.equals(t);)c++;if(!(p<(l?3:2))){”bevel“===r&&(i=1.05);var h,f=pa/(512*this.overscaling)*15,y=this.segments.prepareSegment(10*p,this.layoutVertexArray,this.indexArray),d=void 0,m=void 0,v=void 0,g=void 0;this.e1=this.e2=-1,l&&(h=t,g=t.sub(h)._unit()._perp());for(var x=c;x:t)||!t.equals(m)){g&&(v=g),h&&(d=h),h=t,g=m?m.sub(h)._unit()._perp():v;var b=(v=v||g).add(g);0===b.x&&0===b.y||b._unit();var _=v.x*g.x+v.y*g.y,w=b.x*g.x+b.y*g.y,A=0!==w?1/w:1/0,k=2*Math.sqrt(2-2*w),S=w<is&&d&&m,I=v.x*g.y-v.y*g.x>0;if(S&&x>c){var z=h.dist(d);if(z>2*f){var C=h.sub(h.sub(d)._mult(f/z)._round());this.updateDistance(d,C),this.addCurrentVertex(C,v,0,0,y),d=C;}}var B=d&&m,P=B?r:l?”butt“:n;if(B&&”round“===P&&(A<a?P=”miter“:A<=2&&(P=”fakeround“)),”miter“===P&&A>i&&(P=”bevel“),”bevel“===P&&(A>2&&(P=”flipbevel“),A<i&&(P=”miter“)),d&&this.updateDistance(d,h),”miter“===P)b._mult(A),this.addCurrentVertex(h,b,0,0,y);else if(”flipbevel“===P){if(A>100)b=g.mult(-1);else{var E=A*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(E*(I?-1:1));}this.addCurrentVertex(h,b,0,0,y),this.addCurrentVertex(h,b.mult(-1),0,0,y);}else if(”bevel“===P||”fakeround“===P){var M=-Math.sqrt(A*A-1),T=I?M:0,V=I?0:M;if(d&&this.addCurrentVertex(h,v,T,V,y),”fakeround“===P)for(var F=Math.round(180*k/Math.PI/20),O=1;O<F;O++){var L=O/F;if(.5!==L){var D=L-.5;L+=L*D*(L-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*D*D+(.848013+_*(.215638*_-1.06021)));}var U=g.sub(v)._mult(L)._add(v)._unit()._mult(I?-1:1);this.addHalfVertex(h,U.x,U.y,!1,I,0,y);}m&&this.addCurrentVertex(h,g,-T,-V,y);}else if(”butt“===P)this.addCurrentVertex(h,b,0,0,y);else if(”square“===P){var R=d?1:-1;this.addCurrentVertex(h,b,R,R,y);}else”round“===P&&(d&&(this.addCurrentVertex(h,v,0,0,y),this.addCurrentVertex(h,v,1,1,y,!0)),m&&(this.addCurrentVertex(h,g,-1,-1,y,!0),this.addCurrentVertex(h,g,0,0,y)));if(S&&x<p-1){var j=h.dist(m);if(j>2*f){var q=h.add(m.sub(h)._mult(f/j)._round());this.updateDistance(h,q),this.addCurrentVertex(q,g,0,0,y),h=q;}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s);}},os.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,u,l,a,!0,-n,i),this.distance>as/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a));},os.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6);var p=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),o.primitiveLength++),i?this.e2=p:this.e1=p;},os.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)this.distance/this.totalDistance)(as-1):this.distance;},xn(”LineBucket“,os,{omit:});var ss=new ti({”line-cap“:new Hn(It.layout_line),”line-join“:new Yn(It.layout_line),”line-miter-limit“:new Hn(It.layout_line),”line-round-limit“:new Hn(It.layout_line),”line-sort-key“:new Yn(It.layout_line)}),us={paint:new ti({”line-opacity“:new Yn(It.paint_line),”line-color“:new Yn(It.paint_line),”line-translate“:new Hn(It.paint_line),”line-translate-anchor“:new Hn(It.paint_line),”line-width“:new Yn(It.paint_line),”line-gap-width“:new Yn(It.paint_line),”line-offset“:new Yn(It.paint_line),”line-blur“:new Yn(It.paint_line),”line-dasharray“:new Wn(It.paint_line),”line-pattern“:new $n(It.paint_line),”line-gradient“:new Qn(It.paint_line)}),layout:ss},ls=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Rn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Yn))(us.paint.properties.specification);ls.useIntegerZoom=!0;var ps=function(t){function e(e){t.call(this,e,us);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){”line-gradient“===t&&this._updateGradient();},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values.value.expression;this.gradient=Za(t,”lineProgress“),this.gradientTexture=null;},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values=ls.possiblyEvaluate(this._transitioningPaint._values.value,e);},e.prototype.createBucket=function(t){return new os(t)},e.prototype.queryRadius=function(t){var e=t,r=cs(za(”line-width“,this,e),za(”line-gap-width“,this,e)),n=za(”line-offset“,this,e);return r/2+Math.abs(n)+Ca(this.paint.get(”line-translate“))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=Ba(t,this.paint.get(”line-translate“),this.paint.get(”line-translate-anchor“),o.angle,s),l=s/2*cs(this.paint.get(”line-width“).evaluate(e,r),this.paint.get(”line-gap-width“).evaluate(e,r)),p=this.paint.get(”line-offset“).evaluate(e,r);return p&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t,s=[],u=0;u<o.length;u++){var l=o,p=o,c=o,h=0===u?n:p.sub(l)._unit()._perp(),f=u===o.length-1?n:c.sub(p)._unit()._perp(),y=h._add(f)._unit(),d=y.x*f.x+y.y*f.y;y._mult(1/d),s.push(y._mult(e)._add(p));}r.push(s);}return r}(n,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e;if(t.length>=3)for(var a=0;a))return!0;if(xa(t,i,r))return!0}return!1}(u,n,l)},e.prototype.isTileClipped=function(){return!0},e}(ei);function cs(t,e){return e>0?e+2*t:t}var hs=ai(),fs=ai(,4),ys=(ai(,4),ai()),ds=(ai(),ai(,4)),ms=ai(,4);ai(),ai(),ai(),ai();function vs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get(”text-transform“).evaluate(r,{});return ”uppercase“===n?t=t.toLocaleUpperCase():”lowercase“===n&&(t=t.toLocaleLowerCase()),Un.applyArabicShaping&&(t=Un.applyArabicShaping(t)),t}(t.text,e,r);})),t}var gs={”!“:”︕“,”#“:”#“,$:”$“,”%“:”%“,”&“:”&“,”(“:”︵“,”)“:”︶“,”*“:”*“,”+“:”+“,”,“:”︐“,”-“:”︲“,”.“:”・“,”/“:”/“,”:“:”︓“,”;“:”︔“,”<“:”︿“,”=“:”=“,”>“:”﹀“,”?“:”︖“,”@“:”@“,”[“:”﹇“,”\“:”\“,”]“:”﹈“,”^“:”^“,_:”︳“,”`“:”`“,”{“:”︷“,”|“:”―“,”}“:”︸“,”~“:”~“,”¢“:”¢“,”£“:”£“,”¥“:”¥“,”¦“:”¦“,”¬“:”¬“,”¯“:” ̄“,”–“:”︲“,”—“:”︱“,”‘“:”﹃“,”’“:”﹄“,”““:”﹁“,””“:”﹂“,”…“:”︙“,”‧“:”・“,”₩“:”₩“,”、“:”︑“,”。“:”︒“,”〈“:”︿“,”〉“:”﹀“,”《“:”︽“,”》“:”︾“,”「“:”﹁“,”」“:”﹂“,”『“:”﹃“,”』“:”﹄“,”【“:”︻“,”】“:”︼“,”〔“:”︹“,”〕“:”︺“,”〖“:”︗“,”〗“:”︘“,”!“:”︕“,”(“:”︵“,”)“:”︶“,”,“:”︐“,”-“:”︲“,”.“:”・“,”:“:”︓“,”;“:”︔“,”<“:”︿“,”>“:”﹀“,”?“:”︖“,”[“:”﹇“,”]“:”﹈“,”_“:”︳“,”{“:”︷“,”|“:”―“,”}“:”︸“,”⦅“:”︵“,”⦆“:”︶“,”。“:”︒“,”「“:”﹁“,”」“:”﹂“};var xs=24,bs={horizontal:1,vertical:2,horizontalOnly:3},_s=function(){this.text=”“,this.sectionIndex=[],this.sections=;};function ws(t,e,r,n,i,a,o,s,u,l,p,c){var h,f=_s.fromFeature(t,r);l===bs.vertical&&f.verticalizePunctuation();var y=Un.processBidirectionalText,d=Un.processStyledBidirectionalText;if(y&&1===f.sections.length){h=[];for(var m=0,v=y(f.toString(),Cs(f,s,n,e,c));m<v.length;m+=1){var g=v,x=new _s;x.text=g,x.sections=f.sections;for(var b=0;b<g.length;b++)x.sectionIndex.push(0);h.push(x);}}else if(d){h=[];for(var _=0,w=d(f.text,f.sectionIndex,Cs(f,s,n,e,c));_<w.length;_+=1){var A=w,k=new _s;k.text=A,k.sectionIndex=A,k.sections=f.sections,h.push(k);}}else h=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o;r.push(t.substring(i,s)),i=s;}return i<n.length&&r.push(t.substring(i,n.length)),r}(f,Cs(f,s,n,e,c));var S=[],I={positionedGlyphs:S,text:f.toString(),top:u,bottom:u,left:u,right:u,writingMode:l,lineCount:h.length,yOffset:-17};return function(t,e,r,n,i,a,o,s,u){for(var l=0,p=t.yOffset,c=0,h=t.positionedGlyphs,f=”right“===a?1:”left“===a?0:.5,y=0,d=r;y<d.length;y+=1){var m=d;m.trim();var v=m.getMaxScale();if(m.length()){for(var g=h.length,x=0;x<m.length();x++){var b=m.getSection(x),_=m.getSectionIndex(x),w=m.getCharCode(x),A=24*(v-b.scale),k=e,S=k&&k;S&&(o===bs.horizontal||!u&&!Cn(w)||u&&(As||(z=w,Sn.Arabic(z)||Sn[”Arabic Supplement“](z)||Sn[”Arabic Extended-A“](z)||Sn[”Arabic Presentation Forms-A“](z)||Sn[”Arabic Presentation Forms-B“](z)))?(h.push({glyph:w,x:l,y:p+A,vertical:!1,scale:b.scale,fontStack:b.fontStack,sectionIndex:_}),l+=S.metrics.advance*b.scale+s):(h.push({glyph:w,x:l,y:p+A,vertical:!0,scale:b.scale,fontStack:b.fontStack,sectionIndex:_}),l+=xs*b.scale+s));}if(h.length!==g){var I=l-s;c=Math.max(I,c),Ps(h,e,g,h.length-1,f);}l=0,p+=n*v;}else p+=n;}var z;var C=Bs(i),B=C.horizontalAlign,P=C.verticalAlign;!function(t,e,r,n,i,a,o){for(var s=(e-r)*i,u=(-n*o+.5)*a,l=0;l.x+=s,t.y+=u;}(h,f,B,P,c,n,r.length);var E=p-t.yOffset;t.top+=-P*E,t.bottom=t.top+E,t.left+=-B*c,t.right=t.left+c;}(I,e,h,i,a,o,l,s,p),!!S.length&&I}_s.fromFeature=function(t,e){for(var r=new _s,n=0;n<t.sections.length;n++){var i=t.sections;r.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),r.text+=i.text;for(var a=0;a<i.text.length;a++)r.sectionIndex.push(n);}return r},_s.prototype.length=function(){return this.text.length},_s.prototype.getSection=function(t){return this.sections[this.sectionIndex]},_s.prototype.getSectionIndex=function(t){return this.sectionIndex},_s.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},_s.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e=”“,r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Bn(n)||gs[t])&&(!i||!Bn(i)||gs[t])&&gs[t]?e+=gs[t]:e+=t;}return e}(this.text);},_s.prototype.trim=function(){for(var t=0,e=0;e;e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&As;n–)r–;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},_s.prototype.substring=function(t,e){var r=new _s;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},_s.prototype.toString=function(){return this.text},_s.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections.scale)}),0)};var As={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ks={};function Ss(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs®*r}function Is(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function zs(t,e,r,n,i,a){for(var o=null,s=Ss(e,r,i,a),u=0,l=n;u<l.length;u+=1){var p=l,c=Ss(e-p.x,r,i,a)+p.badness;c<=s&&(o=p,s=c);}return{index:t,x:e,priorBreak:o,badness:s}}function Cs(t,e,r,n,i){if(”point“!==i)return[];if(!t)return;for(var a,o=[],s=function(t,e,r,n){for(var i=0,a=0;a<t.length();a++){var o=t.getSection(a),s=n,u=s&&s;u&&(i+=u.metrics.advance*o.scale+e);}return i/Math.max(1,Math.ceil(i/r))}(t,e,r,n),u=t.text.indexOf(”“)>=0,l=0,p=0;p<t.length();p++){var c=t.getSection(p),h=t.getCharCode(p),f=n,y=f&&f;if(y&&!As&&(l+=y.metrics.advance*c.scale+e),p<t.length()-1){var d=!!(!((a=h)<11904)&&(Sn[”Bopomofo Extended“](a)||Sn.Bopomofo(a)||Sn[”CJK Compatibility Forms“](a)||Sn[”CJK Compatibility Ideographs“](a)||Sn[”CJK Compatibility“](a)||Sn[”CJK Radicals Supplement“](a)||Sn[”CJK Strokes“](a)||Sn[”CJK Symbols and Punctuation“](a)||Sn[”CJK Unified Ideographs Extension A“](a)||Sn[”CJK Unified Ideographs“](a)||Sn[”Enclosed CJK Letters and Months“](a)||Sn[”Halfwidth and Fullwidth Forms“](a)||Sn.Hiragana(a)||Sn[”Ideographic Description Characters“](a)||Sn[”Kangxi Radicals“](a)||Sn[”Katakana Phonetic Extensions“](a)||Sn.Katakana(a)||Sn[”Vertical Forms“](a)||Sn[”Yi Radicals“](a)||Sn[”Yi Syllables“](a)));(ks||d)&&o.push(zs(p+1,l,s,o,Is(h,t.getCharCode(p+1),d&&u),!1));}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(zs(t.length(),l,s,o,0,!0))}function Bs(t){var e=.5,r=.5;switch(t){case”right“:case”top-right“:case”bottom-right“:e=1;break;case”left“:case”top-left“:case”bottom-left“:e=0;}switch(t){case”bottom“:case”bottom-right“:case”bottom-left“:r=1;break;case”top“:case”top-right“:case”top-left“:r=0;}return{horizontalAlign:e,verticalAlign:r}}function Ps(t,e,r,n,i){if(i){var a=t,o=e,s=o&&o;if(s)for(var u=s.metrics.advance*a.scale,l=(t.x+u)*i,p=r;p<=n;p++)t.x-=l;}}function Es(t,e,r,n,i,a){var o,s,u,l,p=t.image,c=e.left*a,h=e.right*a;”width“===r||”both“===r?(l=i+c-n,s=i+h+n):s=(l=i+(c+h-p.displaySize)/2)+p.displaySize;var f=e.top*a,y=e.bottom*a;return ”height“===r||”both“===r?(o=i+f-n,u=i+y+n):u=(o=i+(f+y-p.displaySize)/2)+p.displaySize,{image:p,top:o,right:s,bottom:u,left:l}}ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0,ks=!0;var Ms=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);xn(”Anchor“,Ms);var Ts=256;function Vs(t,e){var r=e.expression;if(”constant“===r.kind)return{kind:”constant“,layoutSize:r.evaluate(new Rn(t+1))};if(”source“===r.kind)return{kind:”source“};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<=t;)a++;for(var o=a=Math.max(0,a-1);o<t+1;)o++;o=Math.min(n.length-1,o);var s=n,u=n;return ”composite“===r.kind?{kind:”composite“,minZoom:s,maxZoom:u,interpolationType:i}:{kind:”camera“,minZoom:s,maxZoom:u,minSize:r.evaluate(new Rn(s)),maxSize:r.evaluate(new Rn(u)),interpolationType:i}}function Fs(t,e,r){var n=e.uSize,i=e.uSizeT,a=r.lowerSize,o=r.upperSize;return ”source“===t.kind?a/Ts:”composite“===t.kind?Ae(a/Ts,o/Ts,i):n}function Os(t,e){var r=0,n=0;if(”constant“===t.kind)n=t.layoutSize;else if(”source“!==t.kind){var i=t.interpolationType,a=t.minZoom,o=t.maxZoom,s=i?l(Ke.interpolationFactor(i,e,a,o),0,1):0;”camera“===t.kind?n=Ae(t.minSize,t.maxSize,s):r=s;}return{uSizeT:r,uSize:n}}var Ls=Object.freeze({__proto__:null,getSizeData:Vs,evaluateSizeForFeature:Fs,evaluateSizeForZoom:Os,SIZE_PACK_FACTOR:Ts}),Ds=Zo.VectorTileFeature.types,Us=;function Rs(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,s?s:0,s?s:0);}function js(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r);}var qs=function(t){this.layoutVertexArray=new hi,this.indexArray=new Ai,this.programConfigurations=t,this.segments=new ji,this.dynamicLayoutVertexArray=new fi,this.opacityVertexArray=new yi,this.placedSymbolArray=new Ei;};qs.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,fs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Us,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t);},qs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());},xn(”SymbolBuffers“,qs);var Ns=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ji,this.collisionVertexArray=new vi;};Ns.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ys.members,!0);},Ns.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());},xn(”CollisionBuffers“,Ns);var Ks=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1;var e=this.layers._unevaluatedLayout._values;this.textSizeData=Vs(this.zoom,e),this.iconSizeData=Vs(this.zoom,e);var r=this.layers.layout,n=r.get(”symbol-sort-key“),i=r.get(”symbol-z-order“);this.sortFeaturesByKey=”viewport-y“!==i&&void 0!==n.constantOr(1);var a=”viewport-y“===i||”auto“===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&(r.get(”text-allow-overlap“)||r.get(”icon-allow-overlap“)||r.get(”text-ignore-placement“)||r.get(”icon-ignore-placement“)),”point“===r.get(”symbol-placement“)&&(this.writingModes=r.get(”text-writing-mode“).map((function(t){return bs}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID;};Ks.prototype.createArrays=function(){var t=this.layers.layout;this.hasPaintOverrides=Js.hasPaintOverrides(t),this.text=new qs(new sa(hs.members,this.layers,this.zoom,(function(t){return /^text/.test(t)}))),this.icon=new qs(new sa(hs.members,this.layers,this.zoom,(function(t){return /^icon/.test(t)}))),this.textCollisionBox=new Ns(mi,ds.members,ki),this.iconCollisionBox=new Ns(mi,ds.members,ki),this.textCollisionCircle=new Ns(mi,ms.members,Ai),this.iconCollisionCircle=new Ns(mi,ms.members,Ai),this.glyphOffsetArray=new Fi,this.lineVertexArray=new Li,this.symbolInstances=new Ti;},Ks.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a=!0,(r||n)&&i){var o=gs;o&&(e=!0);}},Ks.prototype.populate=function(t,e){var r=this.layers,n=r.layout,i=n.get(”text-font“),a=n.get(”text-field“),o=n.get(”icon-image“),s=(”constant“!==a.value.kind||a.value.value.toString().length>0)&&(”constant“!==i.value.kind||i.value.value.length>0),u=(”constant“!==o.value.kind||!!o.value.value)&&Object.keys(o.parameters).length>0,l=n.get(”symbol-sort-key“);if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=e.availableImages,f=new Rn(this.zoom),y=0,d=t;y<d.length;y+=1){var m=d,v=m.feature,g=m.index,x=m.sourceLayerIndex;if(r._featureFilter(f,v)){var b=void 0;if(s){var _=r.getValueAndResolveTokens(”text-field“,v,h);b=vs(_ instanceof Qt?:Qt.fromString(),r,v);}var w=void 0;if(u){var A=r.getValueAndResolveTokens(”icon-image“,v,h);w=A instanceof te?A:te.fromString(A);}if(b||w){var k=this.sortFeaturesByKey?l.evaluate(v,{}):void 0,S={text:b,icon:w,index:g,sourceLayerIndex:x,geometry:fa(v),properties:v.properties,type:Ds,sortKey:k};if(void 0!==v.id&&(S.id=v.id),this.features.push(S),w&&(p=!0),b){var I=i.evaluate(v,{}).join(”,“),z=”map“===n.get(”text-rotation-alignment“)&&”point“!==n.get(”symbol-placement“);this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bs.vertical)>=0;for(var C=0,B=b.sections;C<B.length;C+=1){var P=B,E=In(b.toString()),M=P.fontStack||I,T=c=c||{};this.calculateGlyphDependencies(P.text,T,z,this.allowVerticalPlacement,E);}}}}}”line“===n.get(”symbol-placement“)&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t),i++;}function o(t,e,i){var a=r;return delete r,r=a,n.geometry.pop(),n.geometry=n.geometry.concat(i),a}function s(t,r,i){var a=e;return delete e,e=a,n.geometry.shift(),n.geometry=i.concat(n.geometry),a}function u(t,e,r){var n=r?e[e.length-1]:e[0];return t+”:“n.x
”:“+n.y}for(var l=0;l<t.length;l++){var p=t,c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r!==e){var d=s(f,y,c),m=o(f,y,n.geometry);delete e,delete r,r[u(h,n.geometry,!0)]=m,n.geometry=null;}else f in r?o(f,y,c):y in e?s(f,y,c):(a(l),e=i-1,r=i-1);}else a(l);}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}));}},Ks.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r));},Ks.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ks.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ks.prototype.upload=function(t){this.uploaded||(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0;},Ks.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy();},Ks.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e),i=t.dist(e),a={},o=t.segment+1;o={x:e.x,y:e.y,tileUnitDistanceFromAnchor:n},o.dist(e));for(var s=t.segment||0;s>=0;s–)a={x:e.x,y:e.y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e.dist(e));for(var u=0;u<e.length;u++){var l=a;this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor);}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ks.prototype.addSymbols=function(t,e,r,n,i,a,o,s,u,l,p){var c=this,h=t.indexArray,f=t.layoutVertexArray,y=t.dynamicLayoutVertexArray,d=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,a.sortKey),m=this.glyphOffsetArray.length,v=d.vertexLength,g=this.allowVerticalPlacement&&o===bs.vertical?Math.PI/2:0,x=function(t){var e=t.tl,n=t.tr,i=t.bl,a=t.br,o=t.tex,u=d.vertexLength,l=t.glyphOffset;Rs(f,s.x,s.y,e.x,l+e.y,o.x,o.y,r),Rs(f,s.x,s.y,n.x,l+n.y,o.x+o.w,o.y,r),Rs(f,s.x,s.y,i.x,l+i.y,o.x,o.y+o.h,r),Rs(f,s.x,s.y,a.x,l+a.y,o.x+o.w,o.y+o.h,r),js(y,s,g),h.emplaceBack(u,u+1,u+2),h.emplaceBack(u+1,u+2,u+3),d.vertexLength+=4,d.primitiveLength+=2,c.glyphOffsetArray.emplaceBack(t.glyphOffset);};if(a.text&&a.text.sections){var b=a.text.sections;if(this.hasPaintOverrides){for(var _,w=function(e,r){void 0===_||_===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{},b),_=e;},A=0,k=e;A<k.length;A+=1){var S=k;w(S.sectionIndex,!1),x(S);}w(_,!0);}else{for(var I=0,z=e;I<z.length;I+=1){x(z);}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{},b);}}else{for(var C=0,B=e;C<B.length;C+=1){x(B);}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{});}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,v,u,l,s.segment,r?r:0,r?r:0,n,n,o,0,!1,0,p);},Ks.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},Ks.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s,u){var l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),p=l.vertexLength,c=a.layoutVertexArray,h=a.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,o,f,y,new i(t,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,n)),this._addCollisionDebugVertex(c,h,o,f,y,new i(t,n)),l.vertexLength+=4,u){var d=a.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2;}else{var m=a.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4;}},Ks.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,u=a.x2,l=a.y2,p=a.radius>0;this.addCollisionDebugVertices(o,s,u,l,p?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r,p);}},Ks.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1);}},Ks.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,u){for(var l={},p=e;p<r;p++){var c=t.get(p);if(0===c.radius){l.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},l.textFeatureIndex=c.featureIndex;break}l.textCircles||(l.textCircles=[],l.textFeatureIndex=c.featureIndex);l.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1);}for(var h=n;h<i;h++){var f=t.get(h);if(0===f.radius){l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}}for(var y=a;y<o;y++){var d=t.get(y);if(0===d.radius){l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}}for(var m=s;m<u;m++){var v=t.get(m);if(0===v.radius){l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}}return l},Ks.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex));}},Ks.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ks.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ks.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},Ks.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},Ks.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},Ks.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},Ks.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3);},Ks.prototype.addIndicesForPlacedIconSymbol=function(t){var e=this.icon.placedSymbolArray.get(t);if(e.numGlyphs){var r=e.vertexStartIndex;this.icon.indexArray.emplaceBack(r,r+1,r+2),this.icon.indexArray.emplaceBack(r+1,r+2,r+3);}},Ks.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=,a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex);}return a.sort((function(t,e){return n-n||i-i})),a},Ks.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n,a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),.forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t);})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedIconSymbol(a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedIconSymbol(a.verticalPlacedIconSymbolIndex);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},xn(”SymbolBucket“,Ks,{omit:}),Ks.MAX_GLYPHS=65535,Ks.addDynamicAttributes=js;var Zs=new ti({”symbol-placement“:new Hn(It.layout_symbol),”symbol-spacing“:new Hn(It.layout_symbol),”symbol-avoid-edges“:new Hn(It.layout_symbol),”symbol-sort-key“:new Yn(It.layout_symbol),”symbol-z-order“:new Hn(It.layout_symbol),”icon-allow-overlap“:new Hn(It.layout_symbol),”icon-ignore-placement“:new Hn(It.layout_symbol),”icon-optional“:new Hn(It.layout_symbol),”icon-rotation-alignment“:new Hn(It.layout_symbol),”icon-size“:new Yn(It.layout_symbol),”icon-text-fit“:new Hn(It.layout_symbol),”icon-text-fit-padding“:new Hn(It.layout_symbol),”icon-image“:new Yn(It.layout_symbol),”icon-rotate“:new Yn(It.layout_symbol),”icon-padding“:new Hn(It.layout_symbol),”icon-keep-upright“:new Hn(It.layout_symbol),”icon-offset“:new Yn(It.layout_symbol),”icon-anchor“:new Yn(It.layout_symbol),”icon-pitch-alignment“:new Hn(It.layout_symbol),”text-pitch-alignment“:new Hn(It.layout_symbol),”text-rotation-alignment“:new Hn(It.layout_symbol),”text-field“:new Yn(It.layout_symbol),”text-font“:new Yn(It.layout_symbol),”text-size“:new Yn(It.layout_symbol),”text-max-width“:new Yn(It.layout_symbol),”text-line-height“:new Hn(It.layout_symbol),”text-letter-spacing“:new Yn(It.layout_symbol),”text-justify“:new Yn(It.layout_symbol),”text-radial-offset“:new Yn(It.layout_symbol),”text-variable-anchor“:new Hn(It.layout_symbol),”text-anchor“:new Yn(It.layout_symbol),”text-max-angle“:new Hn(It.layout_symbol),”text-writing-mode“:new Hn(It.layout_symbol),”text-rotate“:new Yn(It.layout_symbol),”text-padding“:new Hn(It.layout_symbol),”text-keep-upright“:new Hn(It.layout_symbol),”text-transform“:new Yn(It.layout_symbol),”text-offset“:new Yn(It.layout_symbol),”text-allow-overlap“:new Hn(It.layout_symbol),”text-ignore-placement“:new Hn(It.layout_symbol),”text-optional“:new Hn(It.layout_symbol)}),Xs={paint:new ti({”icon-opacity“:new Yn(It.paint_symbol),”icon-color“:new Yn(It.paint_symbol),”icon-halo-color“:new Yn(It.paint_symbol),”icon-halo-width“:new Yn(It.paint_symbol),”icon-halo-blur“:new Yn(It.paint_symbol),”icon-translate“:new Hn(It.paint_symbol),”icon-translate-anchor“:new Hn(It.paint_symbol),”text-opacity“:new Yn(It.paint_symbol),”text-color“:new Yn(It.paint_symbol,{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),”text-halo-color“:new Yn(It.paint_symbol),”text-halo-width“:new Yn(It.paint_symbol),”text-halo-blur“:new Yn(It.paint_symbol),”text-translate“:new Hn(It.paint_symbol),”text-translate-anchor“:new Hn(It.paint_symbol)}),layout:Zs},Gs=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t;};Gs.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Gs.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},Gs.prototype.possibleOutputs=function(){return[void 0]},Gs.prototype.serialize=function(){return null},xn(”FormatSectionOverride“,Gs,{omit:});var Js=function(t){function e(e){t.call(this,e,Xs);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),”auto“===this.layout.get(”icon-rotation-alignment“)&&(”point“!==this.layout.get(”symbol-placement“)?this.layout._values=”map“:this.layout._values=”viewport“),”auto“===this.layout.get(”text-rotation-alignment“)&&(”point“!==this.layout.get(”symbol-placement“)?this.layout._values=”map“:this.layout._values=”viewport“),”auto“===this.layout.get(”text-pitch-alignment“)&&(this.layout._values=this.layout.get(”text-rotation-alignment“)),”auto“===this.layout.get(”icon-pitch-alignment“)&&(this.layout._values=this.layout.get(”icon-rotation-alignment“)),”point“===this.layout.get(”symbol-placement“)){var n=this.layout.get(”text-writing-mode“);if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o;i.indexOf(s)<0&&i.push(s);}this.layout._values=i;}else this.layout._values=[”horizontal“];}this._setPaintOverrides();},e.prototype.getValueAndResolveTokens=function(t,e,r){var n=this.layout.get(t).evaluate(e,{},r),i=this._unevaluatedLayout._values;return i.isDataDriven()||zr(i.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t):”“}))}(e.properties,n)},e.prototype.createBucket=function(t){return new Ks(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Xs.paint.overridableProperties;t<r.length;t+=1){var n=r;if(e.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),a=new Gs(i),o=new Ir(a,i.property.specification),s=null;s=”constant“===i.value.kind||”source“===i.value.kind?new Br(”source“,o):new Pr(”composite“,o,i.value.zoomStops,i.value._interpolationType),this.paint._values=new Gn(i.property,s,i.parameters);}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get(”text-field“),n=Xs.paint.properties,i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1){var a=r;if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if(”constant“===r.value.kind&&r.value.value instanceof Qt)a(r.value.value.sections);else if(”source“===r.value.kind){var o=function(t){if(!i)if(t instanceof ie&&re(t.value)===Nt){var e=t.value;a(e.sections);}else t instanceof ue?a(t.sections):t.eachChild(o);},s=r.value;s._styleExpression&&o(s._styleExpression.expression);}return i},e.hasPaintOverrides=function(t){for(var r=0,n=Xs.paint.overridableProperties;r<n.length;r+=1){var i=n;if(e.hasPaintOverride(t,i))return!0}return!1},e}(ei),Hs={paint:new ti({”background-color“:new Hn(It.paint_background),”background-pattern“:new Wn(It.paint_background),”background-opacity“:new Hn(It.paint_background)})},Ys=function(t){function e(e){t.call(this,e,Hs);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei),$s={paint:new ti({”raster-opacity“:new Hn(It.paint_raster),”raster-hue-rotate“:new Hn(It.paint_raster),”raster-brightness-min“:new Hn(It.paint_raster),”raster-brightness-max“:new Hn(It.paint_raster),”raster-saturation“:new Hn(It.paint_raster),”raster-contrast“:new Hn(It.paint_raster),”raster-resampling“:new Hn(It.paint_raster),”raster-fade-duration“:new Hn(It.paint_raster)})},Ws=function(t){function e(e){t.call(this,e,$s);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei);var Qs=function(t){function e(e){t.call(this,e,{}),this.implementation=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return ”3d“===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl);},e}(ei),tu={circle:Oa,heatmap:Xa,hillshade:Ja,fill:Fo,”fill-extrusion“:Qo,line:ps,symbol:Js,background:Ys,raster:Ws};function eu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i;e+=a.w*a.h,r=Math.max(r,a.w);}t.sort((function(t,e){return e.h-t.h}));for(var o=,s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p,h=o.length-1;h>=0;h–){var f=o;if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=o.pop();h=y);}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(o.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}var ru=function(t,e){var r=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=n;},nu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};nu.tl.get=function(){return},nu.br.get=function(){return},nu.tlbr.get=function(){return this.tl.concat(this.br)},nu.displaySize.get=function(){return},Object.defineProperties(ru.prototype,nu);var iu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=eu(i),o=a.w,s=a.h,u=new Na({width:o||1,height:s||1});for(var l in t){var p=t,c=r.paddedRect;Na.copy(p.data,u,{x:0,y:0},{x:c.x+1,y:c.y+1},p.data);}for(var h in e){var f=e,y=n.paddedRect,d=y.x+1,m=y.y+1,v=f.data.width,g=f.data.height;Na.copy(f.data,u,{x:0,y:0},{x:d,y:m},f.data),Na.copy(f.data,u,{x:0,y:g-1},{x:d,y:m-1},{width:v,height:1}),Na.copy(f.data,u,{x:0,y:0},{x:d,y:m+g},{width:v,height:1}),Na.copy(f.data,u,{x:v-1,y:0},{x:d-1,y:m},{width:1,height:g}),Na.copy(f.data,u,{x:0,y:0},{x:d+v,y:m},{width:1,height:g});}this.image=u,this.iconPositions=r,this.patternPositions=n;};iu.prototype.addImages=function(t,e,r){for(var n in t){var i=t,a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e=new ru(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n);}},iu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions,t.getImage®,e),this.patchUpdatedImage(this.patternPositions,t.getImage®,e);},iu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n,a=n;r.update(e.data,void 0,{x:i,y:a});}},xn(”ImagePosition“,ru),xn(”ImageAtlas“,iu);var au=self.HTMLImageElement,ou=self.HTMLCanvasElement,su=self.HTMLVideoElement,uu=self.ImageData,lu=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n);};lu.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size===n&&this.size===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=,t instanceof au||t instanceof ou||t instanceof su||t instanceof uu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof au||t instanceof ou||t instanceof su||t instanceof uu?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data);}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D);},lu.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e);},lu.prototype.isSizePowerOfTwo=function(){return this.size===this.size&&Math.log(this.size)/Math.LN2%1==0},lu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null;};var pu={read:function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t;for(c+=h,a=f&(1<<-p)-1,f>>=-p,p+=s;p>0;a=256*a+t,c+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t,c+=h,p-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=l;}return(f?-1:1)*o*Math.pow(2,a-n)},write:function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=p?(s=0,o=p):o+c>=1?(s=(e*u-1)*Math.pow(2,i),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t=255&s,f+=y,s/=256,i-=8);for(o=o<0;t=255&o,f+=y,o/=256,l-=8);t|=128*d;}},cu=hu;function hu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}hu.Varint=0,hu.Fixed64=1,hu.Bytes=2,hu.Fixed32=5;var fu=”undefined“==typeof TextDecoder?null:new TextDecoder(”utf8“);function yu(t){return t.type===hu.Bytes?t.readVarint()+t.pos:t.pos+1}function du(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function mu(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i–)r.buf=r.buf;}function vu(t,e){for(var r=0;r);}function gu(t,e){for(var r=0;r);}function xu(t,e){for(var r=0;r);}function bu(t,e){for(var r=0;r);}function _u(t,e){for(var r=0;r);}function wu(t,e){for(var r=0;r);}function Au(t,e){for(var r=0;r);}function ku(t,e){for(var r=0;r);}function Su(t,e){for(var r=0;r);}function Iu(t,e){return(t|t<<8|t<<16)+16777216*t}function zu(t,e,r){t=e,t=e>>>8,t=e>>>16,t=e>>>24;}function Cu(t,e){return(t|t<<8|t<<16)+(t<<24)}hu.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Iu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Iu(this.buf,this.pos)+4294967296*Iu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Iu(this.buf,this.pos)+4294967296*Cu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=pu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=pu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n),r<128?e:(e|=(127&(r=n))<<7,r<128?e:(e|=(127&(r=n))<<14,r<128?e:(e|=(127&(r=n))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a,n=(112&i)>>4,i<128)return du(t,n,e);if(i=a,n|=(127&i)<<3,i<128)return du(t,n,e);if(i=a,n|=(127&i)<<10,i<128)return du(t,n,e);if(i=a,n|=(127&i)<<17,i<128)return du(t,n,e);if(i=a,n|=(127&i)<<24,i<128)return du(t,n,e);if(i=a,n|=(1&i)<<31,i<128)return du(t,n,e);throw new Error(”Expected varint not more than 10 bytes“)}(e|=(15&(r=n))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&fu?function(t,e,r){return fu.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n=”“,i=e;for(;i<r;){var a,o,s,u=t,l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(a=t))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(a=t,o=t,128==(192&a)&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t,o=t,s=t,128==(192&a)&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==hu.Bytes)return t.push(this.readVarint(e));var r=yu(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==hu.Bytes)return t.push(this.readSVarint());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==hu.Bytes)return t.push(this.readBoolean());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==hu.Bytes)return t.push(this.readFloat());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==hu.Bytes)return t.push(this.readDouble());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==hu.Bytes)return t.push(this.readFixed32());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==hu.Bytes)return t.push(this.readSFixed32());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==hu.Bytes)return t.push(this.readFixed64());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==hu.Bytes)return t.push(this.readSFixed64());var e=yu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===hu.Varint)for(;this.buf>127;);else if(e===hu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===hu.Fixed32)this.pos+=4;else{if(e!==hu.Fixed64)throw new Error(”Unimplemented type: “+e);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),zu(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),zu(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),zu(this.buf,-1&t,this.pos),zu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),zu(this.buf,-1&t,this.pos),zu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error(”Given varint doesn't fit into 10 bytes“);e.realloc(10),function(t,e,r){r.buf=127&t|128,t>>>=7,r.buf=127&t|128,t>>>=7,r.buf=127&t|128,t>>>=7,r.buf=127&t|128,t>>>=7,r.buf=127&t;}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf|=r|((t>>>=3)?128:0),!t)return;if(e.buf=127&t|((t>>>=7)?128:0),!t)return;if(e.buf=127&t|((t>>>=7)?128:0),!t)return;if(e.buf=127&t|((t>>>=7)?128:0),!t)return;if(e.buf=127&t|((t>>>=7)?128:0),!t)return;e.buf=127&t;}(n,e);}(t,this):(this.realloc(4),this.buf=127&t|(t>127?128:0),t<=127||(this.buf=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t=239,t=191,t=189):i=n;continue}if(n<56320){t=239,t=191,t=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t=239,t=191,t=189,i=null);n<128?t=n:(n<2048?t=n>>6|192:(n<65536?t=n>>12|224:(t=n>>18|240,t=n>>12&63|128),t=n>>6&63|128),t=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&mu(e,r,this),this.pos=e-1,this.writeVarint®,this.pos+=r;},writeFloat:function(t){this.realloc(4),pu.write(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),pu.write(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=t;},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&mu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,hu.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,vu,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,gu,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_u,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xu,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,bu,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wu,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Au,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ku,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Su,e);},writeBytesField:function(t,e){this.writeTag(t,hu.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,hu.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,hu.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,hu.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,hu.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,hu.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,hu.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,hu.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,hu.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,hu.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var Bu=3;function Pu(t,e,r){1===t&&r.readMessage(Eu,e);}function Eu(t,e,r){if(3===t){var n=r.readMessage(Mu,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,u=n.left,l=n.top,p=n.advance;e.push({id:i,bitmap:new qa({width:o+2*Bu,height:s+2*Bu},a),metrics:{width:o,height:s,left:u,top:l,advance:p}});}}function Mu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}var Tu=Bu,Vu=function(t){var e=this;this._callback=t,this._triggered=!1,”undefined“!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback();});};Vu.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback();}),0));},Vu.prototype.remove=function(){delete this._channel,this._callback=function(){};};var Fu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(,this),this.invoker=new Vu(this.process),this.target.addEventListener(”message“,this.receive,!1);};function Ou(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return}Fu.prototype.send=function(t,e,r,n){var i=this,a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks=r);var o=[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:wn(e,o)},o),{cancel:function(){r&&delete i.callbacks,i.target.postMessage({id:a,type:”<cancel>“,targetMapId:n,sourceMapId:i.mapId});}}},Fu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(”<cancel>“===e.type){delete this.tasks;var n=this.cancelCallbacks;delete this.cancelCallbacks,n&&n();}else this.tasks=e,this.taskQueue.push®,this.invoker.trigger();},Fu.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks;if(delete this.tasks,this.taskQueue.length&&this.invoker.trigger(),r)if(”<response>“===r.type){var n=this.callbacks;delete this.callbacks,n&&(r.error?n(An(r.error)):n(null,An(r.data)));}else{var i=!1,a=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks;var a=[];t.target.postMessage({id:e,type:”“,sourceMapId:t.mapId,error:r?wn®:null,data:wn(n,a)},a);}:function(t){i=!0;},o=null,s=An(r.data);if(this.parent)o=this.parent(r.sourceMapId,s,a);else if(this.parent.getWorkerSource){var u=r.type.split(”.“);o=this.parent.getWorkerSource(r.sourceMapId,u,s.source)[u](s,a);}else a(new Error(”Could not find function “+r.type));!i&&o&&o.cancel&&(this.cancelCallbacks=o.cancel);}}},Fu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener(”message“,this.receive,!1);};var Lu=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t,t]).setNorthEast([t,t]):this.setSouthWest(t).setNorthEast(t));};Lu.prototype.setNorthEast=function(t){return this._ne=t instanceof Du?new Du(t.lng,t.lat):Du.convert(t),this},Lu.prototype.setSouthWest=function(t){return this._sw=t instanceof Du?new Du(t.lng,t.lat):Du.convert(t),this},Lu.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Du)e=t,r=t;else{if(!(t instanceof Lu))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Lu.convert(t)):this.extend(Du.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Du(e.lng,e.lat),this._ne=new Du(r.lng,r.lat)),this},Lu.prototype.getCenter=function(){return new Du((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Lu.prototype.getSouthWest=function(){return this._sw},Lu.prototype.getNorthEast=function(){return this._ne},Lu.prototype.getNorthWest=function(){return new Du(this.getWest(),this.getNorth())},Lu.prototype.getSouthEast=function(){return new Du(this.getEast(),this.getSouth())},Lu.prototype.getWest=function(){return this._sw.lng},Lu.prototype.getSouth=function(){return this._sw.lat},Lu.prototype.getEast=function(){return this._ne.lng},Lu.prototype.getNorth=function(){return this._ne.lat},Lu.prototype.toArray=function(){return},Lu.prototype.toString=function(){return ”LngLatBounds(“+this._sw.toString()+”, “+this._ne.toString()+”)“},Lu.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Lu.convert=function(t){return!t||t instanceof Lu?t:new Lu(t)};var Du=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(”Invalid LngLat object: (“t
”, “e
”)“);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error(”Invalid LngLat latitude value: must be between -90 and 90“)};Du.prototype.wrap=function(){return new Du(p(this.lng,-180,180),this.lat)},Du.prototype.toArray=function(){return},Du.prototype.toString=function(){return ”LngLat(“this.lng
”, “this.lat
”)“},Du.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Lu(new Du(this.lng-r,this.lat-e),new Du(this.lng+r,this.lat+e))},Du.convert=function(t){if(t instanceof Du)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Du(Number(t),Number(t));if(!Array.isArray(t)&&”object“==typeof t&&null!==t)return new Du(Number(”lng“in t?t.lng:t.lon),Number(t.lat));throw new Error(”`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]“)};var Uu=2*Math.PI*6378137;function Ru(t){return Uu*Math.cos(t*Math.PI/180)}function ju(t){return(180+t)/360}function qu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Nu(t,e){return t/Ru(e)}function Ku(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Zu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};Zu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Du.convert(t);return new Zu(ju(r.lng),qu(r.lat),Nu(e,r.lat))},Zu.prototype.toLngLat=function(){return new Du(360*this.x-180,Ku(this.y))},Zu.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Ru(Ku(e));var t,e;},Zu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Uu*(t=Ku(this.y),1/Math.cos(t*Math.PI/180));var t;};var Xu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Hu(0,t,e,r);};Xu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Xu.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Ou(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Ou(256*(r+1),256*(n+1),i),a+”,“a[1]
”,“o[0]
”,“+o),u=function(t,e,r){for(var n,i=”“,a=t;a>0;a–)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t.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(”tms“===e?Math.pow(2,this.z)-this.y-1:this.y)).replace(”{quadkey}“,u).replace(”{bbox-epsg-3857}“,s)},Xu.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i((t.x*e-this.x)*pa,(t.y*e-this.y)*pa)};var Gu=function(t,e){this.wrap=t,this.canonical=e,this.key=Hu(t,e.z,e.x,e.y);},Ju=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Xu(r,+n,+i),this.key=Hu(e,t,n,i);};function Hu(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}Ju.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Ju.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Ju(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ju(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Ju.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Ju.prototype.children=function(t){if(this.overscaledZ>=t)return[new Ju(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Ju(e,this.wrap,e,r,n),new Ju(e,this.wrap,e,r+1,n),new Ju(e,this.wrap,e,r,n+1),new Ju(e,this.wrap,e,r+1,n+1)]},Ju.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Ju.prototype.wrapped=function(){return new Ju(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Ju.prototype.unwrapTo=function(t){return new Ju(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Ju.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Ju.prototype.toUnwrapped=function(){return new Gu(this.wrap,this.canonical)},Ju.prototype.toString=function(){return this.overscaledZ+”/“this.canonical.x
”/“+this.canonical.y},Ju.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Zu(t.x-this.wrap,t.y))},xn(”CanonicalTileID“,Xu),xn(”OverscaledTileID“,Ju,{omit:});var Yu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError(”DEM tiles must be square“);if(r&&”mapbox“!==r&&”terrarium“!==r)return w('”'r
'“ is not a valid encoding type. Valid types include ”mapbox“ and ”terrarium“.');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||”mapbox“;for(var i=0;i=this.data,this.data=this.data,this.data=this.data,this.data=this.data;this.data=this.data,this.data=this.data,this.data=this.data,this.data=this.data;};Yu.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return(”terrarium“===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r,r,r)},Yu.prototype.getUnpackVector=function(){return ”terrarium“===this.encoding?:[6553.6,25.6,.1,1e4]},Yu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError(”out of range source coordinates for DEM data“);return(e+1)*this.stride+(t+1)},Yu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Yu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Yu.prototype.getPixels=function(){return new Na({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Yu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error(”dem dimension mismatch“);var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch®{case-1:a=o-1;break;case 1:o=a+1;}for(var s=-e*this.dim,u=-r*this.dim,l=a;l<o;l++)for(var p=n;p=t.data;},xn(”DEMData“,Yu);var $u=ai();var Wu=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t;this._stringToNumber=e,this._numberToString=r;}};Wu.prototype.encode=function(t){return this._stringToNumber},Wu.prototype.decode=function(t){return this._numberToString};var Qu=function(t,e,r,n){this.type=”Feature“,this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id);},tl={geometry:{configurable:!0}};tl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},tl.geometry.set=function(t){this._geometry=t;},Qu.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)”_geometry“!==e&&”_vectorTileFeature“!==e&&(t=this);return t},Object.defineProperties(Qu.prototype,tl);var el=function(){this.state={},this.stateChanges={},this.deletedStates={};};el.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges=this.stateChanges||{},this.stateChanges[n]=this.stateChanges[n]||{},c(this.stateChanges[n],r),null===this.deletedStates)for(var i in this.deletedStates={},this.state)i!==n&&(this.deletedStates[i]=null);else if(this.deletedStates&&null===this.deletedStates[n])for(var a in this.deletedStates[n]={},this.state[n])r||(this.deletedStates[n]=null);else for(var o in r){this.deletedStates&&this.deletedStates[n]&&null===this.deletedStates[n]&&delete this.deletedStates[n];}},el.prototype.removeFeatureState=function(t,e,r){if(!(null===this.deletedStates)){var n=String(e);if(this.deletedStates=this.deletedStates||{},r&&void 0!==e&&e>=0)null!==this.deletedStates[n]&&(this.deletedStates[n]=this.deletedStates[n]||{},this.deletedStates[n]=null);else if(void 0!==e&&e>=0){if(this.stateChanges&&this.stateChanges[n])for(r in this.deletedStates[n]={},this.stateChanges[n])this.deletedStates[n]=null;else this.deletedStates[n]=null;}else this.deletedStates=null;}},el.prototype.getState=function(t,e){var r=String(e),n=this.state||{},i=this.stateChanges||{},a=c({},n,i);if(null===this.deletedStates)return{};if(this.deletedStates){var o=this.deletedStates[e];if(null===o)return{};for(var s in o)delete a;}return a},el.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},el.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state=this.state||{};var i={};for(var a in this.stateChanges)this.state[a]||(this.state[a]={}),c(this.state[a],this.stateChanges[a]),i=this.state[a];r=i;}for(var o in this.deletedStates){this.state=this.state||{};var s={};if(null===this.deletedStates)for(var u in this.state)s={},this.state[u]={};else for(var l in this.deletedStates){if(null===this.deletedStates[l])this.state[l]={};else for(var p=0,h=Object.keys(this.deletedStates[l]);p<h.length;p+=1){var f=h;delete this.state[l];}s=this.state[l];}r=r||{},c(r,s);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys®.length)for(var y in t){t.setFeatureState(r,e);}};var rl=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new yn(pa,16,0),this.grid3D=new yn(pa,16,0),this.featureIndexArray=r||new Ui;};function nl(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o;e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);}return{minX:e,minY:r,maxX:n,maxY:i}}function il(t,e){return e-t}rl.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e,p=,c=0;c<l.length;c++){var h=l;p=Math.min(p,h.x),p=Math.min(p,h.y),p=Math.max(p,h.x),p=Math.max(p,h.y);}p<pa&&p<pa&&p>=0&&p>=0&&s.insert(o,p,p,p,p);}},rl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Zo.VectorTile(new cu(this.rawTileData)).layers,this.sourceLayerCoder=new Wu(this.vtLayers?Object.keys(this.vtLayers).sort():)),this.vtLayers},rl.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var a=t.params||{},o=pa/t.tileSize/t.scale,s=jr(a.filter),u=t.queryGeometry,l=t.queryPadding*o,p=nl(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=nl(t.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var u=s;if(e<=u.x&&r<=u.y&&n>=u.x&&a>=u.y)return!0}var l=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1){if(Sa(t,c))return!0}for(var h=0;h<t.length-1;h++){if(Ia(t,t,l))return!0}return!1}(t.cameraQueryGeometry,e-l,r-l,n+l,a+l)})),y=0,d=f;y<d.length;y+=1){var m=d;c.push(m);}c.sort(il);for(var v,g={},x=function(i){var l=c;if(l!==v){v=l;var p=n.featureIndexArray.get(l),h=null;n.loadMatchingFeature(g,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,s,a.layers,e,(function(e,i){h||(h=fa(e));var a={};return e.id&&(a=r.getState(i.sourceLayer||”_geojsonTileLayer“,e.id)),i.queryIntersectsFeature(u,e,a,h,n.z,t.transform,o,t.pixelPosMatrix)}));}},b=0;b<c.length;b++)x(b);return g},rl.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s){var u=this.bucketLayerIDs;if(!a||function(t,e){for(var r=0;r)>=0)return!0;return!1}(a,u)){var l=this.sourceLayerCoder.decode®,p=this.vtLayers.feature(n);if(i(new Rn(this.tileID.overscaledZ),p))for(var c=0;c<u.length;c++){var h=u;if(!(a&&a.indexOf(h)<0)){var f=o;if(f){var y=!s||s(p,f);if(y){var d=new Qu(p,this.z,this.x,this.y);d.layer=f.serialize();var m=t;void 0===m&&(m=t=[]),m.push({featureIndex:n,feature:d,intersectionZ:y});}}}}}},rl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a){var o={};this.loadVTLayers();for(var s=jr(n),u=0,l=t;u<l.length;u+=1){var p=l;this.loadMatchingFeature(o,e,r,p,s,i,a);}return o},rl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r;n<i.length;n+=1){if(t===i)return!0}return!1},xn(”FeatureIndex“,rl,{omit:});var al=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state=”loading“;};al.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<V.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e);},al.prototype.wasRequested=function(){return ”errored“===this.state||”loaded“===this.state||”reloading“===this.state},al.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state=”loaded“,t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a,n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var u=s;r=t;}}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets;if(i instanceof Ks){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0;}}for(var a in this.queryPadding=0,this.buckets){var o=this.buckets;this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(o));}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage);}else this.collisionBoxArray=new Bi;},al.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets.destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state=”unloaded“;},al.prototype.getBucket=function(t){return this.buckets},al.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets;r.uploadPending()&&r.upload(t);}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new lu(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new lu(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null);},al.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture);},al.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:i,tileSize:this.tileSize,pixelPosMatrix:u,transform:o,params:a,queryPadding:this.queryPadding*s},t,e):{}},al.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:”“,i=r._geojsonTileLayer||r;if(i)for(var a=jr(e&&e.filter),o=this.tileID.canonical,s=o.z,u=o.x,l=o.y,p={z:s,x:u,y:l},c=0;c<i.length;c++){var h=i.feature©;if(a(new Rn(this.tileID.overscaledZ),h)){var f=new Qu(h,s,u,l);f.tile=p,t.push(f);}}}},al.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer),delete this.mask;},al.prototype.setMask=function(t,e){if(!o(this.mask,t)&&(this.clearMask(),this.mask=t,!o(t,{0:!0}))){var r=new ui,n=new Ai;this.segments=new ji,this.segments.prepareSegment(0,r,n);for(var a=Object.keys(t),s=0;s<a.length;s++){var u=t[+a],l=pa>>u.z,p=new i(u.x*l,u.y*l),c=new i(p.x+l,p.y+l),h=this.segments.prepareSegment(4,r,n);r.emplaceBack(p.x,p.y,p.x,p.y),r.emplaceBack(c.x,p.y,c.x,p.y),r.emplaceBack(p.x,c.y,p.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var f=h.vertexLength;n.emplaceBack(f,f+1,f+2),n.emplaceBack(f+1,f+2,f+3),h.vertexLength+=4,h.primitiveLength+=2;}this.maskedBoundsBuffer=e.createVertexBuffer(r,$u.members),this.maskedIndexBuffer=e.createIndexBuffer(n);}},al.prototype.hasData=function(){return ”loaded“===this.state||”reloading“===this.state||”expired“===this.state},al.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},al.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=S(t.cacheControl);r&&(this.expirationTime=Date.now()+1e3*r);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0;}else i=!0;i?(this.expiredRequestCount++,this.state=”expired“):this.expiredRequestCount=0;}},al.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)},al.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var i=this.buckets,a=i.layers.sourceLayer||”_geojsonTileLayer“,o=r,s=t;o&&s&&0!==Object.keys(s).length&&(i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(i))));}}},al.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},al.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<V.now()},al.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0;},al.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=V.now()+t;};function ol(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(–o<0)return!1;s-=t.dist(a),a=t;}s+=t.dist(t),o++;for(var u=[],l=0;s<r/2;){var p=t,c=t,h=t;if(!h)return!1;var f=p.angleTo©-c.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u.distance>n;)l-=u.shift().angleDelta;if(l>i)return!1;o++,s+=c.dist(h);}return!0}function sl(t){for(var e=0,r=0;r.dist(t);return e}function ul(t,e,r){return t?.6*e*r:0}function ll(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function pl(t,e,r,n,i,a){for(var o=ul(r,i,a),s=ll(r,n)*a,u=0,l=sl(t)/2,p=0;p<t.length-1;p++){var c=t,h=t,f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=Ae(c.x,h.x,y),m=Ae(c.y,h.y,y),v=new Ms(d,m,h.angleTo©,p);return v._round(),!o||ol(t,v,s,o,e)?v:void 0}u+=f;}}function cl(t,e,r,n,i,a,o,s,u){var l=ul(n,a,o),p=ll(n,i),c=p*o,h=0===t.x||t.x===u||0===t.y||t.y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,a,o,s,u,l){var p=o/2;var c=sl(e);var h=0,f=r-n;var y=[];for(var d=0;d<e.length-1;d++){for(var m=e,v=e,g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,_=Ae(m.x,v.x,b),w=Ae(m.y,v.y,b);if(_>=0&&_<l&&w>=0&&w<l&&f-p>=0&&f+p<=c){var A=new Ms(_,w,x,d);A._round(),i&&!ol(e,A,o,i,a)||y.push(A);}}h+=g;}u||y.length||s||(y=t(e,h/2,n,i,a,o,s,!0,l));return y}(t,h?e/2*s%e:(p/2+2*a)*o*s%e,e,l,r,c,h,!1,u)}function hl(t,e){var r=t.image,n=t.right-t.left,a=(n*r.paddedRect.w/(r.paddedRect.w-2)-n)/2,o=t.left-a,s=t.right+a,u=t.bottom-t.top,l=(u*r.paddedRect.h/(r.paddedRect.h-2)-u)/2,p=t.top-l,c=t.bottom+l,h=new i(o,p),f=new i(s,p),y=new i(s,c),d=new i(o,c),m=e*Math.PI/180;if(m){var v=Math.sin(m),g=Math.cos(m),x=;h._matMult(x),f._matMult(x),d._matMult(x),y._matMult(x);}return[{tl:h,tr:f,bl:d,br:y,tex:r.paddedRect,writingMode:void 0,glyphOffset:,sectionIndex:0}]}var fl=function(t,e,r,n,a,o,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l;if(this.boxStartIndex=t.length,p){var v=y-f,g=m-d;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(t,e,r,r.segment,g,v,n,a,o,c));}else{if(h){var x=new i(d,f),b=new i(m,f),_=new i(d,y),w=new i(m,y),A=h*Math.PI/180;x._rotate(A),b._rotate(A),_._rotate(A),w._rotate(A),d=Math.min(x.x,b.x,_.x,w.x),m=Math.max(x.x,b.x,_.x,w.x),f=Math.min(x.y,b.y,_.y,w.y),y=Math.max(x.y,b.y,_.y,w.y);}t.emplaceBack(r.x,r.y,d,f,m,y,n,a,o,0,0);}this.boxEndIndex=t.length;};fl.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,u,l){var p=a/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-a/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(–m<0){if(v>g)return;m=0;break}v-=e.dist(d),d=e;}while(v>x);for(var b=e.dist(e),_=-f;_<c+f;_++){var w=_*p,A=g+w;if(w<0&&(A+=w),w>i&&(A+=w-i),!(A<v)){for(;v+b<A;){if(v+=b,++m+1>=e.length)return;b=e.dist(e);}var k=A-v,S=e,I=e.sub(S)._unit()._mult(k)._add(S)._round(),z=Math.abs(A-y)<p?0:.8*(A-y);t.emplaceBack(I.x,I.y,-a/2,-a/2,a/2,a/2,o,s,u,a/2,z);}}};var yl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=dl),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r–)this._down®;};function dl(t,e){return t<e?-1:t>e?1:0}function ml(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,u=t,l=0;l<u.length;l++){var p=u;(!l||p.x<n)&&(n=p.x),(!l||p.y<a)&&(a=p.y),(!l||p.x>o)&&(o=p.x),(!l||p.y>s)&&(s=p.y);}var c=o-n,h=s-a,f=Math.min(c,h),y=f/2,d=new yl([],vl);if(0===f)return new i(n,a);for(var m=n;m<o;m+=f)for(var v=a;v<s;v+=f)d.push(new gl(m+y,v+y,y,t));for(var g=function(t){for(var e=0,r=0,n=0,i=t,a=0,o=i.length,s=o-1;a<o;s=a++){var u=i,l=i,p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p;}return new gl(r/e,n/e,0,t)}(t),x=d.length;d.length;){var b=d.pop();(b.d>g.d||!g.d)&&(g=b,r&&console.log(”found best %d after %d probes“,Math.round(1e4*b.d)/1e4,x)),b.max-g.d<=e||(y=b.h/2,d.push(new gl(b.p.x-y,b.p.y-y,y,t)),d.push(new gl(b.p.x+y,b.p.y-y,y,t)),d.push(new gl(b.p.x-y,b.p.y+y,y,t)),d.push(new gl(b.p.x+y,b.p.y+y,y,t)),x+=4);}return r&&(console.log(”num probes: “+x),console.log(”best distance: “+g.d)),g.p}function vl(t,e){return e.max-t.max}function gl(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e,o=0,s=a.length,u=s-1;o<s;u=o++){var l=a,p=a;l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Aa(t,l,p));}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}yl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},yl.prototype.pop=function(){if(0!==this.length){var t=this.data,e=this.data.pop();return this.length–,this.length>0&&(this.data=e,this._down(0)),t}},yl.prototype.peek=function(){return this.data},yl.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e;t>0;){var i=t-1>>1,a=e;if(r(n,a)>=0)break;e=a,t=i;}e=n;},yl.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e;t<n;){var a=1+(t<<1),o=e,s=a+1;if(s,o)<0&&(a=s,o=e),r(o,i)>=0)break;e=o,t=a;}e=i;};var xl=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,u,l;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};})),bl=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};})),_l=xl,wl=xl,Al=bl;_l.murmur3=wl,_l.murmur2=Al;var kl=7,Sl=Number.POSITIVE_INFINITY;function Il(t,e){return e!==Sl?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs®,t){case”top-right“:case”top-left“:case”top“:i=r-kl;break;case”bottom-right“:case”bottom-left“:case”bottom“:i=-r+kl;}switch(t){case”top-right“:case”bottom-right“:case”right“:n=-e;break;case”top-left“:case”bottom-left“:case”left“:n=e;}return}(t,e,e):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case”top-right“:case”top-left“:n=i-kl;break;case”bottom-right“:case”bottom-left“:n=-i+kl;break;case”bottom“:n=-e+kl;break;case”top“:n=e-kl;}switch(t){case”top-right“:case”bottom-right“:r=-i;break;case”top-left“:case”bottom-left“:r=i;break;case”left“:r=e;break;case”right“:r=-e;}return}(t,e)}function zl(t){switch(t){case”right“:case”top-right“:case”bottom-right“:return ”right“;case”left“:case”top-left“:case”bottom-left“:return ”left“}return ”center“}var Cl=65535;function Bl(t,e,r,n,a,o,s,u,l,p,c,h,f,y){var d=function(t,e,r,n,a,o,s,u){for(var l=n.layout.get(”text-rotate“).evaluate(o,{})*Math.PI/180,p=e.positionedGlyphs,c=[],h=0;h<p.length;h++){var f=p,y=s,d=y&&y;if(d){var m=d.rect;if(m){var v=Tu+1,g=d.metrics.advance*f.scale/2,x=a?:[0,0],b=a?:[f.x+g+r,f.y+r],_=(a||u)&&f.vertical,w=;_&&(w=b,b=);var A=(d.metrics.left-v)*f.scale-g+b,k=(-d.metrics.top-v)*f.scale+b,S=A+m.w*f.scale,I=k+m.h*f.scale,z=new i(A,k),C=new i(S,k),B=new i(A,I),P=new i(S,I);if(_){var E=new i(-g,g-e.yOffset),M=-Math.PI/2,T=xs/2-g,V=new i(5-e.yOffset-T,0),F=new(Function.prototype.bind.apply(i,.concat(w)));z._rotateAround(M,E)._add(V)._add(F),C._rotateAround(M,E)._add(V)._add(F),B._rotateAround(M,E)._add(V)._add(F),P._rotateAround(M,E)._add(V)._add(F);}if(l){var O=Math.sin(l),L=Math.cos(l),D=;z._matMult(D),C._matMult(D),B._matMult(D),P._matMult(D);}c.push({tl:z,tr:C,bl:B,br:P,tex:m,writingMode:e.writingMode,glyphOffset:x,sectionIndex:f.sectionIndex});}}}return c}(0,r,s,n,a,o,h,t.allowVerticalPlacement),m=t.textSizeData,v=null;”source“===m.kind?(v=)[0]>Cl&&w(t.layerIds+': Value for ”text-size“ is >= 256. Reduce your ”text-size“.‘):”composite“===m.kind&&((v=[Ts*y.compositeTextSizes.evaluate(o,{}),Ts*y.compositeTextSizes.evaluate(o,{})])[0]>Cl||v>Cl)&&w(t.layerIds+': Value for ”text-size“ is >= 256. Reduce your ”text-size“.'),t.addSymbols(t.text,d,v,s,a,o,l,e,u.lineStartIndex,u.lineLength,f);for(var g=0,x=p;g<x.length;g+=1){c[x]=t.text.placedSymbolArray.length-1;}return 4*d.length}function Pl(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i,o=a.length-1;o>=0;o–)if(n.dist(a)<r)return!0}else i=[];return i.push(n),!1}t.Actor=Fu,t.AlphaImage=qa,t.CanonicalTileID=Xu,t.CollisionBoxArray=Bi,t.Color=Yt,t.DEMData=Yu,t.DataConstantProperty=Hn,t.DictionaryCoder=Wu,t.EXTENT=pa,t.ErrorEvent=kt,t.EvaluationParameters=Rn,t.Event=At,t.Evented=St,t.FeatureIndex=rl,t.FillBucket=Mo,t.FillExtrusionBucket=Ho,t.ImageAtlas=iu,t.ImagePosition=ru,t.LineBucket=os,t.LngLat=Du,t.LngLatBounds=Lu,t.MercatorCoordinate=Zu,t.ONE_EM=xs,t.OverscaledTileID=Ju,t.Point=i,t.Point$1=i,t.ProgramConfiguration=oa,t.Properties=ti,t.Protobuf=cu,t.RGBAImage=Na,t.RequestManager=j,t.ResourceType=pt,t.SegmentVector=ji,t.SourceFeatureState=el,t.StructArrayLayout1ui2=Si,t.StructArrayLayout2i4=si,t.StructArrayLayout2ui4=ki,t.StructArrayLayout3ui6=Ai,t.StructArrayLayout4i8=ui,t.SymbolBucket=Ks,t.Texture=lu,t.Tile=al,t.Transitionable=Nn,t.Uniform1f=Gi,t.Uniform1i=Xi,t.Uniform2f=Ji,t.Uniform3f=Hi,t.Uniform4f=Yi,t.UniformColor=$i,t.UniformMatrix4f=Qi,t.UnwrappedTileID=Gu,t.ValidationError=zt,t.WritingMode=bs,t.ZoomHistory=kn,t.addDynamicAttributes=js,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i=e,0==–n&&r(a,i);}));}));},t.bezier=s,t.bindAll=m,t.browser=V,t.cacheEntryPossiblyAdded=function(t){++lt>it&&(t.getActor().send(”enforceCacheSizeLimit“,nt),lt=0);},t.clamp=l,t.clearTileCache=function(t){var e=self.caches.delete(rt);t&&e.catch(t).then((function(){return t()}));},t.clone=function(t){var e=new Ma(16);return e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e=t,e},t.clone$1=b,t.config=F,t.create=function(){var t=new Ma(16);return Ma!=Float32Array&&(t=0,t=0,t=0,t=0,t=0,t=0,t=0,t=0,t=0,t=0,t=0,t=0),t=1,t=1,t=1,t=1,t},t.create$1=function(){var t=new Ma(9);return Ma!=Float32Array&&(t=0,t=0,t=0,t=0,t=0,t=0),t=1,t=1,t=1,t},t.create$2=function(){var t=new Ma(4);return Ma!=Float32Array&&(t=0,t=0),t=1,t=1,t},t.createCommonjsModule=e,t.createExpression=Cr,t.createLayout=ai,t.createStyleLayer=function(t){return ”custom“===t.type?new Qs(t):new tu(t)},t.deepEqual=o,t.ease=u,t.emitValidationErrors=fn,t.endsWith=v,t.enforceCacheSizeLimit=function(t){self.caches&&self.caches.open(rt).then((function(e){e.keys().then((function®{for(var n=0;n);}));}));},t.evaluateSizeForFeature=Fs,t.evaluateSizeForZoom=Os,t.evaluateVariableOffset=Il,t.evented=Dn,t.extend=c,t.featureFilter=jr,t.filterObject=x,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t=n,t=r,t=0,t=-r,t=n,t=0,t=0,t=0,t=1,t},t.getAnchorAlignment=Bs,t.getAnchorJustification=zl,t.getArrayBuffer=mt,t.getImage=bt,t.getJSON=function(t,e){return dt(c(t,{type:”json“}),e)},t.getRTLTextPluginStatus=function(){return On},t.getReferrer=ft,t.getVideo=function(t,e){var r,n,i=self.document.createElement(”video“);i.muted=!0,i.onloadstart=function(){e(null,i);};for(var a=0;a<t.length;a++){var o=self.document.createElement(”source“);r=t,n=void 0,(n=self.document.createElement(”a“)).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin=”Anonymous“),o.src=t,i.appendChild(o);}return{cancel:function(){}}},t.identity=function(t){return t=1,t=0,t=0,t=0,t=0,t=1,t=0,t=0,t=0,t=0,t=1,t=0,t=0,t=0,t=0,t=1,t},t.ieee754=pu,t.invert=function(t,e){var r=e,n=e,i=e,a=e,o=e,s=e,u=e,l=e,p=e,c=e,h=e,f=e,y=e,d=e,m=e,v=e,g=r*s-n*o,x=r*u-i*o,b=r*l-a*o,_=n*u-i*s,w=n*l-a*s,A=i*l-a*u,k=p*d-c*y,S=p*m-h*y,I=p*v-f*y,z=c*m-h*d,C=c*v-f*d,B=h*v-f*m,P=g*B-x*C+b*z+_*I-w*S+A*k;return P?(P=1/P,t=(s*B-u*C+l*z)*P,t=(i*C-n*B-a*z)*P,t=(d*A-m*w+v*_)*P,t=(h*w-c*A-f*_)*P,t=(u*I-o*B-l*S)*P,t=(r*B-i*I+a*S)*P,t=(m*b-y*A-v*x)*P,t=(p*A-h*b+f*x)*P,t=(o*C-s*I+l*k)*P,t=(n*I-r*C-a*k)*P,t=(y*w-d*b+v*g)*P,t=(c*b-p*w-f*g)*P,t=(s*S-o*z-u*k)*P,t=(r*z-n*S+i*k)*P,t=(d*x-y*_-m*g)*P,t=(p*_-c*x+h*g)*P,t):null},t.isChar=Sn,t.isMapboxURL=q,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=dt,t.mapObject=g,t.mercatorXfromLng=ju,t.mercatorYfromLat=qu,t.mercatorZfromAltitude=Nu,t.multiply=function(t,e,r){var n=e,i=e,a=e,o=e,s=e,u=e,l=e,p=e,c=e,h=e,f=e,y=e,d=e,m=e,v=e,g=e,x=r,b=r,_=r,w=r;return t=x*n+b*s+_*c+w*d,t=x*i+b*u+_*h+w*m,t=x*a+b*l+_*f+w*v,t=x*o+b*p+_*y+w*g,x=r,b=r,_=r,w=r,t=x*n+b*s+_*c+w*d,t=x*i+b*u+_*h+w*m,t=x*a+b*l+_*f+w*v,t=x*o+b*p+_*y+w*g,x=r,b=r,_=r,w=r,t=x*n+b*s+_*c+w*d,t=x*i+b*u+_*h+w*m,t=x*a+b*l+_*f+w*v,t=x*o+b*p+_*y+w*g,x=r,b=r,_=r,w=r,t=x*n+b*s+_*c+w*d,t=x*i+b*u+_*h+w*m,t=x*a+b*l+_*f+w*v,t=x*o+b*p+_*y+w*g,t},t.mvt=Zo,t.number=Ae,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),u=1/(n-i),l=1/(a-o);return t=-2*s,t=0,t=0,t=0,t=0,t=-2*u,t=0,t=0,t=0,t=0,t=2*l,t=0,t=(e+r)*s,t=(i+n)*u,t=(o+a)*l,t=1,t},t.parseGlyphPBF=function(t){return new cu(t).readFields(Pu,[])},t.performSymbolLayout=function(t,e,r,n,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=pa/s,t.compareText={},t.iconsNeedLinear=!1;var u=t.layers.layout,l=t.layers._unevaluatedLayout._values,p={};if(”composite“===t.textSizeData.kind){var c=t.textSizeData,h=c.minZoom,f=c.maxZoom;p.compositeTextSizes=[l.possiblyEvaluate(new Rn(h)),l.possiblyEvaluate(new Rn(f))];}if(”composite“===t.iconSizeData.kind){var y=t.iconSizeData,d=y.minZoom,m=y.maxZoom;p.compositeIconSizes=[l.possiblyEvaluate(new Rn(d)),l.possiblyEvaluate(new Rn(m))];}p.layoutTextSize=l.possiblyEvaluate(new Rn(t.zoom+1)),p.layoutIconSize=l.possiblyEvaluate(new Rn(t.zoom+1)),p.textMaxSize=l.possiblyEvaluate(new Rn(18));for(var v=u.get(”text-line-height“)*xs,g=”map“===u.get(”text-rotation-alignment“)&&”point“!==u.get(”symbol-placement“),x=u.get(”text-keep-upright“),b=function(){var o=A,s=u.get(”text-font“).evaluate(o,{}).join(”,“),l=r,c={horizontal:{},vertical:void 0},h=o.text,f=;if(h){var y=h.toString(),d=u.get(”text-letter-spacing“).evaluate(o,{})*xs,m=function(t){for(var e=0,r=t;e<r.length;e+=1){if(!zn(r.charCodeAt(0)))return!1}return!0}(y)?d:0,b=u.get(”text-anchor“).evaluate(o,{}),k=u.get(”text-variable-anchor“);if(!k){var S=u.get(”text-radial-offset“).evaluate(o,{});f=S?Il(b,):u.get(”text-offset“).evaluate(o,{}).map((function(t){return t*xs}));}var I=g?”center“:u.get(”text-justify“).evaluate(o,{}),z=u.get(”symbol-placement“),C=”point“===z?u.get(”text-max-width“).evaluate(o,{})*xs:0,B=function(){t.allowVerticalPlacement&&In(y)&&(c.vertical=ws(h,e,s,C,v,b,”left“,m,f,bs.vertical,!0,z));};if(!g&&k){for(var P=”auto“===I?k.map((function(t){return zl(t)})):[I],E=!1,M=0;M<P.length;M++){var T=P;if(!c.horizontal)if(E)c.horizontal=c.horizontal;else{var V=ws(h,e,s,C,v,”center“,T,m,f,bs.horizontal,!1,z);V&&(c.horizontal=V,E=1===V.lineCount);}}B();}else{”auto“===I&&(I=zl(b));var F=ws(h,e,s,C,v,b,I,m,f,bs.horizontal,!1,z);F&&(c.horizontal=F),B(),In(y)&&g&&x&&(c.vertical=ws(h,e,s,C,v,b,I,m,f,bs.vertical,!1,z));}}var O=void 0;if(o.icon&&o.icon.name){var L=n;L&&(O=function(t,e,r){var n=Bs®,i=n.horizontalAlign,a=n.verticalAlign,o=e,s=e,u=o-t.displaySize*i,l=u+t.displaySize,p=s-t.displaySize*a;return{image:t,top:p,bottom:p+t.displaySize,left:u,right:l}}(a,u.get(”icon-offset“).evaluate(o,{}),u.get(”icon-anchor“).evaluate(o,{})),void 0===t.sdfIcons?t.sdfIcons=L.sdf:t.sdfIcons!==L.sdf&&w(”Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer“),L.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==u.get(”icon-rotate“).constantOr(1)&&(t.iconsNeedLinear=!0));}(Object.keys(c.horizontal).length||O)&&function(t,e,r,n,a,o,s){var u=o.layoutTextSize.evaluate(e,{}),l=o.layoutIconSize.evaluate(e,{}),p=o.textMaxSize.evaluate(e,{});void 0===p&&(p=u);var c,h=t.layers.layout,f=h.get(”icon-offset“).evaluate(e,{}),y=function(t){for(var e in t)return t;return null}(r.horizontal),d=u/24,m=t.tilePixelRatio*d,v=t.tilePixelRatio*p/24,g=t.tilePixelRatio*l,x=t.tilePixelRatio*h.get(”symbol-spacing“),b=h.get(”text-padding“)*t.tilePixelRatio,_=h.get(”icon-padding“)*t.tilePixelRatio,A=h.get(”text-max-angle“)/180*Math.PI,k=”map“===h.get(”text-rotation-alignment“)&&”point“!==h.get(”symbol-placement“),S=”map“===h.get(”icon-rotation-alignment“)&&”point“!==h.get(”symbol-placement“),I=h.get(”symbol-placement“),z=x/2,C=h.get(”icon-text-fit“);n&&”none“!==C&&(t.allowVerticalPlacement&&r.vertical&&(c=Es(n,r.vertical,C,h.get(”icon-text-fit-padding“),f,d)),y&&(n=Es(n,y,C,h.get(”icon-text-fit-padding“),f,d)));var B=function(i,u){u.x<0||u.x>=pa||u.y<0||u.y>=pa||function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_){var A,k,S,I,z,C=t.addToLineVertexArray(e,r),B=0,P=0,E=0,M=0,T=-1,V=-1,F={},O=_l(”“),L=0,D=0;void 0===o._unevaluatedLayout.getValue(”text-radial-offset“)?(A=o.layout.get(”text-offset“).evaluate(x,{}).map((function(t){return t*xs})),L=A,D=A):(L=o.layout.get(”text-radial-offset“).evaluate(x,{})*xs,D=Sl);if(t.allowVerticalPlacement&&n.vertical){var U=o.layout.get(”text-rotate“).evaluate(x,{})+90,R=n.vertical;I=new fl(s,r,e,u,l,p,R,c,h,f,t.overscaling,U),a&&(z=new fl(s,r,e,u,l,p,a,d,m,f,t.overscaling,U));}if(i){var j=o.layout.get(”icon-rotate“).evaluate(x,{}),q=hl(i,j),N=a?hl(a,j):void 0;S=new fl(s,r,e,u,l,p,i,d,m,!1,t.overscaling,j),B=4*q.length;var K=t.iconSizeData,Z=null;”source“===K.kind?(Z=)[0]>Cl&&w(t.layerIds+': Value for ”icon-size“ is >= 256. Reduce your ”icon-size“.’):”composite“===K.kind&&((Z=[Ts*_.compositeIconSizes.evaluate(x,{}),Ts*_.compositeIconSizes.evaluate(x,{})])[0]>Cl||Z>Cl)&&w(t.layerIds+': Value for ”icon-size“ is >= 256. Reduce your ”icon-size“.'),t.addSymbols(t.icon,q,Z,g,v,x,!1,e,C.lineStartIndex,C.lineLength,-1),T=t.icon.placedSymbolArray.length-1,N&&(P=4*N.length,t.addSymbols(t.icon,N,Z,g,v,x,bs.vertical,e,C.lineStartIndex,C.lineLength,-1),V=t.icon.placedSymbolArray.length-1);}for(var X in n.horizontal){var G=n.horizontal;if(!k){O=_l(G.text);var J=o.layout.get(”text-rotate“).evaluate(x,{});k=new fl(s,r,e,u,l,p,G,c,h,f,t.overscaling,J);}var H=1===G.lineCount;if(E+=Bl(t,e,G,o,f,x,y,C,n.vertical?bs.horizontal:bs.horizontalOnly,H?Object.keys(n.horizontal):,F,b,T,_),H)break}n.vertical&&(M+=Bl(t,e,n.vertical,o,f,x,y,C,bs.vertical,,F,b,V,_));var Y=k?k.boxStartIndex:t.collisionBoxArray.length,$=k?k.boxEndIndex:t.collisionBoxArray.length,W=I?I.boxStartIndex:t.collisionBoxArray.length,Q=I?I.boxEndIndex:t.collisionBoxArray.length,tt=S?S.boxStartIndex:t.collisionBoxArray.length,et=S?S.boxEndIndex:t.collisionBoxArray.length,rt=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=Ks.MAX_GLYPHS&&w(”Too many glyphs being rendered in a tile. See =0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,T,V,O,Y,$,W,Q,tt,et,rt,nt,u,E,M,B,P,0,c,L,D);}(t,u,i,r,n,c,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,k,s,g,_,S,f,e,a,o);};if(“line”===I)for(var“>github.com/mapbox/mapbox-gl-js/issues/2907”);t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,T,V,O,Y,$,W,Q,tt,et,rt,nt,u,E,M,B,P,0,c,L,D);}(t,u,i,r,n,c,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,k,s,g,_,S,f,e,a,o);};if(“line”===I)for(var P=0,E=function(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var u=t,l=void 0,p=0;p<u.length-1;p++){var c=u,h=u;c.x<e&&h.x<e||(c.x<e?c=new i(e,c.y+(h.y-c.y)*((e-c.x)/(h.x-c.x)))._round():h.x<e&&(h=new i(e,c.y+(h.y-c.y)*((e-c.x)/(h.x-c.x)))._round()),c.y<r&&h.y<r||(c.y<r?c=new i(c.x+(h.x-c.x)*((r-c.y)/(h.y-c.y)),r)._round():h.y<r&&(h=new i(c.x+(h.x-c.x)*((r-c.y)/(h.y-c.y)),r)._round()),c.x>=n&&h.x>=n||(c.x>=n?c=new i(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round():h.x>=n&&(h=new i(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round()),c.y>=a&&h.y>=a||(c.y>=a?c=new i(c.x+(h.x-c.x)*((a-c.y)/(h.y-c.y)),a)._round():h.y>=a&&(h=new i(c.x+(h.x-c.x)*((a-c.y)/(h.y-c.y)),a)._round()),l&&c.equals(l)||(l=,o.push(l)),l.push(h)))));}return o}(e.geometry,0,0,pa,pa);P<E.length;P+=1)for(var M=E,T=cl(M,x,A,r.vertical||y,n,24,v,t.overscaling,pa),V=0,F=T;V<F.length;V+=1){var O=F,L=y;L&&Pl(t,L.text,z,O)||B(M,O);}else if(“line-center”===I)for(var D=0,U=e.geometry;D<U.length;D+=1){var R=U;if(R.length>1){var j=pl(R,A,r.vertical||y,n,24,v);j&&B(R,j);}}else if(“Polygon”===e.type)for(var q=0,N=Co(e.geometry,0);q<N.length;q+=1){var K=N,Z=ml(K,16);B(K,new Ms(Z.x,Z.y,0));}else if(“LineString”===e.type)for(var X=0,G=e.geometry;X<G.length;X+=1){var J=G;B(J,new Ms(J.x,J.y,0));}else if(“Point”===e.type)for(var H=0,Y=e.geometry;H<Y.length;H+=1)for(var $=Y,W=0,Q=$;W<Q.length;W+=1){var tt=Q;B(,new Ms(tt.x,tt.y,0));}}(t,o,c,O,l,p,f);},_=0,A=t.features;_<A.length;_+=1)b();o&&t.generateCollisionDebugBuffers();},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t=o/r,t=0,t=0,t=0,t=0,t=o,t=0,t=0,t=0,t=0,t=-1,t=0,t=0,t=0,null!=i&&i!==1/0?(a=1/(n-i),t=(i+n)*a,t=2*i*n*a):(t=-1,t=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e;i in t&&(r=t);}return r},t.plugin=Un,t.polygonIntersectsPolygon=ma,t.postMapLoadEvent=et,t.postTurnstileEvent=Q,t.potpack=eu,t.rasterBoundsAttributes=$u,t.refProperties=,t.register=xn,t.registerForPluginAvailability=function(t){return Ln?t({pluginURL:Ln,completionCallback:En}):Dn.once(“pluginAvailable”,t),t},t.rotate=function(t,e,r){var n=e,i=e,a=e,o=e,s=Math.sin®,u=Math.cos®;return t=n*u+a*s,t=i*u+o*s,t=n*-s+a*u,t=i*-s+o*u,t},t.rotateX=function(t,e,r){var n=Math.sin®,i=Math.cos®,a=e,o=e,s=e,u=e,l=e,p=e,c=e,h=e;return e!==t&&(t=e,t=e,t=e,t=e,t=e,t=e,t=e,t=e),t=a*i+l*n,t=o*i+p*n,t=s*i+c*n,t=u*i+h*n,t=l*i-a*n,t=p*i-o*n,t=c*i-s*n,t=h*i-u*n,t},t.rotateZ=function(t,e,r){var n=Math.sin®,i=Math.cos®,a=e,o=e,s=e,u=e,l=e,p=e,c=e,h=e;return e!==t&&(t=e,t=e,t=e,t=e,t=e,t=e,t=e,t=e),t=a*i+l*n,t=o*i+p*n,t=s*i+c*n,t=u*i+h*n,t=l*i-a*n,t=p*i-o*n,t=c*i-s*n,t=h*i-u*n,t},t.scale=function(t,e,r){var n=r,i=r,a=r;return t=e*n,t=e*n,t=e*n,t=e*n,t=e*i,t=e*i,t=e*i,t=e*i,t=e*a,t=e*a,t=e*a,t=e*a,t=e,t=e,t=e,t=e,t},t.setCacheLimits=function(t,e){nt=t,it=e;},t.setRTLTextPlugin=function(t,e){if(On===Tn||On===Vn)throw new Error(“setRTLTextPlugin cannot be called multiple times.”);On=Tn,Ln=V.resolveURL(t),En=function(t){t?(On=Mn,Ln=null,On=Fn,e&&e(t)):On=Vn;},Dn.fire(new At(“pluginAvailable”,{pluginURL:Ln,completionCallback:En}));},t.sphericalToCartesian=function(t){var e=t,r=t,n=t;return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos®*Math.sin(n),y:e*Math.sin®*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=It,t.symbolSize=Ls,t.transformMat3=function(t,e,r){var n=e,i=e,a=e;return t=n*r+i*r+a*r,t=n*r+i*r+a*r,t=n*r+i*r+a*r,t},t.transformMat4=Fa,t.translate=function(t,e,r){var n,i,a,o,s,u,l,p,c,h,f,y,d=r,m=r,v=r;return e===t?(t=e*d+e*m+e*v+e,t=e*d+e*m+e*v+e,t=e*d+e*m+e*v+e,t=e*d+e*m+e*v+e):(n=e,i=e,a=e,o=e,s=e,u=e,l=e,p=e,c=e,h=e,f=e,y=e,t=n,t=i,t=a,t=o,t=s,t=u,t=l,t=p,t=c,t=h,t=f,t=y,t=n*d+s*m+c*v+e,t=i*d+u*m+h*v+e,t=a*d+l*m+f*v+e,t=o*d+p*m+y*v+e),t},t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:“layers.”r
': missing required property “id”'}),void 0===t.render&&e.push({message:“layers.”r
': missing required method “render”'}),t.renderingMode&&“2d”!==t.renderingMode&&“3d”!==t.renderingMode&&e.push({message:“layers.”r
': property “renderingMode” must be either “2d” or “3d”'}),e},t.validateLight=pn,t.validateStyle=ln,t.values=function(t){var e=[];for(var r in t)e.push(t);return e},t.vectorTile=Zo,t.version=“1.5.0”,t.warnOnce=w,t.webpSupported=O,t.window=self,t.wrap=p;}));define(,(function(e){“use strict”;function t(e){var r=typeof e;if(“number”===r||“boolean”===r||“string”===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i=“[”,n=0,o=e;n)+“,”;}return i+“]”}for(var s=Object.keys(e).sort(),a=“{”,u=0;u)+“:”+t(e[s])+“,”;return a+“}”}function r®{for(var i=“”,n=0,o=e.refProperties;n<o.length;n+=1){i+=“/”+t(r[o]);}return i}var i=function(e){this.keyCache={},e&&this.replace(e);};i.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[]);},i.prototype.update=function(t,i){for(var n=this,o=0,s=t;o<s.length;o+=1){var a=s;this._layerConfigs=a;var u=this._layers=e.createStyleLayer(a);u._featureFilter=e.featureFilter(u.filter),this.keyCache&&delete this.keyCache;}for(var l=0,h=i;l<h.length;l+=1){var c=h;delete this.keyCache,delete this._layerConfigs,delete this._layers;}this.familiesBySource={};for(var f=0,p=function(e,t){for(var i={},n=0;n<e.length;n++){var o=t&&t[e.id]||r(e);t&&(t[e.id]=o);var s=i;s||(s=i=[]),s.push(e);}var a=[];for(var u in i)a.push(i);return a}(e.values(this._layerConfigs),this.keyCache);f<p.length;f+=1){var d=p.map((function(e){return n._layers})),g=d;if(“none”!==g.visibility){var m=g.source||“”,v=this.familiesBySource;v||(v=this.familiesBySource={});var y=g.sourceLayer||“_geojsonTileLayer”,w=v;w||(w=v=[]),w.push(d);}}};var n=function(t){var r={},i=[];for(var n in t){var o=t,s=r={};for(var a in o){var u=o;if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var l={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};i.push(l),s={rect:l,metrics:u.metrics};}}}var h=e.potpack(i),c=h.w,f=h.h,p=new e.AlphaImage({width:c||1,height:f||1});for(var d in t){var g=t;for(var m in g){var v=g;if(v&&0!==v.bitmap.width&&0!==v.bitmap.height){var y=r[m].rect;e.AlphaImage.copy(v.bitmap,p,{x:0,y:0},{x:y.x+1,y:y.y+1},v.bitmap);}}}this.image=p,this.positions=r;};e.register(“GlyphAtlas”,n);var o=function(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies;};function s(t,r,i){for(var n=new e.EvaluationParameters®,o=0,s=t;o<s.length;o+=1){s.recalculate(n,i);}}o.prototype.parse=function(t,r,i,o,a){var u=this;this.status=“parsing”,this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var l=new e.DictionaryCoder(Object.keys(t.layers).sort()),h=new e.FeatureIndex(this.tileID);h.bucketLayerIDs=[];var c,f,p,d,g={},m={featureIndex:h,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},v=r.familiesBySource;for(var y in v){var w=t.layers;if(w){1===w.version&&e.warnOnce('Vector tile source “'this.source
'” layer “'y
'” does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=l.encode(y),b=[],S=0;S<w.length;S++){var M=w.feature(S);b.push({feature:M,index:S,sourceLayerIndex:x});}for(var k=0,F=v;k<F.length;k+=1){var P=F,I=P;if(!(I.minzoom&&this.zoom=I.maxzoom))if(“none”!==I.visibility)s(P,this.zoom,i),(g=I.createBucket({index:h.bucketLayerIDs.length,layers:P,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,m),h.bucketLayerIDs.push(P.map((function(e){return e.id})));}}}var T=e.mapObject(m.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(T).length?o.send(“getGlyphs”,{uid:this.uid,stacks:T},(function(e,t){c||(c=e,f=t,L.call(u));})):f={};var _=Object.keys(m.iconDependencies);_.length?o.send(“getImages”,{icons:_},(function(e,t){c||(c=e,p=t,L.call(u));})):p={};var D=Object.keys(m.patternDependencies);function L(){if©return a©;if(f&&p&&d){var t=new n(f),r=new e.ImageAtlas(p,d);for(var o in g){var u=g;u instanceof e.SymbolBucket?(s(u.layers,this.zoom,i),e.performSymbolLayout(u,f,t.positions,p,r.iconPositions,this.showCollisionBoxes)):u.hasPattern&&(u instanceof e.LineBucket||u instanceof e.FillBucket||u instanceof e.FillExtrusionBucket)&&(s(u.layers,this.zoom,i),u.addFeatures(m,r.patternPositions));}this.status=“done”,a(null,{buckets:e.values(g).filter((function(e){return!e.isEmpty()})),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null});}}D.length?o.send(“getImages”,{icons:D},(function(e,t){c||(c=e,d=t,L.call(u));})):d={},L.call(this);};var a=“undefined”!=typeof performance,u={getEntriesByName:function(e){return!!(a&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(e)},mark:function(e){return!!(a&&performance&&performance.mark)&&performance.mark(e)},measure:function(e,t,r){return!!(a&&performance&&performance.measure)&&performance.measure(e,t,r)},clearMarks:function(e){return!!(a&&performance&&performance.clearMarks)&&performance.clearMarks(e)},clearMeasures:function(e){return!!(a&&performance&&performance.clearMeasures)&&performance.clearMeasures(e)}},l=function(e){this._marks={start:.join(“#”),end:.join(“#”),measure:e.url.toString()},u.mark(this._marks.start);};function h(t,r){var i=e.getArrayBuffer(t.request,(function(t,i,n,o){t?r(t):i&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.Protobuf(i)),rawData:i,cacheControl:n,expires:o});}));return function(){i.cancel(),r();}}l.prototype.finish=function(){u.mark(this._marks.end);var e=u.getEntriesByName(this._marks.measure);return 0===e.length&&(u.measure(this._marks.measure,this._marks.start,this._marks.end),e=u.getEntriesByName(this._marks.measure),u.clearMarks(this._marks.start),u.clearMarks(this._marks.end),u.clearMeasures(this._marks.measure)),e},u.Performance=l;var c=function(e,t,r,i){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||h,this.loading={},this.loaded={};};c.prototype.loadTile=function(t,r){var i=this,n=t.uid;this.loading||(this.loading={});var s=!!(t&&t.request&&t.request.collectResourceTiming)&&new u.Performance(t.request),a=this.loading=new o(t);a.abort=this.loadVectorData(t,(function(t,o){if(delete i.loading,t||!o)return a.status=“done”,i.loaded=a,r(t);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var h={};if(s){var c=s.finish();c&&(h.resourceTiming=JSON.parse(JSON.stringify©));}a.vectorTile=o.vectorTile,a.parse(o.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(t,i){if(t||!i)return r(t);r(null,e.extend({rawTileData:u.slice(0)},i,l,h));})),i.loaded=i.loaded||{},i.loaded=a;}));},c.prototype.reloadTile=function(e,t){var r=this,i=this.loaded,n=e.uid,o=this;if(i&&i){var s=i;s.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,i){var n=s.reloadCallback;n&&(delete s.reloadCallback,s.parse(s.vectorTile,o.layerIndex,r.availableImages,o.actor,n)),t(e,i);};“parsing”===s.status?s.reloadCallback=a:“done”===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a());}},c.prototype.abortTile=function(e,t){var r=this.loading,i=e.uid;r&&r&&r.abort&&(r.abort(),delete r),t();},c.prototype.removeTile=function(e,t){var r=this.loaded,i=e.uid;r&&r&&delete r,t();};var f=function(){this.loaded={};};f.prototype.loadTile=function(t,r){var i=t.uid,n=t.encoding,o=t.rawImageData,s=new e.DEMData(i,o,n);this.loaded=this.loaded||{},this.loaded=s,r(null,s);},f.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t&&delete t;};var p={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function d(e){var t=0;if(e&&e.length>0){t+=Math.abs(g(e));for(var r=1;r));}return t}function g(e){var t,r,i,n,o,s,a=0,u=e.length;if(u>2){for(s=0;s,r=e,a+=(m(e[0])-m(t))*Math.sin(m(r));a=a*p.RADIUS*p.RADIUS/2;}return a}function m(e){return e*Math.PI/180}var v={geometry:function e(t){var r,i=0;switch(t.type){case“Polygon”:return d(t.coordinates);case“MultiPolygon”:for(r=0;r);return i;case“Point”:case“MultiPoint”:case“LineString”:case“MultiLineString”:return 0;case“GeometryCollection”:for(r=0;r);return i}},ring:g},y=function e(t,r){switch(t&&t.type||null){case“FeatureCollection”:return t.features=t.features.map(w(e,r)),t;case“GeometryCollection”:return t.geometries=t.geometries.map(w(e,r)),t;case“Feature”:return t.geometry=e(t.geometry,r),t;case“Polygon”:case“MultiPolygon”:return function(e,t){“Polygon”===e.type?e.coordinates=x(e.coordinates,t):“MultiPolygon”===e.type&&(e.coordinates=e.coordinates.map(w(x,t)));return e}(t,r);default:return t}};function w(e,t){return function®{return e(r,t)}}function x(e,t){t=!!t,e=b(e,t);for(var r=1;r=b(e,!t);return e}function b(e,t){return function(e){return v.ring(e)>=0}(e)===t?e:e.reverse()}var S=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,M=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,“id”in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10));};M.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var n=i;t.push([new e.Point$1(n,n)]);}return t}for(var o=[],s=0,a=this._feature.geometry;s<a.length;s+=1){for(var u=[],l=0,h=a;l<h.length;l+=1){var c=h;u.push(new e.Point$1(c,c));}o.push(u);}return o},M.prototype.toGeoJSON=function(e,t,r){return S.call(this,e,t,r)};var k=function(t){this.layers={_geojsonTileLayer:this},this.name=“_geojsonTileLayer”,this.extent=e.EXTENT,this.length=t.length,this._features=t;};k.prototype.feature=function(e){return new M(this._features)};var F=P;function P(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length;}P.Varint=0,P.Fixed64=1,P.Bytes=2,P.Fixed32=5;function I(e){return e.type===P.Bytes?e.readVarint()+e.pos:e.pos+1}function T(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function _(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n–)r.buf=r.buf;}function D(e,t){for(var r=0;r);}function L(e,t){for(var r=0;r);}function B(e,t){for(var r=0;r);}function V(e,t){for(var r=0;r);}function C(e,t){for(var r=0;r);}function z(e,t){for(var r=0;r);}function E(e,t){for(var r=0;r);}function O(e,t){for(var r=0;r);}function N(e,t){for(var r=0;r);}function A(e,t){return(e|e<<8|e<<16)+16777216*e}function J(e,t,r){e=t,e=t>>>8,e=t>>>16,e=t>>>24;}function G(e,t){return(e|e<<8|e<<16)+(e<<24)}P.prototype={destroy:function(){this.buf=null;},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,e(n,t,this),this.pos===o&&this.skip(i);}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=A(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=G(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=A(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=A(this.buf,this.pos)+4294967296*G(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var t=e.ieee754.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=e.ieee754.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(e){var t,r,i=this.buf;return t=127&(r=i),r<128?t:(t|=(127&(r=i))<<7,r<128?t:(t|=(127&(r=i))<<14,r<128?t:(t|=(127&(r=i))<<21,r<128?t:function(e,t,r){var i,n,o=r.buf;if(n=o,i=(112&n)>>4,n<128)return T(e,i,t);if(n=o,i|=(127&n)<<3,n<128)return T(e,i,t);if(n=o,i|=(127&n)<<10,n<128)return T(e,i,t);if(n=o,i|=(127&n)<<17,n<128)return T(e,i,t);if(n=o,i|=(127&n)<<24,n<128)return T(e,i,t);if(n=o,i|=(1&n)<<31,n<128)return T(e,i,t);throw new Error(“Expected varint not more than 10 bytes”)}(t|=(15&(r=i))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,r){var i=“”,n=t;for(;n<r;){var o,s,a,u=e,l=null,h=u>239?4:u>223?3:u>191?2:1;if(n+h>r)break;1===h?u<128&&(l=u):2===h?128==(192&(o=e))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===h?(o=e,s=e,128==(192&o)&&128==(192&s)&&((l=(15&u)<<12|(63&o)<<6|63&s)<=2047||l>=55296&&l<=57343)&&(l=null)):4===h&&(o=e,s=e,a=e,128==(192&o)&&128==(192&s)&&128==(192&a)&&((l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,h=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=h;}return i}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==P.Bytes)return e.push(this.readVarint(t));var r=I(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==P.Bytes)return e.push(this.readSVarint());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==P.Bytes)return e.push(this.readBoolean());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==P.Bytes)return e.push(this.readFloat());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==P.Bytes)return e.push(this.readDouble());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==P.Bytes)return e.push(this.readFixed32());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==P.Bytes)return e.push(this.readSFixed32());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==P.Bytes)return e.push(this.readFixed64());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==P.Bytes)return e.push(this.readSFixed64());var t=I(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===P.Varint)for(;this.buf>127;);else if(t===P.Bytes)this.pos=this.readVarint()+this.pos;else if(t===P.Fixed32)this.pos+=4;else{if(t!==P.Fixed64)throw new Error(“Unimplemented type: ”+t);this.pos+=8;}},writeTag:function(e,t){this.writeVarint(e<<3|t);},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),J(this.buf,e,this.pos),this.pos+=4;},writeSFixed32:function(e){this.realloc(4),J(this.buf,e,this.pos),this.pos+=4;},writeFixed64:function(e){this.realloc(8),J(this.buf,-1&e,this.pos),J(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(e){this.realloc(8),J(this.buf,-1&e,this.pos),J(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8;},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,i;e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error(“Given varint doesn't fit into 10 bytes”);t.realloc(10),function(e,t,r){r.buf=127&e|128,e>>>=7,r.buf=127&e|128,e>>>=7,r.buf=127&e|128,e>>>=7,r.buf=127&e|128,e>>>=7,r.buf=127&e;}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf|=r|((e>>>=3)?128:0),!e)return;if(t.buf=127&e|((e>>>=7)?128:0),!e)return;if(t.buf=127&e|((e>>>=7)?128:0),!e)return;if(t.buf=127&e|((e>>>=7)?128:0),!e)return;if(t.buf=127&e|((e>>>=7)?128:0),!e)return;t.buf=127&e;}(i,t);}(e,this):(this.realloc(4),this.buf=127&e|(e>127?128:0),e<=127||(this.buf=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf=e>>>7&127))));},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e);},writeBoolean:function(e){this.writeVarint(Boolean(e));},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var i,n,o=0;o<t.length;o++){if((i=t.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===t.length?(e=239,e=191,e=189):n=i;continue}if(i<56320){e=239,e=191,e=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null;}else n&&(e=239,e=191,e=189,n=null);i<128?e=i:(i<2048?e=i>>6|192:(i<65536?e=i>>12|224:(e=i>>18|240,e=i>>12&63|128),e=i>>6&63|128),e=63&i|128);}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&_(t,r,this),this.pos=t-1,this.writeVarint®,this.pos+=r;},writeFloat:function(t){this.realloc(4),e.ieee754.write(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),e.ieee754.write(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=e;},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&_(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i;},writeMessage:function(e,t,r){this.writeTag(e,P.Bytes),this.writeRawMessage(t,r);},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,D,t);},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,L,t);},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,C,t);},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,B,t);},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,V,t);},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,z,t);},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,E,t);},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,O,t);},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,N,t);},writeBytesField:function(e,t){this.writeTag(e,P.Bytes),this.writeBytes(t);},writeFixed32Field:function(e,t){this.writeTag(e,P.Fixed32),this.writeFixed32(t);},writeSFixed32Field:function(e,t){this.writeTag(e,P.Fixed32),this.writeSFixed32(t);},writeFixed64Field:function(e,t){this.writeTag(e,P.Fixed64),this.writeFixed64(t);},writeSFixed64Field:function(e,t){this.writeTag(e,P.Fixed64),this.writeSFixed64(t);},writeVarintField:function(e,t){this.writeTag(e,P.Varint),this.writeVarint(t);},writeSVarintField:function(e,t){this.writeTag(e,P.Varint),this.writeSVarint(t);},writeStringField:function(e,t){this.writeTag(e,P.Bytes),this.writeString(t);},writeFloatField:function(e,t){this.writeTag(e,P.Fixed32),this.writeFloat(t);},writeDoubleField:function(e,t){this.writeTag(e,P.Fixed64),this.writeDouble(t);},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t));}};var Z=e.vectorTile.VectorTileFeature,j=Y;function Y(e,t){this.options=t||{},this.features=e,this.length=e.length;}function X(e,t){this.id=“number”==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?:e.geometry,this.properties=e.tags,this.extent=t||4096;}Y.prototype.feature=function(e){return new X(this.features,this.options.extent)},X.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var i=t,n=[],o=0;o<i.length;o++)n.push(new e.Point$1(i[0],i[1]));this.geometry.push(n);}return this.geometry},X.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<e.length;o++)for(var s=e,a=0;a<s.length;a++){var u=s;t=Math.min(t,u.x),r=Math.max(r,u.x),i=Math.min(i,u.y),n=Math.max(n,u.y);}return},X.prototype.toGeoJSON=Z.prototype.toGeoJSON;var R=$,W=$,q=function(e,t){t=t||{};var r={};for(var i in e)r=new j(e.features,t),r.name=i,r.version=t.version,r.extent=t.extent;return $({layers:r})},U=j;function $(e){var t=new F;return function(e,t){for(var r in e.layers)t.writeMessage(3,H,e.layers);}(e,t),t.finish()}function H(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||“”),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:,keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature®,t.writeMessage(2,K,i);var n=i.keys;for(r=0;r);var o=i.values;for(r=0;r);}function K(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,Q,e),t.writeVarintField(3,r.type),t.writeMessage(4,re,r);}function Q(e,t){var r=e.feature,i=e.keys,n=e.values,o=e.keycache,s=e.valuecache;for(var a in r.properties){var u=o;void 0===u&&(i.push(a),u=i.length-1,o=u),t.writeVarint(u);var l=r.properties,h=typeof l;“string”!==h&&“boolean”!==h&&“number”!==h&&(l=JSON.stringify(l));var c=h+“:”+l,f=s;void 0===f&&(n.push(l),f=n.length-1,s=f),t.writeVarint(f);}}function ee(e,t){return(t<<3)+(7&e)}function te(e){return e<<1^e>>31}function re(e,t){for(var r=e.loadGeometry(),i=e.type,n=0,o=0,s=r.length,a=0;a<s;a++){var u=r,l=1;1===i&&(l=u.length),t.writeVarint(ee(1,l));for(var h=3===i?u.length-1:u.length,c=0;c<h;c++){1===c&&1!==i&&t.writeVarint(ee(2,h-1));var f=u.x-n,p=u.y-o;t.writeVarint(te(f)),t.writeVarint(te(p)),n+=f,o+=p;}3===i&&t.writeVarint(ee(7,1));}}function ie(e,t){var r=typeof e;“string”===r?t.writeStringField(1,e):“boolean”===r?t.writeBooleanField(7,e):“number”===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}function ne(e,t,r,i,n,o){if(!(n-i<=r)){var s=i+n>>1;!function e(t,r,i,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,u=i-n+1,l=Math.log(a),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(a-h)/a)*(u-a/2<0?-1:1),f=Math.max(n,Math.floor(i-u*h/a+c)),p=Math.min(o,Math.floor(i+(a-u)*h/a+c));e(t,r,i,f,p,s);}var d=r,g=n,m=o;for(oe(t,r,n,i),r>d&&oe(t,r,n,o);g<m;){for(oe(t,r,g,m),g++,m–;r<d;)g++;for(;r>d;)m–;}r===d?oe(t,r,n,m):oe(t,r,++m,o),m<=i&&(n=m+1),i<=m&&(o=m-1);}}(e,t,s,i,n,o%2),ne(e,t,r,i,s-1,o+1),ne(e,t,r,s+1,n,o+1);}}function oe(e,t,r,i){se(e,r,i),se(t,2*r,2*i),se(t,2*r+1,2*i+1);}function se(e,t,r){var i=e;e=e,e=i;}function ae(e,t,r,i){var n=e-r,o=t-i;return n*n+o*o}R.fromVectorTileJs=W,R.fromGeojsonVt=q,R.GeoJSONWrapper=U;var ue=function(e){return e},le=function(e){return e},he=function(e,t,r,i,n){void 0===t&&(t=ue),void 0===r&&(r=le),void 0===i&&(i=64),void 0===n&&(n=Float64Array),this.nodeSize=i,this.points=e;for(var o=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(e.length),a=this.coords=new n(2*e.length),u=0;u=u,a=t(e),a=r(e);ne(s,a,i,0,s.length-1,0);};he.prototype.range=function(e,t,r,i){return function(e,t,r,i,n,o,s){for(var a,u,l=,h=[];l.length;){var c=l.pop(),f=l.pop(),p=l.pop();if(f-p<=s)for(var d=p;d<=f;d++)a=t,u=t,a>=r&&a<=n&&u>=i&&u<=o&&h.push(e);else{var g=Math.floor((p+f)/2);a=t,u=t,a>=r&&a<=n&&u>=i&&u<=o&&h.push(e);var m=(c+1)%2;(0===c?r<=a:i<=u)&&(l.push(p),l.push(g-1),l.push(m)),(0===c?n>=a:o>=u)&&(l.push(g+1),l.push(f),l.push(m));}}return h}(this.ids,this.coords,e,t,r,i,this.nodeSize)},he.prototype.within=function(e,t,r){return function(e,t,r,i,n,o){for(var s=,a=[],u=n*n;s.length;){var l=s.pop(),h=s.pop(),c=s.pop();if(h-c<=o)for(var f=c;f<=h;f++)ae(t,t,r,i)<=u&&a.push(e);else{var p=Math.floor((c+h)/2),d=t,g=t;ae(d,g,r,i)<=u&&a.push(e);var m=(l+1)%2;(0===l?r-n<=d:i-n<=g)&&(s.push©,s.push(p-1),s.push(m)),(0===l?r+n>=d:i+n>=g)&&(s.push(p+1),s.push(h),s.push(m));}}return a}(this.ids,this.coords,e,t,r,this.nodeSize)};var ce={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(e){return e}},fe=function(e){this.options=we(Object.create(ce),e),this.trees=new Array(this.options.maxZoom+1);};function pe(e,t,r,i,n){return{x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:n}}function de(e,t){var r=e.geometry.coordinates,i=r,n=r;return{x:ve(i),y:ye(n),zoom:1/0,index:t,parentId:-1}}function ge(e){return{type:“Feature”,id:e.id,properties:me(e),geometry:{type:“Point”,coordinates:}};var t,r,i;}function me(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+“k”:t>=1e3?Math.round(t/100)/10+“k”:t;return we(we({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ve(e){return e/360+.5}function ye(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function we(e,t){for(var r in t)e=t;return e}function xe(e){return e.x}function be(e){return e.y}function Se(e,t,r,i,n,o){var s=n-r,a=o-i;if(0!==s||0!==a){var u=((e-r)*s+(t-i)*a)/(s*s+a*a);u>1?(r=n,i=o):u>0&&(r+=s*u,i+=a*u);}return(s=e-r)*s+(a=t-i)*a}function Me(e,t,r,i){var n={id:void 0===e?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if(“Point”===r||“MultiPoint”===r||“LineString”===r)ke(e,t);else if(“Polygon”===r||“MultiLineString”===r)for(var i=0;i);else if(“MultiPolygon”===r)for(i=0;i<t.length;i++)for(var n=0;n.length;n++)ke(e,t[n]);}(n),n}function ke(e,t){for(var r=0;r),e.minY=Math.min(e.minY,t),e.maxX=Math.max(e.maxX,t),e.maxY=Math.max(e.maxY,t);}function Fe(e,t,r,i){if(t.geometry){var n=t.geometry.coordinates,o=t.geometry.type,s=Math.pow(r.tolerance/((1<:r.generateId&&(u=i||0),“Point”===o)Pe(n,a);else if(“MultiPoint”===o)for(var l=0;l,a);else if(“LineString”===o)Ie(n,a,s,!1);else if(“MultiLineString”===o){if(r.lineMetrics){for(l=0;l,a,s,!1),e.push(Me(u,“LineString”,a,t.properties));return}Te(n,a,s,!1);}else if(“Polygon”===o)Te(n,a,s,!0);else{if(“MultiPolygon”!==o){if(“GeometryCollection”===o){for(l=0;l<t.geometry.geometries.length;l++)Fe(e,{id:u,geometry:t.geometry.geometries,properties:t.properties},r,i);return}throw new Error(“Input data is not a valid GeoJSON object.”)}for(l=0;l<n.length;l++){var h=[];Te(n,h,s,!0),a.push(h);}}e.push(Me(u,o,a,t.properties));}}function Pe(e,t){t.push(_e(e)),t.push(De(e)),t.push(0);}function Ie(e,t,r,i){for(var n,o,s=0,a=0;a<e.length;a++){var u=_e(e[0]),l=De(e[1]);t.push(u),t.push(l),t.push(0),a>0&&(s+=i?(n*l-u*o)/2:Math.sqrt(Math.pow(u-n,2)+Math.pow(l-o,2))),n=u,o=l;}var h=t.length-3;t=1,function e(t,r,i,n){for(var o,s=n,a=i-r>>1,u=i-r,l=t,h=t,c=t,f=t,p=r+3;p<i;p+=3){var d=Se(t,t,l,h,c,f);if(d>s)o=p,s=d;else if(d===s){var g=Math.abs(p-a);g<u&&(o=p,u=g);}}s>n&&(o-r>3&&e(t,r,o,n),t=s,i-o>3&&e(t,o,i,n));}(t,0,h,r),t=1,t.size=Math.abs(s),t.start=0,t.end=t.size;}function Te(e,t,r,i){for(var n=0;n<e.length;n++){var o=[];Ie(e,o,r,i),t.push(o);}}function _e(e){return e/360+.5}function De(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Le(e,t,r,i,n,o,s,a){if(i/=t,o>=(r/=t)&&s<i)return e;if(s<r||o>=i)return null;for(var u=[],l=0;l<e.length;l++){var h=e,c=h.geometry,f=h.type,p=0===n?h.minX:h.minY,d=0===n?h.maxX:h.maxY;if(p>=r&&d<i)u.push(h);else if(!(d<r||p>=i)){var g=[];if(“Point”===f||“MultiPoint”===f)Be(c,g,r,i,n);else if(“LineString”===f)Ve(c,g,r,i,n,!1,a.lineMetrics);else if(“MultiLineString”===f)ze(c,g,r,i,n,!1);else if(“Polygon”===f)ze(c,g,r,i,n,!0);else if(“MultiPolygon”===f)for(var m=0;m<c.length;m++){var v=[];ze(c,v,r,i,n,!0),v.length&&g.push(v);}if(g.length){if(a.lineMetrics&&“LineString”===f){for(m=0;m,h.tags));continue}“LineString”!==f&&“MultiLineString”!==f||(1===g.length?(f=“LineString”,g=g):f=“MultiLineString”),“Point”!==f&&“MultiPoint”!==f||(f=3===g.length?“Point”:“MultiPoint”),u.push(Me(h.id,f,g,h.tags));}}}return u.length?u:null}function Be(e,t,r,i,n){for(var o=0;o<e.length;o+=3){var s=e;s>=r&&s<=i&&(t.push(e),t.push(e),t.push(e));}}function Ve(e,t,r,i,n,o,s){for(var a,u,l=Ce(e),h=0===n?Oe:Ne,c=e.start,f=0;f<e.length-3;f+=3){var p=e,d=e,g=e,m=e,v=e,y=0===n?p:d,w=0===n?m:v,x=!1;s&&(a=Math.sqrt(Math.pow(p-m,2)+Math.pow(d-v,2))),y<r?w>r&&(u=h(l,p,d,m,v,r),s&&(l.start=c+a*u)):y>i?w<i&&(u=h(l,p,d,m,v,i),s&&(l.start=c+a*u)):Ee(l,p,d,g),w<r&&y>=r&&(u=h(l,p,d,m,v,r),x=!0),w>i&&y<=i&&(u=h(l,p,d,m,v,i),x=!0),!o&&x&&(s&&(l.end=c+a*u),t.push(l),l=Ce(e)),s&&(c+=a);}var b=e.length-3;p=e,d=e,g=e,(y=0===n?p:d)>=r&&y<=i&&Ee(l,p,d,g),b=l.length-3,o&&b>=3&&(l!==l||l!==l)&&Ee(l,l,l,l),l.length&&t.push(l);}function Ce(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ze(e,t,r,i,n,o){for(var s=0;s,t,r,i,n,o,!1);}function Ee(e,t,r,i){e.push(t),e.push®,e.push(i);}function Oe(e,t,r,i,n,o){var s=(o-t)/(i-t);return e.push(o),e.push(r+(n-r)*s),e.push(1),s}function Ne(e,t,r,i,n,o){var s=(o-r)/(n-r);return e.push(t+(i-t)*s),e.push(o),e.push(1),s}function Ae(e,t){for(var r=[],i=0;i<e.length;i++){var n,o=e,s=o.type;if(“Point”===s||“MultiPoint”===s||“LineString”===s)n=Je(o.geometry,t);else if(“MultiLineString”===s||“Polygon”===s){n=[];for(var a=0;a,t));}else if(“MultiPolygon”===s)for(n=[],a=0;a<o.geometry.length;a++){for(var u=[],l=0;l.length;l++)u.push(Je(o.geometry[l],t));n.push(u);}r.push(Me(o.id,s,n,o.tags));}return r}function Je(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i+t,e,e);return r}function Ge(e,t){if(e.transformed)return e;var r,i,n,o=1<<e.z,s=e.x,a=e.y;for(r=0;r<e.features.length;r++){var u=e.features,l=u.geometry,h=u.type;if(u.geometry=[],1===h)for(i=0;i,l,t,o,s,a));else for(i=0;i<l.length;i++){var c=[];for(n=0;n.length;n+=2)c.push(Ze(l[n],l[n+1],t,o,s,a));u.geometry.push©;}}return e.transformed=!0,e}function Ze(e,t,r,i,n,o){return}function je(e,t,r,i,n){for(var o=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a,o,n);var u=e.minX,l=e.minY,h=e.maxX,c=e.maxY;u<s.minX&&(s.minX=u),l<s.minY&&(s.minY=l),h>s.maxX&&(s.maxX=h),c>s.maxY&&(s.maxY=c);}return s}function Ye(e,t,r,i){var n=t.geometry,o=t.type,s=[];if(“Point”===o||“MultiPoint”===o)for(var a=0;a),s.push(n),e.numPoints++,e.numSimplified++;else if(“LineString”===o)Xe(s,n,e,r,!1,!1);else if(“MultiLineString”===o||“Polygon”===o)for(a=0;a,e,r,“Polygon”===o,0===a);else if(“MultiPolygon”===o)for(var u=0;u<n.length;u++){var l=n;for(a=0;a,e,r,!0,0===a);}if(s.length){var h=t.tags||null;if(“LineString”===o&&i.lineMetrics){for(var c in h={},t.tags)h=t.tags;h.mapbox_clip_start=n.start/n.size,h.mapbox_clip_end=n.end/n.size;}var f={geometry:s,type:“Polygon”===o||“MultiPolygon”===o?3:“LineString”===o||“MultiLineString”===o?2:1,tags:h};null!==t.id&&(f.id=t.id),e.features.push(f);}}function Xe(e,t,r,i,n,o){var s=i*i;if(i>0&&t.size<(n?s:i))r.numPoints+=t.length/3;else{for(var a=[],u=0;u>s)&&(r.numSimplified++,a.push(t),a.push(t)),r.numPoints++;n&&function(e,t){for(var r=0,i=0,n=e.length,o=n-2;i-e)*(e+e);if(r>0===t)for(i=0,n=e.length;i<n/2;i+=2){var s=e,a=e;e=e,e=e,e=s,e=a;}}(a,o),e.push(a);}}function Re(e,t){var r=(t=this.options=function(e,t){for(var r in t)e=t;return e}(Object.create(this.options),t)).debug;if(r&&console.time(“preprocess data”),t.maxZoom<0||t.maxZoom>24)throw new Error(“maxZoom should be in the 0-24 range”);if(t.promoteId&&t.generateId)throw new Error(“promoteId and generateId cannot be used together.”);var i=function(e,t){var r=[];if(“FeatureCollection”===e.type)for(var i=0;i,t,i);else“Feature”===e.type?Fe(r,e,t):Fe(r,{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd(“preprocess data”),console.log(“index: maxZoom: %d, maxPoints: %d”,t.indexMaxZoom,t.indexMaxPoints),console.time(“generate tiles”),this.stats={},this.total=0),(i=function(e,t){var r=t.buffer/t.extent,i=e,n=Le(e,1,-1-r,r,0,-1,2,t),o=Le(e,1,1-r,2+r,0,-1,2,t);return(n||o)&&(i=Le(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=Ae(n,1).concat(i)),o&&(i=i.concat(Ae(o,-1)))),i}(i,t)).length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log(“features: %d, points: %d”,this.tiles.numFeatures,this.tiles.numPoints),console.timeEnd(“generate tiles”),console.log(“tiles generated:”,this.total,JSON.stringify(this.stats)));}function We(e,t,r){return 32*((1<<e)*r+t)+e}function qe(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);var n=new k(i.features),o=R(n);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),t(null,{vectorTile:n,rawData:o.buffer});}fe.prototype.load=function(e){var t=this.options,r=t.log,i=t.minZoom,n=t.maxZoom,o=t.nodeSize;r&&console.time(“total time”);var s=“prepare ”e.length
“ points”;r&&console.time(s),this.points=e;for(var a=[],u=0;u.geometry&&a.push(de(e,u));this.trees=new he(a,xe,be,o,Float32Array),r&&console.timeEnd(s);for(var l=n;l>=i;l–){var h=+Date.now();a=this._cluster(a,l),this.trees=new he(a,xe,be,o,Float32Array),r&&console.log(“z%d: %d clusters in %dms”,l,a.length,+Date.now()-h);}return r&&console.timeEnd(“total time”),this},fe.prototype.getClusters=function(e,t){var r=((e+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e)),n=180===e?180:((e+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e));if(e-e>=360)r=-180,n=180;else if(r>n){var s=this.getClusters(,t),a=this.getClusters(,t);return s.concat(a)}for(var u=this.trees,l=[],h=0,c=u.range(ve®,ye(o),ve(n),ye(i));h<c.length;h+=1){var f=c,p=u.points;l.push(p.numPoints?ge(p):this.points);}return l},fe.prototype.getChildren=function(e){var t=e>>5,r=e%32,i=“No cluster with the specified id.”,n=this.trees;if(!n)throw new Error(i);var o=n.points;if(!o)throw new Error(i);for(var s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=[],u=0,l=n.within(o.x,o.y,s);u<l.length;u+=1){var h=l,c=n.points;c.parentId===e&&a.push(c.numPoints?ge©:this.points);}if(0===a.length)throw new Error(i);return a},fe.prototype.getLeaves=function(e,t,r){t=t||10,r=r||0;var i=[];return this._appendLeaves(i,e,t,r,0),i},fe.prototype.getTile=function(e,t,r){var i=this.trees,n=Math.pow(2,e),o=this.options,s=o.extent,a=o.radius/s,u=(r-a)/n,l=(r+1+a)/n,h={features:[]};return this._addTileFeatures(i.range((t-a)/n,u,(t+1+a)/n,l),i.points,t,r,n,h),0===t&&this._addTileFeatures(i.range(1-a/n,u,1,l),i.points,n,r,n,h),t===n-1&&this._addTileFeatures(i.range(0,u,a/n,l),i.points,-1,r,n,h),h.features.length?h:null},fe.prototype.getClusterExpansionZoom=function(e){for(var t=e%32-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r.properties.cluster_id;}return t},fe.prototype._appendLeaves=function(e,t,r,i,n){for(var o=0,s=this.getChildren(t);o<s.length;o+=1){var a=s,u=a.properties;if(u&&u.cluster?n+u.point_count<=i?n+=u.point_count:n=this._appendLeaves(e,u.cluster_id,r,i,n):n<i?n++:e.push(a),e.length===r)break}return n},fe.prototype._addTileFeatures=function(e,t,r,i,n,o){for(var s=0,a=e;s<a.length;s+=1){var u=t[a],l={type:1,geometry:[],tags:u.numPoints?me(u):this.points.properties},h=u.numPoints?u.id:this.points.id;void 0!==h&&(l.id=h),o.features.push(l);}},fe.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(e,this.options.maxZoom+1))},fe.prototype._cluster=function(e,t){for(var r=[],i=this.options,n=i.radius,o=i.extent,s=i.reduce,a=n/(o*Math.pow(2,t)),u=0;u<e.length;u++){var l=e;if(!(l.zoom<=t)){l.zoom=t;for(var h=this.trees,c=h.within(l.x,l.y,a),f=l.numPoints||1,p=l.x*f,d=l.y*f,g=s&&f>1?this._map(l,!0):null,m=(u<<5)+(t+1),v=0,y=c;v<y.length;v+=1){var w=y,x=h.points;if(!(x.zoom<=t)){x.zoom=t;var b=x.numPoints||1;p+=x.x*b,d+=x.y*b,f+=b,x.parentId=m,s&&(g||(g=this._map(l,!0)),s(g,this._map(x)));}}1===f?r.push(l):(l.parentId=m,r.push(pe(p/f,d/f,m,f,g)));}}return r},fe.prototype._map=function(e,t){if(e.numPoints)return t?we({},e.properties):e.properties;var r=this.points.properties,i=this.options.map®;return t&&i===r?we({},i):i},Re.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Re.prototype.splitTile=function(e,t,r,i,n,o,s){for(var a=,u=this.options,l=u.debug;a.length;){i=a.pop(),r=a.pop(),t=a.pop(),e=a.pop();var h=1<;if(!f&&(l>1&&console.time(“creation”),f=this.tiles=je(e,t,r,i,u),this.tileCoords.push({z:t,x:r,y:i}),l)){l>1&&(console.log(“tile z%d-%d-%d (features: %d, points: %d, simplified: %d)”,t,r,i,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(“creation”));var p=“z”+t;this.stats=(this.stats||0)+1,this.total++;}if(f.source=e,n){if(t===u.maxZoom||t===n)continue;var d=1<<n-t;if(r!==Math.floor(o/d)||i!==Math.floor(s/d))continue}else if(t===u.indexMaxZoom||f.numPoints<=u.indexMaxPoints)continue;if(f.source=null,0!==e.length){l>1&&console.time(“clipping”);var g,m,v,y,w,x,b=.5*u.buffer/u.extent,S=.5-b,M=.5+b,k=1+b;g=m=v=y=null,w=Le(e,h,r-b,r+M,0,f.minX,f.maxX,u),x=Le(e,h,r+S,r+k,0,f.minX,f.maxX,u),e=null,w&&(g=Le(w,h,i-b,i+M,1,f.minY,f.maxY,u),m=Le(w,h,i+S,i+k,1,f.minY,f.maxY,u),w=null),x&&(v=Le(x,h,i-b,i+M,1,f.minY,f.maxY,u),y=Le(x,h,i+S,i+k,1,f.minY,f.maxY,u),x=null),l>1&&console.timeEnd(“clipping”),a.push(g||[],t+1,2*r,2*i),a.push(m||,t+1,2*r,2*i+1),a.push(v||[],t+1,2*r+1,2*i),a.push(y||,t+1,2*r+1,2*i+1);}}},Re.prototype.getTile=function(e,t,r){var i=this.options,n=i.extent,o=i.debug;if(e<0||e>24)return null;var s=1<)return Ge(this.tiles,n);o>1&&console.log(“drilling down to z%d-%d-%d”,e,t,r);for(var u,l=e,h=t,c=r;!u&&l>0;)l–,h=Math.floor(h/2),c=Math.floor(c/2),u=this.tiles;return u&&u.source?(o>1&&console.log(“found parent tile z%d-%d-%d”,l,h,c),o>1&&console.time(“drilling down”),this.splitTile(u.source,l,h,c,e,t,r),o>1&&console.timeEnd(“drilling down”),this.tiles?Ge(this.tiles,n):null):null};var Ue=function(t){function r(e,r,i,n){t.call(this,e,r,i,qe),n&&(this.loadGeoJSON=n);}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&“Idle”!==this._state?this._state=“NeedsLoadData”:(this._state=“Coalescing”,this._loadData());},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(i&&i.request&&i.request.collectResourceTiming)&&new u.Performance(i.request);this.loadGeoJSON(i,(function(o,s){if(o||!s)return r(o);if(“object”!=typeof s)return r(new Error(“Input data given to '”i.source
“' is not a valid GeoJSON object.”));y(s,!0);try{t._geoJSONIndex=i.cluster?new fe(function(t){var r=t.superclusterOptions,i=t.clusterProperties;if(!i||!r)return r;for(var n={},o={},s={accumulated:null,zoom:0},a={properties:null},u=Object.keys(i),l=0,h=u;l<h.length;l+=1){var c=h,f=i,p=f,d=f,g=e.createExpression(d),m=e.createExpression(“string”==typeof p?[p,,[“get”,c]]:p);n=g.value,o=m.value;}return r.map=function(e){a.properties=e;for(var t={},r=0,i=u;r<i.length;r+=1){var o=i;t=n.evaluate(s,a);}return t},r.reduce=function(e,t){a.properties=t;for(var r=0,i=u;r<i.length;r+=1){var n=i;s.accumulated=e,e=o.evaluate(s,a);}},r}(i)).load(s.features):function(e,t){return new Re(e,t)}(s,i.geojsonVtOptions);}catch(o){return r(o)}t.loaded={};var a={};if(n){var u=n.finish();u&&(a.resourceTiming={},a.resourceTiming=JSON.parse(JSON.stringify(u)));}r(null,a);}));}},r.prototype.coalesce=function(){“Coalescing”===this._state?this._state=“Idle”:“NeedsLoadData”===this._state&&(this._state=“Coalescing”,this._loadData());},r.prototype.reloadTile=function(e,r){var i=this.loaded,n=e.uid;return i&&i?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if(“string”!=typeof t.data)return r(new Error(“Input data given to '”t.source
“' is not a valid GeoJSON object.”));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error(“Input data given to '”t.source
“' is not a valid GeoJSON object.”))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t();},r.prototype.getClusterExpansionZoom=function(e,t){t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId));},r.prototype.getClusterChildren=function(e,t){t(null,this._geoJSONIndex.getChildren(e.clusterId));},r.prototype.getClusterLeaves=function(e,t){t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset));},r}©;var $e=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:c,geojson:Ue},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes)throw new Error('Worker source with name “'e
'” already registered.‘);r.workerSourceTypes=t;},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isLoaded())throw new Error(“RTL text plugin already registered.”);e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText;};};return $e.prototype.setReferrer=function(e,t){this.referrer=t;},$e.prototype.setImages=function(e,t,r){this.availableImages=t,r();},$e.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r();},$e.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r();},$e.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r);},$e.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r);},$e.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r);},$e.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r);},$e.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r);},$e.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);},$e.prototype.removeSource=function(e,t,r){if(this.workerSources&&this.workerSources[t.type]&&this.workerSources[t.type]){var i=this.workerSources[t.type];delete this.workerSources[t.type],void 0!==i.removeSource?i.removeSource(t,r):r();}},$e.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r();}catch(e){r(e.toString());}},$e.prototype.loadRTLTextPlugin=function(t,r,i){try{e.plugin.isLoaded()||(this.self.importScripts®,i(e.plugin.isLoaded()?null:new Error(“RTL Text Plugin failed to import scripts from ”+r)));}catch(e){i(e.toString());}},$e.prototype.getAvailableImages=function(e){var t=this.availableImages;return t||(t=[]),t},$e.prototype.getLayerIndex=function(e){var t=this.layerIndexes;return t||(t=this.layerIndexes=new i),t},$e.prototype.getWorkerSource=function(e,t,r){var i=this;if(this.workerSources||(this.workerSources={}),this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t]){var n={send:function(t,r,n){i.actor.send(t,r,n,e);}};this.workerSources[t]=new this.workerSourceTypes(n,this.getLayerIndex(e),this.getAvailableImages(e));}return this.workerSources[t]},$e.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources||(this.demWorkerSources={}),this.demWorkerSources[t]||(this.demWorkerSources[t]=new f),this.demWorkerSources[t]},$e.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit®;},“undefined”!=typeof WorkerGlobalScope&&void 0!==e.window&&e.window instanceof WorkerGlobalScope&&(e.window.worker=new $e(e.window)),$e}));define(,(function(t){“use strict”;var e=t.createCommonjsModule((function(t){function e(t){return!!(“undefined”!=typeof window&&“undefined”!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&“JSON”in window&&“parse”in JSON&&“stringify”in JSON&&function(){if(!(“Worker”in window&&“Blob”in window&&“URL”in window))return!1;var t,e,i=new Blob(,{type:“text/javascript”}),o=URL.createObjectURL(i);try{e=new Worker(o),t=!0;}catch(e){t=!1;}e&&e.terminate();return URL.revokeObjectURL(o),t}()&&“Uint8ClampedArray”in window&&ArrayBuffer.isView&&function(t){void 0===i&&(i=function(t){var i=document.createElement(“canvas”),o=Object.create(e.webGLContextAttributes);return o.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext(“webgl”,o)||i.probablySupportsContext(“experimental-webgl”,o):i.supportsContext?i.supportsContext(“webgl”,o)||i.supportsContext(“experimental-webgl”,o):i.getContext(“webgl”,o)||i.getContext(“experimental-webgl”,o)}(t));return i}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};})),i={create:function(e,i,o){var r=t.window.document.createElement(e);return void 0!==i&&(r.className=i),o&&o.appendChild®,r},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},o=t.window.document.documentElement.style;function r(t){if(!o)return t;for(var e=0;ein o)return t;return t}var a,n=r();i.disableDrag=function(){o&&n&&(a=o,o=“none”);},i.enableDrag=function(){o&&n&&(o=a);};var s=r();i.setTransform=function(t,e){t.style=e;};var l=!1;try{var c=Object.defineProperty({},“passive”,{get:function(){l=!0;}});t.window.addEventListener(“test”,c,c),t.window.removeEventListener(“test”,c,c);}catch(t){l=!1;}i.addEventListener=function(t,e,i,o){void 0===o&&(o={}),“passive”in o&&l?t.addEventListener(e,i,o):t.addEventListener(e,i,o.capture);},i.removeEventListener=function(t,e,i,o){void 0===o&&(o={}),“passive”in o&&l?t.removeEventListener(e,i,o):t.removeEventListener(e,i,o.capture);};var u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener(“click”,u,!0);};function h(t){var e=t.userImage;if(e&&e.render&&e.render())return t.data.replace(new Uint8Array(e.data.buffer)),!0;return!1}i.suppressClick=function(){t.window.addEventListener(“click”,u,!0),t.window.setTimeout((function(){t.window.removeEventListener(“click”,u,!0);}),0);},i.mousePos=function(e,i){var o=e.getBoundingClientRect(),r=t.window.TouchEvent&&i instanceof t.window.TouchEvent?i.touches:i;return new t.Point(r.clientX-o.left-e.clientLeft,r.clientY-o.top-e.clientTop)},i.touchPos=function(e,i){for(var o=e.getBoundingClientRect(),r=[],a=“touchend”===i.type?i.changedTouches:i.touches,n=0;n<a.length;n++)r.push(new t.Point(a.clientX-o.left-e.clientLeft,a.clientY-o.top-e.clientTop));return r},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf(“MAC”)>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var p=function(e){function i(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var o=i,r=o.ids,a=o.callback;this._notify(r,a);}this.requestors=[];}},i.prototype.getImage=function(t){return this.images},i.prototype.addImage=function(t,e){this.images=e;},i.prototype.updateImage=function(t,e){var i=this.images;e.version=i.version+1,this.images=e,this.updatedImages=!0;},i.prototype.removeImage=function(t){var e=this.images;delete this.images,delete this.patterns,e.userImage&&e.userImage.onRemove&&e.userImage.onRemove();},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var o=0,r=t;o<r.length;o+=1){var a=r;this.images||(i=!1);}this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});},i.prototype._notify=function(e,i){for(var o={},r=0,a=e;r<a.length;r+=1){var n=a;this.images||this.fire(new t.Event(“styleimagemissing”,{id:n}));var s=this.images;s?o={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image “'n
'” 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.');}i(null,o);},i.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns,o=this.getImage(e);if(!o)return null;if(i&&i.position.version===o.version)return i.position;if(i)i.position.version=o.version;else{var r={w:o.data.width+2,h:o.data.height+2,x:0,y:0},a=new t.ImagePosition(r,o);this.patterns={bin:r,position:a};}return this._updatePatternAtlas(),this.patterns.position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE);},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns.bin);var o=t.potpack(e),r=o.w,a=o.h,n=this.atlasImage;for(var s in n.resize({width:r||1,height:a||1}),this.patterns){var l=this.patterns.bin,c=l.x+1,u=l.y+1,h=this.images.data,p=h.width,d=h.height;t.RGBAImage.copy(h,n,{x:0,y:0},{x:c,y:u},{width:p,height:d}),t.RGBAImage.copy(h,n,{x:0,y:d-1},{x:c,y:u-1},{width:p,height:1}),t.RGBAImage.copy(h,n,{x:0,y:0},{x:c,y:u+d},{width:p,height:1}),t.RGBAImage.copy(h,n,{x:p-1,y:0},{x:c-1,y:u},{width:1,height:d}),t.RGBAImage.copy(h,n,{x:0,y:0},{x:c+p,y:u},{width:1,height:d});}this.dirty=!0;},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={};},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var o=i;if(!this.callbackDispatchedThisFrame){this.callbackDispatchedThisFrame=!0;var r=this.images;h®&&this.updateImage(o,r);}}},i}(t.Evented);var d=m,_=m,f=1e20;function m(t,e,i,o,r,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=o||.25,this.fontFamily=r||“sans-serif”,this.fontWeight=a||“normal”,this.radius=i||8;var n=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement(“canvas”),this.canvas.width=this.canvas.height=n,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(n*n),this.gridInner=new Float64Array(n*n),this.f=new Float64Array(n),this.d=new Float64Array(n),this.z=new Float64Array(n+1),this.v=new Int16Array(n),this.middle=Math.round(n/2*(navigator.userAgent.indexOf(“Gecko/”)>=0?1.2:1));}function g(t,e,i,o,r,a,n){for(var s=0;s<e;s++){for(var l=0;l=t;for(v(o,r,a,n,i),l=0;l=r;}for(l=0;l<i;l++){for(s=0;s=t;for(v(o,r,a,n,e),s=0;s=Math.sqrt(r);}}function v(t,e,i,o,r){i=0,o=-f,o=+f;for(var a=1,n=0;a<r;a++){for(var s=(t+a*a-(t[i]+i*i))/(2*a-2*i);s<=o;)n–,s=(t+a*a-(t[i]+i*i))/(2*a-2*i);i=a,o=s,o=+f;}for(a=0,n=0;a<r;a++){for(;o<a;)n++;e=(a-i)*(a-i)+t[i];}}m.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),o=0;o<this.size*this.size;o++){var r=e.data/255;this.gridOuter=1===r?0:0===r?f:Math.pow(Math.max(0,.5-r),2),this.gridInner=1===r?f:0===r?0:Math.pow(Math.max(0,r-.5),2);}for(g(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),g(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),o=0;o<this.size*this.size;o++){var a=this.gridOuter-this.gridInner;i=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))));}return i},d.default=_;var y=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={};};y.prototype.setURL=function(t){this.url=t;},y.prototype.getGlyphs=function(e,i){var o=this,r=[];for(var a in e)for(var n=0,s=e;n<s.length;n+=1){var l=s;r.push({stack:a,id:l});}t.asyncAll(r,(function(t,e){var i=t.stack,r=t.id,a=o.entries;a||(a=o.entries={glyphs:{},requests:{}});var n=a.glyphs;if(void 0===n){if(n=o._tinySDF(a,i,r))return a.glyphs=n,void e(null,{stack:i,id:r,glyph:n});var s=Math.floor(r/256);if(256*s>65535)e(new Error(“glyphs > 65535 not supported”));else{var l=a.requests;l||(l=a.requests=[],y.loadGlyphRange(i,s,o.url,o.requestManager,(function(t,e){if(e)for(var i in e)o._doesCharSupportLocalGlyph(+i)||(a.glyphs=e);for(var r=0,n=l;r<n.length;r+=1){(0,n)(t,e);}delete a.requests;}))),l.push((function(t,o){t?e(t):o&&e(null,{stack:i,id:r,glyph:o||null});}));}}else e(null,{stack:i,id:r,glyph:n});}),(function(t,e){if(t)i(t);else if(e){for(var o={},r=0,a=e;r<a.length;r+=1){var n=a,s=n.stack,l=n.id,c=n.glyph;(o||(o={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics};}i(null,o);}}));},y.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar[“CJK Unified Ideographs”](e)||t.isChar[“Hangul Syllables”](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},y.prototype._tinySDF=function(e,i,o){var r=this.localIdeographFontFamily;if(r&&this._doesCharSupportLocalGlyph(o)){var a=e.tinySDF;if(!a){var n=“400”;/bold/i.test(i)?n=“900”:/medium/i.test(i)?n=“500”:/light/i.test(i)&&(n=“200”),a=e.tinySDF=new y.TinySDF(24,3,8,.25,r,n);}return{id:o,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(o))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=function(e,i,o,r,a){var n=256*i,s=n+255,l=r.transformRequest(r.normalizeGlyphsURL(o).replace(“{fontstack}”,e).replace(“{range}”,n+“-”+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,i){if(e)a(e);else if(i){for(var o={},r=0,n=t.parseGlyphPBF(i);r<n.length;r+=1){var s=n;o=s;}a(null,o);}}));},y.TinySDF=d;var x=function(){this.specification=t.styleSpec.light.position;};x.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},x.prototype.interpolate=function(e,i,o){return{x:t.number(e.x,i.x,o),y:t.number(e.y,i.y,o),z:t.number(e.z,i.z,o)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(i),this._transitioning=this._transitionable.untransitioned();}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var o in e){var r=e;t.endsWith(o,“-transition”)?this._transitionable.setTransition(o.slice(0,-“-transition”.length),r):this._transitionable.setValue(o,r);}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t);},i.prototype._validate=function(e,i,o){return(!o||!1!==o.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),E=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={};};E.prototype.getDash=function(t,e){var i=t.join(“,”)+String(e);return this.positions||(this.positions=this.addDash(t,e)),this.positions},E.prototype.addDash=function(e,i){var o=i?7:0,r=2*o+1;if(this.nextRow+r>this.height)return t.warnOnce(“LineAtlas out of space”),null;for(var a=0,n=0;n;for(var s=this.width/a,l=s/2,c=e.length%2==1,u=-o;u<=o;u++)for(var h=this.nextRow+o+u,p=this.width*h,d=c?-e:0,_=e,f=1,m=0;m<this.width;m++){for(;_,