| 2704 | `)),F.push({type:"Feature",geometry:{type:"Point",coordinates:O.lonlat},properties:{symbol:R(N),angle:L(N),text:U}})}}return{type:"FeatureCollection",features:F}}function T(M,g){return x.isArrayOrTypedArray(M)?g?function(b){return v(M[b])?+M[b]:0}:function(b){return M[b]}:M?function(){return M}:l}function l(){return""}function _(M){return M[0]===S}function w(M,g){var b;if(x.isArrayOrTypedArray(M)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],M[0]];for(var d=1;d<M.length;d++)b.push(g[d-1],M[d])}else b=M;return b}function A(M){var g=M.textfont,b=g.family,d=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||d==="italic";var R=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?R+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(R="Metropolis",u>850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):y.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):y.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",y[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),f&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=b);var L=R.split(", ");return L}}}),dV=Xe({"src/traces/scattermapbox/plot.js"(Z,G){"use strict";var v=sa(),x=pV(),S=im().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,n){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=n,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var n={type:"geojson",data:o.geojson};a&&a.enabled&&v.extendFlat(n,{cluster:!0,clusterMaxZoom:a.maxzoom});var i=this.subplot.map.getSource(this.sourceIds[r]);i?i.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],n)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var n={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(n.filter=o.filter);for(var i=this.layerIds[r],s,h=this.subplot.getMapLayers(),c=0;c<h.length;c++)if(h[c].id===i){s=!0;break}s?(this.subplot.setOptions(i,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(i,"setPaintProperty",n.paint)):this.subplot.addLayer(n,a)},t.update=function(o){var a=o[0].trace,n=this.subplot,i=n.map,s=x(n.gd,o),h=n.belowLookup["trace-"+this.uid],c=!!(a.cluster&&a.cluster.enabled),m=!!this.clusterEnabled,p=this;function T(u){u||p.addSource("circle",s.circle,a.cluster);for(var y=E.cluster,f=0;f<y.length;f++){var R=y[f],L=s[R];p.addLayer(R,L,h)}}function l(u){for(var y=E.cluster,f=y.length-1;f>=0;f--){var R=y[f];i.removeLayer(p.layerIds[R])}u||i.removeSource(p.sourceIds.circle)}function _(u){for(var y=E.nonCluster,f=0;f<y.length;f++){var R=y[f],L=s[R];u||p.addSource(R,L),p.addLayer(R,L,h)}}function w(u){for(var y=E.nonCluster,f=y.length-1;f>=0;f--){var R=y[f];i.removeLayer(p.layerIds[R]),u||i.removeSource(p.sourceIds[R])}}function A(u){m?l(u):w(u)}function M(u){c?T(u):_(u)}function g(){for(var u=c?E.cluster:E.nonCluster,y=0;y<u.length;y++){var f=u[y],R=s[f];R&&(n.setOptions(p.layerIds[f],"setLayoutProperty",R.layout),R.layout.visibility==="visible"&&(f!=="cluster"&&p.setSourceData(f,R),n.setOptions(p.layerIds[f],"setPaintProperty",R.paint)))}}var b=this.isHidden,d=a.visible!==!0;d?b||A():b?d||M():m!==c?(A(),M()):(this.below!==h&&(A(!0),M(!0)),g()),this.clusterEnabled=c,this.isHidden=d,this.below=h,o[0].trace._glTrace=this},t.dispose=function(){for(var o=this.subplot.map,a=this.clusterEnabled?E.cluster:E.nonCluster,n=a.length-1;n>=0;n--){var i=a[n];o.removeLayer(this.layerIds[i]),o.removeSource(this.sourceIds[i])}},G.exports=function(o,a){var n=a[0].trace,i=n.cluster&&n.cluster.enabled,s=n.visible!==!0,h=new e(o,n.uid,i,s),c=x(o.gd,a),m=h.below=o.belowLookup["trace-"+n.uid],p,T,l;if(i)for(h.addSource("circle",c.circle,n.cluster),p=0;p<E.cluster.length;p++)T=E.cluster[p],l=c[T],h.addLayer(T,l,m);else for(p=0;p<E.nonCluster.length;p++)T=E.nonCluster[p],l=c[T],h.addSource(T,l,n.cluster),h.addLayer(T,l,m);return a[0].trace._glTrace=h,h}}}),ST=Xe({"src/traces/scattermapbox/hover.js"(Z,G){"use strict";var v=rf(),x=sa(),S=l1(),E=x.fillText,e=Hs().BADNUM,t=im().traceLayerPrefix;function r(a,n,i){var s=a.cd,h=s[0].trace,c=a.xa,m=a.ya,p=a.subplot,T=[],l=t+h.uid+"-circle",_=h.cluster&&h.cluster.enabled;if(_){var w=p.map.queryRenderedFeatures(null,{layers:[l]});T=w.map(function(N){return N.id})}var A=n>=0?Math.floor((n+180)/360):Math.ceil((n-180)/360),M=A*360,g=n-M;function b(N){var O=N.lonlat;if(O[0]===e||_&&T.indexOf(N.i+1)===-1)return 1/0;var P=x.modHalf(O[0],360),U=O[1],B=p.project([P,U]),X=B.x-c.c2p([g,U]),$=B.y-m.c2p([P,i]),se=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(X*X+$*$)-se,1-3/se)}if(v.getClosest(s,b,a),a.index!==!1){var d=s[a.index],u=d.lonlat,y=[x.modHalf(u[0],360)+M,u[1]],f=c.c2p(y),R=m.c2p(y),L=d.mrc||1;a.x0=f-L,a.x1=f+L,a.y0=R-L,a.y1=R+L;var z={};z[h.subplot]={_subplot:p};var F=h._module.formatLabels(d,h,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=S(h,d),a.extraText=o(h,d,s[0].t.labels),a.hovertemplate=h.hovertemplate,[a]}}function o(a,n,i){if(a.hovertemplate)return;var s=n.hi||a.hoverinfo,h=s.split("+"),c=h.indexOf("all")!==-1,m=h.indexOf("lon")!==-1,p=h.indexOf("lat")!==-1,T=n.lonlat,l=[];function _(w){return w+"\xB0"}return c||m&&p?l.push("("+_(T[1])+", "+_(T[0])+")"):m?l.push(i.lon+_(T[0])):p&&l.push(i.lat+_(T[1])),(c||h.indexOf("text")!==-1)&&E(n,a,l),l.join("<br>")}G.exports={hoverPoints:r,getExtraText:o}}}),vV=Xe({"src/traces/scattermapbox/event_data.js"(Z,G){"use strict";G.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),mV=Xe({"src/traces/scattermapbox/select.js"(Z,G){"use strict";var v=sa(),x=Fu(),S=Hs().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,n=[],i=r[0].trace,s;if(!x.hasMarkers(i))return[];if(t===!1)for(s=0;s<r.length;s++)r[s].selected=0;else for(s=0;s<r.length;s++){var h=r[s],c=h.lonlat;if(c[0]!==S){var m=[v.modHalf(c[0],360),c[1]],p=[o.c2p(m),a.c2p(m)];t.contains(p,null,s,e)?(n.push({pointNumber:s,lon:c[0],lat:c[1]}),h.selected=1):h.selected=0}}return n}}}),k6=Xe({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(Z,G){(function(v,x){typeof Z=="object"&&typeof G<"u"?G.exports=x():(v=v||self,v.mapboxgl=x())})(Z,function(){"use strict";var v,x,S;function E(e,t){if(!v)v=t;else if(!x)x=t;else{var r="var sharedChunk = {}; ("+v+")(sharedChunk); ("+x+")(sharedChunk);",o={};v(o),S=t(o),typeof window<"u"&&(S.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return E(["exports"],function(e){"use strict";function t(k,C){return C={exports:{}},k(C,C.exports),C.exports}var r="1.13.4",o=a;function a(k,C,H,ne){this.cx=3*k,this.bx=3*(H-k)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*C,this.by=3*(ne-C)-this.cy,this.ay=1-this.cy-this.by,this.p1x=k,this.p1y=ne,this.p2x=H,this.p2y=ne}a.prototype.sampleCurveX=function(k){return((this.ax*k+this.bx)*k+this.cx)*k},a.prototype.sampleCurveY=function(k){return((this.ay*k+this.by)*k+this.cy)*k},a.prototype.sampleCurveDerivativeX=function(k){return(3*this.ax*k+2*this.bx)*k+this.cx},a.prototype.solveCurveX=function(k,C){typeof C>"u"&&(C=1e-6);var H,ne,xe,Re,qe;for(xe=k,qe=0;qe<8;qe++){if(Re=this.sampleCurveX(xe)-k,Math.abs(Re)<C)return xe;var pt=this.sampleCurveDerivativeX(xe);if(Math.abs(pt)<1e-6)break;xe=xe-Re/pt}if(H=0,ne=1,xe=k,xe<H)return H;if(xe>ne)return ne;for(;H<ne;){if(Re=this.sampleCurveX(xe),Math.abs(Re-k)<C)return xe;k>Re?H=xe:ne=xe,xe=(ne-H)*.5+H}return xe},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var n=i;function i(k,C){this.x=k,this.y=C}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},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(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,H=k.y-this.y;return C*C+H*H},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,H=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=H,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),H=Math.sin(k),ne=C*this.x-H*this.y,xe=H*this.x+C*this.y;return this.x=ne,this.y=xe,this},_rotateAround:function(k,C){var H=Math.cos(k),ne=Math.sin(k),xe=C.x+H*(this.x-C.x)-ne*(this.y-C.y),Re=C.y+ne*(this.x-C.x)+H*(this.y-C.y);return this.x=xe,this.y=Re,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},i.convert=function(k){return k instanceof i?k:Array.isArray(k)?new i(k[0],k[1]):k};var s=typeof self<"u"?self:{};function h(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var H=0;H<k.length;H++)if(!h(k[H],C[H]))return!1;return!0}if(typeof k=="object"&&k!==null&&C!==null){if(typeof C!="object")return!1;var ne=Object.keys(k);if(ne.length!==Object.keys(C).length)return!1;for(var xe in k)if(!h(k[xe],C[xe]))return!1;return!0}return k===C}var c=Math.pow(2,53)-1;function m(k){if(k<=0)return 0;if(k>=1)return 1;var C=k*k,H=C*k;return 4*(k<.5?H:3*(k-C)+H-.75)}function p(k,C,H,ne){var xe=new o(k,C,H,ne);return function(Re){return xe.solve(Re)}}var T=p(.25,.1,.25,1);function l(k,C,H){return Math.min(H,Math.max(C,k))}function _(k,C,H){var ne=H-C,xe=((k-C)%ne+ne)%ne+C;return xe===C?H:xe}function w(k,C,H){if(!k.length)return H(null,[]);var ne=k.length,xe=new Array(k.length),Re=null;k.forEach(function(qe,pt){C(qe,function(Dt,Gt){Dt&&(Re=Dt),xe[pt]=Gt,--ne===0&&H(Re,xe)})})}function A(k){var C=[];for(var H in k)C.push(k[H]);return C}function M(k,C){var H=[];for(var ne in k)ne in C||H.push(ne);return H}function g(k){for(var C=[],H=arguments.length-1;H-- >0;)C[H]=arguments[H+1];for(var ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne];for(var qe in Re)k[qe]=Re[qe]}return k}function b(k,C){for(var H={},ne=0;ne<C.length;ne++){var xe=C[ne];xe in k&&(H[xe]=k[xe])}return H}var d=1;function u(){return d++}function y(){function k(C){return C?(C^Math.random()*16>>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function f(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(H){C[H]&&(C[H]=C[H].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,H){var ne={};for(var xe in k)ne[xe]=C.call(H||this,k[xe],xe,k);return ne}function N(k,C,H){var ne={};for(var xe in k)C.call(H||this,k[xe],xe,k)&&(ne[xe]=k[xe]);return ne}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function P(k,C){for(var H=0;H<k.length;H++)if(C.indexOf(k[H])>=0)return!0;return!1}var U={};function B(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function X(k,C,H){return(H.y-k.y)*(C.x-k.x)>(C.y-k.y)*(H.x-k.x)}function $(k){for(var C=0,H=0,ne=k.length,xe=ne-1,Re=void 0,qe=void 0;H<ne;xe=H++)Re=k[H],qe=k[xe],C+=(qe.x-Re.x)*(Re.y+qe.y);return C}function se(k){var C=k[0],H=k[1],ne=k[2];return H+=90,H*=Math.PI/180,ne*=Math.PI/180,{x:C*Math.cos(H)*Math.sin(ne),y:C*Math.sin(H)*Math.sin(ne),z:C*Math.cos(ne)}}function le(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function fe(k){var C=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,H={};if(k.replace(C,function(xe,Re,qe,pt){var Dt=qe||pt;return H[Re]=Dt?Dt.toLowerCase():!0,""}),H["max-age"]){var ne=parseInt(H["max-age"],10);isNaN(ne)?delete H["max-age"]:H["max-age"]=ne}return H}var V=null;function Y(k){if(V==null){var C=k.navigator?k.navigator.userAgent:null;V=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return V}function ee(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function q(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,H){return String.fromCharCode(+("0x"+H))}))}function oe(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ae=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,Q=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,re,ce,be={now:ae,frame:function(C){var H=j(C);return{cancel:function(){return Q(H)}}},getImageData:function(C,H){H===void 0&&(H=0);var ne=s.document.createElement("canvas"),xe=ne.getContext("2d");if(!xe)throw new Error("failed to create canvas 2d context");return ne.width=C.width,ne.height=C.height,xe.drawImage(C,0,0,C.width,C.height),xe.getImageData(-H,-H,C.width+2*H,C.height+2*H)},resolveURL:function(C){return re||(re=s.document.createElement("a")),re.href=C,re.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ce==null&&(ce=s.matchMedia("(prefers-reduced-motion: reduce)")),ce.matches):!1}},Ae={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},De={supported:!1,testSupport:rt},ze,Ze=!1,at,nt=!1;s.document&&(at=s.document.createElement("img"),at.onload=function(){ze&&st(ze),ze=null,nt=!0},at.onerror=function(){Ze=!0,ze=null},at.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function rt(k){Ze||!at||(nt?st(k):ze=k)}function st(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,at),k.isContextLost())return;De.supported=!0}catch{}k.deleteTexture(C),Ze=!0}var Me="01";function ye(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",H="",ne=0;ne<10;ne++)H+=C[Math.floor(Math.random()*62)];var xe=12*60*60*1e3,Re=[k,Me,H].join(""),qe=Date.now()+xe;return{token:Re,tokenExpiresAt:qe}}var he=function(C,H){this._transformRequestFn=C,this._customAccessToken=H,this._createSkuToken()};he.prototype._createSkuToken=function(){var C=ye();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},he.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},he.prototype.transformRequest=function(C,H){return this._transformRequestFn?this._transformRequestFn(C,H)||{url:C}:{url:C}},he.prototype.normalizeStyleURL=function(C,H){if(!Oe(C))return C;var ne=qt(C);return ne.path="/styles/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||H)},he.prototype.normalizeGlyphsURL=function(C,H){if(!Oe(C))return C;var ne=qt(C);return ne.path="/fonts/v1"+ne.path,this._makeAPIURL(ne,this._customAccessToken||H)},he.prototype.normalizeSourceURL=function(C,H){if(!Oe(C))return C;var ne=qt(C);return ne.path="/v4/"+ne.authority+".json",ne.params.push("secure"),this._makeAPIURL(ne,this._customAccessToken||H)},he.prototype.normalizeSpriteURL=function(C,H,ne,xe){var Re=qt(C);return Oe(C)?(Re.path="/styles/v1"+Re.path+"/sprite"+H+ne,this._makeAPIURL(Re,this._customAccessToken||xe)):(Re.path+=""+H+ne,Wt(Re))},he.prototype.normalizeTileURL=function(C,H){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Oe(C))return C;var ne=qt(C),xe=/(\.(png|jpg)\d*)(?=$)/,Re=/^.+\/v4\//,qe=be.devicePixelRatio>=2||H===512?"@2x":"",pt=De.supported?".webp":"$1";ne.path=ne.path.replace(xe,""+qe+pt),ne.path=ne.path.replace(Re,"/"),ne.path="/v4"+ne.path;var Dt=this._customAccessToken||Pt(ne.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&Dt&&this._skuToken&&ne.params.push("sku="+this._skuToken),this._makeAPIURL(ne,Dt)},he.prototype.canonicalizeTileURL=function(C,H){var ne="/v4/",xe=/\.[\w]+$/,Re=qt(C);if(!Re.path.match(/(^\/v4\/)/)||!Re.path.match(xe))return C;var qe="mapbox://tiles/";qe+=Re.path.replace(ne,"");var pt=Re.params;return H&&(pt=pt.filter(function(Dt){return!Dt.match(/^access_token=/)})),pt.length&&(qe+="?"+pt.join("&")),qe},he.prototype.canonicalizeTileset=function(C,H){for(var ne=H?Oe(H):!1,xe=[],Re=0,qe=C.tiles||[];Re<qe.length;Re+=1){var pt=qe[Re];ot(pt)?xe.push(this.canonicalizeTileURL(pt,ne)):xe.push(pt)}return xe},he.prototype._makeAPIURL=function(C,H){var ne="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",xe=qt(Ae.API_URL);if(C.protocol=xe.protocol,C.authority=xe.authority,C.protocol==="http"){var Re=C.params.indexOf("secure");Re>=0&&C.params.splice(Re,1)}if(xe.path!=="/"&&(C.path=""+xe.path+C.path),!Ae.REQUIRE_ACCESS_TOKEN)return Wt(C);if(H=H||Ae.ACCESS_TOKEN,!H)throw new Error("An API access token is required to use Mapbox GL. "+ne);if(H[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+ne);return C.params=C.params.filter(function(qe){return qe.indexOf("access_token")===-1}),C.params.push("access_token="+H),Wt(C)};function Oe(k){return k.indexOf("mapbox:")===0}var tt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ot(k){return tt.test(k)}function Qe(k){return k.indexOf("sku=")>0&&ot(k)}function Pt(k){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C],xe=ne.match(/^access_token=(.*)$/);if(xe)return xe[1]}return null}var It=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function qt(k){var C=k.match(It);if(!C)throw new Error("Unable to parse URL object");return{protocol:C[1],authority:C[2],path:C[3]||"/",params:C[4]?C[4].split("&"):[]}}function Wt(k){var C=k.params.length?"?"+k.params.join("&"):"";return k.protocol+"://"+k.authority+k.path+C}var kr="mapbox.eventData";function mr(k){if(!k)return null;var C=k.split(".");if(!C||C.length!==3)return null;try{var H=JSON.parse(oe(C[1]));return H}catch{return null}}var qr=function(C){this.type=C,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};qr.prototype.getStorageKey=function(C){var H=mr(Ae.ACCESS_TOKEN),ne="";return H&&H.u?ne=q(H.u):ne=Ae.ACCESS_TOKEN||"",C?kr+"."+C+":"+ne:kr+":"+ne},qr.prototype.fetchEventData=function(){var C=ee("localStorage"),H=this.getStorageKey(),ne=this.getStorageKey("uuid");if(C)try{var xe=s.localStorage.getItem(H);xe&&(this.eventData=JSON.parse(xe));var Re=s.localStorage.getItem(ne);Re&&(this.anonId=Re)}catch{B("Unable to read from LocalStorage")}},qr.prototype.saveEventData=function(){var C=ee("localStorage"),H=this.getStorageKey(),ne=this.getStorageKey("uuid");if(C)try{s.localStorage.setItem(ne,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(H,JSON.stringify(this.eventData))}catch{B("Unable to write to LocalStorage")}},qr.prototype.processRequests=function(C){},qr.prototype.postEvent=function(C,H,ne,xe){var Re=this;if(Ae.EVENTS_URL){var qe=qt(Ae.EVENTS_URL);qe.params.push("access_token="+(xe||Ae.ACCESS_TOKEN||""));var pt={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Me,userId:this.anonId},Dt=H?g(pt,H):pt,Gt={url:Wt(qe),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Dt])};this.pendingRequest=ca(Gt,function(tr){Re.pendingRequest=null,ne(tr),Re.saveEventData(),Re.processRequests(xe)})}},qr.prototype.queueRequest=function(C,H){this.queue.push(C),this.processRequests(H)};var Sr=function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(ne,xe,Re,qe){this.skuToken=Re,(Ae.EVENTS_URL&&qe||Ae.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(pt){return Oe(pt)||ot(pt)}))&&this.queueRequest({id:xe,timestamp:Date.now()},qe)},C.prototype.processRequests=function(ne){var xe=this;if(!(this.pendingRequest||this.queue.length===0)){var Re=this.queue.shift(),qe=Re.id,pt=Re.timestamp;qe&&this.success[qe]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=y()),this.postEvent(pt,{skuToken:this.skuToken},function(Dt){Dt||qe&&(xe.success[qe]=!0)},ne))}},C}(qr),Rr=function(k){function C(H){k.call(this,"appUserTurnstile"),this._customAccessToken=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(ne,xe){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(ne)&&ne.some(function(Re){return Oe(Re)||ot(Re)})&&this.queueRequest(Date.now(),xe)},C.prototype.processRequests=function(ne){var xe=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Re=mr(Ae.ACCESS_TOKEN),qe=Re?Re.u:Ae.ACCESS_TOKEN,pt=qe!==this.eventData.tokenU;R(this.anonId)||(this.anonId=y(),pt=!0);var Dt=this.queue.shift();if(this.eventData.lastSuccess){var Gt=new Date(this.eventData.lastSuccess),tr=new Date(Dt),Pr=(Dt-this.eventData.lastSuccess)/(24*60*60*1e3);pt=pt||Pr>=1||Pr<-1||Gt.getDate()!==tr.getDate()}else pt=!0;if(!pt)return this.processRequests();this.postEvent(Dt,{"enabled.telemetry":!1},function(Zr){Zr||(xe.eventData.lastSuccess=Dt,xe.eventData.tokenU=qe)},ne)}},C}(qr),wt=new Rr,Ne=wt.postTurnstileEvent.bind(wt),Ke=new Sr,Te=Ke.postMapLoadEvent.bind(Ke),Ie="mapbox-tiles",Ve=500,Ce=50,Ee=1e3*60*7,Pe;function ft(){s.caches&&!Pe&&(Pe=s.caches.open(Ie))}var ct;function _t(k,C){if(ct===void 0)try{new Response(new ReadableStream),ct=!0}catch{ct=!1}ct?C(k.body):k.blob().then(C)}function Ct(k,C,H){if(ft(),!!Pe){var ne={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(qe,pt){return ne.headers.set(pt,qe)});var xe=fe(C.headers.get("Cache-Control")||"");if(!xe["no-store"]){xe["max-age"]&&ne.headers.set("Expires",new Date(H+xe["max-age"]*1e3).toUTCString());var Re=new Date(ne.headers.get("Expires")).getTime()-H;Re<Ee||_t(C,function(qe){var pt=new s.Response(qe,ne);ft(),Pe&&Pe.then(function(Dt){return Dt.put(ir(k.url),pt)}).catch(function(Dt){return B(Dt.message)})})}}}function ir(k){var C=k.indexOf("?");return C<0?k:k.slice(0,C)}function rr(k,C){if(ft(),!Pe)return C(null);var H=ir(k.url);Pe.then(function(ne){ne.match(H).then(function(xe){var Re=er(xe);ne.delete(H),Re&&ne.put(H,xe.clone()),C(null,xe,Re)}).catch(C)}).catch(C)}function er(k){if(!k)return!1;var C=new Date(k.headers.get("Expires")||0),H=fe(k.headers.get("Cache-Control")||"");return C>Date.now()&&!H["no-cache"]}var Lr=1/0;function fa(k){Lr++,Lr>Ce&&(k.getActor().send("enforceCacheSizeLimit",Ve),Lr=0)}function Da(k){ft(),Pe&&Pe.then(function(C){C.keys().then(function(H){for(var ne=0;ne<H.length-k;ne++)C.delete(H[ne])})})}function Ia(k){var C=s.caches.delete(Ie);k&&C.catch(k).then(function(){return k()})}function qa(k,C){Ve=k,Ce=C}var Wa;function Ca(){return Wa==null&&(Wa=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),Wa}var hi={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(hi);var wi=function(k){function C(H,ne,xe){ne===401&&ot(xe)&&(H+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),k.call(this,H),this.status=ne,this.url=xe,this.name=this.constructor.name,this.message=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},C}(Error),Kt=le()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},Ft=function(k){return/^file:/.test(k)||/^file:/.test(Kt())&&!/^\w+:/.test(k)};function Yt(k,C){var H=new s.AbortController,ne=new s.Request(k.url,{method:k.method||"GET",body:k.body,credentials:k.credentials,headers:k.headers,referrer:Kt(),signal:H.signal}),xe=!1,Re=!1,qe=Qe(ne.url);k.type==="json"&&ne.headers.set("Accept","application/json");var pt=function(Gt,tr,Pr){if(!Re){if(Gt&&Gt.message!=="SecurityError"&&B(Gt),tr&&Pr)return Dt(tr);var Zr=Date.now();s.fetch(ne).then(function(Vr){if(Vr.ok){var ua=qe?Vr.clone():null;return Dt(Vr,ua,Zr)}else return C(new wi(Vr.statusText,Vr.status,k.url))}).catch(function(Vr){Vr.code!==20&&C(new Error(Vr.message))})}},Dt=function(Gt,tr,Pr){(k.type==="arrayBuffer"?Gt.arrayBuffer():k.type==="json"?Gt.json():Gt.text()).then(function(Zr){Re||(tr&&Pr&&Ct(ne,tr,Pr),xe=!0,C(null,Zr,Gt.headers.get("Cache-Control"),Gt.headers.get("Expires")))}).catch(function(Zr){Re||C(new Error(Zr.message))})};return qe?rr(ne,pt):pt(null,null),{cancel:function(){Re=!0,xe||H.abort()}}}function Jt(k,C){var H=new s.XMLHttpRequest;H.open(k.method||"GET",k.url,!0),k.type==="arrayBuffer"&&(H.responseType="arraybuffer");for(var ne in k.headers)H.setRequestHeader(ne,k.headers[ne]);return k.type==="json"&&(H.responseType="text",H.setRequestHeader("Accept","application/json")),H.withCredentials=k.credentials==="include",H.onerror=function(){C(new Error(H.statusText))},H.onload=function(){if((H.status>=200&&H.status<300||H.status===0)&&H.response!==null){var xe=H.response;if(k.type==="json")try{xe=JSON.parse(H.response)}catch(Re){return C(Re)}C(null,xe,H.getResponseHeader("Cache-Control"),H.getResponseHeader("Expires"))}else C(new wi(H.statusText,H.status,k.url))},H.send(k.body),{cancel:function(){return H.abort()}}}var Fr=function(k,C){if(!Ft(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return Yt(k,C);if(le()&&self.worker&&self.worker.actor){var H=!0;return self.worker.actor.send("getResource",k,C,void 0,H)}}return Jt(k,C)},ta=function(k,C){return Fr(g(k,{type:"json"}),C)},ra=function(k,C){return Fr(g(k,{type:"arrayBuffer"}),C)},ca=function(k,C){return Fr(g(k,{method:"POST"}),C)};function Ba(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var $a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Za(k,C,H,ne){var xe=new s.Image,Re=s.URL;xe.onload=function(){C(null,xe),Re.revokeObjectURL(xe.src),xe.onload=null,s.requestAnimationFrame(function(){xe.src=$a})},xe.onerror=function(){return C(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 qe=new s.Blob([new Uint8Array(k)],{type:"image/png"});xe.cacheControl=H,xe.expires=ne,xe.src=k.byteLength?Re.createObjectURL(qe):$a}function ri(k,C){var H=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(H).then(function(ne){C(null,ne)}).catch(function(ne){C(new Error("Could not load image because of "+ne.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var pi,Ra,tn=function(){pi=[],Ra=0};tn();var on=function(k,C){if(De.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Ra>=Ae.MAX_PARALLEL_IMAGE_REQUESTS){var H={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return pi.push(H),H}Ra++;var ne=!1,xe=function(){if(!ne)for(ne=!0,Ra--;pi.length&&Ra<Ae.MAX_PARALLEL_IMAGE_REQUESTS;){var qe=pi.shift(),pt=qe.requestParameters,Dt=qe.callback,Gt=qe.cancelled;Gt||(qe.cancel=on(pt,Dt).cancel)}},Re=ra(k,function(qe,pt,Dt,Gt){xe(),qe?C(qe):pt&&(Ca()?ri(pt,C):Za(pt,C,Dt,Gt))});return{cancel:function(){Re.cancel(),xe()}}},hn=function(k,C){var H=s.document.createElement("video");H.muted=!0,H.onloadstart=function(){C(null,H)};for(var ne=0;ne<k.length;ne++){var xe=s.document.createElement("source");Ba(k[ne])||(H.crossOrigin="Anonymous"),xe.src=k[ne],H.appendChild(xe)}return{cancel:function(){}}};function Tt(k,C,H){var ne=H[k]&&H[k].indexOf(C)!==-1;ne||(H[k]=H[k]||[],H[k].push(C))}function ut(k,C,H){if(H&&H[k]){var ne=H[k].indexOf(C);ne!==-1&&H[k].splice(ne,1)}}var Br=function(C,H){H===void 0&&(H={}),g(this,H),this.type=C},Cr=function(k){function C(H,ne){ne===void 0&&(ne={}),k.call(this,"error",g({error:H},ne))}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Br),xr=function(){};xr.prototype.on=function(C,H){return this._listeners=this._listeners||{},Tt(C,H,this._listeners),this},xr.prototype.off=function(C,H){return ut(C,H,this._listeners),ut(C,H,this._oneTimeListeners),this},xr.prototype.once=function(C,H){return this._oneTimeListeners=this._oneTimeListeners||{},Tt(C,H,this._oneTimeListeners),this},xr.prototype.fire=function(C,H){typeof C=="string"&&(C=new Br(C,H||{}));var ne=C.type;if(this.listens(ne)){C.target=this;for(var xe=this._listeners&&this._listeners[ne]?this._listeners[ne].slice():[],Re=0,qe=xe;Re<qe.length;Re+=1){var pt=qe[Re];pt.call(this,C)}for(var Dt=this._oneTimeListeners&&this._oneTimeListeners[ne]?this._oneTimeListeners[ne].slice():[],Gt=0,tr=Dt;Gt<tr.length;Gt+=1){var Pr=tr[Gt];ut(ne,Pr,this._oneTimeListeners),Pr.call(this,C)}var Zr=this._eventedParent;Zr&&(g(C,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Zr.fire(C))}else C instanceof Cr&&console.error(C.error);return this},xr.prototype.listens=function(C){return this._listeners&&this._listeners[C]&&this._listeners[C].length>0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},xr.prototype.setEventedParent=function(C,H){return this._eventedParent=C,this._eventedParentData=H,this};var Ir=8,Ur={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"}},Hr={"*":{type:"source"}},xt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Xt={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:"*"}},vr={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:"*"}},Or={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:"*"}},ba={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"}},Pa={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"}}},ya={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"}}},la={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"}},Ta=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Ai={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ki={"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"}},Ki={"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"}},_n={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Rn={"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"}},En={"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"}},On={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},no={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},cn={type:"array",value:"*"},lo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Wo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},hs={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Oo={type:"array",value:"*",minimum:1},Wn={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}},No=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],as={"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"}},Ns={"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"}},ss={"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"}},uo={"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"}},jn={"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"}},Xn={"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"}},ls={"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"}},Cs={"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"}},Ks={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Xo={"*":{type:"string"}},Gi={$version:Ir,$root:Ur,sources:Hr,source:xt,source_vector:Xt,source_raster:vr,source_raster_dem:Or,source_geojson:ba,source_video:Pa,source_image:ya,layer:la,layout:Ta,layout_background:Ai,layout_fill:ki,layout_circle:Ki,layout_heatmap:_n,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Rn,layout_symbol:En,layout_raster:On,layout_hillshade:no,filter:cn,filter_operator:lo,geometry_type:Wo,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:hs,expression:Oo,light:Wn,paint:No,paint_fill:as,"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:Ns,paint_circle:ss,paint_heatmap:uo,paint_symbol:jn,paint_raster:Xn,paint_hillshade:ls,paint_background:Cs,transition:Ks,"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:Xo},Ln=function(C,H,ne,xe){this.message=(C?C+": ":"")+ne,xe&&(this.identifier=xe),H!=null&&H.__line__&&(this.line=H.__line__)};function Us(k){var C=k.key,H=k.value;return H?[new Ln(C,H,"constants have been deprecated as of v8")]:[]}function _s(k){for(var C=[],H=arguments.length-1;H-- >0;)C[H]=arguments[H+1];for(var ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne];for(var qe in Re)k[qe]=Re[qe]}return k}function Gn(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function zs(k){if(Array.isArray(k))return k.map(zs);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var H in k)C[H]=zs(k[H]);return C}return Gn(k)}var vs=function(k){function C(H,ne){k.call(this,ne),this.message=ne,this.key=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Error),Ws=function(C,H){H===void 0&&(H=[]),this.parent=C,this.bindings={};for(var ne=0,xe=H;ne<xe.length;ne+=1){var Re=xe[ne],qe=Re[0],pt=Re[1];this.bindings[qe]=pt}};Ws.prototype.concat=function(C){return new Ws(this,C)},Ws.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},Ws.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var il={kind:"null"},xn={kind:"number"},ko={kind:"string"},bo={kind:"boolean"},Is={kind:"color"},pu={kind:"object"},co={kind:"value"},Vs={kind:"error"},vl={kind:"collator"},Ts={kind:"formatted"},js={kind:"resolvedImage"};function us(k,C){return{kind:"array",itemType:k,N:C}}function As(k){if(k.kind==="array"){var C=As(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Nl=[il,xn,ko,bo,Is,Ts,pu,us(co),js];function su(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!su(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var H=0,ne=Nl;H<ne.length;H+=1){var xe=ne[H];if(!su(xe,C))return null}}return"Expected "+As(k)+" but found "+As(C)+" instead."}function Tc(k,C){return C.some(function(H){return H.kind===k.kind})}function du(k,C){return C.some(function(H){return H==="null"?k===null:H==="array"?Array.isArray(k):H==="object"?k&&!Array.isArray(k)&&typeof k=="object":H===typeof k})}var Sf=t(function(k,C){var H={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ne(Gt){return Gt=Math.round(Gt),Gt<0?0:Gt>255?255:Gt}function xe(Gt){return Gt<0?0:Gt>1?1:Gt}function Re(Gt){return Gt[Gt.length-1]==="%"?ne(parseFloat(Gt)/100*255):ne(parseInt(Gt))}function qe(Gt){return Gt[Gt.length-1]==="%"?xe(parseFloat(Gt)/100):xe(parseFloat(Gt))}function pt(Gt,tr,Pr){return Pr<0?Pr+=1:Pr>1&&(Pr-=1),Pr*6<1?Gt+(tr-Gt)*Pr*6:Pr*2<1?tr:Pr*3<2?Gt+(tr-Gt)*(2/3-Pr)*6:Gt}function Dt(Gt){var tr=Gt.replace(/ /g,"").toLowerCase();if(tr in H)return H[tr].slice();if(tr[0]==="#"){if(tr.length===4){var Pr=parseInt(tr.substr(1),16);return Pr>=0&&Pr<=4095?[(Pr&3840)>>4|(Pr&3840)>>8,Pr&240|(Pr&240)>>4,Pr&15|(Pr&15)<<4,1]:null}else if(tr.length===7){var Pr=parseInt(tr.substr(1),16);return Pr>=0&&Pr<=16777215?[(Pr&16711680)>>16,(Pr&65280)>>8,Pr&255,1]:null}return null}var Zr=tr.indexOf("("),Vr=tr.indexOf(")");if(Zr!==-1&&Vr+1===tr.length){var ua=tr.substr(0,Zr),Oa=tr.substr(Zr+1,Vr-(Zr+1)).split(","),Mi=1;switch(ua){case"rgba":if(Oa.length!==4)return null;Mi=qe(Oa.pop());case"rgb":return Oa.length!==3?null:[Re(Oa[0]),Re(Oa[1]),Re(Oa[2]),Mi];case"hsla":if(Oa.length!==4)return null;Mi=qe(Oa.pop());case"hsl":if(Oa.length!==3)return null;var ii=(parseFloat(Oa[0])%360+360)%360/360,$i=qe(Oa[1]),Oi=qe(Oa[2]),Ji=Oi<=.5?Oi*($i+1):Oi+$i-Oi*$i,ln=Oi*2-Ji;return[ne(pt(ln,Ji,ii+1/3)*255),ne(pt(ln,Ji,ii)*255),ne(pt(ln,Ji,ii-1/3)*255),Mi];default:return null}}return null}try{C.parseCSSColor=Dt}catch{}}),Uc=Sf.parseCSSColor,Fs=function(C,H,ne,xe){xe===void 0&&(xe=1),this.r=C,this.g=H,this.b=ne,this.a=xe};Fs.parse=function(C){if(C){if(C instanceof Fs)return C;if(typeof C=="string"){var H=Uc(C);if(H)return new Fs(H[0]/255*H[3],H[1]/255*H[3],H[2]/255*H[3],H[3])}}},Fs.prototype.toString=function(){var C=this.toArray(),H=C[0],ne=C[1],xe=C[2],Re=C[3];return"rgba("+Math.round(H)+","+Math.round(ne)+","+Math.round(xe)+","+Re+")"},Fs.prototype.toArray=function(){var C=this,H=C.r,ne=C.g,xe=C.b,Re=C.a;return Re===0?[0,0,0,0]:[H*255/Re,ne*255/Re,xe*255/Re,Re]},Fs.black=new Fs(0,0,0,1),Fs.white=new Fs(1,1,1,1),Fs.transparent=new Fs(0,0,0,0),Fs.red=new Fs(1,0,0,1);var dc=function(C,H,ne){C?this.sensitivity=H?"variant":"case":this.sensitivity=H?"accent":"base",this.locale=ne,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};dc.prototype.compare=function(C,H){return this.collator.compare(C,H)},dc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Hc=function(C,H,ne,xe,Re){this.text=C,this.image=H,this.scale=ne,this.fontStack=xe,this.textColor=Re},lu=function(C){this.sections=C};lu.fromString=function(C){return new lu([new Hc(C,null,null,null,null)])},lu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},lu.factory=function(C){return C instanceof lu?C:lu.fromString(C)},lu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},lu.prototype.serialize=function(){for(var C=["format"],H=0,ne=this.sections;H<ne.length;H+=1){var xe=ne[H];if(xe.image){C.push(["image",xe.image.name]);continue}C.push(xe.text);var Re={};xe.fontStack&&(Re["text-font"]=["literal",xe.fontStack.split(",")]),xe.scale&&(Re["font-scale"]=xe.scale),xe.textColor&&(Re["text-color"]=["rgba"].concat(xe.textColor.toArray())),C.push(Re)}return C};var Pl=function(C){this.name=C.name,this.available=C.available};Pl.prototype.toString=function(){return this.name},Pl.fromString=function(C){return C?new Pl({name:C,available:!1}):null},Pl.prototype.serialize=function(){return["image",this.name]};function ic(k,C,H,ne){if(!(typeof k=="number"&&k>=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof H=="number"&&H>=0&&H<=255)){var xe=typeof ne=="number"?[k,C,H,ne]:[k,C,H];return"Invalid rgba value ["+xe.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof ne>"u"||typeof ne=="number"&&ne>=0&&ne<=1?null:"Invalid rgba value ["+[k,C,H,ne].join(", ")+"]: 'a' must be between 0 and 1."}function Ou(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof Fs)return!0;if(k instanceof dc)return!0;if(k instanceof lu)return!0;if(k instanceof Pl)return!0;if(Array.isArray(k)){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C];if(!Ou(ne))return!1}return!0}else if(typeof k=="object"){for(var xe in k)if(!Ou(k[xe]))return!1;return!0}else return!1}function nl(k){if(k===null)return il;if(typeof k=="string")return ko;if(typeof k=="boolean")return bo;if(typeof k=="number")return xn;if(k instanceof Fs)return Is;if(k instanceof dc)return vl;if(k instanceof lu)return Ts;if(k instanceof Pl)return js;if(Array.isArray(k)){for(var C=k.length,H,ne=0,xe=k;ne<xe.length;ne+=1){var Re=xe[ne],qe=nl(Re);if(!H)H=qe;else{if(H===qe)continue;H=co;break}}return us(H||co,C)}else return pu}function ml(k){var C=typeof k;return k===null?"":C==="string"||C==="number"||C==="boolean"?String(k):k instanceof Fs||k instanceof lu||k instanceof Pl?k.toString():JSON.stringify(k)}var xs=function(C,H){this.type=C,this.value=H};xs.parse=function(C,H){if(C.length!==2)return H.error("'literal' expression requires exactly one argument, but found "+(C.length-1)+" instead.");if(!Ou(C[1]))return H.error("invalid value");var ne=C[1],xe=nl(ne),Re=H.expectedType;return xe.kind==="array"&&xe.N===0&&Re&&Re.kind==="array"&&(typeof Re.N!="number"||Re.N===0)&&(xe=Re),new xs(xe,ne)},xs.prototype.evaluate=function(){return this.value},xs.prototype.eachChild=function(){},xs.prototype.outputDefined=function(){return!0},xs.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Fs?["rgba"].concat(this.value.toArray()):this.value instanceof lu?this.value.serialize():this.value};var Xs=function(C){this.name="ExpressionEvaluationError",this.message=C};Xs.prototype.toJSON=function(){return this.message};var nc={string:ko,number:xn,boolean:bo,object:pu},Ul=function(C,H){this.type=C,this.args=H};Ul.parse=function(C,H){if(C.length<2)return H.error("Expected at least one argument.");var ne=1,xe,Re=C[0];if(Re==="array"){var qe;if(C.length>2){var pt=C[1];if(typeof pt!="string"||!(pt in nc)||pt==="object")return H.error('The item type argument of "array" must be one of string, number, boolean',1);qe=nc[pt],ne++}else qe=co;var Dt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return H.error('The length argument to "array" must be a positive integer literal',2);Dt=C[2],ne++}xe=us(qe,Dt)}else xe=nc[Re];for(var Gt=[];ne<C.length;ne++){var tr=H.parse(C[ne],ne,co);if(!tr)return null;Gt.push(tr)}return new Ul(xe,Gt)},Ul.prototype.evaluate=function(C){for(var H=0;H<this.args.length;H++){var ne=this.args[H].evaluate(C),xe=su(this.type,nl(ne));if(xe){if(H===this.args.length-1)throw new Xs("Expected value to be of type "+As(this.type)+", but found "+As(nl(ne))+" instead.")}else return ne}return null},Ul.prototype.eachChild=function(C){this.args.forEach(C)},Ul.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},Ul.prototype.serialize=function(){var C=this.type,H=[C.kind];if(C.kind==="array"){var ne=C.itemType;if(ne.kind==="string"||ne.kind==="number"||ne.kind==="boolean"){H.push(ne.kind);var xe=C.N;(typeof xe=="number"||this.args.length>1)&&H.push(xe)}}return H.concat(this.args.map(function(Re){return Re.serialize()}))};var qu=function(C){this.type=Ts,this.sections=C};qu.parse=function(C,H){if(C.length<2)return H.error("Expected at least one argument.");var ne=C[1];if(!Array.isArray(ne)&&typeof ne=="object")return H.error("First argument must be an image or text section.");for(var xe=[],Re=!1,qe=1;qe<=C.length-1;++qe){var pt=C[qe];if(Re&&typeof pt=="object"&&!Array.isArray(pt)){Re=!1;var Dt=null;if(pt["font-scale"]&&(Dt=H.parse(pt["font-scale"],1,xn),!Dt))return null;var Gt=null;if(pt["text-font"]&&(Gt=H.parse(pt["text-font"],1,us(ko)),!Gt))return null;var tr=null;if(pt["text-color"]&&(tr=H.parse(pt["text-color"],1,Is),!tr))return null;var Pr=xe[xe.length-1];Pr.scale=Dt,Pr.font=Gt,Pr.textColor=tr}else{var Zr=H.parse(C[qe],1,co);if(!Zr)return null;var Vr=Zr.type.kind;if(Vr!=="string"&&Vr!=="value"&&Vr!=="null"&&Vr!=="resolvedImage")return H.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Re=!0,xe.push({content:Zr,scale:null,font:null,textColor:null})}}return new qu(xe)},qu.prototype.evaluate=function(C){var H=function(ne){var xe=ne.content.evaluate(C);return nl(xe)===js?new Hc("",xe,null,null,null):new Hc(ml(xe),null,ne.scale?ne.scale.evaluate(C):null,ne.font?ne.font.evaluate(C).join(","):null,ne.textColor?ne.textColor.evaluate(C):null)};return new lu(this.sections.map(H))},qu.prototype.eachChild=function(C){for(var H=0,ne=this.sections;H<ne.length;H+=1){var xe=ne[H];C(xe.content),xe.scale&&C(xe.scale),xe.font&&C(xe.font),xe.textColor&&C(xe.textColor)}},qu.prototype.outputDefined=function(){return!1},qu.prototype.serialize=function(){for(var C=["format"],H=0,ne=this.sections;H<ne.length;H+=1){var xe=ne[H];C.push(xe.content.serialize());var Re={};xe.scale&&(Re["font-scale"]=xe.scale.serialize()),xe.font&&(Re["text-font"]=xe.font.serialize()),xe.textColor&&(Re["text-color"]=xe.textColor.serialize()),C.push(Re)}return C};var fl=function(C){this.type=js,this.input=C};fl.parse=function(C,H){if(C.length!==2)return H.error("Expected two arguments.");var ne=H.parse(C[1],1,ko);return ne?new fl(ne):H.error("No image name provided.")},fl.prototype.evaluate=function(C){var H=this.input.evaluate(C),ne=Pl.fromString(H);return ne&&C.availableImages&&(ne.available=C.availableImages.indexOf(H)>-1),ne},fl.prototype.eachChild=function(C){C(this.input)},fl.prototype.outputDefined=function(){return!1},fl.prototype.serialize=function(){return["image",this.input.serialize()]};var xh={"to-boolean":bo,"to-color":Is,"to-number":xn,"to-string":ko},ns=function(C,H){this.type=C,this.args=H};ns.parse=function(C,H){if(C.length<2)return H.error("Expected at least one argument.");var ne=C[0];if((ne==="to-boolean"||ne==="to-string")&&C.length!==2)return H.error("Expected one argument.");for(var xe=xh[ne],Re=[],qe=1;qe<C.length;qe++){var pt=H.parse(C[qe],qe,co);if(!pt)return null;Re.push(pt)}return new ns(xe,Re)},ns.prototype.evaluate=function(C){if(this.type.kind==="boolean")return!!this.args[0].evaluate(C);if(this.type.kind==="color"){for(var H,ne,xe=0,Re=this.args;xe<Re.length;xe+=1){var qe=Re[xe];if(H=qe.evaluate(C),ne=null,H instanceof Fs)return H;if(typeof H=="string"){var pt=C.parseColor(H);if(pt)return pt}else if(Array.isArray(H)&&(H.length<3||H.length>4?ne="Invalid rbga value "+JSON.stringify(H)+": expected an array containing either three or four numeric values.":ne=ic(H[0],H[1],H[2],H[3]),!ne))return new Fs(H[0]/255,H[1]/255,H[2]/255,H[3])}throw new Xs(ne||"Could not parse color from value '"+(typeof H=="string"?H:String(JSON.stringify(H)))+"'")}else if(this.type.kind==="number"){for(var Dt=null,Gt=0,tr=this.args;Gt<tr.length;Gt+=1){var Pr=tr[Gt];if(Dt=Pr.evaluate(C),Dt===null)return 0;var Zr=Number(Dt);if(!isNaN(Zr))return Zr}throw new Xs("Could not convert "+JSON.stringify(Dt)+" to number.")}else return this.type.kind==="formatted"?lu.fromString(ml(this.args[0].evaluate(C))):this.type.kind==="resolvedImage"?Pl.fromString(ml(this.args[0].evaluate(C))):ml(this.args[0].evaluate(C))},ns.prototype.eachChild=function(C){this.args.forEach(C)},ns.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},ns.prototype.serialize=function(){if(this.type.kind==="formatted")return new qu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new fl(this.args[0]).serialize();var C=["to-"+this.type.kind];return this.eachChild(function(H){C.push(H.serialize())}),C};var bh=["Unknown","Point","LineString","Polygon"],Es=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Es.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Es.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?bh[this.feature.type]:this.feature.type:null},Es.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Es.prototype.canonicalID=function(){return this.canonical},Es.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Es.prototype.parseColor=function(C){var H=this._parseColorCache[C];return H||(H=this._parseColorCache[C]=Fs.parse(C)),H};var to=function(C,H,ne,xe){this.name=C,this.type=H,this._evaluate=ne,this.args=xe};to.prototype.evaluate=function(C){return this._evaluate(C,this.args)},to.prototype.eachChild=function(C){this.args.forEach(C)},to.prototype.outputDefined=function(){return!1},to.prototype.serialize=function(){return[this.name].concat(this.args.map(function(C){return C.serialize()}))},to.parse=function(C,H){var ne,xe=C[0],Re=to.definitions[xe];if(!Re)return H.error('Unknown expression "'+xe+'". If you wanted a literal array, use ["literal", [...]].',0);for(var qe=Array.isArray(Re)?Re[0]:Re.type,pt=Array.isArray(Re)?[[Re[1],Re[2]]]:Re.overloads,Dt=pt.filter(function(Mo){var Po=Mo[0];return!Array.isArray(Po)||Po.length===C.length-1}),Gt=null,tr=0,Pr=Dt;tr<Pr.length;tr+=1){var Zr=Pr[tr],Vr=Zr[0],ua=Zr[1];Gt=new ol(H.registry,H.path,null,H.scope);for(var Oa=[],Mi=!1,ii=1;ii<C.length;ii++){var $i=C[ii],Oi=Array.isArray(Vr)?Vr[ii-1]:Vr.type,Ji=Gt.parse($i,1+Oa.length,Oi);if(!Ji){Mi=!0;break}Oa.push(Ji)}if(!Mi){if(Array.isArray(Vr)&&Vr.length!==Oa.length){Gt.error("Expected "+Vr.length+" arguments, but found "+Oa.length+" instead.");continue}for(var ln=0;ln<Oa.length;ln++){var Tn=Array.isArray(Vr)?Vr[ln]:Vr.type,Vn=Oa[ln];Gt.concat(ln+1).checkSubtype(Tn,Vn.type)}if(Gt.errors.length===0)return new to(xe,qe,ua,Oa)}}if(Dt.length===1)(ne=H.errors).push.apply(ne,Gt.errors);else{for(var Nn=Dt.length?Dt:pt,So=Nn.map(function(Mo){var Po=Mo[0];return Wc(Po)}).join(" | "),oo=[],go=1;go<C.length;go++){var ks=H.parse(C[go],1+oo.length);if(!ks)return null;oo.push(As(ks.type))}H.error("Expected arguments of type "+So+", but found ("+oo.join(", ")+") instead.")}return null},to.register=function(C,H){to.definitions=H;for(var ne in H)C[ne]=to};function Wc(k){return Array.isArray(k)?"("+k.map(As).join(", ")+")":"("+As(k.type)+"...)"}var Vu=function(C,H,ne){this.type=vl,this.locale=ne,this.caseSensitive=C,this.diacriticSensitive=H};Vu.parse=function(C,H){if(C.length!==2)return H.error("Expected one argument.");var ne=C[1];if(typeof ne!="object"||Array.isArray(ne))return H.error("Collator options argument must be an object.");var xe=H.parse(ne["case-sensitive"]===void 0?!1:ne["case-sensitive"],1,bo);if(!xe)return null;var Re=H.parse(ne["diacritic-sensitive"]===void 0?!1:ne["diacritic-sensitive"],1,bo);if(!Re)return null;var qe=null;return ne.locale&&(qe=H.parse(ne.locale,1,ko),!qe)?null:new Vu(xe,Re,qe)},Vu.prototype.evaluate=function(C){return new dc(this.caseSensitive.evaluate(C),this.diacriticSensitive.evaluate(C),this.locale?this.locale.evaluate(C):null)},Vu.prototype.eachChild=function(C){C(this.caseSensitive),C(this.diacriticSensitive),this.locale&&C(this.locale)},Vu.prototype.outputDefined=function(){return!1},Vu.prototype.serialize=function(){var C={};return C["case-sensitive"]=this.caseSensitive.serialize(),C["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(C.locale=this.locale.serialize()),["collator",C]};var jl=8192;function Mf(k,C){k[0]=Math.min(k[0],C[0]),k[1]=Math.min(k[1],C[1]),k[2]=Math.max(k[2],C[0]),k[3]=Math.max(k[3],C[1])}function Ac(k){return(180+k)/360}function nf(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function $l(k,C){return!(k[0]<=C[0]||k[2]>=C[2]||k[1]<=C[1]||k[3]>=C[3])}function Jf(k,C){var H=Ac(k[0]),ne=nf(k[1]),xe=Math.pow(2,C.z);return[Math.round(H*xe*jl),Math.round(ne*xe*jl)]}function Of(k,C,H){var ne=k[0]-C[0],xe=k[1]-C[1],Re=k[0]-H[0],qe=k[1]-H[1];return ne*qe-Re*xe===0&&ne*Re<=0&&xe*qe<=0}function of(k,C,H){return C[1]>k[1]!=H[1]>k[1]&&k[0]<(H[0]-C[0])*(k[1]-C[1])/(H[1]-C[1])+C[0]}function jc(k,C){for(var H=!1,ne=0,xe=C.length;ne<xe;ne++)for(var Re=C[ne],qe=0,pt=Re.length;qe<pt-1;qe++){if(Of(k,Re[qe],Re[qe+1]))return!1;of(k,Re[qe],Re[qe+1])&&(H=!H)}return H}function Bf(k,C){for(var H=0;H<C.length;H++)if(jc(k,C[H]))return!0;return!1}function Nf(k,C){return k[0]*C[1]-k[1]*C[0]}function Gu(k,C,H,ne){var xe=k[0]-H[0],Re=k[1]-H[1],qe=C[0]-H[0],pt=C[1]-H[1],Dt=ne[0]-H[0],Gt=ne[1]-H[1],tr=xe*Gt-Dt*Re,Pr=qe*Gt-Dt*pt;return tr>0&&Pr<0||tr<0&&Pr>0}function Ef(k,C,H,ne){var xe=[C[0]-k[0],C[1]-k[1]],Re=[ne[0]-H[0],ne[1]-H[1]];return Nf(Re,xe)===0?!1:!!(Gu(k,C,H,ne)&&Gu(H,ne,k,C))}function oc(k,C,H){for(var ne=0,xe=H;ne<xe.length;ne+=1)for(var Re=xe[ne],qe=0;qe<Re.length-1;++qe)if(Ef(k,C,Re[qe],Re[qe+1]))return!0;return!1}function Xc(k,C){for(var H=0;H<k.length;++H)if(!jc(k[H],C))return!1;for(var ne=0;ne<k.length-1;++ne)if(oc(k[ne],k[ne+1],C))return!1;return!0}function Ql(k,C){for(var H=0;H<C.length;H++)if(Xc(k,C[H]))return!0;return!1}function qc(k,C,H){for(var ne=[],xe=0;xe<k.length;xe++){for(var Re=[],qe=0;qe<k[xe].length;qe++){var pt=Jf(k[xe][qe],H);Mf(C,pt),Re.push(pt)}ne.push(Re)}return ne}function Sc(k,C,H){for(var ne=[],xe=0;xe<k.length;xe++){var Re=qc(k[xe],C,H);ne.push(Re)}return ne}function Zs(k,C,H,ne){if(k[0]<H[0]||k[0]>H[2]){var xe=ne*.5,Re=k[0]-H[0]>xe?-ne:H[0]-k[0]>xe?ne:0;Re===0&&(Re=k[0]-H[2]>xe?-ne:H[2]-k[0]>xe?ne:0),k[0]+=Re}Mf(C,k)}function kf(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function fh(k,C,H,ne){for(var xe=Math.pow(2,ne.z)*jl,Re=[ne.x*jl,ne.y*jl],qe=[],pt=0,Dt=k;pt<Dt.length;pt+=1)for(var Gt=Dt[pt],tr=0,Pr=Gt;tr<Pr.length;tr+=1){var Zr=Pr[tr],Vr=[Zr.x+Re[0],Zr.y+Re[1]];Zs(Vr,C,H,xe),qe.push(Vr)}return qe}function Uf(k,C,H,ne){for(var xe=Math.pow(2,ne.z)*jl,Re=[ne.x*jl,ne.y*jl],qe=[],pt=0,Dt=k;pt<Dt.length;pt+=1){for(var Gt=Dt[pt],tr=[],Pr=0,Zr=Gt;Pr<Zr.length;Pr+=1){var Vr=Zr[Pr],ua=[Vr.x+Re[0],Vr.y+Re[1]];Mf(C,ua),tr.push(ua)}qe.push(tr)}if(C[2]-C[0]<=xe/2){kf(C);for(var Oa=0,Mi=qe;Oa<Mi.length;Oa+=1)for(var ii=Mi[Oa],$i=0,Oi=ii;$i<Oi.length;$i+=1){var Ji=Oi[$i];Zs(Ji,C,H,xe)}}return qe}function Zc(k,C){var H=[1/0,1/0,-1/0,-1/0],ne=[1/0,1/0,-1/0,-1/0],xe=k.canonicalID();if(C.type==="Polygon"){var Re=qc(C.coordinates,ne,xe),qe=fh(k.geometry(),H,ne,xe);if(!$l(H,ne))return!1;for(var pt=0,Dt=qe;pt<Dt.length;pt+=1){var Gt=Dt[pt];if(!jc(Gt,Re))return!1}}if(C.type==="MultiPolygon"){var tr=Sc(C.coordinates,ne,xe),Pr=fh(k.geometry(),H,ne,xe);if(!$l(H,ne))return!1;for(var Zr=0,Vr=Pr;Zr<Vr.length;Zr+=1){var ua=Vr[Zr];if(!Bf(ua,tr))return!1}}return!0}function $f(k,C){var H=[1/0,1/0,-1/0,-1/0],ne=[1/0,1/0,-1/0,-1/0],xe=k.canonicalID();if(C.type==="Polygon"){var Re=qc(C.coordinates,ne,xe),qe=Uf(k.geometry(),H,ne,xe);if(!$l(H,ne))return!1;for(var pt=0,Dt=qe;pt<Dt.length;pt+=1){var Gt=Dt[pt];if(!Xc(Gt,Re))return!1}}if(C.type==="MultiPolygon"){var tr=Sc(C.coordinates,ne,xe),Pr=Uf(k.geometry(),H,ne,xe);if(!$l(H,ne))return!1;for(var Zr=0,Vr=Pr;Zr<Vr.length;Zr+=1){var ua=Vr[Zr];if(!Ql(ua,tr))return!1}}return!0}var Cu=function(C,H){this.type=bo,this.geojson=C,this.geometries=H};Cu.parse=function(C,H){if(C.length!==2)return H.error("'within' expression requires exactly one argument, but found "+(C.length-1)+" instead.");if(Ou(C[1])){var ne=C[1];if(ne.type==="FeatureCollection")for(var xe=0;xe<ne.features.length;++xe){var Re=ne.features[xe].geometry.type;if(Re==="Polygon"||Re==="MultiPolygon")return new Cu(ne,ne.features[xe].geometry)}else if(ne.type==="Feature"){var qe=ne.geometry.type;if(qe==="Polygon"||qe==="MultiPolygon")return new Cu(ne,ne.geometry)}else if(ne.type==="Polygon"||ne.type==="MultiPolygon")return new Cu(ne,ne)}return H.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Cu.prototype.evaluate=function(C){if(C.geometry()!=null&&C.canonicalID()!=null){if(C.geometryType()==="Point")return Zc(C,this.geometries);if(C.geometryType()==="LineString")return $f(C,this.geometries)}return!1},Cu.prototype.eachChild=function(){},Cu.prototype.outputDefined=function(){return!0},Cu.prototype.serialize=function(){return["within",this.geojson]};function jf(k){if(k instanceof to){if(k.name==="get"&&k.args.length===1)return!1;if(k.name==="feature-state")return!1;if(k.name==="has"&&k.args.length===1)return!1;if(k.name==="properties"||k.name==="geometry-type"||k.name==="id")return!1;if(/^filter-/.test(k.name))return!1}if(k instanceof Cu)return!1;var C=!0;return k.eachChild(function(H){C&&!jf(H)&&(C=!1)}),C}function yl(k){if(k instanceof to&&k.name==="feature-state")return!1;var C=!0;return k.eachChild(function(H){C&&!yl(H)&&(C=!1)}),C}function Lu(k,C){if(k instanceof to&&C.indexOf(k.name)>=0)return!1;var H=!0;return k.eachChild(function(ne){H&&!Lu(ne,C)&&(H=!1)}),H}var Mc=function(C,H){this.type=H.type,this.name=C,this.boundExpression=H};Mc.parse=function(C,H){if(C.length!==2||typeof C[1]!="string")return H.error("'var' expression requires exactly one string literal argument.");var ne=C[1];return H.scope.has(ne)?new Mc(ne,H.scope.get(ne)):H.error('Unknown variable "'+ne+'". Make sure "'+ne+'" has been bound in an enclosing "let" expression before using it.',1)},Mc.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Mc.prototype.eachChild=function(){},Mc.prototype.outputDefined=function(){return!1},Mc.prototype.serialize=function(){return["var",this.name]};var ol=function(C,H,ne,xe,Re){H===void 0&&(H=[]),xe===void 0&&(xe=new Ws),Re===void 0&&(Re=[]),this.registry=C,this.path=H,this.key=H.map(function(qe){return"["+qe+"]"}).join(""),this.scope=xe,this.errors=Re,this.expectedType=ne};ol.prototype.parse=function(C,H,ne,xe,Re){return Re===void 0&&(Re={}),H?this.concat(H,ne,xe)._parse(C,Re):this._parse(C,Re)},ol.prototype._parse=function(C,H){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function ne(tr,Pr,Zr){return Zr==="assert"?new Ul(Pr,[tr]):Zr==="coerce"?new ns(Pr,[tr]):tr}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var xe=C[0];if(typeof xe!="string")return this.error("Expression name must be a string, but found "+typeof xe+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Re=this.registry[xe];if(Re){var qe=Re.parse(C,this);if(!qe)return null;if(this.expectedType){var pt=this.expectedType,Dt=qe.type;if((pt.kind==="string"||pt.kind==="number"||pt.kind==="boolean"||pt.kind==="object"||pt.kind==="array")&&Dt.kind==="value")qe=ne(qe,pt,H.typeAnnotation||"assert");else if((pt.kind==="color"||pt.kind==="formatted"||pt.kind==="resolvedImage")&&(Dt.kind==="value"||Dt.kind==="string"))qe=ne(qe,pt,H.typeAnnotation||"coerce");else if(this.checkSubtype(pt,Dt))return null}if(!(qe instanceof xs)&&qe.type.kind!=="resolvedImage"&&vc(qe)){var Gt=new Es;try{qe=new xs(qe.type,qe.evaluate(Gt))}catch(tr){return this.error(tr.message),null}}return qe}return this.error('Unknown expression "'+xe+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},ol.prototype.concat=function(C,H,ne){var xe=typeof C=="number"?this.path.concat(C):this.path,Re=ne?this.scope.concat(ne):this.scope;return new ol(this.registry,xe,H||null,Re,this.errors)},ol.prototype.error=function(C){for(var H=[],ne=arguments.length-1;ne-- >0;)H[ne]=arguments[ne+1];var xe=""+this.key+H.map(function(Re){return"["+Re+"]"}).join("");this.errors.push(new vs(xe,C))},ol.prototype.checkSubtype=function(C,H){var ne=su(C,H);return ne&&this.error(ne),ne};function vc(k){if(k instanceof Mc)return vc(k.boundExpression);if(k instanceof to&&k.name==="error")return!1;if(k instanceof Vu)return!1;if(k instanceof Cu)return!1;var C=k instanceof ns||k instanceof Ul,H=!0;return k.eachChild(function(ne){C?H=H&&vc(ne):H=H&&ne instanceof xs}),H?jf(k)&&Lu(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function yu(k,C){for(var H=k.length-1,ne=0,xe=H,Re=0,qe,pt;ne<=xe;)if(Re=Math.floor((ne+xe)/2),qe=k[Re],pt=k[Re+1],qe<=C){if(Re===H||C<pt)return Re;ne=Re+1}else if(qe>C)xe=Re-1;else throw new Xs("Input is not a number.");return 0}var Tu=function(C,H,ne){this.type=C,this.input=H,this.labels=[],this.outputs=[];for(var xe=0,Re=ne;xe<Re.length;xe+=1){var qe=Re[xe],pt=qe[0],Dt=qe[1];this.labels.push(pt),this.outputs.push(Dt)}};Tu.parse=function(C,H){if(C.length-1<4)return H.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return H.error("Expected an even number of arguments.");var ne=H.parse(C[1],1,xn);if(!ne)return null;var xe=[],Re=null;H.expectedType&&H.expectedType.kind!=="value"&&(Re=H.expectedType);for(var qe=1;qe<C.length;qe+=2){var pt=qe===1?-1/0:C[qe],Dt=C[qe+1],Gt=qe,tr=qe+1;if(typeof pt!="number")return H.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Gt);if(xe.length&&xe[xe.length-1][0]>=pt)return H.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Gt);var Pr=H.parse(Dt,tr,Re);if(!Pr)return null;Re=Re||Pr.type,xe.push([pt,Pr])}return new Tu(Re,ne,xe)},Tu.prototype.evaluate=function(C){var H=this.labels,ne=this.outputs;if(H.length===1)return ne[0].evaluate(C);var xe=this.input.evaluate(C);if(xe<=H[0])return ne[0].evaluate(C);var Re=H.length;if(xe>=H[Re-1])return ne[Re-1].evaluate(C);var qe=yu(H,xe);return ne[qe].evaluate(C)},Tu.prototype.eachChild=function(C){C(this.input);for(var H=0,ne=this.outputs;H<ne.length;H+=1){var xe=ne[H];C(xe)}},Tu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})},Tu.prototype.serialize=function(){for(var C=["step",this.input.serialize()],H=0;H<this.labels.length;H++)H>0&&C.push(this.labels[H]),C.push(this.outputs[H].serialize());return C};function El(k,C,H){return k*(1-H)+C*H}function qf(k,C,H){return new Fs(El(k.r,C.r,H),El(k.g,C.g,H),El(k.b,C.b,H),El(k.a,C.a,H))}function Qf(k,C,H){return k.map(function(ne,xe){return El(ne,C[xe],H)})}var Bu=Object.freeze({__proto__:null,number:El,color:qf,array:Qf}),Ec=.95047,mc=1,Lh=1.08883,sf=4/29,vf=6/29,Nu=3*vf*vf,lf=vf*vf*vf,au=Math.PI/180,Yc=180/Math.PI;function hh(k){return k>lf?Math.pow(k,1/3):k/Nu+sf}function mf(k){return k>vf?k*k*k:Nu*(k-sf)}function sl(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function _u(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function Pu(k){var C=_u(k.r),H=_u(k.g),ne=_u(k.b),xe=hh((.4124564*C+.3575761*H+.1804375*ne)/Ec),Re=hh((.2126729*C+.7151522*H+.072175*ne)/mc),qe=hh((.0193339*C+.119192*H+.9503041*ne)/Lh);return{l:116*Re-16,a:500*(xe-Re),b:200*(Re-qe),alpha:k.a}}function Cf(k){var C=(k.l+16)/116,H=isNaN(k.a)?C:C+k.a/500,ne=isNaN(k.b)?C:C-k.b/200;return C=mc*mf(C),H=Ec*mf(H),ne=Lh*mf(ne),new Fs(sl(3.2404542*H-1.5371385*C-.4985314*ne),sl(-.969266*H+1.8760108*C+.041556*ne),sl(.0556434*H-.2040259*C+1.0572252*ne),k.alpha)}function hl(k,C,H){return{l:El(k.l,C.l,H),a:El(k.a,C.a,H),b:El(k.b,C.b,H),alpha:El(k.alpha,C.alpha,H)}}function uf(k){var C=Pu(k),H=C.l,ne=C.a,xe=C.b,Re=Math.atan2(xe,ne)*Yc;return{h:Re<0?Re+360:Re,c:Math.sqrt(ne*ne+xe*xe),l:H,alpha:k.a}}function kc(k){var C=k.h*au,H=k.c,ne=k.l;return Cf({l:ne,a:Math.cos(C)*H,b:Math.sin(C)*H,alpha:k.alpha})}function Hu(k,C,H){var ne=C-k;return k+H*(ne>180||ne<-180?ne-360*Math.round(ne/360):ne)}function gf(k,C,H){return{h:Hu(k.h,C.h,H),c:El(k.c,C.c,H),l:El(k.l,C.l,H),alpha:El(k.alpha,C.alpha,H)}}var Wu={forward:Pu,reverse:Cf,interpolate:hl},Kc={forward:uf,reverse:kc,interpolate:gf},Lf=Object.freeze({__proto__:null,lab:Wu,hcl:Kc}),iu=function(C,H,ne,xe,Re){this.type=C,this.operator=H,this.interpolation=ne,this.input=xe,this.labels=[],this.outputs=[];for(var qe=0,pt=Re;qe<pt.length;qe+=1){var Dt=pt[qe],Gt=Dt[0],tr=Dt[1];this.labels.push(Gt),this.outputs.push(tr)}};iu.interpolationFactor=function(C,H,ne,xe){var Re=0;if(C.name==="exponential")Re=Vf(H,C.base,ne,xe);else if(C.name==="linear")Re=Vf(H,1,ne,xe);else if(C.name==="cubic-bezier"){var qe=C.controlPoints,pt=new o(qe[0],qe[1],qe[2],qe[3]);Re=pt.solve(Vf(H,1,ne,xe))}return Re},iu.parse=function(C,H){var ne=C[0],xe=C[1],Re=C[2],qe=C.slice(3);if(!Array.isArray(xe)||xe.length===0)return H.error("Expected an interpolation type expression.",1);if(xe[0]==="linear")xe={name:"linear"};else if(xe[0]==="exponential"){var pt=xe[1];if(typeof pt!="number")return H.error("Exponential interpolation requires a numeric base.",1,1);xe={name:"exponential",base:pt}}else if(xe[0]==="cubic-bezier"){var Dt=xe.slice(1);if(Dt.length!==4||Dt.some(function(ii){return typeof ii!="number"||ii<0||ii>1}))return H.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);xe={name:"cubic-bezier",controlPoints:Dt}}else return H.error("Unknown interpolation type "+String(xe[0]),1,0);if(C.length-1<4)return H.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return H.error("Expected an even number of arguments.");if(Re=H.parse(Re,2,xn),!Re)return null;var Gt=[],tr=null;ne==="interpolate-hcl"||ne==="interpolate-lab"?tr=Is:H.expectedType&&H.expectedType.kind!=="value"&&(tr=H.expectedType);for(var Pr=0;Pr<qe.length;Pr+=2){var Zr=qe[Pr],Vr=qe[Pr+1],ua=Pr+3,Oa=Pr+4;if(typeof Zr!="number")return H.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',ua);if(Gt.length&&Gt[Gt.length-1][0]>=Zr)return H.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ua);var Mi=H.parse(Vr,Oa,tr);if(!Mi)return null;tr=tr||Mi.type,Gt.push([Zr,Mi])}return tr.kind!=="number"&&tr.kind!=="color"&&!(tr.kind==="array"&&tr.itemType.kind==="number"&&typeof tr.N=="number")?H.error("Type "+As(tr)+" is not interpolatable."):new iu(tr,ne,xe,Re,Gt)},iu.prototype.evaluate=function(C){var H=this.labels,ne=this.outputs;if(H.length===1)return ne[0].evaluate(C);var xe=this.input.evaluate(C);if(xe<=H[0])return ne[0].evaluate(C);var Re=H.length;if(xe>=H[Re-1])return ne[Re-1].evaluate(C);var qe=yu(H,xe),pt=H[qe],Dt=H[qe+1],Gt=iu.interpolationFactor(this.interpolation,xe,pt,Dt),tr=ne[qe].evaluate(C),Pr=ne[qe+1].evaluate(C);return this.operator==="interpolate"?Bu[this.type.kind.toLowerCase()](tr,Pr,Gt):this.operator==="interpolate-hcl"?Kc.reverse(Kc.interpolate(Kc.forward(tr),Kc.forward(Pr),Gt)):Wu.reverse(Wu.interpolate(Wu.forward(tr),Wu.forward(Pr),Gt))},iu.prototype.eachChild=function(C){C(this.input);for(var H=0,ne=this.outputs;H<ne.length;H+=1){var xe=ne[H];C(xe)}},iu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})},iu.prototype.serialize=function(){var C;this.interpolation.name==="linear"?C=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?C=["linear"]:C=["exponential",this.interpolation.base]:C=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var H=[this.operator,C,this.input.serialize()],ne=0;ne<this.labels.length;ne++)H.push(this.labels[ne],this.outputs[ne].serialize());return H};function Vf(k,C,H,ne){var xe=ne-H,Re=k-H;return xe===0?0:C===1?Re/xe:(Math.pow(C,Re)-1)/(Math.pow(C,xe)-1)}var Xu=function(C,H){this.type=C,this.args=H};Xu.parse=function(C,H){if(C.length<2)return H.error("Expectected at least one argument.");var ne=null,xe=H.expectedType;xe&&xe.kind!=="value"&&(ne=xe);for(var Re=[],qe=0,pt=C.slice(1);qe<pt.length;qe+=1){var Dt=pt[qe],Gt=H.parse(Dt,1+Re.length,ne,void 0,{typeAnnotation:"omit"});if(!Gt)return null;ne=ne||Gt.type,Re.push(Gt)}var tr=xe&&Re.some(function(Pr){return su(xe,Pr.type)});return tr?new Xu(co,Re):new Xu(ne,Re)},Xu.prototype.evaluate=function(C){for(var H=null,ne=0,xe,Re=0,qe=this.args;Re<qe.length;Re+=1){var pt=qe[Re];if(ne++,H=pt.evaluate(C),H&&H instanceof Pl&&!H.available&&(xe||(xe=H.name),H=null,ne===this.args.length&&(H=xe)),H!==null)break}return H},Xu.prototype.eachChild=function(C){this.args.forEach(C)},Xu.prototype.outputDefined=function(){return this.args.every(function(C){return C.outputDefined()})},Xu.prototype.serialize=function(){var C=["coalesce"];return this.eachChild(function(H){C.push(H.serialize())}),C};var Cc=function(C,H){this.type=H.type,this.bindings=[].concat(C),this.result=H};Cc.prototype.evaluate=function(C){return this.result.evaluate(C)},Cc.prototype.eachChild=function(C){for(var H=0,ne=this.bindings;H<ne.length;H+=1){var xe=ne[H];C(xe[1])}C(this.result)},Cc.parse=function(C,H){if(C.length<4)return H.error("Expected at least 3 arguments, but found "+(C.length-1)+" instead.");for(var ne=[],xe=1;xe<C.length-1;xe+=2){var Re=C[xe];if(typeof Re!="string")return H.error("Expected string, but found "+typeof Re+" instead.",xe);if(/[^a-zA-Z0-9_]/.test(Re))return H.error("Variable names must contain only alphanumeric characters or '_'.",xe);var qe=H.parse(C[xe+1],xe+1);if(!qe)return null;ne.push([Re,qe])}var pt=H.parse(C[C.length-1],C.length-1,H.expectedType,ne);return pt?new Cc(ne,pt):null},Cc.prototype.outputDefined=function(){return this.result.outputDefined()},Cc.prototype.serialize=function(){for(var C=["let"],H=0,ne=this.bindings;H<ne.length;H+=1){var xe=ne[H],Re=xe[0],qe=xe[1];C.push(Re,qe.serialize())}return C.push(this.result.serialize()),C};var gc=function(C,H,ne){this.type=C,this.index=H,this.input=ne};gc.parse=function(C,H){if(C.length!==3)return H.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var ne=H.parse(C[1],1,xn),xe=H.parse(C[2],2,us(H.expectedType||co));if(!ne||!xe)return null;var Re=xe.type;return new gc(Re.itemType,ne,xe)},gc.prototype.evaluate=function(C){var H=this.index.evaluate(C),ne=this.input.evaluate(C);if(H<0)throw new Xs("Array index out of bounds: "+H+" < 0.");if(H>=ne.length)throw new Xs("Array index out of bounds: "+H+" > "+(ne.length-1)+".");if(H!==Math.floor(H))throw new Xs("Array index must be an integer, but found "+H+" instead.");return ne[H]},gc.prototype.eachChild=function(C){C(this.index),C(this.input)},gc.prototype.outputDefined=function(){return!1},gc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ql=function(C,H){this.type=bo,this.needle=C,this.haystack=H};ql.parse=function(C,H){if(C.length!==3)return H.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var ne=H.parse(C[1],1,co),xe=H.parse(C[2],2,co);return!ne||!xe?null:Tc(ne.type,[bo,ko,xn,il,co])?new ql(ne,xe):H.error("Expected first argument to be of type boolean, string, number or null, but found "+As(ne.type)+" instead")},ql.prototype.evaluate=function(C){var H=this.needle.evaluate(C),ne=this.haystack.evaluate(C);if(!ne)return!1;if(!du(H,["boolean","string","number","null"]))throw new Xs("Expected first argument to be of type boolean, string, number or null, but found "+As(nl(H))+" instead.");if(!du(ne,["string","array"]))throw new Xs("Expected second argument to be of type array or string, but found "+As(nl(ne))+" instead.");return ne.indexOf(H)>=0},ql.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},ql.prototype.outputDefined=function(){return!0},ql.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var xu=function(C,H,ne){this.type=xn,this.needle=C,this.haystack=H,this.fromIndex=ne};xu.parse=function(C,H){if(C.length<=2||C.length>=5)return H.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ne=H.parse(C[1],1,co),xe=H.parse(C[2],2,co);if(!ne||!xe)return null;if(!Tc(ne.type,[bo,ko,xn,il,co]))return H.error("Expected first argument to be of type boolean, string, number or null, but found "+As(ne.type)+" instead");if(C.length===4){var Re=H.parse(C[3],3,xn);return Re?new xu(ne,xe,Re):null}else return new xu(ne,xe)},xu.prototype.evaluate=function(C){var H=this.needle.evaluate(C),ne=this.haystack.evaluate(C);if(!du(H,["boolean","string","number","null"]))throw new Xs("Expected first argument to be of type boolean, string, number or null, but found "+As(nl(H))+" instead.");if(!du(ne,["string","array"]))throw new Xs("Expected second argument to be of type array or string, but found "+As(nl(ne))+" instead.");if(this.fromIndex){var xe=this.fromIndex.evaluate(C);return ne.indexOf(H,xe)}return ne.indexOf(H)},xu.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Lc=function(C,H,ne,xe,Re,qe){this.inputType=C,this.type=H,this.input=ne,this.cases=xe,this.outputs=Re,this.otherwise=qe};Lc.parse=function(C,H){if(C.length<5)return H.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return H.error("Expected an even number of arguments.");var ne,xe;H.expectedType&&H.expectedType.kind!=="value"&&(xe=H.expectedType);for(var Re={},qe=[],pt=2;pt<C.length-1;pt+=2){var Dt=C[pt],Gt=C[pt+1];Array.isArray(Dt)||(Dt=[Dt]);var tr=H.concat(pt);if(Dt.length===0)return tr.error("Expected at least one branch label.");for(var Pr=0,Zr=Dt;Pr<Zr.length;Pr+=1){var Vr=Zr[Pr];if(typeof Vr!="number"&&typeof Vr!="string")return tr.error("Branch labels must be numbers or strings.");if(typeof Vr=="number"&&Math.abs(Vr)>Number.MAX_SAFE_INTEGER)return tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Vr=="number"&&Math.floor(Vr)!==Vr)return tr.error("Numeric branch labels must be integer values.");if(!ne)ne=nl(Vr);else if(tr.checkSubtype(ne,nl(Vr)))return null;if(typeof Re[String(Vr)]<"u")return tr.error("Branch labels must be unique.");Re[String(Vr)]=qe.length}var ua=H.parse(Gt,pt,xe);if(!ua)return null;xe=xe||ua.type,qe.push(ua)}var Oa=H.parse(C[1],1,co);if(!Oa)return null;var Mi=H.parse(C[C.length-1],C.length-1,xe);return!Mi||Oa.type.kind!=="value"&&H.concat(1).checkSubtype(ne,Oa.type)?null:new Lc(ne,xe,Oa,Re,qe,Mi)},Lc.prototype.evaluate=function(C){var H=this.input.evaluate(C),ne=nl(H)===this.inputType&&this.outputs[this.cases[H]]||this.otherwise;return ne.evaluate(C)},Lc.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},Lc.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},Lc.prototype.serialize=function(){for(var C=this,H=["match",this.input.serialize()],ne=Object.keys(this.cases).sort(),xe=[],Re={},qe=0,pt=ne;qe<pt.length;qe+=1){var Dt=pt[qe],Gt=Re[this.cases[Dt]];Gt===void 0?(Re[this.cases[Dt]]=xe.length,xe.push([this.cases[Dt],[Dt]])):xe[Gt][1].push(Dt)}for(var tr=function(Oa){return C.inputType.kind==="number"?Number(Oa):Oa},Pr=0,Zr=xe;Pr<Zr.length;Pr+=1){var Vr=Zr[Pr],Gt=Vr[0],ua=Vr[1];ua.length===1?H.push(tr(ua[0])):H.push(ua.map(tr)),H.push(this.outputs[outputIndex$1].serialize())}return H.push(this.otherwise.serialize()),H};var Jc=function(C,H,ne){this.type=C,this.branches=H,this.otherwise=ne};Jc.parse=function(C,H){if(C.length<4)return H.error("Expected at least 3 arguments, but found only "+(C.length-1)+".");if(C.length%2!==0)return H.error("Expected an odd number of arguments.");var ne;H.expectedType&&H.expectedType.kind!=="value"&&(ne=H.expectedType);for(var xe=[],Re=1;Re<C.length-1;Re+=2){var qe=H.parse(C[Re],Re,bo);if(!qe)return null;var pt=H.parse(C[Re+1],Re+1,ne);if(!pt)return null;xe.push([qe,pt]),ne=ne||pt.type}var Dt=H.parse(C[C.length-1],C.length-1,ne);return Dt?new Jc(ne,xe,Dt):null},Jc.prototype.evaluate=function(C){for(var H=0,ne=this.branches;H<ne.length;H+=1){var xe=ne[H],Re=xe[0],qe=xe[1];if(Re.evaluate(C))return qe.evaluate(C)}return this.otherwise.evaluate(C)},Jc.prototype.eachChild=function(C){for(var H=0,ne=this.branches;H<ne.length;H+=1){var xe=ne[H],Re=xe[0],qe=xe[1];C(Re),C(qe)}C(this.otherwise)},Jc.prototype.outputDefined=function(){return this.branches.every(function(C){var H=C[0],ne=C[1];return ne.outputDefined()})&&this.otherwise.outputDefined()},Jc.prototype.serialize=function(){var C=["case"];return this.eachChild(function(H){C.push(H.serialize())}),C};var sc=function(C,H,ne,xe){this.type=C,this.input=H,this.beginIndex=ne,this.endIndex=xe};sc.parse=function(C,H){if(C.length<=2||C.length>=5)return H.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var ne=H.parse(C[1],1,co),xe=H.parse(C[2],2,xn);if(!ne||!xe)return null;if(!Tc(ne.type,[us(co),ko,co]))return H.error("Expected first argument to be of type array or string, but found "+As(ne.type)+" instead");if(C.length===4){var Re=H.parse(C[3],3,xn);return Re?new sc(ne.type,ne,xe,Re):null}else return new sc(ne.type,ne,xe)},sc.prototype.evaluate=function(C){var H=this.input.evaluate(C),ne=this.beginIndex.evaluate(C);if(!du(H,["string","array"]))throw new Xs("Expected first argument to be of type array or string, but found "+As(nl(H))+" instead.");if(this.endIndex){var xe=this.endIndex.evaluate(C);return H.slice(ne,xe)}return H.slice(ne)},sc.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},sc.prototype.outputDefined=function(){return!1},sc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Pc(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Qt(k,C,H){return C===H}function br(k,C,H){return C!==H}function aa(k,C,H){return C<H}function $r(k,C,H){return C>H}function ka(k,C,H){return C<=H}function li(k,C,H){return C>=H}function Ci(k,C,H,ne){return ne.compare(C,H)===0}function Hi(k,C,H,ne){return!Ci(k,C,H,ne)}function Qi(k,C,H,ne){return ne.compare(C,H)<0}function dn(k,C,H,ne){return ne.compare(C,H)>0}function Pi(k,C,H,ne){return ne.compare(C,H)<=0}function Di(k,C,H,ne){return ne.compare(C,H)>=0}function Ni(k,C,H){var ne=k!=="=="&&k!=="!=";return function(){function xe(Re,qe,pt){this.type=bo,this.lhs=Re,this.rhs=qe,this.collator=pt,this.hasUntypedArgument=Re.type.kind==="value"||qe.type.kind==="value"}return xe.parse=function(qe,pt){if(qe.length!==3&&qe.length!==4)return pt.error("Expected two or three arguments.");var Dt=qe[0],Gt=pt.parse(qe[1],1,co);if(!Gt)return null;if(!Pc(Dt,Gt.type))return pt.concat(1).error('"'+Dt+`" comparisons are not supported for type '`+As(Gt.type)+"'.");var tr=pt.parse(qe[2],2,co);if(!tr)return null;if(!Pc(Dt,tr.type))return pt.concat(2).error('"'+Dt+`" comparisons are not supported for type '`+As(tr.type)+"'.");if(Gt.type.kind!==tr.type.kind&&Gt.type.kind!=="value"&&tr.type.kind!=="value")return pt.error("Cannot compare types '"+As(Gt.type)+"' and '"+As(tr.type)+"'.");ne&&(Gt.type.kind==="value"&&tr.type.kind!=="value"?Gt=new Ul(tr.type,[Gt]):Gt.type.kind!=="value"&&tr.type.kind==="value"&&(tr=new Ul(Gt.type,[tr])));var Pr=null;if(qe.length===4){if(Gt.type.kind!=="string"&&tr.type.kind!=="string"&&Gt.type.kind!=="value"&&tr.type.kind!=="value")return pt.error("Cannot use collator to compare non-string types.");if(Pr=pt.parse(qe[3],3,vl),!Pr)return null}return new xe(Gt,tr,Pr)},xe.prototype.evaluate=function(qe){var pt=this.lhs.evaluate(qe),Dt=this.rhs.evaluate(qe);if(ne&&this.hasUntypedArgument){var Gt=nl(pt),tr=nl(Dt);if(Gt.kind!==tr.kind||!(Gt.kind==="string"||Gt.kind==="number"))throw new Xs('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Gt.kind+", "+tr.kind+") instead.")}if(this.collator&&!ne&&this.hasUntypedArgument){var Pr=nl(pt),Zr=nl(Dt);if(Pr.kind!=="string"||Zr.kind!=="string")return C(qe,pt,Dt)}return this.collator?H(qe,pt,Dt,this.collator.evaluate(qe)):C(qe,pt,Dt)},xe.prototype.eachChild=function(qe){qe(this.lhs),qe(this.rhs),this.collator&&qe(this.collator)},xe.prototype.outputDefined=function(){return!0},xe.prototype.serialize=function(){var qe=[k];return this.eachChild(function(pt){qe.push(pt.serialize())}),qe},xe}()}var mi=Ni("==",Qt,Ci),Mn=Ni("!=",br,Hi),Qn=Ni("<",aa,Qi),ao=Ni(">",$r,dn),eo=Ni("<=",ka,Pi),fo=Ni(">=",li,Di),An=function(C,H,ne,xe,Re){this.type=ko,this.number=C,this.locale=H,this.currency=ne,this.minFractionDigits=xe,this.maxFractionDigits=Re};An.parse=function(C,H){if(C.length!==3)return H.error("Expected two arguments.");var ne=H.parse(C[1],1,xn);if(!ne)return null;var xe=C[2];if(typeof xe!="object"||Array.isArray(xe))return H.error("NumberFormat options argument must be an object.");var Re=null;if(xe.locale&&(Re=H.parse(xe.locale,1,ko),!Re))return null;var qe=null;if(xe.currency&&(qe=H.parse(xe.currency,1,ko),!qe))return null;var pt=null;if(xe["min-fraction-digits"]&&(pt=H.parse(xe["min-fraction-digits"],1,xn),!pt))return null;var Dt=null;return xe["max-fraction-digits"]&&(Dt=H.parse(xe["max-fraction-digits"],1,xn),!Dt)?null:new An(ne,Re,qe,pt,Dt)},An.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},An.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var un=function(C){this.type=xn,this.input=C};un.parse=function(C,H){if(C.length!==2)return H.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var ne=H.parse(C[1],1);return ne?ne.type.kind!=="array"&&ne.type.kind!=="string"&&ne.type.kind!=="value"?H.error("Expected argument of type string or array, but found "+As(ne.type)+" instead."):new un(ne):null},un.prototype.evaluate=function(C){var H=this.input.evaluate(C);if(typeof H=="string")return H.length;if(Array.isArray(H))return H.length;throw new Xs("Expected value to be of type string or array, but found "+As(nl(H))+" instead.")},un.prototype.eachChild=function(C){C(this.input)},un.prototype.outputDefined=function(){return!1},un.prototype.serialize=function(){var C=["length"];return this.eachChild(function(H){C.push(H.serialize())}),C};var yo={"==":mi,"!=":Mn,">":ao,"<":Qn,">=":fo,"<=":eo,array:Ul,at:gc,boolean:Ul,case:Jc,coalesce:Xu,collator:Vu,format:qu,image:fl,in:ql,"index-of":xu,interpolate:iu,"interpolate-hcl":iu,"interpolate-lab":iu,length:un,let:Cc,literal:xs,match:Lc,number:Ul,"number-format":An,object:Ul,slice:sc,step:Tu,string:Ul,"to-boolean":ns,"to-color":ns,"to-number":ns,"to-string":ns,var:Mc,within:Cu};function Ko(k,C){var H=C[0],ne=C[1],xe=C[2],Re=C[3];H=H.evaluate(k),ne=ne.evaluate(k),xe=xe.evaluate(k);var qe=Re?Re.evaluate(k):1,pt=ic(H,ne,xe,qe);if(pt)throw new Xs(pt);return new Fs(H/255*qe,ne/255*qe,xe/255*qe,qe)}function Ss(k,C){return k in C}function rl(k,C){var H=C[k];return typeof H>"u"?null:H}function Os(k,C,H,ne){for(;H<=ne;){var xe=H+ne>>1;if(C[xe]===k)return!0;C[xe]>k?ne=xe-1:H=xe+1}return!1}function el(k){return{type:k}}to.register(yo,{error:[Vs,[ko],function(k,C){var H=C[0];throw new Xs(H.evaluate(k))}],typeof:[ko,[co],function(k,C){var H=C[0];return As(nl(H.evaluate(k)))}],"to-rgba":[us(xn,4),[Is],function(k,C){var H=C[0];return H.evaluate(k).toArray()}],rgb:[Is,[xn,xn,xn],Ko],rgba:[Is,[xn,xn,xn,xn],Ko],has:{type:bo,overloads:[[[ko],function(k,C){var H=C[0];return Ss(H.evaluate(k),k.properties())}],[[ko,pu],function(k,C){var H=C[0],ne=C[1];return Ss(H.evaluate(k),ne.evaluate(k))}]]},get:{type:co,overloads:[[[ko],function(k,C){var H=C[0];return rl(H.evaluate(k),k.properties())}],[[ko,pu],function(k,C){var H=C[0],ne=C[1];return rl(H.evaluate(k),ne.evaluate(k))}]]},"feature-state":[co,[ko],function(k,C){var H=C[0];return rl(H.evaluate(k),k.featureState||{})}],properties:[pu,[],function(k){return k.properties()}],"geometry-type":[ko,[],function(k){return k.geometryType()}],id:[co,[],function(k){return k.id()}],zoom:[xn,[],function(k){return k.globals.zoom}],"heatmap-density":[xn,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[xn,[],function(k){return k.globals.lineProgress||0}],accumulated:[co,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[xn,el(xn),function(k,C){for(var H=0,ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne];H+=Re.evaluate(k)}return H}],"*":[xn,el(xn),function(k,C){for(var H=1,ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne];H*=Re.evaluate(k)}return H}],"-":{type:xn,overloads:[[[xn,xn],function(k,C){var H=C[0],ne=C[1];return H.evaluate(k)-ne.evaluate(k)}],[[xn],function(k,C){var H=C[0];return-H.evaluate(k)}]]},"/":[xn,[xn,xn],function(k,C){var H=C[0],ne=C[1];return H.evaluate(k)/ne.evaluate(k)}],"%":[xn,[xn,xn],function(k,C){var H=C[0],ne=C[1];return H.evaluate(k)%ne.evaluate(k)}],ln2:[xn,[],function(){return Math.LN2}],pi:[xn,[],function(){return Math.PI}],e:[xn,[],function(){return Math.E}],"^":[xn,[xn,xn],function(k,C){var H=C[0],ne=C[1];return Math.pow(H.evaluate(k),ne.evaluate(k))}],sqrt:[xn,[xn],function(k,C){var H=C[0];return Math.sqrt(H.evaluate(k))}],log10:[xn,[xn],function(k,C){var H=C[0];return Math.log(H.evaluate(k))/Math.LN10}],ln:[xn,[xn],function(k,C){var H=C[0];return Math.log(H.evaluate(k))}],log2:[xn,[xn],function(k,C){var H=C[0];return Math.log(H.evaluate(k))/Math.LN2}],sin:[xn,[xn],function(k,C){var H=C[0];return Math.sin(H.evaluate(k))}],cos:[xn,[xn],function(k,C){var H=C[0];return Math.cos(H.evaluate(k))}],tan:[xn,[xn],function(k,C){var H=C[0];return Math.tan(H.evaluate(k))}],asin:[xn,[xn],function(k,C){var H=C[0];return Math.asin(H.evaluate(k))}],acos:[xn,[xn],function(k,C){var H=C[0];return Math.acos(H.evaluate(k))}],atan:[xn,[xn],function(k,C){var H=C[0];return Math.atan(H.evaluate(k))}],min:[xn,el(xn),function(k,C){return Math.min.apply(Math,C.map(function(H){return H.evaluate(k)}))}],max:[xn,el(xn),function(k,C){return Math.max.apply(Math,C.map(function(H){return H.evaluate(k)}))}],abs:[xn,[xn],function(k,C){var H=C[0];return Math.abs(H.evaluate(k))}],round:[xn,[xn],function(k,C){var H=C[0],ne=H.evaluate(k);return ne<0?-Math.round(-ne):Math.round(ne)}],floor:[xn,[xn],function(k,C){var H=C[0];return Math.floor(H.evaluate(k))}],ceil:[xn,[xn],function(k,C){var H=C[0];return Math.ceil(H.evaluate(k))}],"filter-==":[bo,[ko,co],function(k,C){var H=C[0],ne=C[1];return k.properties()[H.value]===ne.value}],"filter-id-==":[bo,[co],function(k,C){var H=C[0];return k.id()===H.value}],"filter-type-==":[bo,[ko],function(k,C){var H=C[0];return k.geometryType()===H.value}],"filter-<":[bo,[ko,co],function(k,C){var H=C[0],ne=C[1],xe=k.properties()[H.value],Re=ne.value;return typeof xe==typeof Re&&xe<Re}],"filter-id-<":[bo,[co],function(k,C){var H=C[0],ne=k.id(),xe=H.value;return typeof ne==typeof xe&&ne<xe}],"filter->":[bo,[ko,co],function(k,C){var H=C[0],ne=C[1],xe=k.properties()[H.value],Re=ne.value;return typeof xe==typeof Re&&xe>Re}],"filter-id->":[bo,[co],function(k,C){var H=C[0],ne=k.id(),xe=H.value;return typeof ne==typeof xe&&ne>xe}],"filter-<=":[bo,[ko,co],function(k,C){var H=C[0],ne=C[1],xe=k.properties()[H.value],Re=ne.value;return typeof xe==typeof Re&&xe<=Re}],"filter-id-<=":[bo,[co],function(k,C){var H=C[0],ne=k.id(),xe=H.value;return typeof ne==typeof xe&&ne<=xe}],"filter->=":[bo,[ko,co],function(k,C){var H=C[0],ne=C[1],xe=k.properties()[H.value],Re=ne.value;return typeof xe==typeof Re&&xe>=Re}],"filter-id->=":[bo,[co],function(k,C){var H=C[0],ne=k.id(),xe=H.value;return typeof ne==typeof xe&&ne>=xe}],"filter-has":[bo,[co],function(k,C){var H=C[0];return H.value in k.properties()}],"filter-has-id":[bo,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[bo,[us(ko)],function(k,C){var H=C[0];return H.value.indexOf(k.geometryType())>=0}],"filter-id-in":[bo,[us(co)],function(k,C){var H=C[0];return H.value.indexOf(k.id())>=0}],"filter-in-small":[bo,[ko,us(co)],function(k,C){var H=C[0],ne=C[1];return ne.value.indexOf(k.properties()[H.value])>=0}],"filter-in-large":[bo,[ko,us(co)],function(k,C){var H=C[0],ne=C[1];return Os(k.properties()[H.value],ne.value,0,ne.value.length-1)}],all:{type:bo,overloads:[[[bo,bo],function(k,C){var H=C[0],ne=C[1];return H.evaluate(k)&&ne.evaluate(k)}],[el(bo),function(k,C){for(var H=0,ne=C;H<ne.length;H+=1){var xe=ne[H];if(!xe.evaluate(k))return!1}return!0}]]},any:{type:bo,overloads:[[[bo,bo],function(k,C){var H=C[0],ne=C[1];return H.evaluate(k)||ne.evaluate(k)}],[el(bo),function(k,C){for(var H=0,ne=C;H<ne.length;H+=1){var xe=ne[H];if(xe.evaluate(k))return!0}return!1}]]},"!":[bo,[bo],function(k,C){var H=C[0];return!H.evaluate(k)}],"is-supported-script":[bo,[ko],function(k,C){var H=C[0],ne=k.globals&&k.globals.isSupportedScript;return ne?ne(H.evaluate(k)):!0}],upcase:[ko,[ko],function(k,C){var H=C[0];return H.evaluate(k).toUpperCase()}],downcase:[ko,[ko],function(k,C){var H=C[0];return H.evaluate(k).toLowerCase()}],concat:[ko,el(co),function(k,C){return C.map(function(H){return ml(H.evaluate(k))}).join("")}],"resolved-locale":[ko,[vl],function(k,C){var H=C[0];return H.evaluate(k).resolvedLocale()}]});function bs(k){return{result:"success",value:k}}function Fl(k){return{result:"error",value:k}}function _l(k){return k["property-type"]==="data-driven"||k["property-type"]==="cross-faded-data-driven"}function ll(k){return!!k.expression&&k.expression.parameters.indexOf("zoom")>-1}function Un(k){return!!k.expression&&k.expression.interpolated}function Lo(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function Js(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function Rs(k){return k}function uu(k,C){var H=C.type==="color",ne=k.stops&&typeof k.stops[0][0]=="object",xe=ne||k.property!==void 0,Re=ne||!xe,qe=k.type||(Un(C)?"exponential":"interval");if(H&&(k=_s({},k),k.stops&&(k.stops=k.stops.map(function(Nn){return[Nn[0],Fs.parse(Nn[1])]})),k.default?k.default=Fs.parse(k.default):k.default=Fs.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Lf[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var pt,Dt,Gt;if(qe==="exponential")pt=bu;else if(qe==="interval")pt=Ic;else if(qe==="categorical"){pt=Zu,Dt=Object.create(null);for(var tr=0,Pr=k.stops;tr<Pr.length;tr+=1){var Zr=Pr[tr];Dt[Zr[0]]=Zr[1]}Gt=typeof k.stops[0][0]}else if(qe==="identity")pt=Rc;else throw new Error('Unknown function type "'+qe+'"');if(ne){for(var Vr={},ua=[],Oa=0;Oa<k.stops.length;Oa++){var Mi=k.stops[Oa],ii=Mi[0].zoom;Vr[ii]===void 0&&(Vr[ii]={zoom:ii,type:k.type,property:k.property,default:k.default,stops:[]},ua.push(ii)),Vr[ii].stops.push([Mi[0].value,Mi[1]])}for(var $i=[],Oi=0,Ji=ua;Oi<Ji.length;Oi+=1){var ln=Ji[Oi];$i.push([Vr[ln].zoom,uu(Vr[ln],C)])}var Tn={name:"linear"};return{kind:"composite",interpolationType:Tn,interpolationFactor:iu.interpolationFactor.bind(void 0,Tn),zoomStops:$i.map(function(Nn){return Nn[0]}),evaluate:function(So,oo){var go=So.zoom;return bu({stops:$i,base:k.base},C,go).evaluate(go,oo)}}}else if(Re){var Vn=qe==="exponential"?{name:"exponential",base:k.base!==void 0?k.base:1}:null;return{kind:"camera",interpolationType:Vn,interpolationFactor:iu.interpolationFactor.bind(void 0,Vn),zoomStops:k.stops.map(function(Nn){return Nn[0]}),evaluate:function(Nn){var So=Nn.zoom;return pt(k,C,So,Dt,Gt)}}}else return{kind:"source",evaluate:function(So,oo){var go=oo&&oo.properties?oo.properties[k.property]:void 0;return go===void 0?Iu(k.default,C.default):pt(k,C,go,Dt,Gt)}}}function Iu(k,C,H){if(k!==void 0)return k;if(C!==void 0)return C;if(H!==void 0)return H}function Zu(k,C,H,ne,xe){var Re=typeof H===xe?ne[H]:void 0;return Iu(Re,k.default,C.default)}function Ic(k,C,H){if(Lo(H)!=="number")return Iu(k.default,C.default);var ne=k.stops.length;if(ne===1||H<=k.stops[0][0])return k.stops[0][1];if(H>=k.stops[ne-1][0])return k.stops[ne-1][1];var xe=yu(k.stops.map(function(Re){return Re[0]}),H);return k.stops[xe][1]}function bu(k,C,H){var ne=k.base!==void 0?k.base:1;if(Lo(H)!=="number")return Iu(k.default,C.default);var xe=k.stops.length;if(xe===1||H<=k.stops[0][0])return k.stops[0][1];if(H>=k.stops[xe-1][0])return k.stops[xe-1][1];var Re=yu(k.stops.map(function(Pr){return Pr[0]}),H),qe=Au(H,ne,k.stops[Re][0],k.stops[Re+1][0]),pt=k.stops[Re][1],Dt=k.stops[Re+1][1],Gt=Bu[C.type]||Rs;if(k.colorSpace&&k.colorSpace!=="rgb"){var tr=Lf[k.colorSpace];Gt=function(Pr,Zr){return tr.reverse(tr.interpolate(tr.forward(Pr),tr.forward(Zr),qe))}}return typeof pt.evaluate=="function"?{evaluate:function(){for(var Zr=[],Vr=arguments.length;Vr--;)Zr[Vr]=arguments[Vr];var ua=pt.evaluate.apply(void 0,Zr),Oa=Dt.evaluate.apply(void 0,Zr);if(!(ua===void 0||Oa===void 0))return Gt(ua,Oa,qe)}}:Gt(pt,Dt,qe)}function Rc(k,C,H){return C.type==="color"?H=Fs.parse(H):C.type==="formatted"?H=lu.fromString(H.toString()):C.type==="resolvedImage"?H=Pl.fromString(H.toString()):Lo(H)!==C.type&&(C.type!=="enum"||!C.values[H])&&(H=void 0),Iu(H,k.default,C.default)}function Au(k,C,H,ne){var xe=ne-H,Re=k-H;return xe===0?0:C===1?Re/xe:(Math.pow(C,Re)-1)/(Math.pow(C,xe)-1)}var yc=function(C,H){this.expression=C,this._warningHistory={},this._evaluator=new Es,this._defaultValue=H?Se(H):null,this._enumValues=H&&H.type==="enum"?H.values:null};yc.prototype.evaluateWithoutErrorHandling=function(C,H,ne,xe,Re,qe){return this._evaluator.globals=C,this._evaluator.feature=H,this._evaluator.featureState=ne,this._evaluator.canonical=xe,this._evaluator.availableImages=Re||null,this._evaluator.formattedSection=qe,this.expression.evaluate(this._evaluator)},yc.prototype.evaluate=function(C,H,ne,xe,Re,qe){this._evaluator.globals=C,this._evaluator.feature=H||null,this._evaluator.featureState=ne||null,this._evaluator.canonical=xe,this._evaluator.availableImages=Re||null,this._evaluator.formattedSection=qe||null;try{var pt=this.expression.evaluate(this._evaluator);if(pt==null||typeof pt=="number"&&pt!==pt)return this._defaultValue;if(this._enumValues&&!(pt in this._enumValues))throw new Xs("Expected value to be one of "+Object.keys(this._enumValues).map(function(Dt){return JSON.stringify(Dt)}).join(", ")+", but found "+JSON.stringify(pt)+" instead.");return pt}catch(Dt){return this._warningHistory[Dt.message]||(this._warningHistory[Dt.message]=!0,typeof console<"u"&&console.warn(Dt.message)),this._defaultValue}};function ho(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in yo}function Ro(k,C){var H=new ol(yo,[],C?we(C):void 0),ne=H.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return ne?bs(new yc(ne,C)):Fl(H.errors)}var Dc=function(C,H){this.kind=C,this._styleExpression=H,this.isStateDependent=C!=="constant"&&!yl(H.expression)};Dc.prototype.evaluateWithoutErrorHandling=function(C,H,ne,xe,Re,qe){return this._styleExpression.evaluateWithoutErrorHandling(C,H,ne,xe,Re,qe)},Dc.prototype.evaluate=function(C,H,ne,xe,Re,qe){return this._styleExpression.evaluate(C,H,ne,xe,Re,qe)};var lc=function(C,H,ne,xe){this.kind=C,this.zoomStops=ne,this._styleExpression=H,this.isStateDependent=C!=="camera"&&!yl(H.expression),this.interpolationType=xe};lc.prototype.evaluateWithoutErrorHandling=function(C,H,ne,xe,Re,qe){return this._styleExpression.evaluateWithoutErrorHandling(C,H,ne,xe,Re,qe)},lc.prototype.evaluate=function(C,H,ne,xe,Re,qe){return this._styleExpression.evaluate(C,H,ne,xe,Re,qe)},lc.prototype.interpolationFactor=function(C,H,ne){return this.interpolationType?iu.interpolationFactor(this.interpolationType,C,H,ne):0};function Yu(k,C){if(k=Ro(k,C),k.result==="error")return k;var H=k.value.expression,ne=jf(H);if(!ne&&!_l(C))return Fl([new vs("","data expressions not supported")]);var xe=Lu(H,["zoom"]);if(!xe&&!ll(C))return Fl([new vs("","zoom expressions not supported")]);var Re=ie(H);if(!Re&&!xe)return Fl([new vs("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Re instanceof vs)return Fl([Re]);if(Re instanceof iu&&!Un(C))return Fl([new vs("",'"interpolate" expressions cannot be used with this property')]);if(!Re)return bs(ne?new Dc("constant",k.value):new Dc("source",k.value));var qe=Re instanceof iu?Re.interpolation:void 0;return bs(ne?new lc("camera",k.value,Re.labels,qe):new lc("composite",k.value,Re.labels,qe))}var Ue=function(C,H){this._parameters=C,this._specification=H,_s(this,uu(this._parameters,this._specification))};Ue.deserialize=function(C){return new Ue(C._parameters,C._specification)},Ue.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function I(k,C){if(Js(k))return new Ue(k,C);if(ho(k)){var H=Yu(k,C);if(H.result==="error")throw new Error(H.value.map(function(xe){return xe.key+": "+xe.message}).join(", "));return H.value}else{var ne=k;return typeof k=="string"&&C.type==="color"&&(ne=Fs.parse(k)),{kind:"constant",evaluate:function(){return ne}}}}function ie(k){var C=null;if(k instanceof Cc)C=ie(k.result);else if(k instanceof Xu)for(var H=0,ne=k.args;H<ne.length;H+=1){var xe=ne[H];if(C=ie(xe),C)break}else(k instanceof Tu||k instanceof iu)&&k.input instanceof to&&k.input.name==="zoom"&&(C=k);return C instanceof vs||k.eachChild(function(Re){var qe=ie(Re);qe instanceof vs?C=qe:!C&&qe?C=new vs("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):C&&qe&&C!==qe&&(C=new vs("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),C}function we(k){var C={color:Is,string:ko,number:xn,enum:ko,boolean:bo,formatted:Ts,resolvedImage:js};return k.type==="array"?us(C[k.value]||co,k.length):C[k.type]}function Se(k){return k.type==="color"&&Js(k.default)?new Fs(0,0,0,0):k.type==="color"?Fs.parse(k.default)||null:k.default===void 0?null:k.default}function Be(k){var C=k.key,H=k.value,ne=k.valueSpec||{},xe=k.objectElementValidators||{},Re=k.style,qe=k.styleSpec,pt=[],Dt=Lo(H);if(Dt!=="object")return[new Ln(C,H,"object expected, "+Dt+" found")];for(var Gt in H){var tr=Gt.split(".")[0],Pr=ne[tr]||ne["*"],Zr=void 0;if(xe[tr])Zr=xe[tr];else if(ne[tr])Zr=Ao;else if(xe["*"])Zr=xe["*"];else if(ne["*"])Zr=Ao;else{pt.push(new Ln(C,H[Gt],'unknown property "'+Gt+'"'));continue}pt=pt.concat(Zr({key:(C&&C+".")+Gt,value:H[Gt],valueSpec:Pr,style:Re,styleSpec:qe,object:H,objectKey:Gt},H))}for(var Vr in ne)xe[Vr]||ne[Vr].required&&ne[Vr].default===void 0&&H[Vr]===void 0&&pt.push(new Ln(C,H,'missing required property "'+Vr+'"'));return pt}function dt(k){var C=k.value,H=k.valueSpec,ne=k.style,xe=k.styleSpec,Re=k.key,qe=k.arrayElementValidator||Ao;if(Lo(C)!=="array")return[new Ln(Re,C,"array expected, "+Lo(C)+" found")];if(H.length&&C.length!==H.length)return[new Ln(Re,C,"array length "+H.length+" expected, length "+C.length+" found")];if(H["min-length"]&&C.length<H["min-length"])return[new Ln(Re,C,"array length at least "+H["min-length"]+" expected, length "+C.length+" found")];var pt={type:H.value,values:H.values};xe.$version<7&&(pt.function=H.function),Lo(H.value)==="object"&&(pt=H.value);for(var Dt=[],Gt=0;Gt<C.length;Gt++)Dt=Dt.concat(qe({array:C,arrayIndex:Gt,value:C[Gt],valueSpec:pt,style:ne,styleSpec:xe,key:Re+"["+Gt+"]"}));return Dt}function St(k){var C=k.key,H=k.value,ne=k.valueSpec,xe=Lo(H);return xe==="number"&&H!==H&&(xe="NaN"),xe!=="number"?[new Ln(C,H,"number expected, "+xe+" found")]:"minimum"in ne&&H<ne.minimum?[new Ln(C,H,H+" is less than the minimum value "+ne.minimum)]:"maximum"in ne&&H>ne.maximum?[new Ln(C,H,H+" is greater than the maximum value "+ne.maximum)]:[]}function Nt(k){var C=k.valueSpec,H=Gn(k.value.type),ne,xe={},Re,qe,pt=H!=="categorical"&&k.value.property===void 0,Dt=!pt,Gt=Lo(k.value.stops)==="array"&&Lo(k.value.stops[0])==="array"&&Lo(k.value.stops[0][0])==="object",tr=Be({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Pr,default:ua}});return H==="identity"&&pt&&tr.push(new Ln(k.key,k.value,'missing required property "property"')),H!=="identity"&&!k.value.stops&&tr.push(new Ln(k.key,k.value,'missing required property "stops"')),H==="exponential"&&k.valueSpec.expression&&!Un(k.valueSpec)&&tr.push(new Ln(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(Dt&&!_l(k.valueSpec)?tr.push(new Ln(k.key,k.value,"property functions not supported")):pt&&!ll(k.valueSpec)&&tr.push(new Ln(k.key,k.value,"zoom functions not supported"))),(H==="categorical"||Gt)&&k.value.property===void 0&&tr.push(new Ln(k.key,k.value,'"property" property is required')),tr;function Pr(Oa){if(H==="identity")return[new Ln(Oa.key,Oa.value,'identity function may not have a "stops" property')];var Mi=[],ii=Oa.value;return Mi=Mi.concat(dt({key:Oa.key,value:ii,valueSpec:Oa.valueSpec,style:Oa.style,styleSpec:Oa.styleSpec,arrayElementValidator:Zr})),Lo(ii)==="array"&&ii.length===0&&Mi.push(new Ln(Oa.key,ii,"array must have at least one stop")),Mi}function Zr(Oa){var Mi=[],ii=Oa.value,$i=Oa.key;if(Lo(ii)!=="array")return[new Ln($i,ii,"array expected, "+Lo(ii)+" found")];if(ii.length!==2)return[new Ln($i,ii,"array length 2 expected, length "+ii.length+" found")];if(Gt){if(Lo(ii[0])!=="object")return[new Ln($i,ii,"object expected, "+Lo(ii[0])+" found")];if(ii[0].zoom===void 0)return[new Ln($i,ii,"object stop key must have zoom")];if(ii[0].value===void 0)return[new Ln($i,ii,"object stop key must have value")];if(qe&&qe>Gn(ii[0].zoom))return[new Ln($i,ii[0].zoom,"stop zoom values must appear in ascending order")];Gn(ii[0].zoom)!==qe&&(qe=Gn(ii[0].zoom),Re=void 0,xe={}),Mi=Mi.concat(Be({key:$i+"[0]",value:ii[0],valueSpec:{zoom:{}},style:Oa.style,styleSpec:Oa.styleSpec,objectElementValidators:{zoom:St,value:Vr}}))}else Mi=Mi.concat(Vr({key:$i+"[0]",value:ii[0],valueSpec:{},style:Oa.style,styleSpec:Oa.styleSpec},ii));return ho(zs(ii[1]))?Mi.concat([new Ln($i+"[1]",ii[1],"expressions are not allowed in function stops.")]):Mi.concat(Ao({key:$i+"[1]",value:ii[1],valueSpec:C,style:Oa.style,styleSpec:Oa.styleSpec}))}function Vr(Oa,Mi){var ii=Lo(Oa.value),$i=Gn(Oa.value),Oi=Oa.value!==null?Oa.value:Mi;if(!ne)ne=ii;else if(ii!==ne)return[new Ln(Oa.key,Oi,ii+" stop domain type must match previous stop domain type "+ne)];if(ii!=="number"&&ii!=="string"&&ii!=="boolean")return[new Ln(Oa.key,Oi,"stop domain value must be a number, string, or boolean")];if(ii!=="number"&&H!=="categorical"){var Ji="number expected, "+ii+" found";return _l(C)&&H===void 0&&(Ji+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ln(Oa.key,Oi,Ji)]}return H==="categorical"&&ii==="number"&&(!isFinite($i)||Math.floor($i)!==$i)?[new Ln(Oa.key,Oi,"integer expected, found "+$i)]:H!=="categorical"&&ii==="number"&&Re!==void 0&&$i<Re?[new Ln(Oa.key,Oi,"stop domain values must appear in ascending order")]:(Re=$i,H==="categorical"&&$i in xe?[new Ln(Oa.key,Oi,"stop domain values must be unique")]:(xe[$i]=!0,[]))}function ua(Oa){return Ao({key:Oa.key,value:Oa.value,valueSpec:C,style:Oa.style,styleSpec:Oa.styleSpec})}}function $t(k){var C=(k.expressionContext==="property"?Yu:Ro)(zs(k.value),k.valueSpec);if(C.result==="error")return C.value.map(function(ne){return new Ln(""+k.key+ne.key,k.value,ne.message)});var H=C.value.expression||C.value._styleExpression.expression;if(k.expressionContext==="property"&&k.propertyKey==="text-font"&&!H.outputDefined())return[new Ln(k.key,k.value,'Invalid data expression for "'+k.propertyKey+'". Output values must be contained as literals within the expression.')];if(k.expressionContext==="property"&&k.propertyType==="layout"&&!yl(H))return[new Ln(k.key,k.value,'"feature-state" data expressions are not supported with layout properties.')];if(k.expressionContext==="filter"&&!yl(H))return[new Ln(k.key,k.value,'"feature-state" data expressions are not supported with filters.')];if(k.expressionContext&&k.expressionContext.indexOf("cluster")===0){if(!Lu(H,["zoom","feature-state"]))return[new Ln(k.key,k.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(k.expressionContext==="cluster-initial"&&!jf(H))return[new Ln(k.key,k.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Tr(k){var C=k.value,H=k.key,ne=Lo(C);return ne!=="boolean"?[new Ln(H,C,"boolean expected, "+ne+" found")]:[]}function Ar(k){var C=k.key,H=k.value,ne=Lo(H);return ne!=="string"?[new Ln(C,H,"color expected, "+ne+" found")]:Uc(H)===null?[new Ln(C,H,'color expected, "'+H+'" found')]:[]}function Kr(k){var C=k.key,H=k.value,ne=k.valueSpec,xe=[];return Array.isArray(ne.values)?ne.values.indexOf(Gn(H))===-1&&xe.push(new Ln(C,H,"expected one of ["+ne.values.join(", ")+"], "+JSON.stringify(H)+" found")):Object.keys(ne.values).indexOf(Gn(H))===-1&&xe.push(new Ln(C,H,"expected one of ["+Object.keys(ne.values).join(", ")+"], "+JSON.stringify(H)+" found")),xe}function na(k){if(k===!0||k===!1)return!0;if(!Array.isArray(k)||k.length===0)return!1;switch(k[0]){case"has":return k.length>=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,H=k.slice(1);C<H.length;C+=1){var ne=H[C];if(!na(ne)&&typeof ne!="boolean")return!1}return!0;default:return!0}}var He={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Je(k){if(k==null)return{filter:function(){return!0},needGeometry:!1};na(k)||(k=Lt(k));var C=Ro(k,He);if(C.result==="error")throw new Error(C.value.map(function(ne){return ne.key+": "+ne.message}).join(", "));var H=vt(k);return{filter:function(ne,xe,Re){return C.value.evaluate(ne,xe,{},Re)},needGeometry:H}}function lt(k,C){return k<C?-1:k>C?1:0}function vt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C<k.length;C++)if(vt(k[C]))return!0;return!1}function Lt(k){if(!k)return!0;var C=k[0];if(k.length<=1)return C!=="any";var H=C==="=="?At(k[1],k[2],"=="):C==="!="?Er(At(k[1],k[2],"==")):C==="<"||C===">"||C==="<="||C===">="?At(k[1],k[2],C):C==="any"?zt(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Lt)):C==="none"?["all"].concat(k.slice(1).map(Lt).map(Er)):C==="in"?cr(k[1],k.slice(2)):C==="!in"?Er(cr(k[1],k.slice(2))):C==="has"?yr(k[1]):C==="!has"?Er(yr(k[1])):C==="within"?k:!0;return H}function At(k,C,H){switch(k){case"$type":return["filter-type-"+H,C];case"$id":return["filter-id-"+H,C];default:return["filter-"+H,k,C]}}function zt(k){return["any"].concat(k.map(Lt))}function cr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(H){return typeof H!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(lt)]]:["filter-in-small",k,["literal",C]]}}function yr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function Er(k){return["!",k]}function jr(k){return na(zs(k.value))?$t(_s({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qr(k)}function Qr(k){var C=k.value,H=k.key;if(Lo(C)!=="array")return[new Ln(H,C,"array expected, "+Lo(C)+" found")];var ne=k.styleSpec,xe,Re=[];if(C.length<1)return[new Ln(H,C,"filter array must have at least 1 element")];switch(Re=Re.concat(Kr({key:H+"[0]",value:C[0],valueSpec:ne.filter_operator,style:k.style,styleSpec:k.styleSpec})),Gn(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Gn(C[1])==="$type"&&Re.push(new Ln(H,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&Re.push(new Ln(H,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(xe=Lo(C[1]),xe!=="string"&&Re.push(new Ln(H+"[1]",C[1],"string expected, "+xe+" found")));for(var qe=2;qe<C.length;qe++)xe=Lo(C[qe]),Gn(C[1])==="$type"?Re=Re.concat(Kr({key:H+"["+qe+"]",value:C[qe],valueSpec:ne.geometry_type,style:k.style,styleSpec:k.styleSpec})):xe!=="string"&&xe!=="number"&&xe!=="boolean"&&Re.push(new Ln(H+"["+qe+"]",C[qe],"string, number, or boolean expected, "+xe+" found"));break;case"any":case"all":case"none":for(var pt=1;pt<C.length;pt++)Re=Re.concat(Qr({key:H+"["+pt+"]",value:C[pt],style:k.style,styleSpec:k.styleSpec}));break;case"has":case"!has":xe=Lo(C[1]),C.length!==2?Re.push(new Ln(H,C,'filter array for "'+C[0]+'" operator must have 2 elements')):xe!=="string"&&Re.push(new Ln(H+"[1]",C[1],"string expected, "+xe+" found"));break;case"within":xe=Lo(C[1]),C.length!==2?Re.push(new Ln(H,C,'filter array for "'+C[0]+'" operator must have 2 elements')):xe!=="object"&&Re.push(new Ln(H+"[1]",C[1],"object expected, "+xe+" found"));break}return Re}function pa(k,C){var H=k.key,ne=k.style,xe=k.styleSpec,Re=k.value,qe=k.objectKey,pt=xe[C+"_"+k.layerType];if(!pt)return[];var Dt=qe.match(/^(.*)-transition$/);if(C==="paint"&&Dt&&pt[Dt[1]]&&pt[Dt[1]].transition)return Ao({key:H,value:Re,valueSpec:xe.transition,style:ne,styleSpec:xe});var Gt=k.valueSpec||pt[qe];if(!Gt)return[new Ln(H,Re,'unknown property "'+qe+'"')];var tr;if(Lo(Re)==="string"&&_l(Gt)&&!Gt.tokens&&(tr=/^{([^}]+)}$/.exec(Re)))return[new Ln(H,Re,'"'+qe+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(tr[1])+" }`.")];var Pr=[];return k.layerType==="symbol"&&(qe==="text-field"&&ne&&!ne.glyphs&&Pr.push(new Ln(H,Re,'use of "text-field" requires a style "glyphs" property')),qe==="text-font"&&Js(zs(Re))&&Gn(Re.type)==="identity"&&Pr.push(new Ln(H,Re,'"text-font" does not support identity functions'))),Pr.concat(Ao({key:k.key,value:Re,valueSpec:Gt,style:ne,styleSpec:xe,expressionContext:"property",propertyType:C,propertyKey:qe}))}function Aa(k){return pa(k,"paint")}function za(k){return pa(k,"layout")}function ci(k){var C=[],H=k.value,ne=k.key,xe=k.style,Re=k.styleSpec;!H.type&&!H.ref&&C.push(new Ln(ne,H,'either "type" or "ref" is required'));var qe=Gn(H.type),pt=Gn(H.ref);if(H.id)for(var Dt=Gn(H.id),Gt=0;Gt<k.arrayIndex;Gt++){var tr=xe.layers[Gt];Gn(tr.id)===Dt&&C.push(new Ln(ne,H.id,'duplicate layer id "'+H.id+'", previously used at line '+tr.id.__line__))}if("ref"in H){["type","source","source-layer","filter","layout"].forEach(function(ua){ua in H&&C.push(new Ln(ne,H[ua],'"'+ua+'" is prohibited for ref layers'))});var Pr;xe.layers.forEach(function(ua){Gn(ua.id)===pt&&(Pr=ua)}),Pr?Pr.ref?C.push(new Ln(ne,H.ref,"ref cannot reference another ref layer")):qe=Gn(Pr.type):C.push(new Ln(ne,H.ref,'ref layer "'+pt+'" not found'))}else if(qe!=="background")if(!H.source)C.push(new Ln(ne,H,'missing required property "source"'));else{var Zr=xe.sources&&xe.sources[H.source],Vr=Zr&&Gn(Zr.type);Zr?Vr==="vector"&&qe==="raster"?C.push(new Ln(ne,H.source,'layer "'+H.id+'" requires a raster source')):Vr==="raster"&&qe!=="raster"?C.push(new Ln(ne,H.source,'layer "'+H.id+'" requires a vector source')):Vr==="vector"&&!H["source-layer"]?C.push(new Ln(ne,H,'layer "'+H.id+'" must specify a "source-layer"')):Vr==="raster-dem"&&qe!=="hillshade"?C.push(new Ln(ne,H.source,"raster-dem source can only be used with layer type 'hillshade'.")):qe==="line"&&H.paint&&H.paint["line-gradient"]&&(Vr!=="geojson"||!Zr.lineMetrics)&&C.push(new Ln(ne,H,'layer "'+H.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):C.push(new Ln(ne,H.source,'source "'+H.source+'" not found'))}return C=C.concat(Be({key:ne,value:H,valueSpec:Re.layer,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Ao({key:ne+".type",value:H.type,valueSpec:Re.layer.type,style:k.style,styleSpec:k.styleSpec,object:H,objectKey:"type"})},filter:jr,layout:function(Oa){return Be({layer:H,key:Oa.key,value:Oa.value,style:Oa.style,styleSpec:Oa.styleSpec,objectElementValidators:{"*":function(ii){return za(_s({layerType:qe},ii))}}})},paint:function(Oa){return Be({layer:H,key:Oa.key,value:Oa.value,style:Oa.style,styleSpec:Oa.styleSpec,objectElementValidators:{"*":function(ii){return Aa(_s({layerType:qe},ii))}}})}}})),C}function Vi(k){var C=k.value,H=k.key,ne=Lo(C);return ne!=="string"?[new Ln(H,C,"string expected, "+ne+" found")]:[]}var ji={promoteId:Sn};function nn(k){var C=k.value,H=k.key,ne=k.styleSpec,xe=k.style;if(!C.type)return[new Ln(H,C,'"type" is required')];var Re=Gn(C.type),qe;switch(Re){case"vector":case"raster":case"raster-dem":return qe=Be({key:H,value:C,valueSpec:ne["source_"+Re.replace("-","_")],style:k.style,styleSpec:ne,objectElementValidators:ji}),qe;case"geojson":if(qe=Be({key:H,value:C,valueSpec:ne.source_geojson,style:xe,styleSpec:ne,objectElementValidators:ji}),C.cluster)for(var pt in C.clusterProperties){var Dt=C.clusterProperties[pt],Gt=Dt[0],tr=Dt[1],Pr=typeof Gt=="string"?[Gt,["accumulated"],["get",pt]]:Gt;qe.push.apply(qe,$t({key:H+"."+pt+".map",value:tr,expressionContext:"cluster-map"})),qe.push.apply(qe,$t({key:H+"."+pt+".reduce",value:Pr,expressionContext:"cluster-reduce"}))}return qe;case"video":return Be({key:H,value:C,valueSpec:ne.source_video,style:xe,styleSpec:ne});case"image":return Be({key:H,value:C,valueSpec:ne.source_image,style:xe,styleSpec:ne});case"canvas":return[new Ln(H,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Kr({key:H+".type",value:C.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:xe,styleSpec:ne})}}function Sn(k){var C=k.key,H=k.value;if(Lo(H)==="string")return Vi({key:C,value:H});var ne=[];for(var xe in H)ne.push.apply(ne,Vi({key:C+"."+xe,value:H[xe]}));return ne}function Kn(k){var C=k.value,H=k.styleSpec,ne=H.light,xe=k.style,Re=[],qe=Lo(C);if(C===void 0)return Re;if(qe!=="object")return Re=Re.concat([new Ln("light",C,"object expected, "+qe+" found")]),Re;for(var pt in C){var Dt=pt.match(/^(.*)-transition$/);Dt&&ne[Dt[1]]&&ne[Dt[1]].transition?Re=Re.concat(Ao({key:pt,value:C[pt],valueSpec:H.transition,style:xe,styleSpec:H})):ne[pt]?Re=Re.concat(Ao({key:pt,value:C[pt],valueSpec:ne[pt],style:xe,styleSpec:H})):Re=Re.concat([new Ln(pt,C[pt],'unknown property "'+pt+'"')])}return Re}function Bn(k){return Vi(k).length===0?[]:$t(k)}function wo(k){return Vi(k).length===0?[]:$t(k)}var is={"*":function(){return[]},array:dt,boolean:Tr,number:St,color:Ar,constants:Us,enum:Kr,filter:jr,function:Nt,layer:ci,object:Be,source:nn,light:Kn,string:Vi,formatted:Bn,resolvedImage:wo};function Ao(k){var C=k.value,H=k.valueSpec,ne=k.styleSpec;if(H.expression&&Js(Gn(C)))return Nt(k);if(H.expression&&ho(zs(C)))return $t(k);if(H.type&&is[H.type])return is[H.type](k);var xe=Be(_s({},k,{valueSpec:H.type?ne[H.type]:H}));return xe}function Zo(k){var C=k.value,H=k.key,ne=Vi(k);return ne.length||(C.indexOf("{fontstack}")===-1&&ne.push(new Ln(H,C,'"glyphs" url must include a "{fontstack}" token')),C.indexOf("{range}")===-1&&ne.push(new Ln(H,C,'"glyphs" url must include a "{range}" token'))),ne}function ps(k,C){C===void 0&&(C=Gi);var H=[];return H=H.concat(Ao({key:"",value:k,valueSpec:C.$root,styleSpec:C,style:k,objectElementValidators:{glyphs:Zo,"*":function(){return[]}}})),k.constants&&(H=H.concat(Us({key:"constants",value:k.constants,style:k,styleSpec:C}))),ul(H)}ps.source=tl(nn),ps.light=tl(Kn),ps.layer=tl(ci),ps.filter=tl(jr),ps.paintProperty=tl(Aa),ps.layoutProperty=tl(za);function ul(k){return[].concat(k).sort(function(C,H){return C.line-H.line})}function tl(k){return function(){for(var C=[],H=arguments.length;H--;)C[H]=arguments[H];return ul(k.apply(this,C))}}var Jo=ps,$o=Jo.light,Il=Jo.paintProperty,eu=Jo.layoutProperty;function Ru(k,C){var H=!1;if(C&&C.length)for(var ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne];k.fire(new Cr(new Error(Re.message))),H=!0}return H}var vu=cu,Tl=3;function cu(k,C,H){var ne=this.cells=[];if(k instanceof ArrayBuffer){this.arrayBuffer=k;var xe=new Int32Array(this.arrayBuffer);k=xe[0],C=xe[1],H=xe[2],this.d=C+2*H;for(var Re=0;Re<this.d*this.d;Re++){var qe=xe[Tl+Re],pt=xe[Tl+Re+1];ne.push(qe===pt?null:xe.subarray(qe,pt))}var Dt=xe[Tl+ne.length],Gt=xe[Tl+ne.length+1];this.keys=xe.subarray(Dt,Gt),this.bboxes=xe.subarray(Gt),this.insert=this._insertReadonly}else{this.d=C+2*H;for(var tr=0;tr<this.d*this.d;tr++)ne.push([]);this.keys=[],this.bboxes=[]}this.n=C,this.extent=k,this.padding=H,this.scale=C/k,this.uid=0;var Pr=H/C*k;this.min=-Pr,this.max=k+Pr}cu.prototype.insert=function(k,C,H,ne,xe){this._forEachCell(C,H,ne,xe,this._insertCell,this.uid++),this.keys.push(k),this.bboxes.push(C),this.bboxes.push(H),this.bboxes.push(ne),this.bboxes.push(xe)},cu.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},cu.prototype._insertCell=function(k,C,H,ne,xe,Re){this.cells[xe].push(Re)},cu.prototype.query=function(k,C,H,ne,xe){var Re=this.min,qe=this.max;if(k<=Re&&C<=Re&&qe<=H&&qe<=ne&&!xe)return Array.prototype.slice.call(this.keys);var pt=[],Dt={};return this._forEachCell(k,C,H,ne,this._queryCell,pt,Dt,xe),pt},cu.prototype._queryCell=function(k,C,H,ne,xe,Re,qe,pt){var Dt=this.cells[xe];if(Dt!==null)for(var Gt=this.keys,tr=this.bboxes,Pr=0;Pr<Dt.length;Pr++){var Zr=Dt[Pr];if(qe[Zr]===void 0){var Vr=Zr*4;(pt?pt(tr[Vr+0],tr[Vr+1],tr[Vr+2],tr[Vr+3]):k<=tr[Vr+2]&&C<=tr[Vr+3]&&H>=tr[Vr+0]&&ne>=tr[Vr+1])?(qe[Zr]=!0,Re.push(Gt[Zr])):qe[Zr]=!1}}},cu.prototype._forEachCell=function(k,C,H,ne,xe,Re,qe,pt){for(var Dt=this._convertToCellCoord(k),Gt=this._convertToCellCoord(C),tr=this._convertToCellCoord(H),Pr=this._convertToCellCoord(ne),Zr=Dt;Zr<=tr;Zr++)for(var Vr=Gt;Vr<=Pr;Vr++){var ua=this.d*Vr+Zr;if(!(pt&&!pt(this._convertFromCellCoord(Zr),this._convertFromCellCoord(Vr),this._convertFromCellCoord(Zr+1),this._convertFromCellCoord(Vr+1)))&&xe.call(this,k,C,H,ne,ua,Re,qe,pt))return}},cu.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},cu.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},cu.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Tl+this.cells.length+1+1,H=0,ne=0;ne<this.cells.length;ne++)H+=this.cells[ne].length;var xe=new Int32Array(C+H+this.keys.length+this.bboxes.length);xe[0]=this.extent,xe[1]=this.n,xe[2]=this.padding;for(var Re=C,qe=0;qe<k.length;qe++){var pt=k[qe];xe[Tl+qe]=Re,xe.set(pt,Re),Re+=pt.length}return xe[Tl+k.length]=Re,xe.set(this.keys,Re),Re+=this.keys.length,xe[Tl+k.length+1]=Re,xe.set(this.bboxes,Re),Re+=this.bboxes.length,xe.buffer};var uc=s.ImageData,Vl=s.ImageBitmap,Gl={};function de(k,C,H){H===void 0&&(H={}),Object.defineProperty(C,"_classRegistryKey",{value:k,writeable:!1}),Gl[k]={klass:C,omit:H.omit||[],shallow:H.shallow||[]}}de("Object",Object),vu.serialize=function(C,H){var ne=C.toArrayBuffer();return H&&H.push(ne),{buffer:ne}},vu.deserialize=function(C){return new vu(C.buffer)},de("Grid",vu),de("Color",Fs),de("Error",Error),de("ResolvedImage",Pl),de("StylePropertyFunction",Ue),de("StyleExpression",yc,{omit:["_evaluator"]}),de("ZoomDependentExpression",lc),de("ZoomConstantExpression",Dc),de("CompoundExpression",to,{omit:["_evaluate"]});for(var Fe in yo)yo[Fe]._classRegistryKey||de("Expression_"+Fe,yo[Fe]);function et(k){return k&&typeof ArrayBuffer<"u"&&(k instanceof ArrayBuffer||k.constructor&&k.constructor.name==="ArrayBuffer")}function mt(k){return Vl&&k instanceof Vl}function bt(k,C){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp)return k;if(et(k)||mt(k))return C&&C.push(k),k;if(ArrayBuffer.isView(k)){var H=k;return C&&C.push(H.buffer),H}if(k instanceof uc)return C&&C.push(k.data.buffer),k;if(Array.isArray(k)){for(var ne=[],xe=0,Re=k;xe<Re.length;xe+=1){var qe=Re[xe];ne.push(bt(qe,C))}return ne}if(typeof k=="object"){var pt=k.constructor,Dt=pt._classRegistryKey;if(!Dt)throw new Error("can't serialize object of unregistered class");var Gt=pt.serialize?pt.serialize(k,C):{};if(!pt.serialize){for(var tr in k)if(k.hasOwnProperty(tr)&&!(Gl[Dt].omit.indexOf(tr)>=0)){var Pr=k[tr];Gt[tr]=Gl[Dt].shallow.indexOf(tr)>=0?Pr:bt(Pr,C)}k instanceof Error&&(Gt.message=k.message)}if(Gt.$name)throw new Error("$name property is reserved for worker serialization logic.");return Dt!=="Object"&&(Gt.$name=Dt),Gt}throw new Error("can't serialize object of type "+typeof k)}function Mt(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||et(k)||mt(k)||ArrayBuffer.isView(k)||k instanceof uc)return k;if(Array.isArray(k))return k.map(Mt);if(typeof k=="object"){var C=k.$name||"Object",H=Gl[C],ne=H.klass;if(!ne)throw new Error("can't deserialize unregistered class "+C);if(ne.deserialize)return ne.deserialize(k);for(var xe=Object.create(ne.prototype),Re=0,qe=Object.keys(k);Re<qe.length;Re+=1){var pt=qe[Re];if(pt!=="$name"){var Dt=k[pt];xe[pt]=Gl[C].shallow.indexOf(pt)>=0?Dt:Mt(Dt)}}return xe}throw new Error("can't deserialize object of type "+typeof k)}var ar=function(){this.first=!0};ar.prototype.update=function(C,H){var ne=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=ne,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=ne,!0):(this.lastFloorZoom>ne?(this.lastIntegerZoom=ne+1,this.lastIntegerZoomTime=H):this.lastFloorZoom<ne&&(this.lastIntegerZoom=ne,this.lastIntegerZoomTime=H),C!==this.lastZoom?(this.lastZoom=C,this.lastFloorZoom=ne,!0):!1)};var Ot={"Latin-1 Supplement":function(k){return k>=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function _r(k){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C];if(da(ne.charCodeAt(0)))return!0}return!1}function Gr(k){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C];if(!Xr(ne.charCodeAt(0)))return!1}return!0}function Xr(k){return!(Ot.Arabic(k)||Ot["Arabic Supplement"](k)||Ot["Arabic Extended-A"](k)||Ot["Arabic Presentation Forms-A"](k)||Ot["Arabic Presentation Forms-B"](k))}function xa(k){return k<11904?!1:!!(Ot["Bopomofo Extended"](k)||Ot.Bopomofo(k)||Ot["CJK Compatibility Forms"](k)||Ot["CJK Compatibility Ideographs"](k)||Ot["CJK Compatibility"](k)||Ot["CJK Radicals Supplement"](k)||Ot["CJK Strokes"](k)||Ot["CJK Symbols and Punctuation"](k)||Ot["CJK Unified Ideographs Extension A"](k)||Ot["CJK Unified Ideographs"](k)||Ot["Enclosed CJK Letters and Months"](k)||Ot["Halfwidth and Fullwidth Forms"](k)||Ot.Hiragana(k)||Ot["Ideographic Description Characters"](k)||Ot["Kangxi Radicals"](k)||Ot["Katakana Phonetic Extensions"](k)||Ot.Katakana(k)||Ot["Vertical Forms"](k)||Ot["Yi Radicals"](k)||Ot["Yi Syllables"](k))}function da(k){return k===746||k===747?!0:k<4352?!1:!!(Ot["Bopomofo Extended"](k)||Ot.Bopomofo(k)||Ot["CJK Compatibility Forms"](k)&&!(k>=65097&&k<=65103)||Ot["CJK Compatibility Ideographs"](k)||Ot["CJK Compatibility"](k)||Ot["CJK Radicals Supplement"](k)||Ot["CJK Strokes"](k)||Ot["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||Ot["CJK Unified Ideographs Extension A"](k)||Ot["CJK Unified Ideographs"](k)||Ot["Enclosed CJK Letters and Months"](k)||Ot["Hangul Compatibility Jamo"](k)||Ot["Hangul Jamo Extended-A"](k)||Ot["Hangul Jamo Extended-B"](k)||Ot["Hangul Jamo"](k)||Ot["Hangul Syllables"](k)||Ot.Hiragana(k)||Ot["Ideographic Description Characters"](k)||Ot.Kanbun(k)||Ot["Kangxi Radicals"](k)||Ot["Katakana Phonetic Extensions"](k)||Ot.Katakana(k)&&k!==12540||Ot["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||Ot["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||Ot["Unified Canadian Aboriginal Syllabics"](k)||Ot["Unified Canadian Aboriginal Syllabics Extended"](k)||Ot["Vertical Forms"](k)||Ot["Yijing Hexagram Symbols"](k)||Ot["Yi Syllables"](k)||Ot["Yi Radicals"](k))}function Ja(k){return!!(Ot["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||Ot["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||Ot["Letterlike Symbols"](k)||Ot["Number Forms"](k)||Ot["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||Ot["Control Pictures"](k)&&k!==9251||Ot["Optical Character Recognition"](k)||Ot["Enclosed Alphanumerics"](k)||Ot["Geometric Shapes"](k)||Ot["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||Ot["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||Ot["CJK Symbols and Punctuation"](k)||Ot.Katakana(k)||Ot["Private Use Area"](k)||Ot["CJK Compatibility Forms"](k)||Ot["Small Form Variants"](k)||Ot["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function ti(k){return!(da(k)||Ja(k))}function Sa(k){return Ot.Arabic(k)||Ot["Arabic Supplement"](k)||Ot["Arabic Extended-A"](k)||Ot["Arabic Presentation Forms-A"](k)||Ot["Arabic Presentation Forms-B"](k)}function Fa(k){return k>=1424&&k<=2303||Ot["Arabic Presentation Forms-A"](k)||Ot["Arabic Presentation Forms-B"](k)}function Xa(k,C){return!(!C&&Fa(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||Ot.Khmer(k))}function fi(k){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C];if(Fa(ne.charCodeAt(0)))return!0}return!1}function ni(k,C){for(var H=0,ne=k;H<ne.length;H+=1){var xe=ne[H];if(!Xa(xe.charCodeAt(0),C))return!1}return!0}var La={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},sn=null,rn=La.unavailable,vn=null,Pn=function(k){k&&typeof k=="string"&&k.indexOf("NetworkError")>-1&&(rn=La.error),sn&&sn(k)};function Jn(){ro.fire(new Br("pluginStateChange",{pluginStatus:rn,pluginURL:vn}))}var ro=new xr,Yo=function(){return rn},io=function(k){return k({pluginStatus:rn,pluginURL:vn}),ro.on("pluginStateChange",k),k},Ho=function(k,C,H){if(H===void 0&&(H=!1),rn===La.deferred||rn===La.loading||rn===La.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");vn=be.resolveURL(k),rn=La.deferred,sn=C,Jn(),H||cl()},cl=function(){if(rn!==La.deferred||!vn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");rn=La.loading,Jn(),vn&&ra({url:vn},function(k){k?Pn(k):(rn=La.loaded,Jn())})},al={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return rn===La.loaded||al.applyArabicShaping!=null},isLoading:function(){return rn===La.loading},setState:function(C){rn=C.pluginStatus,vn=C.pluginURL},isParsed:function(){return al.applyArabicShaping!=null&&al.processBidirectionalText!=null&&al.processStyledBidirectionalText!=null},getPluginURL:function(){return vn}},xl=function(){!al.isLoading()&&!al.isLoaded()&&Yo()==="deferred"&&cl()},gn=function(C,H){this.zoom=C,H?(this.now=H.now,this.fadeDuration=H.fadeDuration,this.zoomHistory=H.zoomHistory,this.transition=H.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ar,this.transition={})};gn.prototype.isSupportedScript=function(C){return ni(C,al.isLoaded())},gn.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},gn.prototype.getCrossfadeParameters=function(){var C=this.zoom,H=C-Math.floor(C),ne=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:H+(1-H)*ne}:{fromScale:.5,toScale:1,t:1-(1-ne)*H}};var vo=function(C,H){this.property=C,this.value=H,this.expression=I(H===void 0?C.specification.default:H,C.specification)};vo.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},vo.prototype.possiblyEvaluate=function(C,H,ne){return this.property.possiblyEvaluate(this,C,H,ne)};var cs=function(C){this.property=C,this.value=new vo(C,void 0)};cs.prototype.transitioned=function(C,H){return new Al(this.property,this.value,H,g({},C.transition,this.transition),C.now)},cs.prototype.untransitioned=function(){return new Al(this.property,this.value,null,{},0)};var ms=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};ms.prototype.getValue=function(C){return O(this._values[C].value.value)},ms.prototype.setValue=function(C,H){this._values.hasOwnProperty(C)||(this._values[C]=new cs(this._values[C].property)),this._values[C].value=new vo(this._values[C].property,H===null?void 0:O(H))},ms.prototype.getTransition=function(C){return O(this._values[C].transition)},ms.prototype.setTransition=function(C,H){this._values.hasOwnProperty(C)||(this._values[C]=new cs(this._values[C].property)),this._values[C].transition=O(H)||void 0},ms.prototype.serialize=function(){for(var C={},H=0,ne=Object.keys(this._values);H<ne.length;H+=1){var xe=ne[H],Re=this.getValue(xe);Re!==void 0&&(C[xe]=Re);var qe=this.getTransition(xe);qe!==void 0&&(C[xe+"-transition"]=qe)}return C},ms.prototype.transitioned=function(C,H){for(var ne=new Hl(this._properties),xe=0,Re=Object.keys(this._values);xe<Re.length;xe+=1){var qe=Re[xe];ne._values[qe]=this._values[qe].transitioned(C,H._values[qe])}return ne},ms.prototype.untransitioned=function(){for(var C=new Hl(this._properties),H=0,ne=Object.keys(this._values);H<ne.length;H+=1){var xe=ne[H];C._values[xe]=this._values[xe].untransitioned()}return C};var Al=function(C,H,ne,xe,Re){this.property=C,this.value=H,this.begin=Re+xe.delay||0,this.end=this.begin+xe.duration||0,C.specification.transition&&(xe.delay||xe.duration)&&(this.prior=ne)};Al.prototype.possiblyEvaluate=function(C,H,ne){var xe=C.now||0,Re=this.value.possiblyEvaluate(C,H,ne),qe=this.prior;if(qe){if(xe>this.end)return this.prior=null,Re;if(this.value.isDataDriven())return this.prior=null,Re;if(xe<this.begin)return qe.possiblyEvaluate(C,H,ne);var pt=(xe-this.begin)/(this.end-this.begin);return this.property.interpolate(qe.possiblyEvaluate(C,H,ne),Re,m(pt))}else return Re};var Hl=function(C){this._properties=C,this._values=Object.create(C.defaultTransitioningPropertyValues)};Hl.prototype.possiblyEvaluate=function(C,H,ne){for(var xe=new _c(this._properties),Re=0,qe=Object.keys(this._values);Re<qe.length;Re+=1){var pt=qe[Re];xe._values[pt]=this._values[pt].possiblyEvaluate(C,H,ne)}return xe},Hl.prototype.hasTransition=function(){for(var C=0,H=Object.keys(this._values);C<H.length;C+=1){var ne=H[C];if(this._values[ne].prior)return!0}return!1};var Su=function(C){this._properties=C,this._values=Object.create(C.defaultPropertyValues)};Su.prototype.getValue=function(C){return O(this._values[C].value)},Su.prototype.setValue=function(C,H){this._values[C]=new vo(this._values[C].property,H===null?void 0:O(H))},Su.prototype.serialize=function(){for(var C={},H=0,ne=Object.keys(this._values);H<ne.length;H+=1){var xe=ne[H],Re=this.getValue(xe);Re!==void 0&&(C[xe]=Re)}return C},Su.prototype.possiblyEvaluate=function(C,H,ne){for(var xe=new _c(this._properties),Re=0,qe=Object.keys(this._values);Re<qe.length;Re+=1){var pt=qe[Re];xe._values[pt]=this._values[pt].possiblyEvaluate(C,H,ne)}return xe};var Rl=function(C,H,ne){this.property=C,this.value=H,this.parameters=ne};Rl.prototype.isConstant=function(){return this.value.kind==="constant"},Rl.prototype.constantOr=function(C){return this.value.kind==="constant"?this.value.value:C},Rl.prototype.evaluate=function(C,H,ne,xe){return this.property.evaluate(this.value,this.parameters,C,H,ne,xe)};var _c=function(C){this._properties=C,this._values=Object.create(C.defaultPossiblyEvaluatedValues)};_c.prototype.get=function(C){return this._values[C]};var it=function(C){this.specification=C};it.prototype.possiblyEvaluate=function(C,H){return C.expression.evaluate(H)},it.prototype.interpolate=function(C,H,ne){var xe=Bu[this.specification.type];return xe?xe(C,H,ne):C};var Zt=function(C,H){this.specification=C,this.overrides=H};Zt.prototype.possiblyEvaluate=function(C,H,ne,xe){return C.expression.kind==="constant"||C.expression.kind==="camera"?new Rl(this,{kind:"constant",value:C.expression.evaluate(H,null,{},ne,xe)},H):new Rl(this,C.expression,H)},Zt.prototype.interpolate=function(C,H,ne){if(C.value.kind!=="constant"||H.value.kind!=="constant")return C;if(C.value.value===void 0||H.value.value===void 0)return new Rl(this,{kind:"constant",value:void 0},C.parameters);var xe=Bu[this.specification.type];return xe?new Rl(this,{kind:"constant",value:xe(C.value.value,H.value.value,ne)},C.parameters):C},Zt.prototype.evaluate=function(C,H,ne,xe,Re,qe){return C.kind==="constant"?C.value:C.evaluate(H,ne,xe,Re,qe)};var fr=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(ne,xe,Re,qe){if(ne.value===void 0)return new Rl(this,{kind:"constant",value:void 0},xe);if(ne.expression.kind==="constant"){var pt=ne.expression.evaluate(xe,null,{},Re,qe),Dt=ne.property.specification.type==="resolvedImage",Gt=Dt&&typeof pt!="string"?pt.name:pt,tr=this._calculate(Gt,Gt,Gt,xe);return new Rl(this,{kind:"constant",value:tr},xe)}else if(ne.expression.kind==="camera"){var Pr=this._calculate(ne.expression.evaluate({zoom:xe.zoom-1}),ne.expression.evaluate({zoom:xe.zoom}),ne.expression.evaluate({zoom:xe.zoom+1}),xe);return new Rl(this,{kind:"constant",value:Pr},xe)}else return new Rl(this,ne.expression,xe)},C.prototype.evaluate=function(ne,xe,Re,qe,pt,Dt){if(ne.kind==="source"){var Gt=ne.evaluate(xe,Re,qe,pt,Dt);return this._calculate(Gt,Gt,Gt,xe)}else return ne.kind==="composite"?this._calculate(ne.evaluate({zoom:Math.floor(xe.zoom)-1},Re,qe),ne.evaluate({zoom:Math.floor(xe.zoom)},Re,qe),ne.evaluate({zoom:Math.floor(xe.zoom)+1},Re,qe),xe):ne.value},C.prototype._calculate=function(ne,xe,Re,qe){var pt=qe.zoom;return pt>qe.zoomHistory.lastIntegerZoom?{from:ne,to:xe}:{from:Re,to:xe}},C.prototype.interpolate=function(ne){return ne},C}(Zt),oa=function(C){this.specification=C};oa.prototype.possiblyEvaluate=function(C,H,ne,xe){if(C.value!==void 0)if(C.expression.kind==="constant"){var Re=C.expression.evaluate(H,null,{},ne,xe);return this._calculate(Re,Re,Re,H)}else return this._calculate(C.expression.evaluate(new gn(Math.floor(H.zoom-1),H)),C.expression.evaluate(new gn(Math.floor(H.zoom),H)),C.expression.evaluate(new gn(Math.floor(H.zoom+1),H)),H)},oa.prototype._calculate=function(C,H,ne,xe){var Re=xe.zoom;return Re>xe.zoomHistory.lastIntegerZoom?{from:C,to:H}:{from:ne,to:H}},oa.prototype.interpolate=function(C){return C};var wa=function(C){this.specification=C};wa.prototype.possiblyEvaluate=function(C,H,ne,xe){return!!C.expression.evaluate(H,null,{},ne,xe)},wa.prototype.interpolate=function(){return!1};var ma=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var H in C){var ne=C[H];ne.specification.overridable&&this.overridableProperties.push(H);var xe=this.defaultPropertyValues[H]=new vo(ne,void 0),Re=this.defaultTransitionablePropertyValues[H]=new cs(ne);this.defaultTransitioningPropertyValues[H]=Re.untransitioned(),this.defaultPossiblyEvaluatedValues[H]=xe.possiblyEvaluate({})}};de("DataDrivenProperty",Zt),de("DataConstantProperty",it),de("CrossFadedDataDrivenProperty",fr),de("CrossFadedProperty",oa),de("ColorRampProperty",wa);var _a="-transition",Ya=function(k){function C(H,ne){if(k.call(this),this.id=H.id,this.type=H.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},H.type!=="custom"&&(H=H,this.metadata=H.metadata,this.minzoom=H.minzoom,this.maxzoom=H.maxzoom,H.type!=="background"&&(this.source=H.source,this.sourceLayer=H["source-layer"],this.filter=H.filter),ne.layout&&(this._unevaluatedLayout=new Su(ne.layout)),ne.paint)){this._transitionablePaint=new ms(ne.paint);for(var xe in H.paint)this.setPaintProperty(xe,H.paint[xe],{validate:!1});for(var Re in H.layout)this.setLayoutProperty(Re,H.layout[Re],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new _c(ne.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(ne){return ne==="visibility"?this.visibility:this._unevaluatedLayout.getValue(ne)},C.prototype.setLayoutProperty=function(ne,xe,Re){if(Re===void 0&&(Re={}),xe!=null){var qe="layers."+this.id+".layout."+ne;if(this._validate(eu,qe,ne,xe,Re))return}if(ne==="visibility"){this.visibility=xe;return}this._unevaluatedLayout.setValue(ne,xe)},C.prototype.getPaintProperty=function(ne){return z(ne,_a)?this._transitionablePaint.getTransition(ne.slice(0,-_a.length)):this._transitionablePaint.getValue(ne)},C.prototype.setPaintProperty=function(ne,xe,Re){if(Re===void 0&&(Re={}),xe!=null){var qe="layers."+this.id+".paint."+ne;if(this._validate(Il,qe,ne,xe,Re))return!1}if(z(ne,_a))return this._transitionablePaint.setTransition(ne.slice(0,-_a.length),xe||void 0),!1;var pt=this._transitionablePaint._values[ne],Dt=pt.property.specification["property-type"]==="cross-faded-data-driven",Gt=pt.value.isDataDriven(),tr=pt.value;this._transitionablePaint.setValue(ne,xe),this._handleSpecialPaintPropertyUpdate(ne);var Pr=this._transitionablePaint._values[ne].value,Zr=Pr.isDataDriven();return Zr||Gt||Dt||this._handleOverridablePaintPropertyUpdate(ne,tr,Pr)},C.prototype._handleSpecialPaintPropertyUpdate=function(ne){},C.prototype._handleOverridablePaintPropertyUpdate=function(ne,xe,Re){return!1},C.prototype.isHidden=function(ne){return this.minzoom&&ne<this.minzoom||this.maxzoom&&ne>=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(ne){this._transitioningPaint=this._transitionablePaint.transitioned(ne,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(ne,xe){ne.getCrossfadeParameters&&(this._crossfadeParameters=ne.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(ne,void 0,xe)),this.paint=this._transitioningPaint.possiblyEvaluate(ne,void 0,xe)},C.prototype.serialize=function(){var ne={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&&(ne.layout=ne.layout||{},ne.layout.visibility=this.visibility),N(ne,function(xe,Re){return xe!==void 0&&!(Re==="layout"&&!Object.keys(xe).length)&&!(Re==="paint"&&!Object.keys(xe).length)})},C.prototype._validate=function(ne,xe,Re,qe,pt){return pt===void 0&&(pt={}),pt&&pt.validate===!1?!1:Ru(this,ne.call(Jo,{key:xe,layerType:this.type,objectKey:Re,value:qe,styleSpec:Gi,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var ne in this.paint._values){var xe=this.paint.get(ne);if(!(!(xe instanceof Rl)||!_l(xe.property.specification))&&(xe.value.kind==="source"||xe.value.kind==="composite")&&xe.value.isStateDependent)return!0}return!1},C}(xr),bi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},yi=function(C,H){this._structArray=C,this._pos1=H*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},si=128,yn=5,zi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};zi.serialize=function(C,H){return C._trim(),H&&(C.isTransferred=!0,H.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},zi.deserialize=function(C){var H=Object.create(this.prototype);return H.arrayBuffer=C.arrayBuffer,H.length=C.length,H.capacity=C.arrayBuffer.byteLength/H.bytesPerElement,H._refreshViews(),H},zi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},zi.prototype.clear=function(){this.length=0},zi.prototype.resize=function(C){this.reserve(C),this.length=C},zi.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*yn),si),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var H=this.uint8;this._refreshViews(),H&&this.uint8.set(H)}},zi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ei(k,C){C===void 0&&(C=1);var H=0,ne=0,xe=k.map(function(qe){var pt=Na(qe.type),Dt=H=ea(H,Math.max(C,pt)),Gt=qe.components||1;return ne=Math.max(ne,pt),H+=pt*Gt,{name:qe.name,type:qe.type,components:Gt,offset:Dt}}),Re=ea(H,Math.max(ne,C));return{members:xe,size:Re,alignment:C}}function Na(k){return bi[k].BYTES_PER_ELEMENT}function ea(k,C){return Math.ceil(k/C)*C}var Ma=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe){var Re=this.length;return this.resize(Re+1),this.emplace(Re,ne,xe)},C.prototype.emplace=function(ne,xe,Re){var qe=ne*2;return this.int16[qe+0]=xe,this.int16[qe+1]=Re,ne},C}(zi);Ma.prototype.bytesPerElement=4,de("StructArrayLayout2i4",Ma);var Qa=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe){var pt=this.length;return this.resize(pt+1),this.emplace(pt,ne,xe,Re,qe)},C.prototype.emplace=function(ne,xe,Re,qe,pt){var Dt=ne*4;return this.int16[Dt+0]=xe,this.int16[Dt+1]=Re,this.int16[Dt+2]=qe,this.int16[Dt+3]=pt,ne},C}(zi);Qa.prototype.bytesPerElement=8,de("StructArrayLayout4i8",Qa);var di=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt){var Gt=this.length;return this.resize(Gt+1),this.emplace(Gt,ne,xe,Re,qe,pt,Dt)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt){var tr=ne*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Re,this.int16[tr+2]=qe,this.int16[tr+3]=pt,this.int16[tr+4]=Dt,this.int16[tr+5]=Gt,ne},C}(zi);di.prototype.bytesPerElement=12,de("StructArrayLayout2i4i12",di);var Va=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt){var Gt=this.length;return this.resize(Gt+1),this.emplace(Gt,ne,xe,Re,qe,pt,Dt)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt){var tr=ne*4,Pr=ne*8;return this.int16[tr+0]=xe,this.int16[tr+1]=Re,this.uint8[Pr+4]=qe,this.uint8[Pr+5]=pt,this.uint8[Pr+6]=Dt,this.uint8[Pr+7]=Gt,ne},C}(zi);Va.prototype.bytesPerElement=8,de("StructArrayLayout2i4ub8",Va);var Bi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe){var Re=this.length;return this.resize(Re+1),this.emplace(Re,ne,xe)},C.prototype.emplace=function(ne,xe,Re){var qe=ne*2;return this.float32[qe+0]=xe,this.float32[qe+1]=Re,ne},C}(zi);Bi.prototype.bytesPerElement=8,de("StructArrayLayout2f8",Bi);var Li=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr){var Vr=this.length;return this.resize(Vr+1),this.emplace(Vr,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr){var ua=ne*10;return this.uint16[ua+0]=xe,this.uint16[ua+1]=Re,this.uint16[ua+2]=qe,this.uint16[ua+3]=pt,this.uint16[ua+4]=Dt,this.uint16[ua+5]=Gt,this.uint16[ua+6]=tr,this.uint16[ua+7]=Pr,this.uint16[ua+8]=Zr,this.uint16[ua+9]=Vr,ne},C}(zi);Li.prototype.bytesPerElement=20,de("StructArrayLayout10ui20",Li);var pn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua){var Oa=this.length;return this.resize(Oa+1),this.emplace(Oa,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa){var Mi=ne*12;return this.int16[Mi+0]=xe,this.int16[Mi+1]=Re,this.int16[Mi+2]=qe,this.int16[Mi+3]=pt,this.uint16[Mi+4]=Dt,this.uint16[Mi+5]=Gt,this.uint16[Mi+6]=tr,this.uint16[Mi+7]=Pr,this.int16[Mi+8]=Zr,this.int16[Mi+9]=Vr,this.int16[Mi+10]=ua,this.int16[Mi+11]=Oa,ne},C}(zi);pn.prototype.bytesPerElement=24,de("StructArrayLayout4i4ui4i24",pn);var Ha=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ne,xe,Re)},C.prototype.emplace=function(ne,xe,Re,qe){var pt=ne*3;return this.float32[pt+0]=xe,this.float32[pt+1]=Re,this.float32[pt+2]=qe,ne},C}(zi);Ha.prototype.bytesPerElement=12,de("StructArrayLayout3f12",Ha);var Ua=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},C.prototype.emplace=function(ne,xe){var Re=ne*1;return this.uint32[Re+0]=xe,ne},C}(zi);Ua.prototype.bytesPerElement=4,de("StructArrayLayout1ul4",Ua);var Yi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr){var Zr=this.length;return this.resize(Zr+1),this.emplace(Zr,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr){var Vr=ne*10,ua=ne*5;return this.int16[Vr+0]=xe,this.int16[Vr+1]=Re,this.int16[Vr+2]=qe,this.int16[Vr+3]=pt,this.int16[Vr+4]=Dt,this.int16[Vr+5]=Gt,this.uint32[ua+3]=tr,this.uint16[Vr+8]=Pr,this.uint16[Vr+9]=Zr,ne},C}(zi);Yi.prototype.bytesPerElement=20,de("StructArrayLayout6i1ul2ui20",Yi);var Ri=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt){var Gt=this.length;return this.resize(Gt+1),this.emplace(Gt,ne,xe,Re,qe,pt,Dt)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt){var tr=ne*6;return this.int16[tr+0]=xe,this.int16[tr+1]=Re,this.int16[tr+2]=qe,this.int16[tr+3]=pt,this.int16[tr+4]=Dt,this.int16[tr+5]=Gt,ne},C}(zi);Ri.prototype.bytesPerElement=12,de("StructArrayLayout2i2i2i12",Ri);var Ti=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt){var Dt=this.length;return this.resize(Dt+1),this.emplace(Dt,ne,xe,Re,qe,pt)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt){var Gt=ne*4,tr=ne*8;return this.float32[Gt+0]=xe,this.float32[Gt+1]=Re,this.float32[Gt+2]=qe,this.int16[tr+6]=pt,this.int16[tr+7]=Dt,ne},C}(zi);Ti.prototype.bytesPerElement=16,de("StructArrayLayout2f1f2i16",Ti);var xi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe){var pt=this.length;return this.resize(pt+1),this.emplace(pt,ne,xe,Re,qe)},C.prototype.emplace=function(ne,xe,Re,qe,pt){var Dt=ne*12,Gt=ne*3;return this.uint8[Dt+0]=xe,this.uint8[Dt+1]=Re,this.float32[Gt+1]=qe,this.float32[Gt+2]=pt,ne},C}(zi);xi.prototype.bytesPerElement=12,de("StructArrayLayout2ub2f12",xi);var Xi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ne,xe,Re)},C.prototype.emplace=function(ne,xe,Re,qe){var pt=ne*3;return this.uint16[pt+0]=xe,this.uint16[pt+1]=Re,this.uint16[pt+2]=qe,ne},C}(zi);Xi.prototype.bytesPerElement=6,de("StructArrayLayout3ui6",Xi);var mn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi){var Ji=this.length;return this.resize(Ji+1),this.emplace(Ji,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi,Ji){var ln=ne*24,Tn=ne*12,Vn=ne*48;return this.int16[ln+0]=xe,this.int16[ln+1]=Re,this.uint16[ln+2]=qe,this.uint16[ln+3]=pt,this.uint32[Tn+2]=Dt,this.uint32[Tn+3]=Gt,this.uint32[Tn+4]=tr,this.uint16[ln+10]=Pr,this.uint16[ln+11]=Zr,this.uint16[ln+12]=Vr,this.float32[Tn+7]=ua,this.float32[Tn+8]=Oa,this.uint8[Vn+36]=Mi,this.uint8[Vn+37]=ii,this.uint8[Vn+38]=$i,this.uint32[Tn+10]=Oi,this.int16[ln+22]=Ji,ne},C}(zi);mn.prototype.bytesPerElement=48,de("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",mn);var In=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi,Ji,ln,Tn,Vn,Nn,So,oo,go,ks,Mo,Po){var $s=this.length;return this.resize($s+1),this.emplace($s,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi,Ji,ln,Tn,Vn,Nn,So,oo,go,ks,Mo,Po)},C.prototype.emplace=function(ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi,Ji,ln,Tn,Vn,Nn,So,oo,go,ks,Mo,Po,$s){var ws=ne*34,Xl=ne*17;return this.int16[ws+0]=xe,this.int16[ws+1]=Re,this.int16[ws+2]=qe,this.int16[ws+3]=pt,this.int16[ws+4]=Dt,this.int16[ws+5]=Gt,this.int16[ws+6]=tr,this.int16[ws+7]=Pr,this.uint16[ws+8]=Zr,this.uint16[ws+9]=Vr,this.uint16[ws+10]=ua,this.uint16[ws+11]=Oa,this.uint16[ws+12]=Mi,this.uint16[ws+13]=ii,this.uint16[ws+14]=$i,this.uint16[ws+15]=Oi,this.uint16[ws+16]=Ji,this.uint16[ws+17]=ln,this.uint16[ws+18]=Tn,this.uint16[ws+19]=Vn,this.uint16[ws+20]=Nn,this.uint16[ws+21]=So,this.uint16[ws+22]=oo,this.uint32[Xl+12]=go,this.float32[Xl+13]=ks,this.float32[Xl+14]=Mo,this.float32[Xl+15]=Po,this.float32[Xl+16]=$s,ne},C}(zi);In.prototype.bytesPerElement=68,de("StructArrayLayout8i15ui1ul4f68",In);var Ii=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},C.prototype.emplace=function(ne,xe){var Re=ne*1;return this.float32[Re+0]=xe,ne},C}(zi);Ii.prototype.bytesPerElement=4,de("StructArrayLayout1f4",Ii);var an=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ne,xe,Re)},C.prototype.emplace=function(ne,xe,Re,qe){var pt=ne*3;return this.int16[pt+0]=xe,this.int16[pt+1]=Re,this.int16[pt+2]=qe,ne},C}(zi);an.prototype.bytesPerElement=6,de("StructArrayLayout3i6",an);var kn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re){var qe=this.length;return this.resize(qe+1),this.emplace(qe,ne,xe,Re)},C.prototype.emplace=function(ne,xe,Re,qe){var pt=ne*2,Dt=ne*4;return this.uint32[pt+0]=xe,this.uint16[Dt+2]=Re,this.uint16[Dt+3]=qe,ne},C}(zi);kn.prototype.bytesPerElement=8,de("StructArrayLayout1ul2ui8",kn);var Dn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe){var Re=this.length;return this.resize(Re+1),this.emplace(Re,ne,xe)},C.prototype.emplace=function(ne,xe,Re){var qe=ne*2;return this.uint16[qe+0]=xe,this.uint16[qe+1]=Re,ne},C}(zi);Dn.prototype.bytesPerElement=4,de("StructArrayLayout2ui4",Dn);var Zn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne){var xe=this.length;return this.resize(xe+1),this.emplace(xe,ne)},C.prototype.emplace=function(ne,xe){var Re=ne*1;return this.uint16[Re+0]=xe,ne},C}(zi);Zn.prototype.bytesPerElement=2,de("StructArrayLayout1ui2",Zn);var Ds=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(ne,xe,Re,qe){var pt=this.length;return this.resize(pt+1),this.emplace(pt,ne,xe,Re,qe)},C.prototype.emplace=function(ne,xe,Re,qe,pt){var Dt=ne*4;return this.float32[Dt+0]=xe,this.float32[Dt+1]=Re,this.float32[Dt+2]=qe,this.float32[Dt+3]=pt,ne},C}(zi);Ds.prototype.bytesPerElement=16,de("StructArrayLayout4f16",Ds);var bl=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return H.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},H.x1.get=function(){return this._structArray.int16[this._pos2+2]},H.y1.get=function(){return this._structArray.int16[this._pos2+3]},H.x2.get=function(){return this._structArray.int16[this._pos2+4]},H.y2.get=function(){return this._structArray.int16[this._pos2+5]},H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,H),C}(yi);bl.prototype.size=20;var po=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new bl(this,ne)},C}(Yi);de("CollisionBoxArray",po);var Wl=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},H.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},H.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},H.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},H.segment.get=function(){return this._structArray.uint16[this._pos2+10]},H.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},H.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},H.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},H.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},H.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},H.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},H.placedOrientation.set=function(ne){this._structArray.uint8[this._pos1+37]=ne},H.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},H.hidden.set=function(ne){this._structArray.uint8[this._pos1+38]=ne},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},H.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+10]=ne},H.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,H),C}(yi);Wl.prototype.size=48;var fs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new Wl(this,ne)},C}(mn);de("PlacedSymbolArray",fs);var Sl=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return H.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},H.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},H.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},H.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},H.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},H.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},H.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},H.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},H.key.get=function(){return this._structArray.uint16[this._pos2+8]},H.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},H.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},H.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},H.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},H.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},H.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},H.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},H.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},H.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},H.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},H.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},H.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},H.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},H.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},H.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},H.crossTileID.set=function(ne){this._structArray.uint32[this._pos4+12]=ne},H.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},H.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},H.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},H.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,H),C}(yi);Sl.prototype.size=68;var kl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new Sl(this,ne)},C}(In);de("SymbolInstanceArray",kl);var tu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(ne){return this.float32[ne*1+0]},C}(Ii);de("GlyphOffsetArray",tu);var qs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(ne){return this.int16[ne*3+0]},C.prototype.gety=function(ne){return this.int16[ne*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(ne){return this.int16[ne*3+2]},C}(an);de("SymbolLineVertexArray",qs);var pl=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var H={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return H.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},H.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},H.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,H),C}(yi);pl.prototype.size=8;var wl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(ne){return new pl(this,ne)},C}(kn);de("FeatureIndexArray",wl);var Yn=Ei([{name:"a_pos",components:2,type:"Int16"}],4),Cl=Yn.members,Co=function(C){C===void 0&&(C=[]),this.segments=C};Co.prototype.prepareSegment=function(C,H,ne,xe){var Re=this.segments[this.segments.length-1];return C>Co.MAX_VERTEX_ARRAY_LENGTH&&B("Max vertices per segment is "+Co.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!Re||Re.vertexLength+C>Co.MAX_VERTEX_ARRAY_LENGTH||Re.sortKey!==xe)&&(Re={vertexOffset:H.length,primitiveOffset:ne.length,vertexLength:0,primitiveLength:0},xe!==void 0&&(Re.sortKey=xe),this.segments.push(Re)),Re},Co.prototype.get=function(){return this.segments},Co.prototype.destroy=function(){for(var C=0,H=this.segments;C<H.length;C+=1){var ne=H[C];for(var xe in ne.vaos)ne.vaos[xe].destroy()}},Co.simpleSegment=function(C,H,ne,xe){return new Co([{vertexOffset:C,primitiveOffset:H,vertexLength:ne,primitiveLength:xe,vaos:{},sortKey:0}])},Co.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,de("SegmentVector",Co);function ve(k,C){return k=l(Math.floor(k),0,255),C=l(Math.floor(C),0,255),256*k+C}var K=Ei([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),_e=t(function(k){function C(H,ne){var xe,Re,qe,pt,Dt,Gt,tr,Pr;for(xe=H.length&3,Re=H.length-xe,qe=ne,Dt=3432918353,Gt=461845907,Pr=0;Pr<Re;)tr=H.charCodeAt(Pr)&255|(H.charCodeAt(++Pr)&255)<<8|(H.charCodeAt(++Pr)&255)<<16|(H.charCodeAt(++Pr)&255)<<24,++Pr,tr=(tr&65535)*Dt+(((tr>>>16)*Dt&65535)<<16)&4294967295,tr=tr<<15|tr>>>17,tr=(tr&65535)*Gt+(((tr>>>16)*Gt&65535)<<16)&4294967295,qe^=tr,qe=qe<<13|qe>>>19,pt=(qe&65535)*5+(((qe>>>16)*5&65535)<<16)&4294967295,qe=(pt&65535)+27492+(((pt>>>16)+58964&65535)<<16);switch(tr=0,xe){case 3:tr^=(H.charCodeAt(Pr+2)&255)<<16;case 2:tr^=(H.charCodeAt(Pr+1)&255)<<8;case 1:tr^=H.charCodeAt(Pr)&255,tr=(tr&65535)*Dt+(((tr>>>16)*Dt&65535)<<16)&4294967295,tr=tr<<15|tr>>>17,tr=(tr&65535)*Gt+(((tr>>>16)*Gt&65535)<<16)&4294967295,qe^=tr}return qe^=H.length,qe^=qe>>>16,qe=(qe&65535)*2246822507+(((qe>>>16)*2246822507&65535)<<16)&4294967295,qe^=qe>>>13,qe=(qe&65535)*3266489909+(((qe>>>16)*3266489909&65535)<<16)&4294967295,qe^=qe>>>16,qe>>>0}k.exports=C}),te=t(function(k){function C(H,ne){for(var xe=H.length,Re=ne^xe,qe=0,pt;xe>=4;)pt=H.charCodeAt(qe)&255|(H.charCodeAt(++qe)&255)<<8|(H.charCodeAt(++qe)&255)<<16|(H.charCodeAt(++qe)&255)<<24,pt=(pt&65535)*1540483477+(((pt>>>16)*1540483477&65535)<<16),pt^=pt>>>24,pt=(pt&65535)*1540483477+(((pt>>>16)*1540483477&65535)<<16),Re=(Re&65535)*1540483477+(((Re>>>16)*1540483477&65535)<<16)^pt,xe-=4,++qe;switch(xe){case 3:Re^=(H.charCodeAt(qe+2)&255)<<16;case 2:Re^=(H.charCodeAt(qe+1)&255)<<8;case 1:Re^=H.charCodeAt(qe)&255,Re=(Re&65535)*1540483477+(((Re>>>16)*1540483477&65535)<<16)}return Re^=Re>>>13,Re=(Re&65535)*1540483477+(((Re>>>16)*1540483477&65535)<<16),Re^=Re>>>15,Re>>>0}k.exports=C}),me=_e,Ge=_e,Le=te;me.murmur3=Ge,me.murmur2=Le;var $e=function(){this.ids=[],this.positions=[],this.indexed=!1};$e.prototype.add=function(C,H,ne,xe){this.ids.push(jt(C)),this.positions.push(H,ne,xe)},$e.prototype.getPositions=function(C){for(var H=jt(C),ne=0,xe=this.ids.length-1;ne<xe;){var Re=ne+xe>>1;this.ids[Re]>=H?xe=Re:ne=Re+1}for(var qe=[];this.ids[ne]===H;){var pt=this.positions[3*ne],Dt=this.positions[3*ne+1],Gt=this.positions[3*ne+2];qe.push({index:pt,start:Dt,end:Gt}),ne++}return qe},$e.serialize=function(C,H){var ne=new Float64Array(C.ids),xe=new Uint32Array(C.positions);return wr(ne,xe,0,ne.length-1),H&&H.push(ne.buffer,xe.buffer),{ids:ne,positions:xe}},$e.deserialize=function(C){var H=new $e;return H.ids=C.ids,H.positions=C.positions,H.indexed=!0,H};var gt=Math.pow(2,53)-1;function jt(k){var C=+k;return!isNaN(C)&&C<=gt?C:me(String(k))}function wr(k,C,H,ne){for(;H<ne;){for(var xe=k[H+ne>>1],Re=H-1,qe=ne+1;;){do Re++;while(k[Re]<xe);do qe--;while(k[qe]>xe);if(Re>=qe)break;Nr(k,Re,qe),Nr(C,3*Re,3*qe),Nr(C,3*Re+1,3*qe+1),Nr(C,3*Re+2,3*qe+2)}qe-H<ne-qe?(wr(k,C,H,qe),H=qe+1):(wr(k,C,qe+1,ne),ne=qe)}}function Nr(k,C,H){var ne=k[C];k[C]=k[H],k[H]=ne}de("FeaturePositionMap",$e);var pr=function(C,H){this.gl=C.gl,this.location=H},yt=function(k){function C(H,ne){k.call(this,H,ne),this.current=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){this.current!==ne&&(this.current=ne,this.gl.uniform1i(this.location,ne))},C}(pr),kt=function(k){function C(H,ne){k.call(this,H,ne),this.current=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){this.current!==ne&&(this.current=ne,this.gl.uniform1f(this.location,ne))},C}(pr),Bt=function(k){function C(H,ne){k.call(this,H,ne),this.current=[0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1])&&(this.current=ne,this.gl.uniform2f(this.location,ne[0],ne[1]))},C}(pr),nr=function(k){function C(H,ne){k.call(this,H,ne),this.current=[0,0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1]||ne[2]!==this.current[2])&&(this.current=ne,this.gl.uniform3f(this.location,ne[0],ne[1],ne[2]))},C}(pr),hr=function(k){function C(H,ne){k.call(this,H,ne),this.current=[0,0,0,0]}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne[0]!==this.current[0]||ne[1]!==this.current[1]||ne[2]!==this.current[2]||ne[3]!==this.current[3])&&(this.current=ne,this.gl.uniform4f(this.location,ne[0],ne[1],ne[2],ne[3]))},C}(pr),lr=function(k){function C(H,ne){k.call(this,H,ne),this.current=Fs.transparent}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){(ne.r!==this.current.r||ne.g!==this.current.g||ne.b!==this.current.b||ne.a!==this.current.a)&&(this.current=ne,this.gl.uniform4f(this.location,ne.r,ne.g,ne.b,ne.a))},C}(pr),dr=new Float32Array(16),ur=function(k){function C(H,ne){k.call(this,H,ne),this.current=dr}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.set=function(ne){if(ne[12]!==this.current[12]||ne[0]!==this.current[0]){this.current=ne,this.gl.uniformMatrix4fv(this.location,!1,ne);return}for(var xe=1;xe<16;xe++)if(ne[xe]!==this.current[xe]){this.current=ne,this.gl.uniformMatrix4fv(this.location,!1,ne);break}},C}(pr);function Ht(k){return[ve(255*k.r,255*k.g),ve(255*k.b,255*k.a)]}var sr=function(C,H,ne){this.value=C,this.uniformNames=H.map(function(xe){return"u_"+xe}),this.type=ne};sr.prototype.setUniform=function(C,H,ne){C.set(ne.constantOr(this.value))},sr.prototype.getBinding=function(C,H,ne){return this.type==="color"?new lr(C,H):new kt(C,H)};var Vt=function(C,H){this.uniformNames=H.map(function(ne){return"u_"+ne}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Vt.prototype.setConstantPatternPositions=function(C,H){this.pixelRatioFrom=H.pixelRatio,this.pixelRatioTo=C.pixelRatio,this.patternFrom=H.tlbr,this.patternTo=C.tlbr},Vt.prototype.setUniform=function(C,H,ne,xe){var Re=xe==="u_pattern_to"?this.patternTo:xe==="u_pattern_from"?this.patternFrom:xe==="u_pixel_ratio_to"?this.pixelRatioTo:xe==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Re&&C.set(Re)},Vt.prototype.getBinding=function(C,H,ne){return ne.substr(0,9)==="u_pattern"?new hr(C,H):new kt(C,H)};var Dr=function(C,H,ne,xe){this.expression=C,this.type=ne,this.maxValue=0,this.paintVertexAttributes=H.map(function(Re){return{name:"a_"+Re,type:"Float32",components:ne==="color"?2:1,offset:0}}),this.paintVertexArray=new xe};Dr.prototype.populatePaintArray=function(C,H,ne,xe,Re){var qe=this.paintVertexArray.length,pt=this.expression.evaluate(new gn(0),H,{},xe,[],Re);this.paintVertexArray.resize(C),this._setPaintValue(qe,C,pt)},Dr.prototype.updatePaintArray=function(C,H,ne,xe){var Re=this.expression.evaluate({zoom:0},ne,xe);this._setPaintValue(C,H,Re)},Dr.prototype._setPaintValue=function(C,H,ne){if(this.type==="color")for(var xe=Ht(ne),Re=C;Re<H;Re++)this.paintVertexArray.emplace(Re,xe[0],xe[1]);else{for(var qe=C;qe<H;qe++)this.paintVertexArray.emplace(qe,ne);this.maxValue=Math.max(this.maxValue,Math.abs(ne))}},Dr.prototype.upload=function(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Dr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Jr=function(C,H,ne,xe,Re,qe){this.expression=C,this.uniformNames=H.map(function(pt){return"u_"+pt+"_t"}),this.type=ne,this.useIntegerZoom=xe,this.zoom=Re,this.maxValue=0,this.paintVertexAttributes=H.map(function(pt){return{name:"a_"+pt,type:"Float32",components:ne==="color"?4:2,offset:0}}),this.paintVertexArray=new qe};Jr.prototype.populatePaintArray=function(C,H,ne,xe,Re){var qe=this.expression.evaluate(new gn(this.zoom),H,{},xe,[],Re),pt=this.expression.evaluate(new gn(this.zoom+1),H,{},xe,[],Re),Dt=this.paintVertexArray.length;this.paintVertexArray.resize(C),this._setPaintValue(Dt,C,qe,pt)},Jr.prototype.updatePaintArray=function(C,H,ne,xe){var Re=this.expression.evaluate({zoom:this.zoom},ne,xe),qe=this.expression.evaluate({zoom:this.zoom+1},ne,xe);this._setPaintValue(C,H,Re,qe)},Jr.prototype._setPaintValue=function(C,H,ne,xe){if(this.type==="color")for(var Re=Ht(ne),qe=Ht(xe),pt=C;pt<H;pt++)this.paintVertexArray.emplace(pt,Re[0],Re[1],qe[0],qe[1]);else{for(var Dt=C;Dt<H;Dt++)this.paintVertexArray.emplace(Dt,ne,xe);this.maxValue=Math.max(this.maxValue,Math.abs(ne),Math.abs(xe))}},Jr.prototype.upload=function(C){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=C.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Jr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Jr.prototype.setUniform=function(C,H){var ne=this.useIntegerZoom?Math.floor(H.zoom):H.zoom,xe=l(this.expression.interpolationFactor(ne,this.zoom,this.zoom+1),0,1);C.set(xe)},Jr.prototype.getBinding=function(C,H,ne){return new kt(C,H)};var ga=function(C,H,ne,xe,Re,qe){this.expression=C,this.type=H,this.useIntegerZoom=ne,this.zoom=xe,this.layerId=qe,this.zoomInPaintVertexArray=new Re,this.zoomOutPaintVertexArray=new Re};ga.prototype.populatePaintArray=function(C,H,ne){var xe=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(C),this.zoomOutPaintVertexArray.resize(C),this._setPaintValues(xe,C,H.patterns&&H.patterns[this.layerId],ne)},ga.prototype.updatePaintArray=function(C,H,ne,xe,Re){this._setPaintValues(C,H,ne.patterns&&ne.patterns[this.layerId],Re)},ga.prototype._setPaintValues=function(C,H,ne,xe){if(!(!xe||!ne)){var Re=ne.min,qe=ne.mid,pt=ne.max,Dt=xe[Re],Gt=xe[qe],tr=xe[pt];if(!(!Dt||!Gt||!tr))for(var Pr=C;Pr<H;Pr++)this.zoomInPaintVertexArray.emplace(Pr,Gt.tl[0],Gt.tl[1],Gt.br[0],Gt.br[1],Dt.tl[0],Dt.tl[1],Dt.br[0],Dt.br[1],Gt.pixelRatio,Dt.pixelRatio),this.zoomOutPaintVertexArray.emplace(Pr,Gt.tl[0],Gt.tl[1],Gt.br[0],Gt.br[1],tr.tl[0],tr.tl[1],tr.br[0],tr.br[1],Gt.pixelRatio,tr.pixelRatio)}},ga.prototype.upload=function(C){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=C.createVertexBuffer(this.zoomInPaintVertexArray,K.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=C.createVertexBuffer(this.zoomOutPaintVertexArray,K.members,this.expression.isStateDependent))},ga.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var vi=function(C,H,ne){this.binders={},this._buffers=[];var xe=[];for(var Re in C.paint._values)if(ne(Re)){var qe=C.paint.get(Re);if(!(!(qe instanceof Rl)||!_l(qe.property.specification))){var pt=ai(Re,C.type),Dt=qe.value,Gt=qe.property.specification.type,tr=qe.property.useIntegerZoom,Pr=qe.property.specification["property-type"],Zr=Pr==="cross-faded"||Pr==="cross-faded-data-driven";if(Dt.kind==="constant")this.binders[Re]=Zr?new Vt(Dt.value,pt):new sr(Dt.value,pt,Gt),xe.push("/u_"+Re);else if(Dt.kind==="source"||Zr){var Vr=Fi(Re,Gt,"source");this.binders[Re]=Zr?new ga(Dt,Gt,tr,H,Vr,C.id):new Dr(Dt,pt,Gt,Vr),xe.push("/a_"+Re)}else{var ua=Fi(Re,Gt,"composite");this.binders[Re]=new Jr(Dt,pt,Gt,tr,H,ua),xe.push("/z_"+Re)}}}this.cacheKey=xe.sort().join("")};vi.prototype.getMaxValue=function(C){var H=this.binders[C];return H instanceof Dr||H instanceof Jr?H.maxValue:0},vi.prototype.populatePaintArrays=function(C,H,ne,xe,Re){for(var qe in this.binders){var pt=this.binders[qe];(pt instanceof Dr||pt instanceof Jr||pt instanceof ga)&&pt.populatePaintArray(C,H,ne,xe,Re)}},vi.prototype.setConstantPatternPositions=function(C,H){for(var ne in this.binders){var xe=this.binders[ne];xe instanceof Vt&&xe.setConstantPatternPositions(C,H)}},vi.prototype.updatePaintArrays=function(C,H,ne,xe,Re){var qe=!1;for(var pt in C)for(var Dt=H.getPositions(pt),Gt=0,tr=Dt;Gt<tr.length;Gt+=1){var Pr=tr[Gt],Zr=ne.feature(Pr.index);for(var Vr in this.binders){var ua=this.binders[Vr];if((ua instanceof Dr||ua instanceof Jr||ua instanceof ga)&&ua.expression.isStateDependent===!0){var Oa=xe.paint.get(Vr);ua.expression=Oa.value,ua.updatePaintArray(Pr.start,Pr.end,Zr,C[pt],Re),qe=!0}}}return qe},vi.prototype.defines=function(){var C=[];for(var H in this.binders){var ne=this.binders[H];(ne instanceof sr||ne instanceof Vt)&&C.push.apply(C,ne.uniformNames.map(function(xe){return"#define HAS_UNIFORM_"+xe}))}return C},vi.prototype.getBinderAttributes=function(){var C=[];for(var H in this.binders){var ne=this.binders[H];if(ne instanceof Dr||ne instanceof Jr)for(var xe=0;xe<ne.paintVertexAttributes.length;xe++)C.push(ne.paintVertexAttributes[xe].name);else if(ne instanceof ga)for(var Re=0;Re<K.members.length;Re++)C.push(K.members[Re].name)}return C},vi.prototype.getBinderUniforms=function(){var C=[];for(var H in this.binders){var ne=this.binders[H];if(ne instanceof sr||ne instanceof Vt||ne instanceof Jr)for(var xe=0,Re=ne.uniformNames;xe<Re.length;xe+=1){var qe=Re[xe];C.push(qe)}}return C},vi.prototype.getPaintVertexBuffers=function(){return this._buffers},vi.prototype.getUniforms=function(C,H){var ne=[];for(var xe in this.binders){var Re=this.binders[xe];if(Re instanceof sr||Re instanceof Vt||Re instanceof Jr)for(var qe=0,pt=Re.uniformNames;qe<pt.length;qe+=1){var Dt=pt[qe];if(H[Dt]){var Gt=Re.getBinding(C,H[Dt],Dt);ne.push({name:Dt,property:xe,binding:Gt})}}}return ne},vi.prototype.setUniforms=function(C,H,ne,xe){for(var Re=0,qe=H;Re<qe.length;Re+=1){var pt=qe[Re],Dt=pt.name,Gt=pt.property,tr=pt.binding;this.binders[Gt].setUniform(tr,xe,ne.get(Gt),Dt)}},vi.prototype.updatePaintBuffers=function(C){this._buffers=[];for(var H in this.binders){var ne=this.binders[H];if(C&&ne instanceof ga){var xe=C.fromScale===2?ne.zoomInPaintVertexBuffer:ne.zoomOutPaintVertexBuffer;xe&&this._buffers.push(xe)}else(ne instanceof Dr||ne instanceof Jr)&&ne.paintVertexBuffer&&this._buffers.push(ne.paintVertexBuffer)}},vi.prototype.upload=function(C){for(var H in this.binders){var ne=this.binders[H];(ne instanceof Dr||ne instanceof Jr||ne instanceof ga)&&ne.upload(C)}this.updatePaintBuffers()},vi.prototype.destroy=function(){for(var C in this.binders){var H=this.binders[C];(H instanceof Dr||H instanceof Jr||H instanceof ga)&&H.destroy()}};var Ga=function(C,H,ne){ne===void 0&&(ne=function(){return!0}),this.programConfigurations={};for(var xe=0,Re=C;xe<Re.length;xe+=1){var qe=Re[xe];this.programConfigurations[qe.id]=new vi(qe,H,ne)}this.needsUpload=!1,this._featureMap=new $e,this._bufferOffset=0};Ga.prototype.populatePaintArrays=function(C,H,ne,xe,Re,qe){for(var pt in this.programConfigurations)this.programConfigurations[pt].populatePaintArrays(C,H,xe,Re,qe);H.id!==void 0&&this._featureMap.add(H.id,ne,this._bufferOffset,C),this._bufferOffset=C,this.needsUpload=!0},Ga.prototype.updatePaintArrays=function(C,H,ne,xe){for(var Re=0,qe=ne;Re<qe.length;Re+=1){var pt=qe[Re];this.needsUpload=this.programConfigurations[pt.id].updatePaintArrays(C,this._featureMap,H,pt,xe)||this.needsUpload}},Ga.prototype.get=function(C){return this.programConfigurations[C]},Ga.prototype.upload=function(C){if(this.needsUpload){for(var H in this.programConfigurations)this.programConfigurations[H].upload(C);this.needsUpload=!1}},Ga.prototype.destroy=function(){for(var C in this.programConfigurations)this.programConfigurations[C].destroy()};function ai(k,C){var H={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]};return H[k]||[k.replace(C+"-","").replace(/-/g,"_")]}function Zi(k){var C={"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}};return C[k]}function Fi(k,C,H){var ne={color:{source:Bi,composite:Ds},number:{source:Ii,composite:Bi}},xe=Zi(k);return xe&&xe[H]||ne[C][H]}de("ConstantBinder",sr),de("CrossFadedConstantBinder",Vt),de("SourceExpressionBinder",Dr),de("CrossFadedCompositeBinder",ga),de("CompositeExpressionBinder",Jr),de("ProgramConfiguration",vi,{omit:["_buffers"]}),de("ProgramConfigurationSet",Ga);var ui=8192,_i=15,Si=Math.pow(2,_i-1)-1,Ui=-Si-1;function fn(k){for(var C=ui/k.extent,H=k.loadGeometry(),ne=0;ne<H.length;ne++)for(var xe=H[ne],Re=0;Re<xe.length;Re++){var qe=xe[Re],pt=Math.round(qe.x*C),Dt=Math.round(qe.y*C);qe.x=l(pt,Ui,Si),qe.y=l(Dt,Ui,Si),(pt<qe.x||pt>qe.x+1||Dt<qe.y||Dt>qe.y+1)&&B("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return H}function _o(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?fn(k):[]}}function Bo(k,C,H,ne,xe){k.emplaceBack(C*2+(ne+1)/2,H*2+(xe+1)/2)}var Ps=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Ma,this.indexArray=new Xi,this.segments=new Co,this.programConfigurations=new Ga(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};Ps.prototype.populate=function(C,H,ne){var xe=this.layers[0],Re=[],qe=null;xe.type==="circle"&&(qe=xe.layout.get("circle-sort-key"));for(var pt=0,Dt=C;pt<Dt.length;pt+=1){var Gt=Dt[pt],tr=Gt.feature,Pr=Gt.id,Zr=Gt.index,Vr=Gt.sourceLayerIndex,ua=this.layers[0]._featureFilter.needGeometry,Oa=_o(tr,ua);if(this.layers[0]._featureFilter.filter(new gn(this.zoom),Oa,ne)){var Mi=qe?qe.evaluate(Oa,{},ne):void 0,ii={id:Pr,properties:tr.properties,type:tr.type,sourceLayerIndex:Vr,index:Zr,geometry:ua?Oa.geometry:fn(tr),patterns:{},sortKey:Mi};Re.push(ii)}}qe&&Re.sort(function(oo,go){return oo.sortKey-go.sortKey});for(var $i=0,Oi=Re;$i<Oi.length;$i+=1){var Ji=Oi[$i],ln=Ji,Tn=ln.geometry,Vn=ln.index,Nn=ln.sourceLayerIndex,So=C[Vn].feature;this.addFeature(Ji,Tn,Vn,ne),H.featureIndex.insert(So,Tn,Vn,Nn,this.index)}},Ps.prototype.update=function(C,H,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,H,this.stateDependentLayers,ne)},Ps.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Ps.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ps.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Cl),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},Ps.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ps.prototype.addFeature=function(C,H,ne,xe){for(var Re=0,qe=H;Re<qe.length;Re+=1)for(var pt=qe[Re],Dt=0,Gt=pt;Dt<Gt.length;Dt+=1){var tr=Gt[Dt],Pr=tr.x,Zr=tr.y;if(!(Pr<0||Pr>=ui||Zr<0||Zr>=ui)){var Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),ua=Vr.vertexLength;Bo(this.layoutVertexArray,Pr,Zr,-1,-1),Bo(this.layoutVertexArray,Pr,Zr,1,-1),Bo(this.layoutVertexArray,Pr,Zr,1,1),Bo(this.layoutVertexArray,Pr,Zr,-1,1),this.indexArray.emplaceBack(ua,ua+1,ua+2),this.indexArray.emplaceBack(ua,ua+3,ua+2),Vr.vertexLength+=4,Vr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,{},xe)},de("CircleBucket",Ps,{omit:["layers"]});function Do(k,C){for(var H=0;H<k.length;H++)if(Ih(C,k[H]))return!0;for(var ne=0;ne<C.length;ne++)if(Ih(k,C[ne]))return!0;return!!kp(k,C)}function Ms(k,C,H){return!!(Ih(k,C)||qp(C,k,H))}function Ys(k,C){if(k.length===1)return ed(C,k[0]);for(var H=0;H<C.length;H++)for(var ne=C[H],xe=0;xe<ne.length;xe++)if(Ih(k,ne[xe]))return!0;for(var Re=0;Re<k.length;Re++)if(ed(C,k[Re]))return!0;for(var qe=0;qe<C.length;qe++)if(kp(k,C[qe]))return!0;return!1}function mu(k,C,H){for(var ne=0;ne<C.length;ne++){var xe=C[ne];if(k.length>=3){for(var Re=0;Re<xe.length;Re++)if(Ih(k,xe[Re]))return!0}if(Ep(k,xe,H))return!0}return!1}function Ep(k,C,H){if(k.length>1){if(kp(k,C))return!0;for(var ne=0;ne<C.length;ne++)if(qp(C[ne],k,H))return!0}for(var xe=0;xe<k.length;xe++)if(qp(k[xe],C,H))return!0;return!1}function kp(k,C){if(k.length===0||C.length===0)return!1;for(var H=0;H<k.length-1;H++)for(var ne=k[H],xe=k[H+1],Re=0;Re<C.length-1;Re++){var qe=C[Re],pt=C[Re+1];if(Ph(ne,xe,qe,pt))return!0}return!1}function Ph(k,C,H,ne){return X(k,H,ne)!==X(C,H,ne)&&X(k,C,H)!==X(k,C,ne)}function qp(k,C,H){var ne=H*H;if(C.length===1)return k.distSqr(C[0])<ne;for(var xe=1;xe<C.length;xe++){var Re=C[xe-1],qe=C[xe];if(qd(k,Re,qe)<ne)return!0}return!1}function qd(k,C,H){var ne=C.distSqr(H);if(ne===0)return k.distSqr(C);var xe=((k.x-C.x)*(H.x-C.x)+(k.y-C.y)*(H.y-C.y))/ne;return xe<0?k.distSqr(C):xe>1?k.distSqr(H):k.distSqr(H.sub(C)._mult(xe)._add(C))}function ed(k,C){for(var H=!1,ne,xe,Re,qe=0;qe<k.length;qe++){ne=k[qe];for(var pt=0,Dt=ne.length-1;pt<ne.length;Dt=pt++)xe=ne[pt],Re=ne[Dt],xe.y>C.y!=Re.y>C.y&&C.x<(Re.x-xe.x)*(C.y-xe.y)/(Re.y-xe.y)+xe.x&&(H=!H)}return H}function Ih(k,C){for(var H=!1,ne=0,xe=k.length-1;ne<k.length;xe=ne++){var Re=k[ne],qe=k[xe];Re.y>C.y!=qe.y>C.y&&C.x<(qe.x-Re.x)*(C.y-Re.y)/(qe.y-Re.y)+Re.x&&(H=!H)}return H}function td(k,C,H,ne,xe){for(var Re=0,qe=k;Re<qe.length;Re+=1){var pt=qe[Re];if(C<=pt.x&&H<=pt.y&&ne>=pt.x&&xe>=pt.y)return!0}var Dt=[new n(C,H),new n(C,xe),new n(ne,xe),new n(ne,H)];if(k.length>2)for(var Gt=0,tr=Dt;Gt<tr.length;Gt+=1){var Pr=tr[Gt];if(Ih(k,Pr))return!0}for(var Zr=0;Zr<k.length-1;Zr++){var Vr=k[Zr],ua=k[Zr+1];if(Kh(Vr,ua,Dt))return!0}return!1}function Kh(k,C,H){var ne=H[0],xe=H[2];if(k.x<ne.x&&C.x<ne.x||k.x>xe.x&&C.x>xe.x||k.y<ne.y&&C.y<ne.y||k.y>xe.y&&C.y>xe.y)return!1;var Re=X(k,C,H[0]);return Re!==X(k,C,H[1])||Re!==X(k,C,H[2])||Re!==X(k,C,H[3])}function Rh(k,C,H){var ne=C.paint.get(k).value;return ne.kind==="constant"?ne.value:H.programConfigurations.get(C.id).getMaxValue(k)}function Cp(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function Vp(k,C,H,ne,xe){if(!C[0]&&!C[1])return k;var Re=n.convert(C)._mult(xe);H==="viewport"&&Re._rotate(-ne);for(var qe=[],pt=0;pt<k.length;pt++){var Dt=k[pt];qe.push(Dt.sub(Re))}return qe}var Lp=new ma({"circle-sort-key":new Zt(Gi.layout_circle["circle-sort-key"])}),Cv=new ma({"circle-radius":new Zt(Gi.paint_circle["circle-radius"]),"circle-color":new Zt(Gi.paint_circle["circle-color"]),"circle-blur":new Zt(Gi.paint_circle["circle-blur"]),"circle-opacity":new Zt(Gi.paint_circle["circle-opacity"]),"circle-translate":new it(Gi.paint_circle["circle-translate"]),"circle-translate-anchor":new it(Gi.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new it(Gi.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new it(Gi.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Zt(Gi.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Zt(Gi.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Zt(Gi.paint_circle["circle-stroke-opacity"])}),Vd={paint:Cv,layout:Lp},Gf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var k=arguments,C=0,H=arguments.length;H--;)C+=k[H]*k[H];return Math.sqrt(C)});function Gd(){var k=new Gf(4);return Gf!=Float32Array&&(k[1]=0,k[2]=0),k[0]=1,k[3]=1,k}function Lv(k,C,H){var ne=C[0],xe=C[1],Re=C[2],qe=C[3],pt=Math.sin(H),Dt=Math.cos(H);return k[0]=ne*Dt+Re*pt,k[1]=xe*Dt+qe*pt,k[2]=ne*-pt+Re*Dt,k[3]=xe*-pt+qe*Dt,k}function ph(){var k=new Gf(9);return Gf!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0),k[0]=1,k[4]=1,k[8]=1,k}function iv(k,C){var H=Math.sin(C),ne=Math.cos(C);return k[0]=ne,k[1]=H,k[2]=0,k[3]=-H,k[4]=ne,k[5]=0,k[6]=0,k[7]=0,k[8]=1,k}function nm(){var k=new Gf(16);return Gf!=Float32Array&&(k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[11]=0,k[12]=0,k[13]=0,k[14]=0),k[0]=1,k[5]=1,k[10]=1,k[15]=1,k}function om(k){var C=new Gf(16);return C[0]=k[0],C[1]=k[1],C[2]=k[2],C[3]=k[3],C[4]=k[4],C[5]=k[5],C[6]=k[6],C[7]=k[7],C[8]=k[8],C[9]=k[9],C[10]=k[10],C[11]=k[11],C[12]=k[12],C[13]=k[13],C[14]=k[14],C[15]=k[15],C}function Pv(k){return k[0]=1,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=1,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[10]=1,k[11]=0,k[12]=0,k[13]=0,k[14]=0,k[15]=1,k}function nv(k,C){var H=C[0],ne=C[1],xe=C[2],Re=C[3],qe=C[4],pt=C[5],Dt=C[6],Gt=C[7],tr=C[8],Pr=C[9],Zr=C[10],Vr=C[11],ua=C[12],Oa=C[13],Mi=C[14],ii=C[15],$i=H*pt-ne*qe,Oi=H*Dt-xe*qe,Ji=H*Gt-Re*qe,ln=ne*Dt-xe*pt,Tn=ne*Gt-Re*pt,Vn=xe*Gt-Re*Dt,Nn=tr*Oa-Pr*ua,So=tr*Mi-Zr*ua,oo=tr*ii-Vr*ua,go=Pr*Mi-Zr*Oa,ks=Pr*ii-Vr*Oa,Mo=Zr*ii-Vr*Mi,Po=$i*Mo-Oi*ks+Ji*go+ln*oo-Tn*So+Vn*Nn;return Po?(Po=1/Po,k[0]=(pt*Mo-Dt*ks+Gt*go)*Po,k[1]=(xe*ks-ne*Mo-Re*go)*Po,k[2]=(Oa*Vn-Mi*Tn+ii*ln)*Po,k[3]=(Zr*Tn-Pr*Vn-Vr*ln)*Po,k[4]=(Dt*oo-qe*Mo-Gt*So)*Po,k[5]=(H*Mo-xe*oo+Re*So)*Po,k[6]=(Mi*Ji-ua*Vn-ii*Oi)*Po,k[7]=(tr*Vn-Zr*Ji+Vr*Oi)*Po,k[8]=(qe*ks-pt*oo+Gt*Nn)*Po,k[9]=(ne*oo-H*ks-Re*Nn)*Po,k[10]=(ua*Tn-Oa*Ji+ii*$i)*Po,k[11]=(Pr*Ji-tr*Tn-Vr*$i)*Po,k[12]=(pt*So-qe*go-Dt*Nn)*Po,k[13]=(H*go-ne*So+xe*Nn)*Po,k[14]=(Oa*Oi-ua*ln-Mi*$i)*Po,k[15]=(tr*ln-Pr*Oi+Zr*$i)*Po,k):null}function ov(k,C,H){var ne=C[0],xe=C[1],Re=C[2],qe=C[3],pt=C[4],Dt=C[5],Gt=C[6],tr=C[7],Pr=C[8],Zr=C[9],Vr=C[10],ua=C[11],Oa=C[12],Mi=C[13],ii=C[14],$i=C[15],Oi=H[0],Ji=H[1],ln=H[2],Tn=H[3];return k[0]=Oi*ne+Ji*pt+ln*Pr+Tn*Oa,k[1]=Oi*xe+Ji*Dt+ln*Zr+Tn*Mi,k[2]=Oi*Re+Ji*Gt+ln*Vr+Tn*ii,k[3]=Oi*qe+Ji*tr+ln*ua+Tn*$i,Oi=H[4],Ji=H[5],ln=H[6],Tn=H[7],k[4]=Oi*ne+Ji*pt+ln*Pr+Tn*Oa,k[5]=Oi*xe+Ji*Dt+ln*Zr+Tn*Mi,k[6]=Oi*Re+Ji*Gt+ln*Vr+Tn*ii,k[7]=Oi*qe+Ji*tr+ln*ua+Tn*$i,Oi=H[8],Ji=H[9],ln=H[10],Tn=H[11],k[8]=Oi*ne+Ji*pt+ln*Pr+Tn*Oa,k[9]=Oi*xe+Ji*Dt+ln*Zr+Tn*Mi,k[10]=Oi*Re+Ji*Gt+ln*Vr+Tn*ii,k[11]=Oi*qe+Ji*tr+ln*ua+Tn*$i,Oi=H[12],Ji=H[13],ln=H[14],Tn=H[15],k[12]=Oi*ne+Ji*pt+ln*Pr+Tn*Oa,k[13]=Oi*xe+Ji*Dt+ln*Zr+Tn*Mi,k[14]=Oi*Re+Ji*Gt+ln*Vr+Tn*ii,k[15]=Oi*qe+Ji*tr+ln*ua+Tn*$i,k}function cc(k,C,H){var ne=H[0],xe=H[1],Re=H[2],qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii;return C===k?(k[12]=C[0]*ne+C[4]*xe+C[8]*Re+C[12],k[13]=C[1]*ne+C[5]*xe+C[9]*Re+C[13],k[14]=C[2]*ne+C[6]*xe+C[10]*Re+C[14],k[15]=C[3]*ne+C[7]*xe+C[11]*Re+C[15]):(qe=C[0],pt=C[1],Dt=C[2],Gt=C[3],tr=C[4],Pr=C[5],Zr=C[6],Vr=C[7],ua=C[8],Oa=C[9],Mi=C[10],ii=C[11],k[0]=qe,k[1]=pt,k[2]=Dt,k[3]=Gt,k[4]=tr,k[5]=Pr,k[6]=Zr,k[7]=Vr,k[8]=ua,k[9]=Oa,k[10]=Mi,k[11]=ii,k[12]=qe*ne+tr*xe+ua*Re+C[12],k[13]=pt*ne+Pr*xe+Oa*Re+C[13],k[14]=Dt*ne+Zr*xe+Mi*Re+C[14],k[15]=Gt*ne+Vr*xe+ii*Re+C[15]),k}function fu(k,C,H){var ne=H[0],xe=H[1],Re=H[2];return k[0]=C[0]*ne,k[1]=C[1]*ne,k[2]=C[2]*ne,k[3]=C[3]*ne,k[4]=C[4]*xe,k[5]=C[5]*xe,k[6]=C[6]*xe,k[7]=C[7]*xe,k[8]=C[8]*Re,k[9]=C[9]*Re,k[10]=C[10]*Re,k[11]=C[11]*Re,k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15],k}function Dh(k,C,H){var ne=Math.sin(H),xe=Math.cos(H),Re=C[4],qe=C[5],pt=C[6],Dt=C[7],Gt=C[8],tr=C[9],Pr=C[10],Zr=C[11];return C!==k&&(k[0]=C[0],k[1]=C[1],k[2]=C[2],k[3]=C[3],k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15]),k[4]=Re*xe+Gt*ne,k[5]=qe*xe+tr*ne,k[6]=pt*xe+Pr*ne,k[7]=Dt*xe+Zr*ne,k[8]=Gt*xe-Re*ne,k[9]=tr*xe-qe*ne,k[10]=Pr*xe-pt*ne,k[11]=Zr*xe-Dt*ne,k}function Iv(k,C,H){var ne=Math.sin(H),xe=Math.cos(H),Re=C[0],qe=C[1],pt=C[2],Dt=C[3],Gt=C[4],tr=C[5],Pr=C[6],Zr=C[7];return C!==k&&(k[8]=C[8],k[9]=C[9],k[10]=C[10],k[11]=C[11],k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15]),k[0]=Re*xe+Gt*ne,k[1]=qe*xe+tr*ne,k[2]=pt*xe+Pr*ne,k[3]=Dt*xe+Zr*ne,k[4]=Gt*xe-Re*ne,k[5]=tr*xe-qe*ne,k[6]=Pr*xe-pt*ne,k[7]=Zr*xe-Dt*ne,k}function sm(k,C,H,ne,xe){var Re=1/Math.tan(C/2),qe;return k[0]=Re/H,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=Re,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[11]=-1,k[12]=0,k[13]=0,k[15]=0,xe!=null&&xe!==1/0?(qe=1/(ne-xe),k[10]=(xe+ne)*qe,k[14]=2*xe*ne*qe):(k[10]=-1,k[14]=-2*ne),k}function Mu(k,C,H,ne,xe,Re,qe){var pt=1/(C-H),Dt=1/(ne-xe),Gt=1/(Re-qe);return k[0]=-2*pt,k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[5]=-2*Dt,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[10]=2*Gt,k[11]=0,k[12]=(C+H)*pt,k[13]=(xe+ne)*Dt,k[14]=(qe+Re)*Gt,k[15]=1,k}var w0=ov;function sv(){var k=new Gf(3);return Gf!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0),k}function xg(k){var C=new Gf(3);return C[0]=k[0],C[1]=k[1],C[2]=k[2],C}function Pp(k,C,H){return k[0]=C[0]+H[0],k[1]=C[1]+H[1],k[2]=C[2]+H[2],k}function lv(k,C,H){return k[0]=C[0]-H[0],k[1]=C[1]-H[1],k[2]=C[2]-H[2],k}function bg(k,C,H){return k[0]=C[0]*H,k[1]=C[1]*H,k[2]=C[2]*H,k}function T0(k,C){var H=C[0],ne=C[1],xe=C[2],Re=H*H+ne*ne+xe*xe;return Re>0&&(Re=1/Math.sqrt(Re)),k[0]=C[0]*Re,k[1]=C[1]*Re,k[2]=C[2]*Re,k}function UT(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function jT(k,C,H){var ne=C[0],xe=C[1],Re=C[2],qe=H[0],pt=H[1],Dt=H[2];return k[0]=xe*Dt-Re*pt,k[1]=Re*qe-ne*Dt,k[2]=ne*pt-xe*qe,k}function qT(k,C,H){var ne=C[0],xe=C[1],Re=C[2];return k[0]=ne*H[0]+xe*H[3]+Re*H[6],k[1]=ne*H[1]+xe*H[4]+Re*H[7],k[2]=ne*H[2]+xe*H[5]+Re*H[8],k}var VT=lv,vk=function(){var k=sv();return function(C,H,ne,xe,Re,qe){var pt,Dt;for(H||(H=3),ne||(ne=0),xe?Dt=Math.min(xe*H+ne,C.length):Dt=C.length,pt=ne;pt<Dt;pt+=H)k[0]=C[pt],k[1]=C[pt+1],k[2]=C[pt+2],Re(k,k,qe),C[pt]=k[0],C[pt+1]=k[1],C[pt+2]=k[2];return C}}();function GT(){var k=new Gf(4);return Gf!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0,k[3]=0),k}function HT(k,C,H){return k[0]=C[0]*H,k[1]=C[1]*H,k[2]=C[2]*H,k[3]=C[3]*H,k}function WT(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]+k[3]*C[3]}function Rv(k,C,H){var ne=C[0],xe=C[1],Re=C[2],qe=C[3];return k[0]=H[0]*ne+H[4]*xe+H[8]*Re+H[12]*qe,k[1]=H[1]*ne+H[5]*xe+H[9]*Re+H[13]*qe,k[2]=H[2]*ne+H[6]*xe+H[10]*Re+H[14]*qe,k[3]=H[3]*ne+H[7]*xe+H[11]*Re+H[15]*qe,k}var A0=function(){var k=GT();return function(C,H,ne,xe,Re,qe){var pt,Dt;for(H||(H=4),ne||(ne=0),xe?Dt=Math.min(xe*H+ne,C.length):Dt=C.length,pt=ne;pt<Dt;pt+=H)k[0]=C[pt],k[1]=C[pt+1],k[2]=C[pt+2],k[3]=C[pt+3],Re(k,k,qe),C[pt]=k[0],C[pt+1]=k[1],C[pt+2]=k[2],C[pt+3]=k[3];return C}}();function Lx(){var k=new Gf(2);return Gf!=Float32Array&&(k[0]=0,k[1]=0),k}function P1(k){var C=k[0],H=k[1];return C*C+H*H}var I1=P1,mk=function(){var k=Lx();return function(C,H,ne,xe,Re,qe){var pt,Dt;for(H||(H=2),ne||(ne=0),xe?Dt=Math.min(xe*H+ne,C.length):Dt=C.length,pt=ne;pt<Dt;pt+=H)k[0]=C[pt],k[1]=C[pt+1],Re(k,k,qe),C[pt]=k[0],C[pt+1]=k[1];return C}}(),XT=function(k){function C(H){k.call(this,H,Vd)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new Ps(ne)},C.prototype.queryRadius=function(ne){var xe=ne;return Rh("circle-radius",this,xe)+Rh("circle-stroke-width",this,xe)+Cp(this.paint.get("circle-translate"))},C.prototype.queryIntersectsFeature=function(ne,xe,Re,qe,pt,Dt,Gt,tr){for(var Pr=Vp(ne,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Dt.angle,Gt),Zr=this.paint.get("circle-radius").evaluate(xe,Re),Vr=this.paint.get("circle-stroke-width").evaluate(xe,Re),ua=Zr+Vr,Oa=this.paint.get("circle-pitch-alignment")==="map",Mi=Oa?Pr:Ix(Pr,tr),ii=Oa?ua*Gt:ua,$i=0,Oi=qe;$i<Oi.length;$i+=1)for(var Ji=Oi[$i],ln=0,Tn=Ji;ln<Tn.length;ln+=1){var Vn=Tn[ln],Nn=Oa?Vn:Px(Vn,tr),So=ii,oo=Rv([],[Vn.x,Vn.y,0,1],tr);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?So*=oo[3]/Dt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(So*=Dt.cameraToCenterDistance/oo[3]),Ms(Mi,Nn,So))return!0}return!1},C}(Ya);function Px(k,C){var H=Rv([],[k.x,k.y,0,1],C);return new n(H[0]/H[3],H[1]/H[3])}function Ix(k,C){return k.map(function(H){return Px(H,C)})}var R1=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Ps);de("HeatmapBucket",R1,{omit:["layers"]});function zh(k,C,H,ne){var xe=C.width,Re=C.height;if(!ne)ne=new Uint8Array(xe*Re*H);else if(ne instanceof Uint8ClampedArray)ne=new Uint8Array(ne.buffer);else if(ne.length!==xe*Re*H)throw new RangeError("mismatched image size");return k.width=xe,k.height=Re,k.data=ne,k}function wg(k,C,H){var ne=C.width,xe=C.height;if(!(ne===k.width&&xe===k.height)){var Re=zh({},{width:ne,height:xe},H);Tg(k,Re,{x:0,y:0},{x:0,y:0},{width:Math.min(k.width,ne),height:Math.min(k.height,xe)},H),k.width=ne,k.height=xe,k.data=Re.data}}function Tg(k,C,H,ne,xe,Re){if(xe.width===0||xe.height===0)return C;if(xe.width>k.width||xe.height>k.height||H.x>k.width-xe.width||H.y>k.height-xe.height)throw new RangeError("out of range source coordinates for image copy");if(xe.width>C.width||xe.height>C.height||ne.x>C.width-xe.width||ne.y>C.height-xe.height)throw new RangeError("out of range destination coordinates for image copy");for(var qe=k.data,pt=C.data,Dt=0;Dt<xe.height;Dt++)for(var Gt=((H.y+Dt)*k.width+H.x)*Re,tr=((ne.y+Dt)*C.width+ne.x)*Re,Pr=0;Pr<xe.width*Re;Pr++)pt[tr+Pr]=qe[Gt+Pr];return C}var Ip=function(C,H){zh(this,C,1,H)};Ip.prototype.resize=function(C){wg(this,C,1)},Ip.prototype.clone=function(){return new Ip({width:this.width,height:this.height},new Uint8Array(this.data))},Ip.copy=function(C,H,ne,xe,Re){Tg(C,H,ne,xe,Re,1)};var eh=function(C,H){zh(this,C,4,H)};eh.prototype.resize=function(C){wg(this,C,4)},eh.prototype.replace=function(C,H){H?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},eh.prototype.clone=function(){return new eh({width:this.width,height:this.height},new Uint8Array(this.data))},eh.copy=function(C,H,ne,xe,Re){Tg(C,H,ne,xe,Re,4)},de("AlphaImage",Ip),de("RGBAImage",eh);var S0=new ma({"heatmap-radius":new Zt(Gi.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Zt(Gi.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new it(Gi.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wa(Gi.paint_heatmap["heatmap-color"]),"heatmap-opacity":new it(Gi.paint_heatmap["heatmap-opacity"])}),lm={paint:S0};function M0(k){var C={},H=k.resolution||256,ne=k.clips?k.clips.length:1,xe=k.image||new eh({width:H,height:ne}),Re=function($i,Oi,Ji){C[k.evaluationKey]=Ji;var ln=k.expression.evaluate(C);xe.data[$i+Oi+0]=Math.floor(ln.r*255/ln.a),xe.data[$i+Oi+1]=Math.floor(ln.g*255/ln.a),xe.data[$i+Oi+2]=Math.floor(ln.b*255/ln.a),xe.data[$i+Oi+3]=Math.floor(ln.a*255)};if(k.clips)for(var Gt=0,tr=0;Gt<ne;++Gt,tr+=H*4)for(var Pr=0,Zr=0;Pr<H;Pr++,Zr+=4){var Vr=Pr/(H-1),ua=k.clips[Gt],Oa=ua.start,Mi=ua.end,ii=Oa*(1-Vr)+Mi*Vr;Re(tr,Zr,ii)}else for(var qe=0,pt=0;qe<H;qe++,pt+=4){var Dt=qe/(H-1);Re(0,pt,Dt)}return xe}var Ag=function(k){function C(H){k.call(this,H,lm),this._updateColorRamp()}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new R1(ne)},C.prototype._handleSpecialPaintPropertyUpdate=function(ne){ne==="heatmap-color"&&this._updateColorRamp()},C.prototype._updateColorRamp=function(){var ne=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=M0({expression:ne,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},C.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},C.prototype.queryRadius=function(){return 0},C.prototype.queryIntersectsFeature=function(){return!1},C.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},C}(Ya),ZT=new ma({"hillshade-illumination-direction":new it(Gi.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new it(Gi.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new it(Gi.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new it(Gi.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new it(Gi.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new it(Gi.paint_hillshade["hillshade-accent-color"])}),YT={paint:ZT},Rx=function(k){function C(H){k.call(this,H,YT)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},C}(Ya),Dx=Ei([{name:"a_pos",components:2,type:"Int16"}],4),KT=Dx.members,Sg=um,zx=um;function um(k,C,H){H=H||2;var ne=C&&C.length,xe=ne?C[0]*H:k.length,Re=Mg(k,0,xe,H,!0),qe=[];if(!Re||Re.next===Re.prev)return qe;var pt,Dt,Gt,tr,Pr,Zr,Vr;if(ne&&(Re=cv(k,C,Re,H)),k.length>80*H){pt=Gt=k[0],Dt=tr=k[1];for(var ua=H;ua<xe;ua+=H)Pr=k[ua],Zr=k[ua+1],Pr<pt&&(pt=Pr),Zr<Dt&&(Dt=Zr),Pr>Gt&&(Gt=Pr),Zr>tr&&(tr=Zr);Vr=Math.max(Gt-pt,tr-Dt),Vr=Vr!==0?1/Vr:0}return E0(Re,qe,H,pt,Dt,Vr),qe}function Mg(k,C,H,ne,xe){var Re,qe;if(xe===U1(k,C,H,ne)>0)for(Re=C;Re<H;Re+=ne)qe=Ux(Re,k[Re],k[Re+1],qe);else for(Re=H-ne;Re>=C;Re-=ne)qe=Ux(Re,k[Re],k[Re+1],qe);return qe&&C0(qe,qe.next)&&(I0(qe),qe=qe.next),qe}function uv(k,C){if(!k)return k;C||(C=k);var H=k,ne;do if(ne=!1,!H.steiner&&(C0(H,H.next)||cf(H.prev,H,H.next)===0)){if(I0(H),H=C=H.prev,H===H.next)break;ne=!0}else H=H.next;while(ne||H!==C);return C}function E0(k,C,H,ne,xe,Re,qe){if(k){!qe&&Re&&Eg(k,ne,xe,Re);for(var pt=k,Dt,Gt;k.prev!==k.next;){if(Dt=k.prev,Gt=k.next,Re?Ox(k,ne,xe,Re):Fx(k)){C.push(Dt.i/H),C.push(k.i/H),C.push(Gt.i/H),I0(k),k=Gt.next,pt=Gt.next;continue}if(k=Gt,k===pt){qe?qe===1?(k=k0(uv(k),C,H),E0(k,C,H,ne,xe,Re,2)):qe===2&&yd(k,C,H,ne,xe,Re):E0(uv(k),C,H,ne,xe,Re,1);break}}}}function Fx(k){var C=k.prev,H=k,ne=k.next;if(cf(C,H,ne)>=0)return!1;for(var xe=k.next.next;xe!==k.prev;){if(fv(C.x,C.y,H.x,H.y,ne.x,ne.y,xe.x,xe.y)&&cf(xe.prev,xe,xe.next)>=0)return!1;xe=xe.next}return!0}function Ox(k,C,H,ne){var xe=k.prev,Re=k,qe=k.next;if(cf(xe,Re,qe)>=0)return!1;for(var pt=xe.x<Re.x?xe.x<qe.x?xe.x:qe.x:Re.x<qe.x?Re.x:qe.x,Dt=xe.y<Re.y?xe.y<qe.y?xe.y:qe.y:Re.y<qe.y?Re.y:qe.y,Gt=xe.x>Re.x?xe.x>qe.x?xe.x:qe.x:Re.x>qe.x?Re.x:qe.x,tr=xe.y>Re.y?xe.y>qe.y?xe.y:qe.y:Re.y>qe.y?Re.y:qe.y,Pr=F1(pt,Dt,C,H,ne),Zr=F1(Gt,tr,C,H,ne),Vr=k.prevZ,ua=k.nextZ;Vr&&Vr.z>=Pr&&ua&&ua.z<=Zr;){if(Vr!==k.prev&&Vr!==k.next&&fv(xe.x,xe.y,Re.x,Re.y,qe.x,qe.y,Vr.x,Vr.y)&&cf(Vr.prev,Vr,Vr.next)>=0||(Vr=Vr.prevZ,ua!==k.prev&&ua!==k.next&&fv(xe.x,xe.y,Re.x,Re.y,qe.x,qe.y,ua.x,ua.y)&&cf(ua.prev,ua,ua.next)>=0))return!1;ua=ua.nextZ}for(;Vr&&Vr.z>=Pr;){if(Vr!==k.prev&&Vr!==k.next&&fv(xe.x,xe.y,Re.x,Re.y,qe.x,qe.y,Vr.x,Vr.y)&&cf(Vr.prev,Vr,Vr.next)>=0)return!1;Vr=Vr.prevZ}for(;ua&&ua.z<=Zr;){if(ua!==k.prev&&ua!==k.next&&fv(xe.x,xe.y,Re.x,Re.y,qe.x,qe.y,ua.x,ua.y)&&cf(ua.prev,ua,ua.next)>=0)return!1;ua=ua.nextZ}return!0}function k0(k,C,H){var ne=k;do{var xe=ne.prev,Re=ne.next.next;!C0(xe,Re)&&kg(xe,ne,ne.next,Re)&&P0(xe,Re)&&P0(Re,xe)&&(C.push(xe.i/H),C.push(ne.i/H),C.push(Re.i/H),I0(ne),I0(ne.next),ne=k=Re),ne=ne.next}while(ne!==k);return uv(ne)}function yd(k,C,H,ne,xe,Re){var qe=k;do{for(var pt=qe.next.next;pt!==qe.prev;){if(qe.i!==pt.i&&cm(qe,pt)){var Dt=B1(qe,pt);qe=uv(qe,qe.next),Dt=uv(Dt,Dt.next),E0(qe,C,H,ne,xe,Re),E0(Dt,C,H,ne,xe,Re);return}pt=pt.next}qe=qe.next}while(qe!==k)}function cv(k,C,H,ne){var xe=[],Re,qe,pt,Dt,Gt;for(Re=0,qe=C.length;Re<qe;Re++)pt=C[Re]*ne,Dt=Re<qe-1?C[Re+1]*ne:k.length,Gt=Mg(k,pt,Dt,ne,!1),Gt===Gt.next&&(Gt.steiner=!0),xe.push(O1(Gt));for(xe.sort(Bx),Re=0;Re<xe.length;Re++)D1(xe[Re],H),H=uv(H,H.next);return H}function Bx(k,C){return k.x-C.x}function D1(k,C){if(C=JT(k,C),C){var H=B1(C,k);uv(C,C.next),uv(H,H.next)}}function JT(k,C){var H=C,ne=k.x,xe=k.y,Re=-1/0,qe;do{if(xe<=H.y&&xe>=H.next.y&&H.next.y!==H.y){var pt=H.x+(xe-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(pt<=ne&&pt>Re){if(Re=pt,pt===ne){if(xe===H.y)return H;if(xe===H.next.y)return H.next}qe=H.x<H.next.x?H:H.next}}H=H.next}while(H!==C);if(!qe)return null;if(ne===Re)return qe;var Dt=qe,Gt=qe.x,tr=qe.y,Pr=1/0,Zr;H=qe;do ne>=H.x&&H.x>=Gt&&ne!==H.x&&fv(xe<tr?ne:Re,xe,Gt,tr,xe<tr?Re:ne,xe,H.x,H.y)&&(Zr=Math.abs(xe-H.y)/(ne-H.x),P0(H,k)&&(Zr<Pr||Zr===Pr&&(H.x>qe.x||H.x===qe.x&&$T(qe,H)))&&(qe=H,Pr=Zr)),H=H.next;while(H!==Dt);return qe}function $T(k,C){return cf(k.prev,k,C.prev)<0&&cf(C.next,k,k.next)<0}function Eg(k,C,H,ne){var xe=k;do xe.z===null&&(xe.z=F1(xe.x,xe.y,C,H,ne)),xe.prevZ=xe.prev,xe.nextZ=xe.next,xe=xe.next;while(xe!==k);xe.prevZ.nextZ=null,xe.prevZ=null,z1(xe)}function z1(k){var C,H,ne,xe,Re,qe,pt,Dt,Gt=1;do{for(H=k,k=null,Re=null,qe=0;H;){for(qe++,ne=H,pt=0,C=0;C<Gt&&(pt++,ne=ne.nextZ,!!ne);C++);for(Dt=Gt;pt>0||Dt>0&≠)pt!==0&&(Dt===0||!ne||H.z<=ne.z)?(xe=H,H=H.nextZ,pt--):(xe=ne,ne=ne.nextZ,Dt--),Re?Re.nextZ=xe:k=xe,xe.prevZ=Re,Re=xe;H=ne}Re.nextZ=null,Gt*=2}while(qe>1);return k}function F1(k,C,H,ne,xe){return k=32767*(k-H)*xe,C=32767*(C-ne)*xe,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function O1(k){var C=k,H=k;do(C.x<H.x||C.x===H.x&&C.y<H.y)&&(H=C),C=C.next;while(C!==k);return H}function fv(k,C,H,ne,xe,Re,qe,pt){return(xe-qe)*(C-pt)-(k-qe)*(Re-pt)>=0&&(k-qe)*(ne-pt)-(H-qe)*(C-pt)>=0&&(H-qe)*(Re-pt)-(xe-qe)*(ne-pt)>=0}function cm(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Nx(k,C)&&(P0(k,C)&&P0(C,k)&&QT(k,C)&&(cf(k.prev,k,C.prev)||cf(k,C.prev,C))||C0(k,C)&&cf(k.prev,k,k.next)>0&&cf(C.prev,C,C.next)>0)}function cf(k,C,H){return(C.y-k.y)*(H.x-C.x)-(C.x-k.x)*(H.y-C.y)}function C0(k,C){return k.x===C.x&&k.y===C.y}function kg(k,C,H,ne){var xe=Dv(cf(k,C,H)),Re=Dv(cf(k,C,ne)),qe=Dv(cf(H,ne,k)),pt=Dv(cf(H,ne,C));return!!(xe!==Re&&qe!==pt||xe===0&&L0(k,H,C)||Re===0&&L0(k,ne,C)||qe===0&&L0(H,k,ne)||pt===0&&L0(H,C,ne))}function L0(k,C,H){return C.x<=Math.max(k.x,H.x)&&C.x>=Math.min(k.x,H.x)&&C.y<=Math.max(k.y,H.y)&&C.y>=Math.min(k.y,H.y)}function Dv(k){return k>0?1:k<0?-1:0}function Nx(k,C){var H=k;do{if(H.i!==k.i&&H.next.i!==k.i&&H.i!==C.i&&H.next.i!==C.i&&kg(H,H.next,k,C))return!0;H=H.next}while(H!==k);return!1}function P0(k,C){return cf(k.prev,k,k.next)<0?cf(k,C,k.next)>=0&&cf(k,k.prev,C)>=0:cf(k,C,k.prev)<0||cf(k,k.next,C)<0}function QT(k,C){var H=k,ne=!1,xe=(k.x+C.x)/2,Re=(k.y+C.y)/2;do H.y>Re!=H.next.y>Re&&H.next.y!==H.y&&xe<(H.next.x-H.x)*(Re-H.y)/(H.next.y-H.y)+H.x&&(ne=!ne),H=H.next;while(H!==k);return ne}function B1(k,C){var H=new N1(k.i,k.x,k.y),ne=new N1(C.i,C.x,C.y),xe=k.next,Re=C.prev;return k.next=C,C.prev=k,H.next=xe,xe.prev=H,ne.next=H,H.prev=ne,Re.next=ne,ne.prev=Re,ne}function Ux(k,C,H,ne){var xe=new N1(k,C,H);return ne?(xe.next=ne.next,xe.prev=ne,ne.next.prev=xe,ne.next=xe):(xe.prev=xe,xe.next=xe),xe}function I0(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function N1(k,C,H){this.i=k,this.x=C,this.y=H,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}um.deviation=function(k,C,H,ne){var xe=C&&C.length,Re=xe?C[0]*H:k.length,qe=Math.abs(U1(k,0,Re,H));if(xe)for(var pt=0,Dt=C.length;pt<Dt;pt++){var Gt=C[pt]*H,tr=pt<Dt-1?C[pt+1]*H:k.length;qe-=Math.abs(U1(k,Gt,tr,H))}var Pr=0;for(pt=0;pt<ne.length;pt+=3){var Zr=ne[pt]*H,Vr=ne[pt+1]*H,ua=ne[pt+2]*H;Pr+=Math.abs((k[Zr]-k[ua])*(k[Vr+1]-k[Zr+1])-(k[Zr]-k[Vr])*(k[ua+1]-k[Zr+1]))}return qe===0&&Pr===0?0:Math.abs((Pr-qe)/qe)};function U1(k,C,H,ne){for(var xe=0,Re=C,qe=H-ne;Re<H;Re+=ne)xe+=(k[qe]-k[Re])*(k[Re+1]+k[qe+1]),qe=Re;return xe}um.flatten=function(k){for(var C=k[0][0].length,H={vertices:[],holes:[],dimensions:C},ne=0,xe=0;xe<k.length;xe++){for(var Re=0;Re<k[xe].length;Re++)for(var qe=0;qe<C;qe++)H.vertices.push(k[xe][Re][qe]);xe>0&&(ne+=k[xe-1].length,H.holes.push(ne))}return H},Sg.default=zx;function j1(k,C,H,ne,xe){Hd(k,C,H||0,ne||k.length-1,xe||jx)}function Hd(k,C,H,ne,xe){for(;ne>H;){if(ne-H>600){var Re=ne-H+1,qe=C-H+1,pt=Math.log(Re),Dt=.5*Math.exp(2*pt/3),Gt=.5*Math.sqrt(pt*Dt*(Re-Dt)/Re)*(qe-Re/2<0?-1:1),tr=Math.max(H,Math.floor(C-qe*Dt/Re+Gt)),Pr=Math.min(ne,Math.floor(C+(Re-qe)*Dt/Re+Gt));Hd(k,C,tr,Pr,xe)}var Zr=k[C],Vr=H,ua=ne;for(fm(k,H,C),xe(k[ne],Zr)>0&&fm(k,H,ne);Vr<ua;){for(fm(k,Vr,ua),Vr++,ua--;xe(k[Vr],Zr)<0;)Vr++;for(;xe(k[ua],Zr)>0;)ua--}xe(k[H],Zr)===0?fm(k,H,ua):(ua++,fm(k,ua,ne)),ua<=C&&(H=ua+1),C<=ua&&(ne=ua-1)}}function fm(k,C,H){var ne=k[C];k[C]=k[H],k[H]=ne}function jx(k,C){return k<C?-1:k>C?1:0}function Cg(k,C){var H=k.length;if(H<=1)return[k];for(var ne=[],xe,Re,qe=0;qe<H;qe++){var pt=$(k[qe]);pt!==0&&(k[qe].area=Math.abs(pt),Re===void 0&&(Re=pt<0),Re===pt<0?(xe&&ne.push(xe),xe=[k[qe]]):xe.push(k[qe]))}if(xe&&ne.push(xe),C>1)for(var Dt=0;Dt<ne.length;Dt++)ne[Dt].length<=C||(j1(ne[Dt],C,1,ne[Dt].length-1,qx),ne[Dt]=ne[Dt].slice(0,C));return ne}function qx(k,C){return C.area-k.area}function Lg(k,C,H){for(var ne=H.patternDependencies,xe=!1,Re=0,qe=C;Re<qe.length;Re+=1){var pt=qe[Re],Dt=pt.paint.get(k+"-pattern");Dt.isConstant()||(xe=!0);var Gt=Dt.constantOr(null);Gt&&(xe=!0,ne[Gt.to]=!0,ne[Gt.from]=!0)}return xe}function R0(k,C,H,ne,xe){for(var Re=xe.patternDependencies,qe=0,pt=C;qe<pt.length;qe+=1){var Dt=pt[qe],Gt=Dt.paint.get(k+"-pattern"),tr=Gt.value;if(tr.kind!=="constant"){var Pr=tr.evaluate({zoom:ne-1},H,{},xe.availableImages),Zr=tr.evaluate({zoom:ne},H,{},xe.availableImages),Vr=tr.evaluate({zoom:ne+1},H,{},xe.availableImages);Pr=Pr&&Pr.name?Pr.name:Pr,Zr=Zr&&Zr.name?Zr.name:Zr,Vr=Vr&&Vr.name?Vr.name:Vr,Re[Pr]=!0,Re[Zr]=!0,Re[Vr]=!0,H.patterns[Dt.id]={min:Pr,mid:Zr,max:Vr}}}return H}var D0=500,rd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ma,this.indexArray=new Xi,this.indexArray2=new Dn,this.programConfigurations=new Ga(C.layers,C.zoom),this.segments=new Co,this.segments2=new Co,this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};rd.prototype.populate=function(C,H,ne){this.hasPattern=Lg("fill",this.layers,H);for(var xe=this.layers[0].layout.get("fill-sort-key"),Re=[],qe=0,pt=C;qe<pt.length;qe+=1){var Dt=pt[qe],Gt=Dt.feature,tr=Dt.id,Pr=Dt.index,Zr=Dt.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,ua=_o(Gt,Vr);if(this.layers[0]._featureFilter.filter(new gn(this.zoom),ua,ne)){var Oa=xe?xe.evaluate(ua,{},ne,H.availableImages):void 0,Mi={id:tr,properties:Gt.properties,type:Gt.type,sourceLayerIndex:Zr,index:Pr,geometry:Vr?ua.geometry:fn(Gt),patterns:{},sortKey:Oa};Re.push(Mi)}}xe&&Re.sort(function(oo,go){return oo.sortKey-go.sortKey});for(var ii=0,$i=Re;ii<$i.length;ii+=1){var Oi=$i[ii],Ji=Oi,ln=Ji.geometry,Tn=Ji.index,Vn=Ji.sourceLayerIndex;if(this.hasPattern){var Nn=R0("fill",this.layers,Oi,this.zoom,H);this.patternFeatures.push(Nn)}else this.addFeature(Oi,ln,Tn,ne,{});var So=C[Tn].feature;H.featureIndex.insert(So,ln,Tn,Vn,this.index)}},rd.prototype.update=function(C,H,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,H,this.stateDependentLayers,ne)},rd.prototype.addFeatures=function(C,H,ne){for(var xe=0,Re=this.patternFeatures;xe<Re.length;xe+=1){var qe=Re[xe];this.addFeature(qe,qe.geometry,qe.index,H,ne)}},rd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},rd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},rd.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,KT),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.indexBuffer2=C.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(C),this.uploaded=!0},rd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},rd.prototype.addFeature=function(C,H,ne,xe,Re){for(var qe=0,pt=Cg(H,D0);qe<pt.length;qe+=1){for(var Dt=pt[qe],Gt=0,tr=0,Pr=Dt;tr<Pr.length;tr+=1){var Zr=Pr[tr];Gt+=Zr.length}for(var Vr=this.segments.prepareSegment(Gt,this.layoutVertexArray,this.indexArray),ua=Vr.vertexLength,Oa=[],Mi=[],ii=0,$i=Dt;ii<$i.length;ii+=1){var Oi=$i[ii];if(Oi.length!==0){Oi!==Dt[0]&&Mi.push(Oa.length/2);var Ji=this.segments2.prepareSegment(Oi.length,this.layoutVertexArray,this.indexArray2),ln=Ji.vertexLength;this.layoutVertexArray.emplaceBack(Oi[0].x,Oi[0].y),this.indexArray2.emplaceBack(ln+Oi.length-1,ln),Oa.push(Oi[0].x),Oa.push(Oi[0].y);for(var Tn=1;Tn<Oi.length;Tn++)this.layoutVertexArray.emplaceBack(Oi[Tn].x,Oi[Tn].y),this.indexArray2.emplaceBack(ln+Tn-1,ln+Tn),Oa.push(Oi[Tn].x),Oa.push(Oi[Tn].y);Ji.vertexLength+=Oi.length,Ji.primitiveLength+=Oi.length}}for(var Vn=Sg(Oa,Mi),Nn=0;Nn<Vn.length;Nn+=3)this.indexArray.emplaceBack(ua+Vn[Nn],ua+Vn[Nn+1],ua+Vn[Nn+2]);Vr.vertexLength+=Gt,Vr.primitiveLength+=Vn.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Re,xe)},de("FillBucket",rd,{omit:["layers","patternFeatures"]});var q1=new ma({"fill-sort-key":new Zt(Gi.layout_fill["fill-sort-key"])}),Vx=new ma({"fill-antialias":new it(Gi.paint_fill["fill-antialias"]),"fill-opacity":new Zt(Gi.paint_fill["fill-opacity"]),"fill-color":new Zt(Gi.paint_fill["fill-color"]),"fill-outline-color":new Zt(Gi.paint_fill["fill-outline-color"]),"fill-translate":new it(Gi.paint_fill["fill-translate"]),"fill-translate-anchor":new it(Gi.paint_fill["fill-translate-anchor"]),"fill-pattern":new fr(Gi.paint_fill["fill-pattern"])}),Gp={paint:Vx,layout:q1},z0=function(k){function C(H){k.call(this,H,Gp)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(ne,xe){k.prototype.recalculate.call(this,ne,xe);var Re=this.paint._values["fill-outline-color"];Re.value.kind==="constant"&&Re.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},C.prototype.createBucket=function(ne){return new rd(ne)},C.prototype.queryRadius=function(){return Cp(this.paint.get("fill-translate"))},C.prototype.queryIntersectsFeature=function(ne,xe,Re,qe,pt,Dt,Gt){var tr=Vp(ne,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Dt.angle,Gt);return Ys(tr,qe)},C.prototype.isTileClipped=function(){return!0},C}(Ya),Gx=Ei([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Hx=Gx.members,V1=zv;function zv(k,C,H,ne,xe){this.properties={},this.extent=H,this.type=0,this._pbf=k,this._geometry=-1,this._keys=ne,this._values=xe,k.readFields(Wx,this,C)}function Wx(k,C,H){k==1?C.id=H.readVarint():k==2?Xx(H,C):k==3?C.type=H.readVarint():k==4&&(C._geometry=H.pos)}function Xx(k,C){for(var H=k.readVarint()+k.pos;k.pos<H;){var ne=C._keys[k.readVarint()],xe=C._values[k.readVarint()];C.properties[ne]=xe}}zv.types=["Unknown","Point","LineString","Polygon"],zv.prototype.loadGeometry=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,H=1,ne=0,xe=0,Re=0,qe=[],pt;k.pos<C;){if(ne<=0){var Dt=k.readVarint();H=Dt&7,ne=Dt>>3}if(ne--,H===1||H===2)xe+=k.readSVarint(),Re+=k.readSVarint(),H===1&&(pt&&qe.push(pt),pt=[]),pt.push(new n(xe,Re));else if(H===7)pt&&pt.push(pt[0].clone());else throw new Error("unknown command "+H)}return pt&&qe.push(pt),qe},zv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,H=1,ne=0,xe=0,Re=0,qe=1/0,pt=-1/0,Dt=1/0,Gt=-1/0;k.pos<C;){if(ne<=0){var tr=k.readVarint();H=tr&7,ne=tr>>3}if(ne--,H===1||H===2)xe+=k.readSVarint(),Re+=k.readSVarint(),xe<qe&&(qe=xe),xe>pt&&(pt=xe),Re<Dt&&(Dt=Re),Re>Gt&&(Gt=Re);else if(H!==7)throw new Error("unknown command "+H)}return[qe,Dt,pt,Gt]},zv.prototype.toGeoJSON=function(k,C,H){var ne=this.extent*Math.pow(2,H),xe=this.extent*k,Re=this.extent*C,qe=this.loadGeometry(),pt=zv.types[this.type],Dt,Gt;function tr(Vr){for(var ua=0;ua<Vr.length;ua++){var Oa=Vr[ua],Mi=180-(Oa.y+Re)*360/ne;Vr[ua]=[(Oa.x+xe)*360/ne-180,360/Math.PI*Math.atan(Math.exp(Mi*Math.PI/180))-90]}}switch(this.type){case 1:var Pr=[];for(Dt=0;Dt<qe.length;Dt++)Pr[Dt]=qe[Dt][0];qe=Pr,tr(qe);break;case 2:for(Dt=0;Dt<qe.length;Dt++)tr(qe[Dt]);break;case 3:for(qe=eA(qe),Dt=0;Dt<qe.length;Dt++)for(Gt=0;Gt<qe[Dt].length;Gt++)tr(qe[Dt][Gt]);break}qe.length===1?qe=qe[0]:pt="Multi"+pt;var Zr={type:"Feature",geometry:{type:pt,coordinates:qe},properties:this.properties};return"id"in this&&(Zr.id=this.id),Zr};function eA(k){var C=k.length;if(C<=1)return[k];for(var H=[],ne,xe,Re=0;Re<C;Re++){var qe=Zx(k[Re]);qe!==0&&(xe===void 0&&(xe=qe<0),xe===qe<0?(ne&&H.push(ne),ne=[k[Re]]):ne.push(k[Re]))}return ne&&H.push(ne),H}function Zx(k){for(var C=0,H=0,ne=k.length,xe=ne-1,Re,qe;H<ne;xe=H++)Re=k[H],qe=k[xe],C+=(qe.x-Re.x)*(Re.y+qe.y);return C}var Wd=G1;function G1(k,C){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=k,this._keys=[],this._values=[],this._features=[],k.readFields(Yx,this,C),this.length=this._features.length}function Yx(k,C,H){k===15?C.version=H.readVarint():k===1?C.name=H.readString():k===5?C.extent=H.readVarint():k===2?C._features.push(H.pos):k===3?C._keys.push(H.readString()):k===4&&C._values.push(Kx(H))}function Kx(k){for(var C=null,H=k.readVarint()+k.pos;k.pos<H;){var ne=k.readVarint()>>3;C=ne===1?k.readString():ne===2?k.readFloat():ne===3?k.readDouble():ne===4?k.readVarint64():ne===5?k.readVarint():ne===6?k.readSVarint():ne===7?k.readBoolean():null}return C}G1.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new V1(this._pbf,C,this.extent,this._keys,this._values)};var Jx=tA;function tA(k,C){this.layers=k.readFields(rA,{},C)}function rA(k,C,H){if(k===3){var ne=new Wd(H,H.readVarint()+H.pos);ne.length&&(C[ne.name]=ne)}}var $x=Jx,hm=V1,Qx=Wd,Xd={VectorTile:$x,VectorTileFeature:hm,VectorTileLayer:Qx},eb=Xd.VectorTileFeature.types,Pg=500,pm=Math.pow(2,13);function hv(k,C,H,ne,xe,Re,qe,pt){k.emplaceBack(C,H,Math.floor(ne*pm)*2+qe,xe*pm*2,Re*pm*2,Math.round(pt))}var cd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(H){return H.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new di,this.indexArray=new Xi,this.programConfigurations=new Ga(C.layers,C.zoom),this.segments=new Co,this.stateDependentLayerIds=this.layers.filter(function(H){return H.isStateDependent()}).map(function(H){return H.id})};cd.prototype.populate=function(C,H,ne){this.features=[],this.hasPattern=Lg("fill-extrusion",this.layers,H);for(var xe=0,Re=C;xe<Re.length;xe+=1){var qe=Re[xe],pt=qe.feature,Dt=qe.id,Gt=qe.index,tr=qe.sourceLayerIndex,Pr=this.layers[0]._featureFilter.needGeometry,Zr=_o(pt,Pr);if(this.layers[0]._featureFilter.filter(new gn(this.zoom),Zr,ne)){var Vr={id:Dt,sourceLayerIndex:tr,index:Gt,geometry:Pr?Zr.geometry:fn(pt),properties:pt.properties,type:pt.type,patterns:{}};this.hasPattern?this.features.push(R0("fill-extrusion",this.layers,Vr,this.zoom,H)):this.addFeature(Vr,Vr.geometry,Gt,ne,{}),H.featureIndex.insert(pt,Vr.geometry,Gt,tr,this.index,!0)}}},cd.prototype.addFeatures=function(C,H,ne){for(var xe=0,Re=this.features;xe<Re.length;xe+=1){var qe=Re[xe],pt=qe.geometry;this.addFeature(qe,pt,qe.index,H,ne)}},cd.prototype.update=function(C,H,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,H,this.stateDependentLayers,ne)},cd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},cd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},cd.prototype.upload=function(C){this.uploaded||(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,Hx),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},cd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},cd.prototype.addFeature=function(C,H,ne,xe,Re){for(var qe=0,pt=Cg(H,Pg);qe<pt.length;qe+=1){for(var Dt=pt[qe],Gt=0,tr=0,Pr=Dt;tr<Pr.length;tr+=1){var Zr=Pr[tr];Gt+=Zr.length}for(var Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),ua=0,Oa=Dt;ua<Oa.length;ua+=1){var Mi=Oa[ua];if(Mi.length!==0&&!iA(Mi))for(var ii=0,$i=0;$i<Mi.length;$i++){var Oi=Mi[$i];if($i>=1){var Ji=Mi[$i-1];if(!aA(Oi,Ji)){Vr.vertexLength+4>Co.MAX_VERTEX_ARRAY_LENGTH&&(Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ln=Oi.sub(Ji)._perp()._unit(),Tn=Ji.dist(Oi);ii+Tn>32768&&(ii=0),hv(this.layoutVertexArray,Oi.x,Oi.y,ln.x,ln.y,0,0,ii),hv(this.layoutVertexArray,Oi.x,Oi.y,ln.x,ln.y,0,1,ii),ii+=Tn,hv(this.layoutVertexArray,Ji.x,Ji.y,ln.x,ln.y,0,0,ii),hv(this.layoutVertexArray,Ji.x,Ji.y,ln.x,ln.y,0,1,ii);var Vn=Vr.vertexLength;this.indexArray.emplaceBack(Vn,Vn+2,Vn+1),this.indexArray.emplaceBack(Vn+1,Vn+2,Vn+3),Vr.vertexLength+=4,Vr.primitiveLength+=2}}}}if(Vr.vertexLength+Gt>Co.MAX_VERTEX_ARRAY_LENGTH&&(Vr=this.segments.prepareSegment(Gt,this.layoutVertexArray,this.indexArray)),eb[C.type]==="Polygon"){for(var Nn=[],So=[],oo=Vr.vertexLength,go=0,ks=Dt;go<ks.length;go+=1){var Mo=ks[go];if(Mo.length!==0){Mo!==Dt[0]&&So.push(Nn.length/2);for(var Po=0;Po<Mo.length;Po++){var $s=Mo[Po];hv(this.layoutVertexArray,$s.x,$s.y,0,0,1,1,0),Nn.push($s.x),Nn.push($s.y)}}}for(var ws=Sg(Nn,So),Xl=0;Xl<ws.length;Xl+=3)this.indexArray.emplaceBack(oo+ws[Xl],oo+ws[Xl+2],oo+ws[Xl+1]);Vr.primitiveLength+=ws.length/3,Vr.vertexLength+=Gt}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Re,xe)},de("FillExtrusionBucket",cd,{omit:["layers","features"]});function aA(k,C){return k.x===C.x&&(k.x<0||k.x>ui)||k.y===C.y&&(k.y<0||k.y>ui)}function iA(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>ui})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>ui})}var dm=new ma({"fill-extrusion-opacity":new it(Gi["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Zt(Gi["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new it(Gi["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new it(Gi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new fr(Gi["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Zt(Gi["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Zt(Gi["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new it(Gi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),wh={paint:dm},pv=function(k){function C(H){k.call(this,H,wh)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(ne){return new cd(ne)},C.prototype.queryRadius=function(){return Cp(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(ne,xe,Re,qe,pt,Dt,Gt,tr){var Pr=Vp(ne,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Dt.angle,Gt),Zr=this.paint.get("fill-extrusion-height").evaluate(xe,Re),Vr=this.paint.get("fill-extrusion-base").evaluate(xe,Re),ua=nA(Pr,tr,Dt,0),Oa=W1(qe,Vr,Zr,tr),Mi=Oa[0],ii=Oa[1];return tb(Mi,ii,ua)},C}(Ya);function Fv(k,C){return k.x*C.x+k.y*C.y}function H1(k,C){if(k.length===1){for(var H=0,ne=C[H++],xe;!xe||ne.equals(xe);)if(xe=C[H++],!xe)return 1/0;for(;H<C.length;H++){var Re=C[H],qe=k[0],pt=xe.sub(ne),Dt=Re.sub(ne),Gt=qe.sub(ne),tr=Fv(pt,pt),Pr=Fv(pt,Dt),Zr=Fv(Dt,Dt),Vr=Fv(Gt,pt),ua=Fv(Gt,Dt),Oa=tr*Zr-Pr*Pr,Mi=(Zr*Vr-Pr*ua)/Oa,ii=(tr*ua-Pr*Vr)/Oa,$i=1-Mi-ii,Oi=ne.z*$i+xe.z*Mi+Re.z*ii;if(isFinite(Oi))return Oi}return 1/0}else{for(var Ji=1/0,ln=0,Tn=C;ln<Tn.length;ln+=1){var Vn=Tn[ln];Ji=Math.min(Ji,Vn.z)}return Ji}}function tb(k,C,H){var ne=1/0;Ys(H,C)&&(ne=H1(H,C[0]));for(var xe=0;xe<C.length;xe++)for(var Re=C[xe],qe=k[xe],pt=0;pt<Re.length-1;pt++){var Dt=Re[pt],Gt=Re[pt+1],tr=qe[pt],Pr=qe[pt+1],Zr=[Dt,Gt,Pr,tr,Dt];Do(H,Zr)&&(ne=Math.min(ne,H1(H,Zr)))}return ne===1/0?!1:ne}function W1(k,C,H,ne){for(var xe=[],Re=[],qe=ne[8]*C,pt=ne[9]*C,Dt=ne[10]*C,Gt=ne[11]*C,tr=ne[8]*H,Pr=ne[9]*H,Zr=ne[10]*H,Vr=ne[11]*H,ua=0,Oa=k;ua<Oa.length;ua+=1){for(var Mi=Oa[ua],ii=[],$i=[],Oi=0,Ji=Mi;Oi<Ji.length;Oi+=1){var ln=Ji[Oi],Tn=ln.x,Vn=ln.y,Nn=ne[0]*Tn+ne[4]*Vn+ne[12],So=ne[1]*Tn+ne[5]*Vn+ne[13],oo=ne[2]*Tn+ne[6]*Vn+ne[14],go=ne[3]*Tn+ne[7]*Vn+ne[15],ks=Nn+qe,Mo=So+pt,Po=oo+Dt,$s=go+Gt,ws=Nn+tr,Xl=So+Pr,zu=oo+Zr,Zl=go+Vr,Yl=new n(ks/$s,Mo/$s);Yl.z=Po/$s,ii.push(Yl);var Ol=new n(ws/Zl,Xl/Zl);Ol.z=zu/Zl,$i.push(Ol)}xe.push(ii),Re.push($i)}return[xe,Re]}function nA(k,C,H,ne){for(var xe=[],Re=0,qe=k;Re<qe.length;Re+=1){var pt=qe[Re],Dt=[pt.x,pt.y,ne,1];Rv(Dt,Dt,C),xe.push(new n(Dt[0]/Dt[3],Dt[1]/Dt[3]))}return xe}var rb=Ei([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),ab=rb.members,oA=Ei([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),ib=oA.members,X1=Xd.VectorTileFeature.types,Ig=63,nb=Math.cos(75/2*(Math.PI/180)),F0=15,Z1=20,ob=15,Rg=1/2,O0=Math.pow(2,ob-1)/Rg,Hf=function(C){var H=this;this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(ne){return ne.id}),this.index=C.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(ne){H.gradients[ne.id]={}}),this.layoutVertexArray=new Va,this.layoutVertexArray2=new Bi,this.indexArray=new Xi,this.programConfigurations=new Ga(C.layers,C.zoom),this.segments=new Co,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(ne){return ne.isStateDependent()}).map(function(ne){return ne.id})};Hf.prototype.populate=function(C,H,ne){this.hasPattern=Lg("line",this.layers,H);for(var xe=this.layers[0].layout.get("line-sort-key"),Re=[],qe=0,pt=C;qe<pt.length;qe+=1){var Dt=pt[qe],Gt=Dt.feature,tr=Dt.id,Pr=Dt.index,Zr=Dt.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,ua=_o(Gt,Vr);if(this.layers[0]._featureFilter.filter(new gn(this.zoom),ua,ne)){var Oa=xe?xe.evaluate(ua,{},ne):void 0,Mi={id:tr,properties:Gt.properties,type:Gt.type,sourceLayerIndex:Zr,index:Pr,geometry:Vr?ua.geometry:fn(Gt),patterns:{},sortKey:Oa};Re.push(Mi)}}xe&&Re.sort(function(oo,go){return oo.sortKey-go.sortKey});for(var ii=0,$i=Re;ii<$i.length;ii+=1){var Oi=$i[ii],Ji=Oi,ln=Ji.geometry,Tn=Ji.index,Vn=Ji.sourceLayerIndex;if(this.hasPattern){var Nn=R0("line",this.layers,Oi,this.zoom,H);this.patternFeatures.push(Nn)}else this.addFeature(Oi,ln,Tn,ne,{});var So=C[Tn].feature;H.featureIndex.insert(So,ln,Tn,Vn,this.index)}},Hf.prototype.update=function(C,H,ne){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(C,H,this.stateDependentLayers,ne)},Hf.prototype.addFeatures=function(C,H,ne){for(var xe=0,Re=this.patternFeatures;xe<Re.length;xe+=1){var qe=Re[xe];this.addFeature(qe,qe.geometry,qe.index,H,ne)}},Hf.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Hf.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Hf.prototype.upload=function(C){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=C.createVertexBuffer(this.layoutVertexArray2,ib)),this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,ab),this.indexBuffer=C.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(C),this.uploaded=!0},Hf.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Hf.prototype.lineFeatureClips=function(C){if(C.properties&&C.properties.hasOwnProperty("mapbox_clip_start")&&C.properties.hasOwnProperty("mapbox_clip_end")){var H=+C.properties.mapbox_clip_start,ne=+C.properties.mapbox_clip_end;return{start:H,end:ne}}},Hf.prototype.addFeature=function(C,H,ne,xe,Re){var qe=this.layers[0].layout,pt=qe.get("line-join").evaluate(C,{}),Dt=qe.get("line-cap"),Gt=qe.get("line-miter-limit"),tr=qe.get("line-round-limit");this.lineClips=this.lineFeatureClips(C);for(var Pr=0,Zr=H;Pr<Zr.length;Pr+=1){var Vr=Zr[Pr];this.addLine(Vr,C,pt,Dt,Gt,tr)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,ne,Re,xe)},Hf.prototype.addLine=function(C,H,ne,xe,Re,qe){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var pt=0;pt<C.length-1;pt++)this.totalDistance+=C[pt].dist(C[pt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var Dt=X1[H.type]==="Polygon",Gt=C.length;Gt>=2&&C[Gt-1].equals(C[Gt-2]);)Gt--;for(var tr=0;tr<Gt-1&&C[tr].equals(C[tr+1]);)tr++;if(!(Gt<(Dt?3:2))){ne==="bevel"&&(Re=1.05);var Pr=this.overscaling<=16?F0*ui/(512*this.overscaling):0,Zr=this.segments.prepareSegment(Gt*10,this.layoutVertexArray,this.indexArray),Vr,ua=void 0,Oa=void 0,Mi=void 0,ii=void 0;this.e1=this.e2=-1,Dt&&(Vr=C[Gt-2],ii=C[tr].sub(Vr)._unit()._perp());for(var $i=tr;$i<Gt;$i++)if(Oa=$i===Gt-1?Dt?C[tr+1]:void 0:C[$i+1],!(Oa&&C[$i].equals(Oa))){ii&&(Mi=ii),Vr&&(ua=Vr),Vr=C[$i],ii=Oa?Oa.sub(Vr)._unit()._perp():Mi,Mi=Mi||ii;var Oi=Mi.add(ii);(Oi.x!==0||Oi.y!==0)&&Oi._unit();var Ji=Mi.x*ii.x+Mi.y*ii.y,ln=Oi.x*ii.x+Oi.y*ii.y,Tn=ln!==0?1/ln:1/0,Vn=2*Math.sqrt(2-2*ln),Nn=ln<nb&&ua&&Oa,So=Mi.x*ii.y-Mi.y*ii.x>0;if(Nn&&$i>tr){var oo=Vr.dist(ua);if(oo>2*Pr){var go=Vr.sub(Vr.sub(ua)._mult(Pr/oo)._round());this.updateDistance(ua,go),this.addCurrentVertex(go,Mi,0,0,Zr),ua=go}}var ks=ua&&Oa,Mo=ks?ne:Dt?"butt":xe;if(ks&&Mo==="round"&&(Tn<qe?Mo="miter":Tn<=2&&(Mo="fakeround")),Mo==="miter"&&Tn>Re&&(Mo="bevel"),Mo==="bevel"&&(Tn>2&&(Mo="flipbevel"),Tn<Re&&(Mo="miter")),ua&&this.updateDistance(ua,Vr),Mo==="miter")Oi._mult(Tn),this.addCurrentVertex(Vr,Oi,0,0,Zr);else if(Mo==="flipbevel"){if(Tn>100)Oi=ii.mult(-1);else{var Po=Tn*Mi.add(ii).mag()/Mi.sub(ii).mag();Oi._perp()._mult(Po*(So?-1:1))}this.addCurrentVertex(Vr,Oi,0,0,Zr),this.addCurrentVertex(Vr,Oi.mult(-1),0,0,Zr)}else if(Mo==="bevel"||Mo==="fakeround"){var $s=-Math.sqrt(Tn*Tn-1),ws=So?$s:0,Xl=So?0:$s;if(ua&&this.addCurrentVertex(Vr,Mi,ws,Xl,Zr),Mo==="fakeround")for(var zu=Math.round(Vn*180/Math.PI/Z1),Zl=1;Zl<zu;Zl++){var Yl=Zl/zu;if(Yl!==.5){var Ol=Yl-.5,$u=1.0904+Ji*(-3.2452+Ji*(3.55645-Ji*1.43519)),hc=.848013+Ji*(-1.06021+Ji*.215638);Yl=Yl+Yl*Ol*(Yl-1)*($u*Ol*Ol+hc)}var hf=ii.sub(Mi)._mult(Yl)._add(Mi)._unit()._mult(So?-1:1);this.addHalfVertex(Vr,hf.x,hf.y,!1,So,0,Zr)}Oa&&this.addCurrentVertex(Vr,ii,-ws,-Xl,Zr)}else if(Mo==="butt")this.addCurrentVertex(Vr,Oi,0,0,Zr);else if(Mo==="square"){var _f=ua?1:-1;this.addCurrentVertex(Vr,Oi,_f,_f,Zr)}else Mo==="round"&&(ua&&(this.addCurrentVertex(Vr,Mi,0,0,Zr),this.addCurrentVertex(Vr,Mi,1,1,Zr,!0)),Oa&&(this.addCurrentVertex(Vr,ii,-1,-1,Zr,!0),this.addCurrentVertex(Vr,ii,0,0,Zr)));if(Nn&&$i<Gt-1){var gh=Vr.dist(Oa);if(gh>2*Pr){var Zf=Vr.add(Oa.sub(Vr)._mult(Pr/gh)._round());this.updateDistance(Vr,Zf),this.addCurrentVertex(Zf,ii,0,0,Zr),Vr=Zf}}}}},Hf.prototype.addCurrentVertex=function(C,H,ne,xe,Re,qe){qe===void 0&&(qe=!1);var pt=H.x+H.y*ne,Dt=H.y-H.x*ne,Gt=-H.x+H.y*xe,tr=-H.y-H.x*xe;this.addHalfVertex(C,pt,Dt,qe,!1,ne,Re),this.addHalfVertex(C,Gt,tr,qe,!0,-xe,Re),this.distance>O0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,H,ne,xe,Re,qe))},Hf.prototype.addHalfVertex=function(C,H,ne,xe,Re,qe,pt){var Dt=C.x,Gt=C.y,tr=this.lineClips?this.scaledDistance*(O0-1):this.scaledDistance,Pr=tr*Rg;if(this.layoutVertexArray.emplaceBack((Dt<<1)+(xe?1:0),(Gt<<1)+(Re?1:0),Math.round(Ig*H)+128,Math.round(Ig*ne)+128,(qe===0?0:qe<0?-1:1)+1|(Pr&63)<<2,Pr>>6),this.lineClips){var Zr=this.scaledDistance-this.lineClips.start,Vr=this.lineClips.end-this.lineClips.start,ua=Zr/Vr;this.layoutVertexArray2.emplaceBack(ua,this.lineClipsArray.length)}var Oa=pt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Oa),pt.primitiveLength++),Re?this.e2=Oa:this.e1=Oa},Hf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Hf.prototype.updateDistance=function(C,H){this.distance+=C.dist(H),this.updateScaledDistance()},de("LineBucket",Hf,{omit:["layers","patternFeatures"]});var Y1=new ma({"line-cap":new it(Gi.layout_line["line-cap"]),"line-join":new Zt(Gi.layout_line["line-join"]),"line-miter-limit":new it(Gi.layout_line["line-miter-limit"]),"line-round-limit":new it(Gi.layout_line["line-round-limit"]),"line-sort-key":new Zt(Gi.layout_line["line-sort-key"])}),K1=new ma({"line-opacity":new Zt(Gi.paint_line["line-opacity"]),"line-color":new Zt(Gi.paint_line["line-color"]),"line-translate":new it(Gi.paint_line["line-translate"]),"line-translate-anchor":new it(Gi.paint_line["line-translate-anchor"]),"line-width":new Zt(Gi.paint_line["line-width"]),"line-gap-width":new Zt(Gi.paint_line["line-gap-width"]),"line-offset":new Zt(Gi.paint_line["line-offset"]),"line-blur":new Zt(Gi.paint_line["line-blur"]),"line-dasharray":new oa(Gi.paint_line["line-dasharray"]),"line-pattern":new fr(Gi.paint_line["line-pattern"]),"line-gradient":new wa(Gi.paint_line["line-gradient"])}),Dg={paint:K1,layout:Y1},sA=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(ne,xe){return xe=new gn(Math.floor(xe.zoom),{now:xe.now,fadeDuration:xe.fadeDuration,zoomHistory:xe.zoomHistory,transition:xe.transition}),k.prototype.possiblyEvaluate.call(this,ne,xe)},C.prototype.evaluate=function(ne,xe,Re,qe){return xe=g({},xe,{zoom:Math.floor(xe.zoom)}),k.prototype.evaluate.call(this,ne,xe,Re,qe)},C}(Zt),W=new sA(Dg.paint.properties["line-width"].specification);W.useIntegerZoom=!0;var D=function(k){function C(H){k.call(this,H,Dg),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(ne){if(ne==="line-gradient"){var xe=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=xe._styleExpression.expression instanceof Tu,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(ne,xe){k.prototype.recalculate.call(this,ne,xe),this.paint._values["line-floorwidth"]=W.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,ne)},C.prototype.createBucket=function(ne){return new Hf(ne)},C.prototype.queryRadius=function(ne){var xe=ne,Re=J(Rh("line-width",this,xe),Rh("line-gap-width",this,xe)),qe=Rh("line-offset",this,xe);return Re/2+Math.abs(qe)+Cp(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(ne,xe,Re,qe,pt,Dt,Gt){var tr=Vp(ne,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Dt.angle,Gt),Pr=Gt/2*J(this.paint.get("line-width").evaluate(xe,Re),this.paint.get("line-gap-width").evaluate(xe,Re)),Zr=this.paint.get("line-offset").evaluate(xe,Re);return Zr&&(qe=pe(qe,Zr*Gt)),mu(tr,qe,Pr)},C.prototype.isTileClipped=function(){return!0},C}(Ya);function J(k,C){return C>0?C+2*k:k}function pe(k,C){for(var H=[],ne=new n(0,0),xe=0;xe<k.length;xe++){for(var Re=k[xe],qe=[],pt=0;pt<Re.length;pt++){var Dt=Re[pt-1],Gt=Re[pt],tr=Re[pt+1],Pr=pt===0?ne:Gt.sub(Dt)._unit()._perp(),Zr=pt===Re.length-1?ne:tr.sub(Gt)._unit()._perp(),Vr=Pr._add(Zr)._unit(),ua=Vr.x*Zr.x+Vr.y*Zr.y;Vr._mult(1/ua),qe.push(Vr._mult(C)._add(Gt))}H.push(qe)}return H}var ke=Ei([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),je=Ei([{name:"a_projected_pos",components:3,type:"Float32"}],4),We=Ei([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ht=Ei([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Et=Ei([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ut=Ei([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),or=Ei([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Mr=Ei([{name:"triangle",components:3,type:"Uint16"}]),zr=Ei([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Wr=Ei([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ia=Ei([{type:"Float32",name:"offsetX"}]),ha=Ei([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function ja(k,C,H){var ne=C.layout.get("text-transform").evaluate(H,{});return ne==="uppercase"?k=k.toLocaleUpperCase():ne==="lowercase"&&(k=k.toLocaleLowerCase()),al.applyArabicShaping&&(k=al.applyArabicShaping(k)),k}function Ka(k,C,H){return k.sections.forEach(function(ne){ne.text=ja(ne.text,C,H)}),k}function Wi(k){var C={},H={},ne=[],xe=0;function Re(ii){ne.push(k[ii]),xe++}function qe(ii,$i,Oi){var Ji=H[ii];return delete H[ii],H[$i]=Ji,ne[Ji].geometry[0].pop(),ne[Ji].geometry[0]=ne[Ji].geometry[0].concat(Oi[0]),Ji}function pt(ii,$i,Oi){var Ji=C[$i];return delete C[$i],C[ii]=Ji,ne[Ji].geometry[0].shift(),ne[Ji].geometry[0]=Oi[0].concat(ne[Ji].geometry[0]),Ji}function Dt(ii,$i,Oi){var Ji=Oi?$i[0][$i[0].length-1]:$i[0][0];return ii+":"+Ji.x+":"+Ji.y}for(var Gt=0;Gt<k.length;Gt++){var tr=k[Gt],Pr=tr.geometry,Zr=tr.text?tr.text.toString():null;if(!Zr){Re(Gt);continue}var Vr=Dt(Zr,Pr),ua=Dt(Zr,Pr,!0);if(Vr in H&&ua in C&&H[Vr]!==C[ua]){var Oa=pt(Vr,ua,Pr),Mi=qe(Vr,ua,ne[Oa].geometry);delete C[Vr],delete H[ua],H[Dt(Zr,ne[Mi].geometry,!0)]=Mi,ne[Oa].geometry=null}else Vr in H?qe(Vr,ua,Pr):ua in C?pt(Vr,ua,Pr):(Re(Gt),C[Vr]=xe-1,H[ua]=xe-1)}return ne.filter(function(ii){return ii.geometry})}var gi={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function qi(k){for(var C="",H=0;H<k.length;H++){var ne=k.charCodeAt(H+1)||null,xe=k.charCodeAt(H-1)||null,Re=(!ne||!ti(ne)||gi[k[H+1]])&&(!xe||!ti(xe)||gi[k[H-1]]);Re&&gi[k[H]]?C+=gi[k[H]]:C+=k[H]}return C}var en=24,qn=function(k,C,H,ne,xe){var Re,qe,pt=xe*8-ne-1,Dt=(1<<pt)-1,Gt=Dt>>1,tr=-7,Pr=H?xe-1:0,Zr=H?-1:1,Vr=k[C+Pr];for(Pr+=Zr,Re=Vr&(1<<-tr)-1,Vr>>=-tr,tr+=pt;tr>0;Re=Re*256+k[C+Pr],Pr+=Zr,tr-=8);for(qe=Re&(1<<-tr)-1,Re>>=-tr,tr+=ne;tr>0;qe=qe*256+k[C+Pr],Pr+=Zr,tr-=8);if(Re===0)Re=1-Gt;else{if(Re===Dt)return qe?NaN:(Vr?-1:1)*(1/0);qe=qe+Math.pow(2,ne),Re=Re-Gt}return(Vr?-1:1)*qe*Math.pow(2,Re-ne)},Eo=function(k,C,H,ne,xe,Re){var qe,pt,Dt,Gt=Re*8-xe-1,tr=(1<<Gt)-1,Pr=tr>>1,Zr=xe===23?Math.pow(2,-24)-Math.pow(2,-77):0,Vr=ne?0:Re-1,ua=ne?1:-1,Oa=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(pt=isNaN(C)?1:0,qe=tr):(qe=Math.floor(Math.log(C)/Math.LN2),C*(Dt=Math.pow(2,-qe))<1&&(qe--,Dt*=2),qe+Pr>=1?C+=Zr/Dt:C+=Zr*Math.pow(2,1-Pr),C*Dt>=2&&(qe++,Dt/=2),qe+Pr>=tr?(pt=0,qe=tr):qe+Pr>=1?(pt=(C*Dt-1)*Math.pow(2,xe),qe=qe+Pr):(pt=C*Math.pow(2,Pr-1)*Math.pow(2,xe),qe=0));xe>=8;k[H+Vr]=pt&255,Vr+=ua,pt/=256,xe-=8);for(qe=qe<<xe|pt,Gt+=xe;Gt>0;k[H+Vr]=qe&255,Vr+=ua,qe/=256,Gt-=8);k[H+Vr-ua]|=Oa*128},ys={read:qn,write:Eo},mo=zn;function zn(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}zn.Varint=0,zn.Fixed64=1,zn.Bytes=2,zn.Fixed32=5;var ts=65536*65536,Uo=1/ts,zo=12,wn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");zn.prototype={destroy:function(){this.buf=null},readFields:function(k,C,H){for(H=H||this.length;this.pos<H;){var ne=this.readVarint(),xe=ne>>3,Re=this.pos;this.type=ne&7,k(xe,C,this),this.pos===Re&&this.skip(ne)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=dh(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Rp(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=dh(this.buf,this.pos)+dh(this.buf,this.pos+4)*ts;return this.pos+=8,k},readSFixed64:function(){var k=dh(this.buf,this.pos)+Rp(this.buf,this.pos+4)*ts;return this.pos+=8,k},readFloat:function(){var k=ys.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=ys.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,H,ne;return ne=C[this.pos++],H=ne&127,ne<128||(ne=C[this.pos++],H|=(ne&127)<<7,ne<128)||(ne=C[this.pos++],H|=(ne&127)<<14,ne<128)||(ne=C[this.pos++],H|=(ne&127)<<21,ne<128)?H:(ne=C[this.pos],H|=(ne&15)<<28,os(H,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=zo&&wn?hu(this.buf,C,k):dp(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==zn.Bytes)return k.push(this.readVarint(C));var H=Fo(this);for(k=k||[];this.pos<H;)k.push(this.readVarint(C));return k},readPackedSVarint:function(k){if(this.type!==zn.Bytes)return k.push(this.readSVarint());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readSVarint());return k},readPackedBoolean:function(k){if(this.type!==zn.Bytes)return k.push(this.readBoolean());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readBoolean());return k},readPackedFloat:function(k){if(this.type!==zn.Bytes)return k.push(this.readFloat());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readFloat());return k},readPackedDouble:function(k){if(this.type!==zn.Bytes)return k.push(this.readDouble());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readDouble());return k},readPackedFixed32:function(k){if(this.type!==zn.Bytes)return k.push(this.readFixed32());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readFixed32());return k},readPackedSFixed32:function(k){if(this.type!==zn.Bytes)return k.push(this.readSFixed32());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readSFixed32());return k},readPackedFixed64:function(k){if(this.type!==zn.Bytes)return k.push(this.readFixed64());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readFixed64());return k},readPackedSFixed64:function(k){if(this.type!==zn.Bytes)return k.push(this.readSFixed64());var C=Fo(this);for(k=k||[];this.pos<C;)k.push(this.readSFixed64());return k},skip:function(k){var C=k&7;if(C===zn.Varint)for(;this.buf[this.pos++]>127;);else if(C===zn.Bytes)this.pos=this.readVarint()+this.pos;else if(C===zn.Fixed32)this.pos+=4;else if(C===zn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C<this.pos+k;)C*=2;if(C!==this.length){var H=new Uint8Array(C);H.set(this.buf),this.buf=H,this.length=C}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(k){this.realloc(4),yf(this.buf,k,this.pos),this.pos+=4},writeSFixed32:function(k){this.realloc(4),yf(this.buf,k,this.pos),this.pos+=4},writeFixed64:function(k){this.realloc(8),yf(this.buf,k&-1,this.pos),yf(this.buf,Math.floor(k*Uo),this.pos+4),this.pos+=8},writeSFixed64:function(k){this.realloc(8),yf(this.buf,k&-1,this.pos),yf(this.buf,Math.floor(k*Uo),this.pos+4),this.pos+=8},writeVarint:function(k){if(k=+k||0,k>268435455||k<0){Ku(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=fc(this.buf,k,this.pos);var H=this.pos-C;H>=128&&Hp(C,H,this),this.pos=C-1,this.writeVarint(H),this.pos+=H},writeFloat:function(k){this.realloc(4),ys.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),ys.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var H=0;H<C;H++)this.buf[this.pos++]=k[H]},writeRawMessage:function(k,C){this.pos++;var H=this.pos;k(C,this);var ne=this.pos-H;ne>=128&&Hp(H,ne,this),this.pos=H-1,this.writeVarint(ne),this.pos+=ne},writeMessage:function(k,C,H){this.writeTag(k,zn.Bytes),this.writeRawMessage(C,H)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,Th,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,rh,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Qh,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,Jh,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,$h,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,ff,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,ah,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Fh,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Ah,C)},writeBytesField:function(k,C){this.writeTag(k,zn.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,zn.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,zn.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,zn.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,zn.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,zn.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,zn.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,zn.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,zn.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,zn.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function os(k,C,H){var ne=H.buf,xe,Re;if(Re=ne[H.pos++],xe=(Re&112)>>4,Re<128||(Re=ne[H.pos++],xe|=(Re&127)<<3,Re<128)||(Re=ne[H.pos++],xe|=(Re&127)<<10,Re<128)||(Re=ne[H.pos++],xe|=(Re&127)<<17,Re<128)||(Re=ne[H.pos++],xe|=(Re&127)<<24,Re<128)||(Re=ne[H.pos++],xe|=(Re&1)<<31,Re<128))return Ls(k,xe,C);throw new Error("Expected varint not more than 10 bytes")}function Fo(k){return k.type===zn.Bytes?k.readVarint()+k.pos:k.pos+1}function Ls(k,C,H){return H?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function Ku(k,C){var H,ne;if(k>=0?(H=k%4294967296|0,ne=k/4294967296|0):(H=~(-k%4294967296),ne=~(-k/4294967296),H^4294967295?H=H+1|0:(H=0,ne=ne+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),Uu(H,ne,C),th(ne,C)}function Uu(k,C,H){H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos++]=k&127|128,k>>>=7,H.buf[H.pos]=k&127}function th(k,C){var H=(k&7)<<4;C.buf[C.pos++]|=H|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function Hp(k,C,H){var ne=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));H.realloc(ne);for(var xe=H.pos-1;xe>=k;xe--)H.buf[xe+ne]=H.buf[xe]}function Th(k,C){for(var H=0;H<k.length;H++)C.writeVarint(k[H])}function rh(k,C){for(var H=0;H<k.length;H++)C.writeSVarint(k[H])}function Jh(k,C){for(var H=0;H<k.length;H++)C.writeFloat(k[H])}function $h(k,C){for(var H=0;H<k.length;H++)C.writeDouble(k[H])}function Qh(k,C){for(var H=0;H<k.length;H++)C.writeBoolean(k[H])}function ff(k,C){for(var H=0;H<k.length;H++)C.writeFixed32(k[H])}function ah(k,C){for(var H=0;H<k.length;H++)C.writeSFixed32(k[H])}function Fh(k,C){for(var H=0;H<k.length;H++)C.writeFixed64(k[H])}function Ah(k,C){for(var H=0;H<k.length;H++)C.writeSFixed64(k[H])}function dh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+k[C+3]*16777216}function yf(k,C,H){k[H]=C,k[H+1]=C>>>8,k[H+2]=C>>>16,k[H+3]=C>>>24}function Rp(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function dp(k,C,H){for(var ne="",xe=C;xe<H;){var Re=k[xe],qe=null,pt=Re>239?4:Re>223?3:Re>191?2:1;if(xe+pt>H)break;var Dt,Gt,tr;pt===1?Re<128&&(qe=Re):pt===2?(Dt=k[xe+1],(Dt&192)===128&&(qe=(Re&31)<<6|Dt&63,qe<=127&&(qe=null))):pt===3?(Dt=k[xe+1],Gt=k[xe+2],(Dt&192)===128&&(Gt&192)===128&&(qe=(Re&15)<<12|(Dt&63)<<6|Gt&63,(qe<=2047||qe>=55296&&qe<=57343)&&(qe=null))):pt===4&&(Dt=k[xe+1],Gt=k[xe+2],tr=k[xe+3],(Dt&192)===128&&(Gt&192)===128&&(tr&192)===128&&(qe=(Re&15)<<18|(Dt&63)<<12|(Gt&63)<<6|tr&63,(qe<=65535||qe>=1114112)&&(qe=null))),qe===null?(qe=65533,pt=1):qe>65535&&(qe-=65536,ne+=String.fromCharCode(qe>>>10&1023|55296),qe=56320|qe&1023),ne+=String.fromCharCode(qe),xe+=pt}return ne}function hu(k,C,H){return wn.decode(k.subarray(C,H))}function fc(k,C,H){for(var ne=0,xe,Re;ne<C.length;ne++){if(xe=C.charCodeAt(ne),xe>55295&&xe<57344)if(Re)if(xe<56320){k[H++]=239,k[H++]=191,k[H++]=189,Re=xe;continue}else xe=Re-55296<<10|xe-56320|65536,Re=null;else{xe>56319||ne+1===C.length?(k[H++]=239,k[H++]=191,k[H++]=189):Re=xe;continue}else Re&&(k[H++]=239,k[H++]=191,k[H++]=189,Re=null);xe<128?k[H++]=xe:(xe<2048?k[H++]=xe>>6|192:(xe<65536?k[H++]=xe>>12|224:(k[H++]=xe>>18|240,k[H++]=xe>>12&63|128),k[H++]=xe>>6&63|128),k[H++]=xe&63|128)}return H}var Ju=3;function Dp(k,C,H){k===1&&H.readMessage($c,C)}function $c(k,C,H){if(k===3){var ne=H.readMessage(vm,{}),xe=ne.id,Re=ne.bitmap,qe=ne.width,pt=ne.height,Dt=ne.left,Gt=ne.top,tr=ne.advance;C.push({id:xe,bitmap:new Ip({width:qe+2*Ju,height:pt+2*Ju},Re),metrics:{width:qe,height:pt,left:Dt,top:Gt,advance:tr}})}}function vm(k,C,H){k===1?C.id=H.readVarint():k===2?C.bitmap=H.readBytes():k===3?C.width=H.readVarint():k===4?C.height=H.readVarint():k===5?C.left=H.readSVarint():k===6?C.top=H.readSVarint():k===7&&(C.advance=H.readVarint())}function _d(k){return new mo(k).readFields(Dp,[])}var fd=Ju;function Wp(k){for(var C=0,H=0,ne=0,xe=k;ne<xe.length;ne+=1){var Re=xe[ne];C+=Re.w*Re.h,H=Math.max(H,Re.w)}k.sort(function(Mi,ii){return ii.h-Mi.h});for(var qe=Math.max(Math.ceil(Math.sqrt(C/.95)),H),pt=[{x:0,y:0,w:qe,h:1/0}],Dt=0,Gt=0,tr=0,Pr=k;tr<Pr.length;tr+=1)for(var Zr=Pr[tr],Vr=pt.length-1;Vr>=0;Vr--){var ua=pt[Vr];if(!(Zr.w>ua.w||Zr.h>ua.h)){if(Zr.x=ua.x,Zr.y=ua.y,Gt=Math.max(Gt,Zr.y+Zr.h),Dt=Math.max(Dt,Zr.x+Zr.w),Zr.w===ua.w&&Zr.h===ua.h){var Oa=pt.pop();Vr<pt.length&&(pt[Vr]=Oa)}else Zr.h===ua.h?(ua.x+=Zr.w,ua.w-=Zr.w):Zr.w===ua.w?(ua.y+=Zr.h,ua.h-=Zr.h):(pt.push({x:ua.x+Zr.w,y:ua.y,w:ua.w-Zr.w,h:Zr.h}),ua.y+=Zr.h,ua.h-=Zr.h);break}}return{w:Dt,h:Gt,fill:C/(Dt*Gt)||0}}var zc=1,Pf=function(C,H){var ne=H.pixelRatio,xe=H.version,Re=H.stretchX,qe=H.stretchY,pt=H.content;this.paddedRect=C,this.pixelRatio=ne,this.stretchX=Re,this.stretchY=qe,this.content=pt,this.version=xe},Xp={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Xp.tl.get=function(){return[this.paddedRect.x+zc,this.paddedRect.y+zc]},Xp.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-zc,this.paddedRect.y+this.paddedRect.h-zc]},Xp.tlbr.get=function(){return this.tl.concat(this.br)},Xp.displaySize.get=function(){return[(this.paddedRect.w-zc*2)/this.pixelRatio,(this.paddedRect.h-zc*2)/this.pixelRatio]},Object.defineProperties(Pf.prototype,Xp);var Zd=function(C,H){var ne={},xe={};this.haveRenderCallbacks=[];var Re=[];this.addImages(C,ne,Re),this.addImages(H,xe,Re);var qe=Wp(Re),pt=qe.w,Dt=qe.h,Gt=new eh({width:pt||1,height:Dt||1});for(var tr in C){var Pr=C[tr],Zr=ne[tr].paddedRect;eh.copy(Pr.data,Gt,{x:0,y:0},{x:Zr.x+zc,y:Zr.y+zc},Pr.data)}for(var Vr in H){var ua=H[Vr],Oa=xe[Vr].paddedRect,Mi=Oa.x+zc,ii=Oa.y+zc,$i=ua.data.width,Oi=ua.data.height;eh.copy(ua.data,Gt,{x:0,y:0},{x:Mi,y:ii},ua.data),eh.copy(ua.data,Gt,{x:0,y:Oi-1},{x:Mi,y:ii-1},{width:$i,height:1}),eh.copy(ua.data,Gt,{x:0,y:0},{x:Mi,y:ii+Oi},{width:$i,height:1}),eh.copy(ua.data,Gt,{x:$i-1,y:0},{x:Mi-1,y:ii},{width:1,height:Oi}),eh.copy(ua.data,Gt,{x:0,y:0},{x:Mi+$i,y:ii},{width:1,height:Oi})}this.image=Gt,this.iconPositions=ne,this.patternPositions=xe};Zd.prototype.addImages=function(C,H,ne){for(var xe in C){var Re=C[xe],qe={x:0,y:0,w:Re.data.width+2*zc,h:Re.data.height+2*zc};ne.push(qe),H[xe]=new Pf(qe,Re),Re.hasRenderCallback&&this.haveRenderCallbacks.push(xe)}},Zd.prototype.patchUpdatedImages=function(C,H){C.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var ne in C.updatedImages)this.patchUpdatedImage(this.iconPositions[ne],C.getImage(ne),H),this.patchUpdatedImage(this.patternPositions[ne],C.getImage(ne),H)},Zd.prototype.patchUpdatedImage=function(C,H,ne){if(!(!C||!H)&&C.version!==H.version){C.version=H.version;var xe=C.tl,Re=xe[0],qe=xe[1];ne.update(H.data,void 0,{x:Re,y:qe})}},de("ImagePosition",Pf),de("ImageAtlas",Zd);var vp={horizontal:1,vertical:2,horizontalOnly:3},mm=-17;function J1(k){for(var C=0,H=k;C<H.length;C+=1){var ne=H[C];if(ne.positionedGlyphs.length!==0)return!1}return!0}var zg=57344,xd=63743,Ov=function(){this.scale=1,this.fontStack="",this.imageName=null};Ov.forText=function(C,H){var ne=new Ov;return ne.scale=C||1,ne.fontStack=H,ne},Ov.forImage=function(C){var H=new Ov;return H.imageName=C,H};var vh=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};vh.fromFeature=function(C,H){for(var ne=new vh,xe=0;xe<C.sections.length;xe++){var Re=C.sections[xe];Re.image?ne.addImageSection(Re):ne.addTextSection(Re,H)}return ne},vh.prototype.length=function(){return this.text.length},vh.prototype.getSection=function(C){return this.sections[this.sectionIndex[C]]},vh.prototype.getSectionIndex=function(C){return this.sectionIndex[C]},vh.prototype.getCharCode=function(C){return this.text.charCodeAt(C)},vh.prototype.verticalizePunctuation=function(){this.text=qi(this.text)},vh.prototype.trim=function(){for(var C=0,H=0;H<this.text.length&&bd[this.text.charCodeAt(H)];H++)C++;for(var ne=this.text.length,xe=this.text.length-1;xe>=0&&xe>=C&&bd[this.text.charCodeAt(xe)];xe--)ne--;this.text=this.text.substring(C,ne),this.sectionIndex=this.sectionIndex.slice(C,ne)},vh.prototype.substring=function(C,H){var ne=new vh;return ne.text=this.text.substring(C,H),ne.sectionIndex=this.sectionIndex.slice(C,H),ne.sections=this.sections,ne},vh.prototype.toString=function(){return this.text},vh.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(H,ne){return Math.max(H,C.sections[ne].scale)},0)},vh.prototype.addTextSection=function(C,H){this.text+=C.text,this.sections.push(Ov.forText(C.scale,C.fontStack||H));for(var ne=this.sections.length-1,xe=0;xe<C.text.length;++xe)this.sectionIndex.push(ne)},vh.prototype.addImageSection=function(C){var H=C.image?C.image.name:"";if(H.length===0){B("Can't add FormattedSection with an empty image.");return}var ne=this.getNextImageSectionCharCode();if(!ne){B("Reached maximum number of images "+(xd-zg+2));return}this.text+=String.fromCharCode(ne),this.sections.push(Ov.forImage(H)),this.sectionIndex.push(this.sections.length-1)},vh.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=xd?null:++this.imageSectionID:(this.imageSectionID=zg,this.imageSectionID)};function lA(k,C){for(var H=[],ne=k.text,xe=0,Re=0,qe=C;Re<qe.length;Re+=1){var pt=qe[Re];H.push(k.substring(xe,pt)),xe=pt}return xe<ne.length&&H.push(k.substring(xe,ne.length)),H}function Fg(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa){var Mi=vh.fromFeature(k,xe);Pr===vp.vertical&&Mi.verticalizePunctuation();var ii,$i=al.processBidirectionalText,Oi=al.processStyledBidirectionalText;if($i&&Mi.sections.length===1){ii=[];for(var Ji=$i(Mi.toString(),Og(Mi,Gt,Re,C,ne,Vr,ua)),ln=0,Tn=Ji;ln<Tn.length;ln+=1){var Vn=Tn[ln],Nn=new vh;Nn.text=Vn,Nn.sections=Mi.sections;for(var So=0;So<Vn.length;So++)Nn.sectionIndex.push(0);ii.push(Nn)}}else if(Oi){ii=[];for(var oo=Oi(Mi.text,Mi.sectionIndex,Og(Mi,Gt,Re,C,ne,Vr,ua)),go=0,ks=oo;go<ks.length;go+=1){var Mo=ks[go],Po=new vh;Po.text=Mo[0],Po.sectionIndex=Mo[1],Po.sections=Mi.sections,ii.push(Po)}}else ii=lA(Mi,Og(Mi,Gt,Re,C,ne,Vr,ua));var $s=[],ws={positionedLines:$s,text:Mi.toString(),top:tr[1],bottom:tr[1],left:tr[0],right:tr[0],writingMode:Pr,iconsInText:!1,verticalizable:!1};return fA(ws,C,H,ne,ii,qe,pt,Dt,Pr,Gt,Zr,Oa),J1($s)?!1:ws}var bd={};bd[9]=!0,bd[10]=!0,bd[11]=!0,bd[12]=!0,bd[13]=!0,bd[32]=!0;var mp={};mp[10]=!0,mp[32]=!0,mp[38]=!0,mp[40]=!0,mp[41]=!0,mp[43]=!0,mp[45]=!0,mp[47]=!0,mp[173]=!0,mp[183]=!0,mp[8203]=!0,mp[8208]=!0,mp[8211]=!0,mp[8231]=!0;function sb(k,C,H,ne,xe,Re){if(C.imageName){var Dt=ne[C.imageName];return Dt?Dt.displaySize[0]*C.scale*en/Re+xe:0}else{var qe=H[C.fontStack],pt=qe&&qe[k];return pt?pt.metrics.advance*C.scale+xe:0}}function uA(k,C,H,ne,xe,Re){for(var qe=0,pt=0;pt<k.length();pt++){var Dt=k.getSection(pt);qe+=sb(k.getCharCode(pt),Dt,ne,xe,C,Re)}var Gt=Math.max(1,Math.ceil(qe/H));return qe/Gt}function lb(k,C,H,ne){var xe=Math.pow(k-C,2);return ne?k<C?xe/2:xe*2:xe+Math.abs(H)*H}function cA(k,C,H){var ne=0;return k===10&&(ne-=1e4),H&&(ne+=150),(k===40||k===65288)&&(ne+=50),(C===41||C===65289)&&(ne+=50),ne}function ad(k,C,H,ne,xe,Re){for(var qe=null,pt=lb(C,H,xe,Re),Dt=0,Gt=ne;Dt<Gt.length;Dt+=1){var tr=Gt[Dt],Pr=C-tr.x,Zr=lb(Pr,H,xe,Re)+tr.badness;Zr<=pt&&(qe=tr,pt=Zr)}return{index:k,x:C,priorBreak:qe,badness:pt}}function B0(k){return k?B0(k.priorBreak).concat(k.index):[]}function Og(k,C,H,ne,xe,Re,qe){if(Re!=="point")return[];if(!k)return[];for(var pt=[],Dt=uA(k,C,H,ne,xe,qe),Gt=k.text.indexOf("\u200B")>=0,tr=0,Pr=0;Pr<k.length();Pr++){var Zr=k.getSection(Pr),Vr=k.getCharCode(Pr);if(bd[Vr]||(tr+=sb(Vr,Zr,ne,xe,C,qe)),Pr<k.length()-1){var ua=xa(Vr);(mp[Vr]||ua||Zr.imageName)&&pt.push(ad(Pr+1,tr,Dt,pt,cA(Vr,k.getCharCode(Pr+1),ua&&Gt),!1))}}return B0(ad(k.length(),tr,Dt,pt,0,!0))}function $1(k){var C=.5,H=.5;switch(k){case"right":case"top-right":case"bottom-right":C=1;break;case"left":case"top-left":case"bottom-left":C=0;break}switch(k){case"bottom":case"bottom-right":case"bottom-left":H=1;break;case"top":case"top-right":case"top-left":H=0;break}return{horizontalAlign:C,verticalAlign:H}}function fA(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr){for(var Zr=0,Vr=mm,ua=0,Oa=0,Mi=pt==="right"?1:pt==="left"?0:.5,ii=0,$i=0,Oi=xe;$i<Oi.length;$i+=1){var Ji=Oi[$i];Ji.trim();var ln=Ji.getMaxScale(),Tn=(ln-1)*en,Vn={positionedGlyphs:[],lineOffset:0};k.positionedLines[ii]=Vn;var Nn=Vn.positionedGlyphs,So=0;if(!Ji.length()){Vr+=Re,++ii;continue}for(var oo=0;oo<Ji.length();oo++){var go=Ji.getSection(oo),ks=Ji.getSectionIndex(oo),Mo=Ji.getCharCode(oo),Po=0,$s=null,ws=null,Xl=null,zu=en,Zl=!(Dt===vp.horizontal||!tr&&!da(Mo)||tr&&(bd[Mo]||Sa(Mo)));if(go.imageName){var hf=ne[go.imageName];if(!hf)continue;Xl=go.imageName,k.iconsInText=k.iconsInText||!0,ws=hf.paddedRect;var _f=hf.displaySize;go.scale=go.scale*en/Pr,$s={width:_f[0],height:_f[1],left:zc,top:-fd,advance:Zl?_f[1]:_f[0]};var gh=en-_f[1]*go.scale;Po=Tn+gh,zu=$s.advance;var Zf=Zl?_f[0]*go.scale-en*ln:_f[1]*go.scale-en*ln;Zf>0&&Zf>So&&(So=Zf)}else{var Yl=H[go.fontStack],Ol=Yl&&Yl[Mo];if(Ol&&Ol.rect)ws=Ol.rect,$s=Ol.metrics;else{var $u=C[go.fontStack],hc=$u&&$u[Mo];if(!hc)continue;$s=hc.metrics}Po=(ln-go.scale)*en}Zl?(k.verticalizable=!0,Nn.push({glyph:Mo,imageName:Xl,x:Zr,y:Vr+Po,vertical:Zl,scale:go.scale,fontStack:go.fontStack,sectionIndex:ks,metrics:$s,rect:ws}),Zr+=zu*go.scale+Gt):(Nn.push({glyph:Mo,imageName:Xl,x:Zr,y:Vr+Po,vertical:Zl,scale:go.scale,fontStack:go.fontStack,sectionIndex:ks,metrics:$s,rect:ws}),Zr+=$s.advance*go.scale+Gt)}if(Nn.length!==0){var tp=Zr-Gt;ua=Math.max(tp,ua),hA(Nn,0,Nn.length-1,Mi,So)}Zr=0;var rp=Re*ln+So;Vn.lineOffset=Math.max(So,Tn),Vr+=rp,Oa=Math.max(rp,Oa),++ii}var yh=Vr-mm,gp=$1(qe),yp=gp.horizontalAlign,ih=gp.verticalAlign;Oh(k.positionedLines,Mi,yp,ih,ua,Oa,Re,yh,xe.length),k.top+=-ih*yh,k.bottom=k.top+yh,k.left+=-yp*ua,k.right=k.left+ua}function hA(k,C,H,ne,xe){if(!(!ne&&!xe))for(var Re=k[H],qe=Re.metrics.advance*Re.scale,pt=(k[H].x+qe)*ne,Dt=C;Dt<=H;Dt++)k[Dt].x-=pt,k[Dt].y+=xe}function Oh(k,C,H,ne,xe,Re,qe,pt,Dt){var Gt=(C-H)*xe,tr=0;Re!==qe?tr=-pt*ne-mm:tr=(-ne*Dt+.5)*qe;for(var Pr=0,Zr=k;Pr<Zr.length;Pr+=1)for(var Vr=Zr[Pr],ua=0,Oa=Vr.positionedGlyphs;ua<Oa.length;ua+=1){var Mi=Oa[ua];Mi.x+=Gt,Mi.y+=tr}}function Zp(k,C,H){var ne=$1(H),xe=ne.horizontalAlign,Re=ne.verticalAlign,qe=C[0],pt=C[1],Dt=qe-k.displaySize[0]*xe,Gt=Dt+k.displaySize[0],tr=pt-k.displaySize[1]*Re,Pr=tr+k.displaySize[1];return{image:k,top:tr,bottom:Pr,left:Dt,right:Gt}}function dv(k,C,H,ne,xe,Re){var qe=k.image,pt;if(qe.content){var Dt=qe.content,Gt=qe.pixelRatio||1;pt=[Dt[0]/Gt,Dt[1]/Gt,qe.displaySize[0]-Dt[2]/Gt,qe.displaySize[1]-Dt[3]/Gt]}var tr=C.left*Re,Pr=C.right*Re,Zr,Vr,ua,Oa;H==="width"||H==="both"?(Oa=xe[0]+tr-ne[3],Vr=xe[0]+Pr+ne[1]):(Oa=xe[0]+(tr+Pr-qe.displaySize[0])/2,Vr=Oa+qe.displaySize[0]);var Mi=C.top*Re,ii=C.bottom*Re;return H==="height"||H==="both"?(Zr=xe[1]+Mi-ne[0],ua=xe[1]+ii+ne[2]):(Zr=xe[1]+(Mi+ii-qe.displaySize[1])/2,ua=Zr+qe.displaySize[1]),{image:qe,top:Zr,right:Vr,bottom:ua,left:Oa,collisionPadding:pt}}var ep=function(k){function C(H,ne,xe,Re){k.call(this,H,ne),this.angle=xe,Re!==void 0&&(this.segment=Re)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.clone=function(){return new C(this.x,this.y,this.angle,this.segment)},C}(n);de("Anchor",ep);var Bh=128;function id(k,C){var H=C.expression;if(H.kind==="constant"){var ne=H.evaluate(new gn(k+1));return{kind:"constant",layoutSize:ne}}else{if(H.kind==="source")return{kind:"source"};for(var xe=H.zoomStops,Re=H.interpolationType,qe=0;qe<xe.length&&xe[qe]<=k;)qe++;qe=Math.max(0,qe-1);for(var pt=qe;pt<xe.length&&xe[pt]<k+1;)pt++;pt=Math.min(xe.length-1,pt);var Dt=xe[qe],Gt=xe[pt];if(H.kind==="composite")return{kind:"composite",minZoom:Dt,maxZoom:Gt,interpolationType:Re};var tr=H.evaluate(new gn(Dt)),Pr=H.evaluate(new gn(Gt));return{kind:"camera",minZoom:Dt,maxZoom:Gt,minSize:tr,maxSize:Pr,interpolationType:Re}}}function gk(k,C,H){var ne=C.uSize,xe=C.uSizeT,Re=H.lowerSize,qe=H.upperSize;return k.kind==="source"?Re/Bh:k.kind==="composite"?El(Re/Bh,qe/Bh,xe):ne}function yk(k,C){var H=0,ne=0;if(k.kind==="constant")ne=k.layoutSize;else if(k.kind!=="source"){var xe=k.interpolationType,Re=k.minZoom,qe=k.maxZoom,pt=xe?l(iu.interpolationFactor(xe,C,Re,qe),0,1):0;k.kind==="camera"?ne=El(k.minSize,k.maxSize,pt):H=pt}return{uSizeT:H,uSize:ne}}var gW=Object.freeze({__proto__:null,getSizeData:id,evaluateSizeForFeature:gk,evaluateSizeForZoom:yk,SIZE_PACK_FACTOR:Bh});function _k(k,C,H,ne,xe){if(C.segment===void 0)return!0;for(var Re=C,qe=C.segment+1,pt=0;pt>-H/2;){if(qe--,qe<0)return!1;pt-=k[qe].dist(Re),Re=k[qe]}pt+=k[qe].dist(k[qe+1]),qe++;for(var Dt=[],Gt=0;pt<H/2;){var tr=k[qe-1],Pr=k[qe],Zr=k[qe+1];if(!Zr)return!1;var Vr=tr.angleTo(Pr)-Pr.angleTo(Zr);for(Vr=Math.abs((Vr+3*Math.PI)%(Math.PI*2)-Math.PI),Dt.push({distance:pt,angleDelta:Vr}),Gt+=Vr;pt-Dt[0].distance>ne;)Gt-=Dt.shift().angleDelta;if(Gt>xe)return!1;qe++,pt+=Pr.dist(Zr)}return!0}function xk(k){for(var C=0,H=0;H<k.length-1;H++)C+=k[H].dist(k[H+1]);return C}function bk(k,C,H){return k?3/5*C*H:0}function wk(k,C){return Math.max(k?k.right-k.left:0,C?C.right-C.left:0)}function yW(k,C,H,ne,xe,Re){for(var qe=bk(H,xe,Re),pt=wk(H,ne)*Re,Dt=0,Gt=xk(k)/2,tr=0;tr<k.length-1;tr++){var Pr=k[tr],Zr=k[tr+1],Vr=Pr.dist(Zr);if(Dt+Vr>Gt){var ua=(Gt-Dt)/Vr,Oa=El(Pr.x,Zr.x,ua),Mi=El(Pr.y,Zr.y,ua),ii=new ep(Oa,Mi,Zr.angleTo(Pr),tr);return ii._round(),!qe||_k(k,ii,pt,qe,C)?ii:void 0}Dt+=Vr}}function _W(k,C,H,ne,xe,Re,qe,pt,Dt){var Gt=bk(ne,Re,qe),tr=wk(ne,xe),Pr=tr*qe,Zr=k[0].x===0||k[0].x===Dt||k[0].y===0||k[0].y===Dt;C-Pr<C/4&&(C=Pr+C/4);var Vr=Re*2,ua=Zr?C/2*pt%C:(tr/2+Vr)*qe*pt%C;return Tk(k,ua,C,Gt,H,Pr,Zr,!1,Dt)}function Tk(k,C,H,ne,xe,Re,qe,pt,Dt){for(var Gt=Re/2,tr=xk(k),Pr=0,Zr=C-H,Vr=[],ua=0;ua<k.length-1;ua++){for(var Oa=k[ua],Mi=k[ua+1],ii=Oa.dist(Mi),$i=Mi.angleTo(Oa);Zr+H<Pr+ii;){Zr+=H;var Oi=(Zr-Pr)/ii,Ji=El(Oa.x,Mi.x,Oi),ln=El(Oa.y,Mi.y,Oi);if(Ji>=0&&Ji<Dt&&ln>=0&&ln<Dt&&Zr-Gt>=0&&Zr+Gt<=tr){var Tn=new ep(Ji,ln,$i,ua);Tn._round(),(!ne||_k(k,Tn,Re,ne,xe))&&Vr.push(Tn)}}Pr+=ii}return!pt&&!Vr.length&&!qe&&(Vr=Tk(k,Pr/2,H,ne,xe,Re,qe,!0,Dt)),Vr}function Ak(k,C,H,ne,xe){for(var Re=[],qe=0;qe<k.length;qe++)for(var pt=k[qe],Dt=void 0,Gt=0;Gt<pt.length-1;Gt++){var tr=pt[Gt],Pr=pt[Gt+1];tr.x<C&&Pr.x<C||(tr.x<C?tr=new n(C,tr.y+(Pr.y-tr.y)*((C-tr.x)/(Pr.x-tr.x)))._round():Pr.x<C&&(Pr=new n(C,tr.y+(Pr.y-tr.y)*((C-tr.x)/(Pr.x-tr.x)))._round()),!(tr.y<H&&Pr.y<H)&&(tr.y<H?tr=new n(tr.x+(Pr.x-tr.x)*((H-tr.y)/(Pr.y-tr.y)),H)._round():Pr.y<H&&(Pr=new n(tr.x+(Pr.x-tr.x)*((H-tr.y)/(Pr.y-tr.y)),H)._round()),!(tr.x>=ne&&Pr.x>=ne)&&(tr.x>=ne?tr=new n(ne,tr.y+(Pr.y-tr.y)*((ne-tr.x)/(Pr.x-tr.x)))._round():Pr.x>=ne&&(Pr=new n(ne,tr.y+(Pr.y-tr.y)*((ne-tr.x)/(Pr.x-tr.x)))._round()),!(tr.y>=xe&&Pr.y>=xe)&&(tr.y>=xe?tr=new n(tr.x+(Pr.x-tr.x)*((xe-tr.y)/(Pr.y-tr.y)),xe)._round():Pr.y>=xe&&(Pr=new n(tr.x+(Pr.x-tr.x)*((xe-tr.y)/(Pr.y-tr.y)),xe)._round()),(!Dt||!tr.equals(Dt[Dt.length-1]))&&(Dt=[tr],Re.push(Dt)),Dt.push(Pr)))))}return Re}var Bg=zc;function Sk(k,C,H,ne){var xe=[],Re=k.image,qe=Re.pixelRatio,pt=Re.paddedRect.w-2*Bg,Dt=Re.paddedRect.h-2*Bg,Gt=k.right-k.left,tr=k.bottom-k.top,Pr=Re.stretchX||[[0,pt]],Zr=Re.stretchY||[[0,Dt]],Vr=function(Yl,Ol){return Yl+Ol[1]-Ol[0]},ua=Pr.reduce(Vr,0),Oa=Zr.reduce(Vr,0),Mi=pt-ua,ii=Dt-Oa,$i=0,Oi=ua,Ji=0,ln=Oa,Tn=0,Vn=Mi,Nn=0,So=ii;if(Re.content&&ne){var oo=Re.content;$i=ub(Pr,0,oo[0]),Ji=ub(Zr,0,oo[1]),Oi=ub(Pr,oo[0],oo[2]),ln=ub(Zr,oo[1],oo[3]),Tn=oo[0]-$i,Nn=oo[1]-Ji,Vn=oo[2]-oo[0]-Oi,So=oo[3]-oo[1]-ln}var go=function(Yl,Ol,$u,hc){var hf=cb(Yl.stretch-$i,Oi,Gt,k.left),_f=fb(Yl.fixed-Tn,Vn,Yl.stretch,ua),gh=cb(Ol.stretch-Ji,ln,tr,k.top),Zf=fb(Ol.fixed-Nn,So,Ol.stretch,Oa),tp=cb($u.stretch-$i,Oi,Gt,k.left),rp=fb($u.fixed-Tn,Vn,$u.stretch,ua),yh=cb(hc.stretch-Ji,ln,tr,k.top),gp=fb(hc.fixed-Nn,So,hc.stretch,Oa),yp=new n(hf,gh),ih=new n(tp,gh),_p=new n(tp,yh),nd=new n(hf,yh),Uv=new n(_f/qe,Zf/qe),_m=new n(rp/qe,gp/qe),xm=C*Math.PI/180;if(xm){var bm=Math.sin(xm),Wg=Math.cos(xm),wd=[Wg,-bm,bm,Wg];yp._matMult(wd),ih._matMult(wd),nd._matMult(wd),_p._matMult(wd)}var gb=Yl.stretch+Yl.fixed,xA=$u.stretch+$u.fixed,yb=Ol.stretch+Ol.fixed,bA=hc.stretch+hc.fixed,hd={x:Re.paddedRect.x+Bg+gb,y:Re.paddedRect.y+Bg+yb,w:xA-gb,h:bA-yb},Xg=Vn/qe/Gt,_b=So/qe/tr;return{tl:yp,tr:ih,bl:nd,br:_p,tex:hd,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Uv,pixelOffsetBR:_m,minFontScaleX:Xg,minFontScaleY:_b,isSDF:H}};if(!ne||!Re.stretchX&&!Re.stretchY)xe.push(go({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:pt+1},{fixed:0,stretch:Dt+1}));else for(var ks=Mk(Pr,Mi,ua),Mo=Mk(Zr,ii,Oa),Po=0;Po<ks.length-1;Po++)for(var $s=ks[Po],ws=ks[Po+1],Xl=0;Xl<Mo.length-1;Xl++){var zu=Mo[Xl],Zl=Mo[Xl+1];xe.push(go($s,zu,ws,Zl))}return xe}function ub(k,C,H){for(var ne=0,xe=0,Re=k;xe<Re.length;xe+=1){var qe=Re[xe];ne+=Math.max(C,Math.min(H,qe[1]))-Math.max(C,Math.min(H,qe[0]))}return ne}function Mk(k,C,H){for(var ne=[{fixed:-Bg,stretch:0}],xe=0,Re=k;xe<Re.length;xe+=1){var qe=Re[xe],pt=qe[0],Dt=qe[1],Gt=ne[ne.length-1];ne.push({fixed:pt-Gt.stretch,stretch:Gt.stretch}),ne.push({fixed:pt-Gt.stretch,stretch:Gt.stretch+(Dt-pt)})}return ne.push({fixed:C+Bg,stretch:H}),ne}function cb(k,C,H,ne){return k/C*H+ne}function fb(k,C,H,ne){return k-C*H/ne}function xW(k,C,H,ne,xe,Re,qe,pt){for(var Dt=ne.layout.get("text-rotate").evaluate(Re,{})*Math.PI/180,Gt=[],tr=0,Pr=C.positionedLines;tr<Pr.length;tr+=1)for(var Zr=Pr[tr],Vr=0,ua=Zr.positionedGlyphs;Vr<ua.length;Vr+=1){var Oa=ua[Vr];if(Oa.rect){var Mi=Oa.rect||{},ii=1,$i=fd+ii,Oi=!0,Ji=1,ln=0,Tn=(xe||pt)&&Oa.vertical,Vn=Oa.metrics.advance*Oa.scale/2;if(pt&&C.verticalizable){var Nn=(Oa.scale-1)*en,So=(en-Oa.metrics.width*Oa.scale)/2;ln=Zr.lineOffset/2-(Oa.imageName?-So:Nn)}if(Oa.imageName){var oo=qe[Oa.imageName];Oi=oo.sdf,Ji=oo.pixelRatio,$i=zc/Ji}var go=xe?[Oa.x+Vn,Oa.y]:[0,0],ks=xe?[0,0]:[Oa.x+Vn+H[0],Oa.y+H[1]-ln],Mo=[0,0];Tn&&(Mo=ks,ks=[0,0]);var Po=(Oa.metrics.left-$i)*Oa.scale-Vn+ks[0],$s=(-Oa.metrics.top-$i)*Oa.scale+ks[1],ws=Po+Mi.w*Oa.scale/Ji,Xl=$s+Mi.h*Oa.scale/Ji,zu=new n(Po,$s),Zl=new n(ws,$s),Yl=new n(Po,Xl),Ol=new n(ws,Xl);if(Tn){var $u=new n(-Vn,Vn-mm),hc=-Math.PI/2,hf=en/2-Vn,_f=Oa.imageName?hf:0,gh=new n(5-mm-hf,-_f),Zf=new(Function.prototype.bind.apply(n,[null].concat(Mo)));zu._rotateAround(hc,$u)._add(gh)._add(Zf),Zl._rotateAround(hc,$u)._add(gh)._add(Zf),Yl._rotateAround(hc,$u)._add(gh)._add(Zf),Ol._rotateAround(hc,$u)._add(gh)._add(Zf)}if(Dt){var tp=Math.sin(Dt),rp=Math.cos(Dt),yh=[rp,-tp,tp,rp];zu._matMult(yh),Zl._matMult(yh),Yl._matMult(yh),Ol._matMult(yh)}var gp=new n(0,0),yp=new n(0,0),ih=0,_p=0;Gt.push({tl:zu,tr:Zl,bl:Yl,br:Ol,tex:Mi,writingMode:C.writingMode,glyphOffset:go,sectionIndex:Oa.sectionIndex,isSDF:Oi,pixelOffsetTL:gp,pixelOffsetBR:yp,minFontScaleX:ih,minFontScaleY:_p})}}return Gt}var hb=function(C,H,ne,xe,Re,qe,pt,Dt,Gt,tr){if(this.boxStartIndex=C.length,Gt){var Pr=qe.top,Zr=qe.bottom,Vr=qe.collisionPadding;Vr&&(Pr-=Vr[1],Zr+=Vr[3]);var ua=Zr-Pr;ua>0&&(ua=Math.max(10,ua),this.circleDiameter=ua)}else{var Oa=qe.top*pt-Dt,Mi=qe.bottom*pt+Dt,ii=qe.left*pt-Dt,$i=qe.right*pt+Dt,Oi=qe.collisionPadding;if(Oi&&(ii-=Oi[0]*pt,Oa-=Oi[1]*pt,$i+=Oi[2]*pt,Mi+=Oi[3]*pt),tr){var Ji=new n(ii,Oa),ln=new n($i,Oa),Tn=new n(ii,Mi),Vn=new n($i,Mi),Nn=tr*Math.PI/180;Ji._rotate(Nn),ln._rotate(Nn),Tn._rotate(Nn),Vn._rotate(Nn),ii=Math.min(Ji.x,ln.x,Tn.x,Vn.x),$i=Math.max(Ji.x,ln.x,Tn.x,Vn.x),Oa=Math.min(Ji.y,ln.y,Tn.y,Vn.y),Mi=Math.max(Ji.y,ln.y,Tn.y,Vn.y)}C.emplaceBack(H.x,H.y,ii,Oa,$i,Mi,ne,xe,Re)}this.boxEndIndex=C.length},Ng=function(C,H){if(C===void 0&&(C=[]),H===void 0&&(H=bW),this.data=C,this.length=this.data.length,this.compare=H,this.length>0)for(var ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)};Ng.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},Ng.prototype.pop=function(){if(this.length!==0){var C=this.data[0],H=this.data.pop();return this.length--,this.length>0&&(this.data[0]=H,this._down(0)),C}},Ng.prototype.peek=function(){return this.data[0]},Ng.prototype._up=function(C){for(var H=this,ne=H.data,xe=H.compare,Re=ne[C];C>0;){var qe=C-1>>1,pt=ne[qe];if(xe(Re,pt)>=0)break;ne[C]=pt,C=qe}ne[C]=Re},Ng.prototype._down=function(C){for(var H=this,ne=H.data,xe=H.compare,Re=this.length>>1,qe=ne[C];C<Re;){var pt=(C<<1)+1,Dt=ne[pt],Gt=pt+1;if(Gt<this.length&&xe(ne[Gt],Dt)<0&&(pt=Gt,Dt=ne[Gt]),xe(Dt,qe)>=0)break;ne[C]=Dt,C=pt}ne[C]=qe};function bW(k,C){return k<C?-1:k>C?1:0}function wW(k,C,H){C===void 0&&(C=1),H===void 0&&(H=!1);for(var ne=1/0,xe=1/0,Re=-1/0,qe=-1/0,pt=k[0],Dt=0;Dt<pt.length;Dt++){var Gt=pt[Dt];(!Dt||Gt.x<ne)&&(ne=Gt.x),(!Dt||Gt.y<xe)&&(xe=Gt.y),(!Dt||Gt.x>Re)&&(Re=Gt.x),(!Dt||Gt.y>qe)&&(qe=Gt.y)}var tr=Re-ne,Pr=qe-xe,Zr=Math.min(tr,Pr),Vr=Zr/2,ua=new Ng([],TW);if(Zr===0)return new n(ne,xe);for(var Oa=ne;Oa<Re;Oa+=Zr)for(var Mi=xe;Mi<qe;Mi+=Zr)ua.push(new Ug(Oa+Vr,Mi+Vr,Vr,k));for(var ii=SW(k),$i=ua.length;ua.length;){var Oi=ua.pop();(Oi.d>ii.d||!ii.d)&&(ii=Oi,H&&console.log("found best %d after %d probes",Math.round(1e4*Oi.d)/1e4,$i)),!(Oi.max-ii.d<=C)&&(Vr=Oi.h/2,ua.push(new Ug(Oi.p.x-Vr,Oi.p.y-Vr,Vr,k)),ua.push(new Ug(Oi.p.x+Vr,Oi.p.y-Vr,Vr,k)),ua.push(new Ug(Oi.p.x-Vr,Oi.p.y+Vr,Vr,k)),ua.push(new Ug(Oi.p.x+Vr,Oi.p.y+Vr,Vr,k)),$i+=4)}return H&&(console.log("num probes: "+$i),console.log("best distance: "+ii.d)),ii.p}function TW(k,C){return C.max-k.max}function Ug(k,C,H,ne){this.p=new n(k,C),this.h=H,this.d=AW(this.p,ne),this.max=this.d+this.h*Math.SQRT2}function AW(k,C){for(var H=!1,ne=1/0,xe=0;xe<C.length;xe++)for(var Re=C[xe],qe=0,pt=Re.length,Dt=pt-1;qe<pt;Dt=qe++){var Gt=Re[qe],tr=Re[Dt];Gt.y>k.y!=tr.y>k.y&&k.x<(tr.x-Gt.x)*(k.y-Gt.y)/(tr.y-Gt.y)+Gt.x&&(H=!H),ne=Math.min(ne,qd(k,Gt,tr))}return(H?1:-1)*Math.sqrt(ne)}function SW(k){for(var C=0,H=0,ne=0,xe=k[0],Re=0,qe=xe.length,pt=qe-1;Re<qe;pt=Re++){var Dt=xe[Re],Gt=xe[pt],tr=Dt.x*Gt.y-Gt.x*Dt.y;H+=(Dt.x+Gt.x)*tr,ne+=(Dt.y+Gt.y)*tr,C+=tr*3}return new Ug(H/C,ne/C,0,k)}var jg=7,pA=Number.POSITIVE_INFINITY;function Ek(k,C){function H(xe,Re){var qe=0,pt=0;Re<0&&(Re=0);var Dt=Re/Math.sqrt(2);switch(xe){case"top-right":case"top-left":pt=Dt-jg;break;case"bottom-right":case"bottom-left":pt=-Dt+jg;break;case"bottom":pt=-Re+jg;break;case"top":pt=Re-jg;break}switch(xe){case"top-right":case"bottom-right":qe=-Dt;break;case"top-left":case"bottom-left":qe=Dt;break;case"left":qe=Re;break;case"right":qe=-Re;break}return[qe,pt]}function ne(xe,Re,qe){var pt=0,Dt=0;switch(Re=Math.abs(Re),qe=Math.abs(qe),xe){case"top-right":case"top-left":case"top":Dt=qe-jg;break;case"bottom-right":case"bottom-left":case"bottom":Dt=-qe+jg;break}switch(xe){case"top-right":case"bottom-right":case"right":pt=-Re;break;case"top-left":case"bottom-left":case"left":pt=Re;break}return[pt,Dt]}return C[1]!==pA?ne(k,C[0],C[1]):H(k,C[0])}function MW(k,C,H,ne,xe,Re,qe){k.createArrays();var pt=512*k.overscaling;k.tilePixelRatio=ui/pt,k.compareText={},k.iconsNeedLinear=!1;var Dt=k.layers[0].layout,Gt=k.layers[0]._unevaluatedLayout._values,tr={};if(k.textSizeData.kind==="composite"){var Pr=k.textSizeData,Zr=Pr.minZoom,Vr=Pr.maxZoom;tr.compositeTextSizes=[Gt["text-size"].possiblyEvaluate(new gn(Zr),qe),Gt["text-size"].possiblyEvaluate(new gn(Vr),qe)]}if(k.iconSizeData.kind==="composite"){var ua=k.iconSizeData,Oa=ua.minZoom,Mi=ua.maxZoom;tr.compositeIconSizes=[Gt["icon-size"].possiblyEvaluate(new gn(Oa),qe),Gt["icon-size"].possiblyEvaluate(new gn(Mi),qe)]}tr.layoutTextSize=Gt["text-size"].possiblyEvaluate(new gn(k.zoom+1),qe),tr.layoutIconSize=Gt["icon-size"].possiblyEvaluate(new gn(k.zoom+1),qe),tr.textMaxSize=Gt["text-size"].possiblyEvaluate(new gn(18));for(var ii=Dt.get("text-line-height")*en,$i=Dt.get("text-rotation-alignment")==="map"&&Dt.get("symbol-placement")!=="point",Oi=Dt.get("text-keep-upright"),Ji=Dt.get("text-size"),ln=function(){var Nn=Vn[Tn],So=Dt.get("text-font").evaluate(Nn,{},qe).join(","),oo=Ji.evaluate(Nn,{},qe),go=tr.layoutTextSize.evaluate(Nn,{},qe),ks=tr.layoutIconSize.evaluate(Nn,{},qe),Mo={horizontal:{},vertical:void 0},Po=Nn.text,$s=[0,0];if(Po){var ws=Po.toString(),Xl=Dt.get("text-letter-spacing").evaluate(Nn,{},qe)*en,zu=Gr(ws)?Xl:0,Zl=Dt.get("text-anchor").evaluate(Nn,{},qe),Yl=Dt.get("text-variable-anchor");if(!Yl){var Ol=Dt.get("text-radial-offset").evaluate(Nn,{},qe);Ol?$s=Ek(Zl,[Ol*en,pA]):$s=Dt.get("text-offset").evaluate(Nn,{},qe).map(function(Uv){return Uv*en})}var $u=$i?"center":Dt.get("text-justify").evaluate(Nn,{},qe),hc=Dt.get("symbol-placement"),hf=hc==="point"?Dt.get("text-max-width").evaluate(Nn,{},qe)*en:0,_f=function(){k.allowVerticalPlacement&&_r(ws)&&(Mo.vertical=Fg(Po,C,H,xe,So,hf,ii,Zl,"left",zu,$s,vp.vertical,!0,hc,go,oo))};if(!$i&&Yl){for(var gh=$u==="auto"?Yl.map(function(Uv){return dA(Uv)}):[$u],Zf=!1,tp=0;tp<gh.length;tp++){var rp=gh[tp];if(!Mo.horizontal[rp])if(Zf)Mo.horizontal[rp]=Mo.horizontal[0];else{var yh=Fg(Po,C,H,xe,So,hf,ii,"center",rp,zu,$s,vp.horizontal,!1,hc,go,oo);yh&&(Mo.horizontal[rp]=yh,Zf=yh.positionedLines.length===1)}}_f()}else{$u==="auto"&&($u=dA(Zl));var gp=Fg(Po,C,H,xe,So,hf,ii,Zl,$u,zu,$s,vp.horizontal,!1,hc,go,oo);gp&&(Mo.horizontal[$u]=gp),_f(),_r(ws)&&$i&&Oi&&(Mo.vertical=Fg(Po,C,H,xe,So,hf,ii,Zl,$u,zu,$s,vp.vertical,!1,hc,go,oo))}}var yp=void 0,ih=!1;if(Nn.icon&&Nn.icon.name){var _p=ne[Nn.icon.name];_p&&(yp=Zp(xe[Nn.icon.name],Dt.get("icon-offset").evaluate(Nn,{},qe),Dt.get("icon-anchor").evaluate(Nn,{},qe)),ih=_p.sdf,k.sdfIcons===void 0?k.sdfIcons=_p.sdf:k.sdfIcons!==_p.sdf&&B("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(_p.pixelRatio!==k.pixelRatio||Dt.get("icon-rotate").constantOr(1)!==0)&&(k.iconsNeedLinear=!0))}var nd=Ck(Mo.horizontal)||Mo.vertical;k.iconsInText=nd?nd.iconsInText:!1,(nd||yp)&&EW(k,Nn,Mo,yp,ne,tr,go,ks,$s,ih,qe)},Tn=0,Vn=k.features;Tn<Vn.length;Tn+=1)ln();Re&&k.generateCollisionDebugBuffers()}function dA(k){switch(k){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function EW(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr){var Pr=Re.textMaxSize.evaluate(C,{});Pr===void 0&&(Pr=qe);var Zr=k.layers[0].layout,Vr=Zr.get("icon-offset").evaluate(C,{},tr),ua=Ck(H.horizontal),Oa=24,Mi=qe/Oa,ii=k.tilePixelRatio*Mi,$i=k.tilePixelRatio*Pr/Oa,Oi=k.tilePixelRatio*pt,Ji=k.tilePixelRatio*Zr.get("symbol-spacing"),ln=Zr.get("text-padding")*k.tilePixelRatio,Tn=Zr.get("icon-padding")*k.tilePixelRatio,Vn=Zr.get("text-max-angle")/180*Math.PI,Nn=Zr.get("text-rotation-alignment")==="map"&&Zr.get("symbol-placement")!=="point",So=Zr.get("icon-rotation-alignment")==="map"&&Zr.get("symbol-placement")!=="point",oo=Zr.get("symbol-placement"),go=Ji/2,ks=Zr.get("icon-text-fit"),Mo;ne&&ks!=="none"&&(k.allowVerticalPlacement&&H.vertical&&(Mo=dv(ne,H.vertical,ks,Zr.get("icon-text-fit-padding"),Vr,Mi)),ua&&(ne=dv(ne,ua,ks,Zr.get("icon-text-fit-padding"),Vr,Mi)));var Po=function(Wg,wd){wd.x<0||wd.x>=ui||wd.y<0||wd.y>=ui||kW(k,wd,Wg,H,ne,xe,Mo,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,ii,ln,Nn,Dt,Oi,Tn,So,Vr,C,Re,Gt,tr,qe)};if(oo==="line")for(var $s=0,ws=Ak(C.geometry,0,0,ui,ui);$s<ws.length;$s+=1)for(var Xl=ws[$s],zu=_W(Xl,Ji,Vn,H.vertical||ua,ne,Oa,$i,k.overscaling,ui),Zl=0,Yl=zu;Zl<Yl.length;Zl+=1){var Ol=Yl[Zl],$u=ua;(!$u||!CW(k,$u.text,go,Ol))&&Po(Xl,Ol)}else if(oo==="line-center")for(var hc=0,hf=C.geometry;hc<hf.length;hc+=1){var _f=hf[hc];if(_f.length>1){var gh=yW(_f,Vn,H.vertical||ua,ne,Oa,$i);gh&&Po(_f,gh)}}else if(C.type==="Polygon")for(var Zf=0,tp=Cg(C.geometry,0);Zf<tp.length;Zf+=1){var rp=tp[Zf],yh=wW(rp,16);Po(rp[0],new ep(yh.x,yh.y,0))}else if(C.type==="LineString")for(var gp=0,yp=C.geometry;gp<yp.length;gp+=1){var ih=yp[gp];Po(ih,new ep(ih[0].x,ih[0].y,0))}else if(C.type==="Point")for(var _p=0,nd=C.geometry;_p<nd.length;_p+=1)for(var Uv=nd[_p],_m=0,xm=Uv;_m<xm.length;_m+=1){var bm=xm[_m];Po([bm],new ep(bm.x,bm.y,0))}}var Q1=255,gm=Q1*Bh;function kk(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua){var Oa=xW(C,H,pt,xe,Re,qe,ne,k.allowVerticalPlacement),Mi=k.textSizeData,ii=null;Mi.kind==="source"?(ii=[Bh*xe.layout.get("text-size").evaluate(qe,{})],ii[0]>gm&&B(k.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')):Mi.kind==="composite"&&(ii=[Bh*Vr.compositeTextSizes[0].evaluate(qe,{},ua),Bh*Vr.compositeTextSizes[1].evaluate(qe,{},ua)],(ii[0]>gm||ii[1]>gm)&&B(k.layerIds[0]+': Value for "text-size" is >= '+Q1+'. Reduce your "text-size".')),k.addSymbols(k.text,Oa,ii,pt,Re,qe,Gt,C,Dt.lineStartIndex,Dt.lineLength,Zr,ua);for(var $i=0,Oi=tr;$i<Oi.length;$i+=1){var Ji=Oi[$i];Pr[Ji]=k.text.placedSymbolArray.length-1}return Oa.length*4}function Ck(k){for(var C in k)return k[C];return null}function kW(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr,Vr,ua,Oa,Mi,ii,$i,Oi,Ji,ln,Tn,Vn,Nn){var So,oo=k.addToLineVertexArray(C,H),go,ks,Mo,Po,$s=0,ws=0,Xl=0,zu=0,Zl=-1,Yl=-1,Ol={},$u=me(""),hc=0,hf=0;if(pt._unevaluatedLayout.getValue("text-radial-offset")===void 0?(So=pt.layout.get("text-offset").evaluate(Ji,{},Vn).map(function(r_){return r_*en}),hc=So[0],hf=So[1]):(hc=pt.layout.get("text-radial-offset").evaluate(Ji,{},Vn)*en,hf=pA),k.allowVerticalPlacement&&ne.vertical){var _f=pt.layout.get("text-rotate").evaluate(Ji,{},Vn),gh=_f+90,Zf=ne.vertical;Mo=new hb(Dt,C,Gt,tr,Pr,Zf,Zr,Vr,ua,gh),qe&&(Po=new hb(Dt,C,Gt,tr,Pr,qe,Mi,ii,ua,gh))}if(xe){var tp=pt.layout.get("icon-rotate").evaluate(Ji,{}),rp=pt.layout.get("icon-text-fit")!=="none",yh=Sk(xe,tp,Tn,rp),gp=qe?Sk(qe,tp,Tn,rp):void 0;ks=new hb(Dt,C,Gt,tr,Pr,xe,Mi,ii,!1,tp),$s=yh.length*4;var yp=k.iconSizeData,ih=null;yp.kind==="source"?(ih=[Bh*pt.layout.get("icon-size").evaluate(Ji,{})],ih[0]>gm&&B(k.layerIds[0]+': Value for "icon-size" is >= '+Q1+'. Reduce your "icon-size".')):yp.kind==="composite"&&(ih=[Bh*ln.compositeIconSizes[0].evaluate(Ji,{},Vn),Bh*ln.compositeIconSizes[1].evaluate(Ji,{},Vn)],(ih[0]>gm||ih[1]>gm)&&B(k.layerIds[0]+': Value for "icon-size" is >= '+Q1+'. Reduce your "icon-size".')),k.addSymbols(k.icon,yh,ih,Oi,$i,Ji,!1,C,oo.lineStartIndex,oo.lineLength,-1,Vn),Zl=k.icon.placedSymbolArray.length-1,gp&&(ws=gp.length*4,k.addSymbols(k.icon,gp,ih,Oi,$i,Ji,vp.vertical,C,oo.lineStartIndex,oo.lineLength,-1,Vn),Yl=k.icon.placedSymbolArray.length-1)}for(var _p in ne.horizontal){var nd=ne.horizontal[_p];if(!go){$u=me(nd.text);var Uv=pt.layout.get("text-rotate").evaluate(Ji,{},Vn);go=new hb(Dt,C,Gt,tr,Pr,nd,Zr,Vr,ua,Uv)}var _m=nd.positionedLines.length===1;if(Xl+=kk(k,C,nd,Re,pt,ua,Ji,Oa,oo,ne.vertical?vp.horizontal:vp.horizontalOnly,_m?Object.keys(ne.horizontal):[_p],Ol,Zl,ln,Vn),_m)break}ne.vertical&&(zu+=kk(k,C,ne.vertical,Re,pt,ua,Ji,Oa,oo,vp.vertical,["vertical"],Ol,Yl,ln,Vn));var xm=go?go.boxStartIndex:k.collisionBoxArray.length,bm=go?go.boxEndIndex:k.collisionBoxArray.length,Wg=Mo?Mo.boxStartIndex:k.collisionBoxArray.length,wd=Mo?Mo.boxEndIndex:k.collisionBoxArray.length,gb=ks?ks.boxStartIndex:k.collisionBoxArray.length,xA=ks?ks.boxEndIndex:k.collisionBoxArray.length,yb=Po?Po.boxStartIndex:k.collisionBoxArray.length,bA=Po?Po.boxEndIndex:k.collisionBoxArray.length,hd=-1,Xg=function(r_,Hk){return r_&&r_.circleDiameter?Math.max(r_.circleDiameter,Hk):Hk};hd=Xg(go,hd),hd=Xg(Mo,hd),hd=Xg(ks,hd),hd=Xg(Po,hd);var _b=hd>-1?1:0;_b&&(hd*=Nn/en),k.glyphOffsetArray.length>=Du.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ji.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,Ji.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Ol.right>=0?Ol.right:-1,Ol.center>=0?Ol.center:-1,Ol.left>=0?Ol.left:-1,Ol.vertical||-1,Zl,Yl,$u,xm,bm,Wg,wd,gb,xA,yb,bA,Gt,Xl,zu,$s,ws,_b,0,Zr,hc,hf,hd)}function CW(k,C,H,ne){var xe=k.compareText;if(!(C in xe))xe[C]=[];else for(var Re=xe[C],qe=Re.length-1;qe>=0;qe--)if(ne.dist(Re[qe])<H)return!0;return xe[C].push(ne),!1}var LW=Xd.VectorTileFeature.types,PW=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pb(k,C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr){var Vr=pt?Math.min(gm,Math.round(pt[0])):0,ua=pt?Math.min(gm,Math.round(pt[1])):0;k.emplaceBack(C,H,Math.round(ne*32),Math.round(xe*32),Re,qe,(Vr<<1)+(Dt?1:0),ua,Gt*16,tr*16,Pr*256,Zr*256)}function vA(k,C,H){k.emplaceBack(C.x,C.y,H),k.emplaceBack(C.x,C.y,H),k.emplaceBack(C.x,C.y,H),k.emplaceBack(C.x,C.y,H)}function IW(k){for(var C=0,H=k.sections;C<H.length;C+=1){var ne=H[C];if(fi(ne.text))return!0}return!1}var qg=function(C){this.layoutVertexArray=new pn,this.indexArray=new Xi,this.programConfigurations=C,this.segments=new Co,this.dynamicLayoutVertexArray=new Ha,this.opacityVertexArray=new Ua,this.placedSymbolArray=new fs};qg.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},qg.prototype.upload=function(C,H,ne,xe){this.isEmpty()||(ne&&(this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,ke.members),this.indexBuffer=C.createIndexBuffer(this.indexArray,H),this.dynamicLayoutVertexBuffer=C.createVertexBuffer(this.dynamicLayoutVertexArray,je.members,!0),this.opacityVertexBuffer=C.createVertexBuffer(this.opacityVertexArray,PW,!0),this.opacityVertexBuffer.itemSize=1),(ne||xe)&&this.programConfigurations.upload(C))},qg.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},de("SymbolBuffers",qg);var e_=function(C,H,ne){this.layoutVertexArray=new C,this.layoutAttributes=H,this.indexArray=new ne,this.segments=new Co,this.collisionVertexArray=new xi};e_.prototype.upload=function(C){this.layoutVertexBuffer=C.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=C.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=C.createVertexBuffer(this.collisionVertexArray,ht.members,!0)},e_.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},de("CollisionBuffers",e_);var Du=function(C){this.collisionBoxArray=C.collisionBoxArray,this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(Dt){return Dt.id}),this.index=C.index,this.pixelRatio=C.pixelRatio,this.sourceLayerIndex=C.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Pv([]),this.placementViewportMatrix=Pv([]);var H=this.layers[0],ne=H._unevaluatedLayout._values;this.textSizeData=id(this.zoom,ne["text-size"]),this.iconSizeData=id(this.zoom,ne["icon-size"]);var xe=this.layers[0].layout,Re=xe.get("symbol-sort-key"),qe=xe.get("symbol-z-order");this.canOverlap=xe.get("text-allow-overlap")||xe.get("icon-allow-overlap")||xe.get("text-ignore-placement")||xe.get("icon-ignore-placement"),this.sortFeaturesByKey=qe!=="viewport-y"&&Re.constantOr(1)!==void 0;var pt=qe==="viewport-y"||qe==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=pt&&this.canOverlap,xe.get("symbol-placement")==="point"&&(this.writingModes=xe.get("text-writing-mode").map(function(Dt){return vp[Dt]})),this.stateDependentLayerIds=this.layers.filter(function(Dt){return Dt.isStateDependent()}).map(function(Dt){return Dt.id}),this.sourceID=C.sourceID};Du.prototype.createArrays=function(){this.text=new qg(new Ga(this.layers,this.zoom,function(C){return/^text/.test(C)})),this.icon=new qg(new Ga(this.layers,this.zoom,function(C){return/^icon/.test(C)})),this.glyphOffsetArray=new tu,this.lineVertexArray=new qs,this.symbolInstances=new kl},Du.prototype.calculateGlyphDependencies=function(C,H,ne,xe,Re){for(var qe=0;qe<C.length;qe++)if(H[C.charCodeAt(qe)]=!0,(ne||xe)&&Re){var pt=gi[C.charAt(qe)];pt&&(H[pt.charCodeAt(0)]=!0)}},Du.prototype.populate=function(C,H,ne){var xe=this.layers[0],Re=xe.layout,qe=Re.get("text-font"),pt=Re.get("text-field"),Dt=Re.get("icon-image"),Gt=(pt.value.kind!=="constant"||pt.value.value instanceof lu&&!pt.value.value.isEmpty()||pt.value.value.toString().length>0)&&(qe.value.kind!=="constant"||qe.value.value.length>0),tr=Dt.value.kind!=="constant"||!!Dt.value.value||Object.keys(Dt.parameters).length>0,Pr=Re.get("symbol-sort-key");if(this.features=[],!(!Gt&&!tr)){for(var Zr=H.iconDependencies,Vr=H.glyphDependencies,ua=H.availableImages,Oa=new gn(this.zoom),Mi=0,ii=C;Mi<ii.length;Mi+=1){var $i=ii[Mi],Oi=$i.feature,Ji=$i.id,ln=$i.index,Tn=$i.sourceLayerIndex,Vn=xe._featureFilter.needGeometry,Nn=_o(Oi,Vn);if(xe._featureFilter.filter(Oa,Nn,ne)){Vn||(Nn.geometry=fn(Oi));var So=void 0;if(Gt){var oo=xe.getValueAndResolveTokens("text-field",Nn,ne,ua),go=lu.factory(oo);IW(go)&&(this.hasRTLText=!0),(!this.hasRTLText||Yo()==="unavailable"||this.hasRTLText&&al.isParsed())&&(So=Ka(go,xe,Nn))}var ks=void 0;if(tr){var Mo=xe.getValueAndResolveTokens("icon-image",Nn,ne,ua);Mo instanceof Pl?ks=Mo:ks=Pl.fromString(Mo)}if(!(!So&&!ks)){var Po=this.sortFeaturesByKey?Pr.evaluate(Nn,{},ne):void 0,$s={id:Ji,text:So,icon:ks,index:ln,sourceLayerIndex:Tn,geometry:Nn.geometry,properties:Oi.properties,type:LW[Oi.type],sortKey:Po};if(this.features.push($s),ks&&(Zr[ks.name]=!0),So){var ws=qe.evaluate(Nn,{},ne).join(","),Xl=Re.get("text-rotation-alignment")==="map"&&Re.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(vp.vertical)>=0;for(var zu=0,Zl=So.sections;zu<Zl.length;zu+=1){var Yl=Zl[zu];if(Yl.image)Zr[Yl.image.name]=!0;else{var Ol=_r(So.toString()),$u=Yl.fontStack||ws,hc=Vr[$u]=Vr[$u]||{};this.calculateGlyphDependencies(Yl.text,hc,Xl,this.allowVerticalPlacement,Ol)}}}}}}Re.get("symbol-placement")==="line"&&(this.features=Wi(this.features)),this.sortFeaturesByKey&&this.features.sort(function(hf,_f){return hf.sortKey-_f.sortKey})}},Du.prototype.update=function(C,H,ne){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(C,H,this.layers,ne),this.icon.programConfigurations.updatePaintArrays(C,H,this.layers,ne))},Du.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Du.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Du.prototype.upload=function(C){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(C),this.iconCollisionBox.upload(C)),this.text.upload(C,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(C,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Du.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Du.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Du.prototype.addToLineVertexArray=function(C,H){var ne=this.lineVertexArray.length;if(C.segment!==void 0){for(var xe=C.dist(H[C.segment+1]),Re=C.dist(H[C.segment]),qe={},pt=C.segment+1;pt<H.length;pt++)qe[pt]={x:H[pt].x,y:H[pt].y,tileUnitDistanceFromAnchor:xe},pt<H.length-1&&(xe+=H[pt+1].dist(H[pt]));for(var Dt=C.segment||0;Dt>=0;Dt--)qe[Dt]={x:H[Dt].x,y:H[Dt].y,tileUnitDistanceFromAnchor:Re},Dt>0&&(Re+=H[Dt-1].dist(H[Dt]));for(var Gt=0;Gt<H.length;Gt++){var tr=qe[Gt];this.lineVertexArray.emplaceBack(tr.x,tr.y,tr.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ne,lineLength:this.lineVertexArray.length-ne}},Du.prototype.addSymbols=function(C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr,Zr){for(var Vr=C.indexArray,ua=C.layoutVertexArray,Oa=C.segments.prepareSegment(4*H.length,ua,Vr,this.canOverlap?qe.sortKey:void 0),Mi=this.glyphOffsetArray.length,ii=Oa.vertexLength,$i=this.allowVerticalPlacement&&pt===vp.vertical?Math.PI/2:0,Oi=qe.text&&qe.text.sections,Ji=0;Ji<H.length;Ji++){var ln=H[Ji],Tn=ln.tl,Vn=ln.tr,Nn=ln.bl,So=ln.br,oo=ln.tex,go=ln.pixelOffsetTL,ks=ln.pixelOffsetBR,Mo=ln.minFontScaleX,Po=ln.minFontScaleY,$s=ln.glyphOffset,ws=ln.isSDF,Xl=ln.sectionIndex,zu=Oa.vertexLength,Zl=$s[1];pb(ua,Dt.x,Dt.y,Tn.x,Zl+Tn.y,oo.x,oo.y,ne,ws,go.x,go.y,Mo,Po),pb(ua,Dt.x,Dt.y,Vn.x,Zl+Vn.y,oo.x+oo.w,oo.y,ne,ws,ks.x,go.y,Mo,Po),pb(ua,Dt.x,Dt.y,Nn.x,Zl+Nn.y,oo.x,oo.y+oo.h,ne,ws,go.x,ks.y,Mo,Po),pb(ua,Dt.x,Dt.y,So.x,Zl+So.y,oo.x+oo.w,oo.y+oo.h,ne,ws,ks.x,ks.y,Mo,Po),vA(C.dynamicLayoutVertexArray,Dt,$i),Vr.emplaceBack(zu,zu+1,zu+2),Vr.emplaceBack(zu+1,zu+2,zu+3),Oa.vertexLength+=4,Oa.primitiveLength+=2,this.glyphOffsetArray.emplaceBack($s[0]),(Ji===H.length-1||Xl!==H[Ji+1].sectionIndex)&&C.programConfigurations.populatePaintArrays(ua.length,qe,qe.index,{},Zr,Oi&&Oi[Xl])}C.placedSymbolArray.emplaceBack(Dt.x,Dt.y,Mi,this.glyphOffsetArray.length-Mi,ii,Gt,tr,Dt.segment,ne?ne[0]:0,ne?ne[1]:0,xe[0],xe[1],pt,0,!1,0,Pr)},Du.prototype._addCollisionDebugVertex=function(C,H,ne,xe,Re,qe){return H.emplaceBack(0,0),C.emplaceBack(ne.x,ne.y,xe,Re,Math.round(qe.x),Math.round(qe.y))},Du.prototype.addCollisionDebugVertices=function(C,H,ne,xe,Re,qe,pt){var Dt=Re.segments.prepareSegment(4,Re.layoutVertexArray,Re.indexArray),Gt=Dt.vertexLength,tr=Re.layoutVertexArray,Pr=Re.collisionVertexArray,Zr=pt.anchorX,Vr=pt.anchorY;this._addCollisionDebugVertex(tr,Pr,qe,Zr,Vr,new n(C,H)),this._addCollisionDebugVertex(tr,Pr,qe,Zr,Vr,new n(ne,H)),this._addCollisionDebugVertex(tr,Pr,qe,Zr,Vr,new n(ne,xe)),this._addCollisionDebugVertex(tr,Pr,qe,Zr,Vr,new n(C,xe)),Dt.vertexLength+=4;var ua=Re.indexArray;ua.emplaceBack(Gt,Gt+1),ua.emplaceBack(Gt+1,Gt+2),ua.emplaceBack(Gt+2,Gt+3),ua.emplaceBack(Gt+3,Gt),Dt.primitiveLength+=4},Du.prototype.addDebugCollisionBoxes=function(C,H,ne,xe){for(var Re=C;Re<H;Re++){var qe=this.collisionBoxArray.get(Re),pt=qe.x1,Dt=qe.y1,Gt=qe.x2,tr=qe.y2;this.addCollisionDebugVertices(pt,Dt,Gt,tr,xe?this.textCollisionBox:this.iconCollisionBox,qe.anchorPoint,ne)}},Du.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new e_(Ri,Ut.members,Dn),this.iconCollisionBox=new e_(Ri,Ut.members,Dn);for(var C=0;C<this.symbolInstances.length;C++){var H=this.symbolInstances.get(C);this.addDebugCollisionBoxes(H.textBoxStartIndex,H.textBoxEndIndex,H,!0),this.addDebugCollisionBoxes(H.verticalTextBoxStartIndex,H.verticalTextBoxEndIndex,H,!0),this.addDebugCollisionBoxes(H.iconBoxStartIndex,H.iconBoxEndIndex,H,!1),this.addDebugCollisionBoxes(H.verticalIconBoxStartIndex,H.verticalIconBoxEndIndex,H,!1)}},Du.prototype._deserializeCollisionBoxesForSymbol=function(C,H,ne,xe,Re,qe,pt,Dt,Gt){for(var tr={},Pr=H;Pr<ne;Pr++){var Zr=C.get(Pr);tr.textBox={x1:Zr.x1,y1:Zr.y1,x2:Zr.x2,y2:Zr.y2,anchorPointX:Zr.anchorPointX,anchorPointY:Zr.anchorPointY},tr.textFeatureIndex=Zr.featureIndex;break}for(var Vr=xe;Vr<Re;Vr++){var ua=C.get(Vr);tr.verticalTextBox={x1:ua.x1,y1:ua.y1,x2:ua.x2,y2:ua.y2,anchorPointX:ua.anchorPointX,anchorPointY:ua.anchorPointY},tr.verticalTextFeatureIndex=ua.featureIndex;break}for(var Oa=qe;Oa<pt;Oa++){var Mi=C.get(Oa);tr.iconBox={x1:Mi.x1,y1:Mi.y1,x2:Mi.x2,y2:Mi.y2,anchorPointX:Mi.anchorPointX,anchorPointY:Mi.anchorPointY},tr.iconFeatureIndex=Mi.featureIndex;break}for(var ii=Dt;ii<Gt;ii++){var $i=C.get(ii);tr.verticalIconBox={x1:$i.x1,y1:$i.y1,x2:$i.x2,y2:$i.y2,anchorPointX:$i.anchorPointX,anchorPointY:$i.anchorPointY},tr.verticalIconFeatureIndex=$i.featureIndex;break}return tr},Du.prototype.deserializeCollisionBoxes=function(C){this.collisionArrays=[];for(var H=0;H<this.symbolInstances.length;H++){var ne=this.symbolInstances.get(H);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(C,ne.textBoxStartIndex,ne.textBoxEndIndex,ne.verticalTextBoxStartIndex,ne.verticalTextBoxEndIndex,ne.iconBoxStartIndex,ne.iconBoxEndIndex,ne.verticalIconBoxStartIndex,ne.verticalIconBoxEndIndex))}},Du.prototype.hasTextData=function(){return this.text.segments.get().length>0},Du.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Du.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Du.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Du.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Du.prototype.addIndicesForPlacedSymbol=function(C,H){for(var ne=C.placedSymbolArray.get(H),xe=ne.vertexStartIndex+ne.numGlyphs*4,Re=ne.vertexStartIndex;Re<xe;Re+=4)C.indexArray.emplaceBack(Re,Re+1,Re+2),C.indexArray.emplaceBack(Re+1,Re+2,Re+3)},Du.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var H=Math.sin(C),ne=Math.cos(C),xe=[],Re=[],qe=[],pt=0;pt<this.symbolInstances.length;++pt){qe.push(pt);var Dt=this.symbolInstances.get(pt);xe.push(Math.round(H*Dt.anchorX+ne*Dt.anchorY)|0),Re.push(Dt.featureIndex)}return qe.sort(function(Gt,tr){return xe[Gt]-xe[tr]||Re[tr]-Re[Gt]}),qe},Du.prototype.addToSortKeyRanges=function(C,H){var ne=this.sortKeyRanges[this.sortKeyRanges.length-1];ne&&ne.sortKey===H?ne.symbolInstanceEnd=C+1:this.sortKeyRanges.push({sortKey:H,symbolInstanceStart:C,symbolInstanceEnd:C+1})},Du.prototype.sortFeatures=function(C){var H=this;if(this.sortFeaturesByY&&this.sortedAngle!==C&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var ne=0,xe=this.symbolInstanceIndexes;ne<xe.length;ne+=1){var Re=xe[ne],qe=this.symbolInstances.get(Re);this.featureSortOrder.push(qe.featureIndex),[qe.rightJustifiedTextSymbolIndex,qe.centerJustifiedTextSymbolIndex,qe.leftJustifiedTextSymbolIndex].forEach(function(pt,Dt,Gt){pt>=0&&Gt.indexOf(pt)===Dt&&H.addIndicesForPlacedSymbol(H.text,pt)}),qe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,qe.verticalPlacedTextSymbolIndex),qe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,qe.placedIconSymbolIndex),qe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,qe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},de("SymbolBucket",Du,{omit:["layers","collisionBoxArray","features","compareText"]}),Du.MAX_GLYPHS=65535,Du.addDynamicAttributes=vA;function RW(k,C){return C.replace(/{([^{}]+)}/g,function(H,ne){return ne in k?String(k[ne]):""})}var DW=new ma({"symbol-placement":new it(Gi.layout_symbol["symbol-placement"]),"symbol-spacing":new it(Gi.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new it(Gi.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Zt(Gi.layout_symbol["symbol-sort-key"]),"symbol-z-order":new it(Gi.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new it(Gi.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new it(Gi.layout_symbol["icon-ignore-placement"]),"icon-optional":new it(Gi.layout_symbol["icon-optional"]),"icon-rotation-alignment":new it(Gi.layout_symbol["icon-rotation-alignment"]),"icon-size":new Zt(Gi.layout_symbol["icon-size"]),"icon-text-fit":new it(Gi.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new it(Gi.layout_symbol["icon-text-fit-padding"]),"icon-image":new Zt(Gi.layout_symbol["icon-image"]),"icon-rotate":new Zt(Gi.layout_symbol["icon-rotate"]),"icon-padding":new it(Gi.layout_symbol["icon-padding"]),"icon-keep-upright":new it(Gi.layout_symbol["icon-keep-upright"]),"icon-offset":new Zt(Gi.layout_symbol["icon-offset"]),"icon-anchor":new Zt(Gi.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new it(Gi.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new it(Gi.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new it(Gi.layout_symbol["text-rotation-alignment"]),"text-field":new Zt(Gi.layout_symbol["text-field"]),"text-font":new Zt(Gi.layout_symbol["text-font"]),"text-size":new Zt(Gi.layout_symbol["text-size"]),"text-max-width":new Zt(Gi.layout_symbol["text-max-width"]),"text-line-height":new it(Gi.layout_symbol["text-line-height"]),"text-letter-spacing":new Zt(Gi.layout_symbol["text-letter-spacing"]),"text-justify":new Zt(Gi.layout_symbol["text-justify"]),"text-radial-offset":new Zt(Gi.layout_symbol["text-radial-offset"]),"text-variable-anchor":new it(Gi.layout_symbol["text-variable-anchor"]),"text-anchor":new Zt(Gi.layout_symbol["text-anchor"]),"text-max-angle":new it(Gi.layout_symbol["text-max-angle"]),"text-writing-mode":new it(Gi.layout_symbol["text-writing-mode"]),"text-rotate":new Zt(Gi.layout_symbol["text-rotate"]),"text-padding":new it(Gi.layout_symbol["text-padding"]),"text-keep-upright":new it(Gi.layout_symbol["text-keep-upright"]),"text-transform":new Zt(Gi.layout_symbol["text-transform"]),"text-offset":new Zt(Gi.layout_symbol["text-offset"]),"text-allow-overlap":new it(Gi.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new it(Gi.layout_symbol["text-ignore-placement"]),"text-optional":new it(Gi.layout_symbol["text-optional"])}),zW=new ma({"icon-opacity":new Zt(Gi.paint_symbol["icon-opacity"]),"icon-color":new Zt(Gi.paint_symbol["icon-color"]),"icon-halo-color":new Zt(Gi.paint_symbol["icon-halo-color"]),"icon-halo-width":new Zt(Gi.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Zt(Gi.paint_symbol["icon-halo-blur"]),"icon-translate":new it(Gi.paint_symbol["icon-translate"]),"icon-translate-anchor":new it(Gi.paint_symbol["icon-translate-anchor"]),"text-opacity":new Zt(Gi.paint_symbol["text-opacity"]),"text-color":new Zt(Gi.paint_symbol["text-color"],{runtimeType:Is,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Zt(Gi.paint_symbol["text-halo-color"]),"text-halo-width":new Zt(Gi.paint_symbol["text-halo-width"]),"text-halo-blur":new Zt(Gi.paint_symbol["text-halo-blur"]),"text-translate":new it(Gi.paint_symbol["text-translate"]),"text-translate-anchor":new it(Gi.paint_symbol["text-translate-anchor"])}),mA={paint:zW,layout:DW},Vg=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:il,this.defaultValue=C};Vg.prototype.evaluate=function(C){if(C.formattedSection){var H=this.defaultValue.property.overrides;if(H&&H.hasOverride(C.formattedSection))return H.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},Vg.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var H=this.defaultValue.value;C(H._styleExpression.expression)}},Vg.prototype.outputDefined=function(){return!1},Vg.prototype.serialize=function(){return null},de("FormatSectionOverride",Vg,{omit:["defaultValue"]});var FW=function(k){function C(H){k.call(this,H,mA)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(ne,xe){if(k.prototype.recalculate.call(this,ne,xe),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Re=this.layout.get("text-writing-mode");if(Re){for(var qe=[],pt=0,Dt=Re;pt<Dt.length;pt+=1){var Gt=Dt[pt];qe.indexOf(Gt)<0&&qe.push(Gt)}this.layout._values["text-writing-mode"]=qe}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},C.prototype.getValueAndResolveTokens=function(ne,xe,Re,qe){var pt=this.layout.get(ne).evaluate(xe,{},Re,qe),Dt=this._unevaluatedLayout._values[ne];return!Dt.isDataDriven()&&!ho(Dt.value)&&pt?RW(xe.properties,pt):pt},C.prototype.createBucket=function(ne){return new Du(ne)},C.prototype.queryRadius=function(){return 0},C.prototype.queryIntersectsFeature=function(){return!1},C.prototype._setPaintOverrides=function(){for(var ne=0,xe=mA.paint.overridableProperties;ne<xe.length;ne+=1){var Re=xe[ne];if(C.hasPaintOverride(this.layout,Re)){var qe=this.paint.get(Re),pt=new Vg(qe),Dt=new yc(pt,qe.property.specification),Gt=null;qe.value.kind==="constant"||qe.value.kind==="source"?Gt=new Dc("source",Dt):Gt=new lc("composite",Dt,qe.value.zoomStops,qe.value._interpolationType),this.paint._values[Re]=new Rl(qe.property,Gt,qe.parameters)}}},C.prototype._handleOverridablePaintPropertyUpdate=function(ne,xe,Re){return!this.layout||xe.isDataDriven()||Re.isDataDriven()?!1:C.hasPaintOverride(this.layout,ne)},C.hasPaintOverride=function(ne,xe){var Re=ne.get("text-field"),qe=mA.paint.properties[xe],pt=!1,Dt=function(Pr){for(var Zr=0,Vr=Pr;Zr<Vr.length;Zr+=1){var ua=Vr[Zr];if(qe.overrides&&qe.overrides.hasOverride(ua)){pt=!0;return}}};if(Re.value.kind==="constant"&&Re.value.value instanceof lu)Dt(Re.value.value.sections);else if(Re.value.kind==="source"){var Gt=function(Pr){if(!pt)if(Pr instanceof xs&&nl(Pr.value)===Ts){var Zr=Pr.value;Dt(Zr.sections)}else Pr instanceof qu?Dt(Pr.sections):Pr.eachChild(Gt)},tr=Re.value;tr._styleExpression&&Gt(tr._styleExpression.expression)}return pt},C}(Ya),OW=new ma({"background-color":new it(Gi.paint_background["background-color"]),"background-pattern":new oa(Gi.paint_background["background-pattern"]),"background-opacity":new it(Gi.paint_background["background-opacity"])}),BW={paint:OW},NW=function(k){function C(H){k.call(this,H,BW)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Ya),UW=new ma({"raster-opacity":new it(Gi.paint_raster["raster-opacity"]),"raster-hue-rotate":new it(Gi.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new it(Gi.paint_raster["raster-brightness-min"]),"raster-brightness-max":new it(Gi.paint_raster["raster-brightness-max"]),"raster-saturation":new it(Gi.paint_raster["raster-saturation"]),"raster-contrast":new it(Gi.paint_raster["raster-contrast"]),"raster-resampling":new it(Gi.paint_raster["raster-resampling"]),"raster-fade-duration":new it(Gi.paint_raster["raster-fade-duration"])}),jW={paint:UW},qW=function(k){function C(H){k.call(this,H,jW)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Ya);function VW(k){var C=[],H=k.id;return H===void 0&&C.push({message:"layers."+H+': missing required property "id"'}),k.render===void 0&&C.push({message:"layers."+H+': missing required method "render"'}),k.renderingMode&&k.renderingMode!=="2d"&&k.renderingMode!=="3d"&&C.push({message:"layers."+H+': property "renderingMode" must be either "2d" or "3d"'}),C}var GW=function(k){function C(H){k.call(this,H,{}),this.implementation=H}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},C.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},C.prototype.recalculate=function(){},C.prototype.updateTransitions=function(){},C.prototype.hasTransition=function(){},C.prototype.serialize=function(){},C.prototype.onAdd=function(ne){this.implementation.onAdd&&this.implementation.onAdd(ne,ne.painter.context.gl)},C.prototype.onRemove=function(ne){this.implementation.onRemove&&this.implementation.onRemove(ne,ne.painter.context.gl)},C}(Ya),HW={circle:XT,heatmap:Ag,hillshade:Rx,fill:z0,"fill-extrusion":pv,line:D,symbol:FW,background:NW,raster:qW};function WW(k){return k.type==="custom"?new GW(k):new HW[k.type](k)}var Lk=s.HTMLImageElement,Pk=s.HTMLCanvasElement,Ik=s.HTMLVideoElement,Rk=s.ImageData,db=s.ImageBitmap,N0=function(C,H,ne,xe){this.context=C,this.format=ne,this.texture=C.gl.createTexture(),this.update(H,xe)};N0.prototype.update=function(C,H,ne){var xe=C.width,Re=C.height,qe=(!this.size||this.size[0]!==xe||this.size[1]!==Re)&&!ne,pt=this,Dt=pt.context,Gt=Dt.gl;if(this.useMipmap=!!(H&&H.useMipmap),Gt.bindTexture(Gt.TEXTURE_2D,this.texture),Dt.pixelStoreUnpackFlipY.set(!1),Dt.pixelStoreUnpack.set(1),Dt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Gt.RGBA&&(!H||H.premultiply!==!1)),qe)this.size=[xe,Re],C instanceof Lk||C instanceof Pk||C instanceof Ik||C instanceof Rk||db&&C instanceof db?Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,this.format,Gt.UNSIGNED_BYTE,C):Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,xe,Re,0,this.format,Gt.UNSIGNED_BYTE,C.data);else{var tr=ne||{x:0,y:0},Pr=tr.x,Zr=tr.y;C instanceof Lk||C instanceof Pk||C instanceof Ik||C instanceof Rk||db&&C instanceof db?Gt.texSubImage2D(Gt.TEXTURE_2D,0,Pr,Zr,Gt.RGBA,Gt.UNSIGNED_BYTE,C):Gt.texSubImage2D(Gt.TEXTURE_2D,0,Pr,Zr,xe,Re,Gt.RGBA,Gt.UNSIGNED_BYTE,C.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Gt.generateMipmap(Gt.TEXTURE_2D)},N0.prototype.bind=function(C,H,ne){var xe=this,Re=xe.context,qe=Re.gl;qe.bindTexture(qe.TEXTURE_2D,this.texture),ne===qe.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(ne=qe.LINEAR),C!==this.filter&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,C),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,ne||C),this.filter=C),H!==this.wrap&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,H),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,H),this.wrap=H)},N0.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},N0.prototype.destroy=function(){var C=this.context,H=C.gl;H.deleteTexture(this.texture),this.texture=null};var gA=function(C){var H=this;this._callback=C,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){H._triggered=!1,H._callback()})};gA.prototype.trigger=function(){var C=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){C._triggered=!1,C._callback()},0))},gA.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Gg=function(C,H,ne){this.target=C,this.parent=H,this.mapId=ne,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},L(["receive","process"],this),this.invoker=new gA(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=le()?C:s};Gg.prototype.send=function(C,H,ne,xe,Re){var qe=this;Re===void 0&&(Re=!1);var pt=Math.round(Math.random()*1e18).toString(36).substring(0,10);ne&&(this.callbacks[pt]=ne);var Dt=Y(this.globalScope)?void 0:[];return this.target.postMessage({id:pt,type:C,hasCallback:!!ne,targetMapId:xe,mustQueue:Re,sourceMapId:this.mapId,data:bt(H,Dt)},Dt),{cancel:function(){ne&&delete qe.callbacks[pt],qe.target.postMessage({id:pt,type:"<cancel>",targetMapId:xe,sourceMapId:qe.mapId})}}},Gg.prototype.receive=function(C){var H=C.data,ne=H.id;if(ne&&!(H.targetMapId&&this.mapId!==H.targetMapId))if(H.type==="<cancel>"){delete this.tasks[ne];var xe=this.cancelCallbacks[ne];delete this.cancelCallbacks[ne],xe&&xe()}else le()||H.mustQueue?(this.tasks[ne]=H,this.taskQueue.push(ne),this.invoker.trigger()):this.processTask(ne,H)},Gg.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),H=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),H&&this.processTask(C,H)}},Gg.prototype.processTask=function(C,H){var ne=this;if(H.type==="<response>"){var xe=this.callbacks[C];delete this.callbacks[C],xe&&(H.error?xe(Mt(H.error)):xe(null,Mt(H.data)))}else{var Re=!1,qe=Y(this.globalScope)?void 0:[],pt=H.hasCallback?function(Zr,Vr){Re=!0,delete ne.cancelCallbacks[C],ne.target.postMessage({id:C,type:"<response>",sourceMapId:ne.mapId,error:Zr?bt(Zr):null,data:bt(Vr,qe)},qe)}:function(Zr){Re=!0},Dt=null,Gt=Mt(H.data);if(this.parent[H.type])Dt=this.parent[H.type](H.sourceMapId,Gt,pt);else if(this.parent.getWorkerSource){var tr=H.type.split("."),Pr=this.parent.getWorkerSource(H.sourceMapId,tr[0],Gt.source);Dt=Pr[tr[1]](Gt,pt)}else pt(new Error("Could not find function "+H.type));!Re&&Dt&&Dt.cancel&&(this.cancelCallbacks[C]=Dt.cancel)}},Gg.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function XW(k,C,H){C=Math.pow(2,H)-C-1;var ne=Dk(k*256,C*256,H),xe=Dk((k+1)*256,(C+1)*256,H);return ne[0]+","+ne[1]+","+xe[0]+","+xe[1]}function Dk(k,C,H){var ne=2*Math.PI*6378137/256/Math.pow(2,H),xe=k*ne-2*Math.PI*6378137/2,Re=C*ne-2*Math.PI*6378137/2;return[xe,Re]}var Wf=function(C,H){C&&(H?this.setSouthWest(C).setNorthEast(H):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};Wf.prototype.setNorthEast=function(C){return this._ne=C instanceof Fc?new Fc(C.lng,C.lat):Fc.convert(C),this},Wf.prototype.setSouthWest=function(C){return this._sw=C instanceof Fc?new Fc(C.lng,C.lat):Fc.convert(C),this},Wf.prototype.extend=function(C){var H=this._sw,ne=this._ne,xe,Re;if(C instanceof Fc)xe=C,Re=C;else if(C instanceof Wf){if(xe=C._sw,Re=C._ne,!xe||!Re)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var qe=C;return this.extend(Wf.convert(qe))}else{var pt=C;return this.extend(Fc.convert(pt))}return this}return!H&&!ne?(this._sw=new Fc(xe.lng,xe.lat),this._ne=new Fc(Re.lng,Re.lat)):(H.lng=Math.min(xe.lng,H.lng),H.lat=Math.min(xe.lat,H.lat),ne.lng=Math.max(Re.lng,ne.lng),ne.lat=Math.max(Re.lat,ne.lat)),this},Wf.prototype.getCenter=function(){return new Fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Wf.prototype.getSouthWest=function(){return this._sw},Wf.prototype.getNorthEast=function(){return this._ne},Wf.prototype.getNorthWest=function(){return new Fc(this.getWest(),this.getNorth())},Wf.prototype.getSouthEast=function(){return new Fc(this.getEast(),this.getSouth())},Wf.prototype.getWest=function(){return this._sw.lng},Wf.prototype.getSouth=function(){return this._sw.lat},Wf.prototype.getEast=function(){return this._ne.lng},Wf.prototype.getNorth=function(){return this._ne.lat},Wf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Wf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Wf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Wf.prototype.contains=function(C){var H=Fc.convert(C),ne=H.lng,xe=H.lat,Re=this._sw.lat<=xe&&xe<=this._ne.lat,qe=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(qe=this._sw.lng>=ne&&ne>=this._ne.lng),Re&&qe},Wf.convert=function(C){return!C||C instanceof Wf?C:new Wf(C)};var zk=63710088e-1,Fc=function(C,H){if(isNaN(C)||isNaN(H))throw new Error("Invalid LngLat object: ("+C+", "+H+")");if(this.lng=+C,this.lat=+H,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fc.prototype.wrap=function(){return new Fc(_(this.lng,-180,180),this.lat)},Fc.prototype.toArray=function(){return[this.lng,this.lat]},Fc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fc.prototype.distanceTo=function(C){var H=Math.PI/180,ne=this.lat*H,xe=C.lat*H,Re=Math.sin(ne)*Math.sin(xe)+Math.cos(ne)*Math.cos(xe)*Math.cos((C.lng-this.lng)*H),qe=zk*Math.acos(Math.min(Re,1));return qe},Fc.prototype.toBounds=function(C){C===void 0&&(C=0);var H=40075017,ne=360*C/H,xe=ne/Math.cos(Math.PI/180*this.lat);return new Wf(new Fc(this.lng-xe,this.lat-ne),new Fc(this.lng+xe,this.lat+ne))},Fc.convert=function(C){if(C instanceof Fc)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Fc(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Fc(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Fk=2*Math.PI*zk;function Ok(k){return Fk*Math.cos(k*Math.PI/180)}function Bk(k){return(180+k)/360}function Nk(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function Uk(k,C){return k/Ok(C)}function ZW(k){return k*360-180}function yA(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function YW(k,C){return k*Ok(yA(C))}function KW(k){return 1/Math.cos(k*Math.PI/180)}var U0=function(C,H,ne){ne===void 0&&(ne=0),this.x=+C,this.y=+H,this.z=+ne};U0.fromLngLat=function(C,H){H===void 0&&(H=0);var ne=Fc.convert(C);return new U0(Bk(ne.lng),Nk(ne.lat),Uk(H,ne.lat))},U0.prototype.toLngLat=function(){return new Fc(ZW(this.x),yA(this.y))},U0.prototype.toAltitude=function(){return YW(this.z,this.y)},U0.prototype.meterInMercatorCoordinateUnits=function(){return 1/Fk*KW(yA(this.y))};var j0=function(C,H,ne){this.z=C,this.x=H,this.y=ne,this.key=t_(0,C,C,H,ne)};j0.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},j0.prototype.url=function(C,H){var ne=XW(this.x,this.y,this.z),xe=JW(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(H==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",xe).replace("{bbox-epsg-3857}",ne)},j0.prototype.getTilePoint=function(C){var H=Math.pow(2,this.z);return new n((C.x*H-this.x)*ui,(C.y*H-this.y)*ui)},j0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var jk=function(C,H){this.wrap=C,this.canonical=H,this.key=t_(C,H.z,H.z,H.x,H.y)},Xf=function(C,H,ne,xe,Re){this.overscaledZ=C,this.wrap=H,this.canonical=new j0(ne,+xe,+Re),this.key=t_(H,C,ne,xe,Re)};Xf.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Xf.prototype.scaledTo=function(C){var H=this.canonical.z-C;return C>this.canonical.z?new Xf(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xf(C,this.wrap,C,this.canonical.x>>H,this.canonical.y>>H)},Xf.prototype.calculateScaledKey=function(C,H){var ne=this.canonical.z-C;return C>this.canonical.z?t_(this.wrap*+H,C,this.canonical.z,this.canonical.x,this.canonical.y):t_(this.wrap*+H,C,C,this.canonical.x>>ne,this.canonical.y>>ne)},Xf.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var H=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ<this.overscaledZ&&C.canonical.x===this.canonical.x>>H&&C.canonical.y===this.canonical.y>>H},Xf.prototype.children=function(C){if(this.overscaledZ>=C)return[new Xf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var H=this.canonical.z+1,ne=this.canonical.x*2,xe=this.canonical.y*2;return[new Xf(H,this.wrap,H,ne,xe),new Xf(H,this.wrap,H,ne+1,xe),new Xf(H,this.wrap,H,ne,xe+1),new Xf(H,this.wrap,H,ne+1,xe+1)]},Xf.prototype.isLessThan=function(C){return this.wrap<C.wrap?!0:this.wrap>C.wrap?!1:this.overscaledZ<C.overscaledZ?!0:this.overscaledZ>C.overscaledZ?!1:this.canonical.x<C.canonical.x?!0:this.canonical.x>C.canonical.x?!1:this.canonical.y<C.canonical.y},Xf.prototype.wrapped=function(){return new Xf(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Xf.prototype.unwrapTo=function(C){return new Xf(this.overscaledZ,C,this.canonical.z,this.canonical.x,this.canonical.y)},Xf.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Xf.prototype.toUnwrapped=function(){return new jk(this.wrap,this.canonical)},Xf.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Xf.prototype.getTilePoint=function(C){return this.canonical.getTilePoint(new U0(C.x-this.wrap,C.y))};function t_(k,C,H,ne,xe){k*=2,k<0&&(k=k*-1-1);var Re=1<<H;return(Re*Re*k+Re*xe+ne).toString(36)+H.toString(36)+C.toString(36)}function JW(k,C,H){for(var ne="",xe,Re=k;Re>0;Re--)xe=1<<Re-1,ne+=(C&xe?1:0)+(H&xe?2:0);return ne}de("CanonicalTileID",j0),de("OverscaledTileID",Xf,{omit:["posMatrix"]});var Bv=function(C,H,ne){if(this.uid=C,H.height!==H.width)throw new RangeError("DEM tiles must be square");if(ne&&ne!=="mapbox"&&ne!=="terrarium")return B('"'+ne+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=H.height;var xe=this.dim=H.height-2;this.data=new Uint32Array(H.data.buffer),this.encoding=ne||"mapbox";for(var Re=0;Re<xe;Re++)this.data[this._idx(-1,Re)]=this.data[this._idx(0,Re)],this.data[this._idx(xe,Re)]=this.data[this._idx(xe-1,Re)],this.data[this._idx(Re,-1)]=this.data[this._idx(Re,0)],this.data[this._idx(Re,xe)]=this.data[this._idx(Re,xe-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(xe,-1)]=this.data[this._idx(xe-1,0)],this.data[this._idx(-1,xe)]=this.data[this._idx(0,xe-1)],this.data[this._idx(xe,xe)]=this.data[this._idx(xe-1,xe-1)]};Bv.prototype.get=function(C,H){var ne=new Uint8Array(this.data.buffer),xe=this._idx(C,H)*4,Re=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return Re(ne[xe],ne[xe+1],ne[xe+2])},Bv.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Bv.prototype._idx=function(C,H){if(C<-1||C>=this.dim+1||H<-1||H>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(H+1)*this.stride+(C+1)},Bv.prototype._unpackMapbox=function(C,H,ne){return(C*256*256+H*256+ne)/10-1e4},Bv.prototype._unpackTerrarium=function(C,H,ne){return C*256+H+ne/256-32768},Bv.prototype.getPixels=function(){return new eh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bv.prototype.backfillBorder=function(C,H,ne){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var xe=H*this.dim,Re=H*this.dim+this.dim,qe=ne*this.dim,pt=ne*this.dim+this.dim;switch(H){case-1:xe=Re-1;break;case 1:Re=xe+1;break}switch(ne){case-1:qe=pt-1;break;case 1:pt=qe+1;break}for(var Dt=-H*this.dim,Gt=-ne*this.dim,tr=qe;tr<pt;tr++)for(var Pr=xe;Pr<Re;Pr++)this.data[this._idx(Pr,tr)]=C.data[this._idx(Pr+Dt,tr+Gt)]},de("DEMData",Bv);function $W(k,C){var H={};if(!C)return H;for(var ne=function(){var qe=Re[xe],pt=qe.layerIds.map(function(Pr){return C.getLayer(Pr)}).filter(Boolean);if(pt.length!==0){qe.layers=pt,qe.stateDependentLayerIds&&(qe.stateDependentLayers=qe.stateDependentLayerIds.map(function(Pr){return pt.filter(function(Zr){return Zr.id===Pr})[0]}));for(var Dt=0,Gt=pt;Dt<Gt.length;Dt+=1){var tr=Gt[Dt];H[tr.id]=qe}}},xe=0,Re=k;xe<Re.length;xe+=1)ne();return H}var vb=function(C){this._stringToNumber={},this._numberToString=[];for(var H=0;H<C.length;H++){var ne=C[H];this._stringToNumber[ne]=H,this._numberToString[H]=ne}};vb.prototype.encode=function(C){return this._stringToNumber[C]},vb.prototype.decode=function(C){return this._numberToString[C]};var mb=function(C,H,ne,xe,Re){this.type="Feature",this._vectorTileFeature=C,C._z=H,C._x=ne,C._y=xe,this.properties=C.properties,this.id=Re},_A={geometry:{configurable:!0}};_A.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},_A.geometry.set=function(k){this._geometry=k},mb.prototype.toJSON=function(){var C={geometry:this.geometry};for(var H in this)H==="_geometry"||H==="_vectorTileFeature"||(C[H]=this[H]);return C},Object.defineProperties(mb.prototype,_A);var Hg=function(){this.state={},this.stateChanges={},this.deletedStates={}};Hg.prototype.updateState=function(C,H,ne){var xe=String(H);if(this.stateChanges[C]=this.stateChanges[C]||{},this.stateChanges[C][xe]=this.stateChanges[C][xe]||{},g(this.stateChanges[C][xe],ne),this.deletedStates[C]===null){this.deletedStates[C]={};for(var Re in this.state[C])Re!==xe&&(this.deletedStates[C][Re]=null)}else{var qe=this.deletedStates[C]&&this.deletedStates[C][xe]===null;if(qe){this.deletedStates[C][xe]={};for(var pt in this.state[C][xe])ne[pt]||(this.deletedStates[C][xe][pt]=null)}else for(var Dt in ne){var Gt=this.deletedStates[C]&&this.deletedStates[C][xe]&&this.deletedStates[C][xe][Dt]===null;Gt&&delete this.deletedStates[C][xe][Dt]}}},Hg.prototype.removeFeatureState=function(C,H,ne){var xe=this.deletedStates[C]===null;if(!xe){var Re=String(H);if(this.deletedStates[C]=this.deletedStates[C]||{},ne&&H!==void 0)this.deletedStates[C][Re]!==null&&(this.deletedStates[C][Re]=this.deletedStates[C][Re]||{},this.deletedStates[C][Re][ne]=null);else if(H!==void 0){var qe=this.stateChanges[C]&&this.stateChanges[C][Re];if(qe){this.deletedStates[C][Re]={};for(ne in this.stateChanges[C][Re])this.deletedStates[C][Re][ne]=null}else this.deletedStates[C][Re]=null}else this.deletedStates[C]=null}},Hg.prototype.getState=function(C,H){var ne=String(H),xe=this.state[C]||{},Re=this.stateChanges[C]||{},qe=g({},xe[ne],Re[ne]);if(this.deletedStates[C]===null)return{};if(this.deletedStates[C]){var pt=this.deletedStates[C][H];if(pt===null)return{};for(var Dt in pt)delete qe[Dt]}return qe},Hg.prototype.initializeTileState=function(C,H){C.setFeatureState(this.state,H)},Hg.prototype.coalesceChanges=function(C,H){var ne={};for(var xe in this.stateChanges){this.state[xe]=this.state[xe]||{};var Re={};for(var qe in this.stateChanges[xe])this.state[xe][qe]||(this.state[xe][qe]={}),g(this.state[xe][qe],this.stateChanges[xe][qe]),Re[qe]=this.state[xe][qe];ne[xe]=Re}for(var pt in this.deletedStates){this.state[pt]=this.state[pt]||{};var Dt={};if(this.deletedStates[pt]===null)for(var Gt in this.state[pt])Dt[Gt]={},this.state[pt][Gt]={};else for(var tr in this.deletedStates[pt]){var Pr=this.deletedStates[pt][tr]===null;if(Pr)this.state[pt][tr]={};else for(var Zr=0,Vr=Object.keys(this.deletedStates[pt][tr]);Zr<Vr.length;Zr+=1){var ua=Vr[Zr];delete this.state[pt][tr][ua]}Dt[tr]=this.state[pt][tr]}ne[pt]=ne[pt]||{},g(ne[pt],Dt)}if(this.stateChanges={},this.deletedStates={},Object.keys(ne).length!==0)for(var Oa in C){var Mi=C[Oa];Mi.setFeatureState(ne,H)}};var Nv=function(C,H){this.tileID=C,this.x=C.canonical.x,this.y=C.canonical.y,this.z=C.canonical.z,this.grid=new vu(ui,16,0),this.grid3D=new vu(ui,16,0),this.featureIndexArray=new wl,this.promoteId=H};Nv.prototype.insert=function(C,H,ne,xe,Re,qe){var pt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ne,xe,Re);for(var Dt=qe?this.grid3D:this.grid,Gt=0;Gt<H.length;Gt++){for(var tr=H[Gt],Pr=[1/0,1/0,-1/0,-1/0],Zr=0;Zr<tr.length;Zr++){var Vr=tr[Zr];Pr[0]=Math.min(Pr[0],Vr.x),Pr[1]=Math.min(Pr[1],Vr.y),Pr[2]=Math.max(Pr[2],Vr.x),Pr[3]=Math.max(Pr[3],Vr.y)}Pr[0]<ui&&Pr[1]<ui&&Pr[2]>=0&&Pr[3]>=0&&Dt.insert(pt,Pr[0],Pr[1],Pr[2],Pr[3])}},Nv.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Xd.VectorTile(new mo(this.rawTileData)).layers,this.sourceLayerCoder=new vb(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Nv.prototype.query=function(C,H,ne,xe){var Re=this;this.loadVTLayers();for(var qe=C.params||{},pt=ui/C.tileSize/C.scale,Dt=Je(qe.filter),Gt=C.queryGeometry,tr=C.queryPadding*pt,Pr=Vk(Gt),Zr=this.grid.query(Pr.minX-tr,Pr.minY-tr,Pr.maxX+tr,Pr.maxY+tr),Vr=Vk(C.cameraQueryGeometry),ua=this.grid3D.query(Vr.minX-tr,Vr.minY-tr,Vr.maxX+tr,Vr.maxY+tr,function(Tn,Vn,Nn,So){return td(C.cameraQueryGeometry,Tn-tr,Vn-tr,Nn+tr,So+tr)}),Oa=0,Mi=ua;Oa<Mi.length;Oa+=1){var ii=Mi[Oa];Zr.push(ii)}Zr.sort(QW);for(var $i={},Oi,Ji=function(Tn){var Vn=Zr[Tn];if(Vn!==Oi){Oi=Vn;var Nn=Re.featureIndexArray.get(Vn),So=null;Re.loadMatchingFeature($i,Nn.bucketIndex,Nn.sourceLayerIndex,Nn.featureIndex,Dt,qe.layers,qe.availableImages,H,ne,xe,function(oo,go,ks){return So||(So=fn(oo)),go.queryIntersectsFeature(Gt,oo,ks,So,Re.z,C.transform,pt,C.pixelPosMatrix)})}},ln=0;ln<Zr.length;ln++)Ji(ln);return $i},Nv.prototype.loadMatchingFeature=function(C,H,ne,xe,Re,qe,pt,Dt,Gt,tr,Pr){var Zr=this.bucketLayerIDs[H];if(!(qe&&!P(qe,Zr))){var Vr=this.sourceLayerCoder.decode(ne),ua=this.vtLayers[Vr],Oa=ua.feature(xe);if(Re.needGeometry){var Mi=_o(Oa,!0);if(!Re.filter(new gn(this.tileID.overscaledZ),Mi,this.tileID.canonical))return}else if(!Re.filter(new gn(this.tileID.overscaledZ),Oa))return;for(var ii=this.getId(Oa,Vr),$i=0;$i<Zr.length;$i++){var Oi=Zr[$i];if(!(qe&&qe.indexOf(Oi)<0)){var Ji=Dt[Oi];if(Ji){var ln={};ii!==void 0&&tr&&(ln=tr.getState(Ji.sourceLayer||"_geojsonTileLayer",ii));var Tn=g({},Gt[Oi]);Tn.paint=qk(Tn.paint,Ji.paint,Oa,ln,pt),Tn.layout=qk(Tn.layout,Ji.layout,Oa,ln,pt);var Vn=!Pr||Pr(Oa,Ji,ln);if(Vn){var Nn=new mb(Oa,this.z,this.x,this.y,ii);Nn.layer=Tn;var So=C[Oi];So===void 0&&(So=C[Oi]=[]),So.push({featureIndex:xe,feature:Nn,intersectionZ:Vn})}}}}}},Nv.prototype.lookupSymbolFeatures=function(C,H,ne,xe,Re,qe,pt,Dt){var Gt={};this.loadVTLayers();for(var tr=Je(Re),Pr=0,Zr=C;Pr<Zr.length;Pr+=1){var Vr=Zr[Pr];this.loadMatchingFeature(Gt,ne,xe,Vr,tr,qe,pt,Dt,H)}return Gt},Nv.prototype.hasLayer=function(C){for(var H=0,ne=this.bucketLayerIDs;H<ne.length;H+=1)for(var xe=ne[H],Re=0,qe=xe;Re<qe.length;Re+=1){var pt=qe[Re];if(C===pt)return!0}return!1},Nv.prototype.getId=function(C,H){var ne=C.id;if(this.promoteId){var xe=typeof this.promoteId=="string"?this.promoteId:this.promoteId[H];ne=C.properties[xe],typeof ne=="boolean"&&(ne=Number(ne))}return ne},de("FeatureIndex",Nv,{omit:["rawTileData","sourceLayerCoder"]});function qk(k,C,H,ne,xe){return F(k,function(Re,qe){var pt=C instanceof _c?C.get(qe):null;return pt&&pt.evaluate?pt.evaluate(H,ne,xe):pt})}function Vk(k){for(var C=1/0,H=1/0,ne=-1/0,xe=-1/0,Re=0,qe=k;Re<qe.length;Re+=1){var pt=qe[Re];C=Math.min(C,pt.x),H=Math.min(H,pt.y),ne=Math.max(ne,pt.x),xe=Math.max(xe,pt.y)}return{minX:C,minY:H,maxX:ne,maxY:xe}}function QW(k,C){return C-k}var eX=3e4,mh=function(C,H){this.tileID=C,this.uid=u(),this.uses=0,this.tileSize=H,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};mh.prototype.registerFadeDuration=function(C){var H=C+this.timeAdded;H<be.now()||this.fadeEndTime&&H<this.fadeEndTime||(this.fadeEndTime=H)},mh.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},mh.prototype.loadVectorData=function(C,H,ne){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!C){this.collisionBoxArray=new po;return}C.featureIndex&&(this.latestFeatureIndex=C.featureIndex,C.rawTileData?(this.latestRawTileData=C.rawTileData,this.latestFeatureIndex.rawTileData=C.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=C.collisionBoxArray,this.buckets=$W(C.buckets,H.style),this.hasSymbolBuckets=!1;for(var xe in this.buckets){var Re=this.buckets[xe];if(Re instanceof Du)if(this.hasSymbolBuckets=!0,ne)Re.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var qe in this.buckets){var pt=this.buckets[qe];if(pt instanceof Du&&pt.hasRTLText){this.hasRTLText=!0,xl();break}}this.queryPadding=0;for(var Dt in this.buckets){var Gt=this.buckets[Dt];this.queryPadding=Math.max(this.queryPadding,H.style.getLayer(Dt).queryRadius(Gt))}C.imageAtlas&&(this.imageAtlas=C.imageAtlas),C.glyphAtlasImage&&(this.glyphAtlasImage=C.glyphAtlasImage)},mh.prototype.unloadVectorData=function(){for(var C in this.buckets)this.buckets[C].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},mh.prototype.getBucket=function(C){return this.buckets[C.id]},mh.prototype.upload=function(C){for(var H in this.buckets){var ne=this.buckets[H];ne.uploadPending()&&ne.upload(C)}var xe=C.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new N0(C,this.imageAtlas.image,xe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new N0(C,this.glyphAtlasImage,xe.ALPHA),this.glyphAtlasImage=null)},mh.prototype.prepare=function(C){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(C,this.imageAtlasTexture)},mh.prototype.queryRenderedFeatures=function(C,H,ne,xe,Re,qe,pt,Dt,Gt,tr){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:xe,cameraQueryGeometry:Re,scale:qe,tileSize:this.tileSize,pixelPosMatrix:tr,transform:Dt,params:pt,queryPadding:this.queryPadding*Gt},C,H,ne)},mh.prototype.querySourceFeatures=function(C,H){var ne=this.latestFeatureIndex;if(!(!ne||!ne.rawTileData)){var xe=ne.loadVTLayers(),Re=H?H.sourceLayer:"",qe=xe._geojsonTileLayer||xe[Re];if(qe)for(var pt=Je(H&&H.filter),Dt=this.tileID.canonical,Gt=Dt.z,tr=Dt.x,Pr=Dt.y,Zr={z:Gt,x:tr,y:Pr},Vr=0;Vr<qe.length;Vr++){var ua=qe.feature(Vr);if(pt.needGeometry){var Oa=_o(ua,!0);if(!pt.filter(new gn(this.tileID.overscaledZ),Oa,this.tileID.canonical))continue}else if(!pt.filter(new gn(this.tileID.overscaledZ),ua))continue;var Mi=ne.getId(ua,Re),ii=new mb(ua,Gt,tr,Pr,Mi);ii.tile=Zr,C.push(ii)}}},mh.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},mh.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},mh.prototype.setExpiryData=function(C){var H=this.expirationTime;if(C.cacheControl){var ne=fe(C.cacheControl);ne["max-age"]&&(this.expirationTime=Date.now()+ne["max-age"]*1e3)}else C.expires&&(this.expirationTime=new Date(C.expires).getTime());if(this.expirationTime){var xe=Date.now(),Re=!1;if(this.expirationTime>xe)Re=!1;else if(!H)Re=!0;else if(this.expirationTime<H)Re=!0;else{var qe=this.expirationTime-H;qe?this.expirationTime=xe+Math.max(qe,eX):Re=!0}Re?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},mh.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},mh.prototype.setFeatureState=function(C,H){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(C).length===0)){var ne=this.latestFeatureIndex.loadVTLayers();for(var xe in this.buckets)if(H.style.hasLayer(xe)){var Re=this.buckets[xe],qe=Re.layers[0].sourceLayer||"_geojsonTileLayer",pt=ne[qe],Dt=C[qe];if(!(!pt||!Dt||Object.keys(Dt).length===0)){Re.update(Dt,pt,this.imageAtlas&&this.imageAtlas.patternPositions||{});var Gt=H&&H.style&&H.style.getLayer(xe);Gt&&(this.queryPadding=Math.max(this.queryPadding,Gt.queryRadius(Re)))}}}},mh.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},mh.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<be.now()},mh.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},mh.prototype.setHoldDuration=function(C){this.symbolFadeHoldUntil=be.now()+C},mh.prototype.setDependencies=function(C,H){for(var ne={},xe=0,Re=H;xe<Re.length;xe+=1){var qe=Re[xe];ne[qe]=!0}this.dependencies[C]=ne},mh.prototype.hasDependency=function(C,H){for(var ne=0,xe=C;ne<xe.length;ne+=1){var Re=xe[ne],qe=this.dependencies[Re];if(qe)for(var pt=0,Dt=H;pt<Dt.length;pt+=1){var Gt=Dt[pt];if(qe[Gt])return!0}}return!1};var tX=["type","source","source-layer","minzoom","maxzoom","filter","layout"],ym=s.performance,Gk=function(C){this._marks={start:[C.url,"start"].join("#"),end:[C.url,"end"].join("#"),measure:C.url.toString()},ym.mark(this._marks.start)};Gk.prototype.finish=function(){ym.mark(this._marks.end);var C=ym.getEntriesByName(this._marks.measure);return C.length===0&&(ym.measure(this._marks.measure,this._marks.start,this._marks.end),C=ym.getEntriesByName(this._marks.measure),ym.clearMarks(this._marks.start),ym.clearMarks(this._marks.end),ym.clearMeasures(this._marks.measure)),C},e.Actor=Gg,e.AlphaImage=Ip,e.CanonicalTileID=j0,e.CollisionBoxArray=po,e.Color=Fs,e.DEMData=Bv,e.DataConstantProperty=it,e.DictionaryCoder=vb,e.EXTENT=ui,e.ErrorEvent=Cr,e.EvaluationParameters=gn,e.Event=Br,e.Evented=xr,e.FeatureIndex=Nv,e.FillBucket=rd,e.FillExtrusionBucket=cd,e.ImageAtlas=Zd,e.ImagePosition=Pf,e.LineBucket=Hf,e.LngLat=Fc,e.LngLatBounds=Wf,e.MercatorCoordinate=U0,e.ONE_EM=en,e.OverscaledTileID=Xf,e.Point=n,e.Point$1=n,e.Properties=ma,e.Protobuf=mo,e.RGBAImage=eh,e.RequestManager=he,e.RequestPerformance=Gk,e.ResourceType=hi,e.SegmentVector=Co,e.SourceFeatureState=Hg,e.StructArrayLayout1ui2=Zn,e.StructArrayLayout2f1f2i16=Ti,e.StructArrayLayout2i4=Ma,e.StructArrayLayout3ui6=Xi,e.StructArrayLayout4i8=Qa,e.SymbolBucket=Du,e.Texture=N0,e.Tile=mh,e.Transitionable=ms,e.Uniform1f=kt,e.Uniform1i=yt,e.Uniform2f=Bt,e.Uniform3f=nr,e.Uniform4f=hr,e.UniformColor=lr,e.UniformMatrix4f=ur,e.UnwrappedTileID=jk,e.ValidationError=Ln,e.WritingMode=vp,e.ZoomHistory=ar,e.add=Pp,e.addDynamicAttributes=vA,e.asyncAll=w,e.bezier=p,e.bindAll=L,e.browser=be,e.cacheEntryPossiblyAdded=fa,e.clamp=l,e.clearTileCache=Ia,e.clipLine=Ak,e.clone=om,e.clone$1=O,e.clone$2=xg,e.collisionCircleLayout=or,e.config=Ae,e.create=nm,e.create$1=ph,e.create$2=Gd,e.createCommonjsModule=t,e.createExpression=Ro,e.createLayout=Ei,e.createStyleLayer=WW,e.cross=jT,e.deepEqual=h,e.dot=UT,e.dot$1=WT,e.ease=T,e.emitValidationErrors=Ru,e.endsWith=z,e.enforceCacheSizeLimit=Da,e.evaluateSizeForFeature=gk,e.evaluateSizeForZoom=yk,e.evaluateVariableOffset=Ek,e.evented=ro,e.extend=g,e.featureFilter=Je,e.filterObject=N,e.fromRotation=iv,e.getAnchorAlignment=$1,e.getAnchorJustification=dA,e.getArrayBuffer=ra,e.getImage=on,e.getJSON=ta,e.getRTLTextPluginStatus=Yo,e.getReferrer=Kt,e.getVideo=hn,e.identity=Pv,e.invert=nv,e.isChar=Ot,e.isMapboxURL=Oe,e.keysDifference=M,e.makeRequest=Fr,e.mapObject=F,e.mercatorXfromLng=Bk,e.mercatorYfromLat=Nk,e.mercatorZfromAltitude=Uk,e.mul=w0,e.multiply=ov,e.mvt=Xd,e.nextPowerOfTwo=f,e.normalize=T0,e.number=El,e.offscreenCanvasSupported=Ca,e.ortho=Mu,e.parseGlyphPBF=_d,e.pbf=mo,e.performSymbolLayout=MW,e.perspective=sm,e.pick=b,e.plugin=al,e.polygonIntersectsPolygon=Do,e.postMapLoadEvent=Te,e.postTurnstileEvent=Ne,e.potpack=Wp,e.refProperties=tX,e.register=de,e.registerForPluginStateChange=io,e.renderColorRamp=M0,e.rotate=Lv,e.rotateX=Dh,e.rotateZ=Iv,e.scale=fu,e.scale$1=HT,e.scale$2=bg,e.setCacheLimits=qa,e.setRTLTextPlugin=Ho,e.sphericalToCartesian=se,e.sqrLen=I1,e.styleSpec=Gi,e.sub=VT,e.symbolSize=gW,e.transformMat3=qT,e.transformMat4=Rv,e.translate=cc,e.triggerPluginCompletionEvent=Pn,e.uniqueId=u,e.validateCustomStyleLayer=VW,e.validateLight=$o,e.validateStyle=Jo,e.values=A,e.vectorTile=Xd,e.version=r,e.warnOnce=B,e.webpSupported=De,e.window=s,e.wrap=_}),E(["./shared"],function(e){"use strict";function t(Kt){var Ft=typeof Kt;if(Ft==="number"||Ft==="boolean"||Ft==="string"||Kt===void 0||Kt===null)return JSON.stringify(Kt);if(Array.isArray(Kt)){for(var Yt="[",Jt=0,Fr=Kt;Jt<Fr.length;Jt+=1){var ta=Fr[Jt];Yt+=t(ta)+","}return Yt+"]"}for(var ra=Object.keys(Kt).sort(),ca="{",Ba=0;Ba<ra.length;Ba++)ca+=JSON.stringify(ra[Ba])+":"+t(Kt[ra[Ba]])+",";return ca+"}"}function r(Kt){for(var Ft="",Yt=0,Jt=e.refProperties;Yt<Jt.length;Yt+=1){var Fr=Jt[Yt];Ft+="/"+t(Kt[Fr])}return Ft}function o(Kt,Ft){for(var Yt={},Jt=0;Jt<Kt.length;Jt++){var Fr=Ft&&Ft[Kt[Jt].id]||r(Kt[Jt]);Ft&&(Ft[Kt[Jt].id]=Fr);var ta=Yt[Fr];ta||(ta=Yt[Fr]=[]),ta.push(Kt[Jt])}var ra=[];for(var ca in Yt)ra.push(Yt[ca]);return ra}var a=function(Ft){this.keyCache={},Ft&&this.replace(Ft)};a.prototype.replace=function(Ft){this._layerConfigs={},this._layers={},this.update(Ft,[])},a.prototype.update=function(Ft,Yt){for(var Jt=this,Fr=0,ta=Ft;Fr<ta.length;Fr+=1){var ra=ta[Fr];this._layerConfigs[ra.id]=ra;var ca=this._layers[ra.id]=e.createStyleLayer(ra);ca._featureFilter=e.featureFilter(ca.filter),this.keyCache[ra.id]&&delete this.keyCache[ra.id]}for(var Ba=0,$a=Yt;Ba<$a.length;Ba+=1){var Za=$a[Ba];delete this.keyCache[Za],delete this._layerConfigs[Za],delete this._layers[Za]}this.familiesBySource={};for(var ri=o(e.values(this._layerConfigs),this.keyCache),pi=0,Ra=ri;pi<Ra.length;pi+=1){var tn=Ra[pi],on=tn.map(function(xr){return Jt._layers[xr.id]}),hn=on[0];if(hn.visibility!=="none"){var Tt=hn.source||"",ut=this.familiesBySource[Tt];ut||(ut=this.familiesBySource[Tt]={});var Br=hn.sourceLayer||"_geojsonTileLayer",Cr=ut[Br];Cr||(Cr=ut[Br]=[]),Cr.push(on)}}};var n=1,i=function(Ft){var Yt={},Jt=[];for(var Fr in Ft){var ta=Ft[Fr],ra=Yt[Fr]={};for(var ca in ta){var Ba=ta[+ca];if(!(!Ba||Ba.bitmap.width===0||Ba.bitmap.height===0)){var $a={x:0,y:0,w:Ba.bitmap.width+2*n,h:Ba.bitmap.height+2*n};Jt.push($a),ra[ca]={rect:$a,metrics:Ba.metrics}}}}var Za=e.potpack(Jt),ri=Za.w,pi=Za.h,Ra=new e.AlphaImage({width:ri||1,height:pi||1});for(var tn in Ft){var on=Ft[tn];for(var hn in on){var Tt=on[+hn];if(!(!Tt||Tt.bitmap.width===0||Tt.bitmap.height===0)){var ut=Yt[tn][hn].rect;e.AlphaImage.copy(Tt.bitmap,Ra,{x:0,y:0},{x:ut.x+n,y:ut.y+n},Tt.bitmap)}}}this.image=Ra,this.positions=Yt};e.register("GlyphAtlas",i);var s=function(Ft){this.tileID=new e.OverscaledTileID(Ft.tileID.overscaledZ,Ft.tileID.wrap,Ft.tileID.canonical.z,Ft.tileID.canonical.x,Ft.tileID.canonical.y),this.uid=Ft.uid,this.zoom=Ft.zoom,this.pixelRatio=Ft.pixelRatio,this.tileSize=Ft.tileSize,this.source=Ft.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Ft.showCollisionBoxes,this.collectResourceTiming=!!Ft.collectResourceTiming,this.returnDependencies=!!Ft.returnDependencies,this.promoteId=Ft.promoteId};s.prototype.parse=function(Ft,Yt,Jt,Fr,ta){var ra=this;this.status="parsing",this.data=Ft,this.collisionBoxArray=new e.CollisionBoxArray;var ca=new e.DictionaryCoder(Object.keys(Ft.layers).sort()),Ba=new e.FeatureIndex(this.tileID,this.promoteId);Ba.bucketLayerIDs=[];var $a={},Za={featureIndex:Ba,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Jt},ri=Yt.familiesBySource[this.source];for(var pi in ri){var Ra=Ft.layers[pi];if(Ra){Ra.version===1&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+pi+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var tn=ca.encode(pi),on=[],hn=0;hn<Ra.length;hn++){var Tt=Ra.feature(hn),ut=Ba.getId(Tt,pi);on.push({feature:Tt,id:ut,index:hn,sourceLayerIndex:tn})}for(var Br=0,Cr=ri[pi];Br<Cr.length;Br+=1){var xr=Cr[Br],Ir=xr[0];if(!(Ir.minzoom&&this.zoom<Math.floor(Ir.minzoom))&&!(Ir.maxzoom&&this.zoom>=Ir.maxzoom)&&Ir.visibility!=="none"){h(xr,this.zoom,Jt);var Ur=$a[Ir.id]=Ir.createBucket({index:Ba.bucketLayerIDs.length,layers:xr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:tn,sourceID:this.source});Ur.populate(on,Za,this.tileID.canonical),Ba.bucketLayerIDs.push(xr.map(function(la){return la.id}))}}}}var Hr,xt,Xt,vr,Or=e.mapObject(Za.glyphDependencies,function(la){return Object.keys(la).map(Number)});Object.keys(Or).length?Fr.send("getGlyphs",{uid:this.uid,stacks:Or},function(la,Ta){Hr||(Hr=la,xt=Ta,ya.call(ra))}):xt={};var ba=Object.keys(Za.iconDependencies);ba.length?Fr.send("getImages",{icons:ba,source:this.source,tileID:this.tileID,type:"icons"},function(la,Ta){Hr||(Hr=la,Xt=Ta,ya.call(ra))}):Xt={};var Pa=Object.keys(Za.patternDependencies);Pa.length?Fr.send("getImages",{icons:Pa,source:this.source,tileID:this.tileID,type:"patterns"},function(la,Ta){Hr||(Hr=la,vr=Ta,ya.call(ra))}):vr={},ya.call(this);function ya(){if(Hr)return ta(Hr);if(xt&&Xt&&vr){var la=new i(xt),Ta=new e.ImageAtlas(Xt,vr);for(var Ai in $a){var ki=$a[Ai];ki instanceof e.SymbolBucket?(h(ki.layers,this.zoom,Jt),e.performSymbolLayout(ki,xt,la.positions,Xt,Ta.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ki.hasPattern&&(ki instanceof e.LineBucket||ki instanceof e.FillBucket||ki instanceof e.FillExtrusionBucket)&&(h(ki.layers,this.zoom,Jt),ki.addFeatures(Za,this.tileID.canonical,Ta.patternPositions))}this.status="done",ta(null,{buckets:e.values($a).filter(function(Ki){return!Ki.isEmpty()}),featureIndex:Ba,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:la.image,imageAtlas:Ta,glyphMap:this.returnDependencies?xt:null,iconMap:this.returnDependencies?Xt:null,glyphPositions:this.returnDependencies?la.positions:null})}}};function h(Kt,Ft,Yt){for(var Jt=new e.EvaluationParameters(Ft),Fr=0,ta=Kt;Fr<ta.length;Fr+=1){var ra=ta[Fr];ra.recalculate(Jt,Yt)}}function c(Kt,Ft){var Yt=e.getArrayBuffer(Kt.request,function(Jt,Fr,ta,ra){Jt?Ft(Jt):Fr&&Ft(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(Fr)),rawData:Fr,cacheControl:ta,expires:ra})});return function(){Yt.cancel(),Ft()}}var m=function(Ft,Yt,Jt,Fr){this.actor=Ft,this.layerIndex=Yt,this.availableImages=Jt,this.loadVectorData=Fr||c,this.loading={},this.loaded={}};m.prototype.loadTile=function(Ft,Yt){var Jt=this,Fr=Ft.uid;this.loading||(this.loading={});var ta=Ft&&Ft.request&&Ft.request.collectResourceTiming?new e.RequestPerformance(Ft.request):!1,ra=this.loading[Fr]=new s(Ft);ra.abort=this.loadVectorData(Ft,function(ca,Ba){if(delete Jt.loading[Fr],ca||!Ba)return ra.status="done",Jt.loaded[Fr]=ra,Yt(ca);var $a=Ba.rawData,Za={};Ba.expires&&(Za.expires=Ba.expires),Ba.cacheControl&&(Za.cacheControl=Ba.cacheControl);var ri={};if(ta){var pi=ta.finish();pi&&(ri.resourceTiming=JSON.parse(JSON.stringify(pi)))}ra.vectorTile=Ba.vectorTile,ra.parse(Ba.vectorTile,Jt.layerIndex,Jt.availableImages,Jt.actor,function(Ra,tn){if(Ra||!tn)return Yt(Ra);Yt(null,e.extend({rawTileData:$a.slice(0)},tn,Za,ri))}),Jt.loaded=Jt.loaded||{},Jt.loaded[Fr]=ra})},m.prototype.reloadTile=function(Ft,Yt){var Jt=this,Fr=this.loaded,ta=Ft.uid,ra=this;if(Fr&&Fr[ta]){var ca=Fr[ta];ca.showCollisionBoxes=Ft.showCollisionBoxes;var Ba=function($a,Za){var ri=ca.reloadCallback;ri&&(delete ca.reloadCallback,ca.parse(ca.vectorTile,ra.layerIndex,Jt.availableImages,ra.actor,ri)),Yt($a,Za)};ca.status==="parsing"?ca.reloadCallback=Ba:ca.status==="done"&&(ca.vectorTile?ca.parse(ca.vectorTile,this.layerIndex,this.availableImages,this.actor,Ba):Ba())}},m.prototype.abortTile=function(Ft,Yt){var Jt=this.loading,Fr=Ft.uid;Jt&&Jt[Fr]&&Jt[Fr].abort&&(Jt[Fr].abort(),delete Jt[Fr]),Yt()},m.prototype.removeTile=function(Ft,Yt){var Jt=this.loaded,Fr=Ft.uid;Jt&&Jt[Fr]&&delete Jt[Fr],Yt()};var p=e.window.ImageBitmap,T=function(){this.loaded={}};T.prototype.loadTile=function(Ft,Yt){var Jt=Ft.uid,Fr=Ft.encoding,ta=Ft.rawImageData,ra=p&&ta instanceof p?this.getImageData(ta):ta,ca=new e.DEMData(Jt,ra,Fr);this.loaded=this.loaded||{},this.loaded[Jt]=ca,Yt(null,ca)},T.prototype.getImageData=function(Ft){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(Ft.width,Ft.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Ft.width,this.offscreenCanvas.height=Ft.height,this.offscreenCanvasContext.drawImage(Ft,0,0,Ft.width,Ft.height);var Yt=this.offscreenCanvasContext.getImageData(-1,-1,Ft.width+2,Ft.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:Yt.width,height:Yt.height},Yt.data)},T.prototype.removeTile=function(Ft){var Yt=this.loaded,Jt=Ft.uid;Yt&&Yt[Jt]&&delete Yt[Jt]};var l=_;function _(Kt,Ft){var Yt=Kt&&Kt.type,Jt;if(Yt==="FeatureCollection")for(Jt=0;Jt<Kt.features.length;Jt++)_(Kt.features[Jt],Ft);else if(Yt==="GeometryCollection")for(Jt=0;Jt<Kt.geometries.length;Jt++)_(Kt.geometries[Jt],Ft);else if(Yt==="Feature")_(Kt.geometry,Ft);else if(Yt==="Polygon")w(Kt.coordinates,Ft);else if(Yt==="MultiPolygon")for(Jt=0;Jt<Kt.coordinates.length;Jt++)w(Kt.coordinates[Jt],Ft);return Kt}function w(Kt,Ft){if(Kt.length!==0){A(Kt[0],Ft);for(var Yt=1;Yt<Kt.length;Yt++)A(Kt[Yt],!Ft)}}function A(Kt,Ft){for(var Yt=0,Jt=0,Fr=Kt.length,ta=Fr-1;Jt<Fr;ta=Jt++)Yt+=(Kt[Jt][0]-Kt[ta][0])*(Kt[ta][1]+Kt[Jt][1]);Yt>=0!=!!Ft&&Kt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,g=function(Ft){this._feature=Ft,this.extent=e.EXTENT,this.type=Ft.type,this.properties=Ft.tags,"id"in Ft&&!isNaN(Ft.id)&&(this.id=parseInt(Ft.id,10))};g.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Ft=[],Yt=0,Jt=this._feature.geometry;Yt<Jt.length;Yt+=1){var Fr=Jt[Yt];Ft.push([new e.Point$1(Fr[0],Fr[1])])}return Ft}else{for(var ta=[],ra=0,ca=this._feature.geometry;ra<ca.length;ra+=1){for(var Ba=ca[ra],$a=[],Za=0,ri=Ba;Za<ri.length;Za+=1){var pi=ri[Za];$a.push(new e.Point$1(pi[0],pi[1]))}ta.push($a)}return ta}},g.prototype.toGeoJSON=function(Ft,Yt,Jt){return M.call(this,Ft,Yt,Jt)};var b=function(Ft){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=Ft.length,this._features=Ft};b.prototype.feature=function(Ft){return new g(this._features[Ft])};var d=e.vectorTile.VectorTileFeature,u=y;function y(Kt,Ft){this.options=Ft||{},this.features=Kt,this.length=Kt.length}y.prototype.feature=function(Kt){return new f(this.features[Kt],this.options.extent)};function f(Kt,Ft){this.id=typeof Kt.id=="number"?Kt.id:void 0,this.type=Kt.type,this.rawGeometry=Kt.type===1?[Kt.geometry]:Kt.geometry,this.properties=Kt.tags,this.extent=Ft||4096}f.prototype.loadGeometry=function(){var Kt=this.rawGeometry;this.geometry=[];for(var Ft=0;Ft<Kt.length;Ft++){for(var Yt=Kt[Ft],Jt=[],Fr=0;Fr<Yt.length;Fr++)Jt.push(new e.Point$1(Yt[Fr][0],Yt[Fr][1]));this.geometry.push(Jt)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Kt=this.geometry,Ft=1/0,Yt=-1/0,Jt=1/0,Fr=-1/0,ta=0;ta<Kt.length;ta++)for(var ra=Kt[ta],ca=0;ca<ra.length;ca++){var Ba=ra[ca];Ft=Math.min(Ft,Ba.x),Yt=Math.max(Yt,Ba.x),Jt=Math.min(Jt,Ba.y),Fr=Math.max(Fr,Ba.y)}return[Ft,Jt,Yt,Fr]},f.prototype.toGeoJSON=d.prototype.toGeoJSON;var R=N,L=N,z=O,F=u;function N(Kt){var Ft=new e.pbf;return P(Kt,Ft),Ft.finish()}function O(Kt,Ft){Ft=Ft||{};var Yt={};for(var Jt in Kt)Yt[Jt]=new u(Kt[Jt].features,Ft),Yt[Jt].name=Jt,Yt[Jt].version=Ft.version,Yt[Jt].extent=Ft.extent;return N({layers:Yt})}function P(Kt,Ft){for(var Yt in Kt.layers)Ft.writeMessage(3,U,Kt.layers[Yt])}function U(Kt,Ft){Ft.writeVarintField(15,Kt.version||1),Ft.writeStringField(1,Kt.name||""),Ft.writeVarintField(5,Kt.extent||4096);var Yt,Jt={keys:[],values:[],keycache:{},valuecache:{}};for(Yt=0;Yt<Kt.length;Yt++)Jt.feature=Kt.feature(Yt),Ft.writeMessage(2,B,Jt);var Fr=Jt.keys;for(Yt=0;Yt<Fr.length;Yt++)Ft.writeStringField(3,Fr[Yt]);var ta=Jt.values;for(Yt=0;Yt<ta.length;Yt++)Ft.writeMessage(4,fe,ta[Yt])}function B(Kt,Ft){var Yt=Kt.feature;Yt.id!==void 0&&Ft.writeVarintField(1,Yt.id),Ft.writeMessage(2,X,Kt),Ft.writeVarintField(3,Yt.type),Ft.writeMessage(4,le,Yt)}function X(Kt,Ft){var Yt=Kt.feature,Jt=Kt.keys,Fr=Kt.values,ta=Kt.keycache,ra=Kt.valuecache;for(var ca in Yt.properties){var Ba=ta[ca];typeof Ba>"u"&&(Jt.push(ca),Ba=Jt.length-1,ta[ca]=Ba),Ft.writeVarint(Ba);var $a=Yt.properties[ca],Za=typeof $a;Za!=="string"&&Za!=="boolean"&&Za!=="number"&&($a=JSON.stringify($a));var ri=Za+":"+$a,pi=ra[ri];typeof pi>"u"&&(Fr.push($a),pi=Fr.length-1,ra[ri]=pi),Ft.writeVarint(pi)}}function $(Kt,Ft){return(Ft<<3)+(Kt&7)}function se(Kt){return Kt<<1^Kt>>31}function le(Kt,Ft){for(var Yt=Kt.loadGeometry(),Jt=Kt.type,Fr=0,ta=0,ra=Yt.length,ca=0;ca<ra;ca++){var Ba=Yt[ca],$a=1;Jt===1&&($a=Ba.length),Ft.writeVarint($(1,$a));for(var Za=Jt===3?Ba.length-1:Ba.length,ri=0;ri<Za;ri++){ri===1&&Jt!==1&&Ft.writeVarint($(2,Za-1));var pi=Ba[ri].x-Fr,Ra=Ba[ri].y-ta;Ft.writeVarint(se(pi)),Ft.writeVarint(se(Ra)),Fr+=pi,ta+=Ra}Jt===3&&Ft.writeVarint($(7,1))}}function fe(Kt,Ft){var Yt=typeof Kt;Yt==="string"?Ft.writeStringField(1,Kt):Yt==="boolean"?Ft.writeBooleanField(7,Kt):Yt==="number"&&(Kt%1!==0?Ft.writeDoubleField(3,Kt):Kt<0?Ft.writeSVarintField(6,Kt):Ft.writeVarintField(5,Kt))}R.fromVectorTileJs=L,R.fromGeojsonVt=z,R.GeoJSONWrapper=F;function V(Kt,Ft,Yt,Jt,Fr,ta){if(!(Fr-Jt<=Yt)){var ra=Jt+Fr>>1;Y(Kt,Ft,ra,Jt,Fr,ta%2),V(Kt,Ft,Yt,Jt,ra-1,ta+1),V(Kt,Ft,Yt,ra+1,Fr,ta+1)}}function Y(Kt,Ft,Yt,Jt,Fr,ta){for(;Fr>Jt;){if(Fr-Jt>600){var ra=Fr-Jt+1,ca=Yt-Jt+1,Ba=Math.log(ra),$a=.5*Math.exp(2*Ba/3),Za=.5*Math.sqrt(Ba*$a*(ra-$a)/ra)*(ca-ra/2<0?-1:1),ri=Math.max(Jt,Math.floor(Yt-ca*$a/ra+Za)),pi=Math.min(Fr,Math.floor(Yt+(ra-ca)*$a/ra+Za));Y(Kt,Ft,Yt,ri,pi,ta)}var Ra=Ft[2*Yt+ta],tn=Jt,on=Fr;for(ee(Kt,Ft,Jt,Yt),Ft[2*Fr+ta]>Ra&&ee(Kt,Ft,Jt,Fr);tn<on;){for(ee(Kt,Ft,tn,on),tn++,on--;Ft[2*tn+ta]<Ra;)tn++;for(;Ft[2*on+ta]>Ra;)on--}Ft[2*Jt+ta]===Ra?ee(Kt,Ft,Jt,on):(on++,ee(Kt,Ft,on,Fr)),on<=Yt&&(Jt=on+1),Yt<=on&&(Fr=on-1)}}function ee(Kt,Ft,Yt,Jt){q(Kt,Yt,Jt),q(Ft,2*Yt,2*Jt),q(Ft,2*Yt+1,2*Jt+1)}function q(Kt,Ft,Yt){var Jt=Kt[Ft];Kt[Ft]=Kt[Yt],Kt[Yt]=Jt}function oe(Kt,Ft,Yt,Jt,Fr,ta,ra){for(var ca=[0,Kt.length-1,0],Ba=[],$a,Za;ca.length;){var ri=ca.pop(),pi=ca.pop(),Ra=ca.pop();if(pi-Ra<=ra){for(var tn=Ra;tn<=pi;tn++)$a=Ft[2*tn],Za=Ft[2*tn+1],$a>=Yt&&$a<=Fr&&Za>=Jt&&Za<=ta&&Ba.push(Kt[tn]);continue}var on=Math.floor((Ra+pi)/2);$a=Ft[2*on],Za=Ft[2*on+1],$a>=Yt&&$a<=Fr&&Za>=Jt&&Za<=ta&&Ba.push(Kt[on]);var hn=(ri+1)%2;(ri===0?Yt<=$a:Jt<=Za)&&(ca.push(Ra),ca.push(on-1),ca.push(hn)),(ri===0?Fr>=$a:ta>=Za)&&(ca.push(on+1),ca.push(pi),ca.push(hn))}return Ba}function ae(Kt,Ft,Yt,Jt,Fr,ta){for(var ra=[0,Kt.length-1,0],ca=[],Ba=Fr*Fr;ra.length;){var $a=ra.pop(),Za=ra.pop(),ri=ra.pop();if(Za-ri<=ta){for(var pi=ri;pi<=Za;pi++)j(Ft[2*pi],Ft[2*pi+1],Yt,Jt)<=Ba&&ca.push(Kt[pi]);continue}var Ra=Math.floor((ri+Za)/2),tn=Ft[2*Ra],on=Ft[2*Ra+1];j(tn,on,Yt,Jt)<=Ba&&ca.push(Kt[Ra]);var hn=($a+1)%2;($a===0?Yt-Fr<=tn:Jt-Fr<=on)&&(ra.push(ri),ra.push(Ra-1),ra.push(hn)),($a===0?Yt+Fr>=tn:Jt+Fr>=on)&&(ra.push(Ra+1),ra.push(Za),ra.push(hn))}return ca}function j(Kt,Ft,Yt,Jt){var Fr=Kt-Yt,ta=Ft-Jt;return Fr*Fr+ta*ta}var Q=function(Kt){return Kt[0]},re=function(Kt){return Kt[1]},ce=function(Ft,Yt,Jt,Fr,ta){Yt===void 0&&(Yt=Q),Jt===void 0&&(Jt=re),Fr===void 0&&(Fr=64),ta===void 0&&(ta=Float64Array),this.nodeSize=Fr,this.points=Ft;for(var ra=Ft.length<65536?Uint16Array:Uint32Array,ca=this.ids=new ra(Ft.length),Ba=this.coords=new ta(Ft.length*2),$a=0;$a<Ft.length;$a++)ca[$a]=$a,Ba[2*$a]=Yt(Ft[$a]),Ba[2*$a+1]=Jt(Ft[$a]);V(ca,Ba,Fr,0,ca.length-1,0)};ce.prototype.range=function(Ft,Yt,Jt,Fr){return oe(this.ids,this.coords,Ft,Yt,Jt,Fr,this.nodeSize)},ce.prototype.within=function(Ft,Yt,Jt){return ae(this.ids,this.coords,Ft,Yt,Jt,this.nodeSize)};var be={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Kt){return Kt}},Ae=function(Ft){this.options=ye(Object.create(be),Ft),this.trees=new Array(this.options.maxZoom+1)};Ae.prototype.load=function(Ft){var Yt=this.options,Jt=Yt.log,Fr=Yt.minZoom,ta=Yt.maxZoom,ra=Yt.nodeSize;Jt&&console.time("total time");var ca="prepare "+Ft.length+" points";Jt&&console.time(ca),this.points=Ft;for(var Ba=[],$a=0;$a<Ft.length;$a++)Ft[$a].geometry&&Ba.push(ze(Ft[$a],$a));this.trees[ta+1]=new ce(Ba,he,Oe,ra,Float32Array),Jt&&console.timeEnd(ca);for(var Za=ta;Za>=Fr;Za--){var ri=+Date.now();Ba=this._cluster(Ba,Za),this.trees[Za]=new ce(Ba,he,Oe,ra,Float32Array),Jt&&console.log("z%d: %d clusters in %dms",Za,Ba.length,+Date.now()-ri)}return Jt&&console.timeEnd("total time"),this},Ae.prototype.getClusters=function(Ft,Yt){var Jt=((Ft[0]+180)%360+360)%360-180,Fr=Math.max(-90,Math.min(90,Ft[1])),ta=Ft[2]===180?180:((Ft[2]+180)%360+360)%360-180,ra=Math.max(-90,Math.min(90,Ft[3]));if(Ft[2]-Ft[0]>=360)Jt=-180,ta=180;else if(Jt>ta){var ca=this.getClusters([Jt,Fr,180,ra],Yt),Ba=this.getClusters([-180,Fr,ta,ra],Yt);return ca.concat(Ba)}for(var $a=this.trees[this._limitZoom(Yt)],Za=$a.range(nt(Jt),rt(ra),nt(ta),rt(Fr)),ri=[],pi=0,Ra=Za;pi<Ra.length;pi+=1){var tn=Ra[pi],on=$a.points[tn];ri.push(on.numPoints?Ze(on):this.points[on.index])}return ri},Ae.prototype.getChildren=function(Ft){var Yt=this._getOriginId(Ft),Jt=this._getOriginZoom(Ft),Fr="No cluster with the specified id.",ta=this.trees[Jt];if(!ta)throw new Error(Fr);var ra=ta.points[Yt];if(!ra)throw new Error(Fr);for(var ca=this.options.radius/(this.options.extent*Math.pow(2,Jt-1)),Ba=ta.within(ra.x,ra.y,ca),$a=[],Za=0,ri=Ba;Za<ri.length;Za+=1){var pi=ri[Za],Ra=ta.points[pi];Ra.parentId===Ft&&$a.push(Ra.numPoints?Ze(Ra):this.points[Ra.index])}if($a.length===0)throw new Error(Fr);return $a},Ae.prototype.getLeaves=function(Ft,Yt,Jt){Yt=Yt||10,Jt=Jt||0;var Fr=[];return this._appendLeaves(Fr,Ft,Yt,Jt,0),Fr},Ae.prototype.getTile=function(Ft,Yt,Jt){var Fr=this.trees[this._limitZoom(Ft)],ta=Math.pow(2,Ft),ra=this.options,ca=ra.extent,Ba=ra.radius,$a=Ba/ca,Za=(Jt-$a)/ta,ri=(Jt+1+$a)/ta,pi={features:[]};return this._addTileFeatures(Fr.range((Yt-$a)/ta,Za,(Yt+1+$a)/ta,ri),Fr.points,Yt,Jt,ta,pi),Yt===0&&this._addTileFeatures(Fr.range(1-$a/ta,Za,1,ri),Fr.points,ta,Jt,ta,pi),Yt===ta-1&&this._addTileFeatures(Fr.range(0,Za,$a/ta,ri),Fr.points,-1,Jt,ta,pi),pi.features.length?pi:null},Ae.prototype.getClusterExpansionZoom=function(Ft){for(var Yt=this._getOriginZoom(Ft)-1;Yt<=this.options.maxZoom;){var Jt=this.getChildren(Ft);if(Yt++,Jt.length!==1)break;Ft=Jt[0].properties.cluster_id}return Yt},Ae.prototype._appendLeaves=function(Ft,Yt,Jt,Fr,ta){for(var ra=this.getChildren(Yt),ca=0,Ba=ra;ca<Ba.length;ca+=1){var $a=Ba[ca],Za=$a.properties;if(Za&&Za.cluster?ta+Za.point_count<=Fr?ta+=Za.point_count:ta=this._appendLeaves(Ft,Za.cluster_id,Jt,Fr,ta):ta<Fr?ta++:Ft.push($a),Ft.length===Jt)break}return ta},Ae.prototype._addTileFeatures=function(Ft,Yt,Jt,Fr,ta,ra){for(var ca=0,Ba=Ft;ca<Ba.length;ca+=1){var $a=Ba[ca],Za=Yt[$a],ri=Za.numPoints,pi={type:1,geometry:[[Math.round(this.options.extent*(Za.x*ta-Jt)),Math.round(this.options.extent*(Za.y*ta-Fr))]],tags:ri?at(Za):this.points[Za.index].properties},Ra=void 0;ri?Ra=Za.id:this.options.generateId?Ra=Za.index:this.points[Za.index].id&&(Ra=this.points[Za.index].id),Ra!==void 0&&(pi.id=Ra),ra.features.push(pi)}},Ae.prototype._limitZoom=function(Ft){return Math.max(this.options.minZoom,Math.min(+Ft,this.options.maxZoom+1))},Ae.prototype._cluster=function(Ft,Yt){for(var Jt=[],Fr=this.options,ta=Fr.radius,ra=Fr.extent,ca=Fr.reduce,Ba=Fr.minPoints,$a=ta/(ra*Math.pow(2,Yt)),Za=0;Za<Ft.length;Za++){var ri=Ft[Za];if(!(ri.zoom<=Yt)){ri.zoom=Yt;for(var pi=this.trees[Yt+1],Ra=pi.within(ri.x,ri.y,$a),tn=ri.numPoints||1,on=tn,hn=0,Tt=Ra;hn<Tt.length;hn+=1){var ut=Tt[hn],Br=pi.points[ut];Br.zoom>Yt&&(on+=Br.numPoints||1)}if(on>=Ba){for(var Cr=ri.x*tn,xr=ri.y*tn,Ir=ca&&tn>1?this._map(ri,!0):null,Ur=(Za<<5)+(Yt+1)+this.points.length,Hr=0,xt=Ra;Hr<xt.length;Hr+=1){var Xt=xt[Hr],vr=pi.points[Xt];if(!(vr.zoom<=Yt)){vr.zoom=Yt;var Or=vr.numPoints||1;Cr+=vr.x*Or,xr+=vr.y*Or,vr.parentId=Ur,ca&&(Ir||(Ir=this._map(ri,!0)),ca(Ir,this._map(vr)))}}ri.parentId=Ur,Jt.push(De(Cr/on,xr/on,Ur,on,Ir))}else if(Jt.push(ri),on>1)for(var ba=0,Pa=Ra;ba<Pa.length;ba+=1){var ya=Pa[ba],la=pi.points[ya];la.zoom<=Yt||(la.zoom=Yt,Jt.push(la))}}}return Jt},Ae.prototype._getOriginId=function(Ft){return Ft-this.points.length>>5},Ae.prototype._getOriginZoom=function(Ft){return(Ft-this.points.length)%32},Ae.prototype._map=function(Ft,Yt){if(Ft.numPoints)return Yt?ye({},Ft.properties):Ft.properties;var Jt=this.points[Ft.index].properties,Fr=this.options.map(Jt);return Yt&&Fr===Jt?ye({},Fr):Fr};function De(Kt,Ft,Yt,Jt,Fr){return{x:Kt,y:Ft,zoom:1/0,id:Yt,parentId:-1,numPoints:Jt,properties:Fr}}function ze(Kt,Ft){var Yt=Kt.geometry.coordinates,Jt=Yt[0],Fr=Yt[1];return{x:nt(Jt),y:rt(Fr),zoom:1/0,index:Ft,parentId:-1}}function Ze(Kt){return{type:"Feature",id:Kt.id,properties:at(Kt),geometry:{type:"Point",coordinates:[st(Kt.x),Me(Kt.y)]}}}function at(Kt){var Ft=Kt.numPoints,Yt=Ft>=1e4?Math.round(Ft/1e3)+"k":Ft>=1e3?Math.round(Ft/100)/10+"k":Ft;return ye(ye({},Kt.properties),{cluster:!0,cluster_id:Kt.id,point_count:Ft,point_count_abbreviated:Yt})}function nt(Kt){return Kt/360+.5}function rt(Kt){var Ft=Math.sin(Kt*Math.PI/180),Yt=.5-.25*Math.log((1+Ft)/(1-Ft))/Math.PI;return Yt<0?0:Yt>1?1:Yt}function st(Kt){return(Kt-.5)*360}function Me(Kt){var Ft=(180-Kt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Ft))/Math.PI-90}function ye(Kt,Ft){for(var Yt in Ft)Kt[Yt]=Ft[Yt];return Kt}function he(Kt){return Kt.x}function Oe(Kt){return Kt.y}function tt(Kt,Ft,Yt,Jt){for(var Fr=Jt,ta=Yt-Ft>>1,ra=Yt-Ft,ca,Ba=Kt[Ft],$a=Kt[Ft+1],Za=Kt[Yt],ri=Kt[Yt+1],pi=Ft+3;pi<Yt;pi+=3){var Ra=ot(Kt[pi],Kt[pi+1],Ba,$a,Za,ri);if(Ra>Fr)ca=pi,Fr=Ra;else if(Ra===Fr){var tn=Math.abs(pi-ta);tn<ra&&(ca=pi,ra=tn)}}Fr>Jt&&(ca-Ft>3&&tt(Kt,Ft,ca,Jt),Kt[ca+2]=Fr,Yt-ca>3&&tt(Kt,ca,Yt,Jt))}function ot(Kt,Ft,Yt,Jt,Fr,ta){var ra=Fr-Yt,ca=ta-Jt;if(ra!==0||ca!==0){var Ba=((Kt-Yt)*ra+(Ft-Jt)*ca)/(ra*ra+ca*ca);Ba>1?(Yt=Fr,Jt=ta):Ba>0&&(Yt+=ra*Ba,Jt+=ca*Ba)}return ra=Kt-Yt,ca=Ft-Jt,ra*ra+ca*ca}function Qe(Kt,Ft,Yt,Jt){var Fr={id:typeof Kt>"u"?null:Kt,type:Ft,geometry:Yt,tags:Jt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Pt(Fr),Fr}function Pt(Kt){var Ft=Kt.geometry,Yt=Kt.type;if(Yt==="Point"||Yt==="MultiPoint"||Yt==="LineString")It(Kt,Ft);else if(Yt==="Polygon"||Yt==="MultiLineString")for(var Jt=0;Jt<Ft.length;Jt++)It(Kt,Ft[Jt]);else if(Yt==="MultiPolygon")for(Jt=0;Jt<Ft.length;Jt++)for(var Fr=0;Fr<Ft[Jt].length;Fr++)It(Kt,Ft[Jt][Fr])}function It(Kt,Ft){for(var Yt=0;Yt<Ft.length;Yt+=3)Kt.minX=Math.min(Kt.minX,Ft[Yt]),Kt.minY=Math.min(Kt.minY,Ft[Yt+1]),Kt.maxX=Math.max(Kt.maxX,Ft[Yt]),Kt.maxY=Math.max(Kt.maxY,Ft[Yt+1])}function qt(Kt,Ft){var Yt=[];if(Kt.type==="FeatureCollection")for(var Jt=0;Jt<Kt.features.length;Jt++)Wt(Yt,Kt.features[Jt],Ft,Jt);else Kt.type==="Feature"?Wt(Yt,Kt,Ft):Wt(Yt,{geometry:Kt},Ft);return Yt}function Wt(Kt,Ft,Yt,Jt){if(Ft.geometry){var Fr=Ft.geometry.coordinates,ta=Ft.geometry.type,ra=Math.pow(Yt.tolerance/((1<<Yt.maxZoom)*Yt.extent),2),ca=[],Ba=Ft.id;if(Yt.promoteId?Ba=Ft.properties[Yt.promoteId]:Yt.generateId&&(Ba=Jt||0),ta==="Point")kr(Fr,ca);else if(ta==="MultiPoint")for(var $a=0;$a<Fr.length;$a++)kr(Fr[$a],ca);else if(ta==="LineString")mr(Fr,ca,ra,!1);else if(ta==="MultiLineString")if(Yt.lineMetrics){for($a=0;$a<Fr.length;$a++)ca=[],mr(Fr[$a],ca,ra,!1),Kt.push(Qe(Ba,"LineString",ca,Ft.properties));return}else qr(Fr,ca,ra,!1);else if(ta==="Polygon")qr(Fr,ca,ra,!0);else if(ta==="MultiPolygon")for($a=0;$a<Fr.length;$a++){var Za=[];qr(Fr[$a],Za,ra,!0),ca.push(Za)}else if(ta==="GeometryCollection"){for($a=0;$a<Ft.geometry.geometries.length;$a++)Wt(Kt,{id:Ba,geometry:Ft.geometry.geometries[$a],properties:Ft.properties},Yt,Jt);return}else throw new Error("Input data is not a valid GeoJSON object.");Kt.push(Qe(Ba,ta,ca,Ft.properties))}}function kr(Kt,Ft){Ft.push(Sr(Kt[0])),Ft.push(Rr(Kt[1])),Ft.push(0)}function mr(Kt,Ft,Yt,Jt){for(var Fr,ta,ra=0,ca=0;ca<Kt.length;ca++){var Ba=Sr(Kt[ca][0]),$a=Rr(Kt[ca][1]);Ft.push(Ba),Ft.push($a),Ft.push(0),ca>0&&(Jt?ra+=(Fr*$a-Ba*ta)/2:ra+=Math.sqrt(Math.pow(Ba-Fr,2)+Math.pow($a-ta,2))),Fr=Ba,ta=$a}var Za=Ft.length-3;Ft[2]=1,tt(Ft,0,Za,Yt),Ft[Za+2]=1,Ft.size=Math.abs(ra),Ft.start=0,Ft.end=Ft.size}function qr(Kt,Ft,Yt,Jt){for(var Fr=0;Fr<Kt.length;Fr++){var ta=[];mr(Kt[Fr],ta,Yt,Jt),Ft.push(ta)}}function Sr(Kt){return Kt/360+.5}function Rr(Kt){var Ft=Math.sin(Kt*Math.PI/180),Yt=.5-.25*Math.log((1+Ft)/(1-Ft))/Math.PI;return Yt<0?0:Yt>1?1:Yt}function wt(Kt,Ft,Yt,Jt,Fr,ta,ra,ca){if(Yt/=Ft,Jt/=Ft,ta>=Yt&&ra<Jt)return Kt;if(ra<Yt||ta>=Jt)return null;for(var Ba=[],$a=0;$a<Kt.length;$a++){var Za=Kt[$a],ri=Za.geometry,pi=Za.type,Ra=Fr===0?Za.minX:Za.minY,tn=Fr===0?Za.maxX:Za.maxY;if(Ra>=Yt&&tn<Jt){Ba.push(Za);continue}else if(tn<Yt||Ra>=Jt)continue;var on=[];if(pi==="Point"||pi==="MultiPoint")Ne(ri,on,Yt,Jt,Fr);else if(pi==="LineString")Ke(ri,on,Yt,Jt,Fr,!1,ca.lineMetrics);else if(pi==="MultiLineString")Ie(ri,on,Yt,Jt,Fr,!1);else if(pi==="Polygon")Ie(ri,on,Yt,Jt,Fr,!0);else if(pi==="MultiPolygon")for(var hn=0;hn<ri.length;hn++){var Tt=[];Ie(ri[hn],Tt,Yt,Jt,Fr,!0),Tt.length&&on.push(Tt)}if(on.length){if(ca.lineMetrics&&pi==="LineString"){for(hn=0;hn<on.length;hn++)Ba.push(Qe(Za.id,pi,on[hn],Za.tags));continue}(pi==="LineString"||pi==="MultiLineString")&&(on.length===1?(pi="LineString",on=on[0]):pi="MultiLineString"),(pi==="Point"||pi==="MultiPoint")&&(pi=on.length===3?"Point":"MultiPoint"),Ba.push(Qe(Za.id,pi,on,Za.tags))}}return Ba.length?Ba:null}function Ne(Kt,Ft,Yt,Jt,Fr){for(var ta=0;ta<Kt.length;ta+=3){var ra=Kt[ta+Fr];ra>=Yt&&ra<=Jt&&(Ft.push(Kt[ta]),Ft.push(Kt[ta+1]),Ft.push(Kt[ta+2]))}}function Ke(Kt,Ft,Yt,Jt,Fr,ta,ra){for(var ca=Te(Kt),Ba=Fr===0?Ce:Ee,$a=Kt.start,Za,ri,pi=0;pi<Kt.length-3;pi+=3){var Ra=Kt[pi],tn=Kt[pi+1],on=Kt[pi+2],hn=Kt[pi+3],Tt=Kt[pi+4],ut=Fr===0?Ra:tn,Br=Fr===0?hn:Tt,Cr=!1;ra&&(Za=Math.sqrt(Math.pow(Ra-hn,2)+Math.pow(tn-Tt,2))),ut<Yt?Br>Yt&&(ri=Ba(ca,Ra,tn,hn,Tt,Yt),ra&&(ca.start=$a+Za*ri)):ut>Jt?Br<Jt&&(ri=Ba(ca,Ra,tn,hn,Tt,Jt),ra&&(ca.start=$a+Za*ri)):Ve(ca,Ra,tn,on),Br<Yt&&ut>=Yt&&(ri=Ba(ca,Ra,tn,hn,Tt,Yt),Cr=!0),Br>Jt&&ut<=Jt&&(ri=Ba(ca,Ra,tn,hn,Tt,Jt),Cr=!0),!ta&&Cr&&(ra&&(ca.end=$a+Za*ri),Ft.push(ca),ca=Te(Kt)),ra&&($a+=Za)}var xr=Kt.length-3;Ra=Kt[xr],tn=Kt[xr+1],on=Kt[xr+2],ut=Fr===0?Ra:tn,ut>=Yt&&ut<=Jt&&Ve(ca,Ra,tn,on),xr=ca.length-3,ta&&xr>=3&&(ca[xr]!==ca[0]||ca[xr+1]!==ca[1])&&Ve(ca,ca[0],ca[1],ca[2]),ca.length&&Ft.push(ca)}function Te(Kt){var Ft=[];return Ft.size=Kt.size,Ft.start=Kt.start,Ft.end=Kt.end,Ft}function Ie(Kt,Ft,Yt,Jt,Fr,ta){for(var ra=0;ra<Kt.length;ra++)Ke(Kt[ra],Ft,Yt,Jt,Fr,ta,!1)}function Ve(Kt,Ft,Yt,Jt){Kt.push(Ft),Kt.push(Yt),Kt.push(Jt)}function Ce(Kt,Ft,Yt,Jt,Fr,ta){var ra=(ta-Ft)/(Jt-Ft);return Kt.push(ta),Kt.push(Yt+(Fr-Yt)*ra),Kt.push(1),ra}function Ee(Kt,Ft,Yt,Jt,Fr,ta){var ra=(ta-Yt)/(Fr-Yt);return Kt.push(Ft+(Jt-Ft)*ra),Kt.push(ta),Kt.push(1),ra}function Pe(Kt,Ft){var Yt=Ft.buffer/Ft.extent,Jt=Kt,Fr=wt(Kt,1,-1-Yt,Yt,0,-1,2,Ft),ta=wt(Kt,1,1-Yt,2+Yt,0,-1,2,Ft);return(Fr||ta)&&(Jt=wt(Kt,1,-Yt,1+Yt,0,-1,2,Ft)||[],Fr&&(Jt=ft(Fr,1).concat(Jt)),ta&&(Jt=Jt.concat(ft(ta,-1)))),Jt}function ft(Kt,Ft){for(var Yt=[],Jt=0;Jt<Kt.length;Jt++){var Fr=Kt[Jt],ta=Fr.type,ra;if(ta==="Point"||ta==="MultiPoint"||ta==="LineString")ra=ct(Fr.geometry,Ft);else if(ta==="MultiLineString"||ta==="Polygon"){ra=[];for(var ca=0;ca<Fr.geometry.length;ca++)ra.push(ct(Fr.geometry[ca],Ft))}else if(ta==="MultiPolygon")for(ra=[],ca=0;ca<Fr.geometry.length;ca++){for(var Ba=[],$a=0;$a<Fr.geometry[ca].length;$a++)Ba.push(ct(Fr.geometry[ca][$a],Ft));ra.push(Ba)}Yt.push(Qe(Fr.id,ta,ra,Fr.tags))}return Yt}function ct(Kt,Ft){var Yt=[];Yt.size=Kt.size,Kt.start!==void 0&&(Yt.start=Kt.start,Yt.end=Kt.end);for(var Jt=0;Jt<Kt.length;Jt+=3)Yt.push(Kt[Jt]+Ft,Kt[Jt+1],Kt[Jt+2]);return Yt}function _t(Kt,Ft){if(Kt.transformed)return Kt;var Yt=1<<Kt.z,Jt=Kt.x,Fr=Kt.y,ta,ra,ca;for(ta=0;ta<Kt.features.length;ta++){var Ba=Kt.features[ta],$a=Ba.geometry,Za=Ba.type;if(Ba.geometry=[],Za===1)for(ra=0;ra<$a.length;ra+=2)Ba.geometry.push(Ct($a[ra],$a[ra+1],Ft,Yt,Jt,Fr));else for(ra=0;ra<$a.length;ra++){var ri=[];for(ca=0;ca<$a[ra].length;ca+=2)ri.push(Ct($a[ra][ca],$a[ra][ca+1],Ft,Yt,Jt,Fr));Ba.geometry.push(ri)}}return Kt.transformed=!0,Kt}function Ct(Kt,Ft,Yt,Jt,Fr,ta){return[Math.round(Yt*(Kt*Jt-Fr)),Math.round(Yt*(Ft*Jt-ta))]}function ir(Kt,Ft,Yt,Jt,Fr){for(var ta=Ft===Fr.maxZoom?0:Fr.tolerance/((1<<Ft)*Fr.extent),ra={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Yt,y:Jt,z:Ft,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ca=0;ca<Kt.length;ca++){ra.numFeatures++,rr(ra,Kt[ca],ta,Fr);var Ba=Kt[ca].minX,$a=Kt[ca].minY,Za=Kt[ca].maxX,ri=Kt[ca].maxY;Ba<ra.minX&&(ra.minX=Ba),$a<ra.minY&&(ra.minY=$a),Za>ra.maxX&&(ra.maxX=Za),ri>ra.maxY&&(ra.maxY=ri)}return ra}function rr(Kt,Ft,Yt,Jt){var Fr=Ft.geometry,ta=Ft.type,ra=[];if(ta==="Point"||ta==="MultiPoint")for(var ca=0;ca<Fr.length;ca+=3)ra.push(Fr[ca]),ra.push(Fr[ca+1]),Kt.numPoints++,Kt.numSimplified++;else if(ta==="LineString")er(ra,Fr,Kt,Yt,!1,!1);else if(ta==="MultiLineString"||ta==="Polygon")for(ca=0;ca<Fr.length;ca++)er(ra,Fr[ca],Kt,Yt,ta==="Polygon",ca===0);else if(ta==="MultiPolygon")for(var Ba=0;Ba<Fr.length;Ba++){var $a=Fr[Ba];for(ca=0;ca<$a.length;ca++)er(ra,$a[ca],Kt,Yt,!0,ca===0)}if(ra.length){var Za=Ft.tags||null;if(ta==="LineString"&&Jt.lineMetrics){Za={};for(var ri in Ft.tags)Za[ri]=Ft.tags[ri];Za.mapbox_clip_start=Fr.start/Fr.size,Za.mapbox_clip_end=Fr.end/Fr.size}var pi={geometry:ra,type:ta==="Polygon"||ta==="MultiPolygon"?3:ta==="LineString"||ta==="MultiLineString"?2:1,tags:Za};Ft.id!==null&&(pi.id=Ft.id),Kt.features.push(pi)}}function er(Kt,Ft,Yt,Jt,Fr,ta){var ra=Jt*Jt;if(Jt>0&&Ft.size<(Fr?ra:Jt)){Yt.numPoints+=Ft.length/3;return}for(var ca=[],Ba=0;Ba<Ft.length;Ba+=3)(Jt===0||Ft[Ba+2]>ra)&&(Yt.numSimplified++,ca.push(Ft[Ba]),ca.push(Ft[Ba+1])),Yt.numPoints++;Fr&&Lr(ca,ta),Kt.push(ca)}function Lr(Kt,Ft){for(var Yt=0,Jt=0,Fr=Kt.length,ta=Fr-2;Jt<Fr;ta=Jt,Jt+=2)Yt+=(Kt[Jt]-Kt[ta])*(Kt[Jt+1]+Kt[ta+1]);if(Yt>0===Ft)for(Jt=0,Fr=Kt.length;Jt<Fr/2;Jt+=2){var ra=Kt[Jt],ca=Kt[Jt+1];Kt[Jt]=Kt[Fr-2-Jt],Kt[Jt+1]=Kt[Fr-1-Jt],Kt[Fr-2-Jt]=ra,Kt[Fr-1-Jt]=ca}}function fa(Kt,Ft){return new Da(Kt,Ft)}function Da(Kt,Ft){Ft=this.options=qa(Object.create(this.options),Ft);var Yt=Ft.debug;if(Yt&&console.time("preprocess data"),Ft.maxZoom<0||Ft.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(Ft.promoteId&&Ft.generateId)throw new Error("promoteId and generateId cannot be used together.");var Jt=qt(Kt,Ft);this.tiles={},this.tileCoords=[],Yt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Ft.indexMaxZoom,Ft.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Jt=Pe(Jt,Ft),Jt.length&&this.splitTile(Jt,0,0,0),Yt&&(Jt.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Da.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Da.prototype.splitTile=function(Kt,Ft,Yt,Jt,Fr,ta,ra){for(var ca=[Kt,Ft,Yt,Jt],Ba=this.options,$a=Ba.debug;ca.length;){Jt=ca.pop(),Yt=ca.pop(),Ft=ca.pop(),Kt=ca.pop();var Za=1<<Ft,ri=Ia(Ft,Yt,Jt),pi=this.tiles[ri];if(!pi&&($a>1&&console.time("creation"),pi=this.tiles[ri]=ir(Kt,Ft,Yt,Jt,Ba),this.tileCoords.push({z:Ft,x:Yt,y:Jt}),$a)){$a>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ft,Yt,Jt,pi.numFeatures,pi.numPoints,pi.numSimplified),console.timeEnd("creation"));var Ra="z"+Ft;this.stats[Ra]=(this.stats[Ra]||0)+1,this.total++}if(pi.source=Kt,Fr){if(Ft===Ba.maxZoom||Ft===Fr)continue;var tn=1<<Fr-Ft;if(Yt!==Math.floor(ta/tn)||Jt!==Math.floor(ra/tn))continue}else if(Ft===Ba.indexMaxZoom||pi.numPoints<=Ba.indexMaxPoints)continue;if(pi.source=null,Kt.length!==0){$a>1&&console.time("clipping");var on=.5*Ba.buffer/Ba.extent,hn=.5-on,Tt=.5+on,ut=1+on,Br,Cr,xr,Ir,Ur,Hr;Br=Cr=xr=Ir=null,Ur=wt(Kt,Za,Yt-on,Yt+Tt,0,pi.minX,pi.maxX,Ba),Hr=wt(Kt,Za,Yt+hn,Yt+ut,0,pi.minX,pi.maxX,Ba),Kt=null,Ur&&(Br=wt(Ur,Za,Jt-on,Jt+Tt,1,pi.minY,pi.maxY,Ba),Cr=wt(Ur,Za,Jt+hn,Jt+ut,1,pi.minY,pi.maxY,Ba),Ur=null),Hr&&(xr=wt(Hr,Za,Jt-on,Jt+Tt,1,pi.minY,pi.maxY,Ba),Ir=wt(Hr,Za,Jt+hn,Jt+ut,1,pi.minY,pi.maxY,Ba),Hr=null),$a>1&&console.timeEnd("clipping"),ca.push(Br||[],Ft+1,Yt*2,Jt*2),ca.push(Cr||[],Ft+1,Yt*2,Jt*2+1),ca.push(xr||[],Ft+1,Yt*2+1,Jt*2),ca.push(Ir||[],Ft+1,Yt*2+1,Jt*2+1)}}},Da.prototype.getTile=function(Kt,Ft,Yt){var Jt=this.options,Fr=Jt.extent,ta=Jt.debug;if(Kt<0||Kt>24)return null;var ra=1<<Kt;Ft=(Ft%ra+ra)%ra;var ca=Ia(Kt,Ft,Yt);if(this.tiles[ca])return _t(this.tiles[ca],Fr);ta>1&&console.log("drilling down to z%d-%d-%d",Kt,Ft,Yt);for(var Ba=Kt,$a=Ft,Za=Yt,ri;!ri&&Ba>0;)Ba--,$a=Math.floor($a/2),Za=Math.floor(Za/2),ri=this.tiles[Ia(Ba,$a,Za)];return!ri||!ri.source?null:(ta>1&&console.log("found parent tile z%d-%d-%d",Ba,$a,Za),ta>1&&console.time("drilling down"),this.splitTile(ri.source,Ba,$a,Za,Kt,Ft,Yt),ta>1&&console.timeEnd("drilling down"),this.tiles[ca]?_t(this.tiles[ca],Fr):null)};function Ia(Kt,Ft,Yt){return((1<<Kt)*Yt+Ft)*32+Kt}function qa(Kt,Ft){for(var Yt in Ft)Kt[Yt]=Ft[Yt];return Kt}function Wa(Kt,Ft){var Yt=Kt.tileID.canonical;if(!this._geoJSONIndex)return Ft(null,null);var Jt=this._geoJSONIndex.getTile(Yt.z,Yt.x,Yt.y);if(!Jt)return Ft(null,null);var Fr=new b(Jt.features),ta=R(Fr);(ta.byteOffset!==0||ta.byteLength!==ta.buffer.byteLength)&&(ta=new Uint8Array(ta)),Ft(null,{vectorTile:Fr,rawData:ta.buffer})}var Ca=function(Kt){function Ft(Yt,Jt,Fr,ta){Kt.call(this,Yt,Jt,Fr,Wa),ta&&(this.loadGeoJSON=ta)}return Kt&&(Ft.__proto__=Kt),Ft.prototype=Object.create(Kt&&Kt.prototype),Ft.prototype.constructor=Ft,Ft.prototype.loadData=function(Jt,Fr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=Fr,this._pendingLoadDataParams=Jt,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},Ft.prototype._loadData=function(){var Jt=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var Fr=this._pendingCallback,ta=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var ra=ta&&ta.request&&ta.request.collectResourceTiming?new e.RequestPerformance(ta.request):!1;this.loadGeoJSON(ta,function(ca,Ba){if(ca||!Ba)return Fr(ca);if(typeof Ba!="object")return Fr(new Error("Input data given to '"+ta.source+"' is not a valid GeoJSON object."));l(Ba,!0);try{if(ta.filter){var $a=e.createExpression(ta.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if($a.result==="error")throw new Error($a.value.map(function(Ra){return Ra.key+": "+Ra.message}).join(", "));var Za=Ba.features.filter(function(Ra){return $a.value.evaluate({zoom:0},Ra)});Ba={type:"FeatureCollection",features:Za}}Jt._geoJSONIndex=ta.cluster?new Ae(hi(ta)).load(Ba.features):fa(Ba,ta.geojsonVtOptions)}catch(Ra){return Fr(Ra)}Jt.loaded={};var ri={};if(ra){var pi=ra.finish();pi&&(ri.resourceTiming={},ri.resourceTiming[ta.source]=JSON.parse(JSON.stringify(pi)))}Fr(null,ri)})}},Ft.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},Ft.prototype.reloadTile=function(Jt,Fr){var ta=this.loaded,ra=Jt.uid;return ta&&ta[ra]?Kt.prototype.reloadTile.call(this,Jt,Fr):this.loadTile(Jt,Fr)},Ft.prototype.loadGeoJSON=function(Jt,Fr){if(Jt.request)e.getJSON(Jt.request,Fr);else if(typeof Jt.data=="string")try{return Fr(null,JSON.parse(Jt.data))}catch{return Fr(new Error("Input data given to '"+Jt.source+"' is not a valid GeoJSON object."))}else return Fr(new Error("Input data given to '"+Jt.source+"' is not a valid GeoJSON object."))},Ft.prototype.removeSource=function(Jt,Fr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Fr()},Ft.prototype.getClusterExpansionZoom=function(Jt,Fr){try{Fr(null,this._geoJSONIndex.getClusterExpansionZoom(Jt.clusterId))}catch(ta){Fr(ta)}},Ft.prototype.getClusterChildren=function(Jt,Fr){try{Fr(null,this._geoJSONIndex.getChildren(Jt.clusterId))}catch(ta){Fr(ta)}},Ft.prototype.getClusterLeaves=function(Jt,Fr){try{Fr(null,this._geoJSONIndex.getLeaves(Jt.clusterId,Jt.limit,Jt.offset))}catch(ta){Fr(ta)}},Ft}(m);function hi(Kt){var Ft=Kt.superclusterOptions,Yt=Kt.clusterProperties;if(!Yt||!Ft)return Ft;for(var Jt={},Fr={},ta={accumulated:null,zoom:0},ra={properties:null},ca=Object.keys(Yt),Ba=0,$a=ca;Ba<$a.length;Ba+=1){var Za=$a[Ba],ri=Yt[Za],pi=ri[0],Ra=ri[1],tn=e.createExpression(Ra),on=e.createExpression(typeof pi=="string"?[pi,["accumulated"],["get",Za]]:pi);Jt[Za]=tn.value,Fr[Za]=on.value}return Ft.map=function(hn){ra.properties=hn;for(var Tt={},ut=0,Br=ca;ut<Br.length;ut+=1){var Cr=Br[ut];Tt[Cr]=Jt[Cr].evaluate(ta,ra)}return Tt},Ft.reduce=function(hn,Tt){ra.properties=Tt;for(var ut=0,Br=ca;ut<Br.length;ut+=1){var Cr=Br[ut];ta.accumulated=hn[Cr],hn[Cr]=Fr[Cr].evaluate(ta,ra)}},Ft}var wi=function(Ft){var Yt=this;this.self=Ft,this.actor=new e.Actor(Ft,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:m,geojson:Ca},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(Jt,Fr){if(Yt.workerSourceTypes[Jt])throw new Error('Worker source with name "'+Jt+'" already registered.');Yt.workerSourceTypes[Jt]=Fr},this.self.registerRTLTextPlugin=function(Jt){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=Jt.applyArabicShaping,e.plugin.processBidirectionalText=Jt.processBidirectionalText,e.plugin.processStyledBidirectionalText=Jt.processStyledBidirectionalText}};return wi.prototype.setReferrer=function(Ft,Yt){this.referrer=Yt},wi.prototype.setImages=function(Ft,Yt,Jt){this.availableImages[Ft]=Yt;for(var Fr in this.workerSources[Ft]){var ta=this.workerSources[Ft][Fr];for(var ra in ta)ta[ra].availableImages=Yt}Jt()},wi.prototype.setLayers=function(Ft,Yt,Jt){this.getLayerIndex(Ft).replace(Yt),Jt()},wi.prototype.updateLayers=function(Ft,Yt,Jt){this.getLayerIndex(Ft).update(Yt.layers,Yt.removedIds),Jt()},wi.prototype.loadTile=function(Ft,Yt,Jt){this.getWorkerSource(Ft,Yt.type,Yt.source).loadTile(Yt,Jt)},wi.prototype.loadDEMTile=function(Ft,Yt,Jt){this.getDEMWorkerSource(Ft,Yt.source).loadTile(Yt,Jt)},wi.prototype.reloadTile=function(Ft,Yt,Jt){this.getWorkerSource(Ft,Yt.type,Yt.source).reloadTile(Yt,Jt)},wi.prototype.abortTile=function(Ft,Yt,Jt){this.getWorkerSource(Ft,Yt.type,Yt.source).abortTile(Yt,Jt)},wi.prototype.removeTile=function(Ft,Yt,Jt){this.getWorkerSource(Ft,Yt.type,Yt.source).removeTile(Yt,Jt)},wi.prototype.removeDEMTile=function(Ft,Yt){this.getDEMWorkerSource(Ft,Yt.source).removeTile(Yt)},wi.prototype.removeSource=function(Ft,Yt,Jt){if(!(!this.workerSources[Ft]||!this.workerSources[Ft][Yt.type]||!this.workerSources[Ft][Yt.type][Yt.source])){var Fr=this.workerSources[Ft][Yt.type][Yt.source];delete this.workerSources[Ft][Yt.type][Yt.source],Fr.removeSource!==void 0?Fr.removeSource(Yt,Jt):Jt()}},wi.prototype.loadWorkerSource=function(Ft,Yt,Jt){try{this.self.importScripts(Yt.url),Jt()}catch(Fr){Jt(Fr.toString())}},wi.prototype.syncRTLPluginState=function(Ft,Yt,Jt){try{e.plugin.setState(Yt);var Fr=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&Fr!=null){this.self.importScripts(Fr);var ta=e.plugin.isParsed(),ra=ta?void 0:new Error("RTL Text Plugin failed to import scripts from "+Fr);Jt(ra,ta)}}catch(ca){Jt(ca.toString())}},wi.prototype.getAvailableImages=function(Ft){var Yt=this.availableImages[Ft];return Yt||(Yt=[]),Yt},wi.prototype.getLayerIndex=function(Ft){var Yt=this.layerIndexes[Ft];return Yt||(Yt=this.layerIndexes[Ft]=new a),Yt},wi.prototype.getWorkerSource=function(Ft,Yt,Jt){var Fr=this;if(this.workerSources[Ft]||(this.workerSources[Ft]={}),this.workerSources[Ft][Yt]||(this.workerSources[Ft][Yt]={}),!this.workerSources[Ft][Yt][Jt]){var ta={send:function(ra,ca,Ba){Fr.actor.send(ra,ca,Ba,Ft)}};this.workerSources[Ft][Yt][Jt]=new this.workerSourceTypes[Yt](ta,this.getLayerIndex(Ft),this.getAvailableImages(Ft))}return this.workerSources[Ft][Yt][Jt]},wi.prototype.getDEMWorkerSource=function(Ft,Yt){return this.demWorkerSources[Ft]||(this.demWorkerSources[Ft]={}),this.demWorkerSources[Ft][Yt]||(this.demWorkerSources[Ft][Yt]=new T),this.demWorkerSources[Ft][Yt]},wi.prototype.enforceCacheSizeLimit=function(Ft,Yt){e.enforceCacheSizeLimit(Yt)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new wi(self)),wi}),E(["./shared"],function(e){"use strict";var t=e.createCommonjsModule(function(ve){ve.exports?ve.exports=K:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=K,window.mapboxgl.notSupportedReason=_e);function K(nr){return!_e(nr)}function _e(nr){if(!te())return"not a browser";if(!me())return"insufficent Array support";if(!Ge())return"insufficient Function support";if(!Le())return"insufficient Object support";if(!$e())return"insufficient JSON support";if(!gt())return"insufficient worker support";if(!jt())return"insufficient Uint8ClampedArray support";if(!wr())return"insufficient ArrayBuffer support";if(!Nr())return"insufficient Canvas/getImageData support";if(!yt(nr&&nr.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function te(){return typeof window<"u"&&typeof document<"u"}function me(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function Ge(){return Function.prototype&&Function.prototype.bind}function Le(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function $e(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function gt(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var nr=new Blob([""],{type:"text/javascript"}),hr=URL.createObjectURL(nr),lr,dr;try{dr=new Worker(hr),lr=!0}catch{lr=!1}return dr&&dr.terminate(),URL.revokeObjectURL(hr),lr}function jt(){return"Uint8ClampedArray"in window}function wr(){return ArrayBuffer.isView}function Nr(){var nr=document.createElement("canvas");nr.width=nr.height=1;var hr=nr.getContext("2d");if(!hr)return!1;var lr=hr.getImageData(0,0,1,1);return lr&&lr.width===nr.width}var pr={};function yt(nr){return pr[nr]===void 0&&(pr[nr]=Bt(nr)),pr[nr]}K.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function kt(nr){var hr=document.createElement("canvas"),lr=Object.create(K.webGLContextAttributes);return lr.failIfMajorPerformanceCaveat=nr,hr.probablySupportsContext?hr.probablySupportsContext("webgl",lr)||hr.probablySupportsContext("experimental-webgl",lr):hr.supportsContext?hr.supportsContext("webgl",lr)||hr.supportsContext("experimental-webgl",lr):hr.getContext("webgl",lr)||hr.getContext("experimental-webgl",lr)}function Bt(nr){var hr=kt(nr);if(!hr)return!1;var lr=hr.createShader(hr.VERTEX_SHADER);return!lr||hr.isContextLost()?!1:(hr.shaderSource(lr,"void main() {}"),hr.compileShader(lr),hr.getShaderParameter(lr,hr.COMPILE_STATUS)===!0)}}),r={};r.create=function(ve,K,_e){var te=e.window.document.createElement(ve);return K!==void 0&&(te.className=K),_e&&_e.appendChild(te),te},r.createNS=function(ve,K){var _e=e.window.document.createElementNS(ve,K);return _e};var o=e.window.document&&e.window.document.documentElement.style;function a(ve){if(!o)return ve[0];for(var K=0;K<ve.length;K++)if(ve[K]in o)return ve[K];return ve[0]}var n=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),i;r.disableDrag=function(){o&&n&&(i=o[n],o[n]="none")},r.enableDrag=function(){o&&n&&(o[n]=i)};var s=a(["transform","WebkitTransform"]);r.setTransform=function(ve,K){ve.style[s]=K};var h=!1;try{var c=Object.defineProperty({},"passive",{get:function(){h=!0}});e.window.addEventListener("test",c,c),e.window.removeEventListener("test",c,c)}catch{h=!1}r.addEventListener=function(ve,K,_e,te){te===void 0&&(te={}),"passive"in te&&h?ve.addEventListener(K,_e,te):ve.addEventListener(K,_e,te.capture)},r.removeEventListener=function(ve,K,_e,te){te===void 0&&(te={}),"passive"in te&&h?ve.removeEventListener(K,_e,te):ve.removeEventListener(K,_e,te.capture)};var m=function(ve){ve.preventDefault(),ve.stopPropagation(),e.window.removeEventListener("click",m,!0)};r.suppressClick=function(){e.window.addEventListener("click",m,!0),e.window.setTimeout(function(){e.window.removeEventListener("click",m,!0)},0)},r.mousePos=function(ve,K){var _e=ve.getBoundingClientRect();return new e.Point(K.clientX-_e.left-ve.clientLeft,K.clientY-_e.top-ve.clientTop)},r.touchPos=function(ve,K){for(var _e=ve.getBoundingClientRect(),te=[],me=0;me<K.length;me++)te.push(new e.Point(K[me].clientX-_e.left-ve.clientLeft,K[me].clientY-_e.top-ve.clientTop));return te},r.mouseButton=function(ve){return typeof e.window.InstallTrigger<"u"&&ve.button===2&&ve.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:ve.button},r.remove=function(ve){ve.parentNode&&ve.parentNode.removeChild(ve)};function p(ve,K,_e){var te,me,Ge,Le=e.browser.devicePixelRatio>1?"@2x":"",$e=e.getJSON(K.transformRequest(K.normalizeSpriteURL(ve,Le,".json"),e.ResourceType.SpriteJSON),function(wr,Nr){$e=null,Ge||(Ge=wr,te=Nr,jt())}),gt=e.getImage(K.transformRequest(K.normalizeSpriteURL(ve,Le,".png"),e.ResourceType.SpriteImage),function(wr,Nr){gt=null,Ge||(Ge=wr,me=Nr,jt())});function jt(){if(Ge)_e(Ge);else if(te&&me){var wr=e.browser.getImageData(me),Nr={};for(var pr in te){var yt=te[pr],kt=yt.width,Bt=yt.height,nr=yt.x,hr=yt.y,lr=yt.sdf,dr=yt.pixelRatio,ur=yt.stretchX,Ht=yt.stretchY,sr=yt.content,Vt=new e.RGBAImage({width:kt,height:Bt});e.RGBAImage.copy(wr,Vt,{x:nr,y:hr},{x:0,y:0},{width:kt,height:Bt}),Nr[pr]={data:Vt,pixelRatio:dr,sdf:lr,stretchX:ur,stretchY:Ht,content:sr}}_e(null,Nr)}}return{cancel:function(){$e&&($e.cancel(),$e=null),gt&&(gt.cancel(),gt=null)}}}function T(ve){var K=ve.userImage;if(K&&K.render){var _e=K.render();if(_e)return ve.data.replace(new Uint8Array(K.data.buffer)),!0}return!1}var l=1,_=function(ve){function K(){ve.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.isLoaded=function(){return this.loaded},K.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var me=0,Ge=this.requestors;me<Ge.length;me+=1){var Le=Ge[me],$e=Le.ids,gt=Le.callback;this._notify($e,gt)}this.requestors=[]}},K.prototype.getImage=function(te){return this.images[te]},K.prototype.addImage=function(te,me){this._validate(te,me)&&(this.images[te]=me)},K.prototype._validate=function(te,me){var Ge=!0;return this._validateStretch(me.stretchX,me.data&&me.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchX" value'))),Ge=!1),this._validateStretch(me.stretchY,me.data&&me.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchY" value'))),Ge=!1),this._validateContent(me.content,me)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "content" value'))),Ge=!1),Ge},K.prototype._validateStretch=function(te,me){if(!te)return!0;for(var Ge=0,Le=0,$e=te;Le<$e.length;Le+=1){var gt=$e[Le];if(gt[0]<Ge||gt[1]<gt[0]||me<gt[1])return!1;Ge=gt[1]}return!0},K.prototype._validateContent=function(te,me){return te?!(te.length!==4||te[0]<0||me.data.width<te[0]||te[1]<0||me.data.height<te[1]||te[2]<0||me.data.width<te[2]||te[3]<0||me.data.height<te[3]||te[2]<te[0]||te[3]<te[1]):!0},K.prototype.updateImage=function(te,me){var Ge=this.images[te];me.version=Ge.version+1,this.images[te]=me,this.updatedImages[te]=!0},K.prototype.removeImage=function(te){var me=this.images[te];delete this.images[te],delete this.patterns[te],me.userImage&&me.userImage.onRemove&&me.userImage.onRemove()},K.prototype.listImages=function(){return Object.keys(this.images)},K.prototype.getImages=function(te,me){var Ge=!0;if(!this.isLoaded())for(var Le=0,$e=te;Le<$e.length;Le+=1){var gt=$e[Le];this.images[gt]||(Ge=!1)}this.isLoaded()||Ge?this._notify(te,me):this.requestors.push({ids:te,callback:me})},K.prototype._notify=function(te,me){for(var Ge={},Le=0,$e=te;Le<$e.length;Le+=1){var gt=$e[Le];this.images[gt]||this.fire(new e.Event("styleimagemissing",{id:gt}));var jt=this.images[gt];jt?Ge[gt]={data:jt.data.clone(),pixelRatio:jt.pixelRatio,sdf:jt.sdf,version:jt.version,stretchX:jt.stretchX,stretchY:jt.stretchY,content:jt.content,hasRenderCallback:!!(jt.userImage&&jt.userImage.render)}:e.warnOnce('Image "'+gt+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}me(null,Ge)},K.prototype.getPixelSize=function(){var te=this.atlasImage,me=te.width,Ge=te.height;return{width:me,height:Ge}},K.prototype.getPattern=function(te){var me=this.patterns[te],Ge=this.getImage(te);if(!Ge)return null;if(me&&me.position.version===Ge.version)return me.position;if(me)me.position.version=Ge.version;else{var Le=Ge.data.width+l*2,$e=Ge.data.height+l*2,gt={w:Le,h:$e,x:0,y:0},jt=new e.ImagePosition(gt,Ge);this.patterns[te]={bin:gt,position:jt}}return this._updatePatternAtlas(),this.patterns[te].position},K.prototype.bind=function(te){var me=te.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(te,this.atlasImage,me.RGBA),this.atlasTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE)},K.prototype._updatePatternAtlas=function(){var te=[];for(var me in this.patterns)te.push(this.patterns[me].bin);var Ge=e.potpack(te),Le=Ge.w,$e=Ge.h,gt=this.atlasImage;gt.resize({width:Le||1,height:$e||1});for(var jt in this.patterns){var wr=this.patterns[jt],Nr=wr.bin,pr=Nr.x+l,yt=Nr.y+l,kt=this.images[jt].data,Bt=kt.width,nr=kt.height;e.RGBAImage.copy(kt,gt,{x:0,y:0},{x:pr,y:yt},{width:Bt,height:nr}),e.RGBAImage.copy(kt,gt,{x:0,y:nr-1},{x:pr,y:yt-1},{width:Bt,height:1}),e.RGBAImage.copy(kt,gt,{x:0,y:0},{x:pr,y:yt+nr},{width:Bt,height:1}),e.RGBAImage.copy(kt,gt,{x:Bt-1,y:0},{x:pr-1,y:yt},{width:1,height:nr}),e.RGBAImage.copy(kt,gt,{x:0,y:0},{x:pr+Bt,y:yt},{width:1,height:nr})}this.dirty=!0},K.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},K.prototype.dispatchRenderCallbacks=function(te){for(var me=0,Ge=te;me<Ge.length;me+=1){var Le=Ge[me];if(!this.callbackDispatchedThisFrame[Le]){this.callbackDispatchedThisFrame[Le]=!0;var $e=this.images[Le],gt=T($e);gt&&this.updateImage(Le,$e)}}},K}(e.Evented);function w(ve,K,_e,te,me){var Ge=K*256,Le=Ge+255,$e=te.transformRequest(te.normalizeGlyphsURL(_e).replace("{fontstack}",ve).replace("{range}",Ge+"-"+Le),e.ResourceType.Glyphs);e.getArrayBuffer($e,function(gt,jt){if(gt)me(gt);else if(jt){for(var wr={},Nr=0,pr=e.parseGlyphPBF(jt);Nr<pr.length;Nr+=1){var yt=pr[Nr];wr[yt.id]=yt}me(null,wr)}})}var A=b,M=b,g=1e20;function b(ve,K,_e,te,me,Ge){this.fontSize=ve||24,this.buffer=K===void 0?3:K,this.cutoff=te||.25,this.fontFamily=me||"sans-serif",this.fontWeight=Ge||"normal",this.radius=_e||8;var Le=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Le,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Le*Le),this.gridInner=new Float64Array(Le*Le),this.f=new Float64Array(Le),this.d=new Float64Array(Le),this.z=new Float64Array(Le+1),this.v=new Int16Array(Le),this.middle=Math.round(Le/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}b.prototype.draw=function(ve){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ve,this.buffer,this.middle);for(var K=this.ctx.getImageData(0,0,this.size,this.size),_e=new Uint8ClampedArray(this.size*this.size),te=0;te<this.size*this.size;te++){var me=K.data[te*4+3]/255;this.gridOuter[te]=me===1?0:me===0?g:Math.pow(Math.max(0,.5-me),2),this.gridInner[te]=me===1?g:me===0?0:Math.pow(Math.max(0,me-.5),2)}for(d(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),d(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),te=0;te<this.size*this.size;te++){var Ge=this.gridOuter[te]-this.gridInner[te];_e[te]=Math.max(0,Math.min(255,Math.round(255-255*(Ge/this.radius+this.cutoff))))}return _e};function d(ve,K,_e,te,me,Ge,Le){for(var $e=0;$e<K;$e++){for(var gt=0;gt<_e;gt++)te[gt]=ve[gt*K+$e];for(u(te,me,Ge,Le,_e),gt=0;gt<_e;gt++)ve[gt*K+$e]=me[gt]}for(gt=0;gt<_e;gt++){for($e=0;$e<K;$e++)te[$e]=ve[gt*K+$e];for(u(te,me,Ge,Le,K),$e=0;$e<K;$e++)ve[gt*K+$e]=Math.sqrt(me[$e])}}function u(ve,K,_e,te,me){_e[0]=0,te[0]=-g,te[1]=+g;for(var Ge=1,Le=0;Ge<me;Ge++){for(var $e=(ve[Ge]+Ge*Ge-(ve[_e[Le]]+_e[Le]*_e[Le]))/(2*Ge-2*_e[Le]);$e<=te[Le];)Le--,$e=(ve[Ge]+Ge*Ge-(ve[_e[Le]]+_e[Le]*_e[Le]))/(2*Ge-2*_e[Le]);Le++,_e[Le]=Ge,te[Le]=$e,te[Le+1]=+g}for(Ge=0,Le=0;Ge<me;Ge++){for(;te[Le+1]<Ge;)Le++;K[Ge]=(Ge-_e[Le])*(Ge-_e[Le])+ve[_e[Le]]}}A.default=M;var y=function(K,_e){this.requestManager=K,this.localIdeographFontFamily=_e,this.entries={}};y.prototype.setURL=function(K){this.url=K},y.prototype.getGlyphs=function(K,_e){var te=this,me=[];for(var Ge in K)for(var Le=0,$e=K[Ge];Le<$e.length;Le+=1){var gt=$e[Le];me.push({stack:Ge,id:gt})}e.asyncAll(me,function(jt,wr){var Nr=jt.stack,pr=jt.id,yt=te.entries[Nr];yt||(yt=te.entries[Nr]={glyphs:{},requests:{},ranges:{}});var kt=yt.glyphs[pr];if(kt!==void 0){wr(null,{stack:Nr,id:pr,glyph:kt});return}if(kt=te._tinySDF(yt,Nr,pr),kt){yt.glyphs[pr]=kt,wr(null,{stack:Nr,id:pr,glyph:kt});return}var Bt=Math.floor(pr/256);if(Bt*256>65535){wr(new Error("glyphs > 65535 not supported"));return}if(yt.ranges[Bt]){wr(null,{stack:Nr,id:pr,glyph:kt});return}var nr=yt.requests[Bt];nr||(nr=yt.requests[Bt]=[],y.loadGlyphRange(Nr,Bt,te.url,te.requestManager,function(hr,lr){if(lr){for(var dr in lr)te._doesCharSupportLocalGlyph(+dr)||(yt.glyphs[+dr]=lr[+dr]);yt.ranges[Bt]=!0}for(var ur=0,Ht=nr;ur<Ht.length;ur+=1){var sr=Ht[ur];sr(hr,lr)}delete yt.requests[Bt]})),nr.push(function(hr,lr){hr?wr(hr):lr&&wr(null,{stack:Nr,id:pr,glyph:lr[pr]||null})})},function(jt,wr){if(jt)_e(jt);else if(wr){for(var Nr={},pr=0,yt=wr;pr<yt.length;pr+=1){var kt=yt[pr],Bt=kt.stack,nr=kt.id,hr=kt.glyph;(Nr[Bt]||(Nr[Bt]={}))[nr]=hr&&{id:hr.id,bitmap:hr.bitmap.clone(),metrics:hr.metrics}}_e(null,Nr)}})},y.prototype._doesCharSupportLocalGlyph=function(K){return!!this.localIdeographFontFamily&&(e.isChar["CJK Unified Ideographs"](K)||e.isChar["Hangul Syllables"](K)||e.isChar.Hiragana(K)||e.isChar.Katakana(K))},y.prototype._tinySDF=function(K,_e,te){var me=this.localIdeographFontFamily;if(me&&this._doesCharSupportLocalGlyph(te)){var Ge=K.tinySDF;if(!Ge){var Le="400";/bold/i.test(_e)?Le="900":/medium/i.test(_e)?Le="500":/light/i.test(_e)&&(Le="200"),Ge=K.tinySDF=new y.TinySDF(24,3,8,.25,me,Le)}return{id:te,bitmap:new e.AlphaImage({width:30,height:30},Ge.draw(String.fromCharCode(te))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=w,y.TinySDF=A;var f=function(){this.specification=e.styleSpec.light.position};f.prototype.possiblyEvaluate=function(K,_e){return e.sphericalToCartesian(K.expression.evaluate(_e))},f.prototype.interpolate=function(K,_e,te){return{x:e.number(K.x,_e.x,te),y:e.number(K.y,_e.y,te),z:e.number(K.z,_e.z,te)}};var R=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new f,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),L="-transition",z=function(ve){function K(_e){ve.call(this),this._transitionable=new e.Transitionable(R),this.setLight(_e),this._transitioning=this._transitionable.untransitioned()}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getLight=function(){return this._transitionable.serialize()},K.prototype.setLight=function(te,me){if(me===void 0&&(me={}),!this._validate(e.validateLight,te,me))for(var Ge in te){var Le=te[Ge];e.endsWith(Ge,L)?this._transitionable.setTransition(Ge.slice(0,-L.length),Le):this._transitionable.setValue(Ge,Le)}},K.prototype.updateTransitions=function(te){this._transitioning=this._transitionable.transitioned(te,this._transitioning)},K.prototype.hasTransition=function(){return this._transitioning.hasTransition()},K.prototype.recalculate=function(te){this.properties=this._transitioning.possiblyEvaluate(te)},K.prototype._validate=function(te,me,Ge){return Ge&&Ge.validate===!1?!1:e.emitValidationErrors(this,te.call(e.validateStyle,e.extend({value:me,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},K}(e.Evented),F=function(K,_e){this.width=K,this.height=_e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};F.prototype.getDash=function(K,_e){var te=K.join(",")+String(_e);return this.dashEntry[te]||(this.dashEntry[te]=this.addDash(K,_e)),this.dashEntry[te]},F.prototype.getDashRanges=function(K,_e,te){var me=K.length%2===1,Ge=[],Le=me?-K[K.length-1]*te:0,$e=K[0]*te,gt=!0;Ge.push({left:Le,right:$e,isDash:gt,zeroLength:K[0]===0});for(var jt=K[0],wr=1;wr<K.length;wr++){gt=!gt;var Nr=K[wr];Le=jt*te,jt+=Nr,$e=jt*te,Ge.push({left:Le,right:$e,isDash:gt,zeroLength:Nr===0})}return Ge},F.prototype.addRoundDash=function(K,_e,te){for(var me=_e/2,Ge=-te;Ge<=te;Ge++)for(var Le=this.nextRow+te+Ge,$e=this.width*Le,gt=0,jt=K[gt],wr=0;wr<this.width;wr++){wr/jt.right>1&&(jt=K[++gt]);var Nr=Math.abs(wr-jt.left),pr=Math.abs(wr-jt.right),yt=Math.min(Nr,pr),kt=void 0,Bt=Ge/te*(me+1);if(jt.isDash){var nr=me-Math.abs(Bt);kt=Math.sqrt(yt*yt+nr*nr)}else kt=me-Math.sqrt(yt*yt+Bt*Bt);this.data[$e+wr]=Math.max(0,Math.min(255,kt+128))}},F.prototype.addRegularDash=function(K){for(var _e=K.length-1;_e>=0;--_e){var te=K[_e],me=K[_e+1];te.zeroLength?K.splice(_e,1):me&&me.isDash===te.isDash&&(me.left=te.left,K.splice(_e,1))}var Ge=K[0],Le=K[K.length-1];Ge.isDash===Le.isDash&&(Ge.left=Le.left-this.width,Le.right=Ge.right+this.width);for(var $e=this.width*this.nextRow,gt=0,jt=K[gt],wr=0;wr<this.width;wr++){wr/jt.right>1&&(jt=K[++gt]);var Nr=Math.abs(wr-jt.left),pr=Math.abs(wr-jt.right),yt=Math.min(Nr,pr),kt=jt.isDash?yt:-yt;this.data[$e+wr]=Math.max(0,Math.min(255,kt+128))}},F.prototype.addDash=function(K,_e){var te=_e?7:0,me=2*te+1;if(this.nextRow+me>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ge=0,Le=0;Le<K.length;Le++)Ge+=K[Le];if(Ge!==0){var $e=this.width/Ge,gt=this.getDashRanges(K,this.width,$e);_e?this.addRoundDash(gt,$e,te):this.addRegularDash(gt)}var jt={y:(this.nextRow+te+.5)/this.height,height:2*te/this.height,width:Ge};return this.nextRow+=me,this.dirty=!0,jt},F.prototype.bind=function(K){var _e=K.gl;this.texture?(_e.bindTexture(_e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,_e.texSubImage2D(_e.TEXTURE_2D,0,0,0,this.width,this.height,_e.ALPHA,_e.UNSIGNED_BYTE,this.data))):(this.texture=_e.createTexture(),_e.bindTexture(_e.TEXTURE_2D,this.texture),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_WRAP_S,_e.REPEAT),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_WRAP_T,_e.REPEAT),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_MIN_FILTER,_e.LINEAR),_e.texParameteri(_e.TEXTURE_2D,_e.TEXTURE_MAG_FILTER,_e.LINEAR),_e.texImage2D(_e.TEXTURE_2D,0,_e.ALPHA,this.width,this.height,0,_e.ALPHA,_e.UNSIGNED_BYTE,this.data))};var N=function ve(K,_e){this.workerPool=K,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var te=this.workerPool.acquire(this.id),me=0;me<te.length;me++){var Ge=te[me],Le=new ve.Actor(Ge,_e,this.id);Le.name="Worker "+me,this.actors.push(Le)}};N.prototype.broadcast=function(K,_e,te){te=te||function(){},e.asyncAll(this.actors,function(me,Ge){me.send(K,_e,Ge)},te)},N.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},N.prototype.remove=function(){this.actors.forEach(function(K){K.remove()}),this.actors=[],this.workerPool.release(this.id)},N.Actor=e.Actor;function O(ve,K,_e){var te=function(me,Ge){if(me)return _e(me);if(Ge){var Le=e.pick(e.extend(Ge,ve),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);Ge.vector_layers&&(Le.vectorLayers=Ge.vector_layers,Le.vectorLayerIds=Le.vectorLayers.map(function($e){return $e.id})),Le.tiles=K.canonicalizeTileset(Le,ve.url),_e(null,Le)}};return ve.url?e.getJSON(K.transformRequest(K.normalizeSourceURL(ve.url),e.ResourceType.Source),te):e.browser.frame(function(){return te(null,ve)})}var P=function(K,_e,te){this.bounds=e.LngLatBounds.convert(this.validateBounds(K)),this.minzoom=_e||0,this.maxzoom=te||24};P.prototype.validateBounds=function(K){return!Array.isArray(K)||K.length!==4?[-180,-90,180,90]:[Math.max(-180,K[0]),Math.max(-90,K[1]),Math.min(180,K[2]),Math.min(90,K[3])]},P.prototype.contains=function(K){var _e=Math.pow(2,K.z),te={minX:Math.floor(e.mercatorXfromLng(this.bounds.getWest())*_e),minY:Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*_e),maxX:Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*_e),maxY:Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*_e)},me=K.x>=te.minX&&K.x<te.maxX&&K.y>=te.minY&&K.y<te.maxY;return me};var U=function(ve){function K(_e,te,me,Ge){if(ve.call(this),this.id=_e,this.dispatcher=me,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(te,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},te),this._collectResourceTiming=te.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Ge)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(this._options,this.map._requestManager,function(me,Ge){te._tileJSONRequest=null,te._loaded=!0,me?te.fire(new e.ErrorEvent(me)):Ge&&(e.extend(te,Ge),Ge.bounds&&(te.tileBounds=new P(Ge.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(Ge.tiles,te.map._requestManager._customAccessToken),e.postMapLoadEvent(Ge.tiles,te.map._getMapId(),te.map._requestManager._skuToken,te.map._requestManager._customAccessToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},K.prototype.loaded=function(){return this._loaded},K.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setSourceProperty=function(te){this._tileJSONRequest&&this._tileJSONRequest.cancel(),te();var me=this.map.style.sourceCaches[this.id];me.clearTiles(),this.load()},K.prototype.setTiles=function(te){var me=this;return this.setSourceProperty(function(){me._options.tiles=te}),this},K.prototype.setUrl=function(te){var me=this;return this.setSourceProperty(function(){me.url=te,me._options.url=te}),this},K.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},K.prototype.serialize=function(){return e.extend({},this._options)},K.prototype.loadTile=function(te,me){var Ge=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme)),Le={request:this.map._requestManager.transformRequest(Ge,e.ResourceType.Tile),uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,tileSize:this.tileSize*te.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Le.request.collectResourceTiming=this._collectResourceTiming,!te.actor||te.state==="expired"?(te.actor=this.dispatcher.getActor(),te.request=te.actor.send("loadTile",Le,$e.bind(this))):te.state==="loading"?te.reloadCallback=me:te.request=te.actor.send("reloadTile",Le,$e.bind(this));function $e(gt,jt){if(delete te.request,te.aborted)return me(null);if(gt&>.status!==404)return me(gt);jt&&jt.resourceTiming&&(te.resourceTiming=jt.resourceTiming),this.map._refreshExpiredTiles&&jt&&te.setExpiryData(jt),te.loadVectorData(jt,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),me(null),te.reloadCallback&&(this.loadTile(te,te.reloadCallback),te.reloadCallback=null)}},K.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.actor&&te.actor.send("abortTile",{uid:te.uid,type:this.type,source:this.id},void 0)},K.prototype.unloadTile=function(te){te.unloadVectorData(),te.actor&&te.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id},void 0)},K.prototype.hasTransition=function(){return!1},K}(e.Evented),B=function(ve){function K(_e,te,me,Ge){ve.call(this),this.id=_e,this.dispatcher=me,this.setEventedParent(Ge),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},te),e.extend(this,e.pick(te,["url","scheme","tileSize"]))}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(this._options,this.map._requestManager,function(me,Ge){te._tileJSONRequest=null,te._loaded=!0,me?te.fire(new e.ErrorEvent(me)):Ge&&(e.extend(te,Ge),Ge.bounds&&(te.tileBounds=new P(Ge.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(Ge.tiles),e.postMapLoadEvent(Ge.tiles,te.map._getMapId(),te.map._requestManager._skuToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},K.prototype.loaded=function(){return this._loaded},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},K.prototype.serialize=function(){return e.extend({},this._options)},K.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},K.prototype.loadTile=function(te,me){var Ge=this,Le=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(Le,e.ResourceType.Tile),function($e,gt){if(delete te.request,te.aborted)te.state="unloaded",me(null);else if($e)te.state="errored",me($e);else if(gt){Ge.map._refreshExpiredTiles&&te.setExpiryData(gt),delete gt.cacheControl,delete gt.expires;var jt=Ge.map.painter.context,wr=jt.gl;te.texture=Ge.map.painter.getTileTexture(gt.width),te.texture?te.texture.update(gt,{useMipmap:!0}):(te.texture=new e.Texture(jt,gt,wr.RGBA,{useMipmap:!0}),te.texture.bind(wr.LINEAR,wr.CLAMP_TO_EDGE,wr.LINEAR_MIPMAP_NEAREST),jt.extTextureFilterAnisotropic&&wr.texParameterf(wr.TEXTURE_2D,jt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,jt.extTextureFilterAnisotropicMax)),te.state="loaded",e.cacheEntryPossiblyAdded(Ge.dispatcher),me(null)}})},K.prototype.abortTile=function(te,me){te.request&&(te.request.cancel(),delete te.request),me()},K.prototype.unloadTile=function(te,me){te.texture&&this.map.painter.saveTileTexture(te.texture),me()},K.prototype.hasTransition=function(){return!1},K}(e.Evented),X=function(ve){function K(_e,te,me,Ge){ve.call(this,_e,te,me,Ge),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},te),this.encoding=te.encoding||"mapbox"}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},K.prototype.loadTile=function(te,me){var Ge=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(Ge,e.ResourceType.Tile),Le.bind(this)),te.neighboringTiles=this._getNeighboringTiles(te.tileID);function Le(gt,jt){if(delete te.request,te.aborted)te.state="unloaded",me(null);else if(gt)te.state="errored",me(gt);else if(jt){this.map._refreshExpiredTiles&&te.setExpiryData(jt),delete jt.cacheControl,delete jt.expires;var wr=e.window.ImageBitmap&&jt instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported(),Nr=wr?jt:e.browser.getImageData(jt,1),pr={uid:te.uid,coord:te.tileID,source:this.id,rawImageData:Nr,encoding:this.encoding};(!te.actor||te.state==="expired")&&(te.actor=this.dispatcher.getActor(),te.actor.send("loadDEMTile",pr,$e.bind(this)))}}function $e(gt,jt){gt&&(te.state="errored",me(gt)),jt&&(te.dem=jt,te.needsHillshadePrepare=!0,te.state="loaded",me(null))}},K.prototype._getNeighboringTiles=function(te){var me=te.canonical,Ge=Math.pow(2,me.z),Le=(me.x-1+Ge)%Ge,$e=me.x===0?te.wrap-1:te.wrap,gt=(me.x+1+Ge)%Ge,jt=me.x+1===Ge?te.wrap+1:te.wrap,wr={};return wr[new e.OverscaledTileID(te.overscaledZ,$e,me.z,Le,me.y).key]={backfilled:!1},wr[new e.OverscaledTileID(te.overscaledZ,jt,me.z,gt,me.y).key]={backfilled:!1},me.y>0&&(wr[new e.OverscaledTileID(te.overscaledZ,$e,me.z,Le,me.y-1).key]={backfilled:!1},wr[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y-1).key]={backfilled:!1},wr[new e.OverscaledTileID(te.overscaledZ,jt,me.z,gt,me.y-1).key]={backfilled:!1}),me.y+1<Ge&&(wr[new e.OverscaledTileID(te.overscaledZ,$e,me.z,Le,me.y+1).key]={backfilled:!1},wr[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y+1).key]={backfilled:!1},wr[new e.OverscaledTileID(te.overscaledZ,jt,me.z,gt,me.y+1).key]={backfilled:!1}),wr},K.prototype.unloadTile=function(te){te.demTexture&&this.map.painter.saveTileTexture(te.demTexture),te.fbo&&(te.fbo.destroy(),delete te.fbo),te.dem&&delete te.dem,delete te.neighboringTiles,te.state="unloaded",te.actor&&te.actor.send("removeDEMTile",{uid:te.uid,source:this.id})},K}(B),$=function(ve){function K(_e,te,me,Ge){ve.call(this),this.id=_e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=me.getActor(),this.setEventedParent(Ge),this._data=te.data,this._options=e.extend({},te),this._collectResourceTiming=te.collectResourceTiming,this._resourceTiming=[],te.maxzoom!==void 0&&(this.maxzoom=te.maxzoom),te.type&&(this.type=te.type),te.attribution&&(this.attribution=te.attribution),this.promoteId=te.promoteId;var Le=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:te.cluster||!1,geojsonVtOptions:{buffer:(te.buffer!==void 0?te.buffer:128)*Le,tolerance:(te.tolerance!==void 0?te.tolerance:.375)*Le,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:te.lineMetrics||!1,generateId:te.generateId||!1},superclusterOptions:{maxZoom:te.clusterMaxZoom!==void 0?Math.min(te.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,te.clusterMinPoints||2),extent:e.EXTENT,radius:(te.clusterRadius||50)*Le,log:!1,generateId:te.generateId||!1},clusterProperties:te.clusterProperties,filter:te.filter},te.workerOptions)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(me){if(me){te.fire(new e.ErrorEvent(me));return}var Ge={dataType:"source",sourceDataType:"metadata"};te._collectResourceTiming&&te._resourceTiming&&te._resourceTiming.length>0&&(Ge.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ge))})},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setData=function(te){var me=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ge){if(Ge){me.fire(new e.ErrorEvent(Ge));return}var Le={dataType:"source",sourceDataType:"content"};me._collectResourceTiming&&me._resourceTiming&&me._resourceTiming.length>0&&(Le.resourceTiming=me._resourceTiming,me._resourceTiming=[]),me.fire(new e.Event("data",Le))}),this},K.prototype.getClusterExpansionZoom=function(te,me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},me),this},K.prototype.getClusterChildren=function(te,me){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},me),this},K.prototype.getClusterLeaves=function(te,me,Ge,Le){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:me,offset:Ge},Le),this},K.prototype._updateWorkerData=function(te){var me=this;this._loaded=!1;var Ge=e.extend({},this.workerOptions),Le=this._data;typeof Le=="string"?(Ge.request=this.map._requestManager.transformRequest(e.browser.resolveURL(Le),e.ResourceType.Source),Ge.request.collectResourceTiming=this._collectResourceTiming):Ge.data=JSON.stringify(Le),this.actor.send(this.type+".loadData",Ge,function($e,gt){me._removed||gt&>.abandoned||(me._loaded=!0,gt&>.resourceTiming&>.resourceTiming[me.id]&&(me._resourceTiming=gt.resourceTiming[me.id].slice(0)),me.actor.send(me.type+".coalesce",{source:Ge.source},null),te($e))})},K.prototype.loaded=function(){return this._loaded},K.prototype.loadTile=function(te,me){var Ge=this,Le=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var $e={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(Le,$e,function(gt,jt){return delete te.request,te.unloadVectorData(),te.aborted?me(null):gt?me(gt):(te.loadVectorData(jt,Ge.map.painter,Le==="reloadTile"),me(null))})},K.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},K.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},K.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},K.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},K.prototype.hasTransition=function(){return!1},K}(e.Evented),se=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=function(ve){function K(_e,te,me,Ge){ve.call(this),this.id=_e,this.dispatcher=me,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ge),this.options=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(te,me){var Ge=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(Le,$e){Ge._loaded=!0,Le?Ge.fire(new e.ErrorEvent(Le)):$e&&(Ge.image=$e,te&&(Ge.coordinates=te),me&&me(),Ge._finishLoading())})},K.prototype.loaded=function(){return this._loaded},K.prototype.updateImage=function(te){var me=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){me.texture=null}),this)},K.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},K.prototype.onAdd=function(te){this.map=te,this.load()},K.prototype.setCoordinates=function(te){var me=this;this.coordinates=te;var Ge=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=fe(Ge),this.minzoom=this.maxzoom=this.tileID.z;var Le=Ge.map(function($e){return me.tileID.getTilePoint($e)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(Le[0].x,Le[0].y,0,0),this._boundsArray.emplaceBack(Le[1].x,Le[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(Le[3].x,Le[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(Le[2].x,Le[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ge in this.tiles){var Le=this.tiles[Ge];Le.state!=="loaded"&&(Le.state="loaded",Le.texture=this.texture)}}},K.prototype.loadTile=function(te,me){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},me(null)):(te.state="errored",me(null))},K.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return!1},K}(e.Evented);function fe(ve){for(var K=1/0,_e=1/0,te=-1/0,me=-1/0,Ge=0,Le=ve;Ge<Le.length;Ge+=1){var $e=Le[Ge];K=Math.min(K,$e.x),_e=Math.min(_e,$e.y),te=Math.max(te,$e.x),me=Math.max(me,$e.y)}var gt=te-K,jt=me-_e,wr=Math.max(gt,jt),Nr=Math.max(0,Math.floor(-Math.log(wr)/Math.LN2)),pr=Math.pow(2,Nr);return new e.CanonicalTileID(Nr,Math.floor((K+te)/2*pr),Math.floor((_e+me)/2*pr))}var V=function(ve){function K(_e,te,me,Ge){ve.call(this,_e,te,me,Ge),this.roundZoom=!0,this.type="video",this.options=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){var te=this;this._loaded=!1;var me=this.options;this.urls=[];for(var Ge=0,Le=me.urls;Ge<Le.length;Ge+=1){var $e=Le[Ge];this.urls.push(this.map._requestManager.transformRequest($e,e.ResourceType.Source).url)}e.getVideo(this.urls,function(gt,jt){te._loaded=!0,gt?te.fire(new e.ErrorEvent(gt)):jt&&(te.video=jt,te.video.loop=!0,te.video.addEventListener("playing",function(){te.map.triggerRepaint()}),te.map&&te.video.play(),te._finishLoading())})},K.prototype.pause=function(){this.video&&this.video.pause()},K.prototype.play=function(){this.video&&this.video.play()},K.prototype.seek=function(te){if(this.video){var me=this.video.seekable;te<me.start(0)||te>me.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+me.start(0)+" and "+me.end(0)+"-second mark."))):this.video.currentTime=te}},K.prototype.getVideo=function(){return this.video},K.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},K.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.texSubImage2D(me.TEXTURE_2D,0,0,0,me.RGBA,me.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ge in this.tiles){var Le=this.tiles[Ge];Le.state!=="loaded"&&(Le.state="loaded",Le.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this.video&&!this.video.paused},K}(le),Y=function(ve){function K(_e,te,me,Ge){ve.call(this,_e,te,me,Ge),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(Le){return!Array.isArray(Le)||Le.length!==2||Le.some(function($e){return typeof $e!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+_e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+_e,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+_e,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+_e,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+_e,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},K.prototype.getCanvas=function(){return this.canvas},K.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},K.prototype.onRemove=function(){this.pause()},K.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var me=this.map.painter.context,Ge=me.gl;this.boundsBuffer||(this.boundsBuffer=me.createVertexBuffer(this._boundsArray,se.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(me,this.canvas,Ge.RGBA,{premultiply:!0});for(var Le in this.tiles){var $e=this.tiles[Le];$e.state!=="loaded"&&($e.state="loaded",$e.texture=this.texture)}}},K.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},K.prototype.hasTransition=function(){return this._playing},K.prototype._hasInvalidDimensions=function(){for(var te=0,me=[this.canvas.width,this.canvas.height];te<me.length;te+=1){var Ge=me[te];if(isNaN(Ge)||Ge<=0)return!0}return!1},K}(le),ee={vector:U,raster:B,"raster-dem":X,geojson:$,video:V,image:le,canvas:Y},q=function(ve,K,_e,te){var me=new ee[K.type](ve,K,_e,te);if(me.id!==ve)throw new Error("Expected Source id to be "+ve+" instead of "+me.id);return e.bindAll(["load","abort","unload","serialize","prepare"],me),me},oe=function(ve){return ee[ve]},ae=function(ve,K){ee[ve]=K};function j(ve,K){var _e=e.identity([]);return e.translate(_e,_e,[1,1,0]),e.scale(_e,_e,[ve.width*.5,ve.height*.5,1]),e.multiply(_e,_e,ve.calculatePosMatrix(K.toUnwrapped()))}function Q(ve,K,_e){if(ve)for(var te=0,me=ve;te<me.length;te+=1){var Ge=me[te],Le=K[Ge];if(Le&&Le.source===_e&&Le.type==="fill-extrusion")return!0}else for(var $e in K){var gt=K[$e];if(gt.source===_e&>.type==="fill-extrusion")return!0}return!1}function re(ve,K,_e,te,me,Ge){var Le=Q(me&&me.layers,K,ve.id),$e=Ge.maxPitchScaleFactor(),gt=ve.tilesIn(te,$e,Le);gt.sort(Ae);for(var jt=[],wr=0,Nr=gt;wr<Nr.length;wr+=1){var pr=Nr[wr];jt.push({wrappedTileID:pr.tileID.wrapped().key,queryResults:pr.tile.queryRenderedFeatures(K,_e,ve._state,pr.queryGeometry,pr.cameraQueryGeometry,pr.scale,me,Ge,$e,j(ve.transform,pr.tileID))})}var yt=De(jt);for(var kt in yt)yt[kt].forEach(function(Bt){var nr=Bt.feature,hr=ve.getFeatureState(nr.layer["source-layer"],nr.id);nr.source=nr.layer.source,nr.layer["source-layer"]&&(nr.sourceLayer=nr.layer["source-layer"]),nr.state=hr});return yt}function ce(ve,K,_e,te,me,Ge,Le){for(var $e={},gt=Ge.queryRenderedSymbols(te),jt=[],wr=0,Nr=Object.keys(gt).map(Number);wr<Nr.length;wr+=1){var pr=Nr[wr];jt.push(Le[pr])}jt.sort(Ae);for(var yt=function(){var lr=Bt[kt],dr=lr.featureIndex.lookupSymbolFeatures(gt[lr.bucketInstanceId],K,lr.bucketIndex,lr.sourceLayerIndex,me.filter,me.layers,me.availableImages,ve);for(var ur in dr){var Ht=$e[ur]=$e[ur]||[],sr=dr[ur];sr.sort(function(ga,vi){var Ga=lr.featureSortOrder;if(Ga){var ai=Ga.indexOf(ga.featureIndex),Zi=Ga.indexOf(vi.featureIndex);return Zi-ai}else return vi.featureIndex-ga.featureIndex});for(var Vt=0,Dr=sr;Vt<Dr.length;Vt+=1){var Jr=Dr[Vt];Ht.push(Jr)}}},kt=0,Bt=jt;kt<Bt.length;kt+=1)yt();var nr=function(lr){$e[lr].forEach(function(dr){var ur=dr.feature,Ht=ve[lr],sr=_e[Ht.source],Vt=sr.getFeatureState(ur.layer["source-layer"],ur.id);ur.source=ur.layer.source,ur.layer["source-layer"]&&(ur.sourceLayer=ur.layer["source-layer"]),ur.state=Vt})};for(var hr in $e)nr(hr);return $e}function be(ve,K){for(var _e=ve.getRenderableIds().map(function(gt){return ve.getTileByID(gt)}),te=[],me={},Ge=0;Ge<_e.length;Ge++){var Le=_e[Ge],$e=Le.tileID.canonical.key;me[$e]||(me[$e]=!0,Le.querySourceFeatures(te,K))}return te}function Ae(ve,K){var _e=ve.tileID,te=K.tileID;return _e.overscaledZ-te.overscaledZ||_e.canonical.y-te.canonical.y||_e.wrap-te.wrap||_e.canonical.x-te.canonical.x}function De(ve){for(var K={},_e={},te=0,me=ve;te<me.length;te+=1){var Ge=me[te],Le=Ge.queryResults,$e=Ge.wrappedTileID,gt=_e[$e]=_e[$e]||{};for(var jt in Le)for(var wr=Le[jt],Nr=gt[jt]=gt[jt]||{},pr=K[jt]=K[jt]||[],yt=0,kt=wr;yt<kt.length;yt+=1){var Bt=kt[yt];Nr[Bt.featureIndex]||(Nr[Bt.featureIndex]=!0,pr.push(Bt))}}return K}var ze=function(K,_e){this.max=K,this.onRemove=_e,this.reset()};ze.prototype.reset=function(){for(var K in this.data)for(var _e=0,te=this.data[K];_e<te.length;_e+=1){var me=te[_e];me.timeout&&clearTimeout(me.timeout),this.onRemove(me.value)}return this.data={},this.order=[],this},ze.prototype.add=function(K,_e,te){var me=this,Ge=K.wrapped().key;this.data[Ge]===void 0&&(this.data[Ge]=[]);var Le={value:_e,timeout:void 0};if(te!==void 0&&(Le.timeout=setTimeout(function(){me.remove(K,Le)},te)),this.data[Ge].push(Le),this.order.push(Ge),this.order.length>this.max){var $e=this._getAndRemoveByKey(this.order[0]);$e&&this.onRemove($e)}return this},ze.prototype.has=function(K){return K.wrapped().key in this.data},ze.prototype.getAndRemove=function(K){return this.has(K)?this._getAndRemoveByKey(K.wrapped().key):null},ze.prototype._getAndRemoveByKey=function(K){var _e=this.data[K].shift();return _e.timeout&&clearTimeout(_e.timeout),this.data[K].length===0&&delete this.data[K],this.order.splice(this.order.indexOf(K),1),_e.value},ze.prototype.getByKey=function(K){var _e=this.data[K];return _e?_e[0].value:null},ze.prototype.get=function(K){if(!this.has(K))return null;var _e=this.data[K.wrapped().key][0];return _e.value},ze.prototype.remove=function(K,_e){if(!this.has(K))return this;var te=K.wrapped().key,me=_e===void 0?0:this.data[te].indexOf(_e),Ge=this.data[te][me];return this.data[te].splice(me,1),Ge.timeout&&clearTimeout(Ge.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ge.value),this.order.splice(this.order.indexOf(te),1),this},ze.prototype.setMaxSize=function(K){for(this.max=K;this.order.length>this.max;){var _e=this._getAndRemoveByKey(this.order[0]);_e&&this.onRemove(_e)}return this},ze.prototype.filter=function(K){var _e=[];for(var te in this.data)for(var me=0,Ge=this.data[te];me<Ge.length;me+=1){var Le=Ge[me];K(Le.value)||_e.push(Le)}for(var $e=0,gt=_e;$e<gt.length;$e+=1){var jt=gt[$e];this.remove(jt.value.tileID,jt)}};var Ze=function(K,_e,te){this.context=K;var me=K.gl;this.buffer=me.createBuffer(),this.dynamicDraw=!!te,this.context.unbindVAO(),K.bindElementBuffer.set(this.buffer),me.bufferData(me.ELEMENT_ARRAY_BUFFER,_e.arrayBuffer,this.dynamicDraw?me.DYNAMIC_DRAW:me.STATIC_DRAW),this.dynamicDraw||delete _e.arrayBuffer};Ze.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Ze.prototype.updateData=function(K){var _e=this.context.gl;this.context.unbindVAO(),this.bind(),_e.bufferSubData(_e.ELEMENT_ARRAY_BUFFER,0,K.arrayBuffer)},Ze.prototype.destroy=function(){var K=this.context.gl;this.buffer&&(K.deleteBuffer(this.buffer),delete this.buffer)};var at={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},nt=function(K,_e,te,me){this.length=_e.length,this.attributes=te,this.itemSize=_e.bytesPerElement,this.dynamicDraw=me,this.context=K;var Ge=K.gl;this.buffer=Ge.createBuffer(),K.bindVertexBuffer.set(this.buffer),Ge.bufferData(Ge.ARRAY_BUFFER,_e.arrayBuffer,this.dynamicDraw?Ge.DYNAMIC_DRAW:Ge.STATIC_DRAW),this.dynamicDraw||delete _e.arrayBuffer};nt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},nt.prototype.updateData=function(K){var _e=this.context.gl;this.bind(),_e.bufferSubData(_e.ARRAY_BUFFER,0,K.arrayBuffer)},nt.prototype.enableAttributes=function(K,_e){for(var te=0;te<this.attributes.length;te++){var me=this.attributes[te],Ge=_e.attributes[me.name];Ge!==void 0&&K.enableVertexAttribArray(Ge)}},nt.prototype.setVertexAttribPointers=function(K,_e,te){for(var me=0;me<this.attributes.length;me++){var Ge=this.attributes[me],Le=_e.attributes[Ge.name];Le!==void 0&&K.vertexAttribPointer(Le,Ge.components,K[at[Ge.type]],!1,this.itemSize,Ge.offset+this.itemSize*(te||0))}},nt.prototype.destroy=function(){var K=this.context.gl;this.buffer&&(K.deleteBuffer(this.buffer),delete this.buffer)};var rt=function(K){this.gl=K.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};rt.prototype.get=function(){return this.current},rt.prototype.set=function(K){},rt.prototype.getDefault=function(){return this.default},rt.prototype.setDefault=function(){this.set(this.default)};var st=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return e.Color.transparent},K.prototype.set=function(te){var me=this.current;te.r===me.r&&te.g===me.g&&te.b===me.b&&te.a===me.a&&!this.dirty||(this.gl.clearColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},K}(rt),Me=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 1},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearDepth(te),this.current=te,this.dirty=!1)},K}(rt),ye=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearStencil(te),this.current=te,this.dirty=!1)},K}(rt),he=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return[!0,!0,!0,!0]},K.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&te[3]===me[3]&&!this.dirty||(this.gl.colorMask(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},K}(rt),Oe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthMask(te),this.current=te,this.dirty=!1)},K}(rt),tt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 255},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.stencilMask(te),this.current=te,this.dirty=!1)},K}(rt),ot=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},K.prototype.set=function(te){var me=this.current;te.func===me.func&&te.ref===me.ref&&te.mask===me.mask&&!this.dirty||(this.gl.stencilFunc(te.func,te.ref,te.mask),this.current=te,this.dirty=!1)},K}(rt),Qe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[te.KEEP,te.KEEP,te.KEEP]},K.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&!this.dirty||(this.gl.stencilOp(te[0],te[1],te[2]),this.current=te,this.dirty=!1)},K}(rt),Pt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.STENCIL_TEST):me.disable(me.STENCIL_TEST),this.current=te,this.dirty=!1}},K}(rt),It=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return[0,1]},K.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&!this.dirty||(this.gl.depthRange(te[0],te[1]),this.current=te,this.dirty=!1)},K}(rt),qt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.DEPTH_TEST):me.disable(me.DEPTH_TEST),this.current=te,this.dirty=!1}},K}(rt),Wt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.LESS},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthFunc(te),this.current=te,this.dirty=!1)},K}(rt),kr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.BLEND):me.disable(me.BLEND),this.current=te,this.dirty=!1}},K}(rt),mr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[te.ONE,te.ZERO]},K.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&!this.dirty||(this.gl.blendFunc(te[0],te[1]),this.current=te,this.dirty=!1)},K}(rt),qr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return e.Color.transparent},K.prototype.set=function(te){var me=this.current;te.r===me.r&&te.g===me.g&&te.b===me.b&&te.a===me.a&&!this.dirty||(this.gl.blendColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},K}(rt),Sr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.FUNC_ADD},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.blendEquation(te),this.current=te,this.dirty=!1)},K}(rt),Rr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.CULL_FACE):me.disable(me.CULL_FACE),this.current=te,this.dirty=!1}},K}(rt),wt=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.BACK},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.cullFace(te),this.current=te,this.dirty=!1)},K}(rt),Ne=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.CCW},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.frontFace(te),this.current=te,this.dirty=!1)},K}(rt),Ke=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.useProgram(te),this.current=te,this.dirty=!1)},K}(rt),Te=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return this.gl.TEXTURE0},K.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.activeTexture(te),this.current=te,this.dirty=!1)},K}(rt),Ie=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){var te=this.gl;return[0,0,te.drawingBufferWidth,te.drawingBufferHeight]},K.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&te[3]===me[3]&&!this.dirty||(this.gl.viewport(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},K}(rt),Ve=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindFramebuffer(me.FRAMEBUFFER,te),this.current=te,this.dirty=!1}},K}(rt),Ce=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindRenderbuffer(me.RENDERBUFFER,te),this.current=te,this.dirty=!1}},K}(rt),Ee=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindTexture(me.TEXTURE_2D,te),this.current=te,this.dirty=!1}},K}(rt),Pe=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindBuffer(me.ARRAY_BUFFER,te),this.current=te,this.dirty=!1}},K}(rt),ft=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){var me=this.gl;me.bindBuffer(me.ELEMENT_ARRAY_BUFFER,te),this.current=te,this.dirty=!1},K}(rt),ct=function(ve){function K(_e){ve.call(this,_e),this.vao=_e.extVertexArrayObject}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K.prototype.set=function(te){!this.vao||te===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(te),this.current=te,this.dirty=!1)},K}(rt),_t=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return 4},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_ALIGNMENT,te),this.current=te,this.dirty=!1}},K}(rt),Ct=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te),this.current=te,this.dirty=!1}},K}(rt),ir=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return!1},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_FLIP_Y_WEBGL,te),this.current=te,this.dirty=!1}},K}(rt),rr=function(ve){function K(_e,te){ve.call(this,_e),this.context=_e,this.parent=te}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.getDefault=function(){return null},K}(rt),er=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.setDirty=function(){this.dirty=!0},K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var me=this.gl;me.framebufferTexture2D(me.FRAMEBUFFER,me.COLOR_ATTACHMENT0,me.TEXTURE_2D,te,0),this.current=te,this.dirty=!1}},K}(rr),Lr=function(ve){function K(){ve.apply(this,arguments)}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var me=this.gl;me.framebufferRenderbuffer(me.FRAMEBUFFER,me.DEPTH_ATTACHMENT,me.RENDERBUFFER,te),this.current=te,this.dirty=!1}},K}(rr),fa=function(K,_e,te,me){this.context=K,this.width=_e,this.height=te;var Ge=K.gl,Le=this.framebuffer=Ge.createFramebuffer();this.colorAttachment=new er(K,Le),me&&(this.depthAttachment=new Lr(K,Le))};fa.prototype.destroy=function(){var K=this.context.gl,_e=this.colorAttachment.get();if(_e&&K.deleteTexture(_e),this.depthAttachment){var te=this.depthAttachment.get();te&&K.deleteRenderbuffer(te)}K.deleteFramebuffer(this.framebuffer)};var Da=519,Ia=function(K,_e,te){this.func=K,this.mask=_e,this.range=te};Ia.ReadOnly=!1,Ia.ReadWrite=!0,Ia.disabled=new Ia(Da,Ia.ReadOnly,[0,1]);var qa=519,Wa=7680,Ca=function(K,_e,te,me,Ge,Le){this.test=K,this.ref=_e,this.mask=te,this.fail=me,this.depthFail=Ge,this.pass=Le};Ca.disabled=new Ca({func:qa,mask:0},0,0,Wa,Wa,Wa);var hi=0,wi=1,Kt=771,Ft=function(K,_e,te){this.blendFunction=K,this.blendColor=_e,this.mask=te};Ft.Replace=[wi,hi],Ft.disabled=new Ft(Ft.Replace,e.Color.transparent,[!1,!1,!1,!1]),Ft.unblended=new Ft(Ft.Replace,e.Color.transparent,[!0,!0,!0,!0]),Ft.alphaBlended=new Ft([wi,Kt],e.Color.transparent,[!0,!0,!0,!0]);var Yt=1029,Jt=2305,Fr=function(K,_e,te){this.enable=K,this.mode=_e,this.frontFace=te};Fr.disabled=new Fr(!1,Yt,Jt),Fr.backCCW=new Fr(!0,Yt,Jt);var ta=function(K){this.gl=K,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new st(this),this.clearDepth=new Me(this),this.clearStencil=new ye(this),this.colorMask=new he(this),this.depthMask=new Oe(this),this.stencilMask=new tt(this),this.stencilFunc=new ot(this),this.stencilOp=new Qe(this),this.stencilTest=new Pt(this),this.depthRange=new It(this),this.depthTest=new qt(this),this.depthFunc=new Wt(this),this.blend=new kr(this),this.blendFunc=new mr(this),this.blendColor=new qr(this),this.blendEquation=new Sr(this),this.cullFace=new Rr(this),this.cullFaceSide=new wt(this),this.frontFace=new Ne(this),this.program=new Ke(this),this.activeTexture=new Te(this),this.viewport=new Ie(this),this.bindFramebuffer=new Ve(this),this.bindRenderbuffer=new Ce(this),this.bindTexture=new Ee(this),this.bindVertexBuffer=new Pe(this),this.bindElementBuffer=new ft(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ct(this),this.pixelStoreUnpack=new _t(this),this.pixelStoreUnpackPremultiplyAlpha=new Ct(this),this.pixelStoreUnpackFlipY=new ir(this),this.extTextureFilterAnisotropic=K.getExtension("EXT_texture_filter_anisotropic")||K.getExtension("MOZ_EXT_texture_filter_anisotropic")||K.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=K.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=K.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(K.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=K.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=K.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=K.getParameter(K.MAX_TEXTURE_SIZE)};ta.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},ta.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},ta.prototype.createIndexBuffer=function(K,_e){return new Ze(this,K,_e)},ta.prototype.createVertexBuffer=function(K,_e,te){return new nt(this,K,_e,te)},ta.prototype.createRenderbuffer=function(K,_e,te){var me=this.gl,Ge=me.createRenderbuffer();return this.bindRenderbuffer.set(Ge),me.renderbufferStorage(me.RENDERBUFFER,K,_e,te),this.bindRenderbuffer.set(null),Ge},ta.prototype.createFramebuffer=function(K,_e,te){return new fa(this,K,_e,te)},ta.prototype.clear=function(K){var _e=K.color,te=K.depth,me=this.gl,Ge=0;_e&&(Ge|=me.COLOR_BUFFER_BIT,this.clearColor.set(_e),this.colorMask.set([!0,!0,!0,!0])),typeof te<"u"&&(Ge|=me.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(te),this.depthMask.set(!0)),me.clear(Ge)},ta.prototype.setCullFace=function(K){K.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(K.mode),this.frontFace.set(K.frontFace))},ta.prototype.setDepthMode=function(K){K.func===this.gl.ALWAYS&&!K.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(K.func),this.depthMask.set(K.mask),this.depthRange.set(K.range))},ta.prototype.setStencilMode=function(K){K.test.func===this.gl.ALWAYS&&!K.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(K.mask),this.stencilOp.set([K.fail,K.depthFail,K.pass]),this.stencilFunc.set({func:K.test.func,ref:K.ref,mask:K.test.mask}))},ta.prototype.setColorMode=function(K){e.deepEqual(K.blendFunction,Ft.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(K.blendFunction),this.blendColor.set(K.blendColor)),this.colorMask.set(K.mask)},ta.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var ra=function(ve){function K(_e,te,me){var Ge=this;ve.call(this),this.id=_e,this.dispatcher=me,this.on("data",function(Le){Le.dataType==="source"&&Le.sourceDataType==="metadata"&&(Ge._sourceLoaded=!0),Ge._sourceLoaded&&!Ge._paused&&Le.dataType==="source"&&Le.sourceDataType==="content"&&(Ge.reload(),Ge.transform&&Ge.update(Ge.transform))}),this.on("error",function(){Ge._sourceErrored=!0}),this._source=q(_e,te,me,this),this._tiles={},this._cache=new ze(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.onAdd=function(te){this.map=te,this._maxTileCacheSize=te?te._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(te)},K.prototype.onRemove=function(te){this._source&&this._source.onRemove&&this._source.onRemove(te)},K.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var te in this._tiles){var me=this._tiles[te];if(me.state!=="loaded"&&me.state!=="errored")return!1}return!0},K.prototype.getSource=function(){return this._source},K.prototype.pause=function(){this._paused=!0},K.prototype.resume=function(){if(this._paused){var te=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,te&&this.reload(),this.transform&&this.update(this.transform)}},K.prototype._loadTile=function(te,me){return this._source.loadTile(te,me)},K.prototype._unloadTile=function(te){if(this._source.unloadTile)return this._source.unloadTile(te,function(){})},K.prototype._abortTile=function(te){if(this._source.abortTile)return this._source.abortTile(te,function(){})},K.prototype.serialize=function(){return this._source.serialize()},K.prototype.prepare=function(te){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var me in this._tiles){var Ge=this._tiles[me];Ge.upload(te),Ge.prepare(this.map.style.imageManager)}},K.prototype.getIds=function(){return e.values(this._tiles).map(function(te){return te.tileID}).sort(ca).map(function(te){return te.key})},K.prototype.getRenderableIds=function(te){var me=this,Ge=[];for(var Le in this._tiles)this._isIdRenderable(Le,te)&&Ge.push(this._tiles[Le]);return te?Ge.sort(function($e,gt){var jt=$e.tileID,wr=gt.tileID,Nr=new e.Point(jt.canonical.x,jt.canonical.y)._rotate(me.transform.angle),pr=new e.Point(wr.canonical.x,wr.canonical.y)._rotate(me.transform.angle);return jt.overscaledZ-wr.overscaledZ||pr.y-Nr.y||pr.x-Nr.x}).map(function($e){return $e.tileID.key}):Ge.map(function($e){return $e.tileID}).sort(ca).map(function($e){return $e.key})},K.prototype.hasRenderableParent=function(te){var me=this.findLoadedParent(te,0);return me?this._isIdRenderable(me.tileID.key):!1},K.prototype._isIdRenderable=function(te,me){return this._tiles[te]&&this._tiles[te].hasData()&&!this._coveredTiles[te]&&(me||!this._tiles[te].holdingForFade())},K.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var te in this._tiles)this._tiles[te].state!=="errored"&&this._reloadTile(te,"reloading")},K.prototype._reloadTile=function(te,me){var Ge=this._tiles[te];Ge&&(Ge.state!=="loading"&&(Ge.state=me),this._loadTile(Ge,this._tileLoaded.bind(this,Ge,te,me)))},K.prototype._tileLoaded=function(te,me,Ge,Le){if(Le){te.state="errored",Le.status!==404?this._source.fire(new e.ErrorEvent(Le,{tile:te})):this.update(this.transform);return}te.timeAdded=e.browser.now(),Ge==="expired"&&(te.refreshedUponExpiration=!0),this._setTileReloadTimer(me,te),this.getSource().type==="raster-dem"&&te.dem&&this._backfillDEM(te),this._state.initializeTileState(te,this.map?this.map.painter:null),this._source.fire(new e.Event("data",{dataType:"source",tile:te,coord:te.tileID}))},K.prototype._backfillDEM=function(te){for(var me=this.getRenderableIds(),Ge=0;Ge<me.length;Ge++){var Le=me[Ge];if(te.neighboringTiles&&te.neighboringTiles[Le]){var $e=this.getTileByID(Le);gt(te,$e),gt($e,te)}}function gt(jt,wr){jt.needsHillshadePrepare=!0;var Nr=wr.tileID.canonical.x-jt.tileID.canonical.x,pr=wr.tileID.canonical.y-jt.tileID.canonical.y,yt=Math.pow(2,jt.tileID.canonical.z),kt=wr.tileID.key;Nr===0&&pr===0||Math.abs(pr)>1||(Math.abs(Nr)>1&&(Math.abs(Nr+yt)===1?Nr+=yt:Math.abs(Nr-yt)===1&&(Nr-=yt)),!(!wr.dem||!jt.dem)&&(jt.dem.backfillBorder(wr.dem,Nr,pr),jt.neighboringTiles&&jt.neighboringTiles[kt]&&(jt.neighboringTiles[kt].backfilled=!0)))}},K.prototype.getTile=function(te){return this.getTileByID(te.key)},K.prototype.getTileByID=function(te){return this._tiles[te]},K.prototype._retainLoadedChildren=function(te,me,Ge,Le){for(var $e in this._tiles){var gt=this._tiles[$e];if(!(Le[$e]||!gt.hasData()||gt.tileID.overscaledZ<=me||gt.tileID.overscaledZ>Ge)){for(var jt=gt.tileID;gt&>.tileID.overscaledZ>me+1;){var wr=gt.tileID.scaledTo(gt.tileID.overscaledZ-1);gt=this._tiles[wr.key],gt&>.hasData()&&(jt=wr)}for(var Nr=jt;Nr.overscaledZ>me;)if(Nr=Nr.scaledTo(Nr.overscaledZ-1),te[Nr.key]){Le[jt.key]=jt;break}}}},K.prototype.findLoadedParent=function(te,me){if(te.key in this._loadedParentTiles){var Ge=this._loadedParentTiles[te.key];return Ge&&Ge.tileID.overscaledZ>=me?Ge:null}for(var Le=te.overscaledZ-1;Le>=me;Le--){var $e=te.scaledTo(Le),gt=this._getLoadedTile($e);if(gt)return gt}},K.prototype._getLoadedTile=function(te){var me=this._tiles[te.key];if(me&&me.hasData())return me;var Ge=this._cache.getByKey(te.wrapped().key);return Ge},K.prototype.updateCacheSize=function(te){var me=Math.ceil(te.width/this._source.tileSize)+1,Ge=Math.ceil(te.height/this._source.tileSize)+1,Le=me*Ge,$e=5,gt=Math.floor(Le*$e),jt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,gt):gt;this._cache.setMaxSize(jt)},K.prototype.handleWrapJump=function(te){var me=this._prevLng===void 0?te:this._prevLng,Ge=te-me,Le=Ge/360,$e=Math.round(Le);if(this._prevLng=te,$e){var gt={};for(var jt in this._tiles){var wr=this._tiles[jt];wr.tileID=wr.tileID.unwrapTo(wr.tileID.wrap+$e),gt[wr.tileID.key]=wr}this._tiles=gt;for(var Nr in this._timers)clearTimeout(this._timers[Nr]),delete this._timers[Nr];for(var pr in this._tiles){var yt=this._tiles[pr];this._setTileReloadTimer(pr,yt)}}},K.prototype.update=function(te){var me=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ge;this.used?this._source.tileID?Ge=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ga){return new e.OverscaledTileID(ga.canonical.z,ga.wrap,ga.canonical.z,ga.canonical.x,ga.canonical.y)}):(Ge=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ge=Ge.filter(function(ga){return me._source.hasTile(ga)}))):Ge=[];var Le=te.coveringZoomLevel(this._source),$e=Math.max(Le-K.maxOverzooming,this._source.minzoom),gt=Math.max(Le+K.maxUnderzooming,this._source.minzoom),jt=this._updateRetainedTiles(Ge,Le);if(Ba(this._source.type)){for(var wr={},Nr={},pr=Object.keys(jt),yt=0,kt=pr;yt<kt.length;yt+=1){var Bt=kt[yt],nr=jt[Bt],hr=this._tiles[Bt];if(!(!hr||hr.fadeEndTime&&hr.fadeEndTime<=e.browser.now())){var lr=this.findLoadedParent(nr,$e);lr&&(this._addTile(lr.tileID),wr[lr.tileID.key]=lr.tileID),Nr[Bt]=nr}}this._retainLoadedChildren(Nr,Le,gt,jt);for(var dr in wr)jt[dr]||(this._coveredTiles[dr]=!0,jt[dr]=wr[dr])}for(var ur in jt)this._tiles[ur].clearFadeHold();for(var Ht=e.keysDifference(this._tiles,jt),sr=0,Vt=Ht;sr<Vt.length;sr+=1){var Dr=Vt[sr],Jr=this._tiles[Dr];Jr.hasSymbolBuckets&&!Jr.holdingForFade()?Jr.setHoldDuration(this.map._fadeDuration):(!Jr.hasSymbolBuckets||Jr.symbolFadeFinished())&&this._removeTile(Dr)}this._updateLoadedParentTileCache()}},K.prototype.releaseSymbolFadeTiles=function(){for(var te in this._tiles)this._tiles[te].holdingForFade()&&this._removeTile(te)},K.prototype._updateRetainedTiles=function(te,me){for(var Ge={},Le={},$e=Math.max(me-K.maxOverzooming,this._source.minzoom),gt=Math.max(me+K.maxUnderzooming,this._source.minzoom),jt={},wr=0,Nr=te;wr<Nr.length;wr+=1){var pr=Nr[wr],yt=this._addTile(pr);Ge[pr.key]=pr,!yt.hasData()&&me<this._source.maxzoom&&(jt[pr.key]=pr)}this._retainLoadedChildren(jt,me,gt,Ge);for(var kt=0,Bt=te;kt<Bt.length;kt+=1){var nr=Bt[kt],hr=this._tiles[nr.key];if(!hr.hasData()){if(me+1>this._source.maxzoom){var lr=nr.children(this._source.maxzoom)[0],dr=this.getTile(lr);if(dr&&dr.hasData()){Ge[lr.key]=lr;continue}}else{var ur=nr.children(this._source.maxzoom);if(Ge[ur[0].key]&&Ge[ur[1].key]&&Ge[ur[2].key]&&Ge[ur[3].key])continue}for(var Ht=hr.wasRequested(),sr=nr.overscaledZ-1;sr>=$e;--sr){var Vt=nr.scaledTo(sr);if(Le[Vt.key]||(Le[Vt.key]=!0,hr=this.getTile(Vt),!hr&&Ht&&(hr=this._addTile(Vt)),hr&&(Ge[Vt.key]=Vt,Ht=hr.wasRequested(),hr.hasData())))break}}}return Ge},K.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var me=[],Ge=void 0,Le=this._tiles[te].tileID;Le.overscaledZ>0;){if(Le.key in this._loadedParentTiles){Ge=this._loadedParentTiles[Le.key];break}me.push(Le.key);var $e=Le.scaledTo(Le.overscaledZ-1);if(Ge=this._getLoadedTile($e),Ge)break;Le=$e}for(var gt=0,jt=me;gt<jt.length;gt+=1){var wr=jt[gt];this._loadedParentTiles[wr]=Ge}}},K.prototype._addTile=function(te){var me=this._tiles[te.key];if(me)return me;me=this._cache.getAndRemove(te),me&&(this._setTileReloadTimer(te.key,me),me.tileID=te,this._state.initializeTileState(me,this.map?this.map.painter:null),this._cacheTimers[te.key]&&(clearTimeout(this._cacheTimers[te.key]),delete this._cacheTimers[te.key],this._setTileReloadTimer(te.key,me)));var Ge=!!me;return Ge||(me=new e.Tile(te,this._source.tileSize*te.overscaleFactor()),this._loadTile(me,this._tileLoaded.bind(this,me,te.key,me.state))),me?(me.uses++,this._tiles[te.key]=me,Ge||this._source.fire(new e.Event("dataloading",{tile:me,coord:me.tileID,dataType:"source"})),me):null},K.prototype._setTileReloadTimer=function(te,me){var Ge=this;te in this._timers&&(clearTimeout(this._timers[te]),delete this._timers[te]);var Le=me.getExpiryTimeout();Le&&(this._timers[te]=setTimeout(function(){Ge._reloadTile(te,"expired"),delete Ge._timers[te]},Le))},K.prototype._removeTile=function(te){var me=this._tiles[te];me&&(me.uses--,delete this._tiles[te],this._timers[te]&&(clearTimeout(this._timers[te]),delete this._timers[te]),!(me.uses>0)&&(me.hasData()&&me.state!=="reloading"?this._cache.add(me.tileID,me,me.getExpiryTimeout()):(me.aborted=!0,this._abortTile(me),this._unloadTile(me))))},K.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},K.prototype.tilesIn=function(te,me,Ge){var Le=this,$e=[],gt=this.transform;if(!gt)return $e;for(var jt=Ge?gt.getCameraQueryGeometry(te):te,wr=te.map(function(sr){return gt.pointCoordinate(sr)}),Nr=jt.map(function(sr){return gt.pointCoordinate(sr)}),pr=this.getIds(),yt=1/0,kt=1/0,Bt=-1/0,nr=-1/0,hr=0,lr=Nr;hr<lr.length;hr+=1){var dr=lr[hr];yt=Math.min(yt,dr.x),kt=Math.min(kt,dr.y),Bt=Math.max(Bt,dr.x),nr=Math.max(nr,dr.y)}for(var ur=function(sr){var Vt=Le._tiles[pr[sr]];if(!Vt.holdingForFade()){var Dr=Vt.tileID,Jr=Math.pow(2,gt.zoom-Vt.tileID.overscaledZ),ga=me*Vt.queryPadding*e.EXTENT/Vt.tileSize/Jr,vi=[Dr.getTilePoint(new e.MercatorCoordinate(yt,kt)),Dr.getTilePoint(new e.MercatorCoordinate(Bt,nr))];if(vi[0].x-ga<e.EXTENT&&vi[0].y-ga<e.EXTENT&&vi[1].x+ga>=0&&vi[1].y+ga>=0){var Ga=wr.map(function(Zi){return Dr.getTilePoint(Zi)}),ai=Nr.map(function(Zi){return Dr.getTilePoint(Zi)});$e.push({tile:Vt,tileID:Dr,queryGeometry:Ga,cameraQueryGeometry:ai,scale:Jr})}}},Ht=0;Ht<pr.length;Ht++)ur(Ht);return $e},K.prototype.getVisibleCoordinates=function(te){for(var me=this,Ge=this.getRenderableIds(te).map(function(jt){return me._tiles[jt].tileID}),Le=0,$e=Ge;Le<$e.length;Le+=1){var gt=$e[Le];gt.posMatrix=this.transform.calculatePosMatrix(gt.toUnwrapped())}return Ge},K.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ba(this._source.type))for(var te in this._tiles){var me=this._tiles[te];if(me.fadeEndTime!==void 0&&me.fadeEndTime>=e.browser.now())return!0}return!1},K.prototype.setFeatureState=function(te,me,Ge){te=te||"_geojsonTileLayer",this._state.updateState(te,me,Ge)},K.prototype.removeFeatureState=function(te,me,Ge){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,me,Ge)},K.prototype.getFeatureState=function(te,me){return te=te||"_geojsonTileLayer",this._state.getState(te,me)},K.prototype.setDependencies=function(te,me,Ge){var Le=this._tiles[te];Le&&Le.setDependencies(me,Ge)},K.prototype.reloadTilesForDependencies=function(te,me){for(var Ge in this._tiles){var Le=this._tiles[Ge];Le.hasDependency(te,me)&&this._reloadTile(Ge,"reloading")}this._cache.filter(function($e){return!$e.hasDependency(te,me)})},K}(e.Evented);ra.maxOverzooming=10,ra.maxUnderzooming=3;function ca(ve,K){var _e=Math.abs(ve.wrap*2)-+(ve.wrap<0),te=Math.abs(K.wrap*2)-+(K.wrap<0);return ve.overscaledZ-K.overscaledZ||te-_e||K.canonical.y-ve.canonical.y||K.canonical.x-ve.canonical.x}function Ba(ve){return ve==="raster"||ve==="image"||ve==="video"}function $a(){return new e.window.Worker(Co.workerUrl)}var Za="mapboxgl_preloaded_worker_pool",ri=function(){this.active={}};ri.prototype.acquire=function(K){if(!this.workers)for(this.workers=[];this.workers.length<ri.workerCount;)this.workers.push(new $a);return this.active[K]=!0,this.workers.slice()},ri.prototype.release=function(K){delete this.active[K],this.numActive()===0&&(this.workers.forEach(function(_e){_e.terminate()}),this.workers=null)},ri.prototype.isPreloaded=function(){return!!this.active[Za]},ri.prototype.numActive=function(){return Object.keys(this.active).length};var pi=Math.floor(e.browser.hardwareConcurrency/2);ri.workerCount=Math.max(Math.min(pi,6),1);var Ra;function tn(){return Ra||(Ra=new ri),Ra}function on(){var ve=tn();ve.acquire(Za)}function hn(){var ve=Ra;ve&&(ve.isPreloaded()&&ve.numActive()===1?(ve.release(Za),Ra=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}function Tt(ve,K){var _e={};for(var te in ve)te!=="ref"&&(_e[te]=ve[te]);return e.refProperties.forEach(function(me){me in K&&(_e[me]=K[me])}),_e}function ut(ve){ve=ve.slice();for(var K=Object.create(null),_e=0;_e<ve.length;_e++)K[ve[_e].id]=ve[_e];for(var te=0;te<ve.length;te++)"ref"in ve[te]&&(ve[te]=Tt(ve[te],K[ve[te].ref]));return ve}function Br(){var ve={},K=e.styleSpec.$version;for(var _e in e.styleSpec.$root){var te=e.styleSpec.$root[_e];if(te.required){var me=null;_e==="version"?me=K:te.type==="array"?me=[]:me={},me!=null&&(ve[_e]=me)}}return ve}var Cr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function xr(ve,K,_e){_e.push({command:Cr.addSource,args:[ve,K[ve]]})}function Ir(ve,K,_e){K.push({command:Cr.removeSource,args:[ve]}),_e[ve]=!0}function Ur(ve,K,_e,te){Ir(ve,_e,te),xr(ve,K,_e)}function Hr(ve,K,_e){var te;for(te in ve[_e])if(ve[_e].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[_e][te],K[_e][te]))return!1;for(te in K[_e])if(K[_e].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[_e][te],K[_e][te]))return!1;return!0}function xt(ve,K,_e,te){ve=ve||{},K=K||{};var me;for(me in ve)ve.hasOwnProperty(me)&&(K.hasOwnProperty(me)||Ir(me,_e,te));for(me in K)K.hasOwnProperty(me)&&(ve.hasOwnProperty(me)?e.deepEqual(ve[me],K[me])||(ve[me].type==="geojson"&&K[me].type==="geojson"&&Hr(ve,K,me)?_e.push({command:Cr.setGeoJSONSourceData,args:[me,K[me].data]}):Ur(me,K,_e,te)):xr(me,K,_e))}function Xt(ve,K,_e,te,me,Ge){ve=ve||{},K=K||{};var Le;for(Le in ve)ve.hasOwnProperty(Le)&&(e.deepEqual(ve[Le],K[Le])||_e.push({command:Ge,args:[te,Le,K[Le],me]}));for(Le in K)!K.hasOwnProperty(Le)||ve.hasOwnProperty(Le)||e.deepEqual(ve[Le],K[Le])||_e.push({command:Ge,args:[te,Le,K[Le],me]})}function vr(ve){return ve.id}function Or(ve,K){return ve[K.id]=K,ve}function ba(ve,K,_e){ve=ve||[],K=K||[];var te=ve.map(vr),me=K.map(vr),Ge=ve.reduce(Or,{}),Le=K.reduce(Or,{}),$e=te.slice(),gt=Object.create(null),jt,wr,Nr,pr,yt,kt,Bt;for(jt=0,wr=0;jt<te.length;jt++)Nr=te[jt],Le.hasOwnProperty(Nr)?wr++:(_e.push({command:Cr.removeLayer,args:[Nr]}),$e.splice($e.indexOf(Nr,wr),1));for(jt=0,wr=0;jt<me.length;jt++)Nr=me[me.length-1-jt],$e[$e.length-1-jt]!==Nr&&(Ge.hasOwnProperty(Nr)?(_e.push({command:Cr.removeLayer,args:[Nr]}),$e.splice($e.lastIndexOf(Nr,$e.length-wr),1)):wr++,kt=$e[$e.length-jt],_e.push({command:Cr.addLayer,args:[Le[Nr],kt]}),$e.splice($e.length-jt,0,Nr),gt[Nr]=!0);for(jt=0;jt<me.length;jt++)if(Nr=me[jt],pr=Ge[Nr],yt=Le[Nr],!(gt[Nr]||e.deepEqual(pr,yt))){if(!e.deepEqual(pr.source,yt.source)||!e.deepEqual(pr["source-layer"],yt["source-layer"])||!e.deepEqual(pr.type,yt.type)){_e.push({command:Cr.removeLayer,args:[Nr]}),kt=$e[$e.lastIndexOf(Nr)+1],_e.push({command:Cr.addLayer,args:[yt,kt]});continue}Xt(pr.layout,yt.layout,_e,Nr,null,Cr.setLayoutProperty),Xt(pr.paint,yt.paint,_e,Nr,null,Cr.setPaintProperty),e.deepEqual(pr.filter,yt.filter)||_e.push({command:Cr.setFilter,args:[Nr,yt.filter]}),(!e.deepEqual(pr.minzoom,yt.minzoom)||!e.deepEqual(pr.maxzoom,yt.maxzoom))&&_e.push({command:Cr.setLayerZoomRange,args:[Nr,yt.minzoom,yt.maxzoom]});for(Bt in pr)pr.hasOwnProperty(Bt)&&(Bt==="layout"||Bt==="paint"||Bt==="filter"||Bt==="metadata"||Bt==="minzoom"||Bt==="maxzoom"||(Bt.indexOf("paint.")===0?Xt(pr[Bt],yt[Bt],_e,Nr,Bt.slice(6),Cr.setPaintProperty):e.deepEqual(pr[Bt],yt[Bt])||_e.push({command:Cr.setLayerProperty,args:[Nr,Bt,yt[Bt]]})));for(Bt in yt)!yt.hasOwnProperty(Bt)||pr.hasOwnProperty(Bt)||Bt==="layout"||Bt==="paint"||Bt==="filter"||Bt==="metadata"||Bt==="minzoom"||Bt==="maxzoom"||(Bt.indexOf("paint.")===0?Xt(pr[Bt],yt[Bt],_e,Nr,Bt.slice(6),Cr.setPaintProperty):e.deepEqual(pr[Bt],yt[Bt])||_e.push({command:Cr.setLayerProperty,args:[Nr,Bt,yt[Bt]]}))}}function Pa(ve,K){if(!ve)return[{command:Cr.setStyle,args:[K]}];var _e=[];try{if(!e.deepEqual(ve.version,K.version))return[{command:Cr.setStyle,args:[K]}];e.deepEqual(ve.center,K.center)||_e.push({command:Cr.setCenter,args:[K.center]}),e.deepEqual(ve.zoom,K.zoom)||_e.push({command:Cr.setZoom,args:[K.zoom]}),e.deepEqual(ve.bearing,K.bearing)||_e.push({command:Cr.setBearing,args:[K.bearing]}),e.deepEqual(ve.pitch,K.pitch)||_e.push({command:Cr.setPitch,args:[K.pitch]}),e.deepEqual(ve.sprite,K.sprite)||_e.push({command:Cr.setSprite,args:[K.sprite]}),e.deepEqual(ve.glyphs,K.glyphs)||_e.push({command:Cr.setGlyphs,args:[K.glyphs]}),e.deepEqual(ve.transition,K.transition)||_e.push({command:Cr.setTransition,args:[K.transition]}),e.deepEqual(ve.light,K.light)||_e.push({command:Cr.setLight,args:[K.light]});var te={},me=[];xt(ve.sources,K.sources,me,te);var Ge=[];ve.layers&&ve.layers.forEach(function(Le){te[Le.source]?_e.push({command:Cr.removeLayer,args:[Le.id]}):Ge.push(Le)}),_e=_e.concat(me),ba(Ge,K.layers,_e)}catch(Le){console.warn("Unable to compute style diff:",Le),_e=[{command:Cr.setStyle,args:[K]}]}return _e}var ya=function(K,_e){this.reset(K,_e)};ya.prototype.reset=function(K,_e){this.points=K||[],this._distances=[0];for(var te=1;te<this.points.length;te++)this._distances[te]=this._distances[te-1]+this.points[te].dist(this.points[te-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(_e||0,this.length*.5),this.paddedLength=this.length-this.padding*2},ya.prototype.lerp=function(K){if(this.points.length===1)return this.points[0];K=e.clamp(K,0,1);for(var _e=1,te=this._distances[_e],me=K*this.paddedLength+this.padding;te<me&&_e<this._distances.length;)te=this._distances[++_e];var Ge=_e-1,Le=this._distances[Ge],$e=te-Le,gt=$e>0?(me-Le)/$e:0;return this.points[Ge].mult(1-gt).add(this.points[_e].mult(gt))};var la=function(K,_e,te){var me=this.boxCells=[],Ge=this.circleCells=[];this.xCellCount=Math.ceil(K/te),this.yCellCount=Math.ceil(_e/te);for(var Le=0;Le<this.xCellCount*this.yCellCount;Le++)me.push([]),Ge.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=K,this.height=_e,this.xScale=this.xCellCount/K,this.yScale=this.yCellCount/_e,this.boxUid=0,this.circleUid=0};la.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},la.prototype.insert=function(K,_e,te,me,Ge){this._forEachCell(_e,te,me,Ge,this._insertBoxCell,this.boxUid++),this.boxKeys.push(K),this.bboxes.push(_e),this.bboxes.push(te),this.bboxes.push(me),this.bboxes.push(Ge)},la.prototype.insertCircle=function(K,_e,te,me){this._forEachCell(_e-me,te-me,_e+me,te+me,this._insertCircleCell,this.circleUid++),this.circleKeys.push(K),this.circles.push(_e),this.circles.push(te),this.circles.push(me)},la.prototype._insertBoxCell=function(K,_e,te,me,Ge,Le){this.boxCells[Ge].push(Le)},la.prototype._insertCircleCell=function(K,_e,te,me,Ge,Le){this.circleCells[Ge].push(Le)},la.prototype._query=function(K,_e,te,me,Ge,Le){if(te<0||K>this.width||me<0||_e>this.height)return Ge?!1:[];var $e=[];if(K<=0&&_e<=0&&this.width<=te&&this.height<=me){if(Ge)return!0;for(var gt=0;gt<this.boxKeys.length;gt++)$e.push({key:this.boxKeys[gt],x1:this.bboxes[gt*4],y1:this.bboxes[gt*4+1],x2:this.bboxes[gt*4+2],y2:this.bboxes[gt*4+3]});for(var jt=0;jt<this.circleKeys.length;jt++){var wr=this.circles[jt*3],Nr=this.circles[jt*3+1],pr=this.circles[jt*3+2];$e.push({key:this.circleKeys[jt],x1:wr-pr,y1:Nr-pr,x2:wr+pr,y2:Nr+pr})}return Le?$e.filter(Le):$e}else{var yt={hitTest:Ge,seenUids:{box:{},circle:{}}};return this._forEachCell(K,_e,te,me,this._queryCell,$e,yt,Le),Ge?$e.length>0:$e}},la.prototype._queryCircle=function(K,_e,te,me,Ge){var Le=K-te,$e=K+te,gt=_e-te,jt=_e+te;if($e<0||Le>this.width||jt<0||gt>this.height)return me?!1:[];var wr=[],Nr={hitTest:me,circle:{x:K,y:_e,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(Le,gt,$e,jt,this._queryCellCircle,wr,Nr,Ge),me?wr.length>0:wr},la.prototype.query=function(K,_e,te,me,Ge){return this._query(K,_e,te,me,!1,Ge)},la.prototype.hitTest=function(K,_e,te,me,Ge){return this._query(K,_e,te,me,!0,Ge)},la.prototype.hitTestCircle=function(K,_e,te,me){return this._queryCircle(K,_e,te,!0,me)},la.prototype._queryCell=function(K,_e,te,me,Ge,Le,$e,gt){var jt=$e.seenUids,wr=this.boxCells[Ge];if(wr!==null)for(var Nr=this.bboxes,pr=0,yt=wr;pr<yt.length;pr+=1){var kt=yt[pr];if(!jt.box[kt]){jt.box[kt]=!0;var Bt=kt*4;if(K<=Nr[Bt+2]&&_e<=Nr[Bt+3]&&te>=Nr[Bt+0]&&me>=Nr[Bt+1]&&(!gt||gt(this.boxKeys[kt]))){if($e.hitTest)return Le.push(!0),!0;Le.push({key:this.boxKeys[kt],x1:Nr[Bt],y1:Nr[Bt+1],x2:Nr[Bt+2],y2:Nr[Bt+3]})}}}var nr=this.circleCells[Ge];if(nr!==null)for(var hr=this.circles,lr=0,dr=nr;lr<dr.length;lr+=1){var ur=dr[lr];if(!jt.circle[ur]){jt.circle[ur]=!0;var Ht=ur*3;if(this._circleAndRectCollide(hr[Ht],hr[Ht+1],hr[Ht+2],K,_e,te,me)&&(!gt||gt(this.circleKeys[ur]))){if($e.hitTest)return Le.push(!0),!0;var sr=hr[Ht],Vt=hr[Ht+1],Dr=hr[Ht+2];Le.push({key:this.circleKeys[ur],x1:sr-Dr,y1:Vt-Dr,x2:sr+Dr,y2:Vt+Dr})}}}},la.prototype._queryCellCircle=function(K,_e,te,me,Ge,Le,$e,gt){var jt=$e.circle,wr=$e.seenUids,Nr=this.boxCells[Ge];if(Nr!==null)for(var pr=this.bboxes,yt=0,kt=Nr;yt<kt.length;yt+=1){var Bt=kt[yt];if(!wr.box[Bt]){wr.box[Bt]=!0;var nr=Bt*4;if(this._circleAndRectCollide(jt.x,jt.y,jt.radius,pr[nr+0],pr[nr+1],pr[nr+2],pr[nr+3])&&(!gt||gt(this.boxKeys[Bt])))return Le.push(!0),!0}}var hr=this.circleCells[Ge];if(hr!==null)for(var lr=this.circles,dr=0,ur=hr;dr<ur.length;dr+=1){var Ht=ur[dr];if(!wr.circle[Ht]){wr.circle[Ht]=!0;var sr=Ht*3;if(this._circlesCollide(lr[sr],lr[sr+1],lr[sr+2],jt.x,jt.y,jt.radius)&&(!gt||gt(this.circleKeys[Ht])))return Le.push(!0),!0}}},la.prototype._forEachCell=function(K,_e,te,me,Ge,Le,$e,gt){for(var jt=this._convertToXCellCoord(K),wr=this._convertToYCellCoord(_e),Nr=this._convertToXCellCoord(te),pr=this._convertToYCellCoord(me),yt=jt;yt<=Nr;yt++)for(var kt=wr;kt<=pr;kt++){var Bt=this.xCellCount*kt+yt;if(Ge.call(this,K,_e,te,me,Bt,Le,$e,gt))return}},la.prototype._convertToXCellCoord=function(K){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(K*this.xScale)))},la.prototype._convertToYCellCoord=function(K){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(K*this.yScale)))},la.prototype._circlesCollide=function(K,_e,te,me,Ge,Le){var $e=me-K,gt=Ge-_e,jt=te+Le;return jt*jt>$e*$e+gt*gt},la.prototype._circleAndRectCollide=function(K,_e,te,me,Ge,Le,$e){var gt=(Le-me)/2,jt=Math.abs(K-(me+gt));if(jt>gt+te)return!1;var wr=($e-Ge)/2,Nr=Math.abs(_e-(Ge+wr));if(Nr>wr+te)return!1;if(jt<=gt||Nr<=wr)return!0;var pr=jt-gt,yt=Nr-wr;return pr*pr+yt*yt<=te*te};function Ta(ve,K,_e,te,me){var Ge=e.create();return K?(e.scale(Ge,Ge,[1/me,1/me,1]),_e||e.rotateZ(Ge,Ge,te.angle)):e.multiply(Ge,te.labelPlaneMatrix,ve),Ge}function Ai(ve,K,_e,te,me){if(K){var Ge=e.clone(ve);return e.scale(Ge,Ge,[me,me,1]),_e||e.rotateZ(Ge,Ge,-te.angle),Ge}else return te.glCoordMatrix}function ki(ve,K){var _e=[ve.x,ve.y,0,1];Oo(_e,_e,K);var te=_e[3];return{point:new e.Point(_e[0]/te,_e[1]/te),signedDistanceFromCamera:te}}function Ki(ve,K){return .5+.5*(ve/K)}function _n(ve,K){var _e=ve[0]/ve[3],te=ve[1]/ve[3],me=_e>=-K[0]&&_e<=K[0]&&te>=-K[1]&&te<=K[1];return me}function Rn(ve,K,_e,te,me,Ge,Le,$e){var gt=te?ve.textSizeData:ve.iconSizeData,jt=e.evaluateSizeForZoom(gt,_e.transform.zoom),wr=[256/_e.width*2+1,256/_e.height*2+1],Nr=te?ve.text.dynamicLayoutVertexArray:ve.icon.dynamicLayoutVertexArray;Nr.clear();for(var pr=ve.lineVertexArray,yt=te?ve.text.placedSymbolArray:ve.icon.placedSymbolArray,kt=_e.transform.width/_e.transform.height,Bt=!1,nr=0;nr<yt.length;nr++){var hr=yt.get(nr);if(hr.hidden||hr.writingMode===e.WritingMode.vertical&&!Bt){hs(hr.numGlyphs,Nr);continue}Bt=!1;var lr=[hr.anchorX,hr.anchorY,0,1];if(e.transformMat4(lr,lr,K),!_n(lr,wr)){hs(hr.numGlyphs,Nr);continue}var dr=lr[3],ur=Ki(_e.transform.cameraToCenterDistance,dr),Ht=e.evaluateSizeForFeature(gt,jt,hr),sr=Le?Ht/ur:Ht*ur,Vt=new e.Point(hr.anchorX,hr.anchorY),Dr=ki(Vt,me).point,Jr={},ga=no(hr,sr,!1,$e,K,me,Ge,ve.glyphOffsetArray,pr,Nr,Dr,Vt,Jr,kt);Bt=ga.useVertical,(ga.notEnoughRoom||Bt||ga.needsFlipping&&no(hr,sr,!0,$e,K,me,Ge,ve.glyphOffsetArray,pr,Nr,Dr,Vt,Jr,kt).notEnoughRoom)&&hs(hr.numGlyphs,Nr)}te?ve.text.dynamicLayoutVertexBuffer.updateData(Nr):ve.icon.dynamicLayoutVertexBuffer.updateData(Nr)}function En(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr){var Nr=$e.glyphStartIndex+$e.numGlyphs,pr=$e.lineStartIndex,yt=$e.lineStartIndex+$e.lineLength,kt=K.getoffsetX($e.glyphStartIndex),Bt=K.getoffsetX(Nr-1),nr=lo(ve*kt,_e,te,me,Ge,Le,$e.segment,pr,yt,gt,jt,wr);if(!nr)return null;var hr=lo(ve*Bt,_e,te,me,Ge,Le,$e.segment,pr,yt,gt,jt,wr);return hr?{first:nr,last:hr}:null}function On(ve,K,_e,te){if(ve===e.WritingMode.horizontal){var me=Math.abs(_e.y-K.y),Ge=Math.abs(_e.x-K.x)*te;if(me>Ge)return{useVertical:!0}}return(ve===e.WritingMode.vertical?K.y<_e.y:K.x>_e.x)?{needsFlipping:!0}:null}function no(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr,pr,yt){var kt=K/24,Bt=ve.lineOffsetX*kt,nr=ve.lineOffsetY*kt,hr;if(ve.numGlyphs>1){var lr=ve.glyphStartIndex+ve.numGlyphs,dr=ve.lineStartIndex,ur=ve.lineStartIndex+ve.lineLength,Ht=En(kt,$e,Bt,nr,_e,wr,Nr,ve,gt,Ge,pr);if(!Ht)return{notEnoughRoom:!0};var sr=ki(Ht.first.point,Le).point,Vt=ki(Ht.last.point,Le).point;if(te&&!_e){var Dr=On(ve.writingMode,sr,Vt,yt);if(Dr)return Dr}hr=[Ht.first];for(var Jr=ve.glyphStartIndex+1;Jr<lr-1;Jr++)hr.push(lo(kt*$e.getoffsetX(Jr),Bt,nr,_e,wr,Nr,ve.segment,dr,ur,gt,Ge,pr));hr.push(Ht.last)}else{if(te&&!_e){var ga=ki(Nr,me).point,vi=ve.lineStartIndex+ve.segment+1,Ga=new e.Point(gt.getx(vi),gt.gety(vi)),ai=ki(Ga,me),Zi=ai.signedDistanceFromCamera>0?ai.point:cn(Nr,Ga,ga,1,me),Fi=On(ve.writingMode,ga,Zi,yt);if(Fi)return Fi}var ui=lo(kt*$e.getoffsetX(ve.glyphStartIndex),Bt,nr,_e,wr,Nr,ve.segment,ve.lineStartIndex,ve.lineStartIndex+ve.lineLength,gt,Ge,pr);if(!ui)return{notEnoughRoom:!0};hr=[ui]}for(var _i=0,Si=hr;_i<Si.length;_i+=1){var Ui=Si[_i];e.addDynamicAttributes(jt,Ui.point,Ui.angle)}return{}}function cn(ve,K,_e,te,me){var Ge=ki(ve.add(ve.sub(K)._unit()),me).point,Le=_e.sub(Ge);return _e.add(Le._mult(te/Le.mag()))}function lo(ve,K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr){var pr=te?ve-K:ve+K,yt=pr>0?1:-1,kt=0;te&&(yt*=-1,kt=Math.PI),yt<0&&(kt+=Math.PI);for(var Bt=yt>0?$e+Le:$e+Le+1,nr=me,hr=me,lr=0,dr=0,ur=Math.abs(pr),Ht=[];lr+dr<=ur;){if(Bt+=yt,Bt<$e||Bt>=gt)return null;if(hr=nr,Ht.push(nr),nr=Nr[Bt],nr===void 0){var sr=new e.Point(jt.getx(Bt),jt.gety(Bt)),Vt=ki(sr,wr);if(Vt.signedDistanceFromCamera>0)nr=Nr[Bt]=Vt.point;else{var Dr=Bt-yt,Jr=lr===0?Ge:new e.Point(jt.getx(Dr),jt.gety(Dr));nr=cn(Jr,sr,hr,ur-lr+1,wr)}}lr+=dr,dr=hr.dist(nr)}var ga=(ur-lr)/dr,vi=nr.sub(hr),Ga=vi.mult(ga)._add(hr);Ga._add(vi._unit()._perp()._mult(_e*yt));var ai=kt+Math.atan2(nr.y-hr.y,nr.x-hr.x);return Ht.push(Ga),{point:Ga,angle:ai,path:Ht}}var Wo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function hs(ve,K){for(var _e=0;_e<ve;_e++){var te=K.length;K.resize(te+4),K.float32.set(Wo,te*3)}}function Oo(ve,K,_e){var te=K[0],me=K[1];return ve[0]=_e[0]*te+_e[4]*me+_e[12],ve[1]=_e[1]*te+_e[5]*me+_e[13],ve[3]=_e[3]*te+_e[7]*me+_e[15],ve}var Wn=100,No=function(K,_e,te){_e===void 0&&(_e=new la(K.width+2*Wn,K.height+2*Wn,25)),te===void 0&&(te=new la(K.width+2*Wn,K.height+2*Wn,25)),this.transform=K,this.grid=_e,this.ignoredGrid=te,this.pitchfactor=Math.cos(K._pitch)*K.cameraToCenterDistance,this.screenRightBoundary=K.width+Wn,this.screenBottomBoundary=K.height+Wn,this.gridRightBoundary=K.width+2*Wn,this.gridBottomBoundary=K.height+2*Wn};No.prototype.placeCollisionBox=function(K,_e,te,me,Ge){var Le=this.projectAndGetPerspectiveRatio(me,K.anchorPointX,K.anchorPointY),$e=te*Le.perspectiveRatio,gt=K.x1*$e+Le.point.x,jt=K.y1*$e+Le.point.y,wr=K.x2*$e+Le.point.x,Nr=K.y2*$e+Le.point.y;return!this.isInsideGrid(gt,jt,wr,Nr)||!_e&&this.grid.hitTest(gt,jt,wr,Nr,Ge)?{box:[],offscreen:!1}:{box:[gt,jt,wr,Nr],offscreen:this.isOffscreen(gt,jt,wr,Nr)}},No.prototype.placeCollisionCircles=function(K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr,pr,yt){var kt=[],Bt=new e.Point(_e.anchorX,_e.anchorY),nr=ki(Bt,Le),hr=Ki(this.transform.cameraToCenterDistance,nr.signedDistanceFromCamera),lr=wr?Ge/hr:Ge*hr,dr=lr/e.ONE_EM,ur=ki(Bt,$e).point,Ht={},sr=_e.lineOffsetX*dr,Vt=_e.lineOffsetY*dr,Dr=En(dr,me,sr,Vt,!1,ur,Bt,_e,te,$e,Ht),Jr=!1,ga=!1,vi=!0;if(Dr){for(var Ga=pr*.5*hr+yt,ai=new e.Point(-Wn,-Wn),Zi=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),Fi=new ya,ui=Dr.first,_i=Dr.last,Si=[],Ui=ui.path.length-1;Ui>=1;Ui--)Si.push(ui.path[Ui]);for(var fn=1;fn<_i.path.length;fn++)Si.push(_i.path[fn]);var _o=Ga*2.5;if(gt){var Bo=Si.map(function(Lp){return ki(Lp,gt)});Bo.some(function(Lp){return Lp.signedDistanceFromCamera<=0})?Si=[]:Si=Bo.map(function(Lp){return Lp.point})}var Ps=[];if(Si.length>0){for(var Do=Si[0].clone(),Ms=Si[0].clone(),Ys=1;Ys<Si.length;Ys++)Do.x=Math.min(Do.x,Si[Ys].x),Do.y=Math.min(Do.y,Si[Ys].y),Ms.x=Math.max(Ms.x,Si[Ys].x),Ms.y=Math.max(Ms.y,Si[Ys].y);Do.x>=ai.x&&Ms.x<=Zi.x&&Do.y>=ai.y&&Ms.y<=Zi.y?Ps=[Si]:Ms.x<ai.x||Do.x>Zi.x||Ms.y<ai.y||Do.y>Zi.y?Ps=[]:Ps=e.clipLine([Si],ai.x,ai.y,Zi.x,Zi.y)}for(var mu=0,Ep=Ps;mu<Ep.length;mu+=1){var kp=Ep[mu];Fi.reset(kp,Ga*.25);var Ph=0;Fi.length<=.5*Ga?Ph=1:Ph=Math.ceil(Fi.paddedLength/_o)+1;for(var qp=0;qp<Ph;qp++){var qd=qp/Math.max(Ph-1,1),ed=Fi.lerp(qd),Ih=ed.x+Wn,td=ed.y+Wn;kt.push(Ih,td,Ga,0);var Kh=Ih-Ga,Rh=td-Ga,Cp=Ih+Ga,Vp=td+Ga;if(vi=vi&&this.isOffscreen(Kh,Rh,Cp,Vp),ga=ga||this.isInsideGrid(Kh,Rh,Cp,Vp),!K&&this.grid.hitTestCircle(Ih,td,Ga,Nr)&&(Jr=!0,!jt))return{circles:[],offscreen:!1,collisionDetected:Jr}}}}return{circles:!jt&&Jr||!ga?[]:kt,offscreen:vi,collisionDetected:Jr}},No.prototype.queryRenderedSymbols=function(K){if(K.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var _e=[],te=1/0,me=1/0,Ge=-1/0,Le=-1/0,$e=0,gt=K;$e<gt.length;$e+=1){var jt=gt[$e],wr=new e.Point(jt.x+Wn,jt.y+Wn);te=Math.min(te,wr.x),me=Math.min(me,wr.y),Ge=Math.max(Ge,wr.x),Le=Math.max(Le,wr.y),_e.push(wr)}for(var Nr=this.grid.query(te,me,Ge,Le).concat(this.ignoredGrid.query(te,me,Ge,Le)),pr={},yt={},kt=0,Bt=Nr;kt<Bt.length;kt+=1){var nr=Bt[kt],hr=nr.key;if(pr[hr.bucketInstanceId]===void 0&&(pr[hr.bucketInstanceId]={}),!pr[hr.bucketInstanceId][hr.featureIndex]){var lr=[new e.Point(nr.x1,nr.y1),new e.Point(nr.x2,nr.y1),new e.Point(nr.x2,nr.y2),new e.Point(nr.x1,nr.y2)];e.polygonIntersectsPolygon(_e,lr)&&(pr[hr.bucketInstanceId][hr.featureIndex]=!0,yt[hr.bucketInstanceId]===void 0&&(yt[hr.bucketInstanceId]=[]),yt[hr.bucketInstanceId].push(hr.featureIndex))}}return yt},No.prototype.insertCollisionBox=function(K,_e,te,me,Ge){var Le=_e?this.ignoredGrid:this.grid,$e={bucketInstanceId:te,featureIndex:me,collisionGroupID:Ge};Le.insert($e,K[0],K[1],K[2],K[3])},No.prototype.insertCollisionCircles=function(K,_e,te,me,Ge){for(var Le=_e?this.ignoredGrid:this.grid,$e={bucketInstanceId:te,featureIndex:me,collisionGroupID:Ge},gt=0;gt<K.length;gt+=4)Le.insertCircle($e,K[gt],K[gt+1],K[gt+2])},No.prototype.projectAndGetPerspectiveRatio=function(K,_e,te){var me=[_e,te,0,1];Oo(me,me,K);var Ge=new e.Point((me[0]/me[3]+1)/2*this.transform.width+Wn,(-me[1]/me[3]+1)/2*this.transform.height+Wn);return{point:Ge,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/me[3])}},No.prototype.isOffscreen=function(K,_e,te,me){return te<Wn||K>=this.screenRightBoundary||me<Wn||_e>this.screenBottomBoundary},No.prototype.isInsideGrid=function(K,_e,te,me){return te>=0&&K<this.gridRightBoundary&&me>=0&&_e<this.gridBottomBoundary},No.prototype.getViewportMatrix=function(){var K=e.identity([]);return e.translate(K,K,[-Wn,-Wn,0]),K};function as(ve,K,_e){return K*(e.EXTENT/(ve.tileSize*Math.pow(2,_e-ve.tileID.overscaledZ)))}var Ns=function(K,_e,te,me){K?this.opacity=Math.max(0,Math.min(1,K.opacity+(K.placed?_e:-_e))):this.opacity=me&&te?1:0,this.placed=te};Ns.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var ss=function(K,_e,te,me,Ge){this.text=new Ns(K?K.text:null,_e,te,Ge),this.icon=new Ns(K?K.icon:null,_e,me,Ge)};ss.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var uo=function(K,_e,te){this.text=K,this.icon=_e,this.skipFade=te},jn=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},Xn=function(K,_e,te,me,Ge){this.bucketInstanceId=K,this.featureIndex=_e,this.sourceLayerIndex=te,this.bucketIndex=me,this.tileID=Ge},ls=function(K){this.crossSourceCollisions=K,this.maxGroupID=0,this.collisionGroups={}};ls.prototype.get=function(K){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[K]){var _e=++this.maxGroupID;this.collisionGroups[K]={ID:_e,predicate:function(te){return te.collisionGroupID===_e}}}return this.collisionGroups[K]};function Cs(ve,K,_e,te,me){var Ge=e.getAnchorAlignment(ve),Le=Ge.horizontalAlign,$e=Ge.verticalAlign,gt=-(Le-.5)*K,jt=-($e-.5)*_e,wr=e.evaluateVariableOffset(ve,te);return new e.Point(gt+wr[0]*me,jt+wr[1]*me)}function Ks(ve,K,_e,te,me,Ge){var Le=ve.x1,$e=ve.x2,gt=ve.y1,jt=ve.y2,wr=ve.anchorPointX,Nr=ve.anchorPointY,pr=new e.Point(K,_e);return te&&pr._rotate(me?Ge:-Ge),{x1:Le+pr.x,y1:gt+pr.y,x2:$e+pr.x,y2:jt+pr.y,anchorPointX:wr,anchorPointY:Nr}}var Xo=function(K,_e,te,me){this.transform=K.clone(),this.collisionIndex=new No(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=_e,this.retainedQueryData={},this.collisionGroups=new ls(te),this.collisionCircleArrays={},this.prevPlacement=me,me&&(me.prevPlacement=void 0),this.placedOrientations={}};Xo.prototype.getBucketParts=function(K,_e,te,me){var Ge=te.getBucket(_e),Le=te.latestFeatureIndex;if(!(!Ge||!Le||_e.id!==Ge.layerIds[0])){var $e=te.collisionBoxArray,gt=Ge.layers[0].layout,jt=Math.pow(2,this.transform.zoom-te.tileID.overscaledZ),wr=te.tileSize/e.EXTENT,Nr=this.transform.calculatePosMatrix(te.tileID.toUnwrapped()),pr=gt.get("text-pitch-alignment")==="map",yt=gt.get("text-rotation-alignment")==="map",kt=as(te,1,this.transform.zoom),Bt=Ta(Nr,pr,yt,this.transform,kt),nr=null;if(pr){var hr=Ai(Nr,pr,yt,this.transform,kt);nr=e.multiply([],this.transform.labelPlaneMatrix,hr)}this.retainedQueryData[Ge.bucketInstanceId]=new Xn(Ge.bucketInstanceId,Le,Ge.sourceLayerIndex,Ge.index,te.tileID);var lr={bucket:Ge,layout:gt,posMatrix:Nr,textLabelPlaneMatrix:Bt,labelToScreenMatrix:nr,scale:jt,textPixelRatio:wr,holdingForFade:te.holdingForFade(),collisionBoxArray:$e,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(Ge.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ge.sourceID)};if(me)for(var dr=0,ur=Ge.sortKeyRanges;dr<ur.length;dr+=1){var Ht=ur[dr],sr=Ht.sortKey,Vt=Ht.symbolInstanceStart,Dr=Ht.symbolInstanceEnd;K.push({sortKey:sr,symbolInstanceStart:Vt,symbolInstanceEnd:Dr,parameters:lr})}else K.push({symbolInstanceStart:0,symbolInstanceEnd:Ge.symbolInstances.length,parameters:lr})}},Xo.prototype.attemptAnchorPlacement=function(K,_e,te,me,Ge,Le,$e,gt,jt,wr,Nr,pr,yt,kt,Bt){var nr=[pr.textOffset0,pr.textOffset1],hr=Cs(K,te,me,nr,Ge),lr=this.collisionIndex.placeCollisionBox(Ks(_e,hr.x,hr.y,Le,$e,this.transform.angle),Nr,gt,jt,wr.predicate);if(Bt){var dr=this.collisionIndex.placeCollisionBox(Ks(Bt,hr.x,hr.y,Le,$e,this.transform.angle),Nr,gt,jt,wr.predicate);if(dr.box.length===0)return}if(lr.box.length>0){var ur;return this.prevPlacement&&this.prevPlacement.variableOffsets[pr.crossTileID]&&this.prevPlacement.placements[pr.crossTileID]&&this.prevPlacement.placements[pr.crossTileID].text&&(ur=this.prevPlacement.variableOffsets[pr.crossTileID].anchor),this.variableOffsets[pr.crossTileID]={textOffset:nr,width:te,height:me,anchor:K,textBoxScale:Ge,prevAnchor:ur},this.markUsedJustification(yt,K,pr,kt),yt.allowVerticalPlacement&&(this.markUsedOrientation(yt,kt,pr),this.placedOrientations[pr.crossTileID]=kt),{shift:hr,placedGlyphBoxes:lr}}},Xo.prototype.placeLayerBucketPart=function(K,_e,te){var me=this,Ge=K.parameters,Le=Ge.bucket,$e=Ge.layout,gt=Ge.posMatrix,jt=Ge.textLabelPlaneMatrix,wr=Ge.labelToScreenMatrix,Nr=Ge.textPixelRatio,pr=Ge.holdingForFade,yt=Ge.collisionBoxArray,kt=Ge.partiallyEvaluatedTextSize,Bt=Ge.collisionGroup,nr=$e.get("text-optional"),hr=$e.get("icon-optional"),lr=$e.get("text-allow-overlap"),dr=$e.get("icon-allow-overlap"),ur=$e.get("text-rotation-alignment")==="map",Ht=$e.get("text-pitch-alignment")==="map",sr=$e.get("icon-text-fit")!=="none",Vt=$e.get("symbol-z-order")==="viewport-y",Dr=lr&&(dr||!Le.hasIconData()||hr),Jr=dr&&(lr||!Le.hasTextData()||nr);!Le.collisionArrays&&yt&&Le.deserializeCollisionBoxes(yt);var ga=function(ui,_i){if(!_e[ui.crossTileID]){if(pr){me.placements[ui.crossTileID]=new uo(!1,!1,!1);return}var Si=!1,Ui=!1,fn=!0,_o=null,Bo={box:null,offscreen:null},Ps={box:null,offscreen:null},Do=null,Ms=null,Ys=null,mu=0,Ep=0,kp=0;_i.textFeatureIndex?mu=_i.textFeatureIndex:ui.useRuntimeCollisionCircles&&(mu=ui.featureIndex),_i.verticalTextFeatureIndex&&(Ep=_i.verticalTextFeatureIndex);var Ph=_i.textBox;if(Ph){var qp=function(cc){var fu=e.WritingMode.horizontal;if(Le.allowVerticalPlacement&&!cc&&me.prevPlacement){var Dh=me.prevPlacement.placedOrientations[ui.crossTileID];Dh&&(me.placedOrientations[ui.crossTileID]=Dh,fu=Dh,me.markUsedOrientation(Le,fu,ui))}return fu},qd=function(cc,fu){if(Le.allowVerticalPlacement&&ui.numVerticalGlyphVertices>0&&_i.verticalTextBox)for(var Dh=0,Iv=Le.writingModes;Dh<Iv.length;Dh+=1){var sm=Iv[Dh];if(sm===e.WritingMode.vertical?(Bo=fu(),Ps=Bo):Bo=cc(),Bo&&Bo.box&&Bo.box.length)break}else Bo=cc()};if($e.get("text-variable-anchor")){var Kh=$e.get("text-variable-anchor");if(me.prevPlacement&&me.prevPlacement.variableOffsets[ui.crossTileID]){var Rh=me.prevPlacement.variableOffsets[ui.crossTileID];Kh.indexOf(Rh.anchor)>0&&(Kh=Kh.filter(function(cc){return cc!==Rh.anchor}),Kh.unshift(Rh.anchor))}var Cp=function(cc,fu,Dh){for(var Iv=cc.x2-cc.x1,sm=cc.y2-cc.y1,Mu=ui.textBoxScale,w0=sr&&!dr?fu:null,sv={box:[],offscreen:!1},xg=lr?Kh.length*2:Kh.length,Pp=0;Pp<xg;++Pp){var lv=Kh[Pp%Kh.length],bg=Pp>=Kh.length,T0=me.attemptAnchorPlacement(lv,cc,Iv,sm,Mu,ur,Ht,Nr,gt,Bt,bg,ui,Le,Dh,w0);if(T0&&(sv=T0.placedGlyphBoxes,sv&&sv.box&&sv.box.length)){Si=!0,_o=T0.shift;break}}return sv},Vp=function(){return Cp(Ph,_i.iconBox,e.WritingMode.horizontal)},Lp=function(){var cc=_i.verticalTextBox,fu=Bo&&Bo.box&&Bo.box.length;return Le.allowVerticalPlacement&&!fu&&ui.numVerticalGlyphVertices>0&&cc?Cp(cc,_i.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};qd(Vp,Lp),Bo&&(Si=Bo.box,fn=Bo.offscreen);var Cv=qp(Bo&&Bo.box);if(!Si&&me.prevPlacement){var Vd=me.prevPlacement.variableOffsets[ui.crossTileID];Vd&&(me.variableOffsets[ui.crossTileID]=Vd,me.markUsedJustification(Le,Vd.anchor,ui,Cv))}}else{var ed=function(cc,fu){var Dh=me.collisionIndex.placeCollisionBox(cc,lr,Nr,gt,Bt.predicate);return Dh&&Dh.box&&Dh.box.length&&(me.markUsedOrientation(Le,fu,ui),me.placedOrientations[ui.crossTileID]=fu),Dh},Ih=function(){return ed(Ph,e.WritingMode.horizontal)},td=function(){var cc=_i.verticalTextBox;return Le.allowVerticalPlacement&&ui.numVerticalGlyphVertices>0&&cc?ed(cc,e.WritingMode.vertical):{box:null,offscreen:null}};qd(Ih,td),qp(Bo&&Bo.box&&Bo.box.length)}}if(Do=Bo,Si=Do&&Do.box&&Do.box.length>0,fn=Do&&Do.offscreen,ui.useRuntimeCollisionCircles){var Gf=Le.text.placedSymbolArray.get(ui.centerJustifiedTextSymbolIndex),Gd=e.evaluateSizeForFeature(Le.textSizeData,kt,Gf),Lv=$e.get("text-padding"),ph=ui.collisionCircleDiameter;Ms=me.collisionIndex.placeCollisionCircles(lr,Gf,Le.lineVertexArray,Le.glyphOffsetArray,Gd,gt,jt,wr,te,Ht,Bt.predicate,ph,Lv),Si=lr||Ms.circles.length>0&&!Ms.collisionDetected,fn=fn&&Ms.offscreen}if(_i.iconFeatureIndex&&(kp=_i.iconFeatureIndex),_i.iconBox){var iv=function(cc){var fu=sr&&_o?Ks(cc,_o.x,_o.y,ur,Ht,me.transform.angle):cc;return me.collisionIndex.placeCollisionBox(fu,dr,Nr,gt,Bt.predicate)};Ps&&Ps.box&&Ps.box.length&&_i.verticalIconBox?(Ys=iv(_i.verticalIconBox),Ui=Ys.box.length>0):(Ys=iv(_i.iconBox),Ui=Ys.box.length>0),fn=fn&&Ys.offscreen}var nm=nr||ui.numHorizontalGlyphVertices===0&&ui.numVerticalGlyphVertices===0,om=hr||ui.numIconVertices===0;if(!nm&&!om?Ui=Si=Ui&&Si:om?nm||(Ui=Ui&&Si):Si=Ui&&Si,Si&&Do&&Do.box&&(Ps&&Ps.box&&Ep?me.collisionIndex.insertCollisionBox(Do.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,Ep,Bt.ID):me.collisionIndex.insertCollisionBox(Do.box,$e.get("text-ignore-placement"),Le.bucketInstanceId,mu,Bt.ID)),Ui&&Ys&&me.collisionIndex.insertCollisionBox(Ys.box,$e.get("icon-ignore-placement"),Le.bucketInstanceId,kp,Bt.ID),Ms&&(Si&&me.collisionIndex.insertCollisionCircles(Ms.circles,$e.get("text-ignore-placement"),Le.bucketInstanceId,mu,Bt.ID),te)){var Pv=Le.bucketInstanceId,nv=me.collisionCircleArrays[Pv];nv===void 0&&(nv=me.collisionCircleArrays[Pv]=new jn);for(var ov=0;ov<Ms.circles.length;ov+=4)nv.circles.push(Ms.circles[ov+0]),nv.circles.push(Ms.circles[ov+1]),nv.circles.push(Ms.circles[ov+2]),nv.circles.push(Ms.collisionDetected?1:0)}me.placements[ui.crossTileID]=new uo(Si||Dr,Ui||Jr,fn||Le.justReloaded),_e[ui.crossTileID]=!0}};if(Vt)for(var vi=Le.getSortedSymbolIndexes(this.transform.angle),Ga=vi.length-1;Ga>=0;--Ga){var ai=vi[Ga];ga(Le.symbolInstances.get(ai),Le.collisionArrays[ai])}else for(var Zi=K.symbolInstanceStart;Zi<K.symbolInstanceEnd;Zi++)ga(Le.symbolInstances.get(Zi),Le.collisionArrays[Zi]);if(te&&Le.bucketInstanceId in this.collisionCircleArrays){var Fi=this.collisionCircleArrays[Le.bucketInstanceId];e.invert(Fi.invProjMatrix,gt),Fi.viewportMatrix=this.collisionIndex.getViewportMatrix()}Le.justReloaded=!1},Xo.prototype.markUsedJustification=function(K,_e,te,me){var Ge={left:te.leftJustifiedTextSymbolIndex,center:te.centerJustifiedTextSymbolIndex,right:te.rightJustifiedTextSymbolIndex},Le;me===e.WritingMode.vertical?Le=te.verticalPlacedTextSymbolIndex:Le=Ge[e.getAnchorJustification(_e)];for(var $e=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex,te.verticalPlacedTextSymbolIndex],gt=0,jt=$e;gt<jt.length;gt+=1){var wr=jt[gt];wr>=0&&(Le>=0&&wr!==Le?K.text.placedSymbolArray.get(wr).crossTileID=0:K.text.placedSymbolArray.get(wr).crossTileID=te.crossTileID)}},Xo.prototype.markUsedOrientation=function(K,_e,te){for(var me=_e===e.WritingMode.horizontal||_e===e.WritingMode.horizontalOnly?_e:0,Ge=_e===e.WritingMode.vertical?_e:0,Le=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],$e=0,gt=Le;$e<gt.length;$e+=1){var jt=gt[$e];K.text.placedSymbolArray.get(jt).placedOrientation=me}te.verticalPlacedTextSymbolIndex&&(K.text.placedSymbolArray.get(te.verticalPlacedTextSymbolIndex).placedOrientation=Ge)},Xo.prototype.commit=function(K){this.commitTime=K,this.zoomAtLastRecencyCheck=this.transform.zoom;var _e=this.prevPlacement,te=!1;this.prevZoomAdjustment=_e?_e.zoomAdjustment(this.transform.zoom):0;var me=_e?_e.symbolFadeChange(K):1,Ge=_e?_e.opacities:{},Le=_e?_e.variableOffsets:{},$e=_e?_e.placedOrientations:{};for(var gt in this.placements){var jt=this.placements[gt],wr=Ge[gt];wr?(this.opacities[gt]=new ss(wr,me,jt.text,jt.icon),te=te||jt.text!==wr.text.placed||jt.icon!==wr.icon.placed):(this.opacities[gt]=new ss(null,me,jt.text,jt.icon,jt.skipFade),te=te||jt.text||jt.icon)}for(var Nr in Ge){var pr=Ge[Nr];if(!this.opacities[Nr]){var yt=new ss(pr,me,!1,!1);yt.isHidden()||(this.opacities[Nr]=yt,te=te||pr.text.placed||pr.icon.placed)}}for(var kt in Le)!this.variableOffsets[kt]&&this.opacities[kt]&&!this.opacities[kt].isHidden()&&(this.variableOffsets[kt]=Le[kt]);for(var Bt in $e)!this.placedOrientations[Bt]&&this.opacities[Bt]&&!this.opacities[Bt].isHidden()&&(this.placedOrientations[Bt]=$e[Bt]);te?this.lastPlacementChangeTime=K:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=_e?_e.lastPlacementChangeTime:K)},Xo.prototype.updateLayerOpacities=function(K,_e){for(var te={},me=0,Ge=_e;me<Ge.length;me+=1){var Le=Ge[me],$e=Le.getBucket(K);$e&&Le.latestFeatureIndex&&K.id===$e.layerIds[0]&&this.updateBucketOpacities($e,te,Le.collisionBoxArray)}},Xo.prototype.updateBucketOpacities=function(K,_e,te){var me=this;K.hasTextData()&&K.text.opacityVertexArray.clear(),K.hasIconData()&&K.icon.opacityVertexArray.clear(),K.hasIconCollisionBoxData()&&K.iconCollisionBox.collisionVertexArray.clear(),K.hasTextCollisionBoxData()&&K.textCollisionBox.collisionVertexArray.clear();var Ge=K.layers[0].layout,Le=new ss(null,0,!1,!1,!0),$e=Ge.get("text-allow-overlap"),gt=Ge.get("icon-allow-overlap"),jt=Ge.get("text-variable-anchor"),wr=Ge.get("text-rotation-alignment")==="map",Nr=Ge.get("text-pitch-alignment")==="map",pr=Ge.get("icon-text-fit")!=="none",yt=new ss(null,0,$e&&(gt||!K.hasIconData()||Ge.get("icon-optional")),gt&&($e||!K.hasTextData()||Ge.get("text-optional")),!0);!K.collisionArrays&&te&&(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData())&&K.deserializeCollisionBoxes(te);for(var kt=function(lr,dr,ur){for(var Ht=0;Ht<dr/4;Ht++)lr.opacityVertexArray.emplaceBack(ur)},Bt=function(lr){var dr=K.symbolInstances.get(lr),ur=dr.numHorizontalGlyphVertices,Ht=dr.numVerticalGlyphVertices,sr=dr.crossTileID,Vt=_e[sr],Dr=me.opacities[sr];Vt?Dr=Le:Dr||(Dr=yt,me.opacities[sr]=Dr),_e[sr]=!0;var Jr=ur>0||Ht>0,ga=dr.numIconVertices>0,vi=me.placedOrientations[dr.crossTileID],Ga=vi===e.WritingMode.vertical,ai=vi===e.WritingMode.horizontal||vi===e.WritingMode.horizontalOnly;if(Jr){var Zi=il(Dr.text),Fi=Ga?xn:Zi;kt(K.text,ur,Fi);var ui=ai?xn:Zi;kt(K.text,Ht,ui);var _i=Dr.text.isHidden();[dr.rightJustifiedTextSymbolIndex,dr.centerJustifiedTextSymbolIndex,dr.leftJustifiedTextSymbolIndex].forEach(function(kp){kp>=0&&(K.text.placedSymbolArray.get(kp).hidden=_i||Ga?1:0)}),dr.verticalPlacedTextSymbolIndex>=0&&(K.text.placedSymbolArray.get(dr.verticalPlacedTextSymbolIndex).hidden=_i||ai?1:0);var Si=me.variableOffsets[dr.crossTileID];Si&&me.markUsedJustification(K,Si.anchor,dr,vi);var Ui=me.placedOrientations[dr.crossTileID];Ui&&(me.markUsedJustification(K,"left",dr,Ui),me.markUsedOrientation(K,Ui,dr))}if(ga){var fn=il(Dr.icon),_o=!(pr&&dr.verticalPlacedIconSymbolIndex&&Ga);if(dr.placedIconSymbolIndex>=0){var Bo=_o?fn:xn;kt(K.icon,dr.numIconVertices,Bo),K.icon.placedSymbolArray.get(dr.placedIconSymbolIndex).hidden=Dr.icon.isHidden()}if(dr.verticalPlacedIconSymbolIndex>=0){var Ps=_o?xn:fn;kt(K.icon,dr.numVerticalIconVertices,Ps),K.icon.placedSymbolArray.get(dr.verticalPlacedIconSymbolIndex).hidden=Dr.icon.isHidden()}}if(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData()){var Do=K.collisionArrays[lr];if(Do){var Ms=new e.Point(0,0);if(Do.textBox||Do.verticalTextBox){var Ys=!0;if(jt){var mu=me.variableOffsets[sr];mu?(Ms=Cs(mu.anchor,mu.width,mu.height,mu.textOffset,mu.textBoxScale),wr&&Ms._rotate(Nr?me.transform.angle:-me.transform.angle)):Ys=!1}Do.textBox&&Gi(K.textCollisionBox.collisionVertexArray,Dr.text.placed,!Ys||Ga,Ms.x,Ms.y),Do.verticalTextBox&&Gi(K.textCollisionBox.collisionVertexArray,Dr.text.placed,!Ys||ai,Ms.x,Ms.y)}var Ep=!!(!ai&&Do.verticalIconBox);Do.iconBox&&Gi(K.iconCollisionBox.collisionVertexArray,Dr.icon.placed,Ep,pr?Ms.x:0,pr?Ms.y:0),Do.verticalIconBox&&Gi(K.iconCollisionBox.collisionVertexArray,Dr.icon.placed,!Ep,pr?Ms.x:0,pr?Ms.y:0)}}},nr=0;nr<K.symbolInstances.length;nr++)Bt(nr);if(K.sortFeatures(this.transform.angle),this.retainedQueryData[K.bucketInstanceId]&&(this.retainedQueryData[K.bucketInstanceId].featureSortOrder=K.featureSortOrder),K.hasTextData()&&K.text.opacityVertexBuffer&&K.text.opacityVertexBuffer.updateData(K.text.opacityVertexArray),K.hasIconData()&&K.icon.opacityVertexBuffer&&K.icon.opacityVertexBuffer.updateData(K.icon.opacityVertexArray),K.hasIconCollisionBoxData()&&K.iconCollisionBox.collisionVertexBuffer&&K.iconCollisionBox.collisionVertexBuffer.updateData(K.iconCollisionBox.collisionVertexArray),K.hasTextCollisionBoxData()&&K.textCollisionBox.collisionVertexBuffer&&K.textCollisionBox.collisionVertexBuffer.updateData(K.textCollisionBox.collisionVertexArray),K.bucketInstanceId in this.collisionCircleArrays){var hr=this.collisionCircleArrays[K.bucketInstanceId];K.placementInvProjMatrix=hr.invProjMatrix,K.placementViewportMatrix=hr.viewportMatrix,K.collisionCircleArray=hr.circles,delete this.collisionCircleArrays[K.bucketInstanceId]}},Xo.prototype.symbolFadeChange=function(K){return this.fadeDuration===0?1:(K-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Xo.prototype.zoomAdjustment=function(K){return Math.max(0,(this.transform.zoom-K)/1.5)},Xo.prototype.hasTransitions=function(K){return this.stale||K-this.lastPlacementChangeTime<this.fadeDuration},Xo.prototype.stillRecent=function(K,_e){var te=this.zoomAtLastRecencyCheck===_e?1-this.zoomAdjustment(_e):1;return this.zoomAtLastRecencyCheck=_e,this.commitTime+this.fadeDuration*te>K},Xo.prototype.setStale=function(){this.stale=!0};function Gi(ve,K,_e,te,me){ve.emplaceBack(K?1:0,_e?1:0,te||0,me||0),ve.emplaceBack(K?1:0,_e?1:0,te||0,me||0),ve.emplaceBack(K?1:0,_e?1:0,te||0,me||0),ve.emplaceBack(K?1:0,_e?1:0,te||0,me||0)}var Ln=Math.pow(2,25),Us=Math.pow(2,24),_s=Math.pow(2,17),Gn=Math.pow(2,16),zs=Math.pow(2,9),vs=Math.pow(2,8),Ws=Math.pow(2,1);function il(ve){if(ve.opacity===0&&!ve.placed)return 0;if(ve.opacity===1&&ve.placed)return 4294967295;var K=ve.placed?1:0,_e=Math.floor(ve.opacity*127);return _e*Ln+K*Us+_e*_s+K*Gn+_e*zs+K*vs+_e*Ws+K}var xn=0,ko=function(K){this._sortAcrossTiles=K.layout.get("symbol-z-order")!=="viewport-y"&&K.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ko.prototype.continuePlacement=function(K,_e,te,me,Ge){for(var Le=this._bucketParts;this._currentTileIndex<K.length;){var $e=K[this._currentTileIndex];if(_e.getBucketParts(Le,me,$e,this._sortAcrossTiles),this._currentTileIndex++,Ge())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Le.sort(function(jt,wr){return jt.sortKey-wr.sortKey}));this._currentPartIndex<Le.length;){var gt=Le[this._currentPartIndex];if(_e.placeLayerBucketPart(gt,this._seenCrossTileIDs,te),this._currentPartIndex++,Ge())return!0}return!1};var bo=function(K,_e,te,me,Ge,Le,$e){this.placement=new Xo(K,Ge,Le,$e),this._currentPlacementIndex=_e.length-1,this._forceFullPlacement=te,this._showCollisionBoxes=me,this._done=!1};bo.prototype.isDone=function(){return this._done},bo.prototype.continuePlacement=function(K,_e,te){for(var me=this,Ge=e.browser.now(),Le=function(){var Nr=e.browser.now()-Ge;return me._forceFullPlacement?!1:Nr>2};this._currentPlacementIndex>=0;){var $e=K[this._currentPlacementIndex],gt=_e[$e],jt=this.placement.collisionIndex.transform.zoom;if(gt.type==="symbol"&&(!gt.minzoom||gt.minzoom<=jt)&&(!gt.maxzoom||gt.maxzoom>jt)){this._inProgressLayer||(this._inProgressLayer=new ko(gt));var wr=this._inProgressLayer.continuePlacement(te[gt.source],this.placement,this._showCollisionBoxes,gt,Le);if(wr)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},bo.prototype.commit=function(K){return this.placement.commit(K),this.placement};var Is=512/e.EXTENT/2,pu=function(K,_e,te){this.tileID=K,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var me=0;me<_e.length;me++){var Ge=_e.get(me),Le=Ge.key;this.indexedSymbolInstances[Le]||(this.indexedSymbolInstances[Le]=[]),this.indexedSymbolInstances[Le].push({crossTileID:Ge.crossTileID,coord:this.getScaledCoordinates(Ge,K)})}};pu.prototype.getScaledCoordinates=function(K,_e){var te=_e.canonical.z-this.tileID.canonical.z,me=Is/Math.pow(2,te);return{x:Math.floor((_e.canonical.x*e.EXTENT+K.anchorX)*me),y:Math.floor((_e.canonical.y*e.EXTENT+K.anchorY)*me)}},pu.prototype.findMatches=function(K,_e,te){for(var me=this.tileID.canonical.z<_e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-_e.canonical.z),Ge=0;Ge<K.length;Ge++){var Le=K.get(Ge);if(!Le.crossTileID){var $e=this.indexedSymbolInstances[Le.key];if($e)for(var gt=this.getScaledCoordinates(Le,_e),jt=0,wr=$e;jt<wr.length;jt+=1){var Nr=wr[jt];if(Math.abs(Nr.coord.x-gt.x)<=me&&Math.abs(Nr.coord.y-gt.y)<=me&&!te[Nr.crossTileID]){te[Nr.crossTileID]=!0,Le.crossTileID=Nr.crossTileID;break}}}}};var co=function(){this.maxCrossTileID=0};co.prototype.generate=function(){return++this.maxCrossTileID};var Vs=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Vs.prototype.handleWrapJump=function(K){var _e=Math.round((K-this.lng)/360);if(_e!==0)for(var te in this.indexes){var me=this.indexes[te],Ge={};for(var Le in me){var $e=me[Le];$e.tileID=$e.tileID.unwrapTo($e.tileID.wrap+_e),Ge[$e.tileID.key]=$e}this.indexes[te]=Ge}this.lng=K},Vs.prototype.addBucket=function(K,_e,te){if(this.indexes[K.overscaledZ]&&this.indexes[K.overscaledZ][K.key]){if(this.indexes[K.overscaledZ][K.key].bucketInstanceId===_e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(K.overscaledZ,this.indexes[K.overscaledZ][K.key])}for(var me=0;me<_e.symbolInstances.length;me++){var Ge=_e.symbolInstances.get(me);Ge.crossTileID=0}this.usedCrossTileIDs[K.overscaledZ]||(this.usedCrossTileIDs[K.overscaledZ]={});var Le=this.usedCrossTileIDs[K.overscaledZ];for(var $e in this.indexes){var gt=this.indexes[$e];if(Number($e)>K.overscaledZ)for(var jt in gt){var wr=gt[jt];wr.tileID.isChildOf(K)&&wr.findMatches(_e.symbolInstances,K,Le)}else{var Nr=K.scaledTo(Number($e)),pr=gt[Nr.key];pr&&pr.findMatches(_e.symbolInstances,K,Le)}}for(var yt=0;yt<_e.symbolInstances.length;yt++){var kt=_e.symbolInstances.get(yt);kt.crossTileID||(kt.crossTileID=te.generate(),Le[kt.crossTileID]=!0)}return this.indexes[K.overscaledZ]===void 0&&(this.indexes[K.overscaledZ]={}),this.indexes[K.overscaledZ][K.key]=new pu(K,_e.symbolInstances,_e.bucketInstanceId),!0},Vs.prototype.removeBucketCrossTileIDs=function(K,_e){for(var te in _e.indexedSymbolInstances)for(var me=0,Ge=_e.indexedSymbolInstances[te];me<Ge.length;me+=1){var Le=Ge[me];delete this.usedCrossTileIDs[K][Le.crossTileID]}},Vs.prototype.removeStaleBuckets=function(K){var _e=!1;for(var te in this.indexes){var me=this.indexes[te];for(var Ge in me)K[me[Ge].bucketInstanceId]||(this.removeBucketCrossTileIDs(te,me[Ge]),delete me[Ge],_e=!0)}return _e};var vl=function(){this.layerIndexes={},this.crossTileIDs=new co,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};vl.prototype.addLayer=function(K,_e,te){var me=this.layerIndexes[K.id];me===void 0&&(me=this.layerIndexes[K.id]=new Vs);var Ge=!1,Le={};me.handleWrapJump(te);for(var $e=0,gt=_e;$e<gt.length;$e+=1){var jt=gt[$e],wr=jt.getBucket(K);!wr||K.id!==wr.layerIds[0]||(wr.bucketInstanceId||(wr.bucketInstanceId=++this.maxBucketInstanceId),me.addBucket(jt.tileID,wr,this.crossTileIDs)&&(Ge=!0),Le[wr.bucketInstanceId]=!0)}return me.removeStaleBuckets(Le)&&(Ge=!0),Ge},vl.prototype.pruneUnusedLayers=function(K){var _e={};K.forEach(function(me){_e[me]=!0});for(var te in this.layerIndexes)_e[te]||delete this.layerIndexes[te]};var Ts=function(ve,K){return e.emitValidationErrors(ve,K&&K.filter(function(_e){return _e.identifier!=="source.canvas"}))},js=e.pick(Cr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),us=e.pick(Cr,["setCenter","setZoom","setBearing","setPitch"]),As=Br(),Nl=function(ve){function K(_e,te){var me=this;te===void 0&&(te={}),ve.call(this),this.map=_e,this.dispatcher=new N(tn(),this),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new y(_e._requestManager,te.localIdeographFontFamily),this.lineAtlas=new F(256,512),this.crossTileSymbolIndex=new vl,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());var Ge=this;this._rtlTextPluginCallback=K.registerForPluginStateChange(function(Le){var $e={pluginStatus:Le.pluginStatus,pluginURL:Le.pluginURL};Ge.dispatcher.broadcast("syncRTLPluginState",$e,function(gt,jt){if(e.triggerPluginCompletionEvent(gt),jt){var wr=jt.every(function(pr){return pr});if(wr)for(var Nr in Ge.sourceCaches)Ge.sourceCaches[Nr].reload()}})}),this.on("data",function(Le){if(!(Le.dataType!=="source"||Le.sourceDataType!=="metadata")){var $e=me.sourceCaches[Le.sourceId];if($e){var gt=$e.getSource();if(!(!gt||!gt.vectorLayerIds))for(var jt in me._layers){var wr=me._layers[jt];wr.source===gt.id&&me._validateLayer(wr)}}}})}return ve&&(K.__proto__=ve),K.prototype=Object.create(ve&&ve.prototype),K.prototype.constructor=K,K.prototype.loadURL=function(te,me){var Ge=this;me===void 0&&(me={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var Le=typeof me.validate=="boolean"?me.validate:!e.isMapboxURL(te);te=this.map._requestManager.normalizeStyleURL(te,me.accessToken);var $e=this.map._requestManager.transformRequest(te,e.ResourceType.Style);this._request=e.getJSON($e,function(gt,jt){Ge._request=null,gt?Ge.fire(new e.ErrorEvent(gt)):jt&&Ge._load(jt,Le)})},K.prototype.loadJSON=function(te,me){var Ge=this;me===void 0&&(me={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame(function(){Ge._request=null,Ge._load(te,me.validate!==!1)})},K.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(As,!1)},K.prototype._load=function(te,me){if(!(me&&Ts(this,e.validateStyle(te)))){this._loaded=!0,this.stylesheet=te;for(var Ge in te.sources)this.addSource(Ge,te.sources[Ge],{validate:!1});te.sprite?this._loadSprite(te.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(te.glyphs);var Le=ut(this.stylesheet.layers);this._order=Le.map(function(wr){return wr.id}),this._layers={},this._serializedLayers={};for(var $e=0,gt=Le;$e<gt.length;$e+=1){var jt=gt[$e];jt=e.createStyleLayer(jt),jt.setEventedParent(this,{layer:{id:jt.id}}),this._layers[jt.id]=jt,this._serializedLayers[jt.id]=jt.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new z(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},K.prototype._loadSprite=function(te){var me=this;this._spriteRequest=p(te,this.map._requestManager,function(Ge,Le){if(me._spriteRequest=null,Ge)me.fire(new e.ErrorEvent(Ge));else if(Le)for(var $e in Le)me.imageManager.addImage($e,Le[$e]);me.imageManager.setLoaded(!0),me._availableImages=me.imageManager.listImages(),me.dispatcher.broadcast("setImages",me._availableImages),me.fire(new e.Event("data",{dataType:"style"}))})},K.prototype._validateLayer=function(te){var me=this.sourceCaches[te.source];if(me){var Ge=te.sourceLayer;if(Ge){var Le=me.getSource();(Le.type==="geojson"||Le.vectorLayerIds&&Le.vectorLayerIds.indexOf(Ge)===-1)&&this.fire(new e.ErrorEvent(new Error('Source layer "'+Ge+'" does not exist on source "'+Le.id+'" as specified by style layer "'+te.id+'"')))}}},K.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var te in this.sourceCaches)if(!this.sourceCaches[te].loaded())return!1;return!!this.imageManager.isLoaded()},K.prototype._serializeLayers=function(te){for(var me=[],Ge=0,Le=te;Ge<Le.length;Ge+=1){var $e=Le[Ge],gt=this._layers[$e];gt.type!=="custom"&&me.push(gt.serialize())}return me},K.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var te in this.sourceCaches)if(this.sourceCaches[te].hasTransition())return!0;for(var me in this._layers)if(this._layers[me].hasTransition())return!0;return!1},K.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},K.prototype.update=function(te){if(this._loaded){var me=this._changed;if(this._changed){var Ge=Object.keys(this._updatedLayers),Le=Object.keys(this._removedLayers);(Ge.length||Le.length)&&this._updateWorkerLayers(Ge,Le);for(var $e in this._updatedSources){var gt=this._updatedSources[$e];gt==="reload"?this._reloadSource($e):gt==="clear"&&this._clearSource($e)}this._updateTilesForChangedImages();for(var jt in this._updatedPaintProps)this._layers[jt].updateTransitions(te);this.light.updateTransitions(te),this._resetUpdates()}var wr={};for(var Nr in this.sourceCaches){var pr=this.sourceCaches[Nr];wr[Nr]=pr.used,pr.used=!1}for(var yt=0,kt=this._order;yt<kt.length;yt+=1){var Bt=kt[yt],nr=this._layers[Bt];nr.recalculate(te,this._availableImages),!nr.isHidden(te.zoom)&&nr.source&&(this.sourceCaches[nr.source].used=!0)}for(var hr in wr){var lr=this.sourceCaches[hr];wr[hr]!==lr.used&&lr.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:hr}))}this.light.recalculate(te),this.z=te.zoom,me&&this.fire(new e.Event("data",{dataType:"style"}))}},K.prototype._updateTilesForChangedImages=function(){var te=Object.keys(this._changedImages);if(te.length){for(var me in this.sourceCaches)this.sourceCaches[me].reloadTilesForDependencies(["icons","patterns"],te);this._changedImages={}}},K.prototype._updateWorkerLayers=function(te,me){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(te),removedIds:me})},K.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},K.prototype.setState=function(te){var me=this;if(this._checkLoaded(),Ts(this,e.validateStyle(te)))return!1;te=e.clone$1(te),te.layers=ut(te.layers);var Ge=Pa(this.serialize(),te).filter(function($e){return!($e.command in us)});if(Ge.length===0)return!1;var Le=Ge.filter(function($e){return!($e.command in js)});if(Le.length>0)throw new Error("Unimplemented: "+Le.map(function($e){return $e.command}).join(", ")+".");return Ge.forEach(function($e){$e.command!=="setTransition"&&me[$e.command].apply(me,$e.args)}),this.stylesheet=te,!0},K.prototype.addImage=function(te,me){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,me),this._afterImageUpdated(te)},K.prototype.updateImage=function(te,me){this.imageManager.updateImage(te,me)},K.prototype.getImage=function(te){return this.imageManager.getImage(te)},K.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},K.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},K.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},K.prototype.addSource=function(te,me,Ge){var Le=this;if(Ge===void 0&&(Ge={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(me).join(", ")+".");var $e=["vector","raster","geojson","video","image"],gt=$e.indexOf(me.type)>=0;if(!(gt&&this._validate(e.validateStyle.source,"sources."+te,me,null,Ge))){this.map&&this.map._collectResourceTiming&&(me.collectResourceTiming=!0);var jt=this.sourceCaches[te]=new ra(te,me,this.dispatcher);jt.style=this,jt.setEventedParent(this,function(){return{isSourceLoaded:Le.loaded(),source:jt.serialize(),sourceId:te}}),jt.onAdd(this.map),this._changed=!0}},K.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var me in this._layers)if(this._layers[me].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+me+'" is using it.')));var Ge=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ge.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ge.setEventedParent(null),Ge.clearTiles(),Ge.onRemove&&Ge.onRemove(this.map),this._changed=!0},K.prototype.setGeoJSONSourceData=function(te,me){this._checkLoaded();var Ge=this.sourceCaches[te].getSource();Ge.setData(me),this._changed=!0},K.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},K.prototype.addLayer=function(te,me,Ge){Ge===void 0&&(Ge={}),this._checkLoaded();var Le=te.id;if(this.getLayer(Le)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Le+'" already exists on this map')));return}var $e;if(te.type==="custom"){if(Ts(this,e.validateCustomStyleLayer(te)))return;$e=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(Le,te.source),te=e.clone$1(te),te=e.extend(te,{source:Le})),this._validate(e.validateStyle.layer,"layers."+Le,te,{arrayIndex:-1},Ge))return;$e=e.createStyleLayer(te),this._validateLayer($e),$e.setEventedParent(this,{layer:{id:Le}}),this._serializedLayers[$e.id]=$e.serialize()}var gt=me?this._order.indexOf(me):this._order.length;if(me&>===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}if(this._order.splice(gt,0,Le),this._layerOrderChanged=!0,this._layers[Le]=$e,this._removedLayers[Le]&&$e.source&&$e.type!=="custom"){var jt=this._removedLayers[Le];delete this._removedLayers[Le],jt.type!==$e.type?this._updatedSources[$e.source]="clear":(this._updatedSources[$e.source]="reload",this.sourceCaches[$e.source].pause())}this._updateLayer($e),$e.onAdd&&$e.onAdd(this.map)},K.prototype.moveLayer=function(te,me){this._checkLoaded(),this._changed=!0;var Ge=this._layers[te];if(!Ge){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==me){var Le=this._order.indexOf(te);this._order.splice(Le,1);var $e=me?this._order.indexOf(me):this._order.length;if(me&&$e===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}this._order.splice($e,0,te),this._layerOrderChanged=!0}},K.prototype.removeLayer=function(te){this._checkLoaded();var me=this._layers[te];if(!me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}me.setEventedParent(null);var Ge=this._order.indexOf(te);this._order.splice(Ge,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=me,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],me.onRemove&&me.onRemove(this.map)},K.prototype.getLayer=function(te){return this._layers[te]},K.prototype.hasLayer=function(te){return te in this._layers},K.prototype.setLayerZoomRange=function(te,me,Ge){this._checkLoaded();var Le=this.getLayer(te);if(!Le){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}Le.minzoom===me&&Le.maxzoom===Ge||(me!=null&&(Le.minzoom=me),Ge!=null&&(Le.maxzoom=Ge),this._updateLayer(Le))},K.prototype.setFilter=function(te,me,Ge){Ge===void 0&&(Ge={}),this._checkLoaded();var Le=this.getLayer(te);if(!Le){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(Le.filter,me)){if(me==null){Le.filter=void 0,this._updateLayer(Le);return}this._validate(e.validateStyle.filter,"layers."+Le.id+".filter",me,null,Ge)||(Le.filter=e.clone$1(me),this._updateLayer(Le))}},K.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},K.prototype.setLayoutProperty=function(te,me,Ge,Le){Le===void 0&&(Le={}),this._checkLoaded();var $e=this.getLayer(te);if(!$e){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual($e.getLayoutProperty(me),Ge)||($e.setLayoutProperty(me,Ge,Le),this._updateLayer($e))},K.prototype.getLayoutProperty=function(te,me){var Ge=this.getLayer(te);if(!Ge){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ge.getLayoutProperty(me)},K.prototype.setPaintProperty=function(te,me,Ge,Le){Le===void 0&&(Le={}),this._checkLoaded();var $e=this.getLayer(te);if(!$e){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual($e.getPaintProperty(me),Ge)){var gt=$e.setPaintProperty(me,Ge,Le);gt&&this._updateLayer($e),this._changed=!0,this._updatedPaintProps[te]=!0}},K.prototype.getPaintProperty=function(te,me){return this.getLayer(te).getPaintProperty(me)},K.prototype.setFeatureState=function(te,me){this._checkLoaded();var Ge=te.source,Le=te.sourceLayer,$e=this.sourceCaches[Ge];if($e===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ge+"' does not exist in the map's style.")));return}var gt=$e.getSource().type;if(gt==="geojson"&&Le){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(gt==="vector"&&!Le){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),$e.setFeatureState(Le,te.id,me)},K.prototype.removeFeatureState=function(te,me){this._checkLoaded();var Ge=te.source,Le=this.sourceCaches[Ge];if(Le===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ge+"' does not exist in the map's style.")));return}var $e=Le.getSource().type,gt=$e==="vector"?te.sourceLayer:void 0;if($e==="vector"&&!gt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(me&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}Le.removeFeatureState(gt,te.id,me)},K.prototype.getFeatureState=function(te){this._checkLoaded();var me=te.source,Ge=te.sourceLayer,Le=this.sourceCaches[me];if(Le===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+me+"' does not exist in the map's style.")));return}var $e=Le.getSource().type;if($e==="vector"&&!Ge){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),Le.getFeatureState(Ge,te.id)},K.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},K.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},K.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},K.prototype._flattenAndSortRenderedFeatures=function(te){for(var me=this,Ge=function(ai){return me._layers[ai].type==="fill-extrusion"},Le={},$e=[],gt=this._order.length-1;gt>=0;gt--){var jt=this._order[gt];if(Ge(jt)){Le[jt]=gt;for(var wr=0,Nr=te;wr<Nr.length;wr+=1){var pr=Nr[wr],yt=pr[jt];if(yt)for(var kt=0,Bt=yt;kt<Bt.length;kt+=1){var nr=Bt[kt];$e.push(nr)}}}}$e.sort(function(ai,Zi){return Zi.intersectionZ-ai.intersectionZ});for(var hr=[],lr=this._order.length-1;lr>=0;lr--){var dr=this._order[lr];if(Ge(dr))for(var ur=$e.length-1;ur>=0;ur--){var Ht=$e[ur].feature;if(Le[Ht.layer.id]<lr)break;hr.push(Ht),$e.pop()}else for(var sr=0,Vt=te;sr<Vt.length;sr+=1){var Dr=Vt[sr],Jr=Dr[dr];if(Jr)for(var ga=0,vi=Jr;ga<vi.length;ga+=1){var Ga=vi[ga];hr.push(Ga.feature)}}}return hr},K.prototype.queryRenderedFeatures=function(te,me,Ge){me&&me.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",me.filter,null,me);var Le={};if(me&&me.layers){if(!Array.isArray(me.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var $e=0,gt=me.layers;$e<gt.length;$e+=1){var jt=gt[$e],wr=this._layers[jt];if(!wr)return this.fire(new e.ErrorEvent(new Error("The layer '"+jt+"' does not exist in the map's style and cannot be queried for features."))),[];Le[wr.source]=!0}}var Nr=[];me.availableImages=this._availableImages;for(var pr in this.sourceCaches)me.layers&&!Le[pr]||Nr.push(re(this.sourceCaches[pr],this._layers,this._serializedLayers,te,me,Ge));return this.placement&&Nr.push(ce(this._layers,this._serializedLayers,this.sourceCaches,te,me,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Nr)},K.prototype.querySourceFeatures=function(te,me){me&&me.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",me.filter,null,me);var Ge=this.sourceCaches[te];return Ge?be(Ge,me):[]},K.prototype.addSourceType=function(te,me,Ge){if(K.getSourceType(te))return Ge(new Error('A source type called "'+te+'" already exists.'));if(K.setSourceType(te,me),!me.workerSourceURL)return Ge(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:te,url:me.workerSourceURL},Ge)},K.prototype.getLight=function(){return this.light.getLight()},K.prototype.setLight=function(te,me){me===void 0&&(me={}),this._checkLoaded();var Ge=this.light.getLight(),Le=!1;for(var $e in te)if(!e.deepEqual(te[$e],Ge[$e])){Le=!0;break}if(Le){var gt={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(te,me),this.light.updateTransitions(gt)}},K.prototype._validate=function(te,me,Ge,Le,$e){return $e===void 0&&($e={}),$e&&$e.validate===!1?!1:Ts(this,te.call(e.validateStyle,e.extend({key:me,style:this.serialize(),value:Ge,styleSpec:e.styleSpec},Le)))},K.prototype._remove=function(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(var te in this._layers){var me=this._layers[te];me.setEventedParent(null)}for(var Ge in this.sourceCaches)this.sourceCaches[Ge].clearTiles(),this.sourceCaches[Ge].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},K.prototype._clearSource=function(te){this.sourceCaches[te].clearTiles()},K.prototype._reloadSource=function(te){this.sourceCaches[te].resume(),this.sourceCaches[te].reload()},K.prototype._updateSources=function(te){for(var me in this.sourceCaches)this.sourceCaches[me].update(te)},K.prototype._generateCollisionBoxes=function(){for(var te in this.sourceCaches)this._reloadSource(te)},K.prototype._updatePlacement=function(te,me,Ge,Le,$e){$e===void 0&&($e=!1);for(var gt=!1,jt=!1,wr={},Nr=0,pr=this._order;Nr<pr.length;Nr+=1){var yt=pr[Nr],kt=this._layers[yt];if(kt.type==="symbol"){if(!wr[kt.source]){var Bt=this.sourceCaches[kt.source];wr[kt.source]=Bt.getRenderableIds(!0).map(function(sr){return Bt.getTileByID(sr)}).sort(function(sr,Vt){return Vt.tileID.overscaledZ-sr.tileID.overscaledZ||(sr.tileID.isLessThan(Vt.tileID)?-1:1)})}var nr=this.crossTileSymbolIndex.addLayer(kt,wr[kt.source],te.center.lng);gt=gt||nr}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),$e=$e||this._layerOrderChanged||Ge===0,($e||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),te.zoom))&&(this.pauseablePlacement=new bo(te,this._order,$e,me,Ge,Le,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,wr),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),jt=!0),gt&&this.pauseablePlacement.placement.setStale()),jt||gt)for(var hr=0,lr=this._order;hr<lr.length;hr+=1){var dr=lr[hr],ur=this._layers[dr];ur.type==="symbol"&&this.placement.updateLayerOpacities(ur,wr[ur.source])}var Ht=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now());return Ht},K.prototype._releaseSymbolFadeTiles=function(){for(var te in this.sourceCaches)this.sourceCaches[te].releaseSymbolFadeTiles()},K.prototype.getImages=function(te,me,Ge){this.imageManager.getImages(me.icons,Ge),this._updateTilesForChangedImages();var Le=this.sourceCaches[me.source];Le&&Le.setDependencies(me.tileID.key,me.type,me.icons)},K.prototype.getGlyphs=function(te,me,Ge){this.glyphManager.getGlyphs(me.stacks,Ge)},K.prototype.getResource=function(te,me,Ge){return e.makeRequest(me,Ge)},K}(e.Evented);Nl.getSourceType=oe,Nl.setSourceType=ae,Nl.registerForPluginStateChange=e.registerForPluginStateChange;var su=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Tc=`#ifdef GL_ES |