1import{c as Ou,g as Nu}from"./vendor-react-BQgABvsW.js";function Bp(Ca,ll){for(var Mt=0;Mt<ll.length;Mt++){const nn=ll[Mt];if(typeof nn!="string"&&!Array.isArray(nn)){for(const Ae in nn)if(Ae!=="default"&&!(Ae in Ca)){const ys=Object.getOwnPropertyDescriptor(nn,Ae);ys&&Object.defineProperty(Ca,Ae,ys.get?ys:{enumerable:!0,get:()=>nn[Ae]})}}}return Object.freeze(Object.defineProperty(Ca,Symbol.toStringTag,{value:"Module"}))}var tc={exports:{}};/* @preserve 2 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com 3 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade 4 */(function(Ca,ll){(function(Mt,nn){nn(ll)})(Ou,function(Mt){var nn="1.9.4";function Ae(r){var c,_,b,I;for(_=1,b=arguments.length;_<b;_++){I=arguments[_];for(c in I)r[c]=I[c]}return r}var ys=Object.create||function(){function r(){}return function(c){return r.prototype=c,new r}}();function O(r,c){var _=Array.prototype.slice;if(r.bind)return r.bind.apply(r,_.call(arguments,1));var b=_.call(arguments,2);return function(){return r.apply(c,b.length?b.concat(_.call(arguments)):arguments)}}var m=0;function ae(r){return"_leaflet_id"in r||(r._leaflet_id=++m),r._leaflet_id}function An(r,c,_){var b,I,F,J;return J=function(){b=!1,I&&(F.apply(_,I),I=!1)},F=function(){b?I=arguments:(r.apply(_,arguments),setTimeout(J,c),b=!0)},F}function hi(r,c,_){var b=c[1],I=c[0],F=b-I;return r===b&&_?r:((r-I)%F+F)%F+I}function bt(){return!1}function ft(r,c){if(c===!1)return r;var _=Math.pow(10,c===void 0?6:c);return Math.round(r*_)/_}function nr(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Ni(r){return nr(r).split(/\s+/)}function ke(r,c){Object.prototype.hasOwnProperty.call(r,"options")||(r.options=r.options?ys(r.options):{});for(var _ in c)r.options[_]=c[_];return r.options}function rr(r,c,_){var b=[];for(var I in r)b.push(encodeURIComponent(_?I.toUpperCase():I)+"="+encodeURIComponent(r[I]));return(!c||c.indexOf("?")===-1?"?":"&")+b.join("&")}var sr=/\{ *([\w_ -]+) *\}/g;function vs(r,c){return r.replace(sr,function(_,b){var I=c[b];if(I===void 0)throw new Error("No value provided for variable "+_);return typeof I=="function"&&(I=I(c)),I})}var ti=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};function js(r,c){for(var _=0;_<r.length;_++)if(r[_]===c)return _;return-1}var Vi="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function gn(r){return window["webkit"+r]||window["moz"+r]||window["ms"+r]}var rn=0;function qs(r){var c=+new Date,_=Math.max(0,16-(c-rn));return rn=c+_,window.setTimeout(r,_)}var yn=window.requestAnimationFrame||gn("RequestAnimationFrame")||qs,xs=window.cancelAnimationFrame||gn("CancelAnimationFrame")||gn("CancelRequestAnimationFrame")||function(r){window.clearTimeout(r)};function le(r,c,_){if(_&&yn===qs)r.call(c);else return yn.call(window,O(r,c))}function Li(r){r&&xs.call(window,r)}var Si={__proto__:null,extend:Ae,create:ys,bind:O,get lastId(){return m},stamp:ae,throttle:An,wrapNum:hi,falseFn:bt,formatNum:ft,trim:nr,splitWords:Ni,setOptions:ke,getParamString:rr,template:vs,isArray:ti,indexOf:js,emptyImageUrl:Vi,requestFn:yn,cancelFn:xs,requestAnimFrame:le,cancelAnimFrame:Li};function ei(){}ei.extend=function(r){var c=function(){ke(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},_=c.__super__=this.prototype,b=ys(_);b.constructor=c,c.prototype=b;for(var I in this)Object.prototype.hasOwnProperty.call(this,I)&&I!=="prototype"&&I!=="__super__"&&(c[I]=this[I]);return r.statics&&Ae(c,r.statics),r.includes&&(or(r.includes),Ae.apply(null,[b].concat(r.includes))),Ae(b,r),delete b.statics,delete b.includes,b.options&&(b.options=_.options?ys(_.options):{},Ae(b.options,r.options)),b._initHooks=[],b.callInitHooks=function(){if(!this._initHooksCalled){_.callInitHooks&&_.callInitHooks.call(this),this._initHooksCalled=!0;for(var F=0,J=b._initHooks.length;F<J;F++)b._initHooks[F].call(this)}},c},ei.include=function(r){var c=this.prototype.options;return Ae(this.prototype,r),r.options&&(this.prototype.options=c,this.mergeOptions(r.options)),this},ei.mergeOptions=function(r){return Ae(this.prototype.options,r),this},ei.addInitHook=function(r){var c=Array.prototype.slice.call(arguments,1
4),_=typeof r=="function"?r:function(){this[r].apply(this,c)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(_),this};function or(r){if(!(typeof L>"u"||!L||!L.Mixin)){r=ti(r)?r:[r];for(var c=0;c<r.length;c++)r[c]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var fi={on:function(r,c,_){if(typeof r=="object")for(var b in r)this._on(b,r[b],c);else{r=Ni(r);for(var I=0,F=r.length;I<F;I++)this._on(r[I],c,_)}return this},off:function(r,c,_){if(!arguments.length)delete this._events;else if(typeof r=="object")for(var b in r)this._off(b,r[b],c);else{r=Ni(r);for(var I=arguments.length===1,F=0,J=r.length;F<J;F++)I?this._off(r[F]):this._off(r[F],c,_)}return this},_on:function(r,c,_,b){if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}if(this._listens(r,c,_)===!1){_===this&&(_=void 0);var I={fn:c,ctx:_};b&&(I.once=!0),this._events=this._events||{},this._events[r]=this._events[r]||[],this._events[r].push(I)}},_off:function(r,c,_){var b,I,F;if(this._events&&(b=this._events[r],!!b)){if(arguments.length===1){if(this._firingCount)for(I=0,F=b.length;I<F;I++)b[I].fn=bt;delete this._events[r];return}if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}var J=this._listens(r,c,_);if(J!==!1){var lt=b[J];this._firingCount&&(lt.fn=bt,this._events[r]=b=b.slice()),b.splice(J,1)}}},fire:function(r,c,_){if(!this.listens(r,_))return this;var b=Ae({},c,{type:r,target:this,sourceTarget:c&&c.sourceTarget||this});if(this._events){var I=this._events[r];if(I){this._firingCount=this._firingCount+1||1;for(var F=0,J=I.length;F<J;F++){var lt=I[F],pt=lt.fn;lt.once&&this.off(r,pt,lt.ctx),pt.call(lt.ctx||this,b)}this._firingCount--}}return _&&this._propagateEvent(b),this},listens:function(r,c,_,b){typeof r!="string"&&console.warn('"string" type argument expected');var I=c;typeof c!="function"&&(b=!!c,I=void 0,_=void 0);var F=this._events&&this._events[r];if(F&&F.length&&this._listens(r,I,_)!==!1)return!0;if(b){for(var J in this._eventParents)if(this._eventParents[J].listens(r,c,_,b))return!0}return!1},_listens:function(r,c,_){if(!this._events)return!1;var b=this._events[r]||[];if(!c)return!!b.length;_===this&&(_=void 0);for(var I=0,F=b.length;I<F;I++)if(b[I].fn===c&&b[I].ctx===_)return I;return!1},once:function(r,c,_){if(typeof r=="object")for(var b in r)this._on(b,r[b],c,!0);else{r=Ni(r);for(var I=0,F=r.length;I<F;I++)this._on(r[I],c,_,!0)}return this},addEventParent:function(r){return this._eventParents=this._eventParents||{},this._eventParents[ae(r)]=r,this},removeEventParent:function(r){return this._eventParents&&delete this._eventParents[ae(r)],this},_propagateEvent:function(r){for(var c in this._eventParents)this._eventParents[c].fire(r.type,Ae({layer:r.target,propagatedFrom:r.target},r),!0)}};fi.addEventListener=fi.on,fi.removeEventListener=fi.clearAllEventListeners=fi.off,fi.addOneTimeEventListener=fi.once,fi.fireEvent=fi.fire,fi.hasEventListeners=fi.listens;var Zi=ei.extend(fi);function re(r,c,_){this.x=_?Math.round(r):r,this.y=_?Math.round(c):c}var Tr=Math.trunc||function(r){return r>0?Math.floor(r):Math.ceil(r)};re.prototype={clone:function(){return new re(this.x,this.y)},add:function(r){return this.clone()._add(Kt(r))},_add:function(r){return this.x+=r.x,this.y+=r.y,this},subtract:function(r){return this.clone()._subtract(Kt(r))},_subtract:function(r){return this.x-=r.x,this.y-=r.y,this},divideBy:function(r){return this.clone()._divideBy(r)},_divideBy:function(r){return this.x/=r,this.y/=r,this},multiplyBy:function(r){return this.clone()._multiplyBy(r)},_multiplyBy:function(r){return this.x*=r,this.y*=r,this},scaleBy:function(r){return new re(this.x*r.x,this.y*r.y)},unscaleBy:function(r){return new re(this.x/r.x,this.y/r.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Tr(this.x),this.y=Tr(this.y),this},distanceTo:function(r){r=Kt(r);var c=r.x-this.x,_=r.y-this.y;return Math.sqrt(c*c+_*_)},equals:function(r){return r=Kt(r),r.x===this.x&&r.y===this.y},contains:function(r){return r=Kt(r),Math.abs(r.x)<=Math.abs(this.x)&&Math.abs(r.y)<=Math.abs(this.y)},toString:function(){return"Point("+ft(this.x)+", "+ft(this.y)+")"}};function Kt(r,c,_){return r instanceof re?r:ti(r)?new re(r[0],r[1]):r==null?r:typeof r=="object"&&"x"in r&&"y"in r?new re(r.x,r.y):new re(r,c,_)}function Te(r,c){if(r)for(var _=c?[r,c]:r,b=0,I=_.length;b<I;b++)this.extend(_[b])}Te.prototype={extend:function(r){var c,_;if(!r)return this;if(r instanceof re||typeof r[0]=="number"||"x"in r)c=_=Kt(r);else if(r=Ge(r),c=r.min,_=r.max,!c||!_)return this;return!this.min&&!this.max?(this.min=c.clone(),this.max=_.clone()):(this.min.x=Math.min(c.x,this.min.x),this.max.x=Math.max(_.x,this.max.x),this.min.y=Math.min(c.y,this.min.y),this.max.y=Math.max(_.y,this.max.y)),this},getCenter:function(r){return Kt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,r)},getBottomLeft:function(){return Kt(this.min.x,this.max.y)},getTopRight:function(){return Kt(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(r){var c,_;return typeof r[0]=="number"||r instanceof re?r=Kt(r):r=Ge(r),r instanceof Te?(c=r.min,_=r.max):c=_=r,c.x>=this.min.x&&_.x<=this.max.x&&c.y>=this.min.y&&_.y<=this.max.y},intersects:function(r){r=Ge(r);var c=this.min,_=this.max,b=r.min,I=r.max,F=I.x>=c.x&&b.x<=_.x,J=I.y>=c.y&&b.y<=_.y;return F&&J},overlaps:function(r){r=Ge(r);var c=this.min,_=this.max,b=r.min,I=r.max,F=I.x>c.x&&b.x<_.x,J=I.y>c.y&&b.y<_.y;return F&&J},isValid:function(){return!!(this.min&&this.max)},pad:function(r){var c=this.min,_=this.max,b=Math.abs(c.x-_.x)*r,I=Math.abs(c.y-_.y)*r;return Ge(Kt(c.x-b,c.y-I),Kt(_.x+b,_.y+I))},equals:function(r){return r?(r=Ge(r),this.min.equals(r.getTopLeft())&&this.max.equals(r.getBottomRight())):!1}};function Ge(r,c){return!r||r instanceof Te?r:new Te(r,c)}function ci(r,c){if(r)for(var _=c?[r,c]:r,b=0,I=_.length;b<I;b++)this.extend(_[b])}ci.prototype={extend:function(r){var c=this._southWest,_=this._northEast,b,I;if(r instanceof ve)b=r,I=r;else if(r instanceof ci){if(b=r._southWest,I=r._northEast,!b||!I)return this}else return r?this.extend(ge(r)||Fe(r)):this;return!c&&!_?(this._southWest=new ve(b.lat,b.lng),this._northEast=new ve(I.lat,I.lng)):(c.lat=Math.min(b.lat,c.lat),c.lng=Math.min(b.lng,c.lng),_.lat=Math.max(I.lat,_.lat),_.lng=Math.max(I.lng,_.lng)),this}
vendor: 1,069 bytes, line 4
4,pad:function(r){var c=this._southWest,_=this._northEast,b=Math.abs(c.lat-_.lat)*r,I=Math.abs(c.lng-_.lng)*r;return new ci(new ve(c.lat-b,c.lng-I),new ve(_.lat+b,_.lng+I))},getCenter:function(){return new ve((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new ve(this.getNorth(),this.getWest())},getSouthEast:function(){return new ve(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(r){typeof r[0]=="number"||r instanceof ve||"lat"in r?r=ge(r):r=Fe(r);var c=this._southWest,_=this._northEast,b,I;return r instanceof ci?(b=r.getSouthWest(),I=r.getNorthEast()):b=I=r,b.lat>=c.lat&&I.lat<=_.lat&&b.lng>=c.lng&&I.lng<=_.lng},intersects:function(r){r=Fe(r);var c=this._southWest,_=this._northEast,b=r.getSouthWest
4(),I=r.getNorthEast(),F=I.lat>=c.lat&&b.lat<=_.lat,J=I.lng>=c.lng&&b.lng<=_.lng;return F&&J},overlaps:function(r){r=Fe(r);var c=this._southWest,_=this._northEast,b=r.getSouthWest(),I=r.getNorthEast(),F=I.lat>c.lat&&b.lat<_.lat,J=I.lng>c.lng&&b.lng<_.lng;return F&&J},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(r,c){return r?(r=Fe(r),this._southWest.equals(r.getSouthWest(),c)&&this._northEast.equals(r.getNorthEast(),c)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Fe(r,c){return r instanceof ci?r:new ci(r,c)}function ve(r,c,_){if(isNaN(r)||isNaN(c))throw new Error("Invalid LatLng object: ("+r+", "+c+")");this.lat=+r,this.lng=+c,_!==void 0&&(this.alt=+_)}ve.prototype={equals:function(r,c){if(!r)return!1;r=ge(r);var _=Math.max(Math.abs(this.lat-r.lat),Math.abs(this.lng-r.lng));return _<=(c===void 0?1e-9:c)},toString:function(r){return"LatLng("+ft(this.lat,r)+", "+ft(this.lng,r)+")"},distanceTo:function(r){return mi.distance(this,ge(r))},wrap:function(){return mi.wrapLatLng(this)},toBounds:function(r){var c=180*r/40075017,_=c/Math.cos(Math.PI/180*this.lat);return Fe([this.lat-c,this.lng-_],[this.lat+c,this.lng+_])},clone:function(){return new ve(this.lat,this.lng,this.alt)}};function ge(r,c,_){return r instanceof ve?r:ti(r)&&typeof r[0]!="object"?r.length===3?new ve(r[0],r[1],r[2]):r.length===2?new ve(r[0],r[1]):null:r==null?r:typeof r=="object"&&"lat"in r?new ve(r.lat,"lng"in r?r.lng:r.lon,r.alt):c===void 0?null:new ve(r,c,_)}var oi={latLngToPoint:function(r,c){var _=this.projection.project(r),b=this.scale(c);return this.transformation._transform(_,b)},pointToLatLng:function(r,c){var _=this.scale(c),b=this.transformation.untransform(r,_);return this.projection.unproject(b)},project:function(r){return this.projection.project(r)},unproject:function(r){return this.projection.unproject(r)},scale:function(r){return 256*Math.pow(2,r)},zoom:function(r){return Math.log(r/256)/Math.LN2},getProjectedBounds:function(r){if(this.infinite)return null;var c=this.projection.bounds,_=this.scale(r),b=this.transformation.transform(c.min,_),I=this.transformation.transform(c.max,_);return new Te(b,I)},infinite:!1,wrapLatLng:function(r){var c=this.wrapLng?hi(r.lng,this.wrapLng,!0):r.lng,_=this.wrapLat?hi(r.lat,this.wrapLat,!0):r.lat,b=r.alt;return new ve(_,c,b)},wrapLatLngBounds:function(r){var c=r.getCenter(),_=this.wrapLatLng(c),b=c.lat-_.lat,I=c.lng-_.lng;if(b===0&&I===0)return r;
4var F=r.getSouthWest(),J=r.getNorthEast(),lt=new ve(F.lat-b,F.lng-I),pt=new ve(J.lat-b,J.lng-I);return new ci(lt,pt)}},mi=Ae({},oi,{wrapLng:[-180,180],R:6371e3,distance:function(r,c){var _=Math.PI/180,b=r.lat*_,I=c.lat*_,F=Math.sin((c.lat-r.lat)*_/2),J=Math.sin((c.lng-r.lng)*_/2),lt=F*F+Math.cos(b)*Math.cos(I)*J*J,pt=2*Math.atan2(Math.sqrt(lt),Math.sqrt(1-lt));return this.R*pt}}),Pr=6378137,ar={R:Pr,MAX_LATITUDE:85.0511287798,project:function(r){var c=Math.PI/180,_=this.MAX_LATITUDE,b=Math.max(Math.min(_,r.lat),-_),I=Math.sin(b*c);return new re(this.R*r.lng*c,this.R*Math.log((1+I)/(1-I))/2)},unproject:function(r){var c=180/Math.PI;return new ve((2*Math.atan(Math.exp(r.y/this.R))-Math.PI/2)*c,r.x*c/this.R)},bounds:function(){var r=Pr*Math.PI;return new Te([-r,-r],[r,r])}()};function qr(r,c,_,b){if(ti(r)){this._a=r[0],this._b=r[1],this._c=r[2],this._d=r[3];return}this._a=r,this._b=c,this._c=_,this._d=b}qr.prototype={transform:function(r,c){return this._transform(r.clone(),c)},_transform:function(r,c){return c=c||1,r.x=c*(this._a*r.x+this._b),r.y=c*(this._c*r.y+this._d),r},untransform:function(r,c){return c=c||1,new re((r.x/c-this._b)/this._a,(r.y/c-this._d)/this._c)}};function sn(r,c,_,b){return new qr(r,c,_,b)}var Vn=Ae({},mi,{code:"EPSG:3857",projection:ar,transformation:function(){var r=.5/(Math.PI*ar.R);return sn(r,.5,-r,.5)}()}),Sr=Ae({},Vn,{code:"EPSG:900913"});function $r(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function ut(r,c){var _="",b,I,F,J,lt,pt;for(b=0,F=r.length;b<F;b++){for(lt=r[b],I=0,J=lt.length;I<J;I++)pt=lt[I],_+=(I?"L":"M")+pt.x+" "+pt.y;_+=c?dt.svg?"z":"x":""}return _||"M0 0"}var lr=document.documentElement.style,Ir="ActiveXObject"in window,ze=Ir&&!document.addEventListener,He="msLaunchUri"in navigator&&!("documentMode"in document),Gr=ct("webkit"),hr=ct("android"),Zn=ct("android 2")||ct("android 3"),bs=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),vn=hr&&ct("Google")&&bs<537&&!("AudioNode"in window),Hr=!!window.opera,ws=!He&&ct("chrome"),Pt=ct("gecko")&&!Gr&&!Hr&&!Ir,Un=!ws&&ct("safari"),Ii=ct("phantom"),kn="OTransition"in lr,Mr=navigator.platform.indexOf("Win")===0,St=Ir&&"transition"in lr,se="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Zn,Xt="MozPerspective"in lr,Ui=!window.L_DISABLE_3D&&(St||se||Xt)&&!kn&&!Ii,Di=typeof orientation<"u"||ct("mobile"),ie=Di&&Gr,jn=Di&&se,qn=!window.PointerEvent&&window.MSPointerEvent,cr=!!(window.PointerEvent||qn),zn="ontouchstart"in window||!!window.TouchEvent,H=!window.L_NO_TOUCH&&(zn||cr),E=Di&&Hr,z=Di&&Pt,V=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,q=function(){var r=!1;try{var c=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("testPassiveEventSupport",bt,c),window.removeEventListener("testPassiveEventSupport",bt,c)}catch{}return r}(),tt=function(){return!!document.createElement("canvas").getContext}(),it=!!(document.createElementNS&&$r("svg").createSVGRect),ot=!!it&&function(){var r=document.createElement("div");return r.innerHTML="<svg/>",(r.firstChild&&r.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Y=!it&&function(){try{var r=document.createElement("div");r.innerHTML='<v:shape adj="1"/>';var c=r.firstChild;return c.style.behavior="url(#default#VML)",c&&typeof c.adj=="object"}catch{return!1}}(),_t=navigator.platform.indexOf("Mac")===0,vt=navigator.platform.indexOf("Linux")===0;function ct(r){return navigator.userAgent.toLowerCase().indexOf(r)>=0}var dt={ie:Ir,ielt9:ze,edge:He,webkit:Gr,android:hr,android23:Zn,androidStock:vn,opera:Hr,chrome:ws,gecko:Pt,safari:Un,phantom:Ii,opera12:kn,win:Mr,ie3d:St,webkit3d:se,gecko3d:Xt,any3d:Ui,mobile:Di,mobileWebkit:ie,mobileWebkit3d:jn,msPointer:qn,pointer:cr,touch:H,touchNative:zn,mobileOpera:E,mobileGecko:z,retina:V,passiveEvents:q,canvas:tt,svg:it,vml:Y,inlineSvg:ot,mac:_t,linux:vt},jt=dt.msPointer?"MSPointerDown":"pointerdown",Gt=dt.msPointer?"MSPointerMove":"pointermove",Pe=dt.msPointer?"MSPointerUp":"pointerup",ne=dt.msPointer?"MSPointerCancel":"pointercancel",xe={touchstart:jt,touchmove:Gt,touchend:Pe,touchcancel:ne},me={touchstart:Be,touchmove:ur,touchend:ur,touchcancel:ur},je={},We=!1;function he(r,c,_){return c==="touchstart"&&Bi(),me[c]?(_=me[c].bind(this,_),r.addEventListener(xe[c],_,!1),_):(console.warn("wrong event specified:",c),bt)}function De(r,c,_){if(!xe[c]){console.warn("wrong event specified:",c);return}r.removeEventListener(xe[c],_,!1)}function qe(r){je[r.pointerId]=r}function _i(r){je[r.pointerId]&&(je[r.pointerId]=r)}function gi(r){delete je[r.pointerId]}function Bi(){We||(document.addEventListener(jt,qe,!0),document.addEventListener(Gt,_i,!0),document.addEventListener(Pe,gi,!0),document.addEventListener(ne,gi,!0),We=!0)}function ur(r,c){if(c.pointerType!==(c.MSPOINTER_TYPE_MOUSE||"mouse")){c.touches=[];for(var _ in je)c.touches.push(je[_]);c.changedTouches=[c],r(c)}}function Be(r,c){c.MSPOINTER_TYPE_TOUCH&&c.pointerType===c.MSPOINTER_TYPE_TOUCH&&vi(c),ur(r,c)}function Go(r){var c={},_,b;for(b in r)_=r[b],c[b]=_&&_.bind?_.bind(r):_;return r=c,c.type="dblclick",c.detail=2,c.isTrusted=!1,c._simulated=!0,c}var Ho=200;function on(r,c){r.addEventListener("dblclick",c);var _=0,b;function I(F){if(F.detail!==1){b=F.detail;return}if(!(F.pointerType==="mouse"||F.sourceCapabilities&&!F.sourceCapabilities.firesTouchEvents)){var J=po(F);if(!(J.some(function(pt){return pt instanceof HTMLLabelElement&&pt.attributes.for})&&!J.some(function(pt){return pt instanceof HTMLInputElement||pt instanceof HTMLSelectElement}))){var lt=Date.now();lt-_<=Ho?(b++,b===2&&c(Go(F))):b=1,_=lt}}}return r.addEventListener("click",I),{dblclick:c,simDblclick:I}}function an(r,c){r.removeEventListener("dblclick",c.dblclick),r.removeEventListener("click",c.simDblclick)}var Wo=Se(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Mi=Se(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ji=Mi==="webkitTransition"||Mi==="OTransition"?Mi+"End":"transitionend";function Wr(r){return typeof r=="string"?document.getElementById(r):r}function En(r,c){var _=r.style[c]||r.currentStyle&&r.currentStyle[c];if((!_||_==="auto")&&document.defaultView){var b=document.defaultView.getComputedStyle(r,null);_=b?b[c]:null}return _==="auto"?null:_}function Jt(r,c,_){var b=document.createElement(r);return b.className=c||"",_&&_.appendChild(b),b}function Oe(r){var c=r.parentNode;c&&c.removeChild(r)}function qi(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function Ze(r){var c=r.parentNode;c&&c.lastChild!==r&&c.appendChild(r)}function dr(r){var c=r.parentNode;c&&c.firstChild!==r&&c.insertBefore(r,c.firstChild)}function ln(r,c){if(r.classList!==void 0)return r.classList.contains(c);var _=Xr(r);return _.length>
40&&new RegExp("(^|\\s)"+c+"(\\s|$)").test(_)}function ce(r,c){if(r.classList!==void 0)for(var _=Ni(c),b=0,I=_.length;b<I;b++)r.classList.add(_[b]);else if(!ln(r,c)){var F=Xr(r);Xo(r,(F?F+" ":"")+c)}}function Le(r,c){r.classList!==void 0?r.classList.remove(c):Xo(r,nr((" "+Xr(r)+" ").replace(" "+c+" "," ")))}function Xo(r,c){r.className.baseVal===void 0?r.className=c:r.className.baseVal=c}function Xr(r){return r.correspondingElement&&(r=r.correspondingElement),r.className.baseVal===void 0?r.className:r.className.baseVal}function yi(r,c){"opacity"in r.style?r.style.opacity=c:"filter"in r.style&&Cr(r,c)}function Cr(r,c){var _=!1,b="DXImageTransform.Microsoft.Alpha";try{_=r.filters.item(b)}catch{if(c===1)return}c=Math.round(c*100),_?(_.Enabled=c!==100,_.Opacity=c):r.style.filter+=" progid:"+b+"(opacity="+c+")"}function Se(r){for(var c=document.documentElement.style,_=0;_<r.length;_++)if(r[_]in c)return r[_];return!1}function pr(r,c,_){var b=c||new re(0,0);r.style[Wo]=(dt.ie3d?"translate("+b.x+"px,"+b.y+"px)":"translate3d("+b.x+"px,"+b.y+"px,0)")+(_?" scale("+_+")":"")}function ni(r,c){r._leaflet_pos=c,dt.any3d?pr(r,c):(r.style.left=c.x+"px",r.style.top=c.y+"px")}function xn(r){return r._leaflet_pos||new re(0,0)}var Kr,Ar,Jr;if("onselectstart"in document)Kr=function(){oe(window,"selectstart",vi)},Ar=function(){Re(window,"selectstart",vi)};else{var kr=Se(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Kr=function(){if(kr){var r=document.documentElement.style;Jr=r[kr],r[kr]="none"}},Ar=function(){kr&&(document.documentElement.style[kr]=Jr,Jr=void 0)}}function zr(){oe(window,"dragstart",vi)}function lo(){Re(window,"dragstart",vi)}var ho,co;function Ko(r){for(;r.tabIndex===-1;)r=r.parentNode;r.style&&($n(),ho=r,co=r.style.outlineStyle,r.style.outlineStyle="none",oe(window,"keydown",$n))}function $n(){ho&&(ho.style.outlineStyle=co,ho=void 0,co=void 0,Re(window,"keydown",$n))}function Ts(r){do r=r.parentNode;while((!r.offsetWidth||!r.offsetHeight)&&r!==document.body);return r}function Ci(r){var c=r.getBoundingClientRect();return{x:c.width/r.offsetWidth||1,y:c.height/r.offsetHeight||1,boundingClientRect:c}}var $i={__proto__:null,TRANSFORM:Wo,TRANSITION:Mi,TRANSITION_END:ji,get:Wr,getStyle:En,create:Jt,remove:Oe,empty:qi,toFront:Ze,toBack:dr,hasClass:ln,addClass:ce,removeClass:Le,setClass:Xo,getClass:Xr,setOpacity:yi,testProp:Se,setTransform:pr,setPosition:ni,getPosition:xn,get disableTextSelection(){return Kr},get enableTextSelection(){return Ar},disableImageDrag:zr,enableImageDrag:lo,preventOutline:Ko,restoreOutline:$n,getSizedParentNode:Ts,getScale:Ci};function oe(r,c,_,b){if(c&&typeof c=="object")for(var I in c)Yo(r,I,c[I],_);else{c=Ni(c);for(var F=0,J=c.length;F<J;F++)Yo(r,c[F],_,b)}return this}var hn="_leaflet_events";function Re(r,c,_,b){if(arguments.length===1)Jo(r),delete r[hn];else if(c&&typeof c=="object")for(var I in c)uo(r,I,c[I],_);else if(c=Ni(c),arguments.length===2)Jo(r,function(lt){return js(c,lt)!==-1});else for(var F=0,J=c.length;F<J;F++)uo(r,c[F],_,b);return this}function Jo(r,c){for(var _ in r[hn]){var b=_.split(/\d/)[0];(!c||c(b))&&uo(r,b,null,null,_)}}
4var Er={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Yo(r,c,_,b){var I=c+ae(_)+(b?"_"+ae(b):"");if(r[hn]&&r[hn][I])return this;var F=function(lt){return _.call(b||r,lt||window.event)},J=F;!dt.touchNative&&dt.pointer&&c.indexOf("touch")===0?F=he(r,c,F):dt.touch&&c==="dblclick"?F=on(r,F):"addEventListener"in r?c==="touchstart"||c==="touchmove"||c==="wheel"||c==="mousewheel"?r.addEventListener(Er[c]||c,F,dt.passiveEvents?{passive:!1}:!1):c==="mouseenter"||c==="mouseleave"?(F=function(lt){lt=lt||window.event,bn(r,lt)&&J(lt)},r.addEventListener(Er[c],F,!1)):r.addEventListener(c,J,!1):r.attachEvent("on"+c,F),r[hn]=r[hn]||{},r[hn][I]=F}function uo(r,c,_,b,I){I=I||c+ae(_)+(b?"_"+ae(b):"");var F=r[hn]&&r[hn][I];if(!F)return this;!dt.touchNative&&dt.pointer&&c.indexOf("touch")===0?De(r,c,F):dt.touch&&c==="dblclick"?an(r,F):"removeEventListener"in r?r.removeEventListener(Er[c]||c,F,!1):r.detachEvent("on"+c,F),r[hn][I]=null}function Lr(r){return r.stopPropagation?r.stopPropagation():r.originalEvent?r.originalEvent._stopped=!0:r.cancelBubble=!0,this}function Qo(r){return Yo(r,"wheel",Lr),this}function $s(r){return oe(r,"mousedown touchstart dblclick contextmenu",Lr),r._leaflet_disable_click=!0,this}function vi(r){return r.preventDefault?r.preventDefault():r.returnValue=!1,this}function Ln(r){return vi(r),Lr(r),this}function po(r){if(r.composedPath)return r.composedPath();for(var c=[],_=r.target;_;)c.push(_),_=_.parentNode;return c}function Gs(r,c){if(!c)return new re(r.clientX,r.clientY);var _=Ci(c),b=_.boundingClientRect;return new re((r.clientX-b.left)/_.x-c.clientLeft,(r.clientY-b.top)/_.y-c.clientTop)}var ta=dt.linux&&dt.chrome?window.devicePixelRatio:dt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function fo(r){return dt.edge?r.wheelDeltaY/2:r.deltaY&&r.deltaMode===0?-r.deltaY/ta:r.deltaY&&r.deltaMode===1?-r.deltaY*20:r.deltaY&&r.deltaMode===2?-r.deltaY*60:r.deltaX||r.deltaZ?0:r.wheelDelta?(r.wheelDeltaY||r.wheelDelta)/2:r.detail&&Math.abs(r.detail)<32765?-r.detail*20:r.detail?r.detail/-32765*60:0}function bn(r,c){var _=c.relatedTarget;if(!_)return!0;try{for(;_&&_!==r;)_=_.parentNode}catch{return!1}return _!==r}var hl={__proto__:null,on:oe,off:Re,stopPropagation:Lr,disableScrollPropagation:Qo,disableClickPropagation:$s,preventDefault:vi,stop:Ln,getPropagationPath:po,getMousePosition:Gs,getWheelDelta:fo,isExternalTarget:bn,addListener:oe,removeListener:Re},mo=Zi.extend({run:function(r,c,_,b){this.stop(),this._el=r,this._inProgress=!0,this._duration=_||.25,this._easeOutPower=1/Math.max(b||.5,.2),this._startPos=xn(r),this._offset=c.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=le(this._animate,this),this._step()},_step:function(r){var c=+new Date-this._startTime,_=this._duration*1e3;c<_?this._runFrame(this._easeOut(c/_),r):(this._runFrame(1),this._complete())},_runFrame:function(r,c){var _=this._startPos.add(this._offset.multiplyBy(r));c&&_._round(),ni(this._el,_),this.fire("step")},_complete:function(){Li(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(r){return 1-Math.pow(1-r,this._easeOutPower)}}),_e=Zi.extend({options:{crs:Vn,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(r,c){c=ke(this,c),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(r),this._initLayout(),this._onResize=O(this._onResize,this),this._initEvents(),c.maxBounds&&this.setMaxBounds(c.maxBounds),c.zoom!==void 0&&(this._zoom=this._limitZoom(c.zoom)),c.center&&c.zoom!==void 0&&this.setView(ge(c.center),c.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Mi&&dt.any3d&&!dt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),oe(this._proxy,ji,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
vendor: 14,964 bytes, line 4
4,setView:function(r,c,_){if(c=c===void 0?this._zoom:this._limitZoom(c),r=this._limitCenter(ge(r),c,this.options.maxBounds),_=_||{},this._stop(),this._loaded&&!_.reset&&_!==!0){_.animate!==void 0&&(_.zoom=Ae({animate:_.animate},_.zoom),_.pan=Ae({animate:_.animate,duration:_.duration},_.pan));var b=this._zoom!==c?this._tryAnimatedZoom&&this._tryAnimatedZoom(r,c,_.zoom):this._tryAnimatedPan(r,_.pan);if(b)return clearTimeout(this._sizeTimer),this}return this._resetView(r,c,_.pan&&_.pan.noMoveStart),this},setZoom:function(r,c){return this._loaded?this.setView(this.getCenter(),r,{zoom:c}):(this._zoom=r,this)},zoomIn:function(r,c){return r=r||(dt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+r,c)},zoomOut:function(r,c){return r=r||(dt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-r,c)},setZoomAround:function(r,c,_){var b=this.getZoomScale(c),I=this.getSize().divideBy(2),F=r instanceof re?r:this.latLngToContainerPoint(r),J=F.subtract(I).multiplyBy(1-1/b),lt=this.containerPointToLatLng(I.add(J));return this.setView(lt,c,{zoom:_})},_getBoundsCenterZoom:function(r,c){c=c||{},r=r.getBounds?r.getBounds():Fe(r);var _=Kt(c.paddingTopLeft||c.padding||[0,0]),b=Kt(c.paddingBottomRight||c.padding||[0,0]),I=this.getBoundsZoom(r,!1,_.add(b));if(I=typeof c.maxZoom=="number"?Math.min(c.maxZoom,I):I,I===1/0)return{center:r.getCenter(),zoom:I};var F=b.subtract(_).divideBy(2),J=this.project(r.getSouthWest(),I),lt=this.project(r.getNorthEast(),I),pt=this.unproject(J.add(lt).divideBy(2).add(F),I);return{center:pt,zoom:I}},fitBounds:function(r,c){if(r=Fe(r),!r.isValid())throw new Error("Bounds are not valid.");var _=this._getBoundsCenterZoom(r,c);return this.setView(_.center,_.zoom,c)},fitWorld:function(r){return this.fitBounds([[-90,-180],[90,180]],r)},panTo:function(r,c){return this.setView(r,this._zoom,{pan:c})},panBy:function(r,c){if(r=Kt(r).round(),c=c||{},!r.x&&!r.y)return this.fire("moveend");if(c.animate!==!0&&!this.getSize().contains(r))return this._resetView(this.unproject(this.project(this.getCenter()).add(r)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new mo,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),c.noMoveStart||this.fire("movestart"),c.animate!==!1){ce(this._mapPane,"leaflet-pan-anim");var _=this._getMapPanePos().subtract(r).round();this._panAnim.run(this._mapPane,_,c.duration||.25,c.easeLinearity)}else this._rawPanBy(r),this.fire("move").fire("moveend");return this},flyTo:function(r,c,_){if(_=_||{},_.animate===!1||!dt.any3d)return this.setView(r,c,_);this._stop();var b=this.project(this.getCenter()),I=this.project(r),F=this.getSize(),J=this._zoom;r=ge(r),c=c===void 0?J:c;var lt=Math.max(F.x,F.y),pt=lt*this.getZoomScale(J,c),xt=I.distanceTo(b)||1,Bt=1.42,te=Bt*Bt;function ye(si){var fe=si?-1:1,fa=si?pt:lt,fl=pt*pt-lt*lt+fe*te*te*xt*xt,ma=2*fa*te*xt,_a=fl/ma,fs=Math.sqrt(_a*_a+1)-_a,Va=fs<1e-9?-18:Math.log(fs);return Va}function Ai(si){return(Math.exp(si)-Math.exp(-si))/2}function ui(si){return(Math.exp(si)+Math.exp(-si))/2}function Wi(si){return Ai(si)/ui(si)}var di=ye(0);function Ti(si){return lt*(ui(di)/ui(di+Bt*si))}function Ft(si){return lt*(ui(di)*Wi(di+Bt*si)-Ai(di))/te}function Eo(si){return 1-Math.pow(1-si,1.5)}var da=Date.now(),pa=(ye(1)-di)/Bt,Rs=_.duration?1e3*_.duration:1e3*pa*.8;function ps(){var si=(Date.now()-da)/Rs,fe=Eo(si)*pa;si<=1?(this._flyToFrame=le(ps,this),this._move(this.unproject(b.add(I.subtract(b).multiplyBy(Ft(fe)/xt)),J),this.getScaleZoom(lt/Ti(fe),J),{flyTo:!0})):this._move(r,c)._moveEnd(!0)}return this._moveStart(!0,_.noMoveStart),ps.call(this),this},flyToBounds:function(r,c){var _=this._getBoundsCenterZoom(r,c);return this.flyTo(_.center,_.zoom,c)},setMaxBounds:function(r){return r=Fe(r),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),r.isValid()?(this.options.maxBounds=r,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(r){var c=this.options.minZoom;return this.options.minZoom=r,this._loaded&&c!==r&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(r):this},setMaxZoom:function(r){var c=this.options.maxZoom;return this.options.maxZoom=r,this._loaded&&c!==r&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(r):this},panInsideBounds:function(r,c){this._enforcingBounds=!0;var _=this.getCenter(),b=this._limitCenter(_,this._zoom,Fe(r));return _.equals(b)||this.panTo(b,c),this._enforcingBounds=!1,this},panInside:function(r,c){c=c||{};var _=Kt(c.paddingTopLeft||c.padding||[0,0]),b=Kt(c.paddingBottomRight||c.padding||[0,0]),I=this.project(this.getCenter()),F=this.project(r),J=this.getPixelBounds(),lt=Ge([J.min.add(_),J.max.subtract(b)]),pt=lt.getSize();if(!lt.contains(F)){this._enforcingBounds=!0;var xt=F.subtract(lt.getCenter()),Bt=lt.extend(F).getSize().subtract(pt);I.x+=xt.x<0?-Bt.x:Bt.x,I.y+=xt.y<0?-Bt.y:Bt.y,this.panTo(this.unproject(I),c),this._enforcingBounds=!1}return this},invalidateSize:function(r){if(!this._loaded)return this;r=Ae({animate:!1,pan:!0},r===!0?{animate:!0}:r);var c=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var _=this.getSize(),b=c.divideBy(2).round(),I=_.divideBy(2).round(),F=b.subtract(I);return!F.x&&!F.y?this:(r.animate&&r.pan?this.panBy(F):(r.pan&&this._rawPanBy(F),this.fire("move"),r.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(O(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:c,newSize:_}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(r){if(r=this._locateOptions=Ae({timeout:1e4,watch:!1},r),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var c=O(this._handleGeolocationResponse,this),_=O(this._handleGeolocationError,this);return r.watch?this._locationWatchId=navigator.geolocation.watchPosition(c,_,r):navigator.geolocation.getCurrentPosition(c,_,r),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(r){if(this._container._leaflet_id){var c=r.code,_=r.message||(c===1?"permission denied":c===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:c,message:"Geolocation error: "+_+"."})}},_handleGeolocationResponse:function(r){if(this._container._leaflet_id){var c=r.coords.latitude,_=r.coords.longitude,b=new ve(c,_),I=b.toBounds(r.coords.accuracy*2),F=this._locateOptions;if(F.setView){var J=this.getBoundsZoom(I);this.setView(b,F.maxZoom?Math.min(J,F.maxZoom):J)}var lt={latlng:b,bounds:I,timestamp:r.timestamp};for(var pt in r.coords)typeof r.coords[pt]=="number"&&(lt[pt]=r.coords[pt]);this.fire("locationfound",lt)}},addHandler:function(r,c){if(!c)return this;var _=this[r]=new c(this);return this._handlers.push(_),this.options[r]&&_.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Oe(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Li(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var r;for(r in this._layers)this._layers[r].remove();for(r in this._panes)Oe(this._panes[r]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(r,c){var _="leaflet-pane"+(r?" leaflet-"+r.replace("Pane","")+"-pane":""),b=Jt("div",_,c||this._mapPane);return r&&(this._panes[r]=b),b},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var r=this.getPixelBounds(),c=this.unproject(r.getBottomLeft()),_=this.unproject(r.getTopRight());return new ci(c,_)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(r,c,_){r=Fe(r),_=Kt(_||[0,0]);var b=this.getZoom()||0,I=this.getMinZoom(),F=this.getMaxZoom(),J=r.getNorthWest(),lt=r.getSouthEast(),pt=this.getSize().subtract(_),xt=Ge(this.project(lt,b),this.project(J,b)).getSize(),Bt=dt.any3d?this.options.zoomSnap:1,te=pt.x/xt.x,ye=pt.y/xt.y,Ai=c?Math.max(te,ye):Math.min(te,ye);return b=this.getScaleZoom(Ai,b),Bt&&(b=Math.round(b/(Bt/100))*(Bt/100),b=c?Math.ceil(b/Bt)*Bt:Math.floor(b/Bt)*Bt),Math.max(I,Math.min(F,b))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new re(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(r,c){var _=this._getTopLeftPoint(r,c);return new Te(_,_.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(r){return this.options.crs.getProjectedBounds(r===void 0?this.getZoom():r)},getPane:function(r){return typeof r=="string"?this._panes[r]:r},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(r,c){var _=this.options.crs;return c=c===void 0?this._zoom:c,_.scale(r)/_.scale(c)},getScaleZoom:function(r,c){var _=this.options.crs;c=c===void 0?this._zoom:c;var b=_.zoom(r*_.scale(c));return isNaN(b)?1/0:b},project:function(r,c){return c=c===void 0?this._zoom:c,this.options.crs.latLngToPoint(ge(r),c)},unproject:function(r,c){return c=c===void 0?this._zoom:c,this.options.crs.pointToLatLng(Kt(r),c)},layerPointToLatLng:function(r){var c=Kt(r).add(this.getPixelOrigin());return this.unproject(c)},latLngToLayerPoint:function(r){var c=this.project(ge(r))._round();return c._subtract(this.getPixelOrigin())},wrapLatLng:function(r){return this.options.crs.wrapLatLng(ge(r))},wrapLatLngBounds:function(r){return this.options.crs.wrapLatLngBounds(Fe(r))},distance:function(r,c){return this.options.crs.distance(ge(r),ge(c))},containerPointToLayerPoint:function(r){return Kt(r).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(r){return Kt(r).add(this._getMapPanePos())},containerPointToLatLng:function(r){var c=this.containerPointToLayerPoint(Kt(r));return this.layerPointToLatLng(c)},latLngToContainerPoint:function(r){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ge(r)))},mouseEventToContainerPoint:function(r){return Gs(r,this._container)},mouseEventToLayerPoint:function(r){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(r))},mouseEventToLatLng:function(r){return this.layerPointToLatLng(this.mouseEventToLayerPoint(r))},_initContainer:function(r){var c=this._container=Wr(r);if(c){if(c._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");oe(c,"scroll",this._onScroll,this),this._containerId=ae(c)},_initLayout:function(){var r=this._container;this._fadeAnimated=this.options.fadeAnimation&&dt.any3d,ce(r,"leaflet-container"+(dt.touch?" leaflet-touch":"")+(dt.retina?" leaflet-retina":"")+(dt.ielt9?" leaflet-oldie":"")+(dt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var c=En(r,"position");c!=="absolute"&&c!=="relative"&&c!=="fixed"&&c!=="sticky"&&(r.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var r=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ni(this._mapPane,new re(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ce(r.markerPane,"leaflet-zoom-hide"),ce(r.shadowPane,"leaflet-zoom-hide"))},_resetView:function(r,c,_){ni(this._mapPane,new re(0,0));var b=!this._loaded;this._loaded=!0,c=this._limitZoom(c),this.fire("viewprereset");var I=this._zoom!==c;this._moveStart(I,_)._move(r,c)._moveEnd(I),this.fire("viewreset"),b&&this.fire("load")},_moveStart:function(r,c){return r&&this.fire("zoomstart"),c||this.fire("movestart"),this},_move:function(r,c,_,b){c===void 0&&(c=this._zoom);var I=this._zoom!==c;return this._zoom=c,this._lastCenter=r,this._pixelOrigin=this._getNewPixelOrigin(r),b?_&&_.pinch&&this.fire("zoom",_):((I||_&&_.pinch)&&this.fire("zoom",_),this.fire("move",_)),this},_moveEnd:function(r){return r&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Li(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(r){ni(this._mapPane,this._getMapPanePos().subtract(r))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(r){this._targets={},this._targets[ae(this._container)]=this;var c=r?Re:oe;c(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&c(window,"resize",this._onResize,this),dt.any3d&&this.options.transform3DLimit&&(r?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Li(this._resizeRequest),this._resizeRequest=le(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var r=this._getMapPanePos();Math.max(Math.abs(r.x),Math.abs(r.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(r,c){for(var _=[],b,I=c==="mouseout"||c==="mouseover",F=r.target||r.srcElement,J=!1;F;){if(b=this._targets[ae(F)],b&&(c==="click"||c==="preclick")&&this._draggableMoved(b)){J=!0;break}if(b&&b.listens(c,!0)&&(I&&!bn(F,r)||(_.push(b),I))||F===this._container)break;F=F.parentNode}return!_.length&&!J&&!I&&this.listens(c,!0)&&(_=[this]),_},_isClickDisabled:function(r){for(;r&&r!==this._container;){if(r._leaflet_disable_click)return!0;r=r.parentNode}},_handleDOMEvent:function(r){var c=r.target||r.srcElement;if(!(!this._loaded||c._leaflet_disable_events||r.type==="click"&&this._isCl
4ickDisabled(c))){var _=r.type;_==="mousedown"&&Ko(c),this._fireDOMEvent(r,_)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(r,c,_){if(r.type==="click"){var b=Ae({},r);b.type="preclick",this._fireDOMEvent(b,b.type,_)}var I=this._findEventTargets(r,c);if(_){for(var F=[],J=0;J<_.length;J++)_[J].listens(c,!0)&&F.push(_[J]);I=F.concat(I)}if(I.length){c==="contextmenu"&&vi(r);var lt=I[0],pt={originalEvent:r};if(r.type!=="keypress"&&r.type!=="keydown"&&r.type!=="keyup"){var xt=lt.getLatLng&&(!lt._radius||lt._radius<=10);pt.containerPoint=xt?this.latLngToContainerPoint(lt.getLatLng()):this.mouseEventToContainerPoint(r),pt.layerPoint=this.containerPointToLayerPoint(pt.containerPoint),pt.latlng=xt?lt.getLatLng():this.layerPointToLatLng(pt.layerPoint)}for(J=0;J<I.length;J++)if(I[J].fire(c,pt,!0),pt.originalEvent._stopped||I[J].options.bubblingMouseEvents===!1&&js(this._mouseEvents,c)!==-1)return}},_draggableMoved:function(r){return r=r.dragging&&r.dragging.enabled()?r:this,r.dragging&&r.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var r=0,c=this._handlers.length;r<c;r++)this._handlers[r].disable()},whenReady:function(r,c){return this._loaded?r.call(c||this,{target:this}):this.on("load",r,c),this},_getMapPanePos:function(){return xn(this._mapPane)||new re(0,0)},_moved:function(){var r=this._getMapPanePos();return r&&!r.equals([0,0])},_getTopLeftPoint:function(r,c){var _=r&&c!==void 0?this._getNewPixelOrigin(r,c):this.getPixelOrigin();return _.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(r,c){var _=this.getSize()._divideBy(2);return this.project(r,c)._subtract(_)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(r,c,_){var b=this._getNewPixelOrigin(_,c);return this.project(r,c)._subtract(b)},_latLngBoundsToNewLayerBounds:function(r,c,_){var b=this._getNewPixelOrigin(_,c);
vendor: 14,330 bytes, line 4
4return Ge([this.project(r.getSouthWest(),c)._subtract(b),this.project(r.getNorthWest(),c)._subtract(b),this.project(r.getSouthEast(),c)._subtract(b),this.project(r.getNorthEast(),c)._subtract(b)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(r){return this.latLngToLayerPoint(r).subtract(this._getCenterLayerPoint())},_limitCenter:function(r,c,_){if(!_)return r;var b=this.project(r,c),I=this.getSize().divideBy(2),F=new Te(b.subtract(I),b.add(I)),J=this._getBoundsOffset(F,_,c);return Math.abs(J.x)<=1&&Math.abs(J.y)<=1?r:this.unproject(b.add(J),c)},_limitOffset:function(r,c){if(!c)return r;var _=this.getPixelBounds(),b=new Te(_.min.add(r),_.max.add(r));return r.add(this._getBoundsOffset(b,c))},_getBoundsOffset:function(r,c,_){var b=Ge(this.project(c.getNorthEast(),_),this.project(c.getSouthWest(),_)),I=b.min.subtract(r.min),F=b.max.subtract(r.max),J=this._rebound(I.x,-F.x),lt=this._rebound(I.y,-F.y);return new re(J,lt)},_rebound:function(r,c){return r+c>0?Math.round(r-c)/2:Math.max(0,Math.ceil(r))-Math.max(0,Math.floor(c))},_limitZoom:function(r){var c=this.getMinZoom(),_=this.getMaxZoom(),b=dt.any3d?this.options.zoomSnap:1;return b&&(r=Math.round(r/b)*b),Math.max(c,Math.min(_,r))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Le(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(r,c){var _=this._getCenterOffset(r)._trunc();return(c&&c.animate)!==!0&&!this.getSize().contains(_)?!1:(this.panBy(_,c),!0)},_createAnimProxy:function(){var r=this._proxy=Jt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(r),this.on("zoomanim",function(c){var _=Wo,b=this._proxy.style[_];pr(this._proxy,this.project(c.center,c.zoom),this.getZoomScale(c.zoom,1)),b===this._proxy.style[_]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Oe(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var r=this.getCenter(),c=this.getZoom();pr(this._proxy,this.project(r,c),this.getZoomScale(c,1))},_catchTransitionEnd:function(r){this._animatingZoom&&r.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(r,c,_){if(this._animatingZoom)return!0;if(_=_||{},!this._zoomAnimated||_.animate===!1||this._nothingToAnimate()||Math.abs(c-this._zoom)>this.options.zoomAnimationThreshold)return!1;var b=this.getZoomScale(c),I=this._getCenterOffset(r)._divideBy(1-1/b);return _.animate!==!0&&!this.getSize().contains(I)?!1:(le(function(){this._moveStart(!0,_.noMoveStart||!1)._animateZoom(r,c,!0)},this),!0)},_animateZoom:function(r,c,_,b){this._mapPane&&(_&&(this._animatingZoom=!0,this._animateToCenter=r,this._animateToZoom=c,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:r,zoom:c,noUpdate:b}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(O(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Le(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Dr(r,c){return new _e(r,c)}var ue=ei.extend({options:{position:"topright"},initialize:function(r){ke(this,r)},getPosition:function(){return this.options.position},setPosition:function(r){var c=this._map;return c&&c.removeControl(this),this.options.position=r,c&&c.addControl(this),this},getContainer:function(){return this._container},addTo:function(r){this.remove(),this._map=r;var c=this._container=this.onAdd(r),_=this.getPosition(),b=r._controlCorners[_];return ce(c,"leaflet-control"),_.indexOf("bottom")!==-1?b.insertBefore(c,b.firstChild):b.appendChild(c),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Oe(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(r){this._map&&r&&r.screenX>0&&r.screenY>0&&this._map.getContainer().focus()}}),Br=function(r){return new ue(r)};_e.include({addControl:function(r){return r.addTo(this),this},removeControl:function(r){return r.remove(),this},_initControlPos:function(){var r=this._controlCorners={},c="leaflet-",_=this._controlContainer=Jt("div",c+"control-container",this._container);function b(I,F){var J=c+I+" "+c+F;r[I+F]=Jt("div",J,_)}b("top","left"),b("top","right"),b("bottom","left"),b("bottom","right")},_clearControlPos:function(){for(var r in this._controlCorners)Oe(this._controlCorners[r]);Oe(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Aa=ue.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(r,c,_,b){return _<b?-1:b<_?1:0}},initialize:function(r,c,_){ke(this,_),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var b in r)this._addLayer(r[b],b);for(b in c)this._addLayer(c[b],b,!0)},onAdd:function(r){this._initLayout(),this._update(),this._map=r,r.on("zoomend",this._checkDisabledLayers,this);for(var c=0;c<this._layers.length;c++)this._layers[c].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(r){return ue.prototype.addTo.call(this,r),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var r=0;r<this._layers.length;r++)this._layers[r].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(r,c){return this._addLayer(r,c),this._map?this._update():this},addOverlay:function(r,c){return this._addLayer(r,c,!0),this._map?this._update():this},removeLayer:function(r){r.off("add remove",this._onLayerChange,this);var c=this._getLayer(ae(r));return c&&this._layers.splice(this._layers.indexOf(c),1),this._map?this._update():this},expand:function(){ce(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var r=this._map.getSize().y-(this._container.offsetTop+50);return r<this._section.clientHeight?(ce(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=r+"px"):Le(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Le(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var r="leaflet-control-layers",c=this._container=Jt("div",r),_=this.options.collapsed;c.setAttribute("aria-haspopup",!0),$s(c),Qo(c);var b=this._section=Jt("section",r+"-list");_&&(this._map.on("click",this.collapse,this),oe(c,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var I=this._layersLink=Jt("a",r+"-toggle",c);I.href="#",I.title="Layers",I.setAttribute("role","button"),oe(I,{keydown:function(F){F.keyCode===13&&this._expandSafely()},click:function(F){vi(F),this._expandSafely()}},this),_||this.expand(),this._baseLayersList=Jt("div",r+"-base",b),this._separator=Jt("div",r+"-separator",b),this._overlaysList=Jt("div",r+"-overlays",b),c.appendChild(b)},_getLayer:function(r){for(var c=0;c<this._layers.length;c++)if(this._layers[c]&&ae(this._layers[c].layer)===r)return this._layers[c]},_addLayer:function(r,c,_){this._map&&r.on("add remove",this._onLayerChange,this),this._layers.push({layer:r,name:c,overlay:_}),this.options.sortLayers&&this._layers.sort(O(function(b,I){return this.options.sortFunction(b.layer,I.layer,b.name,I.name)},this)),this.options.autoZIndex&&r.setZIndex&&(this._lastZIndex++,r.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;qi(this._baseLayersList),qi(this._overlaysList),this._layerControlInputs=[];var r,c,_,b,I=0;for(_=0;_<this._layers.length;_++)b=this._layers[_],this._addItem(b),c=c||b.overlay,r=r||!b.overlay,I+=b.overlay?0:1;return this.options.hideSingleBase&&(r=r&&I>1,this._baseLayersList.style.display=r?"":"none"),this._separator.style.display=c&&r?"":"none",this},_onLayerChange:function(r){this._handlingClick||this._update();var c=this._getLayer(ae(r.target)),_=c.overlay?r.type==="add"?"overlayadd":"overlayremove":r.type==="add"?"baselayerchange":null;_&&this._map.fire(_,c)},_createRadioElement:function(r,c){var _='<input type="radio" class="leaflet-control-layers-selector" name="'+r+'"'+(c?' checked="checked"':"")+"/>",b=document.createElement("div");return b.innerHTML=_,b.firstChild},_addItem:function(r){var c=document.createElement("label"),_=this._map.hasLayer(r.layer),b;r.overlay?(b=document.createElement("input"),b.type="checkbox",b.className="leaflet-control-layers-selector",b.defaultChecked=_):b=this._createRadioElement("leaflet-base-layers_"+ae(this),_),this._layerControlInputs.push(b),b.layerId=ae(r.layer),oe(b,"click",this._onInputClick,this);var I=document.createElement("span");I.innerHTML=" "+r.name;var F=document.createElement("span");c.appendChild(F),F.appendChild(b),F.appendChild(I);var J=r.overlay?this._overlaysList:this._baseLayersList;return J.appendChild(c),this._checkDisabledLayers(),c},_onInputClick:function(){if(!this._preventClick){var r=this._layerControlInputs,c,_,b=[],I=[];this._handlingClick=!0;for(var F=r.length-1;F>=0;F--)c=r[F],_=this._getLayer(c.layerId).layer,c.checked?b.push(_):c.checked||I.push(_);for(F=0;F<I.length;F++)this._map.hasLayer(I[F])&&this._map.removeLayer(I[F]);for(F=0;F<b.length;F++)this._map.hasLayer(b[F])||this._map.addLayer(b[F]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var r=this._layerControlInputs,c,_,b=this._map.getZoom(),I=r.length-1;I>=0;I--)c=r[I],_=this._getLayer(c.layerId).layer,c.disabled=_.options.minZoom!==void 0&&b<_.options.minZoom||_.options.maxZoom!==void 0&&b>_.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var r=this._section;this._preventClick=!0,oe(r,"click",vi),this.expand();var c=this;setTimeout(function(){Re(r,"click",vi),c._preventClick=!1})}}),Ps=function(r,c,_){return new Aa(r,c,_)},ea=ue.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(r){var c="leaflet-control-zoom",_=Jt("div",c+" leaflet-bar"),b=this.options;return this._zoomInButton=this._createButton(b.zoomInText,b.zoomInTitle,c+"-in",_,this._zoomIn),this._zoomOutButton=this._createButton(b.zoomOutText,b.zoomOutTitle,c+"-out",_,this._zoomOut),this._updateDisabled(),r.on("zoomend zoomlevelschange",this._updateDisabled,this),_},onRemove:function(r){r.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(r){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(r.shiftKey?3:1))},_zoomOut:function(r){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(r.shiftKey?3:1))},_createButton:function(r,c,_,b,I){var F=Jt("a",_,b);return F.innerHTML=r,F.href="#",F.title=c,F.setAttribute("role","button"),F.setAttribute("aria-label",c),$s(F),oe(F,"click",Ln),oe(F,"click",I,this),oe(F,"click",this._refocusOnMap,this),F},_updateDisabled:function(){var r=this._map,c="leaflet-disabled";Le(this._zoomInButton,c),Le(this._zoomOutButton,c),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||r._zoom===r.getMinZoom())&&(ce(this._zoomOutButton,c),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||r._zoom===r.getMaxZoom())&&(ce(this._zoomInButton,c),this._zoomInButton.setAttribute("aria-disabled","true"))}});_e.mergeOptions({zoomControl:!0}),_e.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ea,this.addControl(this.zoomControl))});var ka=function(r){return new ea(r)},za=ue.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(r){var c="leaflet-control-scale",_=Jt("div",c),b=this.options;return this._addScales(b,c+"-line",_),r.on(b.updateWhenIdle?"moveend":"move",this._update,this),r.whenReady(this._update,this),_},onRemove:function(r){r.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(r,c,_){r.metric&&(this._mScale=Jt("div",c,_)),r.imperial&&(this._iScale=Jt("div",c,_))},_update:function(){var r=this._map,c=r.getSize().y/2,_=r.distance(r.containerPointToLatLng([0,c]),r.containerPointToLatLng([this.options.maxWidth,c]));this._updateScales(_)},_updateScales:function(r){this.options.metric&&r&&this._updateMetric(r),this.options.imperial&&r&&this._updateImperial(r)},_updateMetric:function(r){var c=this._getRoundNum(r),_=c<1e3?c+" m":c/1e3+" km";this._updateScale(this._mScale,_,c/r)},_updateImperial:function(r){var c=r*3.2808399,_,b,I;c>5280?(_=c/5280,b=this._getRoundNum(_),this._updateScale(this._iScale,b+" mi",b/_)):(I=this._getRoundNum(c),this._updateScale(this._iScale,I+" ft",I/c))},_updateScale:function(r,c,_){r.style.width=Math.round(this.options.maxWidth*_)+"px",r.innerHTML=c},_getRoundNum:function(r){var c=Math.pow(10,(Math.floor(r)+"").length-1),_=r/c;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:1,c*_}}),Ea=function(r){return new za(r)},ia='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',_o=ue.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(dt.inlineSvg?ia+" ":"")+"Leaflet</a>"},initialize:function(r){ke(this,r),this._attributions={}}
4,onAdd:function(r){r.attributionControl=this,this._container=Jt("div","leaflet-control-attribution"),$s(this._container);for(var c in r._layers)r._layers[c].getAttribution&&this.addAttribution(r._layers[c].getAttribution());return this._update(),r.on("layeradd",this._addAttribution,this),this._container},onRemove:function(r){r.off("layeradd",this._addAttribution,this)},_addAttribution:function(r){r.layer.getAttribution&&(this.addAttribution(r.layer.getAttribution()),r.layer.once("remove",function(){this.removeAttribution(r.layer.getAttribution())},this))},setPrefix:function(r){return this.options.prefix=r,this._update(),this},addAttribution:function(r){return r?(this._attributions[r]||(this._attributions[r]=0),this._attributions[r]++,this._update(),this):this},removeAttribution:function(r){return r?(this._attributions[r]&&(this._attributions[r]--,this._update()),this):this},_update:function(){if(this._map){var r=[];for(var c in this._attributions)this._attributions[c]&&r.push(c);var _=[];this.options.prefix&&_.push(this.options.prefix),r.length&&_.push(r.join(", ")),this._container.innerHTML=_.join(' <span aria-hidden="true">|</span> ')}}});_e.mergeOptions({attributionControl:!0}),_e.addInitHook(function(){this.options.attributionControl&&new _o().addTo(this)});var La=function(r){return new _o(r)};ue.Layers=Aa,ue.Zoom=ea,ue.Scale=za,ue.Attribution=_o,Br.layers=Ps,Br.zoom=ka,Br.scale=Ea,Br.attribution=La;var Dn=ei.extend({initialize:function(r){this._map=r},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Dn.addTo=function(r,c){return r.addHandler(c,this),this};var Da={Events:fi},Rr=dt.touch?"touchstart mousedown":"mousedown",fr=Zi.extend({options:{clickTolerance:3},initialize:function(r,c,_,b){ke(this,b),this._element=r,this._dragStartTarget=c||r,this._preventOutline=_},enable:function(){this._enabled||(oe(this._dragStartTarget,Rr,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(fr._dragging===this&&this.finishDrag(!0),Re(this._dragStartTarget,Rr,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(r){if(this._enabled&&(this._moved=!1,!ln(this._element,"leaflet-zoom-anim"))){if(r.touches&&r.touches.length!==1){fr._dragging===this&&this.finishDrag();return}if(!(fr._dragging||r.shiftKey||r.which!==1&&r.button!==1&&!r.touches)&&(fr._dragging=this,this._preventOutline&&Ko(this._element),zr(),Kr(),!this._moving)){this.fire("down");var c=r.touches?r.touches[0]:r,_=Ts(this._element);this._startPoint=new re(c.clientX,c.clientY),this._startPos=xn(this._element),this._parentScale=Ci(_);var b=r.type==="mousedown";oe(document,b?"mousemove":"touchmove",this._onMove,this),oe(document,b?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(r){if(this._enabled){if(r.touches&&r.touches.length>1){this._moved=!0;return}var c=r.touches&&r.touches.length===1?r.touches[0]:r,_=new re(c.clientX,c.clientY)._subtract(this._startPoint);!_.x&&!_.y||Math.abs(_.x)+Math.abs(_.y)<this.options.clickTolerance||(_.x/=this._parentScale.x,_.y/=this._parentScale.y,vi(r),this._moved||(this.fire("dragstart"),this._moved=!0,ce(document.body,"leaflet-dragging"),this._lastTarget=r.target||r.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ce(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(_),this._moving=!0,this._lastEvent=r,this._updatePosition())}},_updatePosition:function(){var r={originalEvent:this._lastEvent};this.fire("predrag",r),ni(this._element,this._newPos),this.fire("drag",r)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(r){Le(document.body,"leaflet-dragging"),this._lastTarget&&(Le(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Re(document,"mousemove touchmove",this._onMove,this),Re(document,"mouseup touchend touchcancel",this._onUp,this),lo(),Ar();var c=this._moved&&this._moving;this._moving=!1,fr._dragging=!1,c&&this.fire("dragend",{noInertia:r,distance:this._newPos.distanceTo(this._startPos)})}});function Ba(r,c,_){var b,I=[1,4,2,8],F,J,lt,pt,xt,Bt,te,ye;for(F=0,Bt=r.length;F<Bt;F++)r[F]._code=Ri(r[F],c);for(lt=0;lt<4;lt++){for(te=I[lt],b=[],F=0,Bt=r.length,J=Bt-1;F<Bt;J=F++)pt=r[F],xt=r[J],pt._code&te?xt._code&te||(ye=Qr(xt,pt,te,c,_),ye._code=Ri(ye,c),b.push(ye)):(xt._code&te&&(ye=Qr(xt,pt,te,c,_),ye._code=Ri(ye,c),b.push(ye)),b.push(pt));r=b}return r}function na(r,c){var _,b,I,F,J,lt,pt,xt,Bt;if(!r||r.length===0)throw new Error("latlngs not passed");Gi(r)||(console.warn("latlngs are not flat! Only the first ring will be used"),r=r[0]);var te=ge([0,0]),ye=Fe(r),Ai=ye.getNorthWest().distanceTo(ye.getSouthWest
4())*ye.getNorthEast().distanceTo(ye.getNorthWest());Ai<1700&&(te=Yr(r));var ui=r.length,Wi=[];for(_=0;_<ui;_++){var di=ge(r[_]);Wi.push(c.project(ge([di.lat-te.lat,di.lng-te.lng])))}for(lt=pt=xt=0,_=0,b=ui-1;_<ui;b=_++)I=Wi[_],F=Wi[b],J=I.y*F.x-F.y*I.x,pt+=(I.x+F.x)*J,xt+=(I.y+F.y)*J,lt+=J*3;lt===0?Bt=Wi[0]:Bt=[pt/lt,xt/lt];var Ti=c.unproject(Kt(Bt));return ge([Ti.lat+te.lat,Ti.lng+te.lng])}function Yr(r){for(var c=0,_=0,b=0,I=0;I<r.length;I++){var F=ge(r[I]);c+=F.lat,_+=F.lng,b++}return ge([c/b,_/b])}var cl={__proto__:null,clipPolygon:Ba,polygonCenter:na,centroid:Yr};function Hs(r,c){if(!c||!r.length)return r.slice();var _=c*c;return r=Oa(r,_),r=Fa(r,_),r}function Ra(r,c,_){return Math.sqrt(ts(r,c,_,!0))}function ul(r,c,_){return ts(r,c,_)}function Fa(r,c){var _=r.length,b=typeof Uint8Array<"u"?Uint8Array:Array,I=new b(_);I[0]=I[_-1]=1,go(r,I,c,0,_-1);var F,J=[];for(F=0;F<_;F++)I[F]&&J.push(r[F]);return J}function go(r,c,_,b,I){var F=0,J,lt,pt;for(lt=b+1;lt<=I-1;lt++)pt=ts(r[lt],r[b],r[I],!0),pt>F&&(J=lt,F=pt);F>_&&(c[J]=1,go(r,c,_,b,J),go(r,c,_,J,I))}function Oa(r,c){for(var _=[r[0]],b=1,I=0,F=r.length;b<F;b++)sa(r[b],r[I])>c&&(_.push(r[b]),I=b);return I<F-1&&_.push(r[F-1]),_}var yo;function ra(r,c,_,b,I){var F=b?yo:Ri(r,_),J=Ri(c,_),lt,pt,xt;for(yo=J;;){if(!(F|J))return[r,c];if(F&J)return!1;lt=F||J,pt=Qr(r,c,lt,_,I),xt=Ri(pt,_),lt===F?(r=pt,F=xt):(c=pt,J=xt)}}function Qr(r,c,_,b,I){var F=c.x-r.x,J=c.y-r.y,lt=b.min,pt=b.max,xt,Bt;return _&8?(xt=r.x+F*(pt.y-r.y)/J,Bt=pt.y):_&4?(xt=r.x+F*(lt.y-r.y)/J,Bt=lt.y):_&2?(xt=pt.x,Bt=r.y+J*(pt.x-r.x)/F):_&1&&(xt=lt.x,Bt=r.y+J*(lt.x-r.x)/F),new re(xt,Bt,I)}function Ri(r,c){var _=0;return r.x<c.min.x?_|=1:r.x>c.max.x&&(_|=2),r.y<c.min.y?_|=4:r.y>c.max.y&&(_|=8),_}function sa(r,c){var _=c.x-r.x,b=c.y-r.y;return _*_+b*b}function ts(r,c,_,b){var I=c.x,F=c.y,J=_.x-I,lt=_.y-F,pt=J*J+lt*lt,xt;return pt>0&&(xt=((r.x-I)*J+(r.y-F)*lt)/pt,xt>1?(I=_.x,F=_.y):xt>0&&(I+=J*xt,F+=lt*xt)),J=r.x-I,lt=r.y-F,b?J*J+lt*lt:new re(I,F)}function Gi(r){return!ti(r[0])||typeof r[0][0]!="object"&&typeof r[0][0]<"u"}function Ws(r){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Gi(r)}function vo(r,c){var _,b,I,F,J,lt,pt,xt;if(!r||r.length===0)throw new Error("latlngs not passed");Gi(r)||(console.warn("latlngs are not flat! Only the first ring will be used"),r=r[0]);var Bt=ge([0,0]),te=Fe(r),ye=te.getNorthWest().distanceTo(te.getSouthWest
vendor: 4,087 bytes, line 4
4())*te.getNorthEast().distanceTo(te.getNorthWest());ye<1700&&(Bt=Yr(r));var Ai=r.length,ui=[];for(_=0;_<Ai;_++){var Wi=ge(r[_]);ui.push(c.project(ge([Wi.lat-Bt.lat,Wi.lng-Bt.lng])))}for(_=0,b=0;_<Ai-1;_++)b+=ui[_].distanceTo(ui[_+1])/2;if(b===0)xt=ui[0];else for(_=0,F=0;_<Ai-1;_++)if(J=ui[_],lt=ui[_+1],I=J.distanceTo(lt),F+=I,F>b){pt=(F-b)/I,xt=[lt.x-pt*(lt.x-J.x),lt.y-pt*(lt.y-J.y)];break}var di=c.unproject(Kt(xt));return ge([di.lat+Bt.lat,di.lng+Bt.lng])}var es={__proto__:null,simplify:Hs,pointToSegmentDistance:Ra,closestPointOnSegment:ul,clipSegment:ra,_getEdgeIntersection:Qr,_getBitCode:Ri,_sqClosestPointOnSegment:ts,isFlat:Gi,_flat:Ws,polylineCenter:vo},Xs={project:function(r){return new re(r.lng,r.lat)},unproject:function(r){return new ve(r.y,r.x)},bounds:new Te([-180,-90],[180,90])},oa={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Te([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(r){var c=Math.PI/180,_=this.R,b=r.lat*c,I=this.R_MINOR/_,F=Math.sqrt(1-I*I),J=F*Math.sin(b),lt=Math.tan(Math.PI/4-b/2)/Math.pow((1-J)/(1+J),F/2);return b=-_*Math.log(Math.max(lt,1e-10)),new re(r.lng*c*_,b)},unproject:function(r){for(var c=180/Math.PI,_=this.R,b=this.R_MINOR/_,I=Math.sqrt(1-b*b),F=Math.exp(-r.y/_),J=Math.PI/2-2*Math.atan(F),lt=0,pt=.1,xt;lt<15&&Math.abs(pt)>1e-7;lt++)xt=I*Math.sin(J),xt=Math.pow((1-xt)/(1+xt),I/2),pt=Math.PI/2-2*Math.atan(F*xt)-J,J+=pt;return new ve(J*c,r.x*c/_)}},ri={__proto__:null,LonLat:Xs,Mercator:oa,SphericalMercator:ar},dl=Ae({},mi,{code:"EPSG:3395",projection:oa,transformation:function(){var r=.5/(Math.PI*oa.R);return sn(r,.5,-r,.5)}()}),de=Ae({},mi,{code:"EPSG:4326",projection:Xs,transformation:sn(1/180,1,-1/180,.5)}),xo=Ae({},oi,{projection:Xs,transformation:sn(1,0,-1,0),scale:function(r){return Math.pow(2,r)},zoom:function(r){return Math.log(r)/Math.LN2},distance:function(r,c){var _=c.lng-r.lng,b=c.lat-r.lat;return Math.sqrt(_*_+b*b)},infinite:!0});oi.Earth=mi,oi.EPSG3395=dl,oi.EPSG3857=Vn,oi.EPSG900913=Sr,oi.EPSG4326=de,oi.Simple=xo;var be=Zi.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(r){return r.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(r){return r&&r.removeLayer(this),this},getPane:function(r){return this._map.getPane(r?this.options[r]||r:this.options.pane)},addInteractiveTarget:function(r){return this._map._targets[ae(r)]=this,this},removeInteractiveTarget:function(r){return delete this._map._targets[ae(r)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(r){var c=r.target;if(c.hasLayer(this)){if(this._map=c,this._zoomAnimated=c._zoomAnimated,this.getEvents){var _=this.getEvents();c.on(_,this),this.once("remove",function(){c.off(_,this)},this)}this.onAdd(c),this.fire("add"),c.fire("layeradd",{layer:this})}}});_e.include({addLayer:function(r){if(!r._layerAdd)throw new Error("The provided object is not a Layer.");var c=ae(r);return this._layers[c]?this:(this._layers[c]=r,r._mapToAdd=this,r.beforeAdd&&r.beforeAdd(this),this.whenReady(r._layerAdd,r),this)},removeLayer:function(r){var c=ae(r);return this._layers[c]?(this._loaded&&r.onRemove(this),delete this._layers[c],this._loaded&&(this.fire("layerremove",{layer:r}),r.fire("remove")),r._map=r._mapToAdd=null,this):this},hasLayer:function(r){return ae(r)in this._layers},eachLayer:function(r,c){for(var _ in this._layers)r.call(c,this._layers[_]);return this},_addLayers:function(r){r=r?ti(r)?r:[r]:[];for(var c=0,_=r.length;c<_;c++)this.addLayer(r[c])},_addZoomLimit:function(r){(!isNaN(r.options.maxZoom)||!isNaN(r.options.minZoom))&&(this._zoomBoundLayers[ae(r)]=r,this._updateZoomLevels())},_removeZoomLimit:function(r){var c=ae(r);this._zoomBoundLayers[c]&&(delete this._zoomBoundLayers[c],this._updateZoomLevels())},_updateZoomLevels:function(){var r=1/0,c=-1/0,_=this._getZoomSpan();for(var b in this._zoomBoundLayers){var I=this._zoomBoundLayers[b].options;r=I.minZoom===void 0?r:Math.min(r,I.minZoom),c=I.maxZoom===void 0?c:Math.max(c,I.maxZoom)}
vendor: 14,169 bytes, line 4
4this._layersMaxZoom=c===-1/0?void 0:c,this._layersMinZoom=r===1/0?void 0:r,_!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ce=be.extend({initialize:function(r,c){ke(this,c),this._layers={};var _,b;if(r)for(_=0,b=r.length;_<b;_++)this.addLayer(r[_])},addLayer:function(r){var c=this.getLayerId(r);return this._layers[c]=r,this._map&&this._map.addLayer(r),this},removeLayer:function(r){var c=r in this._layers?r:this.getLayerId(r);return this._map&&this._layers[c]&&this._map.removeLayer(this._layers[c]),delete this._layers[c],this},hasLayer:function(r){var c=typeof r=="number"?r:this.getLayerId(r);return c in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(r){var c=Array.prototype.slice.call(arguments,1),_,b;for(_ in this._layers)b=this._layers[_],b[r]&&b[r].apply(b,c);return this},onAdd:function(r){this.eachLayer(r.addLayer,r)},onRemove:function(r){this.eachLayer(r.removeLayer,r)},eachLayer:function(r,c){for(var _ in this._layers)r.call(c,this._layers[_]);return this},getLayer:function(r){return this._layers[r]},getLayers:function(){var r=[];return this.eachLayer(r.push,r),r},setZIndex:function(r){return this.invoke("setZIndex",r)},getLayerId:function(r){return ae(r)}}),is=function(r,c){return new Ce(r,c)},cn=Ce.extend({addLayer:function(r){return this.hasLayer(r)?this:(r.addEventParent(this),Ce.prototype.addLayer.call(this,r),this.fire("layeradd",{layer:r}))},removeLayer:function(r){return this.hasLayer(r)?(r in this._layers&&(r=this._layers[r]),r.removeEventParent(this),Ce.prototype.removeLayer.call(this,r),this.fire("layerremove",{layer:r})):this},setStyle:function(r){return this.invoke("setStyle",r)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var r=new ci;for(var c in this._layers){var _=this._layers[c];r.extend(_.getBounds?_.getBounds():_.getLatLng())}return r}}),Ks=function(r,c){return new cn(r,c)},Fr=ei.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(r){ke(this,r)},createIcon:function(r){return this._createIcon("icon",r)},createShadow:function(r){return this._createIcon("shadow",r)},_createIcon:function(r,c){var _=this._getIconUrl(r);if(!_){if(r==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var b=this._createImg(_,c&&c.tagName==="IMG"?c:null);return this._setIconStyles(b,r),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),b},_setIconStyles:function(r,c){var _=this.options,b=_[c+"Size"];typeof b=="number"&&(b=[b,b]);var I=Kt(b),F=Kt(c==="shadow"&&_.shadowAnchor||_.iconAnchor||I&&I.divideBy(2,!0));r.className="leaflet-marker-"+c+" "+(_.className||""),F&&(r.style.marginLeft=-F.x+"px",r.style.marginTop=-F.y+"px"),I&&(r.style.width=I.x+"px",r.style.height=I.y+"px")},_createImg:function(r,c){return c=c||document.createElement("img"),c.src=r,c},_getIconUrl:function(r){return dt.retina&&this.options[r+"RetinaUrl"]||this.options[r+"Url"]}});function ns(r){return new Fr(r)}var Gn=Fr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(r){return typeof Gn.imagePath!="string"&&(Gn.imagePath=this._detectIconPath()),(this.options.imagePath||Gn.imagePath)+Fr.prototype._getIconUrl.call(this,r)},_stripUrl:function(r){var c=function(_,b,I){var F=b.exec(_);return F&&F[I]};return r=c(r,/^url\((['"])?(.+)\1\)$/,2),r&&c(r,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var r=Jt("div","leaflet-default-icon-path",document.body),c=En(r,"background-image")||En(r,"backgroundImage");if(document.body.removeChild(r),c=this._stripUrl(c),c)return c;var _=document.querySelector('link[href$="leaflet.css"]');return _?_.href.substring(0,_.href.length-11-1):""}}),un=Dn.extend({initialize:function(r){this._marker=r},addHooks:function(){var r=this._marker._icon;this._draggable||(this._draggable=new fr(r,r,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ce(r,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Le(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(r){var c=this._marker,_=c._map,b=this._marker.options.autoPanSpeed,I=this._marker.options.autoPanPadding,F=xn(c._icon),J=_.getPixelBounds(),lt=_.getPixelOrigin(),pt=Ge(J.min._subtract(lt).add(I),J.max._subtract(lt).subtract(I));if(!pt.contains(F)){var xt=Kt((Math.max(pt.max.x,F.x)-pt.max.x)/(J.max.x-pt.max.x)-(Math.min(pt.min.x,F.x)-pt.min.x)/(J.min.x-pt.min.x),(Math.max(pt.max.y,F.y)-pt.max.y)/(J.max.y-pt.max.y)-(Math.min(pt.min.y,F.y)-pt.min.y)/(J.min.y-pt.min.y)).multiplyBy(b);_.panBy(xt,{animate:!1}),this._draggable._newPos._add(xt),this._draggable._startPos._add(xt),ni(c._icon,this._draggable._newPos),this._onDrag(r),this._panRequest=le(this._adjustPan.bind(this,r))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(r){this._marker.options.autoPan&&(Li(this._panRequest),this._panRequest=le(this._adjustPan.bind(this,r)))},_onDrag:function(r){var c=this._marker,_=c._shadow,b=xn(c._icon),I=c._map.layerPointToLatLng(b);_&&ni(_,b),c._latlng=I,r.latlng=I,r.oldLatLng=this._oldLatLng,c.fire("move",r).fire("drag",r)},_onDragEnd:function(r){Li(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",r)}}),Ss=be.extend({options:{icon:new Gn,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(r,c){ke(this,c),this._latlng=ge(r)},onAdd:function(r){this._zoomAnimated=this._zoomAnimated&&r.options.markerZoomAnimation,this._zoomAnimated&&r.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(r){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&r.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(r){var c=this._latlng;return this._latlng=ge(r),this.update(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},setZIndexOffset:function(r){return this.options.zIndexOffset=r,this.update()},getIcon:function(){return this.options.icon},setIcon:function(r){return this.options.icon=r,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var r=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(r)}return this},_initIcon:function(){var r=this.options,c="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),_=r.icon.createIcon(this._icon),b=!1;_!==this._icon&&(this._icon&&this._removeIcon(),b=!0,r.title&&(_.title=r.title),_.tagName==="IMG"&&(_.alt=r.alt||"")),ce(_,c),r.keyboard&&(_.tabIndex="0",_.setAttribute("role","button")),this._icon=_,r.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&oe(_,"focus",this._panOnFocus,this);var I=r.icon.createShadow(this._shadow),F=!1;I!==this._shadow&&(this._removeShadow(),F=!0),I&&(ce(I,c),I.alt=""),this._shadow=I,r.opacity<1&&this._updateOpacity(),b&&this.getPane().appendChild(this._icon),this._initInteraction(),I&&F&&this.getPane(r.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Re(this._icon,"focus",this._panOnFocus,this),Oe(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Oe(this._shadow),this._shadow=null},_setPos:function(r){this._icon&&ni(this._icon,r),this._shadow&&ni(this._shadow,r),this._zIndex=r.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(r){this._icon&&(this._icon.style.zIndex=this._zIndex+r)},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center).round();this._setPos(c)},_initInteraction:function(){if(this.options.interactive&&(ce(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),un)){var r=this.options.draggable;this.dragging&&(r=this.dragging.enabled(),this.dragging.disable()),this.dragging=new un(this),r&&this.dragging.enable()}},setOpacity:function(r){return this.options.opacity=r,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var r=this.options.opacity;this._icon&&yi(this._icon,r),this._shadow&&yi(this._shadow,r)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var r=this._map;if(r){var c=this.options.icon.options,_=c.iconSize?Kt(c.iconSize):Kt(0,0),b=c.iconAnchor?Kt(c.iconAnchor):Kt(0,0);r.panInside(this._latlng,{paddingTopLeft:b,paddingBottomRight:_.subtract(b)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function aa(r,c){return new Ss(r,c)}var Hn=be.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(r){this._renderer=r.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(r){return ke(this,r),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&r&&Object.prototype.hasOwnProperty.call(r,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Wn=Hn.extend({options:{fill:!0,radius:10},initialize:function(r,c){ke(this,c),this._latlng=ge(r),this._radius=this.options.radius},setLatLng:function(r){var c=this._latlng;return this._latlng=ge(r),this.redraw(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(r){return this.options.radius=this._radius=r,this.redraw()},getRadius:function(){return this._radius},setStyle:function(r){var c=r&&r.radius||this._radius;return Hn.prototype.setStyle.call(this,r),this.setRadius(c),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var r=this._radius,c=this._radiusY||r,_=this._clickTolerance(),b=[r+_,c+_];this._pxBounds=new Te(this._point.subtract(b),this._point.add(b))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(r){return r.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Js(r,c){return new Wn(r,c)}var rs=Wn.extend({initialize:function(r,c,_){if(typeof c=="number"&&(c=Ae({},_,{radius:c})),ke(this,c),this._latlng=ge(r),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(r){return this._mRadius=r,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var r=[this._radius,this._radiusY||this._radius];return new ci(this._map.layerPointToLatLng(this._point.subtract(r)),this._map.layerPointToLatLng(this._point.add(r)))},setStyle:Hn.prototype.setStyle,_project:function(){var r=this._latlng.lng,c=this._latlng.lat,_=this._map,b=_.options.crs;if(b.distance===mi.distance){var I=Math.PI/180,F=this._mRadius/mi.R/I,J=_.project([c+F,r]),lt=_.project([c-F,r]),pt=J.add(lt).divideBy(2),xt=_.unproject(pt).lat,Bt=Math.acos((Math.cos(F*I)-Math.sin(c*I)*Math.sin(xt*I))/(Math.cos(c*I)*Math.cos(xt*I)))/I;(isNaN(Bt)||Bt===0)&&(Bt=F/Math.cos(Math.PI/180*c)),this._point=pt.subtract(_.getPixelOrigin()),this._radius=isNaN(Bt)?0:pt.x-_.project([xt,r-Bt]).x,this._radiusY=pt.y-J.y}else{var te=b.unproject(b.project(this._latlng).subtract([this._mRadius,0]));this._point=_.latLngToLayerPoint(this._latlng),this._radius=this._point.x-_.latLngToLayerPoint(te).x}this._updateBounds()}});function Is(r,c,_){return new rs(r,c,_)}var dn=Hn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(r,c){ke(this,c),this._setLatLngs(r)},getLatLngs:function(){return this._latlngs},setLatLngs:function(r){return this._setLatLngs(r),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(r){for(var c=1/0,_=null,b=ts,I,F,J=0,lt=this._parts.length;J<lt;J++)for(var pt=this._parts[J],xt=1,Bt=pt.length;xt<Bt;xt++){I=pt[xt-1],F=pt[xt];var te=b(r,I,F,!0);te<c&&(c=te,_=b(r,I,F))}return _&&(_.distance=Math.sqrt(c)),_}
4,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return vo(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(r,c){return c=c||this._defaultShape(),r=ge(r),c.push(r),this._bounds.extend(r),this.redraw()},_setLatLngs:function(r){this._bounds=new ci,this._latlngs=this._convertLatLngs(r)},_defaultShape:function(){return Gi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(r){for(var c=[],_=Gi(r),b=0,I=r.length;b<I;b++)_?(c[b]=ge(r[b]),this._bounds.extend(c[b])):c[b]=this._convertLatLngs(r[b]);return c},_project:function(){var r=new Te;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,r),this._bounds.isValid()&&r.isValid()&&(this._rawPxBounds=r,this._updateBounds())},_updateBounds:function(){var r=this._clickTolerance(),c=new re(r,r);this._rawPxBounds&&(this._pxBounds=new Te([this._rawPxBounds.min.subtract(c),this._rawPxBounds.max.add(c)]))},_projectLatlngs:function(r,c,_){var b=r[0]instanceof ve,I=r.length,F,J;if(b){for(J=[],F=0;F<I;F++)J[F]=this._map.latLngToLayerPoint(r[F]),_.extend(J[F]);c.push(J)}else for(F=0;F<I;F++)this._projectLatlngs(r[F],c,_)},_clipPoints:function(){var r=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(r))){if(this.options.noClip){this._parts=this._rings;return}var c=this._parts,_,b,I,F,J,lt,pt;for(_=0,I=0,F=this._rings.length;_<F;_++)for(pt=this._rings[_],b=0,J=pt.length;b<J-1;b++)lt=ra(pt[b],pt[b+1],r,b,!0),lt&&(c[I]=c[I]||[],c[I].push(lt[0]),(lt[1]!==pt[b+1]||b===J-2)&&(c[I].push(lt[1]),I++))}},_simplifyPoints:function(){for(var r=this._parts,c=this.options.smoothFactor,_=0,b=r.length;_<b;_++)r[_]=Hs(r[_],c)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(r,c){var _,b,I,F,J,lt,pt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(r))return!1;for(_=0,F=this._parts.length;_<F;_++)for(lt=this._parts[_],b=0,J=lt.length,I=J-1;b<J;I=b++)if(!(!c&&b===0)&&Ra(r,lt[I],lt[b])<=pt)return!0;return!1}});function bo(r,c){return new dn(r,c)}dn._flat=Ws;var Bn=dn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
vendor: 18,203 bytes, line 4
4,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return na(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(r){var c=dn.prototype._convertLatLngs.call(this,r),_=c.length;return _>=2&&c[0]instanceof ve&&c[0].equals(c[_-1])&&c.pop(),c},_setLatLngs:function(r){dn.prototype._setLatLngs.call(this,r),Gi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Gi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var r=this._renderer._bounds,c=this.options.weight,_=new re(c,c);if(r=new Te(r.min.subtract(_),r.max.add(_)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(r))){if(this.options.noClip){this._parts=this._rings;return}for(var b=0,I=this._rings.length,F;b<I;b++)F=Ba(this._rings[b],r,!0),F.length&&this._parts.push(F)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(r){var c=!1,_,b,I,F,J,lt,pt,xt;if(!this._pxBounds||!this._pxBounds.contains(r))return!1;for(F=0,pt=this._parts.length;F<pt;F++)for(_=this._parts[F],J=0,xt=_.length,lt=xt-1;J<xt;lt=J++)b=_[J],I=_[lt],b.y>r.y!=I.y>r.y&&r.x<(I.x-b.x)*(r.y-b.y)/(I.y-b.y)+b.x&&(c=!c);return c||dn.prototype._containsPoint.call(this,r,!0)}});function Ms(r,c){return new Bn(r,c)}var Xn=cn.extend({initialize:function(r,c){ke(this,c),this._layers={},r&&this.addData(r)},addData:function(r){var c=ti(r)?r:r.features,_,b,I;if(c){for(_=0,b=c.length;_<b;_++)I=c[_],(I.geometries||I.geometry||I.features||I.coordinates)&&this.addData(I);return this}var F=this.options;if(F.filter&&!F.filter(r))return this;var J=Cs(r,F);return J?(J.feature=os(r),J.defaultOptions=J.options,this.resetStyle(J),F.onEachFeature&&F.onEachFeature(r,J),this.addLayer(J)):this},resetStyle:function(r){return r===void 0?this.eachLayer(this.resetStyle,this):(r.options=Ae({},r.defaultOptions),this._setLayerStyle(r,this.options.style),this)},setStyle:function(r){return this.eachLayer(function(c){this._setLayerStyle(c,r)},this)},_setLayerStyle:function(r,c){r.setStyle&&(typeof c=="function"&&(c=c(r.feature)),r.setStyle(c))}});function Cs(r,c){var _=r.type==="Feature"?r.geometry:r,b=_?_.coordinates:null,I=[],F=c&&c.pointToLayer,J=c&&c.coordsToLatLng||As,lt,pt,xt,Bt;if(!b&&!_)return null;switch(_.type){case"Point":return lt=J(b),Me(F,r,lt,c);case"MultiPoint":for(xt=0,Bt=b.length;xt<Bt;xt++)lt=J(b[xt]),I.push(Me(F,r,lt,c));return new cn(I);case"LineString":case"MultiLineString":return pt=wo(b,_.type==="LineString"?0:1,J),new dn(pt,c);case"Polygon":case"MultiPolygon":return pt=wo(b,_.type==="Polygon"?1:2,J),new Bn(pt,c);case"GeometryCollection":for(xt=0,Bt=_.geometries.length;xt<Bt;xt++){var te=Cs({geometry:_.geometries[xt],type:"Feature",properties:r.properties},c);te&&I.push(te)}return new cn(I);case"FeatureCollection":for(xt=0,Bt=_.features.length;xt<Bt;xt++){var ye=Cs(_.features[xt],c);ye&&I.push(ye)}return new cn(I);default:throw new Error("Invalid GeoJSON object.")}}function Me(r,c,_,b){return r?r(c,_):new Ss(_,b&&b.markersInheritOptions&&b)}function As(r){return new ve(r[1],r[0],r[2])}function wo(r,c,_){for(var b=[],I=0,F=r.length,J;I<F;I++)J=c?wo(r[I],c-1,_):(_||As)(r[I]),b.push(J);return b}function To(r,c){return r=ge(r),r.alt!==void 0?[ft(r.lng,c),ft(r.lat,c),ft(r.alt,c)]:[ft(r.lng,c),ft(r.lat,c)]}function mr(r,c,_,b){for(var I=[],F=0,J=r.length;F<J;F++)I.push(c?mr(r[F],Gi(r[F])?0:c-1,_,b):To(r[F],b));return!c&&_&&I.length>0&&I.push(I[0].slice()),I}function ss(r,c){return r.feature?Ae({},r.feature,{geometry:c}):os(c)}function os(r){return r.type==="Feature"||r.type==="FeatureCollection"?r:{type:"Feature",properties:{},geometry:r}}var Po={toGeoJSON:function(r){return ss(this,{type:"Point",coordinates:To(this.getLatLng(),r)})}};Ss.include(Po),rs.include(Po),Wn.include(Po),dn.include({toGeoJSON:function(r){var c=!Gi(this._latlngs),_=mr(this._latlngs,c?1:0,!1,r);return ss(this,{type:(c?"Multi":"")+"LineString",coordinates:_})}}),Bn.include({toGeoJSON:function(r){var c=!Gi(this._latlngs),_=c&&!Gi(this._latlngs[0]),b=mr(this._latlngs,_?2:c?1:0,!0,r);return c||(b=[b]),ss(this,{type:(_?"Multi":"")+"Polygon",coordinates:b})}}),Ce.include({toMultiPoint:function(r){var c=[];return this.eachLayer(function(_){c.push(_.toGeoJSON(r).geometry.coordinates)}),ss(this,{type:"MultiPoint",coordinates:c})},toGeoJSON:function(r){var c=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(c==="MultiPoint")return this.toMultiPoint(r);var _=c==="GeometryCollection",b=[];return this.eachLayer(function(I){if(I.toGeoJSON){var F=I.toGeoJSON(r);if(_)b.push(F.geometry);else{var J=os(F);J.type==="FeatureCollection"?b.push.apply(b,J.features):b.push(J)}}}),_?ss(this,{geometries:b,type:"GeometryCollection"}):{type:"FeatureCollection",features:b}}});function la(r,c){return new Xn(r,c)}var So=la,as=be.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(r,c,_){this._url=r,this._bounds=Fe(c),ke(this,_)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ce(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Oe(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(r){return this.options.opacity=r,this._image&&this._updateOpacity(),this},setStyle:function(r){return r.opacity&&this.setOpacity(r.opacity),this},bringToFront:function(){return this._map&&Ze(this._image),this},bringToBack:function(){return this._map&&dr(this._image),this},setUrl:function(r){return this._url=r,this._image&&(this._image.src=r),this},setBounds:function(r){return this._bounds=Fe(r),this._map&&this._reset(),this},getEvents:function(){var r={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},setZIndex:function(r){return this.options.zIndex=r,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var r=this._url.tagName==="IMG",c=this._image=r?this._url:Jt("img");if(ce(c,"leaflet-image-layer"),this._zoomAnimated&&ce(c,"leaflet-zoom-animated"),this.options.className&&ce(c,this.options.className),c.onselectstart=bt,c.onmousemove=bt,c.onload=O(this.fire,this,"load"),c.onerror=O(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),r){this._url=c.src;return}c.src=this._url,c.alt=this.options.alt},_animateZoom:function(r){var c=this._map.getZoomScale(r.zoom),_=this._map._latLngBoundsToNewLayerBounds(this._bounds,r.zoom,r.center).min;pr(this._image,_,c)},_reset:function(){var r=this._image,c=new Te(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),_=c.getSize();ni(r,c.min),r.style.width=_.x+"px",r.style.height=_.y+"px"},_updateOpacity:function(){yi(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var r=this.options.errorOverlayUrl;r&&this._url!==r&&(this._url=r,this._image.src=r)},getCenter:function(){return this._bounds.getCenter()}}),ks=function(r,c,_){return new as(r,c,_)},ls=as.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var r=this._url.tagName==="VIDEO",c=this._image=r?this._url:Jt("video");if(ce(c,"leaflet-image-layer"),this._zoomAnimated&&ce(c,"leaflet-zoom-animated"),this.options.className&&ce(c,this.options.className),c.onselectstart=bt,c.onmousemove=bt,c.onloadeddata=O(this.fire,this,"load"),r){for(var _=c.getElementsByTagName("source"),b=[],I=0;I<_.length;I++)b.push(_[I].src);this._url=_.length>0?b:[c.src];return}ti(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(c.style,"objectFit")&&(c.style.objectFit="fill"),c.autoplay=!!this.options.autoplay,c.loop=!!this.options.loop,c.muted=!!this.options.muted,c.playsInline=!!this.options.playsInline;for(var F=0;F<this._url.length;F++){var J=Jt("source");J.src=this._url[F],c.appendChild(J)}}});function zs(r,c,_){return new ls(r,c,_)}var Io=as.extend({_initImage:function(){var r=this._image=this._url;ce(r,"leaflet-image-layer"),this._zoomAnimated&&ce(r,"leaflet-zoom-animated"),this.options.className&&ce(r,this.options.className),r.onselectstart=bt,r.onmousemove=bt}});function Es(r,c,_){return new Io(r,c,_)}var Hi=be.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(r,c){r&&(r instanceof ve||ti(r))?(this._latlng=ge(r),ke(this,c)):(ke(this,r),this._source=c),this.options.content&&(this._content=this.options.content)},openOn:function(r){return r=arguments.length?r:this._source._map,r.hasLayer(this)||r.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(r){return this._map?this.close():(arguments.length?this._source=r:r=this._source,this._prepareOpen(),this.openOn(r._map)),this},onAdd:function(r){this._zoomAnimated=r._zoomAnimated,this._container||this._initLayout(),r._fadeAnimated&&yi(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),r._fadeAnimated&&yi(this._container,1),this.bringToFront(),this.options.interactive&&(ce(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(r){r._fadeAnimated?(yi(this._container,0),this._removeTimeout=setTimeout(O(Oe,void 0,this._container),200)):Oe(this._container),this.options.interactive&&(Le(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(r){return this._latlng=ge(r),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(r){return this._content=r,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var r={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ze(this._container),this},bringToBack:function(){return this._map&&dr(this._container),this},_prepareOpen:function(r){var c=this._source;if(!c._map)return!1;if(c instanceof cn){c=null;var _=this._source._layers;for(var b in _)if(_[b]._map){c=_[b];break}if(!c)return!1;this._source=c}if(!r)if(c.getCenter)r=c.getCenter();else if(c.getLatLng)r=c.getLatLng();else if(c.getBounds)r=c.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(r),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var r=this._contentNode,c=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof c=="string")r.innerHTML=c;else{for(;r.hasChildNodes();)r.removeChild(r.firstChild);r.appendChild(c)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var r=this._map.latLngToLayerPoint(this._latlng),c=Kt(this.options.offset),_=this._getAnchor();this._zoomAnimated?ni(this._container,r.add(_)):c=c.add(r).add(_);var b=this._containerBottom=-c.y,I=this._containerLeft=-Math.round(this._containerWidth/2)+c.x;this._container.style.bottom=b+"px",this._container.style.left=I+"px"}},_getAnchor:function(){return[0,0]}});_e.include({_initOverlay:function(r,c,_,b){var I=c;return I instanceof r||(I=new r(b).setContent(c)),_&&I.setLatLng(_),I}}),be.include({_initOverlay:function(r,c,_,b){var I=_;return I instanceof r?(ke(I,b),I._source=this):(I=c&&!b?c:new r(b,this),I.setContent(_)),I}});var hs=Hi.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(r){return r=arguments.length?r:this._source._map,!r.hasLayer(this)&&r._popup&&r._popup.options.autoClose&&r.removeLayer(r._popup),r._popup=this,Hi.prototype.openOn.call(this,r)},onAdd:function(r){Hi.prototype.onAdd.call(this,r),r.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Hn||this._source.on("preclick",Lr))},onRemove:function(r){Hi.prototype.onRemove.call(this,r),r.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Hn||this._source.off("preclick",Lr))},getEvents:function(){var r=Hi.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(r.preclick=this.close),this.options.keepInView&&(r.moveend=this._adjustPan),r},_initLayout:function(){var r="leaflet-popup",c=this._container=Jt("div",r+" "+(this.options.className||"")+" leaflet-zoom-animated"),_=this._wrapper=Jt("div",r+"-content-wrapper",c);if(this._contentNode=Jt("div",r+"-content",_),$s(c),Qo(this._contentNode),oe(c,"contextmenu",Lr),this._tipContainer=Jt("div",r+"-tip-container",c),this._tip=Jt("div",r+"-tip",this._tipContainer),this.options.closeButton){var b=this._closeButton=Jt("a",r+"-close-button",c);b.setAttribute("role","button"),b.setAttribute("aria-label","Close popup"),b.href="#close",b.innerHTML='<span aria-hidden="true">×</span>',oe(b,"click",function(I){vi(I),this.close()},this)}},_updateLayout:function(){var r=this._contentNode,c=r.style;c.width="",c.whiteSpace="nowrap";var _=r.offsetWidth;_=Math.min(_,this.options.maxWidth),_=Math.max(_,this.options.minWidth),c.width=_+1+"px",c.whiteSpace="",c.height="";var b=r.offsetHeight,I=this.options.maxHeight,F="leaflet-popup-scrolled";I&&b>I?(c.height=I+"px",ce(r,F)):Le(r,F),this._containerWidth=this._container.offsetWidth},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center),_=this._getAnchor();ni(this._container,c.add(_))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var r=this._map,c=parseInt(En(this._container,"marginBottom"),10)||0,_=this._container.offsetHeight+c,b=this._containerWidth,I=new re(this._containerLeft,-_-this._containerBottom);I._add(xn(this._container));var F=r.layerPointToContainerPoint(I),J=Kt(this.options.autoPanPadding),lt=Kt(this.options.autoPanPaddingTopLeft||J),pt=Kt(this.options.autoPanPaddingBottomRight||J),xt=r.getSize(),Bt=0,te=0;F.x+b+pt.x>xt.x&&(Bt=F.x+b-xt.x+pt.x),F.x-Bt-lt.x<0&&(Bt=F.x-lt.x),F.y+_+pt.y>xt.y&&(te=F.y+_-xt.y+pt.y),F.y-te-lt.y<0&&(te=F.y-lt.y),(Bt||te)&&(this.options.keepInView&&(this._autopanning=!0),r.fire("autopanstart").panBy([Bt,te]))}},_getAnchor:function(){return Kt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Mo=function(r,c){return new hs(r,c)};_e.mergeOptions({closePopupOnClick:!0}),_e.include({openPopup:function(r,c,_){return this._initOverlay(hs,r,c,_).openOn(this),this},closePopup:function(r){return r=arguments.length?r:this._popup,r&&r.close(),this}}),be.include({bindPopup:function(r,c){return this._popup=this._initOverlay(hs,this._popup,r,c),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(r){return this._popup&&(this instanceof cn||(this._popup._source=this),this._popup._prepareOpen(r||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(r){return this._popup&&this._popup.setContent(r),this},getPopup:function(){return this._popup},_openPopup:function(r){if(!(!this._popup||!this._map)){Ln(r);var c=r.layer||r.target;if(this._popup._source===c&&!(c instanceof Hn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(r.latlng);return}this._popup._source=c,this.openPopup(r.latlng)}},_movePopup:function(r){this._popup.setLatLng(r.latlng)},_onKeyPress:function(r){r.originalEvent.keyCode===13&&this._openPopup(r)}});var Ls=Hi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(r){Hi.prototype.onAdd.call(this,r),this.setOpacity(this.options.opacity),r.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(r){Hi.prototype.onRemove.call(this,r),r.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var r=Hi.prototype.getEvents.call(this);return this.options.permanent||(r.preclick=this.close),r},_initLayout:function(){var r="leaflet-tooltip",c=r+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Jt("div",c),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+ae(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(r){var c,_,b=this._map,I=this._container,F=b.latLngToContainerPoint(b.getCenter()),J=b.layerPointToContainerPoint(r),lt=this.options.direction,pt=
4I.offsetWidth,xt=I.offsetHeight,Bt=Kt(this.options.offset),te=this._getAnchor();lt==="top"?(c=pt/2,_=xt):lt==="bottom"?(c=pt/2,_=0):lt==="center"?(c=pt/2,_=xt/2):lt==="right"?(c=0,_=xt/2):lt==="left"?(c=pt,_=xt/2):J.x<F.x?(lt="right",c=0,_=xt/2):(lt="left",c=pt+(Bt.x+te.x)*2,_=xt/2),r=r.subtract(Kt(c,_,!0)).add(Bt).add(te),Le(I,"leaflet-tooltip-right"),Le(I,"leaflet-tooltip-left"),Le(I,"leaflet-tooltip-top"),Le(I,"leaflet-tooltip-bottom"),ce(I,"leaflet-tooltip-"+lt),ni(I,r)},_updatePosition:function(){var r=this._map.latLngToLayerPoint(this._latlng);this._setPosition(r)},setOpacity:function(r){this.options.opacity=r,this._container&&yi(this._container,r)},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center);this._setPosition(c)},_getAnchor:function(){return Kt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),pl=function(r,c){return new Ls(r,c)};_e.include({openTooltip:function(r,c,_){return this._initOverlay(Ls,r,c,_).openOn(this),this},closeTooltip:function(r){return r.close(),this}}),be.include({bindTooltip:function(r,c){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ls,this._tooltip,r,c),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(r){if(!(!r&&this._tooltipHandlersAdded)){var c=r?"off":"on",_={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?_.add=this._openTooltip:(_.mouseover=this._openTooltip,_.mouseout=this.closeTooltip,_.click=this._openTooltip,this._map?this._addFocusListeners():_.add=this._addFocusListeners),this._tooltip.options.sticky&&(_.mousemove=this._moveTooltip),this[c](_),this._tooltipHandlersAdded=!r}},openTooltip:function(r){return this._tooltip&&(this instanceof cn||(this._tooltip._source=this),this._tooltip._prepareOpen(r)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(r){return this._tooltip&&this._tooltip.setContent(r),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(r){var c=typeof r.getElement=="function"&&r.getElement();c&&(oe(c,"focus",function(){this._tooltip._source=r,this.openTooltip()},this),oe(c,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(r){var c=typeof r.getElement=="function"&&r.getElement();c&&c.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(r){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var c=this;this._map.once("moveend",function(){c._openOnceFlag=!1,c._openTooltip(r)});return}this._tooltip._source=r.layer||r.target,this.openTooltip(this._tooltip.options.sticky?r.latlng:void 0)}},_moveTooltip:function(r){var c=r.latlng,_,b;this._tooltip.options.sticky&&r.originalEvent&&(_=this._map.mouseEventToContainerPoint(r.originalEvent),b=this._map.containerPointToLayerPoint(_),c=this._map.layerPointToLatLng(b)),this._tooltip.setLatLng(c)}});var ha=Fr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(r){var c=r&&r.tagName==="DIV"?r:document.createElement("div"),_=this.options;if(_.html instanceof Element?(qi(c),c.appendChild(_.html)):c.innerHTML=_.html!==!1?_.html:"",_.bgPos){var b=Kt(_.bgPos);c.style.backgroundPosition=-b.x+"px "+-b.y+"px"}
vendor: 4,943 bytes, line 4
4return this._setIconStyles(c,"icon"),c},createShadow:function(){return null}});function Co(r){return new ha(r)}Fr.Default=Gn;var cs=be.extend({options:{tileSize:256,opacity:1,updateWhenIdle:dt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(r){ke(this,r)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(r){r._addZoomLimit(this)},onRemove:function(r){this._removeAllTiles(),Oe(this._container),r._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ze(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(dr(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(r){return this.options.opacity=r,this._updateOpacity(),this},setZIndex:function(r){return this.options.zIndex=r,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var r=this._clampZoom(this._map.getZoom());r!==this._tileZoom&&(this._tileZoom=r,this._updateLevels()),this._update()}return this},getEvents:function(){var r={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=An(this._onMoveEnd,this.options.updateInterval,this)),r.move=this._onMove),this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},createTile:function(){return document.createElement("div")},getTileSize:function(){var r=this.options.tileSize;return r instanceof re?r:new re(r,r)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(r){for(var c=this.getPane().children,_=-r(-1/0,1/0),b=0,I=c.length,F;b<I;b++)F=c[b].style.zIndex,c[b]!==this._container&&F&&(_=r(_,+F));isFinite(_)&&(this.options.zIndex=_+r(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!dt.ielt9){yi(this._container,this.options.opacity);var r=+new Date,c=!1,_=!1;for(var b in this._tiles){var I=this._tiles[b];if(!(!I.current||!I.loaded)){var F=Math.min(1,(r-I.loaded)/200);yi(I.el,F),F<1?c=!0:(I.active?_=!0:this._onOpaqueTile(I),I.active=!0)}}_&&!this._noPrune&&this._pruneTiles(),c&&(Li(this._fadeFrame),this._fadeFrame=le(this._updateOpacity,this))}},_onOpaqueTile:bt,_initContainer:function(){this._container||(this._container=Jt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var r=this._tileZoom,c=this.options.maxZoom;if(r!==void 0){for(var _ in this._levels)_=Number(_),this._levels[_].el.children.length||_===r?(this._levels[_].el.style.zIndex=c-Math.abs(r-_),this._onUpdateLevel(_)):(Oe(this._levels[_].el),this._removeTilesAtZoom(_),this._onRemoveLevel(_),delete this._levels[_]);var b=this._levels[r],I=this._map;return b||(b=this._levels[r]={},b.el=Jt("div","leaflet-tile-container leaflet-zoom-animated",this._container),b.el.style.zIndex=c,b.origin=I.project(I.unproject(I.getPixelOrigin()),r).round(),b.zoom=r,this._setZoomTransform(b,I.getCenter(),I.getZoom()),bt(b.el.offsetWidth),this._onCreateLevel(b)),this._level=b,b}},_onUpdateLevel:bt,_onRemoveLevel:bt,_onCreateLevel:bt,_pruneTiles:function(){if(this._map){var r,c,_=this._map.getZoom();if(_>this.options.maxZoom||_<this.options.minZoom){this._removeAllTiles();return}for(r in this._tiles)c=this._tiles[r],c.retain=c.current;for(r in this._tiles)if(c=this._tiles[r],c.current&&!c.active){var b=c.coords;this._retainParent(b.x,b.y,b.z,b.z-5)||this._retainChildren(b.x,b.y,b.z,b.z+2)}for(r in this._tiles)this._tiles[r].retain||this._removeTile(r)}},_removeTilesAtZoom:function(r){for(var c in this._tiles)this._tiles[c].coords.z===r&&this._removeTile(c)},_removeAllTiles:function(){for(var r in this._tiles)this._removeTile(r)},_invalidateAll:function(){for(var r in this._levels)Oe(this._levels[r].el),this._onRemoveLevel(Number(r)),delete this._levels[r];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(r,c,_,b){var I=Math.floor(r/2),F=Math.floor(c/2),J=_-1,lt=new re(+I,+F);lt.z=+J;var pt=this._tileCoordsToKey(lt),xt=this._tiles[pt];return xt&&xt.active?(xt.retain=!0,!0):(xt&&xt.loaded&&(xt.retain=!0),J>b?this._retainParent(I,F,J,b):!1)},_retainChildren:function(r,c,_,b){for(var I=2*r;I<2*r+2;I++)for(var F=2*c;F<2*c+2;F++){var J=new re(I,F);J.z=_+1;var lt=this._tileCoordsToKey(J),pt=this._tiles[lt];if(pt&&pt.active){pt.retain=!0;continue}else pt&&pt.loaded&&(pt.retain=!0);_+1<b&&this._retainChildren(I,F,_+1,b)}},_resetView:function(r){var c=r&&(r.pinch||r.flyTo);
vendor: 5,932 bytes, line 4
4this._setView(this._map.getCenter(),this._map.getZoom(),c,c)},_animateZoom:function(r){this._setView(r.center,r.zoom,!0,r.noUpdate)},_clampZoom:function(r){var c=this.options;return c.minNativeZoom!==void 0&&r<c.minNativeZoom?c.minNativeZoom:c.maxNativeZoom!==void 0&&c.maxNativeZoom<r?c.maxNativeZoom:r},_setView:function(r,c,_,b){var I=Math.round(c);this.options.maxZoom!==void 0&&I>this.options.maxZoom||this.options.minZoom!==void 0&&I<this.options.minZoom?I=void 0:I=this._clampZoom(I);var F=this.options.updateWhenZooming&&I!==this._tileZoom;(!b||F)&&(this._tileZoom=I,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),I!==void 0&&this._update(r),_||this._pruneTiles(),this._noPrune=!!_),this._setZoomTransforms(r,c)},_setZoomTransforms:function(r,c){for(var _ in this._levels)this._setZoomTransform(this._levels[_],r,c)},_setZoomTransform:function(r,c,_){var b=this._map.getZoomScale(_,r.zoom),I=r.origin.multiplyBy(b).subtract(this._map._getNewPixelOrigin(c,_)).round();dt.any3d?pr(r.el,I,b):ni(r.el,I)},_resetGrid:function(){var r=this._map,c=r.options.crs,_=this._tileSize=this.getTileSize(),b=this._tileZoom,I=this._map.getPixelWorldBounds(this._tileZoom);I&&(this._globalTileRange=this._pxBoundsToTileRange(I)),this._wrapX=c.wrapLng&&!this.options.noWrap&&[Math.floor(r.project([0,c.wrapLng[0]],b).x/_.x),Math.ceil(r.project([0,c.wrapLng[1]],b).x/_.y)],this._wrapY=c.wrapLat&&!this.options.noWrap&&[Math.floor(r.project([c.wrapLat[0],0],b).y/_.x),Math.ceil(r.project([c.wrapLat[1],0],b).y/_.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(r){var c=this._map,_=c._animatingZoom?Math.max(c._animateToZoom,c.getZoom()):c.getZoom(),b=c.getZoomScale(_,this._tileZoom),I=c.project(r,this._tileZoom).floor(),F=c.getSize().divideBy(b*2);return new Te(I.subtract(F),I.add(F))},_update:function(r){var c=this._map;if(c){var _=this._clampZoom(c.getZoom());if(r===void 0&&(r=c.getCenter()),this._tileZoom!==void 0){var b=this._getTiledPixelBounds(r),I=this._pxBoundsToTileRange(b),F=I.getCenter(),J=[],lt=this.options.keepBuffer,pt=new Te(I.getBottomLeft().subtract([lt,-lt]),I.getTopRight().add([lt,-lt]));if(!(isFinite(I.min.x)&&isFinite(I.min.y)&&isFinite(I.max.x)&&isFinite(I.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var xt in this._tiles){var Bt=this._tiles[xt].coords;(Bt.z!==this._tileZoom||!pt.contains(new re(Bt.x,Bt.y)))&&(this._tiles[xt].current=!1)}if(Math.abs(_-this._tileZoom)>1){this._setView(r,_);return}for(var te=I.min.y;te<=I.max.y;te++)for(var ye=I.min.x;ye<=I.max.x;ye++){var Ai=new re(ye,te);if(Ai.z=this._tileZoom,!!this._isValidTile(Ai)){var ui=this._tiles[this._tileCoordsToKey(Ai)];ui?ui.current=!0:J.push(Ai)}}if(J.sort(function(di,Ti){return di.distanceTo(F)-Ti.distanceTo(F)}),J.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Wi=document.createDocumentFragment();for(ye=0;ye<J.length;ye++)this._addTile(J[ye],Wi);this._level.el.appendChild(Wi)}}}},_isValidTile:function(r){var c=this._map.options.crs;if(!c.infinite){var _=this._globalTileRange;if(!c.wrapLng&&(r.x<_.min.x||r.x>_.max.x)||!c.wrapLat&&(r.y<_.min.y||r.y>_.max.y))return!1}if(!this.options.bounds)return!0;var b=this._tileCoordsToBounds(r);return Fe(this.options.bounds).overlaps(b)},_keyToBounds:function(r){return this._tileCoordsToBounds(this._keyToTileCoords(r))},_tileCoordsToNwSe:function(r){var c=this._map,_=this.getTileSize(),b=r.scaleBy(_),I=b.add(_),F=c.unproject(b,r.z),J=c.unproject(I,r.z);return[F,J]},_tileCoordsToBounds:function(r){var c=this._tileCoordsToNwSe(r),_=new ci(c[0],c[1]);return this.options.noWrap||(_=this._map.wrapLatLngBounds(_)),_},_tileCoordsToKey:function(r){return r.x+":"+r.y+":"+r.z},_keyToTileCoords:function(r){var c=r.split(":"),_=new re(+c[0],+c[1]);return _.z=+c[2],_},_removeTile:function(r){var c=this._tiles[r];c&&(Oe(c.el),delete this._tiles[r],this.fire("tileunload",{tile:c.el,coords:this._keyToTileCoords(r)}))},_initTile:function(r){ce(r,"leaflet-tile");var c=this.getTileSize();r.style.width=c.x+"px",r.style.height=c.y+"px",r.onselectstart=bt,r.onmousemove=bt,dt.ielt9&&this.options.opacity<1&&yi(r,this.options.opacity)},_addTile:function(r,c){var _=this._getTilePos(r),b=this._tileCoordsToKey(r),I=this.createTile(this._wrapCoords(r),O(this._tileReady,this,r));this._initTile(I),this.createTile.length<2&&le(O(this._tileReady,this,r,null,I)),ni(I,_),this._tiles[b]={el:I,coords:r,current:!0},c.appendChild(I),this.fire("tileloadstart",{tile:I,coords:r})},_tileReady:function(r,c,_){c&&this.fire("tileerror",{error:c,tile:_,coords:r});var b=this._tileCoordsToKey(r);_=this._tiles[b],_&&(_.loaded=+new Date,this._map._fadeAnimated?(yi(_.el,0),Li(this._fadeFrame),this._fadeFrame=le(this._updateOpacity,this)):(_.active=!0,this._pruneTiles()),c||(ce(_.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:_.el,coords:r})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),dt.ielt9||!this._map._fadeAnimated?le(this._pruneTiles,this):setTimeout(O(this._pruneTiles,this),250)))},_getTilePos:function(r){return r.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(r){var c=new re(this._wrapX?hi(r.x,this._wrapX):r.x,this._wrapY?hi(r.y,this._wrapY):r.y);return c.z=r.z,c},_pxBoundsToTileRange:function(r){var c=this.getTileSize();return new Te(r.min.unscaleBy(c).floor(),r.max.unscaleBy(c).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var r in this._tiles)if(!this._tiles[r].loaded)return!1;return!0}});function Ys(r){return new cs(r)}var Kn=cs.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(r,c){this._url=r,c=ke(this,c),c.detectRetina&&dt.retina&&c.maxZoom>0?(c.tileSize=Math.floor(c.tileSize/2),c.zoomReverse?(c.zoomOffset--,c.minZoom=Math.min(c.maxZoom,c.minZ
vendor: 4,682 bytes, line 4
4oom+1)):(c.zoomOffset++,c.maxZoom=Math.max(c.minZoom,c.maxZoom-1)),c.minZoom=Math.max(0,c.minZoom)):c.zoomReverse?c.minZoom=Math.min(c.maxZoom,c.minZoom):c.maxZoom=Math.max(c.minZoom,c.maxZoom),typeof c.subdomains=="string"&&(c.subdomains=c.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(r,c){return this._url===r&&c===void 0&&(c=!0),this._url=r,c||this.redraw(),this},createTile:function(r,c){var _=document.createElement("img");return oe(_,"load",O(this._tileOnLoad,this,c,_)),oe(_,"error",O(this._tileOnError,this,c,_)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(_.referrerPolicy=this.options.referrerPolicy),_.alt="",_.src=this.getTileUrl(r),_},getTileUrl:function(r){var c={r:dt.retina?"@2x":"",s:this._getSubdomain(r),x:r.x,y:r.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var _=this._globalTileRange.max.y-r.y;this.options.tms&&(c.y=_),c["-y"]=_}return vs(this._url,Ae(c,this.options))},_tileOnLoad:function(r,c){dt.ielt9?setTimeout(O(r,this,null,c),0):r(null,c)},_tileOnError:function(r,c,_){var b=this.options.errorTileUrl;b&&c.getAttribute("src")!==b&&(c.src=b),r(_,c)},_onTileRemove:function(r){r.tile.onload=null},_getZoomForUrl:function(){var r=this._tileZoom,c=this.options.maxZoom,_=this.options.zoomReverse,b=this.options.zoomOffset;return _&&(r=c-r),r+b},_getSubdomain:function(r){var c=Math.abs(r.x+r.y)%this.options.subdomains.length;return this.options.subdomains[c]},_abortLoading:function(){var r,c;for(r in this._tiles)if(this._tiles[r].coords.z!==this._tileZoom&&(c=this._tiles[r].el,c.onload=bt,c.onerror=bt,!c.complete)){c.src=Vi;var _=this._tiles[r].coords;Oe(c),delete this._tiles[r],this.fire("tileabort",{tile:c,coords:_})}},_removeTile:function(r){var c=this._tiles[r];if(c)return c.el.setAttribute("src",Vi),cs.prototype._removeTile.call(this,r)},_tileReady:function(r,c,_){if(!(!this._map||_&&_.getAttribute("src")===Vi))return cs.prototype._tileReady.call(this,r,c,_)}});function bi(r,c){return new Kn(r,c)}var Or=Kn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(r,c){this._url=r;var _=Ae({},this.defaultWmsParams);for(var b in c)b in this.options||(_[b]=c[b]);c=ke(this,c);var I=c.detectRetina&&dt.retina?2:1,F=this.getTileSize();_.width=F.x*I,_.height=F.y*I,this.wmsParams=_},onAdd:function(r){this._crs=this.options.crs||r.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var c=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[c]=this._crs.code,Kn.prototype.onAdd.call(this,r)},getTileUrl:function(r){var c=this._tileCoordsToNwSe(r),_=this._crs,b=Ge(_.project(c[0]),_.project(c[1])),I=b.min,F=b.max,J=(this._wmsVersion>=1.3&&this._crs===de?[I.y,I.x,F.y,F.x]:[I.x,I.y,F.x,F.y]).join(","),lt=Kn.prototype.getTileUrl.call(this,r);return lt+rr(this.wmsParams,lt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+J},setParams:function(r,c){return Ae(this.wmsParams,r),c||this.redraw(),this}});function Na(r,c){return new Or(r,c)}Kn.WMS=Or,bi.wms=Na;var Jn=be.extend({options:{padding:.1},initialize:function(r){ke(this,r),ae(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ce(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var r={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(r.zoomanim=this._onAnimZoom),r},_onAnimZoom:function(r){this._updateTransform(r.center,r.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(r,c){var _=this._map.getZoomScale(c,this._zoom),b=this._map.getSize().multiplyBy(.5+this.options.padding),I=this._map.project(this._center,c),F=b.multiplyBy(-_).add(I).subtract(this._map._getNewPixelOrigin(r,c));dt.any3d?pr(this._container,F,_):ni(this._container,F)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var r in this._layers)this._layers[r]._reset()},_onZoomEnd:function(){for(var r in this._layers)this._layers[r]._project()},_updatePaths:function(){for(var r in this._layers)this._layers[r]._update()},_update:function(){var r=this.options.padding,c=this._map.getSize(),_=this._map.containerPointToLayerPoint(c.multiplyBy(-r)).roun
vendor: 10,860 bytes, line 4
4d();this._bounds=new Te(_,_.add(c.multiplyBy(1+r*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ii=Jn.extend({options:{tolerance:0},getEvents:function(){var r=Jn.prototype.getEvents.call(this);return r.viewprereset=this._onViewPreReset,r},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Jn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var r=this._container=document.createElement("canvas");oe(r,"mousemove",this._onMouseMove,this),oe(r,"click dblclick mousedown mouseup contextmenu",this._onClick,this),oe(r,"mouseout",this._handleMouseOut,this),r._leaflet_disable_events=!0,this._ctx=r.getContext("2d")},_destroyContainer:function(){Li(this._redrawRequest),delete this._ctx,Oe(this._container),Re(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var r;this._redrawBounds=null;for(var c in this._layers)r=this._layers[c],r._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Jn.prototype._update.call(this);var r=this._bounds,c=this._container,_=r.getSize(),b=dt.retina?2:1;ni(c,r.min),c.width=b*_.x,c.height=b*_.y,c.style.width=_.x+"px",c.style.height=_.y+"px",dt.retina&&this._ctx.scale(2,2),this._ctx.translate(-r.min.x,-r.min.y),this.fire("update")}},_reset:function(){Jn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(r){this._updateDashArray(r),this._layers[ae(r)]=r;var c=r._order={layer:r,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=c),this._drawLast=c,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(r){this._requestRedraw(r)},_removePath:function(r){var c=r._order,_=c.next,b=c.prev;_?_.prev=b:this._drawLast=b,b?b.next=_:this._drawFirst=_,delete r._order,delete this._layers[ae(r)],this._requestRedraw(r)},_updatePath:function(r){this._extendRedrawBounds(r),r._project(),r._update(),this._requestRedraw(r)},_updateStyle:function(r){this._updateDashArray(r),this._requestRedraw(r)},_updateDashArray:function(r){if(typeof r.options.dashArray=="string"){var c=r.options.dashArray.split(/[, ]+/),_=[],b,I;for(I=0;I<c.length;I++){if(b=Number(c[I]),isNaN(b))return;_.push(b)}r.options._dashArray=_}else r.options._dashArray=r.options.dashArray},_requestRedraw:function(r){this._map&&(this._extendRedrawBounds(r),this._redrawRequest=this._redrawRequest||le(this._redraw,this))},_extendRedrawBounds:function(r){if(r._pxBounds){var c=(r.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Te,this._redrawBounds.extend(r._pxBounds.min.subtract([c,c])),this._redrawBounds.extend(r._pxBounds.max.add([c,c]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var r=this._redrawBounds;if(r){var c=r.getSize();this._ctx.clearRect(r.min.x,r.min.y,c.x,c.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var r,c=this._redrawBounds;if(this._ctx.save(),c){var _=c.getSize();this._ctx.beginPath(),this._ctx.rect(c.min.x,c.min.y,_.x,_.y),this._ctx.clip()}this._drawing=!0;for(var b=this._drawFirst;b;b=b.next)r=b.layer,(!c||r._pxBounds&&r._pxBounds.intersects(c))&&r._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(r,c){if(this._drawing){var _,b,I,F,J=r._parts,lt=J.length,pt=this._ctx;if(lt){for(pt.beginPath(),_=0;_<lt;_++){for(b=0,I=J[_].length;b<I;b++)F=J[_][b],pt[b?"lineTo":"moveTo"](F.x,F.y);c&&pt.closePath()}this._fillStroke(pt,r)}}},_updateCircle:function(r){if(!(!this._drawing||r._empty())){var c=r._point,_=this._ctx,b=Math.max(Math.round(r._radius),1),I=(Math.max(Math.round(r._radiusY),1)||b)/b;I!==1&&(_.save(),_.scale(1,I)),_.beginPath(),_.arc(c.x,c.y/I,b,0,Math.PI*2,!1),I!==1&&_.restore(),this._fillStroke(_,r)}},_fillStroke:function(r,c){var _=c.options;_.fill&&(r.globalAlpha=_.fillOpacity,r.fillStyle=_.fillColor||_.color,r.fill(_.fillRule||"evenodd")),_.stroke&&_.weight!==0&&(r.setLineDash&&r.setLineDash(c.options&&c.options._dashArray||[]),r.globalAlpha=_.opacity,r.lineWidth=_.weight,r.strokeStyle=_.color,r.lineCap=_.lineCap,r.lineJoin=_.lineJoin,r.stroke())},_onClick:function(r){for(var c=this._map.mouseEventToLayerPoint(r),_,b,I=this._drawFirst;I;I=I.next)_=I.layer,_.options.interactive&&_._containsPoint(c)&&(!(r.type==="click"||r.type==="preclick")||!this._map._draggableMoved(_))&&(b=_);this._fireEvent(b?[b]:!1,r)},_onMouseMove:function(r){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var c=this._map.mouseEventToLayerPoint(r);this._handleMouseHover(r,c)}},_handleMouseOut:function(r){var c=this._hoveredLayer;c&&(Le(this._container,"leaflet-interactive"),this._fireEvent([c],r,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(r,c){if(!this._mouseHoverThrottled){for(var _,b,I=this._drawFirst;I;I=I.next)_=I.layer,_.options.interactive&&_._containsPoint(c)&&(b=_);b!==this._hoveredLayer&&(this._handleMouseOut(r),b&&(ce(this._container,"leaflet-interactive"),this._fireEvent([b],r,"mouseover"),this._hoveredLayer=b)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,r),this._mouseHoverThrottled=!0,setTimeout(O(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(r,c,_){this._map._fireDOMEvent(c,_||c.type,r)},_bringToFront:function(r){var c=r._order;if(c){var _=c.next,b=c.prev;if(_)_.prev=b;else return;b?b.next=_:_&&(this._drawFirst=_),c.prev=this._drawLast,this._drawLast.next=c,c.next=null,this._drawLast=c,this._requestRedraw(r)}},_bringToBack:function(r){var c=r._order;if(c){var _=c.next,b=c.prev;if(b)b.next=_;else return;_?_.prev=b:b&&(this._drawLast=b),c.prev=null,c.next=this._drawFirst,this._drawFirst.prev=c,this._drawFirst=c,this._requestRedraw(r)}}});function wn(r){return dt.canvas?new ii(r):null}var wi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(r){return document.createElement("<lvml:"+r+' class="lvml">')}}catch{}return function(r){return document.createElement("<"+r+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Qs={_initContainer:function(){this._container=Jt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Jn.prototype._update.call(this),this.fire("update"))},_initPath:function(r){var c=r._container=wi("shape");ce(c,"leaflet-vml-shape "+(this.options.className||"")),c.coordsize="1 1",r._path=wi("path"),c.appendChild(r._path),this._updateStyle(r),this._layers[ae(r)]=r},_addPath:function(r){var c=r._container;this._container.appendChild(c),r.options.interactive&&r.addInteractiveTarget(c)},_removePath:function(r){var c=r._container;Oe(c),r.removeInteractiveTarget(c),delete this._layers[ae(r)]},_updateStyle:function(r){var c=r._stroke,_=r._fill,b=r.options,I=r._container;I.stroked=!!b.stroke,I.filled=!!b.fill,b.stroke?(c||(c=r._stroke=wi("stroke")),I.appendChild(c),c.weight=b.weight+"px",c.color=b.color,c.opacity=b.opacity,b.dashArray?c.dashStyle=ti(b.dashArray)?b.dashArray.join(" "):b.dashArray.replace(/( *, *)/g," "):c.dashStyle="",c.endcap=b.lineCap.replace("butt","flat"),c.joinstyle=b.lineJoin):c&&(I.removeChild(c),r._stroke=null),b.fill?(_||(_=r._fill=wi("fill")),I.appendChild(_),_.color=b.fillColor||b.color,_.opacity=b.fillOpacity):_&&(I.removeChild(_),r._fill=null)},_updateCircle:function(r){var c=r._point.round(),_=Math.round(r._radius),b=Math.round(r._radiusY||_);this._setPath(r,r._empty()?"M0 0":"AL "+c.x+","+c.y+" "+_+","+b+" 0,"+65535*360)},_setPath:function(r,c){r._path.v=c},_bringToFront:function(r){Ze(r._container)},_bringToBack:function(r){dr(r._container)}},Ds=dt.vml?wi:$r,Nr=Jn.extend({_initContainer:function(){this._container=Ds("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ds("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Oe(this._container),Re(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Jn.prototype._update.call(this);var r=this._bounds,c=r.getSize(),_=this._container;(!this._svgSize||!this._svgSize.equals(c))&&(this._svgSize=c,_.setAttribute("width",c.x),_.setAttribute("height",c.y)),ni(_,r.min),_.setAttribute("viewBox",[r.min.x,r.min.y,c.x,c.y].join(" ")),this.fire("update")}},_initPath:function(r){var c=r._path=Ds("path");r.options.className&&ce(c,r.options.className),r.options.interactive&&ce(c,"leaflet-interactive"),this._updateStyle(r),this._layers[ae(r)]=r},_addPath:function(r){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(r._path),r.addInteractiveTarget(r._path)},_removePath:function(r){Oe(r._path),r.removeInteractiveTarget(r._path),delete this._layers[ae(r)]},_updatePath:function(r){r._project(),r._update()},_updateStyle:function(r){var c=r._path,_=r.options;c&&(_.stroke?(c.setAttribute("stroke",_.color),c.setAttribute("stroke-opacity",_.opacity),c.setAttribute("stroke-width",_.weight),c.setAttribute("stroke-linecap",_.lineCap),c.setAttribute("stroke-linejoin",_.lineJoin),_.dashArray?c.setAttribute("stroke-dasharray",_.dashArray):c.removeAttribute("stroke-dasharray"),_.dashOffset?c.setAttribute("stroke-dashoffset",_.dashOffset):c.removeAttribute("stroke-dashoffset")):c.setAttribute("stroke","none"),_.fill?(c.setAttribute("fill",_.fillColor||_.color),c.setAttribute("fill-opacity",_.fillOpacity),c.setAttribute("fill-rule",_.fillRule||"evenodd")):c.setAttribute("fill","none"))},_updatePoly:function(r,c){this._setPath(r,ut(r._parts,c))},_updateCircle:function(r){var c=r._point,_=Math.max(Math.round(r._radius),1),b=Math.max(Math.round(r._radiusY),1)||_,I="a"+_+","+b+" 0 1,0 ",F=r._empty()?"M0 0":"M"+(c.x-_)+","+c.y+I+_*2+",0 "+I+-_*2+",0 ";this._setPath(r,F)},_setPath:function(r,c){r._path.setAttribute("d",c)},_bringToFront:function(r){Ze(r._path)},_bringToBack:function(r){dr(r._path)}});dt.vml&&Nr.include(Qs);function us(r){return dt.svg||dt.vml?new Nr(r):null}_e.include({getRenderer:function(r){var c=r.options.renderer||this._getPaneRenderer(r.options.pane)||this.options.renderer||this._renderer;return c||(c=this._renderer=this._createRenderer()),this.hasLayer(c)||this.addLayer(c),c},_getPaneRenderer:function(r){if(r==="overlayPane"||r===void 0)return!1;var c=this._paneRenderers[r];return c===void 0&&(c=this._createRenderer({pane:r}),this._paneRenderers[r]=c),c},_createRenderer:function(r){return this.options.preferCanvas&&wn(r)||us(r)}});var Yn=Bn.extend({initialize:function(r,c){Bn.prototype.initialize.call(this,this._boundsToLatLngs(r),c)},setBounds:function(r){return this.setLatLngs(this._boundsToLatLngs(r))}
vendor: 10,590 bytes, line 4
4,_boundsToLatLngs:function(r){return r=Fe(r),[r.getSouthWest(),r.getNorthWest(),r.getNorthEast(),r.getSouthEast()]}});function ca(r,c){return new Yn(r,c)}Nr.create=Ds,Nr.pointsToPath=ut,Xn.geometryToLayer=Cs,Xn.coordsToLatLng=As,Xn.coordsToLatLngs=wo,Xn.latLngToCoords=To,Xn.latLngsToCoords=mr,Xn.getFeature=ss,Xn.asFeature=os,_e.mergeOptions({boxZoom:!0});var to=Dn.extend({initialize:function(r){this._map=r,this._container=r._container,this._pane=r._panes.overlayPane,this._resetStateTimeout=0,r.on("unload",this._destroy,this)},addHooks:function(){oe(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Re(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Oe(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(r){if(!r.shiftKey||r.which!==1&&r.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Kr(),zr(),this._startPoint=this._map.mouseEventToContainerPoint(r),oe(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(r){this._moved||(this._moved=!0,this._box=Jt("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(r);var c=new Te(this._point,this._startPoint),_=c.getSize();ni(this._box,c.min),this._box.style.width=_.x+"px",this._box.style.height=_.y+"px"},_finish:function(){this._moved&&(Oe(this._box),Le(this._container,"leaflet-crosshair")),Ar(),lo(),Re(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(r){if(!(r.which!==1&&r.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(O(this._resetState,this),0);var c=new ci(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(c).fire("boxzoomend",{boxZoomBounds:c})}},_onKeyDown:function(r){r.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});_e.addInitHook("addHandler","boxZoom",to),_e.mergeOptions({doubleClickZoom:!0});var Ao=Dn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(r){var c=this._map,_=c.getZoom(),b=c.options.zoomDelta,I=r.originalEvent.shiftKey?_-b:_+b;c.options.doubleClickZoom==="center"?c.setZoom(I):c.setZoomAround(r.containerPoint,I)}});_e.addInitHook("addHandler","doubleClickZoom",Ao),_e.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var eo=Dn.extend({addHooks:function(){if(!this._draggable){var r=this._map;this._draggable=new fr(r._mapPane,r._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),r.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),r.on("zoomend",this._onZoomEnd,this),r.whenReady(this._onZoomEnd,this))}ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Le(this._map._container,"leaflet-grab"),Le(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var r=this._map;if(r._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var c=Fe(this._map.options.maxBounds);this._offsetLimit=Ge(this._map.latLngToContainerPoint(c.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(c.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;r.fire("movestart").fire("dragstart"),r.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(r){if(this._map.options.inertia){var c=this._lastTime=+new Date,_=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(_),this._times.push(c),this._prunePositions(c)}this._map.fire("move",r).fire("drag",r)},_prunePositions:function(r){for(;this._positions.length>1&&r-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var r=this._map.getSize().divideBy(2),c=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=c.subtract(r).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(r,c){return r-(r-c)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var r=this._draggable._newPos.subtract(this._draggable._startPos),c=this._offsetLimit;r.x<c.min.x&&(r.x=this._viscousLimit(r.x,c.min.x)),r.y<c.min.y&&(r.y=this._viscousLimit(r.y,c.min.y)),r.x>c.max.x&&(r.x=this._viscousLimit(r.x,c.max.x)),r.y>c.max.y&&(r.y=this._viscousLimit(r.y,c.max.y)),this._draggable._newPos=this._draggable._startPos.add(r)}},_onPreDragWrap:function(){var r=this._worldWidth,c=Math.round(r/2),_=this._initialWorldOffset,b=this._draggable._newPos.x,I=(b-c+_)%r+c-_,F=(b+c+_)%r-c-_,J=Math.abs(I+_)<Math.abs(F+_)?I:F;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=J},_onDragEnd:function(r){var c=this._map,_=c.options,b=!_.inertia||r.noInertia||this._times.length<2;if(c.fire("dragend",r),b)c.fire("moveend");else{this._prunePositions(+new Date);var I=this._lastPos.subtract(this._positions[0]),F=(this._lastTime-this._times[0])/1e3,J=_.easeLinearity,lt=I.multiplyBy(J/F),pt=lt.distanceTo([0,0]),xt=Math.min(_.inertiaMaxSpeed,pt),Bt=lt.multiplyBy(xt/pt),te=xt/(_.inertiaDeceleration*J),ye=Bt.multiplyBy(-te/2).round();!ye.x&&!ye.y?c.fire("moveend"):(ye=c._limitOffset(ye,c.options.maxBounds),le(function(){c.panBy(ye,{duration:te,easeLinearity:J,noMoveStart:!0,animate:!0})}))}}});_e.addInitHook("addHandler","dragging",eo),_e.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ko=Dn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(r){this._map=r,this._setPanDelta(r.options.keyboardPanDelta),this._setZoomDelta(r.options.zoomDelta)},addHooks:function(){var r=this._map._container;r.tabIndex<=0&&(r.tabIndex="0"),oe(r,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Re(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var r=document.body,c=document.documentElement,_=r.scrollTop||c.scrollTop,b=r.scrollLeft||c.scrollLeft;this._map._container.focus(),window.scrollTo(b,_)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(r){var c=this._panKeys={},_=this.keyCodes,b,I;for(b=0,I=_.left.length;b<I;b++)c[_.left[b]]=[-1*r,0];for(b=0,I=_.right.length;b<I;b++)c[_.right[b]]=[r,0];for(b=0,I=_.down.length;b<I;b++)c[_.down[b]]=[0,r];for(b=0,I=_.up.length;b<I;b++)c[_.up[b]]=[0,-1*r]},_setZoomDelta:function(r){var c=this._zoomKeys={},_=this.keyCodes,b,I;for(b=0,I=_.zoomIn.length;b<I;b++)c[_.zoomIn[b]]=r;for(b=0,I=_.zoomOut.length;b<I;b++)c[_.zoomOut[b]]=-r},_addHooks:function(){oe(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Re(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(r){if(!(r.altKey||r.ctrlKey||r.metaKey)){var c=r.keyCode,_=this._map,b;if(c in this._panKeys){if(!_._panAnim||!_._panAnim._inProgress)if(b=this._panKeys[c],r.shiftKey&&(b=Kt(b).multiplyBy(3)),_.options.maxBounds&&(b=_._limitOffset(Kt(b),_.options.maxBounds)),_.options.worldCopyJump){var I=_.wrapLatLng(_.unproject(_.project(_.getCenter()).add(b)));_.panTo(I)}else _.panBy(b)}else if(c in this._zoomKeys)_.setZoom(_.getZoom()+(r.shiftKey?3:1)*this._zoomKeys[c]);else if(c===27&&_._popup&&_._popup.options.closeOnEscapeKey)_.closePopup();else return;Ln(r)}}});_e.addInitHook("addHandler","keyboard",ko),_e.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zo=Dn.extend({addHooks:function(){oe(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Re(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(r){var c=fo(r),_=this._map.options.wheelDebounceTime;this._delta+=c,this._lastMousePos=this._map.mouseEventToContainerPoint(r),this._startTime||(this._startTime=+new Date);var b=Math.max(_-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(O(this._performZoom,this),b),Ln(r)},_performZoom:function(){var r=this._map,c=r.getZoom(),_=this._map.options.zoomSnap||0;r._stop();var b=this._delta/(this._map.options.wheelPxPerZoomLevel*4),I=4*Math.log(2/(1+Math.exp(-Math.abs(b))))/Math.LN2,F=_?Math.ceil(I/_)*_:I,J=r._limitZoom(c+(this._delta>0?F:-F))-c;this._delta=0,this._startTime=null,J&&(r.options.scrollWheelZoom==="center"?r.setZoom(c+J):r.setZoomAround(this._lastMousePos,c+J))}});_e.addInitHook("addHandler","scrollWheelZoom",zo);var ds=600;_e.mergeOptions({tapHold:dt.touchNative&&dt.safari&&dt.mobile,tapTolerance:15});var io=Dn.extend({addHooks:function(){oe(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Re(this._map._container,"touchstart",this._onDown,this)},_onDown:function(r){if(clearTimeout(this._holdTimeout),r.touches.length===1){var c=r.touches[0];this._startPos=this._newPos=new re(c.clientX,c.clientY),this._holdTimeout=setTimeout(O(function(){this._cancel(),this._isTapValid()&&(oe(document,"touchend",vi),oe(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",c))},this),ds),oe(document,"touchend touchcancel contextmenu",this._cancel,this),oe(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function r(){Re(document,"touchend",vi),Re(document,"touchend touchcancel",r)},_cancel:function(){clearTimeout(this._holdTimeout),Re(document,"touchend touchcancel contextmenu",this._cancel,this),Re(d
4ocument,"touchmove",this._onMove,this)},_onMove:function(r){var c=r.touches[0];this._newPos=new re(c.clientX,c.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(r,c){var _=new MouseEvent(r,{bubbles:!0,cancelable:!0,view:window,screenX:c.screenX,screenY:c.screenY,clientX:c.clientX,clientY:c.clientY});_._simulated=!0,c.target.dispatchEvent(_)}});_e.addInitHook("addHandler","tapHold",io),_e.mergeOptions({touchZoom:dt.touch,bounceAtZoomLimits:!0});var Bs=Dn.extend({addHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),oe(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Le(this._map._container,"leaflet-touch-zoom"),Re(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(r){var c=this._map;if(!(!r.touches||r.touches.length!==2||c._animatingZoom||this._zooming)){var _=c.mouseEventToContainerPoint(r.touches[0]),b=c.mouseEventToContainerPoint(r.touches[1]);this._centerPoint=c.getSize()._divideBy(2),this._startLatLng=c.containerPointToLatLng(this._centerPoint),c.options.touchZoom!=="center"&&(this._pinchStartLatLng=c.containerPointToLatLng(_.add(b)._divideBy(2))),this._startDist=_.distanceTo(b),this._startZoom=c.getZoom(),this._moved=!1,this._zooming=!0,c._stop(),oe(document,"touchmove",this._onTouchMove,this),oe(document,"touchend touchcancel",this._onTouchEnd,this),vi(r)}},_onTouchMove:function(r){if(!(!r.touches||r.touches.length!==2||!this._zooming)){var c=this._map,_=c.mouseEventToContainerPoint(r.touches[0]),b=c.mouseEventToContainerPoint(r.touches[1]),I=_.distanceTo(b)/this._startDist;if(this._zoom=c.getScaleZoom(I,this._startZoom),!c.options.bounceAtZoomLimits&&(this._zoom<c.getMinZoom()&&I<1||this._zoom>c.getMaxZoom()&&I>1)&&(this._zoom=c._limitZoom(this._zoom)),c.options.touchZoom==="center"){if(this._center=this._startLatLng,I===1)return}else{var F=_._add(b)._divideBy(2)._subtract(this._centerPoint);if(I===1&&F.x===0&&F.y===0)return;this._center=c.unproject(c.project(this._pinchStartLatLng,this._zoom).subtract(F),this._zoom)}this._moved||(c._moveStart(!0,!1),this._moved=!0),Li(this._animRequest);var J=O(c._move,c,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=le(J,this,!0),vi(r)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Li(this._animRequest),Re(document,"touchmove",this._onTouchMove,this),Re(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});_e.addInitHook("addHandler","touchZoom",Bs),_e.BoxZoom=to,_e.DoubleClickZoom=Ao,_e.Drag=eo,_e.Keyboard=ko,_e.ScrollWheelZoom=zo,_e.TapHold=io,_e.TouchZoom=Bs,Mt.Bounds=Te,Mt.Browser=dt,Mt.CRS=oi,Mt.Canvas=ii,Mt.Circle=rs,Mt.CircleMarker=Wn,Mt.Class=ei,Mt.Control=ue,Mt.DivIcon=ha,Mt.DivOverlay=Hi,Mt.DomEvent=hl,Mt.DomUtil=$i,Mt.Draggable=fr,Mt.Evented=Zi,Mt.FeatureGroup=cn,Mt.GeoJSON=Xn,Mt.GridLayer=cs,Mt.Handler=Dn,Mt.Icon=Fr,Mt.ImageOverlay=as,Mt.LatLng=ve,Mt.LatLngBounds=ci,Mt.Layer=be,Mt.LayerGroup=Ce,Mt.LineUtil=es,Mt.Map=_e,Mt.Marker=Ss,Mt.Mixin=Da,Mt.Path=Hn,Mt.Point=re,Mt.PolyUtil=cl,Mt.Polygon=Bn,Mt.Polyline=dn,Mt.Popup=hs,Mt.PosAnimation=mo,Mt.Projection=ri,Mt.Rectangle=Yn,Mt.Renderer=Jn,Mt.SVG=Nr,Mt.SVGOverlay=Io,Mt.TileLayer=Kn,Mt.Tooltip=Ls,Mt.Transformation=qr,Mt.Util=Si,Mt.VideoOverlay=ls,Mt.bind=O,Mt.bounds=Ge,Mt.canvas=wn,Mt.circle=Is,Mt.circleMarker=Js,Mt.control=Br,Mt.divIcon=Co,Mt.extend=Ae,Mt.featureGroup=Ks,Mt.geoJSON=la,Mt.geoJson=So,Mt.gridLayer=Ys,Mt.icon=ns,Mt.imageOverlay=ks,Mt.latLng=ge,Mt.latLngBounds=Fe,Mt.layerGroup=is,Mt.map=Dr,Mt.marker=aa,Mt.point=Kt,Mt.polygon=Ms,Mt.polyline=bo,Mt.popup=Mo,Mt.rectangle=ca,Mt.setOptions=ke,Mt.stamp=ae,Mt.svg=us,Mt.svgOverlay=Es,Mt.tileLayer=bi,Mt.tooltip=pl,Mt.transformation=sn,Mt.version=nn,Mt.videoOverlay=zs;var ua=window.L;Mt.noConflict=function(){return window.L=ua,this},window.L=Mt})}
4)(tc,tc.exports);var Rp=tc.exports;const Np=Nu(Rp);var Vu={exports:{}};/** 5 * MapLibre GL JS 6 * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt 7 */(function(Ca,ll){(function(Mt,nn){Ca.exports=nn()})(Ou,function(){var Mt={},nn={};function Ae(O,m,ae){if(nn[O]=ae,O==="index"){var An="var sharedModule = {}; ("+nn.shared+")(sharedModule); ("+nn.worker+")(sharedModule);",hi={};return nn.shared(hi),nn.index(Mt,hi),typeof window<"u"&&Mt.setWorkerUrl(window.URL.createObjectURL(new Blob([An],{type:"text/javascript"}))),Mt}}Ae("shared",["exports"],function(O){function m(i,e,n,o){return new(n||(n=Promise))(function(h,p){function f(T){try{v(o.next(T))}catch(P){p(P)}}function g(T){try{v(o.throw(T))}catch(P){p(P)}}function v(T){var P;T.done?h(T.value):(P=T.value,P instanceof n?P:new n(function(M){M(P)})).then(f,g)}v((o=o.apply(i,e||[])).next())})}function ae(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var An=hi;function hi(i,e){this.x=i,this.y=e}hi.prototype={clone:function(){return new hi(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,n=i.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),n=Math.sin(i),o=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=o,this},_rotateAround:function(i,e){var n=Math.cos(i),o=Math.sin(i),h=e.y+o*(this.x-e.x)+n*(this.y-e.y);
vendor: 8,008 bytes, line 7
7return this.x=e.x+n*(this.x-e.x)-o*(this.y-e.y),this.y=h,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},hi.convert=function(i){return i instanceof hi?i:Array.isArray(i)?new hi(i[0],i[1]):i};var bt=ae(An),ft=nr;function nr(i,e,n,o){this.cx=3*i,this.bx=3*(n-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=n,this.p2y=o}nr.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var n=i,o=0;o<8;o++){var h=this.sampleCurveX(n)-i;if(Math.abs(h)<e)return n;var p=this.sampleCurveDerivativeX(n);if(Math.abs(p)<1e-6)break;n-=h/p}var f=0,g=1;for(n=i,o=0;o<20&&(h=this.sampleCurveX(n),!(Math.abs(h-i)<e));o++)i>h?f=n:g=n,n=.5*(g-f)+f;return n},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Ni=ae(ft);let ke,rr;function sr(){return ke==null&&(ke=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ke}function vs(){if(rr==null&&(rr=!1,sr())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let o=0;o<5*5;o++){const h=4*o;e.fillStyle=`rgb(${h},${h+1},${h+2})`,e.fillRect(o%5,Math.floor(o/5),1,1)}const n=e.getImageData(0,0,5,5).data;for(let o=0;o<5*5*4;o++)if(o%4!=3&&n[o]!==o){rr=!0;break}}}return rr||!1}function ti(i,e,n,o){const h=new Ni(i,e,n,o);return p=>h.solve(p)}const js=ti(.25,.1,.25,1);function Vi(i,e,n){return Math.min(n,Math.max(e,i))}function gn(i,e,n){const o=n-e,h=((i-e)%o+o)%o+e;return h===e?n:h}function rn(i,...e){for(const n of e)for(const o in n)i[o]=n[o];return i}let qs=1;function yn(i,e,n){const o={};for(const h in i)o[h]=e.call(this,i[h],h,i);return o}function xs(i,e,n){const o={};for(const h in i)e.call(this,i[h],h,i)&&(o[h]=i[h]);return o}function le(i){return Array.isArray(i)?i.map(le):typeof i=="object"&&i?yn(i,le):i}const Li={};function Si(i){Li[i]||(typeof console<"u"&&console.warn(i),Li[i]=!0)}function ei(i,e,n){return(n.y-i.y)*(e.x-i.x)>(e.y-i.y)*(n.x-i.x)}function or(i){return typeof WorkerGlobalScope<"u"&&i!==void 0&&i instanceof WorkerGlobalScope}let fi=null;function Zi(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Tr(i,e,n,o,h){return m(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(i,{timestamp:0});try{const f=p?.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);const g=f.startsWith("BGR"),v=new Uint8ClampedArray(o*h*4);if(yield p.copyTo(v,function(T,P,M,k,D){const R=4*Math.max(-P,0),N=(Math.max(0,M)-M)*k*4+R,$=4*k,W=Math.max(0,P),at=Math.max(0,M);return{rect:{x:W,y:at,width:Math.min(T.width,P+k)-W,height:Math.min(T.height,M+D)-at},layout:[{offset:N,stride:$}]}}(i,e,n,o,h)),g)for(let T=0;T<v.length;T+=4){const P=v[T];v[T]=v[T+2],v[T+2]=P}return v}finally{p.close()}})}let Kt,Te;const Ge="AbortError";function ci(){return new Error(Ge)}const Fe={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ve(i){return Fe.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const ge="global-dispatcher";class oi extends Error{constructor(e,n,o,h){super(`AJAXError: ${n} (${e}): ${o}`),this.status=e,this.statusText=n,this.url=o,this.body=h}}const mi=()=>or(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Pr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const o=ve(i.url);if(o)return o(i,e);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:ge},e)}if(!(/^file:/.test(n=i.url)||/^file:/.test(mi())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(o,h){return m(this,void 0,void 0,function*(){const p=new Request(o.url,{method:o.method||"GET",body:o.body,credentials:o.credentials,headers:o.headers,cache:o.cache,referrer:mi(),signal:h.signal});o.type!=="json"||p.headers.has("Accept")||p.headers.set("Accept","application/json");const f=yield fetch(p);if(!f.ok){const T=yield f.blob();throw new oi(f.status,f.statusText,o.url,T)}let g;g=o.type==="arrayBuffer"||o.type==="image"?f.arrayBuffer():o.type==="json"?f.json():f.text();const v=yield g;if(h.signal.aborted)throw ci();return{data:v,cacheControl:f.headers.get("Cache-Control"),expires:f.headers.get("Expires")}})}(i,e);if(or(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:ge},e)}var n;return function(o,h){return new Promise((p,f)=>{var g;const v=new XMLHttpRequest;v.open(o.method||"GET",o.url,!0),o.type!=="arrayBuffer"&&o.type!=="image"||(v.responseType="arraybuffer");for(const T in o.headers)v.setRequestHeader(T,o.headers[T]);o.type==="json"&&(v.responseType="text",!((g=o.headers)===null||g===void 0)&&g.Accept||v.setRequestHeader("Accept","application/json")),v.withCredentials=o.credentials==="include",v.onerror=()=>{f(new Error(v.statusText))},v.onload=()=>{if(!h.signal.aborted)if((v.status>=200&&v.status<300||v.status===0)&&v.response!==null){let T=v.response;if(o.type==="json")try{T=JSON.parse(v.response)}catch(P){return void f(P)}p({data:T,cacheControl:v.getResponseHeader("Cache-Control"),expires:v.getResponseHeader("Expires")})}else{const T=new Blob([v.response],{type:v.getResponseHeader("Content-Type")});f(new oi(v.status,v.statusText,o.url,T))}},h.signal.addEventListener("abort",()=>{v.abort(),f(ci())}),v.send(o.body)})}(i,e)};function ar(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),n=window.location;return e.protocol===n.protocol&&e.host===n.host}function qr(i,e,n){n[i]&&n[i].indexOf(e)!==-1||(n[i]=n[i]||[],n[i].push(e))}function sn(i,e,n){if(n&&n[i]){const o=n[i].indexOf(e);o!==-1&&n[i].splice(o,1)}}class Vn{constructor(e,n={}){rn(this,n),this.type=e}}class Sr extends Vn{constructor(e,n={}){super("error",rn({error:e},n))}}class $r{on(e,n){return this._listeners=this._listeners||{},qr(e,n,this._listeners),this}off(e,n){return sn(e,n,this._listeners),sn(e,n,this._oneTimeListeners),this}once(e,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},qr(e,n,this._oneTimeListeners),this):new Promise(o=>this.once(e,o))}fire(e,n){typeof e=="string"&&(e=new Vn(e,n||{}));const o=e.type;if(this.listens(o)){e.target=this;const h=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const g of h)g.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const g of p)sn(o,g,this._oneTimeListeners),g.call(this,e);const f=this._eventedParent;f&&(rn(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(e))}else e instanceof Sr&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,n){return this._eventedParent=e,this._eventedParentData=n,this}}var ut={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection
vendor: 11,907 bytes, line 7
7"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 8,873 bytes, line 7
7,"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 9,830 bytes, line 7
7,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const
vendor: 97,969 bytes, lines 7-8
7lr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ir(i,e){const n={};for(const o in i)o!=="ref"&&(n[o]=i[o]);return lr.forEach(o=>{o in e&&(n[o]=e[o])}),n}function ze(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let n=0;n<i.length;n++)if(!ze(i[n],e[n]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const n in i)if(!ze(i[n],e[n]))return!1;return!0}return i===e}function He(i,e){i.push(e)}function Gr(i,e,n){He(n,{command:"addSource",args:[i,e[i]]})}function hr(i,e,n){He(e,{command:"removeSource",args:[i]}),n[i]=!0}function Zn(i,e,n,o){hr(i,n,o),Gr(i,e,n)}function bs(i,e,n){let o;for(o in i[n])if(Object.prototype.hasOwnProperty.call(i[n],o)&&o!=="data"&&!ze(i[n][o],e[n][o]))return!1;for(o in e[n])if(Object.prototype.hasOwnProperty.call(e[n],o)&&o!=="data"&&!ze(i[n][o],e[n][o]))return!1;return!0}function vn(i,e,n,o,h,p){i=i||{},e=e||{};for(const f in i)Object.prototype.hasOwnProperty.call(i,f)&&(ze(i[f],e[f])||n.push({command:p,args:[o,f,e[f],h]}));for(const f in e)Object.prototype.hasOwnProperty.call(e,f)&&!Object.prototype.hasOwnProperty.call(i,f)&&(ze(i[f],e[f])||n.push({command:p,args:[o,f,e[f],h]}))}function Hr(i){return i.id}function ws(i,e){return i[e.id]=e,i}class Pt{constructor(e,n,o,h){this.message=(e?`${e}: `:"")+o,h&&(this.identifier=h),n!=null&&n.__line__&&(this.line=n.__line__)}}function Un(i,...e){for(const n of e)for(const o in n)i[o]=n[o];return i}class Ii extends Error{constructor(e,n){super(n),this.message=n,this.key=e}}class kn{constructor(e,n=[]){this.parent=e,this.bindings={};for(const[o,h]of n)this.bindings[o]=h}concat(e){return new kn(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Mr={kind:"null"},St={kind:"number"},se={kind:"string"},Xt={kind:"boolean"},Ui={kind:"color"},Di={kind:"object"},ie={kind:"value"},jn={kind:"collator"},qn={kind:"formatted"},cr={kind:"padding"},zn={kind:"resolvedImage"},H={kind:"variableAnchorOffsetCollection"};function E(i,e){return{kind:"array",itemType:i,N:e}}function z(i){if(i.kind==="array"){const e=z(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const V=[Mr,St,se,Xt,Ui,qn,Di,E(ie),cr,zn,H];function q(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!q(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const n of V)if(!q(n,e))return null}}return`Expected ${z(i)} but found ${z(e)} instead.`}function tt(i,e){return e.some(n=>n.kind===i.kind)}function it(i,e){return e.some(n=>n==="null"?i===null:n==="array"?Array.isArray(i):n==="object"?i&&!Array.isArray(i)&&typeof i=="object":n===typeof i)}function ot(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const Y=.96422,_t=.82521,vt=4/29,ct=6/29,dt=3*ct*ct,jt=ct*ct*ct,Gt=Math.PI/180,Pe=180/Math.PI;function ne(i){return(i%=360)<0&&(i+=360),i}function xe([i,e,n,o]){let h,p;const f=je((.2225045*(i=me(i))+.7168786*(e=me(e))+.0606169*(n=me(n)))/1);i===e&&e===n?h=p=f:(h=je((.4360747*i+.3850649*e+.1430804*n)/Y),p=je((.0139322*i+.0971045*e+.7141733*n)/_t));const g=116*f-16;return[g<0?0:g,500*(h-f),200*(f-p),o]}function me(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function je(i){return i>jt?Math.pow(i,1/3):i/dt+vt}function We([i,e,n,o]){let h=(i+16)/116,p=isNaN(e)?h:h+e/500,f=isNaN(n)?h:h-n/200;return h=1*De(h),p=Y*De(p),f=_t*De(f),[he(3.1338561*p-1.6168667*h-.4906146*f),he(-.9787684*p+1.9161415*h+.033454*f),he(.0719453*p-.2289914*h+1.4052427*f),o]}function he(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function De(i){return i>ct?i*i*i:dt*(i-vt)}function qe(i){return parseInt(i.padEnd(2,i),16)/255}function _i(i,e){return gi(e?i/100:i,0,1)}function gi(i,e,n){return Math.min(Math.max(e,i),n)}function Bi(i){return!i.some(Number.isNaN)}const ur={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Be{constructor(e,n,o,h=1,p=!0){this.r=e,this.g=n,this.b=o,this.a=h,p||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[e,n,o,h]))}static parse(e){if(e instanceof Be)return e;if(typeof e!="string")return;const n=function(o){if((o=o.toLowerCase().trim())==="transparent")return[0,0,0,0];const h=ur[o];if(h){const[f,g,v]=h;return[f/255,g/255,v/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){const f=o.length<6?1:2;let g=1;return[qe(o.slice(g,g+=f)),qe(o.slice(g,g+=f)),qe(o.slice(g,g+=f)),qe(o.slice(g,g+f)||"ff")]}if(o.startsWith("rgb")){const f=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[g,v,T,P,M,k,D,R,N,$,W,at]=f,et=[P||" ",D||" ",$].join("");if(et===" "||et===" /"||et===",,"||et===",,,"){const st=[T,k,N].join(""),mt=st==="%%%"?100:st===""?255:0;if(mt){const wt=[gi(+v/mt,0,1),gi(+M/mt,0,1),gi(+R/mt,0,1),W?_i(+W,at):1];if(Bi(wt))return wt}}return}}const p=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,g,v,T,P,M,k,D,R]=p,N=[v||" ",P||" ",k].join("");if(N===" "||N===" /"||N===",,"||N===",,,"){const $=[+g,gi(+T,0,100),gi(+M,0,100),D?_i(+D,R):1];if(Bi($))return function([W,at,et,st]){function mt(wt){const Dt=(wt+W/30)%12,Ht=at*Math.min(et,1-et);return et-Ht*Math.max(-1,Math.min(Dt-3,9-Dt,1))}return W=ne(W),at/=100,et/=100,[mt(0),mt(8),mt(4),st]}($)}}}(e);return n?new Be(...n,!1):void 0}get rgb(){const{r:e,g:n,b:o,a:h}=this,p=h||1/0;return this.overwriteGetter("rgb",[e/p,n/p,o/p,h])}get hcl(){return this.overwriteGetter("hcl",function(e){const[n,o,h,p]=xe(e),f=Math.sqrt(o*o+h*h);return[Math.round(1e4*f)?ne(Math.atan2(h,o)*Pe):NaN,f,n,p]}(this.rgb))}get lab(){return this.overwriteGetter("lab",xe(this.rgb))}overwriteGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}toString(){const[e,n,o,h]=this.rgb;return`rgba(${[e,n,o].map(p=>Math.round(255*p)).join(",")},${h})`}}Be.black=new Be(0,0,0,1),Be.white=new Be(1,1,1,1),Be.transparent=new Be(0,0,0,0),Be.red=new Be(1,0,0,1);class Go{constructor(e,n,o){this.sensitivity=e?n?"variant":"case":n?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,n){return this.collator.compare(e,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ho{constructor(e,n,o,h,p){this.text=e,this.image=n,this.scale=o,this.fontStack=h,this.textColor=p}}class on{constructor(e){this.sections=e}static fromString(e){return new on([new Ho(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof on?e:on.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class an{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof an)return e;if(typeof e=="number")return new an([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const n of e)if(typeof n!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new an(e)}}toString(){return JSON.stringify(this.values)}}const Wo=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Mi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Mi)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let n=0;n<e.length;n+=2){const o=e[n],h=e[n+1];if(typeof o!="string"||!Wo.has(o)||!Array.isArray(h)||h.length!==2||typeof h[0]!="number"||typeof h[1]!="number")return}return new Mi(e)}}toString(){return JSON.stringify(this.values)}}class ji{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ji({name:e,available:!1}):null}}function Wr(i,e,n,o){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof n=="number"&&n>=0&&n<=255?o===void 0||typeof o=="number"&&o>=0&&o<=1?null:`Invalid rgba value [${[i,e,n,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof o=="number"?[i,e,n,o]:[i,e,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function En(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Be||i instanceof Go||i instanceof on||i instanceof an||i instanceof Mi||i instanceof ji)return!0;if(Array.isArray(i)){for(const e of i)if(!En(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!En(i[e]))return!1;return!0}return!1}function Jt(i){if(i===null)return Mr;if(typeof i=="string")return se;if(typeof i=="boolean")return Xt;if(typeof i=="number")return St;if(i instanceof Be)return Ui;if(i instanceof Go)return jn;if(i instanceof on)return qn;if(i instanceof an)return cr;if(i instanceof Mi)return H;if(i instanceof ji)return zn;if(Array.isArray(i)){const e=i.length;let n;for(const o of i){const h=Jt(o);if(n){if(n===h)continue;n=ie;break}n=h}return E(n||ie,e)}return Di}function Oe(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Be||i instanceof on||i instanceof an||i instanceof Mi||i instanceof ji?i.toString():JSON.stringify(i)}class qi{constructor(e,n){this.type=e,this.value=n}static parse(e,n){if(e.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!En(e[1]))return n.error("invalid value");const o=e[1];let h=Jt(o);const p=n.expectedType;return h.kind!=="array"||h.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(h=p),new qi(h,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ze{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const dr={string:se,number:St,boolean:Xt,object:Di};class ln{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");let o,h=1;const p=e[0];if(p==="array"){let g,v;if(e.length>2){const T=e[1];if(typeof T!="string"||!(T in dr)||T==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);g=dr[T],h++}else g=ie;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return n.error('The length argument to "array" must be a positive integer literal',2);v=e[2],h++}o=E(g,v)}else{if(!dr[p])throw new Error(`Types doesn't contain name = ${p}`);o=dr[p]}const f=[];for(;h<e.length;h++){const g=n.parse(e[h],h,ie);if(!g)return null;f.push(g)}return new ln(o,f)}evaluate(e){for(let n=0;n<this.args.length;n++){const o=this.args[n].evaluate(e);if(!q(this.type,Jt(o)))return o;if(n===this.args.length-1)throw new Ze(`Expected value to be of type ${z(this.type)}, but found ${z(Jt(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ce={"to-boolean":Xt,"to-color":Ui,"to-number":St,"to-string":se};class Le{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");const o=e[0];if(!ce[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if((o==="to-boolean"||o==="to-string")&&e.length!==2)return n.error("Expected one argument.");const h=ce[o],p=[];for(let f=1;f<e.length;f++){const g=n.parse(e[f],f,ie);if(!g)return null;p.push(g)}return new Le(h,p)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let n,o;for(const h of this.args){if(n=h.evaluate(e),o=null,n instanceof Be)return n;if(typeof n=="string"){const p=e.parseColor(n);if(p)return p}else if(Array.isArray(n)&&(o=n.length<3||n.length>4?`Invalid rbga value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:Wr(n[0],n[1],n[2],n[3]),!o))return new Be(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Ze(o||`Could not parse color from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"padding":{let n;for(const o of this.args){n=o.evaluate(e);const h=an.parse(n);if(h)return h}throw new Ze(`Could not parse padding from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(const o of this.args){n=o.evaluate(e);const h=Mi.parse(n);if(h)return h}throw new Ze(`Could not parse variableAnchorOffsetCollection from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(const o of this.args){if(n=o.evaluate(e),n===null)return 0;const h=Number(n);if(!isNaN(h))return h}throw new Ze(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return on.fromString(Oe(this.args[0].evaluate(e)));case"resolvedImage":return ji.fromString(Oe(this.args[0].evaluate(e)));default:return Oe(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Xo=["Unknown","Point","LineString","Polygon"];class Xr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Xo[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let n=this._parseColorCache[e];return n||(n=this._parseColorCache[e]=Be.parse(e)),n}}class yi{constructor(e,n,o=[],h,p=new kn,f=[]){this.registry=e,this.path=o,this.key=o.map(g=>`[${g}]`).join(""),this.scope=p,this.errors=f,this.expectedType=h,this._isConstant=n}parse(e,n,o,h,p={}){return n?this.concat(n,o,h)._parse(e,p):this._parse(e,p)}_parse(e,n){function o(h,p,f){return f==="assert"?new ln(p,[h]):f==="coerce"?new Le(p,[h]):h}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const h=e[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[h];if(p){let f=p.parse(e,this);if(!f)return null;if(this.expectedType){const g=this.expectedType,v=f.type;if(g.kind!=="string"&&g.kind!=="number"&&g.kind!=="boolean"&&g.kind!=="object"&&g.kind!=="array"||v.kind!=="value")if(g.kind!=="color"&&g.kind!=="formatted"&&g.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string")if(g.kind!=="padding"||v.kind!=="value"&&v.kind!=="number"&&v.kind!=="array")if(g.kind!=="variableAnchorOffsetCollection"||v.kind!=="value"&&v.kind!=="array"){if(this.checkSubtype(g,v))return null}else f=o(f,g,n.typeAnnotation||"coerce");else f=o(f,g,n.typeAnnotation||"coerce");else f=o(f,g,n.typeAnnotation||"coerce");else f=o(f,g,n.typeAnnotation||"assert")}if(!(f instanceof qi)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){const g=new Xr;try{f=new qi(f.type,f.evaluate(g))}catch(v){return this.error(v.message),null}}return f}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,n,o){const h=typeof e=="number"?this.path.concat(e):this.path,p=o?this.scope.concat(o):this.scope;return new yi(this.registry,this._isConstant,h,n||null,p,this.errors)}error(e,...n){const o=`${this.key}${n.map(h=>`[${h}]`).join("")}`;this.errors.push(new Ii(o,e))}checkSubtype(e,n){const o=q(e,n);return o&&this.error(o),o}}class Cr{constructor(e,n){this.type=n.type,this.bindings=[].concat(e),this.result=n}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const n of this.bindings)e(n[1]);e(this.result)}static parse(e,n){if(e.length<4)return n.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let p=1;p<e.length-1;p+=2){const f=e[p];if(typeof f!="string")return n.error(`Expected string, but found ${typeof f} instead.`,p);if(/[^a-zA-Z0-9_]/.test(f))return n.error("Variable names must contain only alphanumeric characters or '_'.",p);const g=n.parse(e[p+1],p+1);if(!g)return null;o.push([f,g])}const h=n.parse(e[e.length-1],e.length-1,n.expectedType,o);return h?new Cr(o,h):null}outputDefined(){return this.result.outputDefined()}}class Se{constructor(e,n){this.type=n.type,this.name=e,this.boundExpression=n}static parse(e,n){if(e.length!==2||typeof e[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");const o=e[1];return n.scope.has(o)?new Se(o,n.scope.get(o)):n.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class pr{constructor(e,n,o){this.type=e,this.index=n,this.input=o}static parse(e,n){if(e.length!==3)return n.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=n.parse(e[1],1,St),h=n.parse(e[2],2,E(n.expectedType||ie));return o&&h?new pr(h.type.itemType,o,h):null}evaluate(e){const n=this.index.evaluate(e),o=this.input.evaluate(e);if(n<0)throw new Ze(`Array index out of bounds: ${n} < 0.`);if(n>=o.length)throw new Ze(`Array index out of bounds: ${n} > ${o.length-1}.`);if(n!==Math.floor(n))throw new Ze(`Array index must be an integer, but found ${n} instead.`);return o[n]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class ni{constructor(e,n){this.type=Xt,this.needle=e,this.haystack=n}static parse(e,n){if(e.length!==3)return n.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=n.parse(e[1],1,ie),h=n.parse(e[2],2,ie);return o&&h?tt(o.type,[Xt,se,St,Mr,ie])?new ni(o,h):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${z(o.type)} instead`):null}evaluate(e){const n=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!it(n,["boolean","string","number","null"]))throw new Ze(`Expected first argument to be of type boolean, string, number or null, but found ${z(Jt(n))} instead.`);if(!it(o,["string","array"]))throw new Ze(`Expected second argument to be of type array or string, but found ${z(Jt(o))} instead.`);return o.indexOf(n)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class xn{constructor(e,n,o){this.type=St,this.needle=e,this.haystack=n,this.fromIndex=o}static parse(e,n){if(e.length<=2||e.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=n.parse(e[1],1,ie),h=n.parse(e[2],2,ie);if(!o||!h)return null;if(!tt(o.type,[Xt,se,St,Mr,ie]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${z(o.type)} instead`);if(e.length===4){const p=n.parse(e[3],3,St);return p?new xn(o,h,p):null}return new xn(o,h)}evaluate(e){const n=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!it(n,["boolean","string","number","null"]))throw new Ze(`Expected first argument to be of type boolean, string, number or null, but found ${z(Jt(n))} instead.`);let h;if(this.fromIndex&&(h=this.fromIndex.evaluate(e)),it(o,["string"])){const p=o.indexOf(n,h);return p===-1?-1:[...o.slice(0,p)].length}if(it(o,["array"]))return o.indexOf(n,h);throw new Ze(`Expected second argument to be of type array or string, but found ${z(Jt(o))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Kr{constructor(e,n,o,h,p,f){this.inputType=e,this.type=n,this.input=o,this.cases=h,this.outputs=p,this.otherwise=f}static parse(e,n){if(e.length<5)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return n.error("Expected an even number of arguments.");let o,h;n.expectedType&&n.expectedType.kind!=="value"&&(h=n.expectedType);const p={},f=[];for(let T=2;T<e.length-1;T+=2){let P=e[T];const M=e[T+1];Array.isArray(P)||(P=[P]);const k=n.concat(T);if(P.length===0)return k.error("Expected at least one branch label.");for(const R of P){if(typeof R!="number"&&typeof R!="string")return k.error("Branch labels must be numbers or strings.");if(typeof R=="number"&&Math.abs(R)>Number.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return k.error("Numeric branch labels must be integer values.");if(o){if(k.checkSubtype(o,Jt(R)))return null}else o=Jt(R);if(p[String(R)]!==void 0)return k.error("Branch labels must be unique.");p[String(R)]=f.length}const D=n.parse(M,T,h);if(!D)return null;h=h||D.type,f.push(D)}const g=n.parse(e[1],1,ie);if(!g)return null;const v=n.parse(e[e.length-1],e.length-1,h);return v?g.type.kind!=="value"&&n.concat(1).checkSubtype(o,g.type)?null:new Kr(o,h,g,p,f,v):null}evaluate(e){const n=this.input.evaluate(e);return(Jt(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Ar{constructor(e,n,o){this.type=e,this.branches=n,this.otherwise=o}static parse(e,n){if(e.length<4)return n.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return n.error("Expected an odd number of arguments.");let o;n.expectedType&&n.expectedType.kind!=="value"&&(o=n.expectedType);const h=[];for(let f=1;f<e.length-1;f+=2){const g=n.parse(e[f],f,Xt);if(!g)return null;const v=n.parse(e[f+1],f+1,o);if(!v)return null;h.push([g,v]),o=o||v.type}const p=n.parse(e[e.length-1],e.length-1,o);if(!p)return null;if(!o)throw new Error("Can't infer output type");return new Ar(o,h,p)}evaluate(e){for(const[n,o]of this.branches)if(n.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[n,o]of this.branches)e(n),e(o);e(this.otherwise)}outputDefined(){return this.branches.every(([e,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class Jr{constructor(e,n,o,h){this.type=e,this.input=n,this.beginIndex=o,this.endIndex=h}static parse(e,n){if(e.length<=2||e.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=n.parse(e[1],1,ie),h=n.parse(e[2],2,St);if(!o||!h)return null;if(!tt(o.type,[E(ie),se,ie]))return n.error(`Expected first argument to be of type array or string, but found ${z(o.type)} instead`);if(e.length===4){const p=n.parse(e[3],3,St);return p?new Jr(o.type,o,h,p):null}return new Jr(o.type,o,h)}evaluate(e){const n=this.input.evaluate(e),o=this.beginIndex.evaluate(e);let h;if(this.endIndex&&(h=this.endIndex.evaluate(e)),it(n,["string"]))return[...n].slice(o,h).join("");if(it(n,["array"]))return n.slice(o,h);throw new Ze(`Expected first argument to be of type array or string, but found ${z(Jt(n))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function kr(i,e){const n=i.length-1;let o,h,p=0,f=n,g=0;for(;p<=f;)if(g=Math.floor((p+f)/2),o=i[g],h=i[g+1],o<=e){if(g===n||e<h)return g;p=g+1}else{if(!(o>e))throw new Ze("Input is not a number.");f=g-1}return 0}class zr{constructor(e,n,o){this.type=e,this.input=n,this.labels=[],this.outputs=[];for(const[h,p]of o)this.labels.push(h),this.outputs.push(p)}static parse(e,n){if(e.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");const o=n.parse(e[1],1,St);if(!o)return null;const h=[];let p=null;n.expectedType&&n.expectedType.kind!=="value"&&(p=n.expectedType);for(let f=1;f<e.length;f+=2){const g=f===1?-1/0:e[f],v=e[f+1],T=f,P=f+1;if(typeof g!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',T);if(h.length&&h[h.length-1][0]>=g)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',T);const M=n.parse(v,P,p);if(!M)return null;p=p||M.type,h.push([g,M])}return new zr(p,o,h)}evaluate(e){const n=this.labels,o=this.outputs;if(n.length===1)return o[0].evaluate(e);const h=this.input.evaluate(e);if(h<=n[0])return o[0].evaluate(e);const p=n.length;return h>=n[p-1]?o[p-1].evaluate(e):o[kr(n,h)].evaluate(e)}eachChild(e){e(this.input);for(const n of this.outputs)e(n)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function lo(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ho=co;function co(i,e,n,o){this.cx=3*i,this.bx=3*(n-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=n,this.p2y=o}co.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var n=i,o=0;o<8;o++){var h=this.sampleCurveX(n)-i;if(Math.abs(h)<e)return n;var p=this.sampleCurveDerivativeX(n);if(Math.abs(p)<1e-6)break;n-=h/p}var f=0,g=1;for(n=i,o=0;o<20&&(h=this.sampleCurveX(n),!(Math.abs(h-i)<e));o++)i>h?f=n:g=n,n=.5*(g-f)+f;return n},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Ko=lo(ho);function $n(i,e,n){return i+n*(e-i)}function Ts(i,e,n){return i.map((o,h)=>$n(o,e[h],n))}const Ci={number:$n,color:function(i,e,n,o="rgb"){switch(o){case"rgb":{const[h,p,f,g]=Ts(i.rgb,e.rgb,n);return new Be(h,p,f,g,!1)}case"hcl":{const[h,p,f,g]=i.hcl,[v,T,P,M]=e.hcl;let k,D;if(isNaN(h)||isNaN(v))isNaN(h)?isNaN(v)?k=NaN:(k=v,f!==1&&f!==0||(D=T)):(k=h,P!==1&&P!==0||(D=p));else{let at=v-h;v>h&&at>180?at-=360:v<h&&h-v>180&&(at+=360),k=h+n*at}const[R,N,$,W]=function([at,et,st,mt]){return at=isNaN(at)?0:at*Gt,We([st,Math.cos(at)*et,Math.sin(at)*et,mt])}([k,D??$n(p,T,n),$n(f,P,n),$n(g,M,n)]);return new Be(R,N,$,W,!1)}case"lab":{const[h,p,f,g]=We(Ts(i.lab,e.lab,n));return new Be(h,p,f,g,!1)}}},array:Ts,padding:function(i,e,n){return new an(Ts(i.values,e.values,n))},variableAnchorOffsetCollection:function(i,e,n){const o=i.values,h=e.values;if(o.length!==h.length)throw new Ze(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const p=[];for(let f=0;f<o.length;f+=2){if(o[f]!==h[f])throw new Ze(`Cannot interpolate values containing mismatched anchors. from[${f}]: ${o[f]}, to[${f}]: ${h[f]}`);p.push(o[f]);const[g,v]=o[f+1],[T,P]=h[f+1];p.push([$n(g,T,n),$n(v,P,n)])}return new Mi(p)}};class $i{constructor(e,n,o,h,p){this.type=e,this.operator=n,this.interpolation=o,this.input=h,this.labels=[],this.outputs=[];for(const[f,g]of p)this.labels.push(f),this.outputs.push(g)}static interpolationFactor(e,n,o,h){let p=0;if(e.name==="exponential")p=oe(n,e.base,o,h);else if(e.name==="linear")p=oe(n,1,o,h);else if(e.name==="cubic-bezier"){const f=e.controlPoints;p=new Ko(f[0],f[1],f[2],f[3]).solve(oe(n,1,o,h))}return p}static parse(e,n){let[o,h,p,...f]=e;if(!Array.isArray(h)||h.length===0)return n.error("Expected an interpolation type expression.",1);if(h[0]==="linear")h={name:"linear"};else if(h[0]==="exponential"){const T=h[1];if(typeof T!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);h={name:"exponential",base:T}}else{if(h[0]!=="cubic-bezier")return n.error(`Unknown interpolation type ${String(h[0])}`,1,0);{const T=h.slice(1);if(T.length!==4||T.some(P=>typeof P!="number"||P<0||P>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:T}}}if(e.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(p=n.parse(p,2,St),!p)return null;const g=[];let v=null;o==="interpolate-hcl"||o==="interpolate-lab"?v=Ui:n.expectedType&&n.expectedType.kind!=="value"&&(v=n.expectedType);for(let T=0;T<f.length;T+=2){const P=f[T],M=f[T+1],k=T+3,D=T+4;if(typeof P!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(g.length&&g[g.length-1][0]>=P)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);const R=n.parse(M,D,v);if(!R)return null;v=v||R.type,g.push([P,R])}return ot(v,St)||ot(v,Ui)||ot(v,cr)||ot(v,H)||ot(v,E(St))?new $i(v,o,h,p,g):n.error(`Type ${z(v)} is not interpolatable.`)}evaluate(e){const n=this.labels,o=this.outputs;if(n.length===1)return o[0].evaluate(e);const h=this.input.evaluate(e);if(h<=n[0])return o[0].evaluate(e);const p=n.length;if(h>=n[p-1])return o[p-1].evaluate(e);const f=kr(n,h),g=$i.interpolationFactor(this.interpolation,h,n[f],n[f+1]),v=o[f].evaluate(e),T=o[f+1].evaluate(e);switch(this.operator){case"interpolate":return Ci[this.type.kind](v,T,g);case"interpolate-hcl":return Ci.color(v,T,g,"hcl");case"interpolate-lab":return Ci.color(v,T,g,"lab")}}eachChild(e){e(this.input);for(const n of this.outputs)e(n)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function oe(i,e,n,o){const h=o-n,p=i-n;return h===0?0:e===1?p/h:(Math.pow(e,p)-1)/(Math.pow(e,h)-1)}class hn{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expectected at least one argument.");let o=null;const h=n.expectedType;h&&h.kind!=="value"&&(o=h);const p=[];for(const g of e.slice(1)){const v=n.parse(g,1+p.length,o,void 0,{typeAnnotation:"omit"});if(!v)return null;o=o||v.type,p.push(v)}if(!o)throw new Error("No output type");const f=h&&p.some(g=>q(h,g.type));return new hn(f?ie:o,p)}evaluate(e){let n,o=null,h=0;for(const p of this.args)if(h++,o=p.evaluate(e),o&&o instanceof ji&&!o.available&&(n||(n=o.name),o=null,h===this.args.length&&(o=n)),o!==null)break;return o}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Re(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Jo(i,e,n,o){return o.compare(e,n)===0}function Er(i,e,n){const o=i!=="=="&&i!=="!=";return class Zu{constructor(p,f,g){this.type=Xt,this.lhs=p,this.rhs=f,this.collator=g,this.hasUntypedArgument=p.type.kind==="value"||f.type.kind==="value"}static parse(p,f){if(p.length!==3&&p.length!==4)return f.error("Expected two or three arguments.");const g=p[0];let v=f.parse(p[1],1,ie);if(!v)return null;if(!Re(g,v.type))return f.concat(1).error(`"${g}" comparisons are not supported for type '${z(v.type)}'.`);let T=f.parse(p[2],2,ie);if(!T)return null;if(!Re(g,T.type))return f.concat(2).error(`"${g}" comparisons are not supported for type '${z(T.type)}'.`);if(v.type.kind!==T.type.kind&&v.type.kind!=="value"&&T.type.kind!=="value")return f.error(`Cannot compare types '${z(v.type)}' and '${z(T.type)}'.`);o&&(v.type.kind==="value"&&T.type.kind!=="value"?v=new ln(T.type,[v]):v.type.kind!=="value"&&T.type.kind==="value"&&(T=new ln(v.type,[T])));let P=null;if(p.length===4){if(v.type.kind!=="string"&&T.type.kind!=="string"&&v.type.kind!=="value"&&T.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(P=f.parse(p[3],3,jn),!P)return null}return new Zu(v,T,P)}evaluate(p){const f=this.lhs.evaluate(p),g=this.rhs.evaluate(p);if(o&&this.hasUntypedArgument){const v=Jt(f),T=Jt(g);if(v.kind!==T.kind||v.kind!=="string"&&v.kind!=="number")throw new Ze(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${v.kind}, ${T.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const v=Jt(f),T=Jt(g);if(v.kind!=="string"||T.kind!=="string")return e(p,f,g)}return this.collator?n(p,f,g,this.collator.evaluate(p)):e(p,f,g)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const Yo=Er("==",function(i,e,n){return e===n},Jo),uo=Er("!=",function(i,e,n){return e!==n},function(i,e,n,o){return!Jo(0,e,n,o)}),Lr=Er("<",function(i,e,n){return e<n},function(i,e,n,o){return o.compare(e,n)<0}),Qo=Er(">",function(i,e,n){return e>n},function(i,e,n,o){return o.compare(e,n)>0}),$s=Er("<=",function(i,e,n){return e<=n},function(i,e,n,o){return o.compare(e,n)<=0}),vi=Er(">=",function(i,e,n){return e>=n},function(i,e,n,o){return o.compare(e,n)>=0});class Ln{constructor(e,n,o){this.type=jn,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=n}static parse(e,n){if(e.length!==2)return n.error("Expected one argument.");const o=e[1];if(typeof o!="object"||Array.isArray(o))return n.error("Collator options argument must be an object.");const h=n.parse(o["case-sensitive"]!==void 0&&o["case-sensitive"],1,Xt);if(!h)return null;const p=n.parse(o["diacritic-sensitive"]!==void 0&&o["diacritic-sensitive"],1,Xt);if(!p)return null;let f=null;return o.locale&&(f=n.parse(o.locale,1,se),!f)?null:new Ln(h,p,f)}evaluate(e){return new Go(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class po{constructor(e,n,o,h,p){this.type=se,this.number=e,this.locale=n,this.currency=o,this.minFractionDigits=h,this.maxFractionDigits=p}static parse(e,n){if(e.length!==3)return n.error("Expected two arguments.");const o=n.parse(e[1],1,St);if(!o)return null;const h=e[2];if(typeof h!="object"||Array.isArray(h))return n.error("NumberFormat options argument must be an object.");let p=null;if(h.locale&&(p=n.parse(h.locale,1,se),!p))return null;let f=null;if(h.currency&&(f=n.parse(h.currency,1,se),!f))return null;let g=null;if(h["min-fraction-digits"]&&(g=n.parse(h["min-fraction-digits"],1,St),!g))return null;let v=null;return h["max-fraction-digits"]&&(v=n.parse(h["max-fraction-digits"],1,St),!v)?null:new po(o,p,f,g,v)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Gs{constructor(e){this.type=qn,this.sections=e}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&typeof o=="object")return n.error("First argument must be an image or text section.");const h=[];let p=!1;for(let f=1;f<=e.length-1;++f){const g=e[f];if(p&&typeof g=="object"&&!Array.isArray(g)){p=!1;let v=null;if(g["font-scale"]&&(v=n.parse(g["font-scale"],1,St),!v))return null;let T=null;if(g["text-font"]&&(T=n.parse(g["text-font"],1,E(se)),!T))return null;let P=null;if(g["text-color"]&&(P=n.parse(g["text-color"],1,Ui),!P))return null;const M=h[h.length-1];M.scale=v,M.font=T,M.textColor=P}else{const v=n.parse(e[f],1,ie);if(!v)return null;const T=v.type.kind;if(T!=="string"&&T!=="value"&&T!=="null"&&T!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,h.push({content:v,scale:null,font:null,textColor:null})}}return new Gs(h)}evaluate(e){return new on(this.sections.map(n=>{const o=n.content.evaluate(e);return Jt(o)===zn?new Ho("",o,null,null,null):new Ho(Oe(o),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)}))}eachChild(e){for(const n of this.sections)e(n.content),n.scale&&e(n.scale),n.font&&e(n.font),n.textColor&&e(n.textColor)}outputDefined(){return!1}}class ta{constructor(e){this.type=zn,this.input=e}static parse(e,n){if(e.length!==2)return n.error("Expected two arguments.");const o=n.parse(e[1],1,se);return o?new ta(o):n.error("No image name provided.")}evaluate(e){const n=this.input.evaluate(e),o=ji.fromString(n);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(n)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class fo{constructor(e){this.type=St,this.input=e}static parse(e,n){if(e.length!==2)return n.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=n.parse(e[1],1);return o?o.type.kind!=="array"&&o.type.kind!=="string"&&o.type.kind!=="value"?n.error(`Expected argument of type string or array, but found ${z(o.type)} instead.`):new fo(o):null}evaluate(e){const n=this.input.evaluate(e);if(typeof n=="string")return[...n].length;if(Array.isArray(n))return n.length;throw new Ze(`Expected value to be of type string or array, but found ${z(Jt(n))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const bn=8192;function hl(i,e){const n=(180+i[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,h=Math.pow(2,e.z);return[Math.round(n*h*bn),Math.round(o*h*bn)]}function mo(i,e){const n=Math.pow(2,e.z);return[(h=(i[0]/bn+e.x)/n,360*h-180),(o=(i[1]/bn+e.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90)];var o,h}function _e(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function Dr(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function ue(i,e,n){const o=i[0]-e[0],h=i[1]-e[1],p=i[0]-n[0],f=i[1]-n[1];return o*f-p*h==0&&o*p<=0&&h*f<=0}function Br(i,e,n,o){return(h=[o[0]-n[0],o[1]-n[1]])[0]*(p=[e[0]-i[0],e[1]-i[1]])[1]-h[1]*p[0]!=0&&!(!Ea(i,e,n,o)||!Ea(n,o,i,e));var h,p}function Aa(i,e,n){for(const o of n)for(let h=0;h<o.length-1;++h)if(Br(i,e,o[h],o[h+1]))return!0;return!1}function Ps(i,e,n=!1){let o=!1;for(const g of e)for(let v=0;v<g.length-1;v++){if(ue(i,g[v],g[v+1]))return n;(p=g[v])[1]>(h=i)[1]!=(f=g[v+1])[1]>h[1]&&h[0]<(f[0]-p[0])*(h[1]-p[1])/(f[1]-p[1])+p[0]&&(o=!o)}var h,p,f;return o}function ea(i,e){for(const n of e)if(Ps(i,n))return!0;return!1}function ka(i,e){for(const n of i)if(!Ps(n,e))return!1;for(let n=0;n<i.length-1;++n)if(Aa(i[n],i[n+1],e))return!1;return!0}function za(i,e){for(const n of e)if(ka(i,n))return!0;return!1}function Ea(i,e,n,o){const h=o[0]-n[0],p=o[1]-n[1],f=(i[0]-n[0])*p-h*(i[1]-n[1]),g=(e[0]-n[0])*p-h*(e[1]-n[1]);return f>0&&g<0||f<0&&g>0}function ia(i,e,n){const o=[];for(let h=0;h<i.length;h++){const p=[];for(let f=0;f<i[h].length;f++){const g=hl(i[h][f],n);_e(e,g),p.push(g)}o.push(p)}return o}function _o(i,e,n){const o=[];for(let h=0;h<i.length;h++){const p=ia(i[h],e,n);o.push(p)}return o}function La(i,e,n,o){if(i[0]<n[0]||i[0]>n[2]){const h=.5*o;let p=i[0]-n[0]>h?-o:n[0]-i[0]>h?o:0;p===0&&(p=i[0]-n[2]>h?-o:n[2]-i[0]>h?o:0),i[0]+=p}_e(e,i)}function Dn(i,e,n,o){const h=Math.pow(2,o.z)*bn,p=[o.x*bn,o.y*bn],f=[];for(const g of i)for(const v of g){const T=[v.x+p[0],v.y+p[1]];La(T,e,n,h),f.push(T)}return f}function Da(i,e,n,o){const h=Math.pow(2,o.z)*bn,p=[o.x*bn,o.y*bn],f=[];for(const v of i){const T=[];for(const P of v){const M=[P.x+p[0],P.y+p[1]];_e(e,M),T.push(M)}f.push(T)}if(e[2]-e[0]<=h/2){(g=e)[0]=g[1]=1/0,g[2]=g[3]=-1/0;for(const v of f)for(const T of v)La(T,e,n,h)}var g;return f}class Rr{constructor(e,n){this.type=Xt,this.geojson=e,this.geometries=n}static parse(e,n){if(e.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(En(e[1])){const o=e[1];if(o.type==="FeatureCollection"){const h=[];for(const p of o.features){const{type:f,coordinates:g}=p.geometry;f==="Polygon"&&h.push(g),f==="MultiPolygon"&&h.push(...g)}if(h.length)return new Rr(o,{type:"MultiPolygon",coordinates:h})}else if(o.type==="Feature"){const h=o.geometry.type;if(h==="Polygon"||h==="MultiPolygon")return new Rr(o,o.geometry)}else if(o.type==="Polygon"||o.type==="MultiPolygon")return new Rr(o,o)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(n,o){const h=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],f=n.canonicalID();if(o.type==="Polygon"){const g=ia(o.coordinates,p,f),v=Dn(n.geometry(),h,p,f);if(!Dr(h,p))return!1;for(const T of v)if(!Ps(T,g))return!1}if(o.type==="MultiPolygon"){const g=_o(o.coordinates,p,f),v=Dn(n.geometry(),h,p,f);if(!Dr(h,p))return!1;for(const T of v)if(!ea(T,g))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(n,o){const h=[1/0,1/0,-1/0,-1/0],p=[1/0,1/0,-1/0,-1/0],f=n.canonicalID();if(o.type==="Polygon"){const g=ia(o.coordinates,p,f),v=Da(n.geometry(),h,p,f);if(!Dr(h,p))return!1;for(const T of v)if(!ka(T,g))return!1}if(o.type==="MultiPolygon"){const g=_o(o.coordinates,p,f),v=Da(n.geometry(),h,p,f);if(!Dr(h,p))return!1;for(const T of v)if(!za(T,g))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let fr=class{constructor(i=[],e=(n,o)=>n<o?-1:n>o?1:0){if(this.data=i,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(this.length===0)return;const i=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:e,compare:n}=this,o=e[i];for(;i>0;){const h=i-1>>1,p=e[h];if(n(o,p)>=0)break;e[i]=p,i=h}e[i]=o}_down(i){const{data:e,compare:n}=this,o=this.length>>1,h=e[i];for(;i<o;){let p=1+(i<<1);const f=p+1;if(f<this.length&&n(e[f],e[p])<0&&(p=f),n(e[p],h)>=0)break;e[i]=e[p],i=p}e[i]=h}};function Ba(i,e,n,o,h){na(i,e,n,o||i.length-1,h||cl)}function na(i,e,n,o,h){for(;o>n;){if(o-n>600){var p=o-n+1,f=e-n+1,g=Math.log(p),v=.5*Math.exp(2*g/3),T=.5*Math.sqrt(g*v*(p-v)/p)*(f-p/2<0?-1:1);na(i,e,Math.max(n,Math.floor(e-f*v/p+T)),Math.min(o,Math.floor(e+(p-f)*v/p+T)),h)}var P=i[e],M=n,k=o;for(Yr(i,n,e),h(i[o],P)>0&&Yr(i,n,o);M<k;){for(Yr(i,M,k),M++,k--;h(i[M],P)<0;)M++;for(;h(i[k],P)>0;)k--}h(i[n],P)===0?Yr(i,n,k):Yr(i,++k,o),k<=e&&(n=k+1),e<=k&&(o=k-1)}}function Yr(i,e,n){var o=i[e];i[e]=i[n],i[n]=o}function cl(i,e){return i<e?-1:i>e?1:0}function Hs(i,e){if(i.length<=1)return[i];const n=[];let o,h;for(const p of i){const f=ul(p);f!==0&&(p.area=Math.abs(f),h===void 0&&(h=f<0),h===f<0?(o&&n.push(o),o=[p]):o.push(p))}if(o&&n.push(o),e>1)for(let p=0;p<n.length;p++)n[p].length<=e||(Ba(n[p],e,1,n[p].length-1,Ra),n[p]=n[p].slice(0,e));return n}function Ra(i,e){return e.area-i.area}function ul(i){let e=0;for(let n,o,h=0,p=i.length,f=p-1;h<p;f=h++)n=i[h],o=i[f],e+=(o.x-n.x)*(n.y+o.y);return e}const Fa=1/298.257223563,go=Fa*(2-Fa),Oa=Math.PI/180;class yo{constructor(e){const n=6378.137*Oa*1e3,o=Math.cos(e*Oa),h=1/(1-go*(1-o*o)),p=Math.sqrt(h);this.kx=n*p*o,this.ky=n*p*h*(1-go)}distance(e,n){const o=this.wrap(e[0]-n[0])*this.kx,h=(e[1]-n[1])*this.ky;return Math.sqrt(o*o+h*h)}pointOnLine(e,n){let o,h,p,f,g=1/0;for(let v=0;v<e.length-1;v++){let T=e[v][0],P=e[v][1],M=this.wrap(e[v+1][0]-T)*this.kx,k=(e[v+1][1]-P)*this.ky,D=0;M===0&&k===0||(D=(this.wrap(n[0]-T)*this.kx*M+(n[1]-P)*this.ky*k)/(M*M+k*k),D>1?(T=e[v+1][0],P=e[v+1][1]):D>0&&(T+=M/this.kx*D,P+=k/this.ky*D)),M=this.wrap(n[0]-T)*this.kx,k=(n[1]-P)*this.ky;const R=M*M+k*k;R<g&&(g=R,o=T,h=P,p=v,f=D)}return{point:[o,h],index:p,t:Math.max(0,Math.min(1,f))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function ra(i,e){return e[0]-i[0]}function Qr(i){return i[1]-i[0]+1}function Ri(i,e){return i[1]>=i[0]&&i[1]<e}function sa(i,e){if(i[0]>i[1])return[null,null];const n=Qr(i);if(e){if(n===2)return[i,null];const h=Math.floor(n/2);return[[i[0],i[0]+h],[i[0]+h,i[1]]]}if(n===1)return[i,null];const o=Math.floor(n/2)-1;return[[i[0],i[0]+o],[i[0]+o+1,i[1]]]}function ts(i,e){if(!Ri(e,i.length))return[1/0,1/0,-1/0,-1/0];const n=[1/0,1/0,-1/0,-1/0];for(let o=e[0];o<=e[1];++o)_e(n,i[o]);return n}function Gi(i){const e=[1/0,1/0,-1/0,-1/0];for(const n of i)for(const o of n)_e(e,o);return e}function Ws(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function vo(i,e,n){if(!Ws(i)||!Ws(e))return NaN;let o=0,h=0;return i[2]<e[0]&&(o=e[0]-i[2]),i[0]>e[2]&&(o=i[0]-e[2]),i[1]>e[3]&&(h=i[1]-e[3]),i[3]<e[1]&&(h=e[1]-i[3]),n.distance([0,0],[o,h])}function es(i,e,n){const o=n.pointOnLine(e,i);return n.distance(i,o.point)}function Xs(i,e,n,o,h){const p=Math.min(es(i,[n,o],h),es(e,[n,o],h)),f=Math.min(es(n,[i,e],h),es(o,[i,e],h));return Math.min(p,f)}function oa(i,e,n,o,h){if(!Ri(e,i.length)||!Ri(o,n.length))return 1/0;let p=1/0;for(let f=e[0];f<e[1];++f){const g=i[f],v=i[f+1];for(let T=o[0];T<o[1];++T){const P=n[T],M=n[T+1];if(Br(g,v,P,M))return 0;p=Math.min(p,Xs(g,v,P,M,h))}}return p}function ri(i,e,n,o,h){if(!Ri(e,i.length)||!Ri(o,n.length))return NaN;let p=1/0;for(let f=e[0];f<=e[1];++f)for(let g=o[0];g<=o[1];++g)if(p=Math.min(p,h.distance(i[f],n[g])),p===0)return p;return p}function dl(i,e,n){if(Ps(i,e,!0))return 0;let o=1/0;for(const h of e){const p=h[0],f=h[h.length-1];if(p!==f&&(o=Math.min(o,es(i,[f,p],n)),o===0))return o;const g=n.pointOnLine(h,i);if(o=Math.min(o,n.distance(i,g.point)),o===0)return o}return o}function de(i,e,n,o){if(!Ri(e,i.length))return NaN;for(let p=e[0];p<=e[1];++p)if(Ps(i[p],n,!0))return 0;let h=1/0;for(let p=e[0];p<e[1];++p){const f=i[p],g=i[p+1];for(const v of n)for(let T=0,P=v.length,M=P-1;T<P;M=T++){const k=v[M],D=v[T];if(Br(f,g,k,D))return 0;h=Math.min(h,Xs(f,g,k,D,o))}}return h}function xo(i,e){for(const n of i)for(const o of n)if(Ps(o,e,!0))return!0;return!1}function be(i,e,n,o=1/0){const h=Gi(i),p=Gi(e);if(o!==1/0&&vo(h,p,n)>=o)return o;if(Dr(h,p)){if(xo(i,e))return 0}else if(xo(e,i))return 0;let f=1/0;for(const g of i)for(let v=0,T=g.length,P=T-1;v<T;P=v++){const M=g[P],k=g[v];for(const D of e)for(let R=0,N=D.length,$=N-1;R<N;$=R++){const W=D[$],at=D[R];if(Br(M,k,W,at))return 0;f=Math.min(f,Xs(M,k,W,at,n))}}return f}function Ce(i,e,n,o,h,p){if(!p)return;const f=vo(ts(o,p),h,n);f<e&&i.push([f,p,[0,0]])}function is(i,e,n,o,h,p,f){if(!p||!f)return;const g=vo(ts(o,p),ts(h,f),n);g<e&&i.push([g,p,f])}function cn(i,e,n,o,h=1/0){let p=Math.min(o.distance(i[0],n[0][0]),h);if(p===0)return p;const f=new fr([[0,[0,i.length-1],[0,0]]],ra),g=Gi(n);for(;f.length>0;){const v=f.pop();if(v[0]>=p)continue;const T=v[1],P=e?50:100;if(Qr(T)<=P){if(!Ri(T,i.length))return NaN;if(e){const M=de(i,T,n,o);if(isNaN(M)||M===0)return M;p=Math.min(p,M)}else for(let M=T[0];M<=T[1];++M){const k=dl(i[M],n,o);if(p=Math.min(p,k),p===0)return 0}}else{const M=sa(T,e);Ce(f,p,o,i,g,M[0]),Ce(f,p,o,i,g,M[1])}}return p}function Ks(i,e,n,o,h,p=1/0){let f=Math.min(p,h.distance(i[0],n[0]));if(f===0)return f;const g=new fr([[0,[0,i.length-1],[0,n.length-1]]],ra);for(;g.length>0;){const v=g.pop();if(v[0]>=f)continue;const T=v[1],P=v[2],M=e?50:100,k=o?50:100;if(Qr(T)<=M&&Qr(P)<=k){if(!Ri(T,i.length)&&Ri(P,n.length))return NaN;let D;if(e&&o)D=oa(i,T,n,P,h),f=Math.min(f,D);else if(e&&!o){const R=i.slice(T[0],T[1]+1);for(let N=P[0];N<=P[1];++N)if(D=es(n[N],R,h),f=Math.min(f,D),f===0)return f}else if(!e&&o){const R=n.slice(P[0],P[1]+1);for(let N=T[0];N<=T[1];++N)if(D=es(i[N],R,h),f=Math.min(f,D),f===0)return f}else D=ri(i,T,n,P,h),f=Math.min(f,D)}else{const D=sa(T,e),R=sa(P,o);is(g,f,h,i,n,D[0],R[0]),is(g,f,h,i,n,D[0],R[1]),is(g,f,h,i,n,D[1],R[0]),is(g,f,h,i,n,D[1],R[1])}}return f}function Fr(i){return i.type==="MultiPolygon"?i.coordinates.map(e=>({type:"Polygon",coordinates:e})):i.type==="MultiLineString"?i.coordinates.map(e=>({type:"LineString",coordinates:e})):i.type==="MultiPoint"?i.coordinates.map(e=>({type:"Point",coordinates:e})):[i]}class ns{constructor(e,n){this.type=St,this.geojson=e,this.geometries=n}static parse(e,n){if(e.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(En(e[1])){const o=e[1];if(o.type==="FeatureCollection")return new ns(o,o.features.map(h=>Fr(h.geometry)).flat());if(o.type==="Feature")return new ns(o,Fr(o.geometry));if("type"in o&&"coordinates"in o)return new ns(o,Fr(o))}return n.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(n,o){const h=n.geometry(),p=h.flat().map(v=>mo([v.x,v.y],n.canonical));if(h.length===0)return NaN;const f=new yo(p[0][1]);let g=1/0;for(const v of o){switch(v.type){case"Point":g=Math.min(g,Ks(p,!1,[v.coordinates],!1,f,g));break;case"LineString":g=Math.min(g,Ks(p,!1,v.coordinates,!0,f,g));break;case"Polygon":g=Math.min(g,cn(p,!1,v.coordinates,f,g))}if(g===0)return g}return g}(e,this.geometries);if(e.geometryType()==="LineString")return function(n,o){const h=n.geometry(),p=h.flat().map(v=>mo([v.x,v.y],n.canonical));if(h.length===0)return NaN;const f=new yo(p[0][1]);let g=1/0;for(const v of o){switch(v.type){case"Point":g=Math.min(g,Ks(p,!0,[v.coordinates],!1,f,g));break;case"LineString":g=Math.min(g,Ks(p,!0,v.coordinates,!0,f,g));break;case"Polygon":g=Math.min(g,cn(p,!0,v.coordinates,f,g))}if(g===0)return g}return g}(e,this.geometries);if(e.geometryType()==="Polygon")return function(n,o){const h=n.geometry();if(h.length===0||h[0].length===0)return NaN;const p=Hs(h,0).map(v=>v.map(T=>T.map(P=>mo([P.x,P.y],n.canonical)))),f=new yo(p[0][0][0][1]);let g=1/0;for(const v of o)for(const T of p){switch(v.type){case"Point":g=Math.min(g,cn([v.coordinates],!1,T,f,g));break;case"LineString":g=Math.min(g,cn(v.coordinates,!0,T,f,g));break;case"Polygon":g=Math.min(g,be(T,v.coordinates,f,g))}if(g===0)return g}return g}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Gn={"==":Yo,"!=":uo,">":Qo,"<":Lr,">=":vi,"<=":$s,array:ln,at:pr,boolean:ln,case:Ar,coalesce:hn,collator:Ln,format:Gs,image:ta,in:ni,"index-of":xn,interpolate:$i,"interpolate-hcl":$i,"interpolate-lab":$i,length:fo,let:Cr,literal:qi,match:Kr,number:ln,"number-format":po,object:ln,slice:Jr,step:zr,string:ln,"to-boolean":Le,"to-color":Le,"to-number":Le,"to-string":Le,var:Se,within:Rr,distance:ns};class un{constructor(e,n,o,h){this.name=e,this.type=n,this._evaluate=o,this.args=h}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,n){const o=e[0],h=un.definitions[o];if(!h)return n.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const p=Array.isArray(h)?h[0]:h.type,f=Array.isArray(h)?[[h[1],h[2]]]:h.overloads,g=f.filter(([T])=>!Array.isArray(T)||T.length===e.length-1);let v=null;for(const[T,P]of g){v=new yi(n.registry,Js,n.path,null,n.scope);const M=[];let k=!1;for(let D=1;D<e.length;D++){const R=e[D],N=Array.isArray(T)?T[D-1]:T.type,$=v.parse(R,1+M.length,N);if(!$){k=!0;break}M.push($)}if(!k)if(Array.isArray(T)&&T.length!==M.length)v.error(`Expected ${T.length} arguments, but found ${M.length} instead.`);else{for(let D=0;D<M.length;D++){const R=Array.isArray(T)?T[D]:T.type,N=M[D];v.concat(D+1).checkSubtype(R,N.type)}if(v.errors.length===0)return new un(o,p,P,M)}}if(g.length===1)n.errors.push(...v.errors);else{const T=(g.length?g:f).map(([M])=>{return k=M,Array.isArray(k)?`(${k.map(z).join(", ")})`:`(${z(k.type)}...)`;var k}).join(" | "),P=[];for(let M=1;M<e.length;M++){const k=n.parse(e[M],1+P.length);if(!k)return null;P.push(z(k.type))}n.error(`Expected arguments of type ${T}, but found (${P.join(", ")}) instead.`)}return null}static register(e,n){un.definitions=n;for(const o in n)e[o]=un}}function Ss(i,[e,n,o,h]){e=e.evaluate(i),n=n.evaluate(i),o=o.evaluate(i);const p=h?h.evaluate(i):1,f=Wr(e,n,o,p);if(f)throw new Ze(f);return new Be(e/255,n/255,o/255,p,!1)}function aa(i,e){return i in e}function Hn(i,e){const n=e[i];return n===void 0?null:n}function Wn(i){return{type:i}}function Js(i){if(i instanceof Se)return Js(i.boundExpression);if(i instanceof un&&i.name==="error"||i instanceof Ln||i instanceof Rr||i instanceof ns)return!1;const e=i instanceof Le||i instanceof ln;let n=!0;return i.eachChild(o=>{n=e?n&&Js(o):n&&o instanceof qi}),!!n&&rs(i)&&dn(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function rs(i){if(i instanceof un&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof Rr||i instanceof ns)return!1;let e=!0;return i.eachChild(n=>{e&&!rs(n)&&(e=!1)}),e}function Is(i){if(i instanceof un&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(n=>{e&&!Is(n)&&(e=!1)}),e}function dn(i,e){if(i instanceof un&&e.indexOf(i.name)>=0)return!1;let n=!0;return i.eachChild(o=>{n&&!dn(o,e)&&(n=!1)}),n}function bo(i){return{result:"success",value:i}}function Bn(i){return{result:"error",value:i}}function Ms(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Xn(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Cs(i){return!!i.expression&&i.expression.interpolated}function Me(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function As(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function wo(i){return i}function To(i,e){const n=e.type==="color",o=i.stops&&typeof i.stops[0][0]=="object",h=o||!(o||i.property!==void 0),p=i.type||(Cs(e)?"exponential":"interval");if(n||e.type==="padding"){const P=n?Be.parse:an.parse;(i=Un({},i)).stops&&(i.stops=i.stops.map(M=>[M[0],P(M[1])])),i.default=P(i.default?i.default:e.default)}if(i.colorSpace&&(f=i.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var f;let g,v,T;if(p==="exponential")g=Po;else if(p==="interval")g=os;else if(p==="categorical"){g=ss,v=Object.create(null);for(const P of i.stops)v[P[0]]=P[1];T=typeof i.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);g=la}if(o){const P={},M=[];for(let R=0;R<i.stops.length;R++){const N=i.stops[R],$=N[0].zoom;P[$]===void 0&&(P[$]={zoom:$,type:i.type,property:i.property,default:i.default,stops:[]},M.push($)),P[$].stops.push([N[0].value,N[1]])}const k=[];for(const R of M)k.push([P[R].zoom,To(P[R],e)]);const D={name:"linear"};return{kind:"composite",interpolationType:D,interpolationFactor:$i.interpolationFactor.bind(void 0,D),zoomStops:k.map(R=>R[0]),evaluate:({zoom:R},N)=>Po({stops:k,base:i.base},e,R).evaluate(R,N)}}if(h){const P=p==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:P,interpolationFactor:$i.interpolationFactor.bind(void 0,P),zoomStops:i.stops.map(M=>M[0]),evaluate:({zoom:M})=>g(i,e,M,v,T)}}return{kind:"source",evaluate(P,M){const k=M&&M.properties?M.properties[i.property]:void 0;return k===void 0?mr(i.default,e.default):g(i,e,k,v,T)}}}function mr(i,e,n){return i!==void 0?i:e!==void 0?e:n!==void 0?n:void 0}function ss(i,e,n,o,h){return mr(typeof n===h?o[n]:void 0,i.default,e.default)}function os(i,e,n){if(Me(n)!=="number")return mr(i.default,e.default);const o=i.stops.length;if(o===1||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[o-1][0])return i.stops[o-1][1];const h=kr(i.stops.map(p=>p[0]),n);return i.stops[h][1]}function Po(i,e,n){const o=i.base!==void 0?i.base:1;if(Me(n)!=="number")return mr(i.default,e.default);const h=i.stops.length;if(h===1||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[h-1][0])return i.stops[h-1][1];const p=kr(i.stops.map(P=>P[0]),n),f=function(P,M,k,D){const R=D-k,N=P-k;return R===0?0:M===1?N/R:(Math.pow(M,N)-1)/(Math.pow(M,R)-1)}(n,o,i.stops[p][0],i.stops[p+1][0]),g=i.stops[p][1],v=i.stops[p+1][1],T=Ci[e.type]||wo;return typeof g.evaluate=="function"?{evaluate(...P){const M=g.evaluate.apply(void 0,P),k=v.evaluate.apply(void 0,P);if(M!==void 0&&k!==void 0)return T(M,k,f,i.colorSpace)}}:T(g,v,f,i.colorSpace)}function la(i,e,n){switch(e.type){case"color":n=Be.parse(n);break;case"formatted":n=on.fromString(n.toString());break;case"resolvedImage":n=ji.fromString(n.toString());break;case"padding":n=an.parse(n);break;default:Me(n)===e.type||e.type==="enum"&&e.values[n]||(n=void 0)}return mr(n,i.default,e.default)}un.register(Gn,{error:[{kind:"error"},[se],(i,[e])=>{throw new Ze(e.evaluate(i))}],typeof:[se,[ie],(i,[e])=>z(Jt(e.evaluate(i)))],"to-rgba":[E(St,4),[Ui],(i,[e])=>{const[n,o,h,p]=e.evaluate(i).rgb;return[255*n,255*o,255*h,p]}],rgb:[Ui,[St,St,St],Ss],rgba:[Ui,[St,St,St,St],Ss],has:{type:Xt,overloads:[[[se],(i,[e])=>aa(e.evaluate(i),i.properties())],[[se,Di],(i,[e,n])=>aa(e.evaluate(i),n.evaluate(i))]]},get:{type:ie,overloads:[[[se],(i,[e])=>Hn(e.evaluate(i),i.properties())],[[se,Di],(i,[e,n])=>Hn(e.evaluate(i),n.evaluate(i))]]},"feature-state":[ie,[se],(i,[e])=>Hn(e.evaluate(i),i.featureState||{})],properties:[Di,[],i=>i.properties()],"geometry-type":[se,[],i=>i.geometryType()],id:[ie,[],i=>i.id()],zoom:[St,[],i=>i.globals.zoom],"heatmap-density":[St,[],i=>i.globals.heatmapDensity||0],"line-progress":[St,[],i=>i.globals.lineProgress||0],accumulated:[ie,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[St,Wn(St),(i,e)=>{let n=0;for(const o of e)n+=o.evaluate(i);return n}],"*":[St,Wn(St),(i,e)=>{let n=1;for(const o of e)n*=o.evaluate(i);return n}],"-":{type:St,overloads:[[[St,St],(i,[e,n])=>e.evaluate(i)-n.evaluate(i)],[[St],(i,[e])=>-e.evaluate(i)]]},"/":[St,[St,St],(i,[e,n])=>e.evaluate(i)/n.evaluate(i)],"%":[St,[St,St],(i,[e,n])=>e.evaluate(i)%n.evaluate(i)],ln2:[St,[],()=>Math.LN2],pi:[St,[],()=>Math.PI],e:[St,[],()=>Math.E],"^":[St,[St,St],(i,[e,n])=>Math.pow(e.evaluate(i),n.evaluate(i))],sqrt:[St,[St],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[St,[St],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[St,[St],(i,[e])=>Math.log(e.evaluate(i))],log2:[St,[St],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[St,[St],(i,[e])=>Math.sin(e.evaluate(i))],cos:[St,[St],(i,[e])=>Math.cos(e.evaluate(i))],tan:[St,[St],(i,[e])=>Math.tan(e.evaluate(i))],asin:[St,[St],(i,[e])=>Math.asin(e.evaluate(i))],acos:[St,[St],(i,[e])=>Math.acos(e.evaluate(i))],atan:[St,[St],(i,[e])=>Math.atan(e.evaluate(i))],min:[St,Wn(St),(i,e)=>Math.min(...e.map(n=>n.evaluate(i)))],max:[St,Wn(St),(i,e)=>Math.max(...e.map(n=>n.evaluate(i)))],abs:[St,[St],(i,[e])=>Math.abs(e.evaluate(i))],round:[St,[St],(i,[e])=>{const n=e.evaluate(i);return n<0?-Math.round(-n):Math.round(n)}],floor:[St,[St],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[St,[St],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Xt,[se,ie],(i,[e,n])=>i.properties()[e.value]===n.value],"filter-id-==":[Xt,[ie],(i,[e])=>i.id()===e.value],"filter-type-==":[Xt,[se],(i,[e])=>i.geometryType()===e.value],"filter-<":[Xt,[se,ie],(i,[e,n])=>{const o=i.properties()[e.value],h=n.value;return typeof o==typeof h&&o<h}],"filter-id-<":[Xt,[ie],(i,[e])=>{const n=i.id(),o=e.value;return typeof n==typeof o&&n<o}],"filter->":[Xt,[se,ie],(i,[e,n])=>{const o=i.properties()[e.value],h=n.value;return typeof o==typeof h&&o>h}],"filter-id->":[Xt,[ie],(i,[e])=>{const n=i.id(),o=e.value;return typeof n==typeof o&&n>o}],"filter-<=":[Xt,[se,ie],(i,[e,n])=>{const o=i.properties()[e.value],h=n.value;return typeof o==typeof h&&o<=h}],"filter-id-<=":[Xt,[ie],(i,[e])=>{const n=i.id(),o=e.value;return typeof n==typeof o&&n<=o}],"filter->=":[Xt,[se,ie],(i,[e,n])=>{const o=i.properties()[e.value],h=n.value;return typeof o==typeof h&&o>=h}],"filter-id->=":[Xt,[ie],(i,[e])=>{const n=i.id(),o=e.value;return typeof n==typeof o&&n>=o}],"filter-has":[Xt,[ie],(i,[e])=>e.value in i.properties()],"filter-has-id":[Xt,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Xt,[E(se)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Xt,[E(ie)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Xt,[se,E(ie)],(i,[e,n])=>n.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Xt,[se,E(ie)],(i,[e,n])=>function(o,h,p,f){for(;p<=f;){const g=p+f>>1;if(h[g]===o)return!0;h[g]>o?f=g-1:p=g+1}return!1}(i.properties()[e.value],n.value,0,n.value.length-1)],all:{type:Xt,overloads:[[[Xt,Xt],(i,[e,n])=>e.evaluate(i)&&n.evaluate(i)],[Wn(Xt),(i,e)=>{for(const n of e)if(!n.evaluate(i))return!1;return!0}]]},any:{type:Xt,overloads:[[[Xt,Xt],(i,[e,n])=>e.evaluate(i)||n.evaluate(i)],[Wn(Xt),(i,e)=>{for(const n of e)if(n.evaluate(i))return!0;return!1}]]},"!":[Xt,[Xt],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Xt,[se],(i,[e])=>{const n=i.globals&&i.globals.isSupportedScript;return!n||n(e.evaluate(i))}],upcase:[se,[se],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[se,[se],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[se,Wn(ie),(i,e)=>e.map(n=>Oe(n.evaluate(i))).join("")],"resolved-locale":[se,[jn],(i,[e])=>e.evaluate(i).resolvedLocale()]});class So{constructor(e,n){var o;this.expression=e,this._warningHistory={},this._evaluator=new Xr,this._defaultValue=n?(o=n).type==="color"&&As(o.default)?new Be(0,0,0,0):o.type==="color"?Be.parse(o.default)||null:o.type==="padding"?an.parse(o.default)||null:o.type==="variableAnchorOffsetCollection"?Mi.parse(o.default)||null:o.default===void 0?null:o.default:null,this._enumValues=n&&n.type==="enum"?n.values:null}evaluateWithoutErrorHandling(e,n,o,h,p,f){return this._evaluator.globals=e,this._evaluator.feature=n,this._evaluator.featureState=o,this._evaluator.canonical=h,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(e,n,o,h,p,f){this._evaluator.globals=e,this._evaluator.feature=n||null,this._evaluator.featureState=o||null,this._evaluator.canonical=h,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f||null;try{const g=this.expression.evaluate(this._evaluator);if(g==null||typeof g=="number"&&g!=g)return this._defaultValue;if(this._enumValues&&!(g in this._enumValues))throw new Ze(`Expected value to be one of ${Object.keys(this._enumValues).map(v=>JSON.stringify(v)).join(", ")}, but found ${JSON.stringify(g)} instead.`);return g}catch(g){return this._warningHistory[g.message]||(this._warningHistory[g.message]=!0,typeof console<"u"&&console.warn(g.message)),this._defaultValue}}}function as(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Gn}function ks(i,e){const n=new yi(Gn,Js,[],e?function(h){const p={color:Ui,string:se,number:St,enum:se,boolean:Xt,formatted:qn,padding:cr,resolvedImage:zn,variableAnchorOffsetCollection:H};return h.type==="array"?E(p[h.value]||ie,h.length):p[h.type]}(e):void 0),o=n.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?bo(new So(o,e)):Bn(n.errors)}class ls{constructor(e,n){this.kind=e,this._styleExpression=n,this.isStateDependent=e!=="constant"&&!Is(n.expression)}evaluateWithoutErrorHandling(e,n,o,h,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,n,o,h,p,f)}evaluate(e,n,o,h,p,f){return this._styleExpression.evaluate(e,n,o,h,p,f)}}class zs{constructor(e,n,o,h){this.kind=e,this.zoomStops=o,this._styleExpression=n,this.isStateDependent=e!=="camera"&&!Is(n.expression),this.interpolationType=h}evaluateWithoutErrorHandling(e,n,o,h,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,n,o,h,p,f)}evaluate(e,n,o,h,p,f){return this._styleExpression.evaluate(e,n,o,h,p,f)}interpolationFactor(e,n,o){return this.interpolationType?$i.interpolationFactor(this.interpolationType,e,n,o):0}}function Io(i,e){const n=ks(i,e);if(n.result==="error")return n;const o=n.value.expression,h=rs(o);if(!h&&!Ms(e))return Bn([new Ii("","data expressions not supported")]);const p=dn(o,["zoom"]);if(!p&&!Xn(e))return Bn([new Ii("","zoom expressions not supported")]);const f=Hi(o);return f||p?f instanceof Ii?Bn([f]):f instanceof $i&&!Cs(e)?Bn([new Ii("",'"interpolate" expressions cannot be used with this property')]):bo(f?new zs(h?"camera":"composite",n.value,f.labels,f instanceof $i?f.interpolation:void 0):new ls(h?"constant":"source",n.value)):Bn([new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Es{constructor(e,n){this._parameters=e,this._specification=n,Un(this,To(this._parameters,this._specification))}static deserialize(e){return new Es(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Hi(i){let e=null;if(i instanceof Cr)e=Hi(i.result);else if(i instanceof hn){for(const n of i.args)if(e=Hi(n),e)break}else(i instanceof zr||i instanceof $i)&&i.input instanceof un&&i.input.name==="zoom"&&(e=i);return e instanceof Ii||i.eachChild(n=>{const o=Hi(n);o instanceof Ii?e=o:!e&&o?e=new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new Ii("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function hs(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!hs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Mo={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ls(i){if(i==null)return{filter:()=>!0,needGeometry:!1};hs(i)||(i=Co(i));const e=ks(i,Mo);if(e.result==="error")throw new Error(e.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,o,h)=>e.value.evaluate(n,o,{},h),needGeometry:ha(i)}}function pl(i,e){return i<e?-1:i>e?1:0}function ha(i){if(!Array.isArray(i))return!1;if(i[0]==="within"||i[0]==="distance")return!0;for(let e=1;e<i.length;e++)if(ha(i[e]))return!0;return!1}function Co(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?cs(i[1],i[2],"=="):e==="!="?bi(cs(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?cs(i[1],i[2],e):e==="any"?(n=i.slice(1),["any"].concat(n.map(Co))):e==="all"?["all"].concat(i.slice(1).map(Co)):e==="none"?["all"].concat(i.slice(1).map(Co).map(bi)):e==="in"?Ys(i[1],i.slice(2)):e==="!in"?bi(Ys(i[1],i.slice(2))):e==="has"?Kn(i[1]):e!=="!has"||bi(Kn(i[1]));var n}function cs(i,e,n){switch(i){case"$type":return[`filter-type-${n}`,e];case"$id":return[`filter-id-${n}`,e];default:return[`filter-${n}`,i,e]}}function Ys(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(n=>typeof n!=typeof e[0])?["filter-in-large",i,["literal",e.sort(pl)]]:["filter-in-small",i,["literal",e]]}}function Kn(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function bi(i){return["!",i]}function Or(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let h="[";for(const p of i)h+=`${Or(p)},`;return`${h}]`}const n=Object.keys(i).sort();let o="{";for(let h=0;h<n.length;h++)o+=`${JSON.stringify(n[h])}:${Or(i[n[h]])},`;return`${o}}`}function Na(i){let e="";for(const n of lr)e+=`/${Or(i[n])}`;return e}function Jn(i){const e=i.value;return e?[new Pt(i.key,e,"constants have been deprecated as of v8")]:[]}function ii(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function wn(i){if(Array.isArray(i))return i.map(wn);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const n in i)e[n]=wn(i[n]);return e}return ii(i)}function wi(i){const e=i.key,n=i.value,o=i.valueSpec||{},h=i.objectElementValidators||{},p=i.style,f=i.styleSpec,g=i.validateSpec;let v=[];const T=Me(n);if(T!=="object")return[new Pt(e,n,`object expected, ${T} found`)];for(const P in n){const M=P.split(".")[0],k=o[M]||o["*"];let D;if(h[M])D=h[M];else if(o[M])D=g;else if(h["*"])D=h["*"];else{if(!o["*"]){v.push(new Pt(e,n[P],`unknown property "${P}"`));continue}D=g}v=v.concat(D({key:(e&&`${e}.`)+P,value:n[P],valueSpec:k,style:p,styleSpec:f,object:n,objectKey:P,validateSpec:g},n))}for(const P in o)h[P]||o[P].required&&o[P].default===void 0&&n[P]===void 0&&v.push(new Pt(e,n,`missing required property "${P}"`));return v}function Qs(i){const e=i.value,n=i.valueSpec,o=i.style,h=i.styleSpec,p=i.key,f=i.arrayElementValidator||i.validateSpec;if(Me(e)!=="array")return[new Pt(p,e,`array expected, ${Me(e)} found`)];if(n.length&&e.length!==n.length)return[new Pt(p,e,`array length ${n.length} expected, length ${e.length} found`)];if(n["min-length"]&&e.length<n["min-length"])return[new Pt(p,e,`array length at least ${n["min-length"]} expected, length ${e.length} found`)];let g={type:n.value,values:n.values};h.$version<7&&(g.function=n.function),Me(n.value)==="object"&&(g=n.value);let v=[];for(let T=0;T<e.length;T++)v=v.concat(f({array:e,arrayIndex:T,value:e[T],valueSpec:g,validateSpec:i.validateSpec,style:o,styleSpec:h,key:`${p}[${T}]`}));return v}function Ds(i){const e=i.key,n=i.value,o=i.valueSpec;let h=Me(n);return h==="number"&&n!=n&&(h="NaN"),h!=="number"?[new Pt(e,n,`number expected, ${h} found`)]:"minimum"in o&&n<o.minimum?[new Pt(e,n,`${n} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&n>o.maximum?[new Pt(e,n,`${n} is greater than the maximum value ${o.maximum}`)]:[]}function Nr(i){const e=i.valueSpec,n=ii(i.value.type);let o,h,p,f={};const g=n!=="categorical"&&i.value.property===void 0,v=!g,T=Me(i.value.stops)==="array"&&Me(i.value.stops[0])==="array"&&Me(i.value.stops[0][0])==="object",P=wi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(D){if(n==="identity")return[new Pt(D.key,D.value,'identity function may not have a "stops" property')];let R=[];const N=D.value;return R=R.concat(Qs({key:D.key,value:N,valueSpec:D.valueSpec,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,arrayElementValidator:M})),Me(N)==="array"&&N.length===0&&R.push(new Pt(D.key,N,"array must have at least one stop")),R},default:function(D){return D.validateSpec({key:D.key,value:D.value,valueSpec:e,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec})}}});return n==="identity"&&g&&P.push(new Pt(i.key,i.value,'missing required property "property"')),n==="identity"||i.value.stops||P.push(new Pt(i.key,i.value,'missing required property "stops"')),n==="exponential"&&i.valueSpec.expression&&!Cs(i.valueSpec)&&P.push(new Pt(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(v&&!Ms(i.valueSpec)?P.push(new Pt(i.key,i.value,"property functions not supported")):g&&!Xn(i.valueSpec)&&P.push(new Pt(i.key,i.value,"zoom functions not supported"))),n!=="categorical"&&!T||i.value.property!==void 0||P.push(new Pt(i.key,i.value,'"property" property is required')),P;function M(D){let R=[];const N=D.value,$=D.key;if(Me(N)!=="array")return[new Pt($,N,`array expected, ${Me(N)} found`)];if(N.length!==2)return[new Pt($,N,`array length 2 expected, length ${N.length} found`)];if(T){if(Me(N[0])!=="object")return[new Pt($,N,`object expected, ${Me(N[0])} found`)];if(N[0].zoom===void 0)return[new Pt($,N,"object stop key must have zoom")];if(N[0].value===void 0)return[new Pt($,N,"object stop key must have value")];if(p&&p>ii(N[0].zoom))return[new Pt($,N[0].zoom,"stop zoom values must appear in ascending order")];ii(N[0].zoom)!==p&&(p=ii(N[0].zoom),h=void 0,f={}),R=R.concat(wi({key:`${$}[0]`,value:N[0],valueSpec:{zoom:{}},validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec,objectElementValidators:{zoom:Ds,value:k}}))}else R=R.concat(k({key:`${$}[0]`,value:N[0],validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec},N));return as(wn(N[1]))?R.concat([new Pt(`${$}[1]`,N[1],"expressions are not allowed in function stops.")]):R.concat(D.validateSpec({key:`${$}[1]`,value:N[1],valueSpec:e,validateSpec:D.validateSpec,style:D.style,styleSpec:D.styleSpec}))}function k(D,R){const N=Me(D.value),$=ii(D.value),W=D.value!==null?D.value:R;if(o){if(N!==o)return[new Pt(D.key,W,`${N} stop domain type must match previous stop domain type ${o}`)]}else o=N;if(N!=="number"&&N!=="string"&&N!=="boolean")return[new Pt(D.key,W,"stop domain value must be a number, string, or boolean")];if(N!=="number"&&n!=="categorical"){let at=`number expected, ${N} found`;return Ms(e)&&n===void 0&&(at+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(D.key,W,at)]}return n!=="categorical"||N!=="number"||isFinite($)&&Math.floor($)===$?n!=="categorical"&&N==="number"&&h!==void 0&&$<h?[new Pt(D.key,W,"stop domain values must appear in ascending order")]:(h=$,n==="categorical"&&$ in f?[new Pt(D.key,W,"stop domain values must be unique")]:(f[$]=!0,[])):[new Pt(D.key,W,`integer expected, found ${$}`)]}}function us(i){const e=(i.expressionContext==="property"?Io:ks)(wn(i.value),i.valueSpec);if(e.result==="error")return e.value.map(o=>new Pt(`${i.key}${o.key}`,i.value,o.message));const n=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!n.outputDefined())return[new Pt(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Is(n))return[new Pt(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Is(n))return[new Pt(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!dn(n,["zoom","feature-state"]))return[new Pt(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!rs(n))return[new Pt(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Yn(i){const e=i.key,n=i.value,o=i.valueSpec,h=[];return Array.isArray(o.values)?o.values.indexOf(ii(n))===-1&&h.push(new Pt(e,n,`expected one of [${o.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(o.values).indexOf(ii(n))===-1&&h.push(new Pt(e,n,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(n)} found`)),h}function ca(i){return hs(wn(i.value))?us(Un({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):to(i)}function to(i){const e=i.value,n=i.key;if(Me(e)!=="array")return[new Pt(n,e,`array expected, ${Me(e)} found`)];const o=i.styleSpec;let h,p=[];if(e.length<1)return[new Pt(n,e,"filter array must have at least 1 element")];switch(p=p.concat(Yn({key:`${n}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),ii(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&ii(e[1])==="$type"&&p.push(new Pt(n,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&p.push(new Pt(n,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(h=Me(e[1]),h!=="string"&&p.push(new Pt(`${n}[1]`,e[1],`string expected, ${h} found`)));for(let f=2;f<e.length;f++)h=Me(e[f]),ii(e[1])==="$type"?p=p.concat(Yn({key:`${n}[${f}]`,value:e[f],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):h!=="string"&&h!=="number"&&h!=="boolean"&&p.push(new Pt(`${n}[${f}]`,e[f],`string, number, or boolean expected, ${h} found`));break;case"any":case"all":case"none":for(let f=1;f<e.length;f++)p=p.concat(to({key:`${n}[${f}]`,value:e[f],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":h=Me(e[1]),e.length!==2?p.push(new Pt(n,e,`filter array for "${e[0]}" operator must have 2 elements`)):h!=="string"&&p.push(new Pt(`${n}[1]`,e[1],`string expected, ${h} found`))}return p}function Ao(i,e){const n=i.key,o=i.validateSpec,h=i.style,p=i.styleSpec,f=i.value,g=i.objectKey,v=p[`${e}_${i.layerType}`];if(!v)return[];const T=g.match(/^(.*)-transition$/);if(e==="paint"&&T&&v[T[1]]&&v[T[1]].transition)return o({key:n,value:f,valueSpec:p.transition,style:h,styleSpec:p});const P=i.valueSpec||v[g];if(!P)return[new Pt(n,f,`unknown property "${g}"`)];let M;if(Me(f)==="string"&&Ms(P)&&!P.tokens&&(M=/^{([^}]+)}$/.exec(f)))return[new Pt(n,f,`"${g}" does not support interpolation syntax 8Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(M[1])} }\`.`)];const k=[];return i.layerType==="symbol"&&(g==="text-field"&&h&&!h.glyphs&&k.push(new Pt(n,f,'use of "text-field" requires a style "glyphs" property')),g==="text-font"&&As(wn(f))&&ii(f.type)==="identity"&&k.push(new Pt(n,f,'"text-font" does not support identity functions'))),k.concat(o({key:i.key,value:f,valueSpec:P,style:h,styleSpec:p,expressionContext:"property",propertyType:e,propertyKey:g}))}function eo(i){return Ao(i,"paint")}function ko(i){return Ao(i,"layout")}function zo(i){let e=[];const n=i.value,o=i.key,h=i.style,p=i.styleSpec;n.type||n.ref||e.push(new Pt(o,n,'either "type" or "ref" is required'));let f=ii(n.type);const g=ii(n.ref);if(n.id){const v=ii(n.id);for(let T=0;T<i.arrayIndex;T++){const P=h.layers[T];ii(P.id)===v&&e.push(new Pt(o,n.id,`duplicate layer id "${n.id}", previously used at line ${P.id.__line__}`))}}if("ref"in n){let v;["type","source","source-layer","filter","layout"].forEach(T=>{T in n&&e.push(new Pt(o,n[T],`"${T}" is prohibited for ref layers`))}),h.layers.forEach(T=>{ii(T.id)===g&&(v=T)}),v?v.ref?e.push(new Pt(o,n.ref,"ref cannot reference another ref layer")):f=ii(v.type):e.push(new Pt(o,n.ref,`ref layer "${g}" not found`))}else if(f!=="background")if(n.source){const v=h.sources&&h.sources[n.source],T=v&&ii(v.type);v?T==="vector"&&f==="raster"?e.push(new Pt(o,n.source,`layer "${n.id}" requires a raster source`)):T!=="raster-dem"&&f==="hillshade"?e.push(new Pt(o,n.source,`layer "${n.id}" requires a raster-dem source`)):T==="raster"&&f!=="raster"?e.push(new Pt(o,n.source,`layer "${n.id}" requires a vector source`)):T!=="vector"||n["source-layer"]?T==="raster-dem"&&f!=="hillshade"?e.push(new Pt(o,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):f!=="line"||!n.paint||!n.paint["line-gradient"]||T==="geojson"&&v.lineMetrics||e.push(new Pt(o,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Pt(o,n,`layer "${n.id}" must specify a "source-layer"`)):e.push(new Pt(o,n.source,`source "${n.source}" not found`))}else e.push(new Pt(o,n,'missing required property "source"'));return e=e.concat(wi({key:o,value:n,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${o}.type`,value:n.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:n,objectKey:"type"}),filter:ca,layout:v=>wi({layer:n,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":T=>ko(Un({layerType:f},T))}}),paint:v=>wi({layer:n,key:v.key,value:v.value,style:v.style,styleSpec:v.styleSpec,validateSpec:v.validateSpec,objectElementValidators:{"*":T=>eo(Un({layerType:f},T))}})}})),e}function ds(i){const e=i.value,n=i.key,o=Me(e);return o!=="string"?[new Pt(n,e,`string expected, ${o} found`)]:[]}const io={promoteId:function({key:i,value:e}){if(Me(e)==="string")return ds({key:i,value:e});{const n=[];for(const o in e)n.push(...ds({key:`${i}.${o}`,value:e[o]}));return n}}};function Bs(i){const e=i.value,n=i.key,o=i.styleSpec,h=i.style,p=i.validateSpec;if(!e.type)return[new Pt(n,e,'"type" is required')];const f=ii(e.type);let g;switch(f){case"vector":case"raster":return g=wi({key:n,value:e,valueSpec:o[`source_${f.replace("-","_")}`],style:i.style,styleSpec:o,objectElementValidators:io,validateSpec:p}),g;case"raster-dem":return g=function(v){var T;const P=(T=v.sourceName)!==null&&T!==void 0?T:"",M=v.value,k=v.styleSpec,D=k.source_raster_dem,R=v.style;let N=[];const $=Me(M);if(M===void 0)return N;if($!=="object")return N.push(new Pt("source_raster_dem",M,`object expected, ${$} found`)),N;const W=ii(M.encoding)==="custom",at=["redFactor","greenFactor","blueFactor","baseShift"],et=v.value.encoding?`"${v.value.encoding}"`:"Default";for(const st in M)!W&&at.includes(st)?N.push(new Pt(st,M[st],`In "${P}": "${st}" is only valid when "encoding" is set to "custom". ${et} encoding found`)):D[st]?N=N.concat(v.validateSpec({key:st,value:M[st],valueSpec:D[st],validateSpec:v.validateSpec,style:R,styleSpec:k})):N.push(new Pt(st,M[st],`unknown property "${st}"`));return N}({sourceName:n,value:e,style:i.style,styleSpec:o,validateSpec:p}),g;case"geojson":if(g=wi({key:n,value:e,valueSpec:o.source_geojson,style:h,styleSpec:o,validateSpec:p,objectElementValidators:io}),e.cluster)for(const v in e.clusterProperties){const[T,P]=e.clusterProperties[v],M=typeof T=="string"?[T,["accumulated"],["get",v]]:T;g.push(...us({key:`${n}.${v}.map`,value:P,expressionContext:"cluster-map"})),g.push(...us({key:`${n}.${v}.reduce`,value:M,expressionContext:"cluster-reduce"}))}return g;case"video":return wi({key:n,value:e,valueSpec:o.source_video,style:h,validateSpec:p,styleSpec:o});case"image":return wi({key:n,value:e,valueSpec:o.source_image,style:h,validateSpec:p,styleSpec:o});case"canvas":return[new Pt(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yn({key:`${n}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ua(i){const e=i.value,n=i.styleSpec,o=n.light,h=i.style;let p=[];const f=Me(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Pt("light",e,`object expected, ${f} found`)]),p;for(const g in e){const v=g.match(/^(.*)-transition$/);p=p.concat(v&&o[v[1]]&&o[v[1]].transition?i.validateSpec({key:g,value:e[g],valueSpec:n.transition,validateSpec:i.validateSpec,style:h,styleSpec:n}):o[g]?i.validateSpec({key:g,value:e[g],valueSpec:o[g],validateSpec:i.validateSpec,style:h,styleSpec:n}):[new Pt(g,e[g],`unknown property "${g}"`)])}return p}function r(i){const e=i.value,n=i.styleSpec,o=n.sky,h=i.style,p=Me(e);if(e===void 0)return[];if(p!=="object")return[new Pt("sky",e,`object expected, ${p} found`)];let f=[];for(const g in e)f=f.concat(o[g]?i.validateSpec({key:g,value:e[g],valueSpec:o[g],style:h,styleSpec:n}):[new Pt(g,e[g],`unknown property "${g}"`)]);return f}function c(i){const e=i.value,n=i.styleSpec,o=n.terrain,h=i.style;let p=[];const f=Me(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Pt("terrain",e,`object expected, ${f} found`)]),p;for(const g in e)p=p.concat(o[g]?i.validateSpec({key:g,value:e[g],valueSpec:o[g],validateSpec:i.validateSpec,style:h,styleSpec:n}):[new Pt(g,e[g],`unknown property "${g}"`)]);return p}function _(i){let e=[];const n=i.value,o=i.key;if(Array.isArray(n)){const h=[],p=[];for(const f in n)n[f].id&&h.includes(n[f].id)&&e.push(new Pt(o,n,`all the sprites' ids must be unique, but ${n[f].id} is duplicated`)),h.push(n[f].id),n[f].url&&p.includes(n[f].url)&&e.push(new Pt(o,n,`all the sprites' URLs must be unique, but ${n[f].url} is duplicated`)),p.push(n[f].url),e=e.concat(wi({key:`${o}[${f}]`,value:n[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return ds({key:o,value:n})}const b={"*":()=>[],array:Qs,boolean:function(i){const e=i.value,n=i.key,o=Me(e);return o!=="boolean"?[new Pt(n,e,`boolean expected, ${o} found`)]:[]},number:Ds,color:function(i){const e=i.key,n=i.value,o=Me(n);return o!=="string"?[new Pt(e,n,`color expected, ${o} found`)]:Be.parse(String(n))?[]:[new Pt(e,n,`color expected, "${n}" found`)]},constants:Jn,enum:Yn,filter:ca,function:Nr,layer:zo,object:wi,source:Bs,light:ua,sky:r,terrain:c,projection:function(i){const e=i.value,n=i.styleSpec,o=n.projection,h=i.style,p=Me(e);if(e===void 0)return[];if(p!=="object")return[new Pt("projection",e,`object expected, ${p} found`)];let f=[];for(const g in e)f=f.concat(o[g]?i.validateSpec({key:g,value:e[g],valueSpec:o[g],style:h,styleSpec:n}):[new Pt(g,e[g],`unknown property "${g}"`)]);return f},string:ds,formatted:function(i){return ds(i).length===0?[]:us(i)},resolvedImage:function(i){return ds(i).length===0?[]:us(i)},padding:function(i){const e=i.key,n=i.value;if(Me(n)==="array"){if(n.length<1||n.length>4)return[new Pt(e,n,`padding requires 1 to 4 values; ${n.length} values found`)];const o={type:"number"};let h=[];for(let p=0;p<n.length;p++)h=h.concat(i.validateSpec({key:`${e}[${p}]`,value:n[p],validateSpec:i.validateSpec,valueSpec:o}));return h}return Ds({key:e,value:n,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const e=i.key,n=i.value,o=Me(n),h=i.styleSpec;if(o!=="array"||n.length<1||n.length%2!=0)return[new Pt(e,n,"variableAnchorOffsetCollection requires a non-empty array of even length")];let p=[];for(let f=0;f<n.length;f+=2)p=p.concat(Yn({key:`${e}[${f}]`,value:n[f],valueSpec:h.layout_symbol["text-anchor"]})),p=p.concat(Qs({key:`${e}[${f+1}]`,value:n[f+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:h}));return p},sprite:_};function I(i){const e=i.value,n=i.valueSpec,o=i.styleSpec;return i.validateSpec=I,n.expression&&As(ii(e))?Nr(i):n.expression&&as(wn(e))?us(i):n.type&&b[n.type]?b[n.type](i):wi(Un({},i,{valueSpec:n.type?o[n.type]:n}))}function F(i){const e=i.value,n=i.key,o=ds(i);return o.length||(e.indexOf("{fontstack}")===-1&&o.push(new Pt(n,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&o.push(new Pt(n,e,'"glyphs" url must include a "{range}" token'))),o}function J(i,e=ut){let n=[];return n=n.concat(I({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:I,objectElementValidators:{glyphs:F,"*":()=>[]}})),i.constants&&(n=n.concat(Jn({key:"constants",value:i.constants}))),pt(n)}function lt(i){return function(e){return i({...e,validateSpec:I})}}function pt(i){return[].concat(i).sort((e,n)=>e.line-n.line)}function xt(i){return function(...e){return pt(i.apply(this,e))}}J.source=xt(lt(Bs)),J.sprite=xt(lt(_)),J.glyphs=xt(lt(F)),J.light=xt(lt(ua)),J.sky=xt(lt(r)),J.terrain=xt(lt(c)),J.layer=xt(lt(zo)),J.filter=xt(lt(ca)),J.paintProperty=xt(lt(eo)),J.layoutProperty=xt(lt(ko));const Bt=J,te=Bt.light,ye=Bt.sky,Ai=Bt.paintProperty,ui=Bt.layoutProperty;function Wi(i,e){let n=!1;if(e&&e.length)for(const o of e)i.fire(new Sr(new Error(o.message))),n=!0;return n}class di{constructor(e,n,o){const h=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const f=new Int32Array(this.arrayBuffer);e=f[0],this.d=(n=f[1])+2*(o=f[2]);for(let v=0;v<this.d*this.d;v++){const T=f[3+v],P=f[3+v+1];h.push(T===P?null:f.subarray(T,P))}const g=f[3+h.length+1];this.keys=f.subarray(f[3+h.length],g),this.bboxes=f.subarray(g),this.insert=this._insertReadonly}else{this.d=n+2*o;for(let f=0;f<this.d*this.d;f++)h.push([]);this.keys=[],this.bboxes=[]}this.n=n,this.extent=e,this.padding=o,this.scale=n/e,this.uid=0;const p=o/n*e;this.min=-p,this.max=e+p}insert(e,n,o,h,p){this._forEachCell(n,o,h,p,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(n),this.bboxes.push(o),this.bboxes.push(h),this.bboxes.push(p)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,n,o,h,p,f){this.cells[p].push(f)}query(e,n,o,h,p){const f=this.min,g=this.max;if(e<=f&&n<=f&&g<=o&&g<=h&&!p)return Array.prototype.slice.call(this.keys);{const v=[];return this._forEachCell(e,n,o,h,this._queryCell,v,{},p),v}}_queryCell(e,n,o,h,p,f,g,v){const T=this.cells[p];if(T!==null){const P=this.keys,M=this.bboxes;for(let k=0;k<T.length;k++){const D=T[k];if(g[D]===void 0){const R=4*D;(v?v(M[R+0],M[R+1],M[R+2],M[R+3]):e<=M[R+2]&&n<=M[R+3]&&o>=M[R+0]&&h>=M[R+1])?(g[D]=!0,f.push(P[D])):g[D]=!1}}}}_forEachCell(e,n,o,h,p,f,g,v){const T=this._convertToCellCoord(e),P=this._convertToCellCoord(n),M=this._convertToCellCoord(o),k=this._convertToCellCoord(h);for(let D=T;D<=M;D++)for(let R=P;R<=k;R++){const N=this.d*R+D;if((!v||v(this._convertFromCellCoord(D),this._convertFromCellCoord(R),this._convertFromCellCoord(D+1),this._convertFromCellCoord(R+1)))&&p.call(this,e,n,o,h,N,f,g,v))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,n=3+this.cells.length+1+1;let o=0;for(let f=0;f<this.cells.length;f++)o+=this.cells[f].length;const h=new Int32Array(n+o+this.keys.length+this.bboxes.length);h[0]=this.extent,h[1]=this.n,h[2]=this.padding;let p=n;for(let f=0;f<e.length;f++){const g=e[f];h[3+f]=p,h.set(g,p),p+=g.length}return h[3+e.length]=p,h.set(this.keys,p),p+=this.keys.length,h[3+e.length+1]=p,h.set(this.bboxes,p),p+=this.bboxes.length,h.buffer}static serialize(e,n){const o=e.toArrayBuffer();return n&&n.push(o),{buffer:o}}static deserialize(e){return new di(e.buffer)}}const Ti={};function Ft(i,e,n={}){if(Ti[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),Ti[i]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}Ft("Object",Object),Ft("TransferableGridIndex",di),Ft("Color",Be),Ft("Error",Error),Ft("AJAXError",oi),Ft("ResolvedImage",ji),Ft("StylePropertyFunction",Es),Ft("StyleExpression",So,{omit:["_evaluator"]}),Ft("ZoomDependentExpression",zs),Ft("ZoomConstantExpression",ls),Ft("CompoundExpression",un,{omit:["_evaluate"]});for(const i in Gn)Gn[i]._classRegistryKey||Ft(`Expression_${i}`,Gn[i]);function Eo(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function da(i){return i.$name||i.constructor._classRegistryKey}function pa(i){return!function(e){if(e===null||typeof e!="object")return!1;const n=da(e);return!(!n||n==="Object")}(i)&&(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||Eo(i)||Zi(i)||ArrayBuffer.isView(i)||i instanceof ImageData)}function Rs(i,e){if(pa(i))return(Eo(i)||Zi(i))&&e&&e.push(i),ArrayBuffer.isView(i)&&e&&e.push(i.buffer),i instanceof ImageData&&e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const p=[];for(const f of i)p.push(Rs(f,e));return p}if(typeof i!="object")throw new Error("can't serialize object of type "+typeof i);const n=da(i);if(!n)throw new Error(`can't serialize object of unregistered class ${i.constructor.name}`);if(!Ti[n])throw new Error(`${n} is not registered.`);const{klass:o}=Ti[n],h=o.serialize?o.serialize(i,e):{};if(o.serialize){if(e&&h===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const p in i){if(!i.hasOwnProperty(p)||Ti[n].omit.indexOf(p)>=0)continue;const f=i[p];h[p]=Ti[n].shallow.indexOf(p)>=0?f:Rs(f,e)}i instanceof Error&&(h.message=i.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(h.$name=n),h}function ps(i){if(pa(i))return i;if(Array.isArray(i))return i.map(ps);if(typeof i!="object")throw new Error("can't deserialize object of type "+typeof i);const e=da(i)||"Object";if(!Ti[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:n}=Ti[e];if(!n)throw new Error(`can't deserialize unregistered class ${e}`);if(n.deserialize)return n.deserialize(i);const o=Object.create(n.prototype);for(const h of Object.keys(i)){if(h==="$name")continue;const p=i[h];o[h]=Ti[e].shallow.indexOf(h)>=0?p:ps(p)}return o}class si{constructor(){this.first=!0}update(e,n){const o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=n):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=n),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}const fe={"Latin-1 Supplement":i=>i>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>
8=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function fa(i){for(const e of i)if(ml(e.charCodeAt(0)))return!0;return!1}function fl(i){for(const e of i)if(!fs(e.charCodeAt(0)))return!1;return!0}function ma(i){const e=i.map(n=>{try{return new RegExp(`\\p{sc=${n}}`,"u").source}catch{return null}}).filter(n=>n);return new RegExp(e.join("|"),"u")}const _a=ma(["Arab","Dupl","Mong","Ougr","Syrc"]);function fs(i){return!_a.test(String.fromCodePoint(i))}const Va=ma(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ml(i){return!(i!==746&&i!==747&&(i<4352||!(fe["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||fe["CJK Compatibility"](i)||fe["CJK Strokes"](i)||!(!fe["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||fe["Enclosed CJK Letters and Months"](i)||fe["Ideographic Description Characters"](i)||fe.Kanbun(i)||fe.Katakana(i)&&i!==12540||!(!fe["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!fe["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||fe["Vertical Forms"](i)||fe["Yijing Hexagram Symbols"](i)||/\p{sc=Cans}/u.test(String.fromCodePoint(i))||/\p{sc=Hang}/u.test(String.fromCodePoint(i))||Va.test(String.fromCodePoint(i)))))}function Fl(i){return!(ml(i)||function(e){return!!(fe["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||fe["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||fe["Letterlike Symbols"](e)||fe["Number Forms"](e)||fe["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||fe["Control Pictures"](e)&&e!==9251||fe["Optical Character Recognition"](e)||fe["Enclosed Alphanumerics"](e)||fe["Geometric Shapes"](e)||fe["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||fe["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||fe["CJK Symbols and Punctuation"](e)||fe.Katakana(e)||fe["Private Use Area"](e)||fe["CJK Compatibility Forms"](e)||fe["Small Form Variants"](e)||fe["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}const lh=ma(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function _l(i){return lh.test(String.fromCodePoint(i))}function hh(i,e){return!(!e&&_l(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||fe.Khmer(i))}function ch(i){for(const e of i)if(_l(e.charCodeAt(0)))return!0;return!1}const Rn=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Xe{constructor(e,n){this.zoom=e,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.zoomHistory=n.zoomHistory,this.transition=n.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new si,this.transition={})}isSupportedScript(e){return function(n,o){for(const h of n)if(!hh(h.charCo
vendor: 17,022 bytes, line 8
8deAt(0),o))return!1;return!0}(e,Rn.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,n=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:n+(1-n)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*n}}}class Lo{constructor(e,n){this.property=e,this.value=n,this.expression=function(o,h){if(As(o))return new Es(o,h);if(as(o)){const p=Io(o,h);if(p.result==="error")throw new Error(p.value.map(f=>`${f.key}: ${f.message}`).join(", "));return p.value}{let p=o;return h.type==="color"&&typeof o=="string"?p=Be.parse(o):h.type!=="padding"||typeof o!="number"&&!Array.isArray(o)?h.type==="variableAnchorOffsetCollection"&&Array.isArray(o)&&(p=Mi.parse(o)):p=an.parse(o),{kind:"constant",evaluate:()=>p}}}(n===void 0?e.specification.default:n,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,n,o){return this.property.possiblyEvaluate(this,e,n,o)}}class Za{constructor(e){this.property=e,this.value=new Lo(e,void 0)}transitioned(e,n){return new Ol(this.property,this.value,n,rn({},e.transition,this.transition),e.now)}untransitioned(){return new Ol(this.property,this.value,null,{},0)}}class Ua{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return le(this._values[e].value.value)}setValue(e,n){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Za(this._values[e].property)),this._values[e].value=new Lo(this._values[e].property,n===null?void 0:le(n))}getTransition(e){return le(this._values[e].transition)}setTransition(e,n){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Za(this._values[e].property)),this._values[e].transition=le(n)||void 0}serialize(){const e={};for(const n of Object.keys(this._values)){const o=this.getValue(n);o!==void 0&&(e[n]=o);const h=this.getTransition(n);h!==void 0&&(e[`${n}-transition`]=h)}return e}transitioned(e,n){const o=new ga(this._properties);for(const h of Object.keys(this._values))o._values[h]=this._values[h].transitioned(e,n._values[h]);return o}untransitioned(){const e=new ga(this._properties);for(const n of Object.keys(this._values))e._values[n]=this._values[n].untransitioned();return e}}class Ol{constructor(e,n,o,h,p){this.property=e,this.value=n,this.begin=p+h.delay||0,this.end=this.begin+h.duration||0,e.specification.transition&&(h.delay||h.duration)&&(this.prior=o)}possiblyEvaluate(e,n,o){const h=e.now||0,p=this.value.possiblyEvaluate(e,n,o),f=this.prior;if(f){if(h>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(h<this.begin)return f.possiblyEvaluate(e,n,o);{const g=(h-this.begin)/(this.end-this.begin);return this.property.interpolate(f.possiblyEvaluate(e,n,o),p,function(v){if(v<=0)return 0;if(v>=1)return 1;const T=v*v,P=T*v;return 4*(v<.5?P:3*(v-T)+P-.75)}(g))}}return p}}class ga{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,n,o){const h=new va(this._properties);for(const p of Object.keys(this._values))h._values[p]=this._values[p].possiblyEvaluate(e,n,o);return h}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class ya{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return le(this._values[e].value)}setValue(e,n){this._values[e]=new Lo(this._values[e].property,n===null?void 0:le(n))}serialize(){const e={};for(const n of Object.keys(this._values)){const o=this.getValue(n);o!==void 0&&(e[n]=o)}return e}possiblyEvaluate(e,n,o){const h=new va(this._properties);for(const p of Object.keys(this._values))h._values[p]=this._values[p].possiblyEvaluate(e,n,o);return h}}class Vr{constructor(e,n,o){this.property=e,this.value=n,this.parameters=o}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,n,o,h){return this.property.evaluate(this.value,this.parameters,e,n,o,h)}}class va{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Vt{constructor(e){this.specification=e}possiblyEvaluate(e,n){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(n)}interpolate(e,n,o){const h=Ci[this.specification.type];return h?h(e,n,o):e}}class Wt{constructor(e,n){this.specification=e,this.overrides=n}possiblyEvaluate(e,n,o,h){return new Vr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(n,null,{},o,h)}:e.expression,n)}interpolate(e,n,o){if(e.value.kind!=="constant"||n.value.kind!=="constant")return e;if(e.value.value===void 0||n.value.value===void 0)return new Vr(this,{kind:"constant",value:void 0},e.parameters);const h=Ci[this.specification.type];if(h){const p=h(e.value.value,n.value.value,o);return new Vr(this,{kind:"constant",value:p},e.parameters)}return e}evaluate(e,n,o,h,p,f){return e.kind==="constant"?e.value:e.evaluate(n,o,h,p,f)}}class ja extends Wt{possiblyEvaluate(e,n,o,h){if(e.value===void 0)return new Vr(this,{kind:"constant",value:void 0},n);if(e.expression.kind==="constant"){const p=e.expression.evaluate(n,null,{},o,h),f=e.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,g=this._calculate(f,f,f,n);return new Vr(this,{kind:"constant",value:g},n)}if(e.expression.kind==="camera"){const p=this._calculate(e.expression.evaluate({zoom:n.zoom-1}),e.expression.evaluate({zoom:n.zoom}),e.expression.evaluate({zoom:n.zoom+1}),n);return new Vr(this,{kind:"constant",value:p},n)}return new Vr(this,e.expression,n)}evaluate(e,n,o,h,p,f){if(e.kind==="source"){const g=e.evaluate(n,o,h,p,f);return this._calculate(g,g,g,n)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(n.zoom)-1},o,h),e.evaluate({zoom:Math.floor(n.zoom)},o,h),e.evaluate({zoom:Math.floor(n.zoom)+1},o,h),n):e.value}_calculate(e,n,o,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:n}:{from:o,to:n}}interpolate(e){return e}}class qa{constructor(e){this.specification=e}possiblyEvaluate(e,n,o,h){if(e.value!==void 0){if(e.expression.kind==="constant"){const p=e.expression.evaluate(n,null,{},o,h);return this._calculate(p,p,p,n)}return this._calculate(e.expression.evaluate(new Xe(Math.floor(n.zoom-1),n)),e.expression.evaluate(new Xe(Math.floor(n.zoom),n)),e.expression.evaluate(new Xe(Math.floor(n.zoom+1),n)),n)}}_calculate(e,n,o,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:n}:{from:o,to:n}}interpolate(e){return e}}class gl{constructor(e){this.specification=e}possiblyEvaluate(e,n,o,h){return!!e.expression.evaluate(n,null,{},o,h)}interpolate(){return!1}}class d{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const n in e){const o=e[n];o.specification.overridable&&this.overridableProperties.push(n);const h=this.defaultPropertyValues[n]=new Lo(o,void 0),p=this.defaultTransitionablePropertyValues[n]=new Za(o);this.defaultTransitioningPropertyValues[n]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=h.possiblyEvaluate({})}}}Ft("DataDrivenProperty",Wt),Ft("DataConstantProperty",Vt),Ft("CrossFadedDataDrivenProperty",ja),Ft("CrossFadedProperty",qa),Ft("ColorRampProperty",gl);const t="-transition";class s extends $r{constructor(e,n){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new ya(n.layout)),n.paint)){this._transitionablePaint=new Ua(n.paint);for(const o in e.paint)this.setPaintProperty(o,e.paint[o],{validate:!1});for(const o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new va(n.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,n,o={}){n!=null&&this._validate(ui,`layers.${this.id}.layout.${e}`,e,n,o)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,n):this.visibility=n)}getPaintProperty(e){return e.endsWith(t)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,n,o={}){if(n!=null&&this._validate(Ai,`layers.${this.id}.paint.${e}`,e,n,o))return!1;if(e.endsWith(t))return this._transitionablePaint.setTransition(e.slice(0,-11),n||void 0),!1;{const h=this._transitionablePaint._values[e],p=h.property.specification["property-type"]==="cross-faded-data-driven",f=h.value.isDataDriven(),g=h.value;this._transitionablePaint.setValue(e,n),this._handleSpecialPaintPropertyUpdate(e);const v=this._transitionablePaint._values[e].value;return v.isDataDriven()||f||p||this._handleOverridablePaintPropertyUpdate(e,g,v)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,n,o){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,n){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,n)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,n)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),xs(e,(n,o)=>!(n===void 0||o==="layout"&&!Object.keys(n).length||o==="paint"&&!Object.keys(n).length))}_validate(e,n,o,h,p={}){return(!p||p.validate!==!1)&&Wi(this,e.call(Bt,{key:n,layerType:this.type,objectKey:o,value:h,styleSpec:ut,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const n=this.paint.get(e);if(n instanceof Vr&&Ms(n.property.specification)&&(n.value.kind==="source"||n.value.kind==="composite")&&n.value.isStateDependent)return!0}return!1}}const a={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class l{constructor(e,n){this._structArray=e,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class u{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,n){return e._trim(),n&&(e.isTransferred=!0,n.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const n=Object.create(this.prototype);return n.arrayBuffer=e.arrayBuffer,n.length=e.length,n.capacity=e.arrayBuffer.byteLength/n.bytesPerElement,n._refreshViews(),n}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const n=this.uint8;this._refreshViews(),n&&this.uint8.set(n)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function y(i,e=1){let n=0,o=0;return{members:i.map(h=>{const p=a[h.type].BYTES_PER_ELEMENT,f=n=x(n,Math.max(e,p)),g=h.components||1;return o=Math.max(o,p),n+=p*g,{name:h.name,type:h.type,components:g,offset:f}}),size:x(n,Math.max(o,e)),alignment:e}}function x(i,e){return Math.ceil(i/e)*e}class w extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,n)}emplace(e,n,o){const h=2*e;return this.int16[h+0]=n,this.int16[h+1]=o,e}}w.prototype.bytesPerElement=4,Ft("StructArrayLayout2i4",w);class S extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,n,o)}emplace(e,n,o,h){const p=3*e;return this.int16[p+0]=n,this.int16[p+1]=o,this.int16[p+2]=h,e}}S.prototype.bytesPerElement=6,Ft("StructArrayLayout3i6",S);class C extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,n,o,h)}emplace(e,n,o,h,p){const f=4*e;return this.int16[f+0]=n,this.int16[f+1]=o,this.int16[f+2]=h,this.int16[f+3]=p,e}}C.prototype.bytesPerElement=8,Ft("StructArrayLayout4i8",C);class A extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f){const g=this.length;return this.resize(g+1),this.emplace(g,e,n,o,h,p,f)}emplace(e,n,o,h,p,f,g){const v=6*e;return this.int16[v+0]=n,this.int16[v+1]=o,this.int16[v+2]=h,this.int16[v+3]=p,this.int16[v+4]=f,this.int16[v+5]=g,e}}A.prototype.bytesPerElement=12,Ft("StructArrayLayout2i4i12",A);class B extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f){const g=this.length;return this.resize(g+1),this.emplace(g,e,n,o,h,p,f)}emplace(e,n,o,h,p,f,g){const v=4*e,T=8*e;return this.int16[v+0]=n,this.int16[v+1]=o,this.uint8[T+4]=h,this.uint8[T+5]=p,this.uint8[T+6]=f,this.uint8[T+7]=g,e}}B.prototype.bytesPerElement=8,Ft("StructArrayLayout2i4ub8",B);class Z extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,n)}emplace(e,n,o){const h=2*e;return this.float32[h+0]=n,this.float32[h+1]=o,e}}Z.prototype.bytesPerElement=8,Ft("StructArrayLayout2f8",Z);class U extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f,g,v,T,P){const M=this.length;return this.resize(M+1),this.emplace(M,e,n,o,h,p,f,g,v,T,P)}emplace(e,n,o,h,p,f,g,v,T,P,M){const k=10*e;return this.uint16[k+0]=n,this.uint16[k+1]=o,this.uint16[k+2]=h,this.uint16[k+3]=p,this.uint16[k+4]=f,this.uint16[k+5]=g,this.uint16[k+6]=v,this.uint16[k+7]=T,this.uint16[k+8]=P,this.uint16[k+9]=M,e}}U.prototype.bytesPerElement=20,Ft("StructArrayLayout10ui20",U);class G extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f,g,v,T,P,M,k){const D=this.length;return this.resize(D+1),this.emplace(D,e,n,o,h,p,f,g,v,T,P,M,k)}emplace(e,n,o,h,p,f,g,v,T,P,M,k,D){const R=12*e;return this.int16[R+0]=n,this.int16[R+1]=o,this.int16[R+2]=h,this.int16[R+3]=p,this.uint16[R+4]=f,this.uint16[R+5]=g,this.uint16[R+6]=v,this.uint16[R+7]=T,this.int16[R+8]=P,this.int16[R+9]=M,this.int16[R+10]=k,this.int16[R+11]=D,e}}G.prototype.bytesPerElement=24,Ft("StructArrayLayout4i4ui4i24",G);class X extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,n,o)}emplace(e,n,o,h){const p=3*e;return this.float32[p+0]=n,this.float32[p+1]=o,this.float32[p+2]=h,e}}X.prototype.bytesPerElement=12,Ft("StructArrayLayout3f12",X);class K extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.uint32[1*e+0]=n,e}}K.prototype.bytesPerElement=4,Ft("StructArrayLayout1ul4",K);class Q extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f,g,v,T){const P=this.length;return this.resize(P+1),this.emplace(P,e,n,o,h,p,f,g,v,T)}
vendor: 17,952 bytes, line 8
8emplace(e,n,o,h,p,f,g,v,T,P){const M=10*e,k=5*e;return this.int16[M+0]=n,this.int16[M+1]=o,this.int16[M+2]=h,this.int16[M+3]=p,this.int16[M+4]=f,this.int16[M+5]=g,this.uint32[k+3]=v,this.uint16[M+8]=T,this.uint16[M+9]=P,e}}Q.prototype.bytesPerElement=20,Ft("StructArrayLayout6i1ul2ui20",Q);class j extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f){const g=this.length;return this.resize(g+1),this.emplace(g,e,n,o,h,p,f)}emplace(e,n,o,h,p,f,g){const v=6*e;return this.int16[v+0]=n,this.int16[v+1]=o,this.int16[v+2]=h,this.int16[v+3]=p,this.int16[v+4]=f,this.int16[v+5]=g,e}}j.prototype.bytesPerElement=12,Ft("StructArrayLayout2i2i2i12",j);class nt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,n,o,h,p)}emplace(e,n,o,h,p,f){const g=4*e,v=8*e;return this.float32[g+0]=n,this.float32[g+1]=o,this.float32[g+2]=h,this.int16[v+6]=p,this.int16[v+7]=f,e}}nt.prototype.bytesPerElement=16,Ft("StructArrayLayout2f1f2i16",nt);class rt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f){const g=this.length;return this.resize(g+1),this.emplace(g,e,n,o,h,p,f)}emplace(e,n,o,h,p,f,g){const v=16*e,T=4*e,P=8*e;return this.uint8[v+0]=n,this.uint8[v+1]=o,this.float32[T+1]=h,this.float32[T+2]=p,this.int16[P+6]=f,this.int16[P+7]=g,e}}rt.prototype.bytesPerElement=16,Ft("StructArrayLayout2ub2f2i16",rt);class ht extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,n,o)}emplace(e,n,o,h){const p=3*e;return this.uint16[p+0]=n,this.uint16[p+1]=o,this.uint16[p+2]=h,e}}ht.prototype.bytesPerElement=6,Ft("StructArrayLayout3ui6",ht);class yt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W){const at=this.length;return this.resize(at+1),this.emplace(at,e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W)}emplace(e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W,at){const et=24*e,st=12*e,mt=48*e;return this.int16[et+0]=n,this.int16[et+1]=o,this.uint16[et+2]=h,this.uint16[et+3]=p,this.uint32[st+2]=f,this.uint32[st+3]=g,this.uint32[st+4]=v,this.uint16[et+10]=T,this.uint16[et+11]=P,this.uint16[et+12]=M,this.float32[st+7]=k,this.float32[st+8]=D,this.uint8[mt+36]=R,this.uint8[mt+37]=N,this.uint8[mt+38]=$,this.uint32[st+10]=W,this.int16[et+22]=at,e}}yt.prototype.bytesPerElement=48,Ft("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yt);class Tt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W,at,et,st,mt,wt,Dt,Ht,Et,kt,qt,Nt){const Ot=this.length;return this.resize(Ot+1),this.emplace(Ot,e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W,at,et,st,mt,wt,Dt,Ht,Et,kt,qt,Nt)}emplace(e,n,o,h,p,f,g,v,T,P,M,k,D,R,N,$,W,at,et,st,mt,wt,Dt,Ht,Et,kt,qt,Nt,Ot){const gt=32*e,$t=16*e;return this.int16[gt+0]=n,this.int16[gt+1]=o,this.int16[gt+2]=h,this.int16[gt+3]=p,this.int16[gt+4]=f,this.int16[gt+5]=g,this.int16[gt+6]=v,this.int16[gt+7]=T,this.uint16[gt+8]=P,this.uint16[gt+9]=M,this.uint16[gt+10]=k,this.uint16[gt+11]=D,this.uint16[gt+12]=R,this.uint16[gt+13]=N,this.uint16[gt+14]=$,this.uint16[gt+15]=W,this.uint16[gt+16]=at,this.uint16[gt+17]=et,this.uint16[gt+18]=st,this.uint16[gt+19]=mt,this.uint16[gt+20]=wt,this.uint16[gt+21]=Dt,this.uint16[gt+22]=Ht,this.uint32[$t+12]=Et,this.float32[$t+13]=kt,this.float32[$t+14]=qt,this.uint16[gt+30]=Nt,this.uint16[gt+31]=Ot,e}}Tt.prototype.bytesPerElement=64,Ft("StructArrayLayout8i15ui1ul2f2ui64",Tt);class zt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.float32[1*e+0]=n,e}}zt.prototype.bytesPerElement=4,Ft("StructArrayLayout1f4",zt);class Rt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,n,o)}emplace(e,n,o,h){const p=3*e;return this.uint16[6*e+0]=n,this.float32[p+1]=o,this.float32[p+2]=h,e}}Rt.prototype.bytesPerElement=12,Ft("StructArrayLayout1ui2f12",Rt);class Ct extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,o){const h=this.length;return this.resize(h+1),this.emplace(h,e,n,o)}emplace(e,n,o,h){const p=4*e;return this.uint32[2*e+0]=n,this.uint16[p+2]=o,this.uint16[p+3]=h,e}}Ct.prototype.bytesPerElement=8,Ft("StructArrayLayout1ul2ui8",Ct);class It extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,n)}emplace(e,n,o){const h=2*e;return this.uint16[h+0]=n,this.uint16[h+1]=o,e}}It.prototype.bytesPerElement=4,Ft("StructArrayLayout2ui4",It);class Zt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.uint16[1*e+0]=n,e}}Zt.prototype.bytesPerElement=2,Ft("StructArrayLayout1ui2",Zt);class ee extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,o,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,n,o,h)}emplace(e,n,o,h,p){const f=4*e;return this.float32[f+0]=n,this.float32[f+1]=o,this.float32[f+2]=h,this.float32[f+3]=p,e}}ee.prototype.bytesPerElement=16,Ft("StructArrayLayout4f16",ee);class At extends l{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new bt(this.anchorPointX,this.anchorPointY)}}At.prototype.size=20;class Lt extends Q{get(e){return new At(this,e)}}Ft("CollisionBoxArray",Lt);class Yt extends l{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Yt.prototype.size=48;class Ke extends yt{get(e){return new Yt(this,e)}}Ft("PlacedSymbolArray",Ke);class pe extends l{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}pe.prototype.size=64;class we extends Tt{get(e){return new pe(this,e)}}Ft("SymbolInstanceArray",we);class Je extends zt{getoffsetX(e){return this.float32[1*e+0]}}Ft("GlyphOffsetArray",Je);class Xi extends S{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ft("SymbolLineVertexArray",Xi);class _r extends l{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}_r.prototype.size=12;class Ye extends Rt{get(e){return new _r(this,e)}}Ft("TextAnchorOffsetArray",Ye);class Tn extends l{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Tn.prototype.size=8;class pn extends Ct{get(e){return new Tn(this,e)}}Ft("FeatureIndexArray",pn);class Ki extends w{}class fn extends w{}class Zr extends w{}class Do extends A{}class $a extends B{}class Bo extends Z{}class Qn extends U{}class Ga extends G{}class yl extends X{}class tr extends K{}class er extends j{}class Fs extends rt{}class gr extends ht{}class Fi extends It{}const Ji=y([{name:"a_pos",components:2,type:"Int16"}],4),{members:Fn}=Ji;class Ie{constructor(e=[]){this.segments=e}prepareSegment(e,n,o,h){let p=this.segments[this.segments.length-1];return e>Ie.MAX_VERTEX_ARRAY_LENGTH&&Si(`Max vertices per segment is ${Ie.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!p||p.vertexLength+e>Ie.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==h)&&(p={vertexOffset:n.length,primitiveOffset:o.length,vertexLength:0,primitiveLength:0},h!==void 0&&(p.sortKey=h),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const e of this.segments)for(const n in e.vaos)e.vaos[n].destroy()}static simpleSegment(e,n,o,h){return new Ie([{vertexOffset:e,primitiveOffset:n,vertexLength:o,primitiveLength:h,vaos:{},sortKey:0}])}}function no(i,e){return 256*(i=Vi(Math.floor(i),0,255))+Vi(Math.floor(e),0,255)}Ie.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ft("SegmentVector",Ie);const Ro=y([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Fo={exports:{}},Nl={exports:{}};Nl.exports=function(i,e){var n,o,h,p,f,g,v,T;for(o=i.length-(n=3&i.length),h=e,f=3432918353,g=461845907,T=0;T<o;)v=255&i.charCodeAt(T)|(255&i.charCodeAt(++T))<<8|(255&i.charCodeAt(++T))<<16|(255&i.charCodeAt(++T))<<24,++T,h=27492+(65535&(p=5*(65535&(h=(h^=v=(65535&(v=(v=(65535&v)*f+(((v>>>16)*f&65535)<<16)&4294967295)<<15|v>>>17))*g+(((v>>>16)*g&65535)<<16)&4294967295)<<13|h>>>19))+((5*(h>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(v=0,n){case 3:v^=(255&i.charCodeAt(T+2))<<16;case 2:v^=(255&i.charCodeAt(T+1))<<8;case 1:h^=v=(65535&(v=(v=(65535&(v^=255&i.charCodeAt(T)))*f+(((v>>>16)*f&65535)<<16)&4294967295)<<15|v>>>17))*g+(((v>>>16)*g&65535)<<16)&4294967295}return h^=i.length,h=2246822507*(65535&(h^=h>>>16))+((2246822507*(h>>>16)&65535)<<16)&4294967295,h=3266489909*(65535&(h^=h>>>13))+((3266489909*(h>>>16)&65535)<<16)&4294967295,(h^=h>>>16)>>>0};var uh=Nl.exports,Vl={exports:{}};Vl.exports=function(i,e){for(var n,o=i.length,h=e^o,p=0;o>=4;)n=1540483477*(65535&(n=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(n>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),o-=4,++p;switch(o){case 3:h^=(255&i.charCodeAt(p+2))<<16;case 2:h^=(255&i.charCodeAt(p+1))<<8;case 1:h=1540483477*(65535&(h^=255&i.charCodeAt(p)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0};var Os=uh,Zl=Vl.exports;Fo.exports=Os,Fo.exports.murmur3=Os,Fo.exports.murmur2=Zl;var Ha=ae(Fo.exports);class xa{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,n,o,h){this.ids.push(Wa(e)),this.positions.push(n,o,h)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const n=Wa(e);let o=0,h=this.ids.length-1;for(;o<h;){const f=o+h>>1;this.ids[f]>=n?h=f:o=f+1}const p=[];for(;this.ids[o]===n;)p.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return p}static serialize(e,n){const o=new Float64Array(e.ids),h=new Uint32Array(e.positions);return Xa(o,h,0,o.length-1),n&&n.push(o.buffer,h.buffer),{ids:o,positions:h}}static deserialize(e){const n=new xa;return n.ids=e.ids,n.positions=e.positions,n.indexed=!0,n}}function Wa(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Ha(String(i))}function Xa(i,e,n,o){for(;n<o;){const h=i[n+o>>1];let p=n-1,f=o+1;for(;;){do p++;while(i[p]<h);do f--;while(i[f]>h);if(p>=f)break;Oo(i,p,f),Oo(e,3*p,3*f),Oo(e,3*p+1,3*f+1),Oo(e,3*p+2,3*f+2)}f-n<o-f?(Xa(i,e,n,f),n=f+1):(Xa(i,e,f+1,o),o=f)}}function Oo(i,e,n){const o=i[e];i[e]=i[n],i[n]=o}Ft("FeaturePositionMap",xa);class ba{constructor(e,n){this.gl=e.gl,this.location=n}}class Ul extends ba{constructor(e,n){super(e,n),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class ec extends ba{constructor(e,n){super(e,n),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class ic extends ba{constructor(e,n){super(e,n),this.current=Be.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const ju=new Float32Array(16);function dh(i){return[no(255*i.r,255*i.g),no(255*i.b,255*i.a)]}class vl{constructor(e,n,o){this.value=e,this.uniformNames=n.map(h=>`u_${h}`),this.type=o}setUniform(e,n,o){e.set(o.constantOr(this.value))}getBinding(e,n,o){return this.type==="color"?new ic(e,n):new Ul(e,n)}}class Ka{constructor(e,n){this.uniformNames=n.map(o=>`u_${o}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,n){this.pixelRatioFrom=n.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=n.tlbr,this.patternTo=e.tlbr}setUniform(e,n,o,h){const p=h==="u_pattern_to"?this.patternTo:h==="u_pattern_from"?this.patternFrom:h==="u_pixel_ratio_to"?this.pixelRatioTo:h==="u_pixel_ratio_from"?this.pixelRatioFrom:null;p&&e.set(p)}getBinding(e,n,o){return o.substr(0,9)==="u_pattern"?new ec(e,n):new Ul(e,n)}}class ro{constructor(e,n,o,h){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=n.map(p=>({name:`a_${p}`,type:"Float32",components:o==="color"?2:1,offset:0})),this.paintVertexArray=new h}populatePaintArray(e,n,o,h,p){const f=this.paintVertexArray.length,g=this.expression.evaluate(new Xe(0),n,{},h,[],p);this.paintVertexArray.resize(e),this._setPaintValue(f,e,g)}updatePaintArray(e,n,o,h){const p=this.expression.evaluate({zoom:0},o,h);this._setPaintValue(e,n,p)}
vendor: 5,070 bytes, line 8
8_setPaintValue(e,n,o){if(this.type==="color"){const h=dh(o);for(let p=e;p<n;p++)this.paintVertexArray.emplace(p,h[0],h[1])}else{for(let h=e;h<n;h++)this.paintVertexArray.emplace(h,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ms{constructor(e,n,o,h,p,f){this.expression=e,this.uniformNames=n.map(g=>`u_${g}_t`),this.type=o,this.useIntegerZoom=h,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=n.map(g=>({name:`a_${g}`,type:"Float32",components:o==="color"?4:2,offset:0})),this.paintVertexArray=new f}populatePaintArray(e,n,o,h,p){const f=this.expression.evaluate(new Xe(this.zoom),n,{},h,[],p),g=this.expression.evaluate(new Xe(this.zoom+1),n,{},h,[],p),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,e,f,g)}updatePaintArray(e,n,o,h){const p=this.expression.evaluate({zoom:this.zoom},o,h),f=this.expression.evaluate({zoom:this.zoom+1},o,h);this._setPaintValue(e,n,p,f)}_setPaintValue(e,n,o,h){if(this.type==="color"){const p=dh(o),f=dh(h);for(let g=e;g<n;g++)this.paintVertexArray.emplace(g,p[0],p[1],f[0],f[1])}else{for(let p=e;p<n;p++)this.paintVertexArray.emplace(p,o,h);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(h))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,n){const o=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,h=Vi(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(h)}getBinding(e,n,o){return new Ul(e,n)}}class No{constructor(e,n,o,h,p,f){this.expression=e,this.type=n,this.useIntegerZoom=o,this.zoom=h,this.layerId=f,this.zoomInPaintVertexArray=new p,this.zoomOutPaintVertexArray=new p}populatePaintArray(e,n,o){const h=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(h,e,n.patterns&&n.patterns[this.layerId],o)}updatePaintArray(e,n,o,h,p){this._setPaintValues(e,n,o.patterns&&o.patterns[this.layerId],p)}_setPaintValues(e,n,o,h){if(!h||!o)return;const{min:p,mid:f,max:g}=o,v=h[p],T=h[f],P=h[g];if(v&&T&&P)for(let M=e;M<n;M++)this.zoomInPaintVertexArray.emplace(M,T.tl[0],T.tl[1],T.br[0],T.br[1],v.tl[0],v.tl[1],v.br[0],v.br[1],T.pixelRatio,v.pixelRatio),this.zoomOutPaintVertexArray.emplace(M,T.tl[0],T.tl[1],T.br[0],T.br[1],P.tl[0],P.tl[1],P.br[0],P.br[1],T.pixelRatio,P.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Ro.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Ro.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class nc{constructor(e,n,o){this.binders={},this._buffers=[];const h=[];for(const p in e.paint._values){if(!o(p))continue;const f=e.paint.get(p);if(!(f instanceof Vr&&Ms(f.property.specification)))continue;const g=qu(p,e.type),v=f.value,T=f.property.specification.type,P=f.property.useIntegerZoom,M=f.property.specification["property-type"],k=M==="cross-faded"||M==="cross-faded-data-driven";if(v.kind==="constant")this.binders[p]=k?new Ka(v.value,g):new vl(v.value,g,T),h.push(`/u_${p}`);else if(v.kind==="source"||k){const D=rc(p,T,"source");this.binders[p]=k?new No(v,T,P,n,D,e.id):new ro(v,g,T,D),h.push(`/a_${p}`)}else{const D=rc(p,T,"composite");this.binders[p]=new ms(v,g,T,P,n,D),h.push(`/z_${p}`)}}this.cacheKey=h.sort().join("")}getMaxValue(e){const n=this.binders[e];return n instanceof ro||n instanceof ms?n.maxValue:0}populatePaintArrays(e,n,o,h,p){for(const f in this.binders){const g=this.binders[f];(g instanceof ro||g instanceof ms||g instanceof No)&&g.populatePaintArray(e,n,o,h,p)}}setConstantPatternPositions(e,n){for(const o in this.binders){const h=this.binders[o];h instanceof Ka&&h.setConstantPatternPositions(e,n)}}updatePaintArrays(e,n,o,h,p){let f=!1;for(const g in e){const v=n.getPositions(g);for(const T of v){const P=o.feature(T.index);for(const M in this.binders){const k=this.binders[M];if((k instanceof ro||k instanceof ms||k instanceof No)&&k.expression.isStateDependent===!0){const D=h.paint.get(M);k.expression=D.value,k.updatePaintArray(T.start,T.end,P,e[g],p),f=!0}}}}return f}
vendor: 37,276 bytes, line 8
8defines(){const e=[];for(const n in this.binders){const o=this.binders[n];(o instanceof vl||o instanceof Ka)&&e.push(...o.uniformNames.map(h=>`#define HAS_UNIFORM_${h}`))}return e}getBinderAttributes(){const e=[];for(const n in this.binders){const o=this.binders[n];if(o instanceof ro||o instanceof ms)for(let h=0;h<o.paintVertexAttributes.length;h++)e.push(o.paintVertexAttributes[h].name);else if(o instanceof No)for(let h=0;h<Ro.members.length;h++)e.push(Ro.members[h].name)}return e}getBinderUniforms(){const e=[];for(const n in this.binders){const o=this.binders[n];if(o instanceof vl||o instanceof Ka||o instanceof ms)for(const h of o.uniformNames)e.push(h)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,n){const o=[];for(const h in this.binders){const p=this.binders[h];if(p instanceof vl||p instanceof Ka||p instanceof ms){for(const f of p.uniformNames)if(n[f]){const g=p.getBinding(e,n[f],f);o.push({name:f,property:h,binding:g})}}}return o}setUniforms(e,n,o,h){for(const{name:p,property:f,binding:g}of n)this.binders[f].setUniform(g,h,o.get(f),p)}updatePaintBuffers(e){this._buffers=[];for(const n in this.binders){const o=this.binders[n];if(e&&o instanceof No){const h=e.fromScale===2?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;h&&this._buffers.push(h)}else(o instanceof ro||o instanceof ms)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(const n in this.binders){const o=this.binders[n];(o instanceof ro||o instanceof ms||o instanceof No)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const n=this.binders[e];(n instanceof ro||n instanceof ms||n instanceof No)&&n.destroy()}}}class wa{constructor(e,n,o=()=>!0){this.programConfigurations={};for(const h of e)this.programConfigurations[h.id]=new nc(h,n,o);this.needsUpload=!1,this._featureMap=new xa,this._bufferOffset=0}populatePaintArrays(e,n,o,h,p,f){for(const g in this.programConfigurations)this.programConfigurations[g].populatePaintArrays(e,n,h,p,f);n.id!==void 0&&this._featureMap.add(n.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,n,o,h){for(const p of o)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(e,this._featureMap,n,p,h)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const n in this.programConfigurations)this.programConfigurations[n].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function qu(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function rc(i,e,n){const o={color:{source:Z,composite:ee},number:{source:zt,composite:Z}},h=function(p){return{"line-pattern":{source:Qn,composite:Qn},"fill-pattern":{source:Qn,composite:Qn},"fill-extrusion-pattern":{source:Qn,composite:Qn}}[p]}(i);return h&&h[n]||o[e][n]}Ft("ConstantBinder",vl),Ft("CrossFadedConstantBinder",Ka),Ft("SourceExpressionBinder",ro),Ft("CrossFadedCompositeBinder",No),Ft("CompositeExpressionBinder",ms),Ft("ProgramConfiguration",nc,{omit:["_buffers"]}),Ft("ProgramConfigurationSet",wa);const xi=8192,ph=Math.pow(2,14)-1,sc=-ph-1;function Ta(i){const e=xi/i.extent,n=i.loadGeometry();for(let o=0;o<n.length;o++){const h=n[o];for(let p=0;p<h.length;p++){const f=h[p],g=Math.round(f.x*e),v=Math.round(f.y*e);f.x=Vi(g,sc,ph),f.y=Vi(v,sc,ph),(g<f.x||g>f.x+1||v<f.y||v>f.y+1)&&Si("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return n}function Pa(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Ta(i):[]}}function jl(i,e,n,o,h){i.emplaceBack(2*e+(o+1)/2,2*n+(h+1)/2)}class fh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new fn,this.indexArray=new gr,this.segments=new Ie,this.programConfigurations=new wa(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,o){const h=this.layers[0],p=[];let f=null,g=!1;h.type==="circle"&&(f=h.layout.get("circle-sort-key"),g=!f.isConstant());for(const{feature:v,id:T,index:P,sourceLayerIndex:M}of e){const k=this.layers[0]._featureFilter.needGeometry,D=Pa(v,k);if(!this.layers[0]._featureFilter.filter(new Xe(this.zoom),D,o))continue;const R=g?f.evaluate(D,{},o):void 0,N={id:T,properties:v.properties,type:v.type,sourceLayerIndex:M,index:P,geometry:k?D.geometry:Ta(v),patterns:{},sortKey:R};p.push(N)}g&&p.sort((v,T)=>v.sortKey-T.sortKey);for(const v of p){const{geometry:T,index:P,sourceLayerIndex:M}=v,k=e[P].feature;this.addFeature(v,T,P,o),n.featureIndex.insert(k,T,P,M,this.index)}}update(e,n,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fn),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,n,o,h){for(const p of n)for(const f of p){const g=f.x,v=f.y;if(g<0||g>=xi||v<0||v>=xi)continue;const T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),P=T.vertexLength;jl(this.layoutVertexArray,g,v,-1,-1),jl(this.layoutVertexArray,g,v,1,-1),jl(this.layoutVertexArray,g,v,1,1),jl(this.layoutVertexArray,g,v,-1,1),this.indexArray.emplaceBack(P,P+1,P+2),this.indexArray.emplaceBack(P,P+3,P+2),T.vertexLength+=4,T.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},h)}}function oc(i,e){for(let n=0;n<i.length;n++)if(Ja(e,i[n]))return!0;for(let n=0;n<e.length;n++)if(Ja(i,e[n]))return!0;return!!mh(i,e)}function $u(i,e,n){return!!Ja(i,e)||!!_h(e,i,n)}function ac(i,e){if(i.length===1)return hc(e,i[0]);for(let n=0;n<e.length;n++){const o=e[n];for(let h=0;h<o.length;h++)if(Ja(i,o[h]))return!0}for(let n=0;n<i.length;n++)if(hc(e,i[n]))return!0;for(let n=0;n<e.length;n++)if(mh(i,e[n]))return!0;return!1}function Gu(i,e,n){if(i.length>1){if(mh(i,e))return!0;for(let o=0;o<e.length;o++)if(_h(e[o],i,n))return!0}for(let o=0;o<i.length;o++)if(_h(i[o],e,n))return!0;return!1}function mh(i,e){if(i.length===0||e.length===0)return!1;for(let n=0;n<i.length-1;n++){const o=i[n],h=i[n+1];for(let p=0;p<e.length-1;p++)if(Hu(o,h,e[p],e[p+1]))return!0}return!1}function Hu(i,e,n,o){return ei(i,n,o)!==ei(e,n,o)&&ei(i,e,n)!==ei(i,e,o)}function _h(i,e,n){const o=n*n;if(e.length===1)return i.distSqr(e[0])<o;for(let h=1;h<e.length;h++)if(lc(i,e[h-1],e[h])<o)return!0;return!1}function lc(i,e,n){const o=e.distSqr(n);if(o===0)return i.distSqr(e);const h=((i.x-e.x)*(n.x-e.x)+(i.y-e.y)*(n.y-e.y))/o;return i.distSqr(h<0?e:h>1?n:n.sub(e)._mult(h)._add(e))}function hc(i,e){let n,o,h,p=!1;for(let f=0;f<i.length;f++){n=i[f];for(let g=0,v=n.length-1;g<n.length;v=g++)o=n[g],h=n[v],o.y>e.y!=h.y>e.y&&e.x<(h.x-o.x)*(e.y-o.y)/(h.y-o.y)+o.x&&(p=!p)}return p}function Ja(i,e){let n=!1;for(let o=0,h=i.length-1;o<i.length;h=o++){const p=i[o],f=i[h];p.y>e.y!=f.y>e.y&&e.x<(f.x-p.x)*(e.y-p.y)/(f.y-p.y)+p.x&&(n=!n)}return n}function Wu(i,e,n){const o=n[0],h=n[2];if(i.x<o.x&&e.x<o.x||i.x>h.x&&e.x>h.x||i.y<o.y&&e.y<o.y||i.y>h.y&&e.y>h.y)return!1;const p=ei(i,e,n[0]);return p!==ei(i,e,n[1])||p!==ei(i,e,n[2])||p!==ei(i,e,n[3])}function xl(i,e,n){const o=e.paint.get(i).value;return o.kind==="constant"?o.value:n.programConfigurations.get(e.id).getMaxValue(i)}function ql(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function $l(i,e,n,o,h){if(!e[0]&&!e[1])return i;const p=bt.convert(e)._mult(h);n==="viewport"&&p._rotate(-o);const f=[];for(let g=0;g<i.length;g++)f.push(i[g].sub(p));return f}let cc,uc;Ft("CircleBucket",fh,{omit:["layers"]});var Xu={get paint(){return uc=uc||new d({"circle-radius":new Wt(ut.paint_circle["circle-radius"]),"circle-color":new Wt(ut.paint_circle["circle-color"]),"circle-blur":new Wt(ut.paint_circle["circle-blur"]),"circle-opacity":new Wt(ut.paint_circle["circle-opacity"]),"circle-translate":new Vt(ut.paint_circle["circle-translate"]),"circle-translate-anchor":new Vt(ut.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vt(ut.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vt(ut.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Wt(ut.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Wt(ut.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Wt(ut.paint_circle["circle-stroke-opacity"])})},get layout(){return cc=cc||new d({"circle-sort-key":new Wt(ut.layout_circle["circle-sort-key"])})}},Pn=1e-6,Ya=typeof Float32Array<"u"?Float32Array:Array;function gh(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function dc(i,e,n){var o=e[0],h=e[1],p=e[2],f=e[3],g=e[4],v=e[5],T=e[6],P=e[7],M=e[8],k=e[9],D=e[10],R=e[11],N=e[12],$=e[13],W=e[14],at=e[15],et=n[0],st=n[1],mt=n[2],wt=n[3];return i[0]=et*o+st*g+mt*M+wt*N,i[1]=et*h+st*v+mt*k+wt*$,i[2]=et*p+st*T+mt*D+wt*W,i[3]=et*f+st*P+mt*R+wt*at,i[4]=(et=n[4])*o+(st=n[5])*g+(mt=n[6])*M+(wt=n[7])*N,i[5]=et*h+st*v+mt*k+wt*$,i[6]=et*p+st*T+mt*D+wt*W,i[7]=et*f+st*P+mt*R+wt*at,i[8]=(et=n[8])*o+(st=n[9])*g+(mt=n[10])*M+(wt=n[11])*N,i[9]=et*h+st*v+mt*k+wt*$,i[10]=et*p+st*T+mt*D+wt*W,i[11]=et*f+st*P+mt*R+wt*at,i[12]=(et=n[12])*o+(st=n[13])*g+(mt=n[14])*M+(wt=n[15])*N,i[13]=et*h+st*v+mt*k+wt*$,i[14]=et*p+st*T+mt*D+wt*W,i[15]=et*f+st*P+mt*R+wt*at,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var bl,Ku=dc;function Gl(i,e,n){var o=e[0],h=e[1],p=e[2],f=e[3];return i[0]=n[0]*o+n[4]*h+n[8]*p+n[12]*f,i[1]=n[1]*o+n[5]*h+n[9]*p+n[13]*f,i[2]=n[2]*o+n[6]*h+n[10]*p+n[14]*f,i[3]=n[3]*o+n[7]*h+n[11]*p+n[15]*f,i}bl=new Ya(4),Ya!=Float32Array&&(bl[0]=0,bl[1]=0,bl[2]=0,bl[3]=0);class Ju extends s{constructor(e){super(e,Xu)}createBucket(e){return new fh(e)}queryRadius(e){const n=e;return xl("circle-radius",this,n)+xl("circle-stroke-width",this,n)+ql(this.paint.get("circle-translate"))}queryIntersectsFeature(e,n,o,h,p,f,g,v){const T=$l(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),f.angle,g),P=this.paint.get("circle-radius").evaluate(n,o)+this.paint.get("circle-stroke-width").evaluate(n,o),M=this.paint.get("circle-pitch-alignment")==="map",k=M?T:function(R,N){return R.map($=>pc($,N))}(T,v),D=M?P*g:P;for(const R of h)for(const N of R){const $=M?N:pc(N,v);let W=D;const at=Gl([],[N.x,N.y,0,1],v);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?W*=at[3]/f.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(W*=f.cameraToCenterDistance/at[3]),$u(k,$,W))return!0}return!1}}function pc(i,e){const n=Gl([],[i.x,i.y,0,1],e);return new bt(n[0]/n[3],n[1]/n[3])}class fc extends fh{}let mc;Ft("HeatmapBucket",fc,{omit:["layers"]});var Yu={get paint(){return mc=mc||new d({"heatmap-radius":new Wt(ut.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wt(ut.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vt(ut.paint_heatmap["heatmap-intensity"]),"heatmap-color":new gl(ut.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vt(ut.paint_heatmap["heatmap-opacity"])})}};function yh(i,{width:e,height:n},o,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==e*n*o)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${e*n*o}`)}else h=new Uint8Array(e*n*o);return i.width=e,i.height=n,i.data=h,i}function _c(i,{width:e,height:n},o){if(e===i.width&&n===i.height)return;const h=yh({},{width:e,height:n},o);vh(i,h,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,n)},o),i.width=e,i.height=n,i.data=h.data}function vh(i,e,n,o,h,p){if(h.width===0||h.height===0)return e;if(h.width>i.width||h.height>i.height||n.x>i.width-h.width||n.y>i.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>e.width||h.height>e.height||o.x>e.width-h.width||o.y>e.height-h.height)throw new RangeError("out of range destination coordinates for image copy");const f=i.data,g=e.data;if(f===g)throw new Error("srcData equals dstData, so image is already copied");for(let v=0;v<h.height;v++){const T=((n.y+v)*i.width+n.x)*p,P=((o.y+v)*e.width+o.x)*p;for(let M=0;M<h.width*p;M++)g[P+M]=f[T+M]}return e}class wl{constructor(e,n){yh(this,e,1,n)}resize(e){_c(this,e,1)}clone(){return new wl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,n,o,h,p){vh(e,n,o,h,p,1)}}class yr{constructor(e,n){yh(this,e,4,n)}resize(e){_c(this,e,4)}replace(e,n){n?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new yr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,n,o,h,p){vh(e,n,o,h,p,4)}}function gc(i){const e={},n=i.resolution||256,o=i.clips?i.clips.length:1,h=i.image||new yr({width:n,height:o});if(Math.log(n)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${n}`);const p=(f,g,v)=>{e[i.evaluationKey]=v;const T=i.expression.evaluate(e);h.data[f+g+0]=Math.floor(255*T.r/T.a),h.data[f+g+1]=Math.floor(255*T.g/T.a),h.data[f+g+2]=Math.floor(255*T.b/T.a),h.data[f+g+3]=Math.floor(255*T.a)};if(i.clips)for(let f=0,g=0;f<o;++f,g+=4*n)for(let v=0,T=0;v<n;v++,T+=4){const P=v/(n-1),{start:M,end:k}=i.clips[f];p(g,T,M*(1-P)+k*P)}else for(let f=0,g=0;f<n;f++,g+=4)p(0,g,f/(n-1));return h}Ft("AlphaImage",wl),Ft("RGBAImage",yr);const xh="big-fb";class Qu extends s{createBucket(e){return new fc(e)}constructor(e){super(e,Yu),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=gc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(xh)&&this.heatmapFbos.delete(xh)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let yc;var td={get paint(){return yc=yc||new d({"hillshade-illumination-direction":new Vt(ut.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Vt(ut.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Vt(ut.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Vt(ut.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Vt(ut.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Vt(ut.paint_hillshade["hillshade-accent-color"])})}};class ed extends s{constructor(e){super(e,td)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const id=y([{name:"a_pos",components:2,type:"Int16"}],4),{members:nd}=id;function vc(i,e,n=2){const o=e&&e.length,h=o?e[0]*n:i.length;let p=xc(i,0,h,n,!0);const f=[];if(!p||p.next===p.prev)return f;let g,v,T;if(o&&(p=function(P,M,k,D){const R=[];for(let N=0,$=M.length;N<$;N++){const W=xc(P,M[N]*D,N<$-1?M[N+1]*D:P.length,D,!1);W===W.next&&(W.steiner=!0),R.push(ud(W))}R.sort(ld);for(let N=0;N<R.length;N++)k=hd(R[N],k);return k}(i,e,p,n)),i.length>80*n){g=1/0,v=1/0;let P=-1/0,M=-1/0;for(let k=n;k<h;k+=n){const D=i[k],R=i[k+1];D<g&&(g=D),R<v&&(v=R),D>P&&(P=D),R>M&&(M=R)}T=Math.max(P-g,M-v),T=T!==0?32767/T:0}return Tl(p,f,n,g,v,T,0),f}function xc(i,e,n,o,h){let p;if(h===function(f,g,v,T){let P=0;for(let M=g,k=v-T;M<v;M+=T)P+=(f[k]-f[M])*(f[M+1]+f[k+1]),k=M;return P}(i,e,n,o)>0)for(let f=e;f<n;f+=o)p=Tc(f/o|0,i[f],i[f+1],p);else for(let f=n-o;f>=e;f-=o)p=Tc(f/o|0,i[f],i[f+1],p);return p&&Hl(p,p.next)&&(Sl(p),p=p.next),p}function Sa(i,e){if(!i)return i;e||(e=i);let n,o=i;do if(n=!1,o.steiner||!Hl(o,o.next)&&pi(o.prev,o,o.next)!==0)o=o.next;else{if(Sl(o),o=e=o.prev,o===o.next)break;n=!0}while(n||o!==e);return e}function Tl(i,e,n,o,h,p,f){if(!i)return;!f&&p&&function(v,T,P,M){let k=v;do k.z===0&&(k.z=bh(k.x,k.y,T,P,M)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==v);k.prevZ.nextZ=null,k.prevZ=null,function(D){let R,N=1;do{let $,W=D;D=null;let at=null;for(R=0;W;){R++;let et=W,st=0;for(let wt=0;wt<N&&(st++,et=et.nextZ,et);wt++);let mt=N;for(;st>0||mt>0&&et;)st!==0&&(mt===0||!et||W.z<=et.z)?($=W,W=W.nextZ,st--):($=et,et=et.nextZ,mt--),at?at.nextZ=$:D=$,$.prevZ=at,at=$;W=et}at.nextZ=null,N*=2}while(R>1)}(k)}(i,o,h,p);let g=i;for(;i.prev!==i.next;){const v=i.prev,T=i.next;if(p?sd(i,o,h,p):rd(i))e.push(v.i,i.i,T.i),Sl(i),i=T.next,g=T.next;else if((i=T)===g){f?f===1?Tl(i=od(Sa(i),e),e,n,o,h,p,2):f===2&&ad(i,e,n,o,h,p):Tl(Sa(i),e,n,o,h,p,1);break}}}function rd(i){const e=i.prev,n=i,o=i.next;if(pi(e,n,o)>=0)return!1;const h=e.x,p=n.x,f=o.x,g=e.y,v=n.y,T=o.y,P=h<p?h<f?h:f:p<f?p:f,M=g<v?g<T?g:T:v<T?v:T,k=h>p?h>f?h:f:p>f?p:f,D=g>v?g>T?g:T:v>T?v:T;let R=o.next;for(;R!==e;){if(R.x>=P&&R.x<=k&&R.y>=M&&R.y<=D&&Qa(h,g,p,v,f,T,R.x,R.y)&&pi(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function sd(i,e,n,o){const h=i.prev,p=i,f=i.next;if(pi(h,p,f)>=0)return!1;const g=h.x,v=p.x,T=f.x,P=h.y,M=p.y,k=f.y,D=g<v?g<T?g:T:v<T?v:T,R=P<M?P<k?P:k:M<k?M:k,N=g>v?g>T?g:T:v>T?v:T,$=P>M?P>k?P:k:M>k?M:k,W=bh(D,R,e,n,o),at=bh(N,$,e,n,o);let et=i.prevZ,st=i.nextZ;for(;et&&et.z>=W&&st&&st.z<=at;){if(et.x>=D&&et.x<=N&&et.y>=R&&et.y<=$&&et!==h&&et!==f&&Qa(g,P,v,M,T,k,et.x,et.y)&&pi(et.prev,et,et.next)>=0||(et=et.prevZ,st.x>=D&&st.x<=N&&st.y>=R&&st.y<=$&&st!==h&&st!==f&&Qa(g,P,v,M,T,k,st.x,st.y)&&pi(st.prev,st,st.next)>=0))return!1;st=st.nextZ}for(;et&&et.z>=W;){if(et.x>=D&&et.x<=N&&et.y>=R&&et.y<=$&&et!==h&&et!==f&&Qa(g,P,v,M,T,k,et.x,et.y)&&pi(et.prev,et,et.next)>=0)return!1;et=et.prevZ}for(;st&&st.z<=at;){if(st.x>=D&&st.x<=N&&st.y>=R&&st.y<=$&&st!==h&&st!==f&&Qa(g,P,v,M,T,k,st.x,st.y)&&pi(st.prev,st,st.next)>=0)return!1;st=st.nextZ}return!0}function od(i,e){let n=i;do{const o=n.prev,h=n.next.next;!Hl(o,h)&&bc(o,n,n.next,h)&&Pl(o,h)&&Pl(h,o)&&(e.push(o.i,n.i,h.i),Sl(n),Sl(n.next),n=i=h),n=n.next}while(n!==i);return Sa(n)}function ad(i,e,n,o,h,p){let f=i;do{let g=f.next.next;for(;g!==f.prev;){if(f.i!==g.i&&dd(f,g)){let v=wc(f,g);return f=Sa(f,f.next),v=Sa(v,v.next),Tl(f,e,n,o,h,p,0),void Tl(v,e,n,o,h,p,0)}g=g.next}f=f.next}while(f!==i)}function ld(i,e){return i.x-e.x}function hd(i,e){const n=function(h,p){let f=p;const g=h.x,v=h.y;let T,P=-1/0;do{if(v<=f.y&&v>=f.next.y&&f.next.y!==f.y){const N=f.x+(v-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(N<=g&&N>P&&(P=N,T=f.x<f.next.x?f:f.next,N===g))return T}f=f.next}while(f!==p);if(!T)return null;const M=T,k=T.x,D=T.y;let R=1/0;f=T;do{if(g>=f.x&&f.x>=k&&g!==f.x&&Qa(v<D?g:P,v,k,D,v<D?P:g,v,f.x,f.y)){const N=Math.abs(v-f.y)/(g-f.x);Pl(f,h)&&(N<R||N===R&&(f.x>T.x||f.x===T.x&&cd(T,f)))&&(T=f,R=N)}f=f.next}while(f!==M);return T}(i,e);if(!n)return e;const o=wc(n,i);return Sa(o,o.next),Sa(n,n.next)}function cd(i,e){return pi(i.prev,i,e.prev)<0&&pi(e.next,i,i.next)<0}function bh(i,e,n,o,h){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-n)*h|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*h|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ud(i){let e=i,n=i;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==i);return n}function Qa(i,e,n,o,h,p,f,g){return(h-f)*(e-g)>=(i-f)*(p-g)&&(i-f)*(o-g)>=(n-f)*(e-g)&&(n-f)*(p-g)>=(h-f)*(o-g)}function dd(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(n,o){let h=n;do{if(h.i!==n.i&&h.next.i!==n.i&&h.i!==o.i&&h.next.i!==o.i&&bc(h,h.next,n,o))return!0;h=h.next}while(h!==n);return!1}(i,e)&&(Pl(i,e)&&Pl(e,i)&&function(n,o){let h=n,p=!1;const f=(n.x+o.x)/2,g=(n.y+o.y)/2;do h.y>g!=h.next.y>g&&h.next.y!==h.y&&f<(h.next.x-h.x)*(g-h.y)/(h.next.y-h.y)+h.x&&(p=!p),h=h.next;while(h!==n);return p}(i,e)&&(pi(i.prev,i,e.prev)||pi(i,e.prev,e))||Hl(i,e)&&pi(i.prev,i,i.next)>0&&pi(e.prev,e,e.next)>0)}function pi(i,e,n){return(e.y-i.y)*(n.x-e.x)-(e.x-i.x)*(n.y-e.y)}function Hl(i,e){return i.x===e.x&&i.y===e.y}function bc(i,e,n,o){const h=Xl(pi(i,e,n)),p=Xl(pi(i,e,o)),f=Xl(pi(n,o,i)),g=Xl(pi(n,o,e));return h!==p&&f!==g||!(h!==0||!Wl(i,n,e))||!(p!==0||!Wl(i,o,e))||!(f!==0||!Wl(n,i,o))||!(g!==0||!Wl(n,e,o))}function Wl(i,e,n){return e.x<=Math.max(i.x,n.x)&&e.x>=Math.min(i.x,n.x)&&e.y<=Math.max(i.y,n.y)&&e.y>=Math.min(i.y,n.y)}function Xl(i){return i>0?1:i<0?-1:0}function Pl(i,e){return pi(i.prev,i,i.next)<0?pi(i,e,i.next)>=0&&pi(i,i.prev,e)>=0:pi(i,e,i.prev)<0||pi(i,i.next,e)<0}function wc(i,e){const n=wh(i.i,i.x,i.y),o=wh(e.i,e.x,e.y),h=i.next,p=e.prev;return i.next=e,e.prev=i,n.next=h,h.prev=n,o.next=n,n.prev=o,p.next=o,o.prev=p,o}function Tc(i,e,n,o){const h=wh(i,e,n);return o?(h.next=o.next,h.prev=o,o.next.prev=h,o.next=h):(h.prev=h,h.next=h),h}function Sl(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function wh(i,e,n){return{i,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Th(i,e,n){const o=n.patternDependencies;let h=!1;for(const p of e){const f=p.paint.get(`${i}-pattern`);f.isConstant()||(h=!0);const g=f.constantOr(null);g&&(h=!0,o[g.to]=!0,o[g.from]=!0)}return h}function Ph(i,e,n,o,h){const p=h.patternDependencies;for(const f of e){const g=f.paint.get(`${i}-pattern`).value;if(g.kind!=="constant"){let v=g.evaluate({zoom:o-1},n,{},h.availableImages),T=g.evaluate({zoom:o},n,{},h.availableImages),P=g.evaluate({zoom:o+1},n,{},h.availableImages);v=v&&v.name?v.name:v,T=T&&T.name?T.name:T,P=P&&P.name?P.name:P,p[v]=!0,p[T]=!0,p[P]=!0,n.patterns[f.id]={min:v,mid:T,max:P}}}return n}class Sh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Zr,this.indexArray=new gr,this.indexArray2=new Fi,this.programConfigurations=new wa(e.layers,e.zoom),this.segments=new Ie,this.segments2=new Ie,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,o){this.hasPattern=Th("fill",this.layers,n);const h=this.layers[0].layout.get("fill-sort-key"),p=!h.isConstant(),f=[];for(const{feature:g,id:v,index:T,sourceLayerIndex:P}of e){const M=this.layers[0]._featureFilter.needGeometry,k=Pa(g,M);if(!this.layers[0]._featureFilter.filter(new Xe(this.zoom),k,o))continue;const D=p?h.evaluate(k,{},o,n.availableImages):void 0,R={id:v,properties:g.properties,type:g.type,sourceLayerIndex:P,index:T,geometry:M?k.geometry:Ta(g),patterns:{},sortKey:D};f.push(R)}p&&f.sort((g,v)=>g.sortKey-v.sortKey);for(const g of f){const{geometry:v,index:T,sourceLayerIndex:P}=g;if(this.hasPattern){const M=Ph("fill",this.layers,g,this.zoom,n);this.patternFeatures.push(M)}else this.addFeature(g,v,T,o,{});n.featureIndex.insert(e[T].feature,v,T,P,this.index)}}update(e,n,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,o)}addFeatures(e,n,o){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,n,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,nd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,n,o,h,p){for(const f of Hs(n,500)){let g=0;for(const D of f)g+=D.length;const v=this.segments.prepareSegment(g,this.layoutVertexArray,this.indexArray),T=v.vertexLength,P=[],M=[];for(const D of f){if(D.length===0)continue;D!==f[0]&&M.push(P.length/2);const R=this.segments2.prepareSegment(D.length,this.layoutVertexArray,this.indexArray2),N=R.vertexLength;this.layoutVertexArray.emplaceBack(D[0].x,D[0].y),this.indexArray2.emplaceBack(N+D.length-1,N),P.push(D[0].x),P.push(D[0].y);for(let $=1;$<D.length;$++)this.layoutVertexArray.emplaceBack(D[$].x,D[$].y),this.indexArray2.emplaceBack(N+$-1,N+$),P.push(D[$].x),P.push(D[$].y);R.vertexLength+=D.length,R.primitiveLength+=D.length}const k=vc(P,M);for(let D=0;D<k.length;D+=3)this.indexArray.emplaceBack(T+k[D],T+k[D+1],T+k[D+2]);v.vertexLength+=g,v.primitiveLength+=k.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,p,h)}}let Pc,Sc;Ft("FillBucket",Sh,{omit:["layers","patternFeatures"]});var pd={get paint(){return Sc=Sc||new d({"fill-antialias":new Vt(ut.paint_fill["fill-antialias"]),"fill-opacity":new Wt(ut.paint_fill["fill-opacity"]),"fill-color":new Wt(ut.paint_fill["fill-color"]),"fill-outline-color":new Wt(ut.paint_fill["fill-outline-color"]),"fill-translate":new Vt(ut.paint_fill["fill-translate"]),"fill-translate-anchor":new Vt(ut.paint_fill["fill-translate-anchor"]),"fill-pattern":new ja(ut.paint_fill["fill-pattern"])})},get layout(){return Pc=Pc||new d({"fill-sort-key":new Wt(ut.layout_fill["fill-sort-key"])})}};class fd extends s{constructor(e){super(e,pd)}recalculate(e,n){super.recalculate(e,n);const o=this.paint._values["fill-outline-color"];o.value.kind==="constant"&&o.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Sh(e)}queryRadius(){return ql(this.paint.get("fill-translate"))}queryIntersectsFeature(e,n,o,h,p,f,g){return ac($l(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),f.angle,g),h)}isTileClipped(){return!0}}const md=y([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),_d=y([{name:"a_centroid",components:2,type:"Int16"}],4),{members:gd}=md;var Vo={},yd=An,Ic=tl;function tl(i,e,n,o,h){this.properties={},this.extent=n,this.type=0,this._pbf=i,this._geometry=-1,this._keys=o,this._values=h,i.readFields(vd,this,e)}function vd(i,e,n){i==1?e.id=n.readVarint():i==2?function(o,h){for(var p=o.readVarint()+o.pos;o.pos<p;){var f=h._keys[o.readVarint()],g=h._values[o.readVarint()];h.properties[f]=g}}(n,e):i==3?e.type=n.readVarint():i==4&&(e._geometry=n.pos)}function xd(i){for(var e,n,o=0,h=0,p=i.length,f=p-1;h<p;f=h++)o+=((n=i[f]).x-(e=i[h]).x)*(e.y+n.y);return o}tl.types=["Unknown","Point","LineString","Polygon"],tl.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,n=i.readVarint()+i.pos,o=1,h=0,p=0,f=0,g=[];i.pos<n;){if(h<=0){var v=i.readVarint();o=7&v,h=v>>3}if(h--,o===1||o===2)p+=i.readSVarint(),f+=i.readSVarint(),o===1&&(e&&g.push(e),e=[]),e.push(new yd(p,f));else{if(o!==7)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&g.push(e),g},tl.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,n=1,o=0,h=0,p=0,f=1/0,g=-1/0,v=1/0,T=-1/0;i.pos<e;){if(o<=0){var P=i.readVarint();n=7&P,o=P>>3}if(o--,n===1||n===2)(h+=i.readSVarint())<f&&(f=h),h>g&&(g=h),(p+=i.readSVarint())<v&&(v=p),p>T&&(T=p);else if(n!==7)throw new Error("unknown command "+n)}return[f,v,g,T]},tl.prototype.toGeoJSON=function(i,e,n){var o,h,p=this.extent*Math.pow(2,n),f=this.extent*i,g=this.extent*e,v=this.loadGeometry(),T=tl.types[this.type];function P(D){for(var R=0;R<D.length;R++){var N=D[R];D[R]=[360*(N.x+f)/p-180,360/Math.PI*Math.atan(Math.exp((180-360*(N.y+g)/p)*Math.PI/180))-90]}}switch(this.type){case 1:var M=[];for(o=0;o<v.length;o++)M[o]=v[o][0];P(v=M);break;case 2:for(o=0;o<v.length;o++)P(v[o]);break;case 3:for(v=function(D){var R=D.length;if(R<=1)return[D];for(var N,$,W=[],at=0;at<R;at++){var et=xd(D[at]);et!==0&&($===void 0&&($=et<0),$===et<0?(N&&W.push(N),N=[D[at]]):N.push(D[at]))}return N&&W.push(N),W}(v),o=0;o<v.length;o++)for(h=0;h<v[o].length;h++)P(v[o][h])}v.length===1?v=v[0]:T="Multi"+T;var k={type:"Feature",geometry:{type:T,coordinates:v},properties:this.properties};return"id"in this&&(k.id=this.id),k};var bd=Ic,Mc=Cc;function Cc(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(wd,this,e),this.length=this._features.length}function wd(i,e,n){i===15?e.version=n.readVarint():i===1?e.name=n.readString():i===5?e.extent=n.readVarint():i===2?e._features.push(n.pos):i===3?e._keys.push(n.readString()):i===4&&e._values.push(function(o){for(var h=null,p=o.readVarint()+o.pos;o.pos<p;){var f=o.readVarint()>>3;h=f===1?o.readString():f===2?o.readFloat():f===3?o.readDouble():f===4?o.readVarint64():f===5?o.readVarint():f===6?o.readSVarint():f===7?o.readBoolean():null}return h}(n))}Cc.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new bd(this._pbf,e,this.extent,this._keys,this._values)};var Td=Mc;function Pd(i,e,n){if(i===3){var o=new Td(n,n.readVarint()+n.pos);o.length&&(e[o.name]=o)}}Vo.VectorTile=function(i,e){this.layers=i.readFields(Pd,{},e)},Vo.VectorTileFeature=Ic,Vo.VectorTileLayer=Mc;const Sd=Vo.VectorTileFeature.types,Ih=Math.pow(2,13);function Il(i,e,n,o,h,p,f,g){i.emplaceBack(e,n,2*Math.floor(o*Ih)+f,h*Ih*2,p*Ih*2,Math.round(g))}class Mh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Do,this.centroidVertexArray=new Ki,this.indexArray=new gr,this.programConfigurations=new wa(e.layers,e.zoom),this.segments=new Ie,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,o){this.features=[],this.hasPattern=Th("fill-extrusion",this.layers,n);for(const{feature:h,id:p,index:f,sourceLayerIndex:g}of e){const v=this.layers[0]._featureFilter.needGeometry,T=Pa(h,v);if(!this.layers[0]._featureFilter.filter(new Xe(this.zoom),T,o))continue;const P={id:p,sourceLayerIndex:g,index:f,geometry:v?T.geometry:Ta(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Ph("fill-extrusion",this.layers,P,this.zoom,n)):this.addFeature(P,P.geometry,f,o,{}),n.featureIndex.insert(h,P.geometry,f,g,this.index,!0)}}addFeatures(e,n,o){for(const h of this.features){const{geometry:p}=h;this.addFeature(h,p,h.index,n,o)}}update(e,n,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,o)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gd),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,_d.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,n,o,h,p){for(const f of Hs(n,500)){const g={x:0,y:0,vertexCount:0};let v=0;for(const R of f)v+=R.length;let T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const R of f){if(R.length===0||Md(R))continue;let N=0;for(let $=0;$<R.length;$++){const W=R[$];if($>=1){const at=R[$-1];if(!Id(W,at)){T.vertexLength+4>Ie.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const et=W.sub(at)._perp()._unit(),st=at.dist(W);N+st>32768&&(N=0),Il(this.layoutVertexArray,W.x,W.y,et.x,et.y,0,0,N),Il(this.layoutVertexArray,W.x,W.y,et.x,et.y,0,1,N),g.x+=2*W.x,g.y+=2*W.y,g.vertexCount+=2,N+=st,Il(this.layoutVertexArray,at.x,at.y,et.x,et.y,0,0,N),Il(this.layoutVertexArray,at.x,at.y,et.x,et.y,0,1,N),g.x+=2*at.x,g.y+=2*at.y,g.vertexCount+=2;const mt=T.vertexLength;this.indexArray.emplaceBack(mt,mt+2,mt+1),this.indexArray.emplaceBack(mt+1,mt+2,mt+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+v>Ie.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(v,this.layoutVertexArray,this.indexArray)),Sd[e.type]!=="Polygon")continue;const P=[],M=[],k=T.vertexLength;for(const R of f)if(R.length!==0){R!==f[0]&&M.push(P.length/2);for(let N=0;N<R.length;N++){const $=R[N];Il(this.layoutVertexArray,$.x,$.y,0,0,1,1,0),g.x+=$.x,g.y+=$.y,g.vertexCount+=1,P.push($.x),P.push($.y)}}const D=vc(P,M);for(let R=0;R<D.length;R+=3)this.indexArray.emplaceBack(k+D[R],k+D[R+2],k+D[R+1]);T.primitiveLength+=D.length/3,T.vertexLength+=v;for(let R=0;R<g.vertexCount;R++){const N=Math.floor(g.x/g.vertexCount),$=Math.floor(g.y/g.vertexCount);this.centroidVertexArray.emplaceBack(N,$)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,p,h)}}function Id(i,e){return i.x===e.x&&(i.x<0||i.x>xi)||i.y===e.y&&(i.y<0||i.y>xi)}function Md(i){return i.every(e=>e.x<0)||i.every(e=>e.x>xi)||i.every(e=>e.y<0)||i.every(e=>e.y>xi)}let Ac;Ft("FillExtrusionBucket",Mh,{omit:["layers","features"]});var Cd={get paint(){return Ac=Ac||new d({"fill-extrusion-opacity":new Vt(ut["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wt(ut["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vt(ut["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vt(ut["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ja(ut["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wt(ut["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wt(ut["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vt(ut["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Ad extends s{constructor(e){super(e,Cd)}createBucket(e){return new Mh(e)}queryRadius(){return ql(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,n,o,h,p,f,g,v){const T=$l(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),f.angle,g),P=this.paint.get("fill-extrusion-height").evaluate(n,o),M=this.paint.get("fill-extrusion-base").evaluate(n,o),k=function(R,N,$,W){const at=[];for(const et of R){const st=[et.x,et.y,0,1];Gl(st,st,N),at.push(new bt(st[0]/st[3],st[1]/st[3]))}return at}(T,v),D=function(R,N,$,W){const at=[],et=[],st=W[8]*N,mt=W[9]*N,wt=W[10]*N,Dt=W[11]*N,Ht=W[8]*$,Et=W[9]*$,kt=W[10]*$,qt=W[11]*$;for(const Nt of R){const Ot=[],gt=[];for(const $t of Nt){const Ut=$t.x,Qt=$t.y,Ue=W[0]*Ut+W[4]*Qt+W[12],Ve=W[1]*Ut+W[5]*Qt+W[13],ki=W[2]*Ut+W[6]*Qt+W[14],Ur=W[3]*Ut+W[7]*Qt+W[15],Qi=ki+wt,zi=Ur+Dt,Sn=Ue+Ht,In=Ve+Et,Mn=ki+kt,li=Ur+qt,Ei=new bt((Ue+st)/zi,(Ve+mt)/zi);Ei.z=Qi/zi,Ot.push(Ei);const mn=new bt(Sn/li,In/li);mn.z=Mn/li,gt.push(mn)}at.push(Ot),et.push(gt)}return[at,et]}(h,M,P,v);return function(R,N,$){let W=1/0;ac($,N)&&(W=kc($,N[0]));for(let at=0;at<N.length;at++){const et=N[at],st=R[at];for(let mt=0;mt<et.length-1;mt++){const wt=et[mt],Dt=[wt,et[mt+1],st[mt+1],st[mt],wt];oc($,Dt)&&(W=Math.min(W,kc($,Dt)))}}return W!==1/0&&W}(D[0],D[1],k)}}function Ml(i,e){return i.x*e.x+i.y*e.y}function kc(i,e){if(i.length===1){let n=0;const o=e[n++];let h;for(;!h||o.equals(h);)if(h=e[n++],!h)return 1/0;for(;n<e.length;n++){const p=e[n],f=i[0],g=h.sub(o),v=p.sub(o),T=f.sub(o),P=Ml(g,g),M=Ml(g,v),k=Ml(v,v),D=Ml(T,g),R=Ml(T,v),N=P*k-M*M,$=(k*D-M*R)/N,W=(P*R-M*D)/N,at=o.z*(1-$-W)+h.z*$+p.z*W;if(isFinite(at))return at}return 1/0}{let n=1/0;for(const o of e)n=Math.min(n,o.z);return n}}const kd=y([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:zd}=kd,Ed=y([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Ld}=Ed,Dd=Vo.VectorTileFeature.types,Bd=Math.cos(Math.PI/180*37.5),zc=Math.pow(2,14)/.5;class Ch{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={}
vendor: 8,672 bytes, line 8
8,this.layers.forEach(n=>{this.gradients[n.id]={}}),this.layoutVertexArray=new $a,this.layoutVertexArray2=new Bo,this.indexArray=new gr,this.programConfigurations=new wa(e.layers,e.zoom),this.segments=new Ie,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,o){this.hasPattern=Th("line",this.layers,n);const h=this.layers[0].layout.get("line-sort-key"),p=!h.isConstant(),f=[];for(const{feature:g,id:v,index:T,sourceLayerIndex:P}of e){const M=this.layers[0]._featureFilter.needGeometry,k=Pa(g,M);if(!this.layers[0]._featureFilter.filter(new Xe(this.zoom),k,o))continue;const D=p?h.evaluate(k,{},o):void 0,R={id:v,properties:g.properties,type:g.type,sourceLayerIndex:P,index:T,geometry:M?k.geometry:Ta(g),patterns:{},sortKey:D};f.push(R)}p&&f.sort((g,v)=>g.sortKey-v.sortKey);for(const g of f){const{geometry:v,index:T,sourceLayerIndex:P}=g;if(this.hasPattern){const M=Ph("line",this.layers,g,this.zoom,n);this.patternFeatures.push(M)}else this.addFeature(g,v,T,o,{});n.featureIndex.insert(e[T].feature,v,T,P,this.index)}}update(e,n,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,o)}addFeatures(e,n,o){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,n,o)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ld)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,n,o,h,p){const f=this.layers[0].layout,g=f.get("line-join").evaluate(e,{}),v=f.get("line-cap"),T=f.get("line-miter-limit"),P=f.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const M of n)this.addLine(M,e,g,v,T,P);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,p,h)}addLine(e,n,o,h,p,f){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let W=0;W<e.length-1;W++)this.totalDistance+=e[W].dist(e[W+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const g=Dd[n.type]==="Polygon";let v=e.length;for(;v>=2&&e[v-1].equals(e[v-2]);)v--;let T=0;for(;T<v-1&&e[T].equals(e[T+1]);)T++;if(v<(g?3:2))return;o==="bevel"&&(p=1.05);const P=this.overscaling<=16?15*xi/(512*this.overscaling):0,M=this.segments.prepareSegment(10*v,this.layoutVertexArray,this.indexArray);let k,D,R,N,$;this.e1=this.e2=-1,g&&(k=e[v-2],$=e[T].sub(k)._unit()._perp());for(let W=T;W<v;W++){if(R=W===v-1?g?e[T+1]:void 0:e[W+1],R&&e[W].equals(R))continue;$&&(N=$),k&&(D=k),k=e[W],$=R?R.sub(k)._unit()._perp():N,N=N||$;let at=N.add($);at.x===0&&at.y===0||at._unit();const et=N.x*$.x+N.y*$.y,st=at.x*$.x+at.y*$.y,mt=st!==0?1/st:1/0,wt=2*Math.sqrt(2-2*st),Dt=st<Bd&&D&&R,Ht=N.x*$.y-N.y*$.x>0;if(Dt&&W>T){const qt=k.dist(D);if(qt>2*P){const Nt=k.sub(k.sub(D)._mult(P/qt)._round());this.updateDistance(D,Nt),this.addCurrentVertex(Nt,N,0,0,M),D=Nt}}const Et=D&&R;let kt=Et?o:g?"butt":h;if(Et&&kt==="round"&&(mt<f?kt="miter":mt<=2&&(kt="fakeround")),kt==="miter"&&mt>p&&(kt="bevel"),kt==="bevel"&&(mt>2&&(kt="flipbevel"),mt<p&&(kt="miter")),D&&this.updateDistance(D,k),kt==="miter")at._mult(mt),this.addCurrentVertex(k,at,0,0,M);else if(kt==="flipbevel"){if(mt>100)at=$.mult(-1);else{const qt=mt*N.add($).mag()/N.sub($).mag();at._perp()._mult(qt*(Ht?-1:1))}this.addCurrentVertex(k,at,0,0,M),this.addCurrentVertex(k,at.mult(-1),0,0,M)}else if(kt==="bevel"||kt==="fakeround"){const qt=-Math.sqrt(mt*mt-1),Nt=Ht?qt:0,Ot=Ht?0:qt;if(D&&this.addCurrentVertex(k,N,Nt,Ot,M),kt==="fakeround"){const gt=Math.round(180*wt/Math.PI/20);for(let $t=1;$t<gt;$t++){let Ut=$t/gt;if(Ut!==.5){const Ue=Ut-.5;Ut+=Ut*Ue*(Ut-1)*((1.0904+et*(et*(3.55645-1.43519*et)-3.2452))*Ue*Ue+(.848013+et*(.215638*et-1.06021)))}const Qt=$.sub(N)._mult(Ut)._add(N)._unit()._mult(Ht?-1:1);this.addHalfVertex(k,Qt.x,Qt.y,!1,Ht,0,M)}}R&&this.addCurrentVertex(k,$,-Nt,-Ot,M)}else if(kt==="butt")this.addCurrentVertex(k,at,0,0,M);else if(kt==="square"){const qt=D?1:-1;this.addCurrentVertex(k,at,qt,qt,M)}else kt==="round"&&(D&&(this.addCurrentVertex(k,N,0,0,M),this.addCurrentVertex(k,N,1,1,M,!0)),R&&(this.addCurrentVertex(k,$,-1,-1,M,!0),this.addCurrentVertex(k,$,0,0,M)));if(Dt&&W<v-1){const qt=k.dist(R);if(qt>2*P){const Nt=k.add(R.sub(k)._mult(P/qt)._round());this.updateDistance(k,Nt),this.addCurrentVertex(Nt,$,0,0,M),k=Nt}}}}addCurrentVertex(e,n,o,h,p,f=!1){const g=n.y*h-n.x,v=-n.y-n.x*h;this.addHalfVertex(e,n.x+n.y*o,n.y-n.x*o,f,!1,o,p),this.addHalfVertex(e,g,v,f,!0,-h,p),this.distance>zc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,n,o,h,p,f))}addHalfVertex({x:e,y:n},o,h,p,f,g,v){const T=.5*(this.lineClips?this.scaledDistance*(zc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(n<<1)+(f?1:0),Math.round(63*o)+128,Math.round(63*h)+128,1+(g===0?0:g<0?-1:1)|(63&T)<<2,T>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const P=v.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,P),v.primitiveLength++),f?this.e2=P:this.e1=P}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,n){this.distance+=e.dist(n),this.updateScaledDistance()}}let Ec,Lc;Ft("LineBucket",Ch,{omit:["layers","patternFeatures"]});var Dc={get paint(){return Lc=Lc||new d({"line-opacity":new Wt(ut.paint_line["line-opacity"]),"line-color":new Wt(ut.paint_line["line-color"]),"line-translate":new Vt(ut.paint_line["line-translate"]),"line-translate-anchor":new Vt(ut.paint_line["line-translate-anchor"]),"line-width":new Wt(ut.paint_line["line-width"]),"line-gap-width":new Wt(ut.paint_line["line-gap-width"]),"line-offset":new Wt(ut.paint_line["line-offset"]),"line-blur":new Wt(ut.paint_line["line-blur"]),"line-dasharray":new qa(ut.paint_line["line-dasharray"]),"line-pattern":new ja(ut.paint_line["line-pattern"]),"line-gradient":new gl(ut.paint_line["line-gradient"])})},get layout(){return Ec=Ec||new d({"line-cap":new Vt(ut.layout_line["line-cap"]),"line-join":new Wt(ut.layout_line["line-join"]),"line-miter-limit":new Vt(ut.layout_line["line-miter-limit"]),"line-round-limit":new Vt(ut.layout_line["line-round-limit"]),"line-sort-key":new Wt(ut.layout_line["line-sort-key"])})}};class Rd extends Wt{possiblyEvaluate(e,n){return n=new Xe(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),super.possiblyEvaluate(e,n)}evaluate(e,n,o,h){return n=rn({},n,{zoom:Math.floor(n.zoom)}),super.evaluate(e,n,o,h)}}let Kl;class Fd extends s{constructor(e){super(e,Dc),this.gradientVersion=0,Kl||(Kl=new Rd(Dc.paint.properties["line-width"].specification),Kl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const n=this.gradientExpression();this.stepInterpolant=!!function(o){return o._styleExpression!==void 0}(n)&&n._styleExpression.expression instanceof zr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,n){super.recalculate(e,n),this.paint._values["line-floorwidth"]=Kl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Ch(e)}queryRadius(e){const n=e,o=Bc(xl("line-width",this,n),xl("line-gap-width",this,n)),h=xl("line-offset",this,n);return o/2+Math.abs(h)+ql(this.paint.get("line-translate"))}queryIntersectsFeature(e,n,o,h,p,f,g){const v=$l(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),f.angle,g),T=g/2*Bc(this.paint.get("line-width").evaluate(n,o),this.paint.get("line-gap-width").evaluate(n,o)),P=this.paint.get("line-offset").evaluate(n,o);
vendor: 5,614 bytes, line 8
8return P&&(h=function(M,k){const D=[];for(let R=0;R<M.length;R++){const N=M[R],$=[];for(let W=0;W<N.length;W++){const at=N[W-1],et=N[W],st=N[W+1],mt=W===0?new bt(0,0):et.sub(at)._unit()._perp(),wt=W===N.length-1?new bt(0,0):st.sub(et)._unit()._perp(),Dt=mt._add(wt)._unit(),Ht=Dt.x*wt.x+Dt.y*wt.y;Ht!==0&&Dt._mult(1/Ht),$.push(Dt._mult(k)._add(et))}D.push($)}return D}(h,P*g)),function(M,k,D){for(let R=0;R<k.length;R++){const N=k[R];if(M.length>=3){for(let $=0;$<N.length;$++)if(Ja(M,N[$]))return!0}if(Gu(M,N,D))return!0}return!1}(v,h,T)}isTileClipped(){return!0}}function Bc(i,e){return e>0?e+2*i:i}const Od=y([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Nd=y([{name:"a_projected_pos",components:3,type:"Float32"}],4);y([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Vd=y([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);y([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Rc=y([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Zd=y([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ud(i,e,n){return i.sections.forEach(o=>{o.text=function(h,p,f){const g=p.layout.get("text-transform").evaluate(f,{});return g==="uppercase"?h=h.toLocaleUpperCase():g==="lowercase"&&(h=h.toLocaleLowerCase()),Rn.applyArabicShaping&&(h=Rn.applyArabicShaping(h)),h}(o.text,e,n)}),i}y([{name:"triangle",components:3,type:"Uint16"}]),y([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),y([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),y([{type:"Float32",name:"offsetX"}]),y([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),y([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Cl={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"};var Pi=24,Fc=Ne,Oc=function(i,e,n,o,h){var p,f,g=8*h-o-1,v=(1<<g)-1,T=v>>1,P=-7,M=h-1,k=-1,D=i[e+M];for(M+=k,p=D&(1<<-P)-1,D>>=-P,P+=g;P>0;p=256*p+i[e+M],M+=k,P-=8);for(f=p&(1<<-P)-1,p>>=-P,P+=o;P>0;f=256*f+i[e+M],M+=k,P-=8);if(p===0)p=1-T;else{if(p===v)return f?NaN:1/0*(D?-1:1);f+=Math.pow(2,o),p-=T}return(D?-1:1)*f*Math.pow(2,p-o)},Nc=function(i,e,n,o,h,p){var f,g,v,T=8*p-h-1,P=(1<<T)-1,M=P>>1,k=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=0,R=1,N=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(g=isNaN(e)?1:0,f=P):(f=Math.floor(Math.log(e)/Math.LN2),e*(v=Math.pow(2,-f))<1&&(f--,v*=2),(e+=f+M>=1?k/v:k*Math.pow(2,1-M))*v>=2&&(f++,v/=2),f+M>=P?(g=0,f=P):f+M>
vendor: 4,132 bytes, line 8
8=1?(g=(e*v-1)*Math.pow(2,h),f+=M):(g=e*Math.pow(2,M-1)*Math.pow(2,h),f=0));h>=8;i[n+D]=255&g,D+=R,g/=256,h-=8);for(f=f<<h|g,T+=h;T>0;i[n+D]=255&f,D+=R,f/=256,T-=8);i[n+D-R]|=128*N};function Ne(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Ne.Varint=0,Ne.Fixed64=1,Ne.Bytes=2,Ne.Fixed32=5;var Ah=4294967296,Vc=1/Ah,Zc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function so(i){return i.type===Ne.Bytes?i.readVarint()+i.pos:i.pos+1}function el(i,e,n){return n?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Uc(i,e,n){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(o);for(var h=n.pos-1;h>=i;h--)n.buf[h+o]=n.buf[h]}function jd(i,e){for(var n=0;n<i.length;n++)e.writeVarint(i[n])}function qd(i,e){for(var n=0;n<i.length;n++)e.writeSVarint(i[n])}function $d(i,e){for(var n=0;n<i.length;n++)e.writeFloat(i[n])}function Gd(i,e){for(var n=0;n<i.length;n++)e.writeDouble(i[n])}function Hd(i,e){for(var n=0;n<i.length;n++)e.writeBoolean(i[n])}function Wd(i,e){for(var n=0;n<i.length;n++)e.writeFixed32(i[n])}function Xd(i,e){for(var n=0;n<i.length;n++)e.writeSFixed32(i[n])}function Kd(i,e){for(var n=0;n<i.length;n++)e.writeFixed64(i[n])}function Jd(i,e){for(var n=0;n<i.length;n++)e.writeSFixed64(i[n])}function Jl(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function il(i,e,n){i[n]=e,i[n+1]=e>>>8,i[n+2]=e>>>16,i[n+3]=e>>>24}function jc(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Ne.prototype={destroy:function(){this.buf=null},readFields:function(i,e,n){for(n=n||this.length;this.pos<n;){var o=this.readVarint(),h=o>>3,p=this.pos;this.type=7&o,i(h,e,this),this.pos===p&&this.skip(o)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Jl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=jc(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Jl(this.buf,this.pos)+Jl(this.buf,this.pos+4)*Ah;return this.pos+=8,i},readSFixed64:function(){var i=Jl(this.buf,this.pos)+jc(this.buf,this.pos+4)*Ah;return this.pos+=8,i},readFloat:function(){var i=Oc(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Oc(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,n,o=this.buf;return e=127&(n=o[this.pos++]),n<128?e:(e|=(127&(n=o[this.pos++]))<<7,n<128?e:(e|=(127&(n=o[this.pos++]))<<14,n<128?e:(e|=(127&(n=o[this.pos++]))<<21,n<128?e:function(h,p,f){var g,v,T=f.buf;if(g=(112&(v=T[f.pos++]))>>4,v<128||(g|=(127&(v=T[f.pos++]))<<3,v<128)||(g|=(127&(v=T[f.pos++]))<<10,v<128)||(g|=(127&(v=T[f.pos++]))<<17,v<128)||(g|=(127&(v=T[f.pos++]))<<24,v<128)||(g|=(1&(v=T[f.pos++]))<<31,v<128))return el(h,g,p);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=o[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Zc?function(n,o,h){return Zc.decode(n.subarray(o,h))}(this.buf,e,i):function(n,o,h){for(var p="",f=o;f<h;){var g,v,T,P=n[f],M=null,k=P>239?4:P>223?3:P>191?2:1;if(f+k>h)break;k===1?P<128&&(M=P):k===2?(192&(g=n[f+1]))==128&&(M=(31&P)<<6|63&g)<=127&&(M=null):k===3?(v=n[f+2],(192&(g=n[f+1]))==128&&(192&v)==128&&((M=(15&P)<<12|(63&g)<<6|63&v)<=2047||M>=55296&&M<=57343)&&(M=null)):k===4&&(v=n[f+2],T=n[f+3],(192&(g=n[f+1]))==128&&(192&v)==128&&(192&T)==128&&((M=(15&P)<<18|(63&g)<<12|(63&v)<<6|63&T)<=65535||M>=1114112)&&(M=null)),M===null?(M=65533,k=1):M>65535&&(M-=65536,p+=String.fromCharCode(M>>>10&1023|55296),M=56320|1023&M),p+=String.fromCharCode(M),f+=k}return p}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Ne.Bytes)return i.push(this.readVarint(e));var n=so(this);for(i=i||[];this.pos<n;)i.push(this.readVarint(e));return i}
vendor: 5,462 bytes, line 8
8,readPackedSVarint:function(i){if(this.type!==Ne.Bytes)return i.push(this.readSVarint());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==Ne.Bytes)return i.push(this.readBoolean());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==Ne.Bytes)return i.push(this.readFloat());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==Ne.Bytes)return i.push(this.readDouble());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==Ne.Bytes)return i.push(this.readFixed32());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==Ne.Bytes)return i.push(this.readSFixed32());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==Ne.Bytes)return i.push(this.readFixed64());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==Ne.Bytes)return i.push(this.readSFixed64());var e=so(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===Ne.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ne.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ne.Fixed32)this.pos+=4;else{if(e!==Ne.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),il(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),il(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),il(this.buf,-1&i,this.pos),il(this.buf,Math.floor(i*Vc),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),il(this.buf,-1&i,this.pos),il(this.buf,Math.floor(i*Vc),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,n){var o,h;if(e>=0?(o=e%4294967296|0,h=e/4294967296|0):(h=~(-e/4294967296),4294967295^(o=~(-e%4294967296))?o=o+1|0:(o=0,h=h+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(p,f,g){g.buf[g.pos++]=127&p|128,p>>>=7,g.buf[g.pos++]=127&p|128,p>>>=7,g.buf[g.pos++]=127&p|128,p>>>=7,g.buf[g.pos++]=127&p|128,g.buf[g.pos]=127&(p>>>=7)}(o,0,n),function(p,f){var g=(7&p)<<4;f.buf[f.pos++]|=g|((p>>>=3)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p)))))}(h,n)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(o,h,p){for(var f,g,v=0;v<h.length;v++){if((f=h.charCodeAt(v))>55295&&f<57344){if(!g){f>56319||v+1===h.length?(o[p++]=239,o[p++]=191,o[p++]=189):g=f;continue}if(f<56320){o[p++]=239,o[p++]=191,o[p++]=189,g=f;continue}f=g-55296<<10|f-56320|65536,g=null}else g&&(o[p++]=239,o[p++]=191,o[p++]=189,g=null);f<128?o[p++]=f:(f<2048?o[p++]=f>>6|192:(f<65536?o[p++]=f>>12|224:(o[p++]=f>>18|240,o[p++]=f>>12&63|128),o[p++]=f>>6&63|128),o[p++]=63&f|128)}return p}(this.buf,i,this.pos);var n=this.pos-e;n>=128&&Uc(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(i){this.realloc(4),Nc(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Nc(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=i[n]},writeRawMessage:function(i,e){this.pos++;var n=this.pos;i(e,this);var o=this.pos-n;o>=128&&Uc(n,o,this),this.pos=n-1,this.writeVarint(o),this.pos+=o},writeMessage:function(i,e,n){this.writeTag(i,Ne.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,jd,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,qd,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Hd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,$d,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Gd,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Wd,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Xd,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Kd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Jd,e)},writeBytesField:function(i,e){this.writeTag(i,Ne.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Ne.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Ne.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Ne.Fixed64),this.writeFixed64
vendor: 9,214 bytes, line 8
8(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Ne.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Ne.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Ne.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Ne.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Ne.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Ne.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var kh=ae(Fc);const zh=3;function Yd(i,e,n){i===1&&n.readMessage(Qd,e)}function Qd(i,e,n){if(i===3){const{id:o,bitmap:h,width:p,height:f,left:g,top:v,advance:T}=n.readMessage(tp,{});e.push({id:o,bitmap:new wl({width:p+2*zh,height:f+2*zh},h),metrics:{width:p,height:f,left:g,top:v,advance:T}})}}function tp(i,e,n){i===1?e.id=n.readVarint():i===2?e.bitmap=n.readBytes():i===3?e.width=n.readVarint():i===4?e.height=n.readVarint():i===5?e.left=n.readSVarint():i===6?e.top=n.readSVarint():i===7&&(e.advance=n.readVarint())}const qc=zh;function $c(i){let e=0,n=0;for(const f of i)e+=f.w*f.h,n=Math.max(n,f.w);i.sort((f,g)=>g.h-f.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}];let h=0,p=0;for(const f of i)for(let g=o.length-1;g>=0;g--){const v=o[g];if(!(f.w>v.w||f.h>v.h)){if(f.x=v.x,f.y=v.y,p=Math.max(p,f.y+f.h),h=Math.max(h,f.x+f.w),f.w===v.w&&f.h===v.h){const T=o.pop();g<o.length&&(o[g]=T)}else f.h===v.h?(v.x+=f.w,v.w-=f.w):f.w===v.w?(v.y+=f.h,v.h-=f.h):(o.push({x:v.x+f.w,y:v.y,w:v.w-f.w,h:f.h}),v.y+=f.h,v.h-=f.h);break}}return{w:h,h:p,fill:e/(h*p)||0}}const On=1;class Eh{constructor(e,{pixelRatio:n,version:o,stretchX:h,stretchY:p,content:f,textFitWidth:g,textFitHeight:v}){this.paddedRect=e,this.pixelRatio=n,this.stretchX=h,this.stretchY=p,this.content=f,this.version=o,this.textFitWidth=g,this.textFitHeight=v}get tl(){return[this.paddedRect.x+On,this.paddedRect.y+On]}get br(){return[this.paddedRect.x+this.paddedRect.w-On,this.paddedRect.y+this.paddedRect.h-On]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*On)/this.pixelRatio,(this.paddedRect.h-2*On)/this.pixelRatio]}}class Gc{constructor(e,n){const o={},h={};this.haveRenderCallbacks=[];const p=[];this.addImages(e,o,p),this.addImages(n,h,p);const{w:f,h:g}=$c(p),v=new yr({width:f||1,height:g||1});for(const T in e){const P=e[T],M=o[T].paddedRect;yr.copy(P.data,v,{x:0,y:0},{x:M.x+On,y:M.y+On},P.data)}for(const T in n){const P=n[T],M=h[T].paddedRect,k=M.x+On,D=M.y+On,R=P.data.width,N=P.data.height;yr.copy(P.data,v,{x:0,y:0},{x:k,y:D},P.data),yr.copy(P.data,v,{x:0,y:N-1},{x:k,y:D-1},{width:R,height:1}),yr.copy(P.data,v,{x:0,y:0},{x:k,y:D+N},{width:R,height:1}),yr.copy(P.data,v,{x:R-1,y:0},{x:k-1,y:D},{width:1,height:N}),yr.copy(P.data,v,{x:0,y:0},{x:k+R,y:D},{width:1,height:N})}this.image=v,this.iconPositions=o,this.patternPositions=h}addImages(e,n,o){for(const h in e){const p=e[h],f={x:0,y:0,w:p.data.width+2*On,h:p.data.height+2*On};o.push(f),n[h]=new Eh(f,p),p.hasRenderCallback&&this.haveRenderCallbacks.push(h)}}patchUpdatedImages(e,n){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),n),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),n)}patchUpdatedImage(e,n,o){if(!e||!n||e.version===n.version)return;e.version=n.version;const[h,p]=e.tl;o.update(n.data,void 0,{x:h,y:p})}}var Zo;Ft("ImagePosition",Eh),Ft("ImageAtlas",Gc),O.ah=void 0,(Zo=O.ah||(O.ah={}))[Zo.none=0]="none",Zo[Zo.horizontal=1]="horizontal",Zo[Zo.vertical=2]="vertical",Zo[Zo.horizontalOnly=3]="horizontalOnly";const Al=-17;class kl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,n){const o=new kl;return o.scale=e||1,o.fontStack=n,o}static forImage(e){const n=new kl;return n.imageName=e,n}}class nl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,n){const o=new nl;for(let h=0;h<e.sections.length;h++){const p=e.sections[h];p.image?o.addImageSection(p):o.addTextSection(p,n)}return o}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let n="";for(let o=0;o<e.length;o++){const h=e.charCodeAt(o+1)||null,p=e.charCodeAt(o-1)||null;n+=h&&Fl(h)&&!Cl[e[o+1]]||p&&Fl(p)&&!Cl[e[o-1]]||!Cl[e[o]]?e[o]:Cl[e[o]]}return n}(this.text)}trim(){let e=0;for(let o=0;o<this.text.length&&Ql[this.text.charCodeAt(o)];o++)e++;let n=this.text.length;for(let o=this.text.length-1;o>=0&&o>=e&&Ql[this.text.charCodeAt(o)];o--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)}substring(e,n){const o=new nl;return o.text=this.text.substring(e,n),o.sectionIndex=this.sectionIndex.slice(e,n),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,n)=>Math.max(e,this.sections[n].scale),0)}addTextSection(e,n){this.text+=e.text,this.sections.push(kl.forText(e.scale,e.fontStack||n));const o=this.sections.length-1;for(let h=0;h<e.text.length;++h)this.sectionIndex.push(o)}addImageSection(e){const n=e.image?e.image.name:"";if(n.length===0)return void Si("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(kl.forImage(n)),this.sectionIndex.push(this.sections.length-1)):Si("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Yl(i,e,n,o,h,p,f,g,v,T,P,M,k,D,R){const N=nl.fromFeature(i,h);let $;M===O.ah.vertical&&N.verticalizePunctuation();const{processBidirectionalText:W,processStyledBidirectionalText:at}=Rn;if(W&&N.sections.length===1){$=[];const mt=W(N.toString(),Lh(N,T,p,e,o,D));for(const wt of mt){const Dt=new nl;Dt.text=wt,Dt.sections=N.sections;for(let Ht=0;Ht<wt.length;Ht++)Dt.sectionIndex.push(0);$.push(Dt)}}else if(at){$=[];const mt=at(N.text,N.sectionIndex,Lh(N,T,p,e,o,D));for(const wt of mt){const Dt=new nl;Dt.text=wt[0],Dt.sectionIndex=wt[1],Dt.sections=N.sections,$.push(Dt)}}else $=function(mt,wt){const Dt=[],Ht=mt.text;let Et=0;for(const kt of wt)Dt.push(mt.substring(Et,kt)),Et=kt;return Et<Ht.length&&Dt.push(mt.substring(Et,Ht.length)),Dt}(N,Lh(N,T,p,e,o,D));const et=[],st={positionedLines:et,text:N.toString(),top:P[1],bottom:P[1],left:P[0],right:P[0],writingMode:M,iconsInText:!1,verticalizable:!1};return function(mt,wt,Dt,Ht,Et,kt,qt,Nt,Ot,gt,$t,Ut){let Qt=0,Ue=Al,Ve=0,ki=0;const Ur=Nt==="right"?1:Nt==="left"?0:.5;let Qi=0;for(const li of Et){li.trim();const Ei=li.getMaxScale(),mn=(Ei-1)*Pi,tn={positionedGlyphs:[],lineOffset:0};mt.positionedLines[Qi]=tn;const Cn=tn.positionedGlyphs;let en=0;if(!li.length()){Ue+=kt,++Qi;continue}for(let Nn=0;Nn<li.length();Nn++){const Ee=li.getSection(Nn),$e=li.getSectionIndex(Nn),Qe=li.getCharCode(Nn);let ir=0,ai=null,al=null,Vs=null,Zs=Pi;const jr=!(Ot===O.ah.horizontal||!$t&&!ml(Qe)||$t&&(Ql[Qe]||(zi=Qe,/\p{sc=Arab}/u.test(String.fromCodePoint(zi)))));if(Ee.imageName){const br=Ht[Ee.imageName];if(!br)continue;Vs=Ee.imageName,mt.iconsInText=mt.iconsInText||!0,al=br.paddedRect;const Oi=br.displaySize;Ee.scale=Ee.scale*Pi/Ut,ai={width:Oi[0],height:Oi[1],left:On,top:-qc,advance:jr?Oi[1]:Oi[0]},ir=mn+(Pi-Oi[1]*Ee.scale),Zs=ai.advance;const oo=jr?Oi[0]*Ee.scale-Pi*Ei:Oi[1]*Ee.scale-Pi*Ei;oo>0&&oo>en&&(en=oo)}else{const br=Dt[Ee.fontStack],Oi=br&&br[Qe];if(Oi&&Oi.rect)al=Oi.rect,ai=Oi.metrics;else{const oo=wt[Ee.fontStack],Rl=oo&&oo[Qe];if(!Rl)continue;ai=Rl.metrics}ir=(Ei-Ee.scale)*Pi}jr?(mt.verticalizable=!0,Cn.push({glyph:Qe,imageName:Vs,x:Qt,y:Ue+ir,vertical:jr,scale:Ee.scale,fontStack:Ee.fontStack,sectionIndex:$e,metrics:ai,rect:al}),Qt+=Zs*Ee.scale+gt):(Cn.push({glyph:Qe,imageName:Vs,x:Qt,y:Ue+ir,vertical:jr,scale:Ee.scale,fontStack:Ee.fontStack,sectionIndex:$e,metrics:ai,rect:al}),Qt+=ai.advance*Ee.scale+gt)}Cn.length!==0&&(Ve=Math.max(Qt-gt,Ve),rp(Cn,0,Cn.length-1,Ur,en)),Qt=0;const xr=kt*Ei+en;tn.lineOffset=Math.max(en,mn),Ue+=xr,ki=Math.max(xr,ki),++Qi}var zi;const Sn=Ue-Al,{horizontalAlign:In,verticalAlign:Mn}=Dh(qt);(function(li,Ei,mn,tn,Cn,en,xr,Nn,Ee){const $e=(Ei-mn)*Cn;let Qe=0;Qe=en!==xr?-Nn*tn-Al:(-tn*Ee+.5)*xr;for(const ir of li)for(const ai of ir.positionedGlyphs)ai.x+=$e,ai.y+=Qe})(mt.positionedLines,Ur,In,Mn,Ve,ki,kt,Sn,Et.length),mt.top+=-Mn*Sn,mt.bottom=mt.top+Sn,mt.left+=-In*Ve,mt.right=mt.left+Ve}(st,e,n,o,$,f,g,v,M,T,k,R),!function(mt){for(const wt of mt)if(wt.positionedGlyphs.length!==0)return!1;return!0}(et)&&st}const Ql={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ep={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},ip={40:!0};function Hc(i,e,n,o,h,p){if(e.imageName){const f=o[e.imageName];return f?f.displaySize[0]*e.scale*Pi/p+h:0}{const f=n[e.fontStack],g=f&&f[i];return g?g.metrics.advance*e.scale+h:0}}function Wc(i,e,n,o){const h=Math.pow(i-e,2);return o?i<e?h/2:2*h:h+Math.abs(n)*n}
vendor: 26,718 bytes, line 8
8function np(i,e,n){let o=0;return i===10&&(o-=1e4),n&&(o+=150),i!==40&&i!==65288||(o+=50),e!==41&&e!==65289||(o+=50),o}function Xc(i,e,n,o,h,p){let f=null,g=Wc(e,n,h,p);for(const v of o){const T=Wc(e-v.x,n,h,p)+v.badness;T<=g&&(f=v,g=T)}return{index:i,x:e,priorBreak:f,badness:g}}function Kc(i){return i?Kc(i.priorBreak).concat(i.index):[]}function Lh(i,e,n,o,h,p){if(!i)return[];const f=[],g=function(M,k,D,R,N,$){let W=0;for(let at=0;at<M.length();at++){const et=M.getSection(at);W+=Hc(M.getCharCode(at),et,R,N,k,$)}return W/Math.max(1,Math.ceil(W/D))}(i,e,n,o,h,p),v=i.text.indexOf("â")>=0;let T=0;for(let M=0;M<i.length();M++){const k=i.getSection(M),D=i.getCharCode(M);if(Ql[D]||(T+=Hc(D,k,o,h,e,p)),M<i.length()-1){const R=!((P=D)<11904)&&(!!fe["CJK Compatibility Forms"](P)||!!fe["CJK Compatibility"](P)||!!fe["CJK Strokes"](P)||!!fe["CJK Symbols and Punctuation"](P)||!!fe["Enclosed CJK Letters and Months"](P)||!!fe["Halfwidth and Fullwidth Forms"](P)||!!fe["Ideographic Description Characters"](P)||!!fe["Vertical Forms"](P)||Va.test(String.fromCodePoint(P)));(ep[D]||R||k.imageName||M!==i.length()-2&&ip[i.getCharCode(M+1)])&&f.push(Xc(M+1,T,g,f,np(D,i.getCharCode(M+1),R&&v),!1))}}var P;return Kc(Xc(i.length(),T,g,f,0,!0))}function Dh(i){let e=.5,n=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function rp(i,e,n,o,h){if(!o&&!h)return;const p=i[n],f=(i[n].x+p.metrics.advance*p.scale)*o;for(let g=e;g<=n;g++)i[g].x-=f,i[g].y+=h}function sp(i,e,n){const{horizontalAlign:o,verticalAlign:h}=Dh(n),p=e[0]-i.displaySize[0]*o,f=e[1]-i.displaySize[1]*h;return{image:i,top:f,bottom:f+i.displaySize[1],left:p,right:p+i.displaySize[0]}}function Jc(i){var e,n;let o=i.left,h=i.top,p=i.right-o,f=i.bottom-h;const g=(e=i.image.textFitWidth)!==null&&e!==void 0?e:"stretchOrShrink",v=(n=i.image.textFitHeight)!==null&&n!==void 0?n:"stretchOrShrink",T=(i.image.content[2]-i.image.content[0])/(i.image.content[3]-i.image.content[1]);if(v==="proportional"){if(g==="stretchOnly"&&p/f<T||g==="proportional"){const P=Math.ceil(f*T);o*=P/p,p=P}}else if(g==="proportional"&&v==="stretchOnly"&&T!==0&&p/f>T){const P=Math.ceil(p/T);h*=P/f,f=P}return{x1:o,y1:h,x2:o+p,y2:h+f}}function Yc(i,e,n,o,h,p){const f=i.image;let g;if(f.content){const $=f.content,W=f.pixelRatio||1;g=[$[0]/W,$[1]/W,f.displaySize[0]-$[2]/W,f.displaySize[1]-$[3]/W]}const v=e.left*p,T=e.right*p;let P,M,k,D;n==="width"||n==="both"?(D=h[0]+v-o[3],M=h[0]+T+o[1]):(D=h[0]+(v+T-f.displaySize[0])/2,M=D+f.displaySize[0]);const R=e.top*p,N=e.bottom*p;return n==="height"||n==="both"?(P=h[1]+R-o[0],k=h[1]+N+o[2]):(P=h[1]+(R+N-f.displaySize[1])/2,k=P+f.displaySize[1]),{image:f,top:P,right:M,bottom:k,left:D,collisionPadding:g}}const zl=255,Ns=128,Uo=zl*Ns;function Qc(i,e){const{expression:n}=e;if(n.kind==="constant")return{kind:"constant",layoutSize:n.evaluate(new Xe(i+1))};if(n.kind==="source")return{kind:"source"};{const{zoomStops:o,interpolationType:h}=n;let p=0;for(;p<o.length&&o[p]<=i;)p++;p=Math.max(0,p-1);let f=p;for(;f<o.length&&o[f]<i+1;)f++;f=Math.min(o.length-1,f);const g=o[p],v=o[f];return n.kind==="composite"?{kind:"composite",minZoom:g,maxZoom:v,interpolationType:h}:{kind:"camera",minZoom:g,maxZoom:v,minSize:n.evaluate(new Xe(g)),maxSize:n.evaluate(new Xe(v)),interpolationType:h}}}function Bh(i,e,n){let o="never";const h=i.get(e);return h?o=h:i.get(n)&&(o="always"),o}const op=Vo.VectorTileFeature.types,ap=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function th(i,e,n,o,h,p,f,g,v,T,P,M,k){const D=g?Math.min(Uo,Math.round(g[0])):0,R=g?Math.min(Uo,Math.round(g[1])):0;i.emplaceBack(e,n,Math.round(32*o),Math.round(32*h),p,f,(D<<1)+(v?1:0),R,16*T,16*P,256*M,256*k)}function Rh(i,e,n){i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n)}function lp(i){for(const e of i.sections)if(ch(e.text))return!0;return!1}class Fh{constructor(e){this.layoutVertexArray=new Ga,this.indexArray=new gr,this.programConfigurations=e,this.segments=new Ie,this.dynamicLayoutVertexArray=new yl,this.opacityVertexArray=new tr,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ke}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,n,o,h){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Od.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,n),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Nd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ap,!0),this.opacityVertexBuffer.itemSize=1),(o||h)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ft("SymbolBuffers",Fh);class Oh{constructor(e,n,o){this.layoutVertexArray=new e,this.layoutAttributes=n,this.indexArray=new o,this.segments=new Ie,this.collisionVertexArray=new Fs}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Vd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ft("CollisionBuffers",Oh);class rl{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(f=>f.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=gh([]),this.placementViewportMatrix=gh([]);const n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Qc(this.zoom,n["text-size"]),this.iconSizeData=Qc(this.zoom,n["icon-size"]);const o=this.layers[0].layout,h=o.get("symbol-sort-key"),p=o.get("symbol-z-order");this.canOverlap=Bh(o,"text-overlap","text-allow-overlap")!=="never"||Bh(o,"icon-overlap","icon-allow-overlap")!=="never"||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,o.get("symbol-placement")==="point"&&(this.writingModes=o.get("text-writing-mode").map(f=>O.ah[f])),this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id),this.sourceID=e.sourceID}createArrays(){this.text=new Fh(new wa(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Fh(new wa(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Je,this.lineVertexArray=new Xi,this.symbolInstances=new we,this.textAnchorOffsets=new Ye}calculateGlyphDependencies(e,n,o,h,p){for(let f=0;f<e.length;f++)if(n[e.charCodeAt(f)]=!0,(o||h)&&p){const g=Cl[e.charAt(f)];g&&(n[g.charCodeAt(0)]=!0)}}populate(e,n,o){const h=this.layers[0],p=h.layout,f=p.get("text-font"),g=p.get("text-field"),v=p.get("icon-image"),T=(g.value.kind!=="constant"||g.value.value instanceof on&&!g.value.value.isEmpty()||g.value.value.toString().length>0)&&(f.value.kind!=="constant"||f.value.value.length>0),P=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,M=p.get("symbol-sort-key");if(this.features=[],!T&&!P)return;const k=n.iconDependencies,D=n.glyphDependencies,R=n.availableImages,N=new Xe(this.zoom);for(const{feature:$,id:W,index:at,sourceLayerIndex:et}of e){const st=h._featureFilter.needGeometry,mt=Pa($,st);if(!h._featureFilter.filter(N,mt,o))continue;let wt,Dt;if(st||(mt.geometry=Ta($)),T){const Et=h.getValueAndResolveTokens("text-field",mt,o,R),kt=on.factory(Et),qt=this.hasRTLText=this.hasRTLText||lp(kt);(!qt||Rn.getRTLTextPluginStatus()==="unavailable"||qt&&Rn.isParsed())&&(wt=Ud(kt,h,mt))}if(P){const Et=h.getValueAndResolveTokens("icon-image",mt,o,R);Dt=Et instanceof ji?Et:ji.fromString(Et)}if(!wt&&!Dt)continue;const Ht=this.sortFeaturesByKey?M.evaluate(mt,{},o):void 0;if(this.features.push({id:W,text:wt,icon:Dt,index:at,sourceLayerIndex:et,geometry:mt.geometry,properties:$.properties,type:op[$.type],sortKey:Ht}),Dt&&(k[Dt.name]=!0),wt){const Et=f.evaluate(mt,{},o).join(","),kt=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(O.ah.vertical)>=0;for(const qt of wt.sections)if(qt.image)k[qt.image.name]=!0;else{const Nt=fa(wt.toString()),Ot=qt.fontStack||Et,gt=D[Ot]=D[Ot]||{};this.calculateGlyphDependencies(qt.text,gt,kt,this.allowVerticalPlacement,Nt)}}}p.get("symbol-placement")==="line"&&(this.features=function($){const W={},at={},et=[];let st=0;function mt(Et){et.push($[Et]),st++}function wt(Et,kt,qt){const Nt=at[Et];return delete at[Et],at[kt]=Nt,et[Nt].geometry[0].pop(),et[Nt].geometry[0]=et[Nt].geometry[0].concat(qt[0]),Nt}function Dt(Et,kt,qt){const Nt=W[kt];return delete W[kt],W[Et]=Nt,et[Nt].geometry[0].shift(),et[Nt].geometry[0]=qt[0].concat(et[Nt].geometry[0]),Nt}function Ht(Et,kt,qt){const Nt=qt?kt[0][kt[0].length-1]:kt[0][0];return`${Et}:${Nt.x}:${Nt.y}`}for(let Et=0;Et<$.length;Et++){const kt=$[Et],qt=kt.geometry,Nt=kt.text?kt.text.toString():null;if(!Nt){mt(Et);continue}const Ot=Ht(Nt,qt),gt=Ht(Nt,qt,!0);if(Ot in at&> in W&&at[Ot]!==W[gt]){const $t=Dt(Ot,gt,qt),Ut=wt(Ot,gt,et[$t].geometry);delete W[Ot],delete at[gt],at[Ht(Nt,et[Ut].geometry,!0)]=Ut,et[$t].geometry=null}else Ot in at?wt(Ot,gt,qt):gt in W?Dt(Ot,gt,qt):(mt(Et),W[Ot]=st-1,at[gt]=st-1)}return et.filter(Et=>Et.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort(($,W)=>$.sortKey-W.sortKey)}update(e,n,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,n,this.layers,o),this.icon.programConfigurations.updatePaintArrays(e,n,this.layers,o))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,n){const o=this.lineVertexArray.length;if(e.segment!==void 0){let h=e.dist(n[e.segment+1]),p=e.dist(n[e.segment]);const f={};for(let g=e.segment+1;g<n.length;g++)f[g]={x:n[g].x,y:n[g].y,tileUnitDistanceFromAnchor:h},g<n.length-1&&(h+=n[g+1].dist(n[g]));for(let g=e.segment||0;g>=0;g--)f[g]={x:n[g].x,y:n[g].y,tileUnitDistanceFromAnchor:p},g>0&&(p+=n[g-1].dist(n[g]));for(let g=0;g<n.length;g++){const v=f[g];this.lineVertexArray.emplaceBack(v.x,v.y,v.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,n,o,h,p,f,g,v,T,P,M,k){const D=e.indexArray,R=e.layoutVertexArray,N=e.segments.prepareSegment(4*n.length,R,D,this.canOverlap?f.sortKey:void 0),$=this.glyphOffsetArray.length,W=N.vertexLength,at=this.allowVerticalPlacement&&g===O.ah.vertical?Math.PI/2:0,et=f.text&&f.text.sections;for(let st=0;st<n.length;st++){const{tl:mt,tr:wt,bl:Dt,br:Ht,tex:Et,pixelOffsetTL:kt,pixelOffsetBR:qt,minFontScaleX:Nt,minFontScaleY:Ot,glyphOffset:gt,isSDF:$t,sectionIndex:Ut}=n[st],Qt=N.vertexLength,Ue=gt[1];th(R,v.x,v.y,mt.x,Ue+mt.y,Et.x,Et.y,o,$t,kt.x,kt.y,Nt,Ot),th(R,v.x,v.y,wt.x,Ue+wt.y,Et.x+Et.w,Et.y,o,$t,qt.x,kt.y,Nt,Ot),th(R,v.x,v.y,Dt.x,Ue+Dt.y,Et.x,Et.y+Et.h,o,$t,kt.x,qt.y,Nt,Ot),th(R,v.x,v.y,Ht.x,Ue+Ht.y,Et.x+Et.w,Et.y+Et.h,o,$t,qt.x,qt.y,Nt,Ot),Rh(e.dynamicLayoutVertexArray,v,at),D.emplaceBack(Qt,Qt+1,Qt+2),D.emplaceBack(Qt+1,Qt+2,Qt+3),N.vertexLength+=4,N.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(gt[0]),st!==n.length-1&&Ut===n[st+1].sectionIndex||e.programConfigurations.populatePaintArrays(R.length,f,f.index,{},k,et&&et[Ut])}e.placedSymbolArray.emplaceBack(v.x,v.y,$,this.glyphOffsetArray.length-$,W,T,P,v.segment,o?o[0]:0,o?o[1]:0,h[0],h[1],g,0,!1,0,M)}_addCollisionDebugVertex(e,n,o,h,p,f){return n.emplaceBack(0,0),e.emplaceBack(o.x,o.y,h,p,Math.round(f.x),Math.round(f.y))}addCollisionDebugVertices(e,n,o,h,p,f,g){const v=p.segments.prepareSegment(4,p.layoutVertexArray,p.indexArray),T=v.vertexLength,P=p.layoutVertexArray,M=p.collisionVertexArray,k=g.anchorX,D=g.anchorY;this._addCollisionDebugVertex(P,M,f,k,D,new bt(e,n)),this._addCollisionDebugVertex(P,M,f,k,D,new bt(o,n)),this._addCollisionDebugVertex(P,M,f,k,D,new bt(o,h)),this._addCollisionDebugVertex(P,M,f,k,D,new bt(e,h)),v.vertexLength+=4;const R=p.indexArray;R.emplaceBack(T,T+1),R.emplaceBack(T+1,T+2),R.emplaceBack(T+2,T+3),R.emplaceBack(T+3,T),v.primitiveLength+=4}addDebugCollisionBoxes(e,n,o,h){for(let p=e;p<n;p++){const f=this.collisionBoxArray.get(p);this.addCollisionDebugVertices(f.x1,f.y1,f.x2,f.y2,h?this.textCollisionBox:this.iconCollisionBox,f.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Oh(er,Rc.members,Fi),this.iconCollisionBox=new Oh(er,Rc.members,Fi);for(let e=0;e<this.symbolInstances.length;e++){const n=this.symbolInstances.get(e);this.addDebugCollisionBoxes(n.textBoxStartIndex,n.textBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.iconBoxStartIndex,n.iconBoxEndIndex,n,!1),this.addDebugCollisionBoxes(n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex,n,!1)}}_deserializeCollisionBoxesForSymbol(e,n,o,h,p,f,g,v,T){const P={};for(let M=n;M<o;M++){const k=e.get(M);P.textBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.textFeatureIndex=k.featureIndex;break}for(let M=h;M<p;M++){const k=e.get(M);P.verticalTextBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.verticalTextFeatureIndex=k.featureIndex;break}for(let M=f;M<g;M++){const k=e.get(M);P.iconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.iconFeatureIndex=k.featureIndex;break}for(let M=v;M<T;M++){const k=e.get(M);P.verticalIconBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},P.verticalIconFeatureIndex=k.featureIndex;break}return P}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let n=0;n<this.symbolInstances.length;n++){const o=this.symbolInstances.get(n);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,n){const o=e.placedSymbolArray.get(n),h=o.vertexStartIndex+4*o.numGlyphs;for(let p=o.vertexStartIndex;p<h;p+=4)e.indexArray.emplaceBack(p,p+1,p+2),e.indexArray.emplaceBack(p+1,p+2,p+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const n=Math.sin(e),o=Math.cos(e),h=[],p=[],f=[];for(let g=0;g<this.symbolInstances.length;++g){f.push(g);const v=this.symbolInstances.get(g);h.push(0|Math.round(n*v.anchorX+o*v.anchorY)),p.push(v.featureIndex)}return f.sort((g,v)=>h[g]-h[v]||p[v]-p[g]),f}addToSortKeyRanges(e,n){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===n?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:n,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const n of this.symbolInstanceIndexes){const o=this.symbolInstances.get(n);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((h,p,f)=>{h>=0&&f.indexOf(h)===p&&this.addIndicesForPlacedSymbol(this.text,h)}),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let tu,eu;Ft("SymbolBucket",rl,{omit:["layers","collisionBoxArray","features","compareText"]}),rl.MAX_GLYPHS=65535,rl.addDynamicAttributes=Rh;var Nh={get paint(){return eu=eu||new d({"icon-opacity":new Wt(ut.paint_symbol["icon-opacity"]),"icon-color":new Wt(ut.paint_symbol["icon-color"]),"icon-halo-color":new Wt(ut.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wt(ut.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wt(ut.paint_symbol["icon-halo-blur"]),"icon-translate":new Vt(ut.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vt(ut.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wt(ut.paint_symbol["text-opacity"]),"text-color":new Wt(ut.paint_symbol["text-color"],{runtimeType:Ui,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Wt(ut.paint_symbol["text-halo-color"]),"text-halo-width":new Wt(ut.paint_symbol["text-halo-width"]),"text-halo-blur":new Wt(ut.paint_symbol["text-halo-blur"]),"text-translate":new Vt(ut.paint_symbol["text-translate"]),"text-translate-anchor":new Vt(ut.paint_symbol["text-translate-anchor"])})},get layout(){return tu=tu||new d({"symbol-placement":new Vt(ut.layout_symbol["symbol-placement"]),"symbol-spacing":new Vt(ut.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vt(ut.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Wt(ut.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vt(ut.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vt(ut.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Vt(ut.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Vt(ut.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vt(ut.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vt(ut.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wt(ut.layout_symbol["icon-size"]),"icon-text-fit":new Vt(ut.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vt(ut.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wt(ut.layout_symbol["icon-image"]),"icon-rotate":new Wt(ut.layout_symbol["icon-rotate"]),"icon-padding":new Wt(ut.layout_symbol["icon-padding"]),"icon-keep-upright":new Vt(ut.layout_symbol["icon-keep-upright"]),"icon-offset":new Wt(ut.layout_symbol["icon-offset"]),"icon-anchor":new Wt(ut.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vt(ut.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vt(ut.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vt(ut.layout_symbol["text-rotation-alignment"]),"text-field":new Wt(ut.layout_symbol["text-field"]),"text-font":new Wt(ut.layout_symbol["text-font"]),"text-size":new Wt(ut.layout_symbol["text-size"]),"text-max-width":new Wt(ut.layout_symbol["text-max-width"]),"text-line-height":new Vt(ut.layout_symbol["text-line-height"]),"text-letter-spacing":new Wt(ut.layout_symbol["text-letter-spacing"]),"text-justify":new Wt(ut.layout_symbol["text-justify"]),"text-radial-offset":new Wt(ut.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vt(ut.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Wt(ut.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Wt(ut.layout_symbol["text-anchor"]),"text-max-angle":new Vt(ut.layout_symbol["text-max-angle"]),"text-writing-mode":new Vt(ut.layout_symbol["text-writing-mode"]),"text-rotate":new Wt(ut.layout_symbol["text-rotate"]),"text-padding":new Vt(ut.layout_symbol["text-padding"]),"text-keep-upright":new Vt(ut.layout_symbol["text-keep-upright"]),"text-transform":new Wt(ut.layout_symbol["text-transform"]),"text-offset":new Wt(ut.layout_symbol["text-offset"]),"text-allow-overlap":new Vt(ut.layout_symbol["text-allow-overlap"]),"text-overlap":new Vt(ut.layout_symbol["text-overlap"]),"text-ignore-placement":new Vt(ut.layout_symbol["text-ignore-placement"]),"text-optional":new Vt(ut.layout_symbol["text-optional"])})}};class iu{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Mr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const n=this.defaultValue.property.overrides;if(n&&n.hasOverride(e.formattedSection))return n.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ft("FormatSectionOverride",iu,{omit:["defaultValue"]});class eh extends s{constructor(e){super(e,Nh)}recalculate(e,n){if(super.recalculate(e,n),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const o=this.layout.get("text-writing-mode");if(o){const h=[];for(const p of o)h.indexOf(p)<0&&h.push(p);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,n,o,h){const p=this.layout.get(e).evaluate(n,{},o,h),f=this._unevaluatedLayout._values[e];return f.isDataDriven()||as(f.value)||!p?p:function(g,v){return v.replace(/{([^{}]+)}/g,(T,P)=>g&&P in g?String(g[P]):"")}(n.properties,p)}createBucket(e){return new rl(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Nh.paint.overridableProperties){if(!eh.hasPaintOverride(this.layout,e))continue;const n=this.paint.get(e),o=new iu(n),h=new So(o,n.property.specification);let p=null;p=n.value.kind==="constant"||n.value.kind==="source"?new ls("source",h):new zs("composite",h,n.value.zoomStops),this.paint._values[e]=new Vr(n.property,p,n.parameters)}}_handleOverridablePaintPropertyUpdate(e,n,o){return!(!this.layout||n.isDataDriven()||o.isDataDriven())&&eh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,n){const o=e.get("text-field"),h=Nh.paint.properties[n];let p=!1;const f=g=>{for(const v of g)if(h.overrides&&h.overrides.hasOverride(v))return void(p=!0)};if(o.value.kind==="constant"&&o.value.value instanceof on)f(o.value.value.sections);else if(o.value.kind==="source"){const g=T=>{p||(T instanceof qi&&Jt(T.value)===qn?f(T.value.sections):T instanceof Gs?f(T.sections):T.eachChild(g))},v=o.value;v._styleExpression&&g(v._styleExpression.expression)}return p}}let nu;var hp={get paint(){return nu=nu||new d({"background-color":new Vt(ut.paint_background["background-color"]),"background-pattern":new qa(ut.paint_background["background-pattern"]),"background-opacity":new Vt(ut.paint_background["background-opacity"])})}};class cp extends s{constructor(e){super(e,hp)}}let ru;var up={get paint(){return ru=ru||new d({"raster-opacity":new Vt(ut.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vt(ut.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vt(ut.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vt(ut.paint_raster["raster-brightness-max"]),"raster-saturation":new Vt(ut.paint_raster["raster-saturation"]),"raster-contrast":new Vt(ut.paint_raster["raster-contrast"]),"raster-resampling":new Vt(ut.paint_raster["raster-resampling"]),"raster-fade-duration":new Vt(ut.paint_raster["raster-fade-duration"])})}};class dp extends s{constructor(e){super(e,up)}}class pp extends s{constructor(e){super(e,{}),this.onAdd=n=>{this.implementation.onAdd&&this.implementation.onAdd(n,n.painter.context.gl)},this.onRemove=n=>{this.implementation.onRemove&&this.implementation.onRemove(n,n.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class fp{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Vh=63710088e-1;class jo{constructor(e,n){if(isNaN(e)||isNaN(n))throw new Error(`Invalid LngLat object: (${e}, ${n})`);
vendor: 10,146 bytes, line 8
8if(this.lng=+e,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new jo(gn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const n=Math.PI/180,o=this.lat*n,h=e.lat*n,p=Math.sin(o)*Math.sin(h)+Math.cos(o)*Math.cos(h)*Math.cos((e.lng-this.lng)*n);return Vh*Math.acos(Math.min(p,1))}static convert(e){if(e instanceof jo)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new jo(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new jo(Number("lng"in e?e.lng:e.lon),Number(e.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>]")}}const su=2*Math.PI*Vh;function ou(i){return su*Math.cos(i*Math.PI/180)}function au(i){return(180+i)/360}function lu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function hu(i,e){return i/ou(e)}function Zh(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class El{constructor(e,n,o=0){this.x=+e,this.y=+n,this.z=+o}static fromLngLat(e,n=0){const o=jo.convert(e);return new El(au(o.lng),lu(o.lat),hu(n,o.lat))}toLngLat(){return new jo(360*this.x-180,Zh(this.y))}toAltitude(){return this.z*ou(Zh(this.y))}meterInMercatorCoordinateUnits(){return 1/su*(e=Zh(this.y),1/Math.cos(e*Math.PI/180));var e}}function cu(i,e,n){var o=2*Math.PI*6378137/256/Math.pow(2,n);return[i*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class Uh{constructor(e,n,o){if(!function(h,p,f){return!(h<0||h>25||f<0||f>=Math.pow(2,h)||p<0||p>=Math.pow(2,h))}(e,n,o))throw new Error(`x=${n}, y=${o}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=n,this.y=o,this.key=Ll(0,e,e,n,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,n,o){const h=(f=this.y,g=this.z,v=cu(256*(p=this.x),256*(f=Math.pow(2,g)-f-1),g),T=cu(256*(p+1),256*(f+1),g),v[0]+","+v[1]+","+T[0]+","+T[1]);var p,f,g,v,T;const P=function(M,k,D){let R,N="";for(let $=M;$>0;$--)R=1<<$-1,N+=(k&R?1:0)+(D&R?2:0);return N}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(o==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,n>1?"@2x":"").replace(/{quadkey}/g,P).replace(/{bbox-epsg-3857}/g,h)}isChildOf(e){const n=this.z-e.z;return n>0&&e.x===this.x>>n&&e.y===this.y>>n}getTilePoint(e){const n=Math.pow(2,this.z);return new bt((e.x*n-this.x)*xi,(e.y*n-this.y)*xi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class uu{constructor(e,n){this.wrap=e,this.canonical=n,this.key=Ll(e,n.z,n.z,n.x,n.y)}}class vr{constructor(e,n,o,h,p){if(e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=n,this.canonical=new Uh(o,+h,+p),this.key=Ll(n,e,o,h,p)}clone(){return new vr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const n=this.canonical.z-e;return e>this.canonical.z?new vr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new vr(e,this.wrap,e,this.canonical.x>>n,this.canonical.y>>n)}calculateScaledKey(e,n){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-e;return e>this.canonical.z?Ll(this.wrap*+n,e,this.canonical.z,this.canonical.x,this.canonical.y):Ll(this.wrap*+n,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const n=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>n&&e.canonical.y===this.canonical.y>>n}children(e){if(this.overscaledZ>=e)return[new vr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const n=this.canonical.z+1,o=2*this.canonical.x,h=2*this.canonical.y;return[new vr(n,this.wrap,n,o,h),new vr(n,this.wrap,n,o+1,h),new vr(n,this.wrap,n,o,h+1),new vr(n,this.wrap,n,o+1,h+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new vr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new vr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new uu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new El(e.x-this.wrap,e.y))}}function Ll(i,e,n,o,h){(i*=2)<0&&(i=-1*i-1);const p=1<<n;return(p*p*i+p*h+o).toString(36)+n.toString(36)+e.toString(36)}Ft("CanonicalTileID",Uh),Ft("OverscaledTileID",vr,{omit:["posMatrix"]});class du{constructor(e,n,o,h=1,p=1,f=1,g=0){if(this.uid=e,n.height!==n.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void Si(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=n.height;const v=this.dim=n.height-2;switch(this.data=new Uint32Array(n.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=h,this.greenFactor=p,this.blueFactor=f,this.baseShift=g;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let T=0;T<v;T++)this.data[this._idx(-1,T)]=this.data[this._idx(0,T)],this.data[this._idx(v,T)]=this.data[this._idx(v-1,T)],this.data[this._idx(T,-1)]=this.data[this._idx(T,0)],this.data[this._idx(T,v)]=this.data[this._idx(T,v-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(v,-1)]=this.data[this._idx(v-1,0)],this.data[this._idx(-1,v)]=this.data[this._idx(0,v-1)],this.data[this._idx(v,v)]=this.data[this._idx(v-1,v-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let T=0;T<v;T++)for(let P=0;P<v;P++){const M=this.get(T,P);M>this.max&&(this.max=M),M<this.min&&(this.min=M)}}get(e,n){const o=new Uint8Array(this.data.buffer),h=4*this._idx(e,n);return this.unpack(o[h],o[h+1],o[h+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,n){if(e<-1||e>=this.dim+1||n<-1||n>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(n+1)*this.stride+(e+1)}unpack(e,n,o){return e*this.redFactor+n*this.greenFactor+o*this.blueFactor-this.baseShift}getPixels(){return new yr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,n,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let h=n*this.dim,p=n*this.dim+this.dim,f=o*this.dim,g=o*this.dim+this.dim;switch(n){case-1:h=p-1;break;case 1:p=h+1}switch(o){case-1:f=g-1;break;case 1:g=f+1}const v=-n*this.dim,T=-o*this.dim;for(let P=f;P<g;P++)for(let M=h;M<p;M++)this.data[this._idx(M,P)]=e.data[this._idx(M+v,P+T)]}}Ft("DEMData",du);class pu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let n=0;n<e.length;n++){const o=e[n];this._stringToNumber[o]=n,this._numberToString[n]=o}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class fu{constructor(e,n,o,h,p){this.type="Feature",this._vectorTileFeature=e,e._z=n,e._x=o,e._y=h,this.properties=e.properties,this.id=p}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const n in this)n!=="_geometry"&&n!=="_vectorTileFeature"&&(e[n]=this[n]);return e}}class mu{constructor(e,n){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new di(xi,16,0),this.grid3D=new di(xi,16,0),this.featureIndexArray=new pn,this.promoteId=n}insert(e,n,o,h,p,f){const g=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,h,p);const v=f?this.grid3D:this.grid;for(let T=0;T<n.length;T++){const P=n[T],M=[1/0,1/0,-1/0,-1/0];for(let k=0;k<P.length;k++){const D=P[k];M[0]=Math.min(M[0],D.x),M[1]=Math.min(M[1],D.y),M[2]=Math.max(M[2],D.x),M[3]=Math.max(M[3],D.y)}M[0]<xi&&M[1]<xi&&M[2]>=0&&M[3]>=0&&v.insert(g,M[0],M[1],M[2],M[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Vo.VectorTile(new kh(this.rawTileData)).layers,this.sourceLayerCoder=new pu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,n,o,h){this.loadVTLayers();const p=e.params||{},f=xi/e.tileSize/e.scale,g=Ls(p.filter),v=e.queryGeometry,T=e.queryPadding*f,P=gu(v),M=this.grid.query(P.minX-T,P.minY-T,P.maxX+T,P.maxY+T),k=gu(e.cameraQueryGeometry),D=this.grid3D.query(k.minX-T,k.minY-T,k.maxX+T,k.maxY+T,($,W,at,et)=>function(st,mt,wt,Dt,Ht){for(const kt of st)if(mt<=kt.x&&wt<=kt.y&&Dt>=kt.x&&Ht>=kt.y)return!0;const Et=[new bt(mt,wt),new bt(mt,Ht),new bt(Dt,Ht),new bt(Dt,wt)];if(st.length>2){for(const kt of Et)if(Ja(st,kt))return!0}for(let kt=0;kt<st.length-1;kt++)if(Wu(st[kt],st[kt+1],Et))return!0;return!1}(e.cameraQueryGeometry,$-T,W-T,at+T,et+T));for(const $ of D)M.push($);M.sort(mp);const R={};let N;for(let $=0;$<M.length;$++){const W=M[$];if(W===N)continue;N=W;const at=this.featureIndexArray.get(W);let et=null;
vendor: 4,198 bytes, line 8
8this.loadMatchingFeature(R,at.bucketIndex,at.sourceLayerIndex,at.featureIndex,g,p.layers,p.availableImages,n,o,h,(st,mt,wt)=>(et||(et=Ta(st)),mt.queryIntersectsFeature(v,st,wt,et,this.z,e.transform,f,e.pixelPosMatrix)))}return R}loadMatchingFeature(e,n,o,h,p,f,g,v,T,P,M){const k=this.bucketLayerIDs[n];if(f&&!function($,W){for(let at=0;at<$.length;at++)if(W.indexOf($[at])>=0)return!0;return!1}(f,k))return;const D=this.sourceLayerCoder.decode(o),R=this.vtLayers[D].feature(h);if(p.needGeometry){const $=Pa(R,!0);if(!p.filter(new Xe(this.tileID.overscaledZ),$,this.tileID.canonical))return}else if(!p.filter(new Xe(this.tileID.overscaledZ),R))return;const N=this.getId(R,D);for(let $=0;$<k.length;$++){const W=k[$];if(f&&f.indexOf(W)<0)continue;const at=v[W];if(!at)continue;let et={};N&&P&&(et=P.getState(at.sourceLayer||"_geojsonTileLayer",N));const st=rn({},T[W]);st.paint=_u(st.paint,at.paint,R,et,g),st.layout=_u(st.layout,at.layout,R,et,g);const mt=!M||M(R,at,et);if(!mt)continue;const wt=new fu(R,this.z,this.x,this.y,N);wt.layer=st;let Dt=e[W];Dt===void 0&&(Dt=e[W]=[]),Dt.push({featureIndex:h,feature:wt,intersectionZ:mt})}}lookupSymbolFeatures(e,n,o,h,p,f,g,v){const T={};this.loadVTLayers();const P=Ls(p);for(const M of e)this.loadMatchingFeature(T,o,h,M,P,f,g,v,n);return T}hasLayer(e){for(const n of this.bucketLayerIDs)for(const o of n)if(e===o)return!0;return!1}getId(e,n){let o=e.id;return this.promoteId&&(o=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[n]],typeof o=="boolean"&&(o=Number(o))),o}}function _u(i,e,n,o,h){return yn(i,(p,f)=>{const g=e instanceof va?e.get(f):null;return g&&g.evaluate?g.evaluate(n,o,h):g})}function gu(i){let e=1/0,n=1/0,o=-1/0,h=-1/0;for(const p of i)e=Math.min(e,p.x),n=Math.min(n,p.y),o=Math.max(o,p.x),h=Math.max(h,p.y);return{minX:e,minY:n,maxX:o,maxY:h}}function mp(i,e){return e-i}function yu(i,e,n,o,h){const p=[];for(let f=0;f<i.length;f++){const g=i[f];let v;for(let T=0;T<g.length-1;T++){let P=g[T],M=g[T+1];P.x<e&&M.x<e||(P.x<e?P=new bt(e,P.y+(e-P.x)/(M.x-P.x)*(M.y-P.y))._round():M.x<e&&(M=new bt(e,P.y+(e-P.x)/(M.x-P.x)*(M.y-P.y))._round()),P.y<n&&M.y<n||(P.y<n?P=new bt(P.x+(n-P.y)/(M.y-P.y)*(M.x-P.x),n)._round():M.y<n&&(M=new bt(P.x+(n-P.y)/(M.y-P.y)*(M.x-P.x),n)._round()),P.x>=o&&M.x>=o||(P.x>=o?P=new bt(o,P.y+(o-P.x)/(M.x-P.x)*(M.y-P.y))._round():M.x>=o&&(M=new bt(o,P.y+(o-P.x)/(M.x-P.x)*(M.y-P.y))._round()),P.y>=h&&M.y>=h||(P.y>=h?P=new bt(P.x+(h-P.y)/(M.y-P.y)*(M.x-P.x),h)._round():M.y>=h&&(M=new bt(P.x+(h-P.y)/(M.y-P.y)*(M.x-P.x),h)._round()),v&&P.equals(v[v.length-1])||(v=[P],p.push(v)),v.push(M)))))}}return p}Ft("FeatureIndex",mu,{omit:["rawTileData","sourceLayerCoder"]});class qo extends bt{constructor(e,n,o,h){super(e,n),this.angle=o,h!==void 0&&(this.segment=h)}clone(){return new qo(this.x,this.y,this.angle,this.segment)}}function vu(i,e,n,o,h){if(e.segment===void 0||n===0)return!0;let p=e,f=e.segment+1,g=0;for(;g>-n/2;){if(f--,f<0)return!1;g-=i[f].dist(p),p=i[f]}g+=i[f].dist(i[f+1]),f++;const v=[];let T=0;for(;g<n/2;){const P=i[f],M=i[f+1];if(!M)return!1;let k=i[f-1].angleTo(P)-P.angleTo(M);for(k=Math.abs((k+3*Math.PI)%(2*Math.PI)-Math.PI),v.push({distance:g,angleDelta:k}),T+=k;g-v[0].distance>o;)T-=v.shift().angleDelta;if(T>h)return!1;f++,g+=P.dist(M)}return!0}function xu(i){let e=0;for(let n=0;n<i.length-1;n++)e+=i[n].dist(i[n+1]);return e}function bu(i,e,n){return i?.6*e*n:0}function wu(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function _p(i,e,n,o,h,p){const f=bu(n,h,p),g=wu(n,o)*p;let v=0;const T=xu(i)/2;for(let P=0;P<i.length-1;P++){const M=i[P],k=i[P+1],D=M.dist(k);if(v+D>T){const R=(T-v)/D,N=Ci.number(M.x,k.x,R),$=Ci.number(M.y,k.y,R),W=new qo(N,$,k.angleTo(M),P);return W._round(),!f||vu(i,W,g,f,e)?W:void 0}v+=D}}function gp(i,e,n,o,h,p,f,g,v){const T=bu(o,p,f),P=wu(o,h),M=P*f,k=i[0].x===0||i[0].x===v||i[0].y===0||i[0].y===v;return e-M<e/4&&(e=M+e/4),Tu(i,k?e/2*g%e:(P/2+2*p)*f*g%e,e,T,n,M,k,!1,v)}function Tu(i,e,n,o,h,p,f,g,v){const T=p/2,P=xu(i);let M=0,k=e-n,D=[];for(let R=0;R<i.length-1;R++){const N=i[R],$=i[R+1],W=N.dist($),at=$.angleTo(N);for(;k+n<M+W;){k+=n;const et=(k-M)/W,st=Ci.number(N.x,$.x,et),mt=Ci.number(N.y,$.y,et);
vendor: 10,632 bytes, line 8
8if(st>=0&&st<v&&mt>=0&&mt<v&&k-T>=0&&k+T<=P){const wt=new qo(st,mt,at,R);wt._round(),o&&!vu(i,wt,p,o,h)||D.push(wt)}}M+=W}return g||D.length||f||(D=Tu(i,M/2,n,o,h,p,f,!0,v)),D}Ft("Anchor",qo);const sl=On;function Pu(i,e,n,o){const h=[],p=i.image,f=p.pixelRatio,g=p.paddedRect.w-2*sl,v=p.paddedRect.h-2*sl;let T={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const P=p.stretchX||[[0,g]],M=p.stretchY||[[0,v]],k=(gt,$t)=>gt+$t[1]-$t[0],D=P.reduce(k,0),R=M.reduce(k,0),N=g-D,$=v-R;let W=0,at=D,et=0,st=R,mt=0,wt=N,Dt=0,Ht=$;if(p.content&&o){const gt=p.content,$t=gt[2]-gt[0],Ut=gt[3]-gt[1];(p.textFitWidth||p.textFitHeight)&&(T=Jc(i)),W=ih(P,0,gt[0]),et=ih(M,0,gt[1]),at=ih(P,gt[0],gt[2]),st=ih(M,gt[1],gt[3]),mt=gt[0]-W,Dt=gt[1]-et,wt=$t-at,Ht=Ut-st}const Et=T.x1,kt=T.y1,qt=T.x2-Et,Nt=T.y2-kt,Ot=(gt,$t,Ut,Qt)=>{const Ue=nh(gt.stretch-W,at,qt,Et),Ve=rh(gt.fixed-mt,wt,gt.stretch,D),ki=nh($t.stretch-et,st,Nt,kt),Ur=rh($t.fixed-Dt,Ht,$t.stretch,R),Qi=nh(Ut.stretch-W,at,qt,Et),zi=rh(Ut.fixed-mt,wt,Ut.stretch,D),Sn=nh(Qt.stretch-et,st,Nt,kt),In=rh(Qt.fixed-Dt,Ht,Qt.stretch,R),Mn=new bt(Ue,ki),li=new bt(Qi,ki),Ei=new bt(Qi,Sn),mn=new bt(Ue,Sn),tn=new bt(Ve/f,Ur/f),Cn=new bt(zi/f,In/f),en=e*Math.PI/180;if(en){const Ee=Math.sin(en),$e=Math.cos(en),Qe=[$e,-Ee,Ee,$e];Mn._matMult(Qe),li._matMult(Qe),mn._matMult(Qe),Ei._matMult(Qe)}const xr=gt.stretch+gt.fixed,Nn=$t.stretch+$t.fixed;return{tl:Mn,tr:li,bl:mn,br:Ei,tex:{x:p.paddedRect.x+sl+xr,y:p.paddedRect.y+sl+Nn,w:Ut.stretch+Ut.fixed-xr,h:Qt.stretch+Qt.fixed-Nn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:tn,pixelOffsetBR:Cn,minFontScaleX:wt/f/qt,minFontScaleY:Ht/f/Nt,isSDF:n}};if(o&&(p.stretchX||p.stretchY)){const gt=Su(P,N,D),$t=Su(M,$,R);for(let Ut=0;Ut<gt.length-1;Ut++){const Qt=gt[Ut],Ue=gt[Ut+1];for(let Ve=0;Ve<$t.length-1;Ve++)h.push(Ot(Qt,$t[Ve],Ue,$t[Ve+1]))}}else h.push(Ot({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:g+1},{fixed:0,stretch:v+1}));return h}function ih(i,e,n){let o=0;for(const h of i)o+=Math.max(e,Math.min(n,h[1]))-Math.max(e,Math.min(n,h[0]));return o}function Su(i,e,n){const o=[{fixed:-sl,stretch:0}];for(const[h,p]of i){const f=o[o.length-1];o.push({fixed:h-f.stretch,stretch:f.stretch}),o.push({fixed:h-f.stretch,stretch:f.stretch+(p-h)})}return o.push({fixed:e+sl,stretch:n}),o}function nh(i,e,n,o){return i/e*n+o}function rh(i,e,n,o){return i-e*n/o}class sh{constructor(e,n,o,h,p,f,g,v,T,P){var M;if(this.boxStartIndex=e.length,T){let k=f.top,D=f.bottom;const R=f.collisionPadding;R&&(k-=R[1],D+=R[3]);let N=D-k;N>0&&(N=Math.max(10,N),this.circleDiameter=N)}else{const k=!((M=f.image)===null||M===void 0)&&M.content&&(f.image.textFitWidth||f.image.textFitHeight)?Jc(f):{x1:f.left,y1:f.top,x2:f.right,y2:f.bottom};k.y1=k.y1*g-v[0],k.y2=k.y2*g+v[2],k.x1=k.x1*g-v[3],k.x2=k.x2*g+v[1];const D=f.collisionPadding;if(D&&(k.x1-=D[0]*g,k.y1-=D[1]*g,k.x2+=D[2]*g,k.y2+=D[3]*g),P){const R=new bt(k.x1,k.y1),N=new bt(k.x2,k.y1),$=new bt(k.x1,k.y2),W=new bt(k.x2,k.y2),at=P*Math.PI/180;R._rotate(at),N._rotate(at),$._rotate(at),W._rotate(at),k.x1=Math.min(R.x,N.x,$.x,W.x),k.x2=Math.max(R.x,N.x,$.x,W.x),k.y1=Math.min(R.y,N.y,$.y,W.y),k.y2=Math.max(R.y,N.y,$.y,W.y)}e.emplaceBack(n.x,n.y,k.x1,k.y1,k.x2,k.y2,o,h,p)}this.boxEndIndex=e.length}}class yp{constructor(e=[],n=(o,h)=>o<h?-1:o>h?1:0){if(this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:n,compare:o}=this,h=n[e];for(;e>0;){const p=e-1>>1,f=n[p];if(o(h,f)>=0)break;n[e]=f,e=p}n[e]=h}_down(e){const{data:n,compare:o}=this,h=this.length>>1,p=n[e];for(;e<h;){let f=1+(e<<1);const g=f+1;if(g<this.length&&o(n[g],n[f])<0&&(f=g),o(n[f],p)>=0)break;n[e]=n[f],e=f}n[e]=p}}function vp(i,e=1,n=!1){let o=1/0,h=1/0,p=-1/0,f=-1/0;const g=i[0];for(let D=0;D<g.length;D++){const R=g[D];(!D||R.x<o)&&(o=R.x),(!D||R.y<h)&&(h=R.y),(!D||R.x>p)&&(p=R.x),(!D||R.y>f)&&(f=R.y)}const v=Math.min(p-o,f-h);let T=v/2;const P=new yp([],xp);if(v===0)return new bt(o,h);for(let D=o;D<p;D+=v)for(let R=h;R<f;R+=v)P.push(new ol(D+T,R+T,T,i));let M=function(D){let R=0,N=0,$=0;const W=D[0];for(let at=0,et=W.length,st=et-1;at<et;st=at++){const mt=W[at],wt=W[st],Dt=mt.x*wt.y-wt.x*mt.y;N+=(mt.x+wt.x)*Dt,$+=(mt.y+wt.y)*Dt,R+=3*Dt}return new ol(N/R,$/R,0,D)}(i),k=P.length;for(;P.length;){const D=P.pop();(D.d>M.d||!M.d)&&(M=D,n&&console.log("found best %d after %d probes",Math.round(1e4*D.d)/1e4,k)),D.max-M.d<=e||(T=D.h/2,P.push(new ol(D.p.x-T,D.p.y-T,T,i)),P.push(new ol(D.p.x+T,D.p.y-T,T,i)),P.push(new ol(D.p.x-T,D.p.y+T,T,i)),P.push(new ol(D.p.x+T,D.p.y+T,T,i)),k+=4)}return n&&(console.log(`num probes: ${k}`),console.log(`best distance: ${M.d}`)),M.p}function xp(i,e){return e.max-i.max}function ol(i,e,n,o){this.p=new bt(i,e),this.h=n,this.d=function(h,p){let f=!1,g=1/0;for(let v=0;v<p.length;v++){const T=p[v];for(let P=0,M=T.length,k=M-1;P<M;k=P++){const D=T[P],R=T[k];D.y>h.y!=R.y>h.y&&h.x<(R.x-D.x)*(h.y-D.y)/(R.y-D.y)+D.x&&(f=!f),g=Math.min(g,lc(h,D,R))}}return(f?1:-1)*Math.sqrt(g)}(this.p,o),this.max=this.d+this.h*Math.SQRT2}var Yi;O.aq=void 0,(Yi=O.aq||(O.aq={}))[Yi.center=1]="center",Yi[Yi.left=2]="left",Yi[Yi.right=3]="right",Yi[Yi.top=4]="top",Yi[Yi.bottom=5]="bottom",Yi[Yi["top-left"]=6]="top-left",Yi[Yi["top-right"]=7]="top-right",Yi[Yi["bottom-left"]=8]="bottom-left",Yi[Yi["bottom-right"]=9]="bottom-right";const $o=7,jh=Number.POSITIVE_INFINITY;function Iu(i,e){return e[1]!==jh?function(n,o,h){let p=0,f=0;switch(o=Math.abs(o),h=Math.abs(h),n){case"top-right":case"top-left":case"top":f=h-$o;break;case"bottom-right":case"bottom-left":case"bottom":f=-h+$o}switch(n){case"top-right":case"bottom-right":case"right":p=-o;break;case"top-left":case"bottom-left":case"left":p=o}return[p,f]}(i,e[0],e[1]):function(n,o){let h=0,p=0;o<0&&(o=0);const f=o/Math.SQRT2;switch(n){case"top-right":case"top-left":p=f-$o;break;case"bottom-right":case"bottom-left":p=-f+$o;break;case"bottom":p=-o+$o;break;case"top":p=o-$o}switch(n){case"top-right":case"bottom-right":h=-f;break;case"top-left":case"bottom-left":h=f;break;case"left":h=o;break;case"right":h=-o}return[h,p]}(i,e[0])}function Mu(i,e,n){var o;const h=i.layout,p=(o=h.get("text-variable-anchor-offset"))===null||o===void 0?void 0:o.evaluate(e,{},n);if(p){const g=p.values,v=[];for(let T=0;T<g.length;T+=2){const P=v[T]=g[T],M=g[T+1].map(k=>k*Pi);P.startsWith("top")?M[1]-=$o:P.startsWith("bottom")&&(M[1]+=$o),v[T+1]=M}return new Mi(v)}const f=h.get("text-variable-anchor");if(f){let g;g=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(e,{},n)*Pi,jh]:h.get("text-offset").evaluate(e,{},n).map(T=>T*Pi);const v=[];for(const T of f)v.push(T,Iu(T,g));return new Mi(v)}return null}function qh(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bp(i,e,n,o,h,p,f,g,v,T,P){let M=p.textMaxSize.evaluate(e,{});M===void 0&&(M=f);const k=i.layers[0].layout,D=k.get("icon-offset").evaluate(e,{},P),R=Au(n.horizontal),N=f/24,$=i.tilePixelRatio*N,W=i.tilePixelRatio*M/24,at=i.tilePixelRatio*g,et=i.tilePixelRatio*k.get("symbol-spacing"),st=k.get("text-padding")*i.tilePixelRatio,mt=function(gt,$t,Ut,Qt=1){const Ue=gt.get("icon-padding").evaluate($t,{},Ut),Ve=Ue&&Ue.values;return[Ve[0]*Qt,Ve[1]*Qt,Ve[2]*Qt,Ve[3]*Qt]}(k,e,P,i.tilePixelRatio),wt=k.get("text-max-angle")/180*Math.PI,Dt=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point",Ht=k.get("icon-rotation-alignment")==="map"&&k.get("symbol-placement")!=="point",Et=k.get("symbol-placement"),kt=et/2,qt=k.get("icon-text-fit");let Nt;o&&qt!=="none"&&(i.allowVerticalPlacement&&n.vertical&&(Nt=Yc(o,n.vertical,qt,k.get("icon-text-fit-padding"),D,N)),R&&(o=Yc(o,R,qt,k.get("icon-text-fit-padding"),D,N)));const Ot=(gt,$t)=>{$t.x<0||$t.x>=xi||$t.y<0||$t.y>=xi||function(Ut,Qt,Ue,Ve,ki,Ur,Qi,zi,Sn,In,Mn,li,Ei,mn,tn,Cn,en,xr,Nn,Ee,$e,Qe,ir,ai,al){const Vs=Ut.addToLineVertexArray(Qt,Ue);let Zs,jr,br,Oi,oo=0,Rl=0,Lu=0,Du=0,Yh=-1,Qh=-1;const ao={};let Bu=Ha("");if(Ut.allowVerticalPlacement&&Ve.vertical){const _n=zi.layout.get("text-rotate").evaluate($e,{},ai)+90;br=new sh(Sn,Qt,In,Mn,li,Ve.vertical,Ei,mn,tn,_n),Qi&&(Oi=new sh(Sn,Qt,In,Mn,li,Qi,en,xr,tn,_n))}if(ki){const _n=zi.layout.get("icon-rotate").evaluate($e,{}),wr=zi.layout.get("icon-text-fit")!=="none",Ia=Pu(ki,_n,ir,wr),gs=Qi?Pu(Qi,_n,ir,wr):void 0;jr=new sh(Sn,Qt,In,Mn,li,ki,en,xr,!1,_n),oo=4*Ia.length;const Ma=Ut.iconSizeData;let Us=null;Ma.kind==="source"?(Us=[Ns*zi.layout.get("icon-size").evaluate($e,{})],Us[0]>Uo&&Si(`${Ut.layerIds[0]}: Value for "icon-size" is >= ${zl}. Reduce your "icon-size".`)):Ma.kind==="composite"&&(Us=[Ns*Qe.compositeIconSizes[0].evaluate($e,{},ai),Ns*Qe.compositeIconSizes[1].evaluate($e,{},ai)],(Us[0]>Uo||Us[1]>Uo)&&Si(`${Ut.layerIds[0]}: Value for "icon-size" is >= ${zl}. Reduce your "icon-size".`)),Ut.addSymbols(Ut.icon,Ia,Us,Ee,Nn,$e,O.ah.none,Qt,Vs.lineStartIndex,Vs.lineLength,-1,ai),Yh=Ut.icon.placedSymbolArray.length-1,gs&&(Rl=4*gs.length,Ut.addSymbols(Ut.icon,gs,Us,Ee,Nn,$e,O.ah.vertical,Qt,Vs.lineStartIndex,Vs.lineLength,-1,ai),Qh=Ut.icon.placedSymbolArray.length-1)}const Ru=Object.keys(Ve.horizontal);for(const _n of Ru){const wr=Ve.horizontal[_n];if(!Zs){Bu=Ha(wr.text);const gs=zi.layout.get("text-rotate").evaluate($e,{},ai);Zs=new sh(Sn,Qt,In,Mn,li,wr,Ei,mn,tn,gs)}const Ia=wr.positionedLines.length===1;if(Lu+=Cu(Ut,Qt,wr,Ur,zi,tn,$e,Cn,Vs,Ve.vertical?O.ah.horizontal:O.ah.horizontalOnly,Ia?Ru:[_n],ao,Yh,Qe,ai),Ia)break}Ve.vertical&&(Du+=Cu(Ut,Qt,Ve.vertical,Ur,zi,tn,$e,Cn,Vs,O.ah.vertical,["vertical"],ao,Qh,Qe,ai));const Pp=Zs?Zs.boxStartIndex:Ut.collisionBoxArray.length,Sp=Zs?Zs.boxEndIndex:Ut.collisionBoxArray.length,Ip=br?br.boxStartIndex:Ut.collisionBoxArray.length,Mp=br?br.boxEndIndex:Ut.collisionBoxArray.length,Cp=jr?jr.boxStartIndex:Ut.collisionBoxArray.length,Ap=jr?jr.boxEndIndex:Ut.collisionBoxArray.length,kp=Oi?Oi.boxStartIndex:Ut.collisionBoxArray.length,zp=Oi?Oi.boxEndIndex:Ut.collisionBoxArray.length;let _s=-1;const ah=(_n,wr)=>_n&&_n.circleDiameter?Math.max(_n.circleDiameter,wr):wr;_s=ah(Zs,_s),_s=ah(br,_s),_s=ah(jr,_s),_s=ah(Oi,_s);const Fu=_s>-1?1:0;Fu&&(_s*=al/Pi),Ut.glyphOffsetArray.length>=rl.MAX_GLYPHS&&Si("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),$e.sortKey!==void 0&&Ut.addToSortKey
vendor: 29,690 bytes, line 8
8Ranges(Ut.symbolInstances.length,$e.sortKey);const Ep=Mu(zi,$e,ai),[Lp,Dp]=function(_n,wr){const Ia=_n.length,gs=wr?.values;if(gs?.length>0)for(let Ma=0;Ma<gs.length;Ma+=2){const Us=gs[Ma+1];_n.emplaceBack(O.aq[gs[Ma]],Us[0],Us[1])}return[Ia,_n.length]}(Ut.textAnchorOffsets,Ep);Ut.symbolInstances.emplaceBack(Qt.x,Qt.y,ao.right>=0?ao.right:-1,ao.center>=0?ao.center:-1,ao.left>=0?ao.left:-1,ao.vertical||-1,Yh,Qh,Bu,Pp,Sp,Ip,Mp,Cp,Ap,kp,zp,In,Lu,Du,oo,Rl,Fu,0,Ei,_s,Lp,Dp)}(i,$t,gt,n,o,h,Nt,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,$,[st,st,st,st],Dt,v,at,mt,Ht,D,e,p,T,P,f)};if(Et==="line")for(const gt of yu(e.geometry,0,0,xi,xi)){const $t=gp(gt,et,wt,n.vertical||R,o,24,W,i.overscaling,xi);for(const Ut of $t)R&&wp(i,R.text,kt,Ut)||Ot(gt,Ut)}else if(Et==="line-center"){for(const gt of e.geometry)if(gt.length>1){const $t=_p(gt,wt,n.vertical||R,o,24,W);$t&&Ot(gt,$t)}}else if(e.type==="Polygon")for(const gt of Hs(e.geometry,0)){const $t=vp(gt,16);Ot(gt[0],new qo($t.x,$t.y,0))}else if(e.type==="LineString")for(const gt of e.geometry)Ot(gt,new qo(gt[0].x,gt[0].y,0));else if(e.type==="Point")for(const gt of e.geometry)for(const $t of gt)Ot([$t],new qo($t.x,$t.y,0))}function Cu(i,e,n,o,h,p,f,g,v,T,P,M,k,D,R){const N=function(at,et,st,mt,wt,Dt,Ht,Et){const kt=mt.layout.get("text-rotate").evaluate(Dt,{})*Math.PI/180,qt=[];for(const Nt of et.positionedLines)for(const Ot of Nt.positionedGlyphs){if(!Ot.rect)continue;const gt=Ot.rect||{};let $t=qc+1,Ut=!0,Qt=1,Ue=0;const Ve=(wt||Et)&&Ot.vertical,ki=Ot.metrics.advance*Ot.scale/2;if(Et&&et.verticalizable&&(Ue=Nt.lineOffset/2-(Ot.imageName?-(Pi-Ot.metrics.width*Ot.scale)/2:(Ot.scale-1)*Pi)),Ot.imageName){const Ee=Ht[Ot.imageName];Ut=Ee.sdf,Qt=Ee.pixelRatio,$t=On/Qt}const Ur=wt?[Ot.x+ki,Ot.y]:[0,0];let Qi=wt?[0,0]:[Ot.x+ki+st[0],Ot.y+st[1]-Ue],zi=[0,0];Ve&&(zi=Qi,Qi=[0,0]);const Sn=Ot.metrics.isDoubleResolution?2:1,In=(Ot.metrics.left-$t)*Ot.scale-ki+Qi[0],Mn=(-Ot.metrics.top-$t)*Ot.scale+Qi[1],li=In+gt.w/Sn*Ot.scale/Qt,Ei=Mn+gt.h/Sn*Ot.scale/Qt,mn=new bt(In,Mn),tn=new bt(li,Mn),Cn=new bt(In,Ei),en=new bt(li,Ei);if(Ve){const Ee=new bt(-ki,ki-Al),$e=-Math.PI/2,Qe=Pi/2-ki,ir=new bt(5-Al-Qe,-(Ot.imageName?Qe:0)),ai=new bt(...zi);mn._rotateAround($e,Ee)._add(ir)._add(ai),tn._rotateAround($e,Ee)._add(ir)._add(ai),Cn._rotateAround($e,Ee)._add(ir)._add(ai),en._rotateAround($e,Ee)._add(ir)._add(ai)}if(kt){const Ee=Math.sin(kt),$e=Math.cos(kt),Qe=[$e,-Ee,Ee,$e];mn._matMult(Qe),tn._matMult(Qe),Cn._matMult(Qe),en._matMult(Qe)}const xr=new bt(0,0),Nn=new bt(0,0);qt.push({tl:mn,tr:tn,bl:Cn,br:en,tex:gt,writingMode:et.writingMode,glyphOffset:Ur,sectionIndex:Ot.sectionIndex,isSDF:Ut,pixelOffsetTL:xr,pixelOffsetBR:Nn,minFontScaleX:0,minFontScaleY:0})}return qt}(0,n,g,h,p,f,o,i.allowVerticalPlacement),$=i.textSizeData;let W=null;$.kind==="source"?(W=[Ns*h.layout.get("text-size").evaluate(f,{})],W[0]>Uo&&Si(`${i.layerIds[0]}: Value for "text-size" is >= ${zl}. Reduce your "text-size".`)):$.kind==="composite"&&(W=[Ns*D.compositeTextSizes[0].evaluate(f,{},R),Ns*D.compositeTextSizes[1].evaluate(f,{},R)],(W[0]>Uo||W[1]>Uo)&&Si(`${i.layerIds[0]}: Value for "text-size" is >= ${zl}. Reduce your "text-size".`)),i.addSymbols(i.text,N,W,g,p,f,T,e,v.lineStartIndex,v.lineLength,k,R);for(const at of P)M[at]=i.text.placedSymbolArray.length-1;return 4*N.length}function Au(i){for(const e in i)return i[e];return null}function wp(i,e,n,o){const h=i.compareText;if(e in h){const p=h[e];for(let f=p.length-1;f>=0;f--)if(o.dist(p[f])<n)return!0}else h[e]=[];return h[e].push(o),!1}const ku=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class $h{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,o]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const h=o>>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);const p=ku[15&o];if(!p)throw new Error("Unrecognized array type.");const[f]=new Uint16Array(e,2,1),[g]=new Uint32Array(e,4,1);return new $h(g,f,p,e)}constructor(e,n=64,o=Float64Array,h){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=ku.indexOf(this.ArrayType),f=2*e*this.ArrayType.BYTES_PER_ELEMENT,g=e*this.IndexArrayType.BYTES_PER_ELEMENT,v=(8-g%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${o}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+g+v,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+f+g+v),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+g+v,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=n,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Gh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,o,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:f,nodeSize:g}=this,v=[0,p.length-1,0],T=[];for(;v.length;){const P=v.pop()||0,M=v.pop()||0,k=v.pop()||0;if(M-k<=g){for(let $=k;$<=M;$++){const W=f[2*$],at=f[2*$+1];W>=e&&W<=o&&at>=n&&at<=h&&T.push(p[$])}continue}const D=k+M>>1,R=f[2*D],N=f[2*D+1];R>=e&&R<=o&&N>=n&&N<=h&&T.push(p[D]),(P===0?e<=R:n<=N)&&(v.push(k),v.push(D-1),v.push(1-P)),(P===0?o>=R:h>=N)&&(v.push(D+1),v.push(M),v.push(1-P))}return T}within(e,n,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:p,nodeSize:f}=this,g=[0,h.length-1,0],v=[],T=o*o;for(;g.length;){const P=g.pop()||0,M=g.pop()||0,k=g.pop()||0;if(M-k<=f){for(let $=k;$<=M;$++)Eu(p[2*$],p[2*$+1],e,n)<=T&&v.push(h[$]);continue}const D=k+M>>1,R=p[2*D],N=p[2*D+1];Eu(R,N,e,n)<=T&&v.push(h[D]),(P===0?e-o<=R:n-o<=N)&&(g.push(k),g.push(D-1),g.push(1-P)),(P===0?e+o>=R:n+o>=N)&&(g.push(D+1),g.push(M),g.push(1-P))}return v}}function Gh(i,e,n,o,h,p){if(h-o<=n)return;const f=o+h>>1;zu(i,e,f,o,h,p),Gh(i,e,n,o,f-1,1-p),Gh(i,e,n,f+1,h,1-p)}function zu(i,e,n,o,h,p){for(;h>o;){if(h-o>600){const T=h-o+1,P=n-o+1,M=Math.log(T),k=.5*Math.exp(2*M/3),D=.5*Math.sqrt(M*k*(T-k)/T)*(P-T/2<0?-1:1);zu(i,e,n,Math.max(o,Math.floor(n-P*k/T+D)),Math.min(h,Math.floor(n+(T-P)*k/T+D)),p)}const f=e[2*n+p];let g=o,v=h;for(Dl(i,e,o,n),e[2*h+p]>f&&Dl(i,e,o,h);g<v;){for(Dl(i,e,g,v),g++,v--;e[2*g+p]<f;)g++;for(;e[2*v+p]>f;)v--}e[2*o+p]===f?Dl(i,e,o,v):(v++,Dl(i,e,v,h)),v<=n&&(o=v+1),n<=v&&(h=v-1)}}function Dl(i,e,n,o){Hh(i,n,o),Hh(e,2*n,2*o),Hh(e,2*n+1,2*o+1)}function Hh(i,e,n){const o=i[e];i[e]=i[n],i[n]=o}function Eu(i,e,n,o){const h=i-n,p=e-o;return h*h+p*p}var Wh;O.bg=void 0,(Wh=O.bg||(O.bg={})).create="create",Wh.load="load",Wh.fullLoad="fullLoad";let oh=null,Bl=[];const Xh=1e3/60,Kh="loadTime",Jh="fullLoadTime",Tp={mark(i){performance.mark(i)},frame(i){const e=i;oh!=null&&Bl.push(e-oh),oh=e},clearMetrics(){oh=null,Bl=[],performance.clearMeasures(Kh),performance.clearMeasures(Jh);for(const i in O.bg)performance.clearMarks(O.bg[i])},getPerformanceMetrics(){performance.measure(Kh,O.bg.create,O.bg.load),performance.measure(Jh,O.bg.create,O.bg.fullLoad);const i=performance.getEntriesByName(Kh)[0].duration,e=performance.getEntriesByName(Jh)[0].duration,n=Bl.length,o=1/(Bl.reduce((p,f)=>p+f,0)/n/1e3),h=Bl.filter(p=>p>Xh).reduce((p,f)=>p+(f-Xh)/Xh,0);return{loadTime:i,fullLoadTime:e,fps:o,percentDroppedFrames:h/(n+h)*100,totalFrames:n}}};O.$=class extends C{},O.A=Ya,O.B=ye,O.C=function(i){if(fi==null){const e=i.navigator?i.navigator.userAgent:null;fi=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return fi},O.D=Vt,O.E=$r,O.F=class{constructor(i,e){this.target=i,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new fp(()=>this.process()),this.subscription=function(n,o,h,p){return n.addEventListener(o,h,!1),{unsubscribe:()=>{n.removeEventListener(o,h,!1)}}}(this.target,"message",n=>this.receive(n)),this.globalScope=or(self)?i:window}registerMessageHandler(i,e){this.messageHandlers[i]=e}sendAsync(i,e){return new Promise((n,o)=>{const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[h]={resolve:n,reject:o},e&&e.signal.addEventListener("abort",()=>{delete this.resolveRejects[h];const g={id:h,type:"<cancel>",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(g)},{once:!0});const p=[],f=Object.assign(Object.assign({},i),{id:h,sourceMapId:this.mapId,origin:location.origin,data:Rs(i.data,p)});this.target.postMessage(f,{transfer:p})})}receive(i){const e=i.data,n=e.id;if(!(e.origin!=="file://"&&location.origin!=="file://"&&e.origin!=="resource://android"&&location.origin!=="resource://android"&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[n];const o=this.abortControllers[n];return delete this.abortControllers[n],void(o&&o.abort())}if(or(self)||e.mustQueue)return this.tasks[n]=e,this.taskQueue.push(n),void this.invoker.trigger();this.processTask(n,e)}}process(){if(this.taskQueue.length===0)return;const i=this.taskQueue.shift(),e=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(i,e)}processTask(i,e){return m(this,void 0,void 0,function*(){if(e.type==="<response>"){const h=this.resolveRejects[i];return delete this.resolveRejects[i],h?void(e.error?h.reject(ps(e.error)):h.resolve(ps(e.data))):void 0}if(!this.messageHandlers[e.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${e.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const n=ps(e.data),o=new AbortController;this.abortControllers[i]=o;try{const h=yield this.messageHandlers[e.type](e.sourceMapId,n,o);this.completeTask(i,null,h)}catch(h){this.completeTask(i,h)}})}completeTask(i,e,n){const o=[];delete this.abortControllers[i];const h={id:i,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Rs(e):null,data:Rs(n,o)};this.target.postMessage(h,{transfer:o})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},O.G=ge,O.H=function(){var i=new Ya(16);return Ya!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},O.I=Eh,O.J=function(i,e,n){var o,h,p,f,g,v,T,P,M,k,D,R,N=n[0],$=n[1],W=n[2];return e===i?(i[12]=e[0]*N+e[4]*$+e[8]*W+e[12],i[13]=e[1]*N+e[5]*$+e[9]*W+e[13],i[14]=e[2]*N+e[6]*$+e[10]*W+e[14],i[15]=e[3]*N+e[7]*$+e[11]*W+e[15]):(h=e[1],p=e[2],f=e[3],g=e[4],v=e[5],T=e[6],P=e[7],M=e[8],k=e[9],D=e[10],R=e[11],i[0]=o=e[0],i[1]=h,i[2]=p,i[3]=f,i[4]=g,i[5]=v,i[6]=T,i[7]=P,i[8]=M,i[9]=k,i[10]=D,i[11]=R,i[12]=o*N+g*$+M*W+e[12],i[13]=h*N+v*$+k*W+e[13],i[14]=p*N+T*$+D*W+e[14],i[15]=f*N+P*$+R*W+e[15]),i},O.K=function(i,e,n){var o=n[0],h=n[1],p=n[2];return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*o,i[3]=e[3]*o,i[4]=e[4]*h,i[5]=e[5]*h,i[6]=e[6]*h,i[7]=e[7]*h,i[8]=e[8]*p,i[9]=e[9]*p,i[10]=e[10]*p,i[11]=e[11]*p,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},O.L=dc,O.M=function(i,e){const n={};for(let o=0;o<e.length;o++){const h=e[o];h in i&&(n[h]=i[h])}return n},O.N=jo,O.O=au,O.P=bt,O.Q=lu,O.R=yr,O.S=vr,O.T=Ua,O.U=sr,O.V=vs,O.W=Tr,O.X=xi,O.Y=y,O.Z=El,O._=m,O.a=Fe,O.a$=function(i,e){var n=i[0],o=i[1],h=i[2],p=i[3],f=i[4],g=i[5],v=i[6],T=i[7],P=i[8],M=i[9],k=i[10],D=i[11],R=i[12],N=i[13],$=i[14],W=i[15],at=e[0],et=e[1],st=e[2],mt=e[3],wt=e[4],Dt=e[5],Ht=e[6],Et=e[7],kt=e[8],qt=e[9],Nt=e[10],Ot=e[11],gt=e[12],$t=e[13],Ut=e[14],Qt=e[15];return Math.abs(n-at)<=Pn*Math.max(1,Math.abs(n),Math.abs(at))&&Math.abs(o-et)<=Pn*Math.max(1,Math.abs(o),Math.abs(et))&&Math.abs(h-st)<=Pn*Math.max(1,Math.abs(h),Math.abs(st))&&Math.abs(p-mt)<=Pn*Math.max(1,Math.abs(p),Math.abs(mt))&&Math.abs(f-wt)<=Pn*Math.max(1,Math.abs(f),Math.abs(wt))&&Math.abs(g-Dt)<=Pn*Math.max(1,Math.abs(g),Math.abs(Dt))&&Math.abs(v-Ht)<=Pn*Math.max(1,Math.abs(v),Math.abs(Ht))&&Math.abs(T-Et)<=Pn*Math.max(1,Math.abs(T),Math.abs(Et))&&Math.abs(P-kt)<=Pn*Math.max(1,Math.abs(P),Math.abs(kt))&&Math.abs(M-qt)<=Pn*Math.max(1,Math.abs(M),Math.abs(qt))&&Math.abs(k-Nt)<=Pn*Math.max(1,Math.abs(k),Math.abs(Nt))&&Math.abs(D-Ot)<=Pn*Math.max(1,Math.abs(D),Math.abs(Ot))&&Math.abs(R-gt)<=Pn*Math.max(1,Math.abs(R),Math.abs(gt))&&Math.abs(N-$t)<=Pn*Math.max(1,Math.abs(N),Math.abs($t))&&Math.abs($-Ut)<=Pn*Math.max(1,Math.abs($),Math.abs(Ut))&&Math.abs(W-Qt)<=Pn*Math.max(1,Math.abs(W),Math.abs(Qt))},O.a0=Ie,O.a1=Uh,O.a2=Pt,O.a3=i=>{const e=window.document.createElement("video");return e.muted=!0,new Promise(n=>{e.onloadstart=()=>{n(e)};for(const o of i){const h=window.document.createElement("source");ar(o)||(e.crossOrigin="Anonymous"),h.src=o,e.appendChild(h)}})},O.a4=function(){return qs++},O.a5=Lt,O.a6=rl,O.a7=Ls,O.a8=Pa,O.a9=fu,O.aA=function(i){if(i.type==="custom")return new pp(i);switch(i.type){case"background":return new cp(i);case"circle":return new Ju(i);case"fill":return new fd(i);case"fill-extrusion":return new Ad(i);case"heatmap":return new Qu(i);case"hillshade":return new ed(i);case"line":return new Fd(i);case"raster":return new dp(i);case"symbol":return new eh(i)}},O.aB=le,O.aC=function(i,e){if(!i)return[{command:"setStyle",args:[e]}];let n=[];try{if(!ze(i.version,e.version))return[{command:"setStyle",args:[e]}];ze(i.center,e.center)||n.push({command:"setCenter",args:[e.center]}),ze(i.zoom,e.zoom)||n.push({command:"setZoom",args:[e.zoom]}),ze(i.bearing,e.bearing)||n.push({command:"setBearing",args:[e.bearing]}),ze(i.pitch,e.pitch)||n.push({command:"setPitch",args:[e.pitch]}),ze(i.sprite,e.sprite)||n.push({command:"setSprite",args:[e.sprite]}),ze(i.glyphs,e.glyphs)||n.push({command:"setGlyphs",args:[e.glyphs]}),ze(i.transition,e.transition)||n.push({command:"setTransition",args:[e.transition]}),ze(i.light,e.light)||n.push({command:"setLight",args:[e.light]}),ze(i.terrain,e.terrain)||n.push({command:"setTerrain",args:[e.terrain]}),ze(i.sky,e.sky)||n.push({command:"setSky",args:[e.sky]}),ze(i.projection,e.projection)||n.push({command:"setProjection",args:[e.projection]});const o={},h=[];(function(f,g,v,T){let P;for(P in g=g||{},f=f||{})Object.prototype.hasOwnProperty.call(f,P)&&(Object.prototype.hasOwnProperty.call(g,P)||hr(P,v,T));for(P in g)Object.prototype.hasOwnProperty.call(g,P)&&(Object.prototype.hasOwnProperty.call(f,P)?ze(f[P],g[P])||(f[P].type==="geojson"&&g[P].type==="geojson"&&bs(f,g,P)?He(v,{command:"setGeoJSONSourceData",args:[P,g[P].data]}):Zn(P,g,v,T)):Gr(P,g,v))})(i.sources,e.sources,h,o);const p=[];i.layers&&i.layers.forEach(f=>{"source"in f&&o[f.source]?n.push({command:"removeLayer",args:[f.id]}):p.push(f)}),n=n.concat(h),function(f,g,v){g=g||[];const T=(f=f||[]).map(Hr),P=g.map(Hr),M=f.reduce(ws,{}),k=g.reduce(ws,{}),D=T.slice(),R=Object.create(null);let N,$,W,at,et;for(let st=0,mt=0;st<T.length;st++)N=T[st],Object.prototype.hasOwnProperty.call(k,N)?mt++:(He(v,{command:"removeLayer",args:[N]}),D.splice(D.indexOf(N,mt),1));for(let st=0,mt=0;st<P.length;st++)N=P[P.length-1-st],D[D.length-1-st]!==N&&(Object.prototype.hasOwnProperty.call(M,N)?(He(v,{command:"removeLayer",args:[N]}),D.splice(D.lastIndexOf(N,D.length-mt),1)):mt++,at=D[D.length-st],He(v,{command:"addLayer",args:[k[N],at]}),D.splice(D.length-st,0,N),R[N]=!0);for(let st=0;st<P.length;st++)if(N=P[st],$=M[N],W=k[N],!R[N]&&!ze($,W))if(ze($.source,W.source)&&ze($["source-layer"],W["source-layer"])&&ze($.type,W.type)){for(et in vn($.layout,W.layout,v,N,null,"setLayoutProperty"),vn($.paint,W.paint,v,N,null,"setPaintProperty"),ze($.filter,W.filter)||He(v,{command:"setFilter",args:[N,W.filter]}),ze($.minzoom,W.minzoom)&&ze($.maxzoom,W.maxzoom)||He(v,{command:"setLayerZoomRange",args:[N,W.minzoom,W.maxzoom]}),$)Object.prototype.hasOwnProperty.call($,et)&&et!=="layout"&&et!=="paint"&&et!=="filter"&&et!=="metadata"&&et!=="minzoom"&&et!=="maxzoom"&&(et.indexOf("paint.")===0?vn($[et],W[et],v,N,et.slice(6),"setPaintProperty"):ze($[et],W[et])||He(v,{command:"setLayerProperty",args:[N,et,W[et]]}));for(et in W)Object.prototype.hasOwnProperty.call(W,et)&&!Object.prototype.hasOwnProperty.call($,et)&&et!=="layout"&&et!=="paint"&&et!=="filter"&&et!=="metadata"&&et!=="minzoom"&&et!=="maxzoom"&&(et.indexOf("paint.")===0?vn($[et],W[et],v,N,et.slice(6),"setPaintProperty"):ze($[et],W[et])||He(v,{command:"setLayerProperty",args:[N,et,W[et]]}))}else He(v,{command:"removeLayer",args:[N]}),at=D[D.lastIndexOf(N)+1],He(v,{command:"addLayer",args:[W,at]})}(p,e.layers,n)}catch(o){console.warn("Unable to compute style diff:",o),n=[{command:"setStyle",args:[e]}]}return n},O.aD=function(i){const e=[],n=i.id;return n===void 0&&e.push({message:`layers.${n}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${n}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),e},O.aE=function i(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!i(e[o],n[o]))return!1;return!0}if(typeof e=="object"&&e!==null&&n!==null){if(typeof n!="object"||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(!i(e[o],n[o]))return!1;return!0}return e===n},O.aF=yn,O.aG=xs,O.aH=class extends ba{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},O.aI=Ul,O.aJ=class extends ba{constructor(i,e){super(i,e),this.current=ju}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},O.aK=ec,O.aL=ic,O.aM=Be,O.aN=class extends ba{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},O.aO=class extends ba{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},O.aP=function(i,e,n,o,h,p,f){var g=1/(e-n),v=1/(o-h),T=1/(p-f);return i[0]=-2*g,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*v,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*T,i[11]=0,i[12]=(e+n)*g,i[13]=(h+o)*v,i[14]=(f+p)*T,i[15]=1,i},O.aQ=Ku,O.aR=class extends nt{},O.aS=Zd,O.aT=class extends ht{},O.aU=xh,O.aV=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},O.aW=gc,O.aX=Ki,O.aY=gr,O.aZ=class extends Zt{},O.a_=function(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]&&i[6]===e[6]&&i[7]===e[7]&&i[8]===e[8]&&i[9]===e[9]&&i[10]===e[10]&&i[11]===e[11]&&i[12]===e[12]&&i[13]===e[13]&&i[14]===e[14]&&i[15]===e[15]},O.aa=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(n,o,h,p)=>{const f=h||p;return e[o]=!f||f.toLowerCase(),""}),e["max-age"]){const n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e},O.ab=function(i,e){const n=[];for(const o in i)o in e||n.push(o);return n},O.ac=Vi,O.ad=function(i,e,n){var o=Math.sin(n),h=Math.cos(n),p=e[0],f=e[1],g=e[2],v=e[3],T=e[4],P=e[5],M=e[6],k=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=p*h+T*o,i[1]=f*h+P*o,i[2]=g*h+M*o,i[3]=v*h+k*o,i[4]=T*h-p*o,i[5]=P*h-f*o,i[6]=M*h-g*o,i[7]=k*h-v*o,i},O.ae=function(i){var e=new Ya(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},O.af=Gl,O.ag=function(i,e){let n=0,o=0;if(i.kind==="constant")o=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:h,minZoom:p,maxZoom:f}=i,g=h?Vi($i.interpolationFactor(h,e,p,f),0,1):0;i.kind==="camera"?o=Ci.number(i.minSize,i.maxSize,g):n=g}return{uSizeT:n,uSize:o}},O.ai=function(i,{uSize:e,uSizeT:n},{lowerSize:o,upperSize:h}){return i.kind==="source"?o/Ns:i.kind==="composite"?Ci.number(o/Ns,h/Ns,n):e},O.aj=Rh,O.ak=function(i,e,n,o){const h=e.y-i.y,p=e.x-i.x,f=o.y-n.y,g=o.x-n.x,v=f*p-g*h;if(v===0)return null;const T=(g*(i.y-n.y)-f*(i.x-n.x))/v;return new bt(i.x+T*p,i.y+T*h)},O.al=yu,O.am=oc,O.an=gh,O.ao=function(i){let e=1/0,n=1/0,o=-1/0,h=-1/0;for(const p of i)e=Math.min(e,p.x),n=Math.min(n,p.y),o=Math.max(o,p.x),h=Math.max(h,p.y);return[e,n,o,h]},O.ap=Pi,O.ar=Bh,O.as=function(i,e){var n=e[0],o=e[1],h=e[2],p=e[3],f=e[4],g=e[5],v=e[6],T=e[7],P=e[8],M=e[9],k=e[10],D=e[11],R=e[12],N=e[13],$=e[14],W=e[15],at=n*g-o*f,et=n*v-h*f,st=n*T-p*f,mt=o*v-h*g,wt=o*T-p*g,Dt=h*T-p*v,Ht=P*N-M*R,Et=P*$-k*R,kt=P*W-D*R,qt=M*$-k*N,Nt=M*W-D*N,Ot=k*W-D*$,gt=at*Ot-et*Nt+st*qt+mt*kt-wt*Et+Dt*Ht;return gt?(i[0]=(g*Ot-v*Nt+T*qt)*(gt=1/gt),i[1]=(h*Nt-o*Ot-p*qt)*gt,i[2]=(N*Dt-$*wt+W*mt)*gt,i[3]=(k*wt-M*Dt-D*mt)*gt,i[4]=(v*kt-f*Ot-T*Et)*gt,i[5]=(n*Ot-h*kt+p*Et)*gt,i[6]=($*st-R*Dt-W*et)*gt,i[7]=(P*Dt-k*st+D*et)*gt,i[8]=(f*Nt-g*kt+T*Ht)*gt,i[9]=(o*kt-n*Nt-p*Ht)*gt,i[10]=(R*wt-N*st+W*at)*gt,i[11]=(M*st-P*wt-D*at)*gt,i[12]=(g*Et-f*qt-v*Ht)*gt,i[13]=(n*qt-o*Et+h*Ht)*gt,i[14]=(N*et-R*mt-$*at)*gt,i[15]=(P*mt-M*et+k*at)*gt,i):null},O.at=qh,O.au=Dh,O.av=$h,O.aw=function(){const i={},e=ut.$version;for(const n in ut.$root){const o=ut.$root[n];if(o.required){let h=null;h=n==="version"?e:o.type==="array"?[]:{},h!=null&&(i[n]=h)}}return i},O.ax=si,O.ay=mi,O.az=function(i){i=i.slice();const e=Object.create(null);for(let n=0;n<i.length;n++)e[i[n].id]=i[n];for(let n=0;n<i.length;n++)"ref"in i[n]&&(i[n]=Ir(i[n],e[i[n].ref]));return i},O.b=Zi,O.b0=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},O.b1=function(i,e,n){return i[0]=e[0]*n[0],i[1]=e[1]*n[1],i[2]=e[2]*n[2],i[3]=e[3]*n[3],i},O.b2=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},O.b3=gn,O.b4=uu,O.b5=hu,O.b6=function(i,e,n,o,h){var p,f=1/Math.tan(e/2);return i[0]=f/n,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,h!=null&&h!==1/0?(i[10]=(h+o)*(p=1/(o-h)),i[14]=2*h*o*p):(i[10]=-1,i[14]=-2*o),i},O.b7=function(i,e,n){var o=Math.sin(n),h=Math.cos(n),p=e[4],f=e[5],g=e[6],v=e[7],T=e[8],P=e[9],M=e[10],k=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=p*h+T*o,i[5]=f*h+P*o,i[6]=g*h+M*o,i[7]=v*h+k*o,i[8]=T*h-p*o,i[9]=P*h-f*o,i[10]=M*h-g*o,i[11]=k*h-v*o,i},O.b8=ti,O.b9=js,O.bA=Fc,O.bB=function(i){return i.message===Ge},O.bC=ks,O.bD=Rn,O.ba=function(i){return i*Math.PI/180},O.bb=function(i,e){const{x:n,y:o}=El.fromLngLat(e);return!(i<0||i>25||o<0||o>=1||n<0||n>=1)},O.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},O.bd=class extends S{},O.be=Vh,O.bf=Tp,O.bh=oi,O.bi=function(i,e){Fe.REGISTERED_PROTOCOLS[i]=e},O.bj=function(i){delete Fe.REGISTERED_PROTOCOLS[i]},O.bk=function(i,e){const n={};for(let h=0;h<i.length;h++){const p=e&&e[i[h].id]||Na(i[h]);e&&(e[i[h].id]=p);let f=n[p];f||(f=n[p]=[]),f.push(i[h])}const o=[];for(const h in n)o.push(n[h]);return o},O.bl=Ft,O.bm=pu,O.bn=mu,O.bo=Gc,O.bp=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=xi/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],n=e.layout,o=e._unevaluatedLayout._values,h={layoutIconSize:o["icon-size"].possiblyEvaluate(new Xe(i.bucket.zoom+1),i.canonical),layoutTextSize:o["text-size"].possiblyEvaluate(new Xe(i.bucket.zoom+1),i.canonical),textMaxSize:o["text-size"].possiblyEvaluate(new Xe(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:T,maxZoom:P}=i.bucket.textSizeData;h.compositeTextSizes=[o["text-size"].possiblyEvaluate(new Xe(T),i.canonical),o["text-size"].possiblyEvaluate(new Xe(P),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:T,maxZoom:P}=i.bucket.iconSizeData;h.compositeIconSizes=[o["icon-size"].possiblyEvaluate(new Xe(T),i.canonical),o["icon-size"].possiblyEvaluate(new Xe(P),i.canonical)]}const p=n.get("text-line-height")*Pi,f=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",g=n.get("text-keep-upright"),v=n.get("text-size");for(const T of i.bucket.features){const P=n.get("text-font").evaluate(T,{},i.canonical).join(","),M=v.evaluate(T,{},i.canonical),k=h.layoutTextSize.evaluate(T,{},i.canonical),D=h.layoutIconSize.evaluate(T,{},i.canonical),R={horizontal:{},vertical:void 0},N=T.text;let $,W=[0,0];if(N){const st=N.toString(),mt=n.get("text-letter-spacing").evaluate(T,{},i.canonical)*Pi,wt=fl(st)?mt:0,Dt=n.get("text-anchor").evaluate(T,{},i.canonical),Ht=Mu(e,T,i.canonical);if(!Ht){const Nt=n.get("text-radial-offset").evaluate(T,{},i.canonical);W=Nt?Iu(Dt,[Nt*Pi,jh]):n.get("text-offset").evaluate(T,{},i.canonical).map(Ot=>Ot*Pi)}let Et=f?"center":n.get("text-justify").evaluate(T,{},i.canonical);const kt=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(T,{},i.canonical)*Pi:1/0,qt=()=>{i.bucket.allowVerticalPlacement&&fa(st)&&(R.vertical=Yl(N,i.glyphMap,i.glyphPositions,i.imagePositions,P,kt,p,Dt,"left",wt,W,O.ah.vertical,!0,k,M))};if(!f&&Ht){const Nt=new Set;if(Et==="auto")for(let gt=0;gt<Ht.values.length;gt+=2)Nt.add(qh(Ht.values[gt]));else Nt.add(Et);let Ot=!1;for(const gt of Nt)if(!R.horizontal[gt])if(Ot)R.horizontal[gt]=R.horizontal[0];else{const $t=Yl(N,i.glyphMap,i.glyphPositions,i.imagePositions,P,kt,p,"center",gt,wt,W,O.ah.horizontal,!1,k,M);$t&&(R.horizontal[gt]=$t,Ot=$t.positionedLines.length===1)}qt()}else{Et==="auto"&&(Et=qh(Dt));const Nt=Yl(N,i.glyphMap,i.glyphPositions,i.imagePositions,P,kt,p,Dt,Et,wt,W,O.ah.horizontal,!1,k,M);Nt&&(R.horizontal[Et]=Nt),qt(),fa(st)&&f&&g&&(R.vertical=Yl(N,i.glyphMap,i.glyphPositions,i.imagePositions,P,kt,p,Dt,Et,wt,W,O.ah.vertical,!1,k,M))}}let at=!1;if(T.icon&&T.icon.name){const st=i.imageMap[T.icon.name];st&&($=sp(i.imagePositions[T.icon.name],n.get("icon-offset").evaluate(T,{},i.canonical),n.get("icon-anchor").evaluate(T,{},i.canonical)),at=!!st.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=at:i.bucket.sdfIcons!==at&&Si("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(st.pixelRatio!==i.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const et=Au(R.horizontal)||R.vertical;i.bucket.iconsInText=!!et&&et.iconsInText,(et||$)&&bp(i.bucket,T,R,$,i.imageMap,h,k,D,W,at,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},O.bq=Ch,O.br=Sh,O.bs=Mh,O.bt=Vo,O.bu=kh,O.bv=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},O.bw=function(i,e,n,o,h){return m(this,void 0,void 0,function*(){if(vs())try{return yield Tr(i,e,n,o,h)}catch{}return function(p,f,g,v,T){const P=p.width,M=p.height;Kt&&Te||(Kt=new OffscreenCanvas(P,M),Te=Kt.getContext("2d",{willReadFrequently:!0})),Kt.width=P,Kt.height=M,Te.drawImage(p,0,0,P,M);const k=Te.getImageData(f,g,v,T);return Te.clearRect(0,0,P,M),k.data}(i,e,n,o,h)})},O.bx=du,O.by=ae,O.bz=An,O.c=ci,O.d=i=>m(void 0,void 0,void 0,function*(){if(i.byteLength===0)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(e)}catch(n){throw new Error(`Could not load image because of ${n.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),O.e=rn,O.f=i=>new Promise((e,n)=>{const o=new Image;o.onload=()=>{e(o),URL.revokeObjectURL(o.src),o.onload=null,window.requestAnimationFrame(()=>{o.src=re})},o.onerror=()=>n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const h=new Blob([new Uint8Array(i)],{type:"image/png"});o.src=i.byteLength?URL.createObjectURL(h):re}),O.g=ve,O.h=(i,e)=>Pr(rn(i,{type:"json"}),e),O.i=or,O.j=Sr,O.k=Vn,O.l=(i,e)=>Pr(rn(i,{type:"arrayBuffer"}),e),O.m=Pr,O.n=function(i){return new kh(i).readFields(Yd,[])},O.o=wl,O.p=$c,O.q=d,O.r=te,O.s=ar,O.t=Wi,O.u=Bt,O.v=ut,O.w=Si,O.x=function([i,e,n]){return e+=90,e*=Math.PI/180,n*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(n),y:i*Math.sin(e)*Math.sin(n),z:i*Math.cos(n)}},O.y=Ci,O.z=Xe}),Ae("worker",["./shared"],function(O){class m{constructor(E){this.keyCache={},E&&this.replace(E)}replace(E){this._layerConfigs={},this._layers={},this.update(E,[])}
vendor: 5,178 bytes, line 8
8update(E,z){for(const q of E){this._layerConfigs[q.id]=q;const tt=this._layers[q.id]=O.aA(q);tt._featureFilter=O.a7(tt.filter),this.keyCache[q.id]&&delete this.keyCache[q.id]}for(const q of z)delete this.keyCache[q],delete this._layerConfigs[q],delete this._layers[q];this.familiesBySource={};const V=O.bk(Object.values(this._layerConfigs),this.keyCache);for(const q of V){const tt=q.map(ct=>this._layers[ct.id]),it=tt[0];if(it.visibility==="none")continue;const ot=it.source||"";let Y=this.familiesBySource[ot];Y||(Y=this.familiesBySource[ot]={});const _t=it.sourceLayer||"_geojsonTileLayer";let vt=Y[_t];vt||(vt=Y[_t]=[]),vt.push(tt)}}}class ae{constructor(E){const z={},V=[];for(const ot in E){const Y=E[ot],_t=z[ot]={};for(const vt in Y){const ct=Y[+vt];if(!ct||ct.bitmap.width===0||ct.bitmap.height===0)continue;const dt={x:0,y:0,w:ct.bitmap.width+2,h:ct.bitmap.height+2};V.push(dt),_t[vt]={rect:dt,metrics:ct.metrics}}}const{w:q,h:tt}=O.p(V),it=new O.o({width:q||1,height:tt||1});for(const ot in E){const Y=E[ot];for(const _t in Y){const vt=Y[+_t];if(!vt||vt.bitmap.width===0||vt.bitmap.height===0)continue;const ct=z[ot][_t].rect;O.o.copy(vt.bitmap,it,{x:0,y:0},{x:ct.x+1,y:ct.y+1},vt.bitmap)}}this.image=it,this.positions=z}}O.bl("GlyphAtlas",ae);class An{constructor(E){this.tileID=new O.S(E.tileID.overscaledZ,E.tileID.wrap,E.tileID.canonical.z,E.tileID.canonical.x,E.tileID.canonical.y),this.uid=E.uid,this.zoom=E.zoom,this.pixelRatio=E.pixelRatio,this.tileSize=E.tileSize,this.source=E.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=E.showCollisionBoxes,this.collectResourceTiming=!!E.collectResourceTiming,this.returnDependencies=!!E.returnDependencies,this.promoteId=E.promoteId,this.inFlightDependencies=[]}parse(E,z,V,q){return O._(this,void 0,void 0,function*(){this.status="parsing",this.data=E,this.collisionBoxArray=new O.a5;const tt=new O.bm(Object.keys(E.layers).sort()),it=new O.bn(this.tileID,this.promoteId);it.bucketLayerIDs=[];const ot={},Y={featureIndex:it,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:V},_t=z.familiesBySource[this.source];for(const he in _t){const De=E.layers[he];if(!De)continue;De.version===1&&O.w(`Vector tile source "${this.source}" layer "${he}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const qe=tt.encode(he),_i=[];for(let gi=0;gi<De.length;gi++){const Bi=De.feature(gi),ur=it.getId(Bi,he);_i.push({feature:Bi,id:ur,index:gi,sourceLayerIndex:qe})}for(const gi of _t[he]){const Bi=gi[0];Bi.source!==this.source&&O.w(`layer.source = ${Bi.source} does not equal this.source = ${this.source}`),Bi.minzoom&&this.zoom<Math.floor(Bi.minzoom)||Bi.maxzoom&&this.zoom>=Bi.maxzoom||Bi.visibility!=="none"&&(hi(gi,this.zoom,V),(ot[Bi.id]=Bi.createBucket({index:it.bucketLayerIDs.length,layers:gi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:qe,sourceID:this.source})).populate(_i,Y,this.tileID.canonical),it.bucketLayerIDs.push(gi.map(ur=>ur.id)))}}const vt=O.aF(Y.glyphDependencies,he=>Object.keys(he).map(Number));this.inFlightDependencies.forEach(he=>he?.abort()),this.inFlightDependencies=[];let ct=Promise.resolve({});if(Object.keys(vt).length){const he=new AbortController;this.inFlightDependencies.push(he),ct=q.sendAsync({type:"GG",data:{stacks:vt,source:this.source,tileID:this.tileID,type:"glyphs"}},he)}const dt=Object.keys(Y.iconDependencies);let jt=Promise.resolve({});if(dt.length){const he=new AbortController;this.inFlightDependencies.push(he),jt=q.sendAsync({type:"GI",data:{icons:dt,source:this.source,tileID:this.tileID,type:"icons"}},he)}const Gt=Object.keys(Y.patternDependencies);let Pe=Promise.resolve({});if(Gt.length){const he=new AbortController;this.inFlightDependencies.push(he),Pe=q.sendAsync({type:"GI",data:{icons:Gt,source:this.source,tileID:this.tileID,type:"patterns"}},he)}const[ne,xe,me]=yield Promise.all([ct,jt,Pe]),je=new ae(ne),We=new O.bo(xe,me);for(const he in ot){const De=ot[he];De instanceof O.a6?(hi(De.layers,this.zoom,V),O.bp({bucket:De,glyphMap:ne,glyphPositions:je.positions,imageMap:xe,imagePositions:We.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):De.hasPattern&&(De instanceof O.bq||De instanceof O.br||De instanceof O.bs)&&(hi(De.layers,this.zoom,V),De.addFeatures(Y,this.tileID.canonical,We.patternPositions))}return this.status="done",{buckets:Object.values(ot).filter(he=>!he.isEmpty()),featureIndex:it,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:je.image,imageAtlas:We,glyphMap:this.returnDependencies?ne:null,iconMap:this.returnDependencies?xe:null,glyphPositions:this.returnDependencies?je.positions:null}})}}function hi(H,E,z){const V=new O.z(E);for(const q of H)q.recalculate(V,z)}class bt{constructor(E,z,V){this.actor=E,this.layerIndex=z,this.availableImages=V,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(E,z){return O._(this,void 0,void 0,function*(){const V=yield O.l(E.request,z);try{return{vectorTile:new O.bt.VectorTile(new O.bu(V.data)),rawData:V.data,cacheControl:V.cacheControl,expires:V.expires}}
8catch(q){const tt=new Uint8Array(V.data);let it=`Unable to parse the tile at ${E.request.url}, `;throw it+=tt[0]===31&&tt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${q.message}`,new Error(it)}})}loadTile(E){return O._(this,void 0,void 0,function*(){const z=E.uid,V=!!(E&&E.request&&E.request.collectResourceTiming)&&new O.bv(E.request),q=new An(E);this.loading[z]=q;const tt=new AbortController;q.abort=tt;try{const it=yield this.loadVectorTile(E,tt);if(delete this.loading[z],!it)return null;const ot=it.rawData,Y={};it.expires&&(Y.expires=it.expires),it.cacheControl&&(Y.cacheControl=it.cacheControl);const _t={};if(V){const ct=V.finish();ct&&(_t.resourceTiming=JSON.parse(JSON.stringify(ct)))}q.vectorTile=it.vectorTile;const vt=q.parse(it.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[z]=q,this.fetching[z]={rawTileData:ot,cacheControl:Y,resourceTiming:_t};try{const ct=yield vt;return O.e({rawTileData:ot.slice(0)},ct,Y,_t)}finally{delete this.fetching[z]}}catch(it){throw delete this.loading[z],q.status="done",this.loaded[z]=q,it}})}reloadTile(E){return O._(this,void 0,void 0,function*(){const z=E.uid;if(!this.loaded||!this.loaded[z])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const V=this.loaded[z];if(V.showCollisionBoxes=E.showCollisionBoxes,V.status==="parsing"){const q=yield V.parse(V.vectorTile,this.layerIndex,this.availableImages,this.actor);let tt;if(this.fetching[z]){const{rawTileData:it,cacheControl:ot,resourceTiming:Y}=this.fetching[z];delete this.fetching[z],tt=O.e({rawTileData:it.slice(0)},q,ot,Y)}else tt=q;return tt}if(V.status==="done"&&V.vectorTile)return V.parse(V.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(E){return O._(this,void 0,void 0,function*(){const z=this.loading,V=E.uid;z&&z[V]&&z[V].abort&&(z[V].abort.abort(),delete z[V])})}removeTile(E){return O._(this,void 0,void 0,function*(){this.loaded&&this.loaded[E.uid]&&delete this.loaded[E.uid]})}}class ft{constructor(){this.loaded={}}loadTile(E){return O._(this,void 0,void 0,function*(){const{uid:z,encoding:V,rawImageData:q,redFactor:tt,greenFactor:it,blueFactor:ot,baseShift:Y}=E,_t=q.width+2,vt=q.height+2,ct=O.b(q)?new O.R({width:_t,height:vt},yield O.bw(q,-1,-1,_t,vt)):q,dt=new O.bx(z,ct,V,tt,it,ot,Y);return this.loaded=this.loaded||{},this.loaded[z]=dt,dt})}removeTile(E){const z=this.loaded,V=E.uid;z&&z[V]&&delete z[V]}}function nr(H,E){if(H.length!==0){Ni(H[0],E);for(var z=1;z<H.length;z++)Ni(H[z],!E)}}function Ni(H,E){for(var z=0,V=0,q=0,tt=H.length,it=tt-1;q<tt;it=q++){var ot=(H[q][0]-H[it][0])*(H[it][1]+H[q][1]),Y=z+ot;V+=Math.abs(z)>=Math.abs(ot)?z-Y+ot:ot-Y+z,z=Y}z+V>=0!=!!E&&H.reverse()}var ke=O.by(function H(E,z){var V,q=E&&E.type;if(q==="FeatureCollection")for(V=0;V<E.features.length;V++)H(E.features[V],z);else if(q==="GeometryCollection")for(V=0;V<E.geometries.length;V++)H(E.geometries[V],z);else if(q==="Feature")H(E.geometry,z);else if(q==="Polygon")nr(E.coordinates,z);else if(q==="MultiPolygon")for(V=0;V<E.coordinates.length;V++)nr(E.coordinates[V],z);return E});const rr=O.bt.VectorTileFeature.prototype.toGeoJSON;var sr={exports:{}},vs=O.bz,ti=O.bt.VectorTileFeature,js=Vi;function Vi(H,E){this.options=E||{},this.features=H,this.length=H.length}function gn(H,E){this.id=typeof H.id=="number"?H.id:void 0,this.type=H.type,this.rawGeometry=H.type===1?[H.geometry]:H.geometry,this.properties=H.tags,this.extent=E||4096}Vi.prototype.feature=function(H){return new gn(this.features[H],this.options.extent)},gn.prototype.loadGeometry=function(){var H=this.rawGeometry;this.geometry=[];for(var E=0;E<H.length;E++){for(var z=H[E],V=[],q=0;q<z.length;q++)V.push(new vs(z[q][0],z[q][1]));this.geometry.push(V)}return this.geometry},gn.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var H=this.geometry,E=1/0,z=-1/0,V=1/0,q=-1/0,tt=0;tt<H.length;tt++)for(var it=H[tt],ot=0;ot<it.length;ot++){var Y=it[ot];E=Math.min(E,Y.x),z=Math.max(z,Y.x),V=Math.min(V,Y.y),q=Math.max(q,Y.y)}return[E,V,z,q]},gn.prototype.toGeoJSON=ti.prototype.toGeoJSON;var rn=O.bA,qs=js;function yn(H){var E=new rn;
vendor: 6,393 bytes, line 8
8return function(z,V){for(var q in z.layers)V.writeMessage(3,xs,z.layers[q])}(H,E),E.finish()}function xs(H,E){var z;E.writeVarintField(15,H.version||1),E.writeStringField(1,H.name||""),E.writeVarintField(5,H.extent||4096);var V={keys:[],values:[],keycache:{},valuecache:{}};for(z=0;z<H.length;z++)V.feature=H.feature(z),E.writeMessage(2,le,V);var q=V.keys;for(z=0;z<q.length;z++)E.writeStringField(3,q[z]);var tt=V.values;for(z=0;z<tt.length;z++)E.writeMessage(4,fi,tt[z])}function le(H,E){var z=H.feature;z.id!==void 0&&E.writeVarintField(1,z.id),E.writeMessage(2,Li,H),E.writeVarintField(3,z.type),E.writeMessage(4,or,z)}function Li(H,E){var z=H.feature,V=H.keys,q=H.values,tt=H.keycache,it=H.valuecache;for(var ot in z.properties){var Y=z.properties[ot],_t=tt[ot];if(Y!==null){_t===void 0&&(V.push(ot),tt[ot]=_t=V.length-1),E.writeVarint(_t);var vt=typeof Y;vt!=="string"&&vt!=="boolean"&&vt!=="number"&&(Y=JSON.stringify(Y));var ct=vt+":"+Y,dt=it[ct];dt===void 0&&(q.push(Y),it[ct]=dt=q.length-1),E.writeVarint(dt)}}}function Si(H,E){return(E<<3)+(7&H)}function ei(H){return H<<1^H>>31}function or(H,E){for(var z=H.loadGeometry(),V=H.type,q=0,tt=0,it=z.length,ot=0;ot<it;ot++){var Y=z[ot],_t=1;V===1&&(_t=Y.length),E.writeVarint(Si(1,_t));for(var vt=V===3?Y.length-1:Y.length,ct=0;ct<vt;ct++){ct===1&&V!==1&&E.writeVarint(Si(2,vt-1));var dt=Y[ct].x-q,jt=Y[ct].y-tt;E.writeVarint(ei(dt)),E.writeVarint(ei(jt)),q+=dt,tt+=jt}V===3&&E.writeVarint(Si(7,1))}}function fi(H,E){var z=typeof H;z==="string"?E.writeStringField(1,H):z==="boolean"?E.writeBooleanField(7,H):z==="number"&&(H%1!=0?E.writeDoubleField(3,H):H<0?E.writeSVarintField(6,H):E.writeVarintField(5,H))}sr.exports=yn,sr.exports.fromVectorTileJs=yn,sr.exports.fromGeojsonVt=function(H,E){E=E||{};var z={};for(var V in H)z[V]=new qs(H[V].features,E),z[V].name=V,z[V].version=E.version,z[V].extent=E.extent;return yn({layers:z})},sr.exports.GeoJSONWrapper=qs;var Zi=O.by(sr.exports);const re={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:H=>H},Tr=Math.fround||(Kt=new Float32Array(1),H=>(Kt[0]=+H,Kt[0]));var Kt;const Te=3,Ge=5,ci=6;class Fe{constructor(E){this.options=Object.assign(Object.create(re),E),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(E){const{log:z,minZoom:V,maxZoom:q}=this.options;z&&console.time("total time");const tt=`prepare ${E.length} points`;z&&console.time(tt),this.points=E;const it=[];for(let Y=0;Y<E.length;Y++){const _t=E[Y];if(!_t.geometry)continue;const[vt,ct]=_t.geometry.coordinates,dt=Tr(oi(vt)),jt=Tr(mi(ct));it.push(dt,jt,1/0,Y,-1,1),this.options.reduce&&it.push(0)}let ot=this.trees[q+1]=this._createTree(it);z&&console.timeEnd(tt);for(let Y=q;Y>=V;Y--){const _t=+Date.now();ot=this.trees[Y]=this._createTree(this._cluster(ot,Y)),z&&console.log("z%d: %d clusters in %dms",Y,ot.numItems,+Date.now()-_t)}return z&&console.timeEnd("total time"),this}getClusters(E,z){let V=((E[0]+180)%360+360)%360-180;const q=Math.max(-90,Math.min(90,E[1]));let tt=E[2]===180?180:((E[2]+180)%360+360)%360-180;const it=Math.max(-90,Math.min(90,E[3]));if(E[2]-E[0]>=360)V=-180,tt=180;else if(V>tt){const ct=this.getClusters([V,q,180,it],z),dt=this.getClusters([-180,q,tt,it],z);return ct.concat(dt)}const ot=this.trees[this._limitZoom(z)],Y=ot.range(oi(V),mi(it),oi(tt),mi(q)),_t=ot.data,vt=[];for(const ct of Y){const dt=this.stride*ct;vt.push(_t[dt+Ge]>1?ve(_t,dt,this.clusterProps):this.points[_t[dt+Te]])}return vt}getChildren(E){const z=this._getOriginId(E),V=this._getOriginZoom(E),q="No cluster with the specified id.",tt=this.trees[V];if(!tt)throw new Error(q);const it=tt.data;if(z*this.stride>=it.length)throw new Error(q);const ot=this.options.radius/(this.options.extent*Math.pow(2,V-1)),Y=tt.within(it[z*this.stride],it[z*this.stride+1],ot),_t=[];for(const vt of Y){const ct=vt*this.stride;it[ct+4]===E&&_t.push(it[ct+Ge]>1?ve(it,ct,this.clusterProps):this.points[it[ct+Te]])}if(_t.length===0)throw new Error(q);return _t}getLeaves(E,z,V){const q=[];return this._appendLeaves(q,E,z=z||10,V=V||0,0),q}getTile(E,z,V){const q=this.trees[this._limitZoom(E)],tt=Math.pow(2,E),{extent:it,radius:ot}=this.options,Y=ot/it,_t=(V-Y)/tt,vt=(V+1+Y)/tt,ct={features:[]};return this._addTileFeatures(q.range((z-Y)/tt,_t,(z+1+Y)/tt,vt),q.data,z,V,tt,ct),z===0&&this._addTileFeatures(q.range(1-Y/tt,_t,1,vt),q.data,tt,V,tt,ct),z===tt-1&&this._addTileFeatures(q.range(0,_t,Y/tt,vt),q.data,-1,V,tt,ct),ct.features.length?ct:null}getClusterExpansionZoom(E){let z=this._getOriginZoom(E)-1;for(;z<=this.options.maxZoom;){const V=this.getChildren(E);if(z++,V.length!==1)break;E=V[0].properties.cluster_id}return z}_appendLeaves(E,z,V,q,tt){const it=this.getChildren(z);for(const ot of it){const Y=ot.properties;if(Y&&Y.cluster?tt+Y.point_count<=q?tt+=Y.point_count:tt=this._appendLeaves(E,Y.cluster_id,V,q,tt):tt<q?tt++:E.push(ot),E.length===V)break}return tt}_createTree(E){const z=new O.av(E.length/this.stride|0,this.options.nodeSize,Float32Array);for(let V=0;V<E.length;V+=this.stride)z.add(E[V],E[V+1]);return z.finish(),z.data=E,z}_addTileFeatures(E,z,V,q,tt,it){for(const ot of E){const Y=ot*this.stride,_t=z[Y+Ge]>1;let vt,ct,dt;if(_t)vt=ge(z,Y,this.clusterProps),ct=z[Y],dt=z[Y+1];else{const Pe=this.points[z[Y+Te]];vt=Pe.properties;const[ne,xe]=Pe.geometry.coordinates;ct=oi(ne),dt=mi(xe)}const jt={type:1,geometry:[[Math.round(this.options.extent*(ct*tt-V)),Math.round(this.options.extent*(dt*tt-q))]],tags:vt};let Gt;Gt=_t||this.options.generateId?z[Y+Te]:this.points[z[Y+Te]].id,Gt!==void 0&&(jt.id=Gt),it.features.push(jt)}}_limitZoom(E){return Math.max(this.options.minZoom,Math.min(Math.floor(+E),this.options.maxZoom+1))}_cluster(E,z){const{radius:V,extent:q,reduce:tt,minPoints:it}=this.options,ot=V/(q*Math.pow(2,z)),Y=E.data,_t=[],vt=this.stride;for(let ct=0;ct<Y.length;ct+=vt){if(Y[ct+2]<=z)continue;Y[ct+2]=z;const dt=Y[ct],jt=Y[ct+1],Gt=E.within(Y[ct],Y[ct+1],ot),Pe=Y[ct+Ge];let ne=Pe;for(const xe of Gt){const me=xe*vt;Y[me+2]>z&&(ne+=Y[me+Ge])}if(ne>Pe&&ne>=it){let xe,me=dt*Pe,je=jt*Pe,We=-1;const he=((ct/vt|0)<<5)+(z+1)+this.points.length;for(const De of Gt){const qe=De*vt;if(Y[qe+2]<=z)continue;Y[qe+2]=z;const _i=Y[qe+Ge];me+=Y[qe]*_i,je+=Y[qe+1]*_i,Y[qe+4]=he,tt&&(xe||(xe=this._map(Y,ct,!0),We=this.clusterProps.length,this.clusterProps.push(xe)),tt(xe,this._map(Y,qe)))}
vendor: 9,007 bytes, line 8
8Y[ct+4]=he,_t.push(me/ne,je/ne,1/0,he,-1,ne),tt&&_t.push(We)}else{for(let xe=0;xe<vt;xe++)_t.push(Y[ct+xe]);if(ne>1)for(const xe of Gt){const me=xe*vt;if(!(Y[me+2]<=z)){Y[me+2]=z;for(let je=0;je<vt;je++)_t.push(Y[me+je])}}}}return _t}_getOriginId(E){return E-this.points.length>>5}_getOriginZoom(E){return(E-this.points.length)%32}_map(E,z,V){if(E[z+Ge]>1){const it=this.clusterProps[E[z+ci]];return V?Object.assign({},it):it}const q=this.points[E[z+Te]].properties,tt=this.options.map(q);return V&&tt===q?Object.assign({},tt):tt}}function ve(H,E,z){return{type:"Feature",id:H[E+Te],properties:ge(H,E,z),geometry:{type:"Point",coordinates:[(V=H[E],360*(V-.5)),Pr(H[E+1])]}};var V}function ge(H,E,z){const V=H[E+Ge],q=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V,tt=H[E+ci],it=tt===-1?{}:Object.assign({},z[tt]);return Object.assign(it,{cluster:!0,cluster_id:H[E+Te],point_count:V,point_count_abbreviated:q})}function oi(H){return H/360+.5}function mi(H){const E=Math.sin(H*Math.PI/180),z=.5-.25*Math.log((1+E)/(1-E))/Math.PI;return z<0?0:z>1?1:z}function Pr(H){const E=(180-360*H)*Math.PI/180;return 360*Math.atan(Math.exp(E))/Math.PI-90}function ar(H,E,z,V){let q=V;const tt=E+(z-E>>1);let it,ot=z-E;const Y=H[E],_t=H[E+1],vt=H[z],ct=H[z+1];for(let dt=E+3;dt<z;dt+=3){const jt=qr(H[dt],H[dt+1],Y,_t,vt,ct);if(jt>q)it=dt,q=jt;else if(jt===q){const Gt=Math.abs(dt-tt);Gt<ot&&(it=dt,ot=Gt)}}q>V&&(it-E>3&&ar(H,E,it,V),H[it+2]=q,z-it>3&&ar(H,it,z,V))}function qr(H,E,z,V,q,tt){let it=q-z,ot=tt-V;if(it!==0||ot!==0){const Y=((H-z)*it+(E-V)*ot)/(it*it+ot*ot);Y>1?(z=q,V=tt):Y>0&&(z+=it*Y,V+=ot*Y)}return it=H-z,ot=E-V,it*it+ot*ot}function sn(H,E,z,V){const q={id:H??null,type:E,geometry:z,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(E==="Point"||E==="MultiPoint"||E==="LineString")Vn(q,z);else if(E==="Polygon")Vn(q,z[0]);else if(E==="MultiLineString")for(const tt of z)Vn(q,tt);else if(E==="MultiPolygon")for(const tt of z)Vn(q,tt[0]);return q}function Vn(H,E){for(let z=0;z<E.length;z+=3)H.minX=Math.min(H.minX,E[z]),H.minY=Math.min(H.minY,E[z+1]),H.maxX=Math.max(H.maxX,E[z]),H.maxY=Math.max(H.maxY,E[z+1])}function Sr(H,E,z,V){if(!E.geometry)return;const q=E.geometry.coordinates;if(q&&q.length===0)return;const tt=E.geometry.type,it=Math.pow(z.tolerance/((1<<z.maxZoom)*z.extent),2);let ot=[],Y=E.id;if(z.promoteId?Y=E.properties[z.promoteId]:z.generateId&&(Y=V||0),tt==="Point")$r(q,ot);else if(tt==="MultiPoint")for(const _t of q)$r(_t,ot);else if(tt==="LineString")ut(q,ot,it,!1);else if(tt==="MultiLineString"){if(z.lineMetrics){for(const _t of q)ot=[],ut(_t,ot,it,!1),H.push(sn(Y,"LineString",ot,E.properties));return}lr(q,ot,it,!1)}else if(tt==="Polygon")lr(q,ot,it,!0);else{if(tt!=="MultiPolygon"){if(tt==="GeometryCollection"){for(const _t of E.geometry.geometries)Sr(H,{id:Y,geometry:_t,properties:E.properties},z,V);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const _t of q){const vt=[];lr(_t,vt,it,!0),ot.push(vt)}}H.push(sn(Y,tt,ot,E.properties))}function $r(H,E){E.push(Ir(H[0]),ze(H[1]),0)}function ut(H,E,z,V){let q,tt,it=0;for(let Y=0;Y<H.length;Y++){const _t=Ir(H[Y][0]),vt=ze(H[Y][1]);E.push(_t,vt,0),Y>0&&(it+=V?(q*vt-_t*tt)/2:Math.sqrt(Math.pow(_t-q,2)+Math.pow(vt-tt,2))),q=_t,tt=vt}const ot=E.length-3;E[2]=1,ar(E,0,ot,z),E[ot+2]=1,E.size=Math.abs(it),E.start=0,E.end=E.size}function lr(H,E,z,V){for(let q=0;q<H.length;q++){const tt=[];ut(H[q],tt,z,V),E.push(tt)}}function Ir(H){return H/360+.5}function ze(H){const E=Math.sin(H*Math.PI/180),z=.5-.25*Math.log((1+E)/(1-E))/Math.PI;return z<0?0:z>1?1:z}function He(H,E,z,V,q,tt,it,ot){if(V/=E,tt>=(z/=E)&&it<V)return H;if(it<z||tt>=V)return null;const Y=[];for(const _t of H){const vt=_t.geometry;let ct=_t.type;const dt=q===0?_t.minX:_t.minY,jt=q===0?_t.maxX:_t.maxY;if(dt>=z&&jt<V){Y.push(_t);continue}if(jt<z||dt>=V)continue;let Gt=[];if(ct==="Point"||ct==="MultiPoint")Gr(vt,Gt,z,V,q);else if(ct==="LineString")hr(vt,Gt,z,V,q,!1,ot.lineMetrics);else if(ct==="MultiLineString")bs(vt,Gt,z,V,q,!1);else if(ct==="Polygon")bs(vt,Gt,z,V,q,!0);else if(ct==="MultiPolygon")for(const Pe of vt){const ne=[];bs(Pe,ne,z,V,q,!0),ne.length&&Gt.push(ne)}if(Gt.length){if(ot.lineMetrics&&ct==="LineString"){for(const Pe of Gt)Y.push(sn(_t.id,ct,Pe,_t.tags));continue}ct!=="LineString"&&ct!=="MultiLineString"||(Gt.length===1?(ct="LineString",Gt=Gt[0]):ct="MultiLineString"),ct!=="Point"&&ct!=="MultiPoint"||(ct=Gt.length===3?"Point":"MultiPoint"),Y.push(sn(_t.id,ct,Gt,_t.tags))}}return Y.length?Y:null}function Gr(H,E,z,V,q){for(let tt=0;tt<H.length;tt+=3){const it=H[tt+q];it>=z&&it<=V&&vn(E,H[tt],H[tt+1],H[tt+2])}}function hr(H,E,z,V,q,tt,it){let ot=Zn(H);const Y=q===0?Hr:ws;let _t,vt,ct=H.start;for(let ne=0;ne<H.length-3;ne+=3){const xe=H[ne],me=H[ne+1],je=H[ne+2],We=H[ne+3],he=H[ne+4],De=q===0?xe:me,qe=q===0?We:he;let _i=!1;it&&(_t=Math.sqrt(Math.pow(xe-We,2)+Math.pow(me-he,2))),De<z?qe>z&&(vt=Y(ot,xe,me,We,he,z),it&&(ot.start=ct+_t*vt)):De>V?qe<V&&(vt=Y(ot,xe,me,We,he,V),it&&(ot.start=ct+_t*vt)):vn(ot,xe,me,je),qe<z&&De>=z&&(vt=Y(ot,xe,me,We,he,z),_i=!0),qe>V&&De<=V&&(vt=Y(ot,xe,me,We,he,V),_i=!0),!tt&&_i&&(it&&(ot.end=ct+_t*vt),E.push(ot),ot=Zn(H)),it&&(ct+=_t)}let dt=H.length-3;const jt=H[dt],Gt=H[dt+1],Pe=q===0?jt:Gt;Pe>=z&&Pe<=V&&vn(ot,jt,Gt,H[dt+2]),dt=ot.length-3,tt&&dt>=3&&(ot[dt]!==ot[0]||ot[dt+1]!==ot[1])&&vn(ot,ot[0],ot[1],ot[2]),ot.length&&E.push(ot)}function Zn(H){const E=[];return E.size=H.size,E.start=H.start,E.end=H.end,E}function bs(H,E,z,V,q,tt){for(const it of H)hr(it,E,z,V,q,tt,!1)}function vn(H,E,z,V){H.push(E,z,V)}function Hr(H,E,z,V,q,tt){const it=(tt-E)/(V-E);return vn(H,tt,z+(q-z)*it,1),it}function ws(H,E,z,V,q,tt){const it=(tt-z)/(q-z);return vn(H,E+(V-E)*it,tt,1),it}function Pt(H,E){const z=[];for(let V=0;V<H.length;V++){const q=H[V],tt=q.type;let it;if(tt==="Point"||tt==="MultiPoint"||tt==="LineString")it=Un(q.geometry,E);else if(tt==="MultiLineString"||tt==="Polygon"){it=[];for(const ot of q.geometry)it.push(Un(ot,E))}else if(tt==="MultiPolygon"){it=[];for(const ot of q.geometry){const Y=[];for(const _t of ot)Y.push(Un(_t,E));it.push(Y)}}z.push(sn(q.id,tt,it,q.tags))}return z}function Un(H,E){const z=[];z.size=H.size,H.start!==void 0&&(z.start=H.start,z.end=H.end);for(let V=0;V<H.length;V+=3)z.push(H[V]+E,H[V+1],H[V+2]);return z}function Ii(H,E){if(H.transformed)return H;const z=1<<H.z,V=H.x,q=H.y;for(const tt of H.features){const it=tt.geometry,ot=tt.type;if(tt.geometry=[],ot===1)for(let Y=0;Y<it.length;Y+=2)tt.geometry.push(kn(it[Y],it[Y+1],E,z,V,q));else for(let Y=0;Y<it.length;Y++){const _t=[];for(let vt=0;vt<it[Y].length;vt+=2)_t.push(kn(it[Y][vt],it[Y][vt+1],E,z,V,q));tt.geometry.push(_t)}}return H.transformed=!0,H}function kn(H,E,z,V,q,tt){return[Math.round(z*(H*V-q)),Math.round(z*(E*V-tt))]}function Mr(H,E,z,V,q){const tt=E===q.maxZoom?0:q.tolerance/((1<<E)*q.extent),it={features:[],numPoints:0,numSimplified:0,numFeatures:H.length,source:null,x:z,y:V,z:E,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const ot of H)St(it,ot,tt,q);return it}function St(H,E,z,V){const q=E.geometry,tt=E.type,it=[];if(H.minX=Math.min(H.minX,E.minX),H.minY=Math.min(H.minY,E.minY),H.maxX=Math.max(H.maxX,E.maxX),H.maxY=Math.max(H.maxY,E.maxY),tt==="Point"||tt==="MultiPoint")for(let ot=0;ot<q.length;ot+=3)it.push(q[ot],q[ot+1]),H.numPoints++,H.numSimplified++;else if(tt==="LineString")se(it,q,H,z,!1,!1);else if(tt==="MultiLineString"||tt==="Polygon")for(let ot=0;ot<q.length;ot++)se(it,q[ot],H,z,tt==="Polygon",ot===0);else if(tt==="MultiPolygon")for(let ot=0;ot<q.length;ot++){const Y=q[ot];for(let _t=0;_t<Y.length;_t++)se(it,Y[_t],H,z,!0,_t===0)}if(it.length){let ot=E.tags||null;if(tt==="LineString"&&V.lineMetrics){ot={};for(const _t in E.tags)ot[_t]=E.tags[_t];ot.mapbox_clip_start=q.start/q.size,ot.mapbox_clip_end=q.end/q.size}const Y={geometry:it,type:tt==="Polygon"||tt==="MultiPolygon"?3:tt==="LineString"||tt==="MultiLineString"?2:1,tags:ot};E.id!==null&&(Y.id=E.id),H.features.push(Y)}}function se(H,E,z,V,q,tt){const it=V*V;if(V>0&&E.size<(q?it:V))return void(z.numPoints+=E.length/3);const ot=[];for(let Y=0;Y<E.length;Y+=3)(V===0||E[Y+2]>it)&&(z.numSimplified++,ot.push(E[Y],E[Y+1])),z.numPoints++;q&&function(Y,_t){let vt=0;for(let ct=0,dt=Y.length,jt=dt-2;ct<dt;jt=ct,ct+=2)vt+=(Y[ct]-Y[jt])*(Y[ct+1]+Y[jt+1]);if(vt>0===_t)for(let ct=0,dt=Y.length;ct<dt/2;ct+=2){const jt=Y[ct],Gt=Y[ct+1];Y[ct]=Y[dt-2-ct],Y[ct+1]=Y[dt-1-ct],Y[dt-2-ct]=jt,Y[dt-1-ct]=Gt}}(ot,tt),H.push(ot)}const Xt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Ui{constructor(E,z){const V=(z=this.options=function(tt,it){for(const ot in it)tt[ot]=it[ot];return tt}(Object.create(Xt),z)).debug;if(V&&console.time("preprocess data"),z.maxZoom<0||z.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(z.promoteId&&z.generateId)throw new Error("promoteId and generateId cannot be used together.");let q=function(tt,it){const ot=[];
vendor: 4,407 bytes, line 8
8if(tt.type==="FeatureCollection")for(let Y=0;Y<tt.features.length;Y++)Sr(ot,tt.features[Y],it,Y);else Sr(ot,tt.type==="Feature"?tt:{geometry:tt},it);return ot}(E,z);this.tiles={},this.tileCoords=[],V&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",z.indexMaxZoom,z.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),q=function(tt,it){const ot=it.buffer/it.extent;let Y=tt;const _t=He(tt,1,-1-ot,ot,0,-1,2,it),vt=He(tt,1,1-ot,2+ot,0,-1,2,it);return(_t||vt)&&(Y=He(tt,1,-ot,1+ot,0,-1,2,it)||[],_t&&(Y=Pt(_t,1).concat(Y)),vt&&(Y=Y.concat(Pt(vt,-1)))),Y}(q,z),q.length&&this.splitTile(q,0,0,0),V&&(q.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(E,z,V,q,tt,it,ot){const Y=[E,z,V,q],_t=this.options,vt=_t.debug;for(;Y.length;){q=Y.pop(),V=Y.pop(),z=Y.pop(),E=Y.pop();const ct=1<<z,dt=Di(z,V,q);let jt=this.tiles[dt];if(!jt&&(vt>1&&console.time("creation"),jt=this.tiles[dt]=Mr(E,z,V,q,_t),this.tileCoords.push({z,x:V,y:q}),vt)){vt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",z,V,q,jt.numFeatures,jt.numPoints,jt.numSimplified),console.timeEnd("creation"));const _i=`z${z}`;this.stats[_i]=(this.stats[_i]||0)+1,this.total++}if(jt.source=E,tt==null){if(z===_t.indexMaxZoom||jt.numPoints<=_t.indexMaxPoints)continue}else{if(z===_t.maxZoom||z===tt)continue;if(tt!=null){const _i=tt-z;if(V!==it>>_i||q!==ot>>_i)continue}}if(jt.source=null,E.length===0)continue;vt>1&&console.time("clipping");const Gt=.5*_t.buffer/_t.extent,Pe=.5-Gt,ne=.5+Gt,xe=1+Gt;let me=null,je=null,We=null,he=null,De=He(E,ct,V-Gt,V+ne,0,jt.minX,jt.maxX,_t),qe=He(E,ct,V+Pe,V+xe,0,jt.minX,jt.maxX,_t);E=null,De&&(me=He(De,ct,q-Gt,q+ne,1,jt.minY,jt.maxY,_t),je=He(De,ct,q+Pe,q+xe,1,jt.minY,jt.maxY,_t),De=null),qe&&(We=He(qe,ct,q-Gt,q+ne,1,jt.minY,jt.maxY,_t),he=He(qe,ct,q+Pe,q+xe,1,jt.minY,jt.maxY,_t),qe=null),vt>1&&console.timeEnd("clipping"),Y.push(me||[],z+1,2*V,2*q),Y.push(je||[],z+1,2*V,2*q+1),Y.push(We||[],z+1,2*V+1,2*q),Y.push(he||[],z+1,2*V+1,2*q+1)}}getTile(E,z,V){E=+E,z=+z,V=+V;const q=this.options,{extent:tt,debug:it}=q;if(E<0||E>24)return null;const ot=1<<E,Y=Di(E,z=z+ot&ot-1,V);if(this.tiles[Y])return Ii(this.tiles[Y],tt);it>1&&console.log("drilling down to z%d-%d-%d",E,z,V);let _t,vt=E,ct=z,dt=V;for(;!_t&&vt>0;)vt--,ct>>=1,dt>>=1,_t=this.tiles[Di(vt,ct,dt)];return _t&&_t.source?(it>1&&(console.log("found parent tile z%d-%d-%d",vt,ct,dt),console.time("drilling down")),this.splitTile(_t.source,vt,ct,dt,E,z,V),it>1&&console.timeEnd("drilling down"),this.tiles[Y]?Ii(this.tiles[Y],tt):null):null}}function Di(H,E,z){return 32*((1<<H)*z+E)+H}function ie(H,E){return E?H.properties[E]:H.id}function jn(H,E){if(H==null)return!0;if(H.type==="Feature")return ie(H,E)!=null;if(H.type==="FeatureCollection"){const z=new Set;for(const V of H.features){const q=ie(V,E);if(q==null||z.has(q))return!1;z.add(q)}return!0}return!1}function qn(H,E){const z=new Map;if(H!=null)if(H.type==="Feature")z.set(ie(H,E),H);else for(const V of H.features)z.set(ie(V,E),V);return z}class cr extends bt{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(E,z){return O._(this,void 0,void 0,function*(){const V=E.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const q=this._geoJSONIndex.getTile(V.z,V.x,V.y);if(!q)return null;const tt=new class{constructor(ot){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=O.X,this.length=ot.length,this._features=ot}feature(ot){return new class{constructor(Y){this._feature=Y,this.extent=O.X,this.type=Y.type,this.properties=Y.tags,"id"in Y&&!isNaN(Y.id)&&(this.id=parseInt(Y.id,10))}loadGeometry(){if(this._feature.type===1){const Y=[];for(const _t of this._feature.geometry)Y.push([new O.P(_t[0],_t[1])]);return Y}{const Y=[];for(const _t of this._feature.geometry){const vt=[];for(const ct of _t)vt.push(new O.P(ct[0],ct[1]));Y.push(vt)}return Y}}toGeoJSON(Y,_t,vt){return rr.call(this,Y,_t,vt)}}(this._features[ot])}}(q.features);let it=Zi(tt);return it.byteOffset===0&&it.byteLength===it.buffer.byteLength||(it=new Uint8Array(it)),{vectorTile:tt,rawData:it.buffer}})}loadData(E){return O._(this,void 0,void 0,function*(){var z;
8(z=this._pendingRequest)===null||z===void 0||z.abort();const V=!!(E&&E.request&&E.request.collectResourceTiming)&&new O.bv(E.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(E,this._pendingRequest),this._geoJSONIndex=E.cluster?new Fe(function({superclusterOptions:it,clusterProperties:ot}){if(!ot||!it)return it;const Y={},_t={},vt={accumulated:null,zoom:0},ct={properties:null},dt=Object.keys(ot);for(const jt of dt){const[Gt,Pe]=ot[jt],ne=O.bC(Pe),xe=O.bC(typeof Gt=="string"?[Gt,["accumulated"],["get",jt]]:Gt);Y[jt]=ne.value,_t[jt]=xe.value}return it.map=jt=>{ct.properties=jt;const Gt={};for(const Pe of dt)Gt[Pe]=Y[Pe].evaluate(vt,ct);return Gt},it.reduce=(jt,Gt)=>{ct.properties=Gt;for(const Pe of dt)vt.accumulated=jt[Pe],jt[Pe]=_t[Pe].evaluate(vt,ct)},it}(E)).load((yield this._pendingData).features):(q=yield this._pendingData,new Ui(q,E.geojsonVtOptions)),this.loaded={};const tt={};if(V){const it=V.finish();it&&(tt.resourceTiming={},tt.resourceTiming[E.source]=JSON.parse(JSON.stringify(it)))}return tt}catch(tt){if(delete this._pendingRequest,O.bB(tt))return{abandoned:!0};throw tt}var q})}getData(){return O._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(E){const z=this.loaded;return z&&z[E.uid]?super.reloadTile(E):this.loadTile(E)}loadAndProcessGeoJSON(E,z){return O._(this,void 0,void 0,function*(){let V=yield this.loadGeoJSON(E,z);if(delete this._pendingRequest,typeof V!="object")throw new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`);if(ke(V,!0),E.filter){const q=O.bC(E.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(q.result==="error")throw new Error(q.value.map(it=>`${it.key}: ${it.message}`).join(", "));V={type:"FeatureCollection",features:V.features.filter(it=>q.value.evaluate({zoom:0},it))}}return V})}loadGeoJSON(E,z){return O._(this,void 0,void 0,function*(){const{promoteId:V}=E;if(E.request){const q=yield O.h(E.request,z);return this._dataUpdateable=jn(q.data,V)?qn(q.data,V):void 0,q.data}
8if(typeof E.data=="string")try{const q=JSON.parse(E.data);return this._dataUpdateable=jn(q,V)?qn(q,V):void 0,q}catch{throw new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`)}if(!E.dataDiff)throw new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${E.source}`);return function(q,tt,it){var ot,Y,_t,vt;if(tt.removeAll&&q.clear(),tt.remove)for(const ct of tt.remove)q.delete(ct);if(tt.add)for(const ct of tt.add){const dt=ie(ct,it);dt!=null&&q.set(dt,ct)}if(tt.update)for(const ct of tt.update){let dt=q.get(ct.id);if(dt==null)continue;const jt=!ct.removeAllProperties&&(((ot=ct.removeProperties)===null||ot===void 0?void 0:ot.length)>0||((Y=ct.addOrUpdateProperties)===null||Y===void 0?void 0:Y.length)>0);if((ct.newGeometry||ct.removeAllProperties||jt)&&(dt=Object.assign({},dt),q.set(ct.id,dt),jt&&(dt.properties=Object.assign({},dt.properties))),ct.newGeometry&&(dt.geometry=ct.newGeometry),ct.removeAllProperties)dt.properties={};else if(((_t=ct.removeProperties)===null||_t===void 0?void 0:_t.length)>0)for(const Gt of ct.removeProperties)Object.prototype.hasOwnProperty.call(dt.properties,Gt)&&delete dt.properties[Gt];if(((vt=ct.addOrUpdateProperties)===null||vt===void 0?void 0:vt.length)>0)for(const{key:Gt,value:Pe}of ct.addOrUpdateProperties)dt.properties[Gt]=Pe}}(this._dataUpdateable,E.dataDiff,V),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(E){return O._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(E){return this._geoJSONIndex.getClusterExpansionZoom(E.clusterId)}getClusterChildren(E){return this._geoJSONIndex.getChildren(E.clusterId)}getClusterLeaves(E){return this._geoJSONIndex.getLeaves(E.clusterId,E.limit,E.offset)}}class zn{constructor(E){this.self=E,this.actor=new O.F(E),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(z,V)=>{if(this.externalWorkerSourceTypes[z])throw new Error(`Worker source with name "${z}" already registered.`);this.externalWorkerSourceTypes[z]=V},this.self.addProtocol=O.bi,this.self.removeProtocol=O.bj,this.self.registerRTLTextPlugin=z=>{if(O.bD.isParsed())throw new Error("RTL text plugin already registered.");O.bD.setMethods(z)},this.actor.registerMessageHandler("LDT",(z,V)=>this._getDEMWorkerSource(z,V.source).loadTile(V)),this.actor.registerMessageHandler("RDT",(z,V)=>O._(this,void 0,void 0,function*(){this._getDEMWorkerSource(z,V.source).removeTile(V)})),this.actor.registerMessageHandler("GCEZ",(z,V)=>O._(this,void 0,void 0,function*(){return this._getWorkerSource(z,V.type,V.source).getClusterExpansionZoom(V)})),this.actor.registerMessageHandler("GCC",(z,V)=>O._(this,void 0,void 0,function*(){return this._getWorkerSource(z,V.type,V.source).getClusterChildren(V)})),this.actor.registerMessageHandler("GCL",(z,V)=>O._(this,void 0,void 0,function*(){return this._getWorkerSource(z,V.type,V.source).getClusterLeaves(V)})),this.actor.registerMessageHandler("LD",(z,V)=>this._getWorkerSource(z,V.type,V.source).loadData(V)),this.actor.registerMessageHandler("GD",(z,V)=>this._getWorkerSource(z,V.type,V.source).getData()),this.actor.registerMessageHandler("LT",(z,V)=>this._getWorkerSource(z,V.type,V.source).loadTile(V)),this.actor.registerMessageHandler("RT",(z,V)=>this._getWorkerSource(z,V.type,V.source).reloadTile(V)),this.actor.registerMessageHandler("AT",(z,V)=>this._getWorkerSource(z,V.type,V.source).abortTile(V)),this.actor.registerMessageHandler("RMT",(z,V)=>this._getWorkerSource(z,V.type,V.source).removeTile(V)),this.actor.registerMessageHandler("RS",(z,V)=>O._(this,void 0,void 0,function*(){if(!this.workerSources[z]||!this.workerSources[z][V.type]||!this.workerSources[z][V.type][V.source])return;const q=this.workerSources[z][V.type][V.source];delete this.workerSources[z][V.type][V.source],q.removeSource!==void 0&&q.removeSource(V)})),this.actor.registerMessageHandler("RM",z=>O._(this,void 0,void 0,function*(){delete this.layerIndexes[z],delete this.availableImages[z],delete this.workerSources[z],delete this.demWorkerSources[z]})),this.actor.registerMessageHandler("SR",(z,V)=>O._(this,void 0,void 0,function*(){this.referrer=V})),this.actor.registerMessageHandler("SRPS",(z,V)=>this._syncRTLPluginState(z,V)),this.actor.registerMessageHandler("IS",(z,V)=>O._(this,void 0,void 0,function*(){this.self.importScripts(V)})),this.actor.registerMessageHandler("SI",(z,V)=>
vendor: 5,040 bytes, line 8
8this._setImages(z,V)),this.actor.registerMessageHandler("UL",(z,V)=>O._(this,void 0,void 0,function*(){this._getLayerIndex(z).update(V.layers,V.removedIds)})),this.actor.registerMessageHandler("SL",(z,V)=>O._(this,void 0,void 0,function*(){this._getLayerIndex(z).replace(V)}))}_setImages(E,z){return O._(this,void 0,void 0,function*(){this.availableImages[E]=z;for(const V in this.workerSources[E]){const q=this.workerSources[E][V];for(const tt in q)q[tt].availableImages=z}})}_syncRTLPluginState(E,z){return O._(this,void 0,void 0,function*(){if(O.bD.isParsed())return O.bD.getState();if(z.pluginStatus!=="loading")return O.bD.setState(z),z;const V=z.pluginURL;if(this.self.importScripts(V),O.bD.isParsed()){const q={pluginStatus:"loaded",pluginURL:V};return O.bD.setState(q),q}throw O.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${V}`)})}_getAvailableImages(E){let z=this.availableImages[E];return z||(z=[]),z}_getLayerIndex(E){let z=this.layerIndexes[E];return z||(z=this.layerIndexes[E]=new m),z}_getWorkerSource(E,z,V){if(this.workerSources[E]||(this.workerSources[E]={}),this.workerSources[E][z]||(this.workerSources[E][z]={}),!this.workerSources[E][z][V]){const q={sendAsync:(tt,it)=>(tt.targetMapId=E,this.actor.sendAsync(tt,it))};switch(z){case"vector":this.workerSources[E][z][V]=new bt(q,this._getLayerIndex(E),this._getAvailableImages(E));break;case"geojson":this.workerSources[E][z][V]=new cr(q,this._getLayerIndex(E),this._getAvailableImages(E));break;default:this.workerSources[E][z][V]=new this.externalWorkerSourceTypes[z](q,this._getLayerIndex(E),this._getAvailableImages(E))}}return this.workerSources[E][z][V]}_getDEMWorkerSource(E,z){return this.demWorkerSources[E]||(this.demWorkerSources[E]={}),this.demWorkerSources[E][z]||(this.demWorkerSources[E][z]=new ft),this.demWorkerSources[E][z]}}return O.i(self)&&(self.worker=new zn(self)),zn}),Ae("index",["exports","./shared"],function(O,m){var ae="4.7.1";let An,hi;const bt={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:d=>new Promise((t,s)=>{const a=requestAnimationFrame(t);d.signal.addEventListener("abort",()=>{cancelAnimationFrame(a),s(m.c())})}),getImageData(d,t=0){return this.getImageCanvasContext(d).getImageData(-t,-t,d.width+2*t,d.height+2*t)},getImageCanvasContext(d){const t=window.document.createElement("canvas"),s=t.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return t.width=d.width,t.height=d.height,s.drawImage(d,0,0,d.width,d.height),s},resolveURL:d=>(An||(An=document.createElement("a")),An.href=d,An.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(hi==null&&(hi=matchMedia("(prefers-reduced-motion: reduce)")),hi.matches)}};class ft{static testProp(t){if(!ft.docStyle)return t[0];for(let s=0;s<t.length;s++)if(t[s]in ft.docStyle)return t[s];return t[0]}static create(t,s,a){const l=window.document.createElement(t);return s!==void 0&&(l.className=s),a&&a.appendChild(l),l}static createNS(t,s){return window.document.createElementNS(t,s)}static disableDrag(){ft.docStyle&&ft.selectProp&&(ft.userSelect=ft.docStyle[ft.selectProp],ft.docStyle[ft.selectProp]="none")}static enableDrag(){ft.docStyle&&ft.selectProp&&(ft.docStyle[ft.selectProp]=ft.userSelect)}static setTransform(t,s){t.style[ft.transformProp]=s}static addEventListener(t,s,a,l={}){t.addEventListener(s,a,"passive"in l?l:l.capture)}static removeEventListener(t,s,a,l={}){t.removeEventListener(s,a,"passive"in l?l:l.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",ft.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ft.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ft.suppressClickInternal,!0)},0)}static getScale(t){const s=t.getBoundingClientRect();return{x:s.width/t.offsetWidth||1,y:s.height/t.offsetHeight||1,boundingClientRect:s}}static getPoint(t,s,a){const l=s.boundingClientRect;return new m.P((a.clientX-l.left)/s.x-t.clientLeft,(a.clientY-l.top)/s.y-t.clientTop)}static mousePos(t,s){const a=ft.getScale(t);return ft.getPoint(t,a,s)}static touchPos(t,s){const a=[],l=ft.getScale(t);for(let u=0;u<s.length;u++)a.push(ft.getPoint(t,l,s[u]));return a}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}ft.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ft.selectProp=ft.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ft.transformProp=ft.testProp(["transform","WebkitTransform"]);const nr={supported:!1,testSupport:function(d){!rr&&ke&&(sr?vs(d):Ni=d)}};let Ni,ke,rr=!1,sr=!1;function vs(d){const t=d.createTexture();d.bindTexture(d.TEXTURE_2D,t);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,ke),d.isContextLost())return;nr.supported=!0}
vendor: 2,103 bytes, line 8
8catch{}d.deleteTexture(t),rr=!0}var ti;typeof document<"u"&&(ke=document.createElement("img"),ke.onload=()=>{Ni&&vs(Ni),Ni=null,sr=!0},ke.onerror=()=>{rr=!0,Ni=null},ke.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(d){let t,s,a,l;d.resetRequestQueue=()=>{t=[],s=0,a=0,l={}},d.addThrottleControl=w=>{const S=a++;return l[S]=w,S},d.removeThrottleControl=w=>{delete l[w],y()},d.getImage=(w,S,C=!0)=>new Promise((A,B)=>{nr.supported&&(w.headers||(w.headers={}),w.headers.accept="image/webp,*/*"),m.e(w,{type:"image"}),t.push({abortController:S,requestParameters:w,supportImageRefresh:C,state:"queued",onError:Z=>{B(Z)},onSuccess:Z=>{A(Z)}}),y()});const u=w=>m._(this,void 0,void 0,function*(){w.state="running";const{requestParameters:S,supportImageRefresh:C,onError:A,onSuccess:B,abortController:Z}=w,U=C===!1&&!m.i(self)&&!m.g(S.url)&&(!S.headers||Object.keys(S.headers).reduce((K,Q)=>K&&Q==="accept",!0));s++;const G=U?x(S,Z):m.m(S,Z);try{const K=yield G;delete w.abortController,w.state="completed",K.data instanceof HTMLImageElement||m.b(K.data)?B(K):K.data&&B({data:yield(X=K.data,typeof createImageBitmap=="function"?m.d(X):m.f(X)),cacheControl:K.cacheControl,expires:K.expires})}catch(K){delete w.abortController,A(K)}finally{s--,y()}var X}),y=()=>{const w=(()=>{for(const S of Object.keys(l))if(l[S]())return!0;return!1})()?m.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:m.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let S=s;S<w&&t.length>0;S++){const C=t.shift();C.abortController.signal.aborted?S--:u(C)}},x=(w,S)=>new Promise((C,A)=>{const B=new Image,Z=w.url,U=w.credentials;U&&U==="include"?B.crossOrigin="use-credentials":(U&&U==="same-origin"||!m.s(Z))&&(B.crossOrigin="anonymous"),S.signal.addEventListener("abort",()=>{B.src="",A(m.c())}),B.fetchPriority="high",B.onload=()=>{B.onerror=B.onload=null,C({data:B})},B.onerror=()=>{B.onerror=B.onload=null,S.signal.aborted||A(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},B.src=Z})}(ti||(ti={})),ti.resetRequestQueue();
vendor: 11,950 bytes, line 8
8class js{constructor(t){this._transformRequestFn=t}transformRequest(t,s){return this._transformRequestFn&&this._transformRequestFn(t,s)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function Vi(d){var t=new m.A(3);return t[0]=d[0],t[1]=d[1],t[2]=d[2],t}var gn,rn=function(d,t,s){return d[0]=t[0]-s[0],d[1]=t[1]-s[1],d[2]=t[2]-s[2],d};gn=new m.A(3),m.A!=Float32Array&&(gn[0]=0,gn[1]=0,gn[2]=0);var qs=function(d){var t=d[0],s=d[1];return t*t+s*s};function yn(d){const t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){const s=[];for(const{id:a,url:l}of d){const u=`${a}${l}`;s.indexOf(u)===-1&&(s.push(u),t.push({id:a,url:l}))}}return t}function xs(d,t,s){const a=d.split("?");return a[0]+=`${t}${s}`,a.join("?")}(function(){var d=new m.A(2);m.A!=Float32Array&&(d[0]=0,d[1]=0)})();class le{constructor(t,s,a,l){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(s,l)}update(t,s,a){const{width:l,height:u}=t,y=!(this.size&&this.size[0]===l&&this.size[1]===u||a),{context:x}=this,{gl:w}=x;if(this.useMipmap=!!(s&&s.useMipmap),w.bindTexture(w.TEXTURE_2D,this.texture),x.pixelStoreUnpackFlipY.set(!1),x.pixelStoreUnpack.set(1),x.pixelStoreUnpackPremultiplyAlpha.set(this.format===w.RGBA&&(!s||s.premultiply!==!1)),y)this.size=[l,u],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||m.b(t)?w.texImage2D(w.TEXTURE_2D,0,this.format,this.format,w.UNSIGNED_BYTE,t):w.texImage2D(w.TEXTURE_2D,0,this.format,l,u,0,this.format,w.UNSIGNED_BYTE,t.data);else{const{x:S,y:C}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||m.b(t)?w.texSubImage2D(w.TEXTURE_2D,0,S,C,w.RGBA,w.UNSIGNED_BYTE,t):w.texSubImage2D(w.TEXTURE_2D,0,S,C,l,u,w.RGBA,w.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&w.generateMipmap(w.TEXTURE_2D)}bind(t,s,a){const{context:l}=this,{gl:u}=l;u.bindTexture(u.TEXTURE_2D,this.texture),a!==u.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=u.LINEAR),t!==this.filter&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,t),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,a||t),this.filter=t),s!==this.wrap&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,s),this.wrap=s)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function Li(d){const{userImage:t}=d;return!!(t&&t.render&&t.render())&&(d.data.replace(new Uint8Array(t.data.buffer)),!0)}class Si extends m.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new m.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:s,promiseResolve:a}of this.requestors)a(this._getImagesForIds(s));this.requestors=[]}}getImage(t){const s=this.images[t];if(s&&!s.data&&s.spriteData){const a=s.spriteData;s.data=new m.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),s.spriteData=null}return s}addImage(t,s){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,s)&&(this.images[t]=s)}_validate(t,s){let a=!0;const l=s.data||s.spriteData;return this._validateStretch(s.stretchX,l&&l.width)||(this.fire(new m.j(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(s.stretchY,l&&l.height)||(this.fire(new m.j(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(s.content,s)||(this.fire(new m.j(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,s){if(!t)return!0;let a=0;for(const l of t){if(l[0]<a||l[1]<l[0]||s<l[1])return!1;a=l[1]}return!0}_validateContent(t,s){if(!t)return!0;if(t.length!==4)return!1;const a=s.spriteData,l=a&&a.width||s.data.width,u=a&&a.height||s.data.height;return!(t[0]<0||l<t[0]||t[1]<0||u<t[1]||t[2]<0||l<t[2]||t[3]<0||u<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,s,a=!0){const l=this.getImage(t);if(a&&(l.data.width!==s.data.width||l.data.height!==s.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${s.data.width}x${s.data.height}).`);s.version=l.version+1,this.images[t]=s,this.updatedImages[t]=!0}removeImage(t){const s=this.images[t];delete this.images[t],delete this.patterns[t],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((s,a)=>{let l=!0;if(!this.isLoaded())for(const u of t)this.images[u]||(l=!1);this.isLoaded()||l?s(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:s})})}_getImagesForIds(t){const s={};for(const a of t){let l=this.getImage(a);l||(this.fire(new m.k("styleimagemissing",{id:a})),l=this.getImage(a)),l?s[a]={data:l.data.clone(),pixelRatio:l.pixelRatio,sdf:l.sdf,version:l.version,stretchX:l.stretchX,stretchY:l.stretchY,content:l.content,textFitWidth:l.textFitWidth,textFitHeight:l.textFitHeight,hasRenderCallback:!!(l.userImage&&l.userImage.render)}:m.w(`Image "${a}" 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.`)}return s}getPixelSize(){const{width:t,height:s}=this.atlasImage;return{width:t,height:s}}getPattern(t){const s=this.patterns[t],a=this.getImage(t);if(!a)return null;if(s&&s.position.version===a.version)return s.position;if(s)s.position.version=a.version;else{const l={w:a.data.width+2,h:a.data.height+2,x:0,y:0},u=new m.I(l,a);this.patterns[t]={bin:l,position:u}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const s=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new le(t,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const u in this.patterns)t.push(this.patterns[u].bin);const{w:s,h:a}=m.p(t),l=this.atlasImage;l.resize({width:s||1,height:a||1});for(const u in this.patterns){const{bin:y}=this.patterns[u],x=y.x+1,w=y.y+1,S=this.getImage(u).data,C=S.width,A=S.height;m.R.copy(S,l,{x:0,y:0},{x,y:w},{width:C,height:A}),m.R.copy(S,l,{x:0,y:A-1},{x,y:w-1},{width:C,height:1}),m.R.copy(S,l,{x:0,y:0},{x,y:w+A},{width:C,height:1}),m.R.copy(S,l,{x:C-1,y:0},{x:x-1,y:w},{width:1,height:A}),m.R.copy(S,l,{x:0,y:0},{x:x+C,y:w},{width:1,height:A})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const s of t){if(this.callbackDispatchedThisFrame[s])continue;this.callbackDispatchedThisFrame[s]=!0;const a=this.getImage(s);a||m.w(`Image with ID: "${s}" was not found`),Li(a)&&this.updateImage(s,a)}}}const ei=1e20;function or(d,t,s,a,l,u,y,x,w){for(let S=t;S<t+a;S++)fi(d,s*u+S,u,l,y,x,w);for(let S=s;S<s+l;S++)fi(d,S*u+t,1,a,y,x,w)}function fi(d,t,s,a,l,u,y){u[0]=0,y[0]=-ei,y[1]=ei,l[0]=d[t];for(let x=1,w=0,S=0;x<a;x++){l[x]=d[t+x*s];const C=x*x;do{const A=u[w];S=(l[x]-l[A]+C-A*A)/(x-A)/2}while(S<=y[w]&&--w>-1);w++,u[w]=x,y[w]=S,y[w+1]=ei}for(let x=0,w=0;x<a;x++){for(;y[w+1]<x;)w++;const S=u[w],C=x-S;d[t+x*s]=l[S]+C*C}}class Zi{constructor(t,s){this.requestManager=t,this.localIdeographFontFamily=s,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return m._(this,void 0,void 0,function*(){const s=[];for(const u in t)for(const y of t[u])s.push(this._getAndCacheGlyphsPromise(u,y));const a=yield Promise.all(s),l={};for(const{stack:u,id:y,glyph:x}of a)l[u]||(l[u]={}),l[u][y]=x&&{id:x.id,bitmap:x.bitmap.clone(),metrics:x.metrics};return l})}_getAndCacheGlyphsPromise(t,s){return m._(this,void 0,void 0,function*(){let a=this.entries[t];a||(a=this.entries[t]={glyphs:{},requests:{},ranges:{}});let l=a.glyphs[s];if(l!==void 0)return{stack:t,id:s,glyph:l};if(l=this._tinySDF(a,t,s),l)return a.glyphs[s]=l,{stack:t,id:s,glyph:l};const u=Math.floor(s/256);if(256*u>65535)throw new Error("glyphs > 65535 not supported");if(a.ranges[u])return{stack:t,id:s,glyph:l};if(!this.url)throw new Error("glyphsUrl is not set");if(!a.requests[u]){const x=Zi.loadGlyphRange(t,u,this.url,this.requestManager);a.requests[u]=x}const y=yield a.requests[u];for(const x in y)this._doesCharSupportLocalGlyph(+x)||(a.glyphs[+x]=y[+x]);return a.ranges[u]=!0,{stack:t,id:s,glyph:y[s]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(t))}_tinySDF(t,s,a){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(a))return;let u=t.tinySDF;if(!u){let x="400";/bold/i.test(s)?x="900":/medium/i.test(s)?x="500":/light/i.test(s)&&(x="200"),u=t.tinySDF=new Zi.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:x})}const y=u.draw(String.fromCharCode(a));return{id:a,bitmap:new m.o({width:y.width||60,height:y.height||60},y.data),metrics:{width:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:y.glyphAdvance/2||24,isDoubleResolution:!0}}}}Zi.loadGlyphRange=function(d,t,s,a){return m._(this,void 0,void 0,function*(){const l=256*t,u=l+255,y=a.transformRequest(s.replace("{fontstack}",d).replace("{range}",`${l}-${u}`),"Glyphs"),x=yield m.l(y,new AbortController);if(!x||!x.data)throw new Error(`Could not load glyph range. range: ${t}, ${l}-${u}`);const w={};for(const S of m.n(x.data))w[S.id]=S;return w})},Zi.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:s=8,cutoff:a=.25,fontFamily:l="sans-serif",fontWeight:u="normal",fontStyle:y="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=s;const x=this.size=d+4*t,w=this._createCanvas(x),S=this.ctx=w.getContext("2d",{willReadFrequently:!0});S.font=`${y} ${u} ${d}px ${l}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(x*x),this.gridInner=new Float64Array(x*x),this.f=new Float64Array(x),this.z=new Float64Array(x+1),this.v=new Uint16Array(x)}_createCanvas(d){const t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){const{width:t,actualBoundingBoxAscent:s,actualBoundingBoxDescent:a,actualBoundingBoxLeft:l,actualBoundingBoxRight:u}=this.ctx.measureText(d),y=Math.ceil(s),x=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(u-l))),w=Math.min(this.size-this.buffer,y+Math.ceil(a)),S=x+2*this.buffer,C=w+2*this.buffer,A=Math.max(S*C,0),B=new Uint8ClampedArray(A),Z={data:B,width:S,height:C,glyphWidth:x,glyphHeight:w,glyphTop:y,glyphLeft:0,glyphAdvance:t};if(x===0||w===0)return Z;const{ctx:U,buffer:G,gridInner:X,gridOuter:K}=this;U.clearRect(G,G,x,w),U.fillText(d,G,G+y);const Q=U.getImageData(G,G,x,w);K.fill(ei,0,A),X.fill(0,0,A);for(let j=0;j<w;j++)for(let nt=0;nt<x;nt++){const rt=Q.data[4*(j*x+nt)+3]/255;if(rt===0)continue;const ht=(j+G)*S+nt+G;if(rt===1)K[ht]=0,X[ht]=ei;else{const yt=.5-rt;K[ht]=yt>0?yt*yt:0,X[ht]=yt<0?yt*yt:0}}or(K,0,0,S,C,S,this.f,this.v,this.z),or(X,G,G,x,w,S,this.f,this.v,this.z);for(let j=0;j<A;j++){const nt=Math.sqrt(K[j])-Math.sqrt(X[j]);B[j]=Math.round(255-255*(nt/this.radius+this.cutoff))}return Z}};class re{constructor(){this.specification=m.v.light.position}possiblyEvaluate(t,s){return m.x(t.expression.evaluate(s))}interpolate(t,s,a){return{x:m.y.number(t.x,s.x,a),y:m.y.number(t.y,s.y,a),z:m.y.number(t.z,s.z,a)}}}let Tr;class Kt extends m.E{constructor(t){super(),Tr=Tr||new m.q({anchor:new m.D(m.v.light.anchor),position:new re,color:new m.D(m.v.light.color),intensity:new m.D(m.v.light.intensity)}),this._transitionable=new m.T(Tr),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,s={}
vendor: 12,983 bytes, line 8
8){if(!this._validate(m.r,t,s))for(const a in t){const l=t[a];a.endsWith("-transition")?this._transitionable.setTransition(a.slice(0,-11),l):this._transitionable.setValue(a,l)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,s,a){return(!a||a.validate!==!1)&&m.t(this,t.call(m.u,{value:s,style:{glyphs:!0,sprite:!0},styleSpec:m.v}))}}const Te=new m.q({"sky-color":new m.D(m.v.sky["sky-color"]),"horizon-color":new m.D(m.v.sky["horizon-color"]),"fog-color":new m.D(m.v.sky["fog-color"]),"fog-ground-blend":new m.D(m.v.sky["fog-ground-blend"]),"horizon-fog-blend":new m.D(m.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new m.D(m.v.sky["sky-horizon-blend"]),"atmosphere-blend":new m.D(m.v.sky["atmosphere-blend"])});class Ge extends m.E{constructor(t){super(),this._transitionable=new m.T(Te),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new m.z(0))}setSky(t,s={}){if(!this._validate(m.B,t,s)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const a in t){const l=t[a];a.endsWith("-transition")?this._transitionable.setTransition(a.slice(0,-11),l):this._transitionable.setValue(a,l)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,s,a={}){return a?.validate!==!1&&m.t(this,t.call(m.u,m.e({value:s,style:{glyphs:!0,sprite:!0},styleSpec:m.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class ci{constructor(t,s){this.width=t,this.height=s,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,s){const a=t.join(",")+String(s);return this.dashEntry[a]||(this.dashEntry[a]=this.addDash(t,s)),this.dashEntry[a]}getDashRanges(t,s,a){const l=[];let u=t.length%2==1?-t[t.length-1]*a:0,y=t[0]*a,x=!0;l.push({left:u,right:y,isDash:x,zeroLength:t[0]===0});let w=t[0];for(let S=1;S<t.length;S++){x=!x;const C=t[S];u=w*a,w+=C,y=w*a,l.push({left:u,right:y,isDash:x,zeroLength:C===0})}return l}addRoundDash(t,s,a){const l=s/2;for(let u=-a;u<=a;u++){const y=this.width*(this.nextRow+a+u);let x=0,w=t[x];for(let S=0;S<this.width;S++){S/w.right>1&&(w=t[++x]);const C=Math.abs(S-w.left),A=Math.abs(S-w.right),B=Math.min(C,A);let Z;const U=u/a*(l+1);if(w.isDash){const G=l-Math.abs(U);Z=Math.sqrt(B*B+G*G)}else Z=l-Math.sqrt(B*B+U*U);this.data[y+S]=Math.max(0,Math.min(255,Z+128))}}}addRegularDash(t){for(let x=t.length-1;x>=0;--x){const w=t[x],S=t[x+1];w.zeroLength?t.splice(x,1):S&&S.isDash===w.isDash&&(S.left=w.left,t.splice(x,1))}const s=t[0],a=t[t.length-1];s.isDash===a.isDash&&(s.left=a.left-this.width,a.right=s.right+this.width);const l=this.width*this.nextRow;let u=0,y=t[u];for(let x=0;x<this.width;x++){x/y.right>1&&(y=t[++u]);const w=Math.abs(x-y.left),S=Math.abs(x-y.right),C=Math.min(w,S);this.data[l+x]=Math.max(0,Math.min(255,(y.isDash?C:-C)+128))}}addDash(t,s){const a=s?7:0,l=2*a+1;if(this.nextRow+l>this.height)return m.w("LineAtlas out of space"),null;let u=0;for(let x=0;x<t.length;x++)u+=t[x];if(u!==0){const x=this.width/u,w=this.getDashRanges(t,this.width,x);s?this.addRoundDash(w,x,a):this.addRegularDash(w)}const y={y:(this.nextRow+a+.5)/this.height,height:2*a/this.height,width:u};return this.nextRow+=l,this.dirty=!0,y}bind(t){const s=t.gl;this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.ALPHA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.ALPHA,this.width,this.height,0,s.ALPHA,s.UNSIGNED_BYTE,this.data))}}const Fe="maplibre_preloaded_worker_pool";class ve{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<ve.workerCount;)this.workers.push(new Worker(m.a.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(s=>{s.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Fe]}numActive(){return Object.keys(this.active).length}}const ge=Math.floor(bt.hardwareConcurrency/2);let oi,mi;function Pr(){return oi||(oi=new ve),oi}ve.workerCount=m.C(globalThis)?Math.max(Math.min(ge,3),1):1;class ar{constructor(t,s){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=s;const a=this.workerPool.acquire(s);for(let l=0;l<a.length;l++){const u=new m.F(a[l],s);u.name=`Worker ${l}`,this.actors.push(u)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,s){const a=[];for(const l of this.actors)a.push(l.sendAsync({type:t,data:s}));return Promise.all(a)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(s=>{s.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,s){for(const a of this.actors)a.registerMessageHandler(t,s)}}function qr(){return mi||(mi=new ar(Pr(),m.G),mi.registerMessageHandler("GR",(d,t,s)=>m.m(t,s))),mi}function sn(d,t){const s=m.H();return m.J(s,s,[1,1,0]),m.K(s,s,[.5*d.width,.5*d.height,1]),m.L(s,s,d.calculatePosMatrix(t.toUnwrapped()))}function Vn(d,t,s,a,l,u){const y=function(A,B,Z){if(A)for(const U of A){const G=B[U];if(G&&G.source===Z&&G.type==="fill-extrusion")return!0}else for(const U in B){const G=B[U];if(G.source===Z&&G.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,d.id),x=u.maxPitchScaleFactor(),w=d.tilesIn(a,x,y);w.sort(Sr);const S=[];for(const A of w)S.push({wrappedTileID:A.tileID.wrapped().key,queryResults:A.tile.queryRenderedFeatures(t,s,d._state,A.queryGeometry,A.cameraQueryGeometry,A.scale,l,u,x,sn(d.transform,A.tileID))});const C=function(A){const B={},Z={};for(const U of A){const G=U.queryResults,X=U.wrappedTileID,K=Z[X]=Z[X]||{};for(const Q in G){const j=G[Q],nt=K[Q]=K[Q]||{},rt=B[Q]=B[Q]||[];for(const ht of j)nt[ht.featureIndex]||(nt[ht.featureIndex]=!0,rt.push(ht))}}return B}(S);for(const A in C)C[A].forEach(B=>{const Z=B.feature,U=d.getFeatureState(Z.layer["source-layer"],Z.id);Z.source=Z.layer.source,Z.layer["source-layer"]&&(Z.sourceLayer=Z.layer["source-layer"]),Z.state=U});return C}function Sr(d,t){const s=d.tileID,a=t.tileID;return s.overscaledZ-a.overscaledZ||s.canonical.y-a.canonical.y||s.wrap-a.wrap||s.canonical.x-a.canonical.x}function $r(d,t,s){return m._(this,void 0,void 0,function*(){let a=d;if(d.url?a=(yield m.h(t.transformRequest(d.url,"Source"),s)).data:yield bt.frameAsync(s),!a)return null;const l=m.M(m.e(a,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(l.vectorLayerIds=a.vector_layers.map(u=>u.id)),l})}class ut{constructor(t,s){t&&(s?this.setSouthWest(t).setNorthEast(s):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof m.N?new m.N(t.lng,t.lat):m.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof m.N?new m.N(t.lng,t.lat):m.N.convert(t),this}extend(t){const s=this._sw,a=this._ne;let l,u;if(t instanceof m.N)l=t,u=t;else{if(!(t instanceof ut))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(ut.convert(t)):this.extend(m.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(m.N.convert(t)):this;if(l=t._sw,u=t._ne,!l||!u)return this}return s||a?(s.lng=Math.min(l.lng,s.lng),s.lat=Math.min(l.lat,s.lat),a.lng=Math.max(u.lng,a.lng),a.lat=Math.max(u.lat,a.lat)):(this._sw=new m.N(l.lng,l.lat),this._ne=new m.N(u.lng,u.lat)),this}getCenter(){return new m.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new m.N(this.getWest(),this.getNorth())}getSouthEast(){return new m.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:s,lat:a}=m.N.convert(t);let l=this._sw.lng<=s&&s<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=s&&s>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&l}static convert(t){return t instanceof ut?t:t&&new ut(t)}static fromLngLat(t,s=0){const a=360*s/40075017,l=a/Math.cos(Math.PI/180*t.lat);return new ut(new m.N(t.lng-l,t.lat-a),new m.N(t.lng+l,t.lat+a))}adjustAntiMeridian(){const t=new m.N(this._sw.lng,this._sw.lat),s=new m.N(this._ne.lng,this._ne.lat);return new ut(t,t.lng>s.lng?new m.N(s.lng+360,s.lat):s)}}class lr{constructor(t,s,a){this.bounds=ut.convert(this.validateBounds(t)),this.minzoom=s||0,this.maxzoom=a||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const s=Math.pow(2,t.z),a=Math.floor(m.O(this.bounds.getWest())*s),l=Math.floor(m.Q(this.bounds.getNorth())*s),u=Math.ceil(m.O(this.bounds.getEast())*s),y=Math.ceil(m.Q(this.bounds.getSouth())*s);return t.x>=a&&t.x<u&&t.y>=l&&t.y<y}}class Ir extends m.E{constructor(t,s,a,l){if(super(),this.id=t,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,m.e(this,m.M(s,["url","scheme","tileSize","promoteId"])),this._options=m.e({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}load(){return m._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new m.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield $r(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(m.e(this,t),t.bounds&&(this.tileBounds=new lr(t.bounds,this.minzoom,this.maxzoom)),this.fire(new m.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new m.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new m.j(t))}})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return m.e({},this._options)}loadTile(t){return m._(this,void 0,void 0,function*(){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(s,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request.collectResourceTiming=this._collectResourceTiming;let l="RT";if(t.actor&&t.state!=="expired"){if(t.state==="loading")return new Promise((u,y)=>{t.reloadPromise={resolve:u,reject:y}})}else t.actor=this.dispatcher.getActor(),l="LT";t.abortController=new AbortController;try{const u=yield t.actor.sendAsync({type:l,data:a},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,u)}catch(u){if(delete t.abortController,t.aborted)return;if(u&&u.status!==404)throw u;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,s){if(s&&s.resourceTiming&&(t.resourceTiming=s.resourceTiming),s&&this.map._refreshExpiredTiles&&t.setExpiryData(s),t.loadVectorData(s,this.map.painter),t.reloadPromise){const a=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(a.resolve).catch(a.reject)}}abortTile(t){return m._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.t
vendor: 4,124 bytes, line 8
8ype,source:this.id}}))})}unloadTile(t){return m._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ze extends m.E{constructor(t,s,a,l){super(),this.id=t,this.dispatcher=a,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=m.e({type:"raster"},s),m.e(this,m.M(s,["url","scheme","tileSize"]))}load(){return m._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new m.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield $r(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(m.e(this,t),t.bounds&&(this.tileBounds=new lr(t.bounds,this.minzoom,this.maxzoom)),this.fire(new m.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new m.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new m.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return m.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return m._(this,void 0,void 0,function*(){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const a=yield ti.getImage(this.map._requestManager.transformRequest(s,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(a&&a.data){this.map._refreshExpiredTiles&&a.cacheControl&&a.expires&&t.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});const l=this.map.painter.context,u=l.gl,y=a.data;t.texture=this.map.painter.getTileTexture(y.width),t.texture?t.texture.update(y,{useMipmap:!0}):(t.texture=new le(l,y,u.RGBA,{useMipmap:!0}),t.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(a){if(delete t.abortController,t.aborted)t.state="unloaded";else if(a)throw t.state="errored",a}})}abortTile(t){return m._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return m._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class He extends ze{constructor(t,s,a,l){super(t,s,a,l),this.type="raster-dem",this.maxzoom=22,this._options=m.e({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox",this.redFactor=s.redFactor,this.greenFactor=s.greenFactor,this.blueFactor=s.blueFactor,this.baseShift=s.baseShift}loadTile(t){return m._(this,void 0,void 0,function*(){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a=this.map._requestManager.transformRequest(s,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const l=yield ti.getImage(a,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(l&&l.data){const u=l.data;this.map._refreshExpiredTiles&&l.cacheControl&&l.expires&&t.setExpiryData({cacheControl:l.cacheControl,expires:l.expires});const y=m.b(u)&&m.U()?u:yield this.readImageNow(u),x={type:this.type,uid:t.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||t.state==="expired"){t.actor=this.dispatcher.getActor();const w=yield t.actor.sendAsync({type:"LDT",data:x});t.dem=w,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}
8catch(l){if(delete t.abortController,t.aborted)t.state="unloaded";else if(l)throw t.state="errored",l}})}readImageNow(t){return m._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&m.V()){const s=t.width+2,a=t.height+2;try{return new m.R({width:s,height:a},yield m.W(t,-1,-1,s,a))}catch{}}return bt.getImageData(t,1)})}_getNeighboringTiles(t){const s=t.canonical,a=Math.pow(2,s.z),l=(s.x-1+a)%a,u=s.x===0?t.wrap-1:t.wrap,y=(s.x+1+a)%a,x=s.x+1===a?t.wrap+1:t.wrap,w={};return w[new m.S(t.overscaledZ,u,s.z,l,s.y).key]={backfilled:!1},w[new m.S(t.overscaledZ,x,s.z,y,s.y).key]={backfilled:!1},s.y>0&&(w[new m.S(t.overscaledZ,u,s.z,l,s.y-1).key]={backfilled:!1},w[new m.S(t.overscaledZ,t.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},w[new m.S(t.overscaledZ,x,s.z,y,s.y-1).key]={backfilled:!1}),s.y+1<a&&(w[new m.S(t.overscaledZ,u,s.z,l,s.y+1).key]={backfilled:!1},w[new m.S(t.overscaledZ,t.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},w[new m.S(t.overscaledZ,x,s.z,y,s.y+1).key]={backfilled:!1}),w}unloadTile(t){return m._(this,void 0,void 0,function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))})}}class Gr extends m.E{constructor(t,s,a,l){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=a.getActor(),this.setEventedParent(l),this._data=s.data,this._options=m.e({},s),this._collectResourceTiming=s.collectResourceTiming,s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;const u=m.X/this.tileSize;s.clusterMaxZoom!==void 0&&this.maxzoom<=s.clusterMaxZoom&&m.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${s.clusterMaxZoom}".`),this.workerOptions=m.e({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*u,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*u,extent:m.X,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?s.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:m.X,radius:(s.clusterRadius||50)*u,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}load(){return m._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return m._(this,void 0,void 0,function*(){const t=m.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMa
vendor: 6,573 bytes, line 8
8xZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,s,a){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:s,offset:a}})}_updateWorkerData(t){return m._(this,void 0,void 0,function*(){const s=m.e({type:this.type},this.workerOptions);t?s.dataDiff=t:typeof this._data=="string"?(s.request=this.map._requestManager.transformRequest(bt.resolveURL(this._data),"Source"),s.request.collectResourceTiming=this._collectResourceTiming):s.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new m.k("dataloading",{dataType:"source"}));try{const a=yield this.actor.sendAsync({type:"LD",data:s});if(this._pendingLoads--,this._removed||a.abandoned)return void this.fire(new m.k("dataabort",{dataType:"source"}));let l=null;a.resourceTiming&&a.resourceTiming[this.id]&&(l=a.resourceTiming[this.id].slice(0));const u={dataType:"source"};this._collectResourceTiming&&l&&l.length>0&&m.e(u,{resourceTiming:l}),this.fire(new m.k("data",Object.assign(Object.assign({},u),{sourceDataType:"metadata"}))),this.fire(new m.k("data",Object.assign(Object.assign({},u),{sourceDataType:"content"})))}catch(a){if(this._pendingLoads--,this._removed)return void this.fire(new m.k("dataabort",{dataType:"source"}));this.fire(new m.j(a))}})}loaded(){return this._pendingLoads===0}loadTile(t){return m._(this,void 0,void 0,function*(){const s=t.actor?"RT":"LT";t.actor=this.actor;const a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const l=yield this.actor.sendAsync({type:s,data:a},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(l,this.map.painter,s==="RT")})}abortTile(t){return m._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return m._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return m.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var hr=m.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Zn extends m.E{constructor(t,s,a,l){super(),this.id=t,this.dispatcher=a,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=s}load(t){return m._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new m.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const s=yield ti.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,s&&s.data&&(this.image=s.data,t&&(this.coordinates=t),this._finishLoading())}catch(s){this._request=null,this._loaded=!0,this.fire(new m.j(s))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new m.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const s=t.map(m.Z.fromLngLat);this.tileID=function(l){let u=1/0,y=1/0,x=-1/0,w=-1/0;for(const B of l)u=Math.min(u,B.x),y=Math.min(y,B.y),x=Math.max(x,B.x),w=Math.max(w,B.y);const S=Math.max(x-u,w-y),C=Math.max(0,Math.floor(-Math.log(S)/Math.LN2)),A=Math.pow(2,C);return new m.a1(C,Math.floor((u+x)/2*A),Math.floor((y+w)/2*A))}(s),this.minzoom=this.maxzoom=this.tileID.z;const a=s.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new m.$,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,m.X,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,m.X),this._boundsArray.emplaceBack(a[2].x,a[2].y,m.X,m.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new m.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const t=this.map.painter.context,s=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=m.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new le(t,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const u=this.tiles[l];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture,a=!0)}a&&this.fire(new m.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return m._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class bs extends Zn{constructor(t,s,a,l){super(t,s,a,l),this.roundZoom=!0,this.type="video",this.options=s}load(){return m._(this,void 0,void 0,function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const s of t.urls)this.urls.push(this.map._requestManager.transformRequest(s,"Source").url);try{const s=yield m.a3(this.urls);if(this._loaded=!0,!s)return;this.video=s,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(s){this.fire(new m.j(s))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const s=this.video.seekable;t<s.start(0)||t>s.end(0)?this.fire(new m.j(new m.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${s.start(0)} and ${s.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
vendor: 4,452 bytes, line 8
8onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const t=this.map.painter.context,s=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=m.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new le(t,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));let a=!1;for(const l in this.tiles){const u=this.tiles[l];u.state!=="loaded"&&(u.state="loaded",u.texture=this.texture,a=!0)}a&&this.fire(new m.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class vn extends Zn{constructor(t,s,a,l){super(t,s,a,l),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(u=>!Array.isArray(u)||u.length!==2||u.some(y=>typeof y!="number"))||this.fire(new m.j(new m.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new m.j(new m.a2(`sources.${t}`,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new m.j(new m.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof HTMLCanvasElement||this.fire(new m.j(new m.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new m.j(new m.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}load(){return m._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new m.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const s=this.map.painter.context,a=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=m.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new le(s,this.canvas,a.RGBA,{premultiply:!0});let l=!1;for(const u in this.tiles){const y=this.tiles[u];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,l=!0)}l&&this.fire(new m.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Hr={},ws=d=>{switch(d){case"geojson":return Gr;case"image":return Zn;case"raster":return ze;case"raster-dem":return He;case"vector":return Ir;case"video":return bs;case"canvas":return vn}return Hr[d]},Pt="RTLPluginLoaded";class Un extends m.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=qr()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(s=>{throw this.status="error",s})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return m._(this,arguments,void 0,function*(s,a=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=bt.resolveURL(s),!this.url)throw new Error(`requested url ${s}
8 is invalid`);if(this.status==="unavailable"){if(!a)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return m._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new m.k(Pt))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ii=null;function kn(){return Ii||(Ii=new Un),Ii}class Mr{constructor(t,s){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=m.a4(),this.uses=0,this.tileSize=s,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const s=t+this.timeAdded;s<this.fadeEndTime||(this.fadeEndTime=s)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,s,a){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){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(l,u){const y={};if(!u)return y;for(const x of l){const w=x.layerIds.map(S=>u.getLayer(S)).filter(Boolean);if(w.length!==0){x.layers=w,x.stateDependentLayerIds&&(x.stateDependentLayers=x.stateDependentLayerIds.map(S=>w.filter(C=>C.id===S)[0]));for(const S of w)y[S.id]=x}}return y}(t.buckets,s.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const u=this.buckets[l];if(u instanceof m.a6){if(this.hasSymbolBuckets=!0,!a)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const u=this.buckets[l];if(u instanceof m.a6&&u.hasRTLText){this.hasRTLText=!0,kn().lazyLoad();break}}this.queryPadding=0;for(const l in this.buckets){const u=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,s.style.getLayer(l).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new m.a5}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const l=this.buckets[a];l.uploadPending()&&l.upload(t)}const s=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new le(t,this.imageAtlas.image,s.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new le(t,this.glyphAtlasImage,s.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,s,a,l,u,y,x,w,S,C){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:u,scale:y,tileSize:this.tileSize,pixelPosMatrix:C,transform:w,params:x,queryPadding:this.queryPadding*S},t,s,a):{}}querySourceFeatures(t,s){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const l=a.loadVTLayers(),u=s&&s.sourceLayer?s.sourceLayer:"",y=l._geojsonTileLayer||l[u];if(!y)return;const x=m.a7(s&&s.filter),{z:w,x:S,y:C}=this.tileID.canonical,A={z:w,x:S,y:C};for(let B=0;B<y.length;B++){const Z=y.feature(B);if(x.needGeometry){const X=m.a8(Z,!0);if(!x.filter(new m.z(this.tileID.overscaledZ),X,this.tileID.canonical))continue}else if(!x.filter(new m.z(this.tileID.overscaledZ),Z))continue;const U=a.getId(Z,u),G=new m.a9(Z,w,S,C,U);G.tile=A,t.push(G)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const s=this.expirationTime;if(t.cacheControl){const a=m.aa(t.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const a=Date.now();let l=!1;if(this.expirationTime>a)l=!1;else if(s)if(this.expirationTime<s)l=!0;else{const u=this.expirationTime-s;u?this.expirationTime=a+Math.max(u,3e4):l=!0}else l=!0;l?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){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)}setFeatureState(t,s){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const a=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!s.style.hasLayer(l))continue;const u=this.buckets[l],y=u.layers[0].sourceLayer||"_geojsonTileLayer",x=a[y],w=t[y];if(!x||!w||Object.keys(w).length===0)continue;u.update(w,x,this.imageAtlas&&this.imageAtlas.patternPositions||{});const S=s&&s.style&&s.style.getLayer(l);S&&(this.queryPadding=Math.max(this.queryPadding,S.queryRadius(u)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<bt.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=bt.now()+t}
vendor: 4,518 bytes, line 8
8setDependencies(t,s){const a={};for(const l of s)a[l]=!0;this.dependencies[t]=a}hasDependency(t,s){for(const a of t){const l=this.dependencies[a];if(l){for(const u of s)if(l[u])return!0}}return!1}}class St{constructor(t,s){this.max=t,this.onRemove=s,this.reset()}reset(){for(const t in this.data)for(const s of this.data[t])s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value);return this.data={},this.order=[],this}add(t,s,a){const l=t.wrapped().key;this.data[l]===void 0&&(this.data[l]=[]);const u={value:s,timeout:void 0};if(a!==void 0&&(u.timeout=setTimeout(()=>{this.remove(t,u)},a)),this.data[l].push(u),this.order.push(l),this.order.length>this.max){const y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const s=this.data[t].shift();return s.timeout&&clearTimeout(s.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),s.value}getByKey(t){const s=this.data[t];return s?s[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,s){if(!this.has(t))return this;const a=t.wrapped().key,l=s===void 0?0:this.data[a].indexOf(s),u=this.data[a][l];return this.data[a].splice(l,1),u.timeout&&clearTimeout(u.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(u.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this}filter(t){const s=[];for(const a in this.data)for(const l of this.data[a])t(l.value)||s.push(l);for(const a of s)this.remove(a.value.tileID,a)}}class se{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,s,a){const l=String(s);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},m.e(this.stateChanges[t][l],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const u in this.state[t])u!==l&&(this.deletedStates[t][u]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(const u in this.state[t][l])a[u]||(this.deletedStates[t][l][u]=null)}else for(const u in a)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][u]===null&&delete this.deletedStates[t][l][u]}removeFeatureState(t,s,a){if(this.deletedStates[t]===null)return;const l=String(s);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&s!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][a]=null);else if(s!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(a in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][a]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,s){const a=String(s),l=m.e({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const u=this.deletedStates[t][s];if(u===null)return{};for(const y in u)delete l[y]}return l}initializeTileState(t,s){t.setFeatureState(this.state,s)}coalesceChanges(t,s){const a={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const u={};for(const y in this.stateChanges[l])this.state[l][y]||(this.state[l][y]={}),m.e(this.state[l][y],this.stateChanges[l][y]),u[y]=this.state[l][y];a[l]=u}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const u={};if(this.deletedStates[l]===null)for(const y in this.state[l])u[y]={},this.state[l][y]={};else for(const y in this.deletedStates[l]){if(this.deletedStates[l][y]===null)this.state[l][y]={};else for(const x of Object.keys(this.deletedStates[l][y]))delete this.state[l][y][x];u[y]=this.state[l][y]}a[l]=a[l]||{},m.e(a[l],u)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const l in t)t[l].setFeatureState(a,s)}}class Xt extends m.E{constructor(t,s,a){super(),this.id=t,this.dispatcher=a,this.on("data",l=>this._dataHandler(l)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,u,y,x)=>{const w=new(ws(u.type))(l,u,y,x);if(w.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${w.id}`);return w})(t,s,a,this),this._tiles={},this._cache=new St(0,l=>this._unloadTile(l)),this._timers={},this._cacheTimers={}
8,this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new se,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const s=this._tiles[t];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,s,a){return m._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,s,a)}catch(l){t.state="errored",l.status!==404?this._source.fire(new m.j(l,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new m.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const s in this._tiles){const a=this._tiles[s];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Ui).map(t=>t.key)}getRenderableIds(t){const s=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&s.push(this._tiles[a]);return t?s.sort((a,l)=>{const u=a.tileID,y=l.tileID,x=new m.P(u.canonical.x,u.canonical.y)._rotate(this.transform.angle),w=new m.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle);return u.overscaledZ-y.overscaledZ||w.y-x.y||w.x-x.x}).map(a=>a.tileID.key):s.map(a=>a.tileID).sort(Ui).map(a=>a.key)}hasRenderableParent(t){const s=this.findLoadedParent(t,0);return!!s&&this._isIdRenderable(s.tileID.key)}_isIdRenderable(t,s){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(s||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,s){return m._(this,void 0,void 0,function*(){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=s),yield this._loadTile(a,t,s))})}_tileLoaded(t,s,a){t.timeAdded=bt.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(s,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new m.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const s=this.getRenderableIds();for(let l=0;l<s.length;l++){const u=s[l];if(t.neighboringTiles&&t.neighboringTiles[u]){const y=this.getTileByID(u);a(t,y),a(y,t)}}function a(l,u){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let y=u.tileID.canonical.x-l.tileID.canonical.x;const x=u.tileID.canonical.y-l.tileID.canonical.y,w=Math.pow(2,l.tileID.canonical.z),S=u.tileID.key;y===0&&x===0||Math.abs(x)>1||(Math.abs(y)>1&&(Math.abs(y+w)===1?y+=w:Math.abs(y-w)===1&&(y-=w)),u.dem&&l.dem&&(l.dem.backfillBorder(u.dem,y,x),l.neighboringTiles&&l.neighboringTiles[S]&&(l.neighboringTiles[S].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,s,a,l){for(const u in this._tiles){let y=this._tiles[u];if(l[u]||!y.hasData()||y.tileID.overscaledZ<=s||y.tileID.overscaledZ>a)continue;let x=y.tileID;for(;y&&y.tileID.overscaledZ>s+1;){const S=y.tileID.scaledTo(y.tileID.overscaledZ-1);y=this._tiles[S.key],y&&y.hasData()&&(x=S)}let w=x;for(;w.overscaledZ>s;)if(w=w.scaledTo(w.overscaledZ-1),t[w.key]){l[x.key]=x;break}}}findLoadedParent(t,s){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=s?a:null}for(let a=t.overscaledZ-1;a>=s;a--){const l=t.scaledTo(a),u=this._getLoadedTile(l);
vendor: 29,999 bytes, line 8
8if(u)return u}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const s=this._tiles[t.key];return s&&s.hasData()?s:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const s=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(s*a*(this._maxTileCacheZoomLevels===null?m.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),u=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(u)}handleWrapJump(t){const s=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,s){const a={};for(const l in this._tiles){const u=this._tiles[l];u.tileID=u.tileID.unwrapTo(u.tileID.wrap+s),a[u.tileID.key]=u}this._tiles=a;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}_updateCoveredAndRetainedTiles(t,s,a,l,u,y){const x={},w={},S=Object.keys(t),C=bt.now();for(const A of S){const B=t[A],Z=this._tiles[A];if(!Z||Z.fadeEndTime!==0&&Z.fadeEndTime<=C)continue;const U=this.findLoadedParent(B,s),G=this.findLoadedSibling(B),X=U||G||null;X&&(this._addTile(X.tileID),x[X.tileID.key]=X.tileID),w[A]=B}this._retainLoadedChildren(w,l,a,t);for(const A in x)t[A]||(this._coveredTiles[A]=!0,t[A]=x[A]);if(y){const A={},B={};for(const Z of u)this._tiles[Z.key].hasData()?A[Z.key]=Z:B[Z.key]=Z;for(const Z in B){const U=B[Z].children(this._source.maxzoom);this._tiles[U[0].key]&&this._tiles[U[1].key]&&this._tiles[U[2].key]&&this._tiles[U[3].key]&&(A[U[0].key]=t[U[0].key]=U[0],A[U[1].key]=t[U[1].key]=U[1],A[U[2].key]=t[U[2].key]=U[2],A[U[3].key]=t[U[3].key]=U[3],delete B[Z])}for(const Z in B){const U=B[Z],G=this.findLoadedParent(U,this._source.minzoom),X=this.findLoadedSibling(U),K=G||X||null;if(K){A[K.tileID.key]=t[K.tileID.key]=K.tileID;for(const Q in A)A[Q].isChildOf(K.tileID)&&delete A[Q]}}for(const Z in this._tiles)A[Z]||(this._coveredTiles[Z]=!0)}}update(t,s){if(!this._sourceLoaded||this._paused)return;let a;this.transform=t,this.terrain=s,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(C=>new m.S(C.canonical.z,C.wrap,C.canonical.z,C.canonical.x,C.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:s}),this._source.hasTile&&(a=a.filter(C=>this._source.hasTile(C)))):a=[];const l=t.coveringZoomLevel(this._source),u=Math.max(l-Xt.maxOverzooming,this._source.minzoom),y=Math.max(l+Xt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const C={};for(const A of a)if(A.canonical.z>this._source.minzoom){const B=A.scaledTo(A.canonical.z-1);C[B.key]=B;const Z=A.scaledTo(Math.max(this._source.minzoom,Math.min(A.canonical.z,5)));C[Z.key]=Z}a=a.concat(Object.values(C))}const x=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,x&&this.fire(new m.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const w=this._updateRetainedTiles(a,l);Di(this._source.type)&&this._updateCoveredAndRetainedTiles(w,u,y,l,a,s);for(const C in w)this._tiles[C].clearFadeHold();const S=m.ab(this._tiles,w);for(const C of S){const A=this._tiles[C];A.hasSymbolBuckets&&!A.holdingForFade()?A.setHoldDuration(this.map._fadeDuration):A.hasSymbolBuckets&&!A.symbolFadeFinished()||this._removeTile(C)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,s){var a;const l={},u={},y=Math.max(s-Xt.maxOverzooming,this._source.minzoom),x=Math.max(s+Xt.maxUnderzooming,this._source.minzoom),w={};for(const S of t){const C=this._addTile(S);l[S.key]=S,C.hasData()||s<this._source.maxzoom&&(w[S.key]=S)}this._retainLoadedChildren(w,s,x,l);for(const S of t){let C=this._tiles[S.key];if(C.hasData())continue;if(s+1>this._source.maxzoom){const B=S.children(this._source.maxzoom)[0],Z=this.getTile(B);if(Z&&Z.hasData()){l[B.key]=B;continue}}else{const B=S.children(this._source.maxzoom);if(l[B[0].key]&&l[B[1].key]&&l[B[2].key]&&l[B[3].key])continue}let A=C.wasRequested();for(let B=S.overscaledZ-1;B>=y;--B){const Z=S.scaledTo(B);if(u[Z.key])break;if(u[Z.key]=!0,C=this.getTile(Z),!C&&A&&(C=this._addTile(Z)),C){const U=C.hasData();if((U||!(!((a=this.map)===null||a===void 0)&&a.cancelPendingTileRequestsWhileZooming)||A)&&(l[Z.key]=Z),A=C.wasRequested(),U)break}}}return l}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const s=[];let a,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){a=this._loadedParentTiles[l.key];break}s.push(l.key);const u=l.scaledTo(l.overscaledZ-1);if(a=this._getLoadedTile(u),a)break;l=u}for(const u of s)this._loadedParentTiles[u]=a}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const s=this._tiles[t].tileID,a=this._getLoadedTile(s);this._loadedSiblingTiles[s.key]=a}}_addTile(t){let s=this._tiles[t.key];if(s)return s;s=this._cache.getAndRemove(t),s&&(this._setTileReloadTimer(t.key,s),s.tileID=t,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,s)));const a=s;return s||(s=new Mr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(s,t.key,s.state)),s.uses++,this._tiles[t.key]=s,a||this._source.fire(new m.k("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s}_setTileReloadTimer(t,s){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=s.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const s=this._tiles[t];s&&(s.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))}_dataHandler(t){const s=t.sourceDataType;t.dataType==="source"&&s==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&t.dataType==="source"&&s==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,s,a){const l=[],u=this.transform;if(!u)return l;const y=a?u.getCameraQueryGeometry(t):t,x=t.map(U=>u.pointCoordinate(U,this.terrain)),w=y.map(U=>u.pointCoordinate(U,this.terrain)),S=this.getIds();let C=1/0,A=1/0,B=-1/0,Z=-1/0;for(const U of w)C=Math.min(C,U.x),A=Math.min(A,U.y),B=Math.max(B,U.x),Z=Math.max(Z,U.y);for(let U=0;U<S.length;U++){const G=this._tiles[S[U]];if(G.holdingForFade())continue;const X=G.tileID,K=Math.pow(2,u.zoom-G.tileID.overscaledZ),Q=s*G.queryPadding*m.X/G.tileSize/K,j=[X.getTilePoint(new m.Z(C,A)),X.getTilePoint(new m.Z(B,Z))];if(j[0].x-Q<m.X&&j[0].y-Q<m.X&&j[1].x+Q>=0&&j[1].y+Q>=0){const nt=x.map(ht=>X.getTilePoint(ht)),rt=w.map(ht=>X.getTilePoint(ht));l.push({tile:G,tileID:X,queryGeometry:nt,cameraQueryGeometry:rt,scale:K})}}return l}getVisibleCoordinates(t){const s=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of s)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return s}hasTransition(){if(this._source.hasTransition())return!0;if(Di(this._source.type)){const t=bt.now();for(const s in this._tiles)if(this._tiles[s].fadeEndTime>=t)return!0}return!1}setFeatureState(t,s,a){this._state.updateState(t=t||"_geojsonTileLayer",s,a)}removeFeatureState(t,s,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",s,a)}getFeatureState(t,s){return this._state.getState(t=t||"_geojsonTileLayer",s)}setDependencies(t,s,a){const l=this._tiles[t];l&&l.setDependencies(s,a)}reloadTilesForDependencies(t,s){for(const a in this._tiles)this._tiles[a].hasDependency(t,s)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,s))}}function Ui(d,t){const s=Math.abs(2*d.wrap)-+(d.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return d.overscaledZ-t.overscaledZ||a-s||t.canonical.y-d.canonical.y||t.canonical.x-d.canonical.x}function Di(d){return d==="raster"||d==="image"||d==="video"}Xt.maxOverzooming=10,Xt.maxUnderzooming=3;class ie{constructor(t,s){this.reset(t,s)}reset(t,s){this.points=t||[],this._distances=[0];for(let a=1;a<this.points.length;a++)this._distances[a]=this._distances[a-1]+this.points[a].dist(this.points[a-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(s||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=m.ac(t,0,1);let s=1,a=this._distances[s];const l=t*this.paddedLength+this.padding;for(;a<l&&s<this._distances.length;)a=this._distances[++s];const u=s-1,y=this._distances[u],x=a-y,w=x>0?(l-y)/x:0;return this.points[u].mult(1-w).add(this.points[s].mult(w))}}function jn(d,t){let s=!0;return d==="always"||d!=="never"&&t!=="never"||(s=!1),s}class qn{constructor(t,s,a){const l=this.boxCells=[],u=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(s/a);for(let y=0;y<this.xCellCount*this.yCellCount;y++)l.push([]),u.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=s,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/s,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,s,a,l,u){this._forEachCell(s,a,l,u,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(s),this.bboxes.push(a),this.bboxes.push(l),this.bboxes.push(u)}insertCircle(t,s,a,l){this._forEachCell(s-l,a-l,s+l,a+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(s),this.circles.push(a),this.circles.push(l)}_insertBoxCell(t,s,a,l,u,y){this.boxCells[u].push(y)}_insertCircleCell(t,s,a,l,u,y){this.circleCells[u].push(y)}_query(t,s,a,l,u,y,x){if(a<0||t>this.width||l<0||s>this.height)return[];const w=[];if(t<=0&&s<=0&&this.width<=a&&this.height<=l){if(u)return[{key:null,x1:t,y1:s,x2:a,y2:l}];for(let S=0;S<this.boxKeys.length;S++)w.push({key:this.boxKeys[S],x1:this.bboxes[4*S],y1:this.bboxes[4*S+1],x2:this.bboxes[4*S+2],y2:this.bboxes[4*S+3]});for(let S=0;S<this.circleKeys.length;S++){const C=this.circles[3*S],A=this.circles[3*S+1],B=this.circles[3*S+2];w.push({key:this.circleKeys[S],x1:C-B,y1:A-B,x2:C+B,y2:A+B})}}else this._forEachCell(t,s,a,l,this._queryCell,w,{hitTest:u,overlapMode:y,seenUids:{box:{},circle:{}}},x);return w}query(t,s,a,l){return this._query(t,s,a,l,!1,null)}hitTest(t,s,a,l,u,y){return this._query(t,s,a,l,!0,u,y).length>0}hitTestCircle(t,s,a,l,u){const y=t-a,x=t+a,w=s-a,S=s+a;if(x<0||y>this.width||S<0||w>this.height)return!1;const C=[];return this._forEachCell(y,w,x,S,this._queryCellCircle,C,{hitTest:!0,overlapMode:l,circle:{x:t,y:s,radius:a},seenUids:{box:{},circle:{}}},u),C.length>0}_queryCell(t,s,a,l,u,y,x,w){const{seenUids:S,hitTest:C,overlapMode:A}=x,B=this.boxCells[u];if(B!==null){const U=this.bboxes;for(const G of B)if(!S.box[G]){S.box[G]=!0;const X=4*G,K=this.boxKeys[G];if(t<=U[X+2]&&s<=U[X+3]&&a>=U[X+0]&&l>=U[X+1]&&(!w||w(K))&&(!C||!jn(A,K.overlapMode))&&(y.push({key:K,x1:U[X],y1:U[X+1],x2:U[X+2],y2:U[X+3]}),C))return!0}}const Z=this.circleCells[u];if(Z!==null){const U=this.circles;for(const G of Z)if(!S.circle[G]){S.circle[G]=!0;const X=3*G,K=this.circleKeys[G];if(this._circleAndRectCollide(U[X],U[X+1],U[X+2],t,s,a,l)&&(!w||w(K))&&(!C||!jn(A,K.overlapMode))){const Q=U[X],j=U[X+1],nt=U[X+2];if(y.push({key:K,x1:Q-nt,y1:j-nt,x2:Q+nt,y2:j+nt}),C)return!0}}}return!1}_queryCellCircle(t,s,a,l,u,y,x,w){const{circle:S,seenUids:C,overlapMode:A}=x,B=this.boxCells[u];if(B!==null){const U=this.bboxes;for(const G of B)if(!C.box[G]){C.box[G]=!0;const X=4*G,K=this.boxKeys[G];if(this._circleAndRectCollide(S.x,S.y,S.radius,U[X+0],U[X+1],U[X+2],U[X+3])&&(!w||w(K))&&!jn(A,K.overlapMode))return y.push(!0),!0}}const Z=this.circleCells[u];if(Z!==null){const U=this.circles;for(const G of Z)if(!C.circle[G]){C.circle[G]=!0;const X=3*G,K=this.circleKeys[G];if(this._circlesCollide(U[X],U[X+1],U[X+2],S.x,S.y,S.radius)&&(!w||w(K))&&!jn(A,K.overlapMode))return y.push(!0),!0}}}_forEachCell(t,s,a,l,u,y,x,w){const S=this._convertToXCellCoord(t),C=this._convertToYCellCoord(s),A=this._convertToXCellCoord(a),B=this._convertToYCellCoord(l);for(let Z=S;Z<=A;Z++)for(let U=C;U<=B;U++)if(u.call(this,t,s,a,l,this.xCellCount*U+Z,y,x,w))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,s,a,l,u,y){const x=l-t,w=u-s,S=a+y;return S*S>x*x+w*w}_circleAndRectCollide(t,s,a,l,u,y,x){const w=(y-l)/2,S=Math.abs(t-(l+w));if(S>w+a)return!1;const C=(x-u)/2,A=Math.abs(s-(u+C));if(A>C+a)return!1;if(S<=w||A<=C)return!0;const B=S-w,Z=A-C;return B*B+Z*Z<=a*a}}function cr(d,t,s,a,l){const u=m.H();return t?(m.K(u,u,[1/l,1/l,1]),s||m.ad(u,u,a.angle)):m.L(u,a.labelPlaneMatrix,d),u}function zn(d,t,s,a,l){if(t){const u=m.ae(d);return m.K(u,u,[l,l,1]),s||m.ad(u,u,-a.angle),u}return a.glCoordMatrix}function H(d,t,s,a){let l;a?(l=[d,t,a(d,t),1],m.af(l,l,s)):(l=[d,t,0,1],Pe(l,l,s));const u=l[3];return{point:new m.P(l[0]/u,l[1]/u),signedDistanceFromCamera:u,isOccluded:!1}}function E(d,t){return .5+d/t*.5}function z(d,t){return d.x>=-t[0]&&d.x<=t[0]&&d.y>=-t[1]&&d.y<=t[1]}function V(d,t,s,a,l,u,y,x,w,S,C,A,B,Z,U){const G=a?d.textSizeData:d.iconSizeData,X=m.ag(G,s.transform.zoom),K=[256/s.width*2+1,256/s.height*2+1],Q=a?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;Q.clear();const j=d.lineVertexArray,nt=a?d.text.placedSymbolArray:d.icon.placedSymbolArray,rt=s.transform.width/s.transform.height;let ht=!1;for(let yt=0;yt<nt.length;yt++){const Tt=nt.get(yt);if(Tt.hidden||Tt.writingMode===m.ah.vertical&&!ht){Gt(Tt.numGlyphs,Q);continue}ht=!1;const zt=H(Tt.anchorX,Tt.anchorY,t,U);if(!z(zt.point,K)){Gt(Tt.numGlyphs,Q);continue}const Rt=E(s.transform.cameraToCenterDistance,zt.signedDistanceFromCamera),Ct=m.ai(G,X,Tt),It=y?Ct/Rt:Ct*Rt,Zt={getElevation:U,labelPlaneMatrix:l,lineVertexArray:j,pitchWithMap:y,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:S,tileAnchorPoint:new m.P(Tt.anchorX,Tt.anchorY),unwrappedTileID:C,width:A,height:B,translation:Z},ee=it(Zt,Tt,It,!1,x,t,u,d.glyphOffsetArray,Q,rt,w);ht=ee.useVertical,(ee.notEnoughRoom||ht||ee.needsFlipping&&it(Zt,Tt,It,!0,x,t,u,d.glyphOffsetArray,Q,rt,w).notEnoughRoom)&&Gt(Tt.numGlyphs,Q)}a?d.text.dynamicLayoutVertexBuffer.updateData(Q):d.icon.dynamicLayoutVertexBuffer.updateData(Q)}function q(d,t,s,a,l,u,y,x){const w=u.glyphStartIndex+u.numGlyphs,S=u.lineStartIndex,C=u.lineStartIndex+u.lineLength,A=t.getoffsetX(u.glyphStartIndex),B=t.getoffsetX(w-1),Z=dt(d*A,s,a,l,u.segment,S,C,x,y);if(!Z)return null;const U=dt(d*B,s,a,l,u.segment,S,C,x,y);return U?x.projectionCache.anyProjectionOccluded?null:{first:Z,last:U}:null}function tt(d,t,s,a){return d===m.ah.horizontal&&Math.abs(s.y-t.y)>Math.abs(s.x-t.x)*a?{useVertical:!0}:(d===m.ah.vertical?t.y<s.y:t.x>s.x)?{needsFlipping:!0}:null}function it(d,t,s,a,l,u,y,x,w,S,C){const A=s/24,B=t.lineOffsetX*A,Z=t.lineOffsetY*A;let U;if(t.numGlyphs>1){const G=t.glyphStartIndex+t.numGlyphs,X=t.lineStartIndex,K=t.lineStartIndex+t.lineLength,Q=q(A,x,B,Z,a,t,C,d);if(!Q)return{notEnoughRoom:!0};const j=H(Q.first.point.x,Q.first.point.y,y,d.getElevation).point,nt=H(Q.last.point.x,Q.last.point.y,y,d.getElevation).point;if(l&&!a){const rt=tt(t.writingMode,j,nt,S);if(rt)return rt}U=[Q.first];for(let rt=t.glyphStartIndex+1;rt<G-1;rt++)U.push(dt(A*x.getoffsetX(rt),B,Z,a,t.segment,X,K,d,C));U.push(Q.last)}else{if(l&&!a){const X=H(d.tileAnchorPoint.x,d.tileAnchorPoint.y,u,d.getElevation).point,K=t.lineStartIndex+t.segment+1,Q=new m.P(d.lineVertexArray.getx(K),d.lineVertexArray.gety(K)),j=H(Q.x,Q.y,u,d.getElevation),nt=j.signedDistanceFromCamera>0?j.point:function(ht,yt,Tt,zt,Rt,Ct){return ot(ht,yt,Tt,1,Rt,Ct)}(d.tileAnchorPoint,Q,X,0,u,d),rt=tt(t.writingMode,X,nt,S);if(rt)return rt}const G=dt(A*x.getoffsetX(t.glyphStartIndex),B,Z,a,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,d,C);if(!G||d.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};U=[G]}for(const G of U)m.aj(w,G.point,G.angle);return{}}function ot(d,t,s,a,l,u){const y=d.add(d.sub(t)._unit()),x=l!==void 0?H(y.x,y.y,l,u.getElevation).point:_t(y.x,y.y,u).point,w=s.sub(x);return s.add(w._mult(a/w.mag()))}function Y(d,t,s){const a=t.projectionCache;if(a.projections[d])return a.projections[d];const l=new m.P(t.lineVertexArray.getx(d),t.lineVertexArray.gety(d)),u=_t(l.x,l.y,t);if(u.signedDistanceFromCamera>0)return a.projections[d]=u.point,a.anyProjectionOccluded=a.anyProjectionOccluded||u.isOccluded,u.point;const y=d-s.direction;return function(x,w,S,C,A){return ot(x,w,S,C,void 0,A)}(s.distanceFromAnchor===0?t.tileAnchorPoint:new m.P(t.lineVertexArray.getx(y),t.lineVertexArray.gety(y)),l,s.previousVertex,s.absOffsetX-s.distanceFromAnchor+1,t)}function _t(d,t,s){const a=d+s.translation[0],l=t+s.translation[1];let u;return!s.pitchWithMap&&s.projection.useSpecialProjectionForSymbols?(u=s.projection.projectTileCoordinates(a,l,s.unwrappedTileID,s.getElevation),u.point.x=(.5*u.point.x+.5)*s.width,u.point.y=(.5*-u.point.y+.5)*s.height):(u=H(a,l,s.labelPlaneMatrix,s.getElevation),u.isOccluded=!1),u}function vt(d,t,s){return d._unit()._perp()._mult(t*s)}function ct(d,t,s,a,l,u,y,x,w){if(x.projectionCache.offsets[d])return x.projectionCache.offsets[d];const S=s.add(t);if(d+w.direction<a||d+w.direction>=l)return x.projectionCache.offsets[d]=S,S;const C=Y(d+w.direction,x,w),A=vt(C.sub(s),y,w.direction),B=s.add(A),Z=C.add(A);return x.projectionCache.offsets[d]=m.ak(u,S,B,Z)||S,x.projectionCache.offsets[d]}function dt(d,t,s,a,l,u,y,x,w){const S=a?d-t:d+t;let C=S>0?1:-1,A=0;a&&(C*=-1,A=Math.PI),C<0&&(A+=Math.PI);let B,Z=C>0?u+l:u+l+1;x.projectionCache.cachedAnchorPoint?B=x.projectionCache.cachedAnchorPoint:(B=_t(x.tileAnchorPoint.x,x.tileAnchorPoint.y,x).point,x.projectionCache.cachedAnchorPoint=B);let U,G,X=B,K=B,Q=0,j=0;const nt=Math.abs(S),rt=[];let ht;for(;Q+j<=nt;){if(Z+=C,Z<u||Z>=y)return null;Q+=j,K=X,G=U;const zt={absOffsetX:nt,direction:C,distanceFromAnchor:Q,previousVertex:K};if(X=Y(Z,x,zt),s===0)rt.push(K),ht=X.sub(K);else{let Rt;const Ct=X.sub(K);Rt=Ct.mag()===0?vt(Y(Z+C,x,zt).sub(X),s,C):vt(Ct,s,C),G||(G=K.add(Rt)),U=ct(Z,Rt,X,u,y,G,s,x,zt),rt.push(G),ht=U.sub(G)}j=ht.mag()}const yt=ht._mult((nt-Q)/j)._add(G||K),Tt=A+Math.atan2(X.y-K.y,X.x-K.x);return rt.push(yt),{point:yt,angle:w?Tt:0,path:rt}}const jt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Gt(d,t){for(let s=0;s<d;s++){const a=t.length;t.resize(a+4),t.float32.set(jt,3*a)}}function Pe(d,t,s){const a=t[0],l=t[1];return d[0]=s[0]*a+s[4]*l+s[12],d[1]=s[1]*a+s[5]*l+s[13],d[3]=s[3]*a+s[7]*l+s[15],d}const ne=100;class xe{constructor(t,s,a=new qn(t.width+200,t.height+200,25),l=new qn(t.width+200,t.height+200,25)){this.transform=t,this.mapProjection=s,this.grid=a,this.ignoredGrid=l,this.pitchFactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+ne,this.screenBottomBoundary=t.height+ne,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,s,a,l,u,y,x,w,S,C,A){const B=t.anchorPointX+w[0],Z=t.anchorPointY+w[1],U=this.projectAndGetPerspectiveRatio(l,B,Z,u,C),G=a*U.perspectiveRatio;let X;if(y||x)X=this._projectCollisionBox(t,G,l,u,y,x,w,U,C,A);else{const rt=U.point.x+(A?A.x*G:0),ht=U.point.y+(A?A.y*G:0);X={allPointsOccluded:!1,box:[rt+t.x1*G,ht+t.y1*G,rt+t.x2*G,ht+t.y2*G]}}const[K,Q,j,nt]=X.box;return this.mapProjection.useSpecialProjectionForSymbols&&(y?X.allPointsOccluded:this.mapProjection.isOccluded(B,Z,u))||U.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(K,Q,j,nt)||s!=="always"&&this.grid.hitTest(K,Q,j,nt,s,S)?{box:[K,Q,j,nt],placeable:!1,offscreen:!1}:{box:[K,Q,j,nt],placeable:!0,offscreen:this.isOffscreen(K,Q,j,nt)}}placeCollisionCircles(t,s,a,l,u,y,x,w,S,C,A,B,Z,U,G,X){const K=[],Q=new m.P(s.anchorX,s.anchorY),j=this.getPerspectiveRatio(y,Q.x,Q.y,x,X),nt=(A?u/j:u*j)/m.ap,rt={getElevation:X,labelPlaneMatrix:w,lineVertexArray:a,pitchWithMap:A,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:Q,unwrappedTileID:x,width:this.transform.width,height:this.transform.height,translation:G},ht=q(nt,l,s.lineOffsetX*nt,s.lineOffsetY*nt,!1,s,!1,rt);let yt=!1,Tt=!1,zt=!0;if(ht){const Rt=.5*Z*j+U,Ct=new m.P(-100,-100),It=new m.P(this.screenRightBoundary,this.screenBottomBoundary),Zt=new ie,ee=ht.first,At=ht.last;let Lt=[];for(let pe=ee.path.length-1;pe>=1;pe--)Lt.push(ee.path[pe]);for(let pe=1;pe<At.path.length;pe++)Lt.push(At.path[pe]);const Yt=2.5*Rt;if(S){const pe=this.projectPathToScreenSpace(Lt,rt,S);Lt=pe.some(we=>we.signedDistanceFromCamera<=0)?[]:pe.map(we=>we.point)}let Ke=[];if(Lt.length>0){const pe=Lt[0].clone(),we=Lt[0].clone();for(let Je=1;Je<Lt.length;Je++)pe.x=Math.min(pe.x,Lt[Je].x),pe.y=Math.min(pe.y,Lt[Je].y),we.x=Math.max(we.x,Lt[Je].x),we.y=Math.max(we.y,Lt[Je].y);Ke=pe.x>=Ct.x&&we.x<=It.x&&pe.y>=Ct.y&&we.y<=It.y?[Lt]:we.x<Ct.x||pe.x>It.x||we.y<Ct.y||pe.y>It.y?[]:m.al([Lt],Ct.x,Ct.y,It.x,It.y)}for(const pe of Ke){Zt.reset(pe,.25*Rt);let we=0;we=Zt.length<=.5*Rt?1:Math.ceil(Zt.paddedLength/Yt)+1;for(let Je=0;Je<we;Je++){const Xi=Je/Math.max(we-1,1),_r=Zt.lerp(Xi),Ye=_r.x+ne,Tn=_r.y+ne;K.push(Ye,Tn,Rt,0);const pn=Ye-Rt,Ki=Tn-Rt,fn=Ye+Rt,Zr=Tn+Rt;if(zt=zt&&this.isOffscreen(pn,Ki,fn,Zr),Tt=Tt||this.isInsideGrid(pn,Ki,fn,Zr),t!=="always"&&this.grid.hitTestCircle(Ye,Tn,Rt,t,B)&&(yt=!0,!C))return{circles:[],offscreen:!1,collisionDetected:yt}}}}return{circles:!C&&yt||!Tt||j<this.perspectiveRatioCutoff?[]:K,offscreen:zt,collisionDetected:yt}}projectPathToScreenSpace(t,s,a){return t.map(l=>H(l.x,l.y,a,s.getElevation))}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const s=[];let a=1/0,l=1/0,u=-1/0,y=-1/0;for(const C of t){const A=new m.P(C.x+ne,C.y+ne);a=Math.min(a,A.x),l=Math.min(l,A.y),u=Math.max(u,A.x),y=Math.max(y,A.y),s.push(A)}const x=this.grid.query(a,l,u,y).concat(this.ignoredGrid.query(a,l,u,y)),w={},S={};for(const C of x){const A=C.key;if(w[A.bucketInstanceId]===void 0&&(w[A.bucketInstanceId]={}),w[A.bucketInstanceId][A.featureIndex])continue;const B=[new m.P(C.x1,C.y1),new m.P(C.x2,C.y1),new m.P(C.x2,C.y2),new m.P(C.x1,C.y2)];m.am(s,B)&&(w[A.bucketInstanceId][A.featureIndex]=!0,S[A.bucketInstanceId]===void 0&&(S[A.bucketInstanceId]=[]),S[A.bucketInstanceId].push(A.featureIndex))}return S}insertCollisionBox(t,s,a,l,u,y){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:u,collisionGroupID:y,overlapMode:s},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,s,a,l,u,y){const x=a?this.ignoredGrid:this.grid,w={bucketInstanceId:l,featureIndex:u,collisionGroupID:y,overlapMode:s};for(let S=0;S<t.length;S+=4)x.insertCircle(w,t[S],t[S+1],t[S+2])}projectAndGetPerspectiveRatio(t,s,a,l,u){let y;u?(y=[s,a,u(s,a),1],m.af(y,y,t)):(y=[s,a,0,1],Pe(y,y,t));const x=y[3];return{point:new m.P((y[0]/x+1)/2*this.transform.width+ne,(-y[1]/x+1)/2*this.transform.height+ne),perspectiveRatio:.5+this.transform.cameraToCenterDistance/x*.5,isOccluded:!1,signedDistanceFromCamera:x}}getPerspectiveRatio(t,s,a,l,u){const y=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(s,a,l,u):H(s,a,t,u);return .5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5}isOffscreen(t,s,a,l){return a<ne||t>=this.screenRightBoundary||l<ne||s>this.screenBottomBoundary}isInsideGrid(t,s,a,l){return a>=0&&t<this.gridRightBoundary&&l>=0&&s<this.gridBottomBoundary}getViewportMatrix(){const t=m.an([]);return m.J(t,t,[-100,-100,0]),t}_projectCollisionBox(t,s,a,l,u,y,x,w,S,C){let A=new m.P(1,0),B=new m.P(0,1);const Z=new m.P(t.anchorPointX+x[0],t.anchorPointY+x[1]);if(y&&!u){const zt=this.projectAndGetPerspectiveRatio(a,Z.x+1,Z.y,l,S).point.sub(w.point).unit(),Rt=Math.atan(zt.y/zt.x)+(zt.x<0?Math.PI:0),Ct=Math.sin(Rt),It=Math.cos(Rt);A=new m.P(It,Ct),B=new m.P(-Ct,It)}else if(!y&&u){const zt=-this.transform.angle,Rt=Math.sin(zt),Ct=Math.cos(zt);A=new m.P(Ct,Rt),B=new m.P(-Rt,Ct)}let U=w.point,G=s;if(u){U=Z;const zt=this.transform.zoom-Math.floor(this.transform.zoom);G=Math.pow(2,-zt),G*=this.mapProjection.getPitchedTextCorrection(this.transform,Z,l),C||(G*=m.ac(.5+w.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}C&&(U=U.add(A.mult(C.x*G)).add(B.mult(C.y*G)));const X=t.x1*G,K=t.x2*G,Q=(X+K)/2,j=t.y1*G,nt=t.y2*G,rt=(j+nt)/2,ht=[{offsetX:X,offsetY:j},{offsetX:Q,offsetY:j},{offsetX:K,offsetY:j},{offsetX:K,offsetY:rt},{offsetX:K,offsetY:nt},{offsetX:Q,offsetY:nt},{offsetX:X,offsetY:nt},{offsetX:X,offsetY:rt}];let yt=[];for(const{offsetX:zt,offsetY:Rt}of ht)yt.push(new m.P(U.x+A.x*zt+B.x*Rt,U.y+A.y*zt+B.y*Rt));let Tt=!1;if(u){const zt=yt.map(Rt=>this.projectAndGetPerspectiveRatio(a,Rt.x,Rt.y,l,S));Tt=zt.some(Rt=>!Rt.isOccluded),yt=zt.map(Rt=>Rt.point)}else Tt=!0;return{box:m.ao(yt),allPointsOccluded:!Tt}}}function me(d,t,s){return t*(m.X/(d.tileSize*Math.pow(2,s-d.tileID.overscaledZ)))}class je{constructor(t,s,a,l){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?s:-s))):l&&a?1:0,this.placed=a}isHidden(){return this.opacity===0&&!this.placed}}class We{constructor(t,s,a,l,u){this.text=new je(t?t.text:null,s,a,u),this.icon=new je(t?t.icon:null,s,l,u)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class he{constructor(t,s,a){this.text=t,this.icon=s,this.skipFade=a}}class De{constructor(){this.invProjMatrix=m.H(),this.viewportMatrix=m.H(),this.circles=[]}}class qe{constructor(t,s,a,l,u){this.bucketInstanceId=t,this.featureIndex=s,this.sourceLayerIndex=a,this.bucketIndex=l,this.tileID=u}}class _i{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const s=++this.maxGroupID;this.collisionGroups[t]={ID:s,predicate:a=>a.collisionGroupID===s}}return this.collisionGroups[t]}}function gi(d,t,s,a,l){const{horizontalAlign:u,verticalAlign:y}=m.au(d);return new m.P(-(u-.5)*t+a[0]*l,-(y-.5)*s+a[1]*l)}class Bi{constructor(t,s,a,l,u,y){this.transform=t.clone(),this.terrain=a,this.collisionIndex=new xe(this.transform,s),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=l,this.retainedQueryData={},this.collisionGroups=new _i(u),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const s=this.terrain;return s?(a,l)=>s.getElevation(t,a,l):null}getBucketParts(t,s,a,l){const u=a.getBucket(s),y=a.latestFeatureIndex;if(!u||!y||s.id!==u.layerIds[0])return;const x=a.collisionBoxArray,w=u.layers[0].layout,S=u.layers[0].paint,C=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),A=a.tileSize/m.X,B=a.tileID.toUnwrapped(),Z=this.transform.calculatePosMatrix(B),U=w.get("text-pitch-alignment")==="map",G=w.get("text-rotation-alignment")==="map",X=me(a,1,this.transform.zoom),K=this.collisionIndex.mapProjection.translatePosition(this.transform,a,S.get("text-translate"),S.get("text-translate-anchor")),Q=this.collisionIndex.mapProjection.translatePosition(this.transform,a,S.get("icon-translate"),S.get("icon-translate-anchor")),j=cr(Z,U,G,this.transform,X);let nt=null;if(U){const ht=zn(Z,U,G,this.transform,X);nt=m.L([],this.transform.labelPlaneMatrix,ht)}this.retainedQueryData[u.bucketInstanceId]=new qe(u.bucketInstanceId,y,u.sourceLayerIndex,u.index,a.tileID);const rt={bucket:u,layout:w,translationText:K,translationIcon:Q,posMatrix:Z,unwrappedTileID:B,textLabelPlaneMatrix:j,labelToScreenMatrix:nt,scale:C,textPixelRatio:A,holdingForFade:a.holdingForFade(),collisionBoxArray:x,partiallyEvaluatedTextSize:m.ag(u.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(u.sourceID)};if(l)for(const ht of u.sortKeyRanges){const{sortKey:yt,symbolInstanceStart:Tt,symbolInstanceEnd:zt}=ht;t.push({sortKey:yt,symbolInstanceStart:Tt,symbolInstanceEnd:zt,parameters:rt})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:u.symbolInstances.length,parameters:rt})}attemptAnchorPlacement(t,s,a,l,u,y,x,w,S,C,A,B,Z,U,G,X,K,Q,j){const nt=m.aq[t.textAnchor],rt=[t.textOffset0,t.textOffset1],ht=gi(nt,a,l,rt,u),yt=this.collisionIndex.placeCollisionBox(s,B,w,S,C,x,y,X,A.predicate,j,ht);if((!Q||this.collisionIndex.placeCollisionBox(Q,B,w,S,C,x,y,K,A.predicate,j,ht).placeable)&&yt.placeable){let Tt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(Tt=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:rt,width:a,height:l,anchor:nt,textBoxScale:u,prevAnchor:Tt},this.markUsedJustification(U,nt,Z,G),U.allowVerticalPlacement&&(this.markUsedOrientation(U,G,Z),this.placedOrientations[Z.crossTileID]=G),{shift:ht,placedGlyphBoxes:yt}}}placeLayerBucketPart(t,s,a){const{bucket:l,layout:u,translationText:y,translationIcon:x,posMatrix:w,unwrappedTileID:S,textLabelPlaneMatr
vendor: 9,771 bytes, line 8
8ix:C,labelToScreenMatrix:A,textPixelRatio:B,holdingForFade:Z,collisionBoxArray:U,partiallyEvaluatedTextSize:G,collisionGroup:X}=t.parameters,K=u.get("text-optional"),Q=u.get("icon-optional"),j=m.ar(u,"text-overlap","text-allow-overlap"),nt=j==="always",rt=m.ar(u,"icon-overlap","icon-allow-overlap"),ht=rt==="always",yt=u.get("text-rotation-alignment")==="map",Tt=u.get("text-pitch-alignment")==="map",zt=u.get("icon-text-fit")!=="none",Rt=u.get("symbol-z-order")==="viewport-y",Ct=nt&&(ht||!l.hasIconData()||Q),It=ht&&(nt||!l.hasTextData()||K);!l.collisionArrays&&U&&l.deserializeCollisionBoxes(U);const Zt=this._getTerrainElevationFunc(this.retainedQueryData[l.bucketInstanceId].tileID),ee=(At,Lt,Yt)=>{var Ke,pe;if(s[At.crossTileID])return;if(Z)return void(this.placements[At.crossTileID]=new he(!1,!1,!1));let we=!1,Je=!1,Xi=!0,_r=null,Ye={box:null,placeable:!1,offscreen:null},Tn={placeable:!1},pn=null,Ki=null,fn=null,Zr=0,Do=0,$a=0;Lt.textFeatureIndex?Zr=Lt.textFeatureIndex:At.useRuntimeCollisionCircles&&(Zr=At.featureIndex),Lt.verticalTextFeatureIndex&&(Do=Lt.verticalTextFeatureIndex);const Bo=Lt.textBox;if(Bo){const tr=Fi=>{let Ji=m.ah.horizontal;if(l.allowVerticalPlacement&&!Fi&&this.prevPlacement){const Fn=this.prevPlacement.placedOrientations[At.crossTileID];Fn&&(this.placedOrientations[At.crossTileID]=Fn,Ji=Fn,this.markUsedOrientation(l,Ji,At))}return Ji},er=(Fi,Ji)=>{if(l.allowVerticalPlacement&&At.numVerticalGlyphVertices>0&&Lt.verticalTextBox){for(const Fn of l.writingModes)if(Fn===m.ah.vertical?(Ye=Ji(),Tn=Ye):Ye=Fi(),Ye&&Ye.placeable)break}else Ye=Fi()},Fs=At.textAnchorOffsetStartIndex,gr=At.textAnchorOffsetEndIndex;if(gr===Fs){const Fi=(Ji,Fn)=>{const Ie=this.collisionIndex.placeCollisionBox(Ji,j,B,w,S,Tt,yt,y,X.predicate,Zt);return Ie&&Ie.placeable&&(this.markUsedOrientation(l,Fn,At),this.placedOrientations[At.crossTileID]=Fn),Ie};er(()=>Fi(Bo,m.ah.horizontal),()=>{const Ji=Lt.verticalTextBox;return l.allowVerticalPlacement&&At.numVerticalGlyphVertices>0&&Ji?Fi(Ji,m.ah.vertical):{box:null,offscreen:null}}),tr(Ye&&Ye.placeable)}else{let Fi=m.aq[(pe=(Ke=this.prevPlacement)===null||Ke===void 0?void 0:Ke.variableOffsets[At.crossTileID])===null||pe===void 0?void 0:pe.anchor];const Ji=(Ie,no,Ro)=>{const Fo=Ie.x2-Ie.x1,Nl=Ie.y2-Ie.y1,uh=At.textBoxScale,Vl=zt&&rt==="never"?no:null;let Os=null,Zl=j==="never"?1:2,Ha="never";Fi&&Zl++;for(let xa=0;xa<Zl;xa++){for(let Wa=Fs;Wa<gr;Wa++){const Xa=l.textAnchorOffsets.get(Wa);if(Fi&&Xa.textAnchor!==Fi)continue;const Oo=this.attemptAnchorPlacement(Xa,Ie,Fo,Nl,uh,yt,Tt,B,w,S,X,Ha,At,l,Ro,y,x,Vl,Zt);if(Oo&&(Os=Oo.placedGlyphBoxes,Os&&Os.placeable))return we=!0,_r=Oo.shift,Os}Fi?Fi=null:Ha=j}return a&&!Os&&(Os={box:this.collisionIndex.placeCollisionBox(Bo,"always",B,w,S,Tt,yt,y,X.predicate,Zt,new m.P(0,0)).box,offscreen:!1,placeable:!1}),Os};er(()=>Ji(Bo,Lt.iconBox,m.ah.horizontal),()=>{const Ie=Lt.verticalTextBox;return l.allowVerticalPlacement&&(!Ye||!Ye.placeable)&&At.numVerticalGlyphVertices>0&&Ie?Ji(Ie,Lt.verticalIconBox,m.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Ye&&(we=Ye.placeable,Xi=Ye.offscreen);const Fn=tr(Ye&&Ye.placeable);if(!we&&this.prevPlacement){const Ie=this.prevPlacement.variableOffsets[At.crossTileID];Ie&&(this.variableOffsets[At.crossTileID]=Ie,this.markUsedJustification(l,Ie.anchor,At,Fn))}}}if(pn=Ye,we=pn&&pn.placeable,Xi=pn&&pn.offscreen,At.useRuntimeCollisionCircles){const tr=l.text.placedSymbolArray.get(At.centerJustifiedTextSymbolIndex),er=m.ai(l.textSizeData,G,tr),Fs=u.get("text-padding");Ki=this.collisionIndex.placeCollisionCircles(j,tr,l.lineVertexArray,l.glyphOffsetArray,er,w,S,C,A,a,Tt,X.predicate,At.collisionCircleDiameter,Fs,y,Zt),Ki.circles.length&&Ki.collisionDetected&&!a&&m.w("Collisions detected, but collision boxes are not shown"),we=nt||Ki.circles.length>0&&!Ki.collisionDetected,Xi=Xi&&Ki.offscreen}if(Lt.iconFeatureIndex&&($a=Lt.iconFeatureIndex),Lt.iconBox){const tr=er=>this.collisionIndex.placeCollisionBox(er,rt,B,w,S,Tt,yt,x,X.predicate,Zt,zt&&_r?_r:void 0);Tn&&Tn.placeable&&Lt.verticalIconBox?(fn=tr(Lt.verticalIconBox),Je=fn.placeable):(fn=tr(Lt.iconBox),Je=fn.placeable),Xi=Xi&&fn.offscreen}const Qn=K||At.numHorizontalGlyphVertices===0&&At.numVerticalGlyphVertices===0,Ga=Q||At.numIconVertices===0;Qn||Ga?Ga?Qn||(Je=Je&&we):we=Je&&we:Je=we=Je&&we;const yl=Je&&fn.placeable;if(we&&pn.placeable&&this.collisionIndex.insertCollisionBox(pn.box,j,u.get("text-ignore-placement"),l.bucketInstanceId,Tn&&Tn.placeable&&Do?Do:Zr,X.ID),yl&&this.collisionIndex.insertCollisionBox(fn.box,rt,u.get("icon-ignore-placement"),l.bucketInstanceId,$a,X.ID),Ki&&we&&this.collisionIndex.insertCollisionCircles(Ki.circles,j,u.get("text-ignore-placement"),l.bucketInstanceId,Zr,X.ID),a&&this.storeCollisionData(l.bucketInstanceId,Yt,Lt,pn,fn,Ki),At.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(l.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[At.crossTileID]=new he(we||Ct,Je||It,Xi||l.justReloaded),s[At.crossTileID]=!0};if(Rt){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const At=l.getSortedSymbolIndexes(this.transform.angle);for(let Lt=At.length-1;Lt>=0;--Lt){const Yt=At[Lt];ee(l.symbolInstances.get(Yt),l.collisionArrays[Yt],Yt)}}else for(let At=t.symbolInstanceStart;At<t.symbolInstanceEnd;At++)ee(l.symbolInstances.get(At),l.collisionArrays[At],At);if(a&&l.bucketInstanceId in this.collisionCircleArrays){const At=this.collisionCircleArrays[l.bucketInstanceId];m.as(At.invProjMatrix,w),At.viewportMatrix=this.collisionIndex.getViewportMatrix()}l.justReloaded=!1}storeCollisionData(t,s,a,l,u,y){if(a.textBox||a.iconBox){let x,w;this.collisionBoxArrays.has(t)?x=this.collisionBoxArrays.get(t):(x=new Map,this.collisionBoxArrays.set(t,x)),x.has(s)?w=x.get(s):(w={text:null,icon:null},x.set(s,w)),a.textBox&&(w.text=l.box),a.iconBox&&(w.icon=u.box)}if(y){let x=this.collisionCircleArrays[t];x===void 0&&(x=this.collisionCircleArrays[t]=new De);for(let w=0;w<y.circles.length;w+=4)x.circles.push(y.circles[w+0]),x.circles.push(y.circles[w+1]),x.circles.push(y.circles[w+2]),x.circles.push(y.collisionDetected?1:0)}}markUsedJustification(t,s,a,l){let u;u=l===m.ah.vertical?a.verticalPlacedTextSymbolIndex:{left:a.leftJustifiedTextSymbolIndex,center:a.centerJustifiedTextSymbolIndex,right:a.rightJustifiedTextSymbolIndex}[m.at(s)];const y=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex,a.verticalPlacedTextSymbolIndex];for(const x of y)x>=0&&(t.text.placedSymbolArray.get(x).crossTileID=u>=0&&x!==u?0:a.crossTileID)}markUsedOrientation(t,s,a){const l=s===m.ah.horizontal||s===m.ah.horizontalOnly?s:0,u=s===m.ah.vertical?s:0,y=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const x of y)t.text.placedSymbolArray.get(x).placedOrientation=l;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=u)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const s=this.prevPlacement;let a=!1;this.prevZoomAdjustment=s?s.zoomAdjustment(this.transform.zoom):0;const l=s?s.symbolFadeChange(t):1,u=s?s.opacities:{},y=s?s.variableOffsets:{},x=s?s.placedOrientations:{};for(const w in this.placements){const S=this.placements[w],C=u[w];C?(this.opacities[w]=new We(C,l,S.text,S.icon),a=a||S.text!==C.text.placed||S.icon!==C.icon.placed):(this.opacities[w]=new We(null,l,S.text,S.icon,S.skipFade),a=a||S.text||S.icon)}for(const w in u){const S=u[w];if(!this.opacities[w]){const C=new We(S,l,!1,!1);C.isHidden()||(this.opacities[w]=C,a=a||S.text.placed||S.icon.placed)}}for(const w in y)this.variableOffsets[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.variableOffsets[w]=y[w]);for(const w in x)this.placedOrientations[w]||!this.opacities[w]||this.opacities[w].isHidden()||(this.placedOrientations[w]=x[w]);if(s&&s.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=s?s.lastPlacementChangeTime:t)}updateLayerOpacities(t,s){const a={};for(const l of s){const u=l.getBucket(t);u&&l.latestFeatureIndex&&t.id===u.layerIds[0]&&this.updateBucketOpacities(u,l.tileID,a,l.collisionBoxArray)}}updateBucketOpacities(t,s,a,l){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const u=t.layers[0],y=u.layout,x=new We(null,0,!1,!1,!0),w=y.get("text-allow-overlap"),S=y.get("icon-allow-overlap"),C=u._unevaluatedLayout.hasValue("text-variable-anchor")||u._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=y.get("text-rotation-alignment")==="map",B=y.get("text-pitch-alignment")==="map",Z=y.get("icon-text-fit")!=="none",U=new We(null,0,w&&(S||!t.hasIconData()||y.get("icon-optional")),S&&(w||!t.hasTextData()||y.get("text-optional")),!0);!t.collisionArrays&&l&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(l);const G=(K,Q,j)=>{for(let nt=0;nt<Q/4;nt++)K.opacityVertexArray.emplaceBack(j);K.hasVisibleVertices=K.hasVisibleVertices||j!==Wr},X=this.collisionBoxArrays.get(t.bucketInstanceId);for(let K=0;K<t.symbolInstances.length;K++){const Q=t.symbolInstances.get(K),{numHorizontalGlyphVertices:j,numVerticalGlyphVertices:nt,crossTileID:rt}=Q;let ht=this.opacities[rt];a[rt]?ht=x:ht||(ht=U,this.opacities[rt]=ht),a[rt]=!0;const yt=Q.numIconVertices>
vendor: 6,823 bytes, line 8
80,Tt=this.placedOrientations[Q.crossTileID],zt=Tt===m.ah.vertical,Rt=Tt===m.ah.horizontal||Tt===m.ah.horizontalOnly;if(j>0||nt>0){const It=ji(ht.text);G(t.text,j,zt?Wr:It),G(t.text,nt,Rt?Wr:It);const Zt=ht.text.isHidden();[Q.rightJustifiedTextSymbolIndex,Q.centerJustifiedTextSymbolIndex,Q.leftJustifiedTextSymbolIndex].forEach(Lt=>{Lt>=0&&(t.text.placedSymbolArray.get(Lt).hidden=Zt||zt?1:0)}),Q.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(Q.verticalPlacedTextSymbolIndex).hidden=Zt||Rt?1:0);const ee=this.variableOffsets[Q.crossTileID];ee&&this.markUsedJustification(t,ee.anchor,Q,Tt);const At=this.placedOrientations[Q.crossTileID];At&&(this.markUsedJustification(t,"left",Q,At),this.markUsedOrientation(t,At,Q))}if(yt){const It=ji(ht.icon),Zt=!(Z&&Q.verticalPlacedIconSymbolIndex&&zt);Q.placedIconSymbolIndex>=0&&(G(t.icon,Q.numIconVertices,Zt?It:Wr),t.icon.placedSymbolArray.get(Q.placedIconSymbolIndex).hidden=ht.icon.isHidden()),Q.verticalPlacedIconSymbolIndex>=0&&(G(t.icon,Q.numVerticalIconVertices,Zt?Wr:It),t.icon.placedSymbolArray.get(Q.verticalPlacedIconSymbolIndex).hidden=ht.icon.isHidden())}const Ct=X&&X.has(K)?X.get(K):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const It=t.collisionArrays[K];if(It){let Zt=new m.P(0,0);if(It.textBox||It.verticalTextBox){let ee=!0;if(C){const At=this.variableOffsets[rt];At?(Zt=gi(At.anchor,At.width,At.height,At.textOffset,At.textBoxScale),A&&Zt._rotate(B?this.transform.angle:-this.transform.angle)):ee=!1}if(It.textBox||It.verticalTextBox){let At;It.textBox&&(At=zt),It.verticalTextBox&&(At=Rt),ur(t.textCollisionBox.collisionVertexArray,ht.text.placed,!ee||At,Ct.text,Zt.x,Zt.y)}}if(It.iconBox||It.verticalIconBox){const ee=!!(!Rt&&It.verticalIconBox);let At;It.iconBox&&(At=ee),It.verticalIconBox&&(At=!ee),ur(t.iconCollisionBox.collisionVertexArray,ht.icon.placed,At,Ct.icon,Z?Zt.x:0,Z?Zt.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const K=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=K.invProjMatrix,t.placementViewportMatrix=K.viewportMatrix,t.collisionCircleArray=K.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,s){const a=this.zoomAtLastRecencyCheck===s?1-this.zoomAdjustment(s):1;return this.zoomAtLastRecencyCheck=s,this.commitTime+this.fadeDuration*a>t}setStale(){this.stale=!0}}function ur(d,t,s,a,l,u){a&&a.length!==0||(a=[0,0,0,0]);const y=a[0]-ne,x=a[1]-ne,w=a[2]-ne,S=a[3]-ne;d.emplaceBack(t?1:0,s?1:0,l||0,u||0,y,x),d.emplaceBack(t?1:0,s?1:0,l||0,u||0,w,x),d.emplaceBack(t?1:0,s?1:0,l||0,u||0,w,S),d.emplaceBack(t?1:0,s?1:0,l||0,u||0,y,S)}const Be=Math.pow(2,25),Go=Math.pow(2,24),Ho=Math.pow(2,17),on=Math.pow(2,16),an=Math.pow(2,9),Wo=Math.pow(2,8),Mi=Math.pow(2,1);function ji(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const t=d.placed?1:0,s=Math.floor(127*d.opacity);return s*Be+t*Go+s*Ho+t*on+s*an+t*Wo+s*Mi+t}const Wr=0;function En(){return{isOccluded:(d,t,s)=>!1,getPitchedTextCorrection:(d,t,s)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(d,t,s,a){throw new Error("Not implemented.")},translatePosition:(d,t,s,a)=>function(l,u,y,x,w=!1){if(!y[0]&&!y[1])return[0,0];const S=w?x==="map"?l.angle:0:x==="viewport"?-l.angle:0;if(S){const C=Math.sin(S),A=Math.cos(S);y=[y[0]*A-y[1]*C,y[0]*C+y[1]*A]}return[w?y[0]:me(u,y[0],l.zoom),w?y[1]:me(u,y[1],l.zoom)]}(d,t,s,a),getCircleRadiusCorrection:d=>1}}class Jt{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,s,a,l,u){const y=this._bucketParts;for(;this._currentTileIndex<t.length;)if(s.getBucketParts(y,l,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,u())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort((x,w)=>x.sortKey-w.sortKey));this._currentPartIndex<y.length;)if(s.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,a),this._currentPartIndex++,u())return!0;return!1}}class Oe{constructor(t,s,a,l,u,y,x,w){this.placement=new Bi(t,En(),s,y,x,w),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=u,this._done=!1}isDone(){return this._done}continuePlacement(t,s,a){const l=bt.now(),u=()=>!this._forceFullPlacement&&bt.now()-l>2;for(;this._currentPlacementIndex>=0;){const y=s[t[this._currentPlacementIndex]],x=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=x)&&(!y.maxzoom||y.maxzoom>x)){if(this._inProgressLayer||(this._inProgressLayer=new Jt(y)),this._inProgressLayer.continuePlacement(a[y.source],this.placement,this._showCollisionBoxes,y,u))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const qi=512/m.X/2;class Ze{constructor(t,s,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const l=new Map;for(let u=0;u<s.length;u++){const y=s.get(u),x=y.key,w=l.get(x);w?w.push(y):l.set(x,[y])}for(const[u,y]of l){const x={positions:y.map(w=>({x:Math.floor(w.anchorX*qi),y:Math.floor(w.anchorY*qi)})),crossTileIDs:y.map(w=>w.crossTileID)};if(x.positions.length>
vendor: 21,912 bytes, line 8
8128){const w=new m.av(x.positions.length,16,Uint16Array);for(const{x:S,y:C}of x.positions)w.add(S,C);w.finish(),delete x.positions,x.index=w}this._symbolsByKey[u]=x}}getScaledCoordinates(t,s){const{x:a,y:l,z:u}=this.tileID.canonical,{x:y,y:x,z:w}=s.canonical,S=qi/Math.pow(2,w-u),C=(x*m.X+t.anchorY)*S,A=l*m.X*qi;return{x:Math.floor((y*m.X+t.anchorX)*S-a*m.X*qi),y:Math.floor(C-A)}}findMatches(t,s,a){const l=this.tileID.canonical.z<s.canonical.z?1:Math.pow(2,this.tileID.canonical.z-s.canonical.z);for(let u=0;u<t.length;u++){const y=t.get(u);if(y.crossTileID)continue;const x=this._symbolsByKey[y.key];if(!x)continue;const w=this.getScaledCoordinates(y,s);if(x.index){const S=x.index.range(w.x-l,w.y-l,w.x+l,w.y+l).sort();for(const C of S){const A=x.crossTileIDs[C];if(!a[A]){a[A]=!0,y.crossTileID=A;break}}}else if(x.positions)for(let S=0;S<x.positions.length;S++){const C=x.positions[S],A=x.crossTileIDs[S];if(Math.abs(C.x-w.x)<=l&&Math.abs(C.y-w.y)<=l&&!a[A]){a[A]=!0,y.crossTileID=A;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class dr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class ln{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const s=Math.round((t-this.lng)/360);if(s!==0)for(const a in this.indexes){const l=this.indexes[a],u={};for(const y in l){const x=l[y];x.tileID=x.tileID.unwrapTo(x.tileID.wrap+s),u[x.tileID.key]=x}this.indexes[a]=u}this.lng=t}addBucket(t,s,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===s.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let u=0;u<s.symbolInstances.length;u++)s.symbolInstances.get(u).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const l=this.usedCrossTileIDs[t.overscaledZ];for(const u in this.indexes){const y=this.indexes[u];if(Number(u)>t.overscaledZ)for(const x in y){const w=y[x];w.tileID.isChildOf(t)&&w.findMatches(s.symbolInstances,t,l)}else{const x=y[t.scaledTo(Number(u)).key];x&&x.findMatches(s.symbolInstances,t,l)}}for(let u=0;u<s.symbolInstances.length;u++){const y=s.symbolInstances.get(u);y.crossTileID||(y.crossTileID=a.generate(),l[y.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ze(t,s.symbolInstances,s.bucketInstanceId),!0}removeBucketCrossTileIDs(t,s){for(const a of s.getCrossTileIDsLists())for(const l of a)delete this.usedCrossTileIDs[t][l]}removeStaleBuckets(t){let s=!1;for(const a in this.indexes){const l=this.indexes[a];for(const u in l)t[l[u].bucketInstanceId]||(this.removeBucketCrossTileIDs(a,l[u]),delete l[u],s=!0)}return s}}class ce{constructor(){this.layerIndexes={},this.crossTileIDs=new dr,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,s,a){let l=this.layerIndexes[t.id];l===void 0&&(l=this.layerIndexes[t.id]=new ln);let u=!1;const y={};l.handleWrapJump(a);for(const x of s){const w=x.getBucket(t);w&&t.id===w.layerIds[0]&&(w.bucketInstanceId||(w.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(x.tileID,w,this.crossTileIDs)&&(u=!0),y[w.bucketInstanceId]=!0)}return l.removeStaleBuckets(y)&&(u=!0),u}pruneUnusedLayers(t){const s={};t.forEach(a=>{s[a]=!0});for(const a in this.layerIndexes)s[a]||delete this.layerIndexes[a]}}const Le=(d,t)=>m.t(d,t&&t.filter(s=>s.identifier!=="source.canvas")),Xo=m.aw();class Xr extends m.E{constructor(t,s={}){super(),this._rtlPluginLoaded=()=>{for(const a in this.sourceCaches){const l=this.sourceCaches[a].getSource().type;l!=="vector"&&l!=="geojson"||this.sourceCaches[a].reload()}},this.map=t,this.dispatcher=new ar(Pr(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(a,l)=>this.getGlyphs(a,l)),this.dispatcher.registerMessageHandler("GI",(a,l)=>this.getImages(a,l)),this.imageManager=new Si,this.imageManager.setEventedParent(this),this.glyphManager=new Zi(t._requestManager,s.localIdeographFontFamily),this.lineAtlas=new ci(256,512),this.crossTileSymbolIndex=new ce,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new m.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",m.ay()),kn().on(Pt,this._rtlPluginLoaded),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;const l=this.sourceCaches[a.sourceId];if(!l)return;const u=l.getSource();if(u&&u.vectorLayerIds)for(const y in this._layers){const x=this._layers[y];x.source===u.id&&this._validateLayer(x)}})}loadURL(t,s={},a){this.fire(new m.k("dataloading",{dataType:"style"})),s.validate=typeof s.validate!="boolean"||s.validate;const l=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const u=this._loadStyleRequest;m.h(l,this._loadStyleRequest).then(y=>{this._loadStyleRequest=null,this._load(y.data,s,a)}).catch(y=>{this._loadStyleRequest=null,y&&!u.signal.aborted&&this.fire(new m.j(y))})}loadJSON(t,s={},a){this.fire(new m.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,bt.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,s.validate=s.validate!==!1,this._load(t,s,a)}).catch(()=>{})}loadEmpty(){this.fire(new m.k("dataloading",{dataType:"style"})),this._load(Xo,{validate:!1})}_load(t,s,a){var l;const u=s.transformStyle?s.transformStyle(a,t):t;if(!s.validate||!Le(this,m.u(u))){this._loaded=!0,this.stylesheet=u;for(const y in u.sources)this.addSource(y,u.sources[y],{validate:!1});u.sprite?this._loadSprite(u.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(u.glyphs),this._createLayers(),this.light=new Kt(this.stylesheet.light),this.sky=new Ge(this.stylesheet.sky),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new m.k("data",{dataType:"style"})),this.fire(new m.k("style.load"))}}_createLayers(){const t=m.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map(s=>s.id),this._layers={},this._serializedLayers=null;for(const s of t){const a=m.aA(s);a.setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=a}}_loadSprite(t,s=!1,a=void 0){let l;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(u,y,x,w){return m._(this,void 0,void 0,function*(){const S=yn(u),C=x>1?"@2x":"",A={},B={};for(const{id:Z,url:U}of S){const G=y.transformRequest(xs(U,C,".json"),"SpriteJSON");A[Z]=m.h(G,w);const X=y.transformRequest(xs(U,C,".png"),"SpriteImage");B[Z]=ti.getImage(X,w)}return yield Promise.all([...Object.values(A),...Object.values(B)]),function(Z,U){return m._(this,void 0,void 0,function*(){const G={};for(const X in Z){G[X]={};const K=bt.getImageCanvasContext((yield U[X]).data),Q=(yield Z[X]).data;for(const j in Q){const{width:nt,height:rt,x:ht,y:yt,sdf:Tt,pixelRatio:zt,stretchX:Rt,stretchY:Ct,content:It,textFitWidth:Zt,textFitHeight:ee}=Q[j];G[X][j]={data:null,pixelRatio:zt,sdf:Tt,stretchX:Rt,stretchY:Ct,content:It,textFitWidth:Zt,textFitHeight:ee,spriteData:{width:nt,height:rt,x:ht,y:yt,context:K}}}}return G})}(A,B)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(u=>{if(this._spriteRequest=null,u)for(const y in u){this._spritesImagesIds[y]=[];const x=this._spritesImagesIds[y]?this._spritesImagesIds[y].filter(w=>!(w in u)):[];for(const w of x)this.imageManager.removeImage(w),this._changedImages[w]=!0;for(const w in u[y]){const S=y==="default"?w:`${y}:${w}`;this._spritesImagesIds[y].push(S),S in this.imageManager.images?this.imageManager.updateImage(S,u[y][w],!1):this.imageManager.addImage(S,u[y][w]),s&&(this._changedImages[S]=!0)}}}).catch(u=>{this._spriteRequest=null,l=u,this.fire(new m.j(l))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),s&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new m.k("data",{dataType:"style"})),a&&a(l)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new m.k("data",{dataType:"style"}))}_validateLayer(t){const s=this.sourceCaches[t.source];if(!s)return;const a=t.sourceLayer;if(!a)return;const l=s.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(a)===-1)&&this.fire(new m.j(new Error(`Source layer "${a}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,s=!1){const a=this._serializedAllLayers();if(!t||t.length===0)return Object.values(s?m.aB(a):a);const l=[];for(const u of t)if(a[u]){const y=s?m.aB(a[u]):a[u];l.push(y)}return l}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const s=Object.keys(this._layers);for(const a of s){const l=this._layers[a];l.type!=="custom"&&(t[a]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const s=this._changed;if(s){const l=Object.keys(this._updatedLayers),u=Object.keys(this._removedLayers);(l.length||u.length)&&this._updateWorkerLayers(l,u);for(const y in this._updatedSources){const x=this._updatedSources[y];if(x==="reload")this._reloadSource(y);else{if(x!=="clear")throw new Error(`Invalid action ${x}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const a={};for(const l in this.sourceCaches){const u=this.sourceCaches[l];a[l]=u.used,u.used=!1}for(const l of this._order){const u=this._layers[l];u.recalculate(t,this._availableImages),!u.isHidden(t.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0)}for(const l in a){const u=this.sourceCaches[l];!!a[l]!=!!u.used&&u.fire(new m.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,s&&this.fire(new m.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,s){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:s})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,s={}){var a;this._checkLoaded();const l=this.serialize();if(t=s.transformStyle?s.transformStyle(l,t):t,((a=s.validate)===null||a===void 0||a)&&Le(this,m.u(t)))return!1;(t=m.aB(t)).layers=m.az(t.layers);const u=m.aC(l,t),y=this._getOperationsToPerform(u);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(y.operations.length===0)return!1;for(const x of y.operations)x();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const s=[],a=[];for(const l of t)switch(l.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":s.push(()=>this.addLayer.apply(this,l.args));break;case"removeLayer":s.push(()=>this.removeLayer.apply(this,l.args));break;case"setPaintProperty":s.push(()=>this.setPaintProperty.apply(this,l.args));break;case"setLayoutProperty":s.push(()=>this.setLayoutProperty.apply(this,l.args));break;case"setFilter":s.push(()=>this.setFilter.apply(this,l.args));break;case"addSource":s.push(()=>this.addSource.apply(this,l.args));break;case"removeSource":s.push(()=>this.removeSource.apply(this,l.args));break;case"setLayerZoomRange":s.push(()=>this.setLayerZoomRange.apply(this,l.args));break;case"setLight":s.push(()=>this.setLight.apply(this,l.args));break;case"setGeoJSONSourceData":s.push(()=>this.setGeoJSONSourceData.apply(this,l.args));break;case"setGlyphs":s.push(()=>this.setGlyphs.apply(this,l.args));break;case"setSprite":s.push(()=>this.setSprite.apply(this,l.args));break;case"setSky":s.push(()=>this.setSky.apply(this,l.args));break;case"setTerrain":s.push(()=>this.map.setTerrain.apply(this,l.args));break;case"setTransition":s.push(()=>{});break;default:a.push(l.command)}return{operations:s,unimplemented:a}}addImage(t,s){if(this.getImage(t))return this.fire(new m.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,s),this._afterImageUpdated(t)}updateImage(t,s){this.imageManager.updateImage(t,s)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new m.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new m.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,s,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!s.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(s).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(m.u.source,`sources.${t}`,s,null,a))return;this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);const l=this.sourceCaches[t]=new Xt(t,s,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new m.j(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const s=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],s.fire(new m.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),s.setEventedParent(null),s.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,s){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(s),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,s,a={}){this._checkLoaded();const l=t.id;if(this.getLayer(l))return void this.fire(new m.j(new Error(`Layer "${l}" already exists on this map.`)));let u;if(t.type==="custom"){if(Le(this,m.aD(t)))return;u=m.aA(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=m.aB(t),t=m.e(t,{source:l})),this._validate(m.u.layer,`layers.${l}`,t,{arrayIndex:-1},a))return;u=m.aA(t),this._validateLayer(u),u.setEventedParent(this,{layer:{id:l}})}const y=s?this._order.indexOf(s):this._order.length;if(s&&y===-1)this.fire(new m.j(new Error(`Cannot add layer "${l}" before non-existing layer "${s}".`)));else{if(this._order.splice(y,0,l),this._layerOrderChanged=!0,this._layers[l]=u,this._removedLayers[l]&&u.source&&u.type!=="custom"){const x=this._removedLayers[l];delete this._removedLayers[l],x.type!==u.type?this._updatedSources[u.source]="clear":(this._updatedSources[u.source]="reload",this.sourceCaches[u.source].pause())}this._updateLayer(u),u.onAdd&&u.onAdd(this.map)}}moveLayer(t,s){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new m.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===s)return;const a=this._order.indexOf(t);this._order.splice(a,1);const l=s?this._order.indexOf(s):this._order.length;s&&l===-1?this.fire(new m.j(new Error(`Cannot move layer "${t}" before non-existing layer "${s}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const s=this._layers[t];if(!s)return void this.fire(new m.j(new Error(`Cannot remove non-existing layer "${t}".`)));s.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=s,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],s.onRemove&&s.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,s,a){this._checkLoaded();const l=this.getLayer(t);l?l.minzoom===s&&l.maxzoom===a||(s!=null&&(l.minzoom=s),a!=null&&(l.maxzoom=a),this._updateLayer(l)):this.fire(new m.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,s,a={}){this._checkLoaded();const l=this.getLayer(t);if(l){if(!m.aE(l.filter,s))return s==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(m.u.filter,`layers.${l.id}.filter`,s,null,a)||(l.filter=m.aB(s),this._updateLayer(l)))}else this.fire(new m.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return m.aB(this.getLayer(t).filter)}setLayoutProperty(t,s,a,l={}){this._checkLoaded();const u=this.getLayer(t);u?m.aE(u.getLayoutProperty(s),a)||(u.setLayoutProperty(s,a,l),this._updateLayer(u)):this.fire(new m.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,s){const a=this.getLayer(t);if(a)return a.getLayoutProperty(s);this.fire(new m.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,s,a,l={}){this._checkLoaded();const u=this.getLayer(t);u?m.aE(u.getPaintProperty(s),a)||(u.setPaintProperty(s,a,l)&&this._updateLayer(u),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new m.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,s){return this.getLayer(t).getPaintProperty(s)}setFeatureState(t,s){this._checkLoaded();const a=t.source,l=t.sourceLayer,u=this.sourceCaches[a];if(u===void 0)return void this.fire(new m.j(new Error(`The source '${a}' does not exist in the map's style.`)));const y=u.getSource().type;y==="geojson"&&l?this.fire(new m.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):y!=="vector"||l?(t.id===void 0&&this.fire(new m.j(new Error("The feature id parameter must be provided."))),u.setFeatureState(l,t.id,s)):this.fire(new m.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,s){this._checkLoaded();const a=t.source,l=this.sourceCaches[a];if(l===void 0)return void this.fire(new m.j(new Error(`The source '${a}' does not exist in the map's style.`)));const u=l.getSource().type,y=u==="vector"?t.sourceLayer:void 0;u!=="vector"||y?s&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new m.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(y,t.id,s):this.fire(new m.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const s=t.source,a=t.sourceLayer,l=this.sourceCaches[s];if(l!==void 0)return l.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new m.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(a,t.id)):void this.fire(new m.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new m.j(new Error(`The source '${s}' does not exist in the map's style.`)))}getTransition(){return m.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=m.aF(this.sourceCaches,u=>u.serialize()),s=this._serializeByIds(this._order,!0),a=this.map.getTerrain()||void 0,l=this.stylesheet;return m.aG({version:l.version,name:l.name,metadata:l.metadata,light:l.light,sky:l.sky,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:s,terrain:a},u=>u!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const s=y=>this._layers[y].type==="fill-extrusion",a={},l=[];for(let y=this._order.length-1;y>=0;y--){const x=this._order[y];if(s(x)){a[x]=y;for(const w of t){const S=w[x];if(S)for(const C of S)l.push(C)}}}l.sort((y,x)=>x.intersectionZ-y.intersectionZ);const u=[];for(let y=this._order.length-1;y>=0;y--){const x=this._order[y];if(s(x))for(let w=l.length-1;w>=0;w--){const S=l[w].feature;if(a[S.layer.id]<y)break;u.push(S),l.pop()}else for(const w of t){const S=w[x];if(S)for(const C of S)u.push(C.feature)}}return u}
vendor: 10,052 bytes, lines 8-67
8queryRenderedFeatures(t,s,a){s&&s.filter&&this._validate(m.u.filter,"queryRenderedFeatures.filter",s.filter,null,s);const l={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new m.j(new Error("parameters.layers must be an Array."))),[];for(const x of s.layers){const w=this._layers[x];if(!w)return this.fire(new m.j(new Error(`The layer '${x}' does not exist in the map's style and cannot be queried for features.`))),[];l[w.source]=!0}}const u=[];s.availableImages=this._availableImages;const y=this._serializedAllLayers();for(const x in this.sourceCaches)s.layers&&!l[x]||u.push(Vn(this.sourceCaches[x],this._layers,y,t,s,a));return this.placement&&u.push(function(x,w,S,C,A,B,Z){const U={},G=B.queryRenderedSymbols(C),X=[];for(const K of Object.keys(G).map(Number))X.push(Z[K]);X.sort(Sr);for(const K of X){const Q=K.featureIndex.lookupSymbolFeatures(G[K.bucketInstanceId],w,K.bucketIndex,K.sourceLayerIndex,A.filter,A.layers,A.availableImages,x);for(const j in Q){const nt=U[j]=U[j]||[],rt=Q[j];rt.sort((ht,yt)=>{const Tt=K.featureSortOrder;if(Tt){const zt=Tt.indexOf(ht.featureIndex);return Tt.indexOf(yt.featureIndex)-zt}return yt.featureIndex-ht.featureIndex});for(const ht of rt)nt.push(ht)}}for(const K in U)U[K].forEach(Q=>{const j=Q.feature,nt=S[x[K].source].getFeatureState(j.layer["source-layer"],j.id);j.source=j.layer.source,j.layer["source-layer"]&&(j.sourceLayer=j.layer["source-layer"]),j.state=nt});return U}(this._layers,y,this.sourceCaches,t,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)}querySourceFeatures(t,s){s&&s.filter&&this._validate(m.u.filter,"querySourceFeatures.filter",s.filter,null,s);const a=this.sourceCaches[t];return a?function(l,u){const y=l.getRenderableIds().map(S=>l.getTileByID(S)),x=[],w={};for(let S=0;S<y.length;S++){const C=y[S],A=C.tileID.canonical.key;w[A]||(w[A]=!0,C.querySourceFeatures(x,u))}return x}(a,s):[]}getLight(){return this.light.getLight()}setLight(t,s={}){this._checkLoaded();const a=this.light.getLight();let l=!1;for(const y in t)if(!m.aE(t[y],a[y])){l=!0;break}if(!l)return;const u={now:bt.now(),transition:m.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,s),this.light.updateTransitions(u)}getSky(){var t;return(t=this.stylesheet)===null||t===void 0?void 0:t.sky}setSky(t,s={}){const a=this.getSky();let l=!1;if(!t&&!a)return;if(t&&!a)l=!0;else if(!t&&a)l=!0;else for(const y in t)if(!m.aE(t[y],a[y])){l=!0;break}if(!l)return;const u={now:bt.now(),transition:m.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,s),this.sky.updateTransitions(u)}_validate(t,s,a,l,u={}){return(!u||u.validate!==!1)&&Le(this,t.call(m.u,m.e({key:s,style:this.serialize(),value:a,styleSpec:m.v},l)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),kn().off(Pt,this._rtlPluginLoaded);for(const s in this._layers)this._layers[s].setEventedParent(null);for(const s in this.sourceCaches){const a=this.sourceCaches[s];a.setEventedParent(null),a.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const s in this.sourceCaches)this.sourceCaches[s].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,s,a,l,u=!1){let y=!1,x=!1;const w={};for(const S of this._order){const C=this._layers[S];if(C.type!=="symbol")continue;if(!w[C.source]){const B=this.sourceCaches[C.source];w[C.source]=B.getRenderableIds(!0).map(Z=>B.getTileByID(Z)).sort((Z,U)=>U.tileID.overscaledZ-Z.tileID.overscaledZ||(Z.tileID.isLessThan(U.tileID)?-1:1))}const A=this.crossTileSymbolIndex.addLayer(C,w[C.source],t.center.lng);y=y||A}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((u=u||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(bt.now(),t.zoom))&&(this.pauseablePlacement=new Oe(t,this.map.terrain,this._order,u,s,a,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,w),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(bt.now()),x=!0),y&&this.pauseablePlacement.placement.setStale()),x||y)for(const S of this._order){const C=this._layers[S];C.type==="symbol"&&this.placement.updateLayerOpacities(C,w[C.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(bt.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,s){return m._(this,void 0,void 0,function*(){const a=yield this.imageManager.getImages(s.icons);this._updateTilesForChangedImages();const l=this.sourceCaches[s.source];return l&&l.setDependencies(s.tileID.key,s.type,s.icons),a})}getGlyphs(t,s){return m._(this,void 0,void 0,function*(){const a=yield this.glyphManager.getGlyphs(s.stacks),l=this.sourceCaches[s.source];return l&&l.setDependencies(s.tileID.key,s.type,[""]),a})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,s={}){this._checkLoaded(),t&&this._validate(m.u.glyphs,"glyphs",t,null,s)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,s,a={},l){this._checkLoaded();const u=[{id:t,url:s}],y=[...yn(this.stylesheet.sprite),...u];this._validate(m.u.sprite,"sprite",y,null,a)||(this.stylesheet.sprite=y,this._loadSprite(u,!0,l))}removeSprite(t){this._checkLoaded();const s=yn(this.stylesheet.sprite);if(s.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;s.splice(s.findIndex(a=>a.id===t),1),this.stylesheet.sprite=s.length>0?s:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new m.k("data",{dataType:"style"}))}else this.fire(new m.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return yn(this.stylesheet.sprite)}setSprite(t,s={},a){this._checkLoaded(),t&&this._validate(m.u.sprite,"sprite",t,null,s)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}var yi=m.Y([{name:"a_pos",type:"Int16",components:2}]);const Cr={prelude:Se(`#ifdef GL_ES 9precision mediump float; 10#else 11#if !defined(lowp) 12#define lowp 13#endif 14#if !defined(mediump) 15#define mediump 16#endif 17#if !defined(highp) 18#define highp 19#endif 20#endif 21`,`#ifdef GL_ES 22precision highp float; 23#else 24#if !defined(lowp) 25#define lowp 26#endif 27#if !defined(mediump) 28#define mediump 29#endif 30#if !defined(highp) 31#define highp 32#endif 33#endif 34vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 35);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} 36#ifdef TERRAIN3D 37uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; 38#endif 39const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { 40#ifdef TERRAIN3D 41highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 42#else 43return 1.0; 44#endif 45}float calculate_visibility(vec4 pos) { 46#ifdef TERRAIN3D 47vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; 48#else 49return 1.0; 50#endif 51}float ele(vec2 pos) { 52#ifdef TERRAIN3D 53vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 54#else 55return 0.0; 56#endif 57}float get_elevation(vec2 pos) { 58#ifdef TERRAIN3D 59vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; 60#else 61return 0.0; 62#endif 63}`),background:Se(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; 64#ifdef OVERDRAW_INSPECTOR 65gl_FragColor=vec4(1.0); 66#endif 67}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Se(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
67uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; 68#ifdef OVERDRAW_INSPECTOR 69gl_FragColor=vec4(1.0); 70#endif 71}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Se(`varying vec3 v_data;varying float v_visibility; 72#pragma mapbox: define highp vec4 color 73#pragma mapbox: define mediump float radius 74#pragma mapbox: define lowp float blur 75#pragma mapbox: define lowp float opacity 76#pragma mapbox: define highp vec4 stroke_color 77#pragma mapbox: define mediump float stroke_width 78#pragma mapbox: define lowp float stroke_opacity 79void main() { 80#pragma mapbox: initialize highp vec4 color 81#pragma mapbox: initialize mediump float radius 82#pragma mapbox: initialize lowp float blur 83#pragma mapbox: initialize lowp float opacity 84#pragma mapbox: initialize highp vec4 stroke_color 85#pragma mapbox: initialize mediump float stroke_width 86#pragma mapbox: initialize lowp float stroke_opacity 87vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); 88#ifdef OVERDRAW_INSPECTOR 89gl_FragColor=vec4(1.0); 90#endif 91}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; 92#pragma mapbox: define highp vec4 color 93#pragma mapbox: define mediump float radius 94#pragma mapbox: define lowp float blur 95#pragma mapbox: define lowp float opacity 96#pragma mapbox: define highp vec4 stroke_color 97#pragma mapbox: define mediump float stroke_width 98#pragma mapbox: define lowp float stroke_opacity 99void main(void) { 100#pragma mapbox: initialize highp vec4 color 101#pragma mapbox: initialize mediump float radius 102#pragma mapbox: initialize lowp float blur 103#pragma mapbox: initialize lowp float opacity 104#pragma mapbox: initialize highp vec4 stroke_color 105#pragma mapbox: initialize mediump float stroke_width 106#pragma mapbox: initialize lowp float stroke_opacity 107vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Se("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Se(`uniform highp float u_intensity;varying vec2 v_extrude; 108#pragma mapbox: define highp float weight 109#define GAUSS_COEF 0.3989422804014327 110void main() { 111#pragma mapbox: initialize highp float weight 112float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); 113#ifdef OVERDRAW_INSPECTOR 114gl_FragColor=vec4(1.0); 115#endif 116}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; 117#pragma mapbox: define highp float weight 118#pragma mapbox: define mediump float radius 119const highp float ZERO=1.0/255.0/16.0; 120#define GAUSS_COEF 0.3989422804014327 121void main(void) { 122#pragma mapbox: initialize highp float weight 123#pragma mapbox: initialize mediump float radius 124vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:Se(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; 125#ifdef OVERDRAW_INSPECTOR 126gl_FragColor=vec4(0.0); 127#endif 128}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Se("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Se("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Se("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Se(`#pragma mapbox: define highp vec4 color 129#pragma mapbox: define lowp float opacity 130void main() { 131#pragma mapbox: initialize highp vec4 color 132#pragma mapbox: initialize lowp float opacity 133gl_FragColor=color*opacity; 134#ifdef OVERDRAW_INSPECTOR 135gl_FragColor=vec4(1.0); 136#endif 137}`,`attribute vec2 a_pos;uniform mat4 u_matrix; 138#pragma mapbox: define highp vec4 color 139#pragma mapbox: define lowp float opacity 140void main() { 141#pragma mapbox: initialize highp vec4 color 142#pragma mapbox: initialize lowp float opacity 143gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Se(`varying vec2 v_pos; 144#pragma mapbox: define highp vec4 outline_color 145#pragma mapbox: define lowp float opacity 146void main() { 147#pragma mapbox: initialize highp vec4 outline_color 148#pragma mapbox: initialize lowp float opacity 149float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); 150#ifdef OVERDRAW_INSPECTOR 151gl_FragColor=vec4(1.0); 152#endif 153}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; 154#pragma mapbox: define highp vec4 outline_color 155#pragma mapbox: define lowp float opacity 156void main() { 157#pragma mapbox: initialize highp vec4 outline_color 158#pragma mapbox: initialize lowp float opacity 159gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Se(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; 160#pragma mapbox: define lowp float opacity 161#pragma mapbox: define lowp vec4 pattern_from 162#pragma mapbox: define lowp vec4 pattern_to 163void main() { 164#pragma mapbox: initialize lowp float opacity 165#pragma mapbox: initialize mediump vec4 pattern_from 166#pragma mapbox: initialize mediump vec4 pattern_to 167vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; 168#ifdef OVERDRAW_INSPECTOR 169gl_FragColor=vec4(1.0); 170#endif 171}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; 172#pragma mapbox: define lowp float opacity 173#pragma mapbox: define lowp vec4 pattern_from 174#pragma mapbox: define lowp vec4 pattern_to 175#pragma mapbox: define lowp float pixel_ratio_from 176#pragma mapbox: define lowp float pixel_ratio_to 177void main() { 178#pragma mapbox: initialize lowp float opacity 179#pragma mapbox: initialize mediump vec4 pattern_from 180#pragma mapbox: initialize mediump vec4 pattern_to 181#pragma mapbox: initialize lowp float pixel_ratio_from 182#pragma mapbox: initialize lowp float pixel_ratio_to 183vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Se(`#ifdef GL_ES 184precision highp float; 185#endif 186uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; 187#pragma mapbox: define lowp float opacity 188#pragma mapbox: define lowp vec4 pattern_from 189#pragma mapbox: define lowp vec4 pattern_to 190void main() { 191#pragma mapbox: initialize lowp float opacity 192#pragma mapbox: initialize mediump vec4 pattern_from 193#pragma mapbox: initialize mediump vec4 pattern_to 194vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; 195#ifdef OVERDRAW_INSPECTOR 196gl_FragColor=vec4(1.0); 197#endif 198}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; 199#pragma mapbox: define lowp float opacity 200#pragma mapbox: define lowp vec4 pattern_from 201#pragma mapbox: define lowp vec4 pattern_to 202#pragma mapbox: define lowp float pixel_ratio_from 203#pragma mapbox: define lowp float pixel_ratio_to 204void main() { 205#pragma mapbox: initialize lowp float opacity 206#pragma mapbox: initialize mediump vec4 pattern_from 207#pragma mapbox: initialize mediump vec4 pattern_to 208#pragma mapbox: initialize lowp float pixel_ratio_from 209#pragma mapbox: initialize lowp float pixel_ratio_to 210vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Se(`varying vec4 v_color;void main() {gl_FragColor=v_color; 211#ifdef OVERDRAW_INSPECTOR 212gl_FragColor=vec4(1.0); 213#endif 214}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; 215#ifdef TERRAIN3D 216attribute vec2 a_centroid; 217#endif 218varying vec4 v_color; 219#pragma mapbox: define highp float base 220#pragma mapbox: define highp float height 221#pragma mapbox: define highp vec4 color 222void main() { 223#pragma mapbox: initialize highp float base 224#pragma mapbox: initialize highp float height 225#pragma mapbox: initialize highp vec4 color 226vec3 normal=a_normal_ed.xyz; 227#ifdef TERRAIN3D 228float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 229#else 230float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 231#endif 232base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/
23216384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Se(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; 233#pragma mapbox: define lowp float base 234#pragma mapbox: define lowp float height 235#pragma mapbox: define lowp vec4 pattern_from 236#pragma mapbox: define lowp vec4 pattern_to 237#pragma mapbox: define lowp float pixel_ratio_from 238#pragma mapbox: define lowp float pixel_ratio_to 239void main() { 240#pragma mapbox: initialize lowp float base 241#pragma mapbox: initialize lowp float height 242#pragma mapbox: initialize mediump vec4 pattern_from 243#pragma mapbox: initialize mediump vec4 pattern_to 244#pragma mapbox: initialize lowp float pixel_ratio_from 245#pragma mapbox: initialize lowp float pixel_ratio_to 246vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; 247#ifdef OVERDRAW_INSPECTOR 248gl_FragColor=vec4(1.0); 249#endif 250}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; 251#ifdef TERRAIN3D 252attribute vec2 a_centroid; 253#endif 254varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; 255#pragma mapbox: define lowp float base 256#pragma mapbox: define lowp float height 257#pragma mapbox: define lowp vec4 pattern_from 258#pragma mapbox: define lowp vec4 pattern_to 259#pragma mapbox: define lowp float pixel_ratio_from 260#pragma mapbox: define lowp float pixel_ratio_to 261void main() { 262#pragma mapbox: initialize lowp float base 263#pragma mapbox: initialize lowp float height 264#pragma mapbox: initialize mediump vec4 pattern_from 265#pragma mapbox: initialize mediump vec4 pattern_to 266#pragma mapbox: initialize lowp float pixel_ratio_from 267#pragma mapbox: initialize lowp float pixel_ratio_to 268vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; 269#ifdef TERRAIN3D 270float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 271#else 272float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 273#endif 274base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 275? a_pos 276: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Se(`#ifdef GL_ES 277precision highp float; 278#endif 279uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); 280#ifdef OVERDRAW_INSPECTOR 281gl_FragColor=vec4(1.0); 282#endif 283}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Se(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; 284#define PI 3.141592653589793 285void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;
285float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; 286#ifdef OVERDRAW_INSPECTOR 287gl_FragColor=vec4(1.0); 288#endif 289}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Se(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; 290#pragma mapbox: define highp vec4 color 291#pragma mapbox: define lowp float blur 292#pragma mapbox: define lowp float opacity 293void main() { 294#pragma mapbox: initialize highp vec4 color 295#pragma mapbox: initialize lowp float blur 296#pragma mapbox: initialize lowp float opacity 297float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); 298#ifdef OVERDRAW_INSPECTOR 299gl_FragColor=vec4(1.0); 300#endif 301}`,` 302#define scale 0.015873016 303attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; 304#pragma mapbox: define highp vec4 color 305#pragma mapbox: define lowp float blur 306#pragma mapbox: define lowp float opacity 307#pragma mapbox: define mediump float gapwidth 308#pragma mapbox: define lowp float offset 309#pragma mapbox: define mediump float width 310void main() { 311#pragma mapbox: initialize highp vec4 color 312#pragma mapbox: initialize lowp float blur 313#pragma mapbox: initialize lowp float opacity 314#pragma mapbox: initialize mediump float gapwidth 315#pragma mapbox: initialize lowp float offset 316#pragma mapbox: initialize mediump float width 317float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 318#ifdef TERRAIN3D 319v_gamma_scale=1.0; 320#else 321float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 322#endif 323v_width2=vec2(outset,inset);}`),lineGradient:Se(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; 324#pragma mapbox: define lowp float blur 325#pragma mapbox: define lowp float opacity 326void main() { 327#pragma mapbox: initialize lowp float blur 328#pragma mapbox: initialize lowp float opacity 329float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); 330#ifdef OVERDRAW_INSPECTOR 331gl_FragColor=vec4(1.0); 332#endif 333}`,` 334#define scale 0.015873016 335attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; 336#pragma mapbox: define lowp float blur 337#pragma mapbox: define lowp float opacity 338#pragma mapbox: define mediump float gapwidth 339#pragma mapbox: define lowp float offset 340#pragma mapbox: define mediump float width 341void main() { 342#pragma mapbox: initialize lowp float blur 343#pragma mapbox: initialize lowp float opacity 344#pragma mapbox: initialize mediump float gapwidth 345#pragma mapbox: initialize lowp float offset 346#pragma mapbox: initialize mediump float width 347float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 348#ifdef TERRAIN3D 349v_gamma_scale=1.0; 350#else 351float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 352#endif 353v_width2=vec2(outset,inset);}`),linePattern:Se(`#ifdef GL_ES 354precision highp float; 355#endif 356uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; 357#pragma mapbox: define lowp vec4 pattern_from 358#pragma mapbox: define lowp vec4 pattern_to 359#pragma mapbox: define lowp float pixel_ratio_from 360#pragma mapbox: define lowp float pixel_ratio_to 361#pragma mapbox: define lowp float blur 362#pragma mapbox: define lowp float opacity 363void main() { 364#pragma mapbox: initialize mediump vec4 pattern_from 365#pragma mapbox: initialize mediump vec4 pattern_to 366#pragma mapbox: initialize lowp float pixel_ratio_from 367#pragma mapbox: initialize lowp float pixel_ratio_to 368#pragma mapbox: initialize lowp float blur 369#pragma mapbox: initialize lowp float opacity 370vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; 371#ifdef OVERDRAW_INSPECTOR 372gl_FragColor=vec4(1.0); 373#endif 374}`,` 375#define scale 0.015873016 376#define LINE_DISTANCE_SCALE 2.0 377attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; 378#pragma mapbox: define lowp float blur 379#pragma mapbox: define lowp float opacity 380#pragma mapbox: define lowp float offset 381#pragma mapbox: define mediump float gapwidth 382#pragma mapbox: define mediump float width 383#pragma mapbox: define lowp float floorwidth 384#pragma mapbox: define lowp vec4 pattern_from 385#pragma mapbox: define lowp vec4 pattern_to 386#pragma mapbox: define lowp float pixel_ratio_from 387#pragma mapbox: define lowp float pixel_ratio_to 388void main() { 389#pragma mapbox: initialize lowp float blur 390#pragma mapbox: initialize lowp float opacity 391#pragma mapbox: initialize lowp float offset 392#pragma mapbox: initialize mediump float gapwidth 393#pragma mapbox: initialize mediump float width 394#pragma mapbox: initialize lowp float floorwidth 395#pragma mapbox: initialize mediump vec4 pattern_from 396#pragma mapbox: initialize mediump vec4 pattern_to 397#pragma mapbox: initialize lowp float pixel_ratio_from 398#pragma mapbox: initialize lowp float pixel_ratio_to 399float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 400#ifdef TERRAIN3D 401v_gamma_scale=1.0; 402#else 403float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 404#endif 405v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Se(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
405uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; 406#pragma mapbox: define highp vec4 color 407#pragma mapbox: define lowp float blur 408#pragma mapbox: define lowp float opacity 409#pragma mapbox: define mediump float width 410#pragma mapbox: define lowp float floorwidth 411void main() { 412#pragma mapbox: initialize highp vec4 color 413#pragma mapbox: initialize lowp float blur 414#pragma mapbox: initialize lowp float opacity 415#pragma mapbox: initialize mediump float width 416#pragma mapbox: initialize lowp float floorwidth 417float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); 418#ifdef OVERDRAW_INSPECTOR 419gl_FragColor=vec4(1.0); 420#endif 421}`,` 422#define scale 0.015873016 423#define LINE_DISTANCE_SCALE 2.0 424attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; 425#pragma mapbox: define highp vec4 color 426#pragma mapbox: define lowp float blur 427#pragma mapbox: define lowp float opacity 428#pragma mapbox: define mediump float gapwidth 429#pragma mapbox: define lowp float offset 430#pragma mapbox: define mediump float width 431#pragma mapbox: define lowp float floorwidth 432void main() { 433#pragma mapbox: initialize highp vec4 color 434#pragma mapbox: initialize lowp float blur 435#pragma mapbox: initialize lowp float opacity 436#pragma mapbox: initialize mediump float gapwidth 437#pragma mapbox: initialize lowp float offset 438#pragma mapbox: initialize mediump float width 439#pragma mapbox: initialize lowp float floorwidth 440float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; 441#ifdef TERRAIN3D 442v_gamma_scale=1.0; 443#else 444float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 445#endif 446v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Se(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 447#ifdef OVERDRAW_INSPECTOR 448gl_FragColor=vec4(1.0); 449#endif 450}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Se(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; 451#pragma mapbox: define lowp float opacity 452void main() { 453#pragma mapbox: initialize lowp float opacity 454lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; 455#ifdef OVERDRAW_INSPECTOR 456gl_FragColor=vec4(1.0); 457#endif 458}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} 459#pragma mapbox: define lowp float opacity 460void main() { 461#pragma mapbox: initialize lowp float opacity 462vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 463camera_to_anchor_distance/u_camera_to_center_distance : 464u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Se(`#define SDF_PX 8.0 465uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; 466#pragma mapbox: define highp vec4 fill_color 467#pragma mapbox: define highp vec4 halo_color 468#pragma mapbox: define lowp float opacity 469#pragma mapbox: define lowp float halo_width 470#pragma mapbox: define lowp float halo_blur 471void main() { 472#pragma mapbox: initialize highp vec4 fill_color 473#pragma mapbox: initialize highp vec4 halo_color 474#pragma mapbox: initialize lowp float opacity 475#pragma mapbox: initialize lowp float halo_width 476#pragma mapbox: initialize lowp float halo_blur 477float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); 478#ifdef OVERDRAW_INSPECTOR 479gl_FragColor=vec4(1.0); 480#endif 481}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} 482#pragma mapbox: define highp vec4 fill_color 483#pragma mapbox: define highp vec4 halo_color 484#pragma mapbox: define lowp float opacity 485#pragma mapbox: define lowp float halo_width 486#pragma mapbox: define lowp float halo_blur 487void main() { 488#pragma mapbox: initialize highp vec4 fill_color 489#pragma mapbox: initialize highp vec4 halo_color 490#pragma mapbox: initialize lowp float opacity 491#pragma mapbox: initialize lowp float halo_width 492#pragma mapbox: initialize lowp float halo_blur 493vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 494camera_to_anchor_distance/u_camera_to_center_distance : 495u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Se(`#define SDF_PX 8.0 496#define SDF 1.0 497#define ICON 0.0 498uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; 499#pragma mapbox: define highp vec4 fill_color 500#pragma mapbox: define highp vec4 halo_color 501#pragma mapbox: define lowp float opacity 502#pragma mapbox: define lowp float halo_width 503#pragma mapbox: define lowp float halo_blur 504void main() { 505#pragma mapbox: initialize highp vec4 fill_color 506#pragma mapbox: initialize highp vec4 halo_color 507#pragma mapbox: initialize lowp float opacity 508#pragma mapbox: initialize lowp float halo_width 509#pragma mapbox: initialize lowp float halo_blur 510float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
510gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; 511#ifdef OVERDRAW_INSPECTOR 512gl_FragColor=vec4(1.0); 513#endif 514return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); 515#ifdef OVERDRAW_INSPECTOR 516gl_FragColor=vec4(1.0); 517#endif 518}`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} 519#pragma mapbox: define highp vec4 fill_color 520#pragma mapbox: define highp vec4 halo_color 521#pragma mapbox: define lowp float opacity 522#pragma mapbox: define lowp float halo_width 523#pragma mapbox: define lowp float halo_blur 524void main() { 525#pragma mapbox: initialize highp vec4 fill_color 526#pragma mapbox: initialize highp vec4 halo_color 527#pragma mapbox: initialize lowp float opacity 528#pragma mapbox: initialize lowp float halo_width 529#pragma mapbox: initialize lowp float halo_blur 530vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 531camera_to_anchor_distance/u_camera_to_center_distance : 532u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Se("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
532float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Se("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Se("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:Se("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Se(d,t){const s=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),l=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),u=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=u?u.concat(l):l,x={};return{fragmentSource:d=d.replace(s,(w,S,C,A,B)=>(x[B]=!0,S==="define"?` 533#ifndef HAS_UNIFORM_u_${B} 534varying ${C} ${A} ${B}; 535#else 536uniform ${C} ${A} u_${B}; 537#endif 538`:` 539#ifdef HAS_UNIFORM_u_${B} 540 ${C} ${A} ${B} = u_${B}; 541#endif 542`)),vertexSource:t=t.replace(s,(w,S,C,A,B)=>{const Z=A==="float"?"vec2":"vec4",U=B.match(/color/)?"color":Z;return x[B]?S==="define"?` 543#ifndef HAS_UNIFORM_u_${B} 544uniform lowp float u_${B}_t; 545attribute ${C} ${Z} a_${B}; 546varying ${C} ${A} ${B}; 547#else 548uniform ${C} ${A} u_${B}; 549#endif 550`:U==="vec4"?` 551#ifndef HAS_UNIFORM_u_${B} 552 ${B} = a_${B}; 553#else 554 ${C} ${A} ${B} = u_${B}; 555#endif 556`:` 557#ifndef HAS_UNIFORM_u_${B} 558 ${B} = unpack_mix_${U}(a_${B}, u_${B}_t); 559#else 560 ${C} ${A} ${B} = u_${B}; 561#endif 562`:S==="define"?` 563#ifndef HAS_UNIFORM_u_${B} 564uniform lowp float u_${B}_t; 565attribute ${C} ${Z} a_${B}; 566#else 567uniform ${C} ${A} u_${B}; 568#endif 569`:U==="vec4"?` 570#ifndef HAS_UNIFORM_u_${B} 571 ${C} ${A} ${B} = a_${B}; 572#else 573 ${C} ${A} ${B} = u_${B}; 574#endif 575`:` 576#ifndef HAS_UNIFORM_u_${B} 577 ${C} ${A} ${B} = unpack_mix_${U}(a_${B}, u_${B}_t); 578#else 579 ${C} ${A} ${B} = u_${B}; 580#endif 581`}),staticAttributes:a,staticUniforms:y}}class pr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,s,a,l,u,y,x,w,S){this.context=t;let C=this.boundPaintVertexBuffers.length!==l.length;for(let A=0;!C&&A<l.length;A++)this.boundPaintVertexBuffers[A]!==l[A]&&(C=!0);!this.vao||this.boundProgram!==s||this.boundLayoutVertexBuffer!==a||C||this.boundIndexBuffer!==u||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==x||this.boundDynamicVertexBuffer2!==w||this.boundDynamicVertexBuffer3!==S?this.freshBind(s,a,l,u,y,x,w,S):(t.bindVertexArray.set(this.vao),x&&x.bind(),u&&u.dynamicDraw&&u.bind(),w&&w.bind(),S&&S.bind())}freshBind(t,s,a,l,u,y,x,w){const S=t.numAttributes,C=this.context,A=C.gl;this.vao&&this.destroy(),this.vao=C.createVertexArray(),C.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=s,this.boundPaintVertexBuffers=a,this.boundIndexBuffer=l,this.boundVertexOffset=u,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=x,this.boundDynamicVertexBuffer3=w,s.enableAttributes(A,t);for(const B of a)B.enableAttributes(A,t);y&&y.enableAttributes(A,t),x&&x.enableAttributes(A,t),w&&w.enableAttributes(A,t),s.bind(),s.setVertexAttribPointers(A,t,u);for(const B of a)B.bind(),B.setVertexAttribPointers(A,t,u);y&&(y.bind(),y.setVertexAttribPointers(A,t,u)),l&&l.bind(),x&&(x.bind(),x.setVertexAttribPointers(A,t,u)),w&&(w.bind(),w.setVertexAttribPointers(A,t,u)),C.currentNumAttributes=S}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ni=(d,t,s,a,l)=>({u_matrix:d,u_texture:0,u_ele_delta:t,u_fog_matrix:s,u_fog_color:a?a.properties.get("fog-color"):m.aM.white,u_fog_ground_blend:a?a.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?a.calculateFogBlendOpacity(l):0,u_horizon_color:a?a.properties.get("horizon-color"):m.aM.white,u_horizon_fog_blend:a?a.properties.get("horizon-fog-blend"):1});function xn(d){const t=[];for(let s=0;s<d.length;s++){if(d[s]===null)continue;const a=d[s].split(" ");t.push(a.pop())}return t}class Kr{constructor(t,s,a,l,u,y){const x=t.gl;this.program=x.createProgram();const w=xn(s.staticAttributes),S=a?a.getBinderAttributes():[],C=w.concat(S),A=Cr.prelude.staticUniforms?xn(Cr.prelude.staticUniforms):[],B=s.staticUniforms?xn(s.staticUniforms):[],Z=a?a.getBinderUniforms():[],U=A.concat(B).concat(Z),G=[];for(const ht of U)G.indexOf(ht)<0&&G.push(ht);const X=a?a.defines():[];u&&X.push("#define OVERDRAW_INSPECTOR;"),y&&X.push("#define TERRAIN3D;");const K=X.concat(Cr.prelude.fragmentSource,s.fragmentSource).join(` 582`),Q=X.concat(Cr.prelude.vertexSource,s.vertexSource).join(` 583`),j=x.createShader(x.FRAGMENT_SHADER);if(x.isContextLost())return void(this.failedToCreate=!0);if(x.shaderSource(j,K),x.compileShader(j),!x.getShaderParameter(j,x.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${x.getShaderInfoLog(j)}`);x.attachShader(this.program,j);const nt=x.createShader(x.VERTEX_SHADER);if(x.isContextLost())return void(this.failedToCreate=!0);if(x.shaderSource(nt,Q),x.compileShader(nt),!x.getShaderParameter(nt,x.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${x.getShaderInfoLog(nt)}`);x.attachShader(this.program,nt),this.attributes={};const rt={};this.numAttributes=C.length;for(let ht=0;ht<this.numAttributes;ht++)C[ht]&&(x.bindAttribLocation(this.program,ht,C[ht]),this.attributes[C[ht]]=ht);if(x.linkProgram(this.program),!x.getProgramParameter(this.program,x.LINK_STATUS))throw new Error(`Program failed to link: ${x.getProgramInfoLog(this.program)}`);x.deleteShader(nt),x.deleteShader(j);for(let ht=0;ht<G.length;ht++){const yt=G[ht];if(yt&&!rt[yt]){const Tt=x.getUniformLocation(this.program,yt);Tt&&(rt[yt]=Tt)}}this.fixedUniforms=l(t,rt),this.terrainUniforms=((ht,yt)=>({u_depth:new m.aH(ht,yt.u_depth),u_terrain:new m.aH(ht,yt.u_terrain),u_terrain_dim:new m.aI(ht,yt.u_terrain_dim),u_terrain_matrix:new m.aJ(ht,yt.u_terrain_matrix),u_terrain_unpack:new m.aK(ht,yt.u_terrain_unpack),u_terrain_exaggeration:new m.aI(ht,yt.u_terrain_exaggeration)}))(t,rt),this.binderUniforms=a?a.getUniforms(t,rt):[]}draw(t,s,a,l,u,y,x,w,S,C,A,B,Z,U,G,X,K,Q){const j=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(l),t.setColorMode(u),t.setCullFace(y),w){t.activeTexture.set(j.TEXTURE2),j.bindTexture(j.TEXTURE_2D,w.depthTexture),t.activeTexture.set(j.TEXTURE3),j.bindTexture(j.TEXTURE_2D,w.texture);for(const rt in this.terrainUniforms)this.terrainUniforms[rt].set(w[rt])}for(const rt in this.fixedUniforms)this.fixedUniforms[rt].set(x[rt]);G&&G.setUniforms(t,this.binderUniforms,Z,{zoom:U});let nt=0;switch(s){case j.LINES:nt=2;break;case j.TRIANGLES:nt=3;break;case j.LINE_STRIP:nt=1}for(const rt of B.get()){const ht=rt.vaos||(rt.vaos={});(ht[S]||(ht[S]=new pr)).bind(t,this,C,G?G.getPaintVertexBuffers():[],A,rt.vertexOffset,X,K,Q),j.drawElements(s,rt.primitiveLength*nt,j.UNSIGNED_SHORT,rt.primitiveOffset*nt*2)}}}function Ar(d,t,s){const a=1/me(s,1,t.transform.tileZoom),l=Math.pow(2,s.tileID.overscaledZ
vendor: 4,267 bytes, line 583
583),u=s.tileSize*Math.pow(2,t.transform.tileZoom)/l,y=u*(s.tileID.canonical.x+s.tileID.wrap*l),x=u*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture.size,u_scale:[a,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[y>>16,x>>16],u_pixel_coord_lower:[65535&y,65535&x]}}const Jr=(d,t,s,a)=>{const l=t.style.light,u=l.properties.get("position"),y=[u.x,u.y,u.z],x=function(){var S=new m.A(9);return m.A!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1,S}();l.properties.get("anchor")==="viewport"&&function(S,C){var A=Math.sin(C),B=Math.cos(C);S[0]=B,S[1]=A,S[2]=0,S[3]=-A,S[4]=B,S[5]=0,S[6]=0,S[7]=0,S[8]=1}(x,-t.transform.angle),function(S,C,A){var B=C[0],Z=C[1],U=C[2];S[0]=B*A[0]+Z*A[3]+U*A[6],S[1]=B*A[1]+Z*A[4]+U*A[7],S[2]=B*A[2]+Z*A[5]+U*A[8]}(y,y,x);const w=l.properties.get("color");return{u_matrix:d,u_lightpos:y,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+s,u_opacity:a}},kr=(d,t,s,a,l,u,y)=>m.e(Jr(d,t,s,a),Ar(u,t,y),{u_height_factor:-Math.pow(2,l.overscaledZ)/y.tileSize/8}),zr=d=>({u_matrix:d}),lo=(d,t,s,a)=>m.e(zr(d),Ar(s,t,a)),ho=(d,t)=>({u_matrix:d,u_world:t}),co=(d,t,s,a,l)=>m.e(lo(d,t,s,a),{u_world:l}),Ko=(d,t,s,a)=>{const l=d.transform;let u,y;if(a.paint.get("circle-pitch-alignment")==="map"){const x=me(s,1,l.zoom);u=!0,y=[x,x]}else u=!1,y=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:d.translatePosMatrix(t.posMatrix,s,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+u,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:y}},$n=(d,t,s)=>({u_matrix:d,u_inv_matrix:t,u_camera_to_center_distance:s.cameraToCenterDistance,u_viewport_size:[s.width,s.height]}),Ts=(d,t,s=1)=>({u_matrix:d,u_color:t,u_overlay:0,u_overlay_scale:s}),Ci=d=>({u_matrix:d}),$i=(d,t,s,a)=>({u_matrix:d,u_extrude_scale:me(t,1,s),u_intensity:a}),oe=(d,t,s,a)=>{const l=m.H();m.aP(l,0,d.width,d.height,0,0,1);const u=d.context.gl;return{u_matrix:l,u_world:[u.drawingBufferWidth,u.drawingBufferHeight],u_image:s,u_color_ramp:a,u_opacity:t.paint.get("heatmap-opacity")}};function hn(d,t){const s=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new m.Z(0,a/s).toLngLat().lat,new m.Z(0,(a+1)/s).toLngLat().lat]}const Re=(d,t,s,a)=>{const l=d.transform;return{u_matrix:Lr(d,t,s,a),u_ratio:1/me(t,1,l.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},Jo=(d,t,s,a,l)=>m.e(Re(d,t,s,l),{u_image:0,u_image_height:a}),Er=(d,t,s,a,l)=>{const u=d.transform,y=uo(t,u);return{u_matrix:Lr(d,t,s,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/me(t,1,u.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[y,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},Yo=(d,t,s,a,l,u)=>{const y=d.lineAtlas,x=uo(t,d.transform),w=s.layout.get("line-cap")==="round",S=y.getDash(a.from,w),C=y.getDash(a.to,w),A=S.width*l.fromScale,B=C.width*l.toScale;return m.e(Re(d,t,s,u),{u_patternscale_a:[x/A,-S.height/2],u_patternscale_b:[x/B,-C.height/2],u_sdfgamma:y.width/(256*Math.min(A,B)*d.pixelRatio)/2,u_image:0,u_tex_y_a:S.y,u_tex_y_b:C.y,u_mix:l.t})};function uo(d,t){return 1/me(d,1,t.tileZoom)}function Lr(d,t,s,a){return d.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const Qo=(d,t,s,a,l)=>{return{u_matrix:d,u_tl_parent:t,u_scale_parent:s,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(y=l.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(u=l.paint.get("raster-contrast"),u>0?1/(1-u):1+u),u_spin_weights:$s(l.paint.get("raster-hue-rotate"))};var u,y};function $s(d){d*=Math.PI/180;const t=Math.sin(d),s=Math.cos(d);return[(2*s+1)/3,(-Math.sqrt(3)*t-s+1)/3,(Math.sqrt(3)*t-s+1)/3]}const vi=(d,t,s,a,l,u,y,x,w,S,C,A,B,Z)=>{const U=y.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="c
583amera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:U.cameraToCenterDistance,u_pitch:U.pitch/360*2*Math.PI,u_rotate_symbol:+s,u_aspect_ratio:U.width/U.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:x,u_label_plane_matrix:w,u_coord_matrix:S,u_is_text:+A,u_pitch_with_map:+a,u_is_along_line:l,u_is_variable_anchor:u,u_texsize:B,u_texture:0,u_translation:C,u_pitched_scale:Z}},Ln=(d,t,s,a,l,u,y,x,w,S,C,A,B,Z,U)=>{const G=y.transform;return m.e(vi(d,t,s,a,l,u,y,x,w,S,C,A,B,U),{u_gamma_scale:a?Math.cos(G._pitch)*G.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:1})},po=(d,t,s,a,l,u,y,x,w,S,C,A,B,Z)=>m.e(Ln(d,t,s,a,l,u,y,x,w,S,C,!0,A,!0,Z),{u_texsize_icon:B,u_texture_icon:1}),Gs=(d,t,s)=>({u_matrix:d,u_opacity:t,u_color:s}),ta=(d,t,s,a,l,u)=>m.e(function(y,x,w,S){const C=w.imageManager.getPattern(y.from.toString()),A=w.imageManager.getPattern(y.to.toString()),{width:B,height:Z}=w.imageManager.getPixelSize(),U=Math.pow(2,S.tileID.overscaledZ),G=S.tileSize*Math.pow(2,w.transform.tileZoom)/U,X=G*(S.tileID.canonical.x+S.tileID.wrap*U),K=G*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:C.tl,u_pattern_br_a:C.br,u_pattern_tl_b:A.tl,u_pattern_br_b:A.br,u_texsize:[B,Z],u_mix:x.t,u_pattern_size_a:C.displaySize,u_pattern_size_b:A.displaySize,u_scale_a:x.fromScale,u_scale_b:x.toScale,u_tile_units_to_pixels:1/me(S,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,K>>16],u_pixel_coord_lower:[65535&X,65535&K]}}(a,u,s,l),{u_matrix:d,u_opacity:t}),fo={fillExtrusion:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_lightpos:new m.aN(d,t.u_lightpos),u_lightintensity:new m.aI(d,t.u_lightintensity),u_lightcolor:new m.aN(d,t.u_lightcolor),u_vertical_gradient:new m.aI(d,t.u_vertical_gradient),u_opacity:new m.aI(d,t.u_opacity)}),fillExtrusionPattern:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_lightpos:new m.aN(d,t.u_lightpos),u_lightintensity:new m.aI(d,t.u_lightintensity),u_lightcolor:new m.aN(d,t.u_lightcolor),u_vertical_gradient:new m.aI(d,t.u_vertical_gradient),u_height_factor:new m.aI(d,t.u_height_factor),u_image:new m.aH(d,t.u_image),u_texsize:new m.aO(d,t.u_texsize),u_pixel_coord_upper:new m.aO(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new m.aO(d,t.u_pixel_coord_lower),u_scale:new m.aN(d,t.u_scale),u_fade:new m.aI(d,t.u_fade),u_opacity:new m.aI(d,t.u_opacity)}),fill:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix)}),fillPattern:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_image:new m.aH(d,t.u_image),u_texsize:new m.aO(d,t.u_texsize),u_pixel_coord_upper:new m.aO(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new m.aO(d,t.u_pixel_coord_lower),u_scale:new m.aN(d,t.u_scale),u_fade:new m.aI(d,t.u_fade)}),fillOutline:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_world:new m.aO(d,t.u_world)}),fillOutlinePattern:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_world:new m.aO(d,t.u_world),u_image:new m.aH(d,t.u_image),u_texsize:new m.aO(d,t.u_texsize),u_pixel_coord_upper:new m.aO(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new m.aO(d,t.u_pixel_coord_lower),u_scale:new m.aN(d,t.u_scale),u_fade:new m.aI(d,t.u_fade)}),circle:(d,t)=>({u_camera_to_center_distance:new m.aI(d,t.u_camera_to_center_distance),u_scale_with_map:new m.aH(d,t.u_scale_with_map),u_pitch_with_map:new m.aH(d,t.u_pitch_with_map),u_extrude_scale:new m.aO(d,t.u_extrude_scale),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_matrix:new m.aJ(d,t.u_matrix)}),collisionBox:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_pixel_extrude_scale:new m.aO(d,t.u_pixel_extrude_scale)}),collisionCircle:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_inv_matrix:new m.aJ(d,t.u_inv_matrix),u_camera_to_center_distance:new m.aI(d,t.u_camera_to_center_distance),u_viewport_size:new m.aO(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new m.aL(d,t.u_color),u_matrix:new m.aJ(d,t.u_matrix),u_overlay:new m.aH(d,t.u_overlay),u_overlay_scale:new m.aI(d,t.u_overlay_scale)}),clippingMask:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix)}),heatmap:(d,t)=>({u_extrude_scale:new m.aI(d,t.u_extrude_scale),u_intensity:new m.aI(d,t.u_intensity),u_matrix:new m.aJ(d,t.u_matrix)}),heatmapTexture:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_world:new m.aO(d,t.u_world),u_image:new m.aH(d,t.u_image),u_color_ramp:new m.aH(d,t.u_color_ramp),u_opacity:new m.aI(d,t.u_opacity)}),hillshade:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_image:new m.aH(d,t.u_image),u_latrange:new m.aO(d,t.u_latrange),u_light:new m.aO(d,t.u_light),u_shadow:new m.aL(d,t.u_shadow),u_highlight:new m.aL(d,t.u_highlight),u_accent:new m.aL(d,t.u_accent)}),hillshadePrepare:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_image:new m.aH(d,t.u_image),u_dimension:new m.aO(d,t.u_dimension),u_zoom:new m.aI(d,t.u_zoom),u_unpack:new m.aK(d,t.u_unpack)}),line:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_ratio:new m.aI(d,t.u_ratio),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_units_to_pixels:new m.aO(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_ratio:new m.aI(d,t.u_ratio),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_units_to_pixels:new m.aO(d,t.u_units_to_pixels),u_image:new m.aH(d,t.u_image),u_image_height:new m.aI(d,t.u_image_height)}),linePattern:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_texsize:new m.aO(d,t.u_texsize),u_ratio:new m.aI(d,t.u_ratio),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_image:new m.aH(d,t.u_image),u_units_to_pixels:new m.aO(d,t.u_units_to_pixels),u_scale:new m.aN(d,t.u_scale),u_fade:new m.aI(d,t.u_fade)}),lineSDF:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_ratio:new m.aI(d,t.u_ratio),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_units_to_pixels:new m.aO(d,t.u_units_to_pixels),u_patternscale_a:new m.aO(d,t.u_patternscale_a),u_patternscale_b:new m.aO(d,t.u_patternscale_b),u_sdfgamma:new m.aI(d,t.u_sdfgamma),u_image:new m.aH(d,t.u_image),u_tex_y_a:new m.aI(d,t.u_tex_y_a),u_tex_y_b:new m.aI(d,t.u_tex_y_b),u_mix:new m.aI(d,t.u_mix)}),raster:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_tl_parent:new m.aO(d,t.u_tl_parent),u_scale_parent:new m.aI(d,t.u_scale_parent),u_buffer_scale:new m.aI(d,t.u_buffer_scale),u_fade_t:new m.aI(d,t.u_fade_t),u_opacity:new m.aI(d,t.u_opacity),u_image0:new m.aH(d,t.u_image0),u_image1:new m.aH(d,t.u_image1),u_brightness_low:new m.aI(d,t.u_brightness_low),u_brightness_high:new m.aI(d,t.u_brightness_high),u_saturation_factor:new m.aI(d,t.u_saturation_factor),u_contrast_factor:new m.aI(d,t.u_contrast_factor),u_spin_weights:new m.aN(d,t.u_spin_weights)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new m.aH(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new m.aH(d,t.u_is_size_feature_constant),u_size_t:new m.aI(d,t.u_size_t),u_size:new m.aI(d,t.u_size),u_camera_to_center_distance:new m.aI(d,t.u_camera_to_center_distance),u_pitch:new m.aI(d,t.u_pitch),u_rotate_symbol:new m.aH(d,t.u_rotate_symbol),u_aspect_ratio:new m.aI(d,t.u_aspect_ratio),u_fade_change:new m.aI(d,t.u_fade_change),u_matrix:new m.aJ(d,t.u_matrix),u_label_plane_matrix:new m.aJ(d,t.u_label_plane_matrix
vendor: 19,789 bytes, line 583
583),u_coord_matrix:new m.aJ(d,t.u_coord_matrix),u_is_text:new m.aH(d,t.u_is_text),u_pitch_with_map:new m.aH(d,t.u_pitch_with_map),u_is_along_line:new m.aH(d,t.u_is_along_line),u_is_variable_anchor:new m.aH(d,t.u_is_variable_anchor),u_texsize:new m.aO(d,t.u_texsize),u_texture:new m.aH(d,t.u_texture),u_translation:new m.aO(d,t.u_translation),u_pitched_scale:new m.aI(d,t.u_pitched_scale)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new m.aH(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new m.aH(d,t.u_is_size_feature_constant),u_size_t:new m.aI(d,t.u_size_t),u_size:new m.aI(d,t.u_size),u_camera_to_center_distance:new m.aI(d,t.u_camera_to_center_distance),u_pitch:new m.aI(d,t.u_pitch),u_rotate_symbol:new m.aH(d,t.u_rotate_symbol),u_aspect_ratio:new m.aI(d,t.u_aspect_ratio),u_fade_change:new m.aI(d,t.u_fade_change),u_matrix:new m.aJ(d,t.u_matrix),u_label_plane_matrix:new m.aJ(d,t.u_label_plane_matrix),u_coord_matrix:new m.aJ(d,t.u_coord_matrix),u_is_text:new m.aH(d,t.u_is_text),u_pitch_with_map:new m.aH(d,t.u_pitch_with_map),u_is_along_line:new m.aH(d,t.u_is_along_line),u_is_variable_anchor:new m.aH(d,t.u_is_variable_anchor),u_texsize:new m.aO(d,t.u_texsize),u_texture:new m.aH(d,t.u_texture),u_gamma_scale:new m.aI(d,t.u_gamma_scale),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_is_halo:new m.aH(d,t.u_is_halo),u_translation:new m.aO(d,t.u_translation),u_pitched_scale:new m.aI(d,t.u_pitched_scale)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new m.aH(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new m.aH(d,t.u_is_size_feature_constant),u_size_t:new m.aI(d,t.u_size_t),u_size:new m.aI(d,t.u_size),u_camera_to_center_distance:new m.aI(d,t.u_camera_to_center_distance),u_pitch:new m.aI(d,t.u_pitch),u_rotate_symbol:new m.aH(d,t.u_rotate_symbol),u_aspect_ratio:new m.aI(d,t.u_aspect_ratio),u_fade_change:new m.aI(d,t.u_fade_change),u_matrix:new m.aJ(d,t.u_matrix),u_label_plane_matrix:new m.aJ(d,t.u_label_plane_matrix),u_coord_matrix:new m.aJ(d,t.u_coord_matrix),u_is_text:new m.aH(d,t.u_is_text),u_pitch_with_map:new m.aH(d,t.u_pitch_with_map),u_is_along_line:new m.aH(d,t.u_is_along_line),u_is_variable_anchor:new m.aH(d,t.u_is_variable_anchor),u_texsize:new m.aO(d,t.u_texsize),u_texsize_icon:new m.aO(d,t.u_texsize_icon),u_texture:new m.aH(d,t.u_texture),u_texture_icon:new m.aH(d,t.u_texture_icon),u_gamma_scale:new m.aI(d,t.u_gamma_scale),u_device_pixel_ratio:new m.aI(d,t.u_device_pixel_ratio),u_is_halo:new m.aH(d,t.u_is_halo),u_translation:new m.aO(d,t.u_translation),u_pitched_scale:new m.aI(d,t.u_pitched_scale)}),background:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_opacity:new m.aI(d,t.u_opacity),u_color:new m.aL(d,t.u_color)}),backgroundPattern:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_opacity:new m.aI(d,t.u_opacity),u_image:new m.aH(d,t.u_image),u_pattern_tl_a:new m.aO(d,t.u_pattern_tl_a),u_pattern_br_a:new m.aO(d,t.u_pattern_br_a),u_pattern_tl_b:new m.aO(d,t.u_pattern_tl_b),u_pattern_br_b:new m.aO(d,t.u_pattern_br_b),u_texsize:new m.aO(d,t.u_texsize),u_mix:new m.aI(d,t.u_mix),u_pattern_size_a:new m.aO(d,t.u_pattern_size_a),u_pattern_size_b:new m.aO(d,t.u_pattern_size_b),u_scale_a:new m.aI(d,t.u_scale_a),u_scale_b:new m.aI(d,t.u_scale_b),u_pixel_coord_upper:new m.aO(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new m.aO(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new m.aI(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_texture:new m.aH(d,t.u_texture),u_ele_delta:new m.aI(d,t.u_ele_delta),u_fog_matrix:new m.aJ(d,t.u_fog_matrix),u_fog_color:new m.aL(d,t.u_fog_color),u_fog_ground_blend:new m.aI(d,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new m.aI(d,t.u_fog_ground_blend_opacity),u_horizon_color:new m.aL(d,t.u_horizon_color),u_horizon_fog_blend:new m.aI(d,t.u_horizon_fog_blend)}),terrainDepth:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_ele_delta:new m.aI(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_matrix:new m.aJ(d,t.u_matrix),u_texture:new m.aH(d,t.u_texture),u_terrain_coords_id:new m.aI(d,t.u_terrain_coords_id),u_ele_delta:new m.aI(d,t.u_ele_delta)}),sky:(d,t)=>({u_sky_color:new m.aL(d,t.u_sky_color),u_horizon_color:new m.aL(d,t.u_horizon_color),u_horizon:new m.aI(d,t.u_horizon),u_sky_horizon_blend:new m.aI(d,t.u_sky_horizon_blend)})};class bn{constructor(t,s,a){this.context=t;const l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const s=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const hl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class mo{constructor(t,s,a,l){this.length=s.length,this.attributes=a,this.itemSize=s.bytesPerElement,this.dynamicDraw=l,this.context=t;const u=t.gl;this.buffer=u.createBuffer(),t.bindVertexBuffer.set(this.buffer),u.bufferData(u.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,s){for(let a=0;a<this.attributes.length;a++){const l=s.attributes[this.attributes[a].name];l!==void 0&&t.enableVertexAttribArray(l)}}setVertexAttribPointers(t,s,a){for(let l=0;l<this.attributes.length;l++){const u=this.attributes[l],y=s.attributes[u.name];y!==void 0&&t.vertexAttribPointer(y,u.components,t[hl[u.type]],!1,this.itemSize,u.offset+this.itemSize*(a||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const _e=new WeakMap;function Dr(d){var t;if(_e.has(d))return _e.get(d);{const s=(t=d.getParameter(d.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return _e.set(d,s),s}}class ue{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Br extends ue{getDefault(){return m.aM.transparent}set(t){const s=this.current;(t.r!==s.r||t.g!==s.g||t.b!==s.b||t.a!==s.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Aa extends ue{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Ps extends ue{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class ea extends ue{getDefault(){return[!0,!0,!0,!0]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||t[3]!==s[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ka extends ue{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class za extends ue{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Ea extends ue{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const s=this.current;(t.func!==s.func||t.ref!==s.ref||t.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class ia extends ue{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class _o extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=t,this.dirty=!1}}class La extends ue{getDefault(){return[0,1]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Dn extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=t,this.dirty=!1}}class Da extends ue{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Rr extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.BLEND):s.disable(s.BLEND),this.current=t,this.dirty=!1}}class fr extends ue{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ba extends ue{getDefault(){return m.aM.transparent}set(t){const s=this.current;(t.r!==s.r||t.g!==s.g||t.b!==s.b||t.a!==s.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class na extends ue{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Yr extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;t?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=t,this.dirty=!1}}class cl extends ue{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Hs extends ue{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Ra extends ue{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class ul extends ue{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Fa extends ue{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const s=this.current;(t[0]!==s[0]||t[1]!==s[1]||t[2]!==s[2]||t[3]!==s[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class go extends ue{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Oa extends ue{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class yo extends ue{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class ra extends ue{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Qr extends ue{getDefault(){return null}set(t){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ri extends ue{getDefault(){return null}set(t){var s;if(t===this.current&&!this.dirty)return;const a=this.gl;Dr(a)?a.bindVertexArray(t):(s=a.getExtension("OES_vertex_array_object"))===null||s===void 0||s.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class sa extends ue{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class ts extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Gi extends ue{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Ws extends ue{constructor(t,s){super(t),this.context=t,this.parent=s}getDefault(){return null}}class vo extends Ws{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class es extends Ws{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Xs extends Ws{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class oa{constructor(t,s,a,l,u){this.context=t,this.width=s,this.height=a;const y=t.gl,x=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new vo(t,x),l)this.depthAttachment=u?new Xs(t,x):new es(t,x);else if(u)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,s=this.colorAttachment.get();if(s&&t.deleteTexture(s),this.depthAttachment){const a=this.depthAttachment.get();a&&t.deleteRenderbuffer(a)}t.deleteFramebuffer(this.framebuffer)}}class ri{constructor(t,s,a){this.blendFunction=t,this.blendColor=s,this.mask=a}}ri.Replace=[1,0],ri.disabled=new ri(ri.Replace,m.aM.transparent,[!1,!1,!1,!1]),ri.unblended=new ri(ri.Replace,m.aM.transparent,[!0,!0,!0,!0]),ri.alphaBlended=new ri([1,771],m.aM.transparent,[!0,!0,!0,!0]);class dl{constructor(t){var s,a;if(this.gl=t,this.clearColor=new Br(this),this.clearDepth=new Aa(this),this.clearStencil=new Ps(this),this.colorMask=new ea(this),this.depthMask=new ka(this),this.stencilMask=new za(this),this.stencilFunc=new Ea(this),this.stencilOp=new ia(this),this.stencilTest=new _o(this),this.depthRange=new La(this),this.depthTest=new Dn(this),this.depthFunc=new Da(this),this.blend=new Rr(this),this.blendFunc=new fr(this),this.blendColor=new Ba(this),this.blendEquation=new na(this),this.cullFace=new Yr(this),this.cullFaceSide=new cl(this),this.frontFace=new Hs(this),this.program=new Ra(this),this.activeTexture=new ul(this),this.viewport=new Fa(this),this.bindFramebuffer=new go(this),this.bindRenderbuffer=new Oa(this),this.bindTexture=new yo(this),this.bindVertexBuffer=new ra(this),this.bindElementBuffer=new Qr(this),this.bindVertexArray=new Ri(this),this.pixelStoreUnpack=new sa(this),this.pixelStoreUnpackPremultiplyAlpha=new ts(this),this.pixelStoreUnpackFlipY=new Gi(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Dr(t)){this.HALF_FLOAT=t.HALF_FLOAT;const l=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(s=t.RGBA16F)!==null&&s!==void 0?s:l?.RGBA16F_EXT,this.RGB16F=(a=t.RGB16F)!==null&&a!==void 0?a:l?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const l=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=l?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,s){return new bn(this,t,s)}createVertexBuffer(t,s,a){return new mo(this,t,s,a)}createRenderbuffer(t,s,a){const l=this.gl,u=l.createRenderbuffer();return this.bindRenderbuffer.set(u),l.renderbufferStorage(l.RENDERBUFFER,t,s,a),this.bindRenderbuffer.set(null),u}createFramebuffer(t,s,a,l){return new oa(this,t,s,a,l)}clear({color:t,depth:s,stencil:a}){const l=this.gl;let u=0;t&&(u|=l.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(u|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),a!==void 0&&(u|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(a),this.stencilMask.set(255)),l.clear(u)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){m.aE(t.blendFunction,ri.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Dr(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var s;return Dr(this.gl)?this.gl.deleteVertexArray(t):(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class de{constructor(t,s,a){this.func=t,this.mask=s,this.range=a}}de.ReadOnly=!1,de.ReadWrite=!0,de.disabled=new de(519,de.ReadOnly,[0,1]);const xo=7680;class be{constructor(t,s,a,l,u,y){this.test=t,this.ref=s,this.mask=a,this.fail=l,this.depthFail=u,this.pass=y}}be.disabled=new be({func:519,mask:0},0,0,xo,xo,xo);class Ce{constructor(t,s,a){this.enable=t,this.mode=s,this.frontFace=a}}let is;function cn(d,t,s,a,l){const u=d.context,y=u.gl,x=d.useProgram("collisionBox"),w=[];let S=0,C=0;for(let K=0;K<a.length;K++){const Q=a[K],j=t.getTile(Q).getBucket(s);if(!j)continue;const nt=l?j.textCollisionBox:j.iconCollisionBox,rt=j.collisionCircleArray;
vendor: 26,167 bytes, line 583
583if(rt.length>0){const ht=m.H();m.aQ(ht,j.placementInvProjMatrix,d.transform.glCoordMatrix),m.aQ(ht,ht,j.placementViewportMatrix),w.push({circleArray:rt,circleOffset:C,transform:Q.posMatrix,invTransform:ht,coord:Q}),S+=rt.length/4,C=S}nt&&x.draw(u,y.LINES,de.disabled,be.disabled,d.colorModeForRenderPass(),Ce.disabled,{u_matrix:Q.posMatrix,u_pixel_extrude_scale:[1/(A=d.transform).width,1/A.height]},d.style.map.terrain&&d.style.map.terrain.getTerrainData(Q),s.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,d.transform.zoom,null,null,nt.collisionVertexBuffer)}var A;if(!l||!w.length)return;const B=d.useProgram("collisionCircle"),Z=new m.aR;Z.resize(4*S),Z._trim();let U=0;for(const K of w)for(let Q=0;Q<K.circleArray.length/4;Q++){const j=4*Q,nt=K.circleArray[j+0],rt=K.circleArray[j+1],ht=K.circleArray[j+2],yt=K.circleArray[j+3];Z.emplace(U++,nt,rt,ht,yt,0),Z.emplace(U++,nt,rt,ht,yt,1),Z.emplace(U++,nt,rt,ht,yt,2),Z.emplace(U++,nt,rt,ht,yt,3)}(!is||is.length<2*S)&&(is=function(K){const Q=2*K,j=new m.aT;j.resize(Q),j._trim();for(let nt=0;nt<Q;nt++){const rt=6*nt;j.uint16[rt+0]=4*nt+0,j.uint16[rt+1]=4*nt+1,j.uint16[rt+2]=4*nt+2,j.uint16[rt+3]=4*nt+2,j.uint16[rt+4]=4*nt+3,j.uint16[rt+5]=4*nt+0}return j}(S));const G=u.createIndexBuffer(is,!0),X=u.createVertexBuffer(Z,m.aS.members,!0);for(const K of w){const Q=$n(K.transform,K.invTransform,d.transform);B.draw(u,y.TRIANGLES,de.disabled,be.disabled,d.colorModeForRenderPass(),Ce.disabled,Q,d.style.map.terrain&&d.style.map.terrain.getTerrainData(K.coord),s.id,X,G,m.a0.simpleSegment(0,2*K.circleOffset,K.circleArray.length,K.circleArray.length/2),null,d.transform.zoom,null,null,null)}X.destroy(),G.destroy()}Ce.disabled=new Ce(!1,1029,2305),Ce.backCCW=new Ce(!0,1029,2305);const Ks=m.an(new Float32Array(16));function Fr(d,t,s,a,l,u){const{horizontalAlign:y,verticalAlign:x}=m.au(d);return new m.P((-(y-.5)*t/l+a[0])*u,(-(x-.5)*s/l+a[1])*u)}function ns(d,t,s,a,l,u){const y=t.tileAnchorPoint.add(new m.P(t.translation[0],t.translation[1]));if(t.pitchWithMap){let x=a.mult(u);s||(x=x.rotate(-l));const w=y.add(x);return H(w.x,w.y,t.labelPlaneMatrix,t.getElevation).point}if(s){const x=_t(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(d),w=Math.atan(x.y/x.x)+(x.x<0?Math.PI:0);return d.add(a.rotate(w))}return d.add(a)}function Gn(d,t,s,a,l,u,y,x,w,S,C,A,B,Z){const U=d.text.placedSymbolArray,G=d.text.dynamicLayoutVertexArray,X=d.icon.dynamicLayoutVertexArray,K={};G.clear();for(let Q=0;Q<U.length;Q++){const j=U.get(Q),nt=j.hidden||!j.crossTileID||d.allowVerticalPlacement&&!j.placedOrientation?null:a[j.crossTileID];if(nt){const rt=new m.P(j.anchorX,j.anchorY),ht={getElevation:Z,width:l.width,height:l.height,labelPlaneMatrix:u,pitchWithMap:s,projection:C,tileAnchorPoint:rt,translation:A,unwrappedTileID:B},yt=s?H(rt.x,rt.y,y,Z):_t(rt.x,rt.y,ht),Tt=E(l.cameraToCenterDistance,yt.signedDistanceFromCamera);let zt=m.ai(d.textSizeData,w,j)*Tt/m.ap;s&&(zt*=d.tilePixelRatio/x);const{width:Rt,height:Ct,anchor:It,textOffset:Zt,textBoxScale:ee}=nt,At=Fr(It,Rt,Ct,Zt,ee,zt),Lt=C.getPitchedTextCorrection(l,rt.add(new m.P(A[0],A[1])),B),Yt=ns(yt.point,ht,t,At,l.angle,Lt),Ke=d.allowVerticalPlacement&&j.placedOrientation===m.ah.vertical?Math.PI/2:0;for(let pe=0;pe<j.numGlyphs;pe++)m.aj(G,Yt,Ke);S&&j.associatedIconIndex>=0&&(K[j.associatedIconIndex]={shiftedAnchor:Yt,angle:Ke})}else Gt(j.numGlyphs,G)}if(S){X.clear();const Q=d.icon.placedSymbolArray;for(let j=0;j<Q.length;j++){const nt=Q.get(j);if(nt.hidden)Gt(nt.numGlyphs,X);else{const rt=K[j];if(rt)for(let ht=0;ht<nt.numGlyphs;ht++)m.aj(X,rt.shiftedAnchor,rt.angle);else Gt(nt.numGlyphs,X)}}d.icon.dynamicLayoutVertexBuffer.updateData(X)}d.text.dynamicLayoutVertexBuffer.updateData(G)}function un(d,t,s){return s.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function Ss(d,t,s,a,l,u,y,x,w,S,C,A){const B=d.context,Z=B.gl,U=d.transform,G=En(),X=x==="map",K=w==="map",Q=x!=="viewport"&&s.layout.get("symbol-placement")!=="point",j=X&&!K&&!Q,nt=!K&&Q,rt=!s.layout.get("symbol-sort-key").isConstant();let ht=!1;const yt=d.depthModeForSublayer(0,de.ReadOnly),Tt=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),zt=[],Rt=G.getCircleRadiusCorrection(U);for(const Ct of a){const It=t.getTile(Ct),Zt=It.getBucket(s);if(!Zt)continue;const ee=l?Zt.text:Zt.icon;if(!ee||!ee.segments.get().length||!ee.hasVisibleVertices)continue;const At=ee.programConfigurations.get(s.id),Lt=l||Zt.sdfIcons,Yt=l?Zt.textSizeData:Zt.iconSizeData,Ke=K||U.pitch!==0,pe=d.useProgram(un(Lt,l,Zt),At),we=m.ag(Yt,U.zoom),Je=d.style.map.terrain&&d.style.map.terrain.getTerrainData(Ct);let Xi,_r,Ye,Tn,pn=[0,0],Ki=null;if(l)_r=It.glyphAtlasTexture,Ye=Z.LINEAR,Xi=It.glyphAtlasTexture.size,Zt.iconsInText&&(pn=It.imageAtlasTexture.size,Ki=It.imageAtlasTexture,Tn=Ke||d.options.rotating||d.options.zooming||Yt.kind==="composite"||Yt.kind==="camera"?Z.LINEAR:Z.NEAREST);else{const Ie=s.layout.get("icon-size").constantOr(0)!==1||Zt.iconsNeedLinear;_r=It.imageAtlasTexture,Ye=Lt||d.options.rotating||d.options.zooming||Ie||Ke?Z.LINEAR:Z.NEAREST,Xi=It.imageAtlasTexture.size}const fn=me(It,1,d.transform.zoom),Zr=nt?Ct.posMatrix:Ks,Do=cr(Zr,K,X,d.transform,fn),$a=zn(Zr,K,X,d.transform,fn),Bo=zn(Ct.posMatrix,K,X,d.transform,fn),Qn=G.translatePosition(d.transform,It,u,y),Ga=Tt&&Zt.hasTextData(),yl=s.layout.get("icon-text-fit")!=="none"&&Ga&&Zt.hasIconData();if(Q){const Ie=d.style.map.terrain?(Ro,Fo)=>d.style.map.terrain.getElevation(Ct,Ro,Fo):null,no=s.layout.get("text-rotation-alignment")==="map";V(Zt,Ct.posMatrix,d,l,Do,Bo,K,S,no,G,Ct.toUnwrapped(),U.width,U.height,Qn,Ie)}const tr=Ct.posMatrix,er=l&&Tt||yl,Fs=Q||er?Ks:Do,gr=$a,Fi=Lt&&s.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ji;Ji=Lt?Zt.iconsInText?po(Yt.kind,we,j,K,Q,er,d,tr,Fs,gr,Qn,Xi,pn,Rt):Ln(Yt.kind,we,j,K,Q,er,d,tr,Fs,gr,Qn,l,Xi,!0,Rt):vi(Yt.kind,we,j,K,Q,er,d,tr,Fs,gr,Qn,l,Xi,Rt);const Fn={program:pe,buffers:ee,uniformValues:Ji,atlasTexture:_r,atlasTextureIcon:Ki,atlasInterpolation:Ye,atlasInterpolationIcon:Tn,isSDF:Lt,hasHalo:Fi};if(rt&&Zt.canOverlap){ht=!0;const Ie=ee.segments.get();for(const no of Ie)zt.push({segments:new m.a0([no]),sortKey:no.sortKey,state:Fn,terrainData:Je})}else zt.push({segments:ee.segments,sortKey:0,state:Fn,terrainData:Je})}ht&&zt.sort((Ct,It)=>Ct.sortKey-It.sortKey);for(const Ct of zt){const It=Ct.state;if(B.activeTexture.set(Z.TEXTURE0),It.atlasTexture.bind(It.atlasInterpolation,Z.CLAMP_TO_EDGE),It.atlasTextureIcon&&(B.activeTexture.set(Z.TEXTURE1),It.atlasTextureIcon&&It.atlasTextureIcon.bind(It.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),It.isSDF){const Zt=It.uniformValues;It.hasHalo&&(Zt.u_is_halo=1,aa(It.buffers,Ct.segments,s,d,It.program,yt,C,A,Zt,Ct.terrainData)),Zt.u_is_halo=0}aa(It.buffers,Ct.segments,s,d,It.program,yt,C,A,It.uniformValues,Ct.terrainData)}}function aa(d,t,s,a,l,u,y,x,w,S){const C=a.context;l.draw(C,C.gl.TRIANGLES,u,y,x,Ce.disabled,w,S,s.id,d.layoutVertexBuffer,d.indexBuffer,t,s.paint,a.transform.zoom,d.programConfigurations.get(s.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function Hn(d,t,s,a){const l=d.context,u=l.gl,y=be.disabled,x=new ri([u.ONE,u.ONE],m.aM.transparent,[!0,!0,!0,!0]),w=t.getBucket(s);if(!w)return;const S=a.key;let C=s.heatmapFbos.get(S);C||(C=Js(l,t.tileSize,t.tileSize),s.heatmapFbos.set(S,C)),l.bindFramebuffer.set(C.framebuffer),l.viewport.set([0,0,t.tileSize,t.tileSize]),l.clear({color:m.aM.transparent});const A=w.programConfigurations.get(s.id),B=d.useProgram("heatmap",A),Z=d.style.map.terrain.getTerrainData(a);B.draw(l,u.TRIANGLES,de.disabled,y,x,Ce.disabled,$i(a.posMatrix,t,d.transform.zoom,s.paint.get("heatmap-intensity")),Z,s.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,s.paint,d.transform.zoom,A)}function Wn(d,t,s){const a=d.context,l=a.gl;a.setColorMode(d.colorModeForRenderPass());const u=rs(a,t),y=s.key,x=t.heatmapFbos.get(y);x&&(a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,x.colorAttachment.get()),a.activeTexture.set(l.TEXTURE1),u.bind(l.LINEAR,l.CLAMP_TO_EDGE),d.useProgram("heatmapTexture").draw(a,l.TRIANGLES,de.disabled,be.disabled,d.colorModeForRenderPass(),Ce.disabled,oe(d,t,0,1),null,t.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments,t.paint,d.transform.zoom),x.destroy(),t.heatmapFbos.delete(y))}function Js(d,t,s){var a,l;const u=d.gl,y=u.createTexture();u.bindTexture(u.TEXTURE_2D,y),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR);const x=(a=d.HALF_FLOAT)!==null&&a!==void 0?a:u.UNSIGNED_BYTE,w=(l=d.RGBA16F)!==null&&l!==void 0?l:u.RGBA;u.texImage2D(u.TEXTURE_2D,0,w,t,s,0,u.RGBA,x,null);const S=d.createFramebuffer(t,s,!1,!1);return S.colorAttachment.set(y),S}function rs(d,t){return t.colorRampTexture||(t.colorRampTexture=new le(d,t.colorRamp,d.gl.RGBA)),t.colorRampTexture}function Is(d,t,s,a,l){if(!s||!a||!a.imageAtlas)return;const u=a.imageAtlas.patternPositions;let y=u[s.to.toString()],x=u[s.from.toString()];if(!y&&x&&(y=x),!x&&y&&(x=y),!y||!x){const w=l.getPaintProperty(t);y=u[w],x=u[w]}y&&x&&d.setConstantPatternPositions(y,x)}function dn(d,t,s,a,l,u,y){const x=d.context.gl,w="fill-pattern",S=s.paint.get(w),C=S&&S.constantOr(1),A=s.getCrossfadeParameters();let B,Z,U,G,X;y?(Z=C&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",B=x.LINES):(Z=C?"fillPattern":"fill",B=x.TRIANGLES);const K=S.constantOr(null);for(const Q of a){const j=t.getTile(Q);if(C&&!j.patternsLoaded())continue;const nt=j.getBucket(s);if(!nt)continue;const rt=nt.programConfigurations.get(s.id),ht=d.useProgram(Z,rt),yt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(Q);C&&(d.context.activeTexture.set(x.TEXTURE0),j.imageAtlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),rt.updatePaintBuffers(A)),Is(rt,w,K,j,s);const Tt=yt?Q:null,zt=d.translatePosMatrix(Tt?Tt.posMatrix:Q.posMatrix,j,s.paint.get("fill-translate"),s.paint.get("fill-translate-anchor"));if(y){G=nt.indexBuffer2,X=nt.segments2;const Rt=[x.drawingBufferWidth,x.drawingBufferHeight];U=Z==="fillOutlinePattern"&&C?co(zt,d,A,j,Rt):ho(zt,Rt)}else G=nt.indexBuffer,X=nt.segments,U=C?lo(zt,d,A,j):zr(zt);ht.draw(d.context,B,l,d.stencilModeForClipping(Q),u,Ce.disabled,U,yt,s.id,nt.layoutVertexBuffer,G,X,s.paint,d.transform.zoom,rt)}}function bo(d,t,s,a,l,u,y){const x=d.context,w=x.gl,S="fill-extrusion-pattern",C=s.paint.get(S),A=C.constantOr(1),B=s.getCrossfadeParameters(),Z=s.paint.get("fill-extrusion-opacity"),U=C.constantOr(null);for(const G of a){const X=t.getTile(G),K=X.getBucket(s);if(!K)continue;const Q=d.style.map.terrain&&d.style.map.terrain.getTerrainData(G),j=K.programConfigurations.get(s.id),nt=d.useProgram(A?"fillExtrusionPattern":"fillExtrusion",j);A&&(d.context.activeTexture.set(w.TEXTURE0),X.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),j.updatePaintBuffers(B)),Is(j,S,U,X,s);const rt=d.translatePosMatrix(G.posMatrix,X,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),ht=s.paint.get("fill-extrusion-vertical-gradient"),yt=A?kr(rt,d,ht,Z,G,B,X):Jr(rt,d,ht,Z);nt.draw(x,x.gl.TRIANGLES,l,u,y,Ce.backCCW,yt,Q,s.id,K.layoutVertexBuffer,K.indexBuffer,K.segments,s.paint,d.transform.zoom,j,d.style.map.terrain&&K.centroidVertexBuffer)}}function Bn(d,t,s,a,l,u,y){const x=d.context,w=x.gl,S=s.fbo;if(!S)return;const C=d.useProgram("hillshade"),A=d.style.map.terrain&&d.style.map.terrain.getTerrainData(t);x.activeTexture.set(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,S.colorAttachment.get()),C.draw(x,w.TRIANGLES,l,u,y,Ce.disabled,((B,Z,U,G)=>{const X=U.paint.get("hillshade-shadow-color"),K=U.paint.get("hillshade-highlight-color"),Q=U.paint.get("hillshade-accent-color");let j=U.paint.get("hillshade-illumination-direction")*(Math.PI/180);U.paint.get("hillshade-illumination-anchor")==="viewport"&&(j-=B.transform.angle);const nt=!B.options.moving;return{u_matrix:G?G.posMatrix:B.transform.calculatePosMatrix(Z.tileID.toUnwrapped(),nt),u_image:0,u_latrange:hn(0,Z.tileID),u_light:[U.paint.get("hillshade-exaggeration"),j],u_shadow:X,u_highlight:K,u_accent:Q}})(d,s,a,A?t:null),A,a.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}function Ms(d,t,s,a,l,u){const y=d.context,x=y.gl,w=t.dem;if(w&&w.data){const S=w.dim,C=w.stride,A=w.getPixels();if(y.activeTexture.set(x.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||d.getTileTexture(C),t.demTexture){const Z=t.demTexture;Z.update(A,{premultiply:!1}),Z.bind(x.NEAREST,x.CLAMP_TO_EDGE)}else t.demTexture=new le(y,A,x.RGBA,{premultiply:!1}),t.demTexture.bind(x.NEAREST,x.CLAMP_TO_EDGE);y.activeTexture.set(x.TEXTURE0);let B=t.fbo;if(!B){const Z=new le(y,{width:S,height:S,data:null},x.RGBA);Z.bind(x.LINEAR,x.CLAMP_TO_EDGE),B=t.fbo=y.createFramebuffer(S,S,!0,!1),B.colorAttachment.set(Z.texture)}y.bindFramebuffer.set(B.framebuffer),y.viewport.set([0,0,S,S]),d.useProgram("hillshadePrepare").draw(y,x.TRIANGLES,a,l,u,Ce.disabled,((Z,U)=>{const G=U.stride,X=m.H();return m.aP(X,0,m.X,-m.X,0,0,1),m.J(X,X,[0,-m.X,0]),{u_matrix:X,u_image:1,u_dimension:[G,G],u_zoom:Z.overscaledZ,u_unpack:U.getUnpackVector()}})(t.tileID,w),null,s.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Xn(d,t,s,a,l,u){const y=a.paint.get("raster-fade-duration");if(!u&&y>0){const x=bt.now(),w=(x-d.timeAdded)/y,S=t?(x-t.timeAdded)/y:-1,C=s.getSource(),A=l.coveringZoomLevel({tileSize:C.tileSize,roundZoom:C.roundZoom}),B=!t||Math.abs(t.tileID.overscaledZ-A)>Math.abs(d.tileID.overscaledZ-A),Z=B&&d.refreshedUponExpiration?1:m.ac(B?w:1-S,0,1);return d.refreshedUponExpiration&&w>=1&&(d.refreshedUponExpiration=!1),t?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const Cs=new m.aM(1,0,0,1),Me=new m.aM(0,1,0,1),As=new m.aM(0,0,1,1),wo=new m.aM(1,0,1,1),To=new m.aM(0,1,1,1);function mr(d,t,s,a){os(d,0,t+s/2,d.transform.width,s,a)}function ss(d,t,s,a){os(d,t-s/2,0,s,d.transform.height,a)}function os(d,t,s,a,l,u){const y=d.context,x=y.gl;x.enable(x.SCISSOR_TEST),x.scissor(t*d.pixelRatio,s*d.pixelRatio,a*d.pixelRatio,l*d.pixelRatio),y.clear({color:u}),x.disable(x.SCISSOR_TEST)}function Po(d,t,s){const a=d.context,l=a.gl,u=s.posMatrix,y=d.useProgram("debug"),x=de.disabled,w=be.disabled,S=d.colorModeForRenderPass(),C="$debug",A=d.style.map.terrain&&d.style.map.terrain.getTerrainData(s);a.activeTexture.set(l.TEXTURE0);const B=t.getTileByID(s.key).latestRawTileData,Z=Math.floor((B&&B.byteLength||0)/1024),U=t.getTile(s).tileSize,G=512/Math.min(U,512)*(s.overscaledZ/d.transform.zoom)*.5;let X=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(X+=` => ${s.overscaledZ}`),function(K,Q){K.initDebugOverlayCanvas();const j=K.debugOverlayCanvas,nt=K.context.gl,rt=K.debugOverlayCanvas.getContext("2d");rt.clearRect(0,0,j.width,j.height),rt.shadowColor="white",rt.shadowBlur=2,rt.lineWidth=1.5,rt.strokeStyle="white",rt.textBaseline="top",rt.font="bold 36px Open Sans, sans-serif",rt.fillText(Q,5,5),rt.strokeText(Q,5,5),K.debugOverlayTexture.update(j),K.debugOverlayTexture.bind(nt.LINEAR,nt.CLAMP_TO_EDGE)}(d,`${X} ${Z}kB`),y.draw(a,l.TRIANGLES,x,w,ri.alphaBlended,Ce.disabled,Ts(u,m.aM.transparent,G),null,C,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),y.draw(a,l.LINE_STRIP,x,w,S,Ce.disabled,Ts(u,m.aM.red),A,C,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function la(d,t,s){const a=d.context,l=a.gl,u=d.colorModeForRenderPass(),y=new de(l.LEQUAL,de.ReadWrite,d.depthRangeFor3D),x=d.useProgram("terrain"),w=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height]);for(const S of s){const C=d.renderToTexture.getTexture(S),A=t.getTerrainData(S.tileID);a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,C.texture);const B=d.transform.calculatePosMatrix(S.tileID.toUnwrapped()),Z=t.getMeshFrameDelta(d.transform.zoom),U=d.transform.calculateFogMatrix(S.tileID.toUnwrapped()),G=ni(B,Z,U,d.style.sky,d.transform.pitch);x.draw(a,l.TRIANGLES,y,be.disabled,u,Ce.backCCW,G,A,"terrain",w.vertexBuffer,w.indexBuffer,w.segments)}}class So{constructor(t,s,a){this.vertexBuffer=t,this.indexBuffer=s,this.segments=a}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class as{constructor(t,s){this.context=new dl(t),this.transform=s,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:m.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Xt.maxUnderzooming+Xt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ce}resize(t,s,a){if(this.width=Math.floor(t*a),this.height=Math.floor(s*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const t=this.context,s=new m.aX;s.emplaceBack(0,0),s.emplaceBack(m.X,0),s.emplaceBack(0,m.X),s.emplaceBack(m.X,m.X),this.tileExtentBuffer=t.createVertexBuffer(s,yi.members),this.tileExtentSegments=m.a0.simpleSegment(0,0,4,2);const a=new m.aX;a.emplaceBack(0,0),a.emplaceBack(m.X,0),a.emplaceBack(0,m.X),a.emplaceBack(m.X,m.X),this.debugBuffer=t.createVertexBuffer(a,yi.members),this.debugSegments=m.a0.simpleSegment(0,0,4,5);const l=new m.$;l.emplaceBack(0,0,0,0),l.emplaceBack(m.X,0,m.X,0),l.emplaceBack(0,m.X,0,m.X),l.emplaceBack(m.X,m.X,m.X,m.X),this.rasterBoundsBuffer=t.createVertexBuffer(l,hr.members),this.rasterBoundsSegments=m.a0.simpleSegment(0,0,4,2);const u=new m.aX;u.emplaceBack(0,0),u.emplaceBack(1,0),u.emplaceBack(0,1),u.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(u,yi.members),this.viewportSegments=m.a0.simpleSegment(0,0,4,2);const y=new m.aZ;y.emplaceBack(0),y.emplaceBack(1),y.emplaceBack(3),y.emplaceBack(2),y.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(y);const x=new m.aY;x.emplaceBack(0,1,2),x.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(x);const w=this.context.gl;this.stencilClearMode=new be({func:w.ALWAYS,mask:0},0,255,w.ZERO,w.ZERO,w.ZERO)}clearStencil(){const t=this.context,s=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=m.H();m.aP(a,0,this.width,this.height,0,0,1),m.K(a,a,[s.drawingBufferWidth,s.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,s.TRIANGLES,de.disabled,this.stencilClearMode,ri.disabled,Ce.disabled,Ci(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,s){if(this.currentStencilSource===t.source||!t.isTileClipped()||!s||!s.length)return;this.currentStencilSource=t.source;const a=this.context,l=a.gl;this.nextStencilID+s.length>256&&this.clearStencil(),a.setColorMode(ri.disabled),a.setDepthMode(de.disabled);const u=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of s){const x=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,w=this.style.map.terrain&&this.style.map.terrain.getTerrainData(y);u.draw(a,l.TRIANGLES,de.disabled,new be({func:l.ALWAYS,mask:0},x,255,l.KEEP,l.KEEP,l.REPLACE),ri.disabled,Ce.disabled,Ci(y.posMatrix),w,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,s=this.context.gl;return new be({func:s.NOTEQUAL,mask:255},t,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(t){const s=this.context.gl;return new be({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,s.KEEP,s.KEEP,s.REPLACE)}stencilConfigForOverlap(t){const s=this.context.gl,a=t.sort((y,x)=>x.overscaledZ-y.overscaledZ),l=a[a.length-1].overscaledZ,u=a[0].overscaledZ-l+1;if(u>1){this.currentStencilSource=void 0,this.nextStencilID+u>256&&this.clearStencil();const y={};for(let x=0;x<u;x++)y[x+l]=new be({func:s.GEQUAL,mask:255},x+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=u,[y,a]}return[{[l]:be.disabled},a]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new ri([t.CONSTANT_COLOR,t.ONE],new m.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?ri.unblended:ri.alphaBlended}depthModeForSublayer(t,s,a){if(!this.opaquePassEnabledForLayer())return de.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new de(a||this.context.gl.LEQUAL,s,[l,l])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,s){this.style=t,this.options=s,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(bt.now()),this.imageManager.beginFrame();const a=this.style._order,l=this.style.sourceCaches,u={},y={},x={};for(const w in l){const S=l[w];S.used&&S.prepare(this.context),u[w]=S.getVisibleCoordinates(),y[w]=u[w].slice().reverse(),x[w]=S.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let w=0;w<a.length;w++)if(this.style._layers[a[w]].is3D()){this.opaquePassCutoff=w;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const w of a){const S=this.style._layers[w];if(!S.hasOffscreenPass()||S.isHidden(this.transform.zoom))continue;const C=y[S.source];(S.type==="custom"||C.length)&&this.renderLayer(this,l[S.source],S,C)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:s.showOverdrawInspector?m.aM.black:m.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(w,S){const C=w.context,A=C.gl,B=((K,Q,j)=>({u_sky_color:K.properties.get("sky-color"),u_horizon_color:K.properties.get("horizon-color"),u_horizon:(Q.height/2+Q.getHorizon())*j,u_sky_horizon_blend:K.properties.get("sky-horizon-blend")*Q.height/2*j}))(S,w.style.map.transform,w.pixelRatio),Z=new de(A.LEQUAL,de.ReadWrite,[0,1]),U=be.disabled,G=w.colorModeForRenderPass(),X=w.useProgram("sky");if(!S.mesh){const K=new m.aX;K.emplaceBack(-1,-1),K.emplaceBack(1,-1),K.emplaceBack(1,1),K.emplaceBack(-1,1);const Q=new m.aY;Q.emplaceBack(0,1,2),Q.emplaceBack(0,2,3),S.mesh=new So(C.createVertexBuffer(K,yi.members),C.createIndexBuffer(Q),m.a0.simpleSegment(0,0,K.length,Q.length))}X.draw(C,A.TRIANGLES,Z,U,G,Ce.disabled,B,void 0,"sky",S.mesh.vertexBuffer,S.mesh.indexBuffer,S.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=s.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const w=this.style._layers[a[this.currentLayer]],S=l[w.source],C=u[w.source];this._renderTileClippingMasks(w,C),this.renderLayer(this,S,w,C)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const w=this.style._layers[a[this.currentLayer]],S=l[w.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(w))continue;const C=(w.type==="symbol"?x:y)[w.source];this._renderTileClippingMasks(w,u[w.source]),this.renderLayer(this,S,w,C)}if(this.options.showTileBoundaries){const w=function(S,C){let A=null;const B=Object.values(S._layers).flatMap(X=>X.source&&!X.isHidden(C)?[S.sourceCaches[X.source]]:[]),Z=B.filter(X=>X.getSource().type==="vector"),U=B.filter(X=>X.getSource().type!=="vector"),G=X=>{(!A||A.getSource().maxzoom<X.getSource().maxzoom)&&(A=X)};return Z.forEach(X=>G(X)),A||U.forEach(X=>G(X)),A}(this.style,this.transform.zoom);w&&function(S,C,A){for(let B=0;B<A.length;B++)Po(S,C,A[B])}(this,w,w.getVisibleCoordinates())}this.options.showPadding&&function(w){const S=w.transform.padding;mr(w,w.transform.height-(S.top||0),3,Cs),mr(w,S.bottom||0,3,Me),ss(w,S.left||0,3,As),ss(w,w.transform.width-(S.right||0),3,wo);const C=w.transform.centerPoint;(function(A,B,Z,U){os(A,B-1,Z-10,2,20,U),os(A,B-10,Z-1,20,2,U)})(w,C.x,w.transform.height-C.y,To)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const s=this.terrainFacilitator.matrix,a=this.transform.modelViewProjectionMatrix;let l=this.terrainFacilitator.dirty;l||(l=t?!m.a_(s,a):!m.a$(s,a)),l||(l=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),l&&(m.b0(s,a),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(u,y){const x=u.context,w=x.gl,S=ri.unblended,C=new de(w.LEQUAL,de.ReadWrite,[0,1]),A=y.getTerrainMesh(),B=y.sourceCache.getRenderableTiles(),Z=u.useProgram("terrainDepth");x.bindFramebuffer.set(y.getFramebuffer("depth").framebuffer),x.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),x.clear({color:m.aM.transparent,depth:1});for(const U of B){const G=y.getTerrainData(U.tileID),X={u_matrix:u.transform.calculatePosMatrix(U.tileID.toUnwrapped()),u_ele_delta:y.getMeshFrameDelta(u.transform.zoom)};Z.draw(x,w.TRIANGLES,C,be.disabled,S,Ce.backCCW,X,G,"terrain",A.vertexBuffer,A.indexBuffer,A.segments)}x.bindFramebuffer.set(null),x.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain),function(u,y){const x=u.context,w=x.gl,S=ri.unblended,C=new de(w.LEQUAL,de.ReadWrite,[0,1]),A=y.getTerrainMesh(),B=y.getCoordsTexture(),Z=y.sourceCache.getRenderableTiles(),U=u.useProgram("terrainCoords");x.bindFramebuffer.set(y.getFramebuffer("coords").framebuffer),x.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),x.clear({color:m.aM.transparent,depth:1}),y.coordsIndex=[];for(const G of Z){const X=y.getTerrainData(G.tileID);x.activeTexture.set(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,B.texture);const K={u_matrix:u.transform.calculatePosMatrix(G.tileID.toUnwrapped()),u_terrain_coords_id:(255-y.coordsIndex.length)/255,u_texture:0,u_ele_delta:y.getMeshFrameDelta(u.transform.zoom)};U.draw(x,w.TRIANGLES,C,be.disabled,S,Ce.backCCW,K,X,"terrain",A.vertexBuffer,A.indexBuffer,A.segments),y.c
583oordsIndex.push(G.tileID.key)}x.bindFramebuffer.set(null),x.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain))}renderLayer(t,s,a,l){if(!a.isHidden(this.transform.zoom)&&(a.type==="background"||a.type==="custom"||(l||[]).length))switch(this.id=a.id,a.type){case"symbol":(function(u,y,x,w,S){if(u.renderPass!=="translucent")return;const C=be.disabled,A=u.colorModeForRenderPass();(x._unevaluatedLayout.hasValue("text-variable-anchor")||x._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(B,Z,U,G,X,K,Q,j,nt){const rt=Z.transform,ht=En(),yt=X==="map",Tt=K==="map";for(const zt of B){const Rt=G.getTile(zt),Ct=Rt.getBucket(U);if(!Ct||!Ct.text||!Ct.text.segments.get().length)continue;const It=m.ag(Ct.textSizeData,rt.zoom),Zt=me(Rt,1,Z.transform.zoom),ee=cr(zt.posMatrix,Tt,yt,Z.transform,Zt),At=U.layout.get("icon-text-fit")!=="none"&&Ct.hasIconData();if(It){const Lt=Math.pow(2,rt.zoom-Rt.tileID.overscaledZ),Yt=Z.style.map.terrain?(pe,we)=>Z.style.map.terrain.getElevation(zt,pe,we):null,Ke=ht.translatePosition(rt,Rt,Q,j);Gn(Ct,yt,Tt,nt,rt,ee,zt.posMatrix,Lt,It,At,ht,Ke,zt.toUnwrapped(),Yt)}}}(w,u,x,y,x.layout.get("text-rotation-alignment"),x.layout.get("text-pitch-alignment"),x.paint.get("text-translate"),x.paint.get("text-translate-anchor"),S),x.paint.get("icon-opacity").constantOr(1)!==0&&Ss(u,y,x,w,!1,x.paint.get("icon-translate"),x.paint.get("icon-translate-anchor"),x.layout.get("icon-rotation-alignment"),x.layout.get("icon-pitch-alignment"),x.layout.get("icon-keep-upright"),C,A),x.paint.get("text-opacity").constantOr(1)!==0&&Ss(u,y,x,w,!0,x.paint.get("text-translate"),x.paint.get("text-translate-anchor"),x.layout.get("text-rotation-alignment"),x.layout.get("text-pitch-alignment"),x.layout.get("text-keep-upright"),C,A),y.map.showCollisionBoxes&&(cn(u,y,x,w,!0),cn(u,y,x,w,!1))})(t,s,a,l,this.style.placement.variableOffsets);break;case"circle":(function(u,y,x,w){if(u.renderPass!=="translucent")return;const S=x.paint.get("circle-opacity"),C=x.paint.get("circle-stroke-width"),A=x.paint.get("circle-stroke-opacity"),B=!x.layout.get("circle-sort-key").isConstant();if(S.constantOr(1)===0&&(C.constantOr(1)===0||A.constantOr(1)===0))return;const Z=u.context,U=Z.gl,G=u.depthModeForSublayer(0,de.ReadOnly),X=be.disabled,K=u.colorModeForRenderPass(),Q=[];for(let j=0;j<w.length;j++){const nt=w[j],rt=y.getTile(nt),ht=rt.getBucket(x);if(!ht)continue;const yt=ht.programConfigurations.get(x.id),Tt=u.useProgram("circle",yt),zt=ht.layoutVertexBuffer,Rt=ht.indexBuffer,Ct=u.style.map.terrain&&u.style.map.terrain.getTerrainData(nt),It={programConfiguration:yt,program:Tt,layoutVertexBuffer:zt,indexBuffer:Rt,uniformValues:Ko(u,nt,rt,x),terrainData:Ct};if(B){const Zt=ht.segments.get();for(const ee of Zt)Q.push({segments:new m.a0([ee]),sortKey:ee.sortKey,state:It})}else Q.push({segments:ht.segments,sortKey:0,state:It})}B&&Q.sort((j,nt)=>j.sortKey-nt.sortKey);for(const j of Q){const{programConfiguration:nt,program:rt,layoutVertexBuffer:ht,indexBuffer:yt,uniformValues:Tt,terrainData:zt}=j.state;rt.draw(Z,U.TRIANGLES,G,X,K,Ce.disabled,Tt,zt,x.id,ht,yt,j.segments,x.paint,u.transform.zoom,nt)}})(t,s,a,l);break;case"heatmap":(function(u,y,x,w){if(x.paint.get("heatmap-opacity")===0)return;const S=u.context;if(u.style.map.terrain){for(const C of w){const A=y.getTile(C);y.hasRenderableParent(C)||(u.renderPass==="offscreen"?Hn(u,A,x,C):u.renderPass==="translucent"&&Wn(u,x,C))}S.viewport.set([0,0,u.width,u.height])}else u.renderPass==="offscreen"?function(C,A,B,Z){const U=C.context,G=U.gl,X=be.disabled,K=new ri([G.ONE,G.ONE],m.aM.transparent,[!0,!0,!0,!0]);(function(Q,j,nt){const rt=Q.gl;Q.activeTexture.set(rt.TEXTURE1),Q.viewport.set([0,0,j.width/4,j.height/4]);let ht=nt.heatmapFbos.get(m.aU);ht?(rt.bindTexture(rt.TEXTURE_2D,ht.colorAttachment.get()),Q.bindFramebuffer.set(ht.framebuffer)):(ht=Js(Q,j.width/4,j.height/4),nt.heatmapFbos.set(m.aU,ht))})(U,C,B),U.clear({color:m.aM.transparent});for(let Q=0;Q<Z.length;Q++){const j=Z[Q];if(A.hasRenderableParent(j))continue;const nt=A.getTile(j),rt=nt.getBucket(B);if(!rt)continue;const ht=rt.programConfigurations.get(B.id),yt=C.useProgram("heatmap",ht),{zoom:Tt}=C.transform;yt.draw(U,G.TRIANGLES,de.disabled,X,K,Ce.disabled,$i(j.posMatrix,nt,Tt,B.paint.get("heatmap-intensity")),null,B.id,rt.layoutVertexBuffer,rt.indexBuffer,rt.segments,B.paint,C.transform.zoom,ht)}U.viewport.set([0,0,C.width,C.height])}(u,y,x,w):u.renderPass==="translucent"&&function(C,A){const B=C.context,Z=B.gl;B.setColorMode(C.colorModeForRenderPass());const U=A.heatmapFbos.get(m.aU);U&&(B.activeTexture.set(Z.TEXTURE0),Z.bindTexture(Z.TEXTURE_2D,U.colorAttachment.get()),B.activeTexture.set(Z.TEXTURE1),rs(B,A).bind(Z.LINEAR,Z.CLAMP_TO_EDGE),C.useProgram("heatmapTexture").draw(B,Z.TRIANGLES,de.disabled,be.disabled,C.colorModeForRenderPass(),Ce.disabled,oe(C,A,0,1),null,A.id,C.viewportBuffer,C.quadTriangleIndexBuffer,C.viewportSegments,A.paint,C.transform.zoom))}(u,x)})(t,s,a,l);break;case"line":(function(u,y,x,w){if(u.renderPass!=="translucent")return;const S=x.paint.get("line-opacity"),C=x.paint.get("line-width");if(S.constantOr(1)===0||C.constantOr(1)===0)return;const A=u.depthModeForSublayer(0,de.ReadOnly),B=u.colorModeForRenderPass(),Z=x.paint.get("line-dasharray"),U=x.paint.get("line-pattern"),G=U.constantOr(1),X=x.paint.get("line-gradient"),K=x.getCrossfadeParameters(),Q=G?"linePattern":Z?"lineSDF":X?"lineGradient":"line",j=u.context,nt=j.gl;let rt=!0;for(const ht of w){const yt=y.getTile(ht);if(G&&!yt.patternsLoaded())continue;const Tt=yt.getBucket(x);if(!Tt)continue;
583const zt=Tt.programConfigurations.get(x.id),Rt=u.context.program.get(),Ct=u.useProgram(Q,zt),It=rt||Ct.program!==Rt,Zt=u.style.map.terrain&&u.style.map.terrain.getTerrainData(ht),ee=U.constantOr(null);if(ee&&yt.imageAtlas){const Yt=yt.imageAtlas,Ke=Yt.patternPositions[ee.to.toString()],pe=Yt.patternPositions[ee.from.toString()];Ke&&pe&&zt.setConstantPatternPositions(Ke,pe)}const At=Zt?ht:null,Lt=G?Er(u,yt,x,K,At):Z?Yo(u,yt,x,Z,K,At):X?Jo(u,yt,x,Tt.lineClipsArray.length,At):Re(u,yt,x,At);if(G)j.activeTexture.set(nt.TEXTURE0),yt.imageAtlasTexture.bind(nt.LINEAR,nt.CLAMP_TO_EDGE),zt.updatePaintBuffers(K);else if(Z&&(It||u.lineAtlas.dirty))j.activeTexture.set(nt.TEXTURE0),u.lineAtlas.bind(j);else if(X){const Yt=Tt.gradients[x.id];let Ke=Yt.texture;if(x.gradientVersion!==Yt.version){let pe=256;if(x.stepInterpolant){const we=y.getSource().maxzoom,Je=ht.canonical.z===we?Math.ceil(1<<u.transform.maxZoom-ht.canonical.z):1;pe=m.ac(m.aV(Tt.maxLineLength/m.X*1024*Je),256,j.maxTextureSize)}Yt.gradient=m.aW({expression:x.gradientExpression(),evaluationKey:"lineProgress",resolution:pe,image:Yt.gradient||void 0,clips:Tt.lineClipsArray}),Yt.texture?Yt.texture.update(Yt.gradient):Yt.texture=new le(j,Yt.gradient,nt.RGBA),Yt.version=x.gradientVersion,Ke=Yt.texture}j.activeTexture.set(nt.TEXTURE0),Ke.bind(x.stepInterpolant?nt.NEAREST:nt.LINEAR,nt.CLAMP_TO_EDGE)}Ct.draw(j,nt.TRIANGLES,A,u.stencilModeForClipping(ht),B,Ce.disabled,Lt,Zt,x.id,Tt.layoutVertexBuffer,Tt.indexBuffer,Tt.segments,x.paint,u.transform.zoom,zt,Tt.layoutVertexBuffer2),rt=!1}})(t,s,a,l);break;case"fill":(function(u,y,x,w){const S=x.paint.get("fill-color"),C=x.paint.get("fill-opacity");if(C.constantOr(1)===0)return;const A=u.colorModeForRenderPass(),B=x.paint.get("fill-pattern"),Z=u.opaquePassEnabledForLayer()&&!B.constantOr(1)&&S.constantOr(m.aM.transparent).a===1&&C.constantOr(0)===1?"opaque":"translucent";if(u.renderPass===Z){const U=u.depthModeForSublayer(1,u.renderPass==="opaque"?de.ReadWrite:de.ReadOnly);dn(u,y,x,w,U,A,!1)}if(u.renderPass==="translucent"&&x.paint.get("fill-antialias")){const U=u.depthModeForSublayer(x.getPaintProperty("fill-outline-color")?2:0,de.ReadOnly);dn(u,y,x,w,U,A,!0)}})(t,s,a,l);break;case"fill-extrusion":(function(u,y,x,w){const S=x.paint.get("fill-extrusion-opacity");if(S!==0&&u.renderPass==="translucent"){const C=new de(u.context.gl.LEQUAL,de.ReadWrite,u.depthRangeFor3D);if(S!==1||x.paint.get("fill-extrusion-pattern").constantOr(1))bo(u,y,x,w,C,be.disabled,ri.disabled),bo(u,y,x,w,C,u.stencilModeFor3D(),u.colorModeForRenderPass());else{const A=u.colorModeForRenderPass();bo(u,y,x,w,C,be.disabled,A)}}})(t,s,a,l);break;case"hillshade":(function(u,y,x,w){if(u.renderPass!=="offscreen"&&u.renderPass!=="translucent")return;const S=u.context,C=u.depthModeForSublayer(0,de.ReadOnly),A=u.colorModeForRenderPass(),[B,Z]=u.renderPass==="translucent"?u.stencilConfigForOverlap(w):[{},w];for(const U of Z){const G=y.getTile(U);G.needsHillshadePrepare!==void 0&&G.needsHillshadePrepare&&u.renderPass==="offscreen"?Ms(u,G,x,C,be.disabled,A):u.renderPass==="translucent"&&Bn(u,U,G,x,C,B[U.overscaledZ],A)}S.viewport.set([0,0,u.width,u.height])})(t,s,a,l);break;case"raster":(function(u,y,x,w){if(u.renderPass!=="translucent"||x.paint.get("raster-opacity")===0||!w.length)return;const S=u.context,C=S.gl,A=y.getSource(),B=u.useProgram("raster"),Z=u.colorModeForRenderPass(),[U,G]=A instanceof Zn?[{},w]:u.stencilConfigForOverlap(w),X=G[G.length-1].overscaledZ,K=!u.options.moving;for(const Q of G){const j=u.depthModeForSublayer(Q.overscaledZ-X,x.paint.get("raster-opacity")===1?de.ReadWrite:de.ReadOnly,C.LESS),nt=y.getTile(Q);nt.registerFadeDuration(x.paint.get("raster-fade-duration"));const rt=y.findLoadedParent(Q,0),ht=y.findLoadedSibling(Q),yt=Xn(nt,rt||ht||null,y,x,u.transform,u.style.map.terrain);let Tt,zt;const Rt=x.paint.get("raster-resampling")==="nearest"?C.NEAREST:C.LINEAR;S.activeTexture.set(C.TEXTURE0),nt.texture.bind(Rt,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(C.TEXTURE1),rt?(rt.texture.bind(Rt,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),Tt=Math.pow(2,rt.tileID.overscaledZ-nt.tileID.overscaledZ
vendor: 22,030 bytes, line 583
583),zt=[nt.tileID.canonical.x*Tt%1,nt.tileID.canonical.y*Tt%1]):nt.texture.bind(Rt,C.CLAMP_TO_EDGE,C.LINEAR_MIPMAP_NEAREST),nt.texture.useMipmap&&S.extTextureFilterAnisotropic&&u.transform.pitch>20&&C.texParameterf(C.TEXTURE_2D,S.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,S.extTextureFilterAnisotropicMax);const Ct=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Q),It=Ct?Q:null,Zt=It?It.posMatrix:u.transform.calculatePosMatrix(Q.toUnwrapped(),K),ee=Qo(Zt,zt||[0,0],Tt||1,yt,x);A instanceof Zn?B.draw(S,C.TRIANGLES,j,be.disabled,Z,Ce.disabled,ee,Ct,x.id,A.boundsBuffer,u.quadTriangleIndexBuffer,A.boundsSegments):B.draw(S,C.TRIANGLES,j,U[Q.overscaledZ],Z,Ce.disabled,ee,Ct,x.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}})(t,s,a,l);break;case"background":(function(u,y,x,w){const S=x.paint.get("background-color"),C=x.paint.get("background-opacity");if(C===0)return;const A=u.context,B=A.gl,Z=u.transform,U=Z.tileSize,G=x.paint.get("background-pattern");if(u.isPatternMissing(G))return;const X=!G&&S.a===1&&C===1&&u.opaquePassEnabledForLayer()?"opaque":"translucent";if(u.renderPass!==X)return;const K=be.disabled,Q=u.depthModeForSublayer(0,X==="opaque"?de.ReadWrite:de.ReadOnly),j=u.colorModeForRenderPass(),nt=u.useProgram(G?"backgroundPattern":"background"),rt=w||Z.coveringTiles({tileSize:U,terrain:u.style.map.terrain});G&&(A.activeTexture.set(B.TEXTURE0),u.imageManager.bind(u.context));const ht=x.getCrossfadeParameters();for(const yt of rt){const Tt=w?yt.posMatrix:u.transform.calculatePosMatrix(yt.toUnwrapped()),zt=G?ta(Tt,C,u,G,{tileID:yt,tileSize:U},ht):Gs(Tt,C,S),Rt=u.style.map.terrain&&u.style.map.terrain.getTerrainData(yt);nt.draw(A,B.TRIANGLES,Q,K,j,Ce.disabled,zt,Rt,x.id,u.tileExtentBuffer,u.quadTriangleIndexBuffer,u.tileExtentSegments)}})(t,0,a,l);break;case"custom":(function(u,y,x){const w=u.context,S=x.implementation;if(u.renderPass==="offscreen"){const C=S.prerender;C&&(u.setCustomLayerDefaults(),w.setColorMode(u.colorModeForRenderPass()),C.call(S,w.gl,u.transform.customLayerMatrix()),w.setDirty(),u.setBaseState())}else if(u.renderPass==="translucent"){u.setCustomLayerDefaults(),w.setColorMode(u.colorModeForRenderPass()),w.setStencilMode(be.disabled);const C=S.renderingMode==="3d"?new de(u.context.gl.LEQUAL,de.ReadWrite,u.depthRangeFor3D):u.depthModeForSublayer(0,de.ReadOnly);w.setDepthMode(C),S.render(w.gl,u.transform.customLayerMatrix(),{farZ:u.transform.farZ,nearZ:u.transform.nearZ,fov:u.transform._fov,modelViewProjectionMatrix:u.transform.modelViewProjectionMatrix,projectionMatrix:u.transform.projectionMatrix}),w.setDirty(),u.setBaseState(),w.bindFramebuffer.set(null)}})(t,0,a)}}translatePosMatrix(t,s,a,l,u){if(!a[0]&&!a[1])return t;const y=u?l==="map"?this.transform.angle:0:l==="viewport"?-this.transform.angle:0;if(y){const S=Math.sin(y),C=Math.cos(y);a=[a[0]*C-a[1]*S,a[0]*S+a[1]*C]}const x=[u?a[0]:me(s,a[0],this.transform.zoom),u?a[1]:me(s,a[1],this.transform.zoom),0],w=new Float32Array(16);return m.J(w,t,x),w}saveTileTexture(t){const s=this._tileTextures[t.size[0]];s?s.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const s=this._tileTextures[t];return s&&s.length>0?s.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const s=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!s||!a}useProgram(t,s){this.cache=this.cache||{};const a=t+(s?s.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new Kr(this.context,Cr[t],s,fo[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new le(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:s}=this.context.gl;return this.width!==t||this.height!==s}}class ks{constructor(t,s){this.points=t,this.planes=s}static fromInvProjectionMatrix(t,s,a){const l=Math.pow(2,a),u=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(x=>{const w=1/(x=m.af([],x,t))[3]/s*l;return m.b1(x,x,[w,w,1/x[3],w])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(x=>{const w=function(B,Z){var U=Z[0],G=Z[1],X=Z[2],K=U*U+G*G+X*X;return K>0&&(K=1/Math.sqrt(K)),B[0]=Z[0]*K,B[1]=Z[1]*K,B[2]=Z[2]*K,B}([],function(B,Z,U){var G=Z[0],X=Z[1],K=Z[2],Q=U[0],j=U[1],nt=U[2];return B[0]=X*nt-K*j,B[1]=K*Q-G*nt,B[2]=G*j-X*Q,B}([],rn([],u[x[0]],u[x[1]]),rn([],u[x[2]],u[x[1]]))),S=-((C=w)[0]*(A=u[x[1]])[0]+C[1]*A[1]+C[2]*A[2]);var C,A;return w.concat(S)});return new ks(u,y)}}class ls{constructor(t,s){this.min=t,this.max=s,this.center=function(a,l,u){return a[0]=.5*l[0],a[1]=.5*l[1],a[2]=.5*l[2],a}([],function(a,l,u){return a[0]=l[0]+u[0],a[1]=l[1]+u[1],a[2]=l[2]+u[2],a}([],this.min,this.max))}quadrant(t){const s=[t%2==0,t<2],a=Vi(this.min),l=Vi(this.max);for(let u=0;u<s.length;u++)a[u]=s[u]?this.min[u]:this.center[u],l[u]=s[u]?this.center[u]:this.max[u];return l[2]=this.max[2],new ls(a,l)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const s=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let a=!0;for(let l=0;l<t.planes.length;l++){const u=t.planes[l];let y=0;for(let x=0;x<s.length;x++)m.b2(u,s[x])>=0&&y++;if(y===0)return 0;y!==s.length&&(a=!1)}if(a)return 2;for(let l=0;l<3;l++){let u=Number.MAX_VALUE,y=-Number.MAX_VALUE;for(let x=0;x<t.points.length;x++){const w=t.points[x][l]-this.min[l];u=Math.min(u,w),y=Math.max(y,w)}if(y<0||u>this.max[l]-this.min[l])return 0}return 1}}class zs{constructor(t=0,s=0,a=0,l=0){if(isNaN(t)||t<0||isNaN(s)||s<0||isNaN(a)||a<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=s,this.left=a,this.right=l}interpolate(t,s,a){return s.top!=null&&t.top!=null&&(this.top=m.y.number(t.top,s.top,a)),s.bottom!=null&&t.bottom!=null&&(this.bottom=m.y.number(t.bottom,s.bottom,a)),s.left!=null&&t.left!=null&&(this.left=m.y.number(t.left,s.left,a)),s.right!=null&&t.right!=null&&(this.right=m.y.number(t.right,s.right,a)),this}getCenter(t,s){const a=m.ac((this.left+t-this.right)/2,0,t),l=m.ac((this.top+s-this.bottom)/2,0,s);return new m.P(a,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new zs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Io=85.051129;class Es{constructor(t,s,a,l,u){this.tileSize=512,this._renderWorldCopies=u===void 0||!!u,this._minZoom=t||0,this._maxZoom=s||22,this._minPitch=a??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new m.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new Es(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new m.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const s=-m.b3(t,-180,180)*Math.PI/180;this.angle!==s&&(this._unmodified=!1,this.angle=s,this._calcMatrices(),this.rotationMatrix=function(){var a=new m.A(4);return m.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,l,u){var y=l[0],x=l[1],w=l[2],S=l[3],C=Math.sin(u),A=Math.cos(u);a[0]=y*A+w*C,a[1]=x*A+S*C,a[2]=y*-C+w*A,a[3]=x*-C+S*A}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const s=m.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==s&&(this._unmodified=!1,this._pitch=s,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const s=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==s&&(this._unmodified=!1,this._zoom=s,this.tileZoom=Math.max(0,Math.floor(s)),this.scale=this.zoomScale(s),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,s,a){this._unmodified=!1,this._edgeInsets.interpolate(t,s,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const s=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,s)}getVisibleUnwrappedCoordinates(t){const s=[new m.b4(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new m.P(0,0)),l=this.pointCoordinate(new m.P(this.width,0)),u=this.pointCoordinate(new m.P(this.width,this.height)),y=this.pointCoordinate(new m.P(0,this.height)),x=Math.floor(Math.min(a.x,l.x,u.x,y.x)),w=Math.floor(Math.max(a.x,l.x,u.x,y.x)),S=1;for(let C=x-S;C<=w+S;C++)C!==0&&s.push(new m.b4(C,t))}return s}coveringTiles(t){var s,a;let l=this.coveringZoomLevel(t);const u=l;if(t.minzoom!==void 0&&l<t.minzoom)return[];t.maxzoom!==void 0&&l>t.maxzoom&&(l=t.maxzoom);const y=this.pointCoordinate(this.getCameraPoint()),x=m.Z.fromLngLat(this.center),w=Math.pow(2,l),S=[w*y.x,w*y.y,0],C=[w*x.x,w*x.y,0],A=ks.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,l);let B=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(B=l);const Z=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,U=j=>({aabb:new ls([j*w,0,0],[(j+1)*w,w,0]),zoom:0,x:0,y:0,wrap:j,fullyVisible:!1}),G=[],X=[],K=l,Q=t.reparseOverscaled?u:l;if(this._renderWorldCopies)for(let j=1;j<=3;j++)G.push(U(-j)),G.push(U(j));for(G.push(U(0));G.length>0;){const j=G.pop(),nt=j.x,rt=j.y;let ht=j.fullyVisible;if(!ht){const Ct=j.aabb.intersects(A);if(Ct===0)continue;ht=Ct===2}const yt=t.terrain?S:C,Tt=j.aabb.distanceX(yt),zt=j.aabb.distanceY(yt),Rt=Math.max(Math.abs(Tt),Math.abs(zt));if(j.zoom===K||Rt>Z+(1<<K-j.zoom)-2&&j.zoom>=B){const Ct=K-j.zoom,It=S[0]-.5-(nt<<Ct),Zt=S[1]-.5-(rt<<Ct);X.push({tileID:new m.S(j.zoom===K?Q:j.zoom,j.wrap,j.zoom,nt,rt),distanceSq:qs([C[0]-.5-nt,C[1]-.5-rt]),tileDistanceToCamera:Math.sqrt(It*It+Zt*Zt)})}else for(let Ct=0;Ct<4;Ct++){const It=(nt<<1)+Ct%2,Zt=(rt<<1)+(Ct>>1),ee=j.zoom+1;let At=j.aabb.quadrant(Ct);if(t.terrain){const Lt=new m.S(ee,j.wrap,ee,It,Zt),Yt=t.terrain.getMinMaxElevation(Lt),Ke=(s=Yt.minElevation)!==null&&s!==void 0?s:this.elevation,pe=(a=Yt.maxElevation)!==null&&a!==void 0?a:this.elevation;At=new ls([At.min[0],At.min[1],Ke],[At.max[0],At.max[1],pe])}G.push({aabb:At,zoom:ee,x:It,y:Zt,wrap:j.wrap,fullyVisible:ht})}}return X.sort((j,nt)=>j.distanceSq-nt.distanceSq).map(j=>j.tileID)}resize(t,s){this.width=t,this.height=s,this.pixelsToGLUnits=[2/t,-2/s],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const s=m.ac(t.lat,-85.051129,Io);return new m.P(m.O(t.lng)*this.worldSize,m.Q(s)*this.worldSize)}unproject(t){return new m.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const s=this.elevation,a=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,l=this.pointLocation(this.centerPoint,t),u=t.getElevationForLngLatZoom(l,this.tileZoom);if(!(this.elevation-u))return;const y=a+s-u,x=Math.cos(this._pitch)*this.cameraToCenterDistance/y/m.b5(1,l.lat),w=this.scaleZoom(x/this.tileSize);this._elevation=u,this._center=l,this.zoom=w}setLocationAtPoint(t,s){const a=this.pointCoordinate(s),l=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(t),y=new m.Z(u.x-(a.x-l.x),u.y-(a.y-l.y));this.center=this.coordinateLocation(y),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,s){return s?this.coordinatePoint(this.locationCoordinate(t),s.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,s){return this.coordinateLocation(this.pointCoordinate(t,s))}locationCoordinate(t){return m.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,s){if(s){const B=s.pointCoordinate(t);if(B!=null)return B}const a=[t.x,t.y,0,1],l=[t.x,t.y,1,1];m.af(a,a,this.pixelMatrixInverse),m.af(l,l,this.pixelMatrixInverse);const u=a[3],y=l[3],x=a[1]/u,w=l[1]/y,S=a[2]/u,C=l[2]/y,A=S===C?0:(0-S)/(C-S);return new m.Z(m.y.number(a[0]/u,l[0]/y,A)/this.worldSize,m.y.number(x,w,A)/this.worldSize)}coordinatePoint(t,s=0,a=this.pixelMatrix){const l=[t.x*this.worldSize,t.y*this.worldSize,s,1];return m.af(l,l,a),new m.P(l[0]/l[3],l[1]/l[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new ut().extend(this.pointLocation(new m.P(0,t))).extend(this.pointLocation(new m.P(this.width,t))).extend(this.pointLocation(new m.P(this.width,this.height))).extend(this.pointLocation(new m.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ut([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Io])}calculateTileMatrix(t){const s=t.canonical,a=this.worldSize/this.zoomScale(s.z),l=s.x+Math.pow(2,s.z)*t.wrap,u=m.an(new Float64Array(16));return m.J(u,u,[l*a,s.y*a,0]),m.K(u,u,[a/m.X,a/m.X,1]),u}calculatePosMatrix(t,s=!1){const a=t.key,l=s?this._alignedPosMatrixCache:this._posMatrixCache;if(l[a])return l[a];const u=this.calculateTileMatrix(t);return m.L(u,s?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,u),l[a]=new Float32Array(u),l[a]}calculateFogMatrix(t){const s=t.key,a=this._fogMatrixCache;if(a[s])return a[s];const l=this.calculateTileMatrix(t);return m.L(l,this.fogMatrix,l),a[s]=new Float32Array(l),a[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,s){s=m.ac(+s,this.minZoom,this.maxZoom);const a={center:new m.N(t.lng,t.lat),zoom:s};let l=this.lngRange;if(!this._renderWorldCopies&&l===null){const j=179.9999999999;l=[-j,j]}const u=this.tileSize*this.zoomScale(a.zoom);let y=0,x=u,w=0,S=u,C=0,A=0;const{x:B,y:Z}=this.size;if(this.latRange){const j=this.latRange;y=m.Q(j[1])*u,x=m.Q(j[0])*u,x-y<Z&&(C=Z/(x-y))}l&&(w=m.b3(m.O(l[0])*u,0,u),S=m.b3(m.O(l[1])*u,0,u),S<w&&(S+=u),S-w<B&&(A=B/(S-w)));const{x:U,y:G}=this.project.call({worldSize:u},t);let X,K;const Q=Math.max(A||0,C||0);if(Q){const j=new m.P(A?(S+w)/2:U,C?(x+y)/2:G);return a.center=this.unproject.call({worldSize:u},j).wrap(),a.zoom+=this.scaleZoom(Q),a}if(this.latRange){const j=Z/2;G-j<y&&(K=y+j),G+j>x&&(K=x-j)}if(l){const j=(w+S)/2;let nt=U;this._renderWorldCopies&&(nt=m.b3(U,j-u/2,j+u/2));const rt=B/2;nt-rt<w&&(X=w+rt),nt+rt>S&&(X=S-rt)}if(X!==void 0||K!==void 0){const j=new m.P(X??U,K??G);a.center=this.unproject.call({worldSize:u},j).wrap()}return a}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:s,zoom:a}=this.getConstrained(this.center,this.zoom);this.center=s,this.zoom=a,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,s=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=m.b5(1,this.center.lat)*this.worldSize;let l=m.an(new Float64Array(16));m.K(l,l,[this.width/2,-this.height/2,1]),m.J(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=m.an(new Float64Array(16)),m.K(l,l,[1,-1,1]),m.J(l,l,[-1,-1,0]),m.K(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;const u=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),y=Math.min(this.elevation,this.minElevationForCurrentTile),x=u-y*this._pixelPerMeter/Math.cos(this._pitch),w=y<0?x:u,S=Math.PI/2+this._pitch,C=this._fov*(.5+t.y/this.height),A=Math.sin(C)*w/Math.sin(m.ac(Math.PI-S-C,.01,Math.PI-.01)),B=this.getHorizon(),Z=2*Math.atan(B/this.cameraToCenterDistance)*(.5+t.y/(2*B)),U=Math.sin(Z)*w/Math.sin(m.ac(Math.PI-S-Z,.01,Math.PI-.01)),G=Math.min(A,U);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*G+w),this.nearZ=this.height/50,l=new Float64Array(16),m.b6(l,this._fov,this.width/this.height,this.nearZ,this.farZ),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,this.projectionMatrix=m.ae(l),m.K(l,l,[1,-1,1]),m.J(l,l,[0,0,-this.cameraToCenterDistance]),m.b7(l,l,this._pitch),m.ad(l,l,this.angle),m.J(l,l,[-s,-a,0]),this.mercatorMatrix=m.K([],l,[this.worldSize,this.worldSize,this.worldSize]),m.K(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=m.L(new Float64Array(16),this.labelPlaneMatrix,l),m.J(l,l,[0,0,-this.elevation]),this.modelViewProjectionMatrix=l,this.invModelViewProjectionMatrix=m.as([],l),this.fogMatrix=new Float64Array(16),m.b6(this.fogMatrix,this._fov,this.width/this.height,u,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,m.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),m.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),m.b7(this.fogMatrix,this.fogMatrix,this._pitch),m.ad(this.fogMatrix,this.fogMatrix,this.angle),m.J(this.fogMatrix,this.fogMatrix,[-s,-a,0]),m.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),m.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=m.L(new Float64Array(16),this.labelPlaneMatrix,l);const X=this.width%2/2,K=this.height%2/2,Q=Math.cos(this.angle),j=Math.sin(this.angle),nt=s-Math.round(s)+Q*X+j*K,rt=a-Math.round(a)+Q*K+j*X,ht=new Float64Array(l);if(m.J(ht,ht,[nt>.5?nt-1:nt,rt>.5?rt-1:rt,0]),this.alignedModelViewProjectionMatrix=ht,l=m.as(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new m.P(0,0)),s=[t.x*this.worldSize,t.y*this.worldSize,0,1];return m.af(s,s,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new m.P(0,t))}getCameraQueryGeometry(t){const s=this.getCameraPoint();if(t.length===1)return[t[0],s];{let a=s.x,l=s.y,u=s.x,y=s.y;for(const x of t)a=Math.min(a,x.x),l=Math.min(l,x.y),u=Math.max(u,x.x),y=Math.max(y,x.y);return[new m.P(a,l),new m.P(u,l),new m.P(u,y),new m.P(a,y),new m.P(a,l)]}}lngLatToCameraDepth(t,s){const a=this.locationCoordinate(t),l=[a.x*this.worldSize,a.y*this.worldSize,s,1];return m.af(l,l,this.modelViewProjectionMatrix),l[2]/l[3]}}function Hi(d,t){let s,a=!1,l=null,u=null;const y=()=>{l=null,a&&(d.apply(u,s),l=setTimeout(y,t),a=!1)};return(...x)=>(a=!0,u=this,s=x,l||y(),l)}class hs{constructor(t){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let a;return s.split("&").map(l=>
vendor: 10,397 bytes, line 583
583l.split("=")).forEach(l=>{l[0]===this._hashName&&(a=l)}),(a&&a[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(s.length>=3&&!s.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:a,pitch:+(s[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,s)},this._removeHash=()=>{const s=this._getCurrentHash();if(s.length===0)return;const a=s.join("/");let l=a;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${a}`);let u=window.location.hash.replace(l,"");u.startsWith("#&")?u=u.slice(0,1)+u.slice(2):u==="#"&&(u="");let y=window.location.href.replace(/(#.+)?$/,u);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=Hi(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const s=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,l=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,l),y=Math.round(s.lng*u)/u,x=Math.round(s.lat*u)/u,w=this._map.getBearing(),S=this._map.getPitch();let C="";if(C+=t?`/${y}/${x}/${a}`:`${a}/${x}/${y}`,(w||S)&&(C+="/"+Math.round(10*w)/10),S&&(C+=`/${Math.round(S)}`),this._hashName){const A=this._hashName;let B=!1;const Z=window.location.hash.slice(1).split("&").map(U=>{const G=U.split("=")[0];return G===A?(B=!0,`${G}=${C}`):U}).filter(U=>U);return B||Z.push(`${A}=${C}`),`#${Z.join("&")}`}return`#${C}`}}const Mo={linearity:.3,easing:m.b8(0,0,.3,1)},Ls=m.e({deceleration:2500,maxSpeed:1400},Mo),pl=m.e({deceleration:20,maxSpeed:1400},Mo),ha=m.e({deceleration:1e3,maxSpeed:360},Mo),Co=m.e({deceleration:1e3,maxSpeed:90},Mo);class cs{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:bt.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,s=bt.now();for(;t.length>0&&s-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,pan:new m.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:u}of this._inertiaBuffer)s.zoom+=u.zoomDelta||0,s.bearing+=u.bearingDelta||0,s.pitch+=u.pitchDelta||0,u.panDelta&&s.pan._add(u.panDelta),u.around&&(s.around=u.around),u.pinchAround&&(s.pinchAround=u.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(s.pan.mag()){const u=Kn(s.pan.mag(),a,m.e({},Ls,t||{}));l.offset=s.pan.mult(u.amount/s.pan.mag()),l.center=this._map.transform.center,Ys(l,u)}if(s.zoom){const u=Kn(s.zoom,a,pl);l.zoom=this._map.transform.zoom+u.amount,Ys(l,u)}if(s.bearing){const u=Kn(s.bearing,a,ha);l.bearing=this._map.transform.bearing+m.ac(u.amount,-179,179),Ys(l,u)}if(s.pitch){const u=Kn(s.pitch,a,Co);l.pitch=this._map.transform.pitch+u.amount,Ys(l,u)}if(l.zoom||l.bearing){const u=s.pinchAround===void 0?s.around:s.pinchAround;l.around=u?this._map.unproject(u):this._map.getCenter()}return this.clear(),m.e(l,{noMoveStart:!0})}}function Ys(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function Kn(d,t,s){const{maxSpeed:a,linearity:l,deceleration:u}=s,y=m.ac(d*l/(t/1e3),-a,a),x=Math.abs(y)/(u*l);return{easing:s.easing,duration:1e3*x,amount:y*(x/2)}}class bi extends m.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,a,l={}){const u=ft.mousePos(s.getCanvas(),a),y=s.unproject(u);super(t,m.e({point:u,lngLat:y,originalEvent:a},l)),this._defaultPrevented=!1,this.target=s}}class Or extends m.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,a){const l=t==="touchend"?a.changedTouches:a.touches,u=ft.touchPos(s.getCanvasContainer(),l),y=u.map(w=>s.unproject(w)),x=u.reduce((w,S,C,A)=>w.add(S.div(A.length)),new m.P(0,0));super(t,{points:u,point:x,lngLats:y,lngLat:s.unproject(x),originalEvent:a}),this._defaultPrevented=!1}}class Na extends m.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,s,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class Jn{constructor(t,s){this._map=t,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Na(t.type,this._map,t))}mousedown(t,s){return this._mousedownPos=s,this._firePreventable(new bi(t.type,this._map,t))}mouseup(t){this._map.fire(new bi(t.type,this._map,t))}click(t,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new bi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new bi(t.type,this._map,t))}mouseover(t){this._map.fire(new bi(t.type,this._map,t))}mouseout(t){this._map.fire(new bi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Or(t.type,this._map,t))}touchmove(t){this._map.fire(new Or(t.type,this._map,t))}touchend(t){this._map.fire(new Or(t.type,this._map,t))}touchcancel(t){this._map.fire(new Or(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ii{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new bi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new bi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new bi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class wn{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(m.P.convert(t),this._map.terrain)}}class wi{constructor(t,s){this._map=t,this._tr=new wn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,s){this.isEnabled()&&t.shiftKey&&t.button===0&&(ft.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(t,s){if(!this._active)return;const a=s;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=a,this._box||(this._box=ft.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const u=Math.min(l.x,a.x),y=Math.max(l.x,a.x),x=Math.min(l.y,a.y),w=Math.max(l.y,a.y);ft.setTransform(this._box,`translate(${u}px,${x}px)`),this._box.style.width=y-u+"px",this._box.style.height=w-x+"px"}mouseupWindow(t,s){if(!this._active||t.button!==0)return;const a=this._startPos,l=s;if(this.reset(),ft.suppressClick(),a.x!==l.x||a.y!==l.y)return this._map.fire(new m.k("boxzoomend",{originalEvent:t})),{cameraAnimation:u=>u.fitScreenCoordinates(a,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ft.remove(this._box),this._box=null),ft.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,s){return this._map.fire(new m.k(t,{originalEvent:s}))}}function Qs(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);const s={};for(let a=0;a<d.length;a++)s[d[a].identifier]=t[a];return s}class Ds{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,s,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(l){const u=new m.P(0,0);for(const y of l)u._add(y);return u.div(l.length)}(s),this.touches=Qs(a,s)))}touchmove(t,s,a){if(this.aborted||!this.centroid)return;const l=Qs(a,s);for(const u in this.touches){const y=l[u];(!y||y.dist(this.touches[u])>30)&&(this.aborted=!0)}}touchend(t,s,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Nr{constructor(t){this.singleTap=new Ds(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,s,a){this.singleTap.touchstart(t,s,a)}touchmove(t,s,a){this.singleTap.touchmove(t,s,a)}touchend(t,s,a){const l=this.singleTap.touchend(t,s,a);if(l){const u=t.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(l)<30;if(u&&y||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class us{constructor(t){this._tr=new wn(t),this._zoomIn=new Nr({numTouches:1,numTaps:2}),this._zoomOut=new Nr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,s,a){this._zoomIn.touchstart(t,s,a),this._zoomOut.touchstart(t,s,a)}touchmove(t,s,a){this._zoomIn.touchmove(t,s,a),this._zoomOut.touchmove(t,s,a)}
vendor: 5,081 bytes, line 583
583touchend(t,s,a){const l=this._zoomIn.touchend(t,s,a),u=this._zoomOut.touchend(t,s,a),y=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(l)},{originalEvent:t})}):u?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:x=>x.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(u)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Yn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const s=this._moveFunction(...t);if(s.bearingDelta||s.pitchDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(t,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=s.length?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,s){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const l=s.length?s[0]:s;return!this._moved&&l.dist(a)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(a,l))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&ft.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const ca={0:1,2:2};class to{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const s=ft.mouseButton(t);this._eventButton=s}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(s,a){const l=ca[a];return s.buttons===void 0||(s.buttons&l)!==l}(t,this._eventButton)}isValidEndEvent(t){return ft.mouseButton(t)===this._eventButton}}class Ao{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const eo=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=t=>{t.preventDefault()}},ko=({enable:d,clickTolerance:t,bearingDegreesPerPixelMoved:s=.8})=>{const a=new to({checkCorrectEvent:l=>ft.mouseButton(l)===0&&l.ctrlKey||ft.mouseButton(l)===2});return new Yn({clickTolerance:t,move:(l,u)=>({bearingDelta:(u.x-l.x)*s}),moveStateManager:a,enable:d,assignEvents:eo})},zo=({enable:d,clickTolerance:t,pitchDegreesPerPixelMoved:s=-.5})=>{const a=new to({checkCorrectEvent:l=>ft.mouseButton(l)===0&&l.ctrlKey||ft.mouseButton(l)===2});return new Yn({clickTolerance:t,move:(l,u)=>({pitchDelta:(u.y-l.y)*s}),moveStateManager:a,enable:d,assignEvents:eo})};class ds{constructor(t,s){this._clickTolerance=t.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new m.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,s,a){return this._calculateTransform(t,s,a)}touchmove(t,s,a){if(this._active){if(!this._shouldBePrevented(a.length))return t.preventDefault(),this._calculateTransform(t,s,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,s,a){this._calculateTransform(t,s,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,s,a){a.length>0&&(this._active=!0);const l=Qs(a,s),u=new m.P(0,0),y=new m.P(0,0);let x=0;for(const S in l){const C=l[S],A=this._touches[S];A&&(u._add(C),y._add(C.sub(A)),x++,l[S]=C)}if(this._touches=l,this._shouldBePrevented(x)||!y.mag())return;const w=y.div(x);return this._sum._add(w),this._sum.mag()<this._clickTolerance?void 0:{around:u.div(x),panDelta:w}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class io{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,s,a){this._firstTwoTouches||a.length<2||(this._firstTwoTouches=[a[0].identifier,a[1].identifier],this._start([s[0],s[1]]))}touchmove(t,s,a){if(!this._firstTwoTouches)return;t.preventDefault();const[l,u]=this._firstTwoTouches,y=Bs(a,s,l),x=Bs(a,s,u);if(!y||!x)return;const w=this._aroundCenter?null:y.add(x).div(2);return this._move([y,x],w,t)}
vendor: 4,599 bytes, line 583
583touchend(t,s,a){if(!this._firstTwoTouches)return;const[l,u]=this._firstTwoTouches,y=Bs(a,s,l),x=Bs(a,s,u);y&&x||(this._active&&ft.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Bs(d,t,s){for(let a=0;a<d.length;a++)if(d[a].identifier===s)return t[a]}function ua(d,t){return Math.log(d/t)/Math.LN2}class r extends io{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,s){const a=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(ua(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ua(this._distance,a),pinchAround:s}}}function c(d,t){return 180*d.angleWith(t)/Math.PI}class _ extends io{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,s,a){const l=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:c(this._vector,l),pinchAround:s}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const s=25/(Math.PI*this._minDiameter)*360,a=c(t,this._startVector);return Math.abs(a)<s}}function b(d){return Math.abs(d.y)>Math.abs(d.x)}class I extends io{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,s,a){super.touchstart(t,s,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,b(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,s,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=t[0].sub(this._lastPoints[0]),u=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,u,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(t,s,a){if(this._valid!==void 0)return this._valid;const l=t.mag()>=2,u=s.mag()>=2;if(!l&&!u)return;if(!l||!u)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const y=t.y>0==s.y>0;return b(t)&&b(s)&&y}}const F={panStep:100,bearingStep:15,pitchStep:10};class J{constructor(t){this._tr=new wn(t);const s=F;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let s=0,a=0,l=0,u=0,y=0;switch(t.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),y=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(a=0,l=0),{cameraAnimation:x=>{const w=this._tr;x.easeTo({duration:300,easeId:"keyboardHandler",easing:lt,zoom:s?Math.round(w.zoom)+s*(t.shiftKey?2:1):w.zoom,bearing:w.bearing+a*this._bearingStep,pitch:w.pitch+l*this._pitchStep,offset:[-u*this._panStep,-y*this._panStep],center:w.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function lt(d){return d*(2-d)}const pt=4.000244140625;class xt{constructor(t,s){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=t,this._tr=new wn(t),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let s=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;
vendor: 15,073 bytes, line 583
583const a=bt.now(),l=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,s!==0&&s%pt==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),t.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=t,this._delta-=s,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const s=ft.mousePos(this._map.getCanvas(),t),a=this._tr;this._around=s.y>a.transform.height/2-a.transform.getHorizon()?m.N.convert(this._aroundCenter?a.center:a.unproject(s)):m.N.convert(a.center),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>pt?this._wheelZoomRate:this._defaultZoomRate;let S=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&S!==0&&(S=1/S);const C=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(C*S))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,l=this._easing;let u,y=!1;const x=bt.now()-this._lastWheelEventTime;if(this._type==="wheel"&&a&&l&&x){const w=Math.min(x/200,1),S=l(w);u=m.y.number(a,s,S),w<1?this._frameId||(this._frameId=!0):y=!0}else u=s,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:u-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let s=m.b9;if(this._prevEase){const a=this._prevEase,l=(bt.now()-a.start)/a.duration,u=a.easing(l+.01)-a.easing(l),y=.27/Math.sqrt(u*u+1e-4)*.01,x=Math.sqrt(.0729-y*y);s=m.b8(y,x,.25,1)}return this._prevEase={start:bt.now(),duration:t,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Bt{constructor(t,s){this._clickZoom=t,this._tapZoom=s}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class te{constructor(t){this._tr=new wn(t),this.reset()}reset(){this._active=!1}dblclick(t,s){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ye{constructor(){this._tap=new Nr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,s,a){if(!this._swipePoint)if(this._tapTime){const l=s[0],u=t.timeStamp-this._tapTime<500,y=this._tapPoint.dist(l)<30;u&&y?a.length>0&&(this._swipePoint=l,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(t,s,a)}touchmove(t,s,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const l=s[0],u=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:u/128}}}else this._tap.touchmove(t,s,a)}touchend(t,s,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const l=this._tap.touchend(t,s,a);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ai{constructor(t,s,a){this._el=t,this._mousePan=s,this._touchPan=a}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ui{constructor(t,s,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=s,this._mousePitch=a}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Wi{constructor(t,s,a,l){this._el=t,this._touchZoom=s,this._touchRotate=a,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class di{constructor(t,s){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=t,this._options=s,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=ft.create("div","maplibregl-cooperative-gesture-screen",t);let s=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(s=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=s,this._container.appendChild(l);const u=document.createElement("div");u.className="maplibregl-mobile-message",u.textContent=a,this._container.appendChild(u),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(ft.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,s){this._enabled&&(this._map.fire(new m.k("cooperativegestureprevented",{gestureType:t,originalEvent:s})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ti=d=>d.zoom||d.drag||d.pitch||d.rotate;class Ft extends m.k{}function Eo(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class da{constructor(t,s){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,u)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=l.type==="renderFrame"?void 0:l,x={needsRenderFrame:!1},w={},S={},C=l.touches,A=C?this._getMapTouches(C):void 0,B=A?ft.touchPos(this._map.getCanvas(),A):ft.mousePos(this._map.getCanvas(),l);for(const{handlerName:G,handler:X,allowed:K}of this._handlers){if(!X.isEnabled())continue;let Q;this._blockedByActive(S,K,G)?X.reset():X[u||l.type]&&(Q=X[u||l.type](l,B,A),this.mergeHandlerResult(x,w,Q,G,y),Q&&Q.needsRenderFrame&&this._triggerRenderFrame()),(Q||X.isActive())&&(S[G]=X)}const Z={};for(const G in this._previousActiveHandlers)S[G]||(Z[G]=y);this._previousActiveHandlers=S,(Object.keys(Z).length||Eo(x))&&(this._changes.push([x,w,Z]),this._triggerRenderFrame()),(Object.keys(S).length||Eo(x))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:U}=x;U&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],U(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cs(t),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,u,y]of this._listeners)ft.addEventListener(l,u,l===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[t,s,a]of this._listeners)ft.removeEventListener(t,s,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const s=this._map,a=s.getCanvasContainer();this._add("mapEvent",new Jn(s,t));const l=s.boxZoom=new wi(s,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();const u=s.cooperativeGestures=new di(s,t.cooperativeGestures);this._add("cooperativeGestures",u),t.cooperativeGestures&&u.enable();const y=new us(s),x=new te(s);s.doubleClickZoom=new Bt(x,y),this._add("tapZoom",y),this._add("clickZoom",x),t.interactive&&t.doubleClickZoom&&s.doubleClickZoom.enable();const w=new ye;this._add("tapDragZoom",w);const S=s.touchPitch=new I(s);this._add("touchPitch",S),t.interactive&&t.touchPitch&&s.touchPitch.enable(t.touchPitch);const C=ko(t),A=zo(t);s.dragRotate=new ui(t,C,A),this._add("mouseRotate",C,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]),t.interactive&&t.dragRotate&&s.dragRotate.enable();const B=(({enable:Q,clickTolerance:j})=>{const nt=new to({checkCorrectEvent:rt=>ft.mouseButton(rt)===0&&!rt.ctrlKey});return new Yn({clickTolerance:j,move:(rt,ht)=>({around:ht,panDelta:ht.sub(rt)}),activateOnStart:!0,moveStateManager:nt,enable:Q,assignEvents:eo})})(t),Z=new ds(t,s);s.dragPan=new Ai(a,B,Z),this._add("mousePan",B),this._add("touchPan",Z,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&s.dragPan.enable(t.dragPan);const U=new _,G=new r;s.touchZoomRotate=new Wi(a,G,U,w),this._add("touchRotate",U,["touchPan","touchZoom"]),this._add("touchZoom",G,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&s.touchZoomRotate.enable(t.touchZoomRotate);const X=s.scrollZoom=new xt(s,()=>this._triggerRenderFrame());this._add("scrollZoom",X,["mousePan"]),t.interactive&&t.scrollZoom&&s.scrollZoom.enable(t.scrollZoom);const K=s.keyboard=new J(s);this._add("keyboard",K),t.interactive&&t.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new ii(s))}_add(t,s,a){this._handlers.push({handlerName:t,handler:s,allowed:a}),this._handlersById[t]=s}stop(t){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ti(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,s,a){for(const l in t)if(l!==a&&(!s||s.indexOf(l)<0))return!0;return!1}_getMapTouches(t){const s=[];for(const a of t)this._el.contains(a.target)&&s.push(a);return s}mergeHandlerResult(t,s,a,l,u){if(!a)return;m.e(t,a);const y={handlerName:l,originalEvent:a.originalEvent||u};a.zoomDelta!==void 0&&(s.zoom=y),a.panDelta!==void 0&&(s.drag=y),a.pitchDelta!==void 0&&(s.pitch=y),a.bearingDelta!==void 0&&(s.rotate=y)}_applyChanges(){const t={},s={},a={};for(const[l,u,y]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new m.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),m.e(s,u),m.e(a,y);this._updateMapTransform(t,s,a),this._changes=[]}_updateMapTransform(t,s,a){const l=this._map,u=l._getTransformForUpdate(),y=l.terrain;if(!(Eo(t)||y&&this._terrainMovement))return this._fireEvents(s,a,!0);let{panDelta:x,zoomDelta:w,bearingDelta:S,pitchDelta:C,around:A,pinchAround:B}=t;B!==void 0&&(A=B),l._stop(!0),A=A||l.transform.centerPoint;const Z=u.pointLocation(x?A.sub(x):A);S&&(u.bearing+=S),C&&(u.pitch+=C),w&&(u.zoom+=w),y?this._terrainMovement||!s.drag&&!s.zoom?s.drag&&this._terrainMovement?u.center=u.pointLocation(u.centerPoint.sub(x)):u.setLocationAtPoint(Z,A):(this._terrainMovement=!0,this._map._elevationFreeze=!0,u.setLocationAtPoint(Z,A)):u.setLocationAtPoint(Z,A),l._applyUpdatedTransform(u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(s,a,!0)}_fireEvents(t,s,a){const l=Ti(this._eventsInProgress),u=Ti(t),y={};for(const A in t){const{originalEvent:B}=t[A];this._eventsInProgress[A]||(y[`${A}start`]=B),this._eventsInProgress[A]=t[A]}!l&&u&&this._fireEvent("movestart",u.originalEvent);for(const A in y)this._fireEvent(A,y[A]);u&&this._fireEvent("move",u.originalEvent);for(const A in t){const{originalEvent:B}=t[A];this._fireEvent(A,B)}const x={};let w;for(const A in this._eventsInProgress){const{handlerName:B,originalEvent:Z}=this._eventsInProgress[A];this._handlersById[B].isActive()||(delete this._eventsInProgress[A],w=s[B]||Z,x[`${A}end`]=w)}for(const A in x)this._fireEvent(A,x[A]);const S=Ti(this._eventsInProgress),C=(l||u)&&!S;if(C&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const A=this._map._getTransformForUpdate();A.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(A)}if(a&&C){this._updatingCamera=!0;const A=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),B=Z=>Z!==0&&-this._bearingSnap<Z&&Z<this._bearingSnap;!A||!A.essential&&bt.prefersReducedMotion?(this._map.fire(new m.k("moveend",{originalEvent:w})),B(this._map.getBearing())&&this._map.resetNorth()):(B(A.bearing||this._map.getBearing())&&
vendor: 2,591 bytes, line 583
583(A.bearing=0),A.freezeElevation=!0,this._map.easeTo(A,{originalEvent:w})),this._updatingCamera=!1}}_fireEvent(t,s){this._map.fire(new m.k(t,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new Ft("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class pa extends m.E{constructor(t,s){super(),this._renderFrameCallback=()=>{const a=Math.min((bt.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=s.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new m.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,s){return this.jumpTo({center:t},s)}panBy(t,s,a){return t=m.P.convert(t).mult(-1),this.panTo(this.transform.center,m.e({offset:t},s),a)}panTo(t,s,a){return this.easeTo(m.e({center:t},s),a)}getZoom(){return this.transform.zoom}setZoom(t,s){return this.jumpTo({zoom:t},s),this}zoomTo(t,s,a){return this.easeTo(m.e({zoom:t},s),a)}zoomIn(t,s){return this.zoomTo(this.getZoom()+1,t,s),this}zoomOut(t,s){return this.zoomTo(this.getZoom()-1,t,s),this}getBearing(){return this.transform.bearing}setBearing(t,s){return this.jumpTo({bearing:t},s),this}getPadding(){return this.transform.padding}setPadding(t,s){return this.jumpTo({padding:t},s),this}rotateTo(t,s,a){return this.easeTo(m.e({bearing:t},s),a)}resetNorth(t,s){return this.rotateTo(0,m.e({duration:1e3},t),s),this}resetNorthPitch(t,s){return this.easeTo(m.e({bearing:0,pitch:0,duration:1e3},t),s),this}snapToNorth(t,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,s):this}getPitch(){return this.transform.pitch}setPitch(t,s){return this.jumpTo({pitch:t},s),this}cameraForBounds(t,s){t=ut.convert(t).adjustAntiMeridian();const a=s&&s.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),a,s)}_cameraForBoxAndBearing(t,s,a,l){const u={top:0,bottom:0,right:0,left:0};if(typeof(l=m.e({padding:u,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const Ct=l.padding;l.padding={top:Ct,bottom:Ct,right:Ct,left:Ct}}l.padding=m.e(u,l.padding);const y=this.transform,x=y.padding,w=new ut(t,s),S=y.project(w.getNorthWest()),C=y.project(w.getNorthEast()),A=y.project(w.getSouthEast()),B=y.project(w.getSouthWest
vendor: 12,800 bytes, line 583
583()),Z=m.ba(-a),U=S.rotate(Z),G=C.rotate(Z),X=A.rotate(Z),K=B.rotate(Z),Q=new m.P(Math.max(U.x,G.x,K.x,X.x),Math.max(U.y,G.y,K.y,X.y)),j=new m.P(Math.min(U.x,G.x,K.x,X.x),Math.min(U.y,G.y,K.y,X.y)),nt=Q.sub(j),rt=(y.width-(x.left+x.right+l.padding.left+l.padding.right))/nt.x,ht=(y.height-(x.top+x.bottom+l.padding.top+l.padding.bottom))/nt.y;if(ht<0||rt<0)return void m.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const yt=Math.min(y.scaleZoom(y.scale*Math.min(rt,ht)),l.maxZoom),Tt=m.P.convert(l.offset),zt=new m.P((l.padding.left-l.padding.right)/2,(l.padding.top-l.padding.bottom)/2).rotate(m.ba(a)),Rt=Tt.add(zt).mult(y.scale/y.zoomScale(yt));return{center:y.unproject(S.add(A).div(2).sub(Rt)),zoom:yt,bearing:a}}fitBounds(t,s,a){return this._fitInternal(this.cameraForBounds(t,s),s,a)}fitScreenCoordinates(t,s,a,l,u){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(m.P.convert(t)),this.transform.pointLocation(m.P.convert(s)),a,l),l,u)}_fitInternal(t,s,a){return t?(delete(s=m.e(t,s)).padding,s.linear?this.easeTo(s,a):this.flyTo(s,a)):this}jumpTo(t,s){this.stop();const a=this._getTransformForUpdate();let l=!1,u=!1,y=!1;return"zoom"in t&&a.zoom!==+t.zoom&&(l=!0,a.zoom=+t.zoom),t.center!==void 0&&(a.center=m.N.convert(t.center)),"bearing"in t&&a.bearing!==+t.bearing&&(u=!0,a.bearing=+t.bearing),"pitch"in t&&a.pitch!==+t.pitch&&(y=!0,a.pitch=+t.pitch),t.padding==null||a.isPaddingEqual(t.padding)||(a.padding=t.padding),this._applyUpdatedTransform(a),this.fire(new m.k("movestart",s)).fire(new m.k("move",s)),l&&this.fire(new m.k("zoomstart",s)).fire(new m.k("zoom",s)).fire(new m.k("zoomend",s)),u&&this.fire(new m.k("rotatestart",s)).fire(new m.k("rotate",s)).fire(new m.k("rotateend",s)),y&&this.fire(new m.k("pitchstart",s)).fire(new m.k("pitch",s)).fire(new m.k("pitchend",s)),this.fire(new m.k("moveend",s))}calculateCameraOptionsFromTo(t,s,a,l=0){const u=m.Z.fromLngLat(t,s),y=m.Z.fromLngLat(a,l),x=y.x-u.x,w=y.y-u.y,S=y.z-u.z,C=Math.hypot(x,w,S);if(C===0)throw new Error("Can't calculate camera options with same From and To");const A=Math.hypot(x,w),B=this.transform.scaleZoom(this.transform.cameraToCenterDistance/C/this.transform.tileSize),Z=180*Math.atan2(x,-w)/Math.PI;let U=180*Math.acos(A/C)/Math.PI;return U=S<0?90-U:90+U,{center:y.toLngLat(),zoom:B,pitch:U,bearing:Z}}easeTo(t,s){var a;this._stop(!1,t.easeId),((t=m.e({offset:[0,0],duration:500,easing:m.b9},t)).animate===!1||!t.essential&&bt.prefersReducedMotion)&&(t.duration=0);const l=this._getTransformForUpdate(),u=l.zoom,y=l.bearing,x=l.pitch,w=l.padding,S="bearing"in t?this._normalizeBearing(t.bearing,y):y,C="pitch"in t?+t.pitch:x,A="padding"in t?t.padding:l.padding,B=m.P.convert(t.offset);let Z=l.centerPoint.add(B);const U=l.pointLocation(Z),{center:G,zoom:X}=l.getConstrained(m.N.convert(t.center||U),(a=t.zoom)!==null&&a!==void 0?a:u);this._normalizeCenter(G,l);const K=l.project(U),Q=l.project(G).sub(K),j=l.zoomScale(X-u);let nt,rt;t.around&&(nt=m.N.convert(t.around),rt=l.locationPoint(nt));const ht={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||X!==u,this._rotating=this._rotating||y!==S,this._pitching=this._pitching||C!==x,this._padding=!l.isPaddingEqual(A),this._easeId=t.easeId,this._prepareEase(s,t.noMoveStart,ht),this.terrain&&this._prepareElevation(G),this._ease(yt=>{if(this._zooming&&(l.zoom=m.y.number(u,X,yt)),this._rotating&&(l.bearing=m.y.number(y,S,yt)),this._pitching&&(l.pitch=m.y.number(x,C,yt)),this._padding&&(l.interpolatePadding(w,A,yt),Z=l.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(yt),nt)l.setLocationAtPoint(nt,rt);else{const Tt=l.zoomScale(l.zoom-u),zt=X>u?Math.min(2,j):Math.max(.5,j),Rt=Math.pow(zt,1-yt),Ct=l.unproject(K.add(Q.mult(yt*Rt)).mult(Tt));l.setLocationAtPoint(l.renderWorldCopies?Ct.wrap():Ct,Z)}this._applyUpdatedTransform(l),this._fireMoveEvents(s)},yt=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(s,yt)},t),this}_prepareEase(t,s,a={}){this._moving=!0,s||a.moving||this.fire(new m.k("movestart",t)),this._zooming&&!a.zooming&&this.fire(new m.k("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new m.k("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new m.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&s!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(s-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=s}this.transform.elevation=m.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){const s=t.getCameraPosition(),a=this.terrain.getElevationForLngLatZoom(s.lngLat,t.zoom);if(s.altitude<a){const l=this.calculateCameraOptionsFromTo(s.lngLat,a,t.center,t.elevation);return{pitch:l.pitch,zoom:l.zoom}}return{}}_applyUpdatedTransform(t){const s=[];if(this.terrain&&s.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&s.push(l=>this.transformCameraUpdate(l)),!s.length)return;const a=t.clone();for(const l of s){const u=a.clone(),{center:y,zoom:x,pitch:w,bearing:S,elevation:C}=l(u);y&&(u.center=y),x!==void 0&&(u.zoom=x),w!==void 0&&(u.pitch=w),S!==void 0&&(u.bearing=S),C!==void 0&&(u.elevation=C),a.apply(u)}this.transform.apply(a)}_fireMoveEvents(t){this.fire(new m.k("move",t)),this._zooming&&this.fire(new m.k("zoom",t)),this._rotating&&this.fire(new m.k("rotate",t)),this._pitching&&this.fire(new m.k("pitch",t))}_afterEase(t,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const a=this._zooming,l=this._rotating,u=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new m.k("zoomend",t)),l&&this.fire(new m.k("rotateend",t)),u&&this.fire(new m.k("pitchend",t)),this.fire(new m.k("moveend",t))}flyTo(t,s){var a;if(!t.essential&&bt.prefersReducedMotion){const Lt=m.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Lt,s)}this.stop(),t=m.e({offset:[0,0],speed:1.2,curve:1.42,easing:m.b9},t);const l=this._getTransformForUpdate(),u=l.zoom,y=l.bearing,x=l.pitch,w=l.padding,S="bearing"in t?this._normalizeBearing(t.bearing,y):y,C="pitch"in t?+t.pitch:x,A="padding"in t?t.padding:l.padding,B=m.P.convert(t.offset);let Z=l.centerPoint.add(B);const U=l.pointLocation(Z),{center:G,zoom:X}=l.getConstrained(m.N.convert(t.center||U),(a=t.zoom)!==null&&a!==void 0?a:u);this._normalizeCenter(G,l);const K=l.zoomScale(X-u),Q=l.project(U),j=l.project(G).sub(Q);let nt=t.curve;const rt=Math.max(l.width,l.height),ht=rt/K,yt=j.mag();if("minZoom"in t){const Lt=m.ac(Math.min(t.minZoom,u,X),l.minZoom,l.maxZoom),Yt=rt/l.zoomScale(Lt-u);nt=Math.sqrt(Yt/yt*2)}const Tt=nt*nt;function zt(Lt){const Yt=(ht*ht-rt*rt+(Lt?-1:1)*Tt*Tt*yt*yt)/(2*(Lt?ht:rt)*Tt*yt);return Math.log(Math.sqrt(Yt*Yt+1)-Yt)}function Rt(Lt){return(Math.exp(Lt)-Math.exp(-Lt))/2}function Ct(Lt){return(Math.exp(Lt)+Math.exp(-Lt))/2}const It=zt(!1);let Zt=function(Lt){return Ct(It)/Ct(It+nt*Lt)},ee=function(Lt){return rt*((Ct(It)*(Rt(Yt=It+nt*Lt)/Ct(Yt))-Rt(It))/Tt)/yt;var Yt},At=(zt(!0)-It)/nt;if(Math.abs(yt)<1e-6||!isFinite(At)){if(Math.abs(rt-ht)<1e-6)return this.easeTo(t,s);const Lt=ht<rt?-1:1;At=Math.abs(Math.log(ht/rt))/nt,ee=()=>0,Zt=Yt=>Math.exp(Lt*nt*Yt)}return t.duration="duration"in t?+t.duration:1e3*At/("screenSpeed"in t?+t.screenSpeed/nt:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=y!==S,this._pitching=C!==x,this._padding=!l.isPaddingEqual(A),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(G),this._ease(Lt=>{const Yt=Lt*At,Ke=1/Zt(Yt);l.zoom=Lt===1?X:u+l.scaleZoom(Ke),this._rotating&&(l.bearing=m.y.number(y,S,Lt)),this._pitching&&(l.pitch=m.y.number(x,C,Lt)),this._padding&&(l.interpolatePadding(w,A,Lt),Z=l.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(Lt);const pe=Lt===1?G:l.unproject(Q.add(j.mult(ee(Yt))).mult(Ke));l.setLocationAtPoint(l.renderWorldCopies?pe.wrap():pe,Z),this._applyUpdatedTransform(l),this._fireMoveEvents(s)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(s)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,s){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,s)}return t||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(t,s,a){a.animate===!1||a.duration===0?(t(1),s()):(this._easeStart=bt.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,s){t=m.b3(t,-180,180);const a=Math.abs(t-s);return Math.abs(t-360-s)<a&&(t-=360),Math.abs(t+360-s)<a&&(t+=360),t}_normalizeCenter(t,s){if(!s.renderWorldCopies||s.lngRange)return;const a=t.lng-s.center.lng;t.lng+=a>180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(m.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Rs={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ps{constructor(t=Rs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=ft.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ft.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ft.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){ft.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,s){const a=this._map._getUIString(`AttributionControl.${s}`);t.title=a,t.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="str
583ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const s=this._map.style.sourceCaches;for(const l in s){const u=s[l];if(u.used||u.usedForTerrain){const y=u.getSource();y.attribution&&t.indexOf(y.attribution)<0&&t.push(y.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,u)=>l.length-u.length),t=t.filter((l,u)=>{for(let y=u+1;y<t.length;y++)if(t[y].indexOf(l)>=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class si{constructor(t={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const a=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=ft.create("div","maplibregl-ctrl");const s=ft.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ft.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class fe{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const s=++this._id;return this._queue.push({callback:t,id:s,cancelled:!1}),s}remove(t){const s=this._currentlyRunning,a=s?this._queue.concat(s):this._queue;for(const l of a)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const a of s)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var fa=m.Y([{name:"a_pos3d",type:"Int16",components:3}]);class fl extends m.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,s){this.sourceCache.update(t,s),this._renderableTilesKeys=[];const a={};for(const l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s}))a[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),m.aP(l.posMatrix,0,m.X,0,m.X,0,1),this._tiles[l.key]=new Mr(l,this.tileSize));for(const l in this._tiles)a[l]||delete this._tiles[l]}freeRtt(t){for(const s in this._tiles){const a=this._tiles[s];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const s={};for(const a of this._renderableTilesKeys){const l=this._tiles[a].tileID;if(l.canonical.equals(t.canonical)){const u=t.clone();u.posMatrix=new Float64Array(16),m.aP(u.posMatrix,0,m.X,0,m.X,0,1),s[a]=u}else if(l.canonical.isChildOf(t.canonical)){const u=t.clone();u.posMatrix=new Float64Array(16);const y=l.canonical.z-t.canonical.z,x=l.canonical.x-(l.canonical.x>>y<<y),w=l.canonical.y-(l.canonical.y>>y<<y),S=m.X>>y;m.aP(u.posMatrix,0,S,0,S,0,1),m.J(u.posMatrix,u.posMatrix,[-x*S,-w*S,0]),s[a]=u}else if(t.canonical.isChildOf(l.canonical)){const u=t.clone();u.posMatrix=new Float64Array(16);const y=t.canonical.z-l.canonical.z,x=t.canonical.x-(t.canonical.x>>y<<y),w=t.canonical.y-(t.canonical.y>>y<<y),S=m.X>>y;m.aP(u.posMatrix,0,m.X,0,m.X,0,1),m.J(u.posMatrix,u.posMatrix,[x*S,w*S,0]),m.K(u.posMatrix,u.posMatrix,[1/2**y,1/2**y,0]),s[a]=u}}return s}getSourceTile(t,s){const a=this.sourceCache._source;let l=t.overscaledZ-this.deltaZoom;if(l>a.maxzoom&&(l=a.maxzoom),l<a.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(l).key);let u=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!u||!u.dem)&&s)for(;l>=a.minzoom&&(!u||!u.dem);)u=this.sourceCache.getTileByID(t.scaledTo(l--).key);return u}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(s=>s.timeAdded>=t)}}class ma{constructor(t,s,a){this.painter=t,this.sourceCache=new fl(s),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qual
vendor: 16,749 bytes, line 583
583ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,s,a,l=m.X){var u;if(!(s>=0&&s<l&&a>=0&&a<l))return 0;const y=this.getTerrainData(t),x=(u=y.tile)===null||u===void 0?void 0:u.dem;if(!x)return 0;const w=function(U,G,X){var K=G[0],Q=G[1];return U[0]=X[0]*K+X[4]*Q+X[12],U[1]=X[1]*K+X[5]*Q+X[13],U}([],[s/l*m.X,a/l*m.X],y.u_terrain_matrix),S=[w[0]*x.dim,w[1]*x.dim],C=Math.floor(S[0]),A=Math.floor(S[1]),B=S[0]-C,Z=S[1]-A;return x.get(C,A)*(1-B)*(1-Z)+x.get(C+1,A)*B*(1-Z)+x.get(C,A+1)*(1-B)*Z+x.get(C+1,A+1)*B*Z}getElevationForLngLatZoom(t,s){if(!m.bb(s,t.wrap()))return 0;const{tileID:a,mercatorX:l,mercatorY:u}=this._getOverscaledTileIDFromLngLatZoom(t,s);return this.getElevation(a,l%m.X,u%m.X,m.X)}getElevation(t,s,a,l=m.X){return this.getDEMElevation(t,s,a,l)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const l=this.painter.context,u=new m.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new le(l,u,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new le(l,new m.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=m.an([])}const s=this.sourceCache.getSourceTile(t,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const l=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new le(l,s.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),s.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const a=s&&s+s.tileID.key+t.key;if(a&&!this._demMatrixCache[a]){const l=this.sourceCache.sourceCache._source.maxzoom;let u=t.canonical.z-s.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=l?u=t.canonical.z-l:m.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=t.canonical.x-(t.canonical.x>>u<<u),x=t.canonical.y-(t.canonical.y>>u<<u),w=m.bc(new Float64Array(16),[1/(m.X<<u),1/(m.X<<u),0]);m.J(w,w,[y*m.X,x*m.X,0]),this._demMatrixCache[t.key]={matrix:w,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:a?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(t){const s=this.painter,a=s.width/devicePixelRatio,l=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===a&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new le(s.context,{width:a,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new le(s.context,{width:a,height:l,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(a,l,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,a,l))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let u=0,y=0;u<this._coordsTextureSize;u++)for(let x=0;x<this._coordsTextureSize;x++,y+=4)s[y+0]=255&x,s[y+1]=255&u,s[y+2]=x>>8<<4|u>>8,s[y+3]=0;const a=new m.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),l=new le(t,a,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const s=new Uint8Array(4),a=this.painter.context,l=a.gl,u=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),x=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(u,x-y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,s),a.bindFramebuffer.set(null);const w=s[0]+(s[2]>>4<<8),S=s[1]+((15&s[2])<<8),C=this.coordsIndex[255-s[3]],A=C&&this.sourceCache.getTileByID(C);if(!A)return null;const B=this._coordsTextureSize,Z=(1<<A.tileID.canonical.z)*B;return new m.Z((A.tileID.canonical.x*B+w)/Z+A.tileID.wrap,(A.tileID.canonical.y*B+S)/Z,this.getElevation(A.tileID,w,S,B))}depthAtPoint(t){const s=new Uint8Array(4),a=this.painter.context,l=a.gl;return a.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,s),a.bindFramebuffer.set(null),(s[0]/16777216+s[1]/65536+s[2]/256+s[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,s=new m.bd,a=new m.aY,l=this.meshSize,u=m.X/l,y=l*l;for(let A=0;A<=l;A++)for(let B=0;B<=l;B++)s.emplaceBack(B*u,A*u,0);for(let A=0;A<y;A+=l+1)for(let B=0;B<l;B++)a.emplaceBack(B+A,l+B+A+1,l+B+A+2),a.emplaceBack(B+A,l+B+A+2,B+A+1);const x=s.length,w=x+2*(l+1);for(const A of[0,1])for(let B=0;B<=l;B++)for(const Z of[0,1])s.emplaceBack(B*u,A*m.X,Z);for(let A=0;A<2*l;A+=2)a.emplaceBack(w+A,w+A+1,w+A+3),a.emplaceBack(w+A,w+A+3,w+A+2),a.emplaceBack(x+A,x+A+3,x+A+1),a.emplaceBack(x+A,x+A+2,x+A+3);const S=s.length,C=S+2*(l+1);for(const A of[0,1])for(let B=0;B<=l;B++)for(const Z of[0,1])s.emplaceBack(A*m.X,B*u,Z);for(let A=0;A<2*l;A+=2)a.emplaceBack(S+A,S+A+1,S+A+3),a.emplaceBack(S+A,S+A+3,S+A+2),a.emplaceBack(C+A,C+A+3,C+A+1),a.emplaceBack(C+A,C+A+2,C+A+3);return this._mesh=new So(t.createVertexBuffer(s,fa.members),t.createIndexBuffer(a),m.a0.simpleSegment(0,0,s.length,a.length)),this._mesh}getMeshFrameDelta(t){return 2*Math.PI*m.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,s){var a;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(t,s);return(a=this.getMinMaxElevation(l).minElevation)!==null&&a!==void 0?a:0}getMinMaxElevation(t){const s=this.getTerrainData(t).tile,a={minElevation:null,maxElevation:null};return s&&s.dem&&(a.minElevation=s.dem.min*this.exaggeration,a.maxElevation=s.dem.max*this.exaggeration),a}_getOverscaledTileIDFromLngLatZoom(t,s){const a=m.Z.fromLngLat(t.wrap()),l=(1<<s)*m.X,u=a.x*l,y=a.y*l,x=Math.floor(u/m.X),w=Math.floor(y/m.X);return{tileID:new m.S(s,0,s,x,w),mercatorX:u,mercatorY:y}}}class _a{constructor(t,s,a){this._context=t,this._size=s,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new le(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(a.texture),{id:t,fbo:s,texture:a,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(s=>t.id!==s),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(t=>!t.inUse)===!1}}const fs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Va{constructor(t,s){this.painter=t,this.terrain=s,this.pool=new _a(t.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(s)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const l=t.sourceCaches[a].getVisibleCoordinates();for(const u of l){const y=this.terrain.sourceCache.getTerrainCoords(u);for(const x in y)this._coordsDescendingInv[a][x]||(this._coordsDescendingInv[a][x]=[]),this._coordsDescendingInv[a][x].push(y[x])}}this._coordsDescendingInvStr={};for(const a of t._order){const l=t._layers[a],u=l.source;if(fs[l.type]&&!this._coordsDescendingInvStr[u]){this._coordsDescendingInvStr[u]={};for(const y in this._coordsDescendingInv[u])this._coordsDescendingInvStr[u][y]=this._coordsDescendingInv[u][y].map(x=>x.key).sort().join()}}for(const a of this._renderableTiles)for(const l in this._coordsDescendingInvStr){const u=this._coordsDescendingInvStr[l][a.tileID.key];u&&u!==a.rttCoords[l]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const s=t.type,a=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(fs[s]&&(this._prevType&&fs[this._prevType]||this._stacks.push([]),this._prevType=s,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(fs[this._prevType]||fs[s]&&l){this._prevType=s;const u=this._stacks.length-1,y=this._stacks[u]||[];for(const x of this._renderableTiles){if(this.pool.isFull()&&(la(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(x),x.rtt[u]){const S=this.pool.getObjectForId(x.rtt[u].id);if(S.stamp===x.rtt[u].stamp){this.pool.useObject(S);continue}}const w=this.pool.getOrCreateFreeObject();this.pool.useObject(w),this.pool.stampObject(w),x.rtt[u]={id:w.id,stamp:w.stamp},a.context.bindFramebuffer.set(w.fbo.framebuffer),a.context.clear({color:m.aM.transparent,stencil:0}),a.currentStencilSource=void 0;for(let S=0;S<y.length;S++){const C=a.style._layers[y[S]],A=C.source?this._coordsDescendingInv[C.source][x.tileID.key]:[x.tileID];a.context.viewport.set([0,0,w.fbo.width,w.fbo.height]),a._renderTileClippingMasks(C,A),a.renderLayer(a,a.style.sourceCaches[C.source],C,A),C.source&&(x.rttCoords[C.source]=this._coordsDescendingInvStr[C.source][x.tileID.key])}}return la(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),fs[s]}return!1}}const ml={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use â + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Fl=ae,lh={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Rs,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:m.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},_l=d=>{d.touchstart=d.dragStart,d.touchmoveWindow=d.dragMove,d.touchend=d.dragEnd},hh={showCompass:!0,showZoom:!0,visualizePitch:!1};class ch{constructor(t,s,a=!1){this.mousedown=y=>{this.startMouse(m.e({},y,{ctrlKey:!0,preventDefault:()=>y.preventDefault()}),ft.mousePos(this.element,y)),ft.addEventListener(window,"mousemove",this.mousemove),ft.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=y=>{this.moveMouse(y,ft.mousePos(this.element,y))},this.mouseup=y=>{this.mouseRotate.dragEnd(y),this.mousePitch&&this.mousePitch.dragEnd(y),this.offTemp()},this.touchstart=y=>{y.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ft.touchPos(this.element,y.targetTouches)[0],this.startTouch(y,this._startPos),ft.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ft.addEventListener(window,"touchend",this.touchend))},this.touchmove=y=>{y.targetTouches.length!==1?this.reset():(this._lastPos=ft.touchPos(this.element,y.targetTouches)[0],this.moveTouch(y,this._lastPos))},this.touchend=y=>{y.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const l=t.dragRotate._mouseRotate.getClickTolerance(),u=t.dragRotate._mousePitch.getClickTolerance();this.element=s,this.mouseRotate=ko({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:y,clickTolerance:x,bearingDegreesPerPixelMoved:w=.8})=>{const S=new Ao;return new Yn({clickTolerance:x,move:(C,A)=>({bearingDelta:(A.x-C.x)*w}),moveStateManager:S,enable:y,assignEvents:_l})})({clickTolerance:l,enable:!0}),this.map=t,a&&(this.mousePitch=zo({clickTolerance:u,enable:!0}),this.touchPitch=(({enable:y,clickTolerance:x,pitchDegreesPerPixelMoved:w=-.5})=>{const S=new Ao;return new Yn({clickTolerance:x,move:(C,A)=>({pitchDelta:(A.y-C.y)*w}),moveStateManager:S,enable:y,assignEvents:_l})})({clickTolerance:u,enable:!0})),ft.addEventListener(s,"mousedown",this.mousedown),ft.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),ft.addEventListener(s,"touchcancel",this.reset)}startMouse(t,s){this.mouseRotate.dragStart(t,s),this.mousePitch&&this.mousePitch.dragStart(t,s),ft.disableDrag()}startTouch(t,s){this.touchRotate.dragStart(t,s),this.touchPitch&&this.touchPitch.dragStart(t,s),ft.disableDrag()}moveMouse(t,s){const a=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,s)||{};if(l&&a.setBearing(a.getBearing()+l),this.mousePitch){const{pitchDelta:u}=this.mousePitch.dragMove(t,s)||{};u&&a.setPitch(a.getPitch()+u)}}moveTouch(t,s){const a=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,s)||{};if(l&&a.setBearing(a.getBearing()+l),this.touchPitch){const{pitchDelta:u}=this.touchPitch.dragMove(t,s)||{};u&&a.setPitch(a.getPitch()+u)}}off(){const t=this.element;ft.removeEventListener(t,"mousedown",this.mousedown),ft.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),ft.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ft.removeEventListener(window,"touchend",this.touchend),ft.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){ft.enableDrag(),ft.removeEventListener(window,"mousemove",this.mousemove),ft.removeEventListener(window,"mouseup",this.mouseup),ft.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ft.removeEventListener(window,"touchend",this.touchend)}}let Rn;function Xe(d,t,s){const a=new m.N(d.lng,d.lat);if(d=new m.N(d.lng,d.lat),t){const l=new m.N(d.lng-360,d.lat),u=new m.N(d.lng+360,d.lat),y=s.locationPoint(d).distSqr(t);s.locationPoint(l).distSqr(t)<y?d=l:s.locationPoint(u).distSqr(t)<y&&(d=u)}for(;Math.abs(d.lng-s.center.lng)>180;){const l=s.locationPoint(d);if(l.x>=0&&l.y>=0&&l.x<=s.width&&l.y<=s.height)break;d.lng>s.center.lng?d.lng-=360:d.lng+=360}return d.lng!==a.lng&&s.locationPoint(d).y>s.height/2-s.getHorizon()?d:a}
vendor: 21,711 bytes, line 583
583const Lo={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Za(d,t,s){const a=d.classList;for(const l in Lo)a.remove(`maplibregl-${s}-anchor-${l}`);a.add(`maplibregl-${s}-anchor-${t}`)}class Ua extends m.E{constructor(t){if(super(),this._onKeyPress=s=>{const a=s.code,l=s.charCode||s.keyCode;a!=="Space"&&a!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=s=>{const a=s.originalEvent.target,l=this._element;this._popup&&(a===l||l.contains(a))&&this.togglePopup()},this._update=s=>{var a;if(!this._map)return;const l=this._map.loaded()&&!this._map.isMoving();(s?.type==="terrain"||s?.type==="render"&&!l)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Xe(this._lngLat,this._flatPos,this._map.transform):(a=this._lngLat)===null||a===void 0?void 0:a.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let u="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?u=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(u=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let y="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?y="rotateX(0deg)":this._pitchAlignment==="map"&&(y=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||s&&s.type!=="moveend"||(this._pos=this._pos.round()),ft.setTransform(this._element,`${Lo[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${y} ${u}`),bt.frameAsync(new AbortController).then(()=>{this._updateOpacity(s&&s.type==="moveend")}).catch(()=>{})},this._onMove=s=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=s.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new m.k("dragstart"))),this.fire(new m.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new m.k("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(t?.opacity,t?.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=m.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ft.create("div");const s=ft.createNS("http://www.w3.org/2000/svg","svg"),a=41,l=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${a}px`),s.setAttributeNS(null,"width",`${l}px`),s.setAttributeNS(null,"viewBox",`0 0 ${l} ${a}`);const u=ft.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"stroke","none"),u.setAttributeNS(null,"stroke-width","1"),u.setAttributeNS(null,"fill","none"),u.setAttributeNS(null,"fill-rule","evenodd");const y=ft.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const x=ft.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"transform","translate(3.0, 29.0)"),x.setAttributeNS(null,"fill","#000000");const w=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const K of w){const Q=ft.createNS("http://www.w3.org/2000/svg","ellipse");Q.setAttributeNS(null,"opacity","0.04"),Q.setAttributeNS(null,"cx","10.5"),Q.setAttributeNS(null,"cy","5.80029008"),Q.setAttributeNS(null,"rx",K.rx),Q.setAttributeNS(null,"ry",K.ry),x.appendChild(Q)}const S=ft.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const C=ft.createNS("http://www.w3.org/2000/svg","path");C.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),S.appendChild(C);const A=ft.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"opacity","0.25"),A.setAttributeNS(null,"fill","#000000");const B=ft.createNS("http://www.w3.org/2000/svg","path");B.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),A.appendChild(B);const Z=ft.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const U=ft.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=ft.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const X=ft.createNS("http://www.w3.org/2000/svg","circle");X.setAttributeNS(null,"fill","#FFFFFF"),X.setAttributeNS(null,"cx","5.5"),X.setAttributeNS(null,"cy","5.5"),X.setAttributeNS(null,"r","5.4999962"),U.appendChild(G),U.appendChild(X),y.appendChild(x),y.appendChild(S),y.appendChild(A),y.appendChild(Z),y.appendChild(U),s.appendChild(y),s.setAttributeNS(null,"height",a*this._scale+"px"),s.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(s),this._offset=m.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",s=>{s.preventDefault()}),this._element.addEventListener("mousedown",s=>{s.preventDefault()}),Za(this._element,this._anchor,"marker"),t&&t.className)for(const s of t.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),ft.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=m.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var s,a;if(!(!((s=this._map)===null||s===void 0)&&s.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const l=this._map,u=l.terrain.depthAtPoint(this._pos),y=l.terrain.getElevationForLngLatZoom(this._lngLat,l.transform.tileZoom);if(l.transform.lngLatToCameraDepth(this._lngLat,y)-u<.006)return void(this._element.style.opacity=this._opacity);const x=-this._offset.y/l.transform._pixelPerMeter,w=Math.sin(l.getPitch()*Math.PI/180)*x,S=l.terrain.depthAtPoint(new m.P(this._pos.x,this._pos.y-this._offset.y)),C=l.transform.lngLatToCameraDepth(this._lngLat,y+w)-S>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&C&&this._popup.remove(),this._element.style.opacity=C?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=m.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,s){return t===void 0&&s===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=t),s!==void 0&&(this._opacityWhenCovered=s),this._map&&this._updateOpacity(!0),this}}const Ol={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ga=0,ya=!1;const Vr={maxWidth:100,unit:"metric"};function va(d,t,s){const a=s&&s.maxWidth||100,l=d._container.clientHeight/2,u=d.unproject([0,l]),y=d.unproject([a,l]),x=u.distanceTo(y);if(s&&s.unit==="imperial"){const w=3.2808*x;w>5280?Vt(t,a,w/5280,d._getUIString("ScaleControl.Miles")):Vt(t,a,w,d._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?Vt(t,a,x/1852,d._getUIString("ScaleControl.NauticalMiles")):x>=1e3?Vt(t,a,x/1e3,d._getUIString("ScaleControl.Kilometers")):Vt(t,a,x,d._getUIString("ScaleControl.Meters"))}function Vt(d,t,s,a){const l=function(u){const y=Math.pow(10,`${Math.floor(u)}`.length-1);let x=u/y;return x=x>=10?10:x>=5?5:x>=3?3:x>=2?2:x>=1?1:function(w){const S=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*S)/S}(x),y*x}(s);d.style.width=t*(l/s)+"px",d.innerHTML=`${l} ${a}`}const Wt={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ja=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function qa(d){if(d){if(typeof d=="number"){const t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new m.P(0,0),top:new m.P(0,d),"top-left":new m.P(t,t),"top-right":new m.P(-t,t),bottom:new m.P(0,-d),"bottom-left":new m.P(t,-t),"bottom-right":new m.P(-t,-t),left:new m.P(d,0),right:new m.P(-d,0)}}if(d instanceof m.P||Array.isArray(d)){const t=m.P.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:m.P.convert(d.center||[0,0]),top:m.P.convert(d.top||[0,0]),"top-left":m.P.convert(d["top-left"]||[0,0]),"top-right":m.P.convert(d["top-right"]||[0,0]),bottom:m.P.convert(d.bottom||[0,0]),"bottom-left":m.P.convert(d["bottom-left"]||[0,0]),"bottom-right":m.P.convert(d["bottom-right"]||[0,0]),left:m.P.convert(d.left||[0,0]),right:m.P.convert(d.right||[0,0])}}return qa(new m.P(0,0))}const gl=ae;O.AJAXError=m.bh,O.Evented=m.E,O.LngLat=m.N,O.MercatorCoordinate=m.Z,O.Point=m.P,O.addProtocol=m.bi,O.config=m.a,O.removeProtocol=m.bj,O.AttributionControl=ps,O.BoxZoomHandler=wi,O.CanvasSource=vn,O.CooperativeGesturesHandler=di,O.DoubleClickZoomHandler=Bt,O.DragPanHandler=Ai,O.DragRotateHandler=ui,O.EdgeInsets=zs,O.FullscreenControl=class extends m.E{constructor(d={}){super(),this._onFullscreenChange=()=>{var t;let s=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((t=s?.shadowRoot)===null||t===void 0)&&t.fullscreenElement;)s=s.shadowRoot.fullscreenElement;s===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,d&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:m.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=ft.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ft.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const d=this._fullscreenButton=ft.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ft.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new m.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new m.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},O.GeoJSONSource=Gr,O.GeolocateControl=class extends m.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new m.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new m.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const s=new m.N(t.coords.longitude,t.coords.latitude),a=t.coords.accuracy,l=this._map.getBearing(),u=m.e({bearing:l},this.options.fitBoundsOptions),y=ut.fromLngLat(s,a);this._map.fitBounds(y,u,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const s=new m.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&ya)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new m.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=ft.create("button","maplibregl-ctrl-geolocate",this._container),ft.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(t===!1){m.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
583se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ft.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ua({element:this._dotElement}),this._circleElement=ft.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ua({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new m.k("trackuserlocationend")),this.fire(new m.k("userlocationlostfocus")))})}},this.options=m.e({},Ol,d)}onAdd(d){return this._map=d,this._container=ft.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return m._(this,arguments,void 0,function*(t=!1){if(Rn!==void 0&&!t)return Rn;if(window.navigator.permissions===void 0)return Rn=!!window.navigator.geolocation,Rn;try{Rn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Rn=!!window.navigator.geolocation}return Rn})}().then(t=>this._finishSetupUI(t)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),ft.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ga=0,ya=!1}_isOutOfMapMaxBounds(d){const t=this._map.getMaxBounds(),s=d.coords;return t&&(s.longitude<t.getWest()||s.longitude>t.getEast()||s.latitude<t.getSouth()||s.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const d=this._map.getBounds(),t=d.getSouthEast(),s=d.getNorthEast(),a=t.distanceTo(s),l=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return m.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new m.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ga--,ya=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new m.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new m.k("trackuserlocationstart")),this.fire(new m.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ga++,ga>1?(d={maximumAge:6e5,timeout:0},ya=!0):(d=this.options.positionOptions,ya=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
583se"),this.options.showUserLocation&&this._updateMarker(null)}},O.Hash=hs,O.ImageSource=Zn,O.KeyboardHandler=J,O.LngLatBounds=ut,O.LogoControl=si,O.Map=class extends pa{constructor(d){m.bf.mark(m.bg.create);const t=Object.assign(Object.assign({},lh),d);if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Es(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new fe,this._controls=[],this._mapId=m.a4(),this._contextLost=s=>{s.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new m.k("webglcontextlost",{originalEvent:s}))},this._contextRestored=s=>{this._setupPainter(),this.resize(),this._update(),this.fire(new m.k("webglcontextrestored",{originalEvent:s}))},this._onMapScroll=s=>{if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=t.preserveDrawingBuffer===!0,this._antialias=t.antialias===!0,this._trackResize=t.trackResize===!0,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ml),t.locale),this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this.transformCameraUpdate=t.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=ti.addThrottleControl(()=>this.isMoving()),this._requestManager=new js(t.transformRequest),typeof t.container=="string"){if(this._container=document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let s=!1;const a=Hi(l=>{this._trackResize&&!this._removed&&(this.resize(l),this.redraw())},50);this._resizeObserver=new ResizeObserver(l=>{s?a(l):s=!0}),this._resizeObserver.observe(this._container)}this.handlers=new da(this,t),this._hash=t.hash&&new hs(typeof t.hash=="string"&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,m.e({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new ps(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new si,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",s=>{this._update(s.dataType==="style"),this.fire(new m.k(`${s.dataType}data`,s))}),this.on("dataloading",s=>{this.fire(new m.k(`${s.dataType}dataloading`,s))}),this.on("dataabort",s=>{this.fire(new m.k("sourcedataabort",s))})}_getMapId(){return this._mapId}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new m.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=d.onAdd(this);this._controls.push(d);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(s,a.firstChild):a.appendChild(s),this}
vendor: 14,794 bytes, line 583
583removeControl(d){if(!d||!d.onRemove)return this.fire(new m.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}calculateCameraOptionsFromTo(d,t,s,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(d,t,s,a)}resize(d){var t;const s=this._containerDimensions(),a=s[0],l=s[1],u=this._getClampedPixelRatio(a,l);if(this._resizeCanvas(a,l,u),this.painter.resize(a,l,u),this.painter.overLimit()){const x=this.painter.context.gl;this._maxCanvasSize=[x.drawingBufferWidth,x.drawingBufferHeight];const w=this._getClampedPixelRatio(a,l);this._resizeCanvas(a,l,w),this.painter.resize(a,l,w)}this.transform.resize(a,l),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,l);const y=!this._moving;return y&&(this.stop(),this.fire(new m.k("movestart",d)).fire(new m.k("move",d))),this.fire(new m.k("resize",d)),y&&this.fire(new m.k("moveend",d)),this}_getClampedPixelRatio(d,t){const{0:s,1:a}=this._maxCanvasSize,l=this.getPixelRatio(),u=d*l,y=t*l;return Math.min(u>s?s/u:1,y>a?a/y:1)*l}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(ut.convert(d)),this._update()}setMinZoom(d){if((d=d??-2)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()<d&&this.setZoom(d),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d??22)>=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d&&this.setZoom(d),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()<d&&this.setPitch(d),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d&&this.setPitch(d),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this._update()}project(d){return this.transform.locationPoint(m.N.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.pointLocation(m.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,s){if(d==="mouseenter"||d==="mouseover"){let a=!1;return{layers:t,listener:s,delegates:{mousemove:u=>{const y=t.filter(w=>this.getLayer(w)),x=y.length!==0?this.queryRenderedFeatures(u.point,{layers:y}):[];x.length?a||(a=!0,s.call(this,new bi(d,this,u.originalEvent,{features:x}))):a=!1},mouseout:()=>{a=!1}}}}if(d==="mouseleave"||d==="mouseout"){let a=!1;return{layers:t,listener:s,delegates:{mousemove:y=>{const x=t.filter(w=>this.getLayer(w));(x.length!==0?this.queryRenderedFeatures(y.point,{layers:x}):[]).length?a=!0:a&&(a=!1,s.call(this,new bi(d,this,y.originalEvent)))},mouseout:y=>{a&&(a=!1,s.call(this,new bi(d,this,y.originalEvent)))}}}}{const a=l=>{const u=t.filter(x=>this.getLayer(x)),y=u.length!==0?this.queryRenderedFeatures(l.point,{layers:u}):[];y.length&&(l.features=y,s.call(this,l),delete l.features)};return{layers:t,listener:s,delegates:{[d]:a}}}}_saveDelegatedListener(d,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(t)}_removeDelegatedListener(d,t,s){if(!this._delegatedListeners||!this._delegatedListeners[d])return;const a=this._delegatedListeners[d];for(let l=0;l<a.length;l++){const u=a[l];if(u.listener===s&&u.layers.length===t.length&&u.layers.every(y=>t.includes(y))){for(const y in u.delegates)this.off(y,u.delegates[y]);return void a.splice(l,1)}}}on(d,t,s){if(s===void 0)return super.on(d,t);const a=this._createDelegatedListener(d,typeof t=="string"?[t]:t,s);this._saveDelegatedListener(d,a);for(const l in a.delegates)this.on(l,a.delegates[l]);return this}once(d,t,s){if(s===void 0)return super.once(d,t);const a=typeof t=="string"?[t]:t,l=this._createDelegatedListener(d,a,s);for(const u in l.delegates){const y=l.delegates[u];l.delegates[u]=(...x)=>{this._removeDelegatedListener(d,a,s),y(...x)}}this._saveDelegatedListener(d,l);for(const u in l.delegates)this.once(u,l.delegates[u]);return this}off(d,t,s){return s===void 0?super.off(d,t):(this._removeDelegatedListener(d,typeof t=="string"?[t]:t,s),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let s;const a=d instanceof m.P||Array.isArray(d),l=a?d:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(a?{}:d)||{},l instanceof m.P||typeof l[0]=="number")s=[m.P.convert(l)];else{const u=m.P.convert(l[0]),y=m.P.convert(l[1]);s=[u,new m.P(y.x,u.y),y,new m.P(u.x,y.y),u]}return this.style.queryRenderedFeatures(s,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=m.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){const t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(d,t));const s=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Xr(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,s):this.style.loadJSON(d,t,s),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Xr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){if(typeof d=="string"){const s=this._requestManager.transformRequest(d,"Style");m.h(s,new AbortController).then(a=>{this._updateDiff(a.data,t)}).catch(a=>{a&&this.fire(new m.j(a))})}else typeof d=="object"&&this._updateDiff(d,t)}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(s){m.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():m.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){const t=this.style&&this.style.sourceCaches[d];if(t!==void 0)return t.loaded();this.fire(new m.j(new Error(`There is no source with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){const t=this.style.sourceCaches[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);this.terrain===null&&t.reload();for(const s in this.style._layers){const a=this.style._layers[s];a.type==="hillshade"&&a.source===d.source&&m.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ma(this.painter,t,d),this.painter.renderToTexture=new Va(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=s=>{s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==d.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(s.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new m.k("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const d=this.style&&this.style.sourceCaches;for(const t in d){const s=d[t]._tiles;for(const a in s){const l=s[a];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,t,s={}){const{pixelRatio:a=1,sdf:l=!1,stretchX:u,stretchY:y,content:x,textFitWidth:w,textFitHeight:S}=s;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||m.b(t))){if(t.width===void 0||t.height===void 0)return this.fire(new m.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:C,height:A,data:B}=t,Z=t;return this.style.addImage(d,{data:new m.R({width:C,height:A},new Uint8Array(B)),pixelRatio:a,stretchX:u,stretchY:y,content:x,textFitWidth:w,textFitHeight:S,sdf:l,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,d),this}}{const{width:C,height:A,data:B}=bt.getImageData(t);this.style.addImage(d,{data:new m.R({width:C,height:A},B),pixelRatio:a,stretchX:u,stretchY:y,content:x,textFitWidth:w,textFitHeight:S,sdf:l,version:0})}}updateImage(d,t){const s=this.style.getImage(d);if(!s)return this.fire(new m.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||m.b(t)?bt.getImageData(t):t,{width:l,height:u,data:y}=a;if(l===void 0||u===void 0)return this.fire(new m.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==s.data.width||u!==s.data.height)return this.fire(new m.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const x=!(t instanceof HTMLImageElement||m.b(t));return s.data.replace(y,x),this.style.updateImage(d,s),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new m.j(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d){return ti.getImage(this._requestManager.transformRequest(d,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,s){return this.style.setLayerZoomRange(d,t,s),this._update(!0)}setFilter(d,t,s={}){return this.style.setFilter(d,t,s),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,s,a={}){return this.style.setPaintProperty(d,t,s,a),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,s,a={}){return this.style.setLayoutProperty(d,t,s,a),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,s,a=>{a||this._update(!0)}),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,s=>{s||this._update(!0)}),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(d){return this._lazyInitEmptyStyle(),this.style.setSky(d),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupContainer(){const d=this._container;d.classList.add("maplibregl-map");const t=this._canvasContainer=ft.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=ft.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
583on");const s=this._containerDimensions(),a=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],a);const l=this._controlContainer=ft.create("div","maplibregl-control-container",d),u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{u[y]=ft.create("div",`maplibregl-ctrl-${y} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(d,t,s){this._canvas.width=Math.floor(s*d),this._canvas.height=Math.floor(s*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const d={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:d},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const s=this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d);if(!s){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new as(s,this.transform),nr.testSupport(s)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const l=this.transform.zoom,u=bt.now();this.style.zoomHistory.update(l,u);const y=new m.z(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),x=y.crossFadingFactor();x===1&&x===this._crossFadingFactor||(s=!0,this._crossFadingFactor=x),this.style.update(y)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new m.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,m.bf.mark(m.bg.load),this.fire(new m.k("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new m.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,m.bf.mark(m.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var d;this._hash&&this._hash.remove();for(const s of this._controls)s.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),ti.removeThrottleControl(this._imageQueueHandle),(d=this._resizeObserver)===null||d===void 0||d.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ft.remove(this._canvasContainer),ft.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),m.bf.clearMetrics(),this._removed=!0,this.fire(new m.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,bt.frameAsync(this._frameRequest).then(d=>{m.bf.frame(d),this._frameRequest=null,this._render(d)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return Fl}getCameraTargetElevation(){return this.transform.elevation}},O.MapMouseEvent=bi,O.MapTouchEvent=Or,O.MapWheelEvent=Na,O.Marker=Ua,O.NavigationControl
vendor: 6,528 bytes, line 583
583=class{constructor(d){this._updateZoomButtons=()=>{const t=this._map.getZoom(),s=t===this._map.getMaxZoom(),a=t===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,s)=>{const a=this._map._getUIString(`NavigationControl.${s}`);t.title=a,t.setAttribute("aria-label",a)},this.options=m.e({},hh,d),this._container=ft.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),ft.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),ft.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=ft.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ch(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ft.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){const s=ft.create("button",d,this._container);return s.type="button",s.addEventListener("click",t),s}},O.Popup=class extends m.E{constructor(d){super(),this.remove=()=>(this._content&&ft.remove(this._content),this._container&&(ft.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new m.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var s;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ft.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ft.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const x of this.options.className.split(" "))this._container.classList.add(x);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Xe(this._lngLat,this._flatPos,this._map.transform):(s=this._lngLat)===null||s===void 0?void 0:s.wrap(),this._trackPointer&&!t)return;const a=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let l=this.options.anchor;const u=qa(this.options.offset);if(!l){const x=this._container.offsetWidth,w=this._container.offsetHeight;let S;S=a.y+u.bottom.y<w?["top"]:a.y>this._map.transform.height-w?["bottom"]:[],a.x<x/2?S.push("left"):a.x>this._map.transform.width-x/2&&S.push("right"),l=S.length===0?"bottom":S.join("-")}let y=a.add(u[l]);this.options.subpixelPositioning||(y=y.round()),ft.setTransform(this._container,`${Lo[l]} translate(${y.x}px,${y.y}px)`),Za(this._container,l,"popup")},this._onClose=()=>{this.remove()},this.options=m.e(Object.create(Wt),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new m.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=m.N.convert(d),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}
vendor: 4,785 bytes, line 583
583setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){const t=document.createDocumentFragment(),s=document.createElement("body");let a;for(s.innerHTML=d;a=s.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ft.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(d){return this._container&&this._container.classList.add(d),this}removeClassName(d){return this._container&&this._container.classList.remove(d),this}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}setSubpixelPositioning(d){this.options.subpixelPositioning=d}_createCloseButton(){this.options.closeButton&&(this._closeButton=ft.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(ja);d&&d.focus()}},O.RasterDEMTileSource=He,O.RasterTileSource=ze,O.ScaleControl=class{constructor(d){this._onMove=()=>{va(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,va(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Vr),d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=ft.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ft.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},O.ScrollZoomHandler=xt,O.Style=Xr,O.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=d}onAdd(d){return this._map=d,this._container=ft.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ft.create("button","maplibregl-ctrl-terrain",this._container),ft.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ft.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},O.TwoFingersTouchPitchHandler=I,O.TwoFingersTouchRotateHandler=_,O.TwoFingersTouchZoomHandler=r,O.TwoFingersTouchZoomRotateHandler=Wi,O.VectorTileSource=Ir,O.VideoSource=bs,O.addSourceType=(d,t)=>m._(void 0,void 0,void 0,function*(){if(ws(d))throw new Error(`A source type called "${d}" already exists.`);((s,a)=>{Hr[s]=a})(d,t)}),O.clearPrewarmedResources=function(){const d=oi;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(Fe),oi=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},O.getMaxParallelImageRequests=function(){return m.a.MAX_PARALLEL_IMAGE_REQUESTS},O.getRTLTextPluginStatus=function(){return kn().getRTLTextPluginStatus()},O.getVersion=function(){return gl},O.getWorkerCount=function(){return ve.workerCount},O.getWorkerUrl=function(){return m.a.WORKER_URL},O.importScriptInWorkers=function(d){return qr().broadcast("IS",d)},O.prewarm=function(){Pr().acquire(Fe)},O.setMaxParallelImageRequests=function(d){m.a.MAX_PARALLEL_IMAGE_REQUESTS=d},O.setRTLTextPlugin=function(d,t){return kn().setRTLTextPlugin(d,t)},O.setWorkerCount=function(d){ve.workerCount=d},O.setWorkerUrl=function(d){m.a.WORKER_URL=d}});var ys=Mt;return ys})})(Vu);var Uu=Vu.exports;const Fp=Nu(Uu),Vp=Bp({__proto__:null,default:Fp},[Uu]);export{Np as L,Fp as a,Rp as l,Vp as m};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.