vendor: 3,215 bytes, lines 1-5
1/* @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 */ 5!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,e){var i,n=Array.prototype.slice;return t.bind?t.bind.apply(t,n.call(arguments,1)):(i=n.call(arguments,2),function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)})}var D=0;function h(t){return"_leaflet_id"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,e,i){var n,o,s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return r}function H(t,e,i){var n=e[1],e=e[0],o=n-e;return t===n&&i?t:((t-e)%o+o)%o+e}function u(){return!1}function i(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return W(t).split(/\s+/)}function c(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?R(t.options):{}),e)t.options[i]=e[i];return t.options}function U(t,e,i){var n,o=[];for(n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var V=/\{ *([\w_ -]+) *\}/g;function q(t,i){return t.replace(V,function(t,e){e=i[e];if(void 0===e)throw new Error("No value provided for variable "+t);return e="function"==typeof e?e(i):e})}var d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function G(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var K="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function J(t){var e=+new Date,i=Math.max(0,16-(e-X));return X=e+i,window.setTimeout(t,i)}var $=window.requestAnimationFrame||Y("RequestAnimationFrame")||J,Q=window.cancelAnimationFrame||Y("CancelAnimationFrame")||Y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function x(t,e,i){if(!i||$!==J)return $.call(window,a(t,e));t.call(e)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:i,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function et(){}et.extend=function(t){function e(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i,n=e.__super__=this.prototype,o=R(n);for(i in(o.constructor=e).prototype=o,this)Object.prototype.hasOwnProperty.call(this,i)&&"prototype"!==i&&"__super__"!==i&&(e[i]=this[i]);if(t.statics&&l(e,t.statics),t.includes){var s=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;
vendor: 144,302 bytes, line 5
5r++)s[r]===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)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},et.include=function(t){var e=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},et.mergeOptions=function(t){return l(this.prototype.options,t),this},et.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var e={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}else delete this._events;return this},_on:function(t,e,i,n){"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1===this._listens(t,e,i)&&(e={fn:e,ctx:i=i===this?void 0:i},n&&(e.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e))},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1!==(e=this._listens(t,e,i))&&(i=n[e],this._firingCount&&(i.fn=u,this._events[t]=n=n.slice()),n.splice(e,1))},fire:function(t,e,i){if(this.listens(t,i)){var n=l({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}i&&this._propagateEvent(n)}return this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e,s=("function"!=typeof e&&(n=!!e,i=o=void 0),this._events&&this._events[t]);if(s&&s.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(this._events){var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o}return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},it=(e.addEventListener=e.on,e.removeEventListener=e.clearAllEventListeners=e.off,e.addOneTimeEventListener=e.once,e.fireEvent=e.fire,e.hasEventListeners=e.listens,et.extend(e));function p(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function m(t,e,i){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new p(t.x,t.y):new p(t,e,i)}function f(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function _(t,e){return!t||t instanceof f?t:new f(t,e)}function s(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function g(t,e){return t instanceof s?t:new s(t,e)}function v(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function w(t,e,i){return t instanceof v?t:d(t)&&"object"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new v(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new v(t,e,i)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(m(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(m(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.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=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var e=(t=m(t)).x-this.x,t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=m(t)).x===this.x&&t.y===this.y},contains:function(t){return t=m(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+i(this.x)+", "+i(this.y)+")"}},f.prototype={extend:function(t){var e,i;if(t){if(t instanceof p||"number"==typeof t[0]||"x"in t)e=i=m(t);else if(e=(t=_(t)).min,i=t.max,!e||!i)return this;this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone())}return this},getCenter:function(t){return m((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return m(this.min.x,this.max.y)},getTopRight:function(){return m(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(t){var e,i;return(t=("number"==typeof t[0]||t instanceof p?m:_)(t))instanceof f?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.x<i.x,t=t.y>e.y&&n.y<i.y;return o&&t},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,t=Math.abs(e.y-i.y)*t;return _(m(e.x-n,e.y-t),m(i.x+n,i.y+t))},equals:function(t){return!!t&&(t=_(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},s.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof v)i=e=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new v(e.lat,e.lng),this._northEast=new v(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,t=Math.abs(e.lng-i.lng)*t;return new s(new v(e.lat-n,e.lng-t),new v(i.lat+n,i.lng+t))},getCenter:function(){return new v((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 v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(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(t){t=("number"==typeof t[0]||t instanceof v||"lat"in t?w:g)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof s?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.lat<i.lat,t=t.lng>e.lng&&n.lng<i.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,e){t=this.projection.project(t),e=this.scale(e);return this.transformation._transform(t,e)},pointToLatLng:function(t,e){e=this.scale(e),t=this.transformation.untransform(t,e);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){var e;return this.infinite?null:(e=this.projection.bounds,t=this.scale(t),new f(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t)))},infinite:!(v.prototype={equals:function(t,e){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+i(this.lat,t)+", "+i(this.lng,t)+")"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,e=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new s(new v(i.lat-n,i.lng-e),new v(t.lat-n,t.lng-e)))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),e=Math.sin((e.lng-t.lng)*i/2),t=s*s+Math.cos(n)*Math.cos(o)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new p(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new f([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,e,i,n){d(t)?(this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3]):(this._a=t,this._b=e,this._c=i,this._d=n)}function ht(t,e,i,n){return new at(t,e,i,n)}at.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new p((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var lt=l({},st,{code:"EPSG:3857",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:"EPSG:900913"});function ct(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,e){for(var i,n,o,s,r="",a=0,h=t.length;a<h;a++){for(i=0,n=(o=t[a]).length;i<n;i++)r+=(i?"L":"M")+(s=o[i]).x+" "+s.y;r+=e?b.svg?"z":"x":""}return r||"M0 0"}var _t=document.documentElement.style,pt="ActiveXObject"in window,mt=pt&&!document.addEventListener,n="msLaunchUri"in navigator&&!("documentMode"in document),ft=y("webkit"),gt=y("android"),vt=y("android 2")||y("android 3"),yt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y("Google")&&yt<537&&!("AudioNode"in window),xt=!!window.opera,wt=!n&&y("chrome"),bt=y("gecko")&&!ft&&!xt&&!pt,Pt=!wt&&y("safari"),Lt=y("phantom"),o="OTransition"in _t,Tt=0===navigator.platform.indexOf("Win"),Mt=pt&&"transition"in _t,zt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vt,_t="MozPerspective"in _t,Ct=!window.L_DISABLE_3D&&(Mt||zt||_t)&&!o&&!Lt,Zt="undefined"!=typeof orientation||y("mobile"),St=Zt&&ft,Et=Zt&&zt,kt=!window.PointerEvent&&window.MSPointerEvent,Ot=!(!window.PointerEvent&&!kt),At="ontouchstart"in window||!!window.TouchEvent,Bt=!window.L_NO_TOUCH&&(At||Ot),It=Zt&&xt,Rt=Zt&&bt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(t){}return t}(),jt=!!document.createElement("canvas").getContext,Ht=!(!document.createElementNS||!ct("svg").createSVGRect),Wt=!!Ht&&((Wt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ve(t,e)||ye(t,((i=xe(t))?i+" ":"")+e)}function z(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,W((" "+xe(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}}function we(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function be(t,e,i){e=e||new p(0,0);t.style[ue]=(b.ie3d?"translate("+e.x+"px,"+e.y+"px)":"translate3d("+e.x+"px,"+e.y+"px,0)")+(i?" scale("+i+")":"")}function Z(t,e){t._leaflet_pos=e,b.any3d?be(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Pe(t){return t._leaflet_pos||new p(0,0)}function Le(){S(window,"dragstart",O)}function Te(){k(window,"dragstart",O)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),le=(he=t).style.outlineStyle,t.style.outlineStyle="none",S(window,"keydown",ze))}function ze(){he&&(he.style.outlineStyle=le,le=he=void 0,k(window,"keydown",ze))}function Ce(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}ae="onselectstart"in document?(re=function(){S(window,"selectstart",O)},function(){k(window,"selectstart",O)}):(se=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),re=function(){var t;se&&(t=document.documentElement.style,oe=t[se],t[se]="none")},function(){se&&(document.documentElement.style[se]=oe,oe=void 0)});pt={__proto__:null,TRANSFORM:ue,TRANSITION:ce,TRANSITION_END:de,get:_e,getStyle:pe,create:P,remove:T,empty:me,toFront:fe,toBack:ge,hasClass:ve,addClass:M,removeClass:z,setClass:ye,getClass:xe,setOpacity:C,testProp:we,setTransform:be,setPosition:Z,getPosition:Pe,get disableTextSelection(){return re},get enableTextSelection(){return ae},disableImageDrag:Le,enableImageDrag:Te,preventOutline:Me,restoreOutline:ze,getSizedParentNode:Ce,getScale:Ze};function S(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)ke(t,o,e[o],i);else for(var s=0,r=(e=F(e)).length;s<r;s++)ke(t,e[s],i,n);return this}var E="_leaflet_events";function k(t,e,i,n){if(1===arguments.length)Se(t),delete t[E];else if(e&&"object"==typeof e)for(var o in e)Oe(t,o,e[o],i);else if(e=F(e),2===arguments.length)Se(t,function(t){return-1!==G(e,t)});else for(var s=0,r=e.length;s<r;s++)Oe(t,e[s],i,n);return this}function Se(t,e){for(var i in t[E]){var n=i.split(/\d/)[0];e&&!e(n)||Oe(t,n,null,null,i)}}var Ee={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function ke(e,t,i,n){var o,s,r=t+h(i)+(n?"_"+h(n):"");e[E]&&e[E][r]||(s=o=function(t){return i.call(n||e,t||window.event)},!b.touchNative&&b.pointer&&0===t.indexOf("touch")?o=Jt(e,t,o):b.touch&&"dblclick"===t?o=ne(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ee[t]||t,o,!!b.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?e.addEventListener(Ee[t],o=function(t){t=t||window.event,We(e,t)&&s(t)},!1):e.addEventListener(t,s,!1):e.attachEvent("on"+t,o),e[E]=e[E]||{},e[E][r]=o)}function Oe(t,e,i,n,o){o=o||e+h(i)+(n?"_"+h(n):"");var s,r,i=t[E]&&t[E][o];i&&(!b.touchNative&&b.pointer&&0===e.indexOf("touch")?(n=t,r=i,Gt[s=e]?n.removeEventListener(Gt[s],r,!1):console.warn("wrong event specified:",s)):b.touch&&"dblclick"===e?(n=i,(r=t).removeEventListener("dblclick",n.dblclick),r.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(Ee[e]||e,i,!1):t.detachEvent("on"+e,i),t[E][o]=null)}function Ae(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Be(t){return ke(t,"wheel",Ae),this}function Ie(t){return S(t,"mousedown touchstart dblclick contextmenu",Ae),t._leaflet_disable_click=!0,this}function O(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return O(t),Ae(t),this}function Ne(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function De(t,e){var i,n;return e?(n=(i=Ze(e)).boundingClientRect,new p((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)):new p(t.clientX,t.clientY)}var je=b.linux&&b.chrome?window.devicePixelRatio:b.mac?3*window.devicePixelRatio:0<window.devicePixelRatio?2*window.devicePixelRatio:1;function He(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function We(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var mt={__proto__:null,on:S,off:k,stopPropagation:Ae,disableScrollPropagation:Be,disableClickPropagation:Ie,preventDefault:O,stop:Re,getPropagationPath:Ne,getMousePosition:De,getWheelDelta:He,isExternalTarget:We,addListener:S,removeListener:k},Fe=it.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pe(t),this._offset=e.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=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t));e&&t._round(),Z(this._el,t),this.fire("step")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=it.extend({options:{crs:lt,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(t,e){e=c(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(w(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ce&&b.any3d&&!b.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(w(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():g(t);var i=m(e.paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));return(o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0?{center:t.getCenter(),zoom:o}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),o),i=this.project(t.getNorthEast(),o),{center:this.unproject(n.add(i).divideBy(2).add(e),o),zoom:o})},fitBounds:function(t,e){if((t=g(t)).isValid())return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e);throw new Error("Bounds are not valid.")},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){var i;return e=e||{},(t=m(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(M(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend")},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!b.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),e=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(e.x,e.y)),i=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(i*i-h*h+(t?-1:1)*c*c*l*l)/(2*(t?i:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var e=(Date.now()-g)/y,i=(1-Math.pow(1-e,1.5))*v;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(i)/l)),a),this.getScaleZoom(h/(e=i,h*(p(m)/p(m+u*e))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){t=this._getBoundsCenterZoom(t,e);return this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return t=g(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.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(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&o.push(i[s]);n=o.concat(n)}if(n.length){"contextmenu"===e&&O(t);var r,a=n[0],h={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(e,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Pe(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){i=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){i=this._getNewPixelOrigin(i,e);return _([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){var n,o;return!i||(n=this.project(t,e),o=this.getSize().divideBy(2),o=new f(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,i,e),Math.abs(o.x)<=1&&Math.abs(o.y)<=1)?t:this.unproject(n.add(o),e)},_limitOffset:function(t,e){var i;return e?(i=new f((i=this.getPixelBounds()).min.add(t),i.max.add(t)),t.add(this._getBoundsOffset(i,e))):t},_getBoundsOffset:function(t,e,i){e=_(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),i=e.min.subtract(t.min),e=e.max.subtract(t.max);return new p(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){z(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){t=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(t))&&(this.panBy(t,e),!0)},_createAnimProxy:function(){var t=this._proxy=P("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ue,i=this._proxy.style[e];be(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();be(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(!this._animatingZoom){if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(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 Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Ve=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var i=this._controlCorners={},n="leaflet-",o=this._controlContainer=P("div",n+"control-container",this._container);function t(t,e){i[t+e]=P("div",n+t+" "+n+e,o)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),B.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in c(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return B.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){M(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(M(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):z(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=P("div",t),i=this.options.collapsed,n=(e.setAttribute("aria-haspopup",!0),Ie(e),Be(e),this._section=P("section",t+"-list")),o=(i&&(this._map.on("click",this.collapse,this),S(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this)),this._layersLink=P("a",t+"-toggle",e));o.href="#",o.title="Layers",o.setAttribute("role","button"),S(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){O(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=P("div",t+"-base",n),this._separator=P("div",t+"-separator",n),this._overlaysList=P("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&h(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(a(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(this._container){me(this._baseLayersList),me(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=e&&t?"":"none"}return this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(h(t.target)),t=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;t&&this._map.fire(t,e)},_createRadioElement:function(t,e){t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280<t?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+" mi",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+" ft",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),t=t/e;return e*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ke=B.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(b.inlineSvg?'<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> ':"")+"Leaflet</a>"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new p((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,O(t),this._moved||(this.fire("dragstart"),this._moved=!0,M(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),M(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Z(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){z(document.body,"leaflet-dragging"),this._lastTarget&&(z(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),k(document,"mousemove touchmove",this._onMove,this),k(document,"mouseup touchend touchcancel",this._onUp,this),Te(),ae();var e=this._moved&&this._moving;this._moving=!1,Xe._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Je(t,e,i){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=si(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)):(a._code&h&&((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)),n.push(r));t=n}return t}function $e(t,e){var i,n,o,s,r,a,h;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var l=w([0,0]),u=g(t),c=(u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(l=Qe(t)),t.length),d=[],_=0;_<c;_++){var p=w(t[_]);d.push(e.project(w([p.lat-l.lat,p.lng-l.lng])))}for(_=r=a=h=0,i=c-1;_<c;i=_++)n=d[_],o=d[i],s=n.y*o.x-o.y*n.x,a+=(n.x+o.x)*s,h+=(n.y+o.y)*s,r+=3*s;u=0===r?d[0]:[a/r,h/r],u=e.unproject(m(u));return w([u.lat+l.lat,u.lng+l.lng])}function Qe(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var s=w(t[o]);e+=s.lat,i+=s.lng,n++}return w([e/n,i/n])}var ti,gt={__proto__:null,clipPolygon:Je,polygonCenter:$e,centroid:Qe};function ei(t,e){if(e&&t.length){var i=t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,e=e.y-t.y;return i*i+e*e})(t[n],t[o])>e&&(i.push(t[n]),o=n);o<s-1&&i.push(t[s-1]);return i}(t,e=e*e),n=i.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);o[0]=o[n-1]=1,function t(e,i,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ri(e[a],e[o],e[s],!0),l<h&&(r=a,l=h);n<l&&(i[r]=1,t(e,i,n,o,r),t(e,i,n,r,s))}(i,o,e,0,n-1);var s,r=[];for(s=0;s<n;s++)o[s]&&r.push(i[s]);return r}return t.slice()}function ii(t,e,i){return Math.sqrt(ri(t,e,i,!0))}function ni(t,e,i,n,o){var s,r,a,h=n?ti:si(t,i),l=si(e,i);for(ti=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=si(r=oi(t,e,s=h||l,i,o),i),s===h?(t=r,h=a):(e=r,l=a)}}function oi(t,e,i,n,o){var s,r,a=e.x-t.x,e=e.y-t.y,h=n.min,n=n.max;return 8&i?(s=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(s=t.x+a*(h.y-t.y)/e,r=h.y):2&i?(s=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(s=h.x,r=t.y+e*(h.x-t.x)/a),new p(s,r,o)}function si(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-e)*r)/a)?(o=i.x,e=i.y):0<a&&(o+=s*a,e+=r*a)),s=t.x-o,r=t.y-e,n?s*s+r*r:new p(o,e)}function I(t){return!d(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ai(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),I(t)}function hi(t,e){var i,n,o,s,r,a;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var h=w([0,0]),l=g(t),u=(l.getNorthWest().distanceTo(l.getSouthWest())*l.getNorthEast().distanceTo(l.getNorthWest())<1700&&(h=Qe(t)),t.length),c=[],d=0;d<u;d++){var _=w(t[d]);c.push(e.project(w([_.lat-h.lat,_.lng-h.lng])))}for(i=d=0;d<u-1;d++)i+=c[d].distanceTo(c[d+1])/2;if(0===i)a=c[0];else for(n=d=0;d<u-1;d++)if(o=c[d],s=c[d+1],i<(n+=r=o.distanceTo(s))){a=[s.x-(r=(n-i)/r)*(s.x-o.x),s.y-r*(s.y-o.y)];break}l=e.unproject(m(a));return w([l.lat+h.lat,l.lng+h.lng])}var vt={__proto__:null,simplify:ei,pointToSegmentDistance:ii,closestPointOnSegment:function(t,e,i){return ri(t,e,i)},clipSegment:ni,_getEdgeIntersection:oi,_getBitCode:si,_sqClosestPointOnSegment:ri,isFlat:I,_flat:ai,polylineCenter:hi},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new f([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new f([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-i*Math.log(Math.max(s,1e-10));return new p(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new v(a*i,t.x*i/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},Pt=l({},st,{code:"EPSG:3395",projection:xt,transformation:ht(bt=.5/(Math.PI*xt.R),.5,-bt,.5)}),li=l({},st,{code:"EPSG:4326",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=Pt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=li,ot.Simple=Lt,it.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",function(){i.off(e,this)},this)),this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this}))}})),ui=(A.include({addLayer:function(t){var e;if(t._layerAdd)return e=h(t),this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this;throw new Error("The provided object is not a Layer.")},removeLayer:function(t){var e=h(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?d(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,e=void 0===o.minZoom?e:Math.min(e,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom);this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,e){var i,n;if(c(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:h})),ci=ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,e=new s;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),di=et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(i)return i=this._createImg(i,e&&"IMG"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i;if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"],n=m(n="number"==typeof n?[n,n]:n),o=m("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return b.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var _i=di.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(t){return"string"!=typeof _i.imagePath&&(_i.imagePath=this._detectIconPath()),(this.options.imagePath||_i.imagePath)+di.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=P("div","leaflet-default-icon-path",document.body),e=pe(t,"background-image")||pe(t,"backgroundImage");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$="leaflet.css"]'))?t.href.substring(0,t.href.length-"leaflet.css".length-1):""}}),pi=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xe(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),M(t,"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&&z(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),a=_(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=m((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Pe(e._icon),o=e._map.layerPointToLatLng(n);i&&Z(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),mi=o.extend({options:{icon:new _i,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(t,e){c(this,e),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.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(t){var e=this._latlng;return this._latlng=w(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1,i=(i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),M(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(i,"focus",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(M(i,e),i.alt=""),this._shadow=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&k(this._icon,"focus",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(M(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),pi&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new pi(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?m(e.iconSize):m(0,0),e=e.iconAnchor?m(e.iconAnchor):m(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var fi=o.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(t){this._renderer=t.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(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"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)}}),gi=fi.extend({options:{fill:!0,radius:10},initialize:function(t,e){c(this,e),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return fi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),t=[t+i,e+i];this._pxBounds=new f(this._point.subtract(t),this._point.add(t))},_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(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var vi=gi.extend({initialize:function(t,e,i){if(c(this,e="number"==typeof e?l({},i,{radius:e}):e),this._latlng=w(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:fi.prototype.setStyle,_project:function(){var t,e,i,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),e=a.project([r-o,s]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,s-n]).x,this._radiusY=e.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var yi=fi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){c(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ri,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<e&&(e=c,i=n(t,l,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(this._map)return hi(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=w(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return I(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=I(t),n=0,o=t.length;n<o;n++)i?(e[n]=w(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new f;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new f([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(e=0,i=(o=this._rings[r]).length;e<i-1;e++)(n=ni(o[e],o[e+1],t,e,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=ei(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,h=this._clickTolerance();if(this._pxBounds&&this._pxBounds.contains(t))for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&ii(t,a[o],a[n])<=h)return!0;return!1}});yi._flat=ai;var xi=yi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(this._map)return $e(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},_convertLatLngs:function(t){var t=yi.prototype._convertLatLngs.call(this,t),e=t.length;return 2<=e&&t[0]instanceof v&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){yi.prototype._setLatLngs.call(this,t),I(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(I(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,e=new p(e,e),t=new f(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,o=this._rings.length;n<o;n++)(i=Je(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(e=this._parts[o]).length)-1;s<h;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s,r=this.options;return(!r.filter||r.filter(t))&&(s=bi(t,r))?(s.feature=Zi(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function bi(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Li;if(!a&&!r)return null;switch(r.type){case"Point":return Pi(l,t,i=u(a),e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=u(a[o]),h.push(Pi(l,t,i,e));return new ci(h);case"LineString":case"MultiLineString":return n=Ti(a,"LineString"===r.type?0:1,u),new yi(n,e);case"Polygon":case"MultiPolygon":return n=Ti(a,"Polygon"===r.type?1:2,u),new xi(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=bi({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);c&&h.push(c)}return new ci(h);case"FeatureCollection":for(o=0,s=r.features.length;o<s;o++){var d=bi(r.features[o],e);d&&h.push(d)}return new ci(h);default:throw new Error("Invalid GeoJSON object.")}}function Pi(t,e,i,n){return t?t(e,i):new mi(i,n&&n.markersInheritOptions&&n)}function Li(t){return new v(t[1],t[0],t[2])}function Ti(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?Ti(t[s],e-1,i):(i||Li)(t[s]),o.push(n);return o}function Mi(t,e){return void 0!==(t=w(t)).alt?[i(t.lng,e),i(t.lat,e),i(t.alt,e)]:[i(t.lng,e),i(t.lat,e)]}function zi(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?zi(t[s],I(t[s])?0:e-1,i,n):Mi(t[s],n));return!e&&i&&0<o.length&&o.push(o[0].slice()),o}function Ci(t,e){return t.feature?l({},t.feature,{geometry:e}):Zi(e)}function Zi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Ci(this,{type:"Point",coordinates:Mi(this.getLatLng(),t)})}};function Si(t,e){return new wi(t,e)}mi.include(Tt),vi.include(Tt),gi.include(Tt),yi.include({toGeoJSON:function(t){var e=!I(this._latlngs);return Ci(this,{type:(e?"Multi":"")+"LineString",coordinates:zi(this._latlngs,e?1:0,!1,t)})}}),xi.include({toGeoJSON:function(t){var e=!I(this._latlngs),i=e&&!I(this._latlngs[0]),t=zi(this._latlngs,i?2:e?1:0,!0,t);return Ci(this,{type:(i?"Multi":"")+"Polygon",coordinates:t=e?t:[t]})}}),ui.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ci(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(e){var i,n,t=this.feature&&this.feature.geometry&&this.feature.geometry.type;return"MultiPoint"===t?this.toMultiPoint(e):(i="GeometryCollection"===t,n=[],this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(e),i?n.push(t.geometry):"FeatureCollection"===(t=Zi(t)).type?n.push.apply(n,t.features):n.push(t))}),i?Ci(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n})}});var Mt=Si,Ei=o.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=g(e),c(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:P("img");M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=a(this.fire,this,"load"),e.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;be(this._image,t,e)},_reset:function(){var t=this._image,e=new f(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Z(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:P("video");if(M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=a(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=P("source");r.src=this._url[s],e.appendChild(r)}}}});var Oi=Ei.extend({_initImage:function(){var t=this._image=this._url;M(t,"leaflet-image-layer"),this._zoomAnimated&&M(t,"leaflet-zoom-animated"),this.options.className&&M(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var Ai=o.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof v||d(t))?(this._latlng=w(t),c(this,e)):(c(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(M(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,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 t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof ci){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error("Unable to get source layer LatLng.");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=m(this.options.offset),i=this._getAnchor(),this._zoomAnimated?Z(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+"px",this._container.style.left=i+"px")},_getAnchor:function(){return[0,0]}}),Bi=(A.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),o.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(c(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}}),Ai.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(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ai.prototype.openOn.call(this,t)},onAdd:function(t){Ai.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof fi||this._source.on("preclick",Ae))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof fi||this._source.off("preclick",Ae))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=P("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=P("div",t+"-content-wrapper",e);this._contentNode=P("div",t+"-content",i),Ie(e),Be(this._contentNode),S(e,"contextmenu",Ae),this._tipContainer=P("div",t+"-tip-container",e),this._tip=P("div",t+"-tip",this._tipContainer),this.options.closeButton&&((i=this._closeButton=P("a",t+"-close-button",e)).setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">×</span>',S(i,"click",function(t){O(t),this.close()},this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width="",e.whiteSpace="nowrap",t.offsetWidth),i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="",t.offsetHeight),n=this.options.maxHeight,o="leaflet-popup-scrolled";(n&&n<i?(e.height=n+"px",M):z)(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Z(this._container,t.add(e))},_adjustPan:function(){var t,e,i,n,o,s,r,a;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning?this._autopanning=!1:(t=this._map,e=parseInt(pe(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+e,a=this._containerWidth,(i=new p(this._containerLeft,-e-this._containerBottom))._add(Pe(this._container)),i=t.layerPointToContainerPoint(i),o=m(this.options.autoPanPadding),n=m(this.options.autoPanPaddingTopLeft||o),o=m(this.options.autoPanPaddingBottomRight||o),s=t.getSize(),r=0,i.x+a+o.x>s.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),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(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||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()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.x<o.x?(s="right",0):(s="left",r+2*(h.x+l.x)),a/2);t=t.subtract(m(e,i,!0)).add(h).add(l),z(n,"leaflet-tooltip-right"),z(n,"leaflet-tooltip-left"),z(n,"leaflet-tooltip-top"),z(n,"leaflet-tooltip-bottom"),M(n,"leaflet-tooltip-"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return m(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Ri=(A.include({openTooltip:function(t,e,i){return this._initOverlay(Ii,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ii,this._tooltip,t,e),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(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&(this instanceof ci||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(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(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(S(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),S(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){t="function"==typeof t.getElement&&t.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){var e;this._tooltip&&this._map&&(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag?(this._openOnceFlag=!0,(e=this)._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)})):(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),di.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var t=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;return e.html instanceof Element?(me(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:"",e.bgPos&&(e=m(e.bgPos),t.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));di.Default=_i;var Ni=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:b.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(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!b.ielt9){C(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(e-s.loaded)/200),C(s.el,o),o<1?i=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=P("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(T(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=P("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var t=Math.floor(t/2),e=Math.floor(e/2),i=i-1,o=new p(+t,+e),o=(o.z=i,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new p(o,s),r=(r.z=i+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();b.any3d?be(t.el,e,n):Z(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(i,this._tileZoom),t=e.project(t,this._tileZoom).floor(),e=e.getSize().divideBy(2*i);return new f(t.subtract(e),t.add(e))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n,e=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(e),s=o.getCenter(),r=[],e=this.options.keepBuffer,a=new f(o.getBottomLeft().subtract([e,-e]),o.getTopRight().add([e,-e]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,e){return t.distanceTo(s)-e.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0<e.maxZoom?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return S(i,"load",a(this._tileOnLoad,this,e,i)),S(i,"error",a(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(e.y=t),e["-y"]=t),q(this._url,l(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(a(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=u,i.onerror=u,i.complete||(i.src=K,e=this._tiles[t].coords,T(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",K),Ni.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==K))return Ni.prototype._tileReady.call(this,t,e,i)}});function ji(t,e){return new Di(t,e)}var Hi=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i,n=l({},this.defaultWmsParams);for(i in e)i in this.options||(n[i]=e[i]);var t=(e=c(this,e)).detectRetina&&b.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,i=_(i.project(e[0]),i.project(e[1])),e=i.min,i=i.max,e=(1.3<=this._wmsVersion&&this._crs===li?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(","),i=Di.prototype.getTileUrl.call(this,t);return i+U(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});Di.WMS=Hi,ji.wms=function(t,e){return new Hi(t,e)};var Wi=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),n=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?be(this._container,n,i):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new f(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fi=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");S(t,"mousemove",this._onMouseMove,this),S(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),S(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),k(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1,Z(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,e=e.prev;i?i.prev=e:this._drawLast=e,e?e.next=i:this._drawFirst=i,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new f,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_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 t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(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 t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],h[n?"lineTo":"moveTo"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(z(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(M(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Ui(t){return b.canvas?new Fi(t):null}var Vi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(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 t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)<Math.abs(n+i)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire("dragend",t),!a&&(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(o=t.multiplyBy(-n/2).round()).x||o.y)?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})})):s.fire("moveend")}})),St=(A.addInitHook("addHandler","dragging",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),k(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(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){S(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){k(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i,n=t.keyCode,o=this._map;if(n in this._panKeys)o._panAnim&&o._panAnim._inProgress||(i=this._panKeys[n],t.shiftKey&&(i=m(i).multiplyBy(3)),o.options.maxBounds&&(i=o._limitOffset(m(i),o.options.maxBounds)),o.options.worldCopyJump?(e=o.wrapLatLng(o.unproject(o.project(o.getCenter()).add(i))),o.panTo(e)):o.panBy(i));else if(n in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Re(t)}}})),Et=(A.addInitHook("addHandler","keyboard",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){k(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=He(t),i=this._map.options.wheelDebounceTime,e=(this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(i-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),e),Re(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),kt=(A.addInitHook("addHandler","scrollWheelZoom",Et),A.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){k(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new p(e.clientX,e.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,"touchend",O),S(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),S(document,"touchend touchcancel contextmenu",this._cancel,this),S(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){k(document,"touchend",O),k(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),k(document,"touchend touchcancel contextmenu",this._cancel,this),k(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});t._simulated=!0,e.target.dispatchEvent(t)}})),Ot=(A.addInitHook("addHandler","tapHold",kt),A.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){M(this._map._container,"leaflet-touch-zoom"),S(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){z(this._map._container,"leaflet-touch-zoom"),k(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,"touchmove",this._onTouchMove,this),S(document,"touchend touchcancel",this._onTouchEnd,this),O(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{i=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(n,this,!0),O(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),k(document,"touchmove",this._onTouchMove,this),k(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))):this._zooming=!1}})),Xi=(A.addInitHook("addHandler","touchZoom",Ot),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=Et,A.TapHold=kt,A.TouchZoom=Ot,t.Bounds=f,t.Browser=b,t.CRS=ot,t.Canvas=Fi,t.Circle=vi,t.CircleMarker=gi,t.Class=et,t.Control=B,t.DivIcon=Ri,t.DivOverlay=Ai,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xe,t.Evented=it,t.FeatureGroup=ci,t.GeoJSON=wi,t.GridLayer=Ni,t.Handler=n,t.Icon=di,t.ImageOverlay=Ei,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ui,t.LineUtil=vt,t.Map=A,t.Marker=mi,t.Mixin=ft,t.Path=fi,t.Point=p,t.PolyUtil=gt,t.Polygon=xi,t.Polyline=yi,t.Popup=Bi,t.PosAnimation=Fe,t.Projection=wt,t.Rectangle=Yi,t.Renderer=Wi,t.SVG=Gi,t.SVGOverlay=Oi,t.TileLayer=Di,t.Tooltip=Ii,t.Transformation=at,t.Util=tt,t.VideoOverlay=ki,t.bind=a,t.bounds=_,t.canvas=Ui,t.circle=function(t,e,i){return new vi(t,e,i)},t.circleMarker=function(t,e){return new gi(t,e)},t.control=Ue,t.divIcon=function(t){return new Ri(t)},t.extend=l,t.featureGroup=function(t,e){return new ci(t,e)},t.geoJSON=Si,t.geoJson=Mt,t.gridLayer=function(t){return new Ni(t)},t.icon=function(t){return new di(t)},t.imageOverlay=function(t,e,i){return new Ei(t,e,i)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,e){return new ui(t,e)},t.map=function(t,e){return new A(t,e)},t.marker=function(t,e){return new mi(t,e)},t.point=m,t.polygon=function(t,e){return new xi(t,e)},t.polyline=function(t,e){return new yi(t,e)},t.popup=function(t,e){return new Bi(t,e)},t.rectangle=function(t,e){return new Yi(t,e)},t.setOptions=c,t.stamp=h,t.svg=Ki,t.svgOverlay=function(t,e,i){return new Oi(t,e,i)},t.tileLayer=ji,t.tooltip=function(t,e){return new Ii(t,e)},t.transformation=ht,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Xi,this},window.L=t});
vendor: 1,545 bytes, lines 6-47
6 7 8 9(function() { 10 // save these original methods before they are overwritten 11 var proto_initIcon = L.Marker.prototype._initIcon; 12 var proto_setPos = L.Marker.prototype._setPos; 13 14 var oldIE = (L.DomUtil.TRANSFORM === 'msTransform'); 15 16 L.Marker.addInitHook(function () { 17 var iconOptions = this.options.icon && this.options.icon.options; 18 var iconAnchor = iconOptions && this.options.icon.options.iconAnchor; 19 if (iconAnchor) { 20 iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px'); 21 } 22 this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ; 23 this.options.rotationAngle = this.options.rotationAngle || 0; 24 25 // Ensure marker keeps rotated during dragging 26 this.on('drag', function(e) { e.target._applyRotation(); }); 27 }); 28 29 L.Marker.include({ 30 _initIcon: function() { 31 proto_initIcon.call(this); 32 }, 33 34 _setPos: function (pos) { 35 proto_setPos.call(this, pos); 36 this._applyRotation(); 37 }, 38 39 _applyRotation: function () { 40 if(this.options.rotationAngle) { 41 this._icon.style[L.DomUtil.TRANSFORM+'Origin'] = this.options.rotationOrigin; 42 43 if(oldIE) { 44 // for IE 9, use the 2D rotation 45 this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)'; 46 } else { 47 // for modern browsers, prefer the 3D accelerated ver
47sion 48 this._icon.style[L.DomUtil.TRANSFORM] += ' rotateZ(' + this.options.rotationAngle + 'deg)'; 49 } 50 } 51 }, 52 53 setRotationAngle: function(angle) { 54 this.options.rotationAngle = angle; 55 this.update(); 56 return this; 57 }, 58 59 setRotationOrigin: function(origin) { 60 this.options.rotationOrigin = origin; 61 this.update(); 62 return this; 63 } 64 }); 65})(); 66 67 68L.Control.SleepMapControl = L.Control.extend({ 69 70 initialize: function(opts){ 71 L.setOptions(this,opts); 72 }, 73 74 options: { 75 position: 'topright', 76 prompt: 'disable map', 77 styles: { 78 'backgroundColor': 'white', 79 'padding': '5px', 80 'border': '2px solid gray' 81 } 82 }, 83 84 buildContainer: function(){ 85 var self = this; 86 var container = L.DomUtil.create('p', 'sleep-button'); 87 var boundEvent = this._nonBoundEvent.bind(this); 88 container.appendChild( document.createTextNode( this.options.prompt )); 89 L.DomEvent.addListener(container, 'click', boundEvent); 90 L.DomEvent.addListener(container, 'touchstart', boundEvent); 91 92 Object.keys(this.options.styles).map(function(key) { 93 container.style[key] = self.options.styles[key]; 94 }); 95 96 return (this._container = container); 97 }, 98 99 onAdd: function () { 100 return this._container || this.buildContainer(); 101 }, 102 103 _nonBoundEvent: function(e) { 104 L.DomEvent.stop(e); 105 if (this._map) this._map.sleep._sleepMap(); 106 return false; 107 } 108 109 }); 110 111 L.Control.sleepMapControl = function(){ 112 return new L.Control.SleepMapControl(); 113 }; 114 115 116 /* 117 * The Sleep Handler 118 */ 119 120 L.Map.mergeOptions({ 121 sleep: true, 122 sleepTime: 750, 123 wakeTime: 750, 124 wakeMessageTouch: 'Touch to Wake', 125 sleepNote: true, 126 hoverToWake: true, 127 sleepOpacity:.7, 128 sleepButton: L.Control.sleepMapControl 129 }); 130 131 L.Map.Sleep = L.Handler.extend({ 132 133 addHooks: function () { 134 var self = this; 135 this.sleepNote = L.DomUtil.create('p', 'sleep-note', this._map._container); 136 this._enterTimeout = null; 137 this._exitTimeout = null; 138 139 /* 140 * If the device has only a touchscreen we will never get 141 * a mouseout event, so we add an extra button to put the map 142 * back to sleep manually. 143 * 144 * a custom control/button can be provided by the user 145 * with the map's `sleepButton` option 146 */ 147 this._sleepButton = this._map.options.sleepButton(); 148 149 if (this._map.tap) { 150 this._map.addControl(this._sleepButton); 151 } 152 153 var mapStyle = this._map._container.style; 154 mapStyle.WebkitTransition += 'opacity .5s'; 155 mapStyle.MozTransition += 'opacity .5s'; 156 157 this._setSleepNoteStyle(); 158 this._sleepMap(); 159 }, 160 161 removeHooks: function () { 162 if (!this._map.scrollWheelZoom.enabled()){ 163 this._map.scrollWheelZoom.enable(); 164 } 165 if (this._map.tap && !this._map.tap.enabled()) { 166 this._map.touchZoom.enable(); 167 this._map.dragging.enable(); 168 this._map.tap.enable(); 169 } 170 L.DomUtil.setOpacity( this._map._container, 1); 171 L.DomUtil.setOpacity( this.sleepNote, 0); 172 this._removeSleepingListeners(); 173 this._removeAwakeListeners(); 174 }, 175 176 _setSleepNoteStyle: function() { 177 var noteString = ''; 178 var style = this.sleepNote.style; 179 180 if(this._map.tap) { 181 noteString = this._map.options.wakeMessageTouch; 182 } else if (this._map.options.wakeMessage) { 183 noteString = this._map.options.wakeMessage; 184 } else if (this._map.options.hoverToWake) { 185 noteString = 'click or hover to wake'; 186 } else { 187 noteString = 'click to wake'; 188 } 189 190 if( this._map.options.sleepNote ){ 191 this.sleepNote.appendChild(document.createTextNode( noteString )); 192 style.pointerEvents = 'none'; 193 style.maxWidth = '150px'; 194 style.transitionDuration = '.2s'; 195 style.zIndex = 5000; 196 style.opacity = '.6'; 197 style.margin = 'auto'; 198 style.textAlign = 'center'; 199 style.borderRadius = '4px'; 200 style.top = '50%'; 201 style.position = 'relative'; 202 style.padding = '5px'; 203 style.border = 'solid 2px black'; 204 style.background = 'white'; 205 206 if(this._map.options.sleepNoteStyle) { 207 var noteStyleOverrides = this._map.options.sleepNoteStyle; 208 Object.keys(noteStyleOverrides).map(function(key) { 209 style[key] = noteStyleOverrides[key]; 210 }); 211 } 212 } 213 }, 214 215 _wakeMap: function (e) {
216 this._stopWaiting(); 217 this._map.scrollWheelZoom.enable(); 218 219 this._map.touchZoom.enable(); 220 this._map.dragging.enable(); 221 if (this._map.tap) { 222 this._map.tap.enable(); 223 } 224 this._map.addControl(this._sleepButton); 225 226 L.DomUtil.setOpacity( this._map._container, 1); 227 this.sleepNote.style.opacity = 0; 228 this._addAwakeListeners(); 229 }, 230 231 _sleepMap: function () { 232 this._stopWaiting(); 233 this._map.scrollWheelZoom.disable(); 234 this._map.touchZoom.disable(); 235 this._map.dragging.disable(); 236 if (this._map.tap) { 237 238 this._map.tap.disable(); 239 240 } 241 this._map.removeControl(this._sleepButton); 242 L.DomUtil.setOpacity( this._map._container, this._map.options.sleepOpacity); 243 this.sleepNote.style.opacity = .4; 244 this._addSleepingListeners(); 245 }, 246 247 _wakePending: function () { 248 this._map.once('mousedown', this._wakeMap, this); 249 if (this._map.options.hoverToWake){ 250 var self = this; 251 this._map.once('mouseout', this._sleepMap, this); 252 self._enterTimeout = setTimeout(function(){ 253 self._map.off('mouseout', self._sleepMap, self); 254 self._wakeMap(); 255 } , self._map.options.wakeTime); 256 } 257 }, 258 259 _sleepPending: function () { 260 var self = this; 261 self._map.once('mouseover', self._wakeMap, self); 262 self._exitTimeout = setTimeout(function(){ 263 self._map.off('mouseover', self._wakeMap, self); 264 self._sleepMap(); 265 } , self._map.options.sleepTime); 266 }, 267 268 _addSleepingListeners: function(){ 269 this._map.once('mouseover', this._wakePending, this); 270 this._map.tap && 271 this._map.once('click', this._wakeMap, this); 272 }, 273 274 _addAwakeListeners: function(){ 275 this._map.once('mouseout', this._sleepPending, this); 276 }, 277 278 _removeSleepingListeners: function(){ 279 this._map.options.hoverToWake && 280 this._map.off('mouseover', this._wakePending, this); 281 this._map.off('mousedown', this._wakeMap, this); 282 this._map.tap && 283 this._map.off('click', this._wakeMap, this); 284 }, 285 286 _removeAwakeListeners: function(){ 287 this._map.off('mouseout', this._sleepPending, this); 288 }, 289 290 _stopWaiting: function () { 291 this._removeSleepingListeners(); 292 this._removeAwakeListeners(); 293 var self = this; 294 if(this._enterTimeout) clearTimeout(self._enterTimeout); 295 if(this._exitTimeout) clearTimeout(self._exitTimeout); 296 this._enterTimeout = null; 297 this._exitTimeout = null; 298 } 299 }); 300 301 L.Map.addInitHook('addHandler', 'sleep', L.Map.Sleep); 302 303 304 305!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("leaflet-arc",[],e):"object"==typeof exports?exports["leaflet-arc"]=e():t["leaflet-arc"]=e()}(this,function(){return function(t){function e(o){if(r[o])return r[o].exports;var s=r[o]={exports:{},id:o,loaded:!1};return t[o].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!t.geometries[0]||!t.geometries[0].coords[0])return[];var r=function(){var r=e.lng-t.geometries[0].coords[0][0]-360;return{v:t.geometries.map(function(t){return r+=360,t.coords.map(function(t){return L.latLng([t[1],t[0]+r])})}).reduce(function(t,e){return t.concat(e)})}}();return"object"===("undefined"==typeof r?"undefined":n(r))?r.v:void 0}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=r(2),h=o(a),p=function(t){return{x:t.lng,y:t.lat}};if(!L)throw new Error("Leaflet is not defined");L.Polyline.Arc=function(t,e,r){var o=L.latLng(t),n=L.latLng(e),a=i({vertices:10,offset:10},r),u=new h["default"].GreatCircle(p(o),p(n)),c=u.Arc(a.vertices,{offset:a.offset}),f=s(c,o);return L.polyline(f,a)}},function(t,e){"use strict";var r=Math.PI/180,o=180/Math.PI,s=function(t,e){this.lon=t,this.lat=e,this.x=r*t,this.y=r*e};s.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},s.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new s(e,t)};var i=function(){this.coords=[],this.length=0};i.prototype.move_to=function(t){this.length++,this.coords.push(t)};var n=function(t){this.properties=t||{},this.geometries=[]};n.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1==this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].c
305oords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},n.prototype.wkt=function(){for(var t="",e="LINESTRING(",r=function(t){e+=t[0]+" "+t[1]+","},o=0;o<this.geometries.length;o++){if(0===this.geometries[o].coords.length)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(r),t+=e.substring(0,e.length-1)+")"}return t};var a=function(t,e,r){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new s(t.x,t.y),this.end=new s(e.x,e.y),this.properties=r||{};var o=this.start.x-this.end.x,i=this.start.y-this.end.y,n=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(n)),this.g==Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};if(a.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),r=Math.sin(t*this.g)/Math.sin(this.g),s=e*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),n=e*Math.sin(this.start.y)+r*Math.sin(this.end.y),a=o*Math.atan2(n,Math.sqrt(Math.pow(s,2)+Math.pow(i,2))),h=o*Math.atan2(i,s);return[h,a]},a.prototype.Arc=function(t,e){var r=[];if(!t||t<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var o=1/(t-1),s=0;s<t;++s){var a=o*s,h=this.interpolate(a);r.push(h)}for(var p=!1,u=0,c=e&&e.offset?e.offset:10,f=180-c,l=-180+c,d=360-c,y=1;y<r.length;++y){var g=r[y-1][0],v=r[y][0],M=Math.abs(v-g);M>d&&(v>f&&g<l||g>f&&v<l)?p=!0:M>u&&(u=M)}var m=[];if(p&&u<c){var w=[];m.push(w);for(var x=0;x<r.length;++x){var b=parseFloat(r[x][0]);if(x>0&&Math.abs(b-r[x-1][0])>d){var L=parseFloat(r[x-1][0]),S=parseFloat(r[x-1][1]),j=parseFloat(r[x][0]),E=parseFloat(r[x][1]);if(L>-180&&L<l&&180==j&&x+1<r.length&&r[x-1][0]>-180&&r[x-1][0]<l){w.push([-180,r[x][1]]),x++,w.push([r[x][0],r[x][1]]);continue}if(L>f&&L<180&&j==-180&&x+1<r.length&&r[x-1][0]>f&&r[x-1][0]<180){w.push([180,r[x][1]]),x++,w.push([r[x][0],r[x][1]]);continue}if(L<l&&j>f){var F=L;L=j,j=F;var C=S;S=E,E=C}if(L>f&&j<l&&(j+=360),L<=180&&j>=180&&L<j){var G=(180-L)/(j-L),I=G*E+(1-G)*S;w.push([r[x-1][0]>f?180:-180,I]),w=[],w.push([r[x-1][0]>f?-180:180,I]),m.push(w)}else w=[],m.push(w);w.push([b,r[x][1]])}else w.push([r[x][0],r[x][1]])}}else{var N=[];m.push(N);for(var A=0;A<r.length;++A)N.push([r[A][0],r[A][1]])}for(var P=new n(this.properties),_=0;_<m.length;++_){var O=new i;P.geometries.push(O);for(var q=m[_],R=0;R<q.length;++R)O.move_to(q[R])}return P},"undefined"!=typeof t&&"undefined"!=typeof t.exports)t.exports.Coord=s,t.exports.Arc=n,t.exports.GreatCircle=a;else{var h={};h.Coord=s,h.Arc=n,h.GreatCircle=a}},function(t,e,r){"use strict";t.exports=r(1)}])}); 306 307 308 309/* Individual */ 310 /* 311 (c) 2017, iosphere GmbH 312 Leaflet.hotline, a Leaflet plugin for drawing gradients along polylines. 313 https://github.com/iosphere/Leaflet.hotline/ 314*/ 315 316(function (root, plugin) { 317 /** 318 * UMD wrapper. 319 * When used directly in the Browser it expects Leaflet to be globally 320 * available as `L`. The plugin then adds itself to Leaflet. 321 * When used as a CommonJS module (e.g. with browserify) only the plugin 322 * factory gets exported, so one hast to call the factory manually and pass 323 * Leaflet as the only parameter. 324 * @see {@link https://github.com/umdjs/umd} 325 */ 326 if (typeof define === 'function' && define.amd) { 327 define(['leaflet'], plugin); 328 } else if (typeof exports === 'object') { 329 module.exports = plugin; 330 } else { 331 plugin(root.L); 332 } 333}(this, function (L) { 334 // Plugin is already added to Leaflet 335 if (L.Hotline) { 336 return L; 337 } 338 339 /** 340 * Core renderer. 341 * @constructor 342 * @param {HTMLElement | string} canvas - <canvas> element or its id 343 * to initialize the instance on. 344 */ 345 var Hotline = function (canvas) { 346 if (!(this instanceof Hotline)) { return new Hotline(canvas); } 347 348 var defaultPalette = { 349 0.0: 'green', 350 0.5: 'yellow', 351 1.0: 'red' 352 }; 353 354 this._canvas = canvas = typeof canvas === 'string' 355 ? document.getElementById(canvas) 356 : canvas; 357 358 this._ctx = canvas.getContext('2d'); 359 this._width = canvas.width; 360 this._height = canvas.height; 361 362 this._weight = 5; 363 this._outlineWidth = 1; 364 this._outlineColor = 'black'; 365 366 this._min = 0; 367 this._max = 1; 368 369 this._data = []; 370 371 this.palette(defaultPalette); 372 }; 373 374 Hotline.prototype = { 375 /** 376 * Sets the width of the canvas. Used when clearing the canvas. 377 * @param {number} width - Width of the canvas. 378 */ 379 width: function (width) { 380 this._width = width; 381 return this; 382 }, 383 384 /** 385 * Sets the height of the canvas. Used when clearing the canvas. 386 * @param {number} height - Height of the canvas. 387 */ 388 height: function (height) { 389 this._height = height; 390 return this; 391 }, 392 393 /** 394 * Sets the weight of the path.
395 * @param {number} weight - Weight of the path in px. 396 */ 397 weight: function (weight) { 398 this._weight = weight; 399 return this; 400 }, 401 402 /** 403 * Sets the width of the outline around the path. 404 * @param {number} outlineWidth - Width of the outline in px. 405 */ 406 outlineWidth: function (outlineWidth) { 407 this._outlineWidth = outlineWidth; 408 return this; 409 }, 410 411 /** 412 * Sets the color of the outline around the path. 413 * @param {string} outlineColor - A CSS color value. 414 */ 415 outlineColor: function (outlineColor) { 416 this._outlineColor = outlineColor; 417 return this; 418 }, 419 420 /** 421 * Sets the palette gradient. 422 * @param {Object.<number, string>} palette - Gradient definition. 423 * e.g. { 0.0: 'white', 1.0: 'black' } 424 */ 425 palette: function (palette) { 426 var canvas = document.createElement('canvas'), 427 ctx = canvas.getContext('2d'), 428 gradient = ctx.createLinearGradient(0, 0, 0, 256); 429 430 canvas.width = 1; 431 canvas.height = 256; 432 433 for (var i in palette) { 434 gradient.addColorStop(i, palette[i]); 435 } 436 437 ctx.fillStyle = gradient; 438 ctx.fillRect(0, 0, 1, 256); 439 440 this._palette = ctx.getImageData(0, 0, 1, 256).data; 441 442 return this; 443 }, 444 445 /** 446 * Sets the value used at the start of the palette gradient. 447 * @param {number} min 448 */ 449 min: function (min) { 450 this._min = min; 451 return this; 452 }, 453 454 /** 455 * Sets the value used at the end of the palette gradient. 456 * @param {number} max 457 */ 458 max: function (max) { 459 this._max = max; 460 return this; 461 }, 462 463 /** 464 * A path to rander as a hotline. 465 * @typedef Array.<{x:number, y:number, z:number}> Path - Array of x, y and z coordinates. 466 */ 467 468 /** 469 * Sets the data that gets drawn on the canvas. 470 * @param {(Path|Path[])} data - A single path or an array of paths. 471 */ 472 data: function (data) { 473 this._data = data; 474 return this; 475 }, 476 477 /** 478 * Adds a path to the list of paths. 479 * @param {Path} path 480 */ 481 add: function (path) { 482 this._data.push(path); 483 return this; 484 }, 485 486 /** 487 * Draws the currently set paths. 488 */ 489 draw: function () { 490 var ctx = this._ctx; 491 492 ctx.globalCompositeOperation = 'source-over'; 493 ctx.lineCap = 'round'; 494 495 this._drawOutline(ctx); 496 this._drawHotline(ctx); 497 498 return this; 499 }, 500 501 /** 502 * Gets the RGB values of a given z value of the current palette. 503 * @param {number} value - Value to get the color for, should be between min and max. 504 * @returns {Array.<number>} The RGB values as an array [r, g, b] 505 */ 506 getRGBForValue: function (value) { 507 var valueRelative = Math.min(Math.max((value - this._min) / (this._max - this._min), 0), 0.999); 508 var paletteIndex = Math.floor(valueRelative * 256) * 4; 509 510 return [ 511 this._palette[paletteIndex], 512 this._palette[paletteIndex + 1], 513 this._palette[paletteIndex + 2] 514 ]; 515 }, 516 517 /** 518 * Draws the outline of the graphs. 519 * @private 520 */ 521 _drawOutline: function (ctx) { 522 var i, j, dataLength, path, pathLength, pointStart, pointEnd; 523 524 if (this._outlineWidth) { 525 for (i = 0, dataLength = this._data.length; i < dataLength; i++) { 526 path = this._data[i]; 527 ctx.lineWidth = this._weight + 2 * this._outlineWidth; 528 529 for (j = 1, pathLength = path.length; j < pathLength; j++) { 530 pointStart = path[j - 1]; 531 pointEnd = path[j]; 532 533 ctx.strokeStyle = this._outlineColor; 534 ctx.beginPath(); 535 ctx.moveTo(pointStart.x, pointStart.y); 536 ctx.lineTo(pointEnd.x, pointEnd.y); 537 ctx.stroke(); 538 } 539 } 540 } 541 }, 542 543 /** 544 * Draws the color encoded hotline of the graphs. 545 * @private 546 */ 547 _drawHotline: function (ctx) { 548 var i, j, dataLength, path, pathLength, pointStart, pointEnd, 549 gradient, gradientStartRGB, gradientEndRGB; 550 551 ctx.lineWidth = this._weight; 552 553 for (i = 0, dataLength = this._data.length; i < dataLength; i++) { 554 path = this._data[i]; 555 556 for (j = 1, pathLength = path.length; j < pathLength; j++) { 557 pointStart = path[j - 1]; 558 pointEnd = path[j]; 559 560 // Create a gradient for each segment, pick start end end colors from palette gradient 561 gradient = ctx.createLinearGradient(pointStart.x, pointStart.y, pointEnd.x, pointEnd.y); 562 gradientStartRGB = this.getRGBForValue(pointStart.z); 563 gradientEndRGB = this.getRGBForValue(pointEnd.z); 564 gradient.addColorStop(0, 'rgb(' + gradientStartRGB.join(',') + ')'); 565 gradient.addColorStop(1, 'rgb(' + gradientEndRGB.join(',') + ')'); 566 567 ctx.strokeStyle = gradient; 568 ctx.beginPath(); 569 ctx.moveTo(pointStart.x, pointStart.y); 570 ctx.lineTo(pointEnd.x, pointEnd.y); 571 ctx.stroke(); 572 } 573 } 574 } 575 }; 576 577 578 var Renderer = L.Canvas.extend({ 579 _initContainer: function () { 580 L.Canvas.prototype._initContainer.call(this); 581 this._hotline = new Hotline(this._container); 582 }, 583 584 _update: function () { 585 L.Canvas.prototype._update.call(this); 586 this._hotline.width(this._container.width); 587 this._hotline.height(this._container.height); 588 }, 589 590 _updatePoly: function (layer) { 591 if (!this._drawing) { return; } 592 593 var parts = layer._parts; 594 595 if (!parts.length) { return; } 596 597 this._updateOptions(layer); 598 599 this._hotline 600 .data(parts) 601 .draw(); 602 }, 603 604 _updateOptions: function (layer) { 605 if (layer.options.min != null) { 606 this._hotline.min(layer.options.min); 607 } 608 if (layer.options.max != null) { 609 this._hotline.max(layer.options.max); 610 } 611 if (layer.options.weight != null) { 612 this._hotline.weight(layer.options.weight); 613 } 614 if (layer.options.outlineWidth != null) { 615 this._hotline.outlineWidth(layer.options.outlineWidth); 616 } 617 if (layer.options.outlineColor != null) { 618 this._hotline.outlineColor(layer.options.outlineColor); 619 } 620 if (layer.options.palette) { 621 this._hotline.palette(layer.options.palette); 622 } 623 } 624 }); 625 626 var renderer = function (options) { 627 return L.Browser.canvas ? new Renderer(options) : null; 628 }; 629 630 631 var Util = { 632 /** 633 * This is just a copy of the original Leaflet version that support a third z coordinate. 634 * @see {@link http://leafletjs.com/reference.html#lineutil-clipsegment|Leaflet} 635 */ 636 clipSegment: function (a, b, bounds, useLastCode, round) { 637 var codeA = useLastCode ? this._lastCode : L.LineUtil._getBitCode(a, bounds), 638 codeB = L.LineUtil._getBitCode(b, bounds), 639 codeOut, p, newCode; 640 641 // save 2nd code to avoid calculating it on the next segment 642 this._lastCode = codeB; 643 644 while (true) { 645 // if a,b is inside the clip window (trivial accept) 646 if (!(codeA | codeB)) { 647 return [a, b]; 648 // if a,b is outside the clip window (trivial reject) 649 } else if (codeA & codeB) { 650 return false;
651 // other cases 652 } else { 653 codeOut = codeA || codeB; 654 p = L.LineUtil._getEdgeIntersection(a, b, codeOut, bounds, round); 655 newCode = L.LineUtil._getBitCode(p, bounds); 656 657 if (codeOut === codeA) { 658 p.z = a.z; 659 a = p; 660 codeA = newCode; 661 } else { 662 p.z = b.z; 663 b = p; 664 codeB = newCode; 665 } 666 } 667 } 668 } 669 }; 670 671 672 L.Hotline = L.Polyline.extend({ 673 statics: { 674 Renderer: Renderer, 675 renderer: renderer 676 }, 677 678 options: { 679 renderer: renderer(), 680 min: 0, 681 max: 1, 682 palette: { 683 0.0: 'green', 684 0.5: 'yellow', 685 1.0: 'red' 686 }, 687 weight: 5, 688 outlineColor: 'black', 689 outlineWidth: 1 690 }, 691 692 getRGBForValue: function (value) { 693 return this._renderer._hotline.getRGBForValue(value); 694 }, 695 696 /** 697 * Just like the Leaflet version, but with support for a z coordinate. 698 */ 699 _projectLatlngs: function (latlngs, result, projectedBounds) { 700 var flat = latlngs[0] instanceof L.LatLng, 701 len = latlngs.length, 702 i, ring; 703 704 if (flat) { 705 ring = []; 706 for (i = 0; i < len; i++) { 707 ring[i] = this._map.latLngToLayerPoint(latlngs[i]); 708 // Add the altitude of the latLng as the z coordinate to the point 709 ring[i].z = latlngs[i].alt; 710 projectedBounds.extend(ring[i]); 711 } 712 result.push(ring); 713 } else { 714 for (i = 0; i < len; i++) { 715 this._projectLatlngs(latlngs[i], result, projectedBounds); 716 } 717 } 718 }, 719 720 /** 721 * Just like the Leaflet version, but uses `Util.clipSegment()`. 722 */ 723 _clipPoints: function () { 724 if (this.options.noClip) { 725 this._parts = this._rings; 726 return; 727 } 728 729 this._parts = []; 730 731 var parts = this._parts, 732 bounds = this._renderer._bounds, 733 i, j, k, len, len2, segment, points; 734 735 for (i = 0, k = 0, len = this._rings.length; i < len; i++) { 736 points = this._rings[i]; 737 738 for (j = 0, len2 = points.length; j < len2 - 1; j++) { 739 segment = Util.clipSegment(points[j], points[j + 1], bounds, j, true); 740 741 if (!segment) { continue; } 742 743 parts[k] = parts[k] || []; 744 parts[k].push(segment[0]); 745 746 // if segment goes out of screen, or it's the last one, it's the end of the line part 747 if ((segment[1] !== points[j + 1]) || (j === len2 - 2)) { 748 parts[k].push(segment[1]); 749 k++; 750 } 751 } 752 } 753 }, 754 755 _clickTolerance: function () { 756 return this.options.weight / 2 + this.options.outlineWidth + (L.Browser.touch ? 10 : 0); 757 } 758 }); 759 760 L.hotline = function (latlngs, options) { 761 return new L.Hotline(latlngs, options); 762 }; 763 764 765 return L; 766})); 767 768(function (factory, window) { 769 if (typeof define === 'function' && define.amd) { 770 define(['leaflet'], function (L) { 771 factory(L); 772 }); 773 } else if (typeof module === 'object' && module.exports) { 774 module.exports = function (L) { 775 if (L === undefined && typeof window !== 'undefined') { 776 L = require('leaflet'); 777 } 778 factory(L); 779 return L; 780 }; 781 } else if (typeof window !== 'undefined' && window.L) { 782 factory(window.L); 783 } 784}(function overIntentFactory(L) { 785 L.OverIntentInitHook = function () { 786 var timer = null; 787 788 this.on('mouseover', function (e) { 789 var duration; 790 if (timer !== null) return; 791 792 duration = this.options.intentDuration || 300; 793 794 timer = setTimeout(L.Util.bind(function () { 795 this.fire('mouseintent', { 796 latlng: e.latlng, 797 layer: e.layer 798 }); 799 timer = null; 800 }, this), duration); 801 }); 802 803 this.on('mouseout', function (e) { 804 if (timer !== null) { 805 clearTimeout(timer); 806 timer = null; 807 } 808 }); 809 }; 810 811 L.Marker.addInitHook(L.OverIntentInitHook); 812 L.Path.addInitHook(L.OverIntentInitHook); 813 L.FeatureGroup.addInitHook(L.OverIntentInitHook); 814}, window)); 815!function(a,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("leafletGestureHandling",["exports"],t):t(a.leafletGestureHandling={})}(this,function(a){"use strict";var o={ar:{touch:"استخد٠إصبعÙÙ ÙØªØØ±ÙÙ Ø§ÙØ®Ø±Ùطة",scroll:"âØ§Ø³ØªØ®Ø¯Ù ctrl + scroll ÙØªØµØºÙر/ØªÙØ¨Ùر Ø§ÙØ®Ø±Ùطة",scrollMac:"ÙÙ ÙÙ٠استخدا٠â + Ø§ÙØªÙ Ø±ÙØ± ÙØªÙØ¨ÙØ±/ØªØµØºÙØ± Ø§ÙØ®Ø±Ùطة"},bg:{touch:"ÐзползвайÑе два пÑÑÑÑа, за да пÑемеÑÑиÑе каÑÑаÑа",scroll:"ÐадÑÑжÑе бÑÑона Ctrl наÑиÑнаÑ, доÐ
815ºÐ°Ñо пÑевÑÑÑаÑе, за да пÑомениÑе маÑаба на каÑÑаÑа",scrollMac:"ÐадÑÑжÑе бÑÑона â наÑиÑнаÑ, докаÑо пÑевÑÑÑаÑе, за да пÑомениÑе маÑаба на каÑÑаÑа"},bn:{touch:"মানà¦à¦¿à¦¤à§à¦°à¦à¦¿à¦à§ সরাতৠদà§à¦à¦¿ à¦à¦à§à¦à§à¦² বà§à¦¯à¦¬à¦¹à¦¾à¦° à¦à¦°à§à¦¨",scroll:"মà§à¦¯à¦¾à¦ª à¦à§à¦® à¦à¦°à¦¤à§ ctrl + scroll বà§à¦¯à¦¬à¦¹à¦¾à¦° à¦à¦°à§à¦¨",scrollMac:"মà§à¦¯à¦¾à¦ªà§ à¦à§à¦® à¦à¦°à¦¤à§ â বà§à¦¤à¦¾à¦® à¦à¦¿à¦ªà§ সà§à¦à§à¦°à¦² à¦à¦°à§à¦¨"},ca:{touch:"Fes servir dos dits per moure el mapa",scroll:"Prem la tecla Control mentre et desplaces per apropar i allunyar el mapa",scrollMac:"Prem la tecla â mentre et desplaces per apropar i allunyar el mapa"},cs:{touch:"K posunutà mapy použijte dva prsty",scroll:"Velikost zobrazenà mapy zmÄÅte podrženÃm klávesy Ctrl a posouvánÃm koleÄka myÅ¡i",scrollMac:"Velikost zobrazenà mapy zmÄnÃte podrženÃm klávesy â a posunutÃm koleÄka myÅ¡i / touchpadu"},da:{touch:"Brug to fingre til at flytte kortet",scroll:"Brug ctrl + rullefunktionen til at zoome ind og ud pÃ¥ kortet",scrollMac:"Brug â + rullefunktionen til at zoome ind og ud pÃ¥ kortet"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"Verwende \u2318 + Scrollen zum Zoomen der Karte"},el:{touch:"ΧÏηÏιμοÏοιήÏÏε δÏο δάÏÏÏ
λα για μεÏακίνηÏη ÏÏον ÏάÏÏη",scroll:"ΧÏηÏιμοÏοιήÏÏε Ïο ÏλήκÏÏο Ctrl και κÏλιÏη, για να μεγεθÏνεÏε Ïον ÏάÏÏη",scrollMac:"ΧÏηÏιμοÏοιήÏÏε Ïο ÏλήκÏÏο â + κÏλιÏη για εÏÏίαÏη ÏÏον ÏάÏÏη"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use â + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use â + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use â + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla â mientras te desplazas para acercar o alejar el mapa"},eu:{touch:"Erabili bi hatz mapa mugitzeko",scroll:"Mapan zooma aplikatzeko, sakatu Ktrl eta egin gora edo behera",scrollMac:"Eduki sakatuta â eta egin gora eta behera mapa handitu eta txikitzeko"},fa:{touch:"Ø¨Ø±Ø§Û ØØ±Ú©Øª داد٠ÙÙØ´Ù از د٠اÙگشت Ø§Ø³ØªÙØ§Ø¯Ù Ú©ÙÛØ¯.",scroll:"âØ¨Ø±Ø§Û Ø¨Ø²Ø±Ú¯âÙÙ
اÛÛ ÙÙØ´Ù از ctrl + scroll Ø§Ø³ØªÙØ§Ø¯Ù Ú©ÙÛØ¯",scrollMac:"Ø¨Ø±Ø§Û Ø¨Ø²Ø±Ú¯âÙÙ
اÛÛ ÙÙØ´ÙØ Ø§Ø² â + Ù¾ÛÙ
Ø§ÛØ´ Ø§Ø³ØªÙØ§Ø¯Ù Ú©ÙÛØ¯."},fi:{touch:"Siirrä karttaa kahdella sormella.",scroll:"Zoomaa karttaa painamalla Ctrl-painiketta ja vierittämällä.",scrollMac:"Zoomaa karttaa pitämällä painike â painettuna ja vierittämällä."},fil:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang â + scroll upang i-zoom ang mapa"},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de â+Molette de défilement"},gl:{touch:"Utiliza dous dedos para mover o mapa",scroll:"Preme Ctrl mentres te desprazas para ampliar o mapa",scrollMac:"Preme â e desprázate para ampliar o mapa"},gu:{touch:"નàªàª¶à« àªàª¸à«àª¡àªµàª¾ બૠàªàªàªàª³à«àªàª¨à« àªàªªàª¯à«àª àªàª°à«",scroll:"નàªàª¶àª¾àª¨à« àªà«àª® àªàª°àªµàª¾ માàªà« ctrl + સà«àªà«àª°à«àª²àª¨à« àªàªªàª¯à«àª àªàª°à«",scrollMac:"નàªàª¶àª¾àª¨à« àªà«àª® àªàª°àªµàª¾ â + સà«àªà«àª°à«àª²àª¨à« àªàªªàª¯à«àª àªàª°à«"},hi:{touch:"मà¥à¤ª à¤à¤ à¤à¤à¤¹ सॠदà¥à¤¸à¤°à¥ à¤à¤à¤¹ लॠà¤à¤¾à¤¨à¥ à¤à¥ लिठदॠà¤à¤à¤à¤²à¤¿à¤¯à¥à¤ à¤à¤¾ à¤à¤¸à¥à¤¤à¥à¤®à¤¾à¤² à¤à¤°à¥à¤",scroll:"मà¥à¤ª à
815¤à¥ à¤à¤¼à¥à¤® à¤à¤°à¤¨à¥ à¤à¥ लिठctrl + सà¥à¤à¥à¤°à¥à¤² à¤à¤¾ à¤à¤ªà¤¯à¥à¤ à¤à¤°à¥à¤",scrollMac:"मà¥à¤ª à¤à¥ à¤à¤¼à¥à¤® à¤à¤°à¤¨à¥ à¤à¥ लिठâ + सà¥à¤à¥à¤°à¥à¤² à¤à¤¾ à¤à¤ªà¤¯à¥à¤ à¤à¤°à¥à¤"},hr:{touch:"PomiÄite kartu pomoÄu dva prsta",scroll:"Upotrijebite Ctrl i klizaÄ miÅ¡a da biste zumirali kartu",scrollMac:"Upotrijebite gumb â dok se pomiÄete za zumiranje karte"},hu:{touch:"Két ujjal mozgassa a térképet",scroll:"A térkép a ctrl + görgetés használatával nagyÃtható",scrollMac:"A térkép a â + görgetés használatával nagyÃtható"},id:{touch:"Gunakan dua jari untuk menggerakkan peta",scroll:"Gunakan ctrl + scroll untuk memperbesar atau memperkecil peta",scrollMac:"Gunakan â + scroll untuk memperbesar atau memperkecil peta"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza â + scorrimento per eseguire lo zoom della mappa"},iw:{touch:"××× ×ת ×××¤× ×××צע×ת ×©×ª× ×צ××¢×ת",scroll:"â×פשר ××©× ×ת ×ת ×ר××§ ×תצ××× ×××¤× ×××צע×ת ×קש ctrl ××××××",scrollMac:"×פשר ××©× ×ת ×ת ×ר××§ ×תצ××× ×××¤× ×××צע×ת ×קש â ××××××"},ja:{touch:"å°å³ãç§»åãããã«ã¯æ 2 æ¬ã§æä½ãã¾ã",scroll:"å°å³ããºã¼ã ããã«ã¯ãCtrl ãã¼ãæ¼ããªããã¹ã¯ãã¼ã«ãã¦ãã ãã",scrollMac:"å°å³ããºã¼ã ããã«ã¯ãâ ãã¼ãæ¼ããªããã¹ã¯ãã¼ã«ãã¦ãã ãã"},kn:{touch:"Use two fingers to move the map",scroll:"Use Ctrl + scroll to zoom the map",scrollMac:"Use â + scroll to zoom the map"},ko:{touch:"ì§ë를 ìì§ì´ë ¤ë©´ ë ìê°ë½ì ì¬ì©íì¸ì.",scroll:"ì§ë를 íë/ì¶ìíë ¤ë©´ Ctrlì ë른 ì± ì¤í¬ë¡¤íì¸ì.",scrollMac:"ì§ë를 íëíë ¤ë©´ â + ì¤í¬ë¡¤ ì¬ì©"},lt:{touch:"Perkelkite žemÄlapį dviem pirÅ¡tais",scroll:"Slinkite nuspaudÄ klaviÅ¡Ä
âCtrlâ, kad pakeistumÄte žemÄlapio mastelį",scrollMac:"Paspauskite klaviÅ¡Ä
â ir slinkite, kad priartintumÄte žemÄlapį"},lv:{touch:"Lai pÄrvietotu karti, bÄ«diet to ar diviem pirkstiem",scroll:"Kartes tÄlummaiÅai izmantojiet ctrl + ritinÄÅ¡anu",scrollMac:"Lai veiktu kartes tÄlummaiÅu, izmantojiet â + ritinÄÅ¡anu"},ml:{touch:"മാപàµà´ªàµ à´¨àµà´àµà´à´¾àµ» à´°à´£àµà´àµ വിരലàµà´àµ¾ à´à´ªà´¯àµà´à´¿à´àµà´àµà´",scroll:"à´àµºà´àµà´°àµàµ¾ + à´¸àµâà´àµà´°àµàµ¾ à´à´ªà´¯àµà´à´¿à´àµà´àµ âമാപàµà´ªàµ âà´¸àµà´ à´àµà´¯àµà´¯àµà´",scrollMac:"â + à´¸àµâà´àµà´°àµàµ¾ à´à´ªà´¯àµà´à´¿à´àµà´àµ âമാപàµà´ªàµ âà´¸àµà´ à´àµà´¯àµà´¯àµà´"},mr:{touch:"नà¤à¤¾à¤¶à¤¾ हलविणà¥à¤¯à¤¾à¤¸à¤¾à¤ ॠदà¥à¤¨ बà¥à¤à¥ वापरा",scroll:"नà¤à¤¾à¤¶à¤¾ à¤à¥à¤® à¤à¤°à¤£à¥à¤¯à¤¾à¤¸à¤¾à¤ ॠctrl + scroll वापरा",scrollMac:"नà¤à¤¾à¤¶à¤¾à¤µà¤° à¤à¥à¤® à¤à¤°à¤£à¥à¤¯à¤¾à¤¸à¤¾à¤ ॠâ + सà¥à¤à¥à¤°à¥à¤² वापरा"},nl:{touch:"Gebruik twee vingers om de kaart te verplaatsen",scroll:"Gebruik Ctrl + scrollen om in- en uit te zoomen op de kaart",scrollMac:"Gebruik â + scrollen om in en uit te zoomen op de kaart"},no:{touch:"Bruk to fingre for Ã¥ flytte kartet",scroll:"Hold ctrl-tasten inne og rull for Ã¥ zoome pÃ¥ kartet",scrollMac:"Hold inne â-tasten og rull for Ã¥ zoome pÃ¥ kartet"},pl:{touch:"PrzesuÅ mapÄ dwoma palcami",scroll:"NaciÅnij CTRL i przewiÅ, by przybliżyÄ mapÄ",scrollMac:"NaciÅnij â i przewiÅ, by przybliżyÄ mapÄ"},pt:{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use â e role a tela simultaneamente para aplicar zoom no mapa"},"pt-BR":{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use â e role a tela simultaneamente para aplicar zoom no mapa"},"pt-PT":{touch:"Utilize dois dedos para mover o mapa",scroll:"Utilizar ctrl + deslocar para aumentar/diminuir zoom do mapa",scrollMac:"Utilize â + deslocar para aumentar/diminuir o zoom do mapa"},ro:{touch:"FolosiÈi douÄ degete pentru a deplasa harta",scroll:"ApÄsaÈi tasta ctrl Èi derulaÈi simultan pentru a mÄri harta",scrollMac:"FolosiÈi â Èi derulaÈi pentru a mÄri/micÈora harta"},ru:{touch:"ЧÑÐ¾Ð±Ñ Ð¿ÐµÑемеÑÑиÑÑ ÐºÐ°ÑÑÑ, пÑоведиÑе по ней двÑÐ¼Ñ Ð¿Ð°Ð»ÑÑами",scroll:"ЧÑÐ¾Ð±Ñ Ð¸Ð·Ð¼ÐµÐ½Ð¸ÑÑ Ð¼Ð°ÑÑÑаб, пÑокÑÑÑивайÑе каÑÑÑ, ÑдеÑÐ¶Ð¸Ð²Ð°Ñ ÐºÐ»Ð°Ð²Ð¸ÑÑ Ctrl.",scrollMac:"ЧÑÐ¾Ð±Ñ Ð¸Ð·Ð¼ÐµÐ½Ð¸ÑÑ Ð¼Ð°ÑÑÑаб, нажмиÑе â + пÑокÑÑÑка"},sk:{touch:"Mapu môžete posunúť dvoma prstami",scroll:"Ak chcete priblÞiÅ¥ mapu, stlaÄte kláves ctrl a posúvajte",scrollMac:"Ak chcete priblÞiÅ¥ mapu, stlaÄte kláves â a posúvajte kolieskom myÅ¡i"},sl:{touch:"Premaknite zemljevid z dvema prstoma",scroll:"Zemljevid poveÄate tako, da držite tipko Ctrl in vrtite
815kolesce na miÅ¡ki",scrollMac:"Uporabite â + funkcijo pomika, da poveÄate ali pomanjÅ¡ate zemljevid"},sr:{touch:"ÐÐ°Ð¿Ñ Ð¿Ð¾Ð¼ÐµÑаÑÑе помоÑÑ Ð´Ð²Ð° пÑÑÑа",scroll:"ÐÑиÑиÑниÑе ctrl ÑаÑÑÐµÑ Ð´Ð¾Ðº помеÑаÑе да биÑÑе зÑмиÑали мапÑ",scrollMac:"ÐÑиÑиÑниÑе ÑаÑÑÐµÑ â док помеÑаÑе да биÑÑе зÑмиÑали мапÑ"},sv:{touch:"Använd tvÃ¥ fingrar för att flytta kartan",scroll:"Använd ctrl + rulla för att zooma kartan",scrollMac:"Använd â + rulla för att zooma pÃ¥ kartan"},ta:{touch:"à®®à¯à®ªà¯à®ªà¯ நà®à®°à¯à®¤à¯à®¤ à®à®°à®£à¯à®à¯ விரலà¯à®à®³à¯à®ªà¯ பயனà¯à®ªà®à¯à®¤à¯à®¤à®µà¯à®®à¯",scroll:"à®®à¯à®ªà¯à®ªà¯ பà¯à®°à®¿à®¤à®¾à®à¯à®à®¿/à®à®¿à®±à®¿à®¤à®¾à®à¯à®à®¿à®ªà¯ பாரà¯à®à¯à®, ctrl பà®à¯à®à®©à¯à®ªà¯ பிà®à®¿à®¤à¯à®¤à®ªà®à®¿, à®®à¯à®²à¯/à®à¯à®´à¯ ஸà¯à®à¯à®°à®¾à®²à¯ à®à¯à®¯à¯à®¯à®µà¯à®®à¯",scrollMac:"à®®à¯à®ªà¯à®ªà¯ பà¯à®°à®¿à®¤à®¾à®à¯à®à®¿/à®à®¿à®±à®¿à®¤à®¾à®à¯à®à®¿à®ªà¯ பாரà¯à®à¯à®, â பà®à¯à®à®©à¯à®ªà¯ பிà®à®¿à®¤à¯à®¤à®ªà®à®¿, à®®à¯à®²à¯/à®à¯à®´à¯ ஸà¯à®à¯à®°à®¾à®²à¯ à®à¯à®¯à¯à®¯à®µà¯à®®à¯"},te:{touch:"à°®à±à°¯à°¾à°ªà±âని తరలిà°à°à°¡à° à°à±à°¸à° à°°à±à°à°¡à± à°µà±à°³à±à°²à°¨à± à°à°ªà°¯à±à°à°¿à°à°à°à°¡à°¿",scroll:"à°®à±à°¯à°¾à°ªà±âని à°à±à°®à± à°à±à°¯à°¡à°¾à°¨à°¿à°à°¿ ctrl à°¬à°à°¨à±âనౠనà±à°à±à°à°¿ à°à°à°à°¿, à°¸à±à°à±à°°à±à°²à± à°à±à°¯à°à°¡à°¿",scrollMac:"à°®à±à°¯à°¾à°ªà± à°à±à°®à± à°à±à°¯à°¾à°²à°à°à± â + à°¸à±à°à±à°°à±à°²à± à°à°ªà°¯à±à°à°¿à°à°à°à°¡à°¿"},th:{touch:"à¹à¸à¹ 2 à¸à¸´à¹à¸§à¹à¸à¸·à¹à¸à¹à¸¥à¸·à¹à¸à¸à¹à¸à¸à¸à¸µà¹",scroll:"à¸à¸ Ctrl à¸à¹à¸²à¸à¹à¸§à¹ à¹à¸¥à¹à¸§à¹à¸¥à¸·à¹à¸à¸à¸«à¸à¹à¸²à¸à¸à¹à¸à¸·à¹à¸à¸à¸¹à¸¡à¹à¸à¸à¸à¸µà¹",scrollMac:"à¸à¸ â à¹à¸¥à¹à¸§à¹à¸¥à¸·à¹à¸à¸à¸«à¸à¹à¸²à¸à¸à¹à¸à¸·à¹à¸à¸à¸¹à¸¡à¹à¸à¸à¸à¸µà¹"},tl:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang â + scroll upang i-zoom ang mapa"},tr:{touch:"Haritada gezinmek için iki parmaÄınızı kullanın",scroll:"Haritayı yakınlaÅtırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaÅtırmak için â tuÅuna basıp ekranı kaydırın"},uk:{touch:"ÐеÑемÑÑÑйÑе каÑÑÑ Ð´Ð²Ð¾Ð¼Ð° палÑÑÑми",scroll:"Щоб змÑнÑваÑи маÑÑÑаб каÑÑи, пÑокÑÑÑÑйÑе колÑÑаÑко миÑÑ, ÑÑÑимÑÑÑи клавÑÑÑ Ctrl",scrollMac:"Щоб змÑниÑи маÑÑÑаб каÑÑи, викоÑиÑÑовÑйÑе â + пÑокÑÑÑÑваннÑ"},vi:{touch:"Sá» dụng hai ngón tay Äá» di chuyá»n bản Äá»",scroll:"Sá» dụng ctrl + cuá»n Äá» thu phóng bản Äá»",scrollMac:"Sá» dụng â + cuá»n Äá» thu phóng bản Äá»"},"zh-CN":{touch:"使ç¨åæç§»å¨å°å¾",scroll:"æä½ Ctrl å¹¶æ»å¨é¼ æ æ»è½®æå¯ç¼©æ¾å°å¾",scrollMac:"æä½ â å¹¶æ»å¨é¼ æ æ»è½®æå¯ç¼©æ¾å°å¾"},"zh-TW":{touch:"åæä»¥å
©æç§»åå°å",scroll:"æä½ ctrl éµå 䏿²åæ»é¼ å¯ä»¥ç¸®æ¾å°å",scrollMac:"æ â å 䏿»¾åæ²è»¸å¯ä»¥ç¸®æ¾å°å"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},duration:1e3}});var t=!1,e=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(a){"movestart"==a.type||"move"==a.type?t=!0:"moveend"==a.type&&(t=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var a;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)a=this._map.options.gestureHandlingOptions.text;else{var t=this._getUserLanguage();
815t||(t="en"),o[t]&&(a=o[t]),a||-1===t.indexOf("-")||(t=t.split("-")[0],a=o[t]),a||(a=o[t="en"])}var e=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(e=!0);var l=a.scroll;e&&(l=a.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",a.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",l)},_getUserLanguage:function(){return navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(a){for(var t=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],e=!1,l=0;l<t.length;l++)L.DomUtil.hasClass(a.target,t[l])&&(e=!0);e?L.DomUtil.hasClass(a.target,"leaflet-interactive")&&"touchmove"===a.type&&1===a.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning"):"touchmove"===a.type||"touchstart"===a.type?1===a.touches.length?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):(a.preventDefault(),this._enableInteractions(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")},_isScrolling:!1,_handleScroll:function(a){a.metaKey||a.ctrlKey?(a.preventDefault(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.enable()):(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.disable(),clearTimeout(this._isScrolling),this._isScrolling=setTimeout(function(){for(var a=document.getElementsByClassName("leaflet-gesture-handling-scroll-warning"),t=0;t<a.length;t++)L.DomUtil.removeClass(a[t],"leaflet-gesture-handling-scroll-warning")},this._map.options.gestureHandlingOptions.duration))},_handleMouseOver:function(a){this._enableInteractions()},_handleMouseOut:function(a){t||this._disableInteractions()}});L.Map.addInitHook("addHandler","gestureHandling",e),a.GestureHandling=e,a.default=e,Object.defineProperty(a,"__esModule",{value:!0})}); 816 817/* MapLibre GL JS 6.10.0. Licensed under the 3-Clause BSD License. */ 818var maplibregl=(()=>{var nh=Object.defineProperty;var Jb=Object.getOwnPropertyDescriptor;var Qb=Object.getOwnPropertyNames;var t2=Object.prototype.hasOwnProperty;var e2=(t,e)=>{for(var i in e)nh(t,i,{get:e[i],enumerable:!0})},i2=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Qb(e))!t2.call(t,a)&&a!==i&&nh(t,a,{get:()=>e[a],enumerable:!(r=Jb(e,a))||r.enumerable});return t};var r2=t=>i2(nh({},"__esModule",{value:!0}),t);var HR={};e2(HR,{AJAXError:()=>Za,AttributionControl:()=>Ob,BoxZoomHandler:()=>Db,CanvasSource:()=>Ix,CooperativeGesturesHandler:()=>Lb,DoubleClickZoomHandler:()=>Fb,DragPanHandler:()=>zb,DragRotateHandler:()=>Rb,EXTENT:()=>k,EdgeInsets:()=>Up,ErrorEvent:()=>J,Event:()=>ei,Evented:()=>ce,FullscreenControl:()=>AR,FullscreenEvent:()=>Hp,GPUInitializationError:()=>Eb,GeoJSONSource:()=>Ex,GeolocateControl:()=>SR,GeolocateErrorEvent:()=>Gb,GeolocateEvent:()=>_a,GeolocatePositionEvent:()=>Wp,GlobeControl:()=>FR,Hash:()=>Sb,ImageSource:()=>yn,KeyboardHandler:()=>Ab,LngLat:()=>Y,LngLatBounds:()=>ji,LogoControl:()=>Vb,Map:()=>_R,MapBoxZoomEvent:()=>Mp,MapContextEvent:()=>_u,MapLibreEvent:()=>ye,MapLibreMap:()=>_R,MapMouseEvent:()=>ci,MapMovementEvent:()=>Q,MapProjectionEvent:()=>cx,MapSourceDataEvent:()=>Nt,MapStyleDataEvent:()=>Pi,MapStyleImageMissingEvent:()=>dx,MapStyleLoadEvent:()=>Ap,MapTerrainEvent:()=>hx,MapTouchEvent:()=>Xs,MapWheelEvent:()=>ux,Marker:()=>qp,MarkerClickEvent:()=>$b,MarkerDragEvent:()=>ga,MercatorCoordinate:()=>Et,NavigationControl:()=>vR,Point:()=>C,Popup:()=>kR,PopupEvent:()=>Xp,RasterDEMTileSource:()=>wx,RasterTileSource:()=>tf,ScaleControl:()=>PR,ScrollZoomHandler:()=>Mb,Style:()=>$p,TerrainControl:()=>MR,TwoFingersTouchPitchHandler:()=>Ib,TwoFingersTouchRotateHandler:()=>Cb,TwoFingersTouchZoomHandler:()=>Pb,TwoFingersTouchZoomRotateHandler:()=>kb,VectorTileSource:()=>bx,VideoSource:()=>Cx,addProtocol:()=>g_,addSourceType:()=>IM,clearPrewarmedResources:()=>eM,config:()=>ti,createTileMesh:()=>Dx,getGlobalDispatcher:()=>Qp,getMaxParallelImageRequests:()=>$R,getRTLTextPluginStatus:()=>VR,getVersion:()=>jR,getWorkerCount:()=>UR,getWorkerUrl:()=>ZR,importScriptInWorkers:()=>WR,isTimeFrozen:()=>bA,now:()=>Ft,prewarm:()=>tM,removeProtocol:()=>__,restoreNow:()=>xA,setMaxParallelImageRequests:()=>GR,setNow:()=>vA,setRTLTextPlugin:()=>OR,setWorkerCount:()=>NR,setWorkerUrl:()=>qR});/** 819* MapLibre GL JS 820* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.10.0/LICENSE.txt 821*/var a2=Object.create,Lg=Object.defineProperty,n2=Object.getOwnPropertyDescriptor,s2=Object.getOwnPropertyNames,o2=Object.getPrototypeOf,Bg=Object.prototype.hasOwnProperty,Vc=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),l2=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=s2(e),n=0,s=a.length,o;n<s;n++)o=a[n],!Bg.call(t,o)&&o!==i&&Lg(t,o,{get:(l=>e[l]).bind(null,o),enumerable:!(r=n2(e,o))||r.enumerable});return t},u2=(t,e,i)=>(i=t==null?{}
vendor: 4,648 bytes, line 821
821:a2(o2(t)),l2(e||!t||!t.__esModule||!Bg.call(t,"default")?Lg(i,"default",{value:t,enumerable:!0}):i,t));function C(t,e){this.x=t,this.y=e}C.prototype={clone(){return new C(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),i=Math.sin(t),r=e*this.x-i*this.y,a=i*this.x+e*this.y;return this.x=r,this.y=a,this},_rotateAround(t,e){let i=Math.cos(t),r=Math.sin(t),a=e.x+i*(this.x-e.x)-r*(this.y-e.y),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=a,this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:C},C.convert=function(t){if(t instanceof C)return t;if(Array.isArray(t))return new C(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new C(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function h2(t,e,i,r){let a=3*t,n=3*(i-t)-a,s=1-a-n,o=3*e,l=3*(r-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let d=h;for(let m=0;m<8;m++){let g=((s*d+n)*d+a)*d-h;if(Math.abs(g)<c)return((u*d+l)*d+o)*d;let _=(3*s*d+2*n)*d+a;if(Math.abs(_)<1e-6)break;d-=g/_}let p=0,f=1;d=h;for(let m=0;m<20;m++){let g=((s*d+n)*d+a)*d;if(Math.abs(g-h)<c)break;h>g?p=d:f=d,d=(p+f)*.5}return((u*d+l)*d+o)*d}}var sh;function ol(){return sh??(sh=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),sh}var bo;function jc(){if(bo==null&&(bo=!1,ol())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let i=0;i<25;i++){let r=i*4;t.fillStyle=`rgb(${r},${r+1},${r+2})`,t.fillRect(i%5,Math.floor(i/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let i=0;i<100;i++)if(i%4!=3&&e[i]!==i){bo=!0;break}}}return bo||!1}var fe=typeof Float32Array<"u"?Float32Array:Array;Math.PI/180,180/Math.PI;function Uc(){var t=new fe(9);return fe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function c2(t){var e=t[0],i=t[1],r=t[2],a=t[3],n=t[4],s=t[5],o=t[6],l=t[7],u=t[8];return e*(u*n-s*l)+i*(-u*a+s*o)+r*(l*a-n*o)}function Og(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function d2(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],s=i+i,o=r+r,l=a+a,u=i*s,h=r*s,c=r*o,d=a*s,p=a*o,f=a*l,m=n*s,g=n*o,_=n*l;return t[0]=1-c-f,t[3]=h-_,t[6]=d+g,t[1]=h+_,t[4]=1-u-f,t[7]=p-m,t[2]=d-g,t[5]=p+m,t[8]=1-u-c,t}function cr(){var t=new fe(16);return fe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ll(t){var e=new fe(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Vg(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ei(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function cs(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],s=e[4],o=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],_=e[15],y=i*o-r*s,x=i*l-a*s,v=i*u-n*s,w=r*l-a*o,b=r*u-n*o,T=a*u-n*l,D=h*m-c*f,
vendor: 23,519 bytes, line 821
821E=h*g-d*f,M=h*_-p*f,R=c*g-d*m,z=c*_-p*m,P=d*_-p*g,S=y*P-x*z+v*R+w*M-b*E+T*D;return S?(S=1/S,t[0]=(o*P-l*z+u*R)*S,t[1]=(a*z-r*P-n*R)*S,t[2]=(m*T-g*b+_*w)*S,t[3]=(d*b-c*T-p*w)*S,t[4]=(l*M-s*P-u*E)*S,t[5]=(i*P-a*M+n*E)*S,t[6]=(g*v-f*T-_*x)*S,t[7]=(h*T-d*v+p*x)*S,t[8]=(s*z-o*M+u*D)*S,t[9]=(r*M-i*z-n*D)*S,t[10]=(f*b-m*v+_*y)*S,t[11]=(c*v-h*b-p*y)*S,t[12]=(o*E-s*R-l*D)*S,t[13]=(i*R-r*E+a*D)*S,t[14]=(m*x-f*w-g*y)*S,t[15]=(h*w-c*x+d*y)*S,t):null}function na(t,e,i){var r=e[0],a=e[1],n=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],_=e[14],y=e[15],x=i[0],v=i[1],w=i[2],b=i[3];return t[0]=x*r+v*o+w*c+b*m,t[1]=x*a+v*l+w*d+b*g,t[2]=x*n+v*u+w*p+b*_,t[3]=x*s+v*h+w*f+b*y,x=i[4],v=i[5],w=i[6],b=i[7],t[4]=x*r+v*o+w*c+b*m,t[5]=x*a+v*l+w*d+b*g,t[6]=x*n+v*u+w*p+b*_,t[7]=x*s+v*h+w*f+b*y,x=i[8],v=i[9],w=i[10],b=i[11],t[8]=x*r+v*o+w*c+b*m,t[9]=x*a+v*l+w*d+b*g,t[10]=x*n+v*u+w*p+b*_,t[11]=x*s+v*h+w*f+b*y,x=i[12],v=i[13],w=i[14],b=i[15],t[12]=x*r+v*o+w*c+b*m,t[13]=x*a+v*l+w*d+b*g,t[14]=x*n+v*u+w*p+b*_,t[15]=x*s+v*h+w*f+b*y,t}function se(t,e,i){var r=i[0],a=i[1],n=i[2],s,o,l,u,h,c,d,p,f,m,g,_;return e===t?(t[12]=e[0]*r+e[4]*a+e[8]*n+e[12],t[13]=e[1]*r+e[5]*a+e[9]*n+e[13],t[14]=e[2]*r+e[6]*a+e[10]*n+e[14],t[15]=e[3]*r+e[7]*a+e[11]*n+e[15]):(s=e[0],o=e[1],l=e[2],u=e[3],h=e[4],c=e[5],d=e[6],p=e[7],f=e[8],m=e[9],g=e[10],_=e[11],t[0]=s,t[1]=o,t[2]=l,t[3]=u,t[4]=h,t[5]=c,t[6]=d,t[7]=p,t[8]=f,t[9]=m,t[10]=g,t[11]=_,t[12]=s*r+h*a+f*n+e[12],t[13]=o*r+c*a+m*n+e[13],t[14]=l*r+d*a+g*n+e[14],t[15]=u*r+p*a+_*n+e[15]),t}function we(t,e,i){var r=i[0],a=i[1],n=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function sa(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[4],s=e[5],o=e[6],l=e[7],u=e[8],h=e[9],c=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=n*a+u*r,t[5]=s*a+h*r,t[6]=o*a+c*r,t[7]=l*a+d*r,t[8]=u*a-n*r,t[9]=h*a-s*r,t[10]=c*a-o*r,t[11]=d*a-l*r,t}function Nc(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[0],s=e[1],o=e[2],l=e[3],u=e[8],h=e[9],c=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*a-u*r,t[1]=s*a-h*r,t[2]=o*a-c*r,t[3]=l*a-d*r,t[8]=n*r+u*a,t[9]=s*r+h*a,t[10]=o*r+c*a,t[11]=l*r+d*a,t}function dr(t,e,i){var r=Math.sin(i),a=Math.cos(i),n=e[0],s=e[1],o=e[2],l=e[3],u=e[4],h=e[5],c=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=n*a+u*r,t[1]=s*a+h*r,t[2]=o*a+c*r,t[3]=l*a+d*r,t[4]=u*a-n*r,t[5]=h*a-s*r,t[6]=c*a-o*r,t[7]=d*a-l*r,t}function jg(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function p2(t,e,i,r,a){var n=1/Math.tan(e/2);if(t[0]=n/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,a!=null&&a!==1/0){var s=1/(r-a);t[10]=(a+r)*s,t[14]=2*a*r*s}else t[10]=-1,t[14]=-2*r;return t}var ul=p2;function f2(t,e,i,r,a,n,s){var o=1/(e-i),l=1/(r-a),u=1/(n-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+i)*o,t[13]=(a+r)*l,t[14]=(s+n)*u,t[15]=1,t}var Ri=f2;function Ug(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Ng(t,e){var i=t[0],r=t[1],a=t[2],n=t[3],s=t[4],o=t[5],l=t[6],u=t[7],h=t[8],c=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],_=t[15],y=e[0],x=e[1],v=e[2],w=e[3],b=e[4],T=e[5],D=e[6],E=e[7],M=e[8],R=e[9],z=e[10],P=e[11],S=e[12],I=e[13],A=e[14],L=e[15];return Math.abs(i-y)<=1e-6*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(r-x)<=1e-6*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(a-v)<=1e-6*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(n-w)<=1e-6*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(s-b)<=1e-6*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(l-D)<=1e-6*Math.max(1,Math.abs(l),Math.abs(D))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-M)<=1e-6*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(c-R)<=1e-6*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(d-z)<=1e-6*Math.max(1,Math.abs(d),Math.abs(z))&&Math.abs(p-P)<=1e-6*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(f-S)<=1e-6*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(m-I)<=1e-6*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(g-A)<=1e-6*Math.max(1,Math.abs(g),Math.abs(A))&&Math.abs(_-L)<=1e-6*Math.max(1,Math.abs(_),Math.abs(L))}function $g(){var t=new fe(3);return fe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function hl(t){var e=new fe(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Qi(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function Wf(t,e,i){var r=new fe(3);return r[0]=t,r[1]=e,r[2]=i,r}function si(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function cl(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Ut(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function ds(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function Gg(t,e){var i=e[0]-t[0],r=e[1]-t[1],a=e[2]-t[2];return Math.sqrt(i*i+r*r+a*a)}function Zg(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Le(t,e){var i=e[0],r=e[1],a=e[2],n=i*i+r*r+a*a;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function oe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ne(t,e,i){var r=e[0],a=e[1],n=e[2],s=i[0],o=i[1],l=i[2];return t[0]=a*l-n*o,t[1]=n*s-r*l,t[2]=r*o-a*s,t}function qg(t,e,i){var r=e[0],a=e[1],n=e[2],s=i[3]*r+i[7]*a+i[11]*n+i[15];return s||(s=1),t[0]=(i[0]*r+i[4]*a+i[8]*n+i[12])/s,t[1]=(i[1]*r+i[5]*a+i[9]*n+i[13])/s,t[2]=(i[2]*r+i[6]*a+i[10]*n+i[14])/s,t}function Wg(t,e,i){var r=e[0],a=e[1],n=e[2];return t[0]=r*i[0]+a*i[3]+n*i[6],t[1]=r*i[1]+a*i[4]+n*i[7],t[2]=r*i[2]+a*i[5]+n*i[8],t}function dl(t,e,i){var r=i[0],a=i[1],n=i[2],s=i[3],o=e[0],l=e[1],u=e[2],h=a*u-n*l,c=n*o-r*u,d=r*l-a*o;return h+=h,c+=c,d+=d,t[0]=o+s*h+a*d-n*c,t[1]=l+s*c+n*h-r*d,t[2]=u+s*d+r*c-a*h,t}function en(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[0],n[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),n[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function oa(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),n[1]=a[1],n[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function pl(t,e,i,r){var a=[],n=[];return a[0]=e[0]-i[0],a[1]=e[1]-i[1],a[2]=e[2]-i[2],n[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),n[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),n[2]=a[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function Hg(t){return t[0]=0,t[1]=0,t[2]=0,t}var tr=cl,ps=Qi;(function(){var t=$g();return function(e,i,r,a,n,s){var o,l;for(i||(i=3),r||(r=0),l=a?Math.min(a*i+r,e.length):e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],n(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function m2(){var t=new fe(4);return fe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function g2(t,e,i,r){var a=new fe(4);return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a}function _2(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}function Xg(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function y2(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],s=i*i+r*r+a*a+n*n;return s>0&&(s=1/Math.sqrt(s)),t[0]=i*s,t[1]=r*s,t[2]=a*s,t[3]=n*s,t}function Te(t,e,i){var r=e[0],a=e[1],n=e[2],s=e[3];return t[0]=i[0]*r+i[4]*a+i[8]*n+i[12]*s,t[1]=i[1]*r+i[5]*a+i[9]*n+i[13]*s,t[2]=i[2]*r+i[6]*a+i[10]*n+i[14]*s,t[3]=i[3]*r+i[7]*a+i[11]*n+i[15]*s,t}var Yg=_2;(function(){var t=m2();return function(e,i,r,a,n,s){var o,l;for(i||(i=4),r||(r=0),l=a?Math.min(a*i+r,e.length):e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],n(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();function Hf(){var t=new fe(4);return fe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function v2(t,e,i){i*=.5;var r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t}function Kg(t,e,i){var r=e[0],a=e[1],n=e[2],s=e[3],o=i[0],l=i[1],u=i[2],h=i[3];return t[0]=r*h+s*o+a*u-n*l,t[1]=a*h+s*l+n*o-r*u,t[2]=n*h+s*u+r*l-a*o,t[3]=s*h-r*o-a*l-n*u,t}function $n(t,e,i,r){var a=e[0],n=e[1],s=e[2],o=e[3],l=i[0],u=i[1],h=i[2],c=i[3],d,p=a*l+n*u+s*h+o*c,f,m,g;return p<0&&(p=-p,l=-l,u=-u,h=-h,c=-c),1-p>1e-6?(d=Math.acos(p),f=Math.sin(d),m=Math.sin((1-r)*d)/f,g=Math.sin(r*d)/f):(m=1-r,g=r),t[0]=m*a+g*l,t[1]=m*n+g*u,t[2]=m*s+g*h,t[3]=m*o+g*c,t}function x2(t,e){var i=e[0]+e[4]+e[8],r;if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var a=0;e[4]>e[0]&&(a=1),e[8]>e[a*3+a]&&(a=2);var n=(a+1)%3,s=(a+2)%3;r=Math.sqrt(e[a*3+a]-e[n*3+n]-e[s*3+s]+1),t[a]=.5*r,r=.5/r,t[3]=(e[n*3+s]-e[s*3+n])*r,t[n]=(e[n*3+a]+e[a*3+n])*r,t[s]=(e[s*3+a]+e[a*3+s])*r}return t}function fl(t,e,i,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",n=Math.PI/360;e*=n,r*=n,i*=n;var s=Math.sin(e),o=Math.cos(e),l=Math.sin(i),u=Math.cos(i),h=Math.sin(r),c=Math.cos(r);switch(a){case"xyz":t[0]=s*u*c+o*l*h,t[1]=o*l*c-s*u*h,t[2]=o*u*h+s*l*c,t[3]=o*u*c-s*l*h;break;case"xzy":t[0]=s*u*c-o*l*h,t[1]=o*l*c-s*u*h,t[2]=o*u*h+s*l*c,t[3]=o*u*c+s*l*h;break;case"yxz":t[0]=s*u*c+o*l*h,t[1]=o*l*c-s*u*h,t[2]=o*u*h-s*l*c,t[3]=o*u*c+s*l*h;break;case"yzx":t[0]=s*u*c+o*l*h,t[1]=o*l*c+s*u*h,t[2]=o*u*h-s*l*c,t[3]=o*u*c-s*l*h;break;case"zxy":t[0]=s*u*c-o*l*h,t[1]=o*l*c+s*u*h,t[2]=o*u*h+s*l*c,t[3]=o*u*c-s*l*h;break;case"zyx":t[0]=s*u*c-o*l*h,t[1]=o*l*c+s*u*h,t[2]=o*u*h-s*l*c,t[3]=o*u*c+s*l*h;break;default:throw Error("Unknown angle order "+a)}return t}var $c=g2,Xf=y2;(function(){var t=$g(),e=Wf(1,0,0),i=Wf(0,1,0);return function(r,a,n){var s=oe(a,n);return s<-.999999?(Ne(t,e,a),ps(t)<1e-6&&Ne(t,i,a),Le(t,t),v2(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(Ne(t,a,n),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,Xf(r,r))}})(),(function(){var t=Hf(),e=Hf();return function(i,r,a,n,s,o){return $n(t,r,s,o),$n(e,a,n,o),$n(i,t,e,2*o*(1-o)),i}})(),(function(){var t=Uc();return function(e,i,r,a){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=a[0],t[4]=a[1],t[7]=a[2],t[2]=-i[0],t[5]=-i[1],t[8]=-i[2],Xf(e,x2(e,t))}})();function ml(){var t=new fe(2);return fe!=Float32Array&&(t[0]=0,t[1]=0),t}function Yf(t,e){var i=new fe(2);return i[0]=t,i[1]=e,i}function Gc(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function Zc(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}function b2(t){var e=t[0],i=t[1];return e*e+i*i}function w2(t,e){return t[0]*e[0]+t[1]*e[1]}function qc(t){return t[0]=0,t[1]=0,t}var Jg=b2;(function(){var t=ml();return function(e,i,r,a,n,s){var o,l;for(i||(i=2),r||(r=0),l=a?Math.min(a*i+r,e.length):e.length,o=r;o<l;o+=i)t[0]=e[o],t[1]=e[o+1],n(t,t,s),e[o]=t[0],e[o+1]=t[1];return e}})();var k=8192;function Ke(t,e,i){return e*(k/(t.tileSize*2**(i-t.tileID.overscaledZ)))}function be(t){return t instanceof Error?t:Error(typeof t=="string"?t:String(t))}function Lr(){return new Float64Array(4)}function St(){return new Float64Array(3)}function Br(){return new Float64Array(16)}function fs(){let t=new Float64Array(16);return Ei(t),t}function Wc(){let t=new Float32Array(16);return Ei(t),t}function pr(t,e,i,r,a=!1){if(!i[0]&&!i[1])return[0,0];let n=a?r==="map"?-t.bearingInRadians:0:r==="viewport"?t.bearingInRadians:0;if(n){let s=Math.sin(n),o=Math.cos(n);i=[i[0]*o-i[1]*s,i[0]*s+i[1]*o]}return[a?i[0]:Ke(e,i[0],t.zoom),a?i[1]:Ke(e,i[1],t.zoom)]}function gl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]}function oi(t,e,i){let r=c2([t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]]);if(r===0)return null;let a=Ne([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),n=Ne([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),s=Ne([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),o=Ut([],a,-t[3]);return si(o,o,Ut([],n,-e[3])),si(o,o,Ut([],s,-i[3])),Ut(o,o,1/r),o}function Qg(t,e,i){let r=t[0]*i[0]+t[1]*i[1]+t[2]*i[2],a=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return a===0?null:(-r-i[3])/a}function ms(t,e,i,r){let a=Math.sqrt(t*t+e*e),n=Math.sqrt(i*i+r*r);t/=a,e/=a,i/=n,r/=n;let s=t*i+e*r,o=Math.acos(s);return-e*i+t*r>0?o:-o}function Je(t,e){let i=zr(t,360),r=zr(e,360),a=r-i,n=r>i?a-360:a+360;return Math.abs(a)<Math.abs(n)?a:n}function gs(t,e){let i=zr(t,Math.PI*2),r=zr(e,Math.PI*2);return Math.min(Math.abs(i-r),Math.abs(i-r+Math.PI*2),Math.abs(i-r-Math.PI*2))}function zr(t,e){return(t%e+e)%e}function _s(t,e,i,r,a){return la(r,a,st((t-e)/(i-e),0,1))}function la(t,e,i){return t*(1-i)+e*i}function t_(t){let e=1/0,i=1/0,r=-1/0,a=-1/0;for(let n of t)e=Math.min(e,n.x),i=Math.min(i,n.y),r=Math.max(r,n.x),a=Math.max(a,n.y);return[e,i,r,a]}function e_(t){if(!t.length)return new Set;let e=Math.max(...t.map(l=>l.canonical.z)),i=1/0,r=-1/0,a=1/0,n=-1/0,s=[];for(let l of t){let{x:u,y:h,z:c}=l.canonical,d=2**(e-c),p=u*d,f=h*d;s.push({id:l,x:p,y:f}),p<i&&(i=p),p>r&&(r=p),f<a&&(a=f),f>n&&(n=f)}let o=new Set;for(let l of s)(l.x===i||l.x===r||l.y===a||l.y===n)&&o.add(l.id);return o}function T2(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function _l(t,e,i,r){return h2(t,e,i,r)}var yl=_l(.25,.1,.25,1);function st(t,e,i){return Math.min(i,Math.max(e,t))}function li(t,e,i){let r=i-e,a=((t-e)%r+r)%r+e;return a===e?i:a}function q(t,...e){for(let i of e)for(let r in i)t[r]=i[r];return t}function rn(t,e){let i={};for(let r of e)r in t&&(i[r]=t[r]);return i}var E2=1;function Hc(){return E2++}function S2(t){return Math.log(t)/Math.LN2%1==0}function i_(t){return t<=1?1:2**Math.ceil(Math.log(t)/Math.LN2)}function Be(t){return 2**t}function Ee(t){return Math.log(t)/Math.LN2}function Qe(t,e,i){if(e<=0)return t;let r=1/e;return i===void 0||Math.abs(i)<1e-10?Math.round(t*r)/r:(i>0?Math.ceil(t*r-1e-9):Math.floor(t*r+1e-10))/r}function vl(t,e,i){let r={};for(let a in t)r[a]=e.call(i||this,t[a],a,t);return r}function Xc(t,e,i){let r={};for(let a in t)e.call(i||this,t[a],a,t)&&(r[a]=t[a]);return r}function wi(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!wi(t[i],e[i]))return!1;return!0}if(typeof t=="object"&&t&&e!==null){if(typeof e!="object"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(!wi(t[i],e[i]))return!1;return!0}return t===e}function Ue(t){return Array.isArray(t)?t.map(Ue):typeof t=="object"&&t?vl(t,Ue):t}var Kf={};function ft(t){Kf[t]||(typeof console<"u"&&console.warn(t),Kf[t]=!0)}function Ir(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function r_(t,e,i,r){let a=e.y-t.y,n=e.x-t.x,s=r.y-i.y,o=r.x-i.x,l=s*n-o*a;if(l===0)return null;let u=t.y-i.y,h=t.x-i.x,c=(o*u-s*h)/l;return new C(t.x+c*n,t.y+c*a)}function a_([t,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,[t*Math.cos(e)*Math.sin(i),t*Math.sin(e)*Math.sin(i),t*Math.cos(i)]}function ea(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function n_(t){let e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,i={};if(t.replace(e,(r,a,n,s)=>{let o=n||s;return i[a]=!o||o.toLowerCase(),""}),i["max-age"]){let r=parseInt(i["max-age"],10);isNaN(r)?delete i["max-age"]:i["max-age"]=r}return i}var oh=null;function s_(t){if(oh==null){let e=t.navigator?t.navigator.userAgent:null;oh=!!t.safari||!!(e&&(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return oh}function Or(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}var o_=async(t,e)=>{let i=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(i,e)}catch(r){throw Error(`Could not load image because of ${be(r).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},l_=t=>new Promise((e,i)=>{let r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},r.onerror=()=>i(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."));let a=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=URL.createObjectURL(a)});function D2(t,e,i,r,a){let n=Math.max(-e,0)*4,s=(Math.max(0,i)-i)*r*4+n,o=r*4,l=Math.max(0,e),u=Math.max(0,i),h=Math.min(t.width,e+r),c=Math.min(t.height,i+a);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}async function u_(t,e,i,r,a){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let n=new VideoFrame(t,{timestamp:0});try{let s=n?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(r*a*4);if(await n.copyTo(l,D2(t,e,i,r,a)),o)for(let u=0;u<l.length;u+=4){let h=l[u];l[u]=l[u+2],l[u+2]=h}return l}finally{n.close()}}function $o(t,e,i,r){return t.addEventListener(e,i,r),{unsubscribe:()=>{t.removeEventListener(e,i,r)}}}function Gt(t){return t*Math.PI/180}function Mi(t){return t/Math.PI*180}function Yc(t,e){return t.roll==e.roll&&t.pitch==e.pitch&&t.bearing==e.bearing}function h_(t){let e=new Float64Array(9);d2(e,t);let i=Mi(-Math.asin(st(e[2],-1,1))),r,a;return Math.hypot(e[5],e[8])<.001?(r=0,a=-Mi(Math.atan2(e[3],e[4]))):(r=Mi(e[5]===0&&e[8]===0?0:Math.atan2(e[5],e[8])),a=Mi(e[1]===0&&e[0]===0?0:Math.atan2(e[1],e[0]))),{roll:r,pitch:i+90,bearing:a}}function Kc(t,e,i){let r=Yf(e.x-i.x,e.y-i.y),a=Yf(t.x-i.x,t.y-i.y),n=r[0]*a[1]-r[1]*a[0];return Mi(Math.atan2(n,w2(r,a)))}function Jc(t,e,i){let r=new Float64Array(4);return fl(r,t,e-90,i),r}var ki=85.051129,c_={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},d_={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function p_(t,e){return c_[e]&&"touches"in t}function f_(t,e){if(!d_[e])return!1;let i=t,r=i?.target?.ownerDocument?.defaultView||window;return i instanceof r.MouseEvent||i instanceof r.WheelEvent}function m_(t){return c_[t]||d_[t]}var Jf="AbortError",an=class extends Error{constructor(t=Jf){super(t instanceof Error?t.message:t),this.name=Jf,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function fr(t){return t instanceof Error&&t.name==="AbortError"}function xl(t){if(t.aborted)throw new an(t.reason)}var ti={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Qc(t){return ti.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function g_(t,e){ti.REGISTERED_PROTOCOLS[t]=e}function __(t){delete ti.REGISTERED_PROTOCOLS[t]}var Go="global-dispatcher",Za=class extends Error{constructor(t,e,i,r){super(`AJAXError: ${e} (${t}): ${i}`),this.status=t,this.statusText=e,this.url=i,this.body=r}};function bl(){if(ea(self))return self.worker?.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}var P2=t=>t.startsWith("file:")||bl()?.startsWith("file:")&&!/^\w+:/.test(t);async function C2(t,e){let i=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:bl(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!i.headers.has("Accept")&&i.headers.set("Accept","application/json");let r;try{r=await fetch(i)}catch(s){throw fr(s)?s:new Za(0,be(s).message,t.url,new Blob)}if(!r.ok){let s=await r.blob();throw new Za(r.status,r.statusText,t.url,s)}let a;a=t.type==="arrayBuffer"||t.type==="image"?r.arrayBuffer():t.type==="json"?r.json():r.text();let n=await a;return xl(e.signal),{data:n,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}}function I2(t,e){return new Promise((i,r)=>{let a=new XMLHttpRequest;a.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(a.responseType="arraybuffer");for(let n in t.headers)a.setRequestHeader(n,t.headers[n]);t.type==="json"&&(a.responseType="text",t.headers?.Accept||a.setRequestHeader("Accept","application/json")),a.withCredentials=t.credentials==="include",a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!e.signal.aborted)if((a.status>=200&&a.status<300||a.status===0)&&a.response!==null){let n=a.response;if(t.type==="json")try{n=JSON.parse(a.response)}catch(s){r(s);return}i({data:n,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires"),etag:a.getResponseHeader("ETag")})}else{let n=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new Za(a.status,a.statusText,t.url,n))}},e.signal.addEventListener("abort",()=>{a.abort(),r(new an(e.signal.reason))}),a.send(t.body)})}var ys=async function(t,e){if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let i=Qc(t.url);if(i){let r=await i(t,e);return!r.data&&t.type==="arrayBuffer"?q(r,{data:new ArrayBuffer(0)}):r}if(ea(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:Go},e)}if(!P2(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return C2(t,e);if(ea(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:Go},e)}return I2(t,e)},vs=(t,e)=>ys(q(t,{type:"json"}),e),td=(t,e)=>ys(q(t,{type:"arrayBuffer"}),e);function ed(t){if(!t||t.startsWith("data:image/"))return!0;if(t.startsWith("blob:")&&(t=t.slice(5),t.startsWith("null")))return!1;if(t.indexOf("://")<=0)return!0;let e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}var y_=t=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(i=>{e.onloadstart=()=>{i(e)};for(let r of t){let a=window.document.createElement("source");ed(r)||(e.crossOrigin="Anonymous"),a.src=r,e.appendChild(a)}})};function Qf(t,e,i){i[t]?.includes(e)||(i[t]||(i[t]=[]),i[t].push(e))}function lh(t,e,i){if(i?.[t]){let r=i[t].indexOf(e);r!==-1&&i[t].splice(r,1)}}var ei=class{constructor(t,e={}){q(this,e),this.type=t}},J=class extends ei{constructor(t,e={}){super("error",q({error:t},e))}},ce=class{on(t,e){return this._listeners||(this._listeners={}),Qf(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return lh(t,e,this._listeners),lh(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),Qf(t,e,this._oneTimeListeners),this):new Promise(i=>this.once(t,i))}fire(t,e){let i=typeof t=="string"?new ei(t,e||{}):t,r=i.type;if(this.listens(r)){i.target=this;let a=this._listeners?.[r]?.slice()??[];for(let o of a)o.call(this,i);let n=this._oneTimeListeners?.[r]?.slice()??[];for(let o of n)lh(r,o,this._oneTimeListeners),o.call(this,i);let s=this._eventedParent;s&&(q(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(i))}else i instanceof J&&console.error(i.error);return this}listens(t){return!!(this._listeners?.[t]?.length||this._oneTimeListeners?.[t]?.length||this._eventedParent?.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},v_
vendor: 34,760 bytes, line 821
821={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{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:"filter"},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:{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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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","feature"]},"property-type":"data-driven"},"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"},"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"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},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:"expression_name",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:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,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,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default: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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
vendor: 1,558 bytes, line 821
821,F=v_,x_=["type","source","source-layer","minzoom","maxzoom","filter","layout"],B=class{constructor(t,e,i,r,a="error"){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),this.severity=a,e!=null&&e.__line__&&(this.line=e.__line__)}},xs={kind:"null"},V={kind:"number"},ut={kind:"string"},mt={kind:"boolean"},Fi={kind:"color"},wl={kind:"projectionDefinition"},Kr={kind:"object"},ct={kind:"value"},A2={kind:"error"},Tl={kind:"collator"},bs={kind:"formatted"},El={kind:"padding"},Yn={kind:"colorArray"},Sl={kind:"numberArray"},ws={kind:"resolvedImage"},Dl={kind:"variableAnchorOffsetCollection"};function Re(t,e){return{kind:"array",itemType:t,N:e}}function Kt(t){if(t.kind==="array"){let e=Kt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var M2=[xs,V,ut,mt,Fi,wl,bs,Kr,Re(ct),El,Sl,Yn,ws,Dl];function Kn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Kn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let i of M2)if(!Kn(i,e))return null}}return`Expected ${Kt(t)} but found ${Kt(e)} instead.`}function id(t,e){return e.some(i=>i.kind===t.kind)}function Jr(t,e){return e.some(i=>i==="null"?t===null:i==="array"?Array.isArray(t):i==="object"?t&&!Array.isArray(t)&&typeof t=="object":i===typeof t)}function Er(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}
vendor: 5,058 bytes, line 821
821var b_=.96422,w_=.82521,T_=4/29,Ch=6/29,E_=3*Ch*Ch,F2=Math.PI/180,z2=180/Math.PI;function S_(t){return t%=360,t<0&&(t+=360),t}function D_([t,e,i,r]){t=uh(t),e=uh(e),i=uh(i);let a,n,s=hh((.2225045*t+.7168786*e+.0606169*i)/1);t===e&&e===i?a=n=s:(a=hh((.4360747*t+.3850649*e+.1430804*i)/b_),n=hh((.0139322*t+.0971045*e+.7141733*i)/w_));let o=116*s-16;return[o<0?0:o,500*(a-s),200*(s-n),r]}function uh(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function hh(t){return t>.008856451679035631?t**(1/3):t/E_+T_}function P_([t,e,i,r]){let a=(t+16)/116,n=isNaN(e)?a:a+e/500,s=isNaN(i)?a:a-i/200;return a=1*dh(a),n=b_*dh(n),s=w_*dh(s),[ch(3.1338561*n-1.6168667*a-.4906146*s),ch(-.9787684*n+1.9161415*a+.033454*s),ch(.0719453*n-.2289914*a+1.4052427*s),r]}function ch(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function dh(t){return t>Ch?t*t*t:E_*(t-T_)}function R2(t){let[e,i,r,a]=D_(t),n=Math.sqrt(i*i+r*r);return[Math.round(n*1e4)?S_(Math.atan2(r,i)*z2):NaN,n,e,a]}function k2([t,e,i,r]){return t=isNaN(t)?0:t*F2,P_([i,Math.cos(t)*e,Math.sin(t)*e,r])}function L2([t,e,i,r]){t=S_(t),e/=100,i/=100;function a(n){let s=(n+t/30)%12,o=e*Math.min(i,1-i);return i-o*Math.max(-1,Math.min(s-3,9-s,1))}return[a(0),a(8),a(4),r]}var B2=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function Gn(t,e){return B2(t,e)?t[e]:void 0}function O2(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=Gn(V2,t);if(e){let[r,a,n]=e;return[r/255,a/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let r=t.length<6?1:2,a=1;return[wo(t.slice(a,a+=r)),wo(t.slice(a,a+=r)),wo(t.slice(a,a+=r)),wo(t.slice(a,a+r)||"ff")]}if(t.startsWith("rgb")){let r=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[a,n,s,o,l,u,h,c,d,p,f,m]=r,g=[o||" ",h||" ",p].join("");if(g===" "||g===" /"||g===",,"||g===",,,"){let _=[s,u,d].join(""),y=_==="%%%"?100:_===""?255:0;if(y){let x=[Ma(+n/y,0,1),Ma(+l/y,0,1),Ma(+c/y,0,1),f?tm(+f,m):1];if(em(x))return x}}return}}let i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[r,a,n,s,o,l,u,h,c]=i,d=[n||" ",o||" ",u].join("");if(d===" "||d===" /"||d===",,"||d===",,,"){let p=[+a,Ma(+s,0,100),Ma(+l,0,100),h?tm(+h,c):1];if(em(p))return L2(p)}}}function wo(t){return parseInt(t.padEnd(2,t),16)/255}function tm(t,e){return Ma(e?t/100:t,0,1)}function Ma(t,e,i){return Math.min(Math.max(e,t),i)}function em(t){return!t.some(Number.isNaN)}var V2={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],ol
vendor: 10,184 bytes, line 821
821ive:[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]};function Mr(t,e,i){return t+i*(e-t)}function qa(t,e,i){return t.map((r,a)=>Mr(r,e[a],i))}function j2(t){return t==="rgb"||t==="hcl"||t==="lab"}var ve,lt=(ve=class{constructor(e,i,r,a=1,n=!0){this.r=e,this.g=i,this.b=r,this.a=a,n||(this.r*=a,this.g*=a,this.b*=a,a||this.overwriteGetter("rgb",[e,i,r,a]))}static parse(e){if(e instanceof ve)return e;if(typeof e!="string")return;let i=O2(e);if(i)return new ve(...i,!1)}get rgb(){let{r:e,g:i,b:r,a}=this,n=a||1/0;return this.overwriteGetter("rgb",[e/n,i/n,r/n,a])}get hcl(){return this.overwriteGetter("hcl",R2(this.rgb))}get lab(){return this.overwriteGetter("lab",D_(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){let[e,i,r,a]=this.rgb;return`rgba(${[e,i,r].map(n=>Math.round(n*255)).join(",")},${a})`}static interpolate(e,i,r,a="rgb"){switch(a){case"rgb":{let[n,s,o,l]=qa(e.rgb,i.rgb,r);return new ve(n,s,o,l,!1)}case"hcl":{let[n,s,o,l]=e.hcl,[u,h,c,d]=i.hcl,p,f;if(!isNaN(n)&&!isNaN(u)){let x=u-n;u>n&&x>180?x-=360:u<n&&n-u>180&&(x+=360),p=n+r*x}else isNaN(n)?isNaN(u)?p=NaN:(p=u,(o===1||o===0)&&(f=h)):(p=n,(c===1||c===0)&&(f=s));let[m,g,_,y]=k2([p,f??Mr(s,h,r),Mr(o,c,r),Mr(l,d,r)]);return new ve(m,g,_,y,!1)}case"lab":{let[n,s,o,l]=P_(qa(e.lab,i.lab,r));return new ve(n,s,o,l,!1)}}}},ve.black=new ve(0,0,0,1),ve.white=new ve(1,1,1,1),ve.transparent=new ve(0,0,0,0),ve.red=new ve(1,0,0,1),ve),U2=["bottom","center","top"],Ih=class{constructor(t,e,i,r,a,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=a,this.verticalAlign=n}},ur=class Bo{constructor(e){this.sections=e}static fromString(e){return new Bo([new Ih(e,null,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 Bo?e:Bo.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},er=class Ln{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ln)return e;if(typeof e=="number")return new Ln([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let i of e)if(typeof i!="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 Ln(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,r){return new Ln(qa(e.values,i.values,r))}},ir=class Bn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Bn)return e;if(typeof e=="number")return new Bn([e]);if(Array.isArray(e)){for(let i of e)if(typeof i!="number")return;return new Bn(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,r){return new Bn(qa(e.values,i.values,r))}},xi=class On{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof On)return e;if(typeof e=="string"){let r=lt.parse(e);return r?new On([r]):void 0}if(!Array.isArray(e))return;let i=[];for(let r of e){if(typeof r!="string")return;let a=lt.parse(r);if(!a)return;i.push(a)}return new On(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,r,a="rgb"){let n=[];if(e.values.length!=i.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let s=0;s<e.values.length;s++)n.push(lt.interpolate(e.values[s],i.values[s],r,a));return new On(n)}},Xt=class extends Error{constructor(t,e){super(t),this.name="RuntimeError",this.path=e}toJSON(){return this.message}},N2=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Ki=class Oo{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Oo)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!=0)){for(let i=0;i<e.length;i+=2){let r=e[i],a=e[i+1];if(typeof r!="string"||!N2.has(r)||!Array.isArray(a)||a.length!==2||typeof a[0]!="number"||typeof a[1]!="number")return}return new Oo(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,r,a){let n=e.values,s=i.values;if(n.length!==s.length)throw new Xt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${i.toString()}`,a);let o=[];for(let l=0;l<n.length;l+=2){if(n[l]!==s[l])throw new Xt(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${n[l]}, to[${l}]: ${s[l]}`,a);o.push(n[l]);let[u,h]=n[l+1],[c,d]=s[l+1];o.push([Mr(u,c,r),Mr(h,d,r)])}return new Oo(o)}},Ji=class C_{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new C_({name:e,available:!1}):null}},mr=class Fa{constructor(e,i,r){this.from=e,this.to=i,this.transition=r}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(e,i,r){return new Fa(e,i,r)}static parse(e){if(e instanceof Fa)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new Fa(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new Fa(e.from,e.to,e.transition);if(typeof e=="string")return new Fa(e,e,1)}},rd=class{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function I_(t,e,i,r){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?r===void 0||typeof r=="number"&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r=="number"?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Wa(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof mr||t instanceof lt||t instanceof rd||t instanceof ur||t instanceof er||t instanceof ir||t instanceof xi||t instanceof Ki||t instanceof Ji)return!0;if(Array.isArray(t)){for(let e of t)if(!Wa(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!Wa(t[e]))return!1;return!0}return!1}function ne(t){if(t===null)return xs;if(typeof t=="string")return ut;if(typeof t=="boolean")return mt;if(typeof t=="number")return V;if(t instanceof lt)return Fi;if(t instanceof mr)return wl;if(t instanceof rd)return Tl;if(t instanceof ur)return bs;if(t instanceof er)return El;if(t instanceof ir)return Sl;if(t instanceof xi)return Yn;if(t instanceof Ki)return Dl;if(t instanceof Ji)return ws;if(Array.isArray(t)){let e=t.length,i;for(let r of t){let a=ne(r);if(!i)i=a;else{if(i===a)continue;i=ct;break}}return Re(i||ct,e)}return Kr}function Zn(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof lt||t instanceof mr||t instanceof ur||t instanceof er||t instanceof ir||t instanceof xi||t instanceof Ki||t instanceof Ji?t.toString():JSON.stringify(t)}var Ha=class A_{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Wa(e[1]))return i.error(`invalid value of type "${typeof e[1]}"`);let r=e[1],a=ne(r),n=i.expectedType;return a.kind==="array"&&a.N===0&&n&&n.kind==="array"&&(typeof n.N!="number"||n.N===0)&&(a=n),new A_(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},$2=["Unknown","Point","LineString","Polygon"],M_=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?$2[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(t){let e=this._parseColorCache.get(t);return e||(e=lt.parse(t),this._parseColorCache.set(t,e)),e}};function Pl(t,e,i){let r=t.length-1,a=0,n=r,s=0,o,l;for(;a<=n;)if(s=Math.floor((a+n)/2),o=t[s],l=t[s+1],o<=e){if(s===r||e<l)return s;a=s+1}else if(o>e)n=s-1;else throw new Xt("Input is not a number.",i);return 0}var ad=class F_{constructor(e,i,r,a){this.type=e,this.input=i,this.key=a,this.labels=[],this.outputs=[];for(let[n,s]of r)this.labels.push(n),this.outputs.push(s)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");let r=i.parse(e[1],1,V);if(!r)return null;let a=[],n=null;i.expectedType&&i.expectedType.kind!=="value"&&(n=i.expectedType);for(let s=1;s<e.length;s+=2){let o=s===1?-1/0:e[s],l=e[s+1],u=s,h=s+1;if(typeof o!="number")return i.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
821omputed expressions) for the input values.',u);if(a.length&&a[a.length-1][0]>=o)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let c=i.parse(l,h,n);if(!c)return null;n||(n=c.type),a.push([o,c])}return new F_(n,r,a,i.key)}evaluate(e){let i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(e);let a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);let n=i.length;return a>=i[n-1]?r[n-1].evaluate(e):r[Pl(i,a,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function G2(t,e,i,r){let a=3*t,n=3*(i-t)-a,s=1-a-n,o=3*e,l=3*(r-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let d=h;for(let m=0;m<8;m++){let g=((s*d+n)*d+a)*d-h;if(Math.abs(g)<c)return((u*d+l)*d+o)*d;let _=(3*s*d+2*n)*d+a;if(Math.abs(_)<1e-6)break;d-=g/_}let p=0,f=1;d=h;for(let m=0;m<20;m++){let g=((s*d+n)*d+a)*d;if(Math.abs(g-h)<c)break;h>g?p=d:f=d,d=(p+f)*.5}return((u*d+l)*d+o)*d}}var bi=class Ah{constructor(e,i,r,a,n,s){this.type=e,this.operator=i,this.interpolation=r,this.input=a,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of n)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,i,r,a){let n=0;if(e.name==="exponential")n=ph(i,e.base,r,a);else if(e.name==="linear")n=ph(i,1,r,a);else if(e.name==="cubic-bezier"){let s=e.controlPoints;n=G2(s[0],s[1],s[2],s[3])(ph(i,1,r,a))}return n}static parse(e,i){let[r,a,n,...s]=e;if(!Array.isArray(a)||a.length===0)return i.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){let u=a[1];if(typeof u!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:u}}else if(a[0]==="cubic-bezier"){let u=a.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:u}}else return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(n=i.parse(n,2,V),!n)return null;let o=[],l=null;(r==="interpolate-hcl"||r==="interpolate-lab")&&i.expectedType!=Yn?l=Fi:i.expectedType&&i.expectedType.kind!=="value"&&(l=i.expectedType);for(let u=0;u<s.length;u+=2){let h=s[u],c=s[u+1],d=u+3,p=u+4;if(typeof h!="number")return i.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(o.length&&o[o.length-1][0]>=h)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);let f=i.parse(c,p,l);if(!f)return null;l||(l=f.type),o.push([h,f])}return!Er(l,V)&&!Er(l,wl)&&!Er(l,Fi)&&!Er(l,El)&&!Er(l,Sl)&&!Er(l,Yn)&&!Er(l,Dl)&&!Er(l,Re(V))?i.error(`Type ${Kt(l)} is not interpolatable.`):new Ah(l,r,a,n,o,i.key)}evaluate(e){let i=this.labels,r=this.outputs;if(i.length===1)return r[0].evaluate(e);let a=this.input.evaluate(e);if(a<=i[0])return r[0].evaluate(e);let n=i.length;if(a>=i[n-1])return r[n-1].evaluate(e);let s=Pl(i,a,this.key),o=i[s],l=i[s+1],u=Ah.interpolationFactor(this.interpolation,a,o,l),h=r[s].evaluate(e),c=r[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Mr(h,c,u);case"color":return lt.interpolate(h,c,u);case"padding":return er.interpolate(h,c,u);case"colorArray":return xi.interpolate(h,c,u);case"numberArray":return ir.interpolate(h,c,u);case"variableAnchorOffsetCollection":return Ki.interpolate(h,c,u,this.key);case"array":return qa(h,c,u);case"projectionDefinition":return mr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return lt.interpolate(h,c,u,"hcl");case"colorArray":return xi.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return lt.interpolate(h,c,u,"lab");case"colorArray":return xi.interpolate(h,c,u,"lab")}}}eachChild(e){e(this.input);for(let i of this.outputs)e(i)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function ph(t,e,i,r){let a=r-i,n=t-i;return a===0?0:e===1?n/a:(e**+n-1)/(e**+a-1)}var Zt={color:lt.interpolate,number:Mr,padding:er.interpolate,numberArray:ir.interpolate,colorArray:xi.interpolate,variableAnchorOffsetCollection:Ki.interpolate,array:qa},z_=class R_{constructor(e){this.type=bs,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r=e[1];if(!Array.isArray(r)&&typeof r=="object")return i.error("First argument must be an image or text section.");let a=[],n=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(n&&typeof o=="object"&&!Array.isArray(o)){n=!1;let l=null;if(o["font-scale"]&&(l=i.parse(o["font-scale"],1,V),!l))return null;let u=null;if(o["text-font"]&&(u=i.parse(o["text-font"],1,Re(ut)),!u))return null;let h=null;if(o["text-color"]&&(h=i.parse(o["text-color"],1,Fi),!h))return null;
vendor: 5,855 bytes, line 821
821let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!U2.includes(o["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o["vertical-align"]}' instead.`);if(c=i.parse(o["vertical-align"],1,ut),!c)return null}let d=a[a.length-1];d.scale=l,d.font=u,d.textColor=h,d.verticalAlign=c}else{let l=i.parse(e[s],1,ct);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,a.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new R_(a)}evaluate(e){return new ur(this.sections.map(i=>{let r=i.content.evaluate(e);return ne(r)===ws?new Ih("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Ih(Zn(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}};function k_(t,e,i=0,r=t.length-1,a=Z2){for(;r>i;){if(r-i>600){let l=r-i+1,u=e-i+1,h=Math.log(l),c=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);k_(t,e,Math.max(i,Math.floor(e-u*c/l+d)),Math.min(r,Math.floor(e+(l-u)*c/l+d)),a)}let n=t[e],s=i,o=r;for(An(t,i,e),a(t[r],n)>0&&An(t,i,r);s<o;){for(An(t,s,o),s++,o--;a(t[s],n)<0;)s++;for(;a(t[o],n)>0;)o--}a(t[i],n)===0?An(t,i,o):(o++,An(t,o,r)),o<=e&&(i=o+1),e<=o&&(r=o-1)}}function An(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}function Z2(t,e){return t<e?-1:+(t>e)}function Cl(t,e){if(t.length<=1)return[t];let i=[],r,a;for(let n of t){let s=W2(n);s!==0&&(n.area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(r&&i.push(r),r=[n]):r.push(n))}if(r&&i.push(r),e>1)for(let n=0;n<i.length;n++)i[n].length<=e||(k_(i[n],e,1,i[n].length-1,q2),i[n]=i[n].slice(0,e));return i}function q2(t,e){return e.area-t.area}function W2(t){let e=0;for(let i=0,r=t.length,a=r-1,n,s;i<r;a=i++)n=t[i],s=t[a],e+=(s.x-n.x)*(n.y+s.y);return e}var To={string:ut,number:V,boolean:mt,object:Kr},sr=class L_{constructor(e,i,r){this.type=e,this.args=i,this.key=r}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r=1,a,n=e[0];if(n==="array"){let o;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in To)||u==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);o=To[u],r++}else o=ct;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);l=e[2],r++}a=Re(o,l)}else{if(!To[n])throw Error(`Types doesn't contain name = ${n}`);a=To[n]}let s=[];for(;r<e.length;r++){let o=i.parse(e[r],r,ct);if(!o)return null;s.push(o)}return new L_(a,s,i.key)}evaluate(e){for(let i=0;i<this.args.length;i++){let r=this.args[i].evaluate(e);if(!Kn(this.type,ne(r)))return r;if(i===this.args.length-1)throw new Xt(`Expected value to be of type ${Kt(this.type)}, but found ${Kt(ne(r))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},im={"to-boolean":mt,"to-color":Fi,"to-number":V,"to-string":ut},La=class B_{constructor(e,i,r){this.type=e,this.args=i,this.key=r}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r=e[0];if(!im[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r==="to-boolean"||r==="to-string")&&e.length!==2)return i.error("Expected one argument.");let a=im[r],n=[];for(let s=1;s<e.length;s++){let o=i.parse(e[s],s,ct);if(!o)return null;n.push(o)}return new B_(a,n,i.key)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let i,r;for(let a of this.args){if(i=a.evaluate(e),r=null,i instanceof lt)return i;if(typeof i=="string"){let n=e.parseColor(i);if(n)return n}else if(Array.isArray(i)&&(r=i.length<3||i.length>4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:I_(i[0],i[1],i[2],i[3]),!r))return new lt(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new Xt(r||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"padding":{let i;for(let r of this.args){i=r.evaluate(e);let a=er.parse(i);if(a)return a}throw new Xt(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"numberArray":{let i;for(let r of this.args){i=r.evaluate(e);let a=ir.parse(i);if(a)return a}throw new Xt(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"colorArray":{let i;for(let r of this.args){i=r.evaluate(e);let a=xi.parse(i);if(a)return a}throw new Xt(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"variableAnchorOffsetCollection":{let i;for(let r of this.args){i=r.evaluate(e);let a=Ki.parse(i);if(a)return a}throw new Xt(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}case"number":{let i=null;for(let r of this.args){if(i=r.evaluate(e),i===null)return 0;let a=Number(i);if(!isNaN(a))return a}throw new Xt(`Could not convert ${JSON.stringify(i)} to number.`,this.key)}case"formatted":return ur.fromString(Zn(this.args[0].evaluate(e)));case"resolvedImage":return Ji.fromString(Zn(this.args[0].evaluate(e)));case"projectionDefinition":{let i=this.args[0].evaluate(e);if(mr.parse(i))return i;throw new Xt(`Could not parse projectionDefinition from value '${typeof i=="string"?i:JSON.stringify(i)}'`,this.key)}default:return Zn(this.args[0].evaluate(e))}}
vendor: 1,339 bytes, line 821
821eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},O_=class V_{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let r=[];for(let n=1;n<e.length-1;n+=2){let s=e[n];if(typeof s!="string")return i.error(`Expected string, but found ${typeof s} instead.`,n);if(/[^a-zA-Z0-9_]/.test(s))return i.error("Variable names must contain only alphanumeric characters or '_'.",n);let o=i.parse(e[n+1],n+1);if(!o)return null;r.push([s,o])}let a=i.parse(e[e.length-1],e.length-1,i.expectedType,r);return a?new V_(r,a):null}outputDefined(){return this.result.outputDefined()}},j_=class U_{constructor(e,i){this.type=i.type,this.name=e,this.boundExpression=i}static parse(e,i){if(e.length!==2||typeof e[1]!="string")return i.error("'var' expression requires exactly one string literal argument.");let r=e[1];return i.scope.has(r)?new U_(r,i.scope.get(r)):i.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}
vendor: 10,341 bytes, line 821
821,H2=class N_{constructor(e,i,r,a){this.type=e,this.index=i,this.input=r,this.key=a}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=i.parse(e[1],1,V),a=i.parse(e[2],2,Re(i.expectedType||ct));if(!r||!a)return null;let n=a.type;return new N_(n.itemType,r,a,i.key)}evaluate(e){let i=this.index.evaluate(e),r=this.input.evaluate(e);if(i<0)throw new Xt(`Array index out of bounds: ${i} < 0.`,this.key);if(i>=r.length)throw new Xt(`Array index out of bounds: ${i} > ${r.length-1}.`,this.key);if(i!==Math.floor(i))throw new Xt(`Array index must be an integer, but found ${i} instead.`,this.key);return r[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},X2=class $_{constructor(e,i,r){this.needle=e,this.haystack=i,this.key=r,this.type=mt}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=i.parse(e[1],1,ct),a=i.parse(e[2],2,ct);return!r||!a?null:id(r.type,[mt,ut,V,xs,ct])?new $_(r,a,i.key):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(r.type)} instead`)}evaluate(e){let i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Jr(i,["boolean","string","number","null"]))throw new Xt(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(ne(i))} instead.`,this.key);if(!Jr(r,["string","array"]))throw new Xt(`Expected second argument to be of type array or string, but found ${Kt(ne(r))} instead.`,this.key);return r.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},Y2=class Mh{constructor(e,i,r,a){this.needle=e,this.haystack=i,this.key=r,this.fromIndex=a,this.type=V}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let r=i.parse(e[1],1,ct),a=i.parse(e[2],2,ct);if(!r||!a)return null;if(!id(r.type,[mt,ut,V,xs,ct]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(r.type)} instead`);if(e.length===4){let n=i.parse(e[3],3,V);return n?new Mh(r,a,i.key,n):null}return new Mh(r,a,i.key)}evaluate(e){let i=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Jr(i,["boolean","string","number","null"]))throw new Xt(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(ne(i))} instead.`,this.key);let a;if(this.fromIndex&&(a=this.fromIndex.evaluate(e)),Jr(r,["string"])){let n=r.indexOf(i,a);return n===-1?-1:[...r.slice(0,n)].length}if(Jr(r,["array"]))return r.indexOf(i,a);throw new Xt(`Expected second argument to be of type array or string, but found ${Kt(ne(r))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},K2=class G_{constructor(e,i,r,a,n,s){this.inputType=e,this.type=i,this.input=r,this.cases=a,this.outputs=n,this.otherwise=s}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let r,a;i.expectedType&&i.expectedType.kind!=="value"&&(a=i.expectedType);let n={},s=[];for(let u=2;u<e.length-1;u+=2){let h=e[u],c=e[u+1];Array.isArray(h)||(h=[h]);let d=i.concat(u);if(h.length===0)return d.error("Expected at least one branch label.");for(let f of h){if(typeof f!="number"&&typeof f!="string")return d.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>2**53-1)return d.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof f=="number"&&Math.floor(f)!==f)return d.error("Numeric branch labels must be integer values.");if(!r)r=ne(f);else if(d.checkSubtype(r,ne(f)))return null;if(n[String(f)]!==void 0)return d.error("Branch labels must be unique.");n[String(f)]=s.length}let p=i.parse(c,u,a);if(!p)return null;a||(a=p.type),s.push(p)}let o=i.parse(e[1],1,ct);if(!o)return null;let l=i.parse(e[e.length-1],e.length-1,a);return!l||o.type.kind!=="value"&&i.concat(1).checkSubtype(r,o.type)?null:new G_(r,a,o,n,s,l)}evaluate(e){let i=this.input.evaluate(e);return(ne(i)===this.inputType&&this.outputs[this.cases[i]]||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()}},J2=class Z_{constructor(e,i,r){this.type=e,this.branches=i,this.otherwise=r}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let r;i.expectedType&&i.expectedType.kind!=="value"&&(r=i.expectedType);let a=[];for(let s=1;s<e.length-1;s+=2){let o=i.parse(e[s],s,mt);if(!o)return null;let l=i.parse(e[s+1],s+1,r);if(!l)return null;a.push([o,l]),r||(r=l.type)}let n=i.parse(e[e.length-1],e.length-1,r);if(!n)return null;if(!r)throw Error("Can't infer output type");return new Z_(r,a,n)}evaluate(e){for(let[i,r]of this.branches)if(i.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[i,r]of this.branches)e(i),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,i])=>i.outputDefined())&&this.otherwise.outputDefined()}},Q2=class Fh{constructor(e,i,r,a,n){this.type=e,this.input=i,this.beginIndex=r,this.key=a,this.endIndex=n}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let r=i.parse(e[1],1,ct),a=i.parse(e[2],2,V);if(!r||!a)return null;if(!id(r.type,[Re(ct),ut,ct]))return i.error(`Expected first argument to be of type array or string, but found ${Kt(r.type)} instead`);if(e.length===4){let n=i.parse(e[3],3,V);return n?new Fh(r.type,r,a,i.key,n):null}return new Fh(r.type,r,a,i.key)}evaluate(e){let i=this.input.evaluate(e),r=this.beginIndex.evaluate(e),a;if(this.endIndex&&(a=this.endIndex.evaluate(e)),Jr(i,["string"]))return[...i].slice(r,a).join("");if(Jr(i,["array"]))return i.slice(r,a);throw new Xt(`Expected first argument to be of type array or string, but found ${Kt(ne(i))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},q_=class zh{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let r=null,a=i.expectedType;a&&a.kind!=="value"&&(r=a);let n=[];for(let s of e.slice(1)){let o=i.parse(s,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!o)return null;r||(r=o.type),n.push(o)}if(!r)throw Error("No output type");return a&&n.some(s=>Kn(a,s.type))?new zh(ct,n):new zh(r,n)}evaluate(e){let i=null,r=0,a;for(let n of this.args)if(r++,i=n.evaluate(e),i&&i instanceof Ji&&!i.available&&(a||(a=i.name),i=null,r===this.args.length&&(i=a)),i!==null)break;return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function rm(t,e){return t==="=="||t==="!="?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 tw(t,e,i){return e===i}function ew(t,e,i){return e!==i}function iw(t,e,i){return e<i}function rw(t,e,i){return e>i}function aw(t,e,i){return e<=i}function nw(t,e,i){return e>=i}function W_(t,e,i,r){return r.compare(e,i)===0}function sw(t,e,i,r){return!W_(t,e,i,r)}function ow(t,e,i,r){return r.compare(e,i)<0}function lw(t,e,i,r){return r.compare(e,i)>0}function uw(t,e,i,r){return r.compare(e,i)<=0}function hw(t,e,i,r){return r.compare(e,i)>=0}function nn(t,e,i){let r=t!=="=="&&t!=="!=";return class H_{constructor(n,s,o,l){this.lhs=n,this.rhs=s,this.key=o,this.collator=l,this.type=mt,this.hasUntypedArgument=n.type.kind==="value"||s.type.kind==="value"}static parse(n,s){if(n.length!==3&&n.length!==4)return s.error("Expected two or three arguments.");let o=n[0],l=s.parse(n[1],1,ct);if(!l)return null;if(!rm(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type '${Kt(l.type)}'.`);let u=s.parse(n[2],2,ct);if(!u)return null;if(!rm(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type '${Kt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${Kt(l.type)}' and '${Kt(u.type)}'.`);r&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new sr(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new sr(l.type,[u],s.key)));let h=null;if(n.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(n[3],3,Tl),!h)return null}return new H_(l,u,s.key,h)}evaluate(n){let s=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){let l=ne(s),u=ne(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new Xt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!r&&this.hasUntypedArgument){let l=ne(s),u=ne(o);if(l.kind!=="string"||u.kind!=="string")return e(n,s,o)}return this.collator?i(n,s,o,this.collator.evaluate(n)):e(n,s,o)}eachChild(n){n(this.lhs),n(this.rhs),this.collator&&n(this.collator)}outputDefined(){return!0}}}var cw=nn("==",tw,W_),dw=nn("!=",ew,sw),pw=nn("<",iw,ow),fw=nn(">",rw,lw),mw=nn("<=",aw,uw),gw=nn(">=",nw,hw),X_=class Y_{constructor(e,i,r){this.type=Tl,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");let r=e[1];if(typeof r!="object"||Array.isArray(r))return i.error("Collator options argument must be an object.");let a=i.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,mt);if(!a)return null;let n=i.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,mt);if(!n)return null;let s=null;return r.locale&&(s=i.parse(r.locale,1,ut),!s)?null:new Y_(a,n,s)}evaluate(e){return new rd(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}}
vendor: 23,359 bytes, line 821
821,_w=class K_{constructor(e,i,r,a,n,s){this.type=ut,this.number=e,this.locale=i,this.currency=r,this.unit=a,this.minFractionDigits=n,this.maxFractionDigits=s}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");let r=i.parse(e[1],1,V);if(!r)return null;let a=e[2];if(typeof a!="object"||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let n=null;if(a.locale&&(n=i.parse(a.locale,1,ut),!n))return null;let s=null;if(a.currency&&(s=i.parse(a.currency,1,ut),!s))return null;let o=null;if(a.unit&&(o=i.parse(a.unit,1,ut),!o))return null;if(s&&o)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(a["min-fraction-digits"]&&(l=i.parse(a["min-fraction-digits"],1,V),!l))return null;let u=null;return a["max-fraction-digits"]&&(u=i.parse(a["max-fraction-digits"],1,V),!u)?null:new K_(r,n,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},yw=class J_{constructor(e){this.type=ws,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");let r=i.parse(e[1],1,ut);return r?new J_(r):i.error("No image name provided.")}evaluate(e){let i=this.input.evaluate(e),r=Ji.fromString(i);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(i)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}},vw=class Q_{constructor(e,i){this.input=e,this.key=i,this.type=V}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=i.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${Kt(r.type)} instead.`):new Q_(r,i.key):null}evaluate(e){let i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new Xt(`Expected value to be of type string or array, but found ${Kt(ne(i))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},Yi=8192;function xw(t,e){let i=bw(t[0]),r=Tw(t[1]),a=2**e.z;return[Math.round(i*a*Yi),Math.round(r*a*Yi)]}function nd(t,e){let i=2**e.z,r=(t[0]/Yi+e.x)/i,a=(t[1]/Yi+e.y)/i;return[ww(r),Ew(a)]}function bw(t){return(180+t)/360}function ww(t){return t*360-180}function Tw(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ew(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Ts(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Jn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Sw(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Dw(t,e,i){let r=t[0]-e[0],a=t[1]-e[1],n=t[0]-i[0],s=t[1]-i[1];return r*s-n*a===0&&r*n<=0&&a*s<=0}function Il(t,e,i,r){let a=[e[0]-t[0],e[1]-t[1]];return Aw([r[0]-i[0],r[1]-i[1]],a)!==0&&!!(am(t,e,i,r)&&am(i,r,t,e))}function Pw(t,e,i){for(let r of i)for(let a=0;a<r.length-1;++a)if(Il(t,e,r[a],r[a+1]))return!0;return!1}function sn(t,e,i=!1){let r=!1;for(let a of e)for(let n=0;n<a.length-1;n++){if(Dw(t,a[n],a[n+1]))return i;Sw(t,a[n],a[n+1])&&(r=!r)}return r}function Cw(t,e){for(let i of e)if(sn(t,i))return!0;return!1}function ty(t,e){for(let i of t)if(!sn(i,e))return!1;for(let i=0;i<t.length-1;++i)if(Pw(t[i],t[i+1],e))return!1;return!0}function Iw(t,e){for(let i of e)if(ty(t,i))return!0;return!1}function Aw(t,e){return t[0]*e[1]-t[1]*e[0]}function am(t,e,i,r){let a=t[0]-i[0],n=t[1]-i[1],s=e[0]-i[0],o=e[1]-i[1],l=r[0]-i[0],u=r[1]-i[1],h=a*u-l*n,c=s*u-l*o;return h>0&&c<0||h<0&&c>0}function sd(t,e,i){let r=[];for(let a=0;a<t.length;a++){let n=[];for(let s=0;s<t[a].length;s++){let o=xw(t[a][s],i);Ts(e,o),n.push(o)}r.push(n)}return r}function ey(t,e,i){let r=[];for(let a=0;a<t.length;a++){let n=sd(t[a],e,i);r.push(n)}return r}function iy(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){let a=r*.5,n=t[0]-i[0]>a?-r:i[0]-t[0]>a?r:0;n===0&&(n=t[0]-i[2]>a?-r:i[2]-t[0]>a?r:0),t[0]+=n}Ts(e,t)}function Mw(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function nm(t,e,i,r){let a=2**r.z*Yi,n=[r.x*Yi,r.y*Yi],s=[];for(let o of t)for(let l of o){let u=[l.x+n[0],l.y+n[1]];iy(u,e,i,a),s.push(u)}return s}function sm(t,e,i,r){let a=2**r.z*Yi,n=[r.x*Yi,r.y*Yi],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+n[0],u.y+n[1]];Ts(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=a/2){Mw(e);for(let o of s)for(let l of o)iy(l,e,i,a)}return s}function Fw(t,e){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if(e.type==="Polygon"){let n=sd(e.coordinates,r,a),s=nm(t.geometry(),i,r,a);if(!Jn(i,r))return!1;for(let o of s)if(!sn(o,n))return!1}if(e.type==="MultiPolygon"){let n=ey(e.coordinates,r,a),s=nm(t.geometry(),i,r,a);if(!Jn(i,r))return!1;for(let o of s)if(!Cw(o,n))return!1}return!0}function zw(t,e){let i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if(e.type==="Polygon"){let n=sd(e.coordinates,r,a),s=sm(t.geometry(),i,r,a);if(!Jn(i,r))return!1;for(let o of s)if(!ty(o,n))return!1}if(e.type==="MultiPolygon"){let n=ey(e.coordinates,r,a),s=sm(t.geometry(),i,r,a);if(!Jn(i,r))return!1;for(let o of s)if(!Iw(o,n))return!1}return!0}var od=class Vo{constructor(e,i){this.type=mt,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Wa(e[1])){let r=e[1];if(r.type==="FeatureCollection"){let a=[];for(let n of r.features){let{type:s,coordinates:o}=n.geometry;s==="Polygon"&&a.push(o),s==="MultiPolygon"&&a.push(...o)}if(a.length)return new Vo(r,{type:"MultiPolygon",coordinates:a})}else if(r.type==="Feature"){let a=r.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new Vo(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Vo(r,r)}return i.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 Fw(e,this.geometries);if(e.geometryType()==="LineString")return zw(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},ry=class{constructor(t=[],e=(i,r)=>i<r?-1:+(i>r)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:i}=this,r=e[t];for(;t>0;){let a=t-1>>1,n=e[a];if(i(r,n)>=0)break;e[t]=n,t=a}e[t]=r}_down(t){let{data:e,compare:i}=this,r=this.length>>1,a=e[t];for(;t<r;){let n=(t<<1)+1,s=n+1;if(s<this.length&&i(e[s],e[n])<0&&(n=s),i(e[n],a)>=0)break;e[t]=e[n],t=n}e[t]=a}},om=Math.PI/180,ld=class{constructor(t){let e=om*6378.137*1e3,i=Math.cos(t*om),r=1/(1-.0066943799901413165*(1-i*i)),a=Math.sqrt(r);this.kx=e*a*i,this.ky=e*a*r*.9933056200098587}distance(t,e){let i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i=1/0,r,a,n,s;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],h=this.wrap(t[o+1][0]-l)*this.kx,c=(t[o+1][1]-u)*this.ky,d=0;(h!==0||c!==0)&&(d=(this.wrap(e[0]-l)*this.kx*h+(e[1]-u)*this.ky*c)/(h*h+c*c),d>1?(l=t[o+1][0],u=t[o+1][1]):d>0&&(l+=h/this.kx*d,u+=c/this.ky*d)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let p=h*h+c*c;p<i&&(i=p,r=l,a=u,n=o,s=d)}return{point:[r,a],index:n,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function ay(t,e){return e[0]-t[0]}function Zo(t){return t[1]-t[0]+1}function hr(t,e){return t[1]>=t[0]&&t[1]<e}function Rh(t,e){if(t[0]>t[1])return[null,null];let i=Zo(t);if(e){if(i===2)return[t,null];let a=Math.floor(i/2);return[[t[0],t[0]+a],[t[0]+a,t[1]]]}if(i===1)return[t,null];let r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function kh(t,e){if(!hr(e,t.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Ts(i,t[r]);return i}function Lh(t){let e=[1/0,1/0,-1/0,-1/0];for(let i of t)for(let r of i)Ts(e,r);return e}function lm(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function ud(t,e,i){if(!lm(t)||!lm(e))return NaN;let r=0,a=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(a=t[1]-e[3]),t[3]<e[1]&&(a=e[1]-t[3]),i.distance([0,0],[r,a])}function Xr(t,e,i){let r=i.pointOnLine(e,t);return i.distance(t,r.point)}function hd(t,e,i,r,a){let n=Math.min(Xr(t,[i,r],a),Xr(e,[i,r],a)),s=Math.min(Xr(i,[t,e],a),Xr(r,[t,e],a));return Math.min(n,s)}function Rw(t,e,i,r,a){if(!(hr(e,t.length)&&hr(r,i.length)))return 1/0;let n=1/0;for(let s=e[0];s<e[1];++s){let o=t[s],l=t[s+1];for(let u=r[0];u<r[1];++u){let h=i[u],c=i[u+1];if(Il(o,l,h,c))return 0;n=Math.min(n,hd(o,l,h,c,a))}}return n}function kw(t,e,i,r,a){if(!(hr(e,t.length)&&hr(r,i.length)))return NaN;let n=1/0;for(let s=e[0];s<=e[1];++s)for(let o=r[0];o<=r[1];++o)if(n=Math.min(n,a.distance(t[s],i[o])),n===0)return n;return n}function Lw(t,e,i){if(sn(t,e,!0))return 0;let r=1/0;for(let a of e){let n=a[0],s=a[a.length-1];if(n!==s&&(r=Math.min(r,Xr(t,[s,n],i)),r===0))return r;let o=i.pointOnLine(a,t);if(r=Math.min(r,i.distance(t,o.point)),r===0)return r}return r}function Bw(t,e,i,r){if(!hr(e,t.length))return NaN;for(let n=e[0];n<=e[1];++n)if(sn(t[n],i,!0))return 0;let a=1/0;for(let n=e[0];n<e[1];++n){let s=t[n],o=t[n+1];for(let l of i)for(let u=0,h=l.length,c=h-1;u<h;c=u++){let d=l[c],p=l[u];if(Il(s,o,d,p))return 0;a=Math.min(a,hd(s,o,d,p,r))}}return a}function um(t,e){for(let i of t)for(let r of i)if(sn(r,e,!0))return!0;return!1}function Ow(t,e,i,r=1/0){let a=Lh(t),n=Lh(e);if(r!==1/0&&ud(a,n,i)>=r)return r;if(Jn(a,n)){if(um(t,e))return 0}else if(um(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l<u;h=l++){let c=o[h],d=o[l];for(let p of e)for(let f=0,m=p.length,g=m-1;f<m;g=f++){let _=p[g],y=p[f];if(Il(c,d,_,y))return 0;s=Math.min(s,hd(c,d,_,y,i))}}return s}function hm(t,e,i,r,a,n){if(!n)return;let s=ud(kh(r,n),a,i);s<e&&t.push([s,n,[0,0]])}function Eo(t,e,i,r,a,n,s){if(!n||!s)return;let o=ud(kh(r,n),kh(a,s),i);o<e&&t.push([o,n,s])}function qo(t,e,i,r,a=1/0){let n=Math.min(r.distance(t[0],i[0][0]),a);if(n===0)return n;let s=new ry([[0,[0,t.length-1],[0,0]]],ay),o=Lh(i);for(;s.length>0;){let l=s.pop();if(l[0]>=n)continue;let u=l[1],h=e?50:100;if(Zo(u)<=h){if(!hr(u,t.length))return NaN;if(e){let c=Bw(t,u,i,r);if(isNaN(c)||c===0)return c;n=Math.min(n,c)}else for(let c=u[0];c<=u[1];++c){let d=Lw(t[c],i,r);if(n=Math.min(n,d),n===0)return 0}}else{let c=Rh(u,e);hm(s,n,r,t,o,c[0]),hm(s,n,r,t,o,c[1])}}return n}function Wo(t,e,i,r,a,n=1/0){let s=Math.min(n,a.distance(t[0],i[0]));if(s===0)return s;let o=new ry([[0,[0,t.length-1],[0,i.length-1]]],ay);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,d=r?50:100;if(Zo(u)<=c&&Zo(h)<=d){if(!hr(u,t.length)&&hr(h,i.length))return NaN;let p;if(e&&r)p=Rw(t,u,i,h,a),s=Math.min(s,p);else if(e&&!r){let f=t.slice(u[0],u[1]+1);for(let m=h[0];m<=h[1];++m)if(p=Xr(i[m],f,a),s=Math.min(s,p),s===0)return s}else if(!e&&r){let f=i.slice(h[0],h[1]+1);for(let m=u[0];m<=u[1];++m)if(p=Xr(t[m],f,a),s=Math.min(s,p),s===0)return s}else p=kw(t,u,i,h,a),s=Math.min(s,p)}else{let p=Rh(u,e),f=Rh(h,r);Eo(o,s,a,t,i,p[0],f[0]),Eo(o,s,a,t,i,p[0],f[1]),Eo(o,s,a,t,i,p[1],f[0]),Eo(o,s,a,t,i,p[1],f[1])}}return s}function Vw(t,e){let i=t.geometry(),r=i.flat().map(s=>nd([s.x,s.y],t.canonical));if(i.length===0)return NaN;let a=new ld(r[0][1]),n=1/0;for(let s of e){switch(s.type){case"Point":n=Math.min(n,Wo(r,!1,[s.coordinates],!1,a,n));break;case"LineString":n=Math.min(n,Wo(r,!1,s.coordinates,!0,a,n));break;case"Polygon":n=Math.min(n,qo(r,!1,s.coordinates,a,n))}if(n===0)return n}return n}function jw(t,e){let i=t.geometry(),r=i.flat().map(s=>nd([s.x,s.y],t.canonical));if(i.length===0)return NaN;let a=new ld(r[0][1]),n=1/0;for(let s of e){switch(s.type){case"Point":n=Math.min(n,Wo(r,!0,[s.coordinates],!1,a,n));break;case"LineString":n=Math.min(n,Wo(r,!0,s.coordinates,!0,a,n));break;case"Polygon":n=Math.min(n,qo(r,!0,s.coordinates,a,n))}if(n===0)return n}return n}function Uw(t,e){let i=t.geometry();if(i.length===0||i[0].length===0)return NaN;let r=Cl(i,0).map(s=>s.map(o=>o.map(l=>nd([l.x,l.y],t.canonical)))),a=new ld(r[0][0][0][1]),n=1/0;for(let s of e)for(let o of r){switch(s.type){case"Point":n=Math.min(n,qo([s.coordinates],!1,o,a,n));break;case"LineString":n=Math.min(n,qo(s.coordinates,!0,o,a,n));break;case"Polygon":n=Math.min(n,Ow(o,s.coordinates,a,n))}if(n===0)return n}return n}function fh(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var cd=class jo{constructor(e,i){this.type=V,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Wa(e[1])){let r=e[1];if(r.type==="FeatureCollection")return new jo(r,r.features.map(a=>fh(a.geometry)).flat());if(r.type==="Feature")return new jo(r,fh(r.geometry));if("type"in r&&"coordinates"in r)return new jo(r,fh(r))}return i.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 Vw(e,this.geometries);if(e.geometryType()==="LineString")return jw(e,this.geometries);if(e.geometryType()==="Polygon")return Uw(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},Nw=class ny{constructor(e){let i=null;for(let r of e)if(!i)i=r.type;else{if(i===r.type)continue;i=ct;break}this.type=Re(i??ct,e.length),this.arr=e}static parse(e,i){if(e.length!==2)return i.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Wa(e[1]))return i.error(`invalid value of type "${typeof e[1]}"`);let r=e[1],a=ne(r);if(a.kind==="array"){let n=r,s=i.concat(1),o=[];for(let l=0;l<n.length;l++){let u=s.parse(n[l],l,ct);if(!u)return null;o.push(u)}return new ny(o)}return new Ha(a,r)}evaluate(e){return this.arr.map(i=>i.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},dd=class sy{constructor(e){this.key=e,this.type=ct}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=e[1];return r==null?i.error("Global state property must be defined."):typeof r=="string"?new sy(r):i.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let i=e.globals?.globalState;return!i||Object.keys(i).length===0?null:Gn(i,this.key)??null}eachChild(){}outputDefined(){return!1}},Va={"==":cw,"!=":dw,">":fw,"<":pw,">=":gw,"<=":mw,array:sr,at:H2,boolean:sr,case:J2,coalesce:q_,collator:X_,format:z_,image:yw,in:X2,"index-of":Y2,interpolate:bi,"interpolate-hcl":bi,"interpolate-lab":bi,length:vw,let:O_,literal:Ha,match:K2,number:sr,"number-format":_w,object:sr,semiliteral:Nw,slice:Q2,step:ad,string:sr,"to-boolean":La,"to-color":La,"to-number":La,"to-string":La,var:j_,within:od,distance:cd,"global-state":dd},qi=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},$w=class oy{constructor(e,i=[]){this.parent=e,this.bindings={};for(let[r,a]of i)this.bindings[r]=a}concat(e){return new oy(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ly=class uy{constructor(e,i,r=[],a,n=new $w,s=[]){this.registry=e,this.path=r,this.key=r.map(o=>`[${o}]`).join(""),this.scope=n,this.errors=s,this.expectedType=a,this._isConstant=i}parse(e,i,r,a,n={}){return i==null?this._parse(e,n):this.concat(i,r,a)._parse(e,n)}_parse(e,i){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let r=this.key;function a(n,s,o){return o==="assert"?new sr(s,[n],r):o==="coerce"?new La(s,[n],r):n}if(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", []].');let n=e[0];if(typeof n!="string")return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[n];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=a(o,l,i.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=a(o,l,i.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof Ha)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new M_;try{o=new Ha(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,i,r){let a=typeof e=="number"?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new uy(this.registry,this._isConstant,a,i||null,n,this.errors)}error(e,...i){let r=`${this.key}${i.map(a=>`[${a}]`).join("")}`;this.errors.push(new qi(r,e))}checkSubtype(e,i){let r=Kn(e,i);return r&&this.error(r),r}},ua=class Vn{constructor(e,i,r,a,n){this.name=e,this.type=i,this._evaluate=r,this.args=a,this.key=n}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){let r=e[0],a=Vn.definitions[r];if(!a)return i.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let n=Array.isArray(a)?a[0]:a.type,s=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ly(i.registry,Ho,i.path,null,i.scope);let c=[],d=!1;for(let p=1;p<e.length;p++){let f=e[p],m=Array.isArray(u)?u[p-1]:u.type,g=l.parse(f,1+c.length,m);if(!g){d=!0;break}c.push(g)}if(!d){if(Array.isArray(u)&&u.length!==c.length){l.error(`Expected ${u.length} arguments, but found ${c.length} instead.`);continue}for(let p=0;p<c.length;p++){let f=Array.isArray(u)?u[p]:u.type,m=c[p];l.concat(p+1).checkSubtype(f,m.type)}if(l.errors.length===0)return new Vn(r,n,h,c,i.key)}}if(o.length===1)i.errors.push(...l.errors);else{let u=(o.length?o:s).map(([c])=>Zw(c)).join(" | "),h=[];for(let c=1;c<e.length;c++){let d=i.parse(e[c],1+h.length);if(!d)return null;h.push(Kt(d.type))}i.error(`Expected arguments of type ${u}, but found (${h.join(", ")}) instead.`)}return null}static register(e,i){Vn.definitions=i;for(let r in i)e[r]=Vn}};function cm(t,[e,i,r,a],n){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);let s=a?a.evaluate(t):1,o=I_(e,i,r,s);if(o)throw new Xt(o,n);return new lt(e/255,i/255,r/255,s,!1)}function dm(t,e){return t in e&&e[t]!==void 0}function mh(t,e){let i=e[t];return i===void 0?null:i}function Gw(t,e,i,r){for(;i<=r;){let a=i+r>>1;if(e[a]===t)return!0;e[a]>t?r=a-1:i=a+1}return!1}function Zr(t){return{type:t}}ua.register(Va,{error:[A2,[ut],(t,[e],i)=>{throw new Xt(e.evaluate(t),i)}],typeof:[ut,[ct],(t,[e])=>Kt(ne(e.evaluate(t)))],"to-rgba":[Re(V,4),[Fi],(t,[e])=>{let[i,r,a,n]=e.evaluate(t).rgb;return[i*255,r*255,a*255,n]}],rgb:[Fi,[V,V,V],cm],rgba:[Fi,[V,V,V,V],cm],has:{type:mt,overloads:[[[ut],(t,[e])=>dm(e.evaluate(t),t.properties())],[[ut,Kr],(t,[e,i])=>dm(e.evaluate(t),i.evaluate(t))]]},get:{type:ct,overloads:[[[ut],(t,[e])=>mh(e.evaluate(t),t.properties())],[[ut,Kr],(t,[e,i])=>mh(e.evaluate(t),i.evaluate(t))]]},"feature-state":[ct,[ut],(t,[e])=>mh(e.evaluate(t),t.featureState||{})],properties:[Kr,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[ct,[],t=>t.id()],zoom:[V,[],t=>t.globals.zoom],"heatmap-density":[V,[],t=>t.globals.heatmapDensity||0],elevation:[V,[],t=>t.globals.elevation||0],"line-progress":[V,[],t=>t.globals.lineProgress||0],accumulated:[ct,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[V,Zr(V),(t,e)=>{let i=0;for(let r of e)i+=r.evaluate(t);return i}],"*":[V,Zr(V),(t,e)=>{let i=1;for(let r of e)i*=r.evaluate(t);return i}],"-":{type:V,overloads:[[[V,V],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[V],(t,[e])=>-e.evaluate(t)]]},"/":[V,[V,V],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[V,[V,V],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[V,[],()=>Math.LN2],pi:[V,[],()=>Math.PI],e:[V,[],()=>Math.E],"^":[V,[V,V],(t,[e,i])=>e.evaluate(t)**+i.evaluate(t)],sqrt:[V,[V],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[V,[V],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[V,[V],(t,[e])=>Math.log(e.evaluate(t))],log2:[V,[V],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[V,[V],(t,[e])=>Math.sin(e.evaluate(t))],cos:[V,[V],(t,[e])=>Math.cos(e.evaluate(t))],tan:[V,[V],(t,[e])=>Math.tan(e.evaluate(t))],asin:[V,[V],(t,[e])=>Math.asin(e.evaluate(t))],acos:[V,[V],(t,[e])=>Math.acos(e.evaluate(t))],atan:[V,[V],(t,[e])=>Math.atan(e.evaluate(t))],min:[V,Zr(V),(t,e)=>Math.min(...e.map(i=>i.evaluate(t)))],max:[V,Zr(V),(t,e)=>Math.max(...e.map(i=>i.evaluate(t)))],abs:[V,[V],(t,[e])=>Math.abs(e.evaluate(t))],round:[V,[V],(t,[e])=>{let i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[V,[V],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[V,[V],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[mt,[ut,ct],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[mt,[ct],(t,[e])=>t.id()===e.value],"filter-type-==":[mt,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[mt,[ut,ct],(t,[e,i])=>{let r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<a}],"filter-id-<":[mt,[ct],(t,[e])=>{let i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[mt,[ut,ct],(t,[e,i])=>{let r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>a}],"filter-id->":[mt,[ct],(t,[e])=>{let i=t.id(),r=e.value;return typeof i==typeof r&&i>r}
vendor: 5,082 bytes, line 821
821],"filter-<=":[mt,[ut,ct],(t,[e,i])=>{let r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[mt,[ct],(t,[e])=>{let i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[mt,[ut,ct],(t,[e,i])=>{let r=t.properties()[e.value],a=i.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[mt,[ct],(t,[e])=>{let i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[mt,[ct],(t,[e])=>{let i=e.value,r=t.properties();return i in r&&r[i]!==void 0}],"filter-has-id":[mt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[mt,[Re(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[mt,[Re(ct)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[mt,[ut,Re(ct)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[mt,[ut,Re(ct)],(t,[e,i])=>Gw(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:mt,overloads:[[[mt,mt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Zr(mt),(t,e)=>{for(let i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:mt,overloads:[[[mt,mt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Zr(mt),(t,e)=>{for(let i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[mt,[mt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[mt,[ut],(t,[e])=>{let i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,Zr(ct),(t,e)=>e.map(i=>Zn(i.evaluate(t))).join("")],split:[Re(ut),[ut,ut],(t,[e,i])=>e.evaluate(t).split(i.evaluate(t))],join:[ut,[Re(ut),ut],(t,[e,i])=>e.evaluate(t).join(i.evaluate(t))],"resolved-locale":[ut,[Tl],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Zw(t){return Array.isArray(t)?`(${t.map(Kt).join(", ")})`:`(${Kt(t.type)}...)`}function Ho(t){if(t instanceof j_)return Ho(t.boundExpression);if(t instanceof ua&&t.name==="error"||t instanceof X_||t instanceof od||t instanceof cd||t instanceof dd)return!1;let e=t instanceof La||t instanceof sr,i=!0;return t.eachChild(r=>{i&&(i=e?Ho(r):r instanceof Ha)}),i?Al(t)&&Ml(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Al(t){if(t instanceof ua&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof od||t instanceof cd)return!1;let e=!0;return t.eachChild(i=>{e&&!Al(i)&&(e=!1)}),e}function Qn(t){if(t instanceof ua&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(i=>{e&&!Qn(i)&&(e=!1)}),e}function Ml(t,e){if(t instanceof ua&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(r=>{i&&!Ml(r,e)&&(i=!1)}),i}function Xa(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function hy(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function pd(t){return!!t.expression&&t.expression.interpolated}var fd=/^(.*)-transition$/;function ts(t,...e){for(let i of e)for(let r in i)t[r]=i[r];return t}function pt(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Fl(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&ne(t)===Kr}function qw(t){return t}function Ww(t){switch(t.type){case"color":return lt.parse;case"padding":return er.parse;case"numberArray":return ir.parse;case"colorArray":return xi.parse;default:return null}}function Hw(t){switch(t){case"exponential":return dy;case"interval":return Yw;case"categorical":return Xw;case"identity":return Kw;default:throw Error(`Unknown function type "${t}"`)}}function cy(t,e){let i=t.stops&&typeof t.stops[0][0]=="object",r=i||t.property!==void 0,a=i||!r,n=t.type||(pd(e)?"exponential":"interval"),s=Ww(e);if(s&&(t=ts({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!j2(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=Hw(n),l,u;if(n==="categorical"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(i){let h={},c=[];for(let f=0;f<t.stops.length;f++){let m=t.stops[f],g=m[0].zoom;h[g]===void 0&&(h[g]={zoom:g,type:t.type,property:t.property,default:t.default,stops:[]},c.push(g)),h[g].stops.push([m[0].value,m[1]])}let d=[];for(let f of c)d.push([h[f].zoom,cy(h[f],e)]);let p={name:"linear"};return{kind:"composite",interpolationType:p,interpolationFactor:bi.interpolationFactor.bind(void 0,p),zoomStops:d.map(f=>f[0]),evaluate({zoom:f},m){return dy({stops:d,base:t.base},e,f).evaluate(f,m)}}}if(a){let h=n==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:bi.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:"source",evaluate(h,c){let d=c&&c.properties?c.properties[t.property]:void 0;return d===void 0?Es(t.default,e.default):o(t,e,d,l,u)}}}
vendor: 13,035 bytes, line 821
821function Es(t,e,i){if(t!==void 0)return t;if(e!==void 0)return e;if(i!==void 0)return i}function Xw(t,e,i,r,a){return Es(typeof i===a?r[i]:void 0,t.default,e.default)}function Yw(t,e,i){if(pt(i)!=="number")return Es(t.default,e.default);let r=t.stops.length;if(r===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];let a=Pl(t.stops.map(n=>n[0]),i,"");return t.stops[a][1]}function dy(t,e,i){let r=t.base===void 0?1:t.base;if(pt(i)!=="number")return Es(t.default,e.default);let a=t.stops.length;if(a===1||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[a-1][0])return t.stops[a-1][1];let n=Pl(t.stops.map(h=>h[0]),i,""),s=Jw(i,r,t.stops[n][0],t.stops[n+1][0]),o=t.stops[n][1],l=t.stops[n+1][1],u=Zt[e.type]||qw;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),d=l.evaluate.apply(void 0,h);if(c!==void 0&&d!==void 0)return u(c,d,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function Kw(t,e,i){switch(e.type){case"color":i=lt.parse(i);break;case"formatted":i=ur.fromString(i.toString());break;case"resolvedImage":i=Ji.fromString(i.toString());break;case"padding":i=er.parse(i);break;case"colorArray":i=xi.parse(i);break;case"numberArray":i=ir.parse(i);break;default:pt(i)!==e.type&&(e.type!=="enum"||!e.values[i])&&(i=void 0)}return Es(i,t.default,e.default)}function Jw(t,e,i,r){let a=r-i,n=t-i;return a===0?0:e===1?n/a:(e**+n-1)/(e**+a-1)}function Bh(t){return{result:"success",value:t}}function za(t){return{result:"error",value:t}}var md=class{constructor(t,e,i,r){this.expression=t,this._warningHistory={},this._evaluator=new M_,this._defaultValue=i?yy(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=r,this._rootKey=e}evaluateWithoutErrorHandling(t,e,i,r,a,n){return this._globalState&&(t=Ya(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,a,n){this._globalState&&(t=Ya(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=n||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Xt(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof Xt?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(py(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function py(t,e,i,r){return`${t}${e}: ${i}${r==null?"":` Falling back to ${String(r)}.`}`}function fy(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function zl(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Va}function Rl(t,e,i,r){fy(e);let a=new ly(Va,Ho,[],i?eT(i):void 0),n=a.parse(t,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Bh(new md(n,e,i,r)):za(a.errors)}var es=class{constructor(t,e,i){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!Qn(e.expression),this.globalStateRefs=Ss(e.expression),this._globalState=i}evaluateWithoutErrorHandling(t,e,i,r,a,n){return this._globalState&&(t=Ya(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,a,n)}evaluate(t,e,i,r,a,n){return this._globalState&&(t=Ya(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,a,n)}},Xo=class{constructor(t,e,i,r,a){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!Qn(e.expression),this.globalStateRefs=Ss(e.expression),this.interpolationType=r,this._globalState=a}evaluateWithoutErrorHandling(t,e,i,r,a,n){return this._globalState&&(t=Ya(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,a,n)}evaluate(t,e,i,r,a,n){return this._globalState&&(t=Ya(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,a,n)}interpolationFactor(t,e,i){return this.interpolationType?bi.interpolationFactor(this.interpolationType,t,e,i):0}};function Qw(t){return t._styleExpression!==void 0}function my(t,e,i,r){let a=Rl(t,e,i,r);if(a.result==="error")return a;let n=a.value.expression,s=Al(n);if(!s&&!Xa(i))return za([new qi("","data expressions not supported")]);let o=Ml(n,["zoom"]);if(!o&&!hy(i))return za([new qi("","zoom expressions not supported")]);let l=Uo(n);if(!l&&!o)return za([new qi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof qi)return za([l]);if(l instanceof bi&&!pd(i))return za([new qi("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Bh(s?new es("constant",a.value,r):new es("source",a.value,r));let u=l instanceof bi?l.interpolation:void 0;return Bh(s?new Xo("camera",a.value,l.labels,u,r):new Xo("composite",a.value,l.labels,u,r))}var gy=class _y{constructor(e,i,r){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,fy(i),this._parameters=e,this._specification=r,this._rootKey=i,this._defaultValue=yy(r),this._warningHistory={};let a=cy(this._parameters,this._specification);this.kind=a.kind,this.interpolationFactor=a.interpolationFactor,this.zoomStops=a.zoomStops,this.interpolationType=a.interpolationType,this._innerEvaluate=a.evaluate}evaluate(e,i){try{return this._innerEvaluate(e,i)}catch(r){let a=r instanceof Error?r.message:String(r),n=`|${a}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<"u"&&console.warn(py(this._rootKey,"",a,this._defaultValue))),this._defaultValue}}static deserialize(e){return new _y(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function tT(t,e,i,r){if(Fl(t))return new gy(t,e,i);if(zl(t)){let a=my(t,e,i,r);if(a.result==="error")throw Error(a.value.map(n=>`${n.key}: ${n.message}`).join(", "));return a.value}{let a=t;return i.type==="color"&&typeof t=="string"?a=lt.parse(t):i.type==="padding"&&(typeof t=="number"||Array.isArray(t))?a=er.parse(t):i.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?a=ir.parse(t):i.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?a=xi.parse(t):i.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?a=Ki.parse(t):i.type==="projectionDefinition"&&typeof t=="string"&&(a=mr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>a}}}function Uo(t){let e=null;if(t instanceof O_)e=Uo(t.result);else if(t instanceof q_){for(let i of t.args)if(e=Uo(i),e)break}else(t instanceof ad||t instanceof bi)&&t.input instanceof ua&&t.input.name==="zoom"&&(e=t);return e instanceof qi||t.eachChild(i=>{let r=Uo(i);r instanceof qi?e=r:!e&&r?e=new qi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new qi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ss(t,e=new Set){return t instanceof dd&&e.add(t.key),t.eachChild(i=>{Ss(i,e)}),e}function eT(t){let e={color:Fi,string:ut,number:V,enum:ut,boolean:mt,formatted:bs,padding:El,numberArray:Sl,colorArray:Yn,projectionDefinition:wl,resolvedImage:ws,variableAnchorOffsetCollection:Dl};return t.type==="array"?Re(e[t.value]||ct,t.length):e[t.type]}function yy(t){if(t.type==="color"&&Fl(t.default))return new lt(0,0,0,0);switch(t.type){case"color":return lt.parse(t.default)||null;case"padding":return er.parse(t.default)||null;case"numberArray":return ir.parse(t.default)||null;case"colorArray":return xi.parse(t.default)||null;case"variableAnchorOffsetCollection":return Ki.parse(t.default)||null;case"projectionDefinition":return mr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function Ya(t,e){let{zoom:i,heatmapDensity:r,elevation:a,lineProgress:n,isSupportedScript:s,accumulated:o}=t??{};return{zoom:i,heatmapDensity:r,elevation:a,lineProgress:n,isSupportedScript:s,accumulated:o,globalState:e}}function iT(t){let e=!1;for(let i of t){let r=vy(i);if(r==="expression")return"expression";r==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function vy(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return iT(t.slice(1));default:return"expression"}}function gd(t){return vy(t)!=="legacy"}function pm(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function rT(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],pm(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",pm(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function xy(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=rT(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function gh(t,e,i){let r=i[t];return Array.isArray(r)?gd(r)?_d(r,e.concat(t)):{path:e.concat(t),legacyFilter:r}:null}function _d(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let i=1;i<t.length;i++){let r=gh(i,e,t);if(r)return r}break;case"!":{let i=gh(1,e,t);if(i)return i;break}case"case":for(let i=1;i<t.length-1;i+=2){let r=gh(i,e,t);if(r)return r}}return null}function aT(t,e){let i=_d(t);if(!i||typeof console>"u")return;let r=i.path.map(a=>`[${a}]`).join("");console.warn(`${e}${r}: ${xy(i.legacyFilter)}`)}var nT={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ka(t,e,i){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};gd(t)?aT(t,e):t=Yo(t);let r=Rl(t,e,nT,i);if(r.result==="error")throw Error(r.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,n,s)=>r.value.evaluate(a,n,{},s),needGeometry:by(t),getGlobalStateRefs:()=>Ss(r.value.expression)}}function sT(t,e){return t<e?-1:+(t>e)}function by(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(by(t[e]))return!0;return!1}function Yo(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?_h(t[1],t[2],"=="):e==="!="?So(_h(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?_h(t[1],t[2],e):e==="any"?oT(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Yo)):e==="none"?["all"].concat(t.slice(1).map(Yo).map(So)):e==="in"?fm(t[1],t.slice(2)):e==="!in"?So(fm(t[1],t.slice(2))):e==="has"?mm(t[1]):e!=="!has"||So(mm(t[1]))}function _h(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function oT(t){return["any"].concat(t.map(Yo))}function fm(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(i=>typeof i!=typeof e[0])?["filter-in-large",t,["literal",e.sort(sT)]]:["filter-in-small",t,["literal",e]]}}function mm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function So(t){return["!",t]}function wy(t){let e=t.key,i=t.value;return i?[new B(e,i,"constants have been deprecated as of v8")]:[]}function re(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ia(t){if(Array.isArray(t))return t.map(ia);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let i in t)e[i]=ia(t[i]);return e}return re(t)}function ai(t){let e=t.key,i=t.value,r=t.valueSpec||{},a=t.objectElementValidators||{},n=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=pt(i);if(u!=="object")return[new B(e,i,`object expected, ${u}
821 found`)];for(let h in i){let c=h.split(".")[0],d=Gn(r,c)||r["*"],p;if(Gn(a,c))p=a[c];else if(Gn(r,c)){if(i[h]===void 0)continue;p=o}else if(a["*"])p=a["*"];else if(r["*"])p=o;else{l.push(new B(e,i[h],`unknown property "${h}"`));continue}l=l.concat(p({key:(e&&`${e}.`)+h,value:i[h],valueSpec:d,style:n,styleSpec:s,object:i,objectKey:h,validateSpec:o},i))}for(let h in r)a[h]||r[h].required&&r[h].default===void 0&&i[h]===void 0&&l.push(new B(e,i,`missing required property "${h}"`));return l}function yd(t){let e=t.value,i=t.valueSpec,r=t.validateSpec,a=t.style,n=t.styleSpec,s=t.key,o=t.arrayElementValidator||r;if(pt(e)!=="array")return[new B(s,e,`array expected, ${pt(e)} found`)];if(i.length&&e.length!==i.length)return[new B(s,e,`array length ${i.length} expected, length ${e.length} found`)];let l={type:i.value,values:i.values};n.$version<7&&(l.function=i.function),pt(i.value)==="object"&&(l=i.value);let u=[];for(let h=0;h<e.length;h++)u=u.concat(o({array:e,arrayIndex:h,value:e[h],valueSpec:l,validateSpec:t.validateSpec,style:a,styleSpec:n,key:`${s}[${h}]`}));return u}function kl(t){let e=t.key,i=t.value,r=t.valueSpec,a=pt(i);return a==="number"&&i!==i&&(a="NaN"),a==="number"?"minimum"in r&&i<r.minimum?[new B(e,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new B(e,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]:[new B(e,i,`number expected, ${a} found`)]}function Ty(t){let e=t.valueSpec,i=re(t.value.type),r,a={}
vendor: 12,635 bytes, lines 821-822
821,n,s,o=i!=="categorical"&&t.value.property===void 0,l=!o,u=pt(t.value.stops)==="array"&&pt(t.value.stops[0])==="array"&&pt(t.value.stops[0][0])==="object",h=ai({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:f}});return i==="identity"&&o&&h.push(new B(t.key,t.value,'missing required property "property"')),i!=="identity"&&!t.value.stops&&h.push(new B(t.key,t.value,'missing required property "stops"')),i==="exponential"&&t.valueSpec.expression&&!pd(t.valueSpec)&&h.push(new B(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Xa(t.valueSpec)?h.push(new B(t.key,t.value,"property functions not supported")):o&&!hy(t.valueSpec)&&h.push(new B(t.key,t.value,"zoom functions not supported"))),(i==="categorical"||u)&&t.value.property===void 0&&h.push(new B(t.key,t.value,'"property" property is required')),h;function c(m){if(i==="identity")return[new B(m.key,m.value,'identity function may not have a "stops" property')];let g=[],_=m.value;return g=g.concat(yd({key:m.key,value:_,valueSpec:m.valueSpec,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,arrayElementValidator:d})),pt(_)==="array"&&_.length===0&&g.push(new B(m.key,_,"array must have at least one stop")),g}function d(m){let g=[],_=m.value,y=m.key;if(pt(_)!=="array")return[new B(y,_,`array expected, ${pt(_)} found`)];if(_.length!==2)return[new B(y,_,`array length 2 expected, length ${_.length} found`)];if(u){if(pt(_[0])!=="object")return[new B(y,_,`object expected, ${pt(_[0])} found`)];if(_[0].zoom===void 0)return[new B(y,_,"object stop key must have zoom")];if(_[0].value===void 0)return[new B(y,_,"object stop key must have value")];if(s&&s>re(_[0].zoom))return[new B(y,_[0].zoom,"stop zoom values must appear in ascending order")];re(_[0].zoom)!==s&&(s=re(_[0].zoom),n=void 0,a={}),g=g.concat(ai({key:`${y}[0]`,value:_[0],valueSpec:{zoom:{}},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec,objectElementValidators:{zoom:kl,value:p}}))}else g=g.concat(p({key:`${y}[0]`,value:_[0],valueSpec:{},validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec},_));return zl(ia(_[1]))?g.concat([new B(`${y}[1]`,_[1],"expressions are not allowed in function stops.")]):g.concat(m.validateSpec({key:`${y}[1]`,value:_[1],valueSpec:e,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec}))}function p(m,g){let _=pt(m.value),y=re(m.value),x=m.value===null?g:m.value;if(!r)r=_;else if(_!==r)return[new B(m.key,x,`${_} stop domain type must match previous stop domain type ${r}`)];if(_!=="number"&&_!=="string"&&_!=="boolean")return[new B(m.key,x,"stop domain value must be a number, string, or boolean")];if(_!=="number"&&i!=="categorical"){let v=`number expected, ${_} found`;return Xa(e)&&i===void 0&&(v+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new B(m.key,x,v)]}return i==="categorical"&&_==="number"&&(!isFinite(y)||Math.floor(y)!==y)?[new B(m.key,x,`integer expected, found ${y}`)]:i!=="categorical"&&_==="number"&&n!==void 0&&y<n?[new B(m.key,x,"stop domain values must appear in ascending order")]:(n=y,i==="categorical"&&y in a?[new B(m.key,x,"stop domain values must be unique")]:(a[y]=!0,[]))}function f(m){return m.validateSpec({key:m.key,value:m.value,valueSpec:e,validateSpec:m.validateSpec,style:m.style,styleSpec:m.styleSpec})}}function Ja(t){let e=(t.expressionContext==="property"?my:Rl)(ia(t.value),t.key,t.valueSpec);if(e.result==="error")return e.value.map(r=>new B(`${t.key}${r.key}`,t.value,r.message));let i=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!i.outputDefined())return[new B(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!Qn(i))return[new B(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!Qn(i))return[new B(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ml(i,["zoom","feature-state"]))return[new B(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!Al(i))return[new B(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function lT(t){let e=t.value,i=t.key,r=pt(e);return r==="boolean"?[]:[new B(i,e,`boolean expected, ${r} found`)]}function Oh(t){let e=t.key,i=t.value,r=pt(i);return r==="string"?lt.parse(String(i))?[]:[new B(e,i,`color expected, "${i}" found`)]:[new B(e,i,`color expected, ${r} found`)]}function is(t){let e=t.key,i=t.value,r=t.valueSpec,a=[];return Array.isArray(r.values)?r.values.indexOf(re(i))===-1&&a.push(new B(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(r.values).indexOf(re(i))===-1&&a.push(new B(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function uT(t,e){let i=t;for(let r of e)i=i[r];return i}function hT(t,e){let i=_d(e);return i?[new B(`${t.key}${i.path.map(r=>`[${r}]`).join("")}`,uT(t.value,i.path),xy(i.legacyFilter),null,"warning")]:[]}function vd(t){let e=ia(t.value);return gd(e)?[...hT(t,e),...Ja(ts({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:Ey(t)}function Ey(t){let e=t.value,i=t.key;if(pt(e)!=="array")return[new B(i,e,`array expected, ${pt(e)} found`)];let r=t.styleSpec,a,n=[];if(e.length<1)return[new B(i,e,"filter array must have at least 1 element")];switch(n=n.concat(is({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),re(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&re(e[1])==="$type"&&n.push(new B(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&n.push(new B(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=pt(e[1]),a!=="string"&&n.push(new B(`${i}[1]`,e[1],`string expected, ${a} found`)));for(let s=2;s<e.length;s++)a=pt(e[s]),re(e[1])==="$type"?n=n.concat(is({key:`${i}[${s}]`,value:e[s],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):a!=="string"&&a!=="number"&&a!=="boolean"&&n.push(new B(`${i}[${s}]`,e[s],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let s=1;s<e.length;s++)n=n.concat(Ey({key:`${i}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=pt(e[1]),e.length===2?a!=="string"&&n.push(new B(`${i}[1]`,e[1],`string expected, ${a} found`)):n.push(new B(i,e,`filter array for "${e[0]}" operator must have 2 elements`))}return n}function Sy(t,e){let i=t.key,r=t.validateSpec,a=t.style,n=t.styleSpec,s=t.value,o=t.objectKey,l=n[`${e}_${t.layerType}`];if(!l)return[];let u=o.match(fd);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return r({key:i,value:s,valueSpec:n.transition,style:a,styleSpec:n});let h=t.valueSpec||l[o];if(!h)return[new B(i,s,`unknown property "${o}"`)];let c;if(pt(s)==="string"&&Xa(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new B(i,s,`"${o}" does not support interpolation syntax 822Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];let d=[];return t.layerType==="symbol"&&o==="text-font"&&Fl(ia(s))&&re(s.type)==="identity"&&d.push(new B(i,s,'"text-font" does not support identity functions')),d.concat(r({key:t.key,value:s,valueSpec:h,style:a,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:o}))}function Dy(t){return Sy(t,"paint")}function Py(t){return Sy(t,"layout")}function Cy(t){let e=[],i=t.value,r=t.key,a=t.style,n=t.styleSpec;if(pt(i)!=="object")return[new B(r,i,`object expected, ${pt(i)} found`)];!i.type&&!i.ref&&e.push(new B(r,i,'either "type" or "ref" is required'));let s=re(i.type),o=re(i.ref);if(i.id){let l=re(i.id);for(let u=0;u<t.arrayIndex;u++){let h=a.layers[u];re(h.id)===l&&e.push(new B(r,i.id,`duplicate layer id "${i.id}", previously used at line ${h.id.__line__}`))}}if("ref"in i){["type","source","source-layer","filter","layout"].forEach(u=>{u in i&&e.push(new B(r,i[u],`"${u}" is prohibited for ref layers`))});let l;a.layers.forEach(u=>{re(u.id)===o&&(l=u)}),l?l.ref?e.push(new B(r,i.ref,"ref cannot reference another ref layer")):s=re(l.type):e.push(new B(r,i.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!i.source)e.push(new B(r,i,'missing required property "source"'));else{let l=a.sources&&a.sources[i.source],u=l&&re(l.type);l?u==="vector"&&s==="raster"?e.push(new B(r,i.source,`layer "${i.id}" requires a raster source`)):u!=="raster-dem"&&s==="hillshade"||u!=="raster-dem"&&s==="color-relief"?e.push(new B(r,i.source,`layer "${i.id}" requires a raster-dem source`)):u==="raster"&&s!=="raster"?e.push(new B(r,i.source,`layer "${i.id}" requires a vector source`)):u==="vector"&&!i["source-layer"]?e.push(new B(r,i,`layer "${i.id}" must specify a "source-layer"`)):u==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new B(r,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):s==="line"&&i.paint&&i.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&e.push(new B(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new B(r,i.source,`source "${i.source}" not found`))}return s==="raster"&&i.paint?.resampling&&i.paint?.["raster-resampling"]&&e.push(new B(r,i.paint,`layer "${i.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(ai({key:r,value:i,valueSpec:n.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${r}.type`,value:i.type,valueSpec:n.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:i,objectKey:"type"})},filter:vd,layout(l){return ai({layer:i,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Py(ts({layerType:s},u))}}})},paint(l){return ai({layer:i,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Dy(ts({layerType:s},u))}}})}}})),e}function Rr(t){let e=t.value,i=t.key,r=pt(e);return r==="string"?[]:[new B(i,e,`string expected, ${r} found`)]}function cT(t){let e=t.sourceName??"",i=t.value,r=t.styleSpec,a=r.source_raster_dem,n=t.style,s=[],o=pt(i);if(i===void 0)return s;if(o!=="object")return s.push(new B("source_raster_dem",i,`object expected, ${o} found`)),s;let l=re(i.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let c in i)!l&&u.includes(c)?s.push(new B(c,i[c],`In "${e}": "${c}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[c]?s=s.concat(t.validateSpec({key:c,value:i[c],valueSpec:a[c],validateSpec:t.validateSpec,style:n,styleSpec:r})):s.push(new B(c,i[c],`unknown property "${c}"`));return s}var gm={promoteId:dT};function Iy(t){let e=t.value,i=t.key,r=t.styleSpec,a=t.style,n=t.validateSpec;if(!e.type)return[new B(i,e,'"type" is required')];let s=re(e.type),o;switch(s){case"vector":case"raster":return o=ai({key:i,value:e,valueSpec:r[`source_${s.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:gm,validateSpec:n}),o;case"raster-dem":return o=cT({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:n}),o;case"geojson":if(o=ai({key:i,value:e,valueSpec:r.source_geojson,style:a,styleSpec:r,validateSpec:n,objectElementValidators:gm}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...Ja({key:`${i}.${l}.map`,value:h,validateSpec:n,expressionContext:"cluster-map"})),o.push(...Ja({key:`${i}.${l}.reduce`,value:c,validateSpec:n,expressionContext:"cluster-reduce"}))}return o;case"video":return ai({key:i,value:e,valueSpec:r.source_video,style:a,validateSpec:n,styleSpec:r});case"image":return ai({key:i,value:e,valueSpec:r.source_image,style:a,validateSpec:n,styleSpec:r});case"canvas":return[new B(i,null,"Please use runtime APIs to add canvas sources, rather than
822including them in stylesheets.","source.canvas")];default:return is({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:n,styleSpec:r})}}function dT({key:t,value:e}){if(pt(e)==="string")return Rr({key:t,value:e});{let i=[];for(let r in e)i.push(...Rr({key:`${t}.${r}`,value:e[r]}));return i}}function Ay(t){let e=t.value,i=t.styleSpec,r=i.light,a=t.style,n=[],s=pt(e);if(e===void 0)return n;if(s!=="object")return n=n.concat([new B("light",e,`object expected, ${s} found`)]),n;for(let o in e){let l=o.match(fd);n=l&&r[l[1]]&&r[l[1]].transition?n.concat(t.validateSpec({key:o,value:e[o],valueSpec:i.transition,validateSpec:t.validateSpec,style:a,styleSpec:i})):r[o]?n.concat(t.validateSpec({key:o,value:e[o],valueSpec:r[o],validateSpec:t.validateSpec,style:a,styleSpec:i})):n.concat([new B(o,e[o],`unknown property "${o}"`)])}return n}function My(t){let e=t.value,i=t.styleSpec,r=i.sky,a=t.style,n=pt(e);if(e===void 0)return[];if(n!=="object")return[new B("sky",e,`object expected, ${n} found`)];let s=[];for(let o in e){let l=o.match(fd);s=l&&r[l[1]]&&r[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i.transition,style:a,styleSpec:i})):r[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r[o],style:a,styleSpec:i})):s.concat([new B(o,e[o],`unknown property "${o}"`)])}return s}function Fy(t){let e=t.value,i=t.styleSpec,r=i.terrain,a=t.style,n=[],s=pt(e);if(e===void 0)return n;if(s!=="object")return n=n.concat([new B("terrain",e,`object expected, ${s} found`)]),n;for(let o in e)n=r[o]?n.concat(t.validateSpec({key:o,value:e[o],valueSpec:r[o],validateSpec:t.validateSpec,style:a,styleSpec:i})):n.concat([new B(o,e[o],`unknown property "${o}"`)]);return n}function pT(t){return Rr(t).length===0?[]:Ja(t)}function fT(t){return Rr(t).length===0?[]:Ja(t)}function mT(t){let e=t.key,i=t.value;if(pt(i)==="array"){if(i.length<1||i.length>4)return[new B(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];let r={type:"number"},a=[];for(let n=0;n<i.length;n++)a=a.concat(t.validateSpec({key:`${e}[${n}]`,value:i[n],validateSpec:t.validateSpec,valueSpec:r}));return a}return kl({key:e,value:i,valueSpec:{}})}function gT(t){let e=t.key,i=t.value;if(pt(i)==="array"){let r={type:"number"};if(i.length<1)return[new B(e,i,"array length at least 1 expected, length 0 found")];let a=[];for(let n=0;n<i.length;n++)a=a.concat(t.validateSpec({key:`${e}[${n}]`,value:i[n],validateSpec:t.validateSpec,valueSpec:r}));return a}return kl({key:e,value:i,valueSpec:{}})}function _T(t){let e=t.key,i=t.value;if(pt(i)==="array"){if(i.length<1)return[new B(e,i,"array length at least 1 expected, length 0 found")];let r=[];for(let a=0;a<i.length;a++)r=r.concat(Oh({key:`${e}[${a}]`,value:i[a],valueSpec:{}}));return r}return Oh({key:e,value:i,valueSpec:{}})}function yT(t){let e=t.key,i=t.value,r=pt(i),a=t.styleSpec;if(r!=="array"||i.length<1||i.length%2!=0)return[new B(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let n=[];for(let s=0;s<i.length;s+=2)n=n.concat(is({key:`${e}[${s}]`,value:i[s],valueSpec:a.layout_symbol["text-anchor"]})),n=n.concat(yd({key:`${e}[${s+1}]`,value:i[s+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:a}));return n}function zy(t){let e=[],i=t.value,r=t.key;if(Array.isArray(i)){let a=[],n=[];for(let s in i)i[s].id&&a.includes(i[s].id)&&e.push(new B(r,i,`all the sprites' ids must be unique, but ${i[s].id} is duplicated`)),a.push(i[s].id),i[s].url&&n.includes(i[s].url)&&e.push(new B(r,i,`all the sprites' URLs must be unique, but ${i[s].url} is duplicated`)),n.push(i[s].url),e=e.concat(ai({key:`${r}[${s}]`,value:i[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return Rr({key:r,value:i})}function vT(t){let e=t.value,i=t.styleSpec,r=i.projection,a=t.style,n=pt(e);if(e===void 0)return[];if(n!=="object")return[new B("projection",e,`object expected, ${n} found`)];let s=[];for(let o in e)s=r[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r[o],style:a,styleSpec:i})):s.concat([new B(o,e[o],`unknown property "${o}"`)]);return s}function xT(t){let e=t.key,i=t.value;i=i instanceof String?i.valueOf():i;let r=pt(i);return r==="array"&&!wT(i)&&!bT(i)?[new B(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]:["array","string"].includes(r)?[]:[new B(e,i,`projection expected, invalid type "${r}" found`)]}function bT(t){return!!["interpolate","step","literal"].includes(t[0])}function wT(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}function Vh(t){return!!t&&t.constructor===Object}function Ry(t){return Vh(t.value)?[]:[new B(t.key,t.value,`object expected, ${pt(t.value)} found`)]}var _m=1114111,TT=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i;
vendor: 21,356 bytes, line 822
822function ET(t,e){if(pt(e)!=="string")return[];let i=`${e}`,r=()=>[new B(t,e,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],a=i.match(TT);if(!a)return r();let[,n,s,o]=a;if(o!==void 0)return o.length>6?r():[];let l=parseInt(n,16),u=s===void 0?l:parseInt(s,16);return l>_m||u>_m?[new B(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new B(t,e,`unicode range start must not be greater than its end, but ${i} is`)]:[]}function ky(t){let e=t.key??"font-faces",i=t.value,r=t.validateSpec,a=t.styleSpec??v_,n=t.style;if(!Vh(i))return[new B(e,i,`object expected, ${pt(i)} found`)];let s=[];for(let o in i){let l=i[o],u=pt(l);if(u==="string")s.push(...Rr({key:`${e}.${o}`,value:l}));else if(u==="array"){let h={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[c,d]of l.entries()){let p=`${e}.${o}[${c}]`;s.push(...ai({key:p,value:d,valueSpec:h,styleSpec:a,style:n,validateSpec:r}));let f=Vh(d)?d["unicode-range"]:void 0;if(pt(f)==="array")for(let[m,g]of f.entries())s.push(...ET(`${p}.unicode-range[${m}]`,g))}}else s.push(new B(`${e}.${o}`,l,`string or array expected, ${u} found`))}return s}var ym={"*"(){return[]},array:yd,boolean:lT,number:kl,color:Oh,constants:wy,enum:is,filter:vd,function:Ty,layer:Cy,object:ai,source:Iy,light:Ay,sky:My,terrain:Fy,projection:vT,projectionDefinition:xT,string:Rr,formatted:pT,resolvedImage:fT,padding:mT,numberArray:gT,colorArray:_T,variableAnchorOffsetCollection:yT,sprite:zy,state:Ry,fontFaces:ky};function qn(t){let e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=qn,i.expression&&Fl(re(e))?Ty(t):i.expression&&zl(ia(e))?Ja(t):i.type&&ym[i.type]?ym[i.type](t):ai(ts({},t,{valueSpec:i.type?r[i.type]:i}))}function Ly(t){let e=t.value,i=t.key,r=Rr(t);return r.length||(e.indexOf("{fontstack}")===-1&&r.push(new B(i,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&r.push(new B(i,e,'"glyphs" url must include a "{range}" token'))),r}function ri(t,e=F){let i=[];return i=i.concat(qn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:qn,objectElementValidators:{glyphs:Ly,"*"(){return[]}}})),t.constants&&(i=i.concat(wy({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:qn}))),By(i)}ri.source=gi(mi(Iy)),ri.sprite=gi(mi(zy)),ri.glyphs=gi(mi(Ly)),ri.fontFaces=gi(mi(ky)),ri.light=gi(mi(Ay)),ri.sky=gi(mi(My)),ri.terrain=gi(mi(Fy)),ri.state=gi(mi(Ry)),ri.layer=gi(mi(Cy)),ri.filter=gi(mi(vd)),ri.paintProperty=gi(mi(Dy)),ri.layoutProperty=gi(mi(Py));function mi(t){return function(e){return t(Object.assign({},e,{validateSpec:qn}))}}function By(t){return[].concat(t).sort((e,i)=>e.line-i.line)}function gi(t){return function(...e){return By(t.apply(this,e))}}var ST={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},DT=class{constructor(t,e,i){this._rootKey=e,this._globalState=i,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=Rl(t,this._rootKey,ST,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(i=>`${i.key}: ${i.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=Ss(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function PT(t,e,i){return new DT(t,e,i)}var $e=ri,xd=new Set(Object.keys(F).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function CT(t){return Object.entries(t.sources??{}).filter(([,e])=>!xd.has(e.type)).map(([e])=>`sources.${e}`)}function bd(t,e){let i=CT(e);return Ll(t,$e(e).filter(({message:r})=>!i.some(a=>r.startsWith(`${a}:`)||r.startsWith(`${a}.`))))}function Ll(t,e){let i=!1;for(let r of e){if(r.severity==="warning"){ft(r.message);continue}t.fire(new J(Error(r.message))),i=!0}return i}function on(t,e,i,r){return r?.validate!==!1&&Ll(t,e({styleSpec:F,...i}))}var jh=class Oy{constructor(e,i,r){let a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],i=s[1],r=s[2],this.d=i+2*r;for(let u=0;u<this.d*this.d;u++){let h=s[3+u],c=s[3+u+1];a.push(h===c?null:s.subarray(h,c))}let o=s[3+a.length],l=s[3+a.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=i+2*r;for(let s=0;s<this.d*this.d;s++)a.push([]);this.keys=[],this.bboxes=[]}this.n=i,this.extent=e,this.padding=r,this.scale=i/e,this.uid=0;let n=r/i*e;this.min=-n,this.max=e+n}insert(e,i,r,a,n){this._forEachCell(i,r,a,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(n)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,i,r,a,n,s){this.cells[n].push(s)}query(e,i,r,a,n){let s=this.min,o=this.max;if(e<=s&&i<=s&&o<=r&&o<=a&&!n)return[...this.keys];{let l=[];return this._forEachCell(e,i,r,a,this._queryCell,l,{},n),l}}_queryCell(e,i,r,a,n,s,o,l){let u=this.cells[n];if(u!==null){let h=this.keys,c=this.bboxes;for(let d of u)if(o[d]===void 0){let p=d*4;(l?l(c[p+0],c[p+1],c[p+2],c[p+3]):e<=c[p+2]&&i<=c[p+3]&&r>=c[p+0]&&a>=c[p+1])?(o[d]=!0,s.push(h[d])):o[d]=!1}}}_forEachCell(e,i,r,a,n,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(i),c=this._convertToCellCoord(r),d=this._convertToCellCoord(a);for(let p=u;p<=c;p++)for(let f=h;f<=d;f++){let m=this.d*f+p;if((!l||l(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&n.call(this,e,i,r,a,m,s,o,l))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;let e=this.cells,i=3+this.cells.length+1+1,r=0;for(let s of this.cells)r+=s.length;let a=new Int32Array(i+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;let n=i;for(let s=0;s<e.length;s++){let o=e[s];a[3+s]=n,a.set(o,n),n+=o.length}return a[3+e.length]=n,a.set(this.keys,n),n+=this.keys.length,a[3+e.length+1]=n,a.set(this.bboxes,n),n+=this.bboxes.length,a.buffer}static serialize(e,i){let r=e.toArrayBuffer();return i&&i.push(r),{buffer:r}}static deserialize(e){return new Oy(e.buffer)}},or={};function $(t,e,i={}){if(or[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),or[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}$("Object",Object),$("Set",Set),$("TransferableGridIndex",jh),$("Color",lt),$("Error",Error),$("AJAXError",Za),$("ResolvedImage",Ji),$("StylePropertyFunction",gy),$("StyleExpression",md,{omit:["_evaluator"]}),$("ZoomDependentExpression",Xo),$("ZoomConstantExpression",es),$("CompoundExpression",ua,{omit:["_evaluate"]});for(let t in Va)Va[t]._classRegistryKey||$(`Expression_${t}`,Va[t]);function Vy(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor?.name==="ArrayBuffer")}function wd(t){let e=t.constructor;return t.$name||e._classRegistryKey}function IT(t){if(typeof t!="object"||!t)return!1;let e=wd(t);return e&&e!=="Object"}function jy(t){return!IT(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Vy(t)||Or(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Wn(t,e){if(jy(t))return(Vy(t)||Or(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let n=[];for(let s of t)n.push(Wn(s,e));return n}if(typeof t!="object")throw Error(`can't serialize object of type ${typeof t}`);let i=wd(t);if(!i)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!or[i])throw Error(`${i} is not registered.`);let{klass:r}=or[i],a=r.serialize?r.serialize(t,e):{};if(r.serialize){if(a===e?.[e.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let n in t){if(!t.hasOwnProperty(n)||or[i].omit.includes(n))continue;let s=t[n];s!==void 0&&(a[n]=or[i].shallow.includes(n)?s:Wn(s,e))}t instanceof Error&&(a.message=t.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(a.$name=i),a}function Hn(t){if(jy(t))return t;if(Array.isArray(t))return t.map(Hn);if(typeof t!="object")throw Error(`can't deserialize object of type ${typeof t}`);let e=wd(t)||"Object";if(!or[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:i}=or[e];if(!i)throw Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);let r=Object.create(i.prototype);for(let a of Object.keys(t)){if(a==="$name")continue;let n=t[a];r[a]=or[e].shallow.includes(a)?n:Hn(n)}return r}var Ko=class{constructor(){this.first=!0}update(t,e){let i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}},Ct=class{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new Ko,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ko,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}},Bl=class{constructor(t,e,i,r){this.property=t,this.value=e,this.expression=tT(e===void 0?t.specification.default:e,i,t.specification,r)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}},Uh=class{constructor(t,e,i){this.property=t,this.value=new Bl(t,void 0,e,i)}transitioned(t,e){return e.value===this.value?e:new vm(this.property,this.value,e,q({},t.transition,this.transition),t.now)}untransitioned(){return new vm(this.property,this.value,null,{},0)}},Ds=class{constructor(t,e,i){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=i,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return Ue(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new Uh(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Bl(this._values[t].property,e===null?void 0:Ue(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let i=t[e];e.endsWith("-transition")?this.setTransition(e.slice(0,-11),i):wi(this._values[e].value.value,i)||this.setValue(e,i)}}getTransition(t){return Ue(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new Uh(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=Ue(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let i=this.getValue(e);i!==void 0&&(t[e]=i);let r=this.getTransition(e);r!==void 0&&(t[`${e}-transition`]=r)}return t}transitioned(t,e){let i=new xm(this._properties);for(let r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){let t=new xm(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},vm=class{constructor(t,e,i,r,a){this.property=t,this.value=e,this.begin=a+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){let r=t.now||0,a=this.value.possiblyEvaluate(t,e,i),n=this.prior;if(!n)return a;if(r>this.end||this.value.isDataDriven())return this.prior=null,a;if(r<this.begin)return n.possiblyEvaluate(t,e,i);{let s=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t,e,i),a,T2(s))}}},xm=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){let r=new Ol(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].possiblyEvaluate(t,e,i);return r}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},AT=class{constructor(t,e,i){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=i,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return Ue(this._values[t].value)}setValue(t,e){this._values[t]=new Bl(this._values[t].property,e===null?void 0:Ue(e),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let e of Object.keys(this._values)){let i=this.getValue(e);i!==void 0&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){let r=new Ol(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].possiblyEvaluate(t,e,i);return r}},vi=class{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}},Ol=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function bm(t){if(Array.isArray(t))return t.length;let e=t?.values;return Array.isArray(e)?e.length:void 0}function Uy(t,e){let i=bm(t),r=bm(e);return i!==void 0&&r!==void 0&&i!==r}var j=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e){if(t.isDataDriven())throw Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){if(Uy(t,e))return ft(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let r=this.specification.type,a=Zt[r];return a?a(t,e,i):t}},tt=class{constructor(t,e,i){this.specification=t,this.name=e,this.overrides=i}possiblyEvaluate(t,e,i,r){return t.expression.kind==="constant"||t.expression.kind==="camera"?new vi(this,{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)},e):new vi(this,t.expression,e)}interpolate(t,e,i){if(t.value.kind!=="constant"||e.value.kind!=="constant")return t;if(t.value.value===void 0||e.value.value===void 0)return new vi(this,{kind:"constant",value:void 0},t.parameters);if(Uy(t.value.value,e.value.value))return ft(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let r=this.specification.type,a=Zt[r];if(a){let n=a(t.value.value,e.value.value,i);return new vi(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,r,a,n){return t.kind==="constant"?t.value:t.evaluate(e,i,r,a,n)}},rs=class extends tt{possiblyEvaluate(t,e,i,r){if(t.value===void 0)return new vi(this,{kind:"constant",value:void 0},e);if(t.expression.kind==="constant"){let a=t.expression.evaluate(e,null,{},i,r),n=t.property.specification.type==="resolvedImage"&&typeof a!="string"?a.name:a,s=this._calculate(n,n,n,e);return new vi(this,{kind:"constant",value:s},e)}if(t.expression.kind==="camera"){let a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new vi(this,{kind:"constant",value:a},e)}return new vi(this,t.expression,e)}evaluate(t,e,i,r,a,n){if(t.kind==="source"){let s=t.evaluate(e,i,r,a,n);return this._calculate(s,s,s,e)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}},Ny=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,i,r){if(t.value!==void 0){if(t.expression.kind==="constant"){let a=t.expression.evaluate(e,null,{},i,r);return this._calculate(a,a,a,e)}return this._calculate(t.expression.evaluate(new Ct(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ct(Math.floor(e.zoom),e)),t.expression.evaluate(new Ct(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}},Vl=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return!1}},ge=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let i=t[e];i.specification.overridable&&this.overridableProperties.push(e);let r=this.defaultPropertyValues[e]=new Bl(i,void 0,i.name,void 0),a=this.defaultTransitionablePropertyValues[e]=new Uh(i,i.name,void 0);this.defaultTransitioningPropertyValues[e]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}};$("DataDrivenProperty",tt),$("DataConstantProperty",j),$("CrossFadedDataDrivenProperty",rs),$("CrossFadedProperty",Ny),$("ColorRampProperty",Vl);var wm=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",yh=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",Li=class extends ce{constructor(t,e,i){if(super(),this.id=t.id,this.type=t.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=PT(this.visibility,`layers[${this.id}].layout.visibility`,i),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=Ka(t.filter,`layers[${this.id}].filter`,i)),e.layout&&(this._unevaluatedLayout=new AT(e.layout,`layers[${this.id}].layout`,i)),e.paint)){this._transitionablePaint=new Ds(e.paint,`layers[${this.id}].paint`,i);for(let r in t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(let r in t.layout)this.setLayoutProperty(r,t.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ol(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=Ka(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t==="visibility")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+wm);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let i=this._unevaluatedLayout._values[e];for(let r of i.getGlobalStateRefs())t.add(r)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let e in this._transitionablePaint._values){let i=this._transitionablePaint._values[e].value;for(let r of i.getGlobalStateRefs()){let a=t.get(r)??[];a.push({name:e,value:i.value}),t.set(r,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,i={}){if(t==="visibility"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if(this._transitionablePaint?.hasProperty(t)){this.fire(new J(Error(t+wm)));return}e!=null&&this._validate($e.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,i)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){if(t.endsWith("-transition")){let e=t.slice(0,-11);if(e==="visibility"||this._unevaluatedLayout?.hasProperty(e))throw Error(t+yh);return this._transitionablePaint.getTransition(e)}if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+yh);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(t==="visibility"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new J(Error(t+yh))),!1;
vendor: 5,511 bytes, line 822
822if(e!=null&&this._validate($e.paintProperty,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let r=this._transitionablePaint._values[t],a=r.property.specification["property-type"]==="cross-faded-data-driven",n=r.value.isDataDriven(),s=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||n||a||this._handleOverridablePaintPropertyUpdate(t,s,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){let t={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?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),Xc(t,(e,i)=>e!==void 0&&!(i==="layout"&&!Object.keys(e).length)&&!(i==="paint"&&!Object.keys(e).length))}_validate(t,e,i,r,a={}){return on(this,t,{key:e,layerType:this.type,objectKey:i,value:r},a)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof vi&&Xa(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},Tm,MT=()=>Tm||(Tm=new ge({"raster-opacity":new j(F.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new j(F.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new j(F.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new j(F.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new j(F.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new j(F.paint_raster["raster-contrast"],"raster-contrast"),resampling:new j(F.paint_raster.resampling,"resampling"),"raster-resampling":new j(F.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new j(F.paint_raster["raster-fade-duration"],"raster-fade-duration")})),FT={get paint(){return MT()}},jl=t=>t.type==="raster",zT=class extends Li{constructor(t,e){super(t,FT,e)}},RT={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ps=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Jt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function Yt(t,e=1){let i=0,r=0;return{members:t.map(a=>{let n=kT(a.type),s=i=Em(i,Math.max(e,n)),o=a.components||1;return r=Math.max(r,n),i+=n*o,{name:a.name,type:a.type,components:o,offset:s}}),size:Em(i,Math.max(r,e)),alignment:e}}function kT(t){return RT[t].BYTES_PER_ELEMENT}function Em(t,e){return Math.ceil(t/e)*e}var as=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){let r=t*2;return this.int16[r+0]=e,this.int16[r+1]=i,t}};as.prototype.bytesPerElement=4,$("StructArrayLayout2i4",as);var Jo=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){let a=t*3;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=r,t}};Jo.prototype.bytesPerElement=6,$("StructArrayLayout3i6",Jo);var Nh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}
vendor: 18,651 bytes, line 822
822emplaceBack(t,e,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r)}emplace(t,e,i,r,a){let n=t*4;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,this.int16[n+3]=a,t}};Nh.prototype.bytesPerElement=8,$("StructArrayLayout4i8",Nh);var $h=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r,a,n)}emplace(t,e,i,r,a,n,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=a,this.int16[o+4]=n,this.int16[o+5]=s,t}};$h.prototype.bytesPerElement=12,$("StructArrayLayout2i4i12",$h);var Gh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r,a,n)}emplace(t,e,i,r,a,n,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=a,this.uint8[l+6]=n,this.uint8[l+7]=s,t}};Gh.prototype.bytesPerElement=8,$("StructArrayLayout2i4ub8",Gh);var ns=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){let r=t*2;return this.float32[r+0]=e,this.float32[r+1]=i,t}};ns.prototype.bytesPerElement=8,$("StructArrayLayout2f8",ns);var Zh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,a,n,s,o,l,u)}emplace(t,e,i,r,a,n,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=a,this.uint16[c+4]=n,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};Zh.prototype.bytesPerElement=20,$("StructArrayLayout10ui20",Zh);var qh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,r,a,n,s,o)}emplace(t,e,i,r,a,n,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=a,this.uint16[u+4]=n,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};qh.prototype.bytesPerElement=16,$("StructArrayLayout8ui16",qh);var Wh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n,s,o,l,u,h,c,d){let p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,r,a,n,s,o,l,u,h,c,d)}emplace(t,e,i,r,a,n,s,o,l,u,h,c,d,p){let f=t*14,m=t*7;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=a,this.uint16[f+4]=n,this.uint16[f+5]=s,this.uint16[f+6]=o,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=h,this.int16[f+10]=c,this.int16[f+11]=d,this.float32[m+6]=p,t}};Wh.prototype.bytesPerElement=28,$("StructArrayLayout4i4ui4i1f28",Wh);var Hh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){let a=t*3;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,t}};Hh.prototype.bytesPerElement=12,$("StructArrayLayout3f12",Hh);var Xh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let i=t*1;return this.uint32[i+0]=e,t}};Xh.prototype.bytesPerElement=4,$("StructArrayLayout1ul4",Xh);var Yh=class extends Jt{_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(t,e,i,r,a,n,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,r,a,n,s,o,l)}emplace(t,e,i,r,a,n,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=i,this.int16[h+2]=r,this.int16[h+3]=a,this.int16[h+4]=n,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};Yh.prototype.bytesPerElement=20,$("StructArrayLayout6i1ul2ui20",Yh);var Kh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r,a,n)}emplace(t,e,i,r,a,n,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=a,this.int16[o+4]=n,this.int16[o+5]=s,t}};Kh.prototype.bytesPerElement=12,$("StructArrayLayout2i2i2i12",Kh);var Jh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r,a)}emplace(t,e,i,r,a,n){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=r,this.int16[o+6]=a,this.int16[o+7]=n,t}};Jh.prototype.bytesPerElement=16,$("StructArrayLayout2f1f2i16",Jh);var Qh=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,a,n){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r,a,n)}emplace(t,e,i,r,a,n,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[l+1]=r,this.float32[l+2]=a,this.int16[u+6]=n,this.int16[u+7]=s,t}};Qh.prototype.bytesPerElement=16,$("StructArrayLayout2ub2f2i16",Qh);var Qo=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){let a=t*3;return this.uint16[a+0]=e,this.uint16[a+1]=i,this.uint16[a+2]=r,t}};Qo.prototype.bytesPerElement=6,$("StructArrayLayout3ui6",Qo);var tc=class extends Jt{_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(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_){let y=this.length;return this.resize(y+1),this.emplace(y,t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_)}emplace(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y){let x=t*26,v=t*13,w=t*52;return this.int16[x+0]=e,this.int16[x+1]=i,this.uint16[x+2]=r,this.uint16[x+3]=a,this.uint32[v+2]=n,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=h,this.float32[v+7]=c,this.float32[v+8]=d,this.uint8[w+36]=p,this.uint8[w+37]=f,this.uint8[w+38]=m,this.uint32[v+10]=g,this.int16[x+22]=_,this.float32[v+12]=y,t}};tc.prototype.bytesPerElement=52,$("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",tc);var ec=class extends Jt{_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(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y,x,v,w,b,T,D,E,M,R,z){let P=this.length;return this.resize(P+1),this.emplace(P,t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y,x,v,w,b,T,D,E,M,R,z)}emplace(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y,x,v,w,b,T,D,E,M,R,z,P){let S=t*34,I=t*17;return this.int16[S+0]=e,this.int16[S+1]=i,this.int16[S+2]=r,this.int16[S+3]=a,this.int16[S+4]=n,this.int16[S+5]=s,this.int16[S+6]=o,this.int16[S+7]=l,this.uint16[S+8]=u,this.uint16[S+9]=h,this.uint16[S+10]=c,this.uint16[S+11]=d,this.uint16[S+12]=p,this.uint16[S+13]=f,this.uint16[S+14]=m,this.uint16[S+15]=g,this.uint16[S+16]=_,this.uint16[S+17]=y,this.uint16[S+18]=x,this.uint16[S+19]=v,this.uint16[S+20]=w,this.uint16[S+21]=b,this.uint16[S+22]=T,this.uint32[I+12]=D,this.float32[I+13]=E,this.float32[I+14]=M,this.uint16[S+30]=R,this.uint16[S+31]=z,this.float32[I+16]=P,t}};ec.prototype.bytesPerElement=68,$("StructArrayLayout8i15ui1ul2f2ui1f68",ec);var tl=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let i=t*1;return this.float32[i+0]=e,t}};tl.prototype.bytesPerElement=4,$("StructArrayLayout1f4",tl);var ic=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){let a=t*6,n=t*3;return this.uint16[a+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}};ic.prototype.bytesPerElement=12,$("StructArrayLayout1ui2f12",ic);var rc=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){let r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){let a=t*2,n=t*4;return this.uint32[a+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t}};rc.prototype.bytesPerElement=8,$("StructArrayLayout1ul2ui8",rc);var ac=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){let r=t*2;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}};ac.prototype.bytesPerElement=4,$("StructArrayLayout2ui4",ac);var nc=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let i=t*1;return this.uint16[i+0]=e,t}};nc.prototype.bytesPerElement=2,$("StructArrayLayout1ui2",nc);var sc=class extends Jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r)}emplace(t,e,i,r,a){let n=t*4;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,this.float32[n+3]=a,t}};sc.prototype.bytesPerElement=16,$("StructArrayLayout4f16",sc);var $y=class extends Ps{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 C(this.anchorPointX,this.anchorPointY)}};$y.prototype.size=20;var Td=class extends Yh{get(t){return new $y(this,t)}};$("CollisionBoxArray",Td);var Gy=class extends Ps{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Gy.prototype.size=52;var Zy=class extends tc{get(t){return new Gy(this,t)}};$("PlacedSymbolArray",Zy);var qy=class extends Ps{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(t){this._structArray.uint32[this._pos4+12]=t}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]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};qy.prototype.size=68;var Wy=class extends ec{get(t){return new qy(this,t)}};$("SymbolInstanceArray",Wy);var Hy=class extends tl{getoffsetX(t){return this.float32[t*1+0]}};$("GlyphOffsetArray",Hy);var Xy=class extends Jo{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};$("SymbolLineVertexArray",Xy);var Yy=class extends Ps{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]}};Yy.prototype.size=12;var Ky=class extends ic{get(t){return new Yy(this,t)}};$("TextAnchorOffsetArray",Ky);var Jy=class extends Ps{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]}};Jy.prototype.size=8;var Qy=class extends rc{get(t){return new Jy(this,t)}};$("FeatureIndexArray",Qy);var gr=class extends as{},t0=class extends Jo{},e0=class extends Nh{},LT=class extends as{},BT=class extends as{},OT=class extends $h{},VT=class extends Gh{},jT=class extends ns{},Ia=class extends Zh{},Sm=class extends qh{},UT=class extends Wh{},NT=class extends Hh{},$T=class extends Xh{},Dm=class extends Kh{},i0=class extends Jh{},GT=class extends Qh{},r0=class extends Qo{},Bi=class extends Qo{},oc=class extends ac{},a0=class extends nc{},lc=Yt([{name:"a_pos",components:2,type:"Int16"}],4),ZT=lc.members;lc.size,lc.alignment;var qt=class Ra{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,i,r,a){let n=this.segments[this.segments.length-1];return e>Ra.MAX_VERTEX_ARRAY_LENGTH&&ft(`Max vertices per segment is ${Ra.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Ra.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!n||n.vertexLength+e>Ra.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==a?this.createNewSegment(i,r,a):n}createNewSegment(e,i,r){let a={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0,vaos:{}};return r!==void 0&&(a.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(a),a}getOrCreateLatestSegment(e,i,r){return this.prepareSegment(0,e,i,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let i in e.vaos)e.vaos[i].destroy()}static simpleSegment(e,i,r,a){return new Ra([{vertexOffset:e,primitiveOffset:i,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}};qt.MAX_VERTEX_ARRAY_LENGTH=2**16-1,$("SegmentVector",qt);function Pm(t,e){return t=st(Math.floor(t),0,255),e=st(Math.floor(e),0,255),256*t+e}var qT=Yt([{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"}]),WT=Yt([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),HT=Vc(((t,e)=>{function i(r,a){for(var n=r.length&3,s=r.length-n,o=a,l,u=3432918353,h=461845907,c,d=0;d<s;)c=r.charCodeAt(d)&255|(r.charCodeAt(++d)&255)<<8|(r.charCodeAt(++d)&255)<<16|(r.charCodeAt(++d)&255)<<24,++d,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>
vendor: 5,798 bytes, line 822
82219,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,n){case 3:c^=(r.charCodeAt(d+2)&255)<<16;case 2:c^=(r.charCodeAt(d+1)&255)<<8;case 1:c^=r.charCodeAt(d)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=r.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=i)})),XT=Vc(((t,e)=>{function i(r,a){for(var n=r.length,s=a^n,o=0,l;n>=4;)l=r.charCodeAt(o)&255|(r.charCodeAt(++o)&255)<<8|(r.charCodeAt(++o)&255)<<16|(r.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,n-=4,++o;switch(n){case 3:s^=(r.charCodeAt(o+2)&255)<<16;case 2:s^=(r.charCodeAt(o+1)&255)<<8;case 1:s^=r.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=i})),uc=u2(Vc(((t,e)=>{var i=HT(),r=XT();e.exports=i,e.exports.murmur3=i,e.exports.murmur2=r}))(),1),n0=class s0{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,i,r,a){this.ids.push(Cm(e)),this.positions.push(i,r,a)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let i=Cm(e),r=0,a=this.ids.length-1;for(;r<a;){let s=r+a>>1;this.ids[s]>=i?a=s:r=s+1}let n=[];for(;this.ids[r]===i;){let s=this.positions[3*r],o=this.positions[3*r+1],l=this.positions[3*r+2];n.push({index:s,start:o,end:l}),r++}return n}static serialize(e,i){let r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return hc(r,a,0,r.length-1),i&&i.push(r.buffer,a.buffer),{ids:r,positions:a}}static deserialize(e){let i=new s0;return i.ids=e.ids,i.positions=e.positions,i.indexed=!0,i}};function Cm(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,uc.default)(String(t))}function hc(t,e,i,r){for(;i<r;){let a=t[i+r>>1],n=i-1,s=r+1;for(;;){do n++;while(t[n]<a);do s--;while(t[s]>a);if(n>=s)break;Do(t,n,s),Do(e,3*n,3*s),Do(e,3*n+1,3*s+1),Do(e,3*n+2,3*s+2)}s-i<r-s?(hc(t,e,i,s),i=s+1):(hc(t,e,s+1,r),r=s)}}function Do(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}$("FeaturePositionMap",n0);var _r=class{constructor(t,e){this.gl=t.gl,this.location=e}},K=class extends _r{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},N=class extends _r{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}},dt=class extends _r{constructor(t,e){super(t,e),this.current=[0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1])&&(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},Oe=class extends _r{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2])&&(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},ln=class extends _r{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},yr=class extends _r{constructor(t,e){super(t,e),this.current=lt.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}},Ed=class extends _r{constructor(t,e){super(t,e),this.current=[]}set(t){if(t!=this.current){this.current=t;let e=new Float32Array(t.length*4);for(let i=0;i<t.length;i++)e[4*i]=t[i].r,e[4*i+1]=t[i].g,e[4*i+2]=t[i].b,e[4*i+3]=t[i].a;this.gl.uniform4fv(this.location,e)}}},Sd=class extends _r{constructor(t,e){super(t,e),this.current=[]}set(t){if(t!=this.current){this.current=t;let e=new Float32Array(t);this.gl.uniform1fv(this.location,e)}}},YT=new Float32Array(16),Si=class extends _r{constructor(t,e){super(t,e),this.current=YT}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);return}for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}};function cc(t){return[Pm(255*t.r,255*t.g),Pm(255*t.b,255*t.a)]}var jn=class{constructor(t,e,i){this.value=t,this.uniformNames=e.map(r=>`u_${r}`),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return this.type==="color"?new yr(t,e):new N(t,e)}},Hr=class{constructor(t,e){this.uniformNames=e.map(i=>`u_${i}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,i,r){let a=null;r==="u_pattern_to"?a=this.patternTo:r==="u_pattern_from"?a=this.patternFrom:r==="u_dasharray_to"?a=this.dashTo:r==="u_dasharray_from"?a=this.dashFrom:r==="u_pixel_ratio_to"?a=this.pixelRatioTo:r==="u_pixel_ratio_from"&&(a=this.pixelRatioFrom),a!==null&&t.set(a)}getBinding(t,e,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new ln(t,e):new N(t,e)}},nr=class{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map(a=>({name:`a_${a}`,type:"Float32",components:i==="color"?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(t,e,i){let r=this.paintVertexArray.length,a=this.expression.evaluate(new Ct
vendor: 15,280 bytes, line 822
822(0,i),e,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(r,t,a)}updatePaintArray(t,e,i,r,a){let n=this.expression.evaluate(new Ct(0,a),i,r);this._setPaintValue(t,e,n)}_setPaintValue(t,e,i){if(this.type==="color"){let r=cc(i);for(let a=t;a<e;a++)this.paintVertexArray.emplace(a,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Ai=class{constructor(t,e,i,r,a,n){this.expression=t,this.uniformNames=e.map(s=>`u_${s}_t`),this.type=i,this.useIntegerZoom=r,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:i==="color"?4:2,offset:0})),this.paintVertexArray=new n}populatePaintArray(t,e,i){let r=this.expression.evaluate(new Ct(this.zoom,i),e,{},i.canonical,[],i.formattedSection),a=this.expression.evaluate(new Ct(this.zoom+1,i),e,{},i.canonical,[],i.formattedSection),n=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(n,t,r,a)}updatePaintArray(t,e,i,r,a){let n=this.expression.evaluate(new Ct(this.zoom,a),i,r),s=this.expression.evaluate(new Ct(this.zoom+1,a),i,r);this._setPaintValue(t,e,n,s)}_setPaintValue(t,e,i,r){if(this.type==="color"){let a=cc(i),n=cc(r);for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,a[0],a[1],n[0],n[1])}else{for(let a=t;a<e;a++)this.paintVertexArray.emplace(a,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=st(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new N(t,e)}},Dr=class{constructor(t,e,i,r,a,n){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=n,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}populatePaintArray(t,e,i){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,this.getPositionIds(e),i)}updatePaintArray(t,e,i,r,a){this._setPaintValues(t,e,this.getPositionIds(i),a)}_setPaintValues(t,e,i,r){let a=this.getPositions(r);if(!a||!i)return;let n=a[i.min],s=a[i.mid],o=a[i.max];if(n&&s&&o)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,n,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},o0=class extends Dr{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return qT.members}emplace(t,e,i,r){t.emplace(e,i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.pixelRatio,r.pixelRatio)}},l0=class extends Dr{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return WT.members}emplace(t,e,i,r){t.emplace(e,0,i.y,i.height,i.width,0,r.y,r.height,r.width)}},u0=class{constructor(t,e,i){this.binders={},this._buffers=[];let r=[];for(let a in t.paint._values){if(!i(a))continue;let n=t.paint.get(a);if(!(n instanceof vi)||!Xa(n.property.specification))continue;let s=KT(a,t.type),o=n.value,l=n.property.specification.type,u=n.property.useIntegerZoom,h=n.property.specification["property-type"],c=h==="cross-faded"||h==="cross-faded-data-driven";if(o.kind==="constant")this.binders[a]=c?new Hr(o.value,s):new jn(o.value,s,l),r.push(`/u_${a}`);else if(o.kind==="source"||c){let d=Im(a,l,"source");this.binders[a]=c?a==="line-dasharray"?new l0(o,l,u,e,d,t.id):new o0(o,l,u,e,d,t.id):new nr(o,s,l,d),r.push(`/a_${a}`)}else{let d=Im(a,l,"composite");this.binders[a]=new Ai(o,s,l,u,e,d),r.push(`/z_${a}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){let e=this.binders[t];return e instanceof nr||e instanceof Ai?e.maxValue:0}populatePaintArrays(t,e,i){for(let r in this.binders){let a=this.binders[r];(a instanceof nr||a instanceof Ai||a instanceof Dr)&&a.populatePaintArray(t,e,i)}}setConstantPatternPositions(t,e){for(let i in this.binders){let r=this.binders[i];r instanceof Hr&&r.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(let i in this.binders){let r=this.binders[i];r instanceof Hr&&r.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,i,r,a){let n=!1;for(let s of t){let o=e.getPositions(s.id);for(let l of o){let u=i.feature(l.index);for(let h in this.binders){let c=this.binders[h];(c instanceof nr||c instanceof Ai||c instanceof Dr)&&c.expression.isStateDependent===!0&&(c.expression=r.paint.get(h).value,c.updatePaintArray(l.start,l.end,u,s.state,a),n=!0)}}}return n}defines(){let t=[];for(let e in this.binders){let i=this.binders[e];(i instanceof jn||i instanceof Hr)&&t.push(...i.uniformNames.map(r=>`#define HAS_UNIFORM_${r}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let i=this.binders[e];if(i instanceof nr||i instanceof Ai)for(let r of i.paintVertexAttributes)t.push(r.name);else if(i instanceof Dr){let r=i.getVertexAttributes();for(let a of r)t.push(a.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let i=this.binders[e];if(i instanceof jn||i instanceof Hr||i instanceof Ai)for(let r of i.uniformNames)t.push(r)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let i=[];for(let r in this.binders){let a=this.binders[r];if(a instanceof jn||a instanceof Hr||a instanceof Ai){for(let n of a.uniformNames)if(e[n]){let s=a.getBinding(t,e[n],n);i.push({name:n,property:r,binding:s})}}}return i}setUniforms(t,e,i,r){for(let{name:a,property:n,binding:s}of e)this.binders[n].setUniform(s,r,i.get(n),a)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let i=this.binders[e];if(t&&i instanceof Dr){let r=t.fromScale===2?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(i instanceof nr||i instanceof Ai)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(let e in this.binders){let i=this.binders[e];(i instanceof nr||i instanceof Ai||i instanceof Dr)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof nr||e instanceof Ai||e instanceof Dr)&&e.destroy()}}},ra=class{constructor(t,e,i=()=>!0){this.programConfigurations={};for(let r of t)this.programConfigurations[r.id]=new u0(r,e,i);this.needsUpload=!1,this._featureMap=new n0,this._bufferOffset=0}populatePaintArrays(t,e,i,r){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r);e.id!==void 0&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,r){for(let a of i)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function KT(t,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-dasharray":["dasharray_to","dasharray_from"],"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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function JT(t){return{"line-pattern":{source:Ia,composite:Ia},"fill-pattern":{source:Ia,composite:Ia},"fill-extrusion-pattern":{source:Ia,composite:Ia},"line-dasharray":{source:Sm,composite:Sm}}[t]}function Im(t,e,i){let r={color:{source:ns,composite:sc},number:{source:tl,composite:ns}};return JT(t)?.[i]||r[e][i]}$("ConstantBinder",jn),$("CrossFadedConstantBinder",Hr),$("SourceExpressionBinder",nr),$("CrossFadedPatternBinder",o0),$("CrossFadedDasharrayBinder",l0),$("CompositeExpressionBinder",Ai),$("ProgramConfiguration",u0,{omit:["_buffers"]}),$("ProgramConfigurationSet",ra);var dc=2**14-1,Am=-dc-1;function ha(t){let e=k/t.extent,i=t.loadGeometry();for(let r of i)for(let a of r){let n=Math.round(a.x*e),s=Math.round(a.y*e);a.x=st(n,Am,dc),a.y=st(s,Am,dc),(n<a.x||n>a.x+1||s<a.y||s>a.y+1)&&ft("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Vr(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ha(t):[]}}var Mm=-32768;function QT(t,e,i,r,a){t.emplaceBack(Mm+e*8+r,Mm+i*8+a)}var Dd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new LT,this.indexArray=new Bi,this.segments=new qt,this.programConfigurations=new ra(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,i){let r=this.layers[0],a=[],n=null,s=!1,o=r.type==="heatmap";if(r.type==="circle"){let c=r;n=c.layout.get("circle-sort-key"),s=!n.isConstant(),o||(o=c.paint.get("circle-pitch-alignment")==="map")}let l=o?e.subdivisionGranularity.circle:1,u=new Ct(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:d,index:p,sourceLayerIndex:f}of t){let m=Vr(c,h);if(!this.layers[0]._featureFilter.filter(u,m,i))continue;let g=s?n.evaluate(m,{},i):void 0,_={id:d,properties:c.properties,type:c.type,sourceLayerIndex:f,index:p,geometry:h?m.geometry:ha(c),patterns:{},sortKey:g};a.push(_)}s&&a.sort((c,d)=>c.sortKey-d.sortKey);for(let c of a){let{geometry:d,index:p,sourceLayerIndex:f}=c,m=t[p].feature;this.addFeature(c,d,p,i,l),e.featureIndex.insert(m,d,p,f,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ZT),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r,a=1){let n;switch(a){case 1:n=[0,7];break;case 3:n=[0,2,5,7];break;case 5:n=[0,1,3,4,6,7];break;case 7:n=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let s=n.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),d=c.vertexLength;for(let p=0;p<s;p++)for(let f=0;f<s;f++)QT(this.layoutVertexArray,u,h,n[f],n[p]);for(let p=0;p<s-1;p++)for(let f=0;f<s-1;f++){let m=d+p*s+f,g=d+(p+1)*s+f;this.indexArray.emplaceBack(m,g+1,m+1),this.indexArray.emplaceBack(m,g,g+1)}c.vertexLength+=s*s,c.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:{},canonical:r})}};$("CircleBucket",Dd,{omit:["layers"]});function Pd(t,e){for(let i of t)if(Qa(e,i))return!0;for(let i of e)if(Qa(t,i))return!0;return Cd(t,e)}function Ul(t,e,i){return Qa(t,e)?!0:pc(e,t,i)}function h0(t,e){if(t.length===1)return Fm(e,t[0]);for(let i of e)for(let r of i)if(Qa(t,r))return!0;for(let i of t)if(Fm(e,i))return!0;for(let i of e)if(Cd(t,i))return!0;return!1}function tE(t,e,i){for(let r of e){if(t.length>=3){for(let a of r)if(Qa(t,a))return!0}if(eE(t,r,i))return!0}return!1}function eE(t,e,i){if(t.length>1){if(Cd(t,e))return!0;for(let r of e)if(pc(r,t,i))return!0}for(let r of t)if(pc(r,e,i))return!0;return!1}function Cd(t,e){if(t.length===0||e.length===0)return!1;for(let i=0;i<t.length-1;i++){let r=t[i],a=t[i+1];for(let n=0;n<e.length-1;n++){let s=e[n],o=e[n+1];if(iE(r,a,s,o))return!0}}return!1}function iE(t,e,i,r){return Ir(t,i,r)!==Ir(e,i,r)&&Ir(t,e,i)!==Ir(t,e,r)}function pc(t,e,i){let r=i*i;if(e.length===1)return t.distSqr(e[0])<r;for(let a=1;a<e.length;a++){let n=e[a-1],s=e[a];if(c0(t,n,s)<r)return!0}return!1}function c0(t,e,i){let r=e.distSqr(i);if(r===0)return t.distSqr(e);let a=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return a<0?t.distSqr(e):a>1?t.distSqr(i):t.distSqr(i.sub(e)._mult(a)._add(e))}function Fm(t,e){let i=!1,r,a,n;for(let s of t){r=s;for(let o=0,l=r.length-1;o<r.length;l=o++)a=r[o],n=r[l],a.y>e.y!=n.y>e.y&&e.x<(n.x-a.x)*(e.y-a.y)/(n.y-a.y)+a.x&&(i=!i)}return i}function Qa(t,e){let i=!1;for(let r=0,a=t.length-1;r<t.length;a=r++){let n=t[r],s=t[a];n.y>e.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(i=!i)}return i}function rE(t,e,i,r,a){for(let s of t)if(e<=s.x&&i<=s.y&&r>=s.x&&a>=s.y)return!0;let n=[new C(e,i),new C(e,a),new C(r,a),new C(r,i)];if(t.length>2){for(let s of n)if(Qa(t,s))return!0}for(let s=0;s<t.length-1;s++){let o=t[s],l=t[s+1];if(aE(o,l,n))return!0}return!1}function aE(t,e,i){let r=i[0],a=i[2];if(t.x<r.x&&e.x<r.x||t.x>a.x&&e.x>a.x||t.y<r.y&&e.y<r.y||t.y>a.y&&e.y>a.y)return!1;let n=Ir(t,e,i[0]);return n!==Ir(t,e,i[1])||n!==Ir(t,e,i[2])||n!==Ir(t,e,i[3])}function ja(t,e,i){let r=e.paint.get(t).value;return r.kind==="constant"?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Nl(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function $l(t,e,i,r,a){if(!e[0]&&!e[1])return t;let n=C.convert(e)._mult(a);i==="viewport"&&n._rotate(-r);let s=[];for(let o of t)s.push(o.sub(n));return s}function nE(t){let e=[];for(let i=0;i<t.length;i++){let r=t[i],a=e.at(-1);(i===0||a&&!r.equals(a))&&e.push(r)}return e}function sE(t,e){let i=[];for(let r of t){let a=nE(r),n=[];for(let s=0;s<a.length;s++){let o=a[s],l=a[s-1],u=a[s+1],h=s===0?new C(0,0):o.sub(l)._unit()._perp(),c=s===a.length-1?new C(0,0):u.sub(o
vendor: 4,942 bytes, line 822
822)._unit()._perp(),d=h._add(c)._unit(),p=d.x*c.x+d.y*c.y;p!==0&&d._mult(1/p),n.push(d._mult(e)._add(o))}i.push(n)}return i}function oE({queryGeometry:t,size:e},i){return Ul(t,i,e)}function lE({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:a},n){return Ul(t,n,e*(i.projectTileCoordinates(n.x,n.y,r,a?.(n.x,n.y)).signedDistanceFromCamera/i.cameraToCenterDistance))}function uE({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:a},n){let s=i.projectTileCoordinates(n.x,n.y,r,a?.(n.x,n.y)).signedDistanceFromCamera,o=e*(i.cameraToCenterDistance/s);return Ul(t,Id(n,i,r,a),o)}function hE({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:a},n){return Ul(t,Id(n,i,r,a),e)}function d0({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:a,pitchAlignment:n="map",pitchScale:s="map"},o){let l=n==="map"?s==="map"?oE:lE:s==="map"?uE:hE,u={queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:a};for(let h of o)for(let c of h)if(l(u,c))return!0;return!1}function Id(t,e,i,r){let a=e.projectTileCoordinates(t.x,t.y,i,r?.(t.x,t.y)).point;return new C((a.x*.5+.5)*e.width,(-a.y*.5+.5)*e.height)}function cE(t,e,i,r){return t.map(a=>Id(a,e,i,r))}var zm,dE=()=>zm||(zm=new ge({"circle-sort-key":new tt(F.layout_circle["circle-sort-key"],"circle-sort-key")})),Rm,pE=()=>Rm||(Rm=new ge({"circle-radius":new tt(F.paint_circle["circle-radius"],"circle-radius"),"circle-color":new tt(F.paint_circle["circle-color"],"circle-color"),"circle-blur":new tt(F.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new tt(F.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new j(F.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new j(F.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new j(F.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new j(F.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new tt(F.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new tt(F.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new tt(F.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),fE={get paint(){return pE()},get layout(){return dE()}},p0=t=>t.type==="circle",mE=class extends Li{constructor(t,e){super(t,fE,e)}createBucket(t){return new Dd(t)}queryRadius(t){let e=t;return ja("circle-radius",this,e)+ja("circle-stroke-width",this,e)+Nl(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,unwrappedTileID:s,getElevation:o}){let l=$l(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,n),u=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),d,p;return c==="map"?(d=l,p=u*n):(d=cE(l,a,s,o),p=u),d0({queryGeometry:d,size:p,transform:a,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},r)}},f0=class extends Dd{};$("HeatmapBucket",f0,{omit:["layers"]});var km,gE=()=>km||(km=new ge({"heatmap-radius":new tt(F.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new tt(F.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new j(F.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Vl(F.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new j(F.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),_E={get paint(){return gE()}};function Ad(t,{width:e,height:i},r,a){if(!a)a=new Uint8Array(e*i*r);else if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*i*r)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${e*i*r}`);return t.width=e,t.height=i,t.data=a,t}function m0(t,{width:e,height:i},r){if(e===t.width&&i===t.height)return;let a=Ad({},{width:e,height:i},r);Md(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},r),t.width=e,t.height=i,t.data=a.data}function Md(t,e,i,r,a,n){if(a.width===0||a.height===0)return e;if(a.width>t.width||a.height>t.height||i.x>t.width-a.width||i.y>t.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||r.x>e.width-a.width||r.y>e.height-a.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<a.height;l++){let u=((i.y+l)*t.width+i.x)*n,h=((r.y+l)*e.width+r.x)*n;for(let c=0;c<a.width*n;c++)o[h+c]=s[u+c]}return e}var Gl=class g0{constructor(e,i){Ad(this,e,1,i)}resize(e){m0(this,e,1)}clone(){return new g0({width:this.width,height:this.height},new Uint8Array(this.data))}
vendor: 10,126 bytes, line 822
822static copy(e,i,r,a,n){Md(e,i,r,a,n,1)}},Ot=class _0{constructor(e,i){Ad(this,e,4,i)}resize(e){m0(this,e,4)}replace(e,i){i?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new _0({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,i,r,a,n){Md(e,i,r,a,n,4)}setPixel(e,i,r){let a=(e*this.width+i)*4;this.data[a+0]=Math.round(r.r*255/r.a),this.data[a+1]=Math.round(r.g*255/r.a),this.data[a+2]=Math.round(r.b*255/r.a),this.data[a+3]=Math.round(r.a*255)}};function vh(t){let e=new Uint8Array(t.length);for(let i=0;i<t.length;i+=4){let r=t[i+3];e[i+0]=Math.round(t[i+0]*r/255),e[i+1]=Math.round(t[i+1]*r/255),e[i+2]=Math.round(t[i+2]*r/255),e[i+3]=r}return e}$("AlphaImage",Gl),$("RGBAImage",Ot);function Fd(t){let e={},i=t.resolution||256,r=t.clips?t.clips.length:1,a=t.image||new Ot({width:i,height:r});if(!S2(i))throw Error(`width is not a power of 2 - ${i}`);let n=(s,o,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);a.setPixel(s/4/i,o/4,u)};if(t.clips)for(let s=0,o=0;s<r;++s,o+=i*4)for(let l=0,u=0;l<i;l++,u+=4){let h=l/(i-1),{start:c,end:d}=t.clips[s],p=c*(1-h)+d*h;n(o,u,p)}else for(let s=0,o=0;s<i;s++,o+=4){let l=s/(i-1);n(0,o,l)}return a}var Cs="big-fb",y0=t=>t.type==="heatmap",yE=class extends Li{createBucket(t){return new f0(t)}constructor(t,e){super(t,_E,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Fd({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Cs)}queryRadius(t){return ja("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,unwrappedTileID:s,getElevation:o}){return d0({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(e,i)*n,transform:a,unwrappedTileID:s,getElevation:o},r)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},Lm,vE=()=>Lm||(Lm=new ge({"hillshade-illumination-direction":new j(F.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new j(F.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new j(F.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new j(F.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new j(F.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new j(F.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new j(F.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new j(F.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new j(F.paint_hillshade.resampling,"resampling")})),xE={get paint(){return vE()}},v0=t=>t.type==="hillshade",bE=class extends Li{constructor(t,e){super(t,xE,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values,a=Math.max(t.length,e.length,i.length,r.length);t=t.concat(Array(a-t.length).fill(t.at(-1))),e=e.concat(Array(a-e.length).fill(e.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1))),r=r.concat(Array(a-r.length).fill(r.at(-1)));let n=e.map(Gt);return{directionRadians:t.map(Gt),altitudeRadians:n,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},Bm,wE=()=>Bm||(Bm=new ge({"color-relief-opacity":new j(F["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Vl(F["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new j(F["paint_color-relief"].resampling,"resampling")})),TE={get paint(){return wE()}};function Po(t){return"data"in t}var he=class{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,r)}update(t,e,i){let{width:r,height:a}=t,n=(this.size?.[0]!==r||this.size[1]!==a)&&!i,{context:s}=this,{gl:o}=s;this.useMipmap=!!e?.useMipmap,n&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&e?.premultiply!==!1;if(n)if(this.size=[r,a],this.format===o.RGBA&&r>0&&a>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(r,a)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,r,a),Po(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:h}=t;l&&h&&(h=vh(h)),h&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,r,a,o.RGBA,o.UNSIGNED_BYTE,h)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Po(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,r,a,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:u,y:h}=i||{x:0,y:0};Po(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,u,h,r,a,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,u,h,o))}this.useMipmap&&!(Po(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,i,r,a){let{data:n}=t;e&&n&&(n=vh(n)),a.texImage2D(a.TEXTURE_2D,0,this.format,i,r,0,this.format,a.UNSIGNED_BYTE,n)}_updateDomImage(t,e,i,r){r.texSubImage2D(r.TEXTURE_2D,0,e,i,r.RGBA,r.UNSIGNED_BYTE,t)}_updateRawData(t,e,i,r,a,n,s){let{data:o}=t;e&&o&&(o=vh(o)),s.texSubImage2D(s.TEXTURE_2D,0,i,r,a,n,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,i){let{context:r}=this,{gl:a}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),(i===a.LINEAR_MIPMAP_NEAREST||i===a.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(i=a.LINEAR);let n=i||t;t!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,t),this.magFilter=t),n!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,n),this.minFilter=n),e!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},lr,EE=(lr=class{constructor(e,i,r,a=1,n=1,s=1,o=0){if(this.uid=e,i.height!==i.width)throw RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r)){ft(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=i.height;let l=this.dim=i.height-4;switch(this.data=new Uint32Array(i.data.buffer),lr.byteViewCache.set(this,new Uint8Array(this.data.buffer)),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=a,this.greenFactor=n,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h<l+2;h++){let c=this._idx(0,Math.max(0,Math.min(l-1,h)));(h<0||h>=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;h<l;h++)for(let c=0;c<l;c++){let d=this._idx(h,c)*4,p=this._unpackAtIndex(u,d);p>this.max&&(this.max=p),p<this.min&&(this.min=p)}}get(e,i){let r=this._getByteView(),a=this._idx(e,i)*4;return this._unpackAtIndex(r,a)}sampleBilinear(e,i){let r=Math.floor(e),a=Math.floor(i);if(r<-1||r>=this.dim||a<-1||a>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);let n=this._getByteView(),s=((a+2)*this.stride+r+2)*4,o=this.stride*4,l=e-r,u=i-a,h=this._unpackAtIndex(n,s),c=this._unpackAtIndex(n,s+4),d=this._unpackAtIndex(n,s+o),p=this._unpackAtIndex(n,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+d*(1-l)*u+p*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,i){if(e<-2||e>=this.dim+2||i<-2||i>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${i}, dim: ${this.dim}`);return(i+2)*this.stride+(e+2)}unpack(e,i,r){return e*this.redFactor+i*this.greenFactor+r*this.blueFactor-this.baseShift}pack(e){return x0(e,this.getUnpackVector())}getPixels(){return new Ot({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,i,r){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let a=i*this.dim,n=i*this.dim+this.dim,s=r*this.dim,o=r*this.dim+this.dim;switch(i){case-1:a=n-2;break;case 1:n=a+2}switch(r){case-1:s=o-2;break;case 1:o=s+2}let l=-i*this.dim,u=-r*this.dim;for(let h=s;h<o;h++)for(let c=a;c<n;c++)this.data[this._idx(c,h)]=e.data[this._idx(c+l,h+u)]}_getByteView(){let e=lr.byteViewCache.get(this);return e?.buffer!==this.data.buffer&&(e=new Uint8Array(this.data.buffer),lr.byteViewCache.set(this,e)),e}_unpackAtIndex(e,i){return this.unpack(e[i],e[i+1],e[i+2])}},lr.byteViewCache=new WeakMap,lr);function x0(t,e){let i=e[0],r=e[1],a=e[2],n=e[3],s=Math.min(i,r,a),o=Math.round((t+n)/s);return{r:Math.floor(o*s/i)%256,g:Math.floor(o*s/r)%256,b:Math.floor(o*s/a)%256}}
vendor: 5,894 bytes, line 822
822$("DEMData",EE);var b0=t=>t.type==="color-relief",SE=class extends Li{constructor(t,e){super(t,TE,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof es&&i._styleExpression.expression instanceof bi){this.colorRampExpression=i;let n=i._styleExpression.expression;e.elevationStops=n.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(n.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[lt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let r={elevationStops:[],colorStops:[]},a=(e.elevationStops.length-1)/(t-1);for(let n=0;n<e.elevationStops.length-.5;n+=a)r.elevationStops.push(e.elevationStops[Math.round(n)]),r.colorStops.push(e.colorStops[Math.round(n)]);return ft(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,e,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let r=this._createColorRamp(e),a=new Ot({width:r.colorStops.length,height:1}),n=new Ot({width:r.colorStops.length,height:1});for(let s=0;s<r.elevationStops.length;s++){let o=x0(r.elevationStops[s],i);n.setPixel(0,s,new lt(o.r/255,o.g/255,o.b/255,1)),a.setPixel(0,s,r.colorStops[s])}return this.colorRampTextures={elevationTexture:new he(t,n,t.gl.RGBA),colorTexture:new he(t,a,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},fc=Yt([{name:"a_pos",components:2,type:"Int16"}],4),DE=fc.members;fc.size,fc.alignment;function el(t,e,i){let r=i.patternDependencies,a=!1;for(let n of e){let s=n.paint.get(`${t}-pattern`);s.isConstant()||(a=!0);let o=s.constantOr(null);o&&(a=!0,r[o.to]=!0,r[o.from]=!0)}return a}function zd(t,e,i,r,a){let{zoom:n}=r,s=a.patternDependencies;for(let o of e){let l=o.paint.get(`${t}-pattern`).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:n-1},i,{},a.availableImages),h=l.evaluate({zoom:n},i,{},a.availableImages),c=l.evaluate({zoom:n+1},i,{},a.availableImages);u=u?.name?u.name:u,h=h?.name?h.name:h,c=c?.name?c.name:c,s[u]=!0,s[h]=!0,s[c]=!0,i.patterns[o.id]={min:u,mid:h,max:c}}}return i}var ss=new Set,mc=!1;function PE(t,e,i=2){let r=e&&e.length,a=r?e[0]*i:t.length;ss.size&&ss.clear();let n=w0(t,0,a,i,!0),s=[];if(!n||n.next===n.prev)return s;let o=0,l=0,u=0;if(r&&(n=FE(t,e,n,i)),t.length>80*i){o=t[0],l=t[1];let h=o,c=l;for(let d=i;d<a;d+=i){let p=t[d],f=t[d+1];p<o&&(o=p),f<l&&(l=f),p>h&&(h=p),f>c&&(c=f)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return gc(n,s,o,l,u),s}function w0(t,e,i,r,a){let n=null;if(a===ZE(t,e,i,r)>0)for(let s=e;s<i;s+=r)n=jm(s/r|0,t[s],t[s+1],n);else for(let s=i-r;s>=e;s-=r)n=jm(s/r|0,t[s],t[s+1],n);return n&&os(n,n.next)&&(us(n),n=n.next),n}function aa(t,e=t){let i=e===t,r=t,a;do a=!1,r!==r.next&&(ss.size===0||!ss.has(r))&&(os(r,r.next)||pe(r.prev,r,r.next)===0)?((i||r===e)&&(e=r.prev),mc=!0,us(r),r=r.prev,a=!0):(i||r!==e)&&(r=r.next,a=!i);while(a||r!==e);return e}function gc(t,e,i,r,a){a&&VE(t,i,r,a);let n=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(pe(o,t,l)<0&&(a?IE(t,i,r,a):CE(t))){e.push(o.i,t.i,l.i),us(t),t=l,n=l;continue}if(t=l,t===n){if(mc=!1,t=aa(t),mc){n=t;continue}if(!s){t=AE(t,e),n=t,s=!0;continue}ME(t,e,i,r,a);break}}}function CE(t){let e=t.prev,i=t,r=t.next,a=e.x,n=i.x,s=r.x,o=e.y,l=i.y,u=r.y,h=Math.min(a,n,s),c=Math.min(o,l,u),d=Math.max(a,n,s),p=Math.max(o,l,u),f=r.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=c&&f.y<=p&&(a!==f.x||o!==f.y)&&rl(a,o,n,l,s,u,f.x,f.y)&&pe(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function IE(t,e,i,r){let a=t.prev,n=t,s=t.next,o=a.x,l=n.x,u=s.x,h=a.y,c=n.y,d=s.y,p=Math.min(o,l,u),f=Math.min(h,c,d),m=Math.max(o,l,u),g=Math.max(h,c,d),_=xc(p,f,e,i,r),y=xc(m,g,e,i,r),x=t.prevZ;for(;x&&x.z>=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==s&&(o!==x.x||h!==x.y)&&rl(o,h,l,c,u,d,x.x,x.y)&&pe(x.prev,x,x.next)>=0)return!1;x=x.prevZ}let v=t.nextZ;for(;v&&v.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==s&&(o!==v.x||h!==v.y)&&rl(o,h,l,c,u,d,v.x,v.y)&&pe(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function AE(t,e){let i=t,r=!1;do{let a=i.prev,n=i.next.next;E0(a,i,i.next,n,!1)&&ls(a,n)&&ls(n,a)&&(e.push(a.i,i.i,n.i),us(i),us(i.next),i=t=n,r=!0),i=i.next}while(i!==t);return r?aa(i):i}function ME(t,e,i,r,a){let n=t;do{let s=n.next.next;for(;s!==n.prev;){if(n.i!==s.i&&NE(n,s)){let o=S0(n,s);n=aa(n,n.next),o=aa(o,o.next),gc(n,e,i,r,a),gc(o,e,i,r,a);return}s=s.next}n=n.next}while(n!==t)}var _c=!1;function FE(t,e,i,r){let a=[];for(let n=0,s=e.length;n<s;n++){let o=w0(t,e[n]*r,n<s-1?e[n+1]*r:t.length,r,!1);o===o.next&&ss.add(o),a.push(UE(o))}a.sort(zE),kE(t.length/r,e.length),T0(i,i),_c=!0;for(let n=0;n<a.length;n++)i=RE(a[n],i);return _c=!1,aa(i)}function zE(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function RE(t,e){let i=BE(t,e);if(!i)return e;let r=S0(i,t),a=r.next;return T0(i,a.next),aa(r,r.next),aa(i,i.next)}var ie=new Float64Array,il=0,yc=[],vc=[];function kE(t,e){let i=Math.ceil((t+2*e)/16)+e+2;ie.length<i*4&&(ie=new Float64Array(i*4)),il=0}function T0(t,e){let i=t;do{let r=il++;yc[r]=i;let a=1/0,n=1/0,s=-1/0,o=-1/0,l=0;do{let h=i.next;i.z=r,i.x<a&&(a=i.x),i.x>s&&(s=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y),h.x<a&&(a=h.x),h.x>s&&(s=h.x),h.y<n&&(n=h.y),h.y>o&&(o=h.y),i=h}while(++l<16&&i!==e);vc[r]=i;let u=r*4;ie[u]=a,ie[u+1]=n,ie[u+2]=s,ie[u+3]=o}while(i!==e)}function LE(t,e){let i=t.z*4;e.x<ie[i]&&(ie[i]=e.x),e.y<ie[i+1]&&(ie[i+1]=e.y),e.x>ie[i+2]&&(ie[i+2]=e.x),e.y>ie[i+3]&&(ie[i+3]=e.y)}
vendor: 17,914 bytes, line 822
822function Om(t){let e=vc[t];for(;e.prev.next!==e;)e=e.next;return vc[t]=e,e}function Vm(t){let e=yc[t];for(;e.prev.next!==e;)e=e.next;return yc[t]=e,e}function BE(t,e){let i=e,r=t.x,a=t.y,n=-1/0,s;if(os(t,i))return i;for(let d=0,p=0;d<il;d++,p+=4){if(a<ie[p+1]||a>ie[p+3]||ie[p]>r||ie[p+2]<=n)continue;let f=Om(d);i=Vm(d);do{if(i.prev.next===i){if(os(t,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let m=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(m<=r&&m>n&&(n=m,s=i.x<i.next.x?i:i.next,m===r))return s}}i=i.next}while(i!==f)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(a,l),h=Math.max(a,l),c=1/0;for(let d=0,p=0;d<il;d++,p+=4){if(ie[p+2]<o||ie[p]>r||ie[p+3]<u||ie[p+1]>h)continue;let f=Om(d);i=Vm(d);do{if(i.prev.next===i&&r>=i.x&&i.x>=o&&r!==i.x&&rl(a<l?r:n,a,o,l,a<l?n:r,a,i.x,i.y)){let m=Math.abs(a-i.y)/(r-i.x);(ls(i,t)||i.y===a&&i.next.y===a&&i.next.x>r)&&(m<c||m===c&&(i.x>s.x||i.x===s.x&&OE(s,i)))&&(s=i,c=m)}i=i.next}while(i!==f)}return s}function OE(t,e){return pe(t.prev,t,e.prev)<0&&pe(e.next,t,t.next)<0}var yi=[],Mn=[],qr=new Uint32Array,Fn=new Uint32Array,zn=new Uint32Array(256);function VE(t,e,i,r){let a=t,n=0;do a.z=xc(a.x,a.y,e,i,r),yi[n++]=a,a=a.next;while(a!==t);jE(n);let s=null;for(let o=0;o<n;o++){let l=yi[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null}function jE(t){if(t<=32){for(let e=1;e<t;e++){let i=yi[e],r=i.z,a=e-1;for(;a>=0&&yi[a].z>r;)yi[a+1]=yi[a],a--;yi[a+1]=i}return}qr.length<t&&(qr=new Uint32Array(t),Fn=new Uint32Array(t),Mn=Array(t));for(let e=0;e<t;e++)qr[e]=yi[e].z;Co(t,yi,qr,Mn,Fn,0),Co(t,Mn,Fn,yi,qr,8),Co(t,yi,qr,Mn,Fn,16),Co(t,Mn,Fn,yi,qr,24)}function Co(t,e,i,r,a,n){zn.fill(0);for(let o=0;o<t;o++)zn[i[o]>>>n&255]++;let s=0;for(let o=0;o<256;o++){let l=zn[o];zn[o]=s,s+=l}for(let o=0;o<t;o++){let l=i[o],u=zn[l>>>n&255]++;r[u]=e[o],a[u]=l}}function xc(t,e,i,r,a){return t=(t-i)*a|0,e=(e-r)*a|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function UE(t){let e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}function rl(t,e,i,r,a,n,s,o){return(a-s)*(e-o)>=(t-s)*(n-o)&&(t-s)*(r-o)>=(i-s)*(e-o)&&(i-s)*(n-o)>=(a-s)*(r-o)}function NE(t,e){let i=os(t,e)&&pe(t.prev,t,t.next)>0&&pe(e.prev,e,e.next)>0;return t.next.i!==e.i&&(i||ls(t,e)&&ls(e,t)&&(pe(t.prev,t,e.prev)!==0||pe(t,e.prev,e)!==0))&&!$E(t,e)&&(i||GE(t,e))}function pe(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function os(t,e){return t.x===e.x&&t.y===e.y}function E0(t,e,i,r,a=!0){let n=pe(t,e,i),s=pe(t,e,r),o=pe(i,r,t),l=pe(i,r,e);return(n>0&&s<0||n<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:a?!!(n===0&&Io(t,i,e)||s===0&&Io(t,r,e)||o===0&&Io(i,t,r)||l===0&&Io(i,e,r)):!1}function Io(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function $E(t,e){let i=Math.min(t.x,e.x),r=Math.max(t.x,e.x),a=Math.min(t.y,e.y),n=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>r&&o.x>r||s.x<i&&o.x<i||s.y>n&&o.y>n||s.y<a&&o.y<a){s=o;continue}if(s.i!==t.i&&o.i!==t.i&&s.i!==e.i&&o.i!==e.i&&E0(s,o,t,e))return!0;s=o}while(s!==t);return!1}function ls(t,e){return pe(t.prev,t,t.next)<0?pe(t,e,t.next)>=0&&pe(t,t.prev,e)>=0:pe(t,e,t.prev)<0||pe(t,t.next,e)<0}function GE(t,e){let i=t,r=!1,a=(t.x+e.x)/2,n=(t.y+e.y)/2;do{let s=i.next;i.y>n!=s.y>n&&a<(s.x-i.x)*(n-i.y)/(s.y-i.y)+i.x&&(r=!r),i=s}while(i!==t);return r}function S0(t,e){let i=bc(t.i,t.x,t.y),r=bc(e.i,e.x,e.y),a=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=a,a.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function jm(t,e,i,r){let a=bc(t,e,i);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function us(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),_c&&LE(t.prev,t.next)}function bc(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function ZE(t,e,i,r){let a=0;for(let n=e,s=i-r;n<i;n+=r)a+=(t[s]-t[n])*(t[n+1]+t[s+1]),s=n;return a}var Wi=class{constructor(t,e){if(e>t)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/e),this._minGranularity,1)}},ta,Zl=(ta=class{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}},ta.noSubdivision=new ta({fill:new Wi(0,0),line:new Wi(0,0),tile:new Wi(0,0),stencil:new Wi(0,0),circle:1}),ta);$("SubdivisionGranularityExpression",Wi),$("SubdivisionGranularitySetting",Zl);var Ua=-32768,Na=32767,qE=class{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=k/t,this._canonical=e}_getKey(t,e){return t+=32768,e+=32768,t<<16|e<<0}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let i=Math.round(t)|0,r=Math.round(e)|0,a=this._getKey(i,r),n=this._vertexDictionary.get(a);if(n!==void 0)return n;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,s),this._vertexBuffer.push(i,r),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return XE(this._vertexBuffer,HE(t,e));let i=[],r=t.length;for(let a=0;a<r;a+=3){let n=[e[t[a+0]],e[t[a+1]],e[t[a+2]]],s=[this._vertexBuffer[n[0]*2+0],this._vertexBuffer[n[0]*2+1],this._vertexBuffer[n[1]*2+0],this._vertexBuffer[n[1]*2+1],this._vertexBuffer[n[2]*2+0],this._vertexBuffer[n[2]*2+1]],o=1/0,l=1/0,u=-1/0,h=-1/0;for(let m=0;m<3;m++){let g=s[m*2],_=s[m*2+1];o=Math.min(o,g),u=Math.max(u,g),l=Math.min(l,_),h=Math.max(h,_)}if(o===u||l===h)continue;let c=Math.floor(o/this._granularityCellSize),d=Math.ceil(u/this._granularityCellSize),p=Math.floor(l/this._granularityCellSize),f=Math.ceil(h/this._granularityCellSize);if(c===d&&p===f){i.push(...n);continue}for(let m=p;m<f;m++){let g=this._scanlineGenerateVertexRingForCellRow(m,s,n);YE(this._vertexBuffer,g,i)}}return i}_scanlineGenerateVertexRingForCellRow(t,e,i){let r=t*this._granularityCellSize,a=r+this._granularityCellSize,n=[];for(let s=0;s<3;s++){let o=e[s*2],l=e[s*2+1],u=e[(s+1)*2%6],h=e[((s+1)*2+1)%6],c=e[(s+2)*2%6],d=e[((s+2)*2+1)%6],p=u-o,f=h-l,m=p===0,g=f===0,_=(r-l)/f,y=(a-l)/f,x=Math.min(_,y),v=Math.max(_,y);if(!g&&(x>=1||v<=0)||g&&(l<r||l>a)){h>=r&&h<=a&&n.push(i[(s+1)%3]);continue}if(!g&&x>0){let T=o+p*x,D=l+f*x;n.push(this._vertexToIndex(T,D))}let w=o+p*Math.max(x,0),b=o+p*Math.min(v,1);if(m||this._generateIntraEdgeVertices(n,o,l,u,h,w,b),!g&&v<1){let T=o+p*v,D=l+f*v;n.push(this._vertexToIndex(T,D))}(g||h>=r&&h<=a)&&n.push(i[(s+1)%3]),!g&&(h<=r||h>=a)&&this._generateInterEdgeVertices(n,o,l,u,h,c,d,b,r,a)}return n}_generateIntraEdgeVertices(t,e,i,r,a,n,s){let o=r-e,l=a-i,u=l===0,h=u?Math.min(e,r):Math.min(n,s),c=u?Math.max(e,r):Math.max(n,s),d=Math.floor(h/this._granularityCellSize)+1,p=Math.ceil(c/this._granularityCellSize)-1;if(u?e<r:n<s)for(let f=d;f<=p;f++){let m=f*this._granularityCellSize,g=i+l*(m-e)/o;t.push(this._vertexToIndex(m,g))}else for(let f=p;f>=d;f--){let m=f*this._granularityCellSize,g=i+l*(m-e)/o;t.push(this._vertexToIndex(m,g))}}_generateInterEdgeVertices(t,e,i,r,a,n,s,o,l,u){let h=a-i,c=n-r,d=s-a,p=(l-a)/d,f=(u-a)/d,m=Math.min(p,f),g=Math.max(p,f),_=r+c*m,y=Math.floor(Math.min(_,o)/this._granularityCellSize)+1,x=Math.ceil(Math.max(_,o)/this._granularityCellSize)-1,v=o<_,w=d===0;if(w&&(s===l||s===u))return;if(w||m>=1||g<=0){let T=e-n,D=i-s,E=(l-s)/D,M=(u-s)/D,R=n+T*Math.min(E,M);y=Math.floor(Math.min(R,o)/this._granularityCellSize)+1,x=Math.ceil(Math.max(R,o)/this._granularityCellSize)-1,v=o<R}let b=h>0?u:l;if(v)for(let T=y;T<=x;T++){let D=T*this._granularityCellSize;t.push(this._vertexToIndex(D,b))}else for(let T=x;T>=y;T--){let D=T*this._granularityCellSize;t.push(this._vertexToIndex(D,b))}}_generateOutline(t,e){let i=[],r=0;for(let a of t){let n=this._granularity<2?this._ringPathIndices(a,r,e):this._pointArrayToIndices(Yr(a,this._granularity,!0));r+=a.length;let s=[];for(let o=1;o<n.length;o++)s.push(n[o-1]),s.push(n[o]);i.push(s)}return i}_ringPathIndices(t,e,i){let r=i.slice(e,e+t.length);return r.length>=2&&P0(t)&&r.push(r[0]),r}_handlePoles(t){let e=!1,i=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(e||i)&&this._fillPoles(t,e,i)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){let i=t[e+1];i===-32768&&(t[e+1]=-32767),i===32767&&(t[e+1]=32766)}}_generatePoleQuad(t,e,i,r,a,n){r>a==(n===-32768)?(t.push(i),t.push(e),t.push(this._vertexToIndex(r,n)),t.push(this._vertexToIndex(a,n)),t.push(i),t.push(this._vertexToIndex(r,n))):(t.push(e),t.push(i),t.push(this._vertexToIndex(r,n)),t.push(i),t.push(this._vertexToIndex(a,n)),t.push(this._vertexToIndex(r,n)))}_fillPoles(t,e,i){let r=this._vertexBuffer,a=k,n=t.length;for(let s=2;s<n;s+=3){let o=t[s-2],l=t[s-1],u=t[s],h=r[o*2],c=r[o*2+1],d=r[l*2],p=r[l*2+1],f=r[u*2],m=r[u*2+1];e&&(c===0&&p===0&&this._generatePoleQuad(t,o,l,h,d,Ua),p===0&&m===0&&this._generatePoleQuad(t,l,u,d,f,Ua),m===0&&c===0&&this._generatePoleQuad(t,u,o,f,h,Ua)),i&&(c===a&&p===a&&this._generatePoleQuad(t,o,l,h,d,Na),p===a&&m===a&&this._generatePoleQuad(t,l,u,d,f,Na),m===a&&c===a&&this._generatePoleQuad(t,u,o,f,h,Na))}}_initializeVertices(t){let e=[];for(let i=0;i<t.length;i+=2)e.push(this._vertexToIndex(t[i],t[i+1]));return e}subdividePolygonInternal(t,e){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:i,holeIndices:r}=WE(t),a=this._initializeVertices(i),n;try{let o=PE(i,r);n=this._subdivideTrianglesScanline(o,a)}catch(o){console.error(o)}let s=[];return e&&(s=this._generateOutline(t,a)),this._ensureNoPoleVertices(),this._handlePoles(n),this._granularity>=2&&this._canonical?.z===0&&(n=this._removeTrianglesOutsideTileX(n),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let i=0;i<t.length;i+=3)this._vertexOutsideTileX(t[i])||this._vertexOutsideTileX(t[i+1])||this._vertexOutsideTileX(t[i+2])||e.push(t[i],t[i+1],t[i+2]);return e}_removeLinesOutsideTileX(t){let e=[];for(let i=0;i<t.length;i+=2)this._vertexOutsideTileX(t[i])||this._vertexOutsideTileX(t[i+1])||e.push(t[i],t[i+1]);return e}_pointArrayToIndices(t){let e=[];for(let i of t)e.push(this._vertexToIndex(i.x,i.y));return e}};function D0(t,e,i,r=!0){return new qE(i,e).subdividePolygonInternal(t,r)}function Yr(t,e,i=!1){if(!t||t.length<1||t.length<2)return[];let r=i&&P0(t);if(e<2)return r?[...t,t[0]]:[...t];let a=Math.floor(k/e),n=[];n.push(new C(t[0].x,t[0].y));let s=t.length,o=r?s:s-1;for(let l=0;l<o;l++){let u=t[l],h=l<s-1?t[l+1]:t[0],c=u.x,d=u.y,p=h.x,f=h.y,m=c!==p,g=d!==f;if(!m&&!g)continue;let _=p-c,y=f-d,x=Math.abs(_),v=Math.abs(y),w=c,b=d;for(;;){let D=_>0?(Math.floor(w/a)+1)*a:(Math.ceil(w/a)-1)*a,E=y>0?(Math.floor(b/a)+1)*a:(Math.ceil(b/a)-1)*a,M=Math.abs(w-D),R=Math.abs(b-E),z=Math.abs(w-p),P=Math.abs(b-f),S=m?M/x:1/0,I=g?R/v:1/0;if((z<=M||!m)&&(P<=R||!g))break;if(S<I&&m||!g){w=D,b+=y*S;let A=new C(w,Math.round(b));(n[n.length-1].x!==A.x||n[n.length-1].y!==A.y)&&n.push(A)}else{w+=_*I,b=E;let A=new C(Math.round(w),b);(n[n.length-1].x!==A.x||n[n.length-1].y!==A.y)&&n.push(A)}}let T=new C(p,f);(n[n.length-1].x!==T.x||n[n.length-1].y!==T.y)&&n.push(T)}return n}function P0(t){return!t[0].equals(t[t.length-1])}function WE(t){let e=[],i=[];for(let r of t)if(r.length!==0){r!==t[0]&&e.push(i.length/2);for(let a of r)i.push(a.x),i.push(a.y)}return{flattened:i,holeIndices:e}}function HE(t,e){let i=Array(t.length);for(let r=0;r<t.length;r++)i[r]=e[t[r]];return i}function XE(t,e){let i=[];for(let r=0;r<e.length;r+=3){let a=e[r],n=e[r+1],s=e[r+2],o=t[a*2],l=t[a*2+1],u=t[n*2],h=t[n*2+1],c=t[s*2],d=t[s*2+1],p=u-o,f=h-l,m=c-o;p*(d-l)-f*m>0?(i.push(a),i.push(s),i.push(n)):(i.push(a),i.push(n),i.push(s))}return i}function YE(t,e,i){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let r=0,a=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<a&&(a=u,r=l)}let n=e.length,s=r,o=(s+1)%n;for(;;){let l=s-1>=0?s-1:n-1,u=(o+1)%n,h=t[e[l]*2],c=t[e[l]*2+1],d=t[e[u]*2],p=t[e[u]*2+1],f=t[e[s]*2],m=t[e[s]*2+1],g=t[e[o]*2],_=t[e[o]*2+1],y=!1;if(h<d)y=!0;else if(h>d)y=!1;else{let x=_-m,v=-(g-f),w=m<_?1:-1;((h-f)*x+(c-m)*v)*w>((d-f)*x+(p-m)*v)*w&&(y=!0)}if(y){let x=e[l],v=e[s],w=e[o];x!==v&&x!==w&&v!==w&&i.push(w,v,x),s--,s<0&&(s=n-1)}else{let x=e[u],v=e[s],w=e[o];x!==v&&x!==w&&v!==w&&i.push(w,v,x),o++,o>=n&&(o=0)}if(l===u)break}}function C0(t,e,i,r,a,n,s,o,l){let u=a.length/2,h=s&&o&&l;if(u<qt.MAX_VERTEX_ARRAY_LENGTH){let c=e.prepareSegment(u,i,r),d=c.vertexLength;for(let m=0;m<n.length;m+=3)r.emplaceBack(d+n[m],d+n[m+1],d+n[m+2]);c.vertexLength+=u,c.primitiveLength+=n.length/3;let p,f;h&&(f=s.prepareSegment(u,i,o),p=f.vertexLength,f.vertexLength+=u);for(let m=0;m<a.length;m+=2)t(a[m],a[m+1]);if(h)for(let m of l){for(let g=1;g<m.length;g+=2)o.emplaceBack(p+m[g-1],p+m[g]);f.primitiveLength+=m.length/2}}else KE(e,i,r,a,n,t),h&&JE(s,i,o,a,l,t),e.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function Xn(t,e,i,r,a,n,s){if(n){let o=r.count;return i(e[a*2],e[a*2+1]),t[a]=r.count,r.count++,s.vertexLength++,o}return t[a]}function KE(t,e,i,r,a,n){let s=[];for(let c=0;c<r.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,i),h=u.vertexLength;for(let c=2;c<a.length;c+=3){let d=a[c-2],p=a[c-1],f=a[c],m=s[d]<l,g=s[p]<l,_=s[f]<l,y=+!!m+ +!!g+ +!!_;u.vertexLength+y>qt.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,i),l=o.count,m=!0,g=!0,_=!0,h=0);let x=Xn(s,r,n,o,d,m,u),v=Xn(s,r,n,o,p,g,u),w=Xn(s,r,n,o,f,_,u);i.emplaceBack(h+x-l,h+v-l,h+w-l),u.primitiveLength++}}function JE(t,e,i,r,a,n){let s=[];for(let c=0;c<r.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,i),h=u.vertexLength;for(let c of a)for(let d=1;d<c.length;d+=2){let p=c[d-1],f=c[d],m=s[p]<l,g=s[f]<l,_=+!!m+ +!!g;u.vertexLength+_>qt.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,i),l=o.count,m=!0,g=!0,h=0);let y=Xn(s,r,n,o,p,m,u),x=Xn(s,r,n,o,f,g,u);i.emplaceBack(h+y-l,h+x-l),u.primitiveLength++}}var I0=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new BT,this.indexArray=new Bi,this.indexArray2=new oc,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new qt,this.segments2=new qt,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,i){this.hasDependencies=el("fill",this.layers,e);let r=this.layers[0].layout.get("fill-sort-key"),a=!r.isConstant(),n=[],s=new Ct(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let d=Vr(l,o);if(!this.layers[0]._featureFilter.filter(s,d,i))continue;let p=a?r.evaluate(d,{},i,e.availableImages):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?d.geometry:ha(l),patterns:{},sortKey:p};n.push(f)}a&&n.sort((l,u)=>l.sortKey-u.sortKey);for(let l of n){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let p=zd("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(p)}else this.addFeature(l,u,h,i,{},e.subdivisionGranularity);let d=t[h].feature;e.featureIndex.insert(d,u,h,c,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}addFeatures({options:t,canonical:e,patternPositions:i,patternMap:r}){this.detectSdfPatterns(r);for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,e,i,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let i in e.patterns){let r=e.patterns[i];this.recordSdfPattern(i,t[r.min]),this.recordSdfPattern(i,t[r.mid]),this.recordSdfPattern(i,t[r.max])}for(let e of this.layers){let i=e.paint.get("fill-pattern").constantOr(null);i&&(this.recordSdfPattern(e.id,t[i.from.toString()]),this.recordSdfPattern(e.id,t[i.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let i=e.sdf===!0,r=this.sdfPatterns[t];r===void 0?this.sdfPatterns[t]=i:r!==i&&ft(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,DE),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,e,i,r,a,n){for(let s of Cl(e,500)){let o=D0(s,r,n.fill.getGranularityForZoomLevel(r.z)),l=this.layoutVertexArray;C0((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:a,canonical:r})}};$("FillBucket",I0,{omit:["layers","patternFeatures"]});var Um,QE=()=>Um||(Um=new ge({"fill-sort-key":new tt(F.layout_fill["fill-sort-key"],"fill-sort-key")})),Nm,tS=()=>Nm||(Nm=new ge({"fill-antialias":new j(F.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new tt(F.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer
822-opacity":new j(F.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new tt(F.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new tt(F.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new j(F.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new j(F.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new rs(F.paint_fill["fill-pattern"],"fill-pattern")})),eS={get paint(){return tS()},get layout(){return QE()}},A0=t=>t.type==="fill",iS=class extends Li{constructor(t,e){super(t,eS,e)}recalculate(t,e){super.recalculate(t,e);let i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new I0(t)}queryRadius(){return Nl(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:i,pixelsToTileUnits:r}){return h0($l(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,r),e)}isTileClipped(){return!0}},wc=Yt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),rS=Yt([{name:"a_centroid",components:2,type:"Int16"}],4),aS=wc.members;wc.size,wc.alignment;var Ti=class Tc{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let i=new Tc;return i.extend(e(new C(this.minX,this.minY))),i.extend(e(new C(this.maxX,this.minY))),i.extend(e(new C(this.minX,this.maxY))),i.extend(e(new C(this.maxX,this.maxY))),i}static fromPoints(e){let i=new Tc;for(let r of e)i.extend(r);return i}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},M0=Ti.fromPoints([new C(0,0),new C(k,k)]);function Ec(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function $m(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Is=class{constructor(t,e,i,r,a){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=a;t.pos<e;){let n=t.readVarint();if(n===8)this.id=t.readVarint();else if(n===18){let s=t.readVarint()+t.pos;for(;t.pos<s;){let o=r[t.readVarint()],l=a[t.readVarint()];this.properties[o]=l}}else n===24?this.type=t.readVarint():(n===34&&(this._geometry=t.pos),t.skip(n))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,i=[],r,a=1,n=0,s=0,o=0;for(;t.pos<e;){if(n<=0){let l=t.readVarint();if(a=l&7,n=l>>3,n===0)continue}if(n--,a===1)s+=t.readSVarint(),o+=t.readSVarint(),r&&i.push(r),r=[new C(s,o)];else if(a===2)s+=t.readSVarint(),o+=t.readSVarint(),r&&r.push(new C(s,o));else if(a===7)r&&r.push(r[0].clone());else throw Error(`unknown command ${a}`)}return r&&i.push(r),i}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,i=1,r=0,a=0,n=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos<e;){if(r<=0){let h=t.readVarint();if(i=h&7,r=h>>3,r===0)continue}if(r--,i===1||i===2)a+=t.readSVarint(),n+=t.readSVarint(),a<s&&(s=a),a>o&&(o=a),n<l&&(l=n),n>u&&(u=n);else if(i!==7)throw Error(`unknown command ${i}`)}return[s,l,o,u]}toGeoJSON(t,e,i){let r=this.extent*2**i,a=this.extent*t,n=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+a)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+n)*2/r)*Math.PI))-90]}function l(c){return c.map(o)}let u;
vendor: 9,871 bytes, line 822
822if(this.type===1){let c=[];for(let p of s)c.push(p[0]);let d=l(c);u=c.length===1?{type:"Point",coordinates:d[0]}:{type:"MultiPoint",coordinates:d}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=F0(s),d=[];for(let p of c)d.push(p.map(l));u=d.length===1?{type:"Polygon",coordinates:d[0]}:{type:"MultiPolygon",coordinates:d}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Is.types=["Unknown","Point","LineString","Polygon"];function F0(t){let e=t.length;if(e<=1)return[t];let i=[],r,a;for(let n=0;n<e;n++){let s=nS(t[n]);s!==0&&(a===void 0&&(a=s<0),a===s<0?(r&&i.push(r),r=[t[n]]):r&&r.push(t[n]))}return r&&i.push(r),i}function nS(t){let e=0;for(let i=0,r=t.length,a=r-1,n,s;i<r;a=i++)n=t[i],s=t[a],e+=(s.x-n.x)*(n.y+s.y);return e}var sS=class{constructor(t,e){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],e===void 0&&(e=t.length);t.pos<e;){let i=t.readVarint();i===10?this.name=t.readString():i===18?(this._features.push(t.pos),t.skip(i)):i===26?this._keys.push(t.readString()):i===34?this._values.push(oS(t)):i===40?this.extent=t.readVarint():i===120?this.version=t.readVarint():t.skip(i)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Is(this._pbf,e,this.extent,this._keys,this._values)}};function oS(t){let e=null,i=t.readVarint()+t.pos;for(;t.pos<i;){let r=t.readVarint();e=r===10?t.readString():r===21?t.readFloat():r===25?t.readDouble():r===32?t.readVarint(!0):r===40?t.readVarint():r===48?t.readSVarint():r===56?t.readBoolean():(t.skip(r),null)}if(e==null)throw Error("unknown feature value");return e}var lS=class{constructor(t,e=t.length){let i=Object.create(null);for(;t.pos<e;){let r=t.readVarint();if(r===26){let a=new sS(t,t.readVarint()+t.pos);a.length&&(i[a.name]=a)}else t.skip(r)}this.layers=i}},Ve=63710088e-1,Y=class Un{constructor(e,i){if(isNaN(e)||isNaN(i))throw Error(`Invalid LngLat object: (${e}, ${i})`);if(this.lng=+e,this.lat=+i,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Un(li(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let i=Math.PI/180,r=this.lat*i,a=e.lat*i,n=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*i);return Ve*Math.acos(Math.min(n,1))}static convert(e){if(e instanceof Un)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Un(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new Un(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw 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>]")}},z0=2*Math.PI*Ve;function R0(t){return z0*Math.cos(t*Math.PI/180)}function ca(t){return(180+t)/360}function da(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jr(t,e){return t/R0(e)}function ql(t){return t*360-180}function tn(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Rd(t,e){return t*R0(tn(e))}function uS(t){return 1/Math.cos(t*Math.PI/180)}var Et=class k0{constructor(e,i,r=0){this.x=+e,this.y=+i,this.z=+r}static fromLngLat(e,i=0){let r=Y.convert(e);return new k0(ca(r.lng),da(r.lat),jr(i,r.lat))}toLngLat(){return new Y(ql(this.x),tn(this.y))}toAltitude(){return Rd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/z0*uS(tn(this.y))}},Ur=89.25;function kd(t,e,i){let r=1/(1<<i.z);return new Et(t/k*r+i.x*r,e/k*r+i.y*r)}function hS(t,e,i){return kd(t,e,i).toLngLat()}function Oi(t,e){let i=st(e.lat,-85.051129,ki);return new C(ca(e.lng)*t,da(i)*t)}function un(t,e){return new Et(e.x/t,e.y/t).toLngLat()}function hn(t){return t.cameraToCenterDistance*Math.min(Math.tan(Gt(90-t.pitch))*.85,Math.tan(Gt(Ur-t.pitch)))}function Wl(t,e){let i=t.canonical,r=e/Be(i.z),a=i.x+2**i.z*t.wrap,n=new Float64Array(16);return Ei(n),se(n,n,[a*r,i.y*r,0]),we(n,n,[r/k,r/k,1]),n}function Ld(t,e,i,r,a){let n=Et.fromLngLat(t,e),s=a*jr(1,t.lat),{x:o,y:l,z:u}=Hl(i,r),h=s*-o,c=s*-l,d=s*u;return new Et(n.x+h,n.y+c,n.z+d)}function L0(t){let e=jr(1,t.center.lat)*t.worldSize;return Ld(t.center,t.elevation,t.pitch,t.bearing,t.cameraToCenterDistance/e)}function Hl(t,e){let i=Gt(t),r=Gt(e),a=Math.cos(-i),n=Math.sin(i);return{x:n*Math.sin(r),y:-n*Math.cos(r),z:a}}function cS(t,e){return e<=0||!t||t.length===0?t:t.map(i=>pS(i,e))}function dS(t,e){let i=hS(k/2,k/2,e),r=Et.fromLngLat(i).meterInMercatorCoordinateUnits(),a=(1<<e.z)*k;return t*r*a}function pS(t,e){if(!t||t.length<3)return t;let i=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,r=i?t.length-1:t.length;if(r<3)return t;let a=[],n=Ec(t[r-1],t[0]);for(let o=0;o<r;o++){let l=t[(o-1+r)%r],u=t[o],h=t[(o+1)%r],c=Ec(u,h);n||c?a.push(u.clone()):mS(a,l,u,h,e),n=c}let s=fS(a);return s.length<3?t:(i&&s.push(s[0].clone()),s)}function fS(t){let e=[];for(let i of t){let r=i.round(),a=e[e.length-1];(a?.x!==r.x||a?.y!==r.y)&&e.push(r)}for(;e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function mS(t,e,i,r,a){let n=e.sub(i),s=r.sub(i),o=n.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(i.clone());return}n._div(o),s._div(l);let u=n.x*s.x+n.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(i.clone());return}let h=.2,c=Math.min(a,o*h,l*h),d=i.add(n.mult(c)),p=i.add(s.mult(c)),f=Math.sqrt((1+u)/2),m=i.add(n.add(s)._unit()._mult(c/f)),g=d.sub(m).angleWith(p.sub(m)),_=Math.max(2,Math.ceil(Math.abs(g)/(Math.PI/6)-1e-6));for(let y=0;y<=_;y++)t.push(d.rotateAround(y/_*g,m))}var xh=8192;function Rn(t,e,i,r,a,n,s,o){t.emplaceBack(e,i,Math.floor(r*xh)*2+s,a*xh*2,n*xh*2,Math.round(o))}var B0=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new OT,this.centroidVertexArray=new gr,this.indexArray=new Bi,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new qt,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,i){this.features=[],this.hasDependencies=el("fill-extrusion",this.layers,e);let r=new Ct(this.zoom),a=this.layers[0],n=a.layout.get("fill-extrusion-rounded-corner-distance"),s=n>0?dS(n,i):0,o=a._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let d=Vr(l,o);if(!a._featureFilter.filter(r,d,i))continue;let p={id:u,sourceLayerIndex:c,index:h,geometry:cS(o?d.geometry:ha(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(zd("fill-extrusion",this.layers,p,{zoom:this.zoom},e)):this.addFeature(p,p.geometry,h,i,{},e.subdivisionGranularity),e.featureIndex.insert(l,p.geometry,h,c,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:i}){for(let r of this.features){let{geometry:a}=r;this.addFeature(r,a,r.index,e,i,t.subdivisionGranularity)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,aS),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,rS.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,a,n){for(let s of Cl(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,r,t,s,n);let u=this.layoutVertexArray.length-l,h=Math.floor(o.x/o.sampleCount),c=Math.floor(o.y/o.sampleCount);for(let d=0;d<u;d++)this.centroidVertexArray.emplaceBack(h,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:a,canonical:r})}processPolygon(t,e,i,r,a){if(r.length<1||$m(r[0]))return;for(let h of r)h.length!==0&&gS(t,h);let n={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=a.fill.getGranularityForZoomLevel(e.z),o=Is.types[i.type]==="Polygon";for(let h of r){if(h.length===0||$m(h))continue;let c=Yr(h,s,o);this._generateSideFaces(c,n)}if(!o)return;let l=D0(r,e,s,!1),u=this.layoutVertexArray;C0((h,c)=>{Rn(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let i=0;for(let r=1;r<t.length;r++){let a=t[r],n=t[r-1];if(Ec(a,n))continue;e.segment.vertexLength+4>qt.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=a.sub(n)._perp()._unit(),o=n.dist(a);i+o>32768&&(i=0),Rn(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,i),Rn(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,i),i+=o,Rn(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,i),Rn(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,i);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function gS(t,e){for(let i=0;i<e.length;i++){let r=e[i];(i!==e.length-1||e[0].x!==r.x||e[0].y!==r.y)&&(t.x+=r.x,t.y+=r.y,t.sampleC
vendor: 17,941 bytes, line 822
822ount++)}}$("FillExtrusionBucket",B0,{omit:["layers","features"]});var Gm,_S=()=>Gm||(Gm=new ge({"fill-extrusion-rounded-corner-distance":new j(F["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),Zm,yS=()=>Zm||(Zm=new ge({"fill-extrusion-opacity":new j(F["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new tt(F["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new j(F["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new j(F["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new rs(F["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new tt(F["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new tt(F["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new j(F["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),vS={get paint(){return yS()},get layout(){return _S()}},O0=t=>t.type==="fill-extrusion",xS=class extends Li{constructor(t,e){super(t,vS,e)}createBucket(t){return new B0(t)}queryRadius(){return Nl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n,pixelPosMatrix:s}){let o=$l(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,n),l=this.paint.get("fill-extrusion-height").evaluate(e,i),u=this.paint.get("fill-extrusion-base").evaluate(e,i),h=TS(o,s,0),c=wS(r,u,l,s),d=c[0],p=c[1];return bS(d,p,h)}};function kn(t,e){return t.x*e.x+t.y*e.y}function qm(t,e){if(t.length===1){let i=0,r=e[i++],a;for(;!a||r.equals(a);)if(a=e[i++],!a)return 1/0;for(;i<e.length;i++){let n=e[i],s=t[0],o=a.sub(r),l=n.sub(r),u=s.sub(r),h=kn(o,o),c=kn(o,l),d=kn(l,l),p=kn(u,o),f=kn(u,l),m=h*d-c*c,g=(d*p-c*f)/m,_=(h*f-c*p)/m,y=1-g-_,x=r.z*y+a.z*g+n.z*_;if(isFinite(x))return x}return 1/0}{let i=1/0;for(let r of e)i=Math.min(i,r.z);return i}}function bS(t,e,i){let r=1/0;h0(i,e)&&(r=qm(i,e[0]));for(let a=0;a<e.length;a++){let n=e[a],s=t[a];for(let o=0;o<n.length-1;o++){let l=n[o],u=n[o+1],h=s[o],c=[l,u,s[o+1],h,l];Pd(i,c)&&(r=Math.min(r,qm(i,c)))}}return r!==1/0&&r}function wS(t,e,i,r){let a=[],n=[],s=r[8]*e,o=r[9]*e,l=r[10]*e,u=r[11]*e,h=r[8]*i,c=r[9]*i,d=r[10]*i,p=r[11]*i;for(let f of t){let m=[],g=[];for(let _ of f){let y=_.x,x=_.y,v=r[0]*y+r[4]*x+r[12],w=r[1]*y+r[5]*x+r[13],b=r[2]*y+r[6]*x+r[14],T=r[3]*y+r[7]*x+r[15],D=v+s,E=w+o,M=b+l,R=T+u,z=v+h,P=w+c,S=b+d,I=T+p,A=new C(D/R,E/R);A.z=M/R,m.push(A);let L=new C(z/I,P/I);L.z=S/I,g.push(L)}a.push(m),n.push(g)}return[a,n]}function TS(t,e,i){let r=[];for(let a of t){let n=[a.x,a.y,i,1];Te(n,n,e),r.push(new C(n[0]/n[3],n[1]/n[3]))}return r}var YR=new Uint32Array(96);var ES="geojsonvt_clip_start",SS="geojsonvt_clip_end";var Sc=Yt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),DS=Sc.members;Sc.size,Sc.alignment;var Dc=Yt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),PS=Dc.members;Dc.size,Dc.alignment;var CS=Math.cos(75/2*(Math.PI/180)),V0=1/2,Wm=2**14/V0,j0=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new VT,this.layoutVertexArray2=new jT,this.indexArray=new Bi,this.programConfigurations=new ra(t.layers,t.zoom),this.segments=new qt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,i){this.hasDependencies=el("line",this.layers,e)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get("line-sort-key"),a=!r.isConstant(),n=[],s=new Ct(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let d=Vr(l,o);if(!this.layers[0]._featureFilter.filter(s,d,i))continue;let p=a?r.evaluate(d,{},i):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?d.geometry:ha(l),patterns:{},dashes:{},sortKey:p};n.push(f)}a&&n.sort((l,u)=>l.sortKey-u.sortKey);for(let l of n){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(el("line",this.layers,e)?zd("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,i,{},{},e.subdivisionGranularity);let d=t[h].feature;e.featureIndex.insert(d,u,h,c,this.index)}}update(t,e,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i,dashPositions:r})}addFeatures({options:t,canonical:e,patternPositions:i,dashPositions:r}){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,e,i,r,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,PS)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,DS),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[ES],end:+t.properties[SS]}}addFeature(t,e,i,r,a,n,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),h=o.get("line-miter-limit").evaluate(t,{}),c=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let d of e)this.addLine(d,t,l,u,h,c,r,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:a,dashPositions:n,canonical:r})}addLine(t,e,i,r,a,n,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=Yr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let x=0;x<t.length-1;x++)this.totalDistance+=t[x].dist(t[x+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=Is.types[e.type]==="Polygon",h=t.length;for(;h>=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c<h-1&&t[c].equals(t[c+1]);)c++;if(h-c<(u?3:2))return;i==="bevel"&&(a=1.05);let d=this.overscaling<=16?15*k/(512*this.overscaling):0,p=this.segments.prepareSegment(h*10,this.layoutVertexArray,this.indexArray),f,m,g,_,y;this.e1=this.e2=-1,u&&(f=t[h-2],y=t[c].sub(f)._unit()._perp());for(let x=c;x<h;x++){if(g=x===h-1?u?t[c+1]:void 0:t[x+1],g&&t[x].equals(g))continue;y&&(_=y),f&&(m=f),f=t[x],y=g?g.sub(f)._unit()._perp():_,_||(_=y);let v=_.add(y);(v.x!==0||v.y!==0)&&v._unit();let w=_.x*y.x+_.y*y.y,b=v.x*y.x+v.y*y.y,T=b===0?1/0:1/b,D=2*Math.sqrt(2-2*b),E=b<CS&&m&&g,M=_.x*y.y-_.y*y.x>0;if(E&&x>c){let P=f.dist(m);if(P>2*d){let S=f.sub(f.sub(m)._mult(d/P)._round());this.updateDistance(m,S),this.addCurrentVertex(S,_,0,0,p),m=S}}let R=m&&g,z=R?i:u?"butt":r;if(R&&z==="round"&&(T<n?z="miter":T<=2&&(z="fakeround")),z==="miter"&&T>a&&(z="bevel"),z==="bevel"&&(T>2&&(z="flipbevel"),T<a&&(z="miter")),m&&this.updateDistance(m,f),z==="miter")v._mult(T),this.addCurrentVertex(f,v,0,0,p);else if(z==="flipbevel"){if(T>100)v=y.mult(-1);else{let P=T*_.add(y).mag()/_.sub(y).mag();v._perp()._mult(P*(M?-1:1))}this.addCurrentVertex(f,v,0,0,p),this.addCurrentVertex(f,v.mult(-1),0,0,p)}else if(z==="bevel"||z==="fakeround"){let P=-Math.sqrt(T*T-1),S=M?P:0,I=M?0:P;if(m&&this.addCurrentVertex(f,_,S,I,p),z==="fakeround"){let A=Math.round(D*180/Math.PI/20);for(let L=1;L<A;L++){let G=L/A;if(G!==.5){let et=G-.5,ot=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),Pt=.848013+w*(-1.06021+w*.215638);G+=G*et*(G-1)*(ot*et*et+Pt)}let U=y.sub(_)._mult(G)._add(_)._unit()._mult(M?-1:1);this.addHalfVertex(f,U.x,U.y,!1,M,0,p)}}g&&this.addCurrentVertex(f,y,-S,-I,p)}else if(z==="butt")this.addCurrentVertex(f,v,0,0,p);else if(z==="square"){let P=m?1:-1;this.addCurrentVertex(f,v,P,P,p)}else z==="round"&&(m&&(this.addCurrentVertex(f,_,0,0,p),this.addCurrentVertex(f,_,1,1,p,!0)),g&&(this.addCurrentVertex(f,y,-1,-1,p,!0),this.addCurrentVertex(f,y,0,0,p)));if(E&&x<h-1){let P=f.dist(g);if(P>2*d){let S=f.add(g.sub(f)._mult(d/P)._round());this.updateDistance(f,S),this.addCurrentVertex(S,y,0,0,p),f=S}}}}addCurrentVertex(t,e,i,r,a,n=!1){let s=e.x+e.y*i,o=e.y-e.x*i,l=-e.x+e.y*r,u=-e.y-e.x*r;this.addHalfVertex(t,s,o,n,!1,i,a),this.addHalfVertex(t,l,u,n,!0,-r,a),this.distance>Wm/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,a,n))}addHalfVertex({x:t,y:e},i,r,a,n,s,o){let l=(this.lineClips?this.scaledDistance*(Wm-1):this.scaledDistance)*V0;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!a,(e<<1)+ +!!n,Math.round(63*i)+128,Math.round(63*r)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),n?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let i=e.paint.get("line-dasharray");if(i&&!i.isConstant())return!0}return!1}addLineDashDependencies(t,e,i,r){for(let a of t){let n=a.paint.get("line-dasharray");if(!n||n.value.kind==="constant")continue;let s=a.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:n.value.evaluate({zoom:i-1},e,{}),round:s},l={dasharray:n.value.evaluate({zoom:i},e,{}),round:s},u={dasharray:n.value.evaluate({zoom:i+1},e,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,d=`${u.dasharray.join(",")},${u.round}`;r.dashDependencies[h]=o,r.dashDependencies[c]=l,r.dashDependencies[d]=u,e.dashes[a.id]={min:h,mid:c,max:d}}}};$("LineBucket",j0,{omit:["layers","patternFeatures"]});var Hm,IS=()=>Hm||(Hm=new ge({"line-cap":new tt(F.layout_line["line-cap"],"line-cap"),"line-join":new tt(F.layout_line["line-join"],"line-join"),"line-miter-limit":new tt(F.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new tt(F.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new tt(F.layout_line["line-sort-key"],"line-sort-key")})),Xm,AS=()=>Xm||(Xm=new ge({"line-opacity":new tt(F.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new j(F.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new tt(F.paint_line["line-color"],"line-color"),"line-translate":new j(F.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new j(F.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new tt(F.paint_line["line-width"],"line-width"),"line-gap-width":new tt(F.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new tt(F.paint_line["line-offset"],"line-offset"),"line-blur":new tt(F.paint_line["line-blur"],"line-blur"),"line-dasharray":new rs(F.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new rs(F.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Vl(F.paint_line["line-gradient"],"line-gradient")})),Ym={get paint(){return AS()},get layout(){return IS()}},MS=class extends tt{possiblyEvaluate(t,e){return e=new Ct(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=q({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}},Ao,U0=t=>t.type==="line",FS=class extends Li{constructor(t,e){super(t,Ym,e),this.gradientVersion=0,Ao||(Ao=new MS(Ym.paint.properties["line-width"].specification,"line-floorwidth"),Ao.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=Qw(e)?e._styleExpression.expression instanceof ad:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Ao.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new j0(t)}queryRadius(t){let e=t,i=Km(ja("line-width",this,e),ja("line-gap-width",this,e)),r=ja("line-offset",this,e);return i/2+Math.abs(r)+Nl(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:a,pixelsToTileUnits:n}){let s=$l(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,n),o=n/2*Km(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),l=this.paint.get("line-offset").evaluate(e,i);return l&&(r=sE(r,l*n)),tE(s,r,o)}isTileClipped(){return!0}};function Km(t,e){return e>0?e+2*t:t}var zS=Yt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),RS=Yt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Yt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var kS=Yt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Yt([{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"}]);var Jm=Yt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),N0=Yt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Yt([{name:"triangle",components:3,type:"Uint16"}]),Yt([{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"},{type:"Float32",name:"heightOffset"}]),Yt([{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"},{type:"Float32",name:"heightOffset"}]),Yt([{type:"Float32",name:"offsetX"}]),Yt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Yt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var al=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(al.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}
vendor: 4,732 bytes, line 822
822async syncState(t,e){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let i=t.pluginURL,r=new Promise(n=>{this.loadScriptResolve=n}),a=new Promise(n=>setTimeout(()=>n(),this.TIMEOUT));if(await e(i),await Promise.race([r,a]),this.isParsed()){let n={pluginStatus:"loaded",pluginURL:i};return this.setState(n),n}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${i}`)}};function LS(t){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}function BS(t){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}function $0(t){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function OS(t){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function Xl(t){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20
822DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(t))}function VS(t){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(t))}function jS(t){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE4
8220\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(t)}function Qm(t){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(t))}function US(t,e){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(t)||/^\p{gc=Mc}/u.test(e)}var NS={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},$S={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,6437
vendor: 11,747 bytes, line 822
8227],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},GS={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},tg=1604,ZS=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/;function qS(t,e,i){let r=0;for(let a of t.split(";")){let[n,s]=a.split(",").map(l=>parseInt(l,36)),o=r+n;for(let l=o;l<o+s;l++)i.set(l,e);r=o+s}}var G0=new Map;for(let[t,e]of Object.entries(NS))qS(e,t,G0);function WS(t){return G0.get(t)??"U"}function HS(t){return t==="D"||t==="L"||t==="C"}function XS(t){return t==="D"||t==="R"||t==="C"}function YS(t,e,i){return t==="D"?e&&i?3:e?1:i?2:0:t==="R"?+!!e:t==="L"?i?2:0:null}function KS(t){return[...t].map(e=>{let i=e.codePointAt(0);return{codePoint:i,type:WS(i),form:null}})}function JS(t){let e=t.filter(i=>i.type!=="T");for(let i=0;i<e.length;i++){let r=e[i],a=i>0&&HS(e[i-1].type),n=i+1<e.length&&XS(e[i+1].type);r.form=YS(r.type,a,n)}}function QS(t){let e=!1;for(let i of t)i.type==="T"?i.form=e?3:0:e=i.form===2||i.form===3}function tD(t){let e=[];for(let i=0;i<t.length;i++){let r=t[i];if(r.codePoint!==tg){e.push(r);continue}let a=i+1;for(;a<t.length&&t[a].type==="T";)a++;let n=t[a],s=n&&GS[String.fromCodePoint(tg,n.codePoint)];if(!s){e.push(r);continue}let o=r.form===3||r.form===1;e.push({codePoint:s[+!!o],type:"R",form:0}),e.push(...t.slice(i+1,a)),i=a}return e}function eD(t){if(t.form===null)return t.codePoint;let e=$S[t.codePoint];return e&&(e[t.form]||e[0])||t.codePoint}function iD(t){if(!ZS.test(t))return t;let e=KS(t);return JS(e),QS(e),tD(e).map(i=>String.fromCodePoint(eD(i))).join("")}function rD(t,e,i){let r=e.layout.get("text-transform").evaluate(i,{});return r==="uppercase"?t=t.toLocaleUpperCase():r==="lowercase"&&(t=t.toLocaleLowerCase()),(al.applyArabicShaping??iD)(t)}function aD(t,e,i){for(let r of t.sections)r.text=rD(r.text,e,i);return t}function bh(t,e,i){let r=i?e.last.points:e.first.points,a=i?r[r.length-1]:r[0];return`${t}:${a.x}:${a.y}`}function nD(t){let e=t.first.points,i=e.length;for(let n=t.first.next;n;n=n.next)i+=n.points.length-1;let r=Array(i);for(let n=0;n<e.length;n++)r[n]=e[n];let a=e.length;for(let n=t.first.next;n;n=n.next){let s=n.points;for(let o=1;o<s.length;o++)r[a++]=s[o]}return r}function eg(t,e,i,r,a){let n=e[i];delete e[i],e[r]=n;let s=t[n];return s.last.next=a.first,s.last=a.last,n}function ig(t,e,i,r,a){let n=e[r];delete e[r],e[i]=n;let s=t[n];return a.last.next=s.first,s.first=a.first,n}function sD(t){let e={},i={},r=[];for(let n of t){let s=n.text?n.text.toString():null,o={points:n.geometry[0],next:null},l={feature:n,first:o,last:o};if(!s){r.push(l);continue}let u=bh(s,l),h=bh(s,l,!0);if(u in i&&h in e&&i[u]!==e[h]){let c=ig(r,e,u,h,l),d=eg(r,i,u,h,r[c]);delete e[u],delete i[h],i[bh(s,r[d],!0)]=d,r[c].feature.geometry=null}else if(u in i)eg(r,i,u,h,l);else if(h in e)ig(r,e,u,h,l);else{let c=r.push(l)-1;e[u]=c,i[h]=c}}let a=[];for(let n of r){let s=n.feature;s.geometry&&(n.first.next&&(s.geometry[0]=nD(n)),a.push(s))}return a}var Z0=typeof Intl<"u"&&"Segmenter"in Intl,wh,Th;function Pc(t){if(!Z0||!jS(t))return[...t];wh??(wh=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let e=[];for(let{segment:i}of wh.segment(t)){let r=e.length-1;r>=0&&US(e[r],i)?e[r]+=i:e.push(i)}return e}function oD(t){let e=new Set;if(Z0){Th??(Th=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:r}of Th.segment(t))e.add(r);return e}let i=0;for(let r of t.split(/\b|(?=\p{Ideo})/u))e.add(i),i+=r.length;return e}function As(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function Bd(t){return/\s/u.test(String.fromCodePoint(t))}function Cc(t){for(let e of t)if(Xl(e.codePointAt(0)))return!0;return!1}function lD(t){for(let e of t)if(!uD(e.codePointAt(0)))return!1;return!0}function uD(t){return!LS(t)}function rg(t){return!(Xl(t)||VS(t))}function q0(t){return/\p{sc=Arab}/u.test(String.fromCodePoint(t))}function W0(t){return BS(t)}function H0(t){for(let e of t)if(W0(e.codePointAt(0)))return!0;return!1}var Ba={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u22EF":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function hD(t){let e="",i={premature:!0,value:void 0},r=t[Symbol.iterator](),a=r.next(),n=t[Symbol.iterator]();n.next();let s=n.next();for(;!a.done;)(s.done||!rg(s.value.codePointAt(0))||Ba[s.value])&&(i.premature||!rg(i.value.codePointAt(0))||Ba[i.value])&&Ba[a.value]?e+=Ba[a.value]:e+=a.value,i={value:a.value,premature:!1},a=r.next(),s=n.next();return e}var cD={10:!0,13:!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},dD={40:!0};function ag(t,e,i,r,a,n){if("fontStack"in e){let s=i[e.fontStack],o=s?.[t];if(o)return o.metrics.advance*e.scale+a;let l=0;for(let u of t){let h=s?.[u];h&&(l+=h.metrics.advance*e.scale+a)}return l}{let s=r[e.imageName];return s?s.displaySize[0]*e.scale*24/n+a:0}}function ng(t,e,i,r){let a=(t-e)**2;return r?t<e?a/2:a*2:a+Math.abs(i)*i}function sg(t){return/^\s+$/u.test(t)}function pD(t,e,i){let r=0;return(t===10||t===13)&&(r-=1e4),i&&(r+=150),(t===40||t===65288)&&(r+=50),(e===41||e===65289)&&(r+=50),r}function og(t,e,i,r,a,n){let s=null,o=ng(e,i,a,n);for(let l of r){let u=ng(e-l.x,i,a,n)+l.badness;u<=o&&(s=l,o=u)}return{index:t,x:e,priorBreak:s,badness:o}}function X0(t){return t?X0(t.priorBreak).concat(t.index):[]}var Od=class Ic{constructor(e="",i=[],r=[]){this.text=e,this.sections=i,this.sectionIndex=r,this.imageSectionID=null,this._graphemes=null}graphemes(){return this._graphemes??(this._graphemes=Pc(this.text)),this._graphemes}static fromFeature(e,i){let r=new Ic;for(let a of e.sections)a.image?r.addImageSection(a):r.addTextSection(a,i);return r}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=hD(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let e=this.graphemes(),i=0;for(;i<e.length&&sg(e[i]);)i++;let r=e.length;for(;r>i&&sg(e[r-1]);)r--;this.text=e.slice(i,r).join(""),this.sectionIndex=this.sectionIndex.slice(i,r),this._graphemes=null}substring(e,i){let r=this.graphemes().slice(e,i).join(""),a=this.sectionIndex.slice(e,i);return new Ic(r,this.sections,a)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,i)=>Math.max(e,this.sections[i].scale),0)}getMaxImageSize(e){let i=0,r=0;for(let a=0;a<this.length();a++){let n=this.getSection(a);if("imageName"in n){let s=e[n.imageName];if(!s)continue;let o=s.displaySize;i=Math.max(i,o[0]),r=Math.max(r,o[1])}}return{maxImageWidth:i,maxImageHeight:r}}_appendSection(e,i){let r=this.graphemes(),a=r.length>0?r[r.length-1]:"",n=Pc(a+e);this.text+=e,this._graphemes=r.slice(0,a?-1:void 0).concat(n);let s=n.length-+!!a;for(let o=0;o<s;o++)this.sectionIndex.push(i)}addTextSection(e,i){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||i}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let i=e.image?e.image.name:"";if(i.length===0){ft("Can't add FormattedSection with an empty image.");return}let r=this.getNextImageSectionCharCode();if(!r){ft("Reached maximum number of images 6401");return}this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:i}),this._appendSection(String.fromCharCode(r),this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,i,r,a,n){let s=[],o=this.determineAverageLineWidth(e,i,r,a,n),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,d=0;for(let p=0;p<u.length;p++){let f=u[p];if(p>0){let m=u[p-1].codePointAt(0),g=f.codePointAt(0),_=OS(m),y=Qm(m)&&Qm(g);(cD[m]||_||"imageName"in this.getSection(p-1)||u[p+1]!==void 0&&dD[g]||y&&(h??(h=oD(this.text))).has(d))&&s.push(og(p,c,o,s,pD(m,g,_&&l),!1))}Bd(f.codePointAt(0))||(c+=ag(f,this.getSection(p),r,a,e,n)),d+=f.length}return X0(og(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,i,r,a,n){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=ag(u,h,r,a,e,n),o++}let l=Math.max(1,Math.ceil(s/i));return s/l}};function fD(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,
822119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},r={};i.L=1,r[1]="L",Object.keys(e).forEach(function(Z,it){i[Z]=1<<it+1,r[i[Z]]=Z}),Object.freeze(i);var a=i.LRI|i.RLI|i.FSI,n=i.L|i.R|i.AL,s=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,o=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,l=i.S|i.WS|i.B|a|i.PDI|o,u=null;function h(){if(!u){u=new Map;var Z=0;for(var it in e)if(e.hasOwnProperty(it))for(var rt=e[it],O="",Tt=void 0,H=!1,W=0,X=0;X<=rt.length+1;X+=1){var yt=rt[X];if(yt!==","&&X!==rt.length)yt==="+"?(H=!0,W=Z=W+parseInt(O,36),O=""):O+=yt;else{H?Tt=Z+parseInt(O,36):(W=Z=W+parseInt(O,36),Tt=Z),H=!1,O="",W=Tt;for(var Bt=Z;Bt<Tt+1;Bt+=1)u.set(Bt,i[it])}}}}function c(Z){return h(),u.get(Z.codePointAt(0))||i.L}function d(Z){return r[c(Z)]}var p={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function f(Z,it){var rt=0,O=new Map,Tt=it&&new Map,H;return Z.split(",").forEach(function W(X){if(X.indexOf("+")!==-1)for(var yt=+X;yt--;)W(H);else{H=X;var Bt=X.split(">"),xt=Bt[0],le=Bt[1];xt=String.fromCodePoint(rt+=parseInt(xt,36)),le=String.fromCodePoint(rt+=parseInt(le,36)),O.set(xt,le),it&&Tt.set(le,xt)}}),{map:O,reverseMap:Tt}}var m,g,_;function y(){if(!m){var Z=f(p.pairs,!0),it=Z.map,rt=Z.reverseMap;m=it,g=rt,_=f(p.canonical,!1).map}}function x(Z){return y(),m.get(Z)||null}function v(Z){return y(),g.get(Z)||null}function w(Z){return y(),_.get(Z)||null}var b=i.L,T=i.R,D=i.EN,E=i.ES,M=i.ET,R=i.AN,z=i.CS,P=i.B,S=i.S,I=i.ON,A=i.BN,L=i.NSM,G=i.AL,U=i.LRO,et=i.RLO,ot=i.LRE,Pt=i.RLE,vt=i.PDF,ee=i.LRI,Lt=i.RLI,Wt=i.FSI,kt=i.PDI;function Pe(Z,it){for(var rt=125,O=new Uint32Array(Z.length),Tt=0;Tt<Z.length;Tt++)O[Tt]=c(Z[Tt]);var H=new Map;function W(Xe,Ii){var Ye=O[Xe];O[Xe]=Ii,H.set(Ye,H.get(Ye)-1),Ye&s&&H.set(s,H.get(s)-1),H.set(Ii,(H.get(Ii)||0)+1),Ii&s&&H.set(s,(H.get(s)||0)+1)}for(var X=new Uint8Array(Z.length),yt=new Map,Bt=[],xt=null,le=0;le<Z.length;le++)xt||Bt.push(xt={start:le,end:Z.length-1,level:it==="rtl"?1:it==="ltr"?0:Zf(le,!1)}),O[le]&P&&(xt.end=le,xt=null);for(var $r=Pt|ot|et|U|a|kt|vt|P,ar=function(Xe){return Xe+(Xe&1?1:2)},Ni=function(Xe){return Xe+(Xe&1?2:1)},je=0;je<Bt.length;je++){xt=Bt[je];var Rt=[{_level:xt.level,_override:0,_isolate:0}],Ht=void 0,pi=0,fi=0,wa=0;H.clear();for(var ue=xt.start;ue<=xt.end;ue++){var Ce=O[ue];if(Ht=Rt[Rt.length-1],H.set(Ce,(H.get(Ce)||0)+1),Ce&s&&H.set(s,(H.get(s)||0)+1),Ce&$r)if(Ce&(Pt|ot)){X[ue]=Ht._level;var vf=(Ce===Pt?Ni:ar)(Ht._level);vf<=rt&&!pi&&!fi?Rt.push({_level:vf,_override:0,_isolate:0}):pi||fi++}else if(Ce&(et|U)){X[ue]=Ht._level;var xf=(Ce===et?Ni:ar)(Ht._level);xf<=rt&&!pi&&!fi?Rt.push({_level:xf,_override:Ce&et?T:b,_isolate:0}):pi||fi++}else if(Ce&a){Ce&Wt&&(Ce=Zf(ue+1,!0)===1?Lt:ee),X[ue]=Ht._level,Ht._override&&W(ue,Ht._override);var bf=(Ce===Lt?Ni:ar)(Ht._level);bf<=rt&&pi===0&&fi===0?(wa++,Rt.push({_level:bf,_override:0,_isolate:1,_isolInitIndex:ue})):pi++}else if(Ce&kt){if(pi>0)pi--;else if(wa>0){for(fi=0;!Rt[Rt.length-1]._isolate;)Rt.pop();var Ru=Rt[Rt.length-1]._isolInitIndex;Ru!=null&&(yt.set(Ru,ue),yt.set(ue,Ru)),Rt.pop(),wa--}Ht=Rt[Rt.length-1],X[ue]=Ht._level,Ht._override&&W(ue,Ht._override)}else Ce&vt?(pi===0&&(fi>0?fi--:!Ht._isolate&&Rt.length>1&&(Rt.pop(),Ht=Rt[Rt.length-1])),X[ue]=Ht._level):Ce&P&&(X[ue]=xt.level);else X[ue]=Ht._level,Ht._override&&Ce!==A&&W(ue,Ht._override)}for(var Ta=[],$i=null,Gr=xt.start;Gr<=xt.end;Gr++){var ku=O[Gr];if(!(ku&o)){var wf=X[Gr],Tf=ku&a,qb=ku===kt;$i&&wf===$i._level?($i._end=Gr,$i._endsWithIsolInit=Tf):Ta.push($i={_start:Gr,_end:Gr,_level:wf,_startsWithPDI:qb,_endsWithIsolInit:Tf})}}for(var Lu=[],ao=0;ao<Ta.length;ao++){var no=Ta[ao];if(!no._startsWithPDI||no._startsWithPDI&&!yt.has(no._start)){for(var Bu=[$i=no],Ef=void 0;$i&&$i._endsWithIsolInit&&(Ef=yt.get($i._end))!=null;)for(var so=ao+1;so<Ta.length;so++)if(Ta[so]._start===Ef){Bu.push($i=Ta[so]);break}for(var Ea=[],Ou=0;Ou<Bu.length;Ou++)for(var Sf=Bu[Ou],Vu=Sf._start;Vu<=Sf._end;Vu++)Ea.push(Vu);for(var Wb=X[Ea[0]],Df=xt.level,oo=Ea[0]-1;oo>=0;oo--)if(!(O[oo]&o)){Df=X[oo];break}var ju=Ea[Ea.length-1],Hb=X[ju],Pf=xt.level;if(!(O[ju]&a)){for(var lo=ju+1;lo<=xt.end;lo++)if(!(O[lo]&o)){Pf=X[lo];break}}Lu.push({_seqIndices:Ea,_sosType:Math.max(Df,Wb)%2?T:b,_eosType:Math.max(Pf,Hb)%2?T:b})}}for(var Uu=0;Uu<Lu.length;Uu++){var Nu=Lu[Uu],at=Nu._seqIndices,xn=Nu._sosType,Xb=Nu._eosType,Sa=X[at[0]]&1?T:b;if(H.get(L))for(var uo=0;uo<at.length;uo++){var Cf=at[uo];if(O[Cf]&L){for(var $u=xn,ho=uo-1;ho>=0;ho--)if(!(O[at[ho]]&o)){$u=O[at[ho]];break}W(Cf,$u&(a|kt)?I:$u)}}if(H.get(D))for(var co=0;co<at.length;co++){var If=at[co];if(O[If]&D)for(var po=co-1;po>=-1;po--){var Af=po===-1?xn:O[at[po]];if(Af&n){Af===G&&W(If,R);break}}}if(H.get(G))for(var Gu=0;Gu<at.length;Gu++){var Mf=at[Gu];O[Mf]&G&&W(Mf,T)}if(H.get(E)||H.get(z))for(var bn=1;bn<at.length-1;bn++){var Zu=at[bn];if(O[Zu]&(E|z)){for(var Da=0,qu=0,Wu=bn-1;Wu>=0&&(Da=O[at[Wu]],Da&o);Wu--);for(var Hu=bn+1;Hu<at.length&&(qu=O[at[Hu]],qu&o);Hu++);Da===qu&&(O[Zu]===E?Da===D:Da&(D|R))&&W(Zu,Da)}}if(H.get(D)){for(var Gi=0;Gi<at.length;
vendor: 2,335 bytes, line 822
822Gi++)if(O[at[Gi]]&D){for(var fo=Gi-1;fo>=0&&O[at[fo]]&(M|o);fo--)W(at[fo],D);for(Gi++;Gi<at.length&&O[at[Gi]]&(M|o|D);Gi++)O[at[Gi]]!==D&&W(at[Gi],D)}}if(H.get(M)||H.get(E)||H.get(z))for(var wn=0;wn<at.length;wn++){var Ff=at[wn];if(O[Ff]&(M|E|z)){W(Ff,I);for(var mo=wn-1;mo>=0&&O[at[mo]]&o;mo--)W(at[mo],I);for(var go=wn+1;go<at.length&&O[at[go]]&o;go++)W(at[go],I)}}if(H.get(D))for(var Xu=0,zf=xn;Xu<at.length;Xu++){var Rf=at[Xu],Yu=O[Rf];Yu&D?zf===b&&W(Rf,b):Yu&n&&(zf=Yu)}if(H.get(s)){for(var Tn=T|D|R,kf=Tn|b,_o=[],Pa=[],Ca=0;Ca<at.length;Ca++)if(O[at[Ca]]&s){var En=Z[at[Ca]],Lf=void 0;if(x(En)!==null)if(Pa.length<63)Pa.push({char:En,seqIndex:Ca});else break;else if((Lf=v(En))!==null)for(var Sn=Pa.length-1;Sn>=0;Sn--){var Ku=Pa[Sn].char;if(Ku===Lf||Ku===v(w(En))||x(w(Ku))===En){_o.push([Pa[Sn].seqIndex,Ca]),Pa.length=Sn;break}}}_o.sort(function(Xe,Ii){return Xe[0]-Ii[0]});for(var Ju=0;Ju<_o.length;Ju++){for(var Bf=_o[Ju],yo=Bf[0],Qu=Bf[1],Of=!1,Zi=0,th=yo+1;th<Qu;th++){var Vf=at[th];if(O[Vf]&kf){Of=!0;var jf=O[Vf]&Tn?T:b;if(jf===Sa){Zi=jf;break}}}if(Of&&!Zi){Zi=xn;for(var eh=yo-1;eh>=0;eh--){var Uf=at[eh];if(O[Uf]&kf){var Nf=O[Uf]&Tn?T:b;Zi=Nf===Sa?Sa:Nf;break}}}if(Zi){if(O[at[yo]]=O[at[Qu]]=Zi,Zi!==Sa){for(var Dn=yo+1;Dn<at.length;Dn++)if(!(O[at[Dn]]&o)){c(Z[at[Dn]])&L&&(O[at[Dn]]=Zi);break}}if(Zi!==Sa){for(var Pn=Qu+1;Pn<at.length;Pn++)if(!(O[at[Pn]]&o)){c(Z[at[Pn]])&L&&(O[at[Pn]]=Zi);break}}}}for(var wr=0;wr<at.length;wr++)if(O[at[wr]]&s){for(var $f=wr,ih=wr,rh=xn,Cn=wr-1;Cn>=0;Cn--)if(O[at[Cn]]&o)$f=Cn;else{rh=O[at[Cn]]&Tn?T:b;break}for(var Gf=Xb,In=wr+1;In<at.length;In++)if(O[at[In]]&(s|o))ih=In;else{Gf=O[at[In]]&Tn?T:b;break}for(var ah=$f;ah<=ih;ah++)O[at[ah]]=rh===Gf?rh:Sa;wr=ih}}}for(var ii=xt.start;ii<=xt.end;ii++){var Yb=X[ii],vo=O[ii];if(Yb&1?vo&(b|D|R)&&X[ii]++:vo&T?X[ii]++:vo&(R|D)&&(X[ii]+=2),vo&o&&(X[ii]=ii===0?xt.level:X[ii-1]),ii===xt.end||c(Z[ii])&(S|P))for(var xo=ii;xo>=0&&c(Z[xo])&l;xo--)X[xo]=xt.level}}return{levels:X,paragraphs:Bt};function Zf(Xe,Ii){for(var Ye=Xe;Ye<Z.length;Ye++){var Tr=O[Ye];if(Tr&(T|G))return 1;if(Tr&(P|b)||Ii&&Tr===kt)return 0;if(Tr&a){var qf=Kb(Ye);Ye=qf===-1?Z.length:qf}}return 0}function Kb(Xe){for(var Ii=1,Ye=Xe+1;Ye<Z.length;Ye++){var Tr=O[Ye];if(Tr&P)break;if(Tr&kt){if(--Ii===0)return Ye}else Tr&a&&Ii++}return-1}}var ze="14>1,j>2,t>2,u>2,1a>g,2v3>
8221,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",qe;function We(){if(!qe){var Z=f(ze,!0),it=Z.map;Z.reverseMap.forEach(function(rt,O){it.set(O,rt)}),qe=it}}function Vt(Z){return We(),qe.get(Z)||null}function He(Z,it,rt,O){var Tt=Z.length;rt=Math.max(0,rt==null?0:+rt),O=Math.min(Tt-1,O==null?Tt-1:+O);for(var H=new Map,W=rt;W<=O;W++)if(it[W]&1){var X=Vt(Z[W]);X!==null&&H.set(W,X)}return H}function Ci(Z,it,rt,O){var Tt=Z.length;rt=Math.max(0,rt==null?0:+rt),O=Math.min(Tt-1,O==null?Tt-1:+O);var H=[];return it.paragraphs.forEach(function(W){var X=Math.max(rt,W.start),yt=Math.min(O,W.end);if(X<yt){for(var Bt=it.levels.slice(X,yt+1),xt=yt;xt>=X&&c(Z[xt])&l;xt--)Bt[xt]=W.level;for(var le=W.level,$r=1/0,ar=0;ar<Bt.length;ar++){var Ni=Bt[ar];Ni>le&&(le=Ni),Ni<$r&&($r=Ni|1)}for(var je=le;je>=$r;je--)for(var Rt=0;Rt<Bt.length;Rt++)if(Bt[Rt]>=je){for(var Ht=Rt;Rt+1<Bt.length&&Bt[Rt+1]>=je;)Rt++;Rt>Ht&&H.push([Ht+X,Rt+X])}}}),H}function Ui(Z,it,rt,O){var Tt=di(Z,it,rt,O),H=[].concat(Z);return Tt.forEach(function(W,X){H[X]=(it.levels[W]&1?Vt(Z[W]):null)||Z[W]}),H.join("")}function di(Z,it,rt,O){for(var Tt=Ci(Z,it,rt,O),H=[],W=0;W<Z.length;W++)H[W]=W;return Tt.forEach(function(X){for(var yt=X[0],Bt=X[1],xt=H.slice(yt,Bt+1),le=xt.length;le--;)H[Bt-le]=xt[le]}),H}return t.closingToOpeningBracket=v,t.getBidiCharType=c,t.getBidiCharTypeName=d,t.getCanonicalBracket=w,t.getEmbeddingLevels=Pe,t.getMirroredCharacter=Vt,t.getMirroredCharactersMap=He,t.getReorderSegments=Ci,t.getReorderedIndices=di,t.getReorderedString=Ui,t.openingToClosingBracket=x,Object.defineProperty(t,"__esModule",{value:!0}),t})({})}var Vd=fD(),mD=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,gD=new Set(["WS","FSI","LRI","RLI","PDI"]),_D=new Set(["S","B"]);function yD(t,e,i,r){let a=[],n=i;for(let s of Pc(t.slice(i,r)))a.push({index:n,text:s,level:e[n]}),n+=s.length;return a}function vD(t,e){let i=!0;for(let r=t.length-1;r>=0;r--){let a=Vd.getBidiCharTypeName(t[r].text[0]);_D.has(a)?(t[r].level=e,i=!0):i&&gD.has(a)?t[r].level=e:i=!1}}function xD(t,e){let i=e,r=1/0;for(let{level:n}of t)n>i&&(i=n),(n|1)<r&&(r=n|1);let a=t.slice();for(let n=i;n>=r;n--)for(let s=0;s<a.length;s++){if(a[s].level<n)continue;let o=s;for(;o+1<a.length&&a[o+1].level>=n;)o++;for(let l=s,u=o;l<u;l++,u--)[a[l],a[u]]=[a[u],a[l]];s=o}return a}function bD(t){return t.level%2==0?t.text:Vd.getMirroredCharacter(t.text)??t.text}function wD(t,e){return t.find(i=>e>=i.start&&e<=i.end)?.level??0}function TD(t,e,i,r,a){let n=yD(t,e,r,a);vD(n,i);let s="",o=[];for(let l of xD(n,i)){if(mD.test(l.text))continue;let u=bD(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function ED(t,e){let i=e.filter(n=>n>0&&n<t.length),r=[...new Set([0,...i,t.length])].sort((n,s)=>n-s),a=[];for(let n=0;n+1<r.length;n++)a.push([r[n],r[n+1]]);return a}function Y0(t,e){let{levels:i,paragraphs:r}=Vd.getEmbeddingLevels(t);return ED(t,e.concat(r.map(a=>a.start))).map(([a,n])=>TD(t,i,wD(r,a),a,n))}function SD(t,e){return Y0(t,e).map(i=>i.text)}function DD(t,e,i){return Y0(t,i).map(r=>[r.text,r.sourceIndices.map(a=>e[a]??0)])}var Ac=4294967296,KR=1/Ac,lg=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),K0=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,i=this.length){let r;for(;r=this.nextField(i);)t(r,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Ac;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Ac;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,i=e[this.pos++];if(i<128)return i;let r=i&127,a;return a=e[this.pos++],r|=(a&127)<<7,a<128||(a=e[this.pos++],r|=(a&127)<<14,a<128)||(a=e[this.pos++],r|=(a&127)<<21,a<128)?r:(a=e[this.pos],r|=(a&15)<<28,PD(r,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&lg?lg.decode(this.buf.subarray(e,t)):ID(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}};function PD(t,e,i){let r=i.buf,a,n;if(n=r[i.pos++],a=(n&112)>>4,n<128||(n=r[i.pos++],a|=(n&127)<<3,n<128)||(n=r[i.pos++],a|=(n&127)<<10,n<128)||(n=r[i.pos++],a|=(n&127)<<17,n<128)||(n=r[i.pos++],a|=(n&127)<<24,n<128)||(n=r[i.pos++],a|=(n&1)<<31,n<128))return CD(t,a,e);throw Error("Expected varint not more than 10 bytes")}function CD(t,e,i){return i?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function ID(t,e,i){let r="",a=e;for(;a<i;){let n=t[a],s=null,o=n>239?4:n>223?3:n>191?2:1;if(a+o>i)break;let l,u,h;o===1?n<128&&(s=n):o===2?(l=t[a+1],(l&192)==128&&(s=(n&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[a+1],u=t[a+2],(l&192)==128&&(u&192)==128&&(s=(n&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[a+1],u=t[a+2],h=t[a+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(n&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,r+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),r+=String.fromCharCode(s),a+=o}return r}function AD(t,e,i){t===1&&i.readMessage(MD,e)}function MD(t,e,i){if(t===3){let{id:r,bitmap:a,width:n,height:s,left:o,top:l,advance:u}=i.readMessage(FD,{});
vendor: 21,886 bytes, line 822
822e.push({id:r,bitmap:new Gl({width:n+6,height:s+6},a),metrics:{width:n,height:s,left:o,top:l,advance:u}})}}function FD(t,e,i){t===1?e.id=i.readVarint():t===2?e.bitmap=i.readBytes():t===3?e.width=i.readVarint():t===4?e.height=i.readVarint():t===5?e.left=i.readSVarint():t===6?e.top=i.readSVarint():t===7&&(e.advance=i.readVarint())}function J0(t){return new K0(t).readFields(AD,[])}function Ms(t){return typeof t?.renderWithWebGL=="function"}function Q0(t){let{userImage:e}=t;return!e?.render||!e.render()?!1:(Ms(e.data)||t.data.replace(new Uint8Array(e.data.buffer)),!0)}function jd(t){let e=0,i=0;for(let s of t)e+=s.w*s.h,i=Math.max(i,s.w);t.sort((s,o)=>o.h-s.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],a=0,n=0;for(let s of t)for(let o=r.length-1;o>=0;o--){let l=r[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,n=Math.max(n,s.y+s.h),a=Math.max(a,s.x+s.w),s.w===l.w&&s.h===l.h){let u=r.pop();u&&o<r.length&&(r[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(r.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:a,h:n,fill:e/(a*n)||0}}var Yl=class{constructor(t,{pixelRatio:e,version:i,isWebGLImage:r=!1,stretchX:a,stretchY:n,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=a,this.stretchY=n,this.content=s,this.version=i,this.needsFirstWebGLRender=r,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},zD=class{constructor(t,e){let i={},r={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let a=[];this.addImages(t,i,a),this.addImages(e,r,a);let{w:n,h:s}=jd(a),o=new Ot({width:n||1,height:s||1});for(let l in t){let u=t[l];if(u.isWebGLImage)continue;let h=i[l].paddedRect;Ot.copy(u.data,o,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(let l in e){let u=e[l],h=r[l].paddedRect,c=h.x+1,d=h.y+1,p=u.data.width,f=u.data.height;Ot.copy(u.data,o,{x:0,y:0},{x:c,y:d},u.data),Ot.copy(u.data,o,{x:0,y:f-1},{x:c,y:d-1},{width:p,height:1}),Ot.copy(u.data,o,{x:0,y:0},{x:c,y:d+f},{width:p,height:1}),Ot.copy(u.data,o,{x:p-1,y:0},{x:c-1,y:d},{width:1,height:f}),Ot.copy(u.data,o,{x:0,y:0},{x:c+p,y:d},{width:1,height:f})}this.image=o,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(let r in t){let a=t[r],n={x:0,y:0,w:a.data.width+2,h:a.data.height+2};i.push(n),e[r]=new Yl(n,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){this.patchedUpdateVersion=t.updateVersion;for(let i in this.iconPositions)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e);for(let i in this.patternPositions)this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}}patchUpdatedImage(t,e,i){if(!t||!e||!t.needsFirstWebGLRender&&t.version===e.version)return;t.needsFirstWebGLRender=!1,t.version=e.version;let[r,a]=t.tl,n=e.userImage?.data;if(!Ms(n)){i.update(e.data,void 0,{x:r,y:a});return}let{width:s,height:o}=e.data;i.context.setCustomLayerDefaults(),n.renderWithWebGL({gl:i.context.gl,texture:i.texture,x:r,y:a,width:s,height:o}),i.context.setDirty()}};$("ImagePosition",Yl),$("ImageAtlas",zD);var t1=(function(t){return t[t.none=0]="none",t[t.horizontal=1]="horizontal",t[t.vertical=2]="vertical",t[t.horizontalOnly=3]="horizontalOnly",t})(t1||{});function RD(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}function kD(t,e){let i=[],r=0;for(let a of e)i.push(t.substring(r,a)),r=a;return r<t.length()&&i.push(t.substring(r,t.length())),i}var ug=/^\p{gc=M}$/u;function LD(t){let e=[],i=0;for(;i<t.length;){if(!ug.test(t[i])){e.push(i),i++;continue}let r=i;for(;r<t.length&&ug.test(t[r]);)r++;let a=t[r];if(a!==void 0&&W0(a.codePointAt(0))){e.push(r);for(let n=r-1;n>=i;n--)e.push(n);i=r+1}else{for(let n=i;n<r;n++)e.push(n);i=r}}return e}function BD(t){let e=[],i=0;for(let r of t.graphemes())e.push(...Array(r.length).fill(t.sectionIndex[i])),i++;return e}function OD(t,e){let i=e.map(n=>t.toCodeUnitIndex(n)),r=al.isParsed()?al:null;if(t.sections.length===1)return r?r.processBidirectionalText(t.toString(),i).map(n=>hg(n,t.sections,[...n].map(()=>0))):SD(t.toString(),i).map(n=>Mc([...n],t.sections,[...n].map(()=>0)));let a=BD(t);return r?r.processStyledBidirectionalText(t.text,a,i).map(([n,s])=>hg(n,t.sections,s)):DD(t.text,a,i).map(([n,s])=>{let o=[...n];return Mc(o,t.sections,e1(o).map(l=>s[l]??0))})}function Mc(t,e,i){let r=new Od(t.join(""),e,[]),a=0;for(let n of r.graphemes())r.sectionIndex.push(i[a]??0),a+=[...n].length;return r}function e1(t){let e=[],i=0;for(let r of t)e.push(i),i+=r.length;return e}function hg(t,e,i){let r=[...t],a=e1(r),n=LD(r);return Mc(n.map(s=>r[s]),e,n.map(s=>i[a[s]]??0))}function Mo(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f){let m=Od.fromFeature(t,a);c===2&&m.verticalizePunctuation();let g=m.determineLineBreaks(u,n,e,r,p),_=H0(m.text)?OD(m,g):kD(m,g),y=[],x={positionedLines:y,text:m.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return WD(x,e,i,r,_,s,o,l,c,u,d,f),!RD(y)&&x}function Fs(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function VD(t,e,i){let r=e.getMaxScale()*24,{maxImageWidth:a,maxImageHeight:n}=e.getMaxImageSize(t),s=Math.max(r,n*i);return{verticalLineContentWidth:Math.max(r,a*i),horizontalLineContentHeight:s}}function i1(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function jD(t,e,i,r){if(t?.rect)return t;let a=e[i.fontStack]?.[r];return a?{rect:null,metrics:a.metrics}:null}function UD(t,e,i){return!(t===1||!e&&!Xl(i)||e&&(Bd(i)||q0(i)))}function No(t){return/\p{Nd}/u.test(String.fromCodePoint(t))}function r1(t){return/\p{Lu}/u.test(String.fromCodePoint(t))}function ND(t){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(t))}function $D(t){let e=t.some(No)&&t.every(r=>No(r)||ND(r)),i=t.length<=3&&t.every(r=>r1(r)||No(r));return e||i}function GD(t){return(No(t)||r1(t))&&!q0(t)}function ZD(t,e){let i=!1;for(let r=0;r<t.length;r++){if(e[r])continue;let a=Ba[t[r]];a&&(r===0||e[r-1])&&(r===t.length-1||e[r+1])&&(t[r]=a,e[r]=!0,i=!0)}return i}function qD(t){let e=t.graphemes().slice(),i=e.map(n=>n.codePointAt(0)),r=i.map(Xl),a=n=>!r[n]&&!Bd(i[n])&&!("imageName"in t.getSection(n));for(let n=0;n<i.length;n++){if(!a(n))continue;let s=n;for(;s+1<i.length&&a(s+1);)s++;if($D(i.slice(n,s+1)))for(let o=n;o<=s;o++)r[o]=GD(i[o]);n=s}return ZD(e,r)&&(t.text=e.join(""),t._graphemes=null),r}function WD(t,e,i,r,a,n,s,o,l,u,h,c){let d=0,p=0,f=0,m=0,g=o==="right"?1:o==="left"?0:.5,_=24/c,y=0;for(let w of a){w.trim();let b=w.getMaxScale(),T={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=T;let D=T.positionedGlyphs,E=0;if(!w.length()){p+=n,++y;continue}let M=VD(r,w,_),R=l===2&&!h?qD(w):null,z=w.graphemes();for(let I=0;I<z.length;I++){let A=w.getSection(I),L=z[I],G=L.codePointAt(0),U=R?R[I]:UD(l,h,G),et="fontStack"in A&&As(L)&&!e[A.fontStack]?.[L]?[...L]:[L];for(let ot of et){let Pt={glyph:ot.codePointAt(0),grapheme:ot,imageName:null,x:d,y:p+-17,vertical:U,scale:1,fontStack:"",sectionIndex:w.getSectionIndex(I),metrics:null,rect:null},vt;if("fontStack"in A){if(vt=HD(A,ot,U,M,e,i),!vt)continue;Pt.fontStack=A.fontStack}else{if(t.iconsInText=!0,A.scale*=_,vt=XD(A,U,b,M,r),!vt)continue;E=Math.max(E,vt.imageOffset),Pt.imageName=A.imageName}let{rect:ee,metrics:Lt,baselineOffset:Wt}=vt;if(Pt.y+=Wt,Pt.scale=A.scale,Pt.metrics=Lt,Pt.rect=ee,D.push(Pt),!U)d+=Lt.advance*A.scale+u;else{t.verticalizable=!0;let kt="imageName"in A?Lt.advance:24;d+=kt*A.scale+u}}}if(D.length!==0){let I=d-u;f=Math.max(I,f),YD(D,0,D.length-1,g)}d=0;let P=(b-1)*24;T.lineOffset=Math.max(E,P);let S=n*b+E;p+=S,m=Math.max(S,m),++y}let{horizontalAlign:x,verticalAlign:v}=Fs(s);KD(t.positionedLines,g,x,v,f,m,n,p,a.length),t.top+=-v*p,t.bottom=t.top+p,t.left+=-x*f,t.right=t.left+f}function HD(t,e,i,r,a,n){let s=n[t.fontStack]?.[e],o=jD(s,a,t,e);if(o===null)return null;let l;if(i)l=r.verticalLineContentWidth-t.scale*24;else{let u=i1(t.verticalAlign);l=(r.horizontalLineContentHeight-t.scale*24)*u}return{rect:o.rect,metrics:o.metrics,baselineOffset:l}}function XD(t,e,i,r,a){let n=a[t.imageName];if(!n)return null;let s=n.paddedRect,o=n.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:e?o[1]:o[0]},u;if(e)u=r.verticalLineContentWidth-o[1]*t.scale;else{let c=i1(t.verticalAlign);u=(r.horizontalLineContentHeight-o[1]*t.scale)*c}let h=(e?o[0]:o[1])*t.scale-24*i;return{rect:s,metrics:l,baselineOffset:u,imageOffset:h}}function YD(t,e,i,r){if(r===0)return;let a=t[i],n=a.metrics.advance*a.scale,s=(t[i].x+n)*r;for(let o=e;o<=i;o++)t[o].x-=s}function KD(t,e,i,r,a,n,s,o,l){let u=(e-i)*a,h=0;h=n===s?-r*l*s+.5*s:-o*r- -17;for(let c of t)for(let d of c.positionedGlyphs)d.x+=u,d.y+=h}function JD(t,e,i){let{horizontalAlign:r,verticalAlign:a}=Fs(i),n=e[0],s=e[1],o=n-t.displaySize[0]*r,l=o+t.displaySize[0],u=s-t.displaySize[1]*a;return{image:t,top:u,bottom:u+t.displaySize[1],left:o,right:l}}function a1(t){let e=t.left,i=t.top,r=t.right-e,a=t.bottom-i,n=t.image.content[2]-t.image.content[0],s=t.image.content[3]-t.image.content[1],o=t.image.textFitWidth??"stretchOrShrink",l=t.image.textFitHeight??"stretchOrShrink",u=n/s;if(l==="proportional"){if(o==="stretchOnly"&&r/a<u||o==="proportional"){let h=Math.ceil(a*u);e*=h/r,r=h}}else if(o==="proportional"&&l==="stretchOnly"&&u!==0&&r/a>u){let h=Math.ceil(r/u);i*=h/a,a=h}return{x1:e,y1:i,x2:e+r,y2:i+a}}function cg(t,e,i,r,a,n){let s=t.image,o;if(s.content){let g=s.content,_=s.pixelRatio||1;o=[g[0]/_,g[1]/_,s.displaySize[0]-g[2]/_,s.displaySize[1]-g[3]/_]}let l=e.left*n,u=e.right*n,h,c,d,p;i==="width"||i==="both"?(p=a[0]+l-r[3],c=a[0]+u+r[1]):(p=a[0]+(l+u-s.displaySize[0])/2,c=p+s.displaySize[0]);let f=e.top*n,m=e.bottom*n;return i==="height"||i==="both"?(h=a[1]+f-r[0],d=a[1]+m+r[2]):(h=a[1]+(f+m-s.displaySize[1])/2,d=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:d,left:p,collisionPadding:o}}var dg=32640;function pg(t,e){let{expression:i}=e;if(i.kind==="constant")return{kind:"constant",layoutSize:i.evaluate(new Ct(t+1))};if(i.kind==="source")return{kind:"source"};if(i.kind==="composite"){let{minZoom:r,maxZoom:a}=QD(i.zoomStops,t);return{kind:"composite",minZoom:r,maxZoom:a,interpolationType:i.interpolationType}}{let r=tP(i),a=i.evaluate(new Ct(t+1));return{kind:"camera",zoomStops:i.zoomStops,sizes:r,layoutSize:a,interpolationType:i.interpolationType}}}function QD(t,e){let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let r=i;for(;r<t.length&&t[r]<e+1;)r++;return r=Math.min(t.length-1,r),{minZoom:t[i],maxZoom:t[r]}}function tP(t){return t.zoomStops.map(e=>t.evaluate(new Ct(e===-1/0?t.zoomStops[1]-1:e)))}function Kl(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:a}){return t.kind==="source"?r/128:t.kind==="composite"?Zt.number(r/128,a/128,i):e}function zs(t,e){let i=0,r=0;return t.kind==="constant"?r=t.layoutSize:t.kind==="camera"?r=eP(t,e):t.kind==="composite"&&(i=iP(t,e)),{uSizeT:i,uSize:r}}function eP({zoomStops:t,sizes:e,layoutSize:i,interpolationType:r},a){let n=t.length-1;for(;n>0&&t[n]>a;)n--;let s=Math.min(n+1,t.length-1),o=r?st(bi.interpolationFactor(r,a,t[n],t[s]),0,1):0;return Math.min(Zt.number(e[n],e[s],o),i)}function iP({interpolationType:t,minZoom:e,maxZoom:i},r){return t?st(bi.interpolationFactor(t,r,e,i),0,1):0}var $a=class n1 extends C{constructor(e,i,r,a){super(e,i),this.angle=r,a!==void 0&&(this.segment=a)}clone(){return new n1(this.x,this.y,this.angle,this.segment)}};$("Anchor",$a);function s1(t,e,i,r,a){if(e.segment===void 0||i===0)return!0;let n=e,s=e.segment+1,o=0;for(;o>-i/2;){if(s--,s<0)return!1;o-=t[s].dist(n),n=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;o<i/2;){let h=t[s-1],c=t[s],d=t[s+1];if(!d)return!1;let p=h.angleTo(c)-c.angleTo(d);for(p=Math.abs((p+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:p}),u+=p;o-l[0].distance>r;)u-=l.shift().angleDelta;if(u>a)return!1;s++,o+=c.dist(d)}return!0}function o1(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function l1(t,e,i){return t?3/5*e*i:0}function u1(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function rP(t,e,i,r,a,n){let s=l1(i,a,n),o=u1(i,r)*n,l=0,u=o1(t)/2;for(let h=0;h<t.length-1;h++){let c=t[h],d=t[h+1],p=c.dist(d);if(l+p>u){let f=(u-l)/p,m=new $a(Zt.number(c.x,d.x,f),Zt.number(c.y,d.y,f),d.angleTo(c),h);return m._round(),!s||s1(t,m,o,s,e)?m:void 0}l+=p}}function aP(t,e,i,r,a,n,s,o,l){let u=l1(r,n,s),h=u1(r,a),c=h*s,d=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c<e/4&&(e=c+e/4);let p=n*2;return h1(t,d?e/2*o%e:(h/2+p)*s*o%e,e,u,i,c,d,!1,l)}function h1(t,e,i,r,a,n,s,o,l){let u=n/2,h=o1(t),c=0,d=e-i,p=[];for(let f=0;f<t.length-1;f++){let m=t[f],g=t[f+1],_=m.dist(g),y=g.angleTo(m);for(;d+i<c+_;){d+=i;let x=(d-c)/_,v=Zt.number(m.x,g.x,x),w=Zt.number(m.y,g.y,x);if(v>=0&&v<l&&w>=0&&w<l&&d-u>=0&&d+u<=h){let b=new $a(v,w,y,f);b._round(),(!r||s1(t,b,n,r,a))&&p.push(b)}}c+=_}return!o&&!p.length&&!s&&(p=h1(t,c/2,i,r,a,n,s,!0,l)),p}function Ud(t,e,i,r,a){let n=[];for(let s of t){let o;for(let l=0;l<s.length-1;l++){let u=s[l],h=s[l+1];u.x<e&&h.x<e||(u.x<e?u=new C(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round():h.x<e&&(h=new C(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round()),!(u.y<i&&h.y<i)&&(u.y<i?u=new C(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round():h.y<i&&(h=new C(u.x+(h.x-u.x)*((i-u.y)/(h.y-u.y)),i)._round()),!(u.x>=r&&h.x>=r)&&(u.x>=r?u=new C(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round():h.x>=r&&(h=new C(r,u.y+(h.y-u.y)*((r-u.x)/(h.x-u.x)))._round()),!(u.y>=a&&h.y>=a)&&(u.y>=a?u=new C(u.x+(h.x-u.x)*((a-u.y)/(h.y-u.y)),a)._round():h.y>=a&&(h=new C(u.x+(h.x-u.x)*((a-u.y)/(h.y-u.y)),a)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],n.push(o)),o.push(h)))))}}return n}function fg(t,e,i,r){let a=[],n=t.image,s=n.pixelRatio,o=n.paddedRect.w-2,l=n.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=n.stretchX||[[0,o]],c=n.stretchY||[[0,l]],d=(S,I)=>S+I[1]-I[0],p=h.reduce(d,0),f=c.reduce(d,0),m=o-p,g=l-f,_=0,y=p,x=0,v=f,w=0,b=m,T=0,D=g;if(n.content&&r){let S=n.content,I=S[2]-S[0],A=S[3]-S[1];(n.textFitWidth||n.textFitHeight)&&(u=a1(t)),_=Fo(h,0,S[0]),x=Fo(c,0,S[1]),y=Fo(h,S[0],S[2]),v=Fo(c,S[1],S[3]),w=S[0]-_,T=S[1]-x,b=I-y,D=A-v}let E=u.x1,M=u.y1,R=u.x2-E,z=u.y2-M,P=(S,I,A,L)=>{let G=zo(S.stretch-_,y,R,E),U=Ro(S.fixed-w,b,S.stretch,p),et=zo(I.stretch-x,v,z,M),ot=Ro(I.fixed-T,D,I.stretch,f),Pt=zo(A.stretch-_,y,R,E),vt=Ro(A.fixed-w,b,A.stretch,p),ee=zo(L.stretch-x,v,z,M),Lt=Ro(L.fixed-T,D,L.stretch,f),Wt=new C(G,et),kt=new C(Pt,et),Pe=new C(Pt,ee),ze=new C(G,ee),qe=new C(U/s,ot/s),We=new C(vt/s,Lt/s),Vt=e*Math.PI/180;if(Vt){let Z=Math.sin(Vt),it=Math.cos(Vt),rt=[it,-Z,Z,it];Wt._matMult(rt),kt._matMult(rt),ze._matMult(rt),Pe._matMult(rt)}let He=S.stretch+S.fixed,Ci=A.stretch+A.fixed,Ui=I.stretch+I.fixed,di=L.stretch+L.fixed;return{tl:Wt,tr:kt,bl:ze,br:Pe,tex:{x:n.paddedRect.x+1+He,y:n.paddedRect.y+1+Ui,w:Ci-He,h:di-Ui},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:qe,pixelOffsetBR:We,minFontScaleX:b/s/R,minFontScaleY:D/s/z,isSDF:i}};if(!r||!n.stretchX&&!n.stretchY)a.push(P({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let S=mg(h,m,p),I=mg(c,g,f);for(let A=0;A<S.length-1;A++){let L=S[A],G=S[A+1];for(let U=0;U<I.length-1;U++){let et=I[U],ot=I[U+1];a.push(P(L,et,G,ot))}}}return a}function Fo(t,e,i){let r=0;for(let a of t)r+=Math.max(e,Math.min(i,a[1]))-Math.max(e,Math.min(i,a[0]));return r}function mg(t,e,i){let r=[{fixed:-1,stretch:0}];for(let[a,n]of t){let s=r[r.length-1];r.push({fixed:a-s.stretch,stretch:s.stretch}),r.push({fixed:a-s.stretch,stretch:s.stretch+(n-a)})}return r.push({fixed:e+1,stretch:i}),r}function zo(t,e,i,r){return t/e*i+r}function Ro(t,e,i,r){return t-e*i/r}function nP(t,e,i,r,a,n,s,o){let l=r.layout.get("text-rotate").evaluate(n,{})*Math.PI/180,u=[];for(let h of e.positionedLines)for(let c of h.positionedGlyphs){if(!c.rect)continue;let d=c.rect||{},p=4,f=!0,m=1,g=0,_=(a||o)&&c.vertical,y=c.metrics.advance*c.scale/2;if(o&&e.verticalizable){let L=(c.scale-1)*24,G=(24-c.metrics.width*c.scale)/2;g=h.lineOffset/2-(c.imageName?-G:L)}if(c.imageName){let L=s[c.imageName];f=L.sdf,m=L.pixelRatio,p=1/m}let x=a?[c.x+y,c.y]:[0,0],v=a?[0,0]:[c.x+y+i[0],c.y+i[1]-g],w=[0,0];_&&(w=v,v=[0,0]);let b=c.metrics.isDoubleResolution?2:1,T=(c.metrics.left-p)*c.scale-y+v[0],D=(-c.metrics.top-p)*c.scale+v[1],E=T+d.w/b*c.scale/m,M=D+d.h/b*c.scale/m,R=new C(T,D),z=new C(E,D),P=new C(T,M),S=new C(E,M);if(_){let L=new C(-y,y- -17),G=-Math.PI/2,U=12-y,et=c.imageName?U:0,ot=new C(22-U,-et),Pt=new C(...w);R._rotateAround(G,L)._add(ot)._add(Pt),z._rotateAround(G,L)._add(ot)._add(Pt),P._rotateAround(G,L)._add(ot)._add(Pt),S._rotateAround(G,L)._add(ot)._add(Pt)}if(l){let L=Math.sin(l),G=Math.cos(l),U=[G,-L,L,G];R._matMult(U),z._matMult(U),P._matMult(U),S._matMult(U)}let I=new C(0,0),A=new C(0,0);u.push({tl:R,tr:z,bl:P,br:S,tex:d,writingMode:e.writingMode,glyphOffset:x,sectionIndex:c.sectionIndex,isSDF:f,pixelOffsetTL:I,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0})}return u}var ko=class{constructor(t,e,i,r,a,n,s,o,l,u){if(this.boxStartIndex=t.length,l){let h=n.top,c=n.bottom,d=n.collisionPadding;d&&(h-=d[1],c+=d[3]);let p=c-h;p>0&&(p=Math.max(10,p),this.circleDiameter=p)}else{let h=n.image?.content&&(n.image.textFitWidth||n.image.textFitHeight)?a1(n):{x1:n.left,y1:n.top,x2:n.right,y2:n.bottom};h.y1=h.y1*s-o[0],h.y2=h.y2*s+o[2],h.x1=h.x1*s-o[3],h.x2=h.x2*s+o[1];let c=n.collisionPadding;if(c&&(h.x1-=c[0]*s,h.y1-=c[1]*s,h.x2+=c[2]*s,h.y2+=c[3]*s),u){let d=new C(h.x1,h.y1),p=new C(h.x2,h.y1),f=new C(h.x1,h.y2),m=new C(h.x2,h.y2),g=u*Math.PI/180;d._rotate(g),p._rotate(g),f._rotate(g),m._rotate(g),h.x1=Math.min(d.x,p.x,f.x,m.x),h.x2=Math.max(d.x,p.x,f.x,m.x),h.y1=Math.min(d.y,p.y,f.y,m.y),h.y2=Math.max(d.y,p.y,f.y,m.y)}t.emplaceBack(e.x,e.y,h.x1,h.y1,h.x2,h.y2,i,r,a)}this.boxEndIndex=t.length}},sP=class{constructor(t=[],e=(i,r)=>i<r?-1:+(i>r)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:i}=this,r=e[t];for(;t>0;){let a=t-1>>1,n=e[a];if(i(r,n)>=0)break;e[t]=n,t=a}e[t]=r}_down(t){let{data:e,compare:i}=this,r=this.length>>1,a=e[t];for(;t<r;){let n=(t<<1)+1,s=n+1;if(s<this.length&&i(e[s],e[n])<0&&(n=s),i(e[n],a)>=0)break;e[t]=e[n],t=n}e[t]=a}};function oP(t,e=1){let i=Ti.fromPoints(t[0]),r=Math.min(i.width(),i.height()),a=r/2,n=new sP([],lP),{minX:s,minY:o,maxX:l,maxY:u}=i;if(r===0)return new C(s,o);for(let d=s;d<l;d+=r)for(let p=o;p<u;p+=r)n.push(new ka(d+a,p+a,a,t));let h=hP(t),c=h;for(;n.length;){let d=n.pop();(d.d>c.d||!c.d)&&(c=d),!(d.max-c.d<=e)&&(a=d.h/2,n.push(new ka(d.p.x-a,d.p.y-a,a,t)),n.push(new ka(d.p.x+a,d.p.y-a,a,t)),n.push(new ka(d.p.x-a,d.p.y+a,a,t)),n.push(new ka(d.p.x+a,d.p.y+a,a,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function lP(t,e){return e.max-t.max}var ka=class{constructor(t,e,i,r){this.p=new C(t,e),this.h=i,this.d=uP(this.p,r),this.max=this.d+this.h*Math.SQRT2}};function uP(t,e){let i=!1,r=1/0;for(let a of e)for(let n=0,s=a.length,o=s-1;n<s;o=n++){let l=a[n],u=a[o];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(i=!i),r=Math.min(r,c0(t,l,u))}return(i?1:-1)*Math.sqrt(r)}function hP(t){let e=0,i=0,r=0,a=t[0];for(let n=0,s=a.length,o=s-1;n<s;o=n++){let l=a[n],u=a[o],h=l.x*u.y-u.x*l.y;i+=(l.x+u.x)*h,r+=(l.y+u.y)*h,e+=h*3}return new ka(i/e,r/e,0,t)}var Jl=(function(t){return t[t.center=1]="center",t[t.left=2]="left",t[t.right=3]="right",t[t.top=4]="top",t[t.bottom=5]="bottom",t[t["top-left"]=6]="top-left",t[t["top-right"]=7]="top-right",t[t["bottom-left"]=8]="bottom-left",t[t["bottom-right"]=9]="bottom-right",t})({}),Nd=1/0;function c1(t,e){function i(a,n){let s=0,o=0;n<0&&(n=0);let l=n/Math.SQRT2;switch(a){case"top-right":case"top-left":o=l-7;break;case"bottom-right":case"bottom-left":o=-l+7;break;case"bottom":o=-n+7;break;case"top":o=n-7}switch(a){case"top-right":case"bottom-right":s=-l;break;case"top-left":case"bottom-left":s=l;break;case"left":s=n;break;case"right":s=-n}return[s,o]}function r(a,n,s){let o=0,l=0;switch(n=Math.abs(n),s=Math.abs(s),a){case"top-right":case"top-left":case"top":l=s-7;break;case"bottom-right":case"bottom-left":case"bottom":l=-s+7}switch(a){case"top-right":case"bottom-right":case"right":o=-n;break;case"top-left":case"bottom-left":case"left":o=n}return[o,l]}return e[1]===Nd?i(t,e[0]):r(t,e[0],e[1])}function d1(t,e,i){let r=t.layout,a=r.get("text-variable-anchor-offset")?.evaluate(e,{},i);if(a){let s=a.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],h=s[l+1].map(c=>c*24);u.startsWith("top")?h[1]-=7:u.startsWith("bottom")&&(h[1]+=7),o[l+1]=h}return new Ki(o)}let n=r.get("text-variable-anchor");if(n){let s;s=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?r.get("text-offset").evaluate(e,{},i).map(l=>l*24):[r.get("text-radial-offset").evaluate(e,{},i)*24,Nd];let o=[];for(let l of n)o.push(l,c1(l,s));return new Ki(o)}return null}function cP(t){var h;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=k/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let i=t.bucket.layers[0],r=i.layout,a=i._unevaluatedLayout._values,n={layoutIconSize:a["icon-size"].possiblyEvaluate(new Ct
vendor: 12,942 bytes, line 822
822(t.bucket.zoom+1),t.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new Ct(t.bucket.zoom+1),t.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new Ct(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:c,maxZoom:d}=t.bucket.textSizeData;n.compositeTextSizes=[a["text-size"].possiblyEvaluate(new Ct(c),t.canonical),a["text-size"].possiblyEvaluate(new Ct(d),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:c,maxZoom:d}=t.bucket.iconSizeData;n.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new Ct(c),t.canonical),a["icon-size"].possiblyEvaluate(new Ct(d),t.canonical)]}let s=r.get("text-line-height")*24,o=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",l=r.get("text-keep-upright"),u=r.get("text-size");for(let c of t.bucket.features){let d=r.get("text-font").evaluate(c,{},t.canonical).join(","),p=u.evaluate(c,{},t.canonical),f=n.layoutTextSize.evaluate(c,{},t.canonical),m=n.layoutIconSize.evaluate(c,{},t.canonical),g={horizontal:{},vertical:void 0},_=c.text,y=[0,0];if(_){let b=_.toString(),T=r.get("text-letter-spacing").evaluate(c,{},t.canonical)*24,D=lD(b)?T:0,E=r.get("text-anchor").evaluate(c,{},t.canonical),M=d1(i,c,t.canonical);if(!M){let S=r.get("text-radial-offset").evaluate(c,{},t.canonical);y=S?c1(E,[S*24,Nd]):r.get("text-offset").evaluate(c,{},t.canonical).map(I=>I*24)}let R=o?"center":r.get("text-justify").evaluate(c,{},t.canonical),z=r.get("symbol-placement")==="point"?r.get("text-max-width").evaluate(c,{},t.canonical)*24:1/0,P=()=>{t.bucket.allowVerticalPlacement&&Cc(b)&&(g.vertical=Mo(_,t.glyphMap,t.glyphPositions,t.imagePositions,d,z,s,E,"left",D,y,2,!0,f,p))};if(!o&&M){let S=new Set;if(R==="auto")for(let A=0;A<M.values.length;A+=2)S.add(nl(M.values[A]));else S.add(R);let I=!1;for(let A of S)if(!g.horizontal[A])if(I)g.horizontal[A]=g.horizontal[0];else{let L=Mo(_,t.glyphMap,t.glyphPositions,t.imagePositions,d,z,s,"center",A,D,y,1,!1,f,p);L&&(g.horizontal[A]=L,I=L.positionedLines.length===1)}P()}else{R==="auto"&&(R=nl(E));let S=Mo(_,t.glyphMap,t.glyphPositions,t.imagePositions,d,z,s,E,R,D,y,1,!1,f,p);S&&(g.horizontal[R]=S),P(),Cc(b)&&o&&l&&(g.vertical=Mo(_,t.glyphMap,t.glyphPositions,t.imagePositions,d,z,s,E,R,D,y,2,!1,f,p))}}let x,v=!1;if(c.icon?.name){let b=t.imageMap[c.icon.name];b&&(x=JD(t.imagePositions[c.icon.name],r.get("icon-offset").evaluate(c,{},t.canonical),r.get("icon-anchor").evaluate(c,{},t.canonical)),v=!!b.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&ft("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),b.pixelRatio===t.bucket.pixelRatio?r.get("icon-rotate").constantOr(1)!==0&&(t.bucket.iconsNeedLinear=!0):t.bucket.iconsNeedLinear=!0)}let w=p1(g.horizontal)||g.vertical;(h=t.bucket).iconsInText||(h.iconsInText=w?w.iconsInText:!1),(w||x)&&dP(t.bucket,c,g,x,t.imageMap,n,f,m,y,v,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function nl(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function dP(t,e,i,r,a,n,s,o,l,u,h,c){let d=n.textMaxSize.evaluate(e,{});d===void 0&&(d=s);let p=t.layers[0].layout,f=p.get("icon-offset").evaluate(e,{},h),m=p1(i.horizontal),g=s/24,_=t.tilePixelRatio*g,y=t.tilePixelRatio*d/24,x=t.tilePixelRatio*o,v=t.tilePixelRatio*p.get("symbol-spacing"),w=p.get("text-padding")*t.tilePixelRatio,b=wP(p,e,h,t.tilePixelRatio),T=p.get("text-max-angle")/180*Math.PI,D=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point",E=p.get("icon-rotation-alignment").constantOr("viewport")==="map"&&p.get("symbol-placement")!=="point",M=p.get("symbol-placement"),R=v/2,z=p.get("icon-text-fit"),P;r&&z!=="none"&&(t.allowVerticalPlacement&&i.vertical&&(P=cg(r,i.vertical,z,p.get("icon-text-fit-padding"),f,g)),m&&(r=cg(r,m,z,p.get("icon-text-fit-padding"),f,g)));let S=h?c.line.getGranularityForZoomLevel(h.z):1,I=(A,L)=>{L.x<0||L.x>=8192||L.y<0||L.y>=8192||fP(t,L,A,i,r,a,P,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,_,[w,w,w,w],D,l,x,b,E,f,e,n,u,h,s)};if(M==="line")for(let A of Ud(e.geometry,0,0,k,k)){let L=Yr(A,S),G=aP(L,v,T,i.vertical||m,r,24,y,t.overscaling,k);for(let U of G){let et=m;(!et||!mP(t,et.text,R,U))&&I(L,U)}}else if(M==="line-center"){for(let A of e.geometry)if(A.length>1){let L=Yr(A,S),G=rP(L,T,i.vertical||m,r,24,y);G&&I(L,G)}}else if(e.type==="Polygon")for(let A of Cl(e.geometry,0)){let L=oP(A,16);I(Yr(A[0],S,!0),new $a(L.x,L.y,0))}else if(e.type==="LineString")for(let A of e.geometry){let L=Yr(A,S);I(L,new $a(L[0].x,L[0].y,0))}else if(e.type==="Point")for(let A of e.geometry)for(let L of A)I([L],new $a(L.x,L.y,0))}function pP(t,e){let i=t.length,r=e?.values;if(r?.length>0)for(let a=0;a<r.length;a+=2){let n=Jl[r[a]],s=r[a+1];t.emplaceBack(n,s[0],s[1])}return[i,t.length]}function gg(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m){let g=nP(e,i,o,a,n,s,r,t.allowVerticalPlacement),_=t.textSizeData,y=null;_.kind==="source"?(y=[128*a.layout.get("text-size").evaluate(s,{})],y[0]>32640&&ft(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):_.kind==="composite"&&(y=[128*f.compositeTextSizes[0].evaluate(s,{},m),128*f.compositeTextSizes[1].evaluate(s,{},m)],(y[0]>32640||y[1]>32640)&&ft(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,y,o,n,s,h,e,u.lineStartIndex,u.lineLength,p,m,l);for(let x of c)d[x]=t.text.placedSymbolArray.length-1;return g.length*4}function p1(t){for(let e in t)return t[e];return null}function fP(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y,x,v,w,b,T,D){let E=t.addToLineVertexArray(e,i),M=o.layout.get("symbol-height-offset").evaluate(v,{},T);M>t.maxHeightOffset&&(t.maxHeightOffset=M);let R,z,P,S,I=0,A=0,L=0,G=0,U=-1,et=-1,ot={},Pt=(0,uc.default)("");if(t.allowVerticalPlacement&&r.vertical){let it=o.layout.get("text-rotate").evaluate(v,{},T)+90,rt=r.vertical;P=new ko(l,e,u,h,c,rt,d,p,f,it),s&&(S=new ko(l,e,u,h,c,s,g,_,f,it))}if(a){let it=o.layout.get("icon-rotate").evaluate(v,{}),rt=o.layout.get("icon-text-fit")!=="none",O=fg(a,it,b,rt),Tt=s?fg(s,it,b,rt):void 0;z=new ko(l,e,u,h,c,a,g,_,!1,it),I=O.length*4;let H=t.iconSizeData,W=null;H.kind==="source"?(W=[128*o.layout.get("icon-size").evaluate(v,{})],W[0]>32640&&ft(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):H.kind==="composite"&&(W=[128*w.compositeIconSizes[0].evaluate(v,{},T),128*w.compositeIconSizes[1].evaluate(v,{},T)],(W[0]>32640||W[1]>32640)&&ft(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,O,W,x,y,v,0,e,E.lineStartIndex,E.lineLength,-1,T,M),U=t.icon.placedSymbolArray.length-1,Tt&&(A=Tt.length*4,t.addSymbols(t.icon,Tt,W,x,y,v,2,e,E.lineStartIndex,E.lineLength,-1,T,M),et=t.icon.placedSymbolArray.length-1)}let vt=Object.keys(r.horizontal);for(let it of vt){let rt=r.horizontal[it];R||(R=(Pt=(0,uc.default)(rt.text),new ko(l,e,u,h,c,rt,d,p,f,o.layout.get("text-rotate").evaluate(v,{},T))));let O=rt.positionedLines.length===1;if(L+=gg(t,e,rt,n,o,f,v,m,M,E,r.vertical?1:3,O?vt:[it],ot,U,w,T),O)break}r.vertical&&(G+=gg(t,e,r.vertical,n,o,f,v,m,M,E,2,["vertical"],ot,et,w,T));let ee=R?R.boxStartIndex:t.collisionBoxArray.length,Lt=R?R.boxEndIndex:t.collisionBoxArray.length,Wt=P?P.boxStartIndex:t.collisionBoxArray.length,kt=P?P.boxEndIndex:t.collisionBoxArray.length,Pe=z?z.boxStartIndex:t.collisionBoxArray.length,ze=z?z.boxEndIndex:t.collisionBoxArray.length,qe=S?S.boxStartIndex:t.collisionBoxArray.length,We=S?S.boxEndIndex:t.collisionBoxArray.length,Vt=-1,He=(it,rt)=>it?.circleDiameter?Math.max(it.circleDiameter,rt):rt;Vt=He(R,Vt),Vt=He(P,Vt),Vt=He(z,Vt),Vt=He(S,Vt);let Ci=+(Vt>-1);Ci&&(Vt*=D/24),t.glyphOffsetArray.length>=t.maxGlyphs&&ft("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),v.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,v.sortKey);let Ui=d1(o,v,T),[di,Z]=pP(t.textAnchorOffsets,Ui);t.symbolInstances.emplaceBack(e.x,e.y,ot.right>=0?ot.right:-1,ot.center>=0?ot.center:-1,ot.left>=0?ot.left:-1,ot.vertical||-1,U,et,Pt,ee,Lt,Wt,kt,Pe,ze,qe,We,u,L,G,I,A,Ci,0,d,Vt,di,Z,M)}function mP(t,e,i,r){let a=t.compareText;if(!(e in a))a[e]=[];else{let n=a[e];for(let s=n.length-1;s>=0;s--)if(r.dist(n[s])<i)return!0}return a[e].push(r),!1}function hs(t,e,i){let r="never",a=t.get(e);return a?r=a:t.get(i)&&(r="always"),r}var gP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Lo(t,e,i,r,a,n,s,o,l,u,h,c,d,p){let f=o?Math.min(dg,Math.round(o[0])):0,m=o?Math.min(dg,Math.round(o[1])):0;t.emplaceBack(e,i,Math.round(r*32),Math.round(a*32),n,s,(f<<1)+ +!!l,m,u*16,h*16,c*256,d*256,p)}function Rs(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function _P(t){for(let e of t.sections)if(H0(e.text))return!0;return!1}var Fc=class{constructor(t){this.layoutVertexArray=new UT,this.indexArray=new Bi,this.programConfigurations=t,this.segments=new qt,this.dynamicLayoutVertexArray=new NT,this.opacityVertexArray=new $T,this.hasVisibleVertices=!1,this.placedSymbolArray=new Zy}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zS.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,RS.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,gP,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};$("SymbolBuffers",Fc);var zc=class{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new qt,this.collisionVertexArray=new GT}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,kS.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};$("CollisionBuffers",zc);var ks=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=pg(this.zoom,e["text-size"]),this.iconSizeData=pg(this.zoom,e["icon-size"]);let i=this.layers[0].layout,r=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=hs(i,"text-overlap","text-allow-overlap")!=="never"||hs(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!r.isConstant();let n=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=n&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(s=>t1[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new Fc(new ra(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new Fc(new ra(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Hy,this.lineVertexArray=new Xy,this.symbolInstances=new Wy,this.textAnchorOffsets=new Ky}calculateGlyphDependencies(t,e,i,r,a){var l;let n=(r||this.allowVerticalPlacement)&&a,s=Od.fromFeature(t,i),o=s.graphemes();for(let u=0;u<o.length;u++){let h=s.getSection(u);if("imageName"in h)continue;let c=e[l=h.fontStack]||(e[l]={}),d=o[u];As(d)&&(c[d]=!0);for(let p of d){if(c[p]=!0,!n)continue;let f=Ba[p];f&&(c[f]=!0)}}}populate(t,e,i){let r=this.layers[0],a=r.layout,n=a.get("text-font"),s=a.get("text-field"),o=a.get("icon-image"),l=(s.value.kind!=="constant"||s.value.value instanceof ur&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(n.value.kind!=="constant"||n.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,d=e.glyphDependencies,p=e.availableImages,f=new Ct
vendor: 7,233 bytes, line 822
822(this.zoom);for(let{feature:m,id:g,index:_,sourceLayerIndex:y}of t){let x=r._featureFilter.needGeometry,v=Vr(m,x);if(!r._featureFilter.filter(f,v,i))continue;x||(v.geometry=ha(m));let w;if(l){let E=r.getValueAndResolveTokens("text-field",v,i,p),M=ur.factory(E);this.hasRTLText||(this.hasRTLText=_P(M)),w=aD(M,r,v)}let b;if(u){let E=r.getValueAndResolveTokens("icon-image",v,i,p);b=E instanceof Ji?E:Ji.fromString(E)}if(!w&&!b)continue;let T=this.sortFeaturesByKey?h.evaluate(v,{},i):void 0,D={id:g,text:w,icon:b,index:_,sourceLayerIndex:y,geometry:v.geometry,properties:m.properties,type:Is.types[m.type],sortKey:T};if(this.features.push(D),b&&(c[b.name]=!0),w){let E=n.evaluate(v,{},i).join(","),M=a.get("text-rotation-alignment")!=="viewport"&&a.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes?.includes(2);let R=Cc(w.toString());this.calculateGlyphDependencies(w,d,E,M,R);for(let z of w.sections)z.image&&(c[z.image.name]=!0)}}a.get("symbol-placement")==="line"&&(this.features=sD(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}))}addFeatures({options:t,canonical:e,glyphMap:i,glyphPositions:r,iconMap:a,iconPositions:n,showCollisionBoxes:s}){cP({bucket:this,glyphMap:i,glyphPositions:r,imageMap:a,imagePositions:n,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let i=this.lineVertexArray.length;if(t.segment!==void 0){let r=t.dist(e[t.segment+1]),a=t.dist(e[t.segment]),n={};for(let s=t.segment+1;s<e.length;s++)n[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:r},s<e.length-1&&(r+=e[s+1].dist(e[s]));for(let s=t.segment||0;s>=0;s--)n[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=e[s-1].dist(e[s]));for(let s=0;s<e.length;s++){let o=n[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(t,e,i,r,a,n,s,o,l,u,h,c,d){let p=t.indexArray,f=t.layoutVertexArray,m=t.segments.prepareSegment(4*e.length,f,p,this.canOverlap?n.sortKey:void 0),g=this.glyphOffsetArray.length,_=m.vertexLength,y=this.allowVerticalPlacement&&s===2?Math.PI/2:0,x=n.text&&n.text.sections;for(let v=0;v<e.length;v++){let{tl:w,tr:b,bl:T,br:D,tex:E,pixelOffsetTL:M,pixelOffsetBR:R,minFontScaleX:z,minFontScaleY:P,glyphOffset:S,isSDF:I,sectionIndex:A}=e[v],L=m.vertexLength,G=S[1];Lo(f,o.x,o.y,w.x,G+w.y,E.x,E.y,i,I,M.x,M.y,z,P,d),Lo(f,o.x,o.y,b.x,G+b.y,E.x+E.w,E.y,i,I,R.x,M.y,z,P,d),Lo(f,o.x,o.y,T.x,G+T.y,E.x,E.y+E.h,i,I,M.x,R.y,z,P,d),Lo(f,o.x,o.y,D.x,G+D.y,E.x+E.w,E.y+E.h,i,I,R.x,R.y,z,P,d),Rs(t.dynamicLayoutVertexArray,o,y),p.emplaceBack(L,L+2,L+1),p.emplaceBack(L+1,L+2,L+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(S[0]),(v===e.length-1||A!==e[v+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(f.length,n,n.index,{imagePositions:{},canonical:c,formattedSection:x?.[A]})}t.placedSymbolArray.emplaceBack(o.x,o.y,g,this.glyphOffsetArray.length-g,_,l,u,o.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],s,0,!1,0,h,d)}_addCollisionDebugVertex(t,e,i,r,a,n){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,a,Math.round(n.x),Math.round(n.y))}addCollisionDebugVertices(t,e,i,r,a,n,s){let o=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),l=o.vertexLength,u=a.layoutVertexArray,h=a.collisionVertexArray,c=s.anchorX,d=s.anchorY;this._addCollisionDebugVertex(u,h,n,c,d,new C(t,e)),this._addCollisionDebugVertex(u,h,n,c,d,new C(i,e)),this._addCollisionDebugVertex(u,h,n,c,d,new C(i,r)),this._addCollisionDebugVertex(u,h,n,c,d,new C(t,r)),o.vertexLength+=4;let p=a.indexArray;p.emplaceBack(l,l+1),p.emplaceBack(l+1,l+2),p.emplaceBack(l+2,l+3),p.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let a=t;a<e;a++){let n=this.collisionBoxArray.get(a),s=n.x1,o=n.y1,l=n.x2,u=n.y2;this.addCollisionDebugVertices(s,o,l,u,r?this.textCollisionBox:this.iconCollisionBox,n.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zc(Dm,Jm.members,oc),this.iconCollisionBox=new zc(Dm,Jm.members,oc);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,a,n,s,o,l){let u={};for(let h=e;h<i;h++){let c=t.get(h);u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}for(let h=r;h<a;h++){let c=t.get(h);u.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalTextFeatureIndex=c.featureIndex;break}for(let h=n;h<s;h++){let c=t.get(h);u.iconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.iconFeatureIndex=c.featureIndex;break}for(let h=o;h<l;h++){let c=t.get(h);u.verticalIconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalIconFeatureIndex=c.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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(t,e){let i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+i.numGlyphs*4;for(let a=i.vertexStartIndex;a<r;a+=4)t.indexArray.emplaceBack(a,a+2,a+1),t.indexArray.emplaceBack(a+1,a+2,a+3)}
vendor: 6,691 bytes, line 822
822getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let e=Math.sin(t),i=Math.cos(t),r=[],a=[],n=[];for(let s=0;s<this.symbolInstances.length;++s){n.push(s);let o=this.symbolInstances.get(s);r.push(Math.round(e*o.anchorX+i*o.anchorY)|0),a.push(o.featureIndex)}return n.sort((s,o)=>r[s]-r[o]||a[o]-a[s]),n}addToSortKeyRanges(t,e){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i?.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let i=this.symbolInstances.get(e);this.featureSortOrder.push(i.featureIndex);let r=[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex];for(let a=0;a<r.length;a++){let n=r[a];n>=0&&r.indexOf(n)===a&&this.addIndicesForPlacedSymbol(this.text,n)}i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};$("SymbolBucket",ks,{omit:["layers","collisionBoxArray","features","compareText"]});function yP(t,e){return e.replace(/{([^{}]+)}/g,(i,r)=>t&&r in t?String(t[r]):"")}var _g,vP=()=>_g||(_g=new ge({"symbol-placement":new j(F.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new j(F.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new j(F.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new tt(F.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new j(F.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new j(F.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new j(F.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new j(F.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new j(F.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new tt(F.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new tt(F.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new j(F.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new j(F.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new tt(F.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new tt(F.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new tt(F.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new j(F.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new tt(F.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new tt(F.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new j(F.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new j(F.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new j(F.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new tt(F.layout_symbol["text-field"],"text-field"),"text-font":new tt(F.layout_symbol["text-font"],"text-font"),"text-size":new tt(F.layout_symbol["text-size"],"text-size"),"text-max-width":new tt(F.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new j(F.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new tt(F.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new tt(F.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new tt(F.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new j(F.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new tt(F.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new tt(F.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new j(F.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new j(F.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new tt(F.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new j(F.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new j(F.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new tt(F.layout_symbol["text-transform"],"text-transform"),"text-offset":new tt(F.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new j(F.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new j(F.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new j(F.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new j(F.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new tt(F.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new j(F.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),yg,xP=()=>yg||(yg=new ge({"icon-opacity":new tt(F.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new tt(F.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new tt(F.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new tt(F.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new tt(F.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new j(F.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new j(F.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new tt(F.paint_symbol["text-opacity"],"text-opacity"),"text-color":new tt(F.paint_symbol["text-color"],"text-color",{runtimeType:Fi,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new tt(F.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new tt(F.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new tt(F.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new j(F.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new j(F.paint_symbol["text-translate-anchor"],"text-translate-anchor")}
vendor: 16,122 bytes, line 822
822)),Eh={get paint(){return xP()},get layout(){return vP()}},f1=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:xs,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e?.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};$("FormatSectionOverride",f1,{omit:["defaultValue"]});var $d=t=>t.type==="symbol",bP=class Rc extends Li{constructor(e,i){super(e,Eh,i)}recalculate(e,i){super.recalculate(e,i);let r=this.layout.get("icon-rotation-alignment");if((r.value.kind!=="constant"||r.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new vi(r.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},r.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),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").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let a=this.layout.get("text-writing-mode");if(a){let n=[];for(let s of a)n.includes(s)||n.push(s);this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,i,r,a){let n=this.layout.get(e).evaluate(i,{},r,a),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!zl(s.value)&&n?yP(i.properties,n):n}createBucket(e){return new ks(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Eh.paint.overridableProperties){if(!Rc.hasPaintOverride(this.layout,e))continue;let i=this.paint.get(e),r=new md(new f1(i),`layers[${this.id}].paint.${i.property.name}`,i.property.specification),a=null;a=i.value.kind==="constant"||i.value.kind==="source"?new es("source",r):new Xo("composite",r,i.value.zoomStops),this.paint._values[e]=new vi(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(e,i,r){return!this.layout||i.isDataDriven()||r.isDataDriven()?!1:Rc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,i){let r=e.get("text-field"),a=Eh.paint.properties[i],n=!1,s=o=>{for(let l of o)if(a.overrides?.hasOverride(l)){n=!0;return}};if(r.value.kind==="constant"&&r.value.value instanceof ur)s(r.value.value.sections);else if(r.value.kind==="source"||r.value.kind==="composite"){let o=u=>{if(!n)if(u instanceof Ha&&ne(u.value)===bs){let h=u.value;s(h.sections)}else u instanceof z_?s(u.sections):u.eachChild(o)},l=r.value;l._styleExpression&&o(l._styleExpression.expression)}return n}};function wP(t,e,i,r=1){let a=t.get("icon-padding").evaluate(e,{},i)?.values;return[a[0]*r,a[1]*r,a[2]*r,a[3]*r]}var vg,TP=()=>vg||(vg=new ge({"background-color":new j(F.paint_background["background-color"],"background-color"),"background-pattern":new Ny(F.paint_background["background-pattern"],"background-pattern"),"background-opacity":new j(F.paint_background["background-opacity"],"background-opacity")})),EP={get paint(){return TP()}},m1=t=>t.type==="background",SP=class extends Li{constructor(t,e){super(t,EP,e)}};function g1(t){let e=[],i=t.id;return i===void 0&&e.push(new B(`layers.${i}`,null,'missing required property "id"')),t.render===void 0&&e.push(new B(`layers.${i}`,null,'missing required method "render"')),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&e.push(new B(`layers.${i}`,null,'property "renderingMode" must be either "2d" or "3d"')),e}var _1=t=>t.type==="custom",DP=class extends Li{constructor(t,e){super(t,{},e),this.onAdd=i=>{this.implementation.onAdd&&this.implementation.onAdd(i,i.painter.context.gl)},this.onRemove=i=>{this.implementation.onRemove&&this.implementation.onRemove(i,i.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function Ql(t,e){if(t.type==="custom")return new DP(t,e);switch(t.type){case"background":return new SP(t,e);case"circle":return new mE(t,e);case"color-relief":return new SE(t,e);case"fill":return new iS(t,e);case"fill-extrusion":return new xS(t,e);case"heatmap":return new yE(t,e);case"hillshade":return new bE(t,e);case"line":return new FS(t,e);case"raster":return new zT(t,e);case"symbol":return new bP(t,e)}}var PP=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},CP={once:!0},y1=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new PP(()=>this.process()),this.subscription=$o(this.target,"message",i=>this.receive(i),!1),this.globalScope=ea(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((i,r)=>{let a=Math.round(Math.random()*1e18).toString(36).substring(0,10),n=e?$o(e.signal,"abort",()=>{n?.unsubscribe(),delete this.resolveRejects[a];let l={id:a,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),r(new an(e.signal.reason))},CP):null;this.resolveRejects[a]={resolve:l=>{n?.unsubscribe(),i(l)},reject:l=>{n?.unsubscribe(),r(l)}};let s=[],o={...t,id:a,sourceMapId:this.mapId,origin:location.origin,data:Wn(t.data,s)};this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,i=e.id,r=["file://","resource://android","null"],a=[e.origin,location.origin],n=e.origin===location.origin,s=a.some(o=>r.includes(o));if((n||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type==="<cancel>"){delete this.tasks[i];let o=this.abortControllers[i];delete this.abortControllers[i],o&&o.abort();return}if(ea(self)||e.mustQueue){this.tasks[i]=e,this.taskQueue.push(i),this.invoker.trigger();return}this.processTask(i,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}async processTask(t,e){if(e.type==="<response>"){let a=this.resolveRejects[t];if(delete this.resolveRejects[t],!a)return;e.error?a.reject(be(Hn(e.error))):a.resolve(Hn(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let i=Hn(e.data),r=new AbortController;this.abortControllers[t]=r;try{let a=await this.messageHandlers[e.type](e.sourceMapId,i,r);this.completeTask(t,null,a)}catch(a){this.completeTask(t,be(a))}}completeTask(t,e,i){let r=[];delete this.abortControllers[t];let a={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Wn(e):null,data:Wn(i,r)};this.target.postMessage(a,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function IP(t,e,i){return!(t<0||t>25||i<0||i>=2**t||e<0||e>=2**t)}function Gd(t,e){let{x:i,y:r}=Et.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)}var Ls=class{constructor(t,e,i){if(!IP(t,e,i))throw Error(`x=${e}, y=${i}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=i,this.key=Qr(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){let r=AP(this.x,this.y,this.z),a=MP(this.z,this.x,this.y);return t[(this.x+this.y)%t.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(i==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,a).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new C((t.x*e-this.x)*k,(t.y*e-this.y)*k)}toString(){return`${this.z}/${this.x}/${this.y}`}},Bs=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Qr(t,e.z,e.z,e.x,e.y)}},Se=class _i{constructor(e,i,r,a,n){if(this.terrainRttPosMatrix32f=null,e<r)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=i,this.canonical=new Ls(r,+a,+n),this.key=Qr(i,e,r,a,n)}clone(){return new _i(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 Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?new _i(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new _i(e,this.wrap,e,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,i){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?Qr(this.wrap*+i,e,this.canonical.z,this.canonical.x,this.canonical.y):Qr(this.wrap*+i,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let i=this.canonical.z-e.canonical.z;return i<0?!1:e.canonical.x===this.canonical.x>>i&&e.canonical.y===this.canonical.y>>i}children(e){if(this.overscaledZ>=e)return[new _i(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,r=this.canonical.x*2,a=this.canonical.y*2;return[new _i(i,this.wrap,i,r,a),new _i(i,this.wrap,i,r+1,a),new _i(i,this.wrap,i,r,a+1),new _i(i,this.wrap,i,r+1,a+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new _i(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new _i(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Bs(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Et(e.x-this.wrap,e.y))}normalizeCoordinates(e,i,r=k){if(e>=0&&e<r&&i>=0&&i<r)return{tileID:this,x:e,y:i};let a=Math.floor(e/r),n=Math.floor(i/r),s=e-a*r,o=i-n*r,l=this.canonical.z,u=1<<l,h=this.canonical.y+n;if(h<0||h>=u)return null;let c=this.canonical.x+a,d=this.wrap;return c<0?(d-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(d+=Math.floor(c/u),c%=u),{tileID:new _i(this.overscaledZ,d,l,c,h),x:s,y:o}}};function Qr(t,e,i,r,a){t*=2,t<0&&(t=t*-1-1);let n=1<<i;return(n*n*t+n*a+r).toString(36)+i.toString(36)+e.toString(36)}var Sh=Math.PI*6378137;function AP(t,e,i){e=2**i-e-1;let r=xg(t*256,e*256,i),a=xg((t+1)*256,(e+1)*256,i);return`${r[0]},${r[1]},${a[0]},${a[1]}`}function xg(t,e,i){let r=2*Sh/256/2**i;return[t*r-Sh,e*r-Sh]}function MP(t,e,i){let r="";for(let a=t;a>0;a--){let n=1<<a-1;r+=(e&n?1:0)+(i&n?2:0)}return r}function Zd(t,e){let i=Math.abs(t.wrap*2)-+(t.wrap<0),r=Math.abs(e.wrap*2)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}$("CanonicalTileID",Ls),$("OverscaledTileID",Se,{omit:["terrainRttPosMatrix32f"]});var Os="_geojsonTileLayer";var FP=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},qd=class{constructor(t,e,i,r,a){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=r,this._z=e;for(let n in t.properties)typeof t.properties[n]=="string"&&t.properties[n].startsWith("__$json__:")&&(t.properties[n]=JSON.parse(t.properties[n].slice(10)));this.properties=t.properties,this.id=a}projectPoint(t,e,i,r){return[(t.x+e)*360/r-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+i)*2/r)*Math.PI))-90]}projectLine(t,e,i,r){return t.map(a=>this.projectPoint(a,e,i,r))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,i=t.extent*this._x,r=t.extent*this._y,a=t.loadGeometry();switch(t.type){case 1:{let n=[];for(let o of a)n.push(o[0]);let s=this.projectLine(n,i,r,e);this._geometry=n.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let n=a.map(s=>this.projectLine(s,i,r,e));this._geometry=n.length===1?{type:"LineString",coordinates:n[0]}:{type:"MultiLineString",coordinates:n};break}case 3:{let n=F0(a),s=[];for(let o of n)s.push(o.map(l=>this.projectLine(l,i,r,e)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!=="_geometry"&&e!=="_vectorTileFeature"&&e!=="_x"&&e!=="_y"&&e!=="_z"&&(t[e]=this[e]);return t}},pa=class{constructor(t,e,i){this._name=t,this.dataBuffer=e,typeof i=="number"?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},tu=class extends pa{},Wd=class extends tu{getValueFromBuffer(t){return this.dataBuffer[t]}},Hd=class extends tu{getValueFromBuffer(t){return this.dataBuffer[t]}},v1=class extends pa{constructor(t,e,i,r){super(t,e,r),this.delta=i}},Xd=class extends v1{constructor(t,e,i,r,a){super(t,a?Int32Array.of(e):Uint32Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},Yd=class extends pa{constructor(t,e,i,r){super(t,r?Int32Array.of(e):Uint32Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}},zP=class{constructor(t,e,i,r,a=4096){if(this._name=t,this._geometryVector=e,this._idVector=i,this._propertyVectors=r,this._extent=a,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let i=0;i<this.numFeatures;i++){let r;if(this.idVector){let s=this.idVector.getValue(i);s!==null&&(r=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let a={coordinates:e[i],type:this.geometryVector.geometryType(i)},n={};
vendor: 6,046 bytes, line 822
822for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(i);l!==null&&(n[o]=l)}t.push({id:r,geometry:a,properties:n})}return t}containsMaxSafeIntegerValues(t){return t instanceof Wd||t instanceof Yd||t instanceof Xd||t instanceof Hd}},Nn={FEATURE:0,VERTEX:1},wt={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},Fr={GEOMETRY:0,STRUCT:1,MAP:2},x1={ID:0},b1=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}},ht;(function(t){t.NONE="NONE",t.DELTA="DELTA",t.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",t.RLE="RLE",t.MORTON="MORTON"})(ht||(ht={}));var ni;(function(t){t.NONE="NONE",t.FAST_PFOR="FAST_PFOR",t.VARINT="VARINT"})(ni||(ni={}));var Kd=new Uint32Array(33);Kd[0]=0;for(let t=1;t<=32;t++)Kd[t]=t===32?4294967295:4294967295>>>32-t;var kc=Kd,Jd=65536;function Qd(t,e){return t-t%e}function RP(t){return Qd(t+31,32)}function w1(t){if(!Number.isFinite(t)||t<=0)return Jd;let e=Qd(Math.floor(t),256);return e===0?256:e}function kP(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function LP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0;i[a++]=n>>>0&3,i[a++]=n>>>2&3,i[a++]=n>>>4&3,i[a++]=n>>>6&3,i[a++]=n>>>8&3,i[a++]=n>>>10&3,i[a++]=n>>>12&3,i[a++]=n>>>14&3,i[a++]=n>>>16&3,i[a++]=n>>>18&3,i[a++]=n>>>20&3,i[a++]=n>>>22&3,i[a++]=n>>>24&3,i[a++]=n>>>26&3,i[a++]=n>>>28&3,i[a++]=n>>>30&3,i[a++]=s>>>0&3,i[a++]=s>>>2&3,i[a++]=s>>>4&3,i[a++]=s>>>6&3,i[a++]=s>>>8&3,i[a++]=s>>>10&3,i[a++]=s>>>12&3,i[a++]=s>>>14&3,i[a++]=s>>>16&3,i[a++]=s>>>18&3,i[a++]=s>>>20&3,i[a++]=s>>>22&3,i[a++]=s>>>24&3,i[a++]=s>>>26&3,i[a++]=s>>>28&3,i[a]=s>>>30&3}function BP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;i[a++]=n>>>0&7,i[a++]=n>>>3&7,i[a++]=n>>>6&7,i[a++]=n>>>9&7,i[a++]=n>>>12&7,i[a++]=n>>>15&7,i[a++]=n>>>18&7,i[a++]=n>>>21&7,i[a++]=n>>>24&7,i[a++]=n>>>27&7,i[a++]=(n>>>30|(s&1)<<2)&7,i[a++]=s>>>1&7,i[a++]=s>>>4&7,i[a++]=s>>>7&7,i[a++]=s>>>10&7,i[a++]=s>>>13&7,i[a++]=s>>>16&7,i[a++]=s>>>19&7,i[a++]=s>>>22&7,i[a++]=s>>>25&7,i[a++]=s>>>28&7,i[a++]=(s>>>31|(o&3)<<1)&7,i[a++]=o>>>2&7,i[a++]=o>>>5&7,i[a++]=o>>>8&7,i[a++]=o>>>11&7,i[a++]=o>>>14&7,i[a++]=o>>>17&7,i[a++]=o>>>20&7,i[a++]=o>>>23&7,i[a++]=o>>>26&7,i[a]=o>>>29&7}function OP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;i[a++]=n>>>0&15,i[a++]=n>>>4&15,i[a++]=n>>>8&15,i[a++]=n>>>12&15,i[a++]=n>>>16&15,i[a++]=n>>>20&15,i[a++]=n>>>24&15,i[a++]=n>>>28&15,i[a++]=s>>>0&15,i[a++]=s>>>4&15,i[a++]=s>>>8&15,i[a++]=s>>>12&15,i[a++]=s>>>16&15,i[a++]=s>>>20&15,i[a++]=s>>>24&15,i[a++]=s>>>28&15,i[a++]=o>>>0&15,i[a++]=o>>>4&15,i[a++]=o>>>8&15,i[a++]=o>>>12&15,i[a++]=o>>>16&15,i[a++]=o>>>20&15,i[a++]=o>>>24&15,i[a++]=o>>>28&15,i[a++]=l>>>0&15,i[a++]=l>>>4&15,i[a++]=l>>>8&15,i[a++]=l>>>12&15,i[a++]=l>>>16&15,i[a++]=l>>>20&15,i[a++]=l>>>24&15,i[a]=l>>>28&15}function VP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;i[a++]=n>>>0&31,i[a++]=n>>>5&31,i[a++]=n>>>10&31,i[a++]=n>>>15&31,i[a++]=n>>>20&31,i[a++]=n>>>25&31,i[a++]=(n>>>30|(s&7)<<2)&31,i[a++]=s>>>3&31,i[a++]=s>>>8&31,i[a++]=s>>>13&31,i[a++]=s>>>18&31,i[a++]=s>>>23&31,i[a++]=(s>>>28|(o&1)<<4)&31,i[a++]=o>>>1&31,i[a++]=o>>>6&31,i[a++]=o>>>11&31,i[a++]=o>>>16&31,i[a++]=o>>>21&31,i[a++]=o>>>26&31,i[a++]=(o>>>31|(l&15)<<1)&31,i[a++]=l>>>4&31,i[a++]=l>>>9&31,i[a++]=l>>>14&31,i[a++]=l>>>19&31,i[a++]=l>>>24&31,i[a++]=(l>>>29|(u&3)<<3)&31,i[a++]=u>>>2&31,i[a++]=u>>>7&31,i[a++]=u>>>12&31,i[a++]=u>>>17&31,i[a++]=u>>>22&31,i[a]=u>>>27&31}function jP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;i[a++]=n>>>0&63,i[a++]=n>>>6&63,i[a++]=n>>>12&63,i[a++]=n>>>18&63,i[a++]=n>>>24&63,i[a++]=(n>>>30|(s&15)<<2)&63,i[a++]=s>>>4&63,i[a++]=s>>>10&63,i[a++]=s>>>16&63,i[a++]=s>>>22&63,i[a++]=(s>>>28|(o&3)<<4)&63,i[a++]=o>>>2&63,i[a++]=o>>>8&63,i[a++]=o>>>14&63,i[a++]=o>>>20&63,i[a++]=o>>>26&63,i[a++]=l>>>0&63,i[a++]=l>>>6&63,i[a++]=l>>>12&63,i[a++]=l>>>18&63,i[a++]=l>>>24&63,i[a++]=(l>>>30|(u&15)<<2)&63,i[a++]=u>>>4&63,i[a++]=u>>>10&63,i[a++]=u>>>16&63,i[a++]=u>>>22&63,i[a++]=(u>>>28|(h&3)<<4)&63,i[a++]=h>>>2&63,i[a++]=h>>>8&63,i[a++]=h>>>14&63,i[a++]=h>>>20&63,i[a]=h>>>26&63}function UP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;i[a++]=n>>>0&127,i[a++]=n>>>7&127,i[a++]=n>>>14&127,i[a++]=n>>>21&127,i[a++]=(n>>>28|(s&7)<<4)&127,i[a++]=s>>>3&127,i[a++]=s>>>10&127,i[a++]=s>>>17&127,i[a++]=s>>>24&127,i[a++]=(s>>>31|(o&63)<<1)&127,i[a++]=o>>>6&127,i[a++]=o>>>13&127,i[a++]=o>>>20&127,i[a++]=(o>>>27|(l&3)<<5)&127,i[a++]=l>>>2&127,i[a++]=l>>>9&127,i[a++]=l>>>16&127,i[a++]=l>>>23&127,i[a++]=(l>>>30|(u&31)<<2)&127,i[a++]=u>>>5&127,i[a++]=u>>>12&127,i[a++]=u>>>19&127,i[a++]=(u>>>26|(h&1)<<6)&127,i[a++]=h>>>1&127,i[a++]=h>>>8&127,i[a++]=h>>>15&127,i[a++]=h>>>22&127,i[a++]=(h>>>29|(c&15)<<3)&127,i[a++]=c>>>4&127,i[a++]=c>>>11&127,i[a++]=c>>>18&127,i[a]=c>>>25&127}function NP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0;i[a++]=n>>>0&255,i[a++]=n>>>8&255,i[a++]=n>>>16&255,i[a++]=n>>>24&255,i[a++]=s>>>0&255,i[a++]=s>>>8&255,i[a++]=s>>>16&255,i[a++]=s>>>24&255,i[a++]=o>>>0&255,i[a++]=o>>>8&255,i[a++]=o>>>16&255,i[a++]=o>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255,i[a++]=d>>>0&255,i[a++]=d>>>8&255,i[a++]=d>>>16&255,i[a]=d>>>24&255}function $P(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0;i[a++]=n>>>0&511,i[a++]=n>>>9&511,i[a++]=n>>>18&511,i[a++]=(n>>>27|(s&15)<<5)&511,i[a++]=s>>>4&511,i[a++]=s>>>13&511,i[a++]=s>>>22&511,i[a++]=(s>>>31|(o&255)<<1)&511,i[a++]=o>>>8&511,i[a++]=o>>>17&511,i[a++]=(o>>>
vendor: 14,313 bytes, line 822
82226|(l&7)<<6)&511,i[a++]=l>>>3&511,i[a++]=l>>>12&511,i[a++]=l>>>21&511,i[a++]=(l>>>30|(u&127)<<2)&511,i[a++]=u>>>7&511,i[a++]=u>>>16&511,i[a++]=(u>>>25|(h&3)<<7)&511,i[a++]=h>>>2&511,i[a++]=h>>>11&511,i[a++]=h>>>20&511,i[a++]=(h>>>29|(c&63)<<3)&511,i[a++]=c>>>6&511,i[a++]=c>>>15&511,i[a++]=(c>>>24|(d&1)<<8)&511,i[a++]=d>>>1&511,i[a++]=d>>>10&511,i[a++]=d>>>19&511,i[a++]=(d>>>28|(p&31)<<4)&511,i[a++]=p>>>5&511,i[a++]=p>>>14&511,i[a]=p>>>23&511}function GP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0;i[a++]=n>>>0&1023,i[a++]=n>>>10&1023,i[a++]=n>>>20&1023,i[a++]=(n>>>30|(s&255)<<2)&1023,i[a++]=s>>>8&1023,i[a++]=s>>>18&1023,i[a++]=(s>>>28|(o&63)<<4)&1023,i[a++]=o>>>6&1023,i[a++]=o>>>16&1023,i[a++]=(o>>>26|(l&15)<<6)&1023,i[a++]=l>>>4&1023,i[a++]=l>>>14&1023,i[a++]=(l>>>24|(u&3)<<8)&1023,i[a++]=u>>>2&1023,i[a++]=u>>>12&1023,i[a++]=u>>>22&1023,i[a++]=h>>>0&1023,i[a++]=h>>>10&1023,i[a++]=h>>>20&1023,i[a++]=(h>>>30|(c&255)<<2)&1023,i[a++]=c>>>8&1023,i[a++]=c>>>18&1023,i[a++]=(c>>>28|(d&63)<<4)&1023,i[a++]=d>>>6&1023,i[a++]=d>>>16&1023,i[a++]=(d>>>26|(p&15)<<6)&1023,i[a++]=p>>>4&1023,i[a++]=p>>>14&1023,i[a++]=(p>>>24|(f&3)<<8)&1023,i[a++]=f>>>2&1023,i[a++]=f>>>12&1023,i[a]=f>>>22&1023}function ZP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0;i[a++]=n>>>0&2047,i[a++]=n>>>11&2047,i[a++]=(n>>>22|(s&1)<<10)&2047,i[a++]=s>>>1&2047,i[a++]=s>>>12&2047,i[a++]=(s>>>23|(o&3)<<9)&2047,i[a++]=o>>>2&2047,i[a++]=o>>>13&2047,i[a++]=(o>>>24|(l&7)<<8)&2047,i[a++]=l>>>3&2047,i[a++]=l>>>14&2047,i[a++]=(l>>>25|(u&15)<<7)&2047,i[a++]=u>>>4&2047,i[a++]=u>>>15&2047,i[a++]=(u>>>26|(h&31)<<6)&2047,i[a++]=h>>>5&2047,i[a++]=h>>>16&2047,i[a++]=(h>>>27|(c&63)<<5)&2047,i[a++]=c>>>6&2047,i[a++]=c>>>17&2047,i[a++]=(c>>>28|(d&127)<<4)&2047,i[a++]=d>>>7&2047,i[a++]=d>>>18&2047,i[a++]=(d>>>29|(p&255)<<3)&2047,i[a++]=p>>>8&2047,i[a++]=p>>>19&2047,i[a++]=(p>>>30|(f&511)<<2)&2047,i[a++]=f>>>9&2047,i[a++]=f>>>20&2047,i[a++]=(f>>>31|(m&1023)<<1)&2047,i[a++]=m>>>10&2047,i[a]=m>>>21&2047}function qP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0,g=t[e+11]>>>0;i[a++]=n>>>0&4095,i[a++]=n>>>12&4095,i[a++]=(n>>>24|(s&15)<<8)&4095,i[a++]=s>>>4&4095,i[a++]=s>>>16&4095,i[a++]=(s>>>28|(o&255)<<4)&4095,i[a++]=o>>>8&4095,i[a++]=o>>>20&4095,i[a++]=l>>>0&4095,i[a++]=l>>>12&4095,i[a++]=(l>>>24|(u&15)<<8)&4095,i[a++]=u>>>4&4095,i[a++]=u>>>16&4095,i[a++]=(u>>>28|(h&255)<<4)&4095,i[a++]=h>>>8&4095,i[a++]=h>>>20&4095,i[a++]=c>>>0&4095,i[a++]=c>>>12&4095,i[a++]=(c>>>24|(d&15)<<8)&4095,i[a++]=d>>>4&4095,i[a++]=d>>>16&4095,i[a++]=(d>>>28|(p&255)<<4)&4095,i[a++]=p>>>8&4095,i[a++]=p>>>20&4095,i[a++]=f>>>0&4095,i[a++]=f>>>12&4095,i[a++]=(f>>>24|(m&15)<<8)&4095,i[a++]=m>>>4&4095,i[a++]=m>>>16&4095,i[a++]=(m>>>28|(g&255)<<4)&4095,i[a++]=g>>>8&4095,i[a]=g>>>20&4095}function WP(t,e,i,r){let a=r,n=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0,g=t[e+11]>>>0,_=t[e+12]>>>0,y=t[e+13]>>>0,x=t[e+14]>>>0,v=t[e+15]>>>0;i[a++]=n>>>0&65535,i[a++]=n>>>16&65535,i[a++]=s>>>0&65535,i[a++]=s>>>16&65535,i[a++]=o>>>0&65535,i[a++]=o>>>16&65535,i[a++]=l>>>0&65535,i[a++]=l>>>16&65535,i[a++]=u>>>0&65535,i[a++]=u>>>16&65535,i[a++]=h>>>0&65535,i[a++]=h>>>16&65535,i[a++]=c>>>0&65535,i[a++]=c>>>16&65535,i[a++]=d>>>0&65535,i[a++]=d>>>16&65535,i[a++]=p>>>0&65535,i[a++]=p>>>16&65535,i[a++]=f>>>0&65535,i[a++]=f>>>16&65535,i[a++]=m>>>0&65535,i[a++]=m>>>16&65535,i[a++]=g>>>0&65535,i[a++]=g>>>16&65535,i[a++]=_>>>0&65535,i[a++]=_>>>16&65535,i[a++]=y>>>0&65535,i[a++]=y>>>16&65535,i[a++]=x>>>0&65535,i[a++]=x>>>16&65535,i[a++]=v>>>0&65535,i[a]=v>>>16&65535}function HP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0;i[a++]=o>>>0&1,i[a++]=o>>>1&1,i[a++]=o>>>2&1,i[a++]=o>>>3&1,i[a++]=o>>>4&1,i[a++]=o>>>5&1,i[a++]=o>>>6&1,i[a++]=o>>>7&1,i[a++]=o>>>8&1,i[a++]=o>>>9&1,i[a++]=o>>>10&1,i[a++]=o>>>11&1,i[a++]=o>>>12&1,i[a++]=o>>>13&1,i[a++]=o>>>14&1,i[a++]=o>>>15&1,i[a++]=o>>>16&1,i[a++]=o>>>17&1,i[a++]=o>>>18&1,i[a++]=o>>>19&1,i[a++]=o>>>20&1,i[a++]=o>>>21&1,i[a++]=o>>>22&1,i[a++]=o>>>23&1,i[a++]=o>>>24&1,i[a++]=o>>>25&1,i[a++]=o>>>26&1,i[a++]=o>>>27&1,i[a++]=o>>>28&1,i[a++]=o>>>29&1,i[a++]=o>>>30&1,i[a++]=o>>>31&1}}function XP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0;i[a++]=o>>>0&3,i[a++]=o>>>2&3,i[a++]=o>>>4&3,i[a++]=o>>>6&3,i[a++]=o>>>8&3,i[a++]=o>>>10&3,i[a++]=o>>>12&3,i[a++]=o>>>14&3,i[a++]=o>>>16&3,i[a++]=o>>>18&3,i[a++]=o>>>20&3,i[a++]=o>>>22&3,i[a++]=o>>>24&3,i[a++]=o>>>26&3,i[a++]=o>>>28&3,i[a++]=o>>>30&3,i[a++]=l>>>0&3,i[a++]=l>>>2&3,i[a++]=l>>>4&3,i[a++]=l>>>6&3,i[a++]=l>>>8&3,i[a++]=l>>>10&3,i[a++]=l>>>12&3,i[a++]=l>>>14&3,i[a++]=l>>>16&3,i[a++]=l>>>18&3,i[a++]=l>>>20&3,i[a++]=l>>>22&3,i[a++]=l>>>24&3,i[a++]=l>>>26&3,i[a++]=l>>>28&3,i[a++]=l>>>30&3}}function YP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0;i[a++]=o>>>0&7,i[a++]=o>>>3&7,i[a++]=o>>>6&7,i[a++]=o>>>9&7,i[a++]=o>>>12&7,i[a++]=o>>>15&7,i[a++]=o>>>18&7,i[a++]=o>>>21&7,i[a++]=o>>>24&7,i[a++]=o>>>27&7,i[a++]=(o>>>30|(l&1)<<2)&7,i[a++]=l>>>1&7,i[a++]=l>>>4&7,i[a++]=l>>>7&7,i[a++]=l>>>10&7,i[a++]=l>>>13&7,i[a++]=l>>>16&7,i[a++]=l>>>19&7,i[a++]=l>>>22&7,i[a++]=l>>>25&7,i[a++]=l>>>28&7,i[a++]=(l>>>31|(u&3)<<1)&7,i[a++]=u>>>2&7,i[a++]=u>>>5&7,i[a++]=u>>>8&7,i[a++]=u>>>11&7,i[a++]=u>>>14&7,i[a++]=u>>>17&7,i[a++]=u>>>20&7,i[a++]=u>>>23&7,i[a++]=u>>>26&7,i[a++]=u>>>29&7}}function KP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0,h=t[n++]>>>0;i[a++]=o>>>0&15,i[a++]=o>>>4&15,i[a++]=o>>>8&15,i[a++]=o>>>12&15,i[a++]=o>>>16&15,i[a++]=o>>>20&15,i[a++]=o>>>24&15,i[a++]=o>>>28&15,i[a++]=l>>>0&15,i[a++]=l>>>4&15,i[a++]=l>>>8&15,i[a++]=l>>>12&15,i[a++]=l>>>16&15,i[a++]=l>>>20&15,i[a++]=l>>>24&15,i[a++]=l>>>28&15,i[a++]=u>>>0&15,i[a++]=u>>>4&15,i[a++]=u>>>8&15,i[a++]=u>>>12&15,i[a++]=u>>>16&15,i[a++]=u>>>20&15,i[a++]=u>>>24&15,i[a++]=u>>>28&15,i[a++]=h>>>0&15,i[a++]=h>>>4&15,i[a++]=h>>>8&15,i[a++]=h>>>12&15,i[a++]=h>>>16&15,i[a++]=h>>>20&15,i[a++]=h>>>24&15,i[a++]=h>>>28&15}}function JP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0,h=t[n++]>>>0,c=t[n++]>>>0;i[a++]=o>>>0&31,i[a++]=o>>>5&31,i[a++]=o>>>10&31,i[a++]=o>>>15&31,i[a++]=o>>>20&31,i[a++]=o>>>25&31,i[a++]=(o>>>30|(l&7)<<2)&31,i[a++]=l>>>3&31,i[a++]=l>>>8&31,i[a++]=l>>>13&31,i[a++]=l>>>18&31,i[a++]=l>>>23&31,i[a++]=(l>>>28|(u&1)<<4)&31,i[a++]=u>>>1&31,i[a++]=u>>>6&31,i[a++]=u>>>11&31,i[a++]=u>>>16&31,i[a++]=u>>>21&31,i[a++]=u>>>26&31,i[a++]=(u>>>31|(h&15)<<1)&31,i[a++]=h>>>4&31,i[a++]=h>>>9&31,i[a++]=h>>>14&31,i[a++]=h>>>19&31,i[a++]=h>>>24&31,i[a++]=(h>>>29|(c&3)<<3)&31,i[a++]=c>>>2&31,i[a++]=c>>>7&31,i[a++]=c>>>12&31,i[a++]=c>>>17&31,i[a++]=c>>>22&31,i[a++]=c>>>27&31}}function QP(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0,h=t[n++]>>>0,c=t[n++]>>>0,d=t[n++]>>>0;i[a++]=o>>>0&63,i[a++]=o>>>6&63,i[a++]=o>>>12&63,i[a++]=o>>>18&63,i[a++]=o>>>24&63,i[a++]=(o>>>30|(l&15)<<2)&63,i[a++]=l>>>4&63,i[a++]=l>>>10&63,i[a++]=l>>>16&63,i[a++]=l>>>22&63,i[a++]=(l>>>28|(u&3)<<4)&63,i[a++]=u>>>2&63,i[a++]=u>>>8&63,i[a++]=u>>>14&63,i[a++]=u>>>20&63,i[a++]=u>>>26&63,i[a++]=h>>>0&63,i[a++]=h>>>6&63,i[a++]=h>>>12&63,i[a++]=h>>>18&63,i[a++]=h>>>24&63,i[a++]=(h>>>30|(c&15)<<2)&63,i[a++]=c>>>4&63,i[a++]=c>>>10&63,i[a++]=c>>>16&63,i[a++]=c>>>22&63,i[a++]=(c>>>28|(d&3)<<4)&63,i[a++]=d>>>2&63,i[a++]=d>>>8&63,i[a++]=d>>>14&63,i[a++]=d>>>20&63,i[a++]=d>>>26&63}}function tC(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0,h=t[n++]>>>0,c=t[n++]>>>0,d=t[n++]>>>0,p=t[n++]>>>0;i[a++]=o>>>0&127,i[a++]=o>>>7&127,i[a++]=o>>>14&127,i[a++]=o>>>21&127,i[a++]=(o>>>28|(l&7)<<4)&127,i[a++]=l>>>3&127,i[a++]=l>>>10&127,i[a++]=l>>>17&127,i[a++]=l>>>24&127,i[a++]=(l>>>31|(u&63)<<1)&127,i[a++]=u>>>6&127,i[a++]=u>>>13&127,i[a++]=u>>>20&127,i[a++]=(u>>>27|(h&3)<<5)&127,i[a++]=h>>>2&127,i[a++]=h>>>9&127,i[a++]=h>>>16&127,i[a++]=h>>>23&127,i[a++]=(h>>>30|(c&31)<<2)&127,i[a++]=c>>>5&127,i[a++]=c>>>12&127,i[a++]=c>>>19&127,i[a++]=(c>>>26|(d&1)<<6)&127,i[a++]=d>>>1&127,i[a++]=d>>>8&127,i[a++]=d>>>15&127,i[a++]=d>>>22&127,i[a++]=(d>>>29|(p&15)<<3)&127,i[a++]=p>>>4&127,i[a++]=p>>>11&127,i[a++]=p>>>18&127,i[a++]=p>>>25&127}}function eC(t,e,i,r){let a=r,n=e;for(let s=0;s<8;s++){let o=t[n++]>>>0,l=t[n++]>>>0,u=t[n++]>>>0,h=t[n++]>>>0,c=t[n++]>>>0,d=t[n++]>>>0,p=t[n++]>>>0,f=t[n++]>>>0;i[a++]=o>>>0&255,i[a++]=o>>>8&255,i[a++]=o>>>16&255,i[a++]=o>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255,i[a++]=d>>>0&255,i[a++]=d>>>8&255,i[a++]=d>>>16&255,i[a++]=d>>>24&255,i[a++]=p>>>0&255,i[a++]=p>>>8&255,i[a++]=p>>>16&255,i[a++]=p>>>24&255,i[a++]=f>>>0&255,i[a++]=f>>>8&255,i[a++]=f>>>16&255,i[a++]=f>>>24&255}}function iC(t,e,i,r){let a=r,n=e;for(let s=0;s<128;s++){let o=t[n++]>>>0;i[a++]=o&65535,i[a++]=o>>>16&65535}}function rC(t,e,i,r,a){let n=kc[a]>>>0,s=e,o=0,l=t[s]>>>0,u=r;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+a<=32){let d=l>>>o&n;i[u+c]=d|0,o+=a,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let d=32-o,p=l>>>o;s++,l=t[s]>>>0;let f=a-d,m=-1>>>32-f>>>0,g=(p|(l&m)<<d)&n;i[u+c]=g|0,o=f}u+=32,o=0,h<7&&(l=t[s]>>>0)}}var Lc=w1(Jd),aC=3*Lc/256+Lc|0;function T1(){let t=new Uint8Array(aC);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function nC(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:T1()}}function sC(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let i=new Uint32Array(Math.max(16,e*2));return t.encodedWords=i,i}function oC(t,e,i,r){r.byteContainer.length<i&&(r.byteContainer=new Uint8Array(i*2),r.byteContainerI32=void 0);let a=r.byteContainer,n=i>>>2;if(a.byteOffset&3)for(let o=0;o<n;o=o+1|0){let l=t[e+o|0]|0,u=o<<2;a[u]=l&255,a[u+1|0]=l>>>8&255,a[u+2|0]=l>>>16&255,a[u+3|0]=l>>>24&255}else{let o=r.byteContainerI32;(!o||o.buffer!==a.buffer||o.byteOffset!==a.byteOffset||o.length<n)&&(o=r.byteContainerI32=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>>2)),o.set(t.subarray(e,e+n))}let s=i&3;if(s>0){let o=t[e+n|0]|0,l=n<<2;for(let u=0;u<s;u=u+1|0)a[l+u|0]=o>>>(u<<3)&255}return a}function lC(t,e,i){let r=t[e++]|0,a=i.dataToBePacked;for(let n=2;n<=32;n=n+1|0){if(!(r>>>n-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${n}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=RP(s),l=s*n+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${n}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=a[n];(!u||u.length<o)&&(u=a[n]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)yC(t,e,u,h,n),e=e+n|0;let c=h-s|0;e=e-(c*n>>>5)|0,i.exceptionSizes[n]=s}return e}function uC(t,e,i,r,a){switch(a){case 1:HP(t,e,i,r);break;case 2:XP(t,e,i,r);break;case 3:YP(t,e,i,r);break;case 4:KP(t,e,i,r);break;case 5:JP(t,e,i,r);break;case 6:QP(t,e,i,r);break;case 7:tC(t,e,i,r);break;case 8:eC(t,e,i,r);break;case 16:iC(t,e,i,r);break;default:rC(t,e,i,r,a)}return e+(a<<3)|0}function hC(t,e,i,r){if(i+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${r} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);let a=t[i++],n=t[i++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${r} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:n,bytePosIn:i}}function cC(t,e,i,r,a,n){if(i+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${n} (need 1 byte for maxBits, bytePos=${i}, byteSize=${e})`);let s=t[i++];if(s<r||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${n} (bitWidth=${r}, expected ${r}..32)`);let o=s-r|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${n} (bitWidth=${r}, maxBits=${s})`);if(i+a>e)throw Error(`FastPFOR decode: exception positions underflow at block=${n} (need=${a}, have=${e-i})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:i}}function dC(t,e,i,r,a,n,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=cC(a,n,s,i,r,l);if(s=c,h===1){let g=1<<i;for(let _=0;_<r;_=_+1|0){let y=a[s++];t[y+e|0]|=g}return s}let d=o.dataToBePacked[h];if(!d)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${i}, maxBits=${u}) at block ${l}`);let p=o.dataPointers,f=p[h]|0,m=o.exceptionSizes[h]|0;if(f+r>m)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${f}, need ${r}, size=${m}) at block ${l}`);for(let g=0;g<r;g=g+1|0){let _=a[s++],y=d[f++]|0;t[_+e|0]|=y<<i}return p[h]=f,s}function pC(t,e,i,r,a,n,s,o,l,u){let h=i|0,c=0;for(let d=0;d<s;d=d+1|0){let p=hC(o,l,c,d);c=p.bytePosIn;let f=p.bitWidth,m=p.exceptionCount,g=n+d*256|0;switch(f){case 0:a.fill(0,g,g+256);break;case 32:for(let _=0;_<256;_=_+1|0)a[g+_|0]=t[h+_|0]|0;h=h+256|0;break;default:h=uC(t,h,a,g,f)}m>0&&(c=dC(a,g,f,m,o,l,c,u,d))}if(h!==r)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${i}, consumedPackedEnd=${h}, expectedPackedEnd=${r}, packedWords=${r-i}, encoded.length=${t.length})`)}function fC(t,e,i,r,a,n){let s=i|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,d=u+1,p=d+c;if(p>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}
822, byteContainerStart=${d}) causes bitmapPos=${p} out of bounds (encoded.length=${t.length})`);let f=oC(t,d,h,n),m=h,g=lC(t,p,n);return n.dataPointers.fill(0),pC(t,s,l,u,e,r|0,a/256|0,f,m,n),g}function mC(t,e,i,r,a,n){let s=r+Qd(a,256),o=r,l=i;for(;o!==s;){let u=Math.min(Lc,s-o);l=fC(t,e,l,o,u,n),o=o+u|0}return l}function gC(t,e,i,r,a,n){if(n===0)return e;let s=0,o=e,l=e+i,u=a,h=a,c=a+n,d=0,p=0;for(;o<l&&h<c;){let f=t[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,d|=(f&127)<<p,f&128)r[h++]=d|0,d=0,p=0;else if(p+=7,p>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${d}, decoded=${h-u}/${n}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${n}, consumedWords=${o-e}/${i}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function _C(t,e,i){let r=0,a=0,n=new Uint32Array(e),s=i??T1();if(t.length>0){let u=t[r]|0;if(r=r+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(a+u>n.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${u}, out.length=${n.length})`);r=mC(t,n,r,a,u,s),a=a+u|0}let o=t.length-r|0,l=e-a|0;return gC(t,r,o,n,a,l),n}function yC(t,e,i,r,a){switch(a){case 2:LP(t,e,i,r);return;case 3:BP(t,e,i,r);return;case 4:OP(t,e,i,r);return;case 5:VP(t,e,i,r);return;case 6:jP(t,e,i,r);return;case 7:UP(t,e,i,r);return;case 8:NP(t,e,i,r);return;case 9:$P(t,e,i,r);return;case 10:GP(t,e,i,r);return;case 11:ZP(t,e,i,r);return;case 12:qP(t,e,i,r);return;case 16:WP(t,e,i,r);return;case 32:for(let u=0;u<32;u=u+1|0)i[r+u|0]=t[e+u|0]|0;return}let n=kc[a]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+a<=32){let h=l>>>o&n;i[r+u]=h|0,o+=a,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let d=kc[a-h]>>>0,p=(c|(l&d)<<h)&n;i[r+u]=p|0,o=a-h}}function vC(t,e,i,r){if(e<0||i<0||e+i>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${i}, bytes.length=${t.length})`);let a=Math.floor(i/4),n=i%4!=0,s=n?a+1:a;if(r.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${s}`);if(a>0){let o=t.byteOffset+e;if(o&3)for(let l=0;l<a;l++){let u=e+l*4;r[l]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]|0}else{let l=new Uint32Array(t.buffer,o,a);for(let u=0;u<a;u++)r[u]=kP(l[u])|0}}if(n){let o=e+a*4,l=i-a*4,u=0;for(let h=0;h<l;h++)u|=t[o+h]<<24-h*8;r[a]=u|0}return s}function Me(t,e,i){let r=new Uint32Array(i),a=0,n=e.get();for(let s=0;s<r.length;s++){let o=t[n++],l=o&127;if(o<128){r[a++]=l;continue}if(o=t[n++],l|=(o&127)<<7,o<128){r[a++]=l;continue}if(o=t[n++],l|=(o&127)<<14,o<128){r[a++]=l;continue}if(o=t[n++],l|=(o&127)<<21,o<128){r[a++]=l;continue}o=t[n++],l|=(o&15)<<28,r[a++]=l}return e.set(n),r}function tp(t,e,i){let r=new BigUint64Array(i);for(let a=0;a<r.length;a++)r[a]=xC(t,e);return r}function xC(t,e){let i=0n,r=0,a=e.get();for(;a<t.length;){let n=t[a++];if(i|=BigInt(n&127)<<BigInt(r),!(n&128))break;if(r+=7,r>=64)throw Error("Varint too long")}return e.set(a),i}function bC(t,e,i){let r=new Float64Array(i);for(let a=0;a<i;a++)r[a]=wC(t,e);return r}function wC(t,e){let i,r;return r=t[e.get()],e.increment(),i=r&127,r<128||(r=t[e.get()],e.increment(),i|=(r&127)<<7,r<128)||(r=t[e.get()],e.increment(),i|=(r&127)<<14,r<128)||(r=t[e.get()],e.increment(),i|=(r&127)<<21,r<128)?i:(r=t[e.get()],i|=(r&15)<<28,TC(i,t,e))}function TC(t,e,i){let r,a;if(a=e[i.get()],i.increment(),r=(a&112)>>4,a<128||(a=e[i.get()],i.increment(),r|=(a&127)<<3,a<128)||(a=e[i.get()],i.increment(),r|=(a&127)<<10,a<128)||(a=e[i.get()],i.increment(),r|=(a&127)<<17,a<128)||(a=e[i.get()],i.increment(),r|=(a&127)<<24,a<128)||(a=e[i.get()],i.increment(),r|=(a&1)<<31,a<128))return r*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function EC(t,e,i,r){return SC(t,e,i,r,nC(i>>>2))}function SC(t,e,i,r,a){let n=r.get();if(i&3)throw Error(`FastPFOR: invalid encodedByteLength=${i} at offset=${n} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=i>>>2,o=sC(a,s);vC(t,n,i,o);let l=_C(o.subarray(0,s),e,a.decoderWorkspace);return r.add(i),l}function _t(t){return t>>>1^-(t&1)}function Ae(t){return t>>1n^-(t&1n)}function Pr(t){return t%2==1?(t+1)/-2:t/2}function DC(t){let e=new Int32Array(t.length);for(let i=0;i<t.length;i++)e[i]=_t(t[i]);return e}function PC(t){let e=new BigInt64Array(t.length);for(let i=0;i<t.length;i++)e[i]=Ae(t[i]);return e}function CC(t){for(let e=0;e<t.length;e++)t[e]=Pr(t[e])}function Bc(t,e,i){if(i===void 0){i=0;for(let n=0;n<e;n++)i+=t[n]}let r=new Uint32Array(i),a=0;for(let n=0;n<e;n++){let s=t[n],o=t[n+e];r.fill(o,a,a+s),a+=s}return r}function Oc(t,e,i){if(i===void 0){i=0;for(let n=0;n<e;n++)i+=Number(t[n])}let r=new BigUint64Array(i),a=0;for(let n=0;n<e;n++){let s=Number(t[n]),o=t[n+e];r.fill(o,a,a+s),a+=s}return r}function E1(t,e,i){let r=new Float64Array(i),a=0;for(let n=0;n<e;n++){let s=t[n],o=t[n+e];r.fill(o,a,a+s),a+=s}return r}function bg(t){let e=new Int32Array(t.length);e[0]=_t(t[0]);let i=t.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let a=t[r],n=t[r+1],s=t[r+2],o=t[r+3];e[r]=_t(a)+e[r-1],e[r+1]=_t(n)+e[r],e[r+2]=_t(s)+e[r+1],e[r+3]=_t(o)+e[r+2]}for(;r!==t.length;++r)e[r]=_t(t[r])+e[r-1];return e}function wg(t){let e=new BigInt64Array(t.length);e[0]=Ae(t[0]);let i=t.length/4*4,r=1;if(i>=4)for(;r<i-4;r+=4){let a=t[r],n=t[r+1],s=t[r+2],o=t[r+3];e[r]=Ae(a)+e[r-1],e[r+1]=Ae(n)+e[r],e[r+2]=Ae(s)+e[r+1],e[r+3]=Ae(o)+e[r+2]}for(;r!==e.length;++r)e[r]=Ae(t[r])+e[r-1];return e}function IC(t){t[0]=Pr(t[0]);let e=t.length/4*4,i=1;if(e>=4)for(;i<e-4;i+=4){let r=t[i],a=t[i+1],n=t[i+2],s=t[i+3];t[i]=Pr(r)+t[i-1],t[i+1]=Pr(a)+t[i],t[i+2]=Pr(n)+t[i+1],t[i+3]=Pr(s)+t[i+2]}for(;i!==t.length;++i)t[i]=Pr(t[i])+t[i-1]}function AC(t,e,i){if(i===void 0){i=0;for(let n=0;n<e;n++)i+=t[n]}let r=new Int32Array(i),a=0;for(let n=0;n<e;n++){let s=t[n],o=t[n+e];o=_t(o),r.fill(o,a,a+s),a+=s}return r}
vendor: 40,182 bytes, line 822
822function MC(t,e,i){if(i===void 0){i=0;for(let n=0;n<e;n++)i+=Number(t[n])}let r=new BigInt64Array(i),a=0;for(let n=0;n<e;n++){let s=Number(t[n]),o=t[n+e];o=Ae(o),r.fill(o,a,a+s),a+=s}return r}function FC(t,e,i){let r=new Float64Array(i),a=0;for(let n=0;n<e;n++){let s=t[n],o=t[n+e];o=Pr(o),r.fill(o,a,a+s),a+=s}return r}function ep(t){let e=t.length/4*4,i=1;if(e>=4)for(let r=t[0];i<e-4;i+=4)r=t[i]+=r,r=t[i+1]+=r,r=t[i+2]+=r,r=t[i+3]+=r;for(;i!==t.length;)t[i]+=t[i-1],++i}function zC(t){let e=0;for(let i=0;i<t.length;i++)t[i]+=e,e=t[i]}function RC(t){if(t.length<2)return new Int32Array(t);let e=new Int32Array(t.length);e[0]=_t(t[0]),e[1]=_t(t[1]);let i=t.length/4*4,r=2;if(i>=4)for(;r<i-4;r+=4){let a=t[r],n=t[r+1],s=t[r+2],o=t[r+3];e[r]=_t(a)+e[r-2],e[r+1]=_t(n)+e[r-1],e[r+2]=_t(s)+e[r],e[r+3]=_t(o)+e[r+1]}for(;r!==t.length;r+=2)e[r]=_t(t[r])+e[r-2],e[r+1]=_t(t[r+1])+e[r-1];return e}function S1(t,e,i,r){if(t.length<2)return new Int32Array(t);let a=new Int32Array(t.length),n=_t(t[0]),s=_t(t[1]);a[0]=Sr(Math.round(n*e),i,r),a[1]=Sr(Math.round(s*e),i,r);let o=t.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=t[l],h=t[l+1],c=_t(u)+n,d=_t(h)+s;a[l]=Sr(Math.round(c*e),i,r),a[l+1]=Sr(Math.round(d*e),i,r);let p=t[l+2],f=t[l+3];n=_t(p)+c,s=_t(f)+d,a[l+2]=Sr(Math.round(n*e),i,r),a[l+3]=Sr(Math.round(s*e),i,r)}for(;l!==t.length;l+=2)n+=_t(t[l]),s+=_t(t[l+1]),a[l]=Sr(Math.round(n*e),i,r),a[l+1]=Sr(Math.round(s*e),i,r);return a}function Sr(t,e,i){return Math.min(i,Math.max(e,t))}function kC(t){let e=new Int32Array(t.length+1);e[0]=0,e[1]=_t(t[0]);let i=e[1];for(let r=2;r!==e.length;++r){let a=t[r-1],n=_t(a);i+=n,e[r]=e[r-1]+i}return new Uint32Array(e)}function LC(t,e,i){let r=new Int32Array(i+1);r[0]=0;let a=1,n=r[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];l=_t(l);for(let u=a;u<a+o;u++)r[u]=l+n,n=r[u];a+=o}return r}function BC(t,e,i){let r=new Uint32Array(i+1);r[0]=0;let a=1,n=r[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];for(let u=a;u<a+o;u++)r[u]=l+n,n=r[u];a+=o}return r}function OC(t,e,i){let r=new Int32Array(i),a=0,n=0;for(let s=0;s<e;s++){let o=t[s],l=t[s+e],u=_t(l);for(let h=0;h<o;h++)n+=u,r[a++]=n}return r}function VC(t,e,i){let r=new BigInt64Array(i),a=0,n=0n;for(let s=0;s<e;s++){let o=Number(t[s]),l=t[s+e],u=Ae(l);for(let h=0;h<o;h++)n+=u,r[a++]=n}return r}function Tg(t){let e=new Uint32Array(t.length);e[0]=_t(t[0])>>>0;for(let i=1;i<t.length;i++)e[i]=e[i-1]+_t(t[i])>>>0;return e}function Eg(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ae(t[0]));for(let i=1;i<t.length;i++)e[i]=BigInt.asUintN(64,e[i-1]+Ae(t[i]));return e}function jC(t){if(t.length<2)return new Uint32Array(t);let e=new Uint32Array(t.length);e[0]=_t(t[0])>>>0,e[1]=_t(t[1])>>>0;for(let i=2;i<t.length;i+=2)e[i]=e[i-2]+_t(t[i])>>>0,e[i+1]=e[i-1]+_t(t[i+1])>>>0;return e}function UC(t,e,i,r){let a=S1(t,e,i,r);return new Uint32Array(a)}function NC(t){return t[1]}function $C(t){return _t(t[1])}function GC(t){if(t.length===2){let e=_t(t[1]);return[e,e]}return[_t(t[2]),_t(t[3])]}function ZC(t){return t[1]}function qC(t){return Ae(t[1])}function WC(t){if(t.length===2){let e=Ae(t[1]);return[e,e]}return[Ae(t[2]),Ae(t[3])]}var ae;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(ae||(ae={}));var ke;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(ke||(ke={}));var Hi;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Hi||(Hi={}));var de;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(de||(de={}));var HC=[ae.PRESENT,ae.DATA,ae.OFFSET,ae.LENGTH],Sg=[ht.NONE,ht.DELTA,ht.COMPONENTWISE_DELTA,ht.RLE,ht.MORTON],XC=[ni.NONE,ni.FAST_PFOR,ni.VARINT],YC=[ke.NONE,ke.SINGLE,ke.SHARED,ke.VERTEX,ke.MORTON,ke.FSST],KC=[Hi.VERTEX,Hi.INDEX,Hi.STRING,Hi.KEY],JC=[de.VAR_BINARY,de.GEOMETRIES,de.PARTS,de.RINGS,de.TRIANGLES,de.SYMBOL,de.DICTIONARY];function $t(t,e){let i=eI(t,e);return i.logicalLevelTechnique1===ht.MORTON?QC(i,t,e):(ht.RLE===i.logicalLevelTechnique1||ht.RLE===i.logicalLevelTechnique2)&&ni.NONE!==i.physicalLevelTechnique?tI(i,t,e):i}function QC(t,e,i){let r=Me(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:r[0],coordinateShift:r[1]}}function tI(t,e,i){let r=Me(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}function eI(t,e){let i=t[e.get()],r=HC[i>>4],a={};switch(r){case ae.DATA:a={dictionaryType:YC[i&15]};break;case ae.OFFSET:a={offsetType:KC[i&15]};break;case ae.LENGTH:a={lengthType:JC[i&15]}}e.increment();let n=t[e.get()],s=Sg[n>>5],o=Sg[n>>2&7],l=XC[n&3];e.increment();let u=Me(t,e,2),h=u[0],c=u[1];return{physicalStreamType:r,logicalStreamType:a,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var jt;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(jt||(jt={}));var zi=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),i=t%8;return(this.values[e]>>i&1)==1}set(t,e){let i=Math.floor(t/8),r=t%8;this.values[i]=this.values[i]|+!!e<<r}getInt(t){let e=Math.floor(t/8),i=t%8;return this.values[e]>>i&1}size(){return this._size}getBuffer(){return this.values}};function fa(t,e,i){if(!e)return t;let r=e.size(),a=t.constructor,n=new a(r),s=0;for(let o=0;o<r;o++)n[o]=e.get(o)?t[s++]:i;return n}function iI(t,e,i){if(!i)return t;let r=i.size(),a=new zi(t,e),n=new zi(new Uint8Array(Math.ceil(r/8)),r),s=0;for(let o=0;o<r;o++){let l=i.get(o)?a.get(s++):!1;n.set(o,l)}return n.getBuffer()}function D1(t,e,i){for(let r=0;r<t;r++){let a=$t(e,i);i.add(a.byteLength)}}function cn(t,e,i,r,a){let n=rI(t,Math.ceil(e/8),i,r);return a?iI(n,e,a):n}function rI(t,e,i,r){let a=new Uint8Array(e),n=0,s=r.get()+i;for(;n<e&&!(r.get()>=s);){let o=t[r.increment()];if(o<=127){let l=o+3,u=t[r.increment()],h=Math.min(n+l,e);a.fill(u,n,h),n=h}else{let l=256-o;for(let u=0;u<l&&n<e;u++)a[n++]=t[r.increment()]}}return r.set(s),a}function P1(t,e,i,r){let a=e.get(),n=a+i*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(a,n)).buffer,o=new Float32Array(s);return e.set(n),r?fa(o,r,0):o}function C1(t,e,i,r){let a=e.get(),n=a+i*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(a,n)).buffer,o=new Float64Array(s);return e.set(n),r?fa(o,r,0):o}function aI(t,e,i){let r=e.get(),a=i*Uint32Array.BYTES_PER_ELEMENT,n=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(i);for(let o=0;o<i;o++)s[o]=n.getUint32(r+o*Uint32Array.BYTES_PER_ELEMENT,!0);return e.add(a),s}function nI(t,e,i){let r=e.get(),a=i*BigUint64Array.BYTES_PER_ELEMENT,n=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new BigUint64Array(i);for(let o=0;o<i;o++)s[o]=n.getBigUint64(r+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return e.add(a),s}var sI=new TextDecoder;function ip(t,e,i){return i-e>=12?sI.decode(t.subarray(e,i)):oI(t,e,i)}function oI(t,e,i){let r="",a=e;for(;a<i;){let n=t[a],s=null,o=n>239?4:n>223?3:n>191?2:1;if(a+o>i)break;let l,u,h;o===1?n<128&&(s=n):o===2?(l=t[a+1],(l&192)==128&&(s=(n&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[a+1],u=t[a+2],(l&192)==128&&(u&192)==128&&(s=(n&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[a+1],u=t[a+2],h=t[a+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(n&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,r+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),r+=String.fromCharCode(s),a+=o}return r}function sl(t,e,i,r,a){return dI(dn(t,e,i),i,r,a)}function Ie(t,e,i,r,a){return pI(dn(t,e,i),i,r,a)}function Cr(t,e,i){return mI(dn(t,e,i),i)}function dn(t,e,i){let r=i.physicalLevelTechnique;switch(r){case ni.FAST_PFOR:return EC(t,i.numValues,i.byteLength,e);case ni.VARINT:return Me(t,e,i.numValues);case ni.NONE:return aI(t,e,i.numValues);default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function Vs(t,e,i){let r=i.physicalLevelTechnique;switch(r){case ni.VARINT:return tp(t,e,i.numValues);case ni.NONE:return nI(t,e,i.numValues);default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function lI(t,e,i){let r=dn(t,e,i);return r.length===1?_t(r[0]):$C(r)}function rp(t,e,i){let r=dn(t,e,i);return r.length===1?i.logicalLevelTechnique1===ht.DELTA?_t(r[0]):r[0]:NC(r)}function I1(t,e,i){return GC(dn(t,e,i))}function A1(t,e,i){return WC(tp(t,e,i.numValues))}function M1(t,e,i,r){return z1(Vs(t,e,i),i,r)}function ap(t,e,i,r){return R1(Vs(t,e,i),i,r)}function uI(t,e,i,r){let a=hI(t,e,i,!1);return r?fa(a,r,0):a}function hI(t,e,i,r){if(i.physicalLevelTechnique===ni.VARINT)return fI(bC(t,e,i.numValues),i,r);let a=Vs(t,e,i),n=r?z1(a,i):R1(a,i);return Float64Array.from(n,Number)}function cI(t,e,i){let r=Vs(t,e,i);return r.length===1?Ae(r[0]):qC(r)}function F1(t,e,i){let r=Vs(t,e,i);return r.length===1?i.logicalLevelTechnique1===ht.DELTA?Ae(r[0]):r[0]:ZC(r)}function dI(t,e,i,r){let a;switch(e.logicalLevelTechnique1){case ht.DELTA:if(e.logicalLevelTechnique2===ht.RLE){let n=e;if(!r)return OC(t,n.runs,n.numRleValues);t=Bc(t,n.runs,n.numRleValues),a=bg(t)}else a=bg(t);break;case ht.RLE:a=AC(t,e.runs,e.numRleValues);break;case ht.MORTON:ep(t),a=new Int32Array(t);break;case ht.COMPONENTWISE_DELTA:if(i&&!r)return S1(t,i.scale,i.min,i.max);a=RC(t);break;case ht.NONE:a=DC(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?fa(a,r,0):a}function pI(t,e,i,r){let a;switch(e.logicalLevelTechnique1){case ht.DELTA:if(e.logicalLevelTechnique2===ht.RLE){let n=e;a=Tg(Bc(t,n.runs,n.numRleValues))}else a=Tg(t);break;case ht.RLE:a=Bc(t,e.runs,e.numRleValues);break;case ht.MORTON:ep(t),a=t;break;case ht.COMPONENTWISE_DELTA:a=i&&!r?UC(t,i.scale,i.min,i.max):jC(t);break;case ht.NONE:a=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?fa(a,r,0):a}function z1(t,e,i){let r;switch(e.logicalLevelTechnique1){case ht.DELTA:if(e.logicalLevelTechnique2===ht.RLE){let a=e;if(!i)return VC(t,a.runs,a.numRleValues);t=Oc(t,a.runs,a.numRleValues),r=wg(t)}else r=wg(t);break;case ht.RLE:r=MC(t,e.runs,e.numRleValues);break;case ht.NONE:r=PC(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?fa(r,i,0n):r}function R1(t,e,i){let r;switch(e.logicalLevelTechnique1){case ht.DELTA:if(e.logicalLevelTechnique2===ht.RLE){let a=e;r=Eg(Oc(t,a.runs,a.numRleValues))}else r=Eg(t);break;case ht.RLE:r=Oc(t,e.runs,e.numRleValues);break;case ht.NONE:r=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?fa(r,i,0n):r}function fI(t,e,i){switch(e.logicalLevelTechnique1){case ht.DELTA:if(e.logicalLevelTechnique2===ht.RLE){let r=e;t=E1(t,r.runs,r.numRleValues)}return IC(t),t;case ht.RLE:return _I(t,e,i);case ht.NONE:return i&&CC(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function mI(t,e){if(e.logicalLevelTechnique1===ht.DELTA&&e.logicalLevelTechnique2===ht.NONE)return kC(t);if(e.logicalLevelTechnique1===ht.RLE&&e.logicalLevelTechnique2===ht.NONE){let i=e;return BC(t,i.runs,i.numRleValues)}if(e.logicalLevelTechnique1===ht.NONE&&e.logicalLevelTechnique2===ht.NONE){zC(t);let i=new Uint32Array(e.numValues+1);return i[0]=0,i.set(t,1),i}if(e.logicalLevelTechnique1===ht.DELTA&&e.logicalLevelTechnique2===ht.RLE){let i=e,r=LC(t,i.runs,i.numRleValues);return ep(r),new Uint32Array(r)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function eu(t,e,i,r,a="int32"){let n=t.logicalLevelTechnique1;if(n===ht.RLE)return t.runs===1?jt.CONST:jt.FLAT;if(n!==ht.DELTA||t.logicalLevelTechnique2!==ht.RLE)return t.numValues===1?jt.CONST:jt.FLAT;let s=e instanceof zi?e.size():e,o=t;if(o.numRleValues!==s)return jt.FLAT;if(o.runs===1)return jt.SEQUENCE;if(o.runs!==2)return t.numValues===1?jt.CONST:jt.FLAT;let l=r.get();if(t.physicalLevelTechnique===ni.VARINT)return gI(i,r,a)?jt.SEQUENCE:t.numValues===1?jt.CONST:jt.FLAT;let u=r.get(),h=new Int32Array(i.buffer,i.byteOffset+u,4);return r.set(l),h[2]===2&&h[3]===2?jt.SEQUENCE:t.numValues===1?jt.CONST:jt.FLAT}function gI(t,e,i){let r=new b1(e.get());if(i==="int64"){let n=tp(t,r,4);return n[2]===2n&&n[3]===2n}let a=Me(t,r,4);return a[2]===2&&a[3]===2}function _I(t,e,i){return i?FC(t,e.runs,e.numRleValues):E1(t,e.runs,e.numRleValues)}var k1=class extends tu{getValueFromBuffer(t){return this.dataBuffer[t]}},L1=class extends v1{constructor(t,e,i,r,a){super(t,a?BigInt64Array.of(e):BigUint64Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function np(t,e,i){return{x:Dg(t,e)-i,y:Dg(t>>1,e)-i}}function Dg(t,e){let i=0;for(let r=0;r<e;r++)i|=(t&1<<2*r)>>r;return i}var xe;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})(xe||(xe={}));var Pg;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(Pg||(Pg={}));var kr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(kr||(kr={}));function yI(t){let e=Array(t.numGeometries),i=1,r=1,a=1,n=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,d=u.ringOffsets,p=t.vertexOffsets,f=!p||p.length===0,m=t.containsPolygonGeometry(),g=t.vertexBuffer;for(let _=0;_<t.numGeometries;_++){let y=t.geometryType(_);switch(y){case xe.POINT:{let x,v;if(f)x=g[s++],v=g[s++];else if(t.vertexBufferType===kr.MORTON){let w=g[p[o++]],b=np(w,l.numBits,l.coordinateShift);x=b.x,v=b.y}else{let w=p[o++]*2;x=g[w],v=g[w+1]}e[n++]=[[new C(x,v)]],h&&a++,c&&i++,d&&r++}break;case xe.MULTIPOINT:{let x=h[a]-h[a-1];a++;let v;if(f){v=Array(x);for(let w=0;w<x;w++){let b=g[s++],T=g[s++];v[w]=new C(b,T)}}else v=Wr(t.vertexBufferType,g,p,o,x,!1,l),o+=x;e[n++]=v.map(w=>[w]),i+=x,r+=x}break;case xe.LINESTRING:{let x;m?(x=d[r]-d[r-1],r++):x=c[i]-c[i-1],i++;let v;f?(v=Aa(g,s,x,!1),s+=x*2):(v=Wr(t.vertexBufferType,g,p,o,x,!1,l),o+=x),e[n++]=[v],h&&a++}break;case xe.POLYGON:{let x=c[i]-c[i-1];i++;let v=Array(x-1),w,b=d[r]-d[r-1];if(r++,f){w=Aa(g,s,b,!0),s+=b*2;for(let T=0;T<v.length;T++)b=d[r]-d[r-1],r++,v[T]=Aa(g,s,b,!0),s+=b*2}else{w=Wr(t.vertexBufferType,g,p,o,b,!0,l),o+=b;for(let T=0;T<v.length;T++)b=d[r]-d[r-1],r++,v[T]=Wr(t.vertexBufferType,g,p,o,b,!0,l),o+=b}e[n++]=[w].concat(v),h&&a++}break;case xe.MULTILINESTRING:{let x=h[a]-h[a-1];a++;let v=Array(x);for(let w=0;w<x;w++){let b;if(m?(b=d[r]-d[r-1],r++):b=c[i]-c[i-1],i++,f)v[w]=Aa(g,s,b,!1),s+=b*2;else{let T=Wr(t.vertexBufferType,g,p,o,b,!1,l);v[w]=T,o+=b}}e[n++]=v}break;case xe.MULTIPOLYGON:{let x=h[a]-h[a-1];a++;let v=Array(x);for(let w=0;w<x;w++){let b=c[i]-c[i-1];i++;let T,D=Array(b-1),E=d[r]-d[r-1];r++,f?(T=Aa(g,s,E,!0),s+=E*2):(T=Wr(t.vertexBufferType,g,p,o,E,!0,l),o+=E);for(let M=0;M<D.length;M++){let R=d[r]-d[r-1];r++,f?(D[M]=Aa(g,s,R,!0),s+=R*2):(D[M]=Wr(t.vertexBufferType,g,p,o,R,!0,l),o+=R)}v[w]=[T].concat(D)}e[n++]=v.flat()}break;default:throw Error(`The specified geometry type (${y}) is currently not supported.`)}}return e}function Wr(t,e,i,r,a,n,s){return t===kr.MORTON?xI(e,i,r,a,n,s):vI(e,i,r,a,n)}function Aa(t,e,i,r){let a=Array(r?i+1:i);for(let n=0;n<i*2;n+=2){let s=t[e+n],o=t[e+n+1];a[n/2]=new C(s,o)}return r&&(a[a.length-1]=a[0]),a}function vI(t,e,i,r,a){let n=Array(a?r+1:r);for(let s=0;s<r*2;s+=2){let o=e[i+s/2]*2,l=t[o],u=t[o+1];n[s/2]=new C(l,u)}return a&&(n[n.length-1]=n[0]),n}function xI(t,e,i,r,a,n){let s=Array(a?r+1:r);for(let o=0;o<r;o++){let l=t[e[i+o]],u=np(l,n.numBits,n.coordinateShift);s[o]=new C(u.x,u.y)}return a&&(s[s.length-1]=s[0]),s}var B1=class{constructor(t,e,i,r,a){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=i,this._vertexBuffer=r,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let i=this.vertexOffsets[t],r=this.vertexBuffer[i],a=np(r,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return yI(this)}get mortonSettings(){return this._mortonSettings}};function bI(t,e,i,r,a){return new O1(t,e,kr.VEC_2,i,r,a)}function wI(t,e,i,r,a,n){return new O1(t,e,kr.MORTON,i,r,a,n)}var O1=class extends B1{constructor(t,e,i,r,a,n,s){super(i,r,a,n,s),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===xe.POLYGON||this._geometryType===xe.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function V1(t,e,i,r){return new j1(kr.VEC_2,t,e,i,r)}function TI(t,e,i,r,a){return new j1(kr.MORTON,t,e,i,r,a)}var j1=class extends B1{constructor(t,e,i,r,a,n){super(t,i,r,a,n),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===xe.POLYGON||this.geometryType(t)===xe.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},U1=class{constructor(t,e,i,r){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=i,this._topologyVector=r}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let t=new Uint32Array(this.numGeometries);for(let e=0;e<this.numGeometries;e++)t[e]=this.geometryType(e);return V1(t,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function Cg(t,e,i,r,a,n){return new EI(t,e,i,r,a,n)}var EI=class extends U1{constructor(t,e,i,r,a,n){super(i,r,a,n),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function Ig(t,e,i,r,a){return new SI(t,e,i,r,a)}var SI=class extends U1{constructor(t,e,i,r,a){super(e,i,r,a),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function DI(t,e,i,r,a){let n=$t(t,i),s=eu(n,r,t,i),o,l,u,h;if(s===jt.CONST){let x=rp(t,i,n),v,w,b,T;for(let D=0;D<e-1;D++){let E=$t(t,i);switch(E.physicalStreamType){case ae.LENGTH:switch(E.logicalStreamType.lengthType){case de.GEOMETRIES:v=Cr(t,i,E);break;case de.PARTS:w=Cr(t,i,E);break;case de.RINGS:b=Cr(t,i,E);break;case de.TRIANGLES:T=Cr(t,i,E)}break;case ae.OFFSET:switch(E.logicalStreamType.offsetType){case Hi.VERTEX:o=Ie(t,i,E);break;case Hi.INDEX:h=Ie(t,i,E)}break;case ae.DATA:if(ke.VERTEX===E.logicalStreamType.dictionaryType)l=sl(t,i,E,a);else{let M=E;u={numBits:M.numBits,coordinateShift:M.coordinateShift},l=Ie(t,i,E,a)}}}return h?v!==void 0||w!==void 0?Cg(r,x,T,h,l,{geometryOffsets:v,partOffsets:w,ringOffsets:b}):Cg(r,x,T,h,l):u===void 0?bI(r,x,{geometryOffsets:v,partOffsets:w,ringOffsets:b},o,l):wI(r,x,{geometryOffsets:v,partOffsets:w,ringOffsets:b},o,l,u)}let c=Ie(t,i,n),d,p,f,m;for(let x=0;x<e-1;x++){let v=$t(t,i);switch(v.physicalStreamType){case ae.LENGTH:switch(v.logicalStreamType.lengthType){case de.GEOMETRIES:d=Ie(t,i,v);break;case de.PARTS:p=Ie(t,i,v);break;case de.RINGS:f=Ie(t,i,v);break;case de.TRIANGLES:m=Cr(t,i,v)}break;case ae.OFFSET:switch(v.logicalStreamType.offsetType){case Hi.VERTEX:o=Ie(t,i,v);break;case Hi.INDEX:h=Ie(t,i,v)}break;case ae.DATA:if(ke.VERTEX===v.logicalStreamType.dictionaryType)l=sl(t,i,v,a);else{let w=v;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=Ie(t,i,v,a)}}}let g,_,y;return d?(g=Dh(c,d,2),p&&f?(_=Ag(c,g,p,!1),y=CI(c,g,_,f)):p&&(_=PI(c,g,p))):p&&f?(_=Dh(c,p,1),y=Ag(c,_,f,!0)):p&&(_=Dh(c,p,0)),h&&!_?Ig(c,m,h,l):h?Ig(c,m,h,l,{geometryOffsets:g,partOffsets:_,ringOffsets:y}):u===void 0?V1(c,{geometryOffsets:g,partOffsets:_,ringOffsets:y},o,l):TI(c,{geometryOffsets:g,partOffsets:_,ringOffsets:y},o,l,u)}function Dh(t,e,i){let r=new Uint32Array(t.length+1),a=0;r[0]=a;let n=0;for(let s=0;s<t.length;s++)a=r[s+1]=a+(t[s]>i?e[n++]:1);return r}function Ag(t,e,i,r){let a=new Uint32Array(e[e.length-1]+1),n=0;a[0]=n;let s=1,o=0;for(let l=0;l<t.length;l++){let u=t[l],h=e[l+1]-e[l];if(u===5||u===2||r&&(u===4||u===1))for(let c=0;c<h;c++)n=a[s++]=n+i[o++];else for(let c=0;c<h;c++)a[s++]=++n}return a}function PI(t,e,i){let r=new Uint32Array(e[e.length-1]+1),a=0;r[0]=a;let n=1,s=0;for(let o=0;o<t.length;o++){let l=t[o],u=e[o+1]-e[o];if(l===4||l===1)for(let h=0;h<u;h++)a=r[n++]=a+i[s++];else for(let h=0;h<u;h++)r[n++]=++a}return r}function CI(t,e,i,r){let a=new Uint32Array(i[i.length-1]+1),n=0;a[0]=n;let s=1,o=1,l=0;for(let u=0;u<t.length;u++){let h=t[u],c=e[u+1]-e[u];if(h!==0&&h!==3)for(let d=0;d<c;d++){let p=i[s]-i[s-1];s++;for(let f=0;f<p;f++)n=a[o++]=n+r[l++]}else for(let d=0;d<c;d++)a[o++]=++n,s++}return a}var II=class extends pa{constructor(t,e,i){super(t,e.getBuffer(),i),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}},AI=class extends tu{getValueFromBuffer(t){return this.dataBuffer[t]}},N1=class extends pa{constructor(t,e,i,r){super(t,r?BigInt64Array.of(e):BigUint64Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}},sp=class extends pa{constructor(t,e,i,r){super(t,i,r),this.offsetBuffer=e}},Mg=class extends sp{constructor(t,e,i,r){super(t,e,i,r??e.length-1)}getValueFromBuffer(t){let e=this.offsetBuffer[t],i=this.offsetBuffer[t+1];return ip(this.dataBuffer,e,i)}},Ga=class extends sp{constructor(t,e,i,r,a){super(t,i,r,a??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){let e=this.indexBuffer[t],i=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return ip(this.dataBuffer,i,r)}};function MI(t,e){let i=0;for(let r=0;r<e.length;r++){let a=e[r];a===255?(i++,r++):i+=t[a]}return i}function FI(t,e,i){let r=new Uint32Array(e.length);for(let s=1;s<e.length;s++)r[s]=r[s-1]+e[s-1];let a=new Uint8Array(MI(e,i)),n=0;for(let s=0;s<i.length;s++){let o=i[s];if(o===255)s++,a[n++]=i[s];else{let l=e[o],u=r[o];for(;l-- >0;)a[n++]=t[u++]}}return a}var $1=class extends sp{constructor(t,e,i,r,a,n,s,o){super(t,i,r,s??e.length),this.indexBuffer=e,this.symbolOffsetBuffer=a,this.symbolTableBuffer=n,this.sharedDictionaryCache=o}getValueFromBuffer(t){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],i=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return ip(this.decodedDictionary,i,r)}decodeDictionary(){return this.symbolLengthBuffer??(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),FI(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),i=t[0];for(let r=1;r<t.length;r++){let a=t[r];e[r-1]=a-i,i=a}return e}};function G1(t,e,i,r,a){let n,s,o,l,u,h=a,c,d;for(let p=0;p<r;p++){let f=$t(e,i);switch(f.physicalStreamType){case ae.PRESENT:{let m=new zi(cn(e,f.numValues,f.byteLength,i),f.numValues);h=a??m;break}case ae.OFFSET:s=Ie(e,i,f,void 0,h);break;case ae.LENGTH:{let m=Cr(e,i,f);de.DICTIONARY===f.logicalStreamType.lengthType?n=m:de.SYMBOL===f.logicalStreamType.lengthType?l=m:c=m;break}case ae.DATA:{let m=e.subarray(i.get(),i.get()+f.byteLength);i.add(f.byteLength);let g=f.logicalStreamType.dictionaryType;ke.FSST===g?u=m:ke.SINGLE===g||ke.SHARED===g?o=m:ke.NONE===g&&(d=m);break}}}return zI(t,u,s,n,o,l,h)??RI(t,o,s,n,h)??kI(t,c,d,s,h)}function zI(t,e,i,r,a,n,s){if(e){if(!i||!r||!a||!n)throw Error(`Incomplete FSST dictionary string column "${t}"`);return new $1(t,i,r,a,n,e,s)}}function RI(t,e,i,r,a){if(e){if(!i||!r)throw Error(`Incomplete dictionary string column "${t}"`);return a?new Ga(t,i,r,e,a):new Ga(t,i,r,e)}}function kI(t,e,i,r,a){if(e&&i){if(r)return a?new Ga(t,r,e,i,a):new Ga(t,r,e,i);if(a&&a.size()!==e.length-1){let n=new Uint32Array(a.size()),s=0;for(let o=0;o<a.size();o++)a.get(o)?n[o]=s++:n[o]=0;return new Ga(t,n,e,i,a)}return a?new Mg(t,e,i,a):new Mg(t,e,i)}}function LI(t,e,i,r){let a,n,s,o,l=!1;for(;!l;){let p=$t(t,e);switch(p.physicalStreamType){case ae.LENGTH:de.DICTIONARY===p.logicalStreamType.lengthType?a=Cr(t,e,p):s=Cr(t,e,p);break;case ae.DATA:ke.SINGLE===p.logicalStreamType.dictionaryType||ke.SHARED===p.logicalStreamType.dictionaryType?(n=t.subarray(e.get(),e.get()+p.byteLength),l=!0):o=t.subarray(e.get(),e.get()+p.byteLength),e.add(p.byteLength)}}if(i.type!=="complexType")throw Error(`Shared dictionary column ${i.name} must be a complex (struct) column.`);if(!a||!n)throw Error(`Incomplete shared dictionary for column "${i.name}"`);let u=i.complexType.children,h=[],c=o?{}:void 0,d=0;for(let p of u){let f=Me(t,e,1)[0];if(f===0)continue;let m=p.name?`${i.name}${p.name}`:i.name;if(r&&!r.has(m)){D1(f,t,e);continue}if(p.type!=="scalarField"||p.scalarField.physicalType!==wt.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(f>1&&!p.nullable||f===1&&p.nullable)throw Error(`The number of streams for the child field ${p.name} does not match its nullability. nullibilty: ${p.nullable}, numStreams: ${f}`);let g;if(p.nullable){let y=$t(t,e);g=new zi(cn(t,y.numValues,y.byteLength,e),y.numValues)}let _=Ie(t,e,$t(t,e),void 0,g);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${m}"`);h[d++]=new $1(m,_,a,n,s,o,g,c)}else h[d++]=new Ga(m,_,a,n,g)}return h}var Fg=class extends pa{constructor(t,e,i){super(t,new Uint8Array,i??e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Xi;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Xi||(Xi={}));var Ar;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(Ar||(Ar={}));function BI(t,e,i,r){let a=OI(i);if(r===0)return a.map(h=>new Fg(h,[]));let n=VI(t,e,r),s=(n.presentStream?n.presentCount:n.lengthStream.length)/a.length,o=[],l=0,u=0;for(let h=0;h<a.length;h++){let c=GI(n,h,s,l,u);o.push(new Fg(a[h],c.value,c.nullabilityBuffer)),l=c.countsEnd,u=c.valuesEnd}return o}function OI(t){let e=t.type==="complexType"?t.complexType.children:void 0;return!e||e.length===0?[t.name]:e.map(i=>t.name+(i.name??""))}function VI(t,e,i){let r=t[e.get()];e.add(1);let a=Ie(t,e,$t(t,e)),n=i-1,s=[];r&Xi.STRING&&(n-=jI(t,e,s)),n-=UI(t,e,r,s),n-=NI(t,e,r,s);let o,l=0;if(r&Xi.PRESENCE){let h=$I(t,e);o=h.value,l=h.count,n--}let u=new Uint32Array;if(n>0&&(u=Ie(t,e,$t(t,e)),n--),n!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${n}`);return{lengthStream:a,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function jI(t,e,i){let r=t[e.get()];e.add(1);let a=G1("",t,e,r);if(a)for(let n=0;n<a.size;n++)i.push(a.getValue(n));return r}function UI(t,e,i,r){let a=0;return i&Xi.INT32?(Oa(r,sl(t,e,$t(t,e))),a++):i&Xi.INT64&&(Oa(r,M1(t,e,$t(t,e))),a++),i&Xi.UINT32?(Oa(r,Ie(t,e,$t(t,e))),a++):i&Xi.UINT64&&(Oa(r,ap(t,e,$t(t,e))),a++),a}function NI(t,e,i,r){let a=0;return i&Xi.FLOAT&&(Oa(r,P1(t,e,$t(t,e).numValues)),a++),i&Xi.DOUBLE&&(Oa(r,C1(t,e,$t(t,e).numValues)),a++),a}function $I(t,e){let i=$t(t,e);if(i.physicalStreamType!==ae.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${i.physicalStreamType}`);let r=i.numValues,a=e.get(),n=new zi(cn(t,r,i.byteLength,e),r);return e.set(a+i.byteLength),{value:n,count:r}}function GI(t,e,i,r,a){let{lengthStream:n,flattenedValues:s,presentStream:o,dictionary:l}=t,u=e*i,h=i,c;if(o){c=new zi(new Uint8Array(Math.ceil(i/8)),i),h=0;for(let y=0;y<i;y++)o.get(u+y)&&(c.set(y,!0),h++)}let d=r+h;if(d>n.length)throw Error("Merged map counts underflow while decoding child streams");let p=Array(i),f=r,m=a;for(let y=0;y<i;y++){if(o&&!o.get(u+y)){p[y]=null;continue}let x=m+n[f++];if(x>s.length)throw Error("Map value stream underflow while decoding feature payload");let v=ZI(s,m,x,l);p[y]=v.value,m=v.nextIndex}let g=0;for(let y=r;y<d;y++)g+=n[y];let _=a+g;if(m!==_)throw Error("Unused flattened map values remain after decode");return{value:p,nullabilityBuffer:c,countsEnd:d,valuesEnd:_}}function ZI(t,e,i,r){return i-e===1||t[e]===Ar.START_LIST?op(t,e,i,r):Z1(t,e,i,r)}function Z1(t,e,i,r){let a=Object.create(null),n=e;for(;n<i;){let s=q1(t[n++],r);if(typeof s!="string")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=op(t,n,i,r);a[s]=o.value,n=o.nextIndex}return{value:a,nextIndex:n}}function op(t,e,i,r){if(e>=i)throw Error("Unexpected end of map value stream");let a=t[e];if(a===Ar.FALSE)return{value:!1,nextIndex:e+1};if(a===Ar.TRUE)return{value:!0,nextIndex:e+1};if(a===Ar.START_MAP){let n=zg(t,e,i);return{value:Z1(t,e+2,n,r).value,nextIndex:n}}if(a===Ar.START_LIST){let n=zg(t,e,i),s=[],o=e+2;for(;o<n;){let l=op(t,o,n,r);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:n}}return{value:q1(a,r),nextIndex:e+1}}function zg(t,e,i){if(e+1>=i)throw Error("Missing length for nested map/list payload");let r=t[e+1];if(r<2)throw Error(`Invalid nested payload length: ${r}`);let a=e+r;if(a>i)throw Error("Nested payload exceeds containing payload bounds");return a}function q1(t,e){let i=t-Ar.COUNT;if(i<0||i>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[i]}function Oa(t,e){for(let i of e)t.push(i)}function qI(t,e,i,r,a,n){return i.type==="scalarType"?n&&!n.has(i.name)?(D1(r,t,e),null):WI(r,t,e,a,i.scalarType,i):i.complexType?.physicalType===Fr.MAP?BI(t,e,i,r):r===0?null:LI(t,e,i,n)}function WI(t,e,i,r,a,n){let s;if(t===0)return null;if(n.nullable){let l=$t(e,i),u=l.numValues,h=i.get(),c=cn(e,u,l.byteLength,i);i.set(h+l.byteLength),s=new zi(c,l.numValues)}let o=s??r;switch(a.physicalType){case wt.UINT_32:case wt.INT_32:return JI(e,i,n,a,o);case wt.STRING:{let l=n.nullable?t-1:t;return G1(n.name,e,i,l,s)??null}case wt.BOOLEAN:return HI(e,i,n,r,o);case wt.UINT_64:case wt.INT_64:return KI(e,i,n,o,a);case wt.FLOAT:return XI(e,i,n,o);case wt.DOUBLE:return YI(e,i,n,o);default:throw Error(`The specified data type for the field is currently not supported: ${a}`)}}function HI(t,e,i,r,a){let n=$t(t,e),s=n.numValues,o=e.get(),l=js(a)?a:void 0,u=cn(t,s,n.byteLength,e,l);e.set(o+n.byteLength);let h=new zi(u,s);return new II(i.name,h,a)}function XI(t,e,i,r){let a=$t(t,e),n=js(r)?r:void 0,s=P1(t,e,a.numValues,n);return new AI(i.name,s,r)}function YI(t,e,i,r){let a=$t(t,e),n=js(r)?r:void 0,s=C1(t,e,a.numValues,n);return new Hd(i.name,s,r)}function KI(t,e,i,r,a){let n=$t(t,e),s=eu(n,r,t,e,"int64"),o=a.physicalType===wt.INT_64;if(s===jt.FLAT){let u=js(r)?r:void 0,h=o?M1(t,e,n,u):ap(t,e,n,u);return new k1(i.name,h,r)}if(s===jt.SEQUENCE){let u=A1(t,e,n);return new L1(i.name,u[0],u[1],n.numRleValues,o)}let l=o?cI(t,e,n):F1(t,e,n);return new N1(i.name,l,r,o)}function JI(t,e,i,r,a){let n=$t(t,e),s=eu(n,a,t,e),o=r.physicalType===wt.INT_32;if(s===jt.FLAT){let u=js(a)?a:void 0,h=o?sl(t,e,n,void 0,u):Ie(t,e,n,void 0,u);return new Wd(i.name,h,a)}if(s===jt.SEQUENCE){let u=I1(t,e,n);return new Xd(i.name,u[0],u[1],n.numRleValues,o)}let l=o?lI(t,e,n):rp(t,e,n);return new Yd(i.name,l,a,o)}function js(t){return t instanceof zi}var me={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function W1(t){switch(t){case me.ID:case me.ID|me.ID_NULLABLE:case me.ID|me.ID_LONG:case me.ID|me.ID_LONG|me.ID_NULLABLE:return{nullable:(t&me.ID_NULLABLE)!==0,columnScope:Nn.FEATURE,type:"scalarType",scalarType:{longID:(t&me.ID_LONG)!==0,type:"logicalType",logicalType:x1.ID}};case me.GEOMETRY:return{nullable:!1,columnScope:Nn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Fr.GEOMETRY,children:[]}};case me.STRUCT:return{nullable:!1,columnScope:Nn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Fr.STRUCT,children:[]}};case me.MAP:return{nullable:!0,columnScope:Nn.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Fr.MAP,children:[]}};default:return rA(t)}}function QI(t){return t>=me.SCALAR_BASE}function H1(t){return t===me.STRUCT||t===me.MAP}function tA(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case wt.BOOLEAN:case wt.INT_8:case wt.UINT_8:case wt.INT_32:case wt.UINT_32:case wt.INT_64:case wt.UINT_64:case wt.FLOAT:case wt.DOUBLE:return!1;case wt.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case Fr.GEOMETRY:case Fr.STRUCT:case Fr.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function eA(t){return t.type==="scalarType"&&t.scalarType?.type==="logicalType"&&t.scalarType.logicalType===x1.ID}function iA(t){return t.type==="complexType"&&t.complexType?.type==="physicalType"&&t.complexType.physicalType===Fr.GEOMETRY}function rA(t){let e;switch(t){case 10:case 11:e=wt.BOOLEAN;break;case 12:case 13:e=wt.INT_8;break;case 14:case 15:e=wt.UINT_8;break;case 16:case 17:e=wt.INT_32;break;case 18:case 19:e=wt.UINT_32;break;case 20:case 21:e=wt.INT_64;break;case 22:case 23:e=wt.UINT_64;break;case 24:case 25:e=wt.FLOAT;break;case 26:case 27:e=wt.DOUBLE;break;case 28:case 29:e=wt.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:Nn.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var aA=new TextDecoder,Rg="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function lp(t,e){let i=Me(t,e,1)[0];if(i===0)return"";let r=e.get(),a=r+i,n=t.subarray(r,a);return e.add(i),aA.decode(n)}function nA(t){let e=t.name,i=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:i}:{type:"complexField",complexField:t.complexType,name:e,nullable:i}}function X1(t,e){let i=Me(t,e,1)[0]>>>0,r=i>=me.SCALAR_BASE?W1(i):null;if(!r)throw Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let a={...r,name:lp(t,e)};if(a.type==="complexType"&&H1(i)){let n=a.complexType,s=Me(t,e,1)[0]>>>0;n.children=Array(s);for(let o=0;o<s;o++)n.children[o]=X1(t,e)}return nA(a)}function sA(t,e){let i=Me(t,e,1)[0]>>>0,r=W1(i);if(!r)throw Error(`Unsupported column type code ${i}. Supported: ${Rg}`);let a;if(QI(i))a=lp(t,e);else if(i<me.GEOMETRY)a="id";else if(i===me.GEOMETRY)a="geometry";else throw Error(`Unsupported column type code ${i}. Supported: ${Rg}`);let n={...r,name:a};if(n.type==="complexType"&&H1(i)){let s=Me(t,e,1)[0]>>>0,o=n.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=X1(t,e)}return n}function oA(t,e){let i={};i.featureTables=[];let r={};if(r.name=lp(t,e),r.name.length===0)throw Error("Missing layer name");let a=Me(t,e,1)[0]>>>0,n=Me(t,e,1)[0]>>>0;r.columns=Array(n);for(let s=0;s<n;s++)r.columns[s]=sA(t,e);return i.featureTables.push(r),[i,a]}function lA(t,e,i=!0){let r=new b1(0),a=[];for(;r.get()<t.length;){let n=Me(t,r,1)[0]>>>0,s=r.get()+n;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=Me(t,r,1)[0]>>>0;if(o!==1&&o!==2){r.set(s);continue}let[l,u]=oA(t,r),h=l.featureTables[0],c=null,d=null,p=[],f=0;for(let g of h.columns){let _=g.name;if(eA(g)){let y=null;if(g.nullable){let v=$t(t,r),w=r.get(),b=cn(t,v.numValues,v.byteLength,r);r.set(w+v.byteLength),y=new zi(b,v.numValues)}let x=$t(t,r);f=y?y.size():x.decompressedCount,c=uA(t,g,r,_,x,y??f,i)}else if(iA(g)){let y=Me(t,r,1)[0];if(f===0){let x=r.get();f=$t(t,r).decompressedCount,r.set(x)}e&&(e.scale=e.extent/u),d=DI(t,y,r,f,e)}else{let y=tA(g)?Me(t,r,1)[0]:1;if(y===0)continue;let x=qI(t,r,g,y,f,void 0);if(x)if(Array.isArray(x))for(let v of x)p.push(v);else p.push(x)}}let m=new zP(h.name,d,c,p,u);a.push(m),r.set(s)}return a}function uA(t,e,i,r,a,n,s=!1){let o=e.scalarType?.longID?wt.UINT_64:wt.UINT_32,l=typeof n=="number"?void 0:n,u=eu(a,n,t,i,o===wt.UINT_64?"int64":"int32");if(o===wt.UINT_32)switch(u){case jt.FLAT:return new Wd(r,Ie(t,i,a,void 0,l),n);case jt.SEQUENCE:{let h=I1(t,i,a);return new Xd(r,h[0],h[1],a.numRleValues,!1)}case jt.CONST:return new Yd(r,rp(t,i,a),n,!1)}switch(u){case jt.FLAT:return s?new Hd(r,uI(t,i,a,l),n):new k1(r,ap(t,i,a,l),n);case jt.SEQUENCE:{let h=A1(t,i,a);return new L1(r,h[0],h[1],a.numRleValues,!1)}case jt.CONST:return new N1(r,F1(t,i,a),n,!1)}throw Error("Vector type not supported for id column.")}var Ph=w1(Jd);Ph/32*4,3*Ph/256+Ph|0;var hA=class{constructor(t,e){switch(this._featureData=t,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case xe.POINT:case xe.MULTIPOINT:this.type=1;break;case xe.LINESTRING:case xe.MULTILINESTRING:this.type=2;break;case xe.POLYGON:case xe.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let i=[];for(let r of e)i.push(new C(r.x,r.y));t.push(i)}return t}},cA=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new hA(this.features[t],this.extent)}},dA=class{constructor(t){this.layers={};let e=lA(new Uint8Array(t));this.layers=e.reduce((i,r)=>({...i,[r.name]:new cA(r)}),{})}},pA=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new jh(k,16,0),this.grid3D=new jh(k,16,0),this.featureIndexArray=new Qy,this.promoteId=e}insert(t,e,i,r,a,n){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,a);let o=n?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new dA(this.rawTileData).layers:this.vtLayers=new lS(new K0(this.rawTileData)).layers,this.sourceLayerCoder=new FP(this.vtLayers?Object.keys(this.vtLayers).sort():[Os])),this.vtLayers}query(t,e,i,r){this.loadVTLayers();let a=t.params,n=k/t.tileSize/t.scale,s=Ka(a.filter,"queryRenderedFeatures filter",a.globalState),o=t.queryGeometry,l=t.queryPadding*n,u=Ti.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Ti.fromPoints(t.cameraQueryGeometry).expandBy(l),d=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(m,g,_,y)=>rE(t.cameraQueryGeometry,m-l,g-l,_+l,y+l));for(let m of d)h.push(m);h.sort(mA);let p={},f;for(let m of h){if(m===f)continue;f=m;let g=this.featureIndexArray.get(m),_=null;
vendor: 7,742 bytes, lines 822-825
822this.loadMatchingFeature(p,g.bucketIndex,g.sourceLayerIndex,g.featureIndex,s,a.layers,a.availableImages,e,i,r,(y,x,v)=>(_||(_=ha(y)),x.queryIntersectsFeature({queryGeometry:o,feature:y,featureState:v,geometry:_,zoom:this.z,transform:t.transform,pixelsToTileUnits:n,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return p}loadMatchingFeature(t,e,i,r,a,n,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(n&&!c.some(m=>n.has(m)))return;let d=this.sourceLayerCoder.decode(i),p=this.vtLayers[d].feature(r);if(a.needGeometry){let m=Vr(p,!0);if(!a.filter(new Ct(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!a.filter(new Ct(this.tileID.overscaledZ),p))return;let f=this.getId(p,d);for(let m of c){if(n&&!n.has(m))continue;let g=o[m];if(!g)continue;let _={};f&&u&&(_=u.getState(g.sourceLayer||"_geojsonTileLayer",f));let y=q({},l[m]);y.paint=kg(y.paint,g.paint,p,_,s),y.layout=kg(y.layout,g.layout,p,_,s);let x=!h||h(p,g,_);if(!x)continue;let v=new qd(p,this.z,this.x,this.y,f);v.layer=y;let w=t[m];w===void 0&&(w=t[m]=[]),w.push({featureIndex:r,feature:v,intersectionZ:x})}}lookupSymbolFeatures(t,e,i,r,a,n,s,o){let l={};this.loadVTLayers();let u=Ka(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let h of t)this.loadMatchingFeature(l,i,r,h,u,n,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;if(this.promoteId){let r=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];i=t.properties[r],typeof i=="boolean"&&(i=Number(i)),i===void 0&&t.properties?.cluster&&this.promoteId&&(i=Number(t.properties.cluster_id))}return i}};$("FeatureIndex",pA,{omit:["rawTileData","sourceLayerCoder"]});function fA(t){return typeof t=="object"&&!!t&&"evaluate"in t}function kg(t,e,i,r,a){return vl(t,(n,s)=>{let o=e instanceof Ol?e.get(s):null;return fA(o)?o.evaluate(i,r,void 0,a):o})}function mA(t,e){return e-t}var Y1=class{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(let t in this.data)for(let e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){let r=t.wrapped().key;this.data[r]===void 0&&(this.data[r]=[]);let a={value:e,timeout:void 0};if(i!==void 0&&(a.timeout=setTimeout(()=>{this.remove(t,a)},i)),this.data[r].push(a),this.order.push(r),this.order.length>this.max){let n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}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){let e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){let e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;let i=t.wrapped().key,r=e===void 0?0:this.data[i].indexOf(e),a=this.data[i][r];return this.data[i].splice(r,1),a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(a.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(t){let e=[];for(let i in this.data)for(let r of this.data[i])t(r.value)||e.push(r);for(let i of e)this.remove(i.value.tileID,i)}};/** 823* MapLibre GL JS 824* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.10.0/LICENSE.txt 825*/var ox="6.10.0";function lx(){var t=new fe(4);return fe!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function gA(t,e){var i=e[0],r=e[1],a=e[2],n=e[3],s=i*n-a*r;return s?(s=1/s,t[0]=n*s,t[1]=-r*s,t[2]=-a*s,t[3]=i*s,t):null}function _A(t){return t[0]*t[3]-t[2]*t[1]}function yA(t,e,i){var r=e[0],a=e[1],n=e[2],s=e[3],o=Math.sin(i),l=Math.cos(i);return t[0]=r*l+n*o,t[1]=a*l+s*o,t[2]=r*-o+n*l,t[3]=a*-o+s*l,t}var iu,up,hp,Ge={frame(t,e,i,r){let a=r||window,n=a.requestAnimationFrame(o=>{s(),e(o)}),{unsubscribe:s}=$o(t.signal,"abort",()=>{s(),a.cancelAnimationFrame(n),i(new an(t.signal.reason))},!1)},frameAsync(t,e){return new Promise((i,r)=>{this.frame(t,i,r,e)})},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let e;if(ol()&&!jc())e=new OffscreenCanvas(t.width,t.height).getContext("2d",{willReadFrequently:!0});else{let i=window.document.createElement("canvas");i.width=t.width,i.height=t.height,e=i.getContext("2d",{willReadFrequently:!0})}if(!e)throw Error("failed to create canvas 2d context");return e.drawImage(t,0,0,t.width,t.height),e},resolveURL(t){return iu||(iu=document.createElement("a")),iu.href=t,iu.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return hp===void 0?matchMedia?(up??(up=matchMedia("(prefers-reduced-motion: reduce)")),up.matches):!1:hp},set prefersReducedMotion(t){hp=t}},Iu=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(t){this._frozenAt=t}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function Ft(){return Iu.getCurrentTime()}function vA(t){Iu.setNow(t)}function xA(){Iu.restoreNow()}function bA(){return Iu.isFrozen()}var At,nt=(At=class{static create(e,i,r){let a=window.document.createElement(e);return i!==void 0&&(a.className=i),r&&r.appendChild(a),a}static createNS(e,i){return window.document.createElementNS(e,i)}static disableDrag(){At.docStyle&&At.selectProp&&(At.userSelect=At.docStyle[At.selectProp],At.docStyle[At.selectProp]="none")}static enableDrag(){At.docStyle&&At.selectProp&&(At.docStyle[At.selectProp]=At.userSelect)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",At.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",At.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",At.suppressClickInternal,!0)},0)}static getScale(e){let i=e.getBoundingClientRect();return{x:i.width/e.offsetWidth||1,y:i.height/e.offsetHeight||1,boundingClientRect:i}}static getPoint(e,i,r){let a=i.boundingClientRect;return new C((r.clientX-a.left)/i.x-e.clientLeft,(r.clientY-a.top)/i.y-e.clientTop)}static mousePos(e,i){let r=At.getScale(e);return At.getPoint(e,r,i)}static touchPos(e,i){let r=[],a=At.getScale(e);for(let n of i)r.push(At.getPoint(e,a,n));return r}static sanitize(e){let i=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),r=i.querySelectorAll("script, iframe");for(let a of r)a.remove();return At.clean(i),i.innerHTML}static isPossiblyDangerous(e,i){let r=i.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(r.includes("javascript:")||r.includes("data:"))||e==="srcdoc"||e.startsWith("on"))return!0}static clean(e){let i=e.children;for(let r of i)At.removeAttributes(r),At.clean(r)}static removeAttributes(e){for(let{name:i,value:r}of Array.from(e.attributes))At.isPossiblyDangerous(i,r)&&e.removeAttribute(i)}},At.docStyle=typeof window<"u"&&window.document?.documentElement.style,At.selectProp=!At.docStyle||"userSelect"in At.docStyle?"userSelect":"webkitUserSelect",At),Vi;(function(t){let e,i,r,a;t.resetRequestQueue=()=>{e=[],i=0,r=0,a={}},t.addThrottleControl=c=>{let d=r++;return a[d]=c,d},t.removeThrottleControl=c=>{delete a[c],u()};let n=()=>{for(let c of Object.keys(a))if(a[c]())return!0;return!1};async function s(c,d,p,f,m=!0,g){let _=await c.transformRequest(d,p);
vendor: 13,483 bytes, line 825
825return xl(f.signal),Vi.getImage(_,f,m,g)}t.transformAndGetImage=s,t.getImage=(c,d,p=!0,f)=>new Promise((m,g)=>{c.headers||(c.headers={}),c.headers.accept="image/webp,*/*",q(c,{type:"image"});let _={abortController:d,requestParameters:c,supportImageRefresh:p,imageBitmapOptions:f,state:"queued",onError:y=>{g(y)},onSuccess:y=>{m(y)}};e.push(_),u()});let o=(c,d)=>typeof createImageBitmap=="function"?o_(c,d):l_(c),l=async c=>{c.state="running";let{requestParameters:d,supportImageRefresh:p,imageBitmapOptions:f,onError:m,onSuccess:g,abortController:_}=c,y=p===!1&&!f&&!ea(self)&&!Qc(d.url)&&(!d.headers||Object.keys(d.headers).reduce((v,w)=>v&&w==="accept",!0));i++;let x=y?h(d,_):ys(d,_);try{let v=await x;delete c.abortController,c.state="completed",v.data instanceof HTMLImageElement||Or(v.data)?g(v):!v.data||v.data.byteLength===0?g({data:null,cacheControl:v.cacheControl,expires:v.expires}):g({data:await o(v.data,f),cacheControl:v.cacheControl,expires:v.expires})}catch(v){delete c.abortController,m(be(v))}finally{i--,u()}},u=()=>{let c=n()?ti.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:ti.MAX_PARALLEL_IMAGE_REQUESTS;for(let d=i;d<c&&e.length>0;d++){let p=e.shift();if(p.abortController.signal.aborted){d--;continue}l(p)}},h=(c,d)=>new Promise((p,f)=>{let m=new Image,g=c.url,_=c.credentials;_&&_==="include"?m.crossOrigin="use-credentials":(_&&_==="same-origin"||!ed(g))&&(m.crossOrigin="anonymous"),d.signal.addEventListener("abort",()=>{m.src="",f(new an(d.signal.reason))}),m.fetchPriority="high",m.onload=()=>{m.onerror=m.onload=null,p({data:m})},m.onerror=()=>{m.onerror=m.onload=null,!d.signal.aborted&&f(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."))},m.src=g})})(Vi||(Vi={})),Vi.resetRequestQueue();var wA=class{constructor(t){this._transformRequestFn=t??null}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}},ye=class extends ei{},Q=class extends ye{},Ap=class extends ye{constructor(t={}){super("style.load",t)}},Pi=class extends ye{constructor(t,e={}){super(t,e),this.dataType="style"}},Nt=class extends ye{constructor(t,e={}){super(t,e),this.dataType="source"}},ci=class extends ye{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i,r={}){i=i instanceof MouseEvent?i:new MouseEvent(t,i);let a=nt.mousePos(e.getCanvas(),i),n=e.unproject(a);super(t,q({point:a,lngLat:n,originalEvent:i},r)),this._defaultPrevented=!1,this.target=e}},Xs=class extends ye{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){let r=t==="touchend"?i.changedTouches:i.touches,a=nt.touchPos(e.getCanvasContainer(),r),n=a.map(l=>e.unproject(l)),s=a.reduce((l,u,h,c)=>l.add(u.div(c.length)),new C(0,0)),o=e.unproject(s);super(t,{points:a,point:s,lngLats:n,lngLat:o,originalEvent:i}),this._defaultPrevented=!1}},ux=class extends ye{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e){super("wheel",{originalEvent:e}),this._defaultPrevented=!1}},Mp=class extends ye{},hx=class extends ye{constructor(t={}){super("terrain",t)}},cx=class extends ye{constructor(t={}){super("projectiontransition",t)}},_u=class extends ye{},dx=class extends ye{constructor(t={}){super("styleimagemissing",t)}};function TA(t,e){let i={};for(let r in t)r!=="ref"&&(i[r]=t[r]);return x_.forEach(r=>{r in e&&(i[r]=e[r])}),i}function K1(t){t=t.slice();let e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=TA(t[i],e[t[i].ref]));return t}function Mt(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Mt(t[i],e[i]))return!1;return!0}if(typeof t=="object"&&t&&e!==null){if(typeof e!="object"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(!Mt(t[i],e[i]))return!1;return!0}return t===e}function hi(t,e){t.push(e)}function px(t,e,i){hi(i,{command:"addSource",args:[t,e[t]]})}function fx(t,e,i){hi(e,{command:"removeSource",args:[t]}),i[t]=!0}function EA(t,e,i,r){fx(t,i,r),px(t,e,i)}function SA(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&r!=="data"&&!Mt(t[i][r],e[i][r]))return!1;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&r!=="data"&&!Mt(t[i][r],e[i][r]))return!1;return!0}function DA(t,e,i,r){t||(t={}),e||(e={});let a;for(a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Object.prototype.hasOwnProperty.call(e,a)||fx(a,i,r));for(a in e)Object.prototype.hasOwnProperty.call(e,a)&&(Object.prototype.hasOwnProperty.call(t,a)?Mt(t[a],e[a])||(t[a].type==="geojson"&&e[a].type==="geojson"&&SA(t,e,a)?hi(i,{command:"setGeoJSONSourceData",args:[a,e[a].data]}):EA(a,e,i,r)):px(a,e,i))}function J1(t,e,i,r,a){hi(e,{command:a,args:[i,r,t[r]]})}function ru(t,e,i,r,a){t||(t={}),e||(e={});for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Mt(t[n],e[n])||J1(e,i,r,n,a));for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&!Object.prototype.hasOwnProperty.call(t,n)&&(Mt(t[n],e[n])||J1(e,i,r,n,a))}function Q1(t){return t.id}function tv(t,e){return t[e.id]=e,t}function PA(t,e,i){t||(t=[]),e||(e=[]);let r=t.map(Q1),a=e.map(Q1),n=t.reduce(tv,{}),s=e.reduce(tv,{}),o=r.slice(),l=Object.create(null),u,h,c,d,p;for(let f=0,m=0;f<r.length;f++)u=r[f],Object.prototype.hasOwnProperty.call(s,u)?m++:(hi(i,{command:"removeLayer",args:[u]}),o.splice(o.indexOf(u,m),1));for(let f=0,m=0;f<a.length;f++)u=a[a.length-1-f],o[o.length-1-f]!==u&&(Object.prototype.hasOwnProperty.call(n,u)?(hi(i,{command:"removeLayer",args:[u]}),o.splice(o.lastIndexOf(u,o.length-m),1)):m++,d=o[o.length-f],hi(i,{command:"addLayer",args:[s[u],d]}),o.splice(o.length-f,0,u),l[u]=!0);for(let f=0;f<a.length;f++)if(u=a[f],h=n[u],c=s[u],!(l[u]||Mt(h,c))){if(!Mt(h.source,c.source)||!Mt(h["source-layer"],c["source-layer"])||!Mt(h.type,c.type)){hi(i,{command:"removeLayer",args:[u]}),d=o[o.lastIndexOf(u)+1],hi(i,{command:"addLayer",args:[c,d]});continue}for(p in ru(h.layout,c.layout,i,u,"setLayoutProperty"),ru(h.paint,c.paint,i,u,"setPaintProperty"),Mt(h.filter,c.filter)||hi(i,{command:"setFilter",args:[u,c.filter]}),(!Mt(h.minzoom,c.minzoom)||!Mt(h.maxzoom,c.maxzoom))&&hi(i,{command:"setLayerZoomRange",args:[u,c.minzoom,c.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,p)&&p!=="layout"&&p!=="paint"&&p!=="filter"&&p!=="metadata"&&p!=="minzoom"&&p!=="maxzoom"&&(p.indexOf("paint.")===0?ru(h[p],c[p],i,u,"setPaintProperty"):Mt(h[p],c[p])||hi(i,{command:"setLayerProperty",args:[u,p,c[p]]}));for(p in c)Object.prototype.hasOwnProperty.call(c,p)&&!Object.prototype.hasOwnProperty.call(h,p)&&p!=="layout"&&p!=="paint"&&p!=="filter"&&p!=="metadata"&&p!=="minzoom"&&p!=="maxzoom"&&(p.indexOf("paint.")===0?ru(h[p],c[p],i,u,"setPaintProperty"):Mt(h[p],c[p])||hi(i,{command:"setLayerProperty",args:[u,p,c[p]]}))}}function CA(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!Mt(t.version,e.version))return[{command:"setStyle",args:[e]}];Mt(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),Mt(t.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),Mt(t.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),Mt(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),Mt(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),Mt(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),Mt(t.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),Mt(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),Mt(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),Mt(t["font-faces"],e["font-faces"])||i.push({command:"setFontFaces",args:[e["font-faces"]]}),Mt(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),Mt(t.light,e.light)||i.push({command:"setLight",args:[e.light]});let r=!Mt(t.terrain,e.terrain);r&&!e.terrain&&i.push({command:"setTerrain",args:[void 0]}),Mt(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),Mt(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});let a={},n=[];DA(t.sources,e.sources,n,a);let s=[];t.layers&&t.layers.forEach(o=>{"source"in o&&a[o.source]?i.push({command:"removeLayer",args:[o.id]}):s.push(o)}),i=i.concat(n),PA(s,e.layers,i),r&&e.terrain&&i.push({command:"setTerrain",args:[e.terrain]})}catch(r){console.warn("Unable to compute style diff:",r),i=[{command:"setStyle",args:[e]}]}return i}function IA(){let t={},e=F.$version;for(let i in F.$root){let r=F.$root[i];if(r.required){let a=null;a=i==="version"?e:r.type==="array"?[]:{},a!=null&&(t[i]=a)}}return t}function yu(t){let e=[];if(typeof t=="string")e.push({id:"default",url:t});else if(t&&t.length>0){let i=[];for(let{id:r,url:a}of t){let n=`${r}${a}`;i.includes(n)||(i.push(n),e.push({id:r,url:a}))}}return e}function ev(t,e,i){try{let r=new URL(t);return r.pathname+=`${e}${i}`,r.toString()}catch{throw Error(`Invalid sprite URL "${t}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}async function AA(t,e,i,r){let a=yu(t),n=i>1?"@2x":"",s={},o={};for(let{id:l,url:u}of a){let h=await e.transformRequest(ev(u,n,".json"),"SpriteJSON");s[l]=vs(h,r);let c=await e.transformRequest(ev(u,n,".png"),"SpriteImage");o[l]=Vi.getImage(c,r)}return await Promise.all([...Object.values(s),...Object.values(o)]),MA(s,o)}async function MA(t,e){let i={};for(let r in t){i[r]={};let a=(await e[r]).data;if(!a)throw Error(`Could not load sprite image for ${r}: the response is empty`);let n=Ge.getImageCanvasContext(a),s=(await t[r]).data;for(let o in s){let{width:l,height:u,x:h,y:c,sdf:d,pixelRatio:p,stretchX:f,stretchY:m,content:g,textFitWidth:_,textFitHeight:y}=s[o],x={width:l,height:u,x:h,y:c,context:n};i[r][o]={data:null,pixelRatio:p,sdf:d,stretchX:f,stretchY:m,content:g,textFitWidth:_,textFitHeight:y,spriteData:x}}}return i}var FA=class extends ce{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let t of Object.keys(this.images))this.removeImage(t);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:e,promiseResolve:i}of this.requestors)i(this._getImagesForIds(e));this.requestors=[]}}getImage(t){let e=this.images[t];if(e&&!e.data&&e.spriteData){let i=e.spriteData;e.data=new Ot({width:i.width,height:i.height},i.context.getImageData(i.x,i.y,i.width,i.height).data),e.spriteData=null}return e}addImage(t,e){if(this.images[t])throw Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e,this._imagesIds=null,e.isWebGLImage&&this.updateImage(t,e,!1))}_validate(t,e){let i=!0,r=e.data||e.spriteData;return this._validateStretch(e.stretchX,r?.width)||(this.fire(new J(Error(`Image "${t}" has invalid "stretchX" value`))),i=!1),this._validateStretch(e.stretchY,r?.height)||(this.fire(new J(Error(`Image "${t}" has invalid "stretchY" value`))),i=!1),this._validateContent(e.content,e)||(this.fire(new J(Error(`Image "${t}" has invalid "content" value`))),i=!1),i}_validateStretch(t,e){if(!t)return!0;let i=0;for(let r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return!1;i=r[1]}return!0}_validateContent(t,e){if(!t)return!0;if(t.length!==4)return!1;let i=e.spriteData,r=i?.width||e.data.width,a=i?.height||e.data.height;return t[0]<0||r<t[0]||t[1]<0||a<t[1]||t[2]<0||r<t[2]||t[3]<0||a<t[3]||t[2]<t[0]?!1:t[3]>=t[1]}updateImage(t,e,i=!0){let r=this.images[t];if(i){let a=r.data||r.spriteData;if(a.width!==e.data.width||a.height!==e.data.height)throw Error(`size mismatch between old image (${a.width}x${a.height}) and new image (${e.data.width}x${e.data.height}).`)}e.version=(r.version??0)+1,this.images[t]=e,this.updateVersion++}removeImage(t){let e=this.images[t];e&&(delete this.images[t],this._imagesIds=null,e.userImage?.onRemove&&e.userImage.onRemove())}listImages(){return this._imagesIds??(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(t,e){return t==="default"?e:`${t}:${e}`}setSpriteImages(t,e){let i=this._spriteImagesIds[t]??[],r=[];for(let s in e){let o=this._getSpriteImageId(t,s);r.push(o),o in this.images?this.updateImage(o,e[s],!1):this.addImage(o,e[s])}let a=new Set(r),n=i.filter(s=>!a.has(s));for(let s of n)this.removeImage(s);return this._spriteImagesIds[t]=r,{loaded:r,removed:n}}removeSpriteImages(t){let e=this._spriteImagesIds[t]??[];for(let i of e)this.removeImage(i);return delete this._spriteImagesIds[t],e}removeAllSpriteImages(){let t=Object.values(this._spriteImagesIds).flat();for(let e of t)this.removeImage(e);return this._spriteImagesIds={},t}setMissingImageResolver(t){this.missingImageResolver=t}getImages(t){return new Promise((e,i)=>{let r=!0;if(!this.isLoaded())for(let a of t)this.images[a]||(r=!1);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})})}async _getImagesForIds(t){let e=new Set(t.filter(a=>!this.getImage(a))),i=this.missingImageResolver;i&&await Promise.allSettled(Array.from(e,a=>i(a)));let r={};for(let a of t){let n=this.getImage(a);n&&(e.delete(a),r[a]={data:n.data.clone(),pixelRatio:n.pixelRatio,sdf:n.sdf,ver
vendor: 1,331 bytes, line 825
825sion:n.version,stretchX:n.stretchX,stretchY:n.stretchY,content:n.content,textFitWidth:n.textFitWidth,textFitHeight:n.textFitHeight,hasRenderCallback:!!n.userImage?.render,isWebGLImage:n.isWebGLImage})}for(let a of e)this.fire(new dx({id:a})),ft(`Image "${a}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return r}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let e of t){if(this._renderCallbacksDispatchedThisFrame[e])continue;this._renderCallbacksDispatchedThisFrame[e]=!0;let i=this.getImage(e);i||ft(`Image with ID: "${e}" was not found`),Q0(i)&&this.updateImage(e,i)}}cloneImages(){let t={};for(let e in this.images){let i=this.images[e];t[e]={...i,data:i.data?i.data.clone():null}}return t}},zA=class{constructor(t){this._imageManager=t,this._entries={},this._image=new Ot({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new Ot({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:t,height:e}=this._image;return{width:t,height:e}}getPattern(t){let e=this._imageManager.getImage(t);if(!e)return null;let i=this._entries[t];
vendor: 35,586 bytes, line 825
825if(i?.image!==e){let r={w:e.data.width+2,h:e.data.height+2,x:0,y:0};this._entries[t]={bin:r,position:new Yl(r,e),image:e}}else if(i.position.version!==e.version)i.position.version=e.version;else return i.position;return this._update(),this._entries[t].position}bind(t){let e=t.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new he(t,this._image,e.RGBA),this._dirty=!1),this._texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_update(){for(let a in this._entries)this._imageManager.getImage(a)||delete this._entries[a];let t=[];for(let a in this._entries)t.push(this._entries[a].bin);let{w:e,h:i}=jd(t),r=this._image;r.resize({width:e||1,height:i||1});for(let a in this._entries){let{bin:n}=this._entries[a],s=n.x+1,o=n.y+1,l=this._entries[a].image.data,u=l.width,h=l.height;Ot.copy(l,r,{x:0,y:0},{x:s,y:o},{width:u,height:h}),Ot.copy(l,r,{x:0,y:h-1},{x:s,y:o-1},{width:u,height:1}),Ot.copy(l,r,{x:0,y:0},{x:s,y:o+h},{width:u,height:1}),Ot.copy(l,r,{x:u-1,y:0},{x:s-1,y:o},{width:1,height:h}),Ot.copy(l,r,{x:0,y:0},{x:s+u,y:o},{width:1,height:h})}this._dirty=!0}},Fp=1114111,RA={start:0,end:Fp},kA=0;function LA(t){let e=/^u\+([0-9a-f]*)(\?+)$/i.exec(t);if(e){let[,a,n]=e;return a.length+n.length>6?null:iv(parseInt(`${a}${"0".repeat(n.length)}`,16),parseInt(`${a}${"f".repeat(n.length)}`,16))}let i=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(t);if(!i)return null;let r=parseInt(i[1],16);return iv(r,i[2]===void 0?r:parseInt(i[2],16))}function iv(t,e){return t>e||t>Fp?null:{start:t,end:Math.min(e,Fp)}}function BA(t,e){return t.ranges.some(({start:i,end:r})=>e>=i&&e<=r)}var OA=class{constructor(t){this.requestManager=t,this._faces={},this._registered=new Set}setFontFaces(t){this._unregisterAll(),this._faces={};for(let[e,i]of Object.entries(t??{})){let r=Array.isArray(i)?i:[i];this._faces[e]=r.map(a=>this._declareFontFace(e,a)).filter(a=>a!==null)}}hasFontFaces(){return Object.keys(this._faces).length>0}async getFontFamily(t,e){for(let i of t.split(","))for(let r of this._faces[i.trim()]??[])if(BA(r,e)&&(r.loaded??(r.loaded=this._loadFontFace(r)),await r.loaded))return r.family;return null}_declareFontFace(t,e){let i=typeof e=="string"?{url:e}:e;if(typeof i?.url!="string")return ft(`Ignoring the font face declared for "${t}": it has no URL.`),null;let r=`maplibre-gl-font-face-${kA++}`,a=i["unicode-range"];if(!a?.length)return{url:i.url,ranges:[RA],family:r};let n=[];for(let s of a){let o=LA(s);if(!o){ft(`Ignoring the unicode range "${s}" of the font face at ${i.url}: it is not a valid range.`);continue}n.push(o)}return n.length?{url:i.url,ranges:n,family:r}:null}async _loadFontFace(t){if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return ft(`Ignoring the font face at ${t.url}: this environment has no CSS Font Loading API.`),!1;let e;try{return e=new FontFace(t.family,await this._downloadFontFile(t.url)),Object.values(this._faces).some(i=>i.includes(t))?(document.fonts.add(e),this._registered.add(e),await e.load(),!0):!1}catch(i){return e&&this._unregister(e),ft(`Ignoring the font face at ${t.url}: ${be(i).message}`),!1}}async _downloadFontFile(t){let e=await this.requestManager.transformRequest(t,"Glyphs"),i=await td(e,new AbortController);if(!i?.data)throw Error(`the response was empty for the font file at ${t}`);return i.data}_unregister(t){document.fonts?.delete(t),this._registered.delete(t)}_unregisterAll(){for(let t of this._registered)document.fonts?.delete(t);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},zp=1e20,Yp=new Float64Array(256);for(let t=0;t<256;t++){let e=.5-(t/255)**.45454545454545453;Yp[t]=e*Math.abs(e)}Yp[255]=-1e20;var VA=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:a="sans-serif",fontWeight:n="normal",fontStyle:s="normal",lang:o=null}={}){this.buffer=e,this.radius=i,this.cutoff=r,this.lang=o;let l=this.size=t+e*4,u=this._createCanvas(l),h=this.ctx=u.getContext("2d",{willReadFrequently:!0});h.font=`${s} ${n} ${t}px ${a}`,h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(t){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(t,t);let e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){let{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:a,actualBoundingBoxRight:n}=this.ctx.measureText(t),s=Math.ceil(i),o=Math.floor(-a),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(n)-o)),u=Math.max(0,Math.min(this.size-this.buffer,s+Math.ceil(r))),h=l+2*this.buffer,c=u+2*this.buffer,d=Math.max(h*c,0),p=new Uint8ClampedArray(d),f={data:p,width:h,height:c,glyphWidth:l,glyphHeight:u,glyphTop:s,glyphLeft:o,glyphAdvance:e};if(l===0||u===0)return f;let{ctx:m,buffer:g,gridInner:_,gridOuter:y}=this;this.lang&&(m.lang=this.lang),m.clearRect(g,g,l,u),m.fillText(t,g-o,g+s);let x=m.getImageData(g,g,l,u);y.fill(zp,0,d),_.fill(0,0,d);let v=3;for(let D=0;D<u;D++){let E=(D+g)*h+g;for(let M=0;M<l;M++,v+=4,E++){let R=x.data[v];if(R===0)continue;let z=Yp[R];y[E]=Math.max(0,z),_[E]=Math.max(0,-z)}}rv(y,0,0,h,c,h,this.f,this.v,this.z);let w=Math.min(g,1);rv(_,g-w,g-w,l+2*w,u+2*w,h,this.f,this.v,this.z);let b=255/this.radius,T=255*(1-this.cutoff);for(let D=0;D<d;D++){let E=Math.sqrt(y[D])-Math.sqrt(_[D]);p[D]=Math.round(T-b*E)}return f}};function rv(t,e,i,r,a,n,s,o,l){for(let u=e;u<e+r;u++)av(t,i*n+u,n,a,s,o,l);for(let u=i;u<i+a;u++)av(t,u*n+e,1,r,s,o,l)}function av(t,e,i,r,a,n,s){n[0]=0,s[0]=-1e20,s[1]=zp,a[0]=t[e];for(let o=1,l=0,u=0;o<r;o++){a[o]=t[e+o*i];let h=o*o;do{let c=n[l];u=(a[o]-a[c]+h-c*c)/(o-c)/2}while(u<=s[l]&&--l>-1);l++,n[l]=o,s[l]=u,s[l+1]=zp}for(let o=0,l=0;o<r;o++){for(;s[l+1]<o;)l++;let u=n[l],h=o-u;t[e+o*i]=a[u]+h*h}}var jA=F.layout_symbol["text-font"].default.join(","),UA=(t,e)=>{let i=new VA(t);return i.buffer=e,i},NA=class{constructor(t,e,i,r=UA){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={},this.lang=i,this.fontFaceManager=new OA(t),this.createRasterizer=r}setURL(t){this.url=t}setFontFaces(t){this.fontFaceManager.setFontFaces(t),this.entries={}}async getGlyphs(t){let e=[];for(let a in t)for(let n of t[a])e.push(this._getAndCacheGlyphsPromise(a,n));let i=await Promise.all(e),r={};for(let{stack:a,id:n,glyph:s}of i)r[a]||(r[a]={}),r[a][n]=s&&{id:s.id,bitmap:s.bitmap.clone(),metrics:s.metrics};return r}async _getAndCacheGlyphsPromise(t,e){var s;(s=this.entries)[t]??(s[t]={glyphs:{},requests:{},ranges:{}});let i=this.entries[t],r=i.glyphs[e];if(r!==void 0)return{stack:t,id:e,glyph:r};let a=e.codePointAt(0),n=this.fontFaceManager.hasFontFaces()?await this.fontFaceManager.getFontFamily(t,a):null;return n?(r=i.glyphs[e]=await this._drawGlyph(i,t,e,n),{stack:t,id:e,glyph:r}):!this.url||As(e)||this._charUsesLocalIdeographFontFamily(a)?(r=i.glyphs[e]=await this._drawGlyph(i,t,e),{stack:t,id:e,glyph:r}):await this._downloadAndCacheRangePromise(t,e)}async _downloadAndCacheRangePromise(t,e){var n;let i=e.codePointAt(0),r=this.entries[t],a=Math.floor(i/256);if(r.ranges[a])return{stack:t,id:e,glyph:null};(n=r.requests)[a]||(n[a]=this._loadGlyphRange(t,a));try{let s=await r.requests[a];for(let o in s)r.glyphs[String.fromCodePoint(+o)]=s[+o];return r.ranges[a]=!0,{stack:t,id:e,glyph:s[i]||null}}catch(s){let o=r.glyphs[e]=await this._drawGlyph(r,t,e);return this._warnOnMissingGlyphRange(o,a,i,be(s)),{stack:t,id:e,glyph:o}}}async _loadGlyphRange(t,e){let i=e*256,r=i+255,a=await this.requestManager.transformRequest(this.url.replace("{fontstack}",t).replace("{range}",`${i}-${r}`),"Glyphs"),n=await td(a,new AbortController);if(!n?.data)throw Error(`Could not load glyph range. range: ${e}, ${i}-${r}`);let s={};for(let o of J0(n.data))s[o.id]=o;return s}_warnOnMissingGlyphRange(t,e,i,r){let a=e*256,n=a+255,s=i.toString(16).padStart(4,"0").toUpperCase();ft(`Unable to load glyph range ${e}, ${a}-${n}. Rendering codepoint U+${s} locally instead. ${r}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&$0(t)}async _drawGlyph(t,e,i,r){let a=(await this._getTinySDF(t,e,i,r)).draw(i),n=/^\p{gc=Cf}+$/u.test(i);return{id:i.codePointAt(0),bitmap:new Gl({width:a.width||60,height:a.height||60},a.data),metrics:{width:n?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:n?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}}_getTinySDF(t,e,i,r){var l,u;let a=As(i);if(r){let h=a?"clusterTinySDFs":"fontFaceTinySDFs";return t[h]??(t[h]={}),(l=t[h])[r]||(l[r]=this._createTinySDF(r,!1,a?3:1)),t[h][r]}let n=e===jA&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(i.codePointAt(0)),s=n?this.localIdeographFontFamily:e;if(a)return t.clusterTinySDFs??(t.clusterTinySDFs={}),(u=t.clusterTinySDFs)[s]||(u[s]=this._createTinySDF(s,!0,3)),t.clusterTinySDFs[s];let o=n?"ideographTinySDF":"tinySDF";return t[o]||(t[o]=this._createTinySDF(s)),t[o]}async _createTinySDF(t,e=!0,i=1){let r=t?t.split(","):[];r.push("sans-serif");let a=r.map(o=>/[-\w]+/.test(o)?o:`'${CSS.escape(o)}'`).join(","),n=e?this._fontWeight(r[0]):void 0,s=e?this._fontStyle(r[0]):"normal";if(typeof document<"u"&&document.fonts?.load)try{await document.fonts.load(`${s} ${n||"normal"} 48px ${a}`)}catch(o){ft(`Failed to load font "${a}": ${be(o).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(i-1)/4)),radius:16,cutoff:.25,fontFamily:a,fontWeight:n,fontStyle:s,lang:this.lang},6)}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let e={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},i;for(let[r,a]of Object.entries(e))RegExp(`\\b${r}\\b`,"i").test(t)&&(i=`${a}`);return i}destroy(){for(let t in this.entries){let e=this.entries[t];e.tinySDF=null,e.ideographTinySDF=null,e.fontFaceTinySDFs={},e.glyphs={},e.requests={},e.ranges={}}this.entries={},this.fontFaceManager.destroy()}},nv,$A=()=>nv||(nv=new ge({anchor:new j(F.light.anchor,"anchor"),position:new j(F.light.position,"position"),color:new j(F.light.color,"color"),intensity:new j(F.light.intensity,"intensity")})),GA=class extends ce{constructor(t,e){super(),this._transitionable=new Ds($A(),"light",e),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return a_(this.properties.get("position"))}setLight(t,e={}){this._validate($e.light,t,e)||this._transitionable.setValues(t)}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,e,i){return on(this,t,{value:e},i)}},sv,ZA=()=>sv||(sv=new ge({"sky-color":new j(F.sky["sky-color"],"sky-color"),"horizon-color":new j(F.sky["horizon-color"],"horizon-color"),"fog-color":new j(F.sky["fog-color"],"fog-color"),"fog-ground-blend":new j(F.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new j(F.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new j(F.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new j(F.sky["atmosphere-blend"],"atmosphere-blend")})),qA=class extends ce{constructor(t,e){super(),this._transitionable=new Ds(ZA(),"sky",e),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Ct(0))}setSky(t,e={}){this._validate($e.sky,t,e)||(t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),this._transitionable.setValues(t))}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,e,i={}){return on(this,t,{value:e},i)}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}},WA=class{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){var r;let i=t.join(",")+String(e);return(r=this.dashEntry)[i]||(r[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){let r=t.length%2==1,a=[],n=r?-t[t.length-1]*i:0,s=t[0]*i,o=!0;a.push({left:n,right:s,isDash:o,zeroLength:t[0]===0});let l=t[0];for(let u=1;u<t.length;u++){o=!o;let h=t[u];n=l*i,l+=h,s=l*i,a.push({left:n,right:s,isDash:o,zeroLength:h===0})}return a}addRoundDash(t,e,i){let r=e/2;for(let a=-i;a<=i;a++){let n=this.nextRow+i+a,s=this.width*n,o=0,l=t[o];for(let u=0;u<this.width;u++){u/l.right>1&&(l=t[++o]);let h=Math.abs(u-l.left),c=Math.abs(u-l.right),d=Math.min(h,c),p,f=a/i*(r+1);if(l.isDash){let m=r-Math.abs(f);p=Math.sqrt(d*d+m*m)}else p=r-Math.sqrt(d*d+f*f);this.data[s+u]=Math.max(0,Math.min(255,p+128))}}}addRegularDash(t){for(let s=t.length-1;s>=0;--s){let o=t[s],l=t[s+1];o.zeroLength?t.splice(s,1):l?.isDash===o.isDash&&(l.left=o.left,t.splice(s,1))}let e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);let r=this.width*this.nextRow,a=0,n=t[a];for(let s=0;s<this.width;s++){s/n.right>1&&(n=t[++a]);let o=Math.abs(s-n.left),l=Math.abs(s-n.right),u=Math.min(o,l),h=n.isDash?u:-u;this.data[r+s]=Math.max(0,Math.min(255,h+128))}}addDash(t,e){let i=e?7:0,r=2*i+1;if(this.nextRow+r>this.height)return ft("LineAtlas out of space"),null;let a=0;for(let s of t)a+=s;if(a!==0){let s=this.width/a,o=this.getDashRanges(t,this.width,s);e?this.addRoundDash(o,s,i):this.addRegularDash(o)}let n={y:this.nextRow+i,height:2*i,width:a};return this.nextRow+=r,this.dirty=!0,n}bind(t){let e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}};function HA(t){if(!t)return!1;let e=globalThis.location;if(!e)return!1;try{return new URL(t,e.href).origin!==e.origin}catch{return!1}}function XA(){let t=location.href;if(!/^https?:/.test(t))return"";let e=t.endsWith("-dev.mjs")?"maplibre-gl-worker-dev.mjs":"maplibre-gl-worker.mjs";return new URL(`./${e}`,t).href}function cp(t,e){if(e)try{return new Worker(t,{type:"module"})}catch(i){console.warn("Module worker not supported, falling back to classic worker",i)}return new Worker(t)}async function YA(t){let e=await fetch(t);if(!e.ok)throw Error(`Failed to fetch worker script (${e.status}): ${t}`);let i=await e.text(),r=new Blob([i],{type:"text/javascript"});return URL.createObjectURL(r)}function KA(t){let e=new Blob([`import ${JSON.stringify(new URL(t,location.href).href)}`],{type:"text/javascript"});return URL.createObjectURL(e)}async function JA(){let t=ti.WORKER_URL||XA(),e=!t?.endsWith(".cjs");if(!HA(t))return cp(t,e);if(e){let r=KA(t);try{return cp(r,e)}finally{URL.revokeObjectURL(r)}}let i=await YA(t);try{return cp(i,e)}finally{URL.revokeObjectURL(i)}}var Kp="maplibre_preloaded_worker_pool",Au=class mx{constructor(){this.active={},this.workersPromise=null}async acquire(e){if(this.active[e]=!0,!this.workersPromise){let i=[];for(;i.length<mx.workerCount;)i.push(JA());this.workersPromise=Promise.all(i)}return(await this.workersPromise).slice()}release(e){if(delete this.active[e],this.numActive()===0&&this.workersPromise){let i=this.workersPromise;this.workersPromise=null,i.then(r=>{for(let a of r)a.terminate()})}}isPreloaded(){return!!this.active[Kp]}numActive(){return Object.keys(this.active).length}},QA=Math.floor(Ge.hardwareConcurrency/2);Au.workerCount=s_(globalThis)?Math.max(Math.min(QA,3),1):1;var Ys;function Jp(){return Ys||(Ys=new Au),Ys}function tM(){Jp().acquire(Kp)}function eM(){let t=Ys;t&&(t.isPreloaded()&&t.numActive()===1?(t.release(Kp),Ys=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()"))}var gx=class{constructor(t,e){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e,this.removed=!1,this.actorsPromise=this.initActors(e)}async initActors(t){let e=await this.workerPool.acquire(t);if(this.removed)return[];if(this.actors=e.map((i,r)=>{let a=new y1(i,t);return a.name=`Worker ${r}`,a}),!this.actors.length)throw Error("No actors found");return this.actors}async broadcast(t,e){let i=await this.actorsPromise;return Promise.all(i.map(r=>r.sendAsync({type:t,data:e})))}async getActor(){let t=await this.actorsPromise;return this.currentActor=(this.currentActor+1)%t.length,t[this.currentActor]}async waitForInitComplete(){this.actors.length===0&&await this.actorsPromise}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.removed=!0;for(let e of this.actors)e.remove();this.actors=[],t&&this.workerPool.release(this.id)}async registerMessageHandler(t,e){let i=await this.actorsPromise;for(let r of i)r.registerMessageHandler(t,e)}async unregisterMessageHandler(t){let e=await this.actorsPromise;for(let i of e)i.unregisterMessageHandler(t)}},au;function Qp(){return au||(au=new gx(Jp(),Go),au.registerMessageHandler("GR",(t,e,i)=>ys(e,i))),au}function iM(t,e){let i=cr();return se(i,i,[1,1,0]),we(i,i,[t.width*.5,t.height*.5,1]),t.calculatePosMatrix?na(i,i,t.calculatePosMatrix(e.toUnwrapped())):i}function rM(t,e,i){if(t)for(let r of t){let a=e[r];if(a?.source===i&&a.type==="fill-extrusion")return!0}else for(let r in e){let a=e[r];if(a.source===i&&a.type==="fill-extrusion")return!0}return!1}function aM(t,e,i,r,a,n,s){let o=rM(a?.layers??null,e,t.id),l=n.maxPitchScaleFactor(),u=t.tilesIn(r,l,o);u.sort(_x);let h=[];for(let c of u)h.push({wrappedTileID:c.tileID.wrapped().key,queryResults:c.tile.queryRenderedFeatures(e,i,t.getState(),c.queryGeometry,c.cameraQueryGeometry,c.scale,a,n,l,iM(n,c.tileID),s?(d,p)=>s(c.tileID,d,p):void 0)});return lM(oM(h),t)}function nM(t,e,i,r,a,n,s){let o={},l=n.queryRenderedSymbols(r),u=[];for(let h of Object.keys(l).map(Number))u.push(s[h]);u.sort(_x);for(let h of u){let c=h.featureIndex.lookupSymbolFeatures(l[h.bucketInstanceId],e,h.bucketIndex,h.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,t);for(let d in c){o[d]||(o[d]=[]);let p=c[d];p.sort((f,m)=>{let g=h.featureSortOrder;if(g){let _=g.indexOf(f.featureIndex);return g.indexOf(m.featureIndex)-_}return m.featureIndex-f.featureIndex});for(let f of p)o[d].push(f)}}return uM(o,t,i)}function sM(t,e){let i=t.getRenderableIds().map(n=>t.getTileByID(n)),r=[],a={};for(let n of i){let s=n.tileID.canonical.key;a[s]||(a[s]=!0,n.querySourceFeatures(r,e))}return r}function _x(t,e){let i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function oM(t){let e={},i={};for(let{queryResults:r,wrappedTileID:a}of t){i[a]||(i[a]={});let n=i[a];for(let s in r){let o=r[s];n[s]||(n[s]={});let l=n[s];e[s]||(e[s]=[]);for(let u of o)l[u.featureIndex]||(l[u.featureIndex]=!0,e[s].push(u))}}return e}function lM(t,e){for(let i in t)for(let r of t[i])yx(r,e);return t}function uM(t,e,i){for(let r in t)for(let a of t[r]){let n=i[e[r].source];yx(a,n)}return t}function yx(t,e){let i=t.feature,r=e.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}async function vx(t,e,i,r){let a=t;if(t.url?a=(await vs(await e.transformRequest(t.url,"Source"),i)).data:await Ge.frameAsync(i,r),!a)return null;let n=rn(q(a,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(n.vectorLayerIds=a.vector_layers.map(s=>s.id)),n}var ji=class vr{constructor(e,i){e&&(i?this.setSouthWest(e).setNorthEast(i):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof Y?new Y(e.lng,e.lat):Y.convert(e),this}setSouthWest(e){return this._sw=e instanceof Y?new Y(e.lng,e.lat):Y.convert(e),this}extend(e){let i=this._sw,r=this._ne,a,n;if(e instanceof Y)a=e,n=e;else if(e instanceof vr){if(a=e._sw,n=e._ne,!a||!n)return this}else{if(Array.isArray(e)){if(e.length===4||e.every(Array.isArray)){let s=e;return this.extend(vr.convert(s))}{let s=e;return this.extend(Y.convert(s))}}return e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(Y.convert(e)):this}return!i&&!r?(this._sw=new Y(a.lng,a.lat),this._ne=new Y(n.lng,n.lat)):(i.lng=Math.min(a.lng,i.lng),i.lat=Math.min(a.lat,i.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)),this}getCenter(){return new Y((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 Y(this.getWest(),this.getNorth())}getSouthEast(){return new Y(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(e){let{lng:i,lat:r}=Y.convert(e),a=this._sw.lat<=r&&r<=this._ne.lat,n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),a&&n}intersects(e){if(e=vr.convert(e),!(e.getNorth()>=this.getSouth()&&e.getSouth()<=this.getNorth()))return!1;let i=Math.abs(this.getEast()-this.getWest()),r=Math.abs(e.getEast()-e.getWest());if(i>=360||r>=360)return!0;let a=li(this.getWest(),-180,180),n=li(this.getEast(),-180,180),s=li(e.getWest(),-180,180),o=li(e.getEast(),-180,180),l=a>n,u=s>o;return l&&u?!0:l?o>=a||s<=n:u?n>=s||a<=o:s<=n&&o>=a}static convert(e){return e instanceof vr||!e?e:new vr(e)}static fromLngLat(e,i=0){let r=360*i/40075017,a=r/Math.cos(Math.PI/180*e.lat);return new vr(new Y(e.lng-a,e.lat-r),new Y(e.lng+a,e.lat+r))}adjustAntiMeridian(){let e=new Y(this._sw.lng,this._sw.lat),i=new Y(this._ne.lng,this._ne.lat);return e.lng>i.lng?new vr(e,new Y(i.lng+360,i.lat)):new vr(e,i)}},xx=class{constructor(t,e,i){this.bounds=ji.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return!Array.isArray(t)||t.length!==4?[-180,-90,180,90]:[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]}contains(t){let e=2**t.z,i={minX:Math.floor(ca(this.bounds.getWest())*e),minY:Math.floor(da(this.bounds.getNorth())*e),maxX:Math.ceil(ca(this.bounds.getEast())*e),maxY:Math.ceil(da(this.bounds.getSouth())*e)};return t.x>=i.minX&&t.x<i.maxX&&t.y>=i.minY&&t.y<i.maxY}},bx=class extends ce{constructor(t,e,i,r){if(super(),this.id=t,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,q(this,rn(e,["url","scheme","tileSize","promoteId","encoding"])),this._options=q({type:"vector"},e),this._collectResourceTiming=e.collectResourceTiming,this.tileSize!==512)throw Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r)}async load(t=!1){this._loaded=!1,this.fire(new Nt("dataloading")),this._tileJSONRequest=new AbortController;try{let e=await vx(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,e&&(q(this,e),e.bounds&&(this.tileBounds=new xx(e.bounds,this.minzoom,this.maxzoom)),this.fire(new Nt("data",{sourceDataType:"metadata"})),this.fire(new Nt("data",{sourceDataType:"content",sourceDataChanged:t})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,fr(e)||this.fire(new J(be(e)))}}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(!0)}setTiles(t){return this.setSourceProperty(()=>{this.tiles=t,this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return q({},this._options)}async loadTile(t){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:await this.map._requestManager.transformRequest(e,"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,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:await this._getOverzoomParameters(t),etag:t.etag};i.request.collectResourceTiming=this._collectResourceTiming,await this.dispatcher.waitForInitComplete();let r="RT";if(!t.actor||t.state==="expired")t.actor=this.dispatcher.getReadyActor(),r="LT";else if(t.state==="loading")return new Promise((a,n)=>{t.reloadPromise={resolve:a,reject:n}});t.abortController=new AbortController;try{let a=await t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,a);let n={};return a?.etagUnmodified&&(n.unmodified=!0),n}catch(a){if(delete t.abortController,t.aborted||fr(a))return;if(a&&a.status!==404)throw a;this._afterTileLoadWorkerResponse(t,null)}}async _getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let e=t.tileID.scaledTo(this.maxzoom).canonical,i=e.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:e,overzoomRequest:await this.map._requestManager.transformRequest(i,"Tile")}}_afterTileLoadWorkerResponse(t,e){if(e?.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.etag=e?.etag,t.loadVectorData(e,this.map.painter),t.reloadPromise){let i=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(i.resolve).catch(i.reject)}}async abortTile(t){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&await t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}})}async unloadTile(t){t.unloadVectorData(),t.actor&&await t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}hasTransition(){return!1}},tf=class extends ce{constructor(t,e,i,r){super(),this.id=t,this.dispatcher=i,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=q({type:"raster"},e),q(this,rn(e,["url","scheme","tileSize"]))}async load(t=!1){this._loaded=!1,this.fire(new Nt("dataloading")),this._tileJSONRequest=new AbortController;try{let e=await vx(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,e&&(q(this,e),e.bounds&&(this.tileBounds=new xx(e.bounds,this.minzoom,this.maxzoom)),this.fire(new Nt("data",{sourceDataType:"metadata"})),this.fire(new Nt("data",{sourceDataType:"content",sourceDataChanged:t})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,fr(e)||this.fire(new J(be(e)))}}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),t(),this.load(!0)}setTiles(t){return this.setSourceProperty(()=>{this.tiles=t,this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return q({},this._options)}setPremultiplyAlpha(t){return this._premultiplyAlpha===t||this.setSourceProperty(()=>{this._premultiplyAlpha=t}),this}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}async loadTile(t){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this._premultiplyAlpha,r=i?void 0:{premultiplyAlpha:"none"};t.abortController=new AbortController;try{let a=await Vi.transformAndGetImage(this.map._requestManager,e,"Tile",t.abortController,this.map._refreshExpiredTiles,r);if(delete t.abortController,t.aborted){t.state="unloaded";return}if(a){this.map._refreshExpiredTiles&&(a.cacheControl||a.expires)&&t.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});let n=this.map.painter.context,s=n.gl,o=a.data??new Ot({width:1,height:1},new Uint8Array(4));t.texture=this.map.painter.getTileTexture(o.width),t.texture?t.texture.update(o,{useMipmap:!0,premultiply:i}):(t.texture=new he(n,o,s.RGBA,{useMipmap:!0,premultiply:i}),t.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.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}}async abortTile(t){t.abortController&&(t.abortController.abort(),delete t.abortController)}async unloadTile(t){t.texture&&this.map.painter.saveTileTexture(t.texture)}hasTransition(){return!1}},wx=class extends tf{constructor(t,e,i,r){super(t,e,i,r),this.type="raster-dem",this.maxzoom=22,this._options=q({type:"raster-dem"},e),this.encoding=e.encoding||"mapbox",this.redFactor=e.redFactor,this.greenFactor=e.greenFactor,this.blueFactor=e.blueFactor,this.baseShift=e.baseShift}async loadTile(t){let e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let i=await Vi.transformAndGetImage(this.map._requestManager,e,"Tile",t.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete t.abortController,t.aborted){t.state="unloaded";return}if(i){if(this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires}),!i.data){t.state="loaded";return}let r=i.data,a=Or(r)&&ol()?r:await this.readImageNow(r),n={type:this.type,uid:t.uid,source:this.id,rawImageData:a,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&t.state!=="expired"&&t.state!=="reloading")return;await this.dispatcher.waitForInitComplete(),(!t.actor||t.state==="expired")&&(t.actor=this.dispatcher.getReadyActor()),t.dem=await t.actor.sendAsync({type:"LDT",data:n}),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.needsColorReliefPrepare=!0,t.state="loaded"}}catch(i){if(delete t.abortController,t.aborted)t.state="unloaded";else if(i)throw t.state="errored",i}}async readImageNow(t){if(typeof VideoFrame<"u"&&jc()){let e=t.width+4,i=t.height+4;try{return new Ot({width:e,height:i},await u_(t,-2,-2,e,i))}catch{}}return Ge.getImageData(t,2)}_getNeighboringTiles(t){let e=t.canonical,i=2**e.z,r=(e.x-1+i)%i,a=e.x===0?t.wrap-1:t.wrap,n=(e.x+1+i)%i,s=e.x+1===i?t.wrap+1:t.wrap,o={};return o[new Se(t.overscaledZ,a,e.z,r,e.y).key]={backfilled:!1},o[new Se(t.overscaledZ,s,e.z,n,e.y).key]={backfilled:!1},e.y>0&&(o[new Se(t.overscaledZ,a,e.z,r,e.y-1).key]={backfilled:!1},o[new Se(t.overscaledZ,t.wrap,e.z,e.x,e.y-1).key]={backfilled:!1},o[new Se(t.overscaledZ,s,e.z,n,e.y-1).key]={backfilled:!1}),e.y+1<i&&(o[new Se(t.overscaledZ,a,e.z,r,e.y+1).key]={backfilled:!1},o[new Se(t.overscaledZ,t.wrap,e.z,e.x,e.y+1).key]={backfilled:!1},o[new Se(t.overscaledZ,s,e.z,n,e.y+1).key]={backfilled:!1}),o}async unloadTile(t){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&&await t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}})}};function Js(t,e){return e?t.properties[e]:t.id}function hM(t,e){let i=new Map;if(t==null||t.type==null)return i;if(t.type==="Feature"){let r=Js(t,e);return r==null?void 0:(i.set(r,t),i)}if(t.type==="FeatureCollection"){let r=new Set;for(let a of t.features){let n=Js(a,e);if(n==null||r.has(n))return;r.add(n),i.set(n,a)}return i}}function cM(t,e,i){let r=[];if(e.removeAll)t.clear();else if(e.remove)for(let a of e.remove){let n=t.get(a);n&&(r.push(n.geometry),t.delete(a))}if(e.add)for(let a of e.add){let n=Js(a,i);if(n==null)continue;let s=t.get(n);s&&r.push(s.geometry),r.push(a.geometry),t.set(n,a)}if(e.update)for(let a of e.update){let n=t.get(a.id);if(!n)continue;let s=!!a.newGeometry,o=a.removeAllProperties||a.removeProperties?.length>0||a.addOrUpdateProperties?.length>0;if(!s&&!o)continue;r.push(n.geometry);let l={...n};if(t.set(a.id,l),s&&(r.push(a.newGeometry),l.geometry=a.newGeometry),o){if(l.properties=a.removeAllProperties?{}:{...l.properties||{}},a.removeProperties)for(let u of a.removeProperties)delete l.properties[u];if(a.addOrUpdateProperties)for(let{key:u,value:h}of a.addOrUpdateProperties)l.properties[u]=h}}return r}function dM(t,e,i){if(!t)return e||{};if(!e)return t||{};i&&(ov(t.add,i),ov(e.add,i));let r=lv(t),a=lv(e);pM(r,a);let n={};if((r.removeAll||a.removeAll)&&(n.removeAll=!0),n.remove=new Set([...r.remove,...a.remove]),n.add=new Map([...r.add,...a.add]),n.update=new Map([...r.update,...a.update]),n.remove.size&&n.add.size)for(let o of n.add.keys())n.remove.delete(o);let s=gM(n);return i&&mM(s.add,i),s}function pM(t,e){e.removeAll&&(t.add.clear(),t.update.clear(),t.remove.clear(),e.remove.clear());for(let i of e.remove)t.add.delete(i),t.update.delete(i);for(let[i,r]of e.update){let a=t.update.get(i);a&&(e.update.set(i,fM(a,r)),t.update.delete(i))}}function fM(t,e){let i={id:t.id};if(e.removeAllProperties&&(delete t.removeProperties,delete t.addOrUpdateProperties,delete e.removeProperties),e.removeProperties&&t.addOrUpdateProperties){let r=new Set(e.removeProperties);t.addOrUpdateProperties=t.addOrUpdateProperties.filter(a=>!r.has(a.key))}return(t.removeAllProperties||e.removeAllProperties)&&(i.removeAllProperties=!0),(t.removeProperties||e.removeProperties)&&(i.removeProperties=[...t.removeProperties||[],...e.removeProperties||[]]),(t.addOrUpdateProperties||e.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...t.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(t.newGeometry||e.newGeometry)&&(i.newGeometry=e.newGeometry||t.newGeometry),i}function ov(t,e){if(t)for(let i of t){let r=Js(i,e);r!=null&&(i.id=r)}}function mM(t,e){if(t)for(let i of t)Js(i,e)!=null&&delete i.id}function lv(t){if(!t)return{};let e={};return e.removeAll=t.removeAll,e.remove=new Set(t.remove||[]),e.add=new Map(t.add?.map(i=>[i.id,i])),e.update=new Map(t.update?.map(i=>[i.id,i])),e}function gM(t){let e={};return t.removeAll&&(e.removeAll=t.removeAll),t.remove&&(e.remove=Array.from(t.remove)),t.add&&(e.add=Array.from(t.add.values())
vendor: 1,825 bytes, line 825
825),t.update&&(e.update=Array.from(t.update.values())),e}function Tx(t){return!t||t.length===0?[]:typeof t[0]=="number"?[t]:t.flatMap(e=>Tx(e))}function vu(t){return t.type==="GeometryCollection"?t.geometries.flatMap(e=>vu(e)):Tx(t.coordinates)}function uv(t){let e=new ji,i;switch(t.type){case"FeatureCollection":i=t.features.flatMap(r=>vu(r.geometry));break;case"Feature":i=vu(t.geometry);break;default:i=vu(t)}if(i.length===0)return e;for(let r of i){let[a,n]=r;e.extend([a,n])}return e}function _M({x:t,y:e,z:i},r=0){let a=ql((t-r)/2**i),n=tn((e+1+r)/2**i),s=ql((t+1+r)/2**i),o=tn((e-r)/2**i);return new ji([a,n],[s,o])}var Ex=class extends ce{constructor(t,e,i,r){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._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:e.data},this.actorPromise=i.getActor(),this.setEventedParent(r),this._data=typeof e.data=="string"?{url:e.data}:{geojson:e.data},this._options=q({},e),this._collectResourceTiming=e.collectResourceTiming,e.maxzoom!==void 0&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type),e.attribution&&(this.attribution=e.attribution),this.promoteId=e.promoteId,e.clusterMaxZoom!==void 0&&this.maxzoom<=e.clusterMaxZoom&&ft(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${e.clusterMaxZoom}".`),this.workerOptions=q({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(e.buffer===void 0?128:e.buffer),tolerance:this._pixelsToTileUnits(e.tolerance===void 0?.375:e.tolerance),extent:k,maxZoom:this.maxzoom,lineMetrics:e.lineMetrics||!1,generateId:e.generateId||!1,promoteId:typeof e.promoteId=="string"?e.promoteId:void 0,cluster:e.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(e.clusterMa
vendor: 19,128 bytes, line 825
825xZoom),minPoints:Math.max(2,e.clusterMinPoints||2),extent:k,radius:this._pixelsToTileUnits(e.clusterRadius||50),log:!1,generateId:e.generateId||!1}},clusterProperties:e.clusterProperties,filter:e.filter},e.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(k/this.tileSize)}_tileUnitsToPixels(t){return t/(k/this.tileSize)}_getClusterMaxZoom(t){let e=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||t===void 0||ft(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${e}"`),e}async load(){await this._updateWorkerData()}onAdd(t){this.map=t,this.load()}setData(t){return this._data=typeof t=="string"?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t},this._updateWorkerData()}updateData(t){return this._pendingWorkerUpdate.diff=dM(this._pendingWorkerUpdate.diff,t),this._updateWorkerData()}async getData(){return this._data.url&&await this.once("data"),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}async getBounds(){return uv(await this.getData())}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,t.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),t.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData()}getClusterOptions(){let{cluster:t,clusterOptions:e}=this.workerOptions.geojsonVtOptions;return{cluster:t,clusterMaxZoom:e.maxZoom,clusterRadius:this._tileUnitsToPixels(e.radius)}}async getClusterExpansionZoom(t){return(await this.actorPromise).sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}async getClusterChildren(t){return(await this.actorPromise).sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}async getClusterLeaves(t,e,i){return(await this.actorPromise).sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}async _updateWorkerData(){if(this._isUpdatingWorker)return this._updatePromise;if(!this._hasPendingWorkerUpdate()){ft(`No pending worker updates for GeoJSONSource ${this.id}.`);return}let{data:t,diff:e,updateCluster:i}=this._pendingWorkerUpdate,r=this._getLoadGeoJSONParameters(t,e,i);t===void 0?e?this._pendingWorkerUpdate.diff=void 0:i&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,this._updatePromise=this._dispatchWorkerUpdate(r),await this._updatePromise}async _getLoadGeoJSONParameters(t,e,i){let r=q({type:this.type,source:this.id},this.workerOptions);if(typeof t=="string")return r.request=await this.map._requestManager.transformRequest(Ge.resolveURL(t),"Source"),r.request.collectResourceTiming=this._collectResourceTiming,r;if(t!==void 0)return r.data=t,r;if(e)return r.dataDiff=e,r;if(i)return r.updateCluster=!0,r}async _dispatchWorkerUpdate(t){this._isUpdatingWorker=!0,this.fire(new Nt("dataloading"));try{let e=await t,i=await(await this.actorPromise).sendAsync({type:"LD",data:e});if(this._isUpdatingWorker=!1,this._removed||i.abandoned){this.fire(new Nt("dataabort"));return}i.data&&(this._data={geojson:i.data});let r=this._applyDiffToSource(e.dataDiff),a=this._getShouldReloadTileOptions(r),n={};this._applyResourceTiming(n,i),this.fire(new Nt("data",{...n,sourceDataType:"metadata"})),this.fire(new Nt("data",{...n,sourceDataType:"content",shouldReloadTileOptions:a}))}catch(e){if(this._isUpdatingWorker=!1,this._removed){this.fire(new Nt("dataabort"));return}this.fire(new J(be(e)))}finally{this._hasPendingWorkerUpdate()&&await this._updateWorkerData()}}_applyResourceTiming(t,e){if(!this._collectResourceTiming)return;let i=e.resourceTiming?.[this.id];if(!i)return;let r=i.slice(0);r?.length&&q(t,{resourceTiming:r})}_applyDiffToSource(t){if(!t)return;let e=typeof this.promoteId=="string"?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let r=hM(this._data.geojson,e);if(!r)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:r}}if(!this._data.updateable)return;let i=cM(this._data.updateable,t,e);if(!(t.removeAll||this._options.cluster))return i}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map(e=>uv(e))}}shouldReloadTile(t,{affectedBounds:e}){if(t.state==="loading")return!0;if(t.state==="unloaded")return!1;let{buffer:i,extent:r}=this.workerOptions.geojsonVtOptions,a=_M(t.tileID.canonical,i/r);for(let n of e)if(a.intersects(n))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}async loadTile(t){let e=t.actor?"RT":"LT";t.actor=await this.actorPromise;let i={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,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;try{let r=await(await this.actorPromise).sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,e==="RT")}catch(r){if(delete t.abortController,t.aborted||fr(r))return;throw r}}async abortTile(t){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}async unloadTile(t){t.unloadVectorData(),await(await this.actorPromise).sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}onRemove(){this._removed=!0,this.actorPromise.then(t=>t.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return q({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},mn=[0,0,1],yM=(t,e)=>({u_tl_parent:new dt(t,e.u_tl_parent),u_scale_parent:new N(t,e.u_scale_parent),u_buffer_scale:new N(t,e.u_buffer_scale),u_image_warp:new Oe(t,e.u_image_warp),u_fade_t:new N(t,e.u_fade_t),u_opacity:new N(t,e.u_opacity),u_image0:new K(t,e.u_image0),u_image1:new K(t,e.u_image1),u_brightness_low:new N(t,e.u_brightness_low),u_brightness_high:new N(t,e.u_brightness_high),u_saturation_factor:new N(t,e.u_saturation_factor),u_contrast_factor:new N(t,e.u_contrast_factor),u_spin_weights:new Oe(t,e.u_spin_weights),u_coords_top:new ln(t,e.u_coords_top),u_coords_bottom:new ln(t,e.u_coords_bottom)}),vM=(t,e,i,r,a,n)=>({u_tl_parent:t,u_scale_parent:e,u_buffer_scale:1,u_image_warp:n,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:wM(r.paint.get("raster-saturation")),u_contrast_factor:bM(r.paint.get("raster-contrast")),u_spin_weights:xM(r.paint.get("raster-hue-rotate")),u_coords_top:[a[0].x,a[0].y,a[1].x,a[1].y],u_coords_bottom:[a[3].x,a[3].y,a[2].x,a[2].y]});function xM(t){t*=Math.PI/180;let e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}function bM(t){return t>0?1/(1-t):1+t}function wM(t){return t>0?1-1/(1.001-t):-t}var to=class{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},ya=Yt([{name:"a_pos",type:"Int16",components:2}]),nu=k/128;function Sx(t,e){let i=Dx(e,"16bit"),r=gr.deserialize({arrayBuffer:i.vertices,length:i.vertices.byteLength/2/2}),a=Bi.deserialize({arrayBuffer:i.indices,length:i.indices.byteLength/2/3});return new to(t.createVertexBuffer(r,ya.members),t.createIndexBuffer(a),qt.simpleSegment(0,0,r.length,a.length))}function Dx(t,e){let i=t.granularity===void 0?1:Math.max(t.granularity,1),r=i+(t.generateBorders?2:0),a=i+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),n=r+1,s=a+1,o=t.generateBorders?-1:0,l=t.generateBorders||t.extendToNorthPole?-1:0,u=i+ +!!t.generateBorders,h=i+(t.generateBorders||t.extendToSouthPole?1:0),c=n*s,d=r*a*6,p=n*s>65536;if(p&&e==="16bit")throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=p||e==="32bit",m=new Int16Array(c*2),g=0;for(let x=l;x<=h;x++)for(let v=o;v<=u;v++){let w=v/i*k;v===-1&&(w=-nu),v===i+1&&(w=k+nu);let b=x/i*k;x===-1&&(b=t.extendToNorthPole?Ua:-nu),x===i+1&&(b=t.extendToSouthPole?Na:k+nu),m[g++]=w,m[g++]=b}let _=f?new Uint32Array(d):new Uint16Array(d),y=0;for(let x=0;x<a;x++)for(let v=0;v<r;v++){let w=v+x*n,b=v+1+x*n,T=v+(x+1)*n,D=v+1+(x+1)*n;_[y++]=w,_[y++]=T,_[y++]=b,_[y++]=b,_[y++]=T,_[y++]=D}return{vertices:m.buffer.slice(0),indices:_.buffer.slice(0),uses32bitIndices:f}}var yn=class extends ce{constructor(t,e,i,r){super(),this.imageWarp=mn,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=e}async load(t){if(this.options.url===void 0){this._loaded=!0,this._finishLoading();return}this._loaded=!1,this.fire(new Nt("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let e=await Vi.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,e?.data?(this._setImage(e.data),t&&(this.coordinates=t),this._finishLoading()):this.fire(new J(Error(`Could not load image ${this.url}: the response is empty`)))}catch(e){if(fr(e))return;this._abortController=null,this._loaded=!0,this.fire(new J(be(e)))}}loaded(){return this._loaded}updateImage(t){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in t?(this._loaded=!0,this._setImage(t.image),t.coordinates&&(this.coordinates=t.coordinates),this._finishLoading(),this):t.url?(this.options.url=t.url,this.load(t.coordinates),this):this}_setImage(t){this.image=t,this._imageDirty=!0}getMesh(t,e){return!this._subdividedQuad||e?null:(this._subdividedMesh??(this._subdividedMesh=Sx(t,{granularity:16})),this._subdividedMesh)}_disposeTexture(){this.texture?.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Nt("data",{sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),this._subdividedMesh?.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(t){return this._warp===t?this:(this._warp=t,this.tileCoords&&this.setCoordinates(this.coordinates),this)}getWarp(){return this._warp}setCoordinates(t){this.coordinates=t;let e=t.map(Et.fromLngLat);return this.tileID=TM(e),this.terrainTileRanges=this._getOverlappingTileRanges(e),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=e.map(i=>this.tileID.getTilePoint(i)._round()),this.imageWarp=SM(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!Px(this.tileCoords),this.flippedWindingOrder=EM(this.tileCoords),this.fire(new Nt("data",{sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,e=t.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)):(this.texture=new he(t,this.image,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE)),this._imageDirty=!1;let i=!1;for(let r in this.tiles){let a=this.tiles[r];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,i=!0)}i&&this.fire(new Nt("data",{sourceDataType:"idle",sourceId:this.id}))}async loadTile(t){this.tileID?.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}serialize(){let t={type:"image",coordinates:this.coordinates};return this.options.url!==void 0&&(t.url=this.options.url),t}hasTransition(){return!1}_getOverlappingTileRanges(t){let{minX:e,minY:i,maxX:r,maxY:a}=Ti.fromPoints(t),n={};for(let s=0;s<=25;s++){let o=2**s,l=Math.floor(e*o),u=Math.floor(i*o),h=Math.floor(r*o),c=Math.floor(a*o),d=(l%o+o)%o,p=h%o,f=Math.floor(l/o),m=Math.floor(h/o);n[s]={minWrap:f,maxWrap:m,minTileXWrapped:d,maxTileXWrapped:p,minTileY:u,maxTileY:c}}return n}};function TM(t){let e=Ti.fromPoints(t),i=e.width(),r=e.height(),a=Math.max(0,Math.floor(-Math.log(Math.max(i,r))/Math.LN2)),n=2**a;return new Ls(a,Math.floor((e.minX+e.maxX)/2*n),Math.floor((e.minY+e.maxY)/2*n))}function EM(t){let e=t[1].x-t[0].x,i=t[1].y-t[0].y,r=t[2].x-t[0].x;return e*(t[2].y-t[0].y)-i*r<0}function SM(t,e){if(e==="flat"||Px(t))return mn;let[i,r,a,n]=t,s=i.x-r.x+a.x-n.x,o=i.y-r.y+a.y-n.y,l=[r.x-a.x,r.y-a.y,n.x-a.x,n.y-a.y],[u,h,c,d]=l,p=_A(l),f=(s*d-c*o)/p,m=(u*o-s*h)/p,g=[1,1+f,1+f+m,1+m],_=Math.max(...g)/Math.min(...g),y=e==="perspective"?0:DM(_);return!(_>=1&&_<=512)||y>=1?mn:[f,m,y]}function DM(t){let e=(1-4/t)/.9921875;return Math.max(0,e)}function Px(t){let[e,i,r,a]=t;return e.x+r.x===i.x+a.x&&e.y+r.y===i.y+a.y}var Cx=class extends yn{constructor(t,e,i,r){super(t,e,i,r),this._onPlayingHandler=()=>{this.map?.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=e}async load(){this._loaded=!1;let t=this.options;this.urls=[];for(let e of t.urls)this.urls.push((await this.map._requestManager.transformRequest(e,"Source")).url);try{let e=await y_(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new J(be(e)))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let e=this.video.seekable;t<e.start(0)||t>e.end(0)?this.fire(new J(new B(`sources.${this.id}`,null,`Playback for this video can be set only between the ${e.start(0)} and ${e.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,e=t.gl;this.texture?this.video.paused||(this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.video)):(this.texture=new he(t,this.video,e.RGBA),this.texture.bind(e.LINEAR,e.CLAMP_TO_EDGE));let i=!1;for(let r in this.tiles){let a=this.tiles[r];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,i=!0)}i&&this.fire(new Nt("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},Ix=class extends yn{constructor(t,e,i,r){super(t,e,i,r),e.coordinates?(!Array.isArray(e.coordinates)||e.coordinates.length!==4||e.coordinates.some(a=>!Array.isArray(a)||a.length!==2||a.some(n=>typeof n!="number")))&&this.fire(new J(new B(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new J(new B(`sources.${t}`,null,'missing required property "coordinates"'))),e.animate&&typeof e.animate!="boolean"&&this.fire(new J(new B(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),e.canvas?typeof e.canvas!="string"&&!(e.canvas instanceof HTMLCanvasElement)&&this.fire(new J(new B(`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 J(new B(`sources.${t}`,null,'missing required property "canvas"'))),this.options=e,this.animate=e.animate===void 0||e.animate}async load(){if(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 J(Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this._playing=(this.prepare(),!1))},this._finishLoading()}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}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;let e=this.map.painter.context,i=e.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new he(e,this.canvas,i.RGBA,{premultiply:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(let a in this.tiles){let n=this.tiles[a];n.state!=="loaded"&&(n.state="loaded",n.texture=this.texture,r=!0)}r&&this.fire(new Nt("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}},Ax={},PM=(t,e,i,r)=>{let a=new(Mx(e.type))(t,e,i,r);if(a.id!==t)throw Error(`Expected Source id to be ${t} instead of ${a.id}`);return a},Mx=t=>{switch(t){case"geojson":return Ex;case"image":return yn;case"raster":return tf;case"raster-dem":return wx;case"vector":return bx;case"video":return Cx;case"canvas":return Ix}return Ax[t]},CM=(t,e)=>{Ax[t]=e},IM=async(t,e)=>{if(Mx(t))throw Error(`A source type called "${t}" already exists.`);CM(t,e)};function AM(t,e){let i={};if(!e)return i;for(let r of t){let a=r.layerIds.map(n=>e.getLayer(n)).filter(Boolean);if(a.length!==0){r.layers=a,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(n=>a.filter(s=>s.id===n)[0]));for(let n of a)i[n.id]=r}}return i}var Rp="RTLPluginLoaded",MM=class extends ce{constructor(...t){super(...t),this.status="unavailable",this.url=null,this.dispatcher=Qp()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(e=>{throw this.status="error",e})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}async setRTLTextPlugin(t,e=!1){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=Ge.resolveURL(t),!this.url)throw Error(`requested url ${t}
825 is invalid`);if(this.status==="unavailable")if(e)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new ei(Rp))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}},dp=null;function Qs(){return dp||(dp=new MM),dp}var Fx=class{constructor(t,e){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=Hc(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadingDirection!==0||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:e,fadingParentID:i,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=e,this.fadingParentID=i,this.fadeEndTime=r}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Ft(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(t){return this.rttObjects[t]}acquireRTT(t,e,i){return this.rttObjects[e]=t.acquireRTT(i)}releaseRTT(t){if(this.rttObjects.length!==0){for(let e of this.rttObjects)e&&t.releaseRTT(e);this.rttObjects.length=0}}loadVectorData(t,e,i){if(t?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!t){this.collisionBoxArray=new Td;return}t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=AM(t.buckets,e?.style),this.hasSymbolBuckets=!1;for(let r in this.buckets){let a=this.buckets[r];if(a instanceof ks)if(this.hasSymbolBuckets=!0,i)a.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let r in this.buckets){let a=this.buckets[r];if(a instanceof ks&&a.hasRTLText){this.hasRTLText=!0,Qs().lazyLoad();break}}this.queryPadding=0;for(let r in this.buckets){let a=this.buckets[r];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(r).queryRadius(a))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let i in this.buckets){let r=this.buckets[i];r.uploadPending()&&r.upload(t)}let e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new he(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new he(t,this.glyphAtlasImage,e.ALPHA),null))}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,a,n,s,o,l,u,h){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:a,scale:n,tileSize:this.tileSize,pixelPosMatrix:u,transform:o,params:s,queryPadding:this.queryPadding*l,getElevation:h},t,e,i):{}}querySourceFeatures(t,e){let i=this.latestFeatureIndex;if(!i?.rawTileData)return;let r=i.loadVTLayers(),a=e?.sourceLayer?e.sourceLayer:"",n=r._geojsonTileLayer||r[a];if(!n)return;let s=Ka(e?.filter,`querySourceFeatures[${a}].filter`,e?.globalState),{z:o,x:l,y:u}=this.tileID.canonical,h={z:o,x:l,y:u};for(let c=0;c<n.length;c++){let d=n.feature(c);if(s.needGeometry){let m=Vr(d,!0);
vendor: 10,894 bytes, line 825
825if(!s.filter(new Ct(this.tileID.overscaledZ),m,this.tileID.canonical))continue}else if(!s.filter(new Ct(this.tileID.overscaledZ),d))continue;let p=i.getId(d,a),f=new qd(d,o,l,u,p);f.tile=h,t.push(f)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){let e=this.expirationTime;if(t.cacheControl){let i=n_(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+i["max-age"]*1e3)}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let i=Date.now(),r=!1;if(this.expirationTime>i)r=!1;else if(!e)r=!0;else if(this.expirationTime<e)r=!0;else{let a=this.expirationTime-e;a?this.expirationTime=i+Math.max(a,3e4):r=!0}r?(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(),2**31-1)}setFeatureState(t,e,i){if(!this.latestFeatureIndex?.rawTileData||Object.keys(t).length===0||this.featureStateRevision===i)return;this.featureStateRevision=i;let r=this.latestFeatureIndex.loadVTLayers();for(let a in this.buckets){if(!e.style.hasLayer(a))continue;let n=this.buckets[a],s=n.layers[0].sourceLayer||"_geojsonTileLayer",o=r[s],l=t[s];if(!o||!l||l.length===0)continue;n.update(l,o,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let u=e?.style?.getLayer(a);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(n)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ft()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=Ft()+t}setDependencies(t,e){let i={};for(let r of e)i[r]=!0;this.dependencies[t]=i}hasDependency(t,e){for(let i of t){let r=this.dependencies[i];if(r){for(let a of e)if(r[a])return!0}}return!1}};function hv(t){let e=[];for(let i in t)e.push({id:i,state:t[i]});return e}var FM=class{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,e,i){var a,n;let r=String(e);if((a=this.stateChanges)[t]||(a[t]={}),(n=this.stateChanges[t])[r]||(n[r]={}),q(this.stateChanges[t][r],i),this.deletedStates[t]===null){this.deletedStates[t]={};for(let s in this.state[t])if(s===r){this.deletedStates[t][r]={};for(let o in this.state[t][s])i[o]===void 0&&(this.deletedStates[t][r][o]=null)}else this.deletedStates[t][s]=null}else if(this.deletedStates[t]?.[r]===null){this.deletedStates[t][r]={};for(let s in this.state[t][r])i[s]===void 0&&(this.deletedStates[t][r][s]=null)}else for(let s in i)this.deletedStates[t]?.[r]?.[s]===null&&delete this.deletedStates[t][r][s]}removeFeatureState(t,e,i){var a,n;if(this.deletedStates[t]===null)return;let r=String(e);if((a=this.deletedStates)[t]||(a[t]={}),i&&e!==void 0)this.deletedStates[t][r]!==null&&((n=this.deletedStates[t])[r]||(n[r]={}),this.deletedStates[t][r][i]=null);else if(e!==void 0)if(this.stateChanges[t]?.[r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,e){let i=String(e),r=this.state[t]||{},a=this.stateChanges[t]||{},n=q({},r[i],a[i]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let s=this.deletedStates[t][e];if(s===null)return{};for(let o in s)delete n[o]}return n}initializeTileState(t,e){let i={};for(let r in this.state)i[r]=hv(this.state[r]);t.setFeatureState(i,e,this.revision)}coalesceChanges(t,e){var a,n,s;let i={};for(let o in this.stateChanges){(a=this.state)[o]||(a[o]={}),i[o]||(i[o]={});for(let l in this.stateChanges[o])(n=this.state[o])[l]||(n[l]={}),q(this.state[o][l],this.stateChanges[o][l]),i[o][l]=this.state[o][l]}for(let o in this.deletedStates)if((s=this.state)[o]||(s[o]={}),i[o]||(i[o]={}),this.deletedStates[o]===null)for(let l in this.state[o])this.state[o][l]={},i[o][l]={};else for(let l in this.deletedStates[o]){if(this.deletedStates[o][l]===null)this.state[o][l]={};else for(let u of Object.keys(this.deletedStates[o][l]))delete this.state[o][l][u];i[o][l]=this.state[o][l]}if(this.stateChanges={},this.deletedStates={},Object.keys(i).length===0)return;this.revision++;let r={};for(let o in i)r[o]=hv(i[o]);t.setFeatureState(r,e,this.revision)}},ef=class zx{constructor(e,i){this.min=e,this.max=i,this.center=Ut([],si([],this.min,this.max),.5)}quadrant(e){let i=[e%2==0,e<2],r=hl(this.min),a=hl(this.max);for(let n=0;n<i.length;n++)r[n]=i[n]?this.min[n]:this.center[n],a[n]=i[n]?this.center[n]:this.max[n];return a[2]=this.max[2],new zx(r,a)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let i=!0;for(let r of e.planes){let a=this.intersectsPlane(r);if(a===0)return 0;a===1&&(i=!1)}return i?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let i=e[3],r=e[3];for(let a=0;a<3;a++)e[a]>0?(i+=e[a]*this.min[a],r+=e[a]*this.max[a]):(r+=e[a]*this.min[a],i+=e[a]*this.max[a]);return i>=0?2:r<0?0:1}},rf=class Rx{constructor(e,i,r){this.points=e,this.planes=i,this.aabb=r}static fromInvProjectionMatrix(e,i=1,r=0,a,n){let s=[[-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]],o=n?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],l=2**r,u=s.map(p=>zM(p,e,i,l));a&&RM(u,o[0],a,n);let h=o.map(p=>{let f=tr([],u[p[0]],u[p[1]]),m=tr([],u[p[2]],u[p[1]]),g=Le([],Ne([],f,m)),_=-oe(g,u[p[1]]);return g.concat(_)}),c=[1/0,1/0,1/0],d=[-1/0,-1/0,-1/0];for(let p of u)for(let f=0;f<3;f++)c[f]=Math.min(c[f],p[f]),d[f]=Math.max(d[f],p[f]);return new Rx(u,h,new ef(c,d))}};function zM(t,e,i,r){let a=Te([],t,e),n=1/a[3]/i*r;return Yg(a,a,[n,n,1/a[3],n])}function RM(t,e,i,r){let a=r?4:0,n=r?0:4,s=0,o=[],l=[];for(let c=0;c<4;c++){let d=tr([],t[c+n],t[c+a]),p=Qi(d);Ut(d,d,1/p),o.push(p),l.push(d)}for(let c=0;c<4;c++){let d=Qg(t[c+a],l[c],i);s=d!==null&&d>=0?Math.max(s,d):Math.max(s,o[c])}let u=kM(t,e),h=LM(i,u);if(h!==null){let c=h/oe(l[0],u);s=Math.min(s,c)}for(let c=0;c<4;c++){let d=Math.min(s,o[c]);t[c+n]=[t[c+a][0]+l[c][0]*d,t[c+a][1]+l[c][1]*d,t[c+a][2]+l[c][2]*d,1]}}function kM(t,e){let i=tr([],t[e[0]],t[e[1]]),r=tr([],t[e[2]],t[e[1]]),a=[0,0,0,0];return Le(a,Ne([],i,r)),a[3]=-oe(a,t[e[0]]),a}function LM(t,e){let i=ps(t),r=Xg([],t,1/i),a=tr([],e,Ut([],r,oe(e,r))),n=ps(a);if(n>0){let s=Math.sqrt(1-r[3]*r[3]),o=Ut([],r,-r[3]),l=si([],o,Ut([],a,s/n));return gl(e,l)}return null}function BM(t,e,i){let r=e.intersectsFrustum(t);if(!i||r===0)return r;let a=e.intersectsPlane(i);return a===0?0:r===2&&a===2?2:1}function cv(t,e,i){let r=0,a=(i-e)/10;for(let n=0;n<10;n++){let s=e+(n+.5)/10*(i-e);r+=a*Math.cos(s)**+t}return r}function kp(t,e){return function(i,r,a,n,s){let o=2*((t-1)/Ee(Math.cos(Gt(Ur-s))/Math.cos(Gt(Ur)))-1),l=Math.acos(a/n),u=2*cv(o-1,0,Gt(s/2)),h=Math.min(Gt(Ur),l+Gt(s/2)),c=Math.min(h,l-Gt(s/2)),d=cv(o-1,c,h),p=Math.atan(r/a),f=Math.hypot(r,a),m=i;return m+=Ee(n/f/Math.max(.5,Math.cos(Gt(s/2)))),m+=o*Ee(Math.cos(p))/2,m-=Ee(Math.max(1,d/u/e))/2,m}}var OM=kp(9.314,3);function af(t,e){let i=(e.roundZoom?Math.round:Math.floor)(t.zoom+Ee(t.tileSize/e.tileSize));return Math.max(0,i)}function VM(t,e){let i=Ur-t.pitch-t.fov/2,r=st((15-i)/15,0,1),a=Math.max(500,e??0);return t.elevation+r*a}function jM(t,e,i){let r=t.planes[1],a=t.points.map(l=>{let u=r[0]*l[0]+r[1]*l[1]+r[2]*l[2]+r[3];if(Math.abs(u)>1e-6)return l;let h=[l[0]-i[0],l[1]-i[1],l[2]-i[2]],c=r[0]*h[0]+r[1]*h[1]+r[2]*h[2];if(c>=-1e-9)return l;let d=e/-c;return[l[0]+h[0]*d,l[1]+h[1]*d,l[2]+h[2]*d,l[3]]}),n=t.planes.map((l,u)=>u===1?[l[0],l[1],l[2],l[3]+e]:l),s=[1/0,1/0,1/0],o=[-1/0,-1/0,-1/0];for(let l of a)for(let u=0;u<3;u++)s[u]=Math.min(s[u],l[u]),o[u]=Math.max(o[u],l[u]);return new rf(a,n,new ef(s,o))}function vn(t,e){let i=t.getCameraFrustum(),r=t.getClippingPlane();if(r&&e.maxContentElevation>0){let b=Math.hypot(r[0],r[1],r[2]);if(b>0){let T=1+e.maxContentElevation/Ve,D=st(-r[3]/b,-1,1),E=Math.cos(Math.acos(D)+Math.acos(1/T));r=[r[0],r[1],r[2],-E*b],i=jM(i,Math.sqrt(T*T-1),t.cameraPosition)}}let a=L0(t),n=Et.fromLngLat(t.center,t.elevation),s=VM(t,e.maxContentElevation),o=t.getCoveringTilesDetailsProvider(),l=o.allowVariableZoom(t,e),u=af(t,e),h=e.minzoom||0,c=e.maxzoom===void 0?t.maxZoom:e.maxzoom,d=Math.min(Math.max(0,u),c),p=2**d,f=[p*a.x,p*a.y,0],m=[p*n.x,p*n.y,0],g=Math.hypot(n.x-a.x,n.y-a.y),_=Math.abs(n.z-a.z),y=Math.hypot(g,_),x=b=>({zoom:0,x:0,y:0,wrap:b,fullyVisible:!1}),v=[],w=[];if(t.renderWorldCopies&&o.allowWorldCopies())for(let b=1;b<=3;b++)v.push(x(-b)),v.push(x(b));for(v.push(x(0));v.length>0;){let b=v.pop(),T=b.x,D=b.y,E=b.fullyVisible,M={x:T,y:D,z:b.zoom},R=o.getTileBoundingVolume(M,b.wrap,s,e);if(!E){let I=BM(i,R,r);if(I===0)continue;E=I===2}let z=o.distanceToTile2d(a.x,a.y,M,R),P=u;l&&(P=(e.calculateTileZoom||OM)(t.zoom+Ee(t.tileSize/e.tileSize),z,_,y,t.fov)),P=(e.roundZoom?Math.round:Math.floor)(P),P=Math.max(0,P);let S=Math.min(P,c);if(b.wrap=o.getWrap(n,M,b.wrap),b.zoom>=S){if(b.zoom<h)continue;let I=d-b.zoom,A=f[0]-.5-(T<<I),L=f[1]-.5-(D<<I),G=e.reparseOverscaled?Math.max(b.zoom,P):b.zoom;w.push({tileID:new Se(b.zoom===c?G:b.zoom,b.wrap,b.zoom,T,D),distanceSq:Jg([m[0]-.5-T,m[1]-.5-D]),tileDistanceToCamera:Math.sqrt(A*A+L*L)});continue}for(let I=0;I<4;I++){let A=(T<<1)+I%2,L=(D<<1)+(I>>1),G=b.zoom+1;v.push({zoom:G,x:A,y:L,wrap:b.wrap,fullyVisible:E})}}return w.sort((b,T)=>b.distanceSq-T.distanceSq).map(b=>b.tileID)}function dv(t){return t==="raster"||t==="image"||t==="video"}function UM(t,e,i,r,a,n,s){let o=Ft(),l=e_(e);for(let u of e){let h=t.getTileById(u.key);(h.fadingDirection===0||h.fadeOpacity===0)&&h.resetFadeLogic(),!NM(t,h,i,o,r,a,s)&&($M(t,h,i,o,n,s)||GM(h,l,o,s)||h.resetFadeLogic())}}function NM(t,e,i,r,a,n,s){if(!e.hasData())return!1;let{tileID:o,fadingRole:l,fadingDirection:u,fadingParentID:h}=e;if(l===0&&u===1&&h)return i[h.key]=h,!0;let c=Math.max(o.overscaledZ-a,n);for(let d=o.overscaledZ-1;d>=c;d--){let p=o.scaledTo(d),f=t.getLoadedTile(p);if(f)return e.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:f.tileID,fadeEndTime:r+s}),f.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:r+s}),i[p.key]=p,!0}return!1}function $M(t,e,i,r,a,n){if(!e.hasData())return!1;let s=e.tileID.children(a),o=pv(t,e,s,i,r,a,n);if(o)return!0;for(let l of s)pv(t,e,l.children(a),i,r,a,n)&&(o=!0);return o}function pv(t,e,i,r,a,n,s){if(i[0].overscaledZ>=n)return!1;let o=!1;for(let l of i){let u=t.getLoadedTile(l);
vendor: 5,430 bytes, line 825
825if(!u)continue;let{fadingRole:h,fadingDirection:c,fadingParentID:d}=u;(h!==0||c!==0||!d)&&(u.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:e.tileID,fadeEndTime:a+s}),e.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+s})),r[l.key]=l,o=!0}return o}function GM(t,e,i,r){let a=t.tileID;if(t.selfFading)return!0;if(t.hasData())return!1;if(e.has(a)){let n=i+r;return t.setSelfFadeLogic(n),!0}return!1}function ZM(t,e){if(e<=0)return!1;let i=Ft();for(let r of t.getAllTiles())if(r.fadeEndTime>=i)return!0;return!1}function qM(t,e){let i=e.getRenderableIds();for(let r of i){if(!t.neighboringTiles?.[r])continue;let a=e.getTileById(r);t.neighboringTiles[r].backfilled||fv(t,a),!a.neighboringTiles?.[t.tileID.key]?.backfilled&&fv(a,t)}}function fv(t,e){t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.needsColorReliefPrepare=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,a=2**t.tileID.canonical.z,n=e.tileID.key;(i!==0||r!==0)&&(Math.abs(r)>1||(Math.abs(i)>1&&(Math.abs(i+a)===1?i+=a:Math.abs(i-a)===1&&(i-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles?.[n]&&(t.neighboringTiles[n].backfilled=!0))))}var mv=class{constructor(){this._tiles={}}handleWrapJump(t){let e={};for(let i in this._tiles){let r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e}setFeatureState(t,e,i){for(let r in this._tiles)this._tiles[r].setFeatureState(t,e,i)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map(e=>e.tileID).sort(Zd).map(e=>e.key):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,e){this._tiles[t]=e}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let e=this.getTileById(t.key);return e?.hasData()?e:null}isIdRenderable(t,e=!1){return this.getTileById(t)?.isRenderable(e)}getRenderableIds(t=0,e){let i=[];for(let r of this.getAllIds())this.isIdRenderable(r,e)&&i.push(this.getTileById(r));return e?i.sort((r,a)=>{let n=r.tileID,s=a.tileID,o=new C(n.canonical.x,n.canonical.y)._rotate(-t),l=new C(s.canonical.x,s.canonical.y)._rotate(-t);return n.overscaledZ-s.overscaledZ||l.y-o.y||l.x-o.x}).map(r=>r.tileID.key):i.map(r=>r.tileID).sort(Zd).map(r=>r.key)}},br,Lp=(br=class extends ce{constructor(e,i,r){super(),this._maxContentElevationSeen=0,this.id=e,this.dispatcher=r,this.on("data",a=>{this._dataHandler(a)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=PM(e,i,r,this),this._inViewTiles=new mv,this._outOfViewCache=new Y1(0,a=>this._unloadTile(a)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new FM,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source?.onAdd&&this._source.onAdd(e)}onRemove(e){for(let i of this._inViewTiles.getAllTiles())i.unloadVectorData();this.clearTiles(),this._source?.onRemove&&this._source.onRemove(e),this._inViewTiles=new mv}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(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(e,i,r,a){try{let n=await this._source.loadTile(e);this._tileLoaded(e,i,r,a,n)}catch(n){e.state="errored",n.status===404?this.update(this.transform,this.terrain):this._source.fire(new J(be(n),{tile:e}))}}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new Nt("dataabort",{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let i of this._inViewTiles.getAllTiles())i.upload(e),i.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,e)}hasRenderableParent(e){let i=e.overscaledZ-1;if(i>=this._source.minzoom){let r=this.getLoadedTile(e.scaledTo(i));if(r)return this._inViewTiles.isIdRenderable(r.tileID.key)}return!1}reload(e,i=void 0){if(this._paused){this._shouldReloadOnResume=!0;return}this._outOfViewCache.reset();for(let r of this._inViewTiles.getAllIds()){let a=this._inViewTiles.getTileById(r);(!i||this._source.shouldReloadTile(a,i))&&(e?this._reloadTile(r,a.state==="errored"?"loading":"expired"):a.state!=="errored"&&this._reloadTile(r,"reloading"))}}async _reloadTile(e,i){let r=this._inViewTiles.getTileById(e);if(!r)return;let a=r.hasData();r.state!=="loading"&&(r.state=i),await this._loadTile(r,e,i,a)}_tileLoaded(e,i,r,a,n){a||(e.timeAdded=Ft(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration)),r
vendor: 4,654 bytes, line 825
825==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),!n?.unmodified&&(this.getSource().type==="raster-dem"&&e.dem&&qM(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new Nt("data",{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(e,i){let r=this._getLoadedDescendents(i),a=new Set;for(let n of i){let s=r[n.key];if(!s?.length){a.add(n);continue}let o=n.overscaledZ+br.maxOverzooming,l=s.filter(c=>c.tileID.overscaledZ<=o);if(!l.length){a.add(n);continue}let u=Math.min(...l.map(c=>c.tileID.overscaledZ)),h=l.filter(c=>c.tileID.overscaledZ===u).map(c=>c.tileID);for(let c of h)e[c.key]=c;this._areDescendentsComplete(h,u,n.overscaledZ)||a.add(n)}return a}_getLoadedDescendents(e){var r;let i={};for(let a of this._inViewTiles.getAllTiles().filter(n=>n.hasData()))for(let n of e)a.tileID.isChildOf(n)&&(i[r=n.key]||(i[r]=[]),i[n.key].push(a));return i}_areDescendentsComplete(e,i,r){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===i:4**(i-r)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let i=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=this._maxTileCacheZoomLevels===null?ti.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,a=Math.floor(i*r),n=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,a):a;this._outOfViewCache.setMaxSize(n)}handleWrapJump(e){let i=(e-(this._prevLng===void 0?e:this._prevLng))/360,r=Math.round(i);this._prevLng=e,r&&(this._inViewTiles.handleWrapJump(r),this._resetTileReloadTimers())}_updateMaxContentElevation(){let e=this._maxContentElevationSeen,i=this.map?.style?._layers;if(!i)return e;let r=this._inViewTiles.getAllTiles();for(let a in i){let n=i[a];if(n.type!=="symbol"||n.source!==this.id||n.isHidden(this.transform.zoom))continue;let s=n;if(s.layout){e=Math.max(e,s.layout.get("symbol-height-offset").constantOr(0));for(let o of r){let l=o.getBucket(n);l&&l.maxHeightOffset>e&&(e=l.maxHeightOffset)}}}return this._maxContentElevationSeen=e,e}update(e,i){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=i,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng);let r;!this.used&&!this.usedForTerrain?r=[]:this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(l=>new Se(l.canonical.z,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y)):(r=vn(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(r=r.filter(l=>this._source.hasTile(l)))),this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));let a=r.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,a&&this.fire(new Nt("data",{sourceDataType:"idle",sourceId:this.id}));let n=af(e,this._source),s=this._updateRetainedTiles(r,n),o=dv(this._source.type);o&&this._rasterFadeDuration>0&&!i&&UM(this._inViewTiles,r,s,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),o?this._cleanUpRasterTiles(s):this._cleanUpVectorTiles(s)}_cleanUpRasterTiles(e){for(let i of this._inViewTiles.getAllIds())e[i]||this._removeTile(i)}_cleanUpVectorTiles(e){for(let i of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(i);if(e[i]){r.clearSymbolFadeHold();continue}if(!r.hasSymbolBuckets){this._removeTile(i);continue}r.holdingForSymbolFade()?r.symbolFadeFinished()&&this._removeTile(i):r.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(e){let i=[];for(let r of e)if(r.canonical.z>this._source.minzoom){let a=r.scaledTo(r.canonical.z-1);i.push(a);let n=r.scaledTo(Math.max(this._source.minzoom,Math.min(r.canonical.z,5)));i.push(n)}return e.concat(i)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,i){let r=new Set;for(let l of e)this._addTile(l).hasData()||r.add(l);let a=e.reduce((l,u)=>(l[u.key]=u,l),{}),n=this._retainLoadedChildren(a,r),s={},o=Math.max(i-br.maxUnderzooming,this._source.minzoom);
vendor: 11,500 bytes, line 825
825for(let l of n){let u=this._inViewTiles.getTileById(l.key),h=u?.wasRequested();for(let c=l.overscaledZ-1;c>=o;--c){let d=l.scaledTo(c);if(s[d.key])break;if(s[d.key]=!0,u=this.getTile(d),!u&&h&&(u=this._addTile(d)),u){let p=u.hasData();if((p||!this.map?.cancelPendingTileRequestsWhileZooming||h)&&(a[d.key]=d),h=u.wasRequested(),p)break}}}return a}_addTile(e){let i=this._inViewTiles.getTileById(e.key);if(i)return i;i=this._outOfViewCache.getAndRemove(e),i&&(i.resetFadeLogic(),this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null));let r=i;return i||(i=new Fx(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,e.key,i.state,!1)),i.uses++,this._inViewTiles.setTile(e.key,i),r||this._source.fire(new Nt("dataloading",{tile:i,coord:i.tileID})),i}_setTileReloadTimer(e,i){this._clearTileReloadTimer(e);let r=i.getExpiryTimeout();if(r){let a=()=>{this._reloadTile(e,"expired"),delete this._timers[e]};this._timers[e]=setTimeout(a,r)}}_clearTileReloadTimer(e){let i=this._timers[e];i&&(clearTimeout(i),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,i)}}refreshTiles(e){for(let i of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(i);(this._inViewTiles.isIdRenderable(i)||r.state=="errored")&&e.some(a=>a.equals(r.tileID.canonical))&&this._reloadTile(i,"expired")}}_removeTile(e){let i=this._inViewTiles.getTileById(e);i&&(i.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),!(i.uses>0)&&(i.hasData()&&i.state!=="reloading"?this._outOfViewCache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}_dataHandler(e){if(e.dataType==="source"){if(e.sourceDataType==="metadata"){this._sourceLoaded=!0;return}e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation();for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,i,r){let a=[],n=this.transform;if(!n)return a;let s=n.getCoveringTilesDetailsProvider().allowWorldCopies(),o=r?n.getCameraQueryGeometry(e):e,l=p=>n.screenPointToMercatorCoordinate(p,this.terrain),u=this.transformBbox(e,l,!s),h=this.transformBbox(o,l,!s),c=this.getIds(),d=Ti.fromPoints(h);for(let p of c){let f=this._inViewTiles.getTileById(p);if(f.holdingForSymbolFade())continue;let m=s?[f.tileID]:[f.tileID.unwrapTo(-1),f.tileID.unwrapTo(0)],g=2**(n.zoom-f.tileID.overscaledZ),_=i*f.queryPadding*k/f.tileSize/g;for(let y of m){let x=d.map(v=>y.getTilePoint(new Et(v.x,v.y)));if(x.expandBy(_),x.intersects(M0)){let v=u.map(b=>y.getTilePoint(b)),w=h.map(b=>y.getTilePoint(b));a.push({tile:f,tileID:s?y:y.unwrapTo(0),queryGeometry:v,cameraQueryGeometry:w,scale:g})}}}return a}transformBbox(e,i,r){let a=e.map(i);if(r){let n=Ti.fromPoints(e);n.shrinkBy(Math.min(n.width(),n.height())*.001);let s=n.map(i);Ti.fromPoints(a).covers(s)||(a=a.map(o=>o.x>.5?new Et(o.x-1,o.y,o.z):o))}return a}getVisibleCoordinates(e){let i=this.getRenderableIds(e).map(r=>this._inViewTiles.getTileById(r).tileID);return this.transform&&this.transform.populateCache(i),i}hasTransition(){return this._source.hasTransition()?!0:dv(this._source.type)&&ZM(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,i,r){e||(e=Os),this._state.updateState(e,i,r)}removeFeatureState(e,i,r){e||(e=Os),this._state.removeFeatureState(e,i,r)}getFeatureState(e,i){return e||(e=Os),this._state.getState(e,i)}setDependencies(e,i,r){let a=this._inViewTiles.getTileById(e);a&&a.setDependencies(i,r)}reloadTilesForDependencies(e,i){for(let r of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(r).hasDependency(e,i)&&this._reloadTile(r,"reloading");this._outOfViewCache.filter(r=>!r.hasDependency(e,i))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}},br.maxUnderzooming=10,br.maxOverzooming=3,br),WM=class{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,this.length*.5),this.paddedLength=this.length-this.padding*2}lerp(t){if(this.points.length===1)return this.points[0];t=st(t,0,1);let e=1,i=this._distances[e],r=t*this.paddedLength+this.padding;for(;i<r&&e<this._distances.length;)i=this._distances[++e];let a=e-1,n=this._distances[a],s=i-n,o=s>0?(r-n)/s:0;return this.points[a].mult(1-o).add(this.points[e].mult(o))}};function xu(t,e,i,r,a){return a?t?t(e,i)+r:r===0?void 0:r:r}function su(t,e){let i=!0;return t==="always"||(t==="never"||e==="never")&&(i=!1),i}var gv=class{constructor(t,e,i){let r=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let n=0;n<this.xCellCount*this.yCellCount;n++)r.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,a){this._forEachCell(e,i,r,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(a)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,a,n){this.boxCells[a].push(n)}_insertCircleCell(t,e,i,r,a,n){this.circleCells[a].push(n)}_query(t,e,i,r,a,n,s){if(i<0||t>this.width||r<0||e>this.height)return[];let o=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(a)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let l=0;l<this.boxKeys.length;l++)o.push({key:this.boxKeys[l],x1:this.bboxes[l*4],y1:this.bboxes[l*4+1],x2:this.bboxes[l*4+2],y2:this.bboxes[l*4+3]});for(let l=0;l<this.circleKeys.length;l++){let u=this.circles[l*3],h=this.circles[l*3+1],c=this.circles[l*3+2];o.push({key:this.circleKeys[l],x1:u-c,y1:h-c,x2:u+c,y2:h+c})}}else{let l={hitTest:a,overlapMode:n,seenUids:{box:{},circle:{}}};this._forEachCell(t,e,i,r,this._queryCell,o,l,s)}return o}query(t,e,i,r){return this._query(t,e,i,r,!1,null)}hitTest(t,e,i,r,a,n){return this._query(t,e,i,r,!0,a,n).length>0}hitTestCircle(t,e,i,r,a){let n=t-i,s=t+i,o=e-i,l=e+i;if(s<0||n>this.width||l<0||o>this.height)return!1;let u=[],h={hitTest:!0,overlapMode:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(n,o,s,l,this._queryCellCircle,u,h,a),u.length>0}_queryCell(t,e,i,r,a,n,s,o){let{seenUids:l,hitTest:u,overlapMode:h}=s,c=this.boxCells[a],d=1e-6;if(c!==null){let f=this.bboxes;for(let m of c)if(!l.box[m]){l.box[m]=!0;let g=m*4,_=this.boxKeys[m];if(t<=f[g+2]+d&&e<=f[g+3]+d&&i>=f[g+0]-d&&r>=f[g+1]-d&&(!o||o(_))&&(!u||!su(h,_.overlapMode))&&(n.push({key:_,x1:f[g],y1:f[g+1],x2:f[g+2],y2:f[g+3]}),u))return!0}}let p=this.circleCells[a];if(p!==null){let f=this.circles;for(let m of p)if(!l.circle[m]){l.circle[m]=!0;let g=m*3,_=this.circleKeys[m];if(this._circleAndRectCollide(f[g],f[g+1],f[g+2],t,e,i,r)&&(!o||o(_))&&(!u||!su(h,_.overlapMode))){let y=f[g],x=f[g+1],v=f[g+2];if(n.push({key:_,x1:y-v,y1:x-v,x2:y+v,y2:x+v}),u)return!0}}}return!1}_queryCellCircle(t,e,i,r,a,n,s,o){let{circle:l,seenUids:u,overlapMode:h}=s,c=this.boxCells[a];if(c!==null){let p=this.bboxes;for(let f of c)if(!u.box[f]){u.box[f]=!0;let m=f*4,g=this.boxKeys[f];if(this._circleAndRectCollide(l.x,l.y,l.radius,p[m+0],p[m+1],p[m+2],p[m+3])&&(!o||o(g))&&!su(h,g.overlapMode))return n.push(!0),!0}}let d=this.circleCells[a];if(d!==null){let p=this.circles;for(let f of d)if(!u.circle[f]){u.circle[f]=!0;let m=f*3,g=this.circleKeys[f];if(this._circlesCollide(p[m],p[m+1],p[m+2],l.x,l.y,l.radius)&&(!o||o(g))&&!su(h,g.overlapMode))return n.push(!0),!0}}}_forEachCell(t,e,i,r,a,n,s,o){let l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r);for(let d=l;d<=h;d++)for(let p=u;p<=c;p++){let f=this.xCellCount*p+d;if(a.call(this,t,e,i,r,f,n,s,o))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,e,i,r,a,n){let s=r-t,o=a-e,l=i+n;return l*l>s*s+o*o}_circleAndRectCollide(t,e,i,r,a,n,s){let o=(n-r)/2,l=Math.abs(t-(r+o));if(l>o+i)return!1;let u=(s-a)/2,h=Math.abs(e-(a+u));if(h>u+i)return!1;if(l<=o||h<=u)return!0;let c=l-o,d=h-u;return c*c+d*d<=i*i}};function HM(t,e){let i=1/(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=1/(e[8]*e[8]+e[9]*e[9]+e[10]*e[10]),a=e[0]*i,n=e[4]*i,s=e[8]*r,o=e[1]*i,l=e[5]*i,u=e[9]*r,h=e[2]*i,c=e[6]*i,d=e[10]*r;t[0]=a,t[1]=n,t[2]=s,t[4]=o,t[5]=l,t[6]=u,t[8]=h,t[9]=c,t[10]=d;let p=e[12],f=e[13],m=e[14];return t[12]=-a*p-o*f-h*m,t[13]=-n*p-l*f-c*m,t[14]=-s*p-u*f-d*m,t[3]=0,t[7]=0,t[11]=0,t[15]=1,t}function XM(t,e){return t[0]=1/e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1/e[5],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=1/e[14],t[12]=0,t[13]=0,t[14]=-1,t[15]=e[10]/e[14],t}function YM(t,e){let i=1/(e[0]*e[5]-e[1]*e[4]);return t[0]=e[5]*i,t[1]=-e[1]*i,t[2]=0,t[3]=0,t[4]=-e[4]*i,t[5]=e[0]*i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1/e[10],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1/e[15],t}var KM=cr();function nf(t,e,i){let r=cr();if(!t){let{vecSouth:a,vecEast:n}=sf(e),s=lx();s[0]=n[0],s[1]=n[1],s[2]=a[0],s[3]=a[1],gA(s,s),r[0]=s[0],r[1]=s[1],r[4]=s[2],r[5]=s[3]}return we(r,r,[1/i,1/i,1]),r}function JM(t,e,i,r){if(t){let a=cr();if(!e){let{vecSouth:n,vecEast:s}=sf(i);a[0]=s[0],a[1]=s[1],a[4]=n[0],a[5]=n[1]}return we(a,a,[r,r,1]),a}return i.pixelsToClipSpaceMatrix}function sf(t){let e=Math.cos(t.rollInRadians),i=Math.sin(t.rollInRadians),r=Math.cos(t.pitchInRadians),a=Math.cos(t.bearingInRadians),n=Math.sin(t.bearingInRadians),s=ml();s[0]=-a*r*i-n*e,s[1]=-n*r*i+a*e;let o=Zc(s);o<1e-9?qc(s):Gc(s,s,1/o);let l=ml();l[0]=a*r*e-n*i,l[1]=n*r*e+a*i;let u=Zc(l);return u<1e-9?qc(l):Gc(l,l,1/u),{vecEast:l,vecSouth:s}}function xa(t,e,i){return xu(t.getElevation,e,i,t.heightOffset??0,t.heightAnchorGround??!0)}function of(t,e,i,r){let a;r==null?(a=[t,e,0,1],lf(a,a,i)):(a=[t,e,r,1],Te(a,a,i));let n=a[3];return{point:new C(a[0]/n,a[1]/n),signedDistanceFromCamera:n,isOccluded:!1}}function kx(t,e){return .5+t/e*.5}function QM(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function t3(t,e,i,r,a,n,s,o,l,u,h,c,d){let p=i?t.textSizeData:t.iconSizeData,f=zs(p,e.transform.zoom),m=[256/e.width*2+1,256/e.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let _=t.lineVertexArray,y=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=e.transform.width/e.transform.height,v=!1;for(let w=0;w<y.length;w++){let b=y.get(w);if(b.hidden||b.writingMode===2&&!v){gn(b.numGlyphs,g);continue}v=!1;let T=new C(b.anchorX,b.anchorY),D={getElevation:d,pitchedLabelPlaneMatr
vendor: 9,837 bytes, line 825
825ix:r,lineVertexArray:_,pitchWithMap:n,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:e.transform,tileAnchorPoint:T,unwrappedTileID:l,width:u,height:h,translation:c},E=Ox(b.anchorX,b.anchorY,D);if(!QM(E.point,m)){gn(b.numGlyphs,g);continue}let M=E.signedDistanceFromCamera,R=kx(e.transform.cameraToCenterDistance,M),z=Kl(p,f,b),P=n?z*e.transform.getPitchedTextCorrection(b.anchorX,b.anchorY,l)/R:z*R,S=yv({projectionContext:D,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:P,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:x,rotateToLine:o});v=S.useVertical,(S.notEnoughRoom||v||S.needsFlipping&&yv({projectionContext:D,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:P,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:x,rotateToLine:o}).notEnoughRoom)&&gn(b.numGlyphs,g)}i?t.text.dynamicLayoutVertexBuffer.updateData(g):t.icon.dynamicLayoutVertexBuffer.updateData(g)}function Lx(t,e,i,r,a,n,s,o){let l=n.glyphStartIndex+n.numGlyphs,u=n.lineStartIndex,h=n.lineStartIndex+n.lineLength,c=e.getoffsetX(n.glyphStartIndex),d=e.getoffsetX(l-1),p=Tu(t*c,i,r,a,n.segment,u,h,o,s);if(!p)return null;let f=Tu(t*d,i,r,a,n.segment,u,h,o,s);return!f||o.projectionCache.anyProjectionOccluded?null:{first:p,last:f}}function _v(t,e,i,r){return t===1&&Math.abs(i.y-e.y)>Math.abs(i.x-e.x)*r?{useVertical:!0}:(t===2?e.y<i.y:e.x>i.x)?{needsFlipping:!0}:null}function yv(t){let{projectionContext:e,pitchedLabelPlaneMatrixInverse:i,symbol:r,fontSize:a,flip:n,keepUpright:s,glyphOffsetArray:o,dynamicLayoutVertexArray:l,aspectRatio:u,rotateToLine:h}=t,c=a/24,d=r.lineOffsetX*c,p=r.lineOffsetY*c,f;if(r.numGlyphs>1){let m=r.glyphStartIndex+r.numGlyphs,g=r.lineStartIndex,_=r.lineStartIndex+r.lineLength,y=Lx(c,o,d,p,n,r,h,e);if(!y)return{notEnoughRoom:!0};let x=ou(y.first.point.x,y.first.point.y,e,i),v=ou(y.last.point.x,y.last.point.y,e,i);if(s&&!n){let w=_v(r.writingMode,x,v,u);if(w)return w}f=[y.first];for(let w=r.glyphStartIndex+1;w<m-1;w++){let b=Tu(c*o.getoffsetX(w),d,p,n,r.segment,g,_,e,h);if(!b)return{notEnoughRoom:!0};f.push(b)}f.push(y.last)}else{if(s&&!n){let g=ba(e.tileAnchorPoint.x,e.tileAnchorPoint.y,e).point,_=r.lineStartIndex+r.segment+1,y=new C(e.lineVertexArray.getx(_),e.lineVertexArray.gety(_)),x=ba(y.x,y.y,e),v=x.signedDistanceFromCamera>0?x.point:Bx(e.tileAnchorPoint,y,g,1,e),w=ou(g.x,g.y,e,i),b=ou(v.x,v.y,e,i),T=_v(r.writingMode,w,b,u);if(T)return T}let m=Tu(c*o.getoffsetX(r.glyphStartIndex),d,p,n,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,e,h);if(!m||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[m]}for(let m of f)Rs(l,m.point,m.angle);return{}}function Bx(t,e,i,r,a){let n=t.add(t.sub(e)._unit()),s=ba(n.x,n.y,a).point,o=i.sub(s);return i.add(o._mult(r/o.mag()))}function Bp(t,e,i){let r=e.projectionCache;if(r.projections[t])return r.projections[t];let a=new C(e.lineVertexArray.getx(t),e.lineVertexArray.gety(t)),n=ba(a.x,a.y,e);if(n.signedDistanceFromCamera>0)return r.projections[t]=n.point,r.anyProjectionOccluded||(r.anyProjectionOccluded=n.isOccluded),n.point;let s=t-i.direction,o=i.distanceFromAnchor===0?e.tileAnchorPoint:new C(e.lineVertexArray.getx(s),e.lineVertexArray.gety(s)),l=i.absOffsetX-i.distanceFromAnchor+1;return Bx(o,a,i.previousVertex,l,e)}function ba(t,e,i){let r=t+i.translation[0],a=e+i.translation[1],n;return i.pitchWithMap?(n=of(r,a,i.pitchedLabelPlaneMatrix,xa(i,r,a)),n.isOccluded=!1):(n=i.transform.projectTileCoordinates(r,a,i.unwrappedTileID,xa(i,r,a)),n.point.x=(n.point.x*.5+.5)*i.width,n.point.y=(-n.point.y*.5+.5)*i.height),n}function ou(t,e,i,r){if(i.pitchWithMap){let a=[t,e,0,1];Te(a,a,r);let n=a[0]/a[3],s=a[1]/a[3];return i.transform.projectTileCoordinates(n,s,i.unwrappedTileID,xa(i,n,s)).point}return{x:t/i.width*2-1,y:1-e/i.height*2}}function Ox(t,e,i){return i.transform.projectTileCoordinates(t,e,i.unwrappedTileID,xa(i,t,e))}function Op(t,e,i){return t._unit()._perp()._mult(e*i)}function e3(t,e,i,r,a,n,s,o,l){if(o.projectionCache.offsets[t])return o.projectionCache.offsets[t];let u=i.add(e);if(t+l.direction<r||t+l.direction>=a)return o.projectionCache.offsets[t]=u,u;let h=Bp(t+l.direction,o,l),c=Op(h.sub(i),s,l.direction),d=i.add(c),p=h.add(c);return o.projectionCache.offsets[t]=r_(n,u,d,p)||u,o.projectionCache.offsets[t]}function Tu(t,e,i,r,a,n,s,o,l){let u=r?t-e:t+e,h=u>0?1:-1,c=0;r&&(h*=-1,c=Math.PI),h<0&&(c+=Math.PI);let d=h>0?n+a:n+a+1,p;o.projectionCache.cachedAnchorPoint?p=o.projectionCache.cachedAnchorPoint:(p=ba(o.tileAnchorPoint.x,o.tileAnchorPoint.y,o).point,o.projectionCache.cachedAnchorPoint=p);let f=p,m=p,g,_,y=0,x=0,v=Math.abs(u),w=[],b;for(;y+x<=v;){if(d+=h,d<n||d>=s)return null;y+=x,m=f,_=g;let M={absOffsetX:v,direction:h,distanceFromAnchor:y,previousVertex:m};if(f=Bp(d,o,M),i===0)w.push(m),b=f.sub(m);else{let R,z=f.sub(m);R=z.mag()===0?Op(Bp(d+h,o,M).sub(f),i,h):Op(z,i,h),_||(_=m.add(R)),g=e3(d,R,f,n,s,_,i,o,M),w.push(_),b=g.sub(_)}x=b.mag()}let T=(v-y)/x,D=b._mult(T)._add(_||m),E=c+Math.atan2(f.y-m.y,f.x-m.x);return w.push(D),{point:D,angle:l?E:0,path:w}}var i3=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function gn(t,e){for(let i=0;i<t;i++){let r=e.length;e.resize(r+4),e.float32.set(i3,r*3)}}function lf(t,e,i){let r=e[0],a=e[1];return t[0]=i[0]*r+i[4]*a+i[12],t[1]=i[1]*r+i[5]*a+i[13],t[3]=i[3]*r+i[7]*a+i[15],t}function r3(t,e){let i=KM;return YM(i,e.pitchedLabelPlaneMatrix),t.map(r=>{let a=of(r.x,r.y,i,xa(e,r.x,r.y)),n=e.transform.projectTileCoordinates(a.point.x,a.point.y,e.unwrappedTileID,xa(e,a.point.x,a.point.y));return n.point.x=(n.point.x*.5+.5)*e.width,n.point.y=(-n.point.y*.5+.5)*e.height,n})}function a3(t){let e=0,i=0,r=0,a=0;for(let n=0;n<t.length;n++)t[n].isOccluded?(r=n+1,a=0):(a++,a>i&&(i=a,e=r));return t.slice(e,e+i)}var n3=class{constructor(t,e=new gv(t.width+200,t.height+200,25),i=new gv(t.width+200,t.height+200,25)){this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,a,n,s,o,l,u,h,c,d=0,p=!0){let f=t.anchorPointX+o[0],m=t.anchorPointY+o[1],g=this.projectAndGetPerspectiveRatio(f,m,a,xu(u,f,m,d,p),c),_=i*g.perspectiveRatio,y;if(!n&&!s){let E=g.x+(h?h.x*_:0),M=g.y+(h?h.y*_:0);y={allPointsOccluded:!1,box:[E+t.x1*_,M+t.y1*_,E+t.x2*_,M+t.y2*_]}}else y=this._projectCollisionBox(t,_,r,a,n,s,o,g,u,h,c,d,p);let[x,v,w,b]=y.box,T=n?y.allPointsOccluded:g.isOccluded,D=T;return D||(D=g.perspectiveRatio<this.perspectiveRatioCutoff),D||(D=!this.isInsideGrid(x,v,w,b)),D||e!=="always"&&this.grid.hitTest(x,v,w,b,e,l)?{box:[x,v,w,b],placeable:!1,offscreen:!1,occluded:T}:{box:[x,v,w,b],placeable:!0,offscreen:this.isOffscreen(x,v,w,b),occluded:T}}placeCollisionCircles(t,e,i,r,a,n,s,o,l,u,h,c,d,p){let f=[],m=new C(e.anchorX,e.anchorY),g=this.getPerspectiveRatio(m.x,m.y,n,p?.(m.x,m.y)),_=(l?a*this.transform.getPitchedTextCorrection(e.anchorX,e.anchorY,n)/g:a*g)/24,y={projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},x=e.lineOffsetX*_,v=e.lineOffsetY*_,w={getElevation:p,pitchedLabelPlaneMatrix:s,lineVertexArray:i,pitchWithMap:l,projectionCache:y,transform:this.transform,tileAnchorPoint:m,unwrappedTileID:n,width:this.transform.width,height:this.transform.height,translation:d},b=Lx(_,r,x,v,!1,e,!1,w),T=!1,D=!1,E=!0;if(b){let M=h*.5*g+c,R=new C(-100,-100),z=new C(this.screenRightBoundary,this.screenBottomBoundary),P=new WM,S=b.first,I=b.last,A=[];for(let U=S.path.length-1;U>=1;U--)A.push(S.path[U]);for(let U=1;U<I.path.length;U++)A.push(I.path[U]);let L=M*2.5;if(l){let U=this.projectPathToScreenSpace(A,w);A=U.some(et=>et.signedDistanceFromCamera<=0)?[]:U.map(et=>et.point)}let G=[];if(A.length>0){let U=A[0].clone(),et=A[0].clone();for(let ot=1;ot<A.length;ot++)U.x=Math.min(U.x,A[ot].x),U.y=Math.min(U.y,A[ot].y),et.x=Math.max(et.x,A[ot].x),et.y=Math.max(et.y,A[ot].y);G=U.x>=R.x&&et.x<=z.x&&U.y>=R.y&&et.y<=z.y?[A]:et.x<R.x||U.x>z.x||et.y<R.y||U.y>z.y?[]:Ud([A],R.x,R.y,z.x,z.y)}for(let U of G){P.reset(U,M*.25);let et=0;et=P.length<=.5*M?1:Math.ceil(P.paddedLength/L)+1;for(let ot=0;ot<et;ot++){let Pt=ot/Math.max(et-1,1),vt=P.lerp(Pt),ee=vt.x+100,Lt=vt.y+100;f.push(ee,Lt,M,0);let Wt=ee-M,kt=Lt-M,Pe=ee+M,ze=Lt+M;if(E&&(E=this.isOffscreen(Wt,kt,Pe,ze)),D||(D=this.isInsideGrid(Wt,kt,Pe,ze)),t!=="always"&&this.grid.hitTestCircle(ee,Lt,M,t,u)&&(T=!0,!o))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!o&&T||!D||g<this.perspectiveRatioCutoff?[]:f,offscreen:E,collisionDetected:T}}projectPathToScreenSpace(t,e){return a3(r3(t,e))}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let e=[],i=new Ti;for(let h of t){let c=new C(h.x+100,h.y+100);i.extend(c),e.push(c)}let{minX:r,minY:a,maxX:n,maxY:s}=i,o=this.grid.query(r,a,n,s).concat(this.ignoredGrid.query(r,a,n,s)),l={},u={};for(let h of o){let c=h.key;if(l[c.bucketInstanceId]===void 0&&(l[c.bucketInstanceId]={}),l[c.bucketInstanceId][c.featureIndex])continue;let d=[new C(h.x1,h.y1),new C(h.x2,h.y1),new C(h.x2,h.y2),new C(h.x1,h.y2)];Pd(e,d)&&(l[c.bucketInstanceId][c.featureIndex]=!0,u[c.bucketInstanceId]===void 0&&(u[c.bucketInstanceId]=[]),u[c.bucketInstanceId].push(c.featureIndex))}return u}insertCollisionBox(t,e,i,r,a,n){let s=i?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:a,collisionGroupID:n,overlapMode:e};s.insert(o,t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,a,n){let s=i?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:a,collisionGroupID:n,overlapMode:e};for(let l=0;l<t.length;
vendor: 10,684 bytes, line 825
825l+=4)s.insertCircle(o,t[l],t[l+1],t[l+2])}projectAndGetPerspectiveRatio(t,e,i,r,a){if(a){let n;r==null?(n=[t,e,0,1],lf(n,n,a)):(n=[t,e,r,1],Te(n,n,a));let s=n[3];return{x:(n[0]/s+1)/2*this.transform.width+100,y:(-n[1]/s+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/s),isOccluded:!1,signedDistanceFromCamera:s}}{let n=this.transform.projectTileCoordinates(t,e,i,r);return{x:(n.point.x+1)/2*this.transform.width+100,y:(-n.point.y+1)/2*this.transform.height+100,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/n.signedDistanceFromCamera),isOccluded:n.isOccluded,signedDistanceFromCamera:n.signedDistanceFromCamera}}}getPerspectiveRatio(t,e,i,r){let a=this.transform.projectTileCoordinates(t,e,i,r);return .5+.5*(this.transform.cameraToCenterDistance/a.signedDistanceFromCamera)}isOffscreen(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){let t=Ei([]);return se(t,t,[-100,-100,0]),t}_projectCollisionBox(t,e,i,r,a,n,s,o,l,u,h,c=0,d=!0){let p=1,f=0,m=0,g=1,_=t.anchorPointX+s[0],y=t.anchorPointY+s[1];if(n&&!a){let I=this.projectAndGetPerspectiveRatio(_+1,y,r,xu(l,_+1,y,c,d),h),A=I.x-o.x,L=I.y-o.y,G=Math.atan(L/A)+(A<0?Math.PI:0),U=Math.sin(G),et=Math.cos(G);p=et,f=U,m=-U,g=et}else if(!n&&a){let I=sf(this.transform);p=I.vecEast[0],f=I.vecEast[1],m=I.vecSouth[0],g=I.vecSouth[1]}let x=o.x,v=o.y,w=e;if(a&&(x=_,v=y,w=2**-(this.transform.zoom-i.overscaledZ),w*=this.transform.getPitchedTextCorrection(_,y,r),!u)){let I=o.signedDistanceFromCamera/this.transform.cameraToCenterDistance,A=st(.5+.5*I,0,4);w*=A}u&&(x+=p*u.x*w+m*u.y*w,v+=f*u.x*w+g*u.y*w);let b=t.x1*w,T=t.x2*w,D=(b+T)/2,E=t.y1*w,M=t.y2*w,R=(E+M)/2,z=[{offsetX:b,offsetY:E},{offsetX:D,offsetY:E},{offsetX:T,offsetY:E},{offsetX:T,offsetY:R},{offsetX:T,offsetY:M},{offsetX:D,offsetY:M},{offsetX:b,offsetY:M},{offsetX:b,offsetY:R}],P=[];for(let{offsetX:I,offsetY:A}of z)P.push(new C(x+p*I+m*A,v+f*I+g*A));let S=!1;if(a){let I=P.map(A=>this.projectAndGetPerspectiveRatio(A.x,A.y,r,xu(l,A.x,A.y,c,d),h));S=I.some(A=>!A.isOccluded),P=I.map(A=>new C(A.x,A.y))}else S=!0;return{box:t_(P),allPointsOccluded:!S}}},vv=class{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return this.opacity===0&&!this.placed}},Us=class{constructor(t,e,i,r,a){this.text=new vv(t?t.text:null,e,i,a),this.icon=new vv(t?t.icon:null,e,r,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},xv=class{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}},s3=class{constructor(t,e,i,r,a){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=a}},o3=class{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:i=>i.collisionGroupID===e}}return this.collisionGroups[t]}};function bv(t,e,i,r,a){let{horizontalAlign:n,verticalAlign:s}=Fs(t),o=-(n-.5)*e,l=-(s-.5)*i;return new C(o+r[0]*a,l+r[1]*a)}var l3=class{constructor(t,e,i,r,a){this.transform=t.clone(),this.terrain=e,this.collisionIndex=new n3(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new o3(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let e=this.terrain;if(e)return(i,r)=>e.getElevation(t,i,r)}getBucketParts(t,e,i,r){let a=i.getBucket(e),n=i.latestFeatureIndex;if(!a||!n||e.id!==a.layerIds[0])return;let s=i.collisionBoxArray,o=a.layers[0].layout,l=a.layers[0].paint,u=2**(this.transform.zoom-i.tileID.overscaledZ),h=i.tileSize/k,c=i.tileID.toUnwrapped(),d=o.get("text-rotation-alignment")==="map",p=Ke(i,1,this.transform.zoom),f=pr(this.collisionIndex.transform,i,l.get("text-translate"),l.get("text-translate-anchor")),m=pr(this.collisionIndex.transform,i,l.get("icon-translate"),l.get("icon-translate-anchor")),g=nf(d,this.transform,p);this.retainedQueryData[a.bucketInstanceId]=new s3(a.bucketInstanceId,n,a.sourceLayerIndex,a.index,i.tileID);let _={bucket:a,layout:o,translationText:f,translationIcon:m,unwrappedTileID:c,pitchedLabelPlaneMatrix:g,scale:u,textPixelRatio:h,holdingForFade:i.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:zs(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(r)for(let y of a.sortKeyRanges){let{sortKey:x,symbolInstanceStart:v,symbolInstanceEnd:w}=y;t.push({sortKey:x,symbolInstanceStart:v,symbolInstanceEnd:w,parameters:_})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:_})}attemptAnchorPlacement(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y,x,v,w){let b=Jl[t.textAnchor],T=[t.textOffset0,t.textOffset1],D=bv(b,i,r,T,a),E=this.collisionIndex.placeCollisionBox(e,c,o,l,u,s,n,m,h.predicate,y,D,x,v,w);if((!_||this.collisionIndex.placeCollisionBox(_,c,o,l,u,s,n,g,h.predicate,y,D,x,v,w).placeable)&&E.placeable){let M;if(this.prevPlacement?.variableOffsets[d.crossTileID]&&this.prevPlacement?.placements[d.crossTileID]?.text&&(M=this.prevPlacement.variableOffsets[d.crossTileID].anchor),d.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:T,width:i,height:r,anchor:b,textBoxScale:a,prevAnchor:M},this.markUsedJustification(p,b,d,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,d),this.placedOrientations[d.crossTileID]=f),{shift:D,placedGlyphBoxes:E}}}placeLayerBucketPart(t,e,i){let{bucket:r,layout:a,translationText:n,translationIcon:s,unwrappedTileID:o,pitchedLabelPlaneMatrix:l,textPixelRatio:u,holdingForFade:h,collisionBoxArray:c,partiallyEvaluatedTextSize:d,collisionGroup:p}=t.parameters,f=a.get("text-optional"),m=a.get("icon-optional"),g=hs(a,"text-overlap","text-allow-overlap"),_=g==="always",y=hs(a,"icon-overlap","icon-allow-overlap"),x=y==="always",v=a.get("text-rotation-alignment")==="map",w=a.get("text-pitch-alignment")==="map",b=a.get("icon-text-fit")!=="none",T=a.get("symbol-z-order")==="viewport-y",D=a.get("symbol-height-anchor")==="ground",E=_&&(x||!r.hasIconData()||m),M=x&&(_||!r.hasTextData()||f);!r.collisionArrays&&c&&r.deserializeCollisionBoxes(c);let R=this.retainedQueryData[r.bucketInstanceId].tileID,z=this._getTerrainElevationFunc(R),P=this.transform.getFastPathSimpleProjectionMatrix(R),S=(I,A,L)=>{if(e[I.crossTileID])return;if(h){this.placements[I.crossTileID]=new xv(!1,!1,!1);return}let G=I.heightOffset,U=!1,et=!1,ot=!0,Pt=null,vt={box:null,placeable:!1,offscreen:null,occluded:!1},ee={box:null,placeable:!1,offscreen:null},Lt=null,Wt=null,kt=null,Pe=0,ze=0,qe=0;A.textFeatureIndex?Pe=A.textFeatureIndex:I.useRuntimeCollisionCircles&&(Pe=I.featureIndex),A.verticalTextFeatureIndex&&(ze=A.verticalTextFeatureIndex);let We=A.textBox;if(We){let it=H=>{let W=1;if(r.allowVerticalPlacement&&!H&&this.prevPlacement){let X=this.prevPlacement.placedOrientations[I.crossTileID];X&&(this.placedOrientations[I.crossTileID]=X,W=X,this.markUsedOrientation(r,W,I))}return W},rt=(H,W)=>{if(r.allowVerticalPlacement&&I.numVerticalGlyphVertices>0&&A.verticalTextBox){for(let X of r.writingModes)if(X===2?(vt=W(),ee=vt):vt=H(),vt?.placeable)break}else vt=H()},O=I.textAnchorOffsetStartIndex,Tt=I.textAnchorOffsetEndIndex;if(Tt===O){let H=(W,X)=>{let yt=this.collisionIndex.placeCollisionBox(W,g,u,R,o,w,v,n,p.predicate,z,void 0,P,G,D);return yt?.placeable&&(this.markUsedOrientation(r,X,I),this.placedOrientations[I.crossTileID]=X),yt};rt(()=>H(We,1),()=>{let W=A.verticalTextBox;return r.allowVerticalPlacement&&I.numVerticalGlyphVertices>0&&W?H(W,2):{box:null,offscreen:null}}),it(vt?.placeable)}else{let H=Jl[this.prevPlacement?.variableOffsets[I.crossTileID]?.anchor],W=(yt,Bt,xt)=>{let le=yt.x2-yt.x1,$r=yt.y2-yt.y1,ar=I.textBoxScale,Ni=b&&y==="never"?Bt:null,je=null,Rt=g==="never"?1:2,Ht="never";H&&Rt++;for(let pi=0;pi<Rt;pi++){for(let fi=O;fi<Tt;fi++){let wa=r.textAnchorOffsets.get(fi);if(H&&wa.textAnchor!==H)continue;let ue=this.attemptAnchorPlacement(wa,yt,le,$r,ar,v,w,u,R,o,p,Ht,I,r,xt,n,s,Ni,z,P,G,D);if(ue&&(je=ue.placedGlyphBoxes,je?.placeable))return U=!0,Pt=ue.shift,je}H?H=null:Ht=g}return i&&!je&&(je={box:this.collisionIndex.placeCollisionBox(We,"always",u,R,o,w,v,n,p.predicate,z,void 0,P,G,D).box,offscreen:!1,placeable:!1,occluded:!1}),je};rt(()=>W(We,A.iconBox,1),()=>{let yt=A.verticalTextBox,Bt=vt?.placeable;return r.allowVerticalPlacement&&!Bt&&I.numVerticalGlyphVertices>0&&yt?W(yt,A.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),vt&&(U=vt.placeable,ot=vt.offscreen);let X=it(vt?.placeable);if(!U&&this.prevPlacement){let yt=this.prevPlacement.variableOffsets[I.crossTileID];yt&&(this.variableOffsets[I.crossTileID]=yt,this.markUsedJustification(r,yt.anchor,I,X))}}}if(Lt=vt,U=Lt?.placeable,ot=Lt?.offscreen,I.useRuntimeCollisionCircles&&I.centerJustifiedTextSymbolIndex>=0){let it=r.text.placedSymbolArray.get(I.centerJustifiedTextSymbolIndex),rt=Kl(r.textSizeData,d,it),O=a.get("text-padding"),Tt=I.collisionCircleDiameter;Wt=this.collisionIndex.placeCollisionCircles(g,it,r.lineVertexArray,r.glyphOffsetArray,rt,o,l,i,w,p.predicate,Tt,O,n,z),Wt.circles.length&&Wt.collisionDetected&&!i&&ft("Collisions detected, but collision boxes are not shown"),U=_||Wt.circles.length>0&&!Wt.collisionDetected,ot&&(ot=Wt.offscreen)}if(A.iconFeatureIndex&&(qe=A.iconFeatureIndex),A.iconBox){let it=rt=>this.collisionIndex.placeCollisionBox(rt,y,u,R,o,w,v,s,p.predicate,z,b&&Pt?Pt:void 0,P,G,D);ee&&ee.placeable&&A.verticalIconBox?(kt=it(A.verticalIconBox),et=kt.placeable):(kt=it(A.iconBox),et=kt.placeable),ot&&(ot=kt.offscreen)}let Vt=f||I.numHorizontalGlyphVertices===0&&I.numVerticalGlyphVertices===0,He=m||I.numIconVertices===0;!Vt&&!He?et=U=et&&U:He?Vt||et&&(et=U):U=et&&U;let Ci=U&&Lt.placeable,Ui=et&&kt.placeable;if(Ci&&(ee&&ee.placeable&&ze?this.collisionIndex.insertCollisionBox(Lt.box,g,a.get("text-ignore-placement"),r.bucketInstanceId,ze,p.ID):this.collisionIndex.insertCollisionBox(Lt.box,g,a.get("text-ignore-placement"),r.bucketInstanceId,Pe,p.ID)),Ui&&this.collisionIndex.insertCollisionBox(kt.box,y,a.get("icon-ignore-placement"),r.bucketInstanceId,qe,p.ID),Wt&&U&&this.collisionIndex.insertCollisionCircles(Wt.circles,g,a.get("text-ignore-placement"),r.bucketInstanceId,Pe,p.ID),i&&this.storeCollisionData(r.bu
vendor: 19,748 bytes, lines 825-852
825cketInstanceId,L,A,Lt,kt,Wt),I.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");if(r.bucketInstanceId===0)throw Error("bucket.bucketInstanceId can't be 0");let di=(U||E)&&!Lt?.occluded,Z=(et||M)&&!kt?.occluded;this.placements[I.crossTileID]=new xv(di,Z,ot||r.justReloaded),e[I.crossTileID]=!0};if(T){if(t.symbolInstanceStart!==0)throw Error("bucket.bucketInstanceId should be 0");let I=r.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let A=I.length-1;A>=0;--A){let L=I[A];S(r.symbolInstances.get(L),r.collisionArrays[L],L)}}else for(let I=t.symbolInstanceStart;I<t.symbolInstanceEnd;I++)S(r.symbolInstances.get(I),r.collisionArrays[I],I);r.justReloaded=!1}storeCollisionData(t,e,i,r,a,n){if(i.textBox||i.iconBox){let s;this.collisionBoxArrays.has(t)?s=this.collisionBoxArrays.get(t):(s=new Map,this.collisionBoxArrays.set(t,s));let o;s.has(e)?o=s.get(e):(o={text:null,icon:null},s.set(e,o)),i.textBox&&(o.text=r.box),i.iconBox&&(o.icon=a.box)}if(n){let s=this.collisionCircleArrays[t];s===void 0&&(s=this.collisionCircleArrays[t]=[]);for(let o=0;o<n.circles.length;o+=4)s.push(n.circles[o+0]-100),s.push(n.circles[o+1]-100),s.push(n.circles[o+2]),s.push(+!!n.collisionDetected)}}markUsedJustification(t,e,i,r){let a={left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex},n;n=r===2?i.verticalPlacedTextSymbolIndex:a[nl(e)];let s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(let o of s)o>=0&&(n>=0&&o!==n?t.text.placedSymbolArray.get(o).crossTileID=0:t.text.placedSymbolArray.get(o).crossTileID=i.crossTileID)}markUsedOrientation(t,e,i){let r=e===1||e===3?e:0,a=e===2?e:0,n=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(let s of n)t.text.placedSymbolArray.get(s).placedOrientation=r;i.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;let r=e?e.symbolFadeChange(t):1,a=e?e.opacities:{},n=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(let o in this.placements){let l=this.placements[o],u=a[o];u?(this.opacities[o]=new Us(u,r,l.text,l.icon),i||(i=l.text!==u.text.placed),i||(i=l.icon!==u.icon.placed)):(this.opacities[o]=new Us(null,r,l.text,l.icon,l.skipFade),i||(i=l.text||l.icon))}for(let o in a){let l=a[o];if(!this.opacities[o]){let u=new Us(l,r,!1,!1);u.isHidden()||(this.opacities[o]=u,i||(i=l.text.placed),i||(i=l.icon.placed))}}for(let o in n)!this.variableOffsets[o]&&this.opacities[o]&&!this.opacities[o].isHidden()&&(this.variableOffsets[o]=n[o]);for(let o in s)!this.placedOrientations[o]&&this.opacities[o]&&!this.opacities[o].isHidden()&&(this.placedOrientations[o]=s[o]);if(e&&e.lastPlacementChangeTime===void 0)throw Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){let i={};for(let r of e){let a=r.getBucket(t);a&&r.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,e,i,r){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();let a=t.layers[0],n=a.layout,s=new Us(null,0,!1,!1,!0),o=n.get("text-allow-overlap"),l=n.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h=n.get("text-rotation-alignment")==="map",c=n.get("text-pitch-alignment")==="map",d=n.get("icon-text-fit")!=="none",p=new Us(null,0,o&&(l||!t.hasIconData()||n.get("icon-optional")),l&&(o||!t.hasTextData()||n.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);let f=(g,_,y)=>{for(let x=0;x<_/4;x++)g.opacityVertexArray.emplaceBack(y);g.hasVisibleVertices||(g.hasVisibleVertices=y!==Ns)},m=this.collisionBoxArrays.get(t.bucketInstanceId);for(let g=0;g<t.symbolInstances.length;g++){let _=t.symbolInstances.get(g),{numHorizontalGlyphVertices:y,numVerticalGlyphVertices:x,crossTileID:v}=_,w=i[v],b=this.opacities[v];w?b=s:b||(b=p,this.opacities[v]=b),i[v]=!0;let T=y>0||x>0,D=_.numIconVertices>0,E=this.placedOrientations[_.crossTileID],M=E===2,R=E===1||E===3;if(T){let P=Tv(b.text),S=M?Ns:P;f(t.text,y,S);let I=R?Ns:P;f(t.text,x,I);let A=b.text.isHidden(),L=[_.rightJustifiedTextSymbolIndex,_.centerJustifiedTextSymbolIndex,_.leftJustifiedTextSymbolIndex];for(let et of L)et>=0&&(t.text.placedSymbolArray.get(et).hidden=A||M?1:0);_.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(_.verticalPlacedTextSymbolIndex).hidden=A||R?1:0);let G=this.variableOffsets[_.crossTileID];G&&this.markUsedJustification(t,G.anchor,_,E);let U=this.placedOrientations[_.crossTileID];U&&(this.markUsedJustification(t,"left",_,U),this.markUsedOrientation(t,U,_))}if(D){let P=Tv(b.icon),S=!(d&&_.verticalPlacedIconSymbolIndex&&M);if(_.placedIconSymbolIndex>=0){let I=S?P:Ns;f(t.icon,_.numIconVertices,I),t.icon.placedSymbolArray.get(_.placedIconSymbolIndex).hidden=b.icon.isHidden()}if(_.verticalPlacedIconSymbolIndex>=0){let I=S?Ns:P;f(t.icon,_.numVerticalIconVertices,I),t.icon.placedSymbolArray.get(_.verticalPlacedIconSymbolIndex).hidden=b.icon.isHidden()}}let z=m?.has(g)?m.get(g):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let P=t.collisionArrays[g];if(P){let S=new C(0,0);if(P.textBox||P.verticalTextBox){let I=!0;if(u){let A=this.variableOffsets[v];A?(S=bv(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),h&&S._rotate(c?-this.transform.bearingInRadians:this.transform.bearingInRadians)):I=!1}if(P.textBox||P.verticalTextBox){let A;P.textBox&&(A=M),P.verticalTextBox&&(A=R),wv(t.textCollisionBox.collisionVertexArray,b.text.placed,!I||A,z.text,S.x,S.y)}}if(P.iconBox||P.verticalIconBox){let I=!(R||!P.verticalIconBox),A;P.iconBox&&(A=I),P.verticalIconBox&&(A=!I),wv(t.iconCollisionBox.collisionVertexArray,b.icon.placed,A,z.icon,d?S.x:0,d?S.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),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 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 Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],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,e){let i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}};function wv(t,e,i,r,a,n){(!r||r.length===0)&&(r=[0,0,0,0]);let s=r[0]-100,o=r[1]-100,l=r[2]-100,u=r[3]-100;t.emplaceBack(+!!e,+!!i,a||0,n||0,s,o),t.emplaceBack(+!!e,+!!i,a||0,n||0,l,o),t.emplaceBack(+!!e,+!!i,a||0,n||0,l,u),t.emplaceBack(+!!e,+!!i,a||0,n||0,s,u)}var u3=2**25,h3=2**24,c3=2**17,d3=2**16;function Tv(t){if(t.opacity===0&&!t.placed)return 0;if(t.opacity===1&&t.placed)return 4294967295;let e=+!!t.placed,i=Math.floor(t.opacity*127);return i*u3+e*h3+i*c3+e*d3+i*512+e*256+i*2+e}var Ns=0,p3=class{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,e,i,r,a){let n=this._bucketParts;for(;this._currentTileIndex<t.length;){let s=t[this._currentTileIndex];if(e.getBucketParts(n,r,s,this._sortAcrossTiles),this._currentTileIndex++,a())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort((s,o)=>s.sortKey-o.sortKey));this._currentPartIndex<n.length;){let s=n[this._currentPartIndex];if(e.placeLayerBucketPart(s,this._seenCrossTileIDs,i),this._currentPartIndex++,a())return!0}return!1}},f3=class{constructor(t,e,i,r,a,n,s,o){this.placement=new l3(t,e,n,s,o),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=a,this._done=!1}isDone(){return this._done}continuePlacement(t,e,i){let r=Ft(),a=()=>!this._forceFullPlacement&&Ft()-r>2;for(;this._currentPlacementIndex>=0;){let n=e[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if($d(n)&&n.layout&&(!n.minzoom||n.minzoom<=s)&&(!n.maxzoom||n.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new p3(n)),this._inProgressLayer.continuePlacement(i[n.source],this.placement,this._showCollisionBoxes,n,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}},Ev=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Qt=new Uint32Array(96),m3=class Vx{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[i,r]=new Uint8Array(e,0,2);if(i!==219)throw Error("Data does not appear to be in a KDBush format.");let a=r>>4;if(a!==1)throw Error(`Got v${a} data when expected v1.`);let n=Ev[r&15];if(!n)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Vx(o,s,n,void 0,e)}constructor(e,i=64,r=Float64Array,a=ArrayBuffer,n){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=Ev.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${r}.`);if(n)this.data=n,this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new a(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new r(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=i,new Uint32Array(h,4,1)[0]=e}}add(e,i){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=i,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Vp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,r,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:s,nodeSize:o}=this;Qt[0]=0,Qt[1]=n.length-1,Qt[2]=0;let l=3,u=[];for(;l>0;){let h=Qt[--l],c=Qt[--l],d=Qt[--l];if(c-d<=o){for(let g=d;g<=c;g++){let _=s[2*g],y=s[2*g+1];_>=e&&_<=r&&y>=i&&y<=a&&u.push(n[g])}continue}let p=d+c>>1,f=s[2*p],m=s[2*p+1];f>=e&&f<=r&&m>=i&&m<=a&&u.push(n[p]),(h===0?e<=f:i<=m)&&(Qt[l++]=d,Qt[l++]=p-1,Qt[l++]=1-h),(h===0?r>=f:a>=m)&&(Qt[l++]=p+1,Qt[l++]=c,Qt[l++]=1-h)}return u}within(e,i,r){let a=[];return this.withinInto(e,i,r,a),a}withinInto(e,i,r,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:s,nodeSize:o}=this;Qt[0]=0,Qt[1]=n.length-1,Qt[2]=0;let l=3,u=0,h=r*r;for(;l>0;){let c=Qt[--l],d=Qt[--l],p=Qt[--l];if(d-p<=o){for(let _=p;_<=d;_++)Sv(s[2*_],s[2*_+1],e,i)<=h&&(a[u++]=n[_]);continue}let f=p+d>>1,m=s[2*f],g=s[2*f+1];Sv(m,g,e,i)<=h&&(a[u++]=n[f]),(c===0?e-r<=m:i-r<=g)&&(Qt[l++]=p,Qt[l++]=f-1,Qt[l++]=1-c),(c===0?e+r>=m:i+r>=g)&&(Qt[l++]=f+1,Qt[l++]=d,Qt[l++]=1-c)}return u}};function Vp(t,e,i,r,a,n){if(a-r<=i)return;let s=r+a>>1;jx(t,e,s,r,a,n),Vp(t,e,i,r,s-1,1-n),Vp(t,e,i,s+1,a,1-n)}function jx(t,e,i,r,a,n){for(;a>r;){if(a-r>600){let u=a-r+1,h=i-r+1,c=Math.log(u),d=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*d*(u-d)/u)*(h-u/2<0?-1:1);jx(t,e,i,Math.max(r,Math.floor(i-h*d/u+p)),Math.min(a,Math.floor(i+(u-h)*d/u+p)),n)}let s=e[2*i+n],o=r,l=a;for($s(t,e,r,i),e[2*a+n]>s&&$s(t,e,r,a);o<l;){for($s(t,e,o,l),o++,l--;e[2*o+n]<s;)o++;for(;e[2*l+n]>s;)l--}e[2*r+n]===s?$s(t,e,r,l):(l++,$s(t,e,l,a)),l<=i&&(r=l+1),i<=l&&(a=l-1)}}function $s(t,e,i,r){pp(t,i,r),pp(e,2*i,2*r),pp(e,2*i+1,2*r+1)}function pp(t,e,i){let r=t[e];t[e]=t[i],t[i]=r}function Sv(t,e,i,r){let a=t-i,n=e-r;return a*a+n*n}var Gs=512/k/2,g3=class{constructor(t,e,i){this.tileID=t,this.bucketInstanceId=i,this._symbolsByKey={};let r=new Map;for(let a=0;a<e.length;a++){let n=e.get(a),s=n.key,o=r.get(s);o?o.push(n):r.set(s,[n])}for(let[a,n]of r){let s={positions:n.map(o=>({x:Math.floor(o.anchorX*Gs),y:Math.floor(o.anchorY*Gs)})),crossTileIDs:n.map(o=>o.crossTileID)};if(s.positions.length>128){let o=new m3(s.positions.length,16,Uint16Array);for(let{x:l,y:u}of s.positions)o.add(l,u);o.finish(),delete s.positions,s.index=o}this._symbolsByKey[a]=s}}getScaledCoordinates(t,e){let{x:i,y:r,z:a}=this.tileID.canonical,{x:n,y:s,z:o}=e.canonical,l=o-a,u=Gs/2**l,h=(n*k+t.anchorX)*u,c=(s*k+t.anchorY)*u,d=i*k*Gs,p=r*k*Gs;return{x:Math.floor(h-d),y:Math.floor(c-p)}}findMatches(t,e,i){let r=this.tileID.canonical.z<e.canonical.z?1:2**(this.tileID.canonical.z-e.canonical.z);for(let a=0;a<t.length;a++){let n=t.get(a);if(n.crossTileID)continue;let s=this._symbolsByKey[n.key];if(!s)continue;let o=this.getScaledCoordinates(n,e);s.index?this.findMatchesForIndexedEntry(s,n,o,r,i):s.positions&&this.findMatchesForNonIndexedEntry(s,n,o,r,i)}}findMatchesForIndexedEntry(t,e,i,r,a){let n=t.index.range(i.x-r,i.y-r,i.x+r,i.y+r),s=1/0;for(let o of n)o<s&&!a[t.crossTileIDs[o]]&&(s=o);if(s!==1/0){let o=t.crossTileIDs[s];a[o]=!0,e.crossTileID=o}}findMatchesForNonIndexedEntry(t,e,i,r,a){for(let n=0;n<t.positions.length;n++){let s=t.positions[n],o=t.crossTileIDs[n];if(Math.abs(s.x-i.x)<=r&&Math.abs(s.y-i.y)<=r&&!a[o]){a[o]=!0,e.crossTileID=o;break}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}},_3=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},y3=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let e=Math.round((t-this.lng)/360);if(e!==0)for(let i in this.indexes){let r=this.indexes[i],a={};for(let n in r){let s=r[n];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+e),a[s.tileID.key]=s}this.indexes[i]=a}this.lng=t}addBucket(t,e,i){var a,n;if(this.indexes[t.overscaledZ]?.[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let s=0;s<e.symbolInstances.length;s++){let o=e.symbolInstances.get(s);o.crossTileID=0}(a=this.usedCrossTileIDs)[n=t.overscaledZ]||(a[n]={});let r=this.usedCrossTileIDs[t.overscaledZ];for(let s in this.indexes){let o=this.indexes[s];if(Number(s)>t.overscaledZ)for(let l in o){let u=o[l];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,r)}else{let l=o[t.scaledTo(Number(s)).key];l&&l.findMatches(e.symbolInstances,t,r)}}for(let s=0;s<e.symbolInstances.length;s++){let o=e.symbolInstances.get(s);o.crossTileID||(o.crossTileID=i.generate(),r[o.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new g3(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(let i of e.getCrossTileIDsLists())for(let r of i)delete this.usedCrossTileIDs[t][r]}removeStaleBuckets(t){let e=!1;for(let i in this.indexes){let r=this.indexes[i];for(let a in r)t[r[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[a]),delete r[a],e=!0)}return e}},Ux=class{constructor(){this.layerIndexes={},this.crossTileIDs=new _3,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];r===void 0&&(r=this.layerIndexes[t.id]=new y3);let a=!1,n={};r.handleWrapJump(i);for(let s of e){let o=s.getBucket(t);t.id===o?.layerIds[0]&&(o.bucketInstanceId||(o.bucketInstanceId=(this.maxBucketInstanceId+=1,this.maxBucketInstanceId)),r.addBucket(s.tileID,o,this.crossTileIDs)&&(a=!0),n[o.bucketInstanceId]=!0)}return r.removeStaleBuckets(n)&&(a=!0),a}pruneUnusedLayers(t){let e={};for(let i of t)e[i]=!0;for(let i in this.layerIndexes)e[i]||delete this.layerIndexes[i]}},v3=`#ifdef GL_ES 826precision mediump float; 827#else 828#if !defined(lowp) 829#define lowp 830#endif 831#if !defined(mediump) 832#define mediump 833#endif 834#if !defined(highp) 835#define highp 836#endif 837#endif 838out highp vec4 fragColor;layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,x3=`#ifdef GL_ES 839precision highp float; 840#else 841#if !defined(lowp) 842#define lowp 843#endif 844#if !defined(mediump) 845#define mediump 846#endif 847#if !defined(highp) 848#define highp 849#endif 850#endif 851vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const uint packedOpacity) {return vec2(float(packedOpacity >> 1u)/127.0,float(packedOpacity & 1u));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 852);}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);
852return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c 853);} 854#ifdef TERRAIN3D 855uniform sampler2D u_terrain;uniform highp sampler2D u_depth;layout(std140) uniform TerrainUBO {highp mat4 u_terrain_matrix;highp vec4 u_terrain_unpack;highp float u_terrain_dim;highp float u_terrain_exaggeration;}; 856#endif 857const 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) { 858#ifdef TERRAIN3D 859highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); 860#else 861return 1.0; 862#endif 863}float calculate_visibility(vec4 pos) { 864#ifdef TERRAIN3D 865vec3 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; 866#else 867return 1.0; 868#endif 869}float ele(ivec2 pos) { 870#ifdef TERRAIN3D 871vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; 872#else 873return 0.0; 874#endif 875}float get_elevation(vec2 pos) { 876#ifdef TERRAIN3D 877#ifdef GLOBE 878if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} 879#endif 880vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.5;vec2 f=fract(coord);ivec2 c=ivec2(floor(coord));ivec2 hi=textureSize(u_terrain,0)-1;float tl=ele(clamp(c,ivec2(0),hi));float tr=ele(clamp(c+ivec2(1,0),ivec2(0),hi));float bl=ele(clamp(c+ivec2(0,1),ivec2(0),hi));float br=ele(clamp(c+ivec2(1,1),ivec2(0),hi));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; 881#else 882return 0.0; 883#endif 884}const float PI=3.141592653589793; 885#define PROJECTION_UBO 886layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,b3=`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity; 887#ifdef OVERDRAW_INSPECTOR 888fragColor=vec4(1.0); 889#endif 890}`,w3="layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}",T3=`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;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity; 891#ifdef OVERDRAW_INSPECTOR 892fragColor=vec4(1.0); 893#endif 894}`,E3="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;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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);}",S3=`in vec3 v_data;flat in float v_visibility; 895#pragma maplibre: define highp vec4 color 896#pragma maplibre: define mediump float radius 897#pragma maplibre: define lowp float blur 898#pragma maplibre: define lowp float opacity 899#pragma maplibre: define highp vec4 stroke_color 900#pragma maplibre: define mediump float stroke_width 901#pragma maplibre: define lowp float stroke_opacity 902void main() { 903#pragma maplibre: initialize highp vec4 color 904#pragma maplibre: initialize mediump float radius 905#pragma maplibre: initialize lowp float blur 906#pragma maplibre: initialize lowp float opacity 907#pragma maplibre: initialize highp vec4 stroke_color 908#pragma maplibre: initialize mediump float stroke_width 909#pragma maplibre: initialize lowp float stroke_opacity 910vec2 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
910/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;} 911#ifdef OVERDRAW_INSPECTOR 912fragColor=vec4(1.0); 913#endif 914}`,D3=`uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform vec2 u_translate;layout(location=0) in ivec2 a_pos;out vec3 v_data;flat out float v_visibility; 915#pragma maplibre: define highp vec4 color 916#pragma maplibre: define mediump float radius 917#pragma maplibre: define lowp float blur 918#pragma maplibre: define lowp float opacity 919#pragma maplibre: define highp vec4 stroke_color 920#pragma maplibre: define mediump float stroke_width 921#pragma maplibre: define lowp float stroke_opacity 922void main(void) { 923#pragma maplibre: initialize highp vec4 color 924#pragma maplibre: initialize mediump float radius 925#pragma maplibre: initialize lowp float blur 926#pragma maplibre: initialize lowp float opacity 927#pragma maplibre: initialize highp vec4 stroke_color 928#pragma maplibre: initialize mediump float stroke_width 929#pragma maplibre: initialize lowp float stroke_opacity 930ivec2 pos_raw=a_pos+32768;vec2 extrude=vec2(pos_raw & 7)/7.0*2.0-1.0;vec2 circle_center=vec2(pos_raw >> 3)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { 931#ifdef GLOBE 932vec3 center_vector=projectToSphere(circle_center); 933#endif 934float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { 935#ifdef GLOBE 936vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); 937#else 938vec4 projected_center=projectTileWithElevation(circle_center,ele); 939#endif 940corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} 941#ifdef GLOBE 942vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); 943#else 944gl_Position=projectTileWithElevation(corner_position,ele); 945#endif 946} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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);}`,Dv="void main() {fragColor=vec4(1.0);}",rr={prelude:bt(v3,x3),projectionMercator:bt(` 947void clipAntimeridian() {}`,"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:bt("in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian !=0 && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}",`#define GLOBE_RADIUS 6371008.8 948#ifndef PROJECTION_UBO 949uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix; 950#endif 951out highp float v_projection_tile_x;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos 952);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float t=exp(PI-(mercator_pos_y*PI*2.0));return (2.0*t)/(t*t+1.0);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;float spherical_x=mercator_pos.x*PI*2.0+PI;float t=exp(PI-(mercator_pos.y*PI*2.0));
952float t2=t*t;float denom=t2+1.0;float sin_sy=(t2-1.0)/denom;float cos_sy=(2.0*t)/denom;vec3 pos=vec3(sin(spherical_x)*cos_sy,sin_sy,cos(spherical_x)*cos_sy 953);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:bt(b3,w3),backgroundPattern:bt(T3,E3),circle:bt(S3,D3),clippingMask:bt(Dv,"layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:bt(`uniform highp float u_intensity;in vec2 v_extrude; 954#pragma maplibre: define highp float weight 955#define GAUSS_COEF 0.3989422804014327 956void main() { 957#pragma maplibre: initialize highp float weight 958float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); 959#ifdef OVERDRAW_INSPECTOR 960fragColor=vec4(1.0); 961#endif 962}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;layout(location=0) in ivec2 a_pos;out vec2 v_extrude; 963#pragma maplibre: define highp float weight 964#pragma maplibre: define mediump float radius 965const highp float ZERO=1.0/255.0/16.0; 966#define GAUSS_COEF 0.3989422804014327 967void main(void) { 968#pragma maplibre: initialize highp float weight 969#pragma maplibre: initialize mediump float radius 970ivec2 pos_raw=a_pos+32768;vec2 unscaled_extrude=vec2(pos_raw & 7)/7.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;vec2 circle_center=vec2(pos_raw >> 3); 971#ifdef GLOBE 972vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); 973#else 974gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); 975#endif 976}`),heatmapTexture:bt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; 977#ifdef OVERDRAW_INSPECTOR 978fragColor=vec4(0.0); 979#endif 980}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world_size,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:bt("flat in float v_placed;flat in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","layout(location=0) in vec2 a_anchor_pos;layout(location=1) in vec2 a_placed;layout(location=2) in vec2 a_box_real;flat out float v_placed;flat out float v_notUsed;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:bt("flat in float v_radius;in vec2 v_extrude;flat in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}","layout(location=0) in vec2 a_pos;layout(location=1) in float a_radius;layout(location=2) in vec2 a_flags;flat out float v_radius;out vec2 v_extrude;flat out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:bt(`#ifdef GL_ES 981precision highp float; 982#endif 983uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {vec4 data=texelFetch(u_elevation_stops,ivec2(stop,0),0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else 984{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); 985#ifdef OVERDRAW_INSPECTOR 986fragColor=vec4(1.0); 987#endif 988}`,"uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=2.0/u_dimension;float scale=(u_dimension.x-4.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:bt("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","layout(location=0) in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:bt(Dv,`layout(location=0) in vec2 a_pos;void main() { 989#ifdef GLOBE 990gl_Position=projectTileFor3D(a_pos,0.0); 991#else 992gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); 993#endif 994}`),fill:bt(`#pragma maplibre: define highp vec4 color 995#pragma maplibre: define lowp float opacity 996void main() { 997#pragma maplibre: initialize highp vec4 color 998#pragma maplibre: initialize lowp float opacity 999fragColor=color*opacity; 1000#ifdef OVERDRAW_INSPECTOR 1001fragColor=vec4(1.0); 1002#endif 1003}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos; 1004#pragma maplibre: define highp vec4 color 1005#pragma maplibre: define lowp float opacity 1006void main() { 1007#pragma maplibre: initialize highp vec4 color 1008#pragma maplibre: initialize lowp float opacity 1009if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:bt(`in vec2 v_pos; 1010#ifdef GLOBE 1011in float v_depth; 1012#endif 1013#pragma maplibre: define highp vec4 outline_color 1014#pragma maplibre: define lowp float opacity 1015void main() { 1016#pragma maplibre: initialize highp vec4 outline_color 1017#pragma maplibre: initialize lowp float opacity 1018float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); 1019#ifdef GLOBE 1020if (v_depth > 1.0) {discard;} 1021#endif 1022#ifdef OVERDRAW_INSPECTOR 1023fragColor=vec4(1.0); 1024#endif 1025}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos; 1026#ifdef GLOBE 1027out float v_depth; 1028#endif 1029#pragma maplibre: define highp vec4 outline_color 1030#pragma maplibre: define lowp float opacity 1031void main() { 1032#pragma maplibre: initialize highp vec4 outline_color 1033#pragma maplibre: initialize lowp float opacity 1034if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world_size; 1035#ifdef GLOBE 1036v_depth=gl_Position.z/gl_Position.w; 1037#endif 1038}`),fillOutlinePattern:bt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;uniform bool u_sdf_pattern;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; 1039#ifdef GLOBE 1040in float v_depth; 1041#endif 1042#pragma maplibre: define lowp float opacity 1043#pragma maplibre: define highp vec4 color 1044#pragma maplibre: define lowp vec4 pattern_from 1045#pragma maplibre: define lowp vec4 pattern_to 1046void main() { 1047#pragma maplibre: initialize lowp float opacity 1048#pragma maplibre: initialize highp vec4 color 1049#pragma maplibre: initialize mediump vec4 pattern_from 1050#pragma maplibre: initialize mediump vec4 pattern_to 1051vec2 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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*alpha*opacity;} else {fragColor=mix(color1,color2,u_fade)*alpha*opacity;} 1052#ifdef GLOBE 1053if (v_depth > 1.0) {discard;} 1054#endif 1055#ifdef OVERDRAW_INSPECTOR 1056fragColor=vec4(1.0); 1057#endif 1058}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; 1059#ifdef GLOBE 1060out float v_depth; 1061#endif 1062#pragma maplibre: define lowp float opacity 1063#pragma maplibre: define highp vec4 color 1064#pragma maplibre: define lowp vec4 pattern_from 1065#pragma maplibre: define lowp vec4 pattern_to 1066#pragma maplibre: define lowp float pixel_ratio_from 1067#pragma maplibre: define lowp float pixel_ratio_to 1068void main() { 1069#pragma maplibre: initialize lowp float opacity 1070#pragma maplibre: initialize highp vec4 color 1071#pragma maplibre: initialize mediump vec4 pattern_from 1072#pragma maplibre: initialize mediump vec4 pattern_to 1073#pragma maplibre: initialize lowp float pixel_ratio_from 1074#pragma maplibre: initialize lowp float pixel_ratio_to 1075if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 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=projectTile(a_pos+u_fill_translate,a_pos);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_size; 1076#ifdef GLOBE 1077v_depth=gl_Position.z/gl_Position.w; 1078#endif 1079}`),fillPattern:bt(`#ifdef GL_ES 1080precision highp float; 1081#endif 1082uniform vec2 u_texsize;uniform float u_fade;uniform bool u_sdf_pattern;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; 1083#pragma maplibre: define lowp float opacity 1084#pragma maplibre: define highp vec4 color 1085#pragma maplibre: define lowp vec4 pattern_from 1086#pragma maplibre: define lowp vec4 pattern_to 1087void main() { 1088#pragma maplibre: initialize lowp float opacity 1089#pragma maplibre: initialize highp vec4 color 1090#pragma maplibre: initialize mediump vec4 pattern_from 1091#pragma maplibre: initialize mediump vec4 pattern_to 1092vec2 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=texture(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=texture(u_image,pos2);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*opacity;} else {fragColor=mix(color1,color2,u_fade)*opacity;} 1093#ifdef OVERDRAW_INSPECTOR 1094fragColor=vec4(1.0); 1095#endif 1096}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; 1097#pragma maplibre: define lowp float opacity 1098#pragma maplibre: define highp vec4 color 1099#pragma maplibre: define lowp vec4 pattern_from 1100#pragma maplibre: define lowp vec4 pattern_to 1101#pragma maplibre: define lowp float pixel_ratio_from 1102#pragma maplibre: define lowp float pixel_ratio_to 1103void main() { 1104#pragma maplibre: initialize lowp float opacity 1105#pragma maplibre: initialize highp vec4 color 1106#pragma maplibre: initialize mediump vec4 pattern_from 1107#pragma maplibre: initialize mediump vec4 pattern_to 1108#pragma maplibre: initialize lowp float pixel_ratio_from 1109#pragma maplibre: initialize lowp float pixel_ratio_to 1110if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 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=projectTile(a_pos+u_fill_translate,a_pos);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:bt(`in vec4 v_color;void main() {fragColor=v_color; 1111#ifdef OVERDRAW_INSPECTOR 1112fragColor=vec4(1.0); 1113#endif 1114}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform l
1114owp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; 1115#ifdef TERRAIN3D 1116layout(location=2) in vec2 a_centroid; 1117#endif 1118out vec4 v_color; 1119#pragma maplibre: define highp float base 1120#pragma maplibre: define highp float height 1121#pragma maplibre: define highp vec4 color 1122void main() { 1123#pragma maplibre: initialize highp float base 1124#pragma maplibre: initialize highp float height 1125#pragma maplibre: initialize highp vec4 color 1126vec3 normal=vec3(a_normal_ed.xyz);float gradient_base=max(0.0,base);float gradient_height=max(0.0,height); 1127#ifdef TERRAIN3D 1128float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 1129#else 1130float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 1131#endif 1132base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 1133#ifdef GLOBE 1134vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 1135#else 1136gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 1137#endif 1138float 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); 1139#ifdef GLOBE 1140mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); 1141#endif 1142directional=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+gradient_base)*pow(gradient_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:bt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; 1143#pragma maplibre: define lowp float base 1144#pragma maplibre: define lowp float height 1145#pragma maplibre: define lowp vec4 pattern_from 1146#pragma maplibre: define lowp vec4 pattern_to 1147#pragma maplibre: define lowp float pixel_ratio_from 1148#pragma maplibre: define lowp float pixel_ratio_to 1149void main() { 1150#pragma maplibre: initialize lowp float base 1151#pragma maplibre: initialize lowp float height 1152#pragma maplibre: initialize mediump vec4 pattern_from 1153#pragma maplibre: initialize mediump vec4 pattern_to 1154#pragma maplibre: initialize lowp float pixel_ratio_from 1155#pragma maplibre: initialize lowp float pixel_ratio_to 1156vec2 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; 1157#ifdef OVERDRAW_INSPECTOR 1158fragColor=vec4(1.0); 1159#endif 1160}`,`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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; 1161#ifdef TERRAIN3D 1162layout(location=2) in vec2 a_centroid; 1163#endif 1164#ifdef GLOBE 1165out vec3 v_sphere_pos; 1166#endif 1167out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; 1168#pragma maplibre: define lowp float base 1169#pragma maplibre: define lowp float height 1170#pragma maplibre: define lowp vec4 pattern_from 1171#pragma maplibre: define lowp vec4 pattern_to 1172#pragma maplibre: define lowp float pixel_ratio_from 1173#pragma maplibre: define lowp float pixel_ratio_to 1174void main() { 1175#pragma maplibre: initialize lowp float base 1176#pragma maplibre: initialize lowp float height 1177#pragma maplibre: initialize mediump vec4 pattern_from 1178#pragma maplibre: initialize mediump vec4 pattern_to 1179#pragma maplibre: initialize lowp float pixel_ratio_from 1180#pragma maplibre: initialize lowp float pixel_ratio_to 1181vec2 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=vec3(a_normal_ed.xyz);float edgedistance=float(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;float gradient_base=max(0.0,base);float gradient_height=max(0.0,height); 1182#ifdef TERRAIN3D 1183float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); 1184#else 1185float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; 1186#endif 1187base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; 1188#ifdef GLOBE 1189vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); 1190#else 1191gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); 1192#endif 1193vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384 1194? a_pos 1195: vec2(edgedistance,elevation*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+gradient_base)*pow(gradient_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:bt(`#ifdef GL_ES 1196precision highp float; 1197#endif 1198uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(ivec2 texel) {vec4 data=texelFetch(u_image,texel,0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {ivec2 pos=ivec2(gl_FragCoord.xy)+ivec2(1);float tileSize=u_dimension.x-4.0;float a=getElevation(pos+ivec2(-1,-1));float b=getElevation(pos+ivec2(0,-1));float c=getElevation(pos+ivec2(1,-1));float d=getElevation(pos+ivec2(-1,0));float e=getElevation(pos);float f=getElevation(pos+ivec2(1,0));float g=getElevation(pos+ivec2(-1,1));float h=getElevation(pos+ivec2(0,1));float i=getElevation(pos+ivec2(1,1));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))*tileSize/p
1198ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); 1199#ifdef OVERDRAW_INSPECTOR 1200fragColor=vec4(1.0); 1201#endif 1202}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;layout(location=1) in vec2 a_texture_pos;out 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:bt(`uniform sampler2D u_image;in highp vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; 1203#define PI 3.141592653589793 1204#define STANDARD 0 1205#define COMBINED 1 1206#define IGOR 2 1207#define MULTIDIRECTIONAL 3 1208#define BASIC 4 1209float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float 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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else 1210{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else 1211{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {highp vec2 size=vec2(textureSize(u_image,0));highp vec2 texturePos=(v_pos*(size-2.0)+1.0)/size;vec4 pixel=texture(u_image,texturePos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} 1212#ifdef OVERDRAW_INSPECTOR 1213fragColor=vec4(1.0); 1214#endif 1215}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:bt(`flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; 1216#ifdef GLOBE 1217in float v_depth; 1218#endif 1219#pragma maplibre: define highp vec4 color 1220#pragma maplibre: define lowp float blur 1221#pragma maplibre: define lowp float opacity 1222void main() { 1223#pragma maplibre: initialize highp vec4 color 1224#pragma maplibre: initialize lowp float blur 1225#pragma maplibre: initialize lowp float opacity 1226clipAntimeridian();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);fragColor=color*(alpha*opacity); 1227#ifdef GLOBE 1228if (v_depth > 1.0) {discard;} 1229#endif 1230#ifdef OVERDRAW_INSPECTOR 1231fragColor=vec4(1.0); 1232#endif 1233}`,` 1234#define scale 0.015873016 1235layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; 1236#ifdef GLOBE 1237out float v_depth; 1238#endif 1239#pragma maplibre: define highp vec4 color 1240#pragma maplibre: define lowp float blur 1241#pragma maplibre: define lowp float opacity 1242#pragma maplibre: define mediump float gapwidth 1243#pragma maplibre: define lowp float offset 1244#pragma maplibre: define mediump float width 1245void main() { 1246#pragma maplibre: initialize highp vec4 color 1247#pragma maplibre: initialize lowp float blur 1248#pragma maplibre: initialize lowp float opacity 1249#pragma maplibre: initialize mediump float gapwidth 1250#pragma maplibre: initialize lowp float offset 1251#pragma maplibre: initialize mediump float width 1252if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);v_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*2.0;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);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);
1252float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 1253#ifdef GLOBE 1254v_depth=gl_Position.z/gl_Position.w; 1255#endif 1256#ifdef TERRAIN3D 1257v_gamma_scale=1.0; 1258#else 1259float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 1260#endif 1261v_width2=vec2(outset,inset);}`),lineGradient:bt(`uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; 1262#ifdef GLOBE 1263in float v_depth; 1264#endif 1265#pragma maplibre: define lowp float blur 1266#pragma maplibre: define lowp float opacity 1267void main() { 1268#pragma maplibre: initialize lowp float blur 1269#pragma maplibre: initialize lowp float opacity 1270clipAntimeridian();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);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); 1271#ifdef GLOBE 1272if (v_depth > 1.0) {discard;} 1273#endif 1274#ifdef OVERDRAW_INSPECTOR 1275fragColor=vec4(1.0); 1276#endif 1277}`,` 1278#define scale 0.015873016 1279layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; 1280#ifdef GLOBE 1281out float v_depth; 1282#endif 1283#pragma maplibre: define lowp float blur 1284#pragma maplibre: define lowp float opacity 1285#pragma maplibre: define mediump float gapwidth 1286#pragma maplibre: define lowp float offset 1287#pragma maplibre: define mediump float width 1288void main() { 1289#pragma maplibre: initialize lowp float blur 1290#pragma maplibre: initialize lowp float opacity 1291#pragma maplibre: initialize mediump float gapwidth 1292#pragma maplibre: initialize lowp float offset 1293#pragma maplibre: initialize mediump float width 1294if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);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=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 1295#ifdef GLOBE 1296v_depth=gl_Position.z/gl_Position.w; 1297#endif 1298#ifdef TERRAIN3D 1299v_gamma_scale=1.0; 1300#else 1301float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 1302#endif 1303v_width2=vec2(outset,inset);}`),linePattern:bt(`#ifdef GL_ES 1304precision highp float; 1305#endif 1306uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width; 1307#ifdef GLOBE 1308in float v_depth; 1309#endif 1310#pragma maplibre: define lowp vec4 pattern_from 1311#pragma maplibre: define lowp vec4 pattern_to 1312#pragma maplibre: define lowp float pixel_ratio_from 1313#pragma maplibre: define lowp float pixel_ratio_to 1314#pragma maplibre: define lowp float blur 1315#pragma maplibre: define lowp float opacity 1316void main() { 1317#pragma maplibre: initialize mediump vec4 pattern_from 1318#pragma maplibre: initialize mediump vec4 pattern_to 1319#pragma maplibre: initialize lowp float pixel_ratio_from 1320#pragma maplibre: initialize lowp float pixel_ratio_to 1321#pragma maplibre: initialize lowp float blur 1322#pragma maplibre: initialize lowp float opacity 1323clipAntimeridian();vec2 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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; 1324#ifdef GLOBE 1325if (v_depth > 1.0) {discard;} 1326#endif 1327#ifdef OVERDRAW_INSPECTOR 1328fragColor=vec4(1.0); 1329#endif 1330}`,` 1331#define scale 0.015873016 1332#define LINE_DISTANCE_SCALE 2.0 1333layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width; 1334#ifdef GLOBE 1335out float v_depth; 1336#endif 1337#pragma maplibre: define lowp float blur 1338#pragma maplibre: define lowp float opacity 1339#pragma maplibre: define lowp float offset 1340#pragma maplibre: define mediump float gapwidth 1341#pragma maplibre: define mediump float width 1342#pragma maplibre: define lowp float floorwidth 1343#pragma maplibre: define lowp vec4 pattern_from 1344#pragma maplibre: define lowp vec4 pattern_to 1345#pragma maplibre: define lowp float pixel_ratio_from 1346#pragma maplibre: define lowp float pixel_ratio_to 1347void main() { 1348#pragma maplibre: initialize lowp float blur 1349#pragma maplibre: initialize lowp float opacity 1350#pragma maplibre: initialize lowp float offset 1351#pragma maplibre: initialize mediump float gapwidth 1352#pragma maplibre: initialize mediump float width 1353#pragma maplibre: initialize lowp float floorwidth 1354#pragma maplibre: initialize mediump vec4 pattern_from 1355#pragma maplibre: initialize mediump vec4 pattern_to 1356#pragma maplibre: initialize lowp float pixel_ratio_from 1357#pragma maplibre: initialize lowp float pixel_ratio_to 1358if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);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);
1358float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 1359#ifdef GLOBE 1360v_depth=gl_Position.z/gl_Position.w; 1361#endif 1362#ifdef TERRAIN3D 1363v_gamma_scale=1.0; 1364#else 1365float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 1366#endif 1367v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:bt(`uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; 1368#ifdef GLOBE 1369in float v_depth; 1370#endif 1371#pragma maplibre: define highp vec4 color 1372#pragma maplibre: define lowp float blur 1373#pragma maplibre: define lowp float opacity 1374#pragma maplibre: define mediump float width 1375#pragma maplibre: define lowp float floorwidth 1376#pragma maplibre: define mediump vec4 dasharray_from 1377#pragma maplibre: define mediump vec4 dasharray_to 1378void main() { 1379#pragma maplibre: initialize highp vec4 color 1380#pragma maplibre: initialize lowp float blur 1381#pragma maplibre: initialize lowp float opacity 1382#pragma maplibre: initialize mediump float width 1383#pragma maplibre: initialize lowp float floorwidth 1384#pragma maplibre: initialize mediump vec4 dasharray_from 1385#pragma maplibre: initialize mediump vec4 dasharray_to 1386clipAntimeridian();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 sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
1386float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); 1387#ifdef GLOBE 1388if (v_depth > 1.0) {discard;} 1389#endif 1390#ifdef OVERDRAW_INSPECTOR 1391fragColor=vec4(1.0); 1392#endif 1393}`,` 1394#define scale 0.015873016 1395#define LINE_DISTANCE_SCALE 2.0 1396layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; 1397#ifdef GLOBE 1398out float v_depth; 1399#endif 1400#pragma maplibre: define highp vec4 color 1401#pragma maplibre: define lowp float blur 1402#pragma maplibre: define lowp float opacity 1403#pragma maplibre: define mediump float gapwidth 1404#pragma maplibre: define lowp float offset 1405#pragma maplibre: define mediump float width 1406#pragma maplibre: define lowp float floorwidth 1407#pragma maplibre: define mediump vec4 dasharray_from 1408#pragma maplibre: define mediump vec4 dasharray_to 1409void main() { 1410#pragma maplibre: initialize highp vec4 color 1411#pragma maplibre: initialize lowp float blur 1412#pragma maplibre: initialize lowp float opacity 1413#pragma maplibre: initialize mediump float gapwidth 1414#pragma maplibre: initialize lowp float offset 1415#pragma maplibre: initialize mediump float width 1416#pragma maplibre: initialize lowp float floorwidth 1417#pragma maplibre: initialize mediump vec4 dasharray_from 1418#pragma maplibre: initialize mediump vec4 dasharray_to 1419if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 1420#ifdef GLOBE 1421v_depth=gl_Position.z/gl_Position.w; 1422#endif 1423#ifdef TERRAIN3D 1424v_gamma_scale=1.0; 1425#else 1426float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 1427#endif 1428float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:bt(`uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; 1429#ifdef GLOBE 1430in float v_depth; 1431#endif 1432#pragma maplibre: define lowp float blur 1433#pragma maplibre: define lowp float opacity 1434#pragma maplibre: define mediump float width 1435#pragma maplibre: define lowp float floorwidth 1436#pragma maplibre: define mediump vec4 dasharray_from 1437#pragma maplibre: define mediump vec4 dasharray_to 1438void main() { 1439#pragma maplibre: initialize lowp float blur 1440#pragma maplibre: initialize lowp float opacity 1441#pragma maplibre: initialize mediump float width 1442#pragma maplibre: initialize lowp float floorwidth 1443#pragma maplibre: initialize mediump vec4 dasharray_from 1444#pragma maplibre: initialize mediump vec4 dasharray_to 1445clipAntimeridian();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);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
1445float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); 1446#ifdef GLOBE 1447if (v_depth > 1.0) {discard;} 1448#endif 1449#ifdef OVERDRAW_INSPECTOR 1450fragColor=vec4(1.0); 1451#endif 1452}`,` 1453#define scale 0.015873016 1454#define LINE_DISTANCE_SCALE 2.0 1455layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; 1456#ifdef GLOBE 1457out float v_depth; 1458#endif 1459#pragma maplibre: define lowp float blur 1460#pragma maplibre: define lowp float opacity 1461#pragma maplibre: define mediump float gapwidth 1462#pragma maplibre: define lowp float offset 1463#pragma maplibre: define mediump float width 1464#pragma maplibre: define lowp float floorwidth 1465#pragma maplibre: define mediump vec4 dasharray_from 1466#pragma maplibre: define mediump vec4 dasharray_to 1467void main() { 1468#pragma maplibre: initialize lowp float blur 1469#pragma maplibre: initialize lowp float opacity 1470#pragma maplibre: initialize mediump float gapwidth 1471#pragma maplibre: initialize lowp float offset 1472#pragma maplibre: initialize mediump float width 1473#pragma maplibre: initialize lowp float floorwidth 1474#pragma maplibre: initialize mediump vec4 dasharray_from 1475#pragma maplibre: initialize mediump vec4 dasharray_to 1476if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; 1477#ifdef GLOBE 1478v_depth=gl_Position.z/gl_Position.w; 1479#endif 1480#ifdef TERRAIN3D 1481v_gamma_scale=1.0; 1482#else 1483float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; 1484#endif 1485float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),layerOpacity:bt(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity; 1486#ifdef OVERDRAW_INSPECTOR 1487fragColor=vec4(0.0); 1488#endif 1489}`,"layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos.x*2.0-1.0,1.0-a_pos.y*2.0,0.0,1.0);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),raster:bt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec3 v_pos0;in vec3 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=texture(u_image0,v_pos0.xy/v_pos0.z);vec4 color1=texture(u_image1,v_pos1.xy/v_pos1.z);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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); 1490#ifdef OVERDRAW_INSPECTOR 1491fragColor=vec4(1.0); 1492#endif 1493}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec3 u_image_warp;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;layout(location=0) in vec2 a_pos;out vec3 v_pos0;out vec3 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 topLeft=u_coords_top.xy;vec2 topRight=u_coords_top.zw;vec2 bottomLeft=u_coords_bottom.xy;vec2 bottomRight=u_coords_bottom.zw;
1493vec2 bilinearPos=mix(mix(topLeft,topRight,fractionalPos.x),mix(bottomLeft,bottomRight,fractionalPos.x),fractionalPos.y);float denominator=dot(u_image_warp.xy,fractionalPos)+1.0;vec2 acrossTop=topRight-topLeft+u_image_warp.x*topRight;vec2 downLeft=bottomLeft-topLeft+u_image_warp.y*bottomLeft;vec2 projectivePos=(acrossTop*fractionalPos.x+downLeft*fractionalPos.y+topLeft)/denominator;vec2 position=mix(projectivePos,bilinearPos,u_image_warp.z);gl_Position=projectTile(position,position);vec2 texturePos=((fractionalPos-0.5)/u_buffer_scale)+0.5; 1494#ifdef GLOBE 1495if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;} 1496#endif 1497float perspectiveRatio=mix(1.0/denominator,1.0,u_image_warp.z);v_pos0=vec3(texturePos*perspectiveRatio,perspectiveRatio);vec2 parentPos=(texturePos*u_scale_parent)+u_tl_parent;v_pos1=vec3(parentPos*perspectiveRatio,perspectiveRatio);}`),symbolIcon:bt(`uniform sampler2D u_texture;in vec2 v_tex;flat in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity; 1498#ifdef OVERDRAW_INSPECTOR 1499fragColor=vec4(1.0); 1500#endif 1501}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;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 bool u_rotate_symbol;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;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_tex;flat out float v_total_opacity; 1502#pragma maplibre: define lowp float opacity 1503void main() { 1504#pragma maplibre: initialize lowp float opacity 1505vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);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);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1506camera_to_anchor_distance/u_camera_to_center_distance : 1507u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {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; 1508#ifdef GLOBE 1509if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 1510#endif 1511vec4 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;}`),symbolSDF:bt(`#define SDF_PX 8.0 1512uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; 1513#pragma maplibre: define highp vec4 fill_color 1514#pragma maplibre: define highp vec4 halo_color 1515#pragma maplibre: define lowp float halo_width 1516#pragma maplibre: define lowp float halo_blur 1517void main() { 1518#pragma maplibre: initialize highp vec4 fill_color 1519#pragma maplibre: initialize highp vec4 halo_color 1520#pragma maplibre: initialize lowp float halo_width 1521#pragma maplibre: initialize lowp float halo_blur 1522float 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 total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;} 1523#ifdef OVERDRAW_INSPECTOR 1524fragColor=vec4(1.0); 1525#endif 1526}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;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_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 bool u_rotate_symbol;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_data0;out vec3 v_data1; 1527#pragma maplibre: define highp vec4 fill_color 1528#pragma maplibre: define highp vec4 halo_color 1529#pragma maplibre: define lowp float opacity 1530#pragma maplibre: define lowp float halo_width 1531#pragma maplibre: define lowp float halo_blur 1532void main() { 1533#pragma maplibre: initialize highp vec4 fill_color 1534#pragma maplibre: initialize highp vec4 halo_color 1535#pragma maplibre: initialize lowp float opacity 1536#pragma maplibre: initialize lowp float halo_width 1537#pragma maplibre: initialize lowp float halo_blur 1538vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);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);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1539camera_to_anchor_distance/u_camera_to_center_distance : 1540u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {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; 1541#ifdef GLOBE 1542if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 1543#endif 1544vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,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;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:bt(`#define SDF_PX 8.0 1545#define SDF 1.0 1546#define ICON 0.0 1547uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf; 1548#pragma maplibre: define highp vec4 fill_color 1549#pragma maplibre: define highp vec4 halo_color 1550#pragma maplibre: define lowp float halo_width 1551#pragma maplibre: define lowp float halo_blur 1552void main() { 1553#pragma maplibre: initialize highp vec4 fill_color 1554#pragma maplibre: initialize highp vec4 halo_color 1555#pragma maplibre: initialize lowp float halo_width 1556#pragma maplibre: initialize lowp float halo_blur 1557float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;
1557fragColor=texture(u_texture_icon,tex_icon)*total_opacity; 1558#ifdef OVERDRAW_INSPECTOR 1559fragColor=vec4(1.0); 1560#endif 1561return;}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;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;} 1562#ifdef OVERDRAW_INSPECTOR 1563fragColor=vec4(1.0); 1564#endif 1565}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec3 a_projected_pos;layout(location=3) in uint a_fade_opacity;layout(location=4) in float a_height_offset;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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;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;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec4 v_data0;out vec3 v_data1;flat out float v_is_sdf; 1566#pragma maplibre: define highp vec4 fill_color 1567#pragma maplibre: define highp vec4 halo_color 1568#pragma maplibre: define lowp float opacity 1569#pragma maplibre: define lowp float halo_width 1570#pragma maplibre: define lowp float halo_blur 1571void main() { 1572#pragma maplibre: initialize highp vec4 fill_color 1573#pragma maplibre: initialize highp vec4 halo_color 1574#pragma maplibre: initialize lowp float opacity 1575#pragma maplibre: initialize lowp float halo_width 1576#pragma maplibre: initialize lowp float halo_blur 1577vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);float is_sdf=float(a_data.z & 1u);float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);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);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? 1578camera_to_anchor_distance/u_camera_to_center_distance : 1579u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {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; 1580#ifdef GLOBE 1581if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} 1582#endif 1583vec4 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;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec3(gamma_scale,size,total_opacity);v_is_sdf=is_sdf;}`),terrain:bt("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;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in 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=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && 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);
1583float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","layout(location=0) in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:bt("in 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() {fragColor=pack(v_depth);}","layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out 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=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),atmosphere:bt(`#ifdef GL_ES 1584precision highp float; 1585#endif 1586in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 1587);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:bt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;in vec3 v_view_direction;const float ATMOSPHERE_HEIGHT_TO_GLOBE_RADIUS=100000.0/6371000.0;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;float opacity=1.0;if (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,((angle_to_globe_center-horizon_angle)*u_camera_to_center_distance+1.0)*u_device_pixel_ratio,u_sky_blend);float closest_approach=max(dot(ray,u_globe_position),0.0);
1587float lowest_altitude=sqrt(max(globe_distance*globe_distance-closest_approach*closest_approach,0.0))-u_globe_radius;float atmosphere_height=u_globe_radius*ATMOSPHERE_HEIGHT_TO_GLOBE_RADIUS;float inside_atmosphere=1.0-smoothstep(atmosphere_height,10.0*atmosphere_height,globe_distance-u_globe_radius);float through_atmosphere=1.0-smoothstep(0.0,atmosphere_height,lowest_altitude);opacity=inside_atmosphere*through_atmosphere*(1.0-u_atmosphere_blend);}if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor*=mix(1.0,opacity,u_sky_blend);}","layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}")};function bt(t,e){let i=/#pragma maplibre: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/in ([\w]+) ([\w]+)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=n?n.concat(a):a,o=r?r.length:0,l={};return t=t.replace(i,(u,h,c,d,p)=>(l[p]=!0,h==="define"?` 1588#ifndef HAS_UNIFORM_u_${p} 1589in ${c} ${d} ${p}; 1590#else 1591uniform ${c} ${d} u_${p}; 1592#endif 1593`:` 1594#ifdef HAS_UNIFORM_u_${p} 1595 ${c} ${d} ${p} = u_${p}; 1596#endif 1597`)),e=e.replace(i,(u,h,c,d,p)=>{let f=d==="float"?"vec2":"vec4",m=p.match(/color/)?"color":f;return l[p]?h==="define"?` 1598#ifndef HAS_UNIFORM_u_${p} 1599uniform lowp float u_${p}_t; 1600layout(location = ${o++}) in ${c} ${f} a_${p}; 1601out ${c} ${d} ${p}; 1602#else 1603uniform ${c} ${d} u_${p}; 1604#endif 1605`:m==="vec4"?` 1606#ifndef HAS_UNIFORM_u_${p} 1607 ${p} = a_${p}; 1608#else 1609 ${c} ${d} ${p} = u_${p}; 1610#endif 1611`:` 1612#ifndef HAS_UNIFORM_u_${p} 1613 ${p} = unpack_mix_${m}(a_${p}, u_${p}_t); 1614#else 1615 ${c} ${d} ${p} = u_${p}; 1616#endif 1617`:h==="define"?` 1618#ifndef HAS_UNIFORM_u_${p} 1619uniform lowp float u_${p}_t; 1620layout(location = ${o++}) in ${c} ${f} a_${p}; 1621#else 1622uniform ${c} ${d} u_${p}; 1623#endif 1624`:m==="vec4"?` 1625#ifndef HAS_UNIFORM_u_${p} 1626 ${c} ${d} ${p} = a_${p}; 1627#else 1628 ${c} ${d} ${p} = u_${p}; 1629#endif 1630`:` 1631#ifndef HAS_UNIFORM_u_${p} 1632 ${c} ${d} ${p} = unpack_mix_${m}(a_${p}, u_${p}_t); 1633#else 1634 ${c} ${d} ${p} = u_${p}; 1635#endif 1636`}),{fragmentSource:t,vertexSource:e,staticAttributes:r,staticUniforms:s}}var Nx="#define PROJECTION_MERCATOR",$x="mercator",jp=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return $x}get shaderDefine(){return Nx}get shaderPreludeCode(){return rr.projectionMercator}get vertexShaderPreludeCode(){return rr.projectionMercator.vertexSource}get subdivisionGranularity(){return Zl.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(t,e,i,r,a){if(this._cachedMesh)return this._cachedMesh;let n=new gr;n.emplaceBack(0,0),n.emplaceBack(k,0),n.emplaceBack(0,k),n.emplaceBack(k,k);let s=t.createVertexBuffer(n,ya.members),o=qt.simpleSegment(0,0,4,2),l=new Bi;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3);let u=t.createIndexBuffer(l);return this._cachedMesh=new to(s,u,o),this._cachedMesh}recalculate(){}hasTransition(){return!1}},Up=class Gx{constructor(e=0,i=0,r=0,a=0){if(isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0||isNaN(a)||a<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=i,this.left=r,this.right=a}interpolate(e,i,r){return i.top!=null&&e.top!=null&&(this.top=Zt.number(e.top,i.top,r)),i.bottom!=null&&e.bottom!=null&&(this.bottom=Zt.number(e.bottom,i.bottom,r)),i.left!=null&&e.left!=null&&(this.left=Zt.number(e.left,i.left,r)),i.right!=null&&e.right!=null&&(this.right=Zt.number(e.right,i.right,r)),this}getCenter(e,i){let r=st((this.left+e-this.right)/2,0,e),a=st((this.top+i-this.bottom)/2,0,i);return new C(r,a)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Gx(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}};function Eu(t,e){if(!t.renderWorldCopies||t.lngRange)return;let i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}function Pv(t){return Math.max(0,Math.floor(t))}var uf=class{constructor(t,e){this.applyConstrain=(i,r)=>this._constrainOverride===null?this._callbacks.defaultConstrain(i,r):this._constrainOverride(i,r),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=e?.renderWorldCopies===void 0||!!e?.renderWorldCopies,this._minZoom=e?.minZoom||0,this._maxZoom=e?.maxZoom||22,this._minPitch=e?.minPitch===void 0||e?.minPitch===null?0:e?.minPitch,this._maxPitch=e?.maxPitch===void 0||e?.maxPitch===null?60:e?.maxPitch,this._constrainOverride=e?.constrainOverride??null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new Y(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Pv(this._zoom),this._scale=Be(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Up,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,e){this._constrainOverride=t.constrainOverride,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._tileZoom=Pv(this._zoom),this._scale=Be(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Up(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=t.autoCalculateNearFarZ,e&&this.constrainInternal(),this._calcMatrices()}
vendor: 5,249 bytes, line 1636
1636get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){if(this._minZoom===t)return;this._minZoom=t;let e=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=e}get maxZoom(){return this._maxZoom}setMaxZoom(t){if(this._maxZoom===t)return;this._maxZoom=t;let e=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=e}get minPitch(){return this._minPitch}setMinPitch(t){if(this._minPitch===t)return;this._minPitch=t;let e=this._unmodified;this.setPitch(Math.max(this.pitch,t)),this._unmodified=e}get maxPitch(){return this._maxPitch}setMaxPitch(t){if(this._maxPitch===t)return;this._maxPitch=t;let e=this._unmodified;this.setPitch(Math.min(this.pitch,t)),this._unmodified=e}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){t===void 0&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new C(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){let e=li(t,-180,180)*Math.PI/180;this._bearingInRadians!==e&&(this._unmodified=!1,this._bearingInRadians=e,this._calcMatrices(),this._rotationMatrix=lx(),yA(this._rotationMatrix,this._rotationMatrix,-this._bearingInRadians))}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let e=st(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==e&&(this._unmodified=!1,this._pitchInRadians=e,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let e=t/180*Math.PI;this._rollInRadians!==e&&(this._unmodified=!1,this._rollInRadians=e,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return Mi(this._fovInRadians)}setFov(t){t=st(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=Gt(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let e=this.applyConstrain(this._center,t).zoom;this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this._tileZoom=Math.max(0,Math.floor(e)),this._scale=Be(e),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){(t.lat!==this._center.lat||t.lng!==this._center.lng)&&(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(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)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,e){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=e,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this.constrainInternal(),this._calcMatrices()}resize(t,e,i=!0){this._width=t,this._height=e,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange?.length!==2||this._lngRange?.length!==2?null:new ji([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-ki,ki])}getCameraQueryGeometry(t,e){if(e.length===1)return[e[0],t];{let{minX:i,minY:r,maxX:a,maxY:n}=Ti.fromPoints(e).extend(t);return[new C(i,r),new C(a,r),new C(a,n),new C(i,n),new C(i,r)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:e,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(e),this.setZoom(i),this._unmodified=t,this._constraining=!1}
vendor: 7,030 bytes, line 1636
1636_calcMatrices(){if(this._pixelPerMeter=jr(1,this.center.lat)*this.worldSize,!this._width||!this._height)return;this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=Ei(new Float64Array(16));we(t,t,[this._width/2,-this._height/2,1]),se(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=Ei(new Float64Array(16)),we(t,t,[1,-1,1]),se(t,t,[-1,-1,0]),we(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t;let e=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(e)*this._height,this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,e,i,r){let a=i===void 0?this.bearing:i,n=r=r===void 0?this.pitch:r,{distanceToCenter:s,clampedElevation:o}=this._distanceToCenterFromAltElevationPitch(e,this.elevation,n),{x:l,y:u}=Hl(n,a),h=Et.fromLngLat(t,e),c=Rd(1,h.y),d,p,f=0;do{if(f+=1,f>10)break;p=s/c;let m=l*p,g=u*p;d=new Et(h.x+m,h.y+g),c=1/d.meterInMercatorCoordinateUnits()}while(Math.abs(s-p*c)>1e-12);return{center:d.toLngLat(),elevation:o,zoom:Ee(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t===0)return;let e=1/this.worldSize,i=jr(1,this.center.lat)*this.worldSize,r=Et.fromLngLat(this.center,this.elevation),a=r.x/e,n=r.y/e,s=r.z/e,o=this.pitch,l=this.bearing,{x:u,y:h,z:c}=Hl(o,l),d=this.cameraToCenterDistance,p=a+d*-u,f=n+d*-h,m=s+d*c,{distanceToCenter:g,clampedElevation:_}=this._distanceToCenterFromAltElevationPitch(m/i,t,o),y=g*i,x=p+u*y,v=f+h*y,w=new Et(x*e,v*e,0).toLngLat(),b=jr(1,w.lat),T=Ee(this.height/2/Math.tan(this.fovInRadians/2)/g/b/this.tileSize);this._elevation=_,this._center=w,this.setZoom(T)}_distanceToCenterFromAltElevationPitch(t,e,i){let r=-Math.cos(Gt(i)),a=t-e,n,s=e;return r*a>=0||Math.abs(r)<.1?(n=1e4,s=t+n*r):n=-a/r,{distanceToCenter:n,clampedElevation:s}}getCameraPoint(){let t=this.pitchInRadians,e=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new C(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let e=t.canonical.z>=0?1<<t.canonical.z:2**t.canonical.z;return[t.canonical.x/e,t.canonical.y/e,1/e/k,1/e/k]}},P3=class{distanceToTile2d(t,e,i,r){let a=r,n=a.distanceX([t,e]),s=a.distanceY([t,e]);return Math.hypot(n,s)}getWrap(t,e,i){return i}getTileBoundingVolume(t,e,i,r){let a=Math.min(0,i),n=Math.max(0,i);if(r?.terrain){let o=new Se(t.z,e,t.z,t.x,t.y),l=r.terrain.getMinMaxElevation(o);a=l.minElevation??a,n=l.maxElevation??n}let s=1<<t.z;return new ef([e+t.x/s,t.y/s,a],[e+(t.x+1)/s,(t.y+1)/s,n])}allowVariableZoom(t,e){let i=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,r=st(78.5-i/2,0,60);return!!e.terrain||t.pitch>r}allowWorldCopies(){return!0}prepareNextFrame(){}},C3=Yt([{name:"a_pos3d",type:"Int16",components:3}]),I3=class extends ce{constructor(t){super(),this._lastTilesetChange=Ft(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(t,e){this.tileManager.update(t,e),this._renderableTilesKeys=[];let i={},r=!1;for(let a of vn(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:e,calculateTileZoom:this.tileManager._source.calculateTileZoom}))i[a.key]=!0,this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.terrainRttPosMatrix32f=new Float32Array(16),Ri(a.terrainRttPosMatrix32f,0,k,k,0,0,1),this._tiles[a.key]=new Fx(a,this.tileSize),this._lastTilesetChange=Ft(),r=!0);for(let a in this._tiles)i[a]||(this._tiles[a].releaseRTT(this.tileManager.map.painter),delete this._tiles[a],r=!0);return r}releaseRTT(t){for(let e in this._tiles){let i=this._tiles[e];(i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&i.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let t in this._tiles)this._tiles[t].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,e){return e?this._getTerrainCoordsForTileRanges(t,e):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let e={};for(let i of this._renderableTilesKeys){let r=this._tiles[i].tileID,a=t.clone(),n=Br();if(r.canonical.equals(t.canonical))Ri(n,0,k,k,0,0,1);else if(r.canonical.isChildOf(t.canonical)){let s=r.canonical.z-t.canonical.z,o=r.canonical.x-(r.canonical.x>>s<<s),l=r.canonical.y-(r.canonical.y>>s<<s),u=k>>s;Ri(n,0,u,u,0,0,1),se(n,n,[-o*u,-l*u,0])}else if(t.canonical.isChildOf(r.canonical)){let s=t.canonical.z-r.canonical.z,o=t.canonical.x-(t.canonical.x>>s<<s),l=t.canonical.y-(t.canonical.y>>s<<s),u=k>>s;Ri(n,0,k,k,0,0,1),se(n,n,[o*u,l*u,0]),we(n,n,[1/2**s,1/2**s,0])}else continue;a.terrainRttPosMatrix32f=new Float32Array(n),e[i]=a}return e}_getTerrainCoordsForTileRanges(t,e){let i={};for(let r of this._renderableTilesKeys){let a=this._tiles[r].tileID;if(!this._isWithinTileRanges(a,e))continue;let n=t.clone(),s=Br();if(a.canonical.z===t.canonical.z){let o=t.canonical.x-a.canonical.x+t.wrap*(1<<t.canonical.z),l=t.canonical.y-a.canonical.y;Ri(s,0,k,k,0,0,1),se(s,s,[o*k,l*k,0])}else if(a.canonical.z>t.canonical.z){let o=a.canonical.z-t.canonical.z,l=a.canonical.x-(a.canonical.x>>o<<o)+t.wrap*(1<<a.canonical.z),u=a.canonical.y-(a.canonical.y>>o<<o),h=t.canonical.x-(a.canonical.x>>o),c=t.canonical.y-(a.canonical.y>>o),d=k>>o;Ri(s,0,d,d,0,0,1),se(s,s,[-l*d+h*k,-u*d+c*k,0])}else{let o=t.canonical.z-a.canonical.z,l=t.canonical.x-(t.canonical.x>>o<<o)+t.wrap*(1<<t.canonical.z),u=t.canonical.y-(t.canonical.y>>o<<o),h=(t.canonical.x>>o)-a.canonical.x,c=(t.canonical.y>>o)-a.canonical.y,d=k<<o;Ri(s,0,d,d,0,0,1),se(s,s,[l*k+h*d,u*k+c*d,0])}n.terrainRttPosMatrix32f=new Float32Array(s),i[r]=n}return i}getSourceTile(t,e){var n,s;let i=this.tileManager._source,r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return;(n=this._sourceTileCache)[s=t.key]||(n[s]=t.scaledTo(r).key);let a=this.findTileInCaches(this._sourceTileCache[t.key]);if(!a?.dem&&e)for(;r>=i.minzoom&&!a?.dem;)a=this.findTileInCaches(t.scaledTo(r--).key);return a}findTileInCaches(t){let e=this.tileManager.getTileByID(t);return e||(e=this.tileManager._outOfViewCache.getByKey(t),e)}anyTilesAfterTime(t=Ft()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,e){let i=e[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap<i.maxWrap||t.canonical.x>=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}},Cv=k*(1-1e-12),Iv=-.5,A3=class{constructor(t,e,i,r="auto"){this._meshCache={},this.painter=t,this.tileManager=new I3(e),this.options=i,this.exaggeration=typeof i.exaggeration=="number"?i.exaggeration:1,this._terrainSkirtLength=r,this.qual
vendor: 23,228 bytes, line 1636
1636ityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,e,i,r=k){let a=t.normalizeCoordinates(e,i,r);if(!a)return 0;let n=this.getElevationSampler(a.tileID);return n?n(a.x,a.y,r):0}getElevationForLngLatZoom(t,e){if(!Gd(e,t.wrap()))return 0;let{tileID:i,mercatorX:r,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,e);return this.getElevation(i,r%k,a%k,k)}getElevationForLngLat(t,e){let i=this.getCoverageIndex();if(i){let n=Et.fromLngLat(t),s=hf(i,this.exaggeration,n.x,n.y);if(s.demLoaded)return s.elevation}let r=vn(e,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),a=0;for(let n of r)n.canonical.z>a&&(a=Math.min(n.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,a)}getElevation(t,e,i,r=k){return this.getDEMElevation(t,e,i,r)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return this._coverageIndex===void 0&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let t=[],e=new Map,i=0,r=0;for(let a of this.tileManager.getRenderableTiles()){if(!a)continue;let{canonical:n,wrap:s}=a.tileID;t.includes(n.z)||t.push(n.z);let o=this.getElevationSampler(a.tileID);e.set(`${s}/${n.z}/${n.x}/${n.y}`,o);let{minElevation:l,maxElevation:u}=this.getMinMaxElevation(a.tileID);i=Math.min(i,l??0),r=Math.max(r,u??0)}return e.size===0?null:(t.sort((a,n)=>n-a),{zooms:t,samplerPerTile:e,minElevation:i-10,maxElevation:r+10})}getElevationSampler(t){let e=t.key,i=this._elevationSamplerCache.get(e);if(i)return i;let r=this.tileManager.getSourceTile(t,!0),a=r?.dem;if(!r||!a)return null;let n=this._getDEMTileMatrix(t,r),s=n[0]*a.dim,o=n[5]*a.dim,l=n[12]*a.dim+Iv,u=n[13]*a.dim+Iv,h=(c,d,p)=>{let f=p===8192?1:k/p;return a.sampleBilinear(c*f*s+l,d*f*o+u)};return this._elevationSamplerCache.set(e,h),h}_getDEMTileMatrix(t,e){let i=`${e.tileID.key}/${t.key}`,r=this._demMatrixCache.get(i);if(r)return r;let a=t.canonical.z-e.tileID.canonical.z,n=t.canonical.x-(t.canonical.x>>a<<a),s=t.canonical.y-(t.canonical.y>>a<<a),o=jg(new Float64Array(16),[1/(k<<a),1/(k<<a),0]);return se(o,o,[n*k,s*k,0]),this._demMatrixCache.set(i,o),o}getTerrainData(t){if(!this._emptyDemTexture){let r=this.painter.context,a=new Ot({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new he(r,a,r.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new he(r,new Ot({width:1,height:1}),r.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Ei([])}let e=this.tileManager.getSourceTile(t,!0);if(e?.dem&&(!e.demTexture||e.needsTerrainPrepare)){let r=this.painter.context;e.demTexture||(e.demTexture=this.painter.getTileTexture(e.dem.stride)),e.demTexture?e.demTexture.update(e.dem.getPixels(),{premultiply:!1}):e.demTexture=new he(r,e.dem.getPixels(),r.gl.RGBA,{premultiply:!1}),e.demTexture.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),e.needsTerrainPrepare=!1}let i=e?this._getDEMTileMatrix(t,e):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:e?.dem?.dim||1,u_terrain_matrix:i,u_terrain_unpack:e?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(e?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:e}}getFramebuffer(){let t=this.painter,e=t.width/devicePixelRatio,i=t.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==e||this._fbo.height!==i)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new he(t.context,{width:e,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(e,i,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,e,i))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}getTerrainMesh(t){let e=this.painter.style.projection?.transitionState>0,i=e&&t.canonical.y===0,r=e&&t.canonical.y===(1<<t.canonical.z)-1,a=`m_${i?"n":""}_${r?"s":""}`;if(this._meshCache[a])return this._meshCache[a];let n=this.painter.context,s=new t0,o=new Bi,l=this.meshSize,u=k/l,h=l*l;for(let d=0;d<=l;d++)for(let p=0;p<=l;p++)s.emplaceBack(p*u,d*u,0);for(let d=0;d<h;d+=l+1)for(let p=0;p<l;p++)o.emplaceBack(p+d,l+p+d+1,l+p+d+2),o.emplaceBack(p+d,l+p+d+2,p+d+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(s,o,l,u,i,r);let c=new to(n.createVertexBuffer(s,C3.members),n.createIndexBuffer(o),qt.simpleSegment(0,0,s.length,o.length));return this._meshCache[a]=c,c}getSkirtLength(t){return 2*Math.PI*Ve/2**Math.max(t,0)/5}getMinTileElevationForLngLatZoom(t,e){if(!Gd(e,t.wrap()))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(t,e);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(t){let e=this.tileManager.getSourceTile(t,!0),i={minElevation:null,maxElevation:null};return e?.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,e){let i=Et.fromLngLat(t.wrap()),r=(1<<e)*k,a=i.x*r,n=i.y*r,s=Math.floor(a/k),o=Math.floor(n/k);return{tileID:new Se(e,0,e,s,o),mercatorX:a,mercatorY:n}}_buildSkirts(t,e,i,r,a,n){let s=t.length,o=s+(i+1),l=(i+1)*i,u=a?Ua:0,h=+!a,c=n?Na:k,d=+!n;for(let m=0;m<=i;m++)t.emplaceBack(m*r,u,h);for(let m=0;m<=i;m++)t.emplaceBack(m*r,c,d);for(let m=0;m<i;m++)e.emplaceBack(l+m,o+m,o+m+1),e.emplaceBack(l+m,o+m+1,l+m+1),e.emplaceBack(0+m,s+m+1,s+m),e.emplaceBack(0+m,0+m+1,s+m+1);let p=t.length,f=p+(i+1)*2;for(let m of[0,1])for(let g=0;g<=i;g++)for(let _ of[0,1])t.emplaceBack(m*k,g*r,_);for(let m=0;m<i*2;m+=2)e.emplaceBack(p+m,p+m+1,p+m+3),e.emplaceBack(p+m,p+m+3,p+m+2),e.emplaceBack(f+m,f+m+3,f+m+1),e.emplaceBack(f+m,f+m+2,f+m+3)}},Av={covered:!1,demLoaded:!1,elevation:0};function hf(t,e,i,r){if(r<0||r>=1)return Av;let a=Math.floor(i),n=i-a;for(let s of t.zooms){let o=1<<s,l=n*o,u=r*o,h=Math.floor(l),c=Math.floor(u),d=`${a}/${s}/${h}/${c}`;if(!t.samplerPerTile.has(d))continue;let p=t.samplerPerTile.get(d);return p?{covered:!0,demLoaded:!0,elevation:p(Math.min((l-h)*k,Cv),Math.min((u-c)*k,Cv),k)*e}:{covered:!0,demLoaded:!1,elevation:0}}return Av}function Zx(t,e){return t.covered&&e<=t.elevation+1e-6}function qx(t,e,i,r,a){for(let n=0;n<40&&r-i>a;n++){let s=(i+r)/2;e(t,s)?r=s:i=s}return{lo:i,hi:r}}var Su=class Wx{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,i,r){this._helper.interpolatePadding(e,i,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,i,r=!0){this._helper.resize(e,i,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,i){this._helper.overrideNearFarZ(e,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(e,i){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(r,a)=>{a=st(+a,this.minZoom,this.maxZoom);let n={center:new Y(r.lng,r.lat),zoom:a},s=this._helper._lngRange;!this._helper._renderWorldCopies&&s===null&&(s=[-179.9999999999,180-1e-10]);let o=this.tileSize*Be(n.zoom),l=0,u=o,h=0,c=o,d=0,p=0,{x:f,y:m}=this.size;if(this._helper._latRange){let w=this._helper._latRange;l=da(w[1])*o,u=da(w[0])*o,u-l<m&&(d=m/(u-l))}s&&(h=li(ca(s[0])*o,0,o),c=li(ca(s[1])*o,0,o),c<h&&(c+=o),c-h<f&&(p=f/(c-h)));let{x:g,y:_}=Oi(o,r),y,x,v=Math.max(p||0,d||0);if(v){let w=new C(p?(c+h)/2:g,d?(u+l)/2:_);return n.center=un(o,w).wrap(),n.zoom+=Ee(v),n}if(this._helper._latRange){let w=m/2;_-w<l&&(x=l+w),_+w>u&&(x=u-w)}if(s){let w=(h+c)/2,b=g;this._helper._renderWorldCopies&&(b=li(g,w-o/2,w+o/2));let T=f/2;b-T<h&&(y=h+T),b+T>c&&(y=c-T)}if(y!==void 0||x!==void 0){let w=new C(y??g,x??_);n.center=un(o,w).wrap()}return n},this.applyConstrain=(r,a)=>this._helper.applyConstrain(r,a),this._helper=i??new uf({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(r,a)=>this.defaultConstrain(r,a)},e),this._coveringTilesDetailsProvider=new P3}clone(){let e=new Wx;return e.apply(this,!1),e}apply(e,i){this._helper.apply(e,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){let i=[new Bs(0,e)];if(this._helper._renderWorldCopies){let r=this.screenPointToMercatorCoordinate(new C(0,0)),a=this.screenPointToMercatorCoordinate(new C(this._helper._width,0)),n=this.screenPointToMercatorCoordinate(new C(this._helper._width,this._helper._height)),s=this.screenPointToMercatorCoordinate(new C(0,this._helper._height)),o=Math.floor(Math.min(r.x,a.x,n.x,s.x)),l=Math.floor(Math.max(r.x,a.x,n.x,s.x));for(let u=o-1;u<=l+1;u++)u!==0&&i.push(new Bs(u,e))}return i}getCameraFrustum(){return rf.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let i=this.screenPointToLocation(this.centerPoint,e),r=e?e.getElevationForLngLat(i,this):0;this._helper.recalculateZoomAndCenter(r)}setLocationAtPoint(e,i,r=this.elevation){let a=r-this.elevation,n=this.screenPointToMercatorCoordinateAtZ(i,a),s=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),o=Et.fromLngLat(e),l=new Et(o.x-(n.x-s.x),o.y-(n.y-s.y));this.setCenter(l?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,i){return i?this.coordinatePoint(Et.fromLngLat(e),i.getElevationForLngLat(e,this),this._pixelMatrix3D):this.coordinatePoint(Et.fromLngLat(e))}screenPointToLocation(e,i){return this.screenPointToMercatorCoordinate(e,i)?.toLngLat()}screenPointToLocationAtElevation(e,i){return this.screenPointToMercatorCoordinateAtZ(e,i-this.elevation)?.toLngLat()}screenPointToMercatorCoordinate(e,i){if(i){let r=this.screenTerrainPointToMercatorCoordinate(e,i);if(r!=null)return r}return this.screenPointToMercatorCoordinateAtZ(e)}screenTerrainPointToMercatorCoordinate(e,i){let r=i.getCoverageIndex();if(!r)return null;let{near:a,far:n}=this.getRaySegmentFromPixel(e),s=this.worldSize,o=n[0]-a[0],l=n[1]-a[1],u=n[2]-a[2],h={index:r,exaggeration:i.exaggeration,near:a,dx:o,dy:l,dz:u,worldSize:s},c=0,d=1;if(u===0){if(a[2]>r.maxElevation||a[2]<r.minElevation)return null}else{let _=(r.maxElevation-a[2])/u,y=(r.minElevation-a[2])/u;if(c=Math.max(c,Math.min(_,y)),d=Math.min(d,Math.max(_,y)),c>d)return null}let p=Math.hypot(o,l),f=st(Math.ceil(p*(d-c)/4),1,512),m=0,g=!lu(h,0);for(let _=0;_<=f;_++){let y=c+(d-c)*_/f;if(!g)g=!lu(h,y);else if(lu(h,y)){let{lo:x,hi:v}=qx(h,lu,m,y,.001/p),w=bu(h,x),b=bu(h,v),T=a[2]+x*u-w.elevation,D=a[2]+v*u-b.elevation,E=w.covered&&T>D?st(x+T*(v-x)/(T-D),x,v):v;return new Et((a[0]+E*o)/s,(a[1]+E*l)/s,bu(h,E).elevation)}m=y}return null}getRaySegmentFromPixel(e){let i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];Te(i,i,this._pixelMatrixInverse),Te(r,r,this._pixelMatrixInverse);let a=i[3],n=r[3],s=this.elevation;return{near:[i[0]/a,i[1]/a,i[2]/a+s],far:[r[0]/n,r[1]/n,r[2]/n+s]}}screenPointToMercatorCoordinateAtZ(e,i){let r=i||0,{near:a,far:n}=this.getRaySegmentFromPixel(e),s=a[2]===n[2]?0:(r+this.elevation-a[2])/(n[2]-a[2]);return new Et(Zt.number(a[0],n[0],s)/this.worldSize,Zt.number(a[1],n[1],s)/this.worldSize,r)}coordinatePoint(e,i=0,r=this._pixelMatrix){let a=this._coordinateClipPoint(e,i,r),n=a[3];return n>0?new C(a[0]/n,a[1]/n):this._offScreenPointBehindCamera(a[0],a[1],n)}_coordinateClipPoint(e,i,r){let a=[e.x*this.worldSize,e.y*this.worldSize,i,1];return Te(a,a,r)}_offScreenPointBehindCamera(e,i,r){let a=this.width/2,n=this.height/2,s=e-a*r,o=i-n*r;s===0&&o===0&&(o=1);let l=a+this.width,u=n+this.height,h=Math.min(s===0?1/0:l/Math.abs(s),o===0?1/0:u/Math.abs(o));return new C(a+s*h,n+o*h)}getBounds(){let e=Math.max(0,this._helper._height/2-hn(this));return new ji().extend(this.screenPointToLocation(new C(0,e))).extend(this.screenPointToLocation(new C(this._helper._width,e))).extend(this.screenPointToLocation(new C(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new C(0,this._helper._height)))}isPointOnMapSurface(e,i){return i?this.screenTerrainPointToMercatorCoordinate(e,i)!=null:e.y>this.height/2-hn(this)}calculatePosMatrix(e,i=!1,r=!1){let a=e.key??Qr(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n.has(a)){let l=n.get(a);return r?l.f32:l.f64}let s=Wl(e,this.worldSize);na(s,i?this._alignedProjMatrix:this._viewProjMatrix,s);let o={f64:s,f32:new Float32Array(s)};return n.set(a,o),r?o.f32:o.f64}calculateFogMatrix(e){let i=e.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);let a=Wl(e,this.worldSize);return na(a,this._fogMatrix,a),r.set(i,new Float32Array(a)),r.get(i)}calculateCenterFromCameraLngLatAlt(e,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(e,i,r,a)}calculateCameraOptionsFromTo(e,i,r,a){let n=Et.fromLngLat(e,i),s=Et.fromLngLat(r,a),o=s.x-n.x,l=s.y-n.y,u=s.z-n.z,h=Math.hypot(o,l,u);if(h===0)throw Error("Can't calculate camera options with same From and To");let c=Math.hypot(o,l),d=Ee(this.cameraToCenterDistance/h/this.tileSize),p=Mi(Math.atan2(o,-l)),f=Mi(Math.acos(c/h));return f=u<0?90-f:90+f,{center:s.toLngLat(),elevation:a,zoom:d,pitch:f,bearing:p}}_calculateNearFarZ(e,i,r){let a=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),n=e-a*this._helper._pixelPerMeter/Math.cos(i),s=a<0?n:e,o=Math.PI/2+this.pitchInRadians,l=Gt(this.fov)*(Math.abs(Math.cos(Gt(this.roll)))*this.height+Math.abs(Math.sin(Gt(this.roll)))*this.width)/this.height*(.5+r.y/this.height),u=Math.sin(l)*s/Math.sin(st(Math.PI-o-l,.01,Math.PI-.01)),h=hn(this),c=Math.atan(h/this._helper.cameraToCenterDistance),d=Gt(90-Ur),p=c>d?2*c*(.5+r.y/(h*2)):d,f=Math.sin(p)*s/Math.sin(st(Math.PI-o-p,.01,Math.PI-.01)),m=Math.min(u,f);this._helper._farZ=(Math.cos(Math.PI/2-i)*m+s)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(e=this._helper.autoCalculateNearFarZ){let i=this.centerOffset,r=Oi(this.worldSize,this.center),a=r.x,n=r.y,s=Gt(Math.min(this.pitch,Ur)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(s));e&&this._calculateNearFarZ(o,s,i);let l;l=new Float64Array(16),ul(l,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),XM(this._invProjMatrix,l),l[8]=-i.x*2/this._helper._width,l[9]=i.y*2/this._helper._height,this._projectionMatrix=ll(l),we(l,l,[1,-1,1]),se(l,l,[0,0,-this._helper.cameraToCenterDistance]),dr(l,l,-this.rollInRadians),sa(l,l,this.pitchInRadians),dr(l,l,-this.bearingInRadians),se(l,l,[-a,-n,0]),this._mercatorMatrix=we([],l,[this.worldSize,this.worldSize,this.worldSize]),we(l,l,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=na(new Float64Array(16),this.clipSpaceToPixelsMatrix,l),se(l,l,[0,0,-this.elevation]),this._viewProjMatrix=l,this._invViewProjMatrix=cs([],l);let u=[0,0,-1,1];Te(u,u,this._invViewProjMatrix),this._cameraPosition=[u[0]/u[3],u[1]/u[3],u[2]/u[3]],this._fogMatrix=new Float64Array(16),ul(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=-i.x*2/this.width,this._fogMatrix[9]=i.y*2/this.height,we(this._fogMatrix,this._fogMatrix,[1,-1,1]),se(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),dr(this._fogMatrix,this._fogMatrix,-this.rollInRadians),sa(this._fogMatrix,this._fogMatrix,this.pitchInRadians),dr(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),se(this._fogMatrix,this._fogMatrix,[-a,-n,0]),we(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),se(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=na(new Float64Array(16),this.clipSpaceToPixelsMatrix,l);let h=this._helper._width%2/2,c=this._helper._height%2/2,d=Math.cos(this.bearingInRadians),p=Math.sin(-this.bearingInRadians),f=a-Math.round(a)+d*h+p*c,m=n-Math.round(n)+d*c+p*h,g=new Float64Array(l);if(se(g,g,[f>.5?f-1:f,m>.5?m-1:m,0]),this._alignedProjMatrix=g,l=cs(new Float64Array(16),this._pixelMatrix),!l)throw Error("failed to invert matrix");this._pixelMatrixInverse=l,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let e=this.screenPointToMercatorCoordinate(new C(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return Te(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this.cameraToCenterDistance/this.pixelsPerMeter+this.elevation}getCameraLngLat(){let e=jr(1,this.center.lat)*this.worldSize,i=this._helper.cameraToCenterDistance/e;return Ld(this.center,this.elevation,this.pitch,this.bearing,i).toLngLat()}getProjectionData(e){let{overscaledTileID:i,aligned:r,applyTerrainMatrix:a}=e,n=this._helper.getMercatorTileCoordinates(i),s=i?this.calculatePosMatrix(i,r,!0):null,o;return o=i?.terrainRttPosMatrix32f&&a?i.terrainRttPosMatrix32f:s||Wc(),{mainMatrix:o,tileMercatorCoords:n,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(e,i,r){if(!i?.getCoverageIndex())return!1;let a=Et.fromLngLat(e);r??(r=i.getElevationForLngLat(e,this));let n=this._coordinateClipPoint(a,r,this._pixelMatrix3D),s=n[3];if(s<=0||n[2]>s)return!0;let o=new C(n[0]/s,n[1]/s),l=this.screenTerrainPointToMercatorCoordinate(o,i);if(l==null)return!1;let u=this.getRaySegmentFromPixel(o),h=Mv(u,a.x*this.worldSize,a.y*this.worldSize,r);return Mv(u,l.x*this.worldSize,l.y*this.worldSize,l.z)<h*.99}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,i,r){return 1}transformLightDirection(e){return hl(e)}getRayDirectionFromPixel(e){throw Error("Not implemented.")}projectTileCoordinates(e,i,r,a){let n=this.calculatePosMatrix(r),s;a==null?(s=[e,i,0,1],lf(s,s,n)):(s=[e,i,a,1],Te(s,s,n));let o=s[3];return{point:new C(s[0]/o,s[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}populateCache(e){for(let i of e)this.calculatePosMatrix(i)}getProjectionDataForCustomLayer(e=!0){let i=new Se(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:e}),a=Wl(i,this.worldSize);na(a,this._viewProjMatrix,a);let n=[k,k,this.worldSize/this._helper.pixelsPerMeter],s=Br();return we(s,a,n),{...r,tileMercatorCoords:[0,0,1,1],fallbackMatrix:s,mainMatrix:s}}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}};function bu(t,e){return hf(t.index,t.exaggeration,(t.near[0]+e*t.dx)/t.worldSize,(t.near[1]+e*t.dy)/t.worldSize)}function lu(t,e){return Zx(bu(t,e),t.near[2]+e*t.dz)}function Mv({near:t,far:e},i,r,a){let n=e[0]-t[0],s=e[1]-t[1],o=e[2]-t[2];return((i-t[0])*n+(r-t[1])*s+(a-t[2])*o)/(n*n+s*s+o*o)}function Hx(){ft("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Xx(t){if(t.useSlerp)if(t.k<1){let e=Jc(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),i=Jc(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),r=new Float64Array(4);$n(r,e,i,t.k);let a=h_(r);t.tr.setRoll(a.roll),t.tr.setPitch(a.pitch),t.tr.setBearing(a.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(Zt.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(Zt.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(Zt.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}
vendor: 4,358 bytes, line 1636
1636function Yx(t,e,i,r,a){let n=a.padding,s=Oi(a.worldSize,i.getNorthWest()),o=Oi(a.worldSize,i.getNorthEast()),l=Oi(a.worldSize,i.getSouthEast()),u=Oi(a.worldSize,i.getSouthWest()),h=Gt(-r),c=s.rotate(h),d=o.rotate(h),p=l.rotate(h),f=u.rotate(h),m=new C(Math.max(c.x,d.x,f.x,p.x),Math.max(c.y,d.y,f.y,p.y)),g=new C(Math.min(c.x,d.x,f.x,p.x),Math.min(c.y,d.y,f.y,p.y)),_=m.sub(g),y=a.width-(n.left+n.right+e.left+e.right),x=a.height-(n.top+n.bottom+e.top+e.bottom),v=y/_.x,w=x/_.y;if(w<0||v<0){Hx();return}let b=Math.min(Ee(a.scale*Math.min(v,w)),t.maxZoom),T=C.convert(t.offset),D=(e.left-e.right)/2,E=(e.top-e.bottom)/2,M=new C(D,E).rotate(Gt(r)),R=T.add(M).mult(a.scale/Be(b));return{center:un(a.worldSize,s.add(l).div(2).sub(R)),zoom:b,bearing:r}}var Du=class{get useGlobeControls(){return!1}handlePanInertia(t,e){let i=t.mag(),r=Math.abs(hn(e));return{easingOffset:t.mult(Math.min(r*.75/i,1)),easingCenter:e.center}}handleMapControlsRollPitchBearingZoom(t,e){t.bearingDelta&&e.setBearing(e.bearing+t.bearingDelta),t.pitchDelta&&e.setPitch(e.pitch+t.pitchDelta),t.rollDelta&&e.setRoll(e.roll+t.rollDelta),t.zoomDelta&&e.setZoom(e.zoom+t.zoomDelta)}handleMapControlsPan(t,e,i){t.around.distSqr(e.centerPoint)<.01||e.setLocationAtPoint(i,t.around,t.aroundElevation)}cameraForBoxAndBearing(t,e,i,r,a){return Yx(t,e,i,r,a)}handleJumpToCenterZoom(t,e){let i=e.zoom===void 0?t.zoom:+e.zoom;t.zoom!==i&&t.setZoom(+e.zoom),e.center!==void 0&&t.setCenter(Y.convert(e.center))}handleEaseTo(t,e){let i=t.zoom,r=t.padding,a={roll:t.roll,pitch:t.pitch,bearing:t.bearing},n={roll:e.roll===void 0?t.roll:e.roll,pitch:e.pitch===void 0?t.pitch:e.pitch,bearing:e.bearing===void 0?t.bearing:e.bearing},s=e.zoom!==void 0,o=!t.isPaddingEqual(e.padding),l=!1,u=s?+e.zoom:t.zoom,h=t.centerPoint.add(e.offsetAsPoint),c=t.screenPointToLocation(h),{center:d,zoom:p}=t.applyConstrain(Y.convert(e.center||c),u??i);Eu(t,d);let f=Oi(t.worldSize,c),m=Oi(t.worldSize,d).sub(f),g=Be(p-i);return l=p!==i,{easeFunc:_=>{if(l&&t.setZoom(Zt.number(i,p,_)),Yc(a,n)||Xx({startEulerAngles:a,endEulerAngles:n,tr:t,k:_,useSlerp:a.roll!=n.roll}),o&&(t.interpolatePadding(r,e.padding,_),h=t.centerPoint.add(e.offsetAsPoint)),e.around)t.setLocationAtPoint(e.around,e.aroundPoint);else{let y=Be(t.zoom-i),x=(p>i?Math.min(2,g):Math.max(.5,g))**(1-_),v=un(t.worldSize,f.add(m.mult(_*x)).mult(y));t.setLocationAtPoint(t.renderWorldCopies?v.wrap():v,h)}},isZooming:l,elevationCenter:d}}handleFlyTo(t,e){let i=e.zoom!==void 0,r=t.zoom,a=t.applyConstrain(Y.convert(e.center||e.locationAtOffset),i?+e.zoom:r),n=a.center,s=a.zoom;Eu(t,n);let o=t.worldSize,l=Oi(o,e.locationAtOffset),u=Oi(o,n).sub(l),h=u.mag(),c=Be(s-r),d=e.minZoom===void 0?t.minZoom:+e.minZoom,p=Math.max(d,t.minZoom),f=Math.min(p,r,s),m=t.applyConstrain(n,f).zoom;return{easeFunc:(g,_,y,x)=>{t.setZoom(g===1?s:r+Ee(_));let v=g===1?n:un(o,l.add(u.mult(y)));t.setLocationAtPoint(t.renderWorldCopies?v.wrap():v,x)},scaleOfZoom:c,targetCenter:n,scaleOfMinZoom:Be(m-r),pixelPathLength:h}}},Fv,M3=()=>Fv||(Fv=new ge({type:new j(F.projection.type,"type")})),fp=new Zl({fill:new Wi(128,2),line:new Wi(512,0),tile:new Wi(128,32),stencil:new Wi(128,1),circle:3}),Kx=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return rr.projectionGlobe}get vertexShaderPreludeCode(){return rr.projectionMercator.vertexSource}get subdivisionGranularity(){return fp}get useGlobeControls(){return!0}destroy(){}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,e,i,r,a){let n=(a==="stencil"?fp.stencil:fp.tile).getGranularityForZoomLevel(e.z),s=e.y===0&&r,o=e.y===(1<<e.z)-1&&r;return this._getMesh(t,{granularity:n,generateBorders:i,extendToNorthPole:s,extendToSouthPole:o})}_getMesh(t,e){let i=this._getMeshKey(e);if(i in this._tileMeshCache)return this._tileMeshCache[i];let r=Sx(t,e);return this._tileMeshCache[i]=r,r}recalculate(t){}hasTransition(){return!1}},zv=class extends ce{constructor(t,e){super(),this._transitionable=new Ds(M3(),"projection",e),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Ct
vendor: 65,194 bytes, line 1636
1636(0)),this._mercatorProjection=new jp,this._verticalPerspectiveProjection=new Kx}get transitionState(){let t=this.properties.get("type");if(typeof t=="string"&&t==="mercator")return 0;if(typeof t=="string"&&t==="vertical-perspective")return 1;if(t instanceof mr){if(t.from===t.to)return t.from==="mercator"?0:1;if(t.from==="vertical-perspective"&&t.to==="mercator")return 1-t.transition;if(t.from==="mercator"&&t.to==="vertical-perspective")return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(t,e,i,r,a){return this.currentProjection.getMeshFromTileID(t,e,i,r,a)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}};function Jx(t){let e=_n(t.worldSize,t.center.lat);return 2*Math.PI*e}function F3(t,e,i){let r=_e(e),a=_e(i),n=oe(r,a),s=Math.acos(n),o=Jx(t);return s/(2*Math.PI)*o}function z3(t,e){return[zr(t*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-e*Math.PI*2))-Math.PI*.5]}function R3(t,e){let i=Math.cos(e),r=new Float64Array(3);return r[0]=Math.sin(t)*i,r[1]=Math.sin(e),r[2]=Math.cos(t)*i,r}function Nr(t,e,i,r,a){let n=1/(1<<a),s=t/k*n+i*n,o=e/k*n+r*n,l=zr(s*Math.PI*2+Math.PI,Math.PI*2),u=2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-Math.PI*.5,h=Math.cos(u),c=new Float64Array(3);return c[0]=Math.sin(l)*h,c[1]=Math.sin(u),c[2]=Math.cos(l)*h,c}function _e(t){return R3(t.lng*Math.PI/180,t.lat*Math.PI/180)}function _n(t,e){return t/(2*Math.PI)/Math.cos(e*Math.PI/180)}function Qx(t){let e=Te(Lr(),[0,0,0,1],t.modelViewProjectionMatrix);return Te(e,e,t.inverseProjectionMatrix),[e[0]/e[3],e[1]/e[3],e[2]/e[3]]}function Ks(t){let e=Math.asin(t[1])/Math.PI*180,i=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(i>1e-6){let r=t[0]/i,a=t[2]/i,n=Math.acos(a),s=(r>0?n:-n)/Math.PI*180;return new Y(li(s,-180,180),e)}return new Y(0,e)}function k3(t,e){return fl(Lr(),-t.lng,-t.lat,e)}function L3(t){let e=t[0],i=t[1],r=t[2],a=t[3];return{lng:-Math.atan2(2*(a*e+i*r),1-2*(e*e+i*i))*180/Math.PI,lat:-Math.asin(st(2*(a*i-r*e),-1,1))*180/Math.PI,bearing:Math.atan2(2*(a*r+e*i),1-2*(i*i+r*r))*180/Math.PI}}var mp=Math.PI*.98;function Rv(t,e){let i=t.cameraPosition,r=Qi(i);if(r<=1)return t.screenPointToLocation(e);let a=St();Le(a,i);let n=t.getRayDirectionFromPixel(e),s=-oe(n,a),o=St();ds(o,n,a,s);let l=Qi(o);if(l<1e-9)return t.screenPointToLocation(e);let u=Math.atan2(l,s),h=Math.asin(1/r)*.9;if(u<h)return t.screenPointToLocation(e);let c=r*Math.sin(h),d=Math.asin(st(c,-1,1))-h,p=r*Math.cos(h)/Math.sqrt(Math.max(1-c*c,1e-12))-1,f=mp-d,m=u-h,g=d+p*m*f/(f+p*m),_=St();Ut(_,o,1/l);let y=St();return Ut(y,a,Math.cos(st(g,0,mp))),ds(y,y,_,Math.sin(st(g,0,mp))),Le(y,y),Ks(y)}function B3(t,e,i,r,a=!0){let n=Rv(t,i),s=e;if(r)s=Rv(t,i.sub(r));else if(!t.isPointOnMapSurface(i))return;let o=_e(n),l=_e(s),u=k3(t.center,t.bearing),h=Ne(St(),l,o),c=Math.sqrt(oe(h,h)),d=Math.acos(st(oe(l,o),-1,1))/2,p=Math.sin(d),f=c?$c(h[1]/c*p,-h[0]/c*p,h[2]/c*p,Math.cos(d)):$c(0,0,0,1),{lng:m,lat:g,bearing:_}=L3(Kg(Lr(),u,f)),y=t.center.lat,x=t.zoom,v=st(g,-90,90),w=a?O3(t,i,r,m):m;t.setCenter(new Y(li(w,-180,180),v)),a||t.setBearing(_),t.setZoom(x+De(y,t.center.lat))}function O3(t,e,i,r){let a=t.center.lng,n=t.center.lat,s=n>=0?90:-90,o=t.locationToScreenPoint(new Y(0,s)),l=e.x-o.x,u=e.y-o.y,h=l*l+u*u,c=st(1-(ki-Math.abs(n))/12,0,1),d=c*c*(3-2*c),p=zr(r-a+180,360)-180,f=0;if(d>0&&i){let m=(l*i.y-u*i.x)/Math.max(h,400);f=(s>0?1:-1)*m*180/Math.PI}return a+(1-d)*p+d*f}function V3(t){let e=St();return e[0]=t[0]*-t[3],e[1]=t[1]*-t[3],e[2]=t[2]*-t[3],{center:e,radius:Math.sqrt(1-t[3]*t[3])}}function j3(t,e,i){let r=St();tr(r,i,t);let a=St();return ds(a,t,r,e/ps(r)),a}function Pu(t){return Math.cos(t*Math.PI/180)}function De(t,e){let i=Pu(t),r=Pu(e);return Ee(r/i)}function U3(t,e){return 360/Jx({worldSize:t,center:{lat:e}})}function N3(t,e){let i=t.rotate(e.bearingInRadians),r=e.zoom+De(e.center.lat,0),a=la(1/Pu(e.center.lat),1/Pu(Math.min(Math.abs(e.center.lat),60)),_s(r,7,3,0,1)),n=U3(e.worldSize,e.center.lat);return new Y(e.center.lng-i.x*n*a,st(e.center.lat+i.y*n,-ki,ki))}function gp(t){let e=.5*t,i=Math.sin(e),r=Math.cos(e);return Math.log(i+r)-Math.log(r-i)}function kv(t,e,i,r){let a=t.lat+i*r;if(Math.abs(i)>1){let n=t.lat+i,s=(Math.sign(n)===Math.sign(t.lat)?Math.abs(t.lat):-Math.abs(t.lat))*Math.PI/180,o=Math.abs(t.lat+i)*Math.PI/180,l=gp(s+r*(o-s)),u=gp(s),h=gp(o),c=(l-u)/(h-u),d=t.lng+e*c;return new Y(d,a)}{let n=t.lng+e*r;return new Y(n,a)}}function uu(t,e,i=1){let r=oe(t,e),a=i*i,n=St(),s=St();Ut(s,e,r),tr(n,t,s);let o=a-oe(n,n);if(o<0)return null;let l=oe(t,t)-a,u=-r+(r<0?1:-1)*Math.sqrt(o),h=l/u,c=u;return{tMin:Math.min(h,c),tMax:Math.max(h,c)}}var $3=class{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,e,i,r){let a=`${t.z}_${t.x}_${t.y}_${r?.terrain?"t":""}_${Math.round(i)}`,n=this._cache.get(a);if(n)return n;let s=this._cachePrevious.get(a);if(s)return this._cache.set(a,s),s;let o=this._boundingVolumeFactory(t,e,i,r);return this._cache.set(a,o),this._hadAnyChanges=!0,o}},_p=class Np{constructor(e,i,r,a){this.min=r,this.max=a,this.points=e,this.planes=i}static fromAabb(e,i){let r=[];for(let a=0;a<8;a++)r.push([(a>>0&1)==1?i[0]:e[0],(a>>1&1)==1?i[1]:e[1],(a>>2&1)==1?i[2]:e[2]]);return new Np(r,[[-1,0,0,i[0]],[1,0,0,-e[0]],[0,-1,0,i[1]],[0,1,0,-e[1]],[0,0,-1,i[2]],[0,0,1,-e[2]]],e,i)}static fromCenterSizeAngles(e,i,r){let a=fl([],r[0],r[1],r[2]),n=dl([],[i[0],0,0],a),s=dl([],[0,i[1],0],a),o=dl([],[0,0,i[2]],a),l=[...e],u=[...e];for(let c=0;c<8;c++)for(let d=0;d<3;d++){let p=e[d]+n[d]*((c>>0&1)==1?1:-1)+s[d]*((c>>1&1)==1?1:-1)+o[d]*((c>>2&1)==1?1:-1);l[d]=Math.min(l[d],p),u[d]=Math.max(u[d],p)}let h=[];for(let c=0;c<8;c++){let d=[...e];si(d,d,Ut([],n,(c>>0&1)==1?1:-1)),si(d,d,Ut([],s,(c>>1&1)==1?1:-1)),si(d,d,Ut([],o,(c>>2&1)==1?1:-1)),h.push(d)}return new Np(h,[[...n,-oe(n,h[0])],[...s,-oe(s,h[0])],[...o,-oe(o,h[0])],[-n[0],-n[1],-n[2],-oe(n,h[7])],[-s[0],-s[1],-s[2],-oe(s,h[7])],[-o[0],-o[1],-o[2],-oe(o,h[7])]],l,u)}intersectsFrustum(e){let i=!0,r=this.points.length,a=this.planes.length,n=e.planes.length,s=e.points.length;for(let o=0;o<n;o++){let l=e.planes[o],u=0;for(let h=0;h<r;h++){let c=this.points[h];l[0]*c[0]+l[1]*c[1]+l[2]*c[2]+l[3]>=0&&u++}if(u===0)return 0;u<r&&(i=!1)}if(i)return 2;for(let o=0;o<a;o++){let l=this.planes[o],u=0;for(let h=0;h<s;h++){let c=e.points[h];l[0]*c[0]+l[1]*c[1]+l[2]*c[2]+l[3]>=0&&u++}if(u===0)return 0}return 1}intersectsPlane(e){let i=this.points.length,r=0;for(let a=0;a<i;a++){let n=this.points[a];e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+e[3]>=0&&r++}return r===i?2:r===0?0:1}};function wu(t,e,i){let r=t-e;return r<0?-r:Math.max(0,r-i)}function yp(t,e,i,r,a){let n=t-i,s;return s=n<0?Math.min(-n,1+n-a):n>a?Math.min(Math.max(n-a,0),1-n):0,Math.max(s,wu(e,r,a))}var G3=class{constructor(){this._boundingVolumeCache=new $3(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,e,i,r){let a=1<<i.z,n=1/a,s=i.x/a,o=i.y/a,l=.5,u=2;return u=Math.min(u,yp(t,e,s,o,n)),u=Math.min(u,yp(t,e,s+l,-o-n,n)),u=Math.min(u,yp(t,e,s+l,2-o-n,n)),u}getWrap(t,e,i){let r=1<<e.z,a=1/r,n=e.x/r,s=wu(t.x,n,a),o=wu(t.x,n-1,a),l=wu(t.x,n+1,a),u=Math.min(s,o,l);return u===l?1:u===o?-1:0}allowVariableZoom(t,e){return af(t,e)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,e,i,r){return this._boundingVolumeCache.getTileBoundingVolume(t,e,i,r)}_computeTileBoundingVolume(t,e,i,r){let a=Math.min(0,i),n=Math.max(0,i);if(r?.terrain){let s=new Se(t.z,e,t.z,t.x,t.y),o=r.terrain.getMinMaxElevation(s);a=o.minElevation??a,n=Math.max(o.maxElevation??n,n)}if(a/=Ve,n/=Ve,a+=1,n+=1,t.z<=0)return _p.fromAabb([-n,-n,-n],[n,n,n]);if(t.z===1)return _p.fromAabb([t.x===0?-n:0,t.y===0?0:-n,-n],[t.x===0?0:n,t.y===0?n:0,n]);{let s=[Nr(0,0,t.x,t.y,t.z),Nr(k,0,t.x,t.y,t.z),Nr(k,k,t.x,t.y,t.z),Nr(0,k,t.x,t.y,t.z)],o=[];for(let D of s)o.push(Ut([],D,n));if(n!==a)for(let D of s)o.push(Ut([],D,a));t.y===0&&o.push([0,1,0]),t.y===(1<<t.z)-1&&o.push([0,-1,0]);let l=[1,1,1],u=[-1,-1,-1];for(let D of o)for(let E=0;E<3;E++)l[E]=Math.min(l[E],D[E]),u[E]=Math.max(u[E],D[E]);let h=Nr(k/2,k/2,t.x,t.y,t.z),c=Ne([],[0,1,0],h);Le(c,c);let d=Ne([],h,c);Le(d,d);let p=Ne([],s[2],s[1]);Le(p,p);let f=Ne([],s[0],s[3]);Le(f,f),o.push(Ut([],h,n)),t.y>=(1<<t.z)/2&&o.push(Ut([],Nr(k/2,0,t.x,t.y,t.z),n)),t.y<(1<<t.z)/2&&o.push(Ut([],Nr(k/2,k,t.x,t.y,t.z),n));let m=Lv(h,o),g=Lv(d,o),_=[-h[0],-h[1],-h[2],m.max],y=[h[0],h[1],h[2],-m.min],x=[-d[0],-d[1],-d[2],g.max],v=[d[0],d[1],d[2],-g.min],w=[...p,0],b=[...f,0],T=[];return t.y===0?T.push(oi(b,w,_),oi(b,w,y)):T.push(oi(x,w,_),oi(x,w,y),oi(x,b,_),oi(x,b,y)),t.y===(1<<t.z)-1?T.push(oi(b,w,_),oi(b,w,y)):T.push(oi(v,w,_),oi(v,w,y),oi(v,b,_),oi(v,b,y)),new _p(T,[_,y,x,v,w,b],l,u)}}};function Lv(t,e){let i=1/0,r=-1/0;for(let a of e){let n=oe(t,a);i=Math.min(i,n),r=Math.max(r,n)}return{min:i,max:r}}var Bv=1e-12,tb=class eb{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,i,r){this._helper.interpolatePadding(e,i,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,i){this._helper.resize(e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,i){this._helper.overrideNearFarZ(e,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(e,i){this._cachedClippingPlane=Lr(),this._projectionMatrix=fs(),this._globeViewProjMatrix32f=Wc(),this._globeViewProjMatrixF64=fs(),this._globeViewProjMatrixF64Inverted=fs(),this._globeProjMatrixInverted=fs(),this._cameraPosition=St(),this.defaultConstrain=(r,a)=>{let n=st(r.lat,-ki,ki),s=st(+a,this.minZoom+De(0,n),this.maxZoom);return{center:new Y(r.lng,n),zoom:s}},this.applyConstrain=(r,a)=>this._helper.applyConstrain(r,a),this._helper=i??new uf({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(r,a)=>this.defaultConstrain(r,a)},e),this._coveringTilesDetailsProvider=new G3}clone(){let e=new eb;return e.apply(this,!1),e}apply(e,i){this._helper.apply(e,i)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=St();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:i,applyGlobeMatrix:r}=e,a=this._helper.getMercatorTileCoordinates(i);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:a,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!r,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:i?.canonical.z===0}}_computeClippingPlane(e){let i=this.pitchInRadians,r=this.cameraToCenterDistance/e,a=Math.sin(i)*r,n=Math.cos(i)*r+1,s=1/Math.sqrt(a*a+n*n)*1,o=-a,l=n,u=Math.sqrt(o*o+l*l);o/=u,l/=u;let h=[0,o,l];pl(h,h,[0,0,0],-this.bearingInRadians),en(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),oa(h,h,[0,0,0],this.center.lng*Math.PI/180);let c=1/Qi(h);return Ut(h,h,c),[...h,-s*c]}isLocationOccluded(e,i,r){let a=i?.getCoverageIndex();r??(r=a?i.getElevationForLngLat(e,this):0);let n=Vv(e,r);if(!this.isSurfacePointVisible(n))return!0;if(!a)return!1;let s=this._projectSurfacePointToScreen(n),o=this.cameraPosition,l=this.getRayDirectionFromPixel(s),u=jv(o,l,n);if(u<=0)return!0;let h=this.screenTerrainPointToMercatorCoordinate(s,i);return h!=null&&jv(o,l,Vv(h.toLngLat(),h.z))<u*.99}transformLightDirection(e){let i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,a=Math.cos(r),n=[Math.sin(i)*a,Math.sin(r),Math.cos(i)*a],s=[n[2],0,-n[0]],o=[0,0,0];Ne(o,s,n),Le(s,s),Le(o,o);let l=[s[0]*e[0]+o[0]*e[1]+n[0]*e[2],s[1]*e[0]+o[1]*e[1]+n[1]*e[2],s[2]*e[0]+o[2]*e[1]+n[2]*e[2]],u=[0,0,0];return Le(u,l),u}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,i,r){let a=kd(e,i,r.canonical),n=z3(a.x,a.y);return this.getCircleRadiusCorrection()/Math.cos(n[1])}projectTileCoordinates(e,i,r,a){let n=r.canonical,s=Nr(e,i,n.x,n.y,n.z),o=1+(a??0)/Ve,l=s[0]*o,u=s[1]*o,h=s[2]*o,c=[l,u,h,1];Te(c,c,this._globeViewProjMatrixF64);let d;if(o<=1){let p=this._cachedClippingPlane;d=p[0]*s[0]+p[1]*s[1]+p[2]*s[2]+p[3]<0}else d=this._isLineOfSightBlocked(l,u,h);return{point:new C(c[0]/c[3],c[1]/c[3]),signedDistanceFromCamera:c[3],isOccluded:d}}_isLineOfSightBlocked(e,i,r){let a=this._cameraPosition,n=e-a[0],s=i-a[1],o=r-a[2],l=n*n+s*s+o*o;if(l===0)return!1;let u=st(-(a[0]*n+a[1]*s+a[2]*o)/l,0,1),h=a[0]+u*n,c=a[1]+u*s,d=a[2]+u*o;return h*h+c*c+d*d<1}_calcMatrices(e=this._helper.autoCalculateNearFarZ){let i=_n(this.worldSize,this.center.lat),r=Br();e&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+i*2),ul(r,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let a=this.centerOffset;r[8]=-a.x*2/this._helper._width,r[9]=a.y*2/this._helper._height,this._projectionMatrix=ll(r),this._globeProjMatrixInverted=Br(),cs(this._globeProjMatrixInverted,r),se(r,r,[0,0,-this.cameraToCenterDistance]),dr(r,r,this.rollInRadians),sa(r,r,-this.pitchInRadians),dr(r,r,this.bearingInRadians),se(r,r,[0,0,-i]);let n=St();n[0]=i,n[1]=i,n[2]=i,sa(r,r,this.center.lat*Math.PI/180),Nc(r,r,-this.center.lng*Math.PI/180),we(r,r,n),this._globeViewProjMatrixF64=r,this._globeViewProjMatrix32f=new Float32Array(r),this._globeViewProjMatrixF64Inverted=Br(),cs(this._globeViewProjMatrixF64Inverted,r);let s=St();this._cameraPosition=St(),this._cameraPosition[2]=this.cameraToCenterDistance/i,pl(this._cameraPosition,this._cameraPosition,s,-this.rollInRadians),en(this._cameraPosition,this._cameraPosition,s,this.pitchInRadians),pl(this._cameraPosition,this._cameraPosition,s,-this.bearingInRadians),si(this._cameraPosition,this._cameraPosition,[0,0,1]),en(this._cameraPosition,this._cameraPosition,s,-this.center.lat*Math.PI/180),oa(this._cameraPosition,this._cameraPosition,s,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(i);let o=ll(this._globeViewProjMatrixF64Inverted);we(o,o,[1,1,-1]),this._cachedFrustum=rf.fromInvProjectionMatrix(o,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){ft("calculateFogMatrix is not supported on globe projection.");let i=Br();return Ei(i),i}getVisibleUnwrappedCoordinates(e){return[new Bs(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){if(e){ft("terrain is not fully supported on vertical perspective projection.");return}this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return(Qi(this._cameraPosition)-1)*Ve}getCameraLngLat(){let e=St();return Le(e,this._cameraPosition),Ks(e)}populateCache(e){}getBounds(){let e=this.width*.5,i=this.height*.5,r=[new C(0,0),new C(e,0),new C(this.width,0),new C(this.width,i),new C(this.width,this.height),new C(e,this.height),new C(0,this.height),new C(0,i)],a=[];for(let c of r)a.push(this.unprojectScreenPoint(c));let n=0,s=0,o=0,l=0,u=this.center;for(let c of a){let d=Je(u.lng,c.lng),p=Je(u.lat,c.lat);d<s&&(s=d),d>n&&(n=d),p<l&&(l=p),p>o&&(o=p)}let h=[u.lng+s,u.lat+l,u.lng+n,u.lat+o];return this.isSurfacePointOnScreen([0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new ji(h)}calculateCenterFromCameraLngLatAlt(e,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(e,i,r,a)}calculateCameraOptionsFromTo(e,i,r,a){let n=Y.convert(r),s=_e(Y.convert(e));Ut(s,s,1+i/Ve);let o=_e(n),l=Ut(St(),o,1+a/Ve),u=cl(St(),s,o),h=Qi(u);if(h<Bv||Gg(s,l)<Bv)throw Error("Can't calculate camera options with same From and To");let c=St();oa(u,u,c,-Gt(n.lng)),en(u,u,c,Gt(n.lat));let d=Mi(Math.acos(st(u[2]/h,-1,1))),p=Math.hypot(u[0],u[1])<h*1e-9?this.bearing:Mi(Math.atan2(-u[0],-u[1]));return{center:n,elevation:a,zoom:Ee(this.cameraToCenterDistance/h/_n(this.tileSize,n.lat)),pitch:d,bearing:p}}setLocationAtPoint(e,i,r){let a=_e(this.unprojectScreenPoint(i)),n=_e(e),s=St();Hg(s);let o=St();oa(o,a,s,-this.center.lng*Math.PI/180),en(o,o,s,this.center.lat*Math.PI/180);let l=n[0]*n[0]+n[2]*n[2],u=o[0]*o[0];if(l<u)return;let h=Math.sqrt(l-u),c=-h,d=ms(n[0],n[2],o[0],h),p=ms(n[0],n[2],o[0],c),f=St();oa(f,n,s,-d);let m=ms(f[1],f[2],o[1],o[2]),g=St();oa(g,n,s,-p);let _=ms(g[1],g[2],o[1],o[2]),y=Math.PI*.5,x=m>=-y&&m<=y,v=_>=-y&&_<=y,w,b;if(x&&v){let M=this.center.lng*Math.PI/180,R=this.center.lat*Math.PI/180,z=gs(d,M),P=gs(m,R),S=gs(p,M),I=gs(_,R);z+P<S+I?(w=d,b=m):(w=p,b=_)}else if(x)w=d,b=m;else if(v)w=p,b=_;else return;let T=w/Math.PI*180,D=b/Math.PI*180,E=this.center.lat;this.setCenter(new Y(T,st(D,-90,90))),this.setZoom(this.zoom+De(E,this.center.lat))}locationToScreenPoint(e,i){let r=_e(e);if(i){let a=i.getElevationForLngLatZoom(e,this._helper._tileZoom);Ut(r,r,1+a/Ve)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(e){let i=Lr();return Te(i,[...e,1],this._globeViewProjMatrixF64),i[0]/=i[3],i[1]/=i[3],new C((i[0]*.5+.5)*this.width,(-i[1]*.5+.5)*this.height)}screenPointToMercatorCoordinate(e,i){if(i){let r=this.screenTerrainPointToMercatorCoordinate(e,i);if(r)return r}return Et.fromLngLat(this.unprojectScreenPoint(e))}screenTerrainPointToMercatorCoordinate(e,i){let r=i.getCoverageIndex();if(!r)return null;let a=this.cameraPosition,n=this.getRayDirectionFromPixel(e),s=uu(a,n,1+r.maxElevation/Ve);if(!s)return null;let o=uu(a,n,1+r.minElevation/Ve),l=Math.max(s.tMin,0),u=o?o.tMin:s.tMax;if(u<=l)return null;let h={index:r,exaggeration:i.exaggeration,origin:a,direction:n},c=0;for(let d=0;d<=256;d++){let p=l+(u-l)*d/256;if(Ov(h,p)){let{hi:f}=qx(h,Ov,c,p,1e-12),{sample:m,mercator:g}=ib(h,f);return new Et(g.x,g.y,m.elevation)}c=p}return null}screenPointToLocation(e,i){return this.screenPointToMercatorCoordinate(e,i)?.toLngLat()}screenPointToLocationAtElevation(e,i){return this.screenPointToLocation(e)}isPointOnMapSurface(e,i){let r=this._cameraPosition;return!!uu(r,this.getRayDirectionFromPixel(e))}getRayDirectionFromPixel(e){let i=Lr();i[0]=e.x/this.width*2-1,i[1]=(e.y/this.height*2-1)*-1,i[2]=1,i[3]=1,Te(i,i,this._globeViewProjMatrixF64Inverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];let r=St();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];let a=St();return Le(a,r),a}isSurfacePointVisible(e){let i=this._cachedClippingPlane;return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let i=Lr();return Te(i,[...e,1],this._globeViewProjMatrixF64),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}unprojectScreenPoint(e){let i=this._cameraPosition,r=this.getRayDirectionFromPixel(e),a=uu(i,r);if(a){let h=St();si(h,i,[r[0]*a.tMin,r[1]*a.tMin,r[2]*a.tMin]);let c=St();return Le(c,h),Ks(c)}let n=this._cachedClippingPlane,s=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],o=-gl(n,i)/s,l=St();if(o>0)si(l,i,[r[0]*o,r[1]*o,r[2]*o]);else{let h=St();si(h,i,[r[0]*2,r[1]*2,r[2]*2]);let c=gl(this._cachedClippingPlane,h);tr(l,h,[this._cachedClippingPlane[0]*c,this._cachedClippingPlane[1]*c,this._cachedClippingPlane[2]*c])}let u=V3(n);return Ks(j3(u.center,u.radius,l))}getProjectionDataForCustomLayer(e=!0){let i=this.getProjectionData({overscaledTileID:new Se(0,0,0,0,0),applyGlobeMatrix:e});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(e){}};function ib(t,e){let i=St();ds(i,t.origin,t.direction,e);let r=Qi(i),a=St();Ut(a,i,1/r);let n=Ks(a),s=Et.fromLngLat(n),o=new Et(s.x,st(s.y,0,.999999999)),l=hf(t.index,t.exaggeration,o.x,o.y),u=Math.abs(n.lat)>85.051129?0:l.elevation;return{sample:{...l,elevation:u},radius:r,mercator:o}}function Ov(t,e){let{sample:i,radius:r}=ib(t,e);return Zx(i,(r-1)*Ve)}function Vv(t,e){let i=_e(t);return Ut(i,i,1+e/Ve)}function jv(t,e,i){let r=cl(St(),i,t);return oe(r,e)}var Uv=class rb{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,i,r){this._helper.interpolatePadding(e,i,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,i,r=!0){this._helper.resize(e,i,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,i){this._helper.overrideNearFarZ(e,i)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e){this._globeness=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(e){this._globeness=1,this.defaultConstrain=(i,r)=>this.currentTransform.defaultConstrain(i,r),this.applyConstrain=(i,r)=>this._helper.applyConstrain(i,r),this._helper=new uf({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(i,r)=>this.defaultConstrain(i,r)},e),this._globeness=1,this._mercatorTransform=new Su(void 0,this._helper),this._verticalPerspectiveTransform=new tb(void 0,this._helper)}clone(){let e=new rb;return e._globeness=this._globeness,e.apply(this,!1),e}apply(e,i){this._helper.apply(e,i)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){let i=this._mercatorTransform.getProjectionData(e),r=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?r.mainMatrix:i.mainMatrix,clippingPlane:r.clippingPlane,tileMercatorCoords:r.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:i.fallbackMatrix,clipAntimeridian:r.clipAntimeridian}}isLocationOccluded(e,i,r){return this.currentTransform.isLocationOccluded(e,i,r)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return la(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return la(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,i,r){let a=this._mercatorTransform.getPitchedTextCorrection(e,i,r),n=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,i,r);return la(a,n,this._globeness)}projectTileCoordinates(e,i,r,a){return this.currentTransform.projectTileCoordinates(e,i,r,a)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform._calcMatrices(),this._mercatorTransform._calcMatrices(this.autoCalculateNearFarZ&&!this.isGlobeRendering))}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this.currentTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this.currentTransform.getCameraAltitude()}getCameraLngLat(){return this.currentTransform.getCameraLngLat()}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(e,i,r,a){return this._helper.calculateCenterFromCameraLngLatAlt(e,i,r,a)}calculateCameraOptionsFromTo(e,i,r,a){return this.currentTransform.calculateCameraOptionsFromTo(e,i,r,a)}setLocationAtPoint(e,i,r){this.currentTransform.setLocationAtPoint(e,i,r)}locationToScreenPoint(e,i){return this.currentTransform.locationToScreenPoint(e,i)}screenPointToMercatorCoordinate(e,i){return this.currentTransform.screenPointToMercatorCoordinate(e,i)}screenTerrainPointToMercatorCoordinate(e,i){return this.currentTransform.screenTerrainPointToMercatorCoordinate(e,i)}screenPointToLocation(e,i){return this.currentTransform.screenPointToLocation(e,i)}screenPointToLocationAtElevation(e,i){return this.currentTransform.screenPointToLocationAtElevation(e,i)}isPointOnMapSurface(e,i){return this.currentTransform.isPointOnMapSurface(e,i)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getProjectionDataForCustomLayer(e=!0){let i=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return i;let r=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return r.fallbackMatrix=i.mainMatrix,r.projectionTransition=this._globeness,r}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}},ab=class xr{get useGlobeControls(){return!0}handlePanInertia(e,i){let r=N3(e,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new C(0,0)}}handleMapControlsRollPitchBearingZoom(e,i){let r=e.around,a=i.screenPointToLocation(r);e.bearingDelta&&i.setBearing(i.bearing+e.bearingDelta),e.pitchDelta&&i.setPitch(i.pitch+e.pitchDelta),e.rollDelta&&i.setRoll(i.roll+e.rollDelta);let n=i.zoom;e.zoomDelta&&i.setZoom(i.zoom+e.zoomDelta);let s=i.zoom-n;if(s===0)return;let o=Je(i.center.lng,a.lng),l=o/(Math.abs(o/180)+1),u=Je(i.center.lat,a.lat),h=i.getRayDirectionFromPixel(r),c=i.cameraPosition,d=oe(c,h)*-1,p=St();si(p,c,[h[0]*d,h[1]*d,h[2]*d]);let f=Qi(p),m=f-1,g=Math.exp(-Math.max(m-.3,0)*.5),_=_s(f,.95,.999,0,1),y=_n(i.worldSize,i.center.lat)/Math.min(i.width,i.height),x=_s(y,.9,.5,1,.25),v=Math.min(g,la(1,x,_)),w=(1-Be(-s))*v,b=i.center.lat,T=i.zoom,D=new Y(i.center.lng+l*w,st(i.center.lat+u*w,-ki,ki));i.setLocationAtPoint(a,r);let E=i.center,M=_s(Math.abs(o),45,85,0,1),R=Math.max(M,_)**.25,z=Je(E.lng,D.lng),P=Je(E.lat,D.lat);i.setCenter(new Y(E.lng+z*R,E.lat+P*R).wrap()),i.setZoom(T+De(b,i.center.lat))}handleMapControlsPan(e,i,r){e.panDelta&&B3(i,r,i.isPointOnMapSurface(e.around)?e.around:i.centerPoint,e.panDelta)}cameraForBoxAndBearing(e,i,r,a,n){let s=Yx(e,i,r,a,n),o=i.left/n.width*2-1,l=(n.width-i.right)/n.width*2-1,u=i.top/n.height*-2+1,h=(n.height-i.bottom)/n.height*-2+1,c=Je(r.getWest(),r.getEast())<0,d=c?r.getEast():r.getWest(),p=c?r.getWest():r.getEast(),f=Math.max(r.getNorth(),r.getSouth()),m=Math.min(r.getNorth(),r.getSouth()),g=d+Je(d,p)*.5,_=f+Je(f,m)*.5,y=n.clone();y.setCenter(s.center),y.setBearing(s.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(s.zoom);let x=y.modelViewProjectionMatrix,v=[_e(r.getNorthWest()),_e(r.getNorthEast()),_e(r.getSouthWest()),_e(r.getSouthEast()),_e(new Y(p,_)),_e(new Y(d,_)),_e(new Y(g,f)),_e(new Y(g,m))],w=_e(s.center),b=1/0;for(let T of v)o<0&&(b=xr.getLesserNonNegativeNonNull(b,xr.solveVectorScale(T,w,x,"x",o))),l>0&&(b=xr.getLesserNonNegativeNonNull(b,xr.solveVectorScale(T,w,x,"x",l))),u>0&&(b=xr.getLesserNonNegativeNonNull(b,xr.solveVectorScale(T,w,x,"y",u))),h<0&&(b=xr.getLesserNonNegativeNonNull(b,xr.solveVectorScale(T,w,x,"y",h)));if(!Number.isFinite(b)||b===0){Hx();return}return s.zoom=Math.min(y.zoom+Ee(b),e.maxZoom),s}handleJumpToCenterZoom(e,i){let r=e.center.lat,a=e.applyConstrain(i.center?Y.convert(i.center):e.center,e.zoom).center;e.setCenter(a.wrap());let n=i.zoom===void 0?e.zoom+De(r,a.lat):+i.zoom;e.zoom!==n&&e.setZoom(n)}handleEaseTo(e,i){let r=e.zoom,a=e.center,n=e.padding,s={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:i.roll===void 0?e.roll:i.roll,pitch:i.pitch===void 0?e.pitch:i.pitch,bearing:i.bearing===void 0?e.bearing:i.bearing},l=i.zoom!==void 0,u=!e.isPaddingEqual(i.padding),h=!1,c=i.center?Y.convert(i.center):a,d=e.applyConstrain(c,r).center;Eu(e,d);let p=e.clone();p.setCenter(d),p.setZoom(l?+i.zoom:r+De(a.lat,c.lat)),p.setBearing(i.bearing);let f=new C(st(e.centerPoint.x+i.offsetAsPoint.x,0,e.width),st(e.centerPoint.y+i.offsetAsPoint.y,0,e.height));p.setLocationAtPoint(d,f);let m=(i.offset&&i.offsetAsPoint.mag())>0?p.center:d,g=l?+i.zoom:r+De(a.lat,m.lat),_=r+De(a.lat,0),y=g+De(m.lat,0),x=Je(a.lng,m.lng),v=Je(a.lat,m.lat),w=Be(y-_);return h=g!==r,{easeFunc:b=>{if(Yc(s,o)||Xx({startEulerAngles:s,endEulerAngles:o,tr:e,k:b,useSlerp:s.roll!=o.roll}),u&&e.interpolatePadding(n,i.padding,b),i.around)ft("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(i.around,i.aroundPoint);else{let T=b*(y>_?Math.min(2,w):Math.max(.5,w))**(1-b),D=kv(a,x,v,T);e.setCenter(D.wrap())}if(h){let T=Zt.number(_,y,b)+De(0,e.center.lat);e.setZoom(T)}},isZooming:h,elevationCenter:m}}handleFlyTo(e,i){let r=i.zoom!==void 0,a=e.center,n=e.zoom,s=e.padding,o=!e.isPaddingEqual(i.padding),l=e.applyConstrain(Y.convert(i.center||i.locationAtOffset),n).center,u=r?+i.zoom:e.zoom+De(e.center.lat,l.lat),h=e.clone();h.setCenter(l),h.setZoom(u),h.setBearing(i.bearing);let c=new C(st(e.centerPoint.x+i.offsetAsPoint.x,0,e.width),st(e.centerPoint.y+i.offsetAsPoint.y,0,e.height));h.setLocationAtPoint(l,c);let d=h.center;Eu(e,d);let p=F3(e,a,d),f=n+De(a.lat,0),m=u+De(d.lat,0),g=Be(m-f),_=typeof i.minZoom=="number"?+i.minZoom:e.minZoom,y=Math.max(_,e.minZoom)+De(d.lat,0),x=Math.min(y,f,m)+De(0,d.lat),v=e.applyConstrain(d,x).zoom+De(d.lat,0),w=Be(v-f),b=Je(a.lng,d.lng),T=Je(a.lat,d.lat);return{easeFunc:(D,E,M,R)=>{let z=kv(a,b,T,M);o&&e.interpolatePadding(s,i.padding,D);let P=D===1?d:z;e.setCenter(P.wrap());let S=f+Ee(E);e.setZoom(D===1?u:S+De(0,P.lat))},scaleOfZoom:g,targetCenter:d,scaleOfMinZoom:w,pixelPathLength:p}}static solveVectorScale(e,i,r,a,n){let s=n,o=a==="x"?[r[0],r[4],r[8],r[12]]:[r[1],r[5],r[9],r[13]],l=[r[3],r[7],r[11],r[15]],u=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],h=e[0]*l[0]+e[1]*l[1]+e[2]*l[2],c=i[0]*o[0]+i[1]*o[1]+i[2]*o[2],d=i[0]*l[0]+i[1]*l[1]+i[2]*l[2],p=(c+o[3]-s*d-s*l[3])/(c-u-s*d+s*h);return c+s*h===u+s*d||l[3]*(u-c)+o[3]*(d-h)+u*d===c*h?null:p}static getLesserNonNegativeNonNull(e,i){return i!==null&&i>=0&&i<e?i:e}},Nv=class{constructor(t){this._globe=t,this._mercatorCameraHelper=new Du,this._verticalPerspectiveCameraHelper=new ab}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,e){return this.currentHelper.handlePanInertia(t,e)}handleMapControlsRollPitchBearingZoom(t,e){this.currentHelper.handleMapControlsRollPitchBearingZoom(t,e)}handleMapControlsPan(t,e,i){this.currentHelper.handleMapControlsPan(t,e,i)}cameraForBoxAndBearing(t,e,i,r,a){return this.currentHelper.cameraForBoxAndBearing(t,e,i,r,a)}handleJumpToCenterZoom(t,e){this.currentHelper.handleJumpToCenterZoom(t,e)}handleEaseTo(t,e){return this.currentHelper.handleEaseTo(t,e)}handleFlyTo(t,e){return this.currentHelper.handleFlyTo(t,e)}};function Z3(t,e,i){let r={constrainOverride:e};if(Array.isArray(t)){let a=new zv({type:t},i);return{projection:a,transform:new Uv(r),cameraHelper:new Nv(a)}}switch(t){case"mercator":return{projection:new jp,transform:new Su(r),cameraHelper:new Du};case"globe":{let a=new zv({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:a,transform:new Uv(r),cameraHelper:new Nv(a)}}case"vertical-perspective":return{projection:new Kx,transform:new tb(r),cameraHelper:new ab};default:return ft(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new jp,transform:new Su(r),cameraHelper:new Du}}}var q3=IA(),$p=class extends ce{constructor(t,e={}){super(),this._rtlPluginLoaded=()=>{for(let r in this.tileManagers){let a=this.tileManagers[r].getSource().type;(a==="vector"||a==="geojson")&&this.tileManagers[r].reload()}},this.map=t,this.dispatcher=new gx(Jp(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(r,a)=>this.getGlyphs(r,a)),this.dispatcher.registerMessageHandler("GI",(r,a)=>this.getImages(r,a)),this.dispatcher.registerMessageHandler("GDA",(r,a)=>this.getDashes(r,a)),this.imageManager=new FA,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(t._missingStyleImageResolver),this.patternAtlas=new zA(this.imageManager);let i=t._container?.lang||typeof document<"u"&&document.documentElement?.lang||void 0;this.glyphManager=new NA(t._requestManager,e.localIdeographFontFamily,i),this.lineAtlas=new WA(256,512),this.crossTileSymbolIndex=new Ux,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",bl()),Qs().on(Rp,this._rtlPluginLoaded),this.on("data",r=>{if(r.dataType!=="source"||r.sourceDataType!=="metadata")return;let a=this.tileManagers[r.sourceId];if(!a)return;let n=a.getSource();if(n?.vectorLayerIds)for(let s in this._layers){let o=this._layers[s];o.source===n.id&&this._validateLayer(o)}})}_setInitialValues(){this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new Ko,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this._symbolPlacementTriggered=!1,this._placedProjectionTransition=void 0,this.crossTileSymbolIndex=new(this.crossTileSymbolIndex?.constructor||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,e){this._checkLoaded();let i=e===null?this.stylesheet.state?.[t]?.default??null:e;if(wi(i,this._globalState[t]))return this;this._globalState[t]=i,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let e=[];for(let i in t)wi(this._globalState[i],t[i].default)||(e.push(i),this._globalState[i]=t[i].default);this._applyGlobalStateChanges(e)}_applyGlobalStateChanges(t){if(t.length===0)return;let e=new Set,i={};for(let r of t){i[r]=this._globalState[r];for(let a in this._layers){let n=this._layers[a],s=n.getLayoutAffectingGlobalStateRefs(),o=n.getPaintAffectingGlobalStateRefs(),l=n.getVisibilityAffectingGlobalStateRefs();if(s.has(r)&&e.add(n.source),o.has(r))for(let{name:u,value:h}of o.get(r))this._updatePaintProperty(n,u,h);l?.has(r)&&(n.recalculateVisibility(),this._updateLayer(n))}}this.dispatcher.broadcast("UGS",i);for(let r in this.tileManagers)e.has(r)&&(this._reloadSource(r),this._changed=!0)}async loadURL(t,e={},i){this.fire(new Pi("dataloading")),e.validate=typeof e.validate!="boolean"||e.validate,this._loadStyleRequest=new AbortController;let r=this._loadStyleRequest;try{let a=await this.map._requestManager.transformRequest(t,"Style");xl(r.signal);let n=await vs(a,r);this._loadStyleRequest===r&&(this._loadStyleRequest=null),this._load(n.data,e,i)}catch(a){this._loadStyleRequest===r&&(this._loadStyleRequest=null),a&&!r.signal.aborted&&this.fire(new J(be(a)))}}loadJSON(t,e={},i){this.fire(new Pi("dataloading")),this._frameRequest=new AbortController,Ge.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,e.validate=e.validate!==!1,this._load(t,e,i)}).catch(()=>{})}loadEmpty(){this.fire(new Pi("dataloading")),this._load(q3,{validate:!1})}_load(t,e,i){let r=e.transformStyle?e.transformStyle(i,t):t;if(!(e.validate&&bd(this,r))){r={...r},this._loaded=!0,this.stylesheet=r;for(let a in r.sources)this.addSource(a,r.sources[a],{validate:!1});r.sprite?this._loadSprite(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this.glyphManager.setFontFaces(r["font-faces"]),this._createLayers(),this.light=new GA(this.stylesheet.light??{},this._globalState),this._setProjectionInternal(this.stylesheet.projection?.type||"mercator"),this.sky=new qA(this.stylesheet.sky,this._globalState),this.map.setTerrain(this.stylesheet.terrain??null,{validate:!1}),this.fire(new Pi("data")),this.fire(new Ap)}}_createLayers(){let t=K1(this.stylesheet.layers);this.setGlobalState(this.stylesheet.state??null),this.dispatcher.broadcast("SL",t),this._order=t.map(e=>e.id),this._layers={},this._serializedLayers=null;for(let e of t){let i=Ql(e,this._globalState);if(i.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=i,jl(i)&&this.tileManagers[i.source]){let r=e.paint?.["raster-fade-duration"]??i.paint.get("raster-fade-duration");this.tileManagers[i.source].setRasterFadeDuration(r)}}}async _loadSprite(t,e=!1,i=void 0){this.imageManager.setLoaded(!1);let r=new AbortController;this._spriteRequest=r;let a;try{let n=await AA(t,this.map._requestManager,this.map.getPixelRatio(),r);if(!n)return;for(let s in n){let{loaded:o,removed:l}=this.imageManager.setSpriteImages(s,n[s]);this._markImagesChanged(l),e&&this._markImagesChanged(o)}}catch(n){a=n,r.signal.aborted||this.fire(new J(a))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),e&&(this._changed=!0),this.dispatcher.broadcast("SI",this.imageManager.listImages()),this.fire(new Pi("data")),i?.(a)}}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new Pi("data"))}_validateLayer(t){let e=this.tileManagers[t.source];if(!e)return;let i=t.sourceLayer;if(!i)return;let r=e.getSource();(r.type==="geojson"||r.vectorLayerIds&&!r.vectorLayerIds.includes(i))&&this.fire(new J(Error(`Source layer "${i}" does not exist on source "${r.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,e=!1){let i=this._serializedAllLayers();if(!t||t.length===0)return Object.values(e?Ue(i):i);let r=[];for(let a of t)if(i[a]){let n=e?Ue(i[a]):i[a];r.push(n)}return r}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let e=Object.keys(this._layers);for(let i of e){let r=this._layers[i];r.type!=="custom"&&(t[i]=r.serialize())}return t}hasTransitions(){if(this.light?.hasTransition()||this.sky?.hasTransition()||this.projection?.hasTransition())return!0;for(let t in this.tileManagers)if(this.tileManagers[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(t){if(!this._loaded)return;let e=this._changed;if(e){this._imagesListDirty&&(this._imagesListDirty=(this.dispatcher.broadcast("SI",this.imageManager.listImages()),!1));let a=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(a.length||n.length)&&this._updateWorkerLayers(a,n);for(let s in this._updatedSources){let o=this._updatedSources[s];if(o==="reload")this._reloadSource(s);else if(o==="clear")this._clearSource(s);else throw Error(`Invalid action ${o}`)}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let s in this._updatedPaintProps)this._layers[s].updateTransitions(t);this._resetUpdates()}let i={};for(let a in this.tileManagers){let n=this.tileManagers[a];i[a]=n.used,n.used=!1}let r=this.imageManager.listImages();for(let a of this._order){let n=this._layers[a];n.recalculate(t,r),!n.isHidden(t.zoom)&&n.source&&(this.tileManagers[n.source].used=!0)}for(let a in i){let n=this.tileManagers[a];!!i[a]!=!!n.used&&n.fire(new Nt("data",{sourceDataType:"visibility",sourceId:a}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,e&&this.fire(new Pi("data"))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,e={}){this._checkLoaded();let i=this.serialize();if(t=e.transformStyle?e.transformStyle(i,t):t,(e.validate??!0)&&bd(this,t))return!1;t=Ue(t),t.layers=K1(t.layers);let r=CA(i,t),a=this._getOperationsToPerform(r);if(a.unimplemented.length>0)throw Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(a.operations.length===0)return!1;for(let n of a.operations)n();return this.stylesheet=t,this._serializedLayers=null,this.fire(new Ap({style:this})),!0}_getOperationsToPerform(t){let e=[],i=[];for(let r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":{let[a,n]=r.args;e.push(()=>this.addLayer(a,n));break}case"removeLayer":{let[a]=r.args;e.push(()=>this.removeLayer(a));break}case"setPaintProperty":{let[a,n,s]=r.args;e.push(()=>this.setPaintProperty(a,n,s));break}case"setLayoutProperty":{let[a,n,s]=r.args;e.push(()=>this.setLayoutProperty(a,n,s));break}case"setFilter":{let[a,n]=r.args;e.push(()=>this.setFilter(a,n));break}case"addSource":{let[a,n]=r.args;e.push(()=>this.addSource(a,n));break}case"removeSource":{let[a]=r.args;e.push(()=>this.removeSource(a));break}case"setLayerZoomRange":{let[a,n,s]=r.args;e.push(()=>this.setLayerZoomRange(a,n,s));break}case"setLight":{let[a]=r.args;e.push(()=>this.setLight(a));break}case"setGeoJSONSourceData":{let[a,n]=r.args;e.push(()=>this.setGeoJSONSourceData(a,n));break}case"setGlyphs":{let[a]=r.args;e.push(()=>this.setGlyphs(a));break}case"setFontFaces":{let[a]=r.args;e.push(()=>this.setFontFaces(a));break}case"setSprite":{let[a]=r.args;e.push(()=>this.setSprite(a));break}case"setTerrain":{let[a]=r.args;e.push(()=>this.map.setTerrain(a));break}case"setSky":{let[a]=r.args;e.push(()=>this.setSky(a));break}case"setProjection":{let[a]=r.args;e.push(()=>this.setProjection(a));break}case"setGlobalState":{let[a]=r.args;e.push(()=>this.setGlobalState(a));break}case"setTransition":e.push(()=>{});break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,e){if(this.getImage(t)){this.fire(new J(Error(`An image named "${t}" already exists.`)));return}this.imageManager.addImage(t,e),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}setMissingImageResolver(t){this.imageManager.setMissingImageResolver(t)}removeImage(t){if(!this.getImage(t)){this.fire(new J(Error(`An image named "${t}" does not exist.`)));return}this.imageManager.removeImage(t),this._afterImageUpdated(t)}_markImagesChanged(t){for(let e of t)this._changedImages[e]=!0}_afterImageUpdated(t){this._changedImages[t]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Pi("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,e,i={}){if(this._checkLoaded(),this.tileManagers[t]!==void 0)throw Error(`Source "${t}" already exists.`);if(!e.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(e).join(", ")}.`);if(xd.has(e.type)&&this._validate($e.source,`sources.${t}`,e,null,i))return;this.map?._collectResourceTiming&&(e.collectResourceTiming=!0);let r=this.tileManagers[t]=new Lp(t,e,this.dispatcher);r.style=this,r.setEventedParent(this,()=>({isSourceLoaded:r.loaded(),source:r.serialize(),sourceId:t})),r.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw Error(`There is no source with this ID=${t}`);for(let i in this._layers)if(this._layers[i].source===t)return this.fire(new J(Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));let e=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],e.fire(new Nt("data",{sourceDataType:"metadata",sourceId:t})),e.setEventedParent(null),e.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),this.tileManagers[t]===void 0)throw Error(`There is no source with this ID=${t}`);let i=this.tileManagers[t].getSource();if(i.type!=="geojson")throw Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(e),this._changed=!0}getSource(t){return this.tileManagers[t]?.getSource()}addLayer(t,e,i={}){this._checkLoaded();let r=t.id;if(this.getLayer(r)){this.fire(new J(Error(`Layer "${r}" already exists on this map.`)));return}let a;if(t.type==="custom"){if(Ll(this,g1(t)))return;a=Ql(t,this._globalState)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(r,t.source),t=Ue(t),t=q(t,{source:r})),this._validate($e.layer,`layers.${r}`,t,{arrayIndex:-1},i))return;a=Ql(t,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:r}})}let n=e?this._order.indexOf(e):this._order.length;if(e&&n===-1){this.fire(new J(Error(`Cannot add layer "${r}" before non-existing layer "${e}".`)));return}if(this._order.splice(n,0,r),this._layerOrderChanged=!0,this._layers[r]=a,this._removedLayers[r]&&a.source&&a.type!=="custom"){let s=this._removedLayers[r];delete this._removedLayers[r],s.type===a.type?(this._updatedSources[a.source]="reload",this.tileManagers[a.source].pause()):this._updatedSources[a.source]="clear"}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}moveLayer(t,e){if(this._checkLoaded(),this._changed=!0,!this._layers[t]){this.fire(new J(Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));return}if(t===e)return;if(e&&!this._order.includes(e)){this.fire(new J(Error(`Cannot move layer "${t}" before non-existing layer "${e}".`)));return}let i=this._order.indexOf(t);this._order.splice(i,1);let r=e?this._order.indexOf(e):this._order.length;this._order.splice(r,0,t),this._layerOrderChanged=!0}removeLayer(t){this._checkLoaded();let e=this._layers[t];if(!e){this.fire(new J(Error(`Cannot remove non-existing layer "${t}".`)));return}e.setEventedParent(null);let i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=e,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],e.type==="symbol"&&e.source&&this.tileManagers[e.source]?.resetMaxContentElevation(),e.onRemove&&e.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,e,i){this._checkLoaded();let r=this.getLayer(t);if(!r){this.fire(new J(Error(`Cannot set the zoom range of non-existing layer "${t}".`)));return}(r.minzoom!==e||r.maxzoom!==i)&&(e!=null&&(r.minzoom=e),i!=null&&(r.maxzoom=i),this._updateLayer(r))}setFilter(t,e,i={}){this._checkLoaded();let r=this.getLayer(t);if(!r){this.fire(new J(Error(`Cannot filter non-existing layer "${t}".`)));return}if(!wi(r.filter,e)){if(e==null){r.setFilter(void 0),this._updateLayer(r);return}this._validate($e.filter,`layers.${r.id}.filter`,e,null,i)||(r.setFilter(Ue(e)),this._updateLayer(r))}}getFilter(t){return Ue(this.getLayer(t).filter)}setLayoutProperty(t,e,i,r={}){this._checkLoaded();let a=this.getLayer(t);if(!a){this.fire(new J(Error(`Cannot style non-existing layer "${t}".`)));return}wi(a.getLayoutProperty(e),i)||(a.setLayoutProperty(e,i,r),this._updateLayer(a))}getLayoutProperty(t,e){let i=this.getLayer(t);if(!i){this.fire(new J(Error(`Cannot get style of non-existing layer "${t}".`)));return}return i.getLayoutProperty(e)}setPaintProperty(t,e,i,r={}){this._checkLoaded();let a=this.getLayer(t);if(!a){this.fire(new J(Error(`Cannot style non-existing layer "${t}".`)));return}wi(a.getPaintProperty(e),i)||this._updatePaintProperty(a,e,i,r)}_updatePaintProperty(t,e,i,r={}){t.setPaintProperty(e,i,r)&&this._updateLayer(t),jl(t)&&e==="raster-fade-duration"&&this.tileManagers[t.source].setRasterFadeDuration(i),this._changed=!0,this._updatedPaintProps[t.id]=!0,t.type==="symbol"&&this.triggerSymbolPlacement(),this._serializedLayers=null}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,e){this._checkLoaded();let i=t.source,r=t.sourceLayer,a=this.tileManagers[i];if(a===void 0){this.fire(new J(Error(`The source '${i}' does not exist in the map's style.`)));return}let n=a.getSource().type;if(n==="geojson"&&r){this.fire(new J(Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(n==="vector"&&!r){this.fire(new J(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(t.id===void 0){this.fire(new J(Error("The feature id parameter must be provided.")));return}let s=["__proto__","constructor","prototype"];if(e&&Object.keys(e).some(o=>s.includes(o))){this.fire(new J(Error(`The feature state should not include one of the following keys: ${s}`)));return}a.setFeatureState(r,t.id,e)}removeFeatureState(t,e){this._checkLoaded();let i=t.source,r=this.tileManagers[i];if(r===void 0){this.fire(new J(Error(`The source '${i}' does not exist in the map's style.`)));return}let a=r.getSource().type,n=a==="vector"?t.sourceLayer:void 0;if(a==="vector"&&!n){this.fire(new J(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(e&&typeof t.id!="string"&&typeof t.id!="number"){this.fire(new J(Error("A feature id is required to remove its specific state property.")));return}r.removeFeatureState(n,t.id,e)}getFeatureState(t){this._checkLoaded();let e=t.source,i=t.sourceLayer,r=this.tileManagers[e];if(r===void 0){this.fire(new J(Error(`The source '${e}' does not exist in the map's style.`)));return}if(r.getSource().type==="vector"&&!i){this.fire(new J(Error("The sourceLayer parameter must be provided for vector source types.")));return}return t.id===void 0&&this.fire(new J(Error("The feature id parameter must be provided."))),r.getFeatureState(i,t.id)}getTransition(){return q({duration:300,delay:0},this.stylesheet?.transition)}serialize(){if(!this._loaded)return;let t=vl(this.tileManagers,a=>a.serialize()),e=this._serializeByIds(this._order,!0),i=this.map.getTerrain()||void 0,r=this.stylesheet;return Xc({version:r.version,name:r.name,metadata:r.metadata,light:r.light,sky:r.sky,center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,sprite:r.sprite,glyphs:r.glyphs,"font-faces":r["font-faces"],transition:r.transition,projection:r.projection,state:r.state,sources:t,layers:e,terrain:i},a=>a!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.tileManagers[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let e=n=>this._layers[n].type==="fill-extrusion",i={},r=[];for(let n=this._order.length-1;n>=0;n--){let s=this._order[n];if(e(s)){i[s]=n;for(let o of t){let l=o[s];if(l)for(let u of l)r.push(u)}}}r.sort((n,s)=>s.intersectionZ-n.intersectionZ);let a=[];for(let n=this._order.length-1;n>=0;n--){let s=this._order[n];if(e(s))for(let o=r.length-1;o>=0;o--){let l=r[o].feature;if(i[l.layer.id]<n)break;a.push(l),r.pop()}else for(let o of t){let l=o[s];if(l)for(let u of l)a.push(u.feature)}}return a}queryRenderedFeatures(t,e,i){e?.filter&&this._validate($e.filter,"queryRenderedFeatures.filter",e.filter,null,e);let r={};if(e?.layers){if(!(Array.isArray(e.layers)||e.layers instanceof Set))return this.fire(new J(Error("parameters.layers must be an Array or a Set of strings"))),[];for(let l of e.layers){let u=this._layers[l];if(!u)return this.fire(new J(Error(`The layer '${l}' does not exist in the map's style and cannot be queried for features.`))),[];r[u.source]=!0}}let a=[];e.availableImages=this.imageManager.listImages();let n=this._serializedAllLayers(),s=e.layers instanceof Set?e.layers:Array.isArray(e.layers)?new Set(e.layers):null,o={...e,layers:s,globalState:this._globalState};for(let l in this.tileManagers)(!e.layers||r[l])&&a.push(aM(this.tileManagers[l],this._layers,n,t,o,i,this.map.terrain?(u,h,c)=>this.map.terrain.getElevation(u,h,c):void 0));return this.placement&&a.push(nM(this._layers,n,this.tileManagers,t,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,e){e?.filter&&this._validate($e.filter,"querySourceFeatures.filter",e.filter,null,e);let i=this.tileManagers[t];return i?sM(i,e?{...e,globalState:this._globalState}:{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,e={}){this._checkLoaded();let i=this.light.getLight(),r=!1;for(let n in t)if(!wi(t[n],i[n])){r=!0;break}if(!r)return;let a={now:Ft(),transition:q({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,e),this.light.updateTransitions(a)}getProjection(){return this.stylesheet?.projection}setProjection(t){this._checkLoaded();let e=t??{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(e.type)}getSky(){return this.stylesheet?.sky}setSky(t,e={}){this._checkLoaded();let i=this.getSky(),r=!1;if(!t&&!i)return;if(t&&!i)r=!0;else if(!t&&i)r=!0;else for(let n in t)if(!wi(t[n],i[n])){r=!0;break}if(!r)return;let a={now:Ft(),transition:q({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,e),this.sky.updateTransitions(a)}_setProjectionInternal(t){let e=Z3(t,this.map._camera?.transform.constrainOverride,this._globalState);this.projection=e.projection,this.map.migrateProjection(e.transform,e.cameraHelper);for(let i in this.tileManagers)this.tileManagers[i].reload()}_validate(t,e,i,r,a={}){return a.validate!==!1&&on(this,t,{key:e,style:this.serialize(),value:i,...r},a)}_remove(t=!0){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),Qs().off(Rp,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.tileManagers){let i=this.tileManagers[e];i.setEventedParent(null),i.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(let e in this.tileManagers)this.tileManagers[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}triggerSymbolPlacement(){this._symbolPlacementTriggered=!0}_placementInputsChanged(t,e,i){let r=this.pauseablePlacement;return!r||this._symbolPlacementTriggered||this._placedProjectionTransition!==this.projection?.transitionState||r._showCollisionBoxes!==e||r.placement.collisionGroups.crossSourceCollisions!==i||r.placement.transform.renderWorldCopies!==t.renderWorldCopies||!Ug(r.placement.transform.modelViewProjectionMatrix,t.modelViewProjectionMatrix)}_updatePlacement(t,e,i,r,a=!1){let n=!1,s=!1,o={};for(let h of this._order){let c=this._layers[h];if(c.type!=="symbol")continue;if(!o[c.source]){let p=this.tileManagers[c.source];o[c.source]=p.getRenderableIds(!0).map(f=>p.getTileByID(f)).sort((f,m)=>m.tileID.overscaledZ-f.tileID.overscaledZ||(f.tileID.isLessThan(m.tileID)?-1:1))}let d=this.crossTileSymbolIndex.addLayer(c,o[c.source],t.center.lng);n||(n=d)}this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||(a=this._layerOrderChanged||i===0);let l=n||this._placementInputsChanged(t,e,r),u=this.pauseablePlacement?.isDone()&&!this.placement.stillRecent(Ft(),t.zoom);if((a||!this.pauseablePlacement||u&&(l||this.placement.stale))&&(this._symbolPlacementTriggered=!1,this._placedProjectionTransition=this.projection?.transitionState,this.pauseablePlacement=new f3(t,this.map.terrain,this._order,a,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?l&&this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,o),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Ft()),s=!0),n&&this.pauseablePlacement.placement.setStale()),s||n)for(let h of this._order){let c=this._layers[h];c.type==="symbol"&&this.placement.updateLayerOpacities(c,o[c.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Ft())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}async getImages(t,e){let i=await this.imageManager.getImages(e.icons);this._updateTilesForChangedImages();let r=this.tileManagers[e.source];return r&&r.setDependencies(e.tileID.key,e.type,e.icons),i}async getGlyphs(t,e){let i=await this.glyphManager.getGlyphs(e.stacks),r=this.tileManagers[e.source];return r&&r.setDependencies(e.tileID.key,e.type,[""]),i}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,e={}){this._checkLoaded(),!(t&&this._validate($e.glyphs,"glyphs",t,null,e))&&(this._changed=!0,this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getFontFaces(){return this.stylesheet["font-faces"]||null}setFontFaces(t){this._checkLoaded(),this._changed=!0,this._glyphsDidChange=!0,this.stylesheet["font-faces"]=t,this.glyphManager.setFontFaces(t)}async getDashes(t,e){let i={};for(let[r,a]of Object.entries(e.dashes))i[r]=this.lineAtlas.getDash(a.dasharray,a.round);return i}addSprite(t,e,i={},r){this._checkLoaded();let a=[{id:t,url:e}],n=[...yu(this.stylesheet.sprite),...a];this._validate($e.sprite,"sprite",n,null,i)||(this.stylesheet.sprite=n,this._loadSprite(a,!0,r))}removeSprite(t){this._checkLoaded();let e=yu(this.stylesheet.sprite);if(!e.find(r=>r.id===t)){this.fire(new J(Error(`Sprite "${t}" doesn't exists on this map.`)));return}let i=this.imageManager.removeSpriteImages(t);this._markImagesChanged(i),e.splice(e.findIndex(r=>
vendor: 10,646 bytes, lines 1636-1638
1636r.id===t),1),this.stylesheet.sprite=e.length>0?e:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Pi("data"))}getSprite(){return yu(this.stylesheet.sprite)}setSprite(t,e={},i){this._checkLoaded(),!(t&&this._validate($e.sprite,"sprite",t,null,e))&&(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,i):(this._unloadSprite(),i&&i(null)))}destroy(){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null));for(let t in this.tileManagers){let e=this.tileManagers[t];e.setEventedParent(null),e.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy();for(let t in this._layers){let e=this._layers[t];e.setEventedParent(null),e.onRemove&&e.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},W3=Yt([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),H3=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,a,n,s,o,l){this.context=t;let u=this.boundPaintVertexBuffers.length!==r.length;for(let h=0;!u&&h<r.length;h++)this.boundPaintVertexBuffers[h]!==r[h]&&(u=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||u||this.boundIndexBuffer!==a||this.boundVertexOffset!==n||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==o||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,a,n,s,o,l):t.bindVertexArray.set(this.vao)}freshBind(t,e,i,r,a,n,s,o){let l=t.numAttributes,u=this.context,h=u.gl;this.vao&&this.destroy(),this.vao=u.createVertexArray(),u.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=s,this.boundDynamicVertexBuffer3=o,e.enableAttributes(h,t);for(let c of i)c.enableAttributes(h,t);n&&n.enableAttributes(h,t),s&&s.enableAttributes(h,t),o&&o.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,a);for(let c of i)c.bind(),c.setVertexAttribPointers(h,t,a);n&&(n.bind(),n.setVertexAttribPointers(h,t,a)),r&&r.bind(),s&&(s.bind(),s.setVertexAttribPointers(h,t,a)),o&&(o.bind(),o.setVertexAttribPointers(h,t,a)),u.currentNumAttributes=l}destroy(){this.vao&&(this.vao=(this.context.deleteVertexArray(this.vao),null))}},X3=(t,e)=>({u_depth:new K(t,e.u_depth),u_terrain:new K(t,e.u_terrain)}),Y3=(t,e)=>({u_texture:new K(t,e.u_texture),u_ele_delta:new N(t,e.u_ele_delta),u_fog_matrix:new Si(t,e.u_fog_matrix),u_fog_color:new yr(t,e.u_fog_color),u_fog_ground_blend:new N(t,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new N(t,e.u_fog_ground_blend_opacity),u_horizon_color:new yr(t,e.u_horizon_color),u_horizon_fog_blend:new N(t,e.u_horizon_fog_blend),u_is_globe_mode:new N(t,e.u_is_globe_mode)}),K3=(t,e)=>({u_ele_delta:new N(t,e.u_ele_delta)}),J3=(t,e,i,r,a)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:e,u_fog_color:i?i.properties.get("fog-color"):lt.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:i?i.calculateFogBlendOpacity(r):0,u_horizon_color:i?i.properties.get("horizon-color"):lt.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),Q3=t=>({u_ele_delta:t}),Mu={ProjectionUBO:0,TerrainUBO:1,FrameUBO:2};function tF(t,e){for(let[i,r]of Object.entries(Mu)){let a=t.getUniformBlockIndex(e,i);a!==t.INVALID_INDEX&&t.uniformBlockBinding(e,a,r)}}var eF={float:[1,1],int:[1,1],vec2:[2,2],vec4:[4,4],mat4:[16,4]};function cf(t){let e={},i=0;for(let{name:r,type:a}of t){let[n,s]=eF[a];i=Math.ceil(i/s)*s,e[r]=i,i+=n}return{offsets:e,contentWords:i,sizeWords:Math.ceil(i/4)*4}}var df=class{constructor(t,e,i){this.context=t,this.binding=e,this.contentWords=i.contentWords;let r=t.gl;this.buffer=r.createBuffer(),r.bindBuffer(r.UNIFORM_BUFFER,this.buffer),r.bufferData(r.UNIFORM_BUFFER,i.sizeWords*4,r.DYNAMIC_DRAW),r.bindBufferBase(r.UNIFORM_BUFFER,e,this.buffer),this.uploaded=new Float32Array(i.sizeWords),this.pending=new Float32Array(i.sizeWords),this.uploadedWords=new Uint32Array(this.uploaded.buffer),this.pendingWords=new Uint32Array(this.pending.buffer),this.hasData=!1,this.bindingDirty=!1}upload(){let t=this.context.gl,e=!this.hasData;if(!e){let i=this.pendingWords,r=this.uploadedWords;for(let a=0;a<this.contentWords;a++)if(i[a]!==r[a]){e=!0;break}}this.bind(),e&&(t.bindBufferBase(t.UNIFORM_BUFFER,this.binding,this.buffer),t.bufferSubData(t.UNIFORM_BUFFER,0,this.pending),this.uploaded.set(this.pending),this.hasData=!0)}bind(){if(!this.bindingDirty)return;let t=this.context.gl;t.bindBufferBase(t.UNIFORM_BUFFER,this.binding,this.buffer),this.bindingDirty=!1}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},nb=cf([{name:"u_projection_matrix",type:"mat4"},{name:"u_projection_fallback_matrix",type:"mat4"},{name:"u_projection_tile_mercator_coords",type:"vec4"},{name:"u_projection_clipping_plane",type:"vec4"},{name:"u_projection_transition",type:"float"},{name:"u_projection_clip_antimeridian",type:"int"}]),pn=nb.offsets;function iF(t){return new df(t,Mu.ProjectionUBO,nb)}function rF(t,e){let i=t.pending;i.set(e.mainMatrix,pn.u_projection_matrix),i.set(e.fallbackMatrix,pn.u_projection_fallback_matrix),i.set(e.tileMercatorCoords,pn.u_projection_tile_mercator_coords),i.set(e.clippingPlane,pn.u_projection_clipping_plane),i[pn.u_projection_transition]=e.projectionTransition,t.pendingWords[pn.u_projection_clip_antimeridian]=+!!e.clipAntimeridian,t.upload()}var sb=cf([{name:"u_terrain_matrix",type:"mat4"},{name:"u_terrain_unpack",type:"vec4"},{name:"u_terrain_dim",type:"float"},{name:"u_terrain_exaggeration",type:"float"}]),hu=sb.offsets;function aF(t){return new df(t,Mu.TerrainUBO,sb)}function nF(t,e){let i=t.pending;i.set(e.u_terrain_matrix,hu.u_terrain_matrix),i.set(e.u_terrain_unpack,hu.u_terrain_unpack),i[hu.u_terrain_dim]=e.u_terrain_dim,i[hu.u_terrain_exaggeration]=e.u_terrain_exaggeration,t.upload()}function vp(t){let e=[];for(let i of t){if(i===null)continue;let r=i.split(" ");e.push(r.pop())}return e}function sF(t,e){let i=new Set([t.INT,t.INT_VEC2,t.INT_VEC3,t.INT_VEC4,t.UNSIGNED_INT,t.UNSIGNED_INT_VEC2,t.UNSIGNED_INT_VEC3,t.UNSIGNED_INT_VEC4]),r=new Set,a=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n<a;n++){let s=t.getActiveAttrib(e,n);s&&i.has(s.type)&&r.add(s.name)}return r}var oF=class{constructor(t,e,i,r,a,n,s,o,l=[]){let u=t.gl;this.program=u.createProgram();let h=vp(e.staticAttributes),c=i?i.getBinderAttributes():[],d=h.concat(c),p=rr.prelude.staticUniforms?vp(rr.prelude.staticUniforms):[],f=e.staticUniforms?vp(e.staticUniforms):[],m=i?i.getBinderUniforms():[],g=p.concat(f).concat(m),_=[];for(let E of g)_.includes(E)||_.push(E);let y=i?i.defines():[];y.unshift("#version 300 es"),a&&y.push("#define OVERDRAW_INSPECTOR;"),n&&y.push("#define TERRAIN3D;"),o&&y.push(o),l&&y.push(...l);let x=y.concat(rr.prelude.fragmentSource,s.fragmentSource,e.fragmentSource).join(` 1637`),v=y.concat(rr.prelude.vertexSource,s.vertexSource,e.vertexSource).join(` 1638`),w=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(w,x),u.compileShader(w),u.attachShader(this.program,w);let b=u.createShader(u.VERTEX_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(b,v),u.compileShader(b),u.attachShader(this.program,b),this.attributes={};let T={};if(this.numAttributes=d.length,u.linkProgram(this.program),!u.getProgramParameter(this.program,u.LINK_STATUS)){if(u.isContextLost()){this.failedToCreate=!0;return}throw u.getShaderParameter(w,u.COMPILE_STATUS)?u.getShaderParameter(b,u.COMPILE_STATUS)?Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${u.getShaderInfoLog(b)}`):Error(`Could not compile fragment shader: ${u.getShaderInfoLog(w)}`)}tF(u,this.program);let D=sF(u,this.program);for(let E of d){if(!E)continue;let M=u.getAttribLocation(this.program,E);M>=0&&(this.attributes[E]={location:M,isInteger:D.has(E)})}u.deleteShader(b),u.deleteShader(w);for(let E of _)if(E&&!T[E]){let M=u.getUniformLocation(this.program,E);M&&(T[E]=M)}this.fixedUniforms=r(t,T),this.terrainUniforms=X3(t,T),this.binderUniforms=i?i.getUniforms(t,T):[]}draw(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m,g,_,y){var w;let x=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.projectionUniformBuffer.bind(),t.terrainUniformBuffer.bind(),t.frameUniformBuffer.bind(),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(a),t.setCullFace(n),o){t.activeTexture.set(x.TEXTURE2),x.bindTexture(x.TEXTURE_2D,o.depthTexture),t.activeTexture.set(x.TEXTURE3),x.bindTexture(x.TEXTURE_2D,o.texture);for(let b in this.terrainUniforms)this.terrainUniforms[b].set(o[b]);nF(t.terrainUniformBuffer,o)}if(l&&rF(t.projectionUniformBuffer,l),s)for(let b in this.fixedUniforms)this.fixedUniforms[b].set(s[b]);m&&m.setUniforms(t,this.binderUniforms,p,{zoom:f});let v=0;switch(e){case x.LINES:v=2;break;case x.TRIANGLES:v=3;break;case x.LINE_STRIP:v=1}for(let b of d.get())b.vaos||(b.vaos={}),(w=b.vaos)[u]||(w[u]=new H3),b.vaos[u].bind(t,this,h,m?m.getPaintVertexBuffers():[],c,b.vertexOffset,g,_,y),x.drawElements(e,b.primitiveLength*v,x.UNSIGNED_SHORT,b.primitiveOffset*v*2)}};function ob(t,e,i){let r=1/Ke(i,1,e.transform.tileZoom),a=2**i.tileID.overscaledZ,n=i.tileSize*2**e.transform.tileZoom/a,s=n*(i.tileID.canonical.x+i.tileID.wrap*a),o=n*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,o>>16],u_pixel_coord_lower:[s&65535,o&65535]}}function lF(t,e,i,r){let a=i.patternAtlas.getPattern(t.from.toString()),n=i.patternAtlas.getPattern(t.to.toString()),{width:s,height:o}=i.patternAtlas.getPixelSize(),l=2**r.tileID.overscaledZ,u=r.tileSize*2**i.transform.tileZoom/l,h=u*(r.tileID.canonical.x+r.tileID.wrap*l),c=u*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[s,o],u_mi
vendor: 9,052 bytes, line 1638
1638x:e.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Ke(r,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,c>>16],u_pixel_coord_lower:[h&65535,c&65535]}}var uF=(t,e)=>({u_lightpos:new Oe(t,e.u_lightpos),u_lightpos_globe:new Oe(t,e.u_lightpos_globe),u_lightintensity:new N(t,e.u_lightintensity),u_lightcolor:new Oe(t,e.u_lightcolor),u_vertical_gradient:new N(t,e.u_vertical_gradient),u_opacity:new N(t,e.u_opacity),u_fill_translate:new dt(t,e.u_fill_translate)}),hF=(t,e)=>({u_lightpos:new Oe(t,e.u_lightpos),u_lightpos_globe:new Oe(t,e.u_lightpos_globe),u_lightintensity:new N(t,e.u_lightintensity),u_lightcolor:new Oe(t,e.u_lightcolor),u_vertical_gradient:new N(t,e.u_vertical_gradient),u_height_factor:new N(t,e.u_height_factor),u_opacity:new N(t,e.u_opacity),u_fill_translate:new dt(t,e.u_fill_translate),u_image:new K(t,e.u_image),u_texsize:new dt(t,e.u_texsize),u_pixel_coord_upper:new dt(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new dt(t,e.u_pixel_coord_lower),u_scale:new Oe(t,e.u_scale),u_fade:new N(t,e.u_fade)}),lb=(t,e,i,r)=>{let a=t.style.light,n=a.getCartesianPosition(),s=Uc();a.properties.get("anchor")==="viewport"&&Og(s,t.transform.bearingInRadians),Wg(n,n,s);let o=t.transform.transformLightDirection(n),l=a.properties.get("color");return{u_lightpos:n,u_lightpos_globe:o,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+e,u_opacity:i,u_fill_translate:r}},cF=(t,e,i,r,a,n,s)=>q(lb(t,e,i,r),ob(n,t,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),dF=(t,e)=>({u_fill_translate:new dt(t,e.u_fill_translate)}),pF=(t,e)=>({u_image:new K(t,e.u_image),u_texsize:new dt(t,e.u_texsize),u_pixel_coord_upper:new dt(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new dt(t,e.u_pixel_coord_lower),u_scale:new Oe(t,e.u_scale),u_fade:new N(t,e.u_fade),u_sdf_pattern:new K(t,e.u_sdf_pattern),u_fill_translate:new dt(t,e.u_fill_translate)}),fF=(t,e)=>({u_fill_translate:new dt(t,e.u_fill_translate)}),mF=(t,e)=>({u_image:new K(t,e.u_image),u_texsize:new dt(t,e.u_texsize),u_pixel_coord_upper:new dt(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new dt(t,e.u_pixel_coord_lower),u_scale:new Oe(t,e.u_scale),u_fade:new N(t,e.u_fade),u_sdf_pattern:new K(t,e.u_sdf_pattern),u_fill_translate:new dt(t,e.u_fill_translate)}),ub=(t,e,i,r,a)=>q(ob(e,t,i),{u_fill_translate:r,u_sdf_pattern:+!!a}),gF=t=>({u_fill_translate:t}),_F=t=>({u_fill_translate:t}),yF=(t,e,i,r,a)=>ub(t,e,i,r,a),vF=(t,e)=>({u_scale_with_map:new K(t,e.u_scale_with_map),u_pitch_with_map:new K(t,e.u_pitch_with_map),u_extrude_scale:new dt(t,e.u_extrude_scale),u_globe_extrude_scale:new N(t,e.u_globe_extrude_scale),u_translate:new dt(t,e.u_translate)}),xF=(t,e,i,r,a)=>{let n=t.transform,s,o,l=0;if(i.paint.get("circle-pitch-alignment")==="map"){let u=Ke(e,1,n.zoom);s=!0,o=[u,u],l=u/(k*2**e.tileID.overscaledZ)*2*Math.PI*a}else s=!1,o=n.pixelsToGLUnits;return{u_scale_with_map:+(i.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+s,u_extrude_scale:o,u_globe_extrude_scale:l,u_translate:r}},bF=(t,e)=>({u_color:new yr(t,e.u_color),u_overlay:new K(t,e.u_overlay),u_overlay_scale:new N(t,e.u_overlay_scale)}),$v=(t,e=1)=>({u_color:t,u_overlay:0,u_overlay_scale:e}),wF=(t,e)=>({u_extrude_scale:new N(t,e.u_extrude_scale),u_intensity:new N(t,e.u_intensity),u_globe_extrude_scale:new N(t,e.u_globe_extrude_scale)}),TF=(t,e)=>({u_matrix:new Si(t,e.u_matrix),u_image:new K(t,e.u_image),u_color_ramp:new K(t,e.u_color_ramp),u_opacity:new N(t,e.u_opacity)}),hb=(t,e,i,r)=>{let a=Ke(t,1,e)/(k*2**t.tileID.overscaledZ)*2*Math.PI*r;return{u_extrude_scale:Ke(t,1,e),u_intensity:i,u_globe_extrude_scale:a}},cb=(t,e,i,r)=>{let a=cr();return Ri(a,0,t.width,t.height,0,0,1),{u_matrix:a,u_image:i,u_color_ramp:r,u_opacity:e.paint.get("heatmap-opacity")}},EF=(t,e)=>({u_image:new K(t,e.u_image),u_latrange:new dt(t,e.u_latrange),u_exaggeration:new N(t,e.u_exaggeration),u_altitudes:new Sd(t,e.u_altitudes),u_azimuths:new Sd(t,e.u_azimuths),u_accent:new yr(t,e.u_accent),u_method:new K(t,e.u_method),u_shadows:new Ed(t,e.u_shadows),u_highlights:new Ed(t,e.u_highlights)}),SF=(t,e)=>({u_matrix:new Si(t,e.u_matrix),u_image:new K(t,e.u_image),u_dimension:new dt(t,e.u_dimension),u_zoom:new N(t,e.u_zoom),u_unpack:new ln(t,e.u_unpack)}),DF=(t,e,i)=>{let r=i.paint.get("hillshade-accent-color"),a;switch(i.paint.get("hillshade-method")){case"basic":a=4;break;case"combined":a=1;break;case"igor":a=2;break;case"multidirectional":a=3;break;default:a=0}let n=i.getIlluminationProperties();for(let s=0;s<n.directionRadians.length;s++)i.paint.get("hillshade-illumination-anchor")==="viewport"&&(n.directionRadians[s]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:CF(t,e.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:n.altitudeRadians,u_azimuths:n.directionRadians,u_accent:r,u_method:a,u_highlights:n.highlightColor,u_shadows:n.shadowColor}},PF=(t,e)=>{let i=e.stride,r=cr();return Ri(r,0,k,-k,0,0,1),se(r,r,[0,-k,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:e.getUnpackVector()}};function CF(t,e){let i=2**e.canonical.z,r=e.canonical.y;return[new Et(0,r/i).toLngLat().lat,new Et(0,(r+1)/i).toLngLat().lat]}var IF=(t,e)=>({u_image:new K(t,e.u_image),u_unpack:new ln(t,e.u_unpack),u_dimension:new dt(t,e.u_dimension),u_elevation_stops:new K(t,e.u_elevation_stops),u_color_stops:new K(t,e.u_color_stops),u_color_ramp_size:new K(t,e.u_color_ramp_size),u_opacity:new N(t,e.u_opacity)}),AF=(t,e,i=0)=>({u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}),MF=(t,e)=>({u_translation:new dt(t,e.u_translation),u_ratio:new N(t,e.u_ratio)}),FF=(t,e)=>({u_translation:new dt(t,e.u_translation),u_ratio:new N(t,e.u_ratio),u_image:new K(t,e.u_image),u_image_height:new N(t,e.u_image_height)}),zF=(t,e)=>({u_translation:new dt(t,e.u_translation),u_texsize:new dt(t,e.u_texsize),u_ratio:new N(t,e.u_ratio),u_image:new K(t,e.u_image),u_scale:new Oe(t,e.u_scale),u_fade:new N(t,e.u_fade)}),RF=(t,e)=>({u_translation:new dt(t,e.u_translation),u_ratio:new N(t,e.u_ratio),u_image:new K(t,e.u_image),u_mix:new N(t,e.u_mix),u_tileratio:new N(t,e.u_tileratio),u_crossfade_from:new N(t,e.u_crossfade_from),u_crossfade_to:new N(t,e.u_crossfade_to),u_lineatlas_width:new N(t,e.u_lineatlas_width),u_lineatlas_height:new N(t,e.u_lineatlas_height)}),kF=(t,e)=>({u_translation:new dt(t,e.u_translation),u_ratio:new N(t,e.u_ratio),u_image:new K(t,e.u_image),u_image_height:new N(t,e.u_image_height),u_tileratio:new N(t,e.u_tileratio),u_crossfade_from:new N(t,e.u_crossfade_from),u_crossfade_to:new N(t,e.u_crossfade_to),u_image_dash:new K(t,e.u_image_dash),u_mix:new N(t,e.u_mix),u_lineatlas_width:new N(t,e.u_lineatlas_width),u_lineatlas_height:new N(t,e.u_lineatlas_height)}),Fu=(t,e,i,r)=>{let a=t.transform;return{u_translation:db(t,e,i),u_ratio:r/Ke(e,1,a.zoom)}},LF=(t,e,i,r,a)=>q(Fu(t,e,i,r),{u_image:0,u_image_height:a}),BF=(t,e,i,r,a)=>{let n=t.transform,s=pf(e,n);return{u_translation:db(t,e,i),u_texsize:e.imageAtlasTexture.size,u_ratio:r/Ke(e,1,n.zoom),u_image:0,u_scale:[s,a.fromScale,a.toScale],u_fade:a.t}},OF=(t,e,i,r,a)=>{let n=t.transform,s=pf(e,n);return q(Fu(t,e,i,r),{u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},VF=(t,e,i,r,a,n)=>{let s=t.transform,o=pf(e,s);return q(Fu(t,e,i,r),{u_image:0,u_image_height:n,u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function pf(t,e){return 1/Ke(t,1,e.tileZoom)}function db(t,e,i){return pr(t.transform,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var jF=(t,e)=>({u_image:new K(t,e.u_image),u_opacity:new N(t,e.u_opacity)}),UF=(t,e)=>({u_image:e,u_opacity:t}),NF=(t,e)=>({u_is_size_zoom_constant:new K(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new K(t,e.u_is_size_feature_constant),u_size_t:new N(t,e.u_size_t),u_size:new N(t,e.u_size),u_rotate_symbol:new K(t,e.u_rotate_symbol),u_label_plane_matrix:new Si(t,e.u_label_plane_matrix),u_coord_matrix:new Si(t,e.u_coord_matrix),u_is_text:new K(t,e.u_is_text),u_pitch_with_map:new K(t,e.u_pitch_with_map),u_is_along_line:new K(t,e.u_is_along_line),u_is_variable_anchor:new K(t,e.u_is_variable_anchor),u_texsize:new dt(t,e.u_texsize),u_texture:new K(t,e.u_texture),u_translation:new dt(t,e.u_translation),u_pitched_scale:new N(t,e.u_pitched_scale),u_is_offset:new K(t,e.u_is_offset),u_height_anchor_ground:new K(t,e.u_height_anchor_ground)}),$F=(t,e)=>({u_is_size_zoom_constant:new K(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new K(t,e.u_is_size_feature_constant),u_size_t:new N(t,e.u_size_t),u_size:new N(t,e.u_size),u_rotate_symbol:new K(t,e.u_rotate_symbol),u_label_plane_matrix:new Si(t,e.u_label_plane_matrix
vendor: 6,288 bytes, line 1638
1638),u_coord_matrix:new Si(t,e.u_coord_matrix),u_is_text:new K(t,e.u_is_text),u_pitch_with_map:new K(t,e.u_pitch_with_map),u_is_along_line:new K(t,e.u_is_along_line),u_is_variable_anchor:new K(t,e.u_is_variable_anchor),u_texsize:new dt(t,e.u_texsize),u_texture:new K(t,e.u_texture),u_gamma_scale:new N(t,e.u_gamma_scale),u_is_halo:new K(t,e.u_is_halo),u_is_plain:new K(t,e.u_is_plain),u_translation:new dt(t,e.u_translation),u_pitched_scale:new N(t,e.u_pitched_scale),u_is_offset:new K(t,e.u_is_offset),u_height_anchor_ground:new K(t,e.u_height_anchor_ground)}),GF=(t,e)=>({u_is_size_zoom_constant:new K(t,e.u_is_size_zoom_constant),u_is_size_feature_constant:new K(t,e.u_is_size_feature_constant),u_size_t:new N(t,e.u_size_t),u_size:new N(t,e.u_size),u_rotate_symbol:new K(t,e.u_rotate_symbol),u_label_plane_matrix:new Si(t,e.u_label_plane_matrix),u_coord_matrix:new Si(t,e.u_coord_matrix),u_is_text:new K(t,e.u_is_text),u_pitch_with_map:new K(t,e.u_pitch_with_map),u_is_along_line:new K(t,e.u_is_along_line),u_is_variable_anchor:new K(t,e.u_is_variable_anchor),u_texsize:new dt(t,e.u_texsize),u_texsize_icon:new dt(t,e.u_texsize_icon),u_texture:new K(t,e.u_texture),u_texture_icon:new K(t,e.u_texture_icon),u_gamma_scale:new N(t,e.u_gamma_scale),u_is_halo:new K(t,e.u_is_halo),u_translation:new dt(t,e.u_translation),u_pitched_scale:new N(t,e.u_pitched_scale),u_is_offset:new K(t,e.u_is_offset),u_height_anchor_ground:new K(t,e.u_height_anchor_ground)}),pb=(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f)=>({u_is_size_zoom_constant:+(t==="constant"||t==="source"),u_is_size_feature_constant:+(t==="constant"||t==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_rotate_symbol:+i,u_label_plane_matrix:o,u_coord_matrix:l,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:a,u_is_variable_anchor:n,u_texsize:c,u_texture:0,u_translation:u,u_pitched_scale:d,u_is_offset:p,u_height_anchor_ground:+f}),fb=(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f,m)=>{let g=s.transform;return q(pb(t,e,i,r,a,n,s,o,l,u,h,c,p,f,m),{u_gamma_scale:r?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_is_halo:+!!d,u_is_plain:1})},ZF=(t,e,i,r,a,n,s,o,l,u,h,c,d,p,f)=>q(fb(t,e,i,r,a,n,s,o,l,u,!0,h,!0,d,p,f),{u_texsize_icon:c,u_texture_icon:1}),qF=(t,e)=>({u_opacity:new N(t,e.u_opacity),u_color:new yr(t,e.u_color)}),WF=(t,e)=>({u_opacity:new N(t,e.u_opacity),u_image:new K(t,e.u_image),u_pattern_tl_a:new dt(t,e.u_pattern_tl_a),u_pattern_br_a:new dt(t,e.u_pattern_br_a),u_pattern_tl_b:new dt(t,e.u_pattern_tl_b),u_pattern_br_b:new dt(t,e.u_pattern_br_b),u_texsize:new dt(t,e.u_texsize),u_mix:new N(t,e.u_mix),u_pattern_size_a:new dt(t,e.u_pattern_size_a),u_pattern_size_b:new dt(t,e.u_pattern_size_b),u_scale_a:new N(t,e.u_scale_a),u_scale_b:new N(t,e.u_scale_b),u_pixel_coord_upper:new dt(t,e.u_pixel_coord_upper),u_pixel_coord_lower:new dt(t,e.u_pixel_coord_lower),u_tile_units_to_pixels:new N(t,e.u_tile_units_to_pixels)}),HF=(t,e)=>({u_opacity:t,u_color:e}),XF=(t,e,i,r,a)=>q(lF(i,a,e,r),{u_opacity:t}),YF=(t,e)=>({u_sun_pos:new Oe(t,e.u_sun_pos),u_atmosphere_blend:new N(t,e.u_atmosphere_blend),u_globe_position:new Oe(t,e.u_globe_position),u_globe_radius:new N(t,e.u_globe_radius),u_inv_proj_matrix:new Si(t,e.u_inv_proj_matrix)}),KF=(t,e,i,r,a)=>({u_sun_pos:t,u_atmosphere_blend:e,u_globe_position:i,u_globe_radius:r,u_inv_proj_matrix:a}),JF=(t,e)=>({u_sky_color:new yr(t,e.u_sky_color),u_horizon_color:new yr(t,e.u_horizon_color),u_horizon:new dt(t,e.u_horizon),u_horizon_normal:new dt(t,e.u_horizon_normal),u_sky_horizon_blend:new N(t,e.u_sky_horizon_blend),u_sky_blend:new N(t,e.u_sky_blend),u_inv_proj_matrix:new Si(t,e.u_inv_proj_matrix),u_globe_position:new Oe(t,e.u_globe_position),u_globe_radius:new N(t,e.u_globe_radius),u_atmosphere_blend:new N(t,e.u_atmosphere_blend)}),QF=(t,e,i)=>{let r=Math.cos(e.rollInRadians),a=Math.sin(e.rollInRadians),n=hn(e),s=e.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(e.width/2-n*a)*i,(e.height/2+n*r)*i],u_horizon_normal:[-a,r],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i,u_sky_blend:s,u_inv_proj_matrix:e.inverseProjectionMatrix,u_globe_position:Qx(e),u_globe_radius:_n(e.worldSize,e.center.lat),u_atmosphere_blend:t.properties.get("atmosphere-blend")}},cu=(t,e)=>({}),t5={fillExtrusion:uF,fillExtrusionPattern:hF,fill:dF,fillPattern:pF,fillOutline:fF,fillOutlinePattern:mF,circle:vF,collisionBox:cu,collisionCircle:cu,debug:bF,depth:cu,clippingMask:cu,heatmap:wF,heatmapTexture:TF,hillshade:EF,hillshadePrepare:SF,colorRelief:IF,line:MF,lineGradient:FF,linePattern:zF,lineSDF:RF,lineGradientSDF:kF,layerOpacity:jF,raster:yM,symbolIcon:NF,symbolSDF:$F,symbolTextAndIcon:GF,background:qF,backgroundPattern:WF,terrain:Y3,terrainDepth:K3,atmosphere:YF,sky:JF},e5=class{constructor(t,e,i){this.context=t;let r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||e.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let e=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},Gv={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},i5=class{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;let a=t.gl;this.buffer=a.createBuffer(),t.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||e.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}
vendor: 33,398 bytes, line 1638
1638enableAttributes(t,e){for(let i of this.attributes){let r=e.attributes[i.name];r!==void 0&&t.enableVertexAttribArray(r.location)}}setVertexAttribPointers(t,e,i){for(let r of this.attributes){let a=e.attributes[r.name];if(a!==void 0){let n=r.offset+this.itemSize*(i||0);a.isInteger?t.vertexAttribIPointer(a.location,r.components,t[Gv[r.type]],this.itemSize,n):t.vertexAttribPointer(a.location,r.components,t[Gv[r.type]],!1,this.itemSize,n)}}}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},zt=class{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)}},r5=class extends zt{getDefault(){return lt.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},a5=class extends zt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}},n5=class extends zt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}},s5=class extends zt{getDefault(){return[!0,!0,!0,!0]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},o5=class extends zt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}},l5=class extends zt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}},u5=class extends zt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}},h5=class extends zt{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}},c5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},d5=class extends zt{getDefault(){return[0,1]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}},p5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},f5=class extends zt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}},m5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},g5=class extends zt{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}},_5=class extends zt{getDefault(){return lt.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},y5=class extends zt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}},v5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},x5=class extends zt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}},b5=class extends zt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}},w5=class extends zt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}},T5=class extends zt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}},E5=class extends zt{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},S5=class extends zt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},D5=class extends zt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},P5=class extends zt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},C5=class extends zt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},I5=class extends zt{getDefault(){return null}set(t){let e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},A5=class extends zt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}},M5=class extends zt{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},F5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},z5=class extends zt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},ff=class extends zt{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}},R5=class extends ff{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},k5=class extends ff{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},L5=class extends ff{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},B5=class{constructor(t,e,i,r,a){this.context=t,this.width=e,this.height=i;let n=t.gl,s=this.framebuffer=n.createFramebuffer();if(this.colorAttachment=new R5(t,s),r)this.depthAttachment=a?new L5(t,s):new k5(t,s);else if(a)throw Error("Stencil cannot be set without depth")}destroy(){let t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){let i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i)}t.deleteFramebuffer(this.framebuffer)}},mb=cf([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}]),ui=mb.offsets;function O5(t){return new df(t,Mu.FrameUBO,mb)}function V5(t,e){let i=t.pending,{transform:r}=e,a=e.context.gl;i[ui.u_units_to_pixels]=1/r.pixelsToGLUnits[0],i[ui.u_units_to_pixels+1]=1/r.pixelsToGLUnits[1],i[ui.u_world_size]=a.drawingBufferWidth,i[ui.u_world_size+1]=a.drawingBufferHeight,i[ui.u_camera_to_center_distance]=r.cameraToCenterDistance,i[ui.u_symbol_fade_change]=e.options.fadeDuration?e.symbolFadeChange:1,i[ui.u_aspect_ratio]=r.width/r.height,i[ui.u_device_pixel_ratio]=e.pixelRatio,i[ui.u_viewport_size]=r.width,i[ui.u_viewport_size+1]=r.height,i[ui.u_pixel_extrude_scale]=1/r.width,i[ui.u_pixel_extrude_scale+1]=1/r.height,i[ui.u_pitch]=r.pitch/360*2*Math.PI,t.upload()}var te=class{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}};te.Replace=[1,0],te.disabled=new te(te.Replace,lt.transparent,[!1,!1,!1,!1]),te.unblended=new te(te.Replace,lt.transparent,[!0,!0,!0,!0]),te.alphaBlended=new te([1,771],lt.transparent,[!0,!0,!0,!0]);var j5=class{constructor(t){this.gl=t,this.clearColor=new r5(this),this.clearDepth=new a5(this),this.clearStencil=new n5(this),this.colorMask=new s5(this),this.depthMask=new o5(this),this.stencilMask=new l5(this),this.stencilFunc=new u5(this),this.stencilOp=new h5(this),this.stencilTest=new c5(this),this.depthRange=new d5(this),this.depthTest=new p5(this),this.depthFunc=new f5(this),this.blend=new m5(this),this.blendFunc=new g5(this),this.blendColor=new _5(this),this.blendEquation=new y5(this),this.cullFace=new v5(this),this.cullFaceSide=new x5(this),this.frontFace=new b5(this),this.program=new w5(this),this.activeTexture=new T5(this),this.viewport=new E5(this),this.bindFramebuffer=new S5(this),this.bindRenderbuffer=new D5(this),this.bindTexture=new P5(this),this.bindVertexBuffer=new C5(this),this.bindElementBuffer=new I5(this),this.bindVertexArray=new A5(this),this.pixelStoreUnpack=new M5(this),this.pixelStoreUnpackPremultiplyAlpha=new F5(this),this.pixelStoreUnpackFlipY=new z5(this),this.extTextureFilterAnisotropic=t.getExtension("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),t.getExtension("EXT_color_buffer_half_float"),t.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=iF(this),this.terrainUniformBuffer=aF(this),this.frameUniformBuffer=O5(this)}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,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(t,e){return new e5(this,t,e)}createVertexBuffer(t,e,i){return new i5(this,t,e,i)}createRenderbuffer(t,e,i){let r=this.gl,a=r.createRenderbuffer();return this.bindRenderbuffer.set(a),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),a}createFramebuffer(t,e,i,r){return new B5(this,t,e,i,r)}clear({color:t,depth:e,stencil:i}){let r=this.gl,a=0;t&&(a|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),e!==void 0&&(a|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),i!==void 0&&(a|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(a)}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(!1):(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range))}setStencilMode(t){t.test.func===this.gl.ALWAYS&&!t.mask?this.stencilTest.set(!1):(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}))}setColorMode(t){wi(t.blendFunction,te.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(){return this.gl.createVertexArray()}deleteVertexArray(t){this.gl.deleteVertexArray(t)}unbindVAO(){this.bindVertexArray.set(null)}},gt=class{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}};gt.ReadOnly=!1,gt.ReadWrite=!0,gt.disabled=new gt(519,gt.ReadOnly,[0,1]);var xp=7680,It=class{constructor(t,e,i,r,a,n){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=a,this.pass=n}};It.disabled=new It({func:519,mask:0},0,0,xp,xp,xp);var Zv=1029,bp=2305,Dt=class{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}};Dt.disabled=new Dt(!1,Zv,bp),Dt.backCCW=new Dt(!0,Zv,bp),Dt.frontCCW=new Dt(!0,1028,bp);function U5(t,e,i){let r=e?.transitionState??0;return{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:t,terrain:i,projectionTransition:r,isRenderingGlobe:r>0}}function Fe(t,e,i={}){return t.transform.getProjectionData({overscaledTileID:e,aligned:i.aligned,applyGlobeMatrix:!t.isRenderingToTexture,applyTerrainMatrix:i.applyTerrainMatrix??!0})}function Ze(t,e){return t.isRenderingToTexture?null:t.terrain?.getTerrainData(e)??null}var du;function qv(t,e,i,r,a,n){let s=t.context,o=s.gl,l=t.useProgram("collisionBox"),u=[],h=0,c=0;for(let _ of r){let y=e.getTile(_).getBucket(i);if(!y)continue;let x=a?y.textCollisionBox:y.iconCollisionBox,v=y.collisionCircleArray;v.length>0&&(u.push({circleArray:v,circleOffset:c,coord:_}),h+=v.length/4,c=h),x&&l.draw(s,o.LINES,gt.disabled,It.disabled,t.colorModeForRenderPass(),Dt.disabled,null,Ze(n,_),Fe(n,_),i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}if(!a||!u.length)return;let d=t.useProgram("collisionCircle"),p=new i0;p.resize(h*4),p._trim();let f=0;for(let _ of u)for(let y=0;y<_.circleArray.length/4;y++){let x=y*4,v=_.circleArray[x+0],w=_.circleArray[x+1],b=_.circleArray[x+2],T=_.circleArray[x+3];p.emplace(f++,v,w,b,T,0),p.emplace(f++,v,w,b,T,1),p.emplace(f++,v,w,b,T,2),p.emplace(f++,v,w,b,T,3)}(!du||du.length<h*2)&&(du=N5(h));let m=s.createIndexBuffer(du,!0),g=s.createVertexBuffer(p,N0.members,!0);for(let _ of u)d.draw(s,o.TRIANGLES,gt.disabled,It.disabled,t.colorModeForRenderPass(),Dt.disabled,null,Ze(n,_.coord),null,i.id,g,m,qt.simpleSegment(0,_.circleOffset*2,_.circleArray.length,_.circleArray.length/2),null,t.transform.zoom,null,null,null);g.destroy(),m.destroy()}function N5(t){let e=t*2,i=new r0;i.resize(e),i._trim();for(let r=0;r<e;r++){let a=r*6;i.uint16[a+0]=r*4+0,i.uint16[a+1]=r*4+1,i.uint16[a+2]=r*4+2,i.uint16[a+3]=r*4+2,i.uint16[a+4]=r*4+3,i.uint16[a+5]=r*4+0}return i}var $5=Ei(new Float32Array(16));function G5(t,e,i,r,a,n){if(n.currentPass!=="translucent")return;let s=It.disabled,o=t.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&q5(r,t,i,e,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),a),i.paint.get("icon-opacity").constantOr(1)!==0&&Wv(t,e,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment").constantOr("viewport"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),s,o,n),i.paint.get("text-opacity").constantOr(1)!==0&&Wv(t,e,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),s,o,n),e.map.showCollisionBoxes&&(qv(t,e,i,r,!0,n),qv(t,e,i,r,!1,n))}function Z5(t,e,i,r,a,n){let{horizontalAlign:s,verticalAlign:o}=Fs(t),l=-(s-.5)*e,u=-(o-.5)*i;return new C((l/a+r[0])*n,(u/a+r[1])*n)}function q5(t,e,i,r,a,n,s,o,l){let u=e.transform,h=e.style.map.terrain,c=a==="map",d=n==="map";for(let p of t){let f=r.getTile(p),m=f.getBucket(i);if(!m?.text?.segments.get().length)continue;let g=m.textSizeData,_=zs(g,u.zoom),y=Ke(f,1,e.transform.zoom),x=nf(c,e.transform,y),v=i.layout.get("icon-text-fit")!=="none"&&m.hasIconData();if(_){let w=2**(u.zoom-f.tileID.overscaledZ),b=h?(T,D)=>h.getElevation(p,T,D):void 0;H5(m,c,d,l,u,x,w,_,v,pr(u,f,s,o),p.toUnwrapped(),b,i.layout.get("symbol-height-anchor")==="ground")}}}function W5(t,e,i,r,a,n){let s=e.tileAnchorPoint.add(new C(e.translation[0],e.translation[1]));if(e.pitchWithMap){let o=r.mult(n);i||(o=o.rotate(-a));let l=s.add(o);return of(l.x,l.y,e.pitchedLabelPlaneMatrix,xa(e,l.x,l.y)).point}if(i){let o=ba(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(t),l=Math.atan(o.y/o.x)+(o.x<0?Math.PI:0);return t.add(r.rotate(l))}return t.add(r)}function H5(t,e,i,r,a,n,s,o,l,u,h,c,d){let p=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,m=t.icon.dynamicLayoutVertexArray,g={};f.clear();for(let _=0;_<p.length;_++){let y=p.get(_),x=t.allowVerticalPlacement&&!y.placedOrientation,v=!y.hidden&&y.crossTileID&&!x?r[y.crossTileID]:null;if(!v)gn(y.numGlyphs,f);else{let w=new C(y.anchorX,y.anchorY),b={getElevation:c,heightOffset:y.heightOffset,heightAnchorGround:d,width:a.width,height:a.height,pitchedLabelPlaneMatrix:n,lineVertexArray:null,pitchWithMap:i,transform:a,projectionCache:null,tileAnchorPoint:w,translation:u,unwrappedTileID:h},T=i?Ox(w.x,w.y,b):ba(w.x,w.y,b),D=kx(a.cameraToCenterDistance,T.signedDistanceFromCamera),E=Kl(t.textSizeData,o,y)*D/24;i&&(E*=t.tilePixelRatio/s);let{width:M,height:R,anchor:z,textOffset:P,textBoxScale:S}=v,I=Z5(z,M,R,P,S,E),A=a.getPitchedTextCorrection(w.x+u[0],w.y+u[1],h),L=W5(T.point,b,e,I,-a.bearingInRadians,A),G=t.allowVerticalPlacement&&y.placedOrientation===2?Math.PI/2:0;for(let U=0;U<y.numGlyphs;U++)Rs(f,L,G);l&&y.associatedIconIndex>=0&&(g[y.associatedIconIndex]={shiftedAnchor:L,angle:G})}}if(l){m.clear();let _=t.icon.placedSymbolArray;for(let y=0;y<_.length;y++){let x=_.get(y);if(x.hidden)gn(x.numGlyphs,m);else{let v=g[y];if(!v)gn(x.numGlyphs,m);else for(let w=0;w<x.numGlyphs;w++)Rs(m,v.shiftedAnchor,v.angle)}}t.icon.dynamicLayoutVertexBuffer.updateData(m)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function X5(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Wv(t,e,i,r,a,n,s,o,l,u,h,c,d){let p=t.context,f=p.gl,m=t.transform,g=o==="map",_=l==="map",y=o!=="viewport"&&i.layout.get("symbol-placement")!=="point",x=g&&!_&&!y,v=!i.layout.get("symbol-sort-key").isConstant(),w=!1,b=t.getDepthModeForSublayer(0,gt.ReadOnly),T=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),D=[],E=m.getCircleRadiusCorrection();for(let z of r){let P=e.getTile(z),S=P.getBucket(i);if(!S)continue;let I=a?S.text:S.icon;if(!I?.segments.get().length||!I.hasVisibleVertices)continue;let A=I.programConfigurations.get(i.id),L=a||S.sdfIcons,G=a?S.textSizeData:S.iconSizeData,U=_||m.pitch!==0,et=t.useProgram(X5(L,a,S),A),ot=zs(G,m.zoom),Pt=Ze(d,z),vt,ee=[0,0],Lt,Wt,kt=null,Pe;if(a){if(Lt=P.glyphAtlasTexture,Wt=f.LINEAR,vt=P.glyphAtlasTexture.size,S.iconsInText){ee=P.imageAtlasTexture.size,kt=P.imageAtlasTexture;let X=G.kind==="composite"||G.kind==="camera";Pe=U||t.options.rotating||t.options.zooming||X?f.LINEAR:f.NEAREST}}else{let X=i.layout.get("icon-size").constantOr(0)!==1||S.iconsNeedLinear;Lt=P.imageAtlasTexture,Wt=L||t.options.rotating||t.options.zooming||X||U?f.LINEAR:f.NEAREST,vt=P.imageAtlasTexture.size}let ze=Ke(P,1,t.transform.zoom),qe=nf(g,t.transform,ze),We=JM(_,g,t.transform,ze),Vt=pr(m,P,n,s),He=Fe(d,z),Ci=T&&S.hasTextData(),Ui=i.layout.get("icon-text-fit")!=="none"&&Ci&&S.hasIconData(),di=i._unevaluatedLayout.hasValue("icon-offset"),Z=i.layout.get("symbol-height-anchor")==="ground";if(y){let X=cr();HM(X,qe);let yt=t.style.map.terrain?(Bt,xt)=>t.style.map.terrain.getElevation(z,Bt,xt):void 0;t3(S,t,a,qe,X,_,u,i.layout.get("text-rotation-alignment")==="map",z.toUnwrapped(),m.width,m.height,Vt,yt)}let it=a&&T||Ui,rt=_?qe:t.transform.clipSpaceToPixelsMatrix,O=y||it?$5:rt,Tt=L&&i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1)!==0,H;H=L?S.iconsInText?ZF(G.kind,ot,x,_,y,it,t,O,We,Vt,vt,ee,E,di,Z):fb(G.kind,ot,x,_,y,it,t,O,We,Vt,a,vt,Tt,E,di,Z):pb(G.kind,ot,x,_,y,it,t,O,We,Vt,a,vt,E,di,Z);let W={program:et,buffers:I,uniformValues:H,projectionData:He,atlasTexture:Lt,atlasTextureIcon:kt,atlasInterpolation:Wt,atlasInterpolationIcon:Pe,isSDF:L,hasHalo:Tt};if(v&&S.canOverlap){w=!0;let X=I.segments.get();for(let yt of X)D.push({segments:new qt([yt]),sortKey:yt.sortKey,state:W,terrainData:Pt})}else D.push({segments:I.segments,sortKey:0,state:W,terrainData:Pt})}w&&D.sort((z,P)=>z.sortKey-P.sortKey);let M=i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,R=i.layout.get("text-letter-spacing").constantOr(0)*24<0||M>1;for(let z of D){let P=z.state;p.activeTexture.set(f.TEXTURE0),P.atlasTexture.bind(P.atlasInterpolation,f.CLAMP_TO_EDGE),P.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),P.atlasTextureIcon&&P.atlasTextureIcon.bind(P.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let S=P.isSDF&&P.hasHalo;if(S){let I=P.uniformValues;I.u_is_halo=1,R&&(I.u_is_plain=0,Hv(P.buffers,z.segments,i,t,P.program,b,h,c,I,P.projectionData,z.terrainData),I.u_is_halo=0,I.u_is_plain=1)}Hv(P.buffers,z.segments,i,t,P.program,b,h,c,P.uniformValues,P.projectionData,z.terrainData),S&&!R&&(P.uniformValues.u_is_halo=0)}}function Hv(t,e,i,r,a,n,s,o,l,u,h){let c=r.context,d=c.gl;a.draw(c,d.TRIANGLES,n,s,o,Dt.backCCW,l,h,u,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Y5(t,e,i,r,a){if(a.currentPass!=="translucent")return;let n=i.paint.get("circle-opacity"),s=i.paint.get("circle-stroke-width"),o=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(n.constantOr(1)===0&&(s.constantOr(1)===0||o.constantOr(1)===0))return;let u=t.context,h=u.gl,c=t.transform,d=t.getDepthModeForSublayer(0,gt.ReadOnly),p=It.disabled,f=t.colorModeForRenderPass(),m=[],g=c.getCircleRadiusCorrection();for(let _ of r){let y=e.getTile(_),x=y.getBucket(i);if(!x)continue;let v=i.paint.get("circle-translate"),w=i.paint.get("circle-translate-anchor"),b=pr(c,y,v,w),T=x.programConfigurations.get(i.id),D=t.useProgram("circle",T),E=x.layoutVertexBuffer,M=x.indexBuffer,R=Ze(a,_),z={programConfiguration:T,program:D,layoutVertexBuffer:E,indexBuffer:M,uniformValues:xF(t,y,i,b,g),terrainData:R,projectionData:Fe(a,_)};if(l){let P=x.segments.get();for(let S of P)m.push({segments:new qt([S]),sortKey:S.sortKey,state:z})}else m.push({segments:x.segments,sortKey:0,state:z})}l&&m.sort((_,y)=>_.sortKey-y.sortKey);for(let _ of m){let{programConfiguration:y,program:x,layoutVertexBuffer:v,indexBuffer:w,uniformValues:b,terrainData:T,projectionData:D}=_.state,E=_.segments;x.draw(u,h.TRIANGLES,d,p,f,Dt.backCCW,b,T,D,i.id,v,w,E,i.paint,t.transform.zoom,y)}}function K5(t,e,i,r,a){if(i.paint.get("heatmap-opacity")===0)return;let n=t.context;if(t.style.map.terrain){for(let s of r){let o=e.getTile(s);e.hasRenderableParent(s)||(a.currentPass==="offscreen"?tz(t,o,i,s,a):a.currentPass==="translucent"&&ez(t,i,s,a))}n.viewport.set([0,0,t.width,t.height])}else a.currentPass==="offscreen"?J5(t,e,i,r,a):a.currentPass==="translucent"&&Q5(t,i)}function J5(t,e,i,r,a){let n=t.context,s=n.gl,o=t.transform,l=It.disabled,u=new te([s.ONE,s.ONE],lt.transparent,[!0,!0,!0,!0]);iz(n,t,i),n.clear({color:lt.transparent});for(let h of r){if(e.hasRenderableParent(h))continue;let c=e.getTile(h),d=c.getBucket(i);if(!d)continue;let p=d.programConfigurations.get(i.id),f=t.useProgram("heatmap",p),m=Fe(a,h,{applyTerrainMatrix:!1}),g=o.getCircleRadiusCorrection();f.draw(n,s.TRIANGLES,gt.disabled,l,u,Dt.backCCW,hb(c,o.zoom,i.paint.get("heatmap-intensity"),g),null,m,i.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,i.paint,o.zoom,p)}n.viewport.set([0,0,t.width,t.height])}function Q5(t,e){let i=t.context,r=i.gl;i.setColorMode(t.colorModeForRenderPass());let a=e.heatmapFbos.get(Cs);a&&(i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1),_b(i,e).bind(r.LINEAR,r.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,r.TRIANGLES,gt.disabled,It.disabled,t.colorModeForRenderPass(),Dt.disabled,cb(t,e,0,1),null,null,e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom))}function tz(t,e,i,r,a){let n=t.context,s=n.gl,o=It.disabled,l=new te([s.ONE,s.ONE],lt.transparent,[!0,!0,!0,!0]),u=e.getBucket(i);if(!u)return;let h=r.key,c=i.heatmapFbos.get(h);c||(c=gb(n,e.tileSize,e.tileSize),i.heatmapFbos.set(h,c)),n.bindFramebuffer.set(c.framebuffer),n.viewport.set([0,0,e.tileSize,e.tileSize]),n.clear({color:lt.transparent});let d=u.programConfigurations.get(i.id),p=t.useProgram("heatmap",d,!a.isRenderingGlobe),f=Fe(a,e.tileID),m=Ze(a,r);p.draw(n,s.TRIANGLES,gt.disabled,o,l,Dt.disabled,hb(e,t.transform.zoom,i.paint.get("heatmap-intensity"),1),m,f,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,t.transform.zoom,d)}function ez(t,e,i,r){let a=t.context,n=a.gl,s=t.transform;a.setColorMode(t.colorModeForRenderPass());let o=_b(a,e),l=i.key,u=e.heatmapFbos.get(l);if(!u)return;a.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(n.TEXTURE1),o.bind(n.LINEAR,n.CLAMP_TO_EDGE);let h=Fe(r,i,{applyTerrainMatrix:r.isRenderingGlobe});t.useProgram("heatmapTexture").draw(a,n.TRIANGLES,gt.disabled,It.disabled,t.colorModeForRenderPass(),Dt.disabled,cb(t,e,0,1),null,h,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,s.zoom),u.destroy(),e.heatmapFbos.delete(l)}function iz(t,e,i){let r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);let a=i.heatmapFbos.get(Cs);a?(r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=gb(t,e.width/4,e.height/4),i.heatmapFbos.set(Cs,a))}function gb(t,e,i){let r=t.gl,a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texStorage2D(r.TEXTURE_2D,1,r.RGBA16F,e,i);let n=t.createFramebuffer(e,i,!1,!1);return n.colorAttachment.set(a),n}function _b(t,e){return e.colorRampTexture||(e.colorRampTexture=new he(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function yb(t,e,i){let r=t.context,a=r.bindFramebuffer.get(),n=r.viewport.get(),[,,s,o]=n;return rz(t,s,o),r.viewport.set([0,0,s,o]),r.clear({color:lt.transparent,depth:1,stencil:0}),t.currentStencilSource=void 0,t.renderTileClippingMasks(e,i),{compositeTarget:a,compositeViewport:n}}function rz(t,e,i){let r=t.context.gl;if(!t.layerOpacityFbo){let n=t.context.createFramebuffer(e,i,!0,!0),s=r.createTexture();r.bindTexture(r.TEXTURE_2D,s),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,i,0,r.RGBA,r.UNSIGNED_BYTE,null),n.colorAttachment.set(s),n.depthAttachment.set(t.context.createRenderbuffer(r.DEPTH_STENCIL,e,i)),t.layerOpacityFbo=n,t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);return}if(t.layerOpacityFbo.width===e&&t.layerOpacityFbo.height===i){t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);return}let a=t.layerOpacityFbo;r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e,i,0,r.RGBA,r.UNSIGNED_BYTE,null),t.context.bindRenderbuffer.set(a.depthAttachment.get()),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,i),t.context.bindRenderbuffer.set(null),a.width=e,a.height=i,t.context.bindFramebuffer.set(a.framebuffer)}function vb(t,e,i,r){let a=t.context,n=a.gl;a.bindFramebuffer.set(i.compositeTarget),a.viewport.set(i.compositeViewport),a.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.layerOpacityFbo.colorAttachment.get()),t.useProgram("layerOpacity").draw(a,n.TRIANGLES,gt.disabled,It.disabled,t.colorModeForRenderPass(),Dt.disabled,UF(e,0),null,null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom),t.currentStencilSource=void 0}function xb(t,e,i,r,a,n,s,o){let l=256;if(a.stepInterpolant){let u=e.getSource().maxzoom,h=s.canonical.z===u?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1,c=n.maxLineLength/k*1024*h;l=st(i_(c),256,i.maxTextureSize)}return o.gradient=Fd({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:o.gradient||void 0,clips:n.lineClipsArray}),o.texture?o.texture.update(o.gradient):o.texture=new he(i,o.gradient,r.RGBA),o.version=a.gradientVersion,o.texture}function az(t,e,i,r,a){t.activeTexture.set(e.TEXTURE0),i.imageAtlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE),r.updatePaintBuffers(a)}function nz(t,e,i,r,a,n){(a||t.lineAtlas.dirty)&&(e.activeTexture.set(i.TEXTURE0),t.lineAtlas.bind(e)),r.updatePaintBuffers(n)}function sz(t,e,i,r,a,n,s){let o=n.gradients[a.id],l=o.texture;a.gradientVersion!==o.version&&(l=xb(t,e,i,r,a,n,s,o)),i.activeTexture.set(r.TEXTURE0),l.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function oz(t,e,i,r,a,n,s,o,l){let u=n.gradients[a.id],h=u.texture;a.gradientVersion!==u.version&&(h=xb(t,e,i,r,a,n,s,u)),i.activeTexture.set(r.TEXTURE0),h.bind(a.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),t.lineAtlas.bind(i),o.updatePaintBuffers(l)}function lz(t,e,i,r,a){if(a.currentPass!=="translucent")return;let n=i.paint.get("line-opacity"),s=i.paint.get("line-width"),o=i.paint.get("line-layer-opacity");if(n.constantOr(1)!==0&&s.constantOr(1)!==0&&o!==0){if(o<1){let l=yb(t,i,r);Xv(t,e,i,r,a),vb(t,o,l,i);return}Xv(t,e,i,r,a)}}function Xv(t,e,i,r,a){let n=t.getDepthModeForSublayer(0,gt.ReadOnly),s=t.colorModeForRenderPass(),o=i.paint.get("line-dasharray"),l=o.constantOr(1),u=i.paint.get("line-pattern"),h=u.constantOr(1),c=i.paint.get("line-gradient"),d=i.getCrossfadeParameters(),p;p=h?"linePattern":l&&c?"lineGradientSDF":l?"lineSDF":c?"lineGradient":"line";let f=t.context,m=f.gl,g=t.transform,_=!0;for(let y of r){let x=e.getTile(y);if(h&&!x.patternsLoaded())continue;let v=x.getBucket(i);if(!v)continue;let w=v.programConfigurations.get(i.id),b=t.context.program.get(),T=t.useProgram(p,w),D=_||T.program!==b,E=Ze(a,y),M=u.constantOr(null),R=o?.constantOr(null);if(M&&x.imageAtlas){let A=x.imageAtlas,L=A.patternPositions[M.to.toString()],G=A.patternPositions[M.from.toString()];L&&G&&w.setConstantPatternPositions(L,G)}else if(R){let A=i.layout.get("line-cap").constantOr(null)==="round",L=t.lineAtlas.getDash(R.to,A),G=t.lineAtlas.getDash(R.from,A);w.setConstantDashPositions(L,G)}let z=Fe(a,y),P=g.getPixelScale(),S;h?(S=BF(t,x,i,P,d),az(f,m,x,w,d)):l&&c?(S=VF(t,x,i,P,d,v.lineClipsArray.length),oz(t,e,f,m,i,v,y,w,d)):l?(S=OF(t,x,i,P,d),nz(t,f,m,w,D,d)):c?(S=LF(t,x,i,P,v.lineClipsArray.length),sz(t,e,f,m,i,v,y)):S=Fu(t,x,i,P);let I=t.stencilModeForClipping(y);T.draw(f,m.TRIANGLES,n,I,s,Dt.disabled,S,E,z,i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,i.paint,t.transform.zoom,w,v.layoutVertexBuffer2),_=!1}}function bb(t,e,i,r,a){if(!i||!r?.imageAtlas)return;let n=r.imageAtlas.patternPositions,s=n[i.to.toString()],o=n[i.from.toString()];if(!s&&o&&(s=o),!o&&s&&(o=s),!s||!o){let l=a.getPaintProperty(e);s=n[l],o=n[l]}s&&o&&t.setConstantPatternPositions(s,o)}function uz(t,e,i,r,a){let n=i.paint.get("fill-color"),s=i.paint.get("fill-opacity"),o=i.paint.get("fill-layer
1638-opacity");if(s.constantOr(1)===0||o===0)return;if(o<1){if(a.currentPass!=="translucent")return;let h=yb(t,i,r);Yv(t,e,i,r,a),vb(t,o,h,i);return}let l=i.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&n.constantOr(lt.transparent).a===1&&s.constantOr(0)===1;if(u&&a.currentPass==="opaque"){let h=t.colorModeForRenderPass();mf(t,e,i,r,t.getDepthModeForSublayer(1,gt.ReadWrite),h,!1,a);return}if(u&&a.currentPass==="translucent"){wb(t,e,i,r,a);return}a.currentPass==="translucent"&&Yv(t,e,i,r,a)}function Yv(t,e,i,r,a){let n=t.colorModeForRenderPass();mf(t,e,i,r,t.getDepthModeForSublayer(1,gt.ReadOnly),n,!1,a),wb(t,e,i,r,a)}function wb(t,e,i,r,a){if(!i.paint.get("fill-antialias"))return;let n=t.colorModeForRenderPass();mf(t,e,i,r,t.getDepthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,gt.ReadOnly),n,!0,a)}function mf(t,e,i,r,a,n,s,o){let l=t.context.gl,u="fill-pattern",h=i.paint.get(u),c=h?.constantOr(1),d=i.getCrossfadeParameters(),p,f,m,g,_,y=t.transform,x=i.paint.get("fill-translate"),v=i.paint.get("fill-translate-anchor");s?(f=c&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=l.LINES):(f=c?"fillPattern":"fill",p=l.TRIANGLES);let w=h.constantOr(null);for(let b of r){let T=e.getTile(b);if(c&&!T.patternsLoaded())continue;let D=T.getBucket(i);if(!D)continue;let E=D.sdfPatterns[i.id]??!1,M=D.programConfigurations.get(i.id),R=t.useProgram(f,M),z=Ze(o,b);c&&(t.context.activeTexture.set(l.TEXTURE0),T.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),M.updatePaintBuffers(d)),bb(M,u,w,T,i);let P=Fe(o,b),S=pr(y,T,x,v);s?(g=D.indexBuffer2,_=D.segments2,m=f==="fillOutlinePattern"&&c?yF(t,d,T,S,E):_F(S)):(g=D.indexBuffer,_=D.segments,m=c?ub(t,d,T,S,E):gF(S));let I=t.stencilModeForClipping(b);R.draw(t.context,p,a,I,n,Dt.backCCW,m,z,P,i.id,D.layoutVertexBuffer,g,_,i.paint,t.transform.zoom,M)}}function hz(t,e,i,r,a){let n=i.paint.get("fill-extrusion-opacity");if(n!==0&&a.currentPass==="translucent"){let s=new gt(t.context.gl.LEQUAL,gt.ReadWrite,a.depthRangeFor3D);if(n===1&&!i.paint.get("fill-extrusion-pattern").constantOr(1)){let o=t.colorModeForRenderPass();wp(t,e,i,r,s,It.disabled,o,a)}else wp(t,e,i,r,s,It.disabled,te.disabled,a),wp(t,e,i,r,s,t.stencilModeFor3D(),t.colorModeForRenderPass(),a)}}function wp(t,e,i,r,a,n,s,o){let l=t.context,u=l.gl,h="fill-extrusion-pattern",c=i.paint.get(h),d=c.constantOr(1),p=i.getCrossfadeParameters(),f=i.paint.get("fill-extrusion-opacity"),m=c.constantOr(null),g=t.transform;for(let _ of r){let y=e.getTile(_),x=y.getBucket(i);if(!x)continue;let v=Ze(o,_),w=x.programConfigurations.get(i.id),b=t.useProgram(d?"fillExtrusionPattern":"fillExtrusion",w);d&&(t.context.activeTexture.set(u.TEXTURE0),y.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),w.updatePaintBuffers(p));let T=Fe(o,_);bb(w,h,m,y,i);let D=pr(g,y,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),E=i.paint.get("fill-extrusion-vertical-gradient"),M=d?cF(t,E,f,D,_,p,y):lb(t,E,f,D);b.draw(l,l.gl.TRIANGLES,a,n,s,Dt.backCCW,M,v,T,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,t.transform.zoom,w,t.style.map.terrain&&x.centroidVertexBuffer)}}function cz(t,e,i,r,a){if(a.currentPass!=="offscreen"&&a.currentPass!=="translucent")return;let n=t.context,s=t.style.projection.useSubdivision,o=t.getDepthModeForSublayer(0,gt.ReadOnly),l=t.colorModeForRenderPass();if(a.currentPass==="offscreen")dz(t,e,r,i,o,It.disabled,l),n.viewport.set([0,0,t.width,t.height]);else if(a.currentPass==="translucent")if(s){let[u,h,c]=t.stencilConfigForOverlapTwoPass(r);Tp(t,e,i,c,u,o,l,!1,a),Tp(t,e,i,c,h,o,l,!0,a)}else{let[u,h]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Tp(t,e,i,h,u,o,l,!1,a)}}function Tp(t,e,i,r,a,n,s,o,l){let u=t.style.projection,h=t.context,c=h.gl,d=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],p=t.useProgram("hillshade",null,!1,d),f=!t.options.moving;for(let m of r){let g=e.getTile(m),_=g.fbo;if(!_)continue;let y=u.getMeshFromTileID(h,m.canonical,o,!0,"raster"),x=Ze(l,m);h.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,_.colorAttachment.get());
vendor: 9,716 bytes, lines 1638-1640
1638let v=Fe(l,m,{aligned:f});p.draw(h,c.TRIANGLES,n,a[m.overscaledZ],s,Dt.backCCW,DF(t,g,i),x,v,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function dz(t,e,i,r,a,n,s){let o=t.context,l=o.gl,u=r.paint.get("resampling")==="nearest"?l.NEAREST:l.LINEAR;for(let h of i){let c=e.getTile(h),d=c.dem;if(!d?.data||!c.needsHillshadePrepare)continue;let p=d.dim+2,f=d.stride,m=d.getPixels();if(o.activeTexture.set(l.TEXTURE1),o.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture||(c.demTexture=t.getTileTexture(f)),c.demTexture){let _=c.demTexture;_.update(m,{premultiply:!1}),_.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else c.demTexture=new he(o,m,l.RGBA,{premultiply:!1}),c.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);o.activeTexture.set(l.TEXTURE0);let g=c.fbo;if(!g){let _=new he(o,{width:p,height:p,data:null},l.RGBA);_.bind(u,l.CLAMP_TO_EDGE),g=c.fbo=o.createFramebuffer(p,p,!0,!1),g.colorAttachment.set(_.texture)}o.bindFramebuffer.set(g.framebuffer),o.viewport.set([0,0,p,p]),t.useProgram("hillshadePrepare").draw(o,l.TRIANGLES,a,n,s,Dt.disabled,PF(c.tileID,d),null,null,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function pz(t,e,i,r,a){if(a.currentPass!=="translucent"||!r.length)return;let n=t.style.projection.useSubdivision,s=t.getDepthModeForSublayer(0,gt.ReadOnly),o=t.colorModeForRenderPass();if(n){let[l,u,h]=t.stencilConfigForOverlapTwoPass(r);Sp(t,e,i,h,l,s,o,!1,a),Sp(t,e,i,h,u,s,o,!0,a)}else{let[l,u]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Sp(t,e,i,u,l,s,o,!1,a)}}var Ep=0;function Sp(t,e,i,r,a,n,s,o,l){let u=t.style.projection,h=t.context,c=h.gl,d=t.useProgram("colorRelief"),p=!t.options.moving,f=i.paint.get("resampling")==="nearest"?c.NEAREST:c.LINEAR,m=!0,g=0;for(let _ of r){let y=e.getTile(_),x=y.dem;if(!x?.data)continue;if(m){Ep||(Ep=c.getParameter(c.MAX_TEXTURE_SIZE));let D=Ep,{elevationTexture:E,colorTexture:M}=i.getColorRampTextures(h,D,x.getUnpackVector());h.activeTexture.set(c.TEXTURE1),E.bind(c.NEAREST,c.CLAMP_TO_EDGE),h.activeTexture.set(c.TEXTURE4),M.bind(c.LINEAR,c.CLAMP_TO_EDGE),m=!1,g=E.size[0]}let v=x.stride;h.activeTexture.set(c.TEXTURE0),(!y.demTexture||y.needsColorReliefPrepare)&&(h.pixelStoreUnpackPremultiplyAlpha.set(!1),y.demTexture||(y.demTexture=t.getTileTexture(v)??new he(h,{width:v,height:v,data:null},c.RGBA)),y.demTexture.update(x.getPixels(),{premultiply:!1}),y.needsColorReliefPrepare=!1),y.demTexture.bind(f,c.CLAMP_TO_EDGE);let w=u.getMeshFromTileID(h,_.canonical,o,!0,"raster"),b=Ze(l,_),T=Fe(l,_,{aligned:p});d.draw(h,c.TRIANGLES,n,a[_.overscaledZ],s,Dt.backCCW,AF(i,y.dem,g),b,T,i.id,w.vertexBuffer,w.indexBuffer,w.segments)}}var Dp=[new C(0,0),new C(k,0),new C(k,k),new C(0,k)];function fz(t,e,i,r,a){if(a.currentPass!=="translucent"||i.paint.get("raster-opacity")===0||!r.length)return;let n=e.getSource(),s=t.style.projection.useSubdivision;if(n instanceof yn)pu(t,e,i,r,null,!1,!1,n.tileCoords,n.imageWarp,n.flippedWindingOrder,a,n.getMesh(t.context,s));else if(s){let[o,l,u]=t.stencilConfigForOverlapTwoPass(r);pu(t,e,i,u,o,!1,!0,Dp,mn,!1,a),pu(t,e,i,u,l,!0,!0,Dp,mn,!1,a)}else{let[o,l]=t.getStencilConfigForOverlapAndUpdateStencilID(r);pu(t,e,i,l,o,!1,!0,Dp,mn,!1,a)}}function pu(t,e,i,r,a,n,s,o,l,u=!1,h,c=null){let d=r[r.length-1].overscaledZ,p=t.context,f=p.gl,m=t.useProgram("raster"),g=t.style.projection,_=t.colorModeForRenderPass(),y=!t.options.moving,x=i.paint.get("raster-opacity"),v=i.paint.get("resampling")==="nearest"||i.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR,w=i.paint.get("raster-fade-duration"),b=!!t.style.map.terrain;for(let T of r){let D=t.getDepthModeForSublayer(T.overscaledZ-d,x===1?gt.ReadWrite:gt.ReadOnly,f.LESS),E=e.getTile(T);p.activeTexture.set(f.TEXTURE0),E.texture.bind(v,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1);let{parentTile:M,parentScaleBy:R,parentTopLeft:z,fadeValues:P}=mz(E,e,w,b);E.fadeOpacity=P.tileOpacity,M?(M.fadeOpacity=P.parentTileOpacity,M.texture.bind(v,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)):E.texture.bind(v,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),E.texture.useMipmap&&p.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&f.texParameterf(f.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let S=Ze(h,T),I=Fe(h,T,{aligned:y}),A=vM(z,R,P.fadeMix,i,o,l),L=c??g.getMeshFromTileID(p,T.canonical,n,s,"raster"),G=a?a[T.overscaledZ]:It.disabled;m.draw(p,f.TRIANGLES,D,G,_,u?Dt.frontCCW:Dt.backCCW,A,S,I,i.id,L.vertexBuffer,L.indexBuffer,L.segments)}}function mz(t,e,i,r){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(i===0||r)return a;if(t.fadingParentID){let n=e.getLoadedTile(t.fadingParentID);if(!n)return a;let s=2**(n.tileID.overscaledZ-t.tileID.overscaledZ);return{parentTile:n,parentScaleBy:s,parentTopLeft:[t.tileID.canonical.x*s%1,t.tileID.canonical.y*s%1],fadeValues:gz(t,n,i)}}return t.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:_z(t,i)}:a}function gz(t,e,i){let r=Ft(),a=(r-t.timeAdded)/i,n=(r-e.timeAdded)/i,s=t.fadingDirection===1,o=st(a,0,1),l=st(1-n,0,1),u=s?o:l;return{tileOpacity:u,parentTileOpacity:s?l:o,fadeMix:{opacity:1,mix:1-u}}}function _z(t,e){let i=(Ft()-t.timeAdded)/e,r=st(i,0,1);return{tileOpacity:r,fadeMix:{opacity:r,mix:0}}}function yz(t,e,i,r,a){let n=i.paint.get("background-color"),s=i.paint.get("background-opacity");if(s===0)return;let o=t.context,l=o.gl,u=t.style.projection,h=t.transform,c=h.tileSize,d=i.paint.get("background-pattern");if(t.isPatternMissing(d))return;let p=!d&&n.a===1&&s===1&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(a.currentPass!==p)return;let f=It.disabled,m=t.getDepthModeForSublayer(0,p==="opaque"?gt.ReadWrite:gt.ReadOnly),g=t.colorModeForRenderPass(),_=t.useProgram(d?"backgroundPattern":"background"),y=r||vn(h,{tileSize:c,terrain:t.style.map.terrain});d&&(o.activeTexture.set(l.TEXTURE0),t.patternAtlas.bind(t.context));let x=i.getCrossfadeParameters();for(let v of y){let w=Fe(a,v),b=d?XF(s,t,d,{tileID:v,tileSize:c},x):HF(s,n),T=Ze(a,v),D=u.getMeshFromTileID(o,v.canonical,!1,!0,"raster");_.draw(o,l.TRIANGLES,m,f,g,Dt.backCCW,b,T,w,i.id,D.vertexBuffer,D.indexBuffer,D.segments)}}var vz=new lt(1,0,0,1),xz=new lt(0,1,0,1),bz=new lt(0,0,1,1),wz=new lt(1,0,1,1),Tz=new lt(0,1,1,1);function Ez(t){let e=t.transform.padding;Kv(t,t.transform.height-(e.top||0),3,vz),Kv(t,e.bottom||0,3,xz),Jv(t,e.left||0,3,bz),Jv(t,t.transform.width-(e.right||0),3,wz);let i=t.transform.centerPoint;Sz(t,i.x,t.transform.height-i.y,Tz)}function Sz(t,e,i,r){Cu(t,e-1,i-10,2,20,r),Cu(t,e-10,i-1,20,2,r)}function Kv(t,e,i,r){Cu(t,0,e+i/2,t.transform.width,i,r)}function Jv(t,e,i,r){Cu(t,e-i/2,0,i,t.transform.height,r)}function Cu(t,e,i,r,a,n){let s=t.context,o=s.gl;o.enable(o.SCISSOR_TEST),o.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,a*t.pixelRatio),s.clear({color:n}),o.disable(o.SCISSOR_TEST)}function Dz(t,e,i,r){for(let a of i)Pz(t,e,a,r)}function Pz(t,e,i,r){let a=t.context,n=a.gl,s=t.useProgram("debug"),o=gt.disabled,l=It.disabled,u=t.colorModeForRenderPass(),h="$debug",c=Ze(r,i);a.activeTexture.set(n.TEXTURE0);let d=e.getTileByID(i.key).latestRawTileData?.byteLength||0,p=Math.floor(d/1024),f=e.getTile(i).tileSize,m=512/Math.min(f,512)*(i.overscaledZ/t.transform.zoom)*.5,g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),Cz(t,`${g} ${p}kB`);let _=Fe(r,i);s.draw(a,n.TRIANGLES,o,l,te.alphaBlended,Dt.disabled,$v(lt.transparent,m),null,_,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(a,n.LINE_STRIP,o,l,u,Dt.disabled,$v(lt.red),c,_,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function Cz(t,e){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,r=t.context.gl,a=t.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,i.width,i.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(e,5,5),a.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}function Iz(t,e){let i=null,r=Object.values(t._layers).flatMap(o=>o.source&&!o.isHidden(e)?[t.tileManagers[o.source]]:[]),a=r.filter(o=>o.getSource().type==="vector"),n=r.filter(o=>o.getSource().type!=="vector"),s=o=>{(!i||i.getSource().maxzoom<o.getSource().maxzoom)&&(i=o)};for(let o of a)s(o);if(!i)for(let o of n)s(o);return i}function Az(t,e,i,r){let{isRenderingGlobe:a}=r,n=t.context,s=i.implementation,o=t.style.projection,l=t.transform,u=l.getProjectionDataForCustomLayer(a),h={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:o.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; 1639uniform mat4 u_projection_matrix; 1640${o.shaderPreludeCode.vertexSource}`,define:o.shaderDefine},defaultProjectionData:u,getProjectionData:d=>l.getProjectionData({overscaledTileID:new Se(d.tileID.canonical.z,d.tileID.wrap??0,d.tileID.canonical.z,d.tileID.canonical.x,d.tileID.canonical.y),aligned:d.aligned,applyGlobeMatrix:d.applyGlobeMatrix,applyTerrainMatrix:d.applyTerrainMatrix})},c=s.renderingMode?s.renderingMode:"2d";if(r.currentPass==="offscreen"){let d=s.prerender;d&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),d.call(s,n.gl,h),n.setDirty(),t.setBaseState())}else if(r.currentPass==="translucent"){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(It.disabled);let d=c==="3d"?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,gt.ReadOnly);
vendor: 4,571 bytes, line 1640
1640n.setDepthMode(d),s.render(n.gl,h),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}function Mz(t,e){let i=t.context,r=i.gl,a=t.transform,n=te.unblended,s=new gt(r.LEQUAL,gt.ReadWrite,[0,1]),o=e.tileManager.getRenderableTiles(),l=t.useProgram("terrainDepth");i.bindFramebuffer.set(e.getFramebuffer().framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:lt.white,depth:1});for(let u of o){let h=e.getTerrainMesh(u.tileID),c=e.getTerrainData(u.tileID),d=a.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),p=Q3(e.getSkirtLength(a.zoom));l.draw(i,r.TRIANGLES,s,It.disabled,n,Dt.backCCW,p,c,d,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}function Fz(t,e,i,r){let{isRenderingGlobe:a}=r,n=t.context,s=n.gl,o=t.transform,l=t.colorModeForRenderPass(),u=t.getDepthModeFor3D(),h=t.useProgram("terrain");n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]);for(let c of i){let d=e.getTerrainMesh(c.tileID),p=t.renderToTexture.getTexture(c),f=e.getTerrainData(c.tileID);n.activeTexture.set(s.TEXTURE0),p.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let m=e.getSkirtLength(o.zoom),g=o.calculateFogMatrix(c.tileID.toUnwrapped()),_=J3(m,g,t.style.sky,o.pitch,a),y=Fe(r,c.tileID,{applyTerrainMatrix:!1});h.draw(n,s.TRIANGLES,u,It.disabled,l,Dt.backCCW,_,f,y,"terrain",d.vertexBuffer,d.indexBuffer,d.segments)}}function Tb(t,e){if(!e.mesh){let i=new gr;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let r=new Bi;r.emplaceBack(0,1,2),r.emplaceBack(0,2,3),e.mesh=new to(t.createVertexBuffer(i,ya.members),t.createIndexBuffer(r),qt.simpleSegment(0,0,i.length,r.length))}return e.mesh}function zz(t,e){let i=t.context,r=i.gl,a=QF(e,t.transform,t.pixelRatio),n=new gt(r.LEQUAL,gt.ReadWrite,[0,1]),s=It.disabled,o=t.colorModeForRenderPass(),l=t.useProgram("sky"),u=Tb(i,e);l.draw(i,r.TRIANGLES,n,s,o,Dt.disabled,a,null,void 0,"sky",u.vertexBuffer,u.indexBuffer,u.segments)}function Rz(t,e){let i=t.getCartesianPosition();Zg(i,i);let r=Ei(new Float64Array(16));return t.properties.get("anchor")==="map"&&(dr(r,r,e.rollInRadians),sa(r,r,-e.pitchInRadians),dr(r,r,e.bearingInRadians),sa(r,r,e.center.lat*Math.PI/180),Nc(r,r,-e.center.lng*Math.PI/180)),qg(i,i,r),i}function kz(t,e,i){let r=t.context,a=r.gl,n=t.useProgram("atmosphere"),s=new gt(a.LEQUAL,gt.ReadOnly,[0,1]),o=t.transform,l=Rz(i,t.transform),u=o.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=e.properties.get("atmosphere-blend")*u.projectionTransition;if(h===0)return;let c=_n(o.worldSize,o.center.lat),d=Qx(o),p=KF(l,h,d,c,o.inverseProjectionMatrix),f=Tb(r,e);n.draw(r,a.TRIANGLES,s,It.disabled,te.alphaBlended,Dt.disabled,p,null,null,"atmosphere",f.vertexBuffer,f.indexBuffer,f.segments)}var Lz={symbol:G5,circle:Y5,heatmap:K5,line:lz,fill:uz,fillExtrusion:hz,hillshade:cz,colorRelief:pz,raster:fz,background:yz,sky:zz,atmosphere:kz,custom:Az,debug:Dz,debugPadding:Ez,terrainDepth:Mz},va,Bz=(va=class{constructor(e,i){this.drawFunctions=Lz,this.context=new j5(e),this.transform=i,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Ei(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Lp.maxOverzooming+Lp.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new Ux}resize(e,i,r){if(this.width=Math.floor(e*r),this.height=Math.floor(i*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let a of this.style._order)this.style._layers[a].resize()}setup(){let e=this.context,i=new gr;i.emplaceBack(0,0),i.emplaceBack(k,0),i.emplaceBack(0,k),i.emplaceBack(k,k),this.tileExtentBuffer=e.createVertexBuffer(i,ya.members),this.tileExtentSegments=qt.simpleSegment(0,0,4,2);let r=new gr;r.emplaceBack(0,0),r.emplaceBack(k,0),r.emplaceBack(0,k),r.emplaceBack(k,k),this.debugBuffer=e.createVertexBuffer(r,ya.members),this.debugSegments=qt.simpleSegment(0,0,4,5);let a=new e0;a.emplaceBack(0,0,0,0),a.emplaceBack(k,0,k,0),a.emplaceBack(0,k,0,k),a.emplaceBack(k,k,k,k),this.rasterBoundsBuffer=e.createVertexBuffer(a,W3.members),this.rasterBoundsSegments=qt.simpleSegment(0,0,4,2);let n=new gr;n.emplaceBack(0,0),n.emplaceBack(k,0),n.emplaceBack(0,k),n.emplaceBack(k,k),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(n,ya.members),this.rasterBoundsSegmentsPosOnly=qt.simpleSegment(0,0,4,5);let s=new gr;
vendor: 17,248 bytes, line 1640
1640s.emplaceBack(0,0),s.emplaceBack(1,0),s.emplaceBack(0,1),s.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(s,ya.members),this.viewportSegments=qt.simpleSegment(0,0,4,2);let o=new a0;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let l=new Bi;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(l);let u=this.context.gl;this.stencilClearMode=new It({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO),this.tileExtentMesh=new to(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=cr();Ri(r,0,this.width,this.height,0,0,1),we(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]);let a={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r,clipAntimeridian:!1};this.useProgram("clippingMask",null,!0).draw(e,i.TRIANGLES,gt.disabled,this.stencilClearMode,te.disabled,Dt.disabled,null,null,a,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,i){if(this.currentStencilSource===e.source||!e.isTileClipped()||!i?.length)return;this.currentStencilSource=e.source,this.nextStencilID+i.length>256&&this.clearStencil();let r=this.context;r.setColorMode(te.disabled),r.setDepthMode(gt.disabled);let a={};for(let n of i)a[n.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(a,i,!0),this._renderTileMasks(a,i,!1),this._tileClippingMaskIDs=a}_renderTileMasks(e,i,r){let a=this.context,n=a.gl,s=this.style.projection,o=this.renderContext,l=this.useProgram("clippingMask");for(let u of i){let h=e[u.key],c=Ze(o,u),d=s.getMeshFromTileID(this.context,u.canonical,r,!0,"stencil"),p=Fe(o,u);l.draw(a,n.TRIANGLES,gt.disabled,new It({func:n.ALWAYS,mask:0},h,255,n.KEEP,n.KEEP,n.REPLACE),te.disabled,o.isRenderingToTexture?Dt.disabled:Dt.backCCW,null,c,p,"$clipping",d.vertexBuffer,d.indexBuffer,d.segments)}}_renderTilesDepthBuffer(){let e=this.context,i=e.gl,r=this.style.projection,a=this.transform,n=this.useProgram("depth"),s=this.getDepthModeFor3D(),o=vn(a,{tileSize:a.tileSize});for(let l of o){let u=Ze(this.renderContext,l),h=r.getMeshFromTileID(this.context,l.canonical,!0,!0,"raster"),c=Fe(this.renderContext,l);n.draw(e,i.TRIANGLES,s,It.disabled,te.disabled,Dt.backCCW,null,u,c,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,i=this.context.gl;return new It({func:i.NOTEQUAL,mask:255},e,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(e){let i=this.context.gl;return new It({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,i.KEEP,i.KEEP,i.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let i=this.context.gl,r=e.sort((s,o)=>o.overscaledZ-s.overscaledZ),a=r[r.length-1].overscaledZ,n=r[0].overscaledZ-a+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let s={};for(let o=0;o<n;o++)s[o+a]=new It({func:i.GEQUAL,mask:255},o+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=n,[s,r]}return[{[a]:It.disabled},r]}stencilConfigForOverlapTwoPass(e){let i=this.context.gl,r=e.sort((s,o)=>o.overscaledZ-s.overscaledZ),a=r[r.length-1].overscaledZ,n=r[0].overscaledZ-a+1;if(this.clearStencil(),n>1){let s={},o={};for(let l=0;l<n;l++)s[l+a]=new It({func:i.GREATER,mask:255},n+1+l,255,i.KEEP,i.KEEP,i.REPLACE),o[l+a]=new It({func:i.GREATER,mask:255},1+l,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID=n*2+1,[s,o,r]}return this.nextStencilID=3,[{[a]:new It({func:i.GREATER,mask:255},2,255,i.KEEP,i.KEEP,i.REPLACE)},{[a]:new It({func:i.GREATER,mask:255},1,255,i.KEEP,i.KEEP,i.REPLACE)},r]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let i=.125;return new te([e.CONSTANT_COLOR,e.ONE],new lt(i,i,i,0),[!0,!0,!0,!0])}return this.renderContext.currentPass==="opaque"?te.unblended:te.alphaBlended}getDepthModeForSublayer(e,i,r){if(!this.opaquePassEnabledForLayer())return gt.disabled;let a=1-((1+this.renderContext.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new gt(r||this.context.gl.LEQUAL,i,[a,a])}getDepthModeFor3D(){return new gt(this.context.gl.LEQUAL,gt.ReadWrite,this.renderContext.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.renderContext.currentLayer<this.renderContext.opaquePassCutoff}render(e,i){this.style=e,this.options=i;let r=this.renderContext=U5(this.transform,e.projection,e.map.terrain??null);this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.patternAtlas=e.patternAtlas,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(Ft()),V5(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let a=this.style._order,n=this.style.tileManagers,s={},o={},l={};for(let h in n){let c=n[h];c.used&&c.prepare(this.context),s[h]=c.getVisibleCoordinates(!1),o[h]=s[h].slice().reverse(),l[h]=c.getVisibleCoordinates(!0).reverse()}r.opaquePassCutoff=1/0;for(let h=0;h<a.length;h++){let c=a[h];if(this.style._layers[c].is3D()){r.opaquePassCutoff=h;break}}this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),r.opaquePassCutoff=0),r.currentPass="offscreen";for(let h of a){let c=this.style._layers[h];if(!c.hasOffscreenPass()||c.isHidden(this.transform.zoom))continue;let d=o[c.source];(c.type==="custom"||d.length)&&this.renderLayer(this,n[c.source],c,d,r)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?lt.black:lt.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,r.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(r.currentPass="opaque",r.currentLayer=a.length-1;r.currentLayer>=0;r.currentLayer--){let h=this.style._layers[a[r.currentLayer]];if(h.isHidden(this.transform.zoom))continue;let c=n[h.source],d=s[h.source];this.renderTileClippingMasks(h,d),this.renderLayer(this,c,h,d,r)}r.currentPass="translucent";let u=!1;for(r.currentLayer=0;r.currentLayer<a.length;r.currentLayer++){let h=this.style._layers[a[r.currentLayer]];if(h.isHidden(this.transform.zoom))continue;let c=n[h.source];if(this.renderToTexture?.renderLayer(h,r))continue;!this.opaquePassEnabledForLayer()&&!u&&(u=!0,r.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let d=(h.type==="symbol"?l:o)[h.source];this.renderTileClippingMasks(h,s[h.source]),this.renderLayer(this,c,h,d,r)}if(r.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let h=Iz(this.style,this.transform.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates(),r)}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.renderToTexture&&!this.options.moving&&this.clearRTTPool(),this.context.setDefault()}markTerrainDepthDirty(){this.terrainFacilitator.depthDirty=!0}maybeDrawDepth(){if(!this.style?.projection||!this.style.map?.terrain)return;let e=this.terrainFacilitator.matrix,i=this.transform.modelViewProjectionMatrix,r=this.terrainFacilitator.depthDirty;r||(r=!Ng(e,i)),r||(r=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),r&&(Vg(e,i),this.terrainFacilitator.renderTime=Ft(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(e,i,r,a,n){if(r.isHidden(this.transform.zoom)||r.type!=="background"&&r.type!=="custom"&&!(a||[]).length)return;this.id=r.id;let s=this.drawFunctions;$d(r)?s.symbol(e,i,r,a,this.style.placement.variableOffsets,n):p0(r)?s.circle(e,i,r,a,n):y0(r)?s.heatmap(e,i,r,a,n):U0(r)?s.line(e,i,r,a,n):A0(r)?s.fill(e,i,r,a,n):O0(r)?s.fillExtrusion(e,i,r,a,n):v0(r)?s.hillshade(e,i,r,a,n):b0(r)?s.colorRelief(e,i,r,a,n):jl(r)?s.raster(e,i,r,a,n):m1(r)?s.background(e,i,r,a,n):_1(r)&&s.custom(e,i,r,n)}saveTileTexture(e){let i=this._tileTextures[e.size[0]];i?i.length<va.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?i.push(e):e.destroy():this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let i=this._tileTextures[e];return i&&i.length>0?i.pop():null}acquireRTT(e){let i=this.context.gl,r=this._rttObjectRecyclePool.pop();if(r)return r.size!==e&&(r.texture.update({width:e,height:e,data:null},{premultiply:!1,useMipmap:!0}),r.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),r.size=e),r;let a=new he(this.context,{width:e,height:e,data:null},i.RGBA,{premultiply:!1,useMipmap:!0});return a.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:a,size:e}}bindRTT(e){let i=this.context.gl,r=e.size;if(!this._rttSharedFbo){let a=this.context.createFramebuffer(r,r,!0,!0),n=this.context.createRenderbuffer(i.DEPTH_STENCIL,r,r);a.depthAttachment.set(n),this._rttSharedFbo={fbo:a,depthRenderbuffer:n,size:r}}this._rttSharedFbo.size!==r&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,r),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=r,this._rttSharedFbo.fbo.height=r,this._rttSharedFbo.size=r),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}clearRTTPool(){for(let e of this._rttObjectRecyclePool)e.texture.destroy();this._rttObjectRecyclePool.length=0}destroyRTTResources(){if(this.clearRTTPool(),!this._rttSharedFbo)return;this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let e=this.context.gl;e.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),e.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let i=this.patternAtlas.getPattern(e.from.toString()),r=this.patternAtlas.getPattern(e.to.toString());return!i||!r}useProgram(e,i,r=!1,a=[]){var m;this.cache||(this.cache={});let n=!!this.style.map.terrain,s=this.style.projection,o=r?rr.projectionMercator:s.shaderPreludeCode,l=r?Nx:s.shaderDefine,u=`/${r?$x:s.shaderVariantName}`,h=i?i.cacheKey:"",c=this._showOverdrawInspector?"/overdraw":"",d=n?"/terrain":"",p=a?`/${a.join("/")}`:"",f=e+h+u+c+d+p;return(m=this.cache)[f]||(m[f]=new oF(this.context,rr[e],i,t5[e],this._showOverdrawInspector,n,o,l,a)),this.cache[f]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new he(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){if(this._tileTextures){for(let e in this._tileTextures){let i=this._tileTextures[e];if(i)for(let r of i)r.destroy()}this._tileTextures={}}if(this.destroyRTTResources(),this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let e in this.cache){let i=this.cache[e];i?.program&&this.context.gl.deleteProgram(i.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:i}=this.context.gl;return this.width!==e||this.height!==i}},va.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,va),Eb=class extends Error{constructor(t,e){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=t,this.statusMessage=e?.statusMessage??null}};function gf(t,e){let i=!1,r=null,a,n=()=>{r=null,i&&(i=(t(...a),r=setTimeout(n,e),!1))};return(...s)=>(i=!0,a=s,r||n(),r)}var Sb=class{constructor(t){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let e=this._getHashParams();return this._hashName?(e.get(this._hashName)||"").split("/"):([...e.keys()][0]??"").split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let i=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:i,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getHashParams();if(this._hashName)e.delete(this._hashName);else{let n=Array.from(e.keys());n.length>0&&e.delete(n[0])}let i=decodeURIComponent(e.toString()).replace(/=&/g,"&").replace(/=$/g,""),r=i?`#${i}`:"",a=window.location.href.replace(/(#.+)?$/,r);a=a.replace("&&","&"),window.history.replaceState(window.history.state,null,a)},this._updateHash=gf(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){let e=this._map.getCenter(),i=Math.round(this._map.getZoom()*100)/100,r=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(e.lng*r)/r,n=Math.round(e.lat*r)/r,s=this._map.getBearing(),o=this._map.getPitch(),l="";if(l+=t?`/${a}/${n}/${i}`:`${i}/${n}/${a}`,(s||o)&&(l+=`/${Math.round(s*10)/10}`),o&&(l+=`/${Math.round(o)}`),this._hashName){let u=this._getHashParams();return u.set(this._hashName,l),`#${decodeURIComponent(u.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${l}`}_isValidHash(t){if(t.length<3||t.some(a=>isNaN(+a)))return!1;try{new Y(+t[2],+t[1])}catch{return!1}let e=+t[0],i=+(t[3]||0),r=+(t[4]||0);return e>=this._map.getMinZoom()&&e<=this._map.getMaxZoom()&&i>=-180&&i<=180&&r>=this._map.getMinPitch()&&r<=this._map.getMaxPitch()}},eo={linearity:.3,easing:_l(0,0,.3,1)},Oz=q({deceleration:2500,maxSpeed:1400},eo),Vz=q({deceleration:20,maxSpeed:1400},eo),jz=q({deceleration:1e3,maxSpeed:360},eo),Uz=q({deceleration:1e3,maxSpeed:90},eo),Nz=q({deceleration:1e3,maxSpeed:360},eo),$z=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Ft(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,e=Ft();for(;t.length>0&&e-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,e=Ft()-60,i=Math.max(0,t.length-2);for(;i>0&&t[i-1].time>=e;)i--;return t.slice(i)}_onMoveEnd(t){this._drainInertiaBuffer();let e=this._getVelocityEntries();if(e.length<2){this.clear();return}let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new C(0,0),pinchAround:void 0,around:void 0};for(let{settings:n}of e)n.around&&(i.around=n.around),n.pinchAround&&(i.pinchAround=n.pinchAround);for(let{settings:n}of e.slice(1))i.zoom+=n.zoomDelta||0,i.bearing+=n.bearingDelta||0,i.pitch+=n.pitchDelta||0,i.roll+=n.rollDelta||0,n.panDelta&&i.pan._add(n.panDelta);if(!i.pan.mag()&&!i.zoom&&!i.bearing&&!i.pitch&&!i.roll){this.clear();return}let r=Ft()-e[0].time,a={};if(i.pan.mag()){let n=qs(i.pan.mag(),r,q({},Oz,t||{})),s=i.pan.mult(n.amount/i.pan.mag()),o=this._map._camera.cameraHelper.handlePanInertia(s,this._map._camera.transform);a.center=o.easingCenter,a.offset=o.easingOffset,Zs(a,n)}if(i.zoom){let n=qs(i.zoom,r,Vz);a.zoom=Qe(this._map.getZoom()+n.amount,this._map.getZoomSnap(),n.amount),Zs(a,n)}if(i.bearing){let n=qs(i.bearing,r,jz);
vendor: 6,414 bytes, line 1640
1640a.bearing=this._map.getBearing()+st(n.amount,-179,179),Zs(a,n)}if(i.pitch){let n=qs(i.pitch,r,Uz);a.pitch=this._map.getPitch()+n.amount,Zs(a,n)}if(i.roll){let n=qs(i.roll,r,Nz);a.roll=this._map.getRoll()+st(n.amount,-179,179),Zs(a,n)}if(a.zoom||a.bearing){let n=i.pinchAround===void 0?i.around:i.pinchAround;a.around=n?this._map.unproject(n):this._map.getCenter()}return this.clear(),q(a,{noMoveStart:!0})}};function Zs(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function qs(t,e,i){let{maxSpeed:r,linearity:a,deceleration:n}=i,s=st(t*a/(e/1e3),-r,r),o=Math.abs(s)/(n*a);return{easing:i.easing,duration:o*1e3,amount:o/2*s}}var Gz=class{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new ux(this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new ci(t.type,this._map,t))}mouseup(t){this._map.fire(new ci(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new ci(t.type,this._map,t))}dblclick(t){return this._firePreventable(new ci(t.type,this._map,t))}mouseover(t){this._map.fire(new ci(t.type,this._map,t))}mouseout(t){this._map.fire(new ci(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Xs(t.type,this._map,t))}touchmove(t){this._map.fire(new Xs(t.type,this._map,t))}touchend(t){this._map.fire(new Xs(t.type,this._map,t))}touchcancel(t){this._map.fire(new Xs(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},Zz=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new ci(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ci("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new ci(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},Db=class{constructor(t,e,i){this._map=t,this._tr=i,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,e.boxZoom&&typeof e.boxZoom=="object"&&(this._boxZoomEnd=e.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&t.button===0&&(nt.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;let i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=i,this._box||(this._box=nt.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let a=Math.min(r.x,i.x),n=Math.max(r.x,i.x),s=Math.min(r.y,i.y),o=Math.max(r.y,i.y);this._box.style.transform=`translate(${a}px,${s}px)`,this._box.style.width=`${n-a}px`,this._box.style.height=`${o-s}px`}mouseupWindow(t,e){if(!this._active||t.button!==0)return;let i=this._startPos,r=e;if(this.reset(),nt.suppressClick(),i.x===r.x&&i.y===r.y)this._fireEvent("boxzoomcancel",t);else{if(this._map.fire(new Mp("boxzoomend",{originalEvent:t})),this._boxZoomEnd){this._boxZoomEnd(this._map,i,r,t);return}return{cameraAnimation:a=>a.fitScreenCoordinates(i,r,this._tr.bearing,{linear:!0})}}}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&&(this._box=(this._box.remove(),null)),nt.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,e){return this._map.fire(new Mp(t,{originalEvent:e}))}};function Gp(t,e){if(t.length!==e.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);let i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}function qz(t){let e=new C(0,0);for(let i of t)e._add(i);return e.div(t.length)}var Wz=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,e,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=qz(e),this.touches=Gp(i,e)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;let r=Gp(i,e);for(let a in this.touches){let n=this.touches[a],s=r[a];(!s||s.dist(n)>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),i.length===0){let r=!this.aborted&&this.centroid;if(this.reset(),r)return r}}},Zp=class{constructor(t){this.singleTap=new Wz(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){let r=this.singleTap.touchend(t,e,i);if(r){let a=t.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if((!a||!n)&&this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},Hz=class{constructor(t,e){this._tr=e,this._zoomIn=new Zp({numTouches:1,numTaps:2}),this._zoomOut=new Zp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){let r=this._zoomIn.touchend(t,e,i),a=this._zoomOut.touchend(t,e,i),n=this._tr;if(r)return this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>s.easeTo({duration:300,zoom:Qe(n.zoom+1,s.getZoomSnap()),around:n.unproject(r)},{originalEvent:t})};if(a)return this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>
vendor: 20,895 bytes, line 1640
1640s.easeTo({duration:300,zoom:Qe(n.zoom-1,s.getZoomSnap()),around:n.unproject(a)},{originalEvent:t})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},io=class{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){let e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.rollDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(e)?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t)){this.reset(t);return}let r=Array.isArray(e)?e[0]:e;if(!(!this._moved&&r.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(i,r)}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&nt.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}},Xz={0:1,2:2};function Yz(t,e){let i=Xz[e];return t.buttons===void 0||(t.buttons&i)!==i}var ro=class{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!Yz(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}},Kz=class{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)}},Jz=class{constructor(t=new ro({checkCorrectEvent:()=>!0}),e=new Kz){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=e}_executeRelevantHandler(t,e,i){if(t instanceof MouseEvent)return e(t);if(typeof TouchEvent<"u"&&t instanceof TouchEvent)return i(t)}startMove(t){this._executeRelevantHandler(t,e=>{this.mouseMoveStateManager.startMove(e)},e=>{this.oneFingerTouchMoveStateManager.startMove(e)})}endMove(t){this._executeRelevantHandler(t,e=>{this.mouseMoveStateManager.endMove(e)},e=>{this.oneFingerTouchMoveStateManager.endMove(e)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,e=>this.mouseMoveStateManager.isValidStartEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,e=>this.mouseMoveStateManager.isValidMoveEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,e=>this.mouseMoveStateManager.isValidEndEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e))}},zu=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=e=>{e.preventDefault()}};function Qz({enable:t,clickTolerance:e}){return new io({clickTolerance:e,move:(i,r)=>({around:r,panDelta:r.sub(i)}),activateOnStart:!0,moveStateManager:new ro({checkCorrectEvent:i=>i.button===0&&!i.ctrlKey}),enable:t,assignEvents:zu})}function tR({enable:t,clickTolerance:e,aroundCenter:i=!0,minPixelCenterThreshold:r=100,rotateSpeed:a=.8},n){return new io({clickTolerance:e,move:(s,o)=>{let l=n();if(i&&Math.abs(l.y-s.y)>r)return{bearingDelta:Kc(new C(s.x,o.y),o,l)};let u=(o.x-s.x)*a;return i&&o.y<l.y&&(u=-u),{bearingDelta:u}},moveStateManager:new ro({checkCorrectEvent:s=>s.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:t,assignEvents:zu})}function eR({enable:t,clickTolerance:e,pitchSpeed:i=-.5}){return new io({clickTolerance:e,move:(r,a)=>({pitchDelta:(a.y-r.y)*i}),moveStateManager:new ro({checkCorrectEvent:r=>r.button===0&&r.ctrlKey||r.button===2}),enable:t,assignEvents:zu})}function iR({enable:t,clickTolerance:e,rollDegreesPerPixelMoved:i=.3},r){return new io({clickTolerance:e,move:(a,n)=>{let s=r(),o=(n.x-a.x)*i;return n.y<s.y&&(o=-o),{rollDelta:o}},moveStateManager:new ro({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:t,assignEvents:zu})}var rR=class{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new C(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(this._shouldBePrevented(i.length)){this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t);return}return t.preventDefault(),this._calculateTransform(t,e,i)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,e,i){i.length>0&&(this._active=!0);let r=Gp(i,e),a=new C(0,0),n=new C(0,0),s=0;for(let l in r){let u=r[l],h=this._touches[l];h&&(a._add(u),n._add(u.sub(h)),s++,r[l]=u)}if(this._touches=r,this._shouldBePrevented(s)||!n.mag())return;let o=n.div(s);if(this._sum._add(o),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:o}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},_f=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();let[r,a]=this._firstTwoTouches,n=fu(i,e,r),s=fu(i,e,a);if(!n||!s)return;let o=this._aroundCenter?null:n.add(s).div(2);return this._move([n,s],o,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;let[r,a]=this._firstTwoTouches,n=fu(i,e,r),s=fu(i,e,a);n&&s||(this._active&&nt.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 fu(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}var Qv=.1;function tx(t,e){return Math.log(t/e)/Math.LN2}var Pb=class extends _f{constructor(){super(),this._zoomRate=1,this._zoomThreshold=Qv}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??Qv}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){let i=this._distance;if(this._distance=t[0].dist(t[1]),!(!this._active&&Math.abs(tx(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:tx(this._distance,i)*this._zoomRate,pinchAround:e}}};function ex(t,e){return t.angleWith(e)*180/Math.PI}var Cb=class extends _f{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,e,i){let r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ex(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let e=25/(Math.PI*this._minDiameter)*360,i=ex(t,this._startVector);return Math.abs(i)<e}};function Pp(t){return Math.abs(t.y)>Math.abs(t.x)}var Ib=class extends _f{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,Pp(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=t[0].sub(this._lastPoints[0]),a=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,a,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+a.y)/2*-.5}}gestureBeginsVertically(t,e,i){if(this._valid!==void 0)return this._valid;let r=t.mag()>=2,a=e.mag()>=2;if(!r&&!a)return;if(!r||!a)return this._firstMove===void 0&&(this._firstMove=i),i-this._firstMove<100&&void 0;let n=t.y>0==e.y>0;return Pp(t)&&Pp(e)&&n}},aR={panStep:100,bearingStep:15,pitchStep:10},Ab=class{constructor(t,e){this._tr=e;let i=aR;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,r=0,a=0,n=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),n=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{let o=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:nR,zoom:e?Qe(o.zoom+e*(t.shiftKey?2:1),s.getZoomSnap()):o.zoom,bearing:o.bearing+i*this._bearingStep,pitch:o.pitch+r*this._pitchStep,offset:[-a*this._panStep,-n*this._panStep],center:o.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 nR(t){return t*(2-t)}var ix=4.000244140625,Mb=class{constructor(t,e,i){this._onTimeout=r=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(r)},this._map=t,this._tr=i,this._triggerRenderFrame=e,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)):!1}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);return}let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?t.deltaY*40:t.deltaY,i=Ft(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,e!==0&&e%ix==0?this._type="wheel":e!==0&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let e=nt.mousePos(this._map.getCanvas(),t),i=this._tr;this._aroundPoint=this._aroundCenter?i.transform.locationToScreenPoint(Y.convert(i.center)):e,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let s=t.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=s),typeof this._targetZoom=="number"&&(this._targetZoom+=s)}if(this._delta!==0){let s=this._type==="wheel"&&Math.abs(this._delta)>ix?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*s)));this._delta<0&&o!==0&&(o=1/o);let l=typeof this._targetZoom=="number"?Be(this._targetZoom):t.scale,u=t.applyConstrain(t.getCameraLngLat(),Ee(l*o)).zoom,h=this._map.getZoomSnap();if(this._type==="wheel"&&h>0){let c=Qe(t.zoom,h);this._targetZoom=Qe(u,h,u-c)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let e=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,i=this._startZoom,r=this._easing,a=!1,n;if(this._type==="wheel"&&i&&r){let s=Ft()-this._lastWheelEventTime,o=Math.min((s+5)/200,1),l=r(o);n=Zt.number(i,e,l),o<1?this._needsRerender=!0:a=!0}else n=e,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=n,{noInertia:!0,needsRenderFrame:!a,zoomDelta:n-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let e=yl;if(this._prevEase){let i=this._prevEase,r=(Ft()-i.start)/i.duration,a=i.easing(r+.01)-i.easing(r),n=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-n*n);e=_l(n,s,.25,1)}return this._prevEase={start:Ft(),duration:t,easing:e},e}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},Fb=class{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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()}},sR=class{constructor(t,e){this._tr=e,this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:Qe(this._tr.zoom+(t.shiftKey?-1:1),i.getZoomSnap()),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oR=class{constructor(){this._tap=new Zp({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(t,e,i);else{let r=e[0],a=t.timeStamp-this._tapTime<500,n=this._tapPoint.dist(r)<30;!a||!n?this.reset():i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier)}}touchmove(t,e,i){if(!this._tapTime)this._tap.touchmove(t,e,i);else if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=e[0],a=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:a/128*this._zoomRate}}}touchend(t,e,i){if(this._tapTime)this._swipePoint&&i.length===0&&this.reset();else{let r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},zb=class{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}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()}},Rb=class{constructor(t,e,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=e,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},kb=class{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,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()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},Lb=class{constructor(t,e){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=nt.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);let a=document.createElement("div");a.className="maplibregl-mobile-message",a.textContent=i,this._container.appendChild(a),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),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,e){this._enabled&&(this._map.fire(new ye("cooperativegestureprevented",{gestureType:t,originalEvent:e})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},lR=class{constructor(t){this._camera=t}get transform(){return this._camera._requestedCameraState||this._camera.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.screenPointToLocation(C.convert(t),this._camera.terrain)}},mu=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate,uR=class extends ei{};function Cp(t){return t.panDelta?.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}var hR=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(t,e,i){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=a=>{this.handleEvent(a,`${a.type}Window`)},this.handleEvent=(a,n)=>{if(a.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let s=a.type==="renderFrame"?void 0:a,o={needsRenderFrame:!1},l={},u={};for(let{handlerName:d,handler:p,allowed:f}of this._handlers){if(!p.isEnabled())continue;let m;if(this._blockedByActive(u,f,d))p.reset();else if(p[n||a.type]){if(f_(a,n||a.type)){let g=nt.mousePos(this._map.getCanvas(),a);m=p[n||a.type](a,g)}else if(p_(a,n||a.type)){let g=a.touches,_=this._getMapTouches(g),y=nt.touchPos(this._map.getCanvas(),_);m=p[n||a.type](a,y,_)}else m_(n||a.type)||(m=p[n||a.type](a));this.mergeHandlerResult(o,l,m,d,s),m?.needsRenderFrame&&this._triggerRe
vendor: 8,759 bytes, line 1640
1640nderFrame()}(m||p.isActive())&&(u[d]=p)}let h={};for(let d in this._previousActiveHandlers)u[d]||(h[d]=s);this._previousActiveHandlers=u,(Object.keys(h).length||Cp(o))&&(this._changes.push([o,l,h]),this._triggerRenderFrame()),(Object.keys(u).length||Cp(o))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:c}=o;c&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],c(this._map))},this._map=t,this._camera=e,this._transformProvider=new lR(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $z(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[a,n,s]of this._listeners)a.addEventListener(n,a===this._ownerDocument?this.handleWindowEvent:this.handleEvent,s)}destroy(){for(let[t,e,i]of this._listeners)t.removeEventListener(e,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Gz(e,t));let r=e.boxZoom=new Db(e,t,this._transformProvider);this._add("boxZoom",r),t.interactive&&t.boxZoom&&r.enable();let a=e.cooperativeGestures=new Lb(e,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let n=new Hz(e,this._transformProvider),s=new sR(e,this._transformProvider);e.doubleClickZoom=new Fb(s,n),this._add("tapZoom",n),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();let o=new oR;this._add("tapDragZoom",o);let l=e.touchPitch=new Ib(e);this._add("touchPitch",l),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let u=()=>e.project(e.getCenter()),h=tR(t,u),c=eR(t),d=iR(t,u);e.dragRotate=new Rb(t,h,c,d),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",c,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();let p=Qz(t),f=new rR(t,e);e.dragPan=new zb(i,p,f),this._add("mousePan",p),this._add("touchPan",f,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);let m=new Cb,g=new Pb;e.touchZoomRotate=new kb(i,g,m,o),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new Zz(e));let _=e.scrollZoom=new Mb(e,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",_,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);let y=e.keyboard=new Ab(e,this._transformProvider);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable()}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{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!!mu(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,e,i){for(let r in t)if(r!==i&&!e?.includes(r))return!0;return!1}_getMapTouches(t){let e=[];for(let i of t){let r=i.target;this._el.contains(r)&&e.push(i)}return e}mergeHandlerResult(t,e,i,r,a){if(!i)return;q(t,i);let n={handlerName:r,originalEvent:i.originalEvent||a};i.zoomDelta!==void 0&&(e.zoom=n),i.panDelta!==void 0&&(e.drag=n),i.rollDelta!==void 0&&(e.roll=n),i.pitchDelta!==void 0&&(e.pitch=n),i.bearingDelta!==void 0&&(e.rotate=n)}_applyChanges(){let t={},e={},i={};for(let[r,a,n]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new C(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),r.rollDelta&&(t.rollDelta=(t.rollDelta||0)+r.rollDelta),r.around!==void 0&&(t.around=r.around),r.pinchAround!==void 0&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),q(e,a),q(i,n);this._updateMapTransform(t,e,i),this._changes=[]}_updateMapTransform(t,e,i){let r=this._map,a=this._camera.getTransformForUpdate(),n=r.terrain;if(!Cp(t)&&!(n&&this._terrainMovement)){this._fireEvents(e,i,!0);return}this._camera.stop(!0);let{panDelta:s,zoomDelta:o,bearingDelta:l,pitchDelta:u,rollDelta:h}=t,{around:c,aroundOnSurface:d}=this._resolveAround(t,n,a),p=n?this._terrainGestureElevation(n,c,d,a,e):void 0,f={panDelta:s,zoomDelta:o,rollDelta:h,pitchDelta:u,bearingDelta:l,around:c,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!a.isPointOnMapSurface(c)&&(c=a.centerPoint);let m=this._computePreZoomAroundLoc(a,c,s,p);this._handleMapControls({terrain:n,tr:a,deltasForHelper:f,preZoomAroundLoc:m,combinedEventsInProgress:e,panDelta:s}),this._camera.applyUpdatedTransform(a),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_resolveAround(t,e,i){let r=t.pinchAround===void 0?t.around:t.pinchAround;return r||(r=this._camera.transform.centerPoint),e&&!i.isPointOnMapSurface(r)?{around:i.centerPoint,aroundOnSurface:!1}:{around:r,aroundOnSurface:!0}}_terrainGestureElevation(t,e,i,r,a){if(!i)return;if(!this._terrainMovement&&(a.drag||a.zoom)){let s=r.screenTerrainPointToMercatorCoordinate(e,t);this._terrainGestureAnchorElevation=s?s.z:null}if(this._terrainGestureAnchorElevation===null)return;let n=this._terrainGestureAnchorElevation;if(!(e.distSqr(r.centerPoint)<.01)&&!(n-r.elevation>=.9*(r.getCameraAltitude()-r.elevation)))return n}_computePreZoomAroundLoc(t,e,i,r){if(e.distSqr(t.centerPoint)<.01)return t.center;let a=i?e.sub(i):e;return r===void 0?t.screenPointToLocation(a):t.screenPointToLocationAtElevation(a,r)}_handleMapControls({terrain:t,tr:e,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:a,panDelta:n}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,e),!t){s.handleMapControlsPan(i,e,r);return}if(s.useGlobeControls){!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(i,e,r);return}if(!this._terrainMovement&&(a.drag||a.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(i,e,r);return}if(i.aroundElevation===void 0&&a.drag&&this._terrainMovement&&n){e.setCenter(e.screenPointToLocation(e.centerPoint.sub(n)));return}s.handleMapControlsPan(i,e,r)}_fireEvents(t,e,i){let r=mu(this._eventsInProgress),a=mu(t),n={};for(let h in t){let{originalEvent:c}=t[h];this._eventsInProgress[h]||(n[`${h}start`]=c),this._eventsInProgress[h]=t[h]}!r&&a&&this._fireEvent("movestart",a.originalEvent);for(let h in n)this._fireEvent(h,n[h]);a&&this._fireEvent("move",a.originalEvent);for(let h in t){let{originalEvent:c}=t[h];this._fireEvent(h,c)}let s={},o;for(let h in this._eventsInProgress){let{handlerName:c,originalEvent:d}=this._eventsInProgress[h];this._handlersById[c].isActive()||(delete this._eventsInProgress[h],o=e[c]||d,s[`${h}end`]=o)}for(let h in s)this._fireEvent(h,s[h]);let l=mu(this._eventsInProgress),u=(r||a)&&!l;if(u&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let h=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&h.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(h)}if(i&&u){this._updatingCamera=!0;let h=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),c=d=>d!==0&&-this._bearingSnap<d&&d<this._bearingSnap;h&&(h.essential||!Ge.prefersReducedMotion)?(c(h.bearing||this._map.getBearing())&&(h.bearing=0),h.freezeElevation=!0,this._map.easeTo(h,{originalEvent:o})):(this._map.fire(new Q("moveend",{originalEvent:o})),c(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,e){this._map.fire(new Q(t,e?{originalEvent:e}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new uR("renderFrame",{timeStamp:t})),this._applyChanges()})}
vendor: 5,313 bytes, line 1640
1640_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},cR=class extends ce{constructor(t){super(),this._renderFrameCallback=()=>{let e=Math.min((Ft()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new Su,this.cameraHelper=new Du,t.minZoom!==void 0&&this.transform.setMinZoom(t.minZoom),t.maxZoom!==void 0&&this.transform.setMaxZoom(t.maxZoom),t.minPitch!==void 0&&this.transform.setMinPitch(t.minPitch),t.maxPitch!==void 0&&this.transform.setMaxPitch(t.maxPitch),t.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(t.renderWorldCopies),t.transformConstrain!==null&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=t.centerClampedToGround??!0,this.transformCameraUpdate=t.transformCameraUpdate??null,this._stopHandlers=t.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,e){if(t.apply(this.transform,!0),this.transform=t,this.cameraHelper=e,this._requestedCameraState){let i=t.clone();i.apply(this._requestedCameraState,!0),this._requestedCameraState=i}}getCenter(){return new Y(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,e){return this.jumpTo({elevation:t},e),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,e,i){return t=C.convert(t).mult(-1),this.panTo(this.transform.center,q({offset:t},e),i)}panTo(t,e,i){return this.easeTo(q({center:t},e),i)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,e,i){return this.easeTo(q({zoom:t},e),i)}zoomIn(t,e){return this.zoomTo(Qe(this.getZoom()+1,this._zoomSnap),t,e),this}zoomOut(t,e){return this.zoomTo(Qe(this.getZoom()-1,this._zoomSnap),t,e),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,e){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new Q("movestart",e)).fire(new Q("move",e)).fire(new Q("moveend",e))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,e,i){return this.easeTo(q({bearing:t},e),i)}resetNorth(t,e){return this.rotateTo(0,q({duration:1e3},t),e),this}resetNorthPitch(t,e){return this.easeTo(q({bearing:0,pitch:0,roll:0,duration:1e3},t),e),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}getRoll(){return this.transform.roll}setRoll(t,e){return this.jumpTo({roll:t},e),this}cameraForBounds(t,e){t=ji.convert(t).adjustAntiMeridian();let i=e?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,e,i,r){let a={top:0,bottom:0,right:0,left:0};if(r=q({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},r),typeof r.padding=="number"){let u=r.padding;r.padding={top:u,bottom:u,right:u,left:u}}let n=q(a,r.padding);r.padding=n;let s=this.transform,o=new ji(t,e),l=this.cameraHelper.cameraForBoxAndBearing(r,n,o,i,s);return l&&this._zoomSnap&&(l.zoom=Qe(l.zoom,this._zoomSnap,-1)),l}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,e,i,r,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(C.convert(t)),this.transform.screenPointToLocation(C.convert(e)),i,r),r,a)}_fitInternal(t,e,i){return t?(e=q(t,e),delete e.padding,e.linear?this.easeTo(e,i):this.flyTo(e,i)):this}jumpTo(t,e){this.stop(),t.zoom!==void 0&&this._zoomSnap&&(t.zoom=Qe(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=!1,a=!1,n=!1,s=i.zoom;this.terrain&&i.setElevation(this.terrain.getElevationForLngLat(t.center?Y.convert(t.center):i.center,i)),this.cameraHelper.handleJumpToCenterZoom(i,t);let o=i.zoom!==s;return t.elevation!==void 0&&i.elevation!==+t.elevation&&i.setElevation(+t.elevation),t.bearing!==void 0&&i.bearing!==+t.bearing&&(r=!0,i.setBearing(+t.bearing)),t.pitch!==void 0&&i.pitch!==+t.pitch&&(a=!0,i.setPitch(+t.pitch)),t.roll!==void 0&&i.roll!==+t.roll&&(n=!0,i.setRoll(+t.roll)),t.padding!=null&&!i.isPaddingEqual(t.padding)&&i.setPadding(t.padding),this.applyUpdatedTransform(i),this.fire(new Q("movestart",e)).fire(new Q("move",e)),o&&this.fire(new Q("zoomstart",e)).fire(new Q("zoom",e)).fire(new Q("zoomend",e)),r&&this.fire(new Q("rotatestart",e)).fire(new Q("rotate",e)).fire(new Q("rotateend",e)),a&&this.fire(new Q("pitchstart",e)).fire(new Q("pitch",e)).fire(new Q("pitchend",e)),n&&this.fire(new Q("rollstart",e)).fire(new Q("roll",e)).fire(new Q("rollend",e)),this.fire(new Q("moveend",e))}
vendor: 10,429 bytes, line 1640
1640calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,a){let n=this.transform.calculateCenterFromCameraLngLatAlt(t,e,i,r);return{center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:i,pitch:r,roll:a}}easeTo(t,e){this._stop(!1,t.easeId),t=q({offset:[0,0],duration:500,easing:yl},t),t.zoom!==void 0&&this._zoomSnap&&(t.zoom=Qe(t.zoom,this._zoomSnap)),(t.animate===!1||!t.essential&&Ge.prefersReducedMotion)&&(t.duration=0);let i=this.getTransformForUpdate(),r=this.getBearing(),a=i.pitch,n=i.roll,s=t.bearing===void 0?r:this._normalizeBearing(t.bearing,r),o=t.pitch===void 0?a:+t.pitch,l=t.roll===void 0?n:this._normalizeBearing(t.roll,n),u=t.padding===void 0?i.padding:t.padding,h=C.convert(t.offset),c,d;t.around&&(c=Y.convert(t.around),d=i.locationToScreenPoint(c));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(i,{bearing:s,pitch:o,roll:l,padding:u,around:c,aroundPoint:d,offsetAsPoint:h,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||(this._rotating=r!==s),this._pitching||(this._pitching=o!==a),this._rolling||(this._rolling=l!==n),this._padding=!i.isPaddingEqual(u),this._zooming||(this._zooming=f.isZooming),this._easeId=t.easeId,this._prepareEase(e,t.noMoveStart,p),this.terrain&&this._prepareElevation(f.elevationCenter),this._ease(m=>{f.easeFunc(m),this.terrain&&!t.freezeElevation&&this._updateElevation(m),this.applyUpdatedTransform(i),this._fireMoveEvents(e)},m=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(e,m)},t),this}_prepareEase(t,e,i={}){this._moving=!0,!e&&!i.moving&&this.fire(new Q("movestart",t)),this._zooming&&!i.zooming&&this.fire(new Q("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new Q("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new Q("pitchstart",t)),this._rolling&&!i.rolling&&this.fire(new Q("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let e=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&e!==this._elevationTarget){let i=this._elevationTarget-this._elevationStart,r=(e-(i*t+this._elevationStart))/(1-t);this._elevationStart+=t*(i-r),this._elevationTarget=e}this.transform.setElevation(Zt.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let e=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(e,t.zoom):0;if(i<r){let a=t.calculateCameraOptionsFromTo(e,r,t.center,t.elevation);return{pitch:a.pitch,zoom:a.zoom}}return{}}applyUpdatedTransform(t){let e=[];if(e.push(r=>this._elevateCameraIfInsideTerrain(r)),this.transformCameraUpdate&&e.push(r=>this.transformCameraUpdate(r)),!e.length)return;let i=t.clone();for(let r of e){let a=i.clone(),{center:n,zoom:s,roll:o,pitch:l,bearing:u,elevation:h}=r(a);n&&a.setCenter(n),h!==void 0&&a.setElevation(h),s!==void 0&&a.setZoom(s),o!==void 0&&a.setRoll(o),l!==void 0&&a.setPitch(l),u!==void 0&&a.setBearing(u),i.apply(a,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new Q("move",t)),this._zooming&&this.fire(new Q("zoom",t)),this._rotating&&this.fire(new Q("rotate",t)),this._pitching&&this.fire(new Q("pitch",t)),this._rolling&&this.fire(new Q("roll",t))}_afterEase(t,e){if(this._easeId&&e&&this._easeId===e)return;delete this._easeId;let i=this._zooming,r=this._rotating,a=this._pitching,n=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new Q("zoomend",t)),r&&this.fire(new Q("rotateend",t)),a&&this.fire(new Q("pitchend",t)),n&&this.fire(new Q("rollend",t)),this.fire(new Q("moveend",t))}flyTo(t,e){if(!t.essential&&Ge.prefersReducedMotion){let P=rn(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(P,e)}this.stop(),t=q({offset:[0,0],speed:1.2,curve:1.42,easing:yl},t),t.zoom!==void 0&&this._zoomSnap&&(t.zoom=Qe(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=i.bearing,a=i.pitch,n=i.roll,s=i.padding,o=t.bearing===void 0?r:this._normalizeBearing(t.bearing,r),l=t.pitch===void 0?a:+t.pitch,u=t.roll===void 0?n:this._normalizeBearing(t.roll,n),h=t.padding===void 0?i.padding:t.padding,c=C.convert(t.offset),d=i.centerPoint.add(c),p=i.screenPointToLocation(d),f=this.cameraHelper.handleFlyTo(i,{bearing:o,pitch:l,roll:u,padding:h,locationAtOffset:p,offsetAsPoint:c,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),m=t.curve,g=Math.max(i.width,i.height),_=g/f.scaleOfZoom,y=f.pixelPathLength,x=g/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(x/y*2));let v=m*m;function w(P){let S=(_*_-g*g+(P?-1:1)*v*v*y*y)/(2*(P?_:g)*v*y);return Math.log(Math.sqrt(S*S+1)-S)}function b(P){return(Math.exp(P)-Math.exp(-P))/2}function T(P){return(Math.exp(P)+Math.exp(-P))/2}function D(P){return b(P)/T(P)}let E=w(!1),M=function(P){return T(E)/T(E+m*P)},R=function(P){return g*((T(E)*D(E+m*P)-b(E))/v)/y},z=(w(!0)-E)/m;if(Math.abs(y)<2e-6||!isFinite(z)){if(Math.abs(g-_)<1e-6)return this.easeTo(t,e);let P=_<g?-1:1;z=Math.abs(Math.log(_/g))/m,R=()=>0,M=S=>Math.exp(P*m*S)}if(t.duration!==void 0)t.duration=+t.duration;else{let P=t.screenSpeed===void 0?+t.speed:+t.screenSpeed/m;t.duration=1e3*z/P}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=r!==o,this._pitching=l!==a,this._rolling=u!==n,this._padding=!i.isPaddingEqual(h),this._prepareEase(e,!1),this.terrain&&this._prepareElevation(f.targetCenter),this._ease(P=>{let S=P*z,I=1/M(S),A=R(S);this._rotating&&i.setBearing(Zt.number(r,o,P)),this._pitching&&i.setPitch(Zt.number(a,l,P)),this._rolling&&i.setRoll(Zt.number(n,u,P)),this._padding&&(i.interpolatePadding(s,h,P),d=i.centerPoint.add(c)),f.easeFunc(P,I,A,d),this.terrain&&!t.freezeElevation&&this._updateElevation(P),this.applyUpdatedTransform(i),this._fireMoveEvents(e)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(e)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e)}return t||this._stopHandlers(),this}_ease(t,e,i){i.animate===!1||i.duration===0?(t(1),e()):(this._easeStart=Ft(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,e){t=li(t,-180,180);let i=Math.abs(t-e);return Math.abs(t-360-e)<i&&(t-=360),Math.abs(t+360-e)<i&&(t+=360),t}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}},Bb={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'},Ob=class{constructor(t=Bb){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=e=>{e&&(e.type==="terrain"||e.dataType==="style"||e.dataType==="source"&&(e.sourceDataType==="metadata"||e.sourceDataType==="visibility"))&&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=nt.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=nt.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=nt.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(){this._container.remove(),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,e){let i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(r=>typeof r=="string"?r:"")):typeof this.options.customAttribution=="str
1640ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let r=this._map.style.stylesheet;this.styleOwner=r.owner,this.styleId=r.id}let e=this._map.style.tileManagers;for(let r in e){let a=e[r];if(a.used||a.usedForTerrain){let n=a.getSource();n.attribution&&!t.includes(n.attribution)&&t.push(n.attribution)}}t=t.filter(r=>String(r).trim()),t.sort((r,a)=>r.length-a.length),t=t.filter((r,a)=>{for(let n=a+1;n<t.length;n++)if(t[n].includes(r))return!1;return!0});let i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=nt.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},Vb=class{constructor(t={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let i=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&i.classList.add("maplibregl-compact"):i.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options?.compact,this._container=nt.create("div","maplibregl-ctrl");let e=nt.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},dR=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){let e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(let r of i)if(r.id===t){r.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let e=this._currentlyRunning=this._queue;this._queue=[];let i=!1,r;for(let a of e)if(!a.cancelled){try{a.callback(t)}catch(n){i||(i=!0,r=n)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,i)throw r}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},rx=["none","zoom","sourceTiles","visibleLayers","revision"],pR=class{constructor(t,e,i,r){this._tileKeys=t.map(a=>a.key).sort().join(),this._revision=e,this._zoom=i,this._visibleLayerIds=r}difference(t){return this._revision===t?._revision?this._visibleLayerIds===t._visibleLayerIds?this._tileKeys===t._tileKeys?this._zoom===t._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},fn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},fR=class{constructor(t,e){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=e,this.rttSize=e.tileManager.tileSize*e.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}
vendor: 20,191 bytes, line 1640
1640prepareForRender(t,e){let i=e!==this._lastPrepareZoom;this._lastPrepareZoom=e,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(o=>!t._layers[o].isHidden(e));let r=this._renderableLayerIds.join(),a=new Set;for(let o of this._renderableLayerIds){let l=t._layers[o],u=l.source;u&&fn[l.type]&&a.add(u)}this._coordsAscending={},this._rttFingerprints={};for(let o of a){let l=t.tileManagers[o];if(!l)continue;this._coordsAscending[o]={};let u=this._coordsAscending[o],h=l.getSource(),c=h instanceof yn?h.terrainTileRanges:null;for(let f of l.getVisibleCoordinates()){let m=this.terrain.tileManager.getTerrainCoords(f,c);for(let g in m)u[g]||(u[g]=[]),u[g].push(m[g])}this._rttFingerprints[o]={};let d=this._rttFingerprints[o],p=l.getState().revision;for(let f in u)d[f]=new pR(u[f],p,e,r)}this.needsFollowUpFrame=!1;let n=i||this.painter.options.moving,s=!1;for(let o of this._renderableTiles){let l=this._textureDifference(o);l!=="none"&&(l==="zoom"&&n||l==="visibleLayers"&&i?this.needsFollowUpFrame=!0:l==="zoom"||l==="sourceTiles"?(s?this.needsFollowUpFrame=!0:o.releaseRTT(this.painter),s=!0):o.releaseRTT(this.painter))}}_textureDifference(t){let e="none";for(let i in this._rttFingerprints){let r=this._rttFingerprints[i][t.tileID.key];if(!r)continue;let a=r.difference(t.rttFingerprint[i]);rx.indexOf(a)>rx.indexOf(e)&&(e=a)}return e}renderLayer(t,e){if(t.isHidden(this.painter.transform.zoom))return!1;let i=t.type,r=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(fn[i]&&((!this._prevType||!fn[this._prevType])&&this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(fn[this._prevType]||fn[i]&&a){this._prevType=i;let n=this._stacks.length-1,s=this._stacks[n]||[];e.isRenderingToTexture=!0;for(let o of this._renderableTiles){if(this._rttTiles.push(o),o.getRTT(n))continue;let l=o.acquireRTT(r,n,this.rttSize);r.bindRTT(l),r.context.clear({color:lt.transparent,stencil:0}),r.currentStencilSource=void 0;for(let u of s){let h=r.style._layers[u],c=h.source?this._coordsAscending[h.source][o.tileID.key]:[o.tileID];r.context.viewport.set([0,0,this.rttSize,this.rttSize]),r.renderTileClippingMasks(h,c),r.renderLayer(r,r.style.tileManagers[h.source],h,c,e),h.source&&(o.rttFingerprint[h.source]=this._rttFingerprints[h.source][o.tileID.key])}l.texture.generateMipmap()}return e.isRenderingToTexture=!1,Fz(this.painter,this.terrain,this._rttTiles,e),this._rttTiles=[],fn[i]}return!1}},mR={"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":"Drag to rotate map, click to reset 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","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},gR=ox,ax={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Bb,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 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],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:ti.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},_R=class extends ce{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(t){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new dR,this._controls=[],this._mapId=Hc(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style){this.fire(new _u("webglcontextlost",{originalEvent:a}));return}for(let n of Object.values(this.style._layers))if(n.type==="custom"&&console.warn(`Custom layer with id '${n.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),n._listeners)for(let[s]of Object.entries(n._listeners))console.warn(`Custom layer with id '${n.id}' had event listeners for event '${s}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new _u("webglcontextlost",{originalEvent:a}))},this._contextRestored=a=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let n in this._lostContextStyle.images){let s=this._lostContextStyle.images[n];s.isWebGLImage&&this.style.imageManager.updateImage(n,s,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(n){this.fire(new J(n));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new _u("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let e={...ax,...t,canvasContextAttributes:{...ax.canvasContextAttributes,...t.canvasContextAttributes}};if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new cR({minZoom:e.minZoom,maxZoom:e.maxZoom,minPitch:e.minPitch,maxPitch:e.maxPitch,bearingSnap:e.bearingSnap,zoomSnap:e.zoomSnap,renderWorldCopies:e.renderWorldCopies,centerClampedToGround:e.centerClampedToGround,terrain:this.terrain,transformConstrain:e.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:e.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._canvasContextAttributes={...e.canvasContextAttributes},this._trackResize=e.trackResize===!0,this._terrainSkirtLength=e.terrainSkirtLength,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale={...mR,...e.locale},this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this._zoomLevelsToOverscale=e.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(e.anisotropicFilterPitch),e.reduceMotion!==void 0&&(Ge.prefersReducedMotion=e.reduceMotion),this._requestManager=new wA(e.transformRequest),this._container=this._resolveContainer(e.container),e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer();try{this._setupPainter()}catch(a){throw this._cleanupContainer(),a}this._imageQueueHandle=Vi.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.markTerrainDepthDirty(),this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new hR(this,this._camera,e),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let i=typeof e.hash=="string"&&e.hash||void 0;this._hash=e.hash?new Sb(i).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:e.center,elevation:e.elevation,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch,roll:e.roll}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,q({},e.fitBoundsOptions,{duration:0}))));let r=typeof e.style=="string"||e.style?.projection?.type!=="globe";this.resize(null,r),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Ob(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new Vb,e.logoPosition),this.on("style.load",()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let a=rn(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new Pi("styledata",a):new Nt("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new Pi("styledataloading",a):new Nt("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new Nt("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,e){return this.style.setGlobalStateProperty(t,e),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,e){if(e===void 0&&(e=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new J(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=t.onAdd(this);this._controls.push(t);let r=this._controlPositions[e];return e.includes("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(t){if(!t?.onRemove)return this.fire(new J(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let e=this._controls.indexOf(t);return e>-1&&this._controls.splice(e,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return vn(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new Y(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,e){return this._camera.setCenter(t,e),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,e){return this._camera.setCenterElevation(t,e),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,e,i){return this._camera.panBy(t,e,i),this}panTo(t,e,i){return this._camera.panTo(t,e,i),this}getZoom(){return this._camera.transform.zoom}setZoom(t,e){return this._camera.setZoom(t,e),this}zoomTo(t,e,i){return this._camera.zoomTo(t,e,i),this}zoomIn(t,e){return this._camera.zoomIn(t,e),this}zoomOut(t,e){return this._camera.zoomOut(t,e),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,e){return this._camera.setVerticalFieldOfView(t,e),this}getBearing(){return this._camera.transform.bearing}setBearing(t,e){return this._camera.setBearing(t,e),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,e){return this._camera.setPadding(t,e),this}rotateTo(t,e,i){return this._camera.rotateTo(t,e,i),this}resetNorth(t,e){return this._camera.resetNorth(t,e),this}resetNorthPitch(t,e){return this._camera.resetNorthPitch(t,e),this}snapToNorth(t,e){return this._camera.snapToNorth(t,e),this}getPitch(){return this._camera.transform.pitch}setPitch(t,e){return this._camera.setPitch(t,e),this}getRoll(){return this._camera.transform.roll}setRoll(t,e){return this._camera.setRoll(t,e),this}cameraForBounds(t,e){return this._camera.cameraForBounds(t,e)}fitBounds(t,e,i){return this._camera.fitBounds(t,e,i),this}fitScreenCoordinates(t,e,i,r,a){return this._camera.fitScreenCoordinates(t,e,i,r,a),this}jumpTo(t,e){return this._camera.jumpTo(t,e),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,a){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,a)}easeTo(t,e){return this._camera.easeTo(t,e),this}flyTo(t,e){return this._camera.flyTo(t,e),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(Y.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,e,i,r){return r==null&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,e,i,r??0)}resize(t,e=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(e);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new Q("movestart",t)).fire(new Q("move",t))),this.fire(new ye("resize",t)),i&&this.fire(new Q("moveend",t)),this}_resizeInternal(t=!0){let[e,i]=this._containerDimensions(),r=this._getClampedPixelRatio(e,i);if(this._resizeCanvas(e,i,r),this.painter.resize(e,i,r),this.painter.overLimit()){let a=this.painter.context.gl;this._maxCanvasSize=[a.drawingBufferWidth,a.drawingBufferHeight];let n=this._getClampedPixelRatio(e,i);this._resizeCanvas(e,i,n),this.painter.resize(e,i,n)}this._resizeTransform(t)}_resizeTransform(t=!0){let[e,i]=this._containerDimensions();this._camera.transform.resize(e,i,t),this._camera._requestedCameraState?.resize(e,i,t)}_getClampedPixelRatio(t,e){let{0:i,1:r}=this._maxCanvasSize,a=this.getPixelRatio(),n=t*a,s=e*a,o=n>i?i/n:1,l=s>r?r/s:1,u=Math.min(o,l);return u<1&&ft("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*a}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(ji.convert(t)),this._update()}setMinZoom(t){if(t??(t=-2),t>=-2&&t<=this._camera.transform.maxZoom){let e=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMinZoom(t),this._camera.applyUpdatedTransform(i),this._update(),e!==this._camera.transform.zoom&&this.fire(new Q("zoomstart")).fire(new Q("zoom")).fire(new Q("zoomend")).fire(new Q("movestart")).fire(new Q("move")).fire(new Q("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let e=this._camera.transform;return t?e.applyConstrain(e.center,e.minZoom).zoom:e.minZoom}setMaxZoom(t){if(t??(t=22),t>=this._camera.transform.minZoom){let e=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMaxZoom(t),this._camera.applyUpdatedTransform(i),this._update(),e!==this._camera.transform.zoom&&this.fire(new Q("zoomstart")).fire(new Q("zoom")).fire(new Q("zoomend")).fire(new Q("movestart")).fire(new Q("move")).fire(new Q("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if(t??(t=0),t<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let e=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMinPitch(t),this._camera.applyUpdatedTransform(i),this._update(),e!==this._camera.transform.pitch&&this.fire(new Q("pitchstart")).fire(new Q("pitch")).fire(new Q("pitchend")).fire(new Q("movestart")).fire(new Q("move")).fire(new Q("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if(t??(t=60),t>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let e=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMaxPitch(t),this._camera.applyUpdatedTransform(i),this._update(),e!==this._camera.transform.pitch&&this.fire(new Q("pitchstart")).fire(new Q("pitch")).fire(new Q("pitchend")).fire(new Q("movestart")).fire(new Q("move")).fire(new Q("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if(t??(t=20),t>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(Y.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(C.convert(t),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegatedListener(t,e,i){if(t==="mouseenter"||t==="mouseover"){let r=!1;return{layers:e,listener:i,delegates:{mousemove:a=>{let n=e.filter(o=>this.getLayer(o)),s=n.length===0?[]:this.queryRenderedFeatures(a.point,{layers:n});s.length?r||(r=!0,i.call(this,new ci(t,this,a.originalEvent,{features:s}))):r=!1},mouseout:()=>{r=!1}}}}if(t==="mouseleave"||t==="mouseout"){let r=!1;return{layers:e,listener:i,delegates:{mousemove:a=>{let n=e.filter(s=>this.getLayer(s));(n.length===0?[]:this.queryRenderedFeatures(a.point,{layers:n})).length?r=!0:r&&(r=!1,i.call(this,new ci(t,this,a.originalEvent)))},mouseout:a=>{r&&(r=!1,i.call(this,new ci(t,this,a.originalEvent)))}}}}{let r=a=>{let n=e.filter(o=>this.getLayer(o)),s=n.length===0?[]:this.queryRenderedFeatures(a.point,{layers:n});s.length&&(a.features=s,i.call(this,a),delete a.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){var i;this._delegatedListeners||(this._delegatedListeners={}),(i=this._delegatedListeners)[t]||(i[t]=[]),this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners?.[t])return;let r=this._delegatedListeners[t];for(let a=0;a<r.length;a++){let n=r[a];if(n.listener===i&&n.layers.length===e.length&&n.layers.every(s=>e.includes(s))){for(let s in n.delegates)this.off(s,n.delegates[s]);r.splice(a,1);return}}}
vendor: 1,292 bytes, line 1640
1640on(t,e,i){if(i===void 0)return super.on(t,e);let r=typeof e=="string"?[e]:e,a=this._createDelegatedListener(t,r,i);this._saveDelegatedListener(t,a);for(let n in a.delegates)this.on(n,a.delegates[n]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,e,i){if(i===void 0)return super.once(t,e);let r=typeof e=="string"?[e]:e,a=this._createDelegatedListener(t,r,i);for(let n in a.delegates){let s=a.delegates[n];a.delegates[n]=(...o)=>{this._removeDelegatedListener(t,r,i),s(...o)}}this._saveDelegatedListener(t,a);for(let n in a.delegates)this.once(n,a.delegates[n]);return this}off(t,e,i){if(i===void 0)return super.off(t,e);let r=typeof e=="string"?[e]:e;return this._removeDelegatedListener(t,r,i),this}queryRenderedFeatures(t,e){if(!this.style)return[];let i,r=t instanceof C||Array.isArray(t),a=r?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(e||(e=(r?{}:t)||{}),a instanceof C||typeof a[0]=="number")i=[C.convert(a)];else{let n=C.convert(a[0]),s=C.convert(a[1]);i=[n,new C(s.x,n.y),s,new C(n.x,s.y),n]}return this.style.queryRenderedFeatures(i,e,this._camera.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,e){return e=q({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
vendor: 11,986 bytes, line 1640
1640idateStyle},e),this._styleUrl=typeof t=="string"?t:null,e.diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(t,e))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let e=this._locale[t];if(e==null)throw Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,e.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(t,e));return}let i=this.style&&e.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)this.style=new $p(this,e||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof t=="string"?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i),this}_lazyInitEmptyStyle(){this.style||(this.style=new $p(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(t,e){if(this._diffStyleRequest?.abort(),typeof t=="string"){let i=t;this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let a=await this._requestManager.transformRequest(i,"Style");if(r.signal.aborted){this._diffStyleRequest=null;return}let n=await vs(a,r);this._diffStyleRequest=null,this._updateDiff(n.data,e)}catch(a){this._diffStyleRequest=null,fr(a)||this.fire(new J(be(a)))}}else typeof t=="object"&&(this._diffStyleRequest=null,this._updateDiff(t,e))}_updateDiff(t,e){try{this.style.setState(t,e)&&this._update(!0)}catch(i){ft(`Unable to perform style diff: ${be(i).message}. Rebuilding the style from scratch.`),this._updateStyle(t,e)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style){ft("There is no style added to the map.");return}return this.style.loaded()}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){let e=this.style?.tileManagers[t];if(e===void 0){this.fire(new J(Error(`There is no tile manager with ID '${t}'`)));return}return e.loaded()}setTerrain(t,e={}){if(this.style._checkLoaded(),t&&on(this,$e.terrain,{value:t},e))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!t)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this.painter.destroyRTTResources(),this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);else{let i=this.style.tileManagers[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);this.terrain===null&&i.reload();for(let r in this.style._layers){let a=this.style._layers[r];a.type==="hillshade"&&a.source===t.source&&ft("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),a.type==="color-relief"&&a.source===t.source&&ft("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new A3(this.painter,i,t,this._terrainSkirtLength),this.painter.renderToTexture=new fR(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=r=>this._handleTerrainDataEvent(r,t.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new hx({terrain:t})),this}_handleTerrainDataEvent(t,e){if(t.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let i=t.sourceId===e;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&t.tile&&this.painter.markTerrainDepthDirty(),i&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if(t.source?.type==="image"){this.terrain.tileManager.releaseAllRTT();return}this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let t=this.style?.tileManagers;for(let e of Object.values(t))if(!e.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style?.getSource(t)}setSourceTileLodParams(t,e,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=kp(Math.max(1,t),Math.max(1,e))}else for(let r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=kp(Math.max(1,t),Math.max(1,e));return this._update(!0),this}refreshTiles(t,e){let i=this.style.tileManagers[t];if(!i)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);e===void 0?i.reload(!0):i.refreshTiles(e.map(r=>new Ls(r.z,r.x,r.y)))}addImage(t,e,i={}){this._lazyInitEmptyStyle();let r=this._createStyleImage(e,i);return r?(this.style.addImage(t,r),r.userImage?.onAdd&&r.userImage.onAdd(this,t),this):this}setMissingStyleImageResolver(t){return this._missingStyleImageResolver=t,this.style?.setMissingImageResolver(t),this}_createStyleImage(t,e={}){let{pixelRatio:i=1,sdf:r=!1,stretchX:a,stretchY:n,content:s,textFitWidth:o,textFitHeight:l}=e;if(t instanceof HTMLImageElement||Or(t)){let{width:u,height:h,data:c}=Ge.getImageData(t);return{data:new Ot({width:u,height:h},c),pixelRatio:i,stretchX:a,stretchY:n,content:s,textFitWidth:o,textFitHeight:l,sdf:r,version:0}}if(t.width===void 0||t.height===void 0)return this.fire(new J(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`"))),null;{let{width:u,height:h,data:c}=t,d=t,p=Ms(d.data);return{data:p?new Ot({width:u,height:h}):new Ot({width:u,height:h},new Uint8Array(c)),pixelRatio:i,stretchX:a,stretchY:n,content:s,textFitWidth:o,textFitHeight:l,sdf:r,version:0,isWebGLImage:p,userImage:d}}}updateImage(t,e){let i=this.style.getImage(t);if(!i)return this.fire(new J(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:a,data:n}=e instanceof HTMLImageElement||Or(e)?Ge.getImageData(e):e;if(r===void 0||a===void 0)return this.fire(new J(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(r!==i.data.width||a!==i.data.height)return this.fire(new J(Error("The width and height of the updated image must be that same as the previous version of the image")));if(i.isWebGLImage=Ms(n),i.isWebGLImage)i.userImage=e;else{let s=!(e instanceof HTMLImageElement||Or(e));i.data.replace(n,s)}return this.style.updateImage(t,i),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new J(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}async loadImage(t){let e=await Vi.getImage(await this._requestManager.transformRequest(t,"Image"),new AbortController);if(!e.data)throw Error(`Could not load image ${t}: the response is empty`);return e}listImages(){return this.style?.listImages()??[]}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style?.getLayer(t)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style?.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,r={}){return this.style?.setPaintProperty(t,e,i,r),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,r={}){return this.style.setLayoutProperty(t,e,i,r),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,r=>{r||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,i=>{i||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_shouldHandleInitialResize(){if(!this._container?.clientWidth||!this._container.clientHeight)return!1;let[t,e]=this._containerDimensions();return t!==this._camera.transform.width||e!==this._camera.transform.height}_setupResizeObserver(){let t=!1,e=gf(r=>{this._trackResize&&!this._removed&&(this.resize(r),this.redraw())},50),i=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new i(r=>{!t&&(t=!0,!this._shouldHandleInitialResize())||e(r)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if(typeof t=="string"){let e=document.getElementById(t);if(!e)throw Error(`Container '${t}' not found.`);return e}if(t instanceof HTMLElement||t&&typeof t=="object"&&t.nodeType===1)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._containerDimensions(),e=this._getClampedPixelRatio(t[0],t[1]),i=this._container;i.classList.add("maplibregl-map");let r=this._canvasContainer=nt.create("div","maplibregl-canvas-container",i);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=nt.create("canvas","maplibregl-canvas",r),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
1640on"),this._resizeCanvas(t[0],t[1],e);let a=this._controlContainer=nt.create("div","maplibregl-control-container",i),n=this._controlPositions={};for(let s of["top-left","top-right","bottom-left","bottom-right"])n[s]=nt.create("div",`maplibregl-ctrl-${s} `,a);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let t={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},e=null;this._canvas.addEventListener("webglcontextcreationerror",r=>{e=r},{once:!0});let i=this._canvas.getContext("webgl2",t);if(!i)throw new Eb(t,e);this.painter=new Bz(i,this._camera.transform)}migrateProjection(t,e){this._camera.migrateProjection(t,e),this.painter.transform=t,this.fire(new cx({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?._loaded?(this._styleDirty||(this._styleDirty=t),this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let e=this._idleTriggered?this._fadeDuration:0,i=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let s=this._camera.transform.zoom,o=Ft();this.style.zoomHistory.update(s,o);let l=new Ct(s,{now:o,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=l.crossFadingFactor();(u!==1||u!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=u),this.style.update(l)}let a=this.style.projection?.transitionState>0!==i;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||a)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,e,this._crossSourceCollisions,a),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new ye("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new ye("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let n=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new ye("idle")),this._loaded&&!this._fullyLoaded&&!n&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Vi.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new ye("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Ge.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(e){if(!fr(e))throw e}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return gR}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}},yR={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},vR=class{constructor(t){this._updateZoomButtons=()=>{let e=this._map.getZoom(),i=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom(!0);this._zoomInButton.disabled=i,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let e=this._map.getPitch(),i=this._map.getRoll(),r=this._map.getBearing(),a=1/Math.cos(Gt(e))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${a}) rotateZ(${-i}deg) rotateX(${e}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${a}) rotateX(${e}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-r-i}deg)`;return}this._compassIcon.style.transform=`rotate(${-r}deg)`},this._setButtonTitle=(e,i)=>{let r=this._map._getUIString(`NavigationControl.${i}`);e.title=r,e.setAttribute("aria-label",r)},this.options=q({},yR,t),this._container=nt.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),nt.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),nt.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=nt.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new xR(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){let i=nt.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},xR=class{constructor(t,e,i=!1){this.mousedown=a=>{this.startMove(a,nt.mousePos(this.element,a)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=a=>{this.move(a,nt.mousePos(this.element,a))},this.mouseup=a=>{this._rotatePitchHandler.dragEnd(a),this.offTemp()},this.touchstart=a=>{a.targetTouches.length===1?(this._startPos=this._lastPos=nt.touchPos(this.element,a.targetTouches)[0],this.startMove(a,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=a=>{a.targetTouches.length===1?(this._lastPos=nt.touchPos(this.element,a.targetTouches)[0],this.move(a,this._lastPos)):this.reset()},this.touchend=a=>{a.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._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=e;let r=new Jz;this._rotatePitchHandler=new io({clickTolerance:3,move:(a,n)=>{let s=e.getBoundingClientRect(),o=new C((s.bottom-s.top)/2,(s.right-s.left)/2);return{bearingDelta:Kc(new C(a.x,n.y),n,o),pitchDelta:i?(n.y-a.y)*-.5:void 0}},moveStateManager:r,enable:!0,assignEvents:()=>{}}),this.map=t,e.addEventListener("mousedown",this.mousedown),e.addEventListener("touchstart",this.touchstart,{passive:!1}),e.addEventListener("touchcancel",this.reset)}startMove(t,e){this._rotatePitchHandler.dragStart(t,e),nt.disableDrag()}move(t,e){let i=this.map,{bearingDelta:r,pitchDelta:a}=this._rotatePitchHandler.dragMove(t,e)||{};r&&i.setBearing(i.getBearing()+r),a&&i.setPitch(i.getPitch()+a)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){nt.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}},ma;async function bR(t=!1){if(ma!==void 0&&!t)return ma;if(window.navigator.permissions===void 0)return ma=!!window.navigator.geolocation,ma;try{ma=(await window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ma=!!window.navigator.geolocation}return ma}function jb(t,e,i,r=!1){if(r||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let a=new Y(t.lng,t.lat);
vendor: 13,682 bytes, line 1640
1640if(t=new Y(t.lng,t.lat),e){let n=new Y(t.lng-360,t.lat),s=new Y(t.lng+360,t.lat),o=i.locationToScreenPoint(t).distSqr(e);i.locationToScreenPoint(n).distSqr(e)<o?t=n:i.locationToScreenPoint(s).distSqr(e)<o&&(t=s)}for(;Math.abs(t.lng-i.center.lng)>180;){let n=i.locationToScreenPoint(t);if(n.x>=0&&n.y>=0&&n.x<=i.width&&n.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t.lng!==a.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(t))?t:a}var yf={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 Ub(t,e,i){let r=t.classList;for(let a in yf)r.remove(`maplibregl-${i}-anchor-${a}`);r.add(`maplibregl-${i}-anchor-${e}`)}var nx={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},Nb="#3FB1CE";function Di(t,e,i=[]){let r=nt.createNS("http://www.w3.org/2000/svg",t);for(let a in e)r.setAttributeNS(null,a,e[a]);for(let a of i)r.appendChild(a);return r}var Ip;function wR(){return Ip||(Ip=Di("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[Di("g",{"fill-rule":"nonzero"},[Di("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([t,e])=>Di("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:e}))),Di("g",{fill:Nb},[Di("path",{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"})]),Di("g",{opacity:"0.25",fill:"#000000"},[Di("path",{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"})]),Di("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),Di("g",{transform:"translate(8.0, 8.0)"},[Di("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),Di("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),Ip)}function TR(t){return t.firstElementChild.children[1]}var ga=class extends ei{},$b=class extends ei{},qp=class extends ce{constructor(t){if(super(),this._onClick=e=>{this.fire(new $b("click",{originalEvent:e}))},this._onKeyPress=e=>{(e.code==="Space"||e.code==="Enter")&&this.togglePopup()},this._onKeyDown=e=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||e.composedPath()[0]!==this._element||e.altKey||e.ctrlKey||e.metaKey)return;let i=nx[e.key];if(!i)return;e.preventDefault(),e.stopPropagation();let r=e.shiftKey?10:1,a=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new C(a.x+i[0]*r,a.y+i[1]*r))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new ga("dragstart"))),this.fire(new ga("drag"))},this._onKeyUp=e=>{nx[e.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=e=>{let i=e.originalEvent.target,r=this._element;this._popup&&(i===r||r.contains(i))&&this.togglePopup()},this._updateCoveredUnthrottled=()=>{let e=this._map?.terrain;if(!e||!this._isInViewport())return;let i=this._isCovered(e);i&&this._popup?.isOpen()&&this._popup.remove(),this._element.style.opacity=i?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",i)},this._updateCovered=gf(this._updateCoveredUnthrottled,100),this._update=e=>{if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();(e?.type==="terrain"||e?.type==="render"&&!i)&&this._map.once("render",this._update),this._lngLat=jb(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!e||e.type==="moveend")&&(this._pos=this._pos.round()),this._element.style.transform=`${yf[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${r}`,Ge.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity()}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let i=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=e.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 ga("dragstart"))),this.fire(new ga("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 ga("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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?.anchor||"center",this._color=t?.color||Nb,this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=C.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=nt.create("div");let e=wR().cloneNode(!0);e.setAttributeNS(null,"height",`${41*this._scale}px`),e.setAttributeNS(null,"width",`${27*this._scale}px`),TR(e).setAttributeNS(null,"fill",this._color),this._element.appendChild(e),this._offset=C.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()}),Ub(this._element,this._anchor,"marker"),t?.className)for(let e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return 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("projectiontransition",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=Y.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let e=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":[e,(24.6+e)*-1],"bottom-right":[-e,(24.6+e)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new ga("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(t)t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map));else return this;return this}_updateOpacity(){if(!this._isInViewport())return;let t=this._map?.terrain,e=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!t||e){let i=e?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==i&&(this._element.style.opacity=i,this._element.classList.toggle("maplibregl-marker-covered",e));return}this._updateCovered()}_isInViewport(){let{width:t,height:e}=this._map._camera.transform;return!!this._pos&&this._pos.x>=0&&this._pos.y>=0&&this._pos.x<=t&&this._pos.y<=e}_isCovered(t){let e=this._map._camera.transform,i=t.getElevationForLngLat(this._lngLat,e),r=Math.max(0,-this._offset.y)/e.pixelsPerMeter,a=Math.sin(this._map.getPitch()*Math.PI/180)*r;return e.isLocationOccluded(this._lngLat,t,i+a)}getOffset(){return this._offset}setOffset(t){return this._offset=C.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._element.classList.toggle("maplibregl-marker-draggable",this._draggable),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._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}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,e){return(this._opacity===void 0||t===void 0&&e===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),t!==void 0&&(this._opacity=String(t)),e!==void 0&&(this._opacityWhenCovered=String(e)),this._map&&this._updateOpacity(),this}},ER={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},gu=0,Ws=!1,_a=class extends ei{},Wp=class extends ei{},Gb=class extends ei{},SR=class extends ce{constructor(t){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e)){this._setErrorState(),this.fire(new Wp("outofmaxbounds",e)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_E
1640RROR":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 Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new Wp("geolocate",e)),this._finish()}},this._updateCamera=e=>{let i=new Y(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,a=this._map.getBearing(),n=q({bearing:a},this.options.fitBoundsOptions),s=ji.fromLngLat(i,r);this._map.fitBounds(s,n,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let i=new Y(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(e.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;let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Ws)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new Gb("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=e=>{if(!this._map)return;let i=e?.[0]instanceof ResizeObserverEntry;!e.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!i&&!this._map.isZooming()&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new _a("trackuserlocationend")),this.fire(new _a("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>{e.preventDefault()}),this._geolocateButton=nt.create("button","maplibregl-ctrl-geolocate",this._container),nt.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){ft("Geolocation support is not available so the GeolocateControl will be disabled.");let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{let i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=nt.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new qp({element:this._dotElement}),this._circleElement=nt.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new qp({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=q({},ER,t)}onAdd(t){return this._map=t,this._container=nt.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),bR().then(e=>this._finishSetupUI(e)),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(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,gu=0,Ws=!1}_isOutOfMapMaxBounds(t){let e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
1640RROR",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":case"BACKGROUND_ERROR":break;case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let e=this._map.project(t),i=this._map.unproject([e.x+100,e.y]),r=t.distanceTo(i)/100,a=2*this._accuracy/r;this._circleElement.style.width=`${a.toFixed(2)}px`,this._circleElement.style.height=`${a.toFixed(2)}px`}trigger(){if(!this._setup)return ft("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 _a("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":gu--,Ws=!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 _a("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 _a("trackuserlocationstart")),this.fire(new _a("userlocationfocus"));break;default:throw 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 Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),gu++;let t;gu>1?(t={maximumAge:6e5,timeout:0},Ws=!0):(t=this.options.positionOptions,Ws=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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","false"),this.options.showUserLocation&&this._updateMarker(null)}},DR={maxWidth:100,unit:"metric"},PR=class{constructor(t){this._onMove=()=>{sx(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,sx(this._map,this._container,this.options)},this.options={...DR,...t}}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=nt.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function sx(t,e,i){let r=i?.maxWidth||100,{width:a,height:n}=t._camera.transform,s=n/2,o=a/2,l=t.unproject([o-r/2,s]),u=t.unproject([o+r/2,s]),h=Math.round(t.project(u).x-t.project(l).x),c=Math.min(r,h,a),d=l.distanceTo(u);if(i?.unit==="imperial"){let p=3.2808*d;p>5280?Hs(e,c,p/5280,t._getUIString("ScaleControl.Miles")):Hs(e,c,p,t._getUIString("ScaleControl.Feet"))}else i?.unit==="nautical"?Hs(e,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?Hs(e,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):Hs(e,c,d,t._getUIString("ScaleControl.Meters"))}function Hs(t,e,i,r){let a=IR(i),n=a/i;t.style.width=`${e*n}px`;let s=`${a}\xA0${r}`;t.textContent!==s&&(t.textContent=s)}function CR(t){let e=10**Math.ceil(-Math.log(t)/Math.LN10);return Math.round(t*e)/e}function IR(t){let e=10**(`${Math.floor(t)}`.length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:CR(i),e*i}var Hp=class extends ei{},AR=class extends ce{constructor(t={}){super(),this._onFullscreenChange=()=>{let e=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;e?.shadowRoot?.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=t.pseudo??!1,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:ft("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(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=nt.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=nt.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);nt.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 Hp("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new Hp("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},MR=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=nt.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=nt.create("button","maplibregl-ctrl-terrain",this._container),nt.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
vendor: 9,921 bytes, lines 1640-1646
1640ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},FR=class{constructor(){this._toggleProjection=()=>{let t=this._map.getProjection()?.type;t==="mercator"||!t?this._map.setProjection({type:"globe"}):this._map.setProjection({type:"mercator"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=nt.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=nt.create("button","maplibregl-ctrl-globe",this._container),nt.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},zR={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},RR=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Xp=class extends ei{},kR=class extends ce{constructor(t){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),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("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new Xp("close"))),this),this._update=e=>{let i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=nt.create("div","maplibregl-popup",this._map.getContainer()),this._tip=nt.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let l of this.options.className.split(" "))this._container.classList.add(l);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=jb(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer);let r;if(e&&"point"in e&&e.point&&(r=e.point),this._trackPointer&&!r)return;let a=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map._camera.transform.locationToScreenPoint(this._lngLat));let n=this.options.anchor,s=Zb(this.options.offset);if(!n){let l=this._container.offsetWidth,u=this._container.offsetHeight,h=LR(this.options.padding),c;c=a.y+s.bottom.y<u+h.top?["top"]:a.y>this._map._camera.transform.height-u-h.bottom?["bottom"]:[],a.x<l/2+h.left?c.push("left"):a.x>this._map._camera.transform.width-l/2-h.right&&c.push("right"),n=c.length===0?"bottom":c.join("-")}let o=a.add(s[n]);this.options.subpixelPositioning||(o=o.round()),this._container.style.transform=`${yf[n]} translate(${o.x}px,${o.y}px)`,Ub(this._container,n,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=q(Object.create(zR),t)}addTo(t){return this._map&&this.remove(),this._map=t,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._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),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 Xp("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=Y.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),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._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let e=document.createDocumentFragment(),i=document.createElement("body"),r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=nt.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=nt.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;let t=this._container.querySelector(RR);t&&t.focus()}};function Zb(t){if(!t)return Zb(new C(0,0));if(typeof t=="number"){let e=Math.round(Math.abs(t)/Math.SQRT2);return{center:new C(0,0),top:new C(0,t),"top-left":new C(e,e),"top-right":new C(-e,e),bottom:new C(0,-t),"bottom-left":new C(e,-e),"bottom-right":new C(-e,-e),left:new C(t,0),right:new C(-t,0)}}if(t instanceof C||Array.isArray(t)){let e=C.convert(t);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:C.convert(t.center||[0,0]),top:C.convert(t.top||[0,0]),"top-left":C.convert(t["top-left"]||[0,0]),"top-right":C.convert(t["top-right"]||[0,0]),bottom:C.convert(t.bottom||[0,0]),"bottom-left":C.convert(t["bottom-left"]||[0,0]),"bottom-right":C.convert(t["bottom-right"]||[0,0]),left:C.convert(t.left||[0,0]),right:C.convert(t.right||[0,0])}}function LR(t){return t?{top:t.top??0,right:t.right??0,bottom:t.bottom??0,left:t.left??0}:{top:0,right:0,bottom:0,left:0}}var BR=ox;function OR(t,e){return Qs().setRTLTextPlugin(t,e)}function VR(){return Qs().getRTLTextPluginStatus()}function jR(){return BR}function UR(){return Au.workerCount}function NR(t){Au.workerCount=t}function $R(){return ti.MAX_PARALLEL_IMAGE_REQUESTS}function GR(t){ti.MAX_PARALLEL_IMAGE_REQUESTS=t}function ZR(){return ti.WORKER_URL}function qR(t){ti.WORKER_URL=t}async function WR(t){await Qp().broadcast("IS",t)}return r2(HR);})(); 1641 1642(function (root) { 1643 if (!root.maplibregl || typeof root.maplibregl.setWorkerUrl !== 'function') { 1644 throw new Error('MapLibre worker configuration is unavailable'); 1645 } 1646 var workerSource = "(()=>{/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.10.0/LICENSE.txt\n*/var g1=Object.create,gp=Object.defineProperty,x1=Object.getOwnPropertyDescriptor,v1=Object.getOwnPropertyNames,b1=Object.getPrototypeOf,xp=Object.prototype.hasOwnProperty,fl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),w1=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(var n=v1(e),a=0,s=n.length,o;a<s;a++)o=n[a],!xp.call(t,o)&&o!==r&&gp(t,o,{get:(l=>e[l]).bind(null,o),enumerable:!(i=x1(e,o))||i.enumerable});return t},D1=(t,e,r)=>(r=t==null?{}
1646:g1(b1(t)),w1(e||!t||!t.__esModule||!xp.call(t,\"default\")?gp(r,\"default\",{value:t,enumerable:!0}):r,t));function M(t,e){this.x=t,this.y=e}M.prototype={clone(){return new M(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:M},M.convert=function(t){if(t instanceof M)return t;if(Array.isArray(t))return new M(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new M(+t.x,+t.y);throw Error(\"Expected [x, y] or {x, y} point format\")};function _1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Ds;function A1(){return Ds??(Ds=typeof OffscreenCanvas<\"u\"&&!!new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),Ds}var On;function S1(){if(On==null&&(On=!1,A1())){let t=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){On=!0;break}}}return On||!1}var he=typeof Float32Array<\"u\"?Float32Array:Array;Math.PI/180,180/Math.PI;function E1(){var t=new he(9);return he!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function vp(){var t=new he(3);return he!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function F1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function ah(t,e,r){var i=new he(3);return i[0]=t,i[1]=e,i[2]=r,i}function T1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function k1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _s(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var I1=F1;(function(){var t=vp();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function C1(){var t=new he(4);return he!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function M1(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function B1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=C1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],a(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();function sh(){var t=new he(4);return he!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function P1(t,e,r){r*=.5;var i=Math.sin(r);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t}function As(t,e,r,i){var n=e[0],a=e[1],s=e[2],o=e[3],l=r[0],u=r[1],h=r[2],c=r[3],p,f=n*l+a*u+s*h+o*c,d,y,m;return f<0&&(f=-f,l=-l,u=-u,h=-h,c=-c),1-f>1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function z1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var oh=M1;(function(){var t=vp(),e=ah(1,0,0),r=ah(0,1,0);return function(i,n,a){var s=k1(n,a);return s<-.999999?(_s(t,e,n),I1(t)<1e-6&&_s(t,r,n),T1(t,t),P1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(_s(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,oh(i,i))}})(),(function(){var t=sh(),e=sh();return function(r,i,n,a,s,o){return As(t,i,s,o),As(e,n,a,o),As(r,t,e,2*o*(1-o)),r}})(),(function(){var t=E1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],oh(e,z1(e,t))}})();function L1(){var t=new he(2);return he!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=L1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o<l;o+=r)t[0]=e[o],t[1]=e[o+1],a(t,t,s),e[o]=t[0],e[o+1]=t[1];return e}})();var mt=8192;var bp=\"__$json__:\";function Wi(t){return t instanceof Error?t:Error(typeof t==\"string\"?t:String(t))}function V1(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;
vendor: 2,960 bytes, line 1646
1646return 4*(t<.5?r:3*(t-e)+r-.75)}function O1(t,e,r,i){return _1(t,e,r,i)}var h5=O1(.25,.1,.25,1);function Zi(t,e,r){return Math.min(r,Math.max(e,t))}function R1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function qt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function $1(t){return Math.log(t)/Math.LN2%1==0}function Aa(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function N1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function Hs(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Hs(t[r],e[r]))return!1;return!0}if(typeof t==\"object\"&&t&&e!==null){if(typeof e!=\"object\"||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!Hs(t[r],e[r]))return!1;return!0}return t===e}function Xe(t){return Array.isArray(t)?t.map(Xe):typeof t==\"object\"&&t?Aa(t,Xe):t}var lh={};function Mt(t){lh[t]||(typeof console<\"u\"&&console.warn(t),lh[t]=!0)}function We(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function dr(t){return typeof WorkerGlobalScope<\"u\"&&t!==void 0&&t instanceof WorkerGlobalScope}function Sa(t){return typeof ImageBitmap<\"u\"&&t instanceof ImageBitmap}function U1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}async function q1(t,e,r,i,n){if(typeof VideoFrame>\"u\")throw Error(\"VideoFrame not supported\");let a=new VideoFrame(t,{timestamp:0});try{let s=a?.format;if(!s||!(s.startsWith(\"BGR\")||s.startsWith(\"RGB\")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith(\"BGR\"),l=new Uint8ClampedArray(i*n*4);if(await a.copyTo(l,U1(t,e,r,i,n)),o)for(let u=0;u<l.length;u+=4){let h=l[u];l[u]=l[u+2],l[u+2]=h}return l}finally{a.close()}}var _i,Ai;function j1(t,e,r,i,n){let a=t.width,s=t.height;(!_i||!Ai)&&(_i=new OffscreenCanvas(a,s),Ai=_i.getContext(\"2d\",{willReadFrequently:!0})),_i.width=a,_i.height=s,Ai.drawImage(t,0,0,a,s);let o=Ai.getImageData(e,r,i,n);return Ai.clearRect(0,0,a,s),o.data}async function wp(t,e,r,i,n){if(S1())try{return await q1(t,e,r,i,n)}catch{}return j1(t,e,r,i,n)}function uh(t,e,r,i){return t.addEventListener(e,r,i),{unsubscribe:()=>{t.removeEventListener(e,r,i)}}}function hh(t){return t*Math.PI/180}var ch=\"AbortError\",dl=class extends Error{constructor(t=ch){super(t instanceof Error?t.message:t),this.name=ch,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function yl(t){return t instanceof Error&&t.name===\"AbortError\"}function G1(t){if(t.aborted)throw new dl(t.reason)}var ml={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function Y1(t){return ml.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf(\"://\"))]}function Dp(t,e){ml.REGISTERED_PROTOCOLS[t]=e}
1646function _p(t){delete ml.REGISTERED_PROTOCOLS[t]}var ph=\"global-dispatcher\",ua=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function Ap(){if(dr(self))return self.worker?.referrer;if(window.location.protocol===\"blob:\")try{return window.parent.location.href}catch{}return window.location.href}var X1=t=>t.startsWith(\"file:\")||Ap()?.startsWith(\"file:\")&&!/^\\w+:/.test(t);async function W1(t,e){let r=new Request(t.url,{method:t.method||\"GET\",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:Ap(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type===\"json\"&&!r.headers.has(\"Accept\")&&r.headers.set(\"Accept\",\"application/json\");let i;try{i=await fetch(r)}catch(s){throw yl(s)?s:new ua(0,Wi(s).message,t.url,new Blob)}if(!i.ok){let s=await i.blob();throw new ua(i.status,i.statusText,t.url,s)}let n;n=t.type===\"arrayBuffer\"||t.type===\"image\"?i.arrayBuffer():t.type===\"json\"?i.json():i.text();let a=await n;return G1(e.signal),{data:a,cacheControl:i.headers.get(\"Cache-Control\"),expires:i.headers.get(\"Expires\"),etag:i.headers.get(\"ETag\")}}function Z1(t,e){return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open(t.method||\"GET\",t.url,!0),(t.type===\"arrayBuffer\"||t.type===\"image\")&&(n.responseType=\"arraybuffer\");for(let a in t.headers)n.setRequestHeader(a,t.headers[a]);t.type===\"json\"&&(n.responseType=\"text\",t.headers?.Accept||n.setRequestHeader(\"Accept\",\"application/json\")),n.withCredentials=t.credentials===\"include\",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(t.type===\"json\")try{a=JSON.parse(n.response)}catch(s){i(s);return}r({data:a,cacheControl:n.getResponseHeader(\"Cache-Control\"),expires:n.getResponseHeader(\"Expires\"),etag:n.getResponseHeader(\"ETag\")})}else{let a=new Blob([n.response],{type:n.getResponseHeader(\"Content-Type\")});i(new ua(n.status,n.statusText,t.url,a))}},e.signal.addEventListener(\"abort\",()=>{n.abort(),i(new dl(e.signal.reason))}),n.send(t.body)})}var Ea=async function(t,e){if(t.url.includes(\"://\")&&!/^https?:|^file:/.test(t.url)){let r=Y1(t.url);if(r){let i=await r(t,e);return!i.data&&t.type===\"arrayBuffer\"?qt(i,{data:new ArrayBuffer(0)}):i}if(dr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,targetMapId:ph},e)}if(!X1(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,\"signal\"))return W1(t,e);if(dr(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:\"GR\",data:t,mustQueue:!0,targetMapId:ph},e)}return Z1(t,e)},Sp=(t,e)=>Ea(qt(t,{type:\"json\"}),e),Ep=(t,e)=>Ea(qt(t,{type:\"arrayBuffer\"}),e);function fh(t,e,r){r[t]?.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Ss(t,e,r){if(r?.[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var Fp=class{constructor(t,e={}){qt(this,e),this.type=t}},ha=class extends Fp{constructor(t,e={}){super(\"error\",qt({error:t},e))}},H1=class{on(t,e){return this._listeners||(this._listeners={}),fh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Ss(t,e,this._listeners),Ss(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),fh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){let r=typeof t==\"string\"?new Fp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let n=this._listeners?.[i]?.slice()??[];for(let o of n)o.call(this,r);let a=this._oneTimeListeners?.[i]?.slice()??[];for(let o of a)Ss(i,o,this._oneTimeListeners),o.call(this,r);let s=this._eventedParent;s&&(qt(r,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),s.fire(r))}else r instanceof ha&&console.error(r.error);return this}listens(t){return!!(this._listeners?.[t]?.length||this._oneTimeListeners?.[t]?.length||this._eventedParent?.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},T
vendor: 37,458 bytes, line 1646
1646p={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\",length:2},centerAltitude:{type:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},roll:{type:\"number\",default:0,units:\"degrees\"},state:{type:\"state\",default:{}},light:{type:\"light\"},sky:{type:\"sky\"},projection:{type:\"projection\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},\"font-faces\":{type:\"fontFaces\"},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},encoding:{type:\"enum\",values:{mvt:{},mlt:{}},default:\"mvt\"},\"*\":{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:\"filter\"},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:{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:{},\"color-relief\":{},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_color-relief\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-rounded-corner-distance\":{type:\"number\",default:0,minimum:0,units:\"meters\",\"property-type\":\"constant\"}},layout_line:{\"line-cap\":{type:\"enum\",values:{butt:{},round:{},square:{}},default:\"butt\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"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\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-round-limit\":{type:\"number\",default:1.05,requires:[{\"line-join\":\"round\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-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\",\"feature\"]},\"property-type\":\"data-driven\"},\"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\"},\"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\"},\"symbol-height-offset\":{type:\"number\",default:0,units:\"meters\",requires:[{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-height-anchor\":{type:\"enum\",values:{ground:{},absolute:{}},default:\"ground\",requires:[\"symbol-height-offset\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},\"layout_color-relief\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",expression:{interpolated:!1,parameters:[\"global-state\"]},\"property-type\":\"data-constant\"}},filter:{type:\"boolean\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},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:\"expression_name\",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:\"projectionDefinition\",default:\"mercator\",\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]}}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_color-relief\",\"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-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,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,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default: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-layer-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"global-state\"]},\"property-type\":\"data-constant\"},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"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\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,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:\"numberArray\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-altitude\":{type:\"numberArray\",default:45,minimum:0,maximum:90,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:\"colorArray\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"colorArray\",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\"},\"hillshade-method\":{type:\"enum\",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:\"standard\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},\"paint_color-relief\":{\"color-relief-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"color-relief-color\":{type:\"color\",transition:!1,expression:{interpolated:!0,parameters:[\"elevation\"]},\"property-type\":\"color-ramp\"},resampling:{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,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\"}},interpolation:{type:\"array\",value:\"interpolation_name\",minimum:1},interpolation_name:{type:\"enum\",values:{linear:{syntax:{overloads:[{parameters:[],\"output-type\":\"interpolation\"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:[\"base\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"base\",type:\"number literal\"}]}},\"cubic-bezier\":{syntax:{overloads:[{parameters:[\"x1\",\"y1\",\"x2\",\"y2\"],\"output-type\":\"interpolation\"}],parameters:[{name:\"x1\",type:\"number literal\"},{name:\"y1\",type:\"number literal\"},{name:\"x2\",type:\"number literal\"},{name:\"y2\",type:\"number literal\"}]}}}}},
1646D=Tp,kp=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"],T=class{constructor(t,e,r,i,n=\"error\"){this.message=(t?`${t}: `:\"\")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},cn={kind:\"null\"},k={kind:\"number\"},Y={kind:\"string\"},Q={kind:\"boolean\"},ue={kind:\"color\"},Fa={kind:\"projectionDefinition\"},cr={kind:\"object\"},Z={kind:\"value\"},K1={kind:\"error\"},Ta={kind:\"collator\"},pn={kind:\"formatted\"},ka={kind:\"padding\"},Hi={kind:\"colorArray\"},Ia={kind:\"numberArray\"},fn={kind:\"resolvedImage\"},Ca={kind:\"variableAnchorOffsetCollection\"};function Nt(t,e){return{kind:\"array\",itemType:t,N:e}}function yt(t){if(t.kind===\"array\"){let e=yt(t.itemType);return typeof t.N==\"number\"?`array<${e}, ${t.N}>`:t.itemType.kind===\"value\"?\"array\":`array<${e}>`}return t.kind}var J1=[cn,k,Y,Q,ue,Fa,pn,cr,Nt(Z),ka,Ia,Hi,fn,Ca];function Ki(t,e){if(e.kind===\"error\")return null;if(t.kind===\"array\"){if(e.kind===\"array\"&&(e.N===0&&e.itemType.kind===\"value\"||!Ki(t.itemType,e.itemType))&&(typeof t.N!=\"number\"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind===\"value\"){for(let r of J1)if(!Ki(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function gl(t,e){return e.some(r=>r.kind===t.kind)}function pr(t,e){return e.some(r=>r===\"null\"?t===null:r===\"array\"?Array.isArray(t):r===\"object\"?t&&!Array.isArray(t)&&typeof t==\"object\":r===typeof t)}function Ue(t,e){return t.kind===\"array\"&&e.kind===\"array\"?t.itemType.kind===e.itemType.kind&&typeof t.N==\"number\":t.kind===e.kind}var Ip=.96422,Cp=.82521,Mp=4/29,Ks=6/29,Bp=3*Ks*Ks,Q1=Math.PI/180,t0=180/Math.PI;function Pp(t){return t%=360,t<0&&(t+=360),t}function zp([t,e,r,i]){t=Es(t),e=Es(e),r=Es(r);let n,a,s=Fs((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Fs((.4360747*t+.3850649*e+.1430804*r)/Ip),a=Fs((.0139322*t+.0971045*e+.7141733*r)/Cp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Es(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Fs(t){return t>.008856451679035631?t**(1/3):t/Bp+Mp}function Lp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*ks(n),a=Ip*ks(a),s=Cp*ks(s),[Ts(3.1338561*a-1.6168667*n-.4906146*s),Ts(-.9787684*a+1.9161415*n+.033454*s),Ts(.0719453*a-.2289914*n+1.4052427*s),i]}function Ts(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function ks(t){return t>Ks?t*t*t:Bp*(t-Mp)}function e0(t){let[e,r,i,n]=zp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?Pp(Math.atan2(i,r)*t0):NaN,a,e,n]}function r0([t,e,r,i]){return t=isNaN(t)?0:t*Q1,Lp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function i0([t,e,r,i]){t=Pp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var n0=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function Ni(t,e){return n0(t,e)?t[e]:void 0}function a0(t){if(t=t.toLowerCase().trim(),t===\"transparent\")return[0,0,0,0];let e=Ni(s0,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[Rn(t.slice(n,n+=i)),Rn(t.slice(n,n+=i)),Rn(t.slice(n,n+=i)),Rn(t.slice(n,n+i)||\"ff\")]}if(t.startsWith(\"rgb\")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||\" \",h||\" \",f].join(\"\");if(m===\" \"||m===\" /\"||m===\",,\"||m===\",,,\"){let g=[s,u,p].join(\"\"),x=g===\"%%%\"?100:g===\"\"?255:0;if(x){let b=[Vr(+a/x,0,1),Vr(+l/x,0,1),Vr(+c/x,0,1),d?dh(+d,y):1];if(yh(b))return b}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||\" \",o||\" \",u].join(\"\");if(p===\" \"||p===\" /\"||p===\",,\"||p===\",,,\"){let f=[+n,Vr(+s,0,100),Vr(+l,0,100),h?d
vendor: 4,834 bytes, line 1646
1646h(+h,c):1];if(yh(f))return i0(f)}}}function Rn(t){return parseInt(t.padEnd(2,t),16)/255}function dh(t,e){return Vr(e?t/100:t,0,1)}function Vr(t,e,r){return Math.min(Math.max(e,t),r)}function yh(t){return!t.some(Number.isNaN)}var s0={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]};function He(t,e,r){return t+r*(e-t)}function Jr(t,e,r){return t.map((i,n)=>He(i,e[n],r))}function o0(t){return t===\"rgb\"||t===\"hcl\"||t===\"lab\"}var Bt,gt=(Bt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter(\"rgb\",[e,r,i,n]))}static parse(e){if(e instanceof Bt)return e;if(typeof e!=\"string\")return;let r=a0(e);if(r)return new Bt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter(\"rgb\",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter(\"hcl\",e0(this.rgb))}get lab(){return this.overwriteGetter(\"lab\",zp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(\",\")},${n})`}static interpolate(e,r,i,n=\"rgb\"){switch(n){case\"rgb\":{let[a,s,o,l]=Jr(e.rgb,r.rgb,i);return new Bt(a,s,o,l,!1)}case\"hcl\":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let b=u-a;u>a&&b>180?b-=360:u<a&&a-u>180&&(b+=360),f=a+i*b}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=r0([f,d??He(s,h,i),He(o,c,i),He(l,p,i)]);
1646return new Bt(y,m,g,x,!1)}case\"lab\":{let[a,s,o,l]=Lp(Jr(e.lab,r.lab,i));return new Bt(a,s,o,l,!1)}}}},Bt.black=new Bt(0,0,0,1),Bt.white=new Bt(1,1,1,1),Bt.transparent=new Bt(0,0,0,0),Bt.red=new Bt(1,0,0,1),Bt),l0=[\"bottom\",\"center\",\"top\"],Js=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},Be=class ra{constructor(e){this.sections=e}static fromString(e){return new ra([new Js(e,null,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 ra?e:ra.fromString(e)}toString(){return this.sections.length===0?\"\":this.sections.map(e=>e.text).join(\"\")}},Ae=class Bi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Bi)return e;if(typeof e==\"number\")return new Bi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!=\"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 Bi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Bi(Jr(e.values,r.values,i))}},Se=class Pi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Pi)return e;if(typeof e==\"number\")return new Pi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!=\"number\")return;return new Pi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Pi(Jr(e.values,r.values,i))}},se=class zi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof zi)return e;if(typeof e==\"string\"){let i=gt.parse(e);return i?new zi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!=\"string\")return;let n=gt.parse(i);if(!n)return;r.push(n)}return new zi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n=\"rgb\"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s<e.values.length;s++)a.push(gt.interpolate(e.values[s],r.values[s],i,n));return new zi(a)}},ct=class extends Error{constructor(t,e){super(t),this.name=\"RuntimeError\",this.path=e}toJSON(){return this.message}},u0=new Set([\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"]),De=class ia{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ia)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!=0)){for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];if(typeof i!=\"string\"||!u0.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!=\"number\"||typeof n[1]!=\"number\")return}return new ia(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n){let a=e.values,s=r.values;if(a.length!==s.length)throw new ct(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`,n);let o=[];for(let l=0;l<a.length;l+=2){if(a[l]!==s[l])throw new ct(`Cannot interpolate values containing mismatched anchors. from[${l}]: ${a[l]}, to[${l}]: ${s[l]}`,n);o.push(a[l]);let[u,h]=a[l+1],[c,p]=s[l+1];o.push([He(u,c,i),He(h,p,i)])}return new ia(o)}},_e=class Vp{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Vp({name:e,available:!1}):null}},br=class Or{constructor(e,r,i){this.from=e,this.to=r,this.transition=i}toString(){return this.from===this.to&&this.transition===1?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(e,r,i){return new Or(e,r,i)}static parse(e){if(e instanceof Or)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]==\"string\"&&typeof e[1]==\"string\"&&typeof e[2]==\"number\")return new Or(e[0],e[1],e[2]);if(typeof e==\"object\"&&typeof e.from==\"string\"&&typeof e.to==\"string\"&&typeof e.transition==\"number\")return new Or(e.from,e.to,e.transition);if(typeof e==\"string\")return new Or(e,e,1)}},xl=class{constructor(t,e,r){this.sensitivity=t?e?\"variant\":\"case\":e?\"accent\":\"base\",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function Op(t,e,r,i){return typeof t==\"number\"&&t>=0&&t<=255&&typeof e==\"number\"&&e>=0&&e<=255&&typeof r==\"number\"&&r>=0&&r<=255?i===void 0||typeof i==\"number\"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i==\"number\"?[t,e,r,i]:[t,e,r]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Qr(t){if(t===null||typeof t==\"string\"||typeof t==\"boolean\"||typeof t==\"number\"||t instanceof br||t instanceof gt||t instanceof xl||t instanceof Be||t instanceof Ae||t instanceof Se||t instanceof se||t instanceof De||t instanceof _e)return!0;
1646if(Array.isArray(t)){for(let e of t)if(!Qr(e))return!1;return!0}if(typeof t==\"object\"){for(let e in t)if(!Qr(t[e]))return!1;return!0}return!1}function At(t){if(t===null)return cn;if(typeof t==\"string\")return Y;if(typeof t==\"boolean\")return Q;if(typeof t==\"number\")return k;if(t instanceof gt)return ue;if(t instanceof br)return Fa;if(t instanceof xl)return Ta;if(t instanceof Be)return pn;if(t instanceof Ae)return ka;if(t instanceof Se)return Ia;if(t instanceof se)return Hi;if(t instanceof De)return Ca;if(t instanceof _e)return fn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=At(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Nt(r||Z,e)}return cr}function Ui(t){let e=typeof t;return t===null?\"\":e===\"string\"||e===\"number\"||e===\"boolean\"?String(t):t instanceof gt||t instanceof br||t instanceof Be||t instanceof Ae||t instanceof Se||t instanceof se||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}var ti=class Rp{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Qr(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=At(i),a=r.expectedType;return n.kind===\"array\"&&n.N===0&&a&&a.kind===\"array\"&&(typeof a.N!=\"number\"||a.N===0)&&(n=a),new Rp(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},h0=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],$p=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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\"?h0[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(t){let e=this._parseColorCache.get(t);return e||(e=gt.parse(t),this._parseColorCache.set(t,e)),e}};function Ma(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||e<l)return s;n=s+1}else if(o>e)a=s-1;else throw new ct(\"Input is not a number.\",r);return 0}var vl=class Np{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");let i=r.parse(e[1],1,k);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!==\"value\"&&(a=r.expectedType);for(let s=1;s<e.length;s+=2){let o=s===1?-1/0:e[s],l=e[s+1],u=s,h=s+1;if(typeof o!=\"number\")return r.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=o)return r.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Np(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Ma(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function c0(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)<c)return((u*p+l)*p+o)*p;let g=(3*s*p+2*a)*p+n;if(Math.abs(g)<1e-6)break;p-=m/g}let f=0,d=1;p=h;for(let y=0;y<20;y++){let m=((s*p+a)*p+n)*p;if(Math.abs(m-h)<c)break;h>m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var be=class Qs{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name===\"exponential\")a=Is(r,e.base,i,n);else if(e.name===\"linear\")a=Is(r,1,i,n);else if(e.name===\"cubic-bezier\"){let s=e.controlPoints;
1646a=c0(s[0],s[1],s[2],s[3])(Is(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error(\"Expected an interpolation type expression.\",1);if(n[0]===\"linear\")n={name:\"linear\"};else if(n[0]===\"exponential\"){let u=n[1];if(typeof u!=\"number\")return r.error(\"Exponential interpolation requires a numeric base.\",1,1);n={name:\"exponential\",base:u}}else if(n[0]===\"cubic-bezier\"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!=\"number\"||h<0||h>1))return r.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);n={name:\"cubic-bezier\",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error(\"Expected an even number of arguments.\");if(a=r.parse(a,2,k),!a)return null;let o=[],l=null;(i===\"interpolate-hcl\"||i===\"interpolate-lab\")&&r.expectedType!=Hi?l=ue:r.expectedType&&r.expectedType.kind!==\"value\"&&(l=r.expectedType);for(let u=0;u<s.length;u+=2){let h=s[u],c=s[u+1],p=u+3,f=u+4;if(typeof h!=\"number\")return r.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(o.length&&o[o.length-1][0]>=h)return r.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ue(l,k)&&!Ue(l,Fa)&&!Ue(l,ue)&&!Ue(l,ka)&&!Ue(l,Ia)&&!Ue(l,Hi)&&!Ue(l,Ca)&&!Ue(l,Nt(k))?r.error(`Type ${yt(l)} is not interpolatable.`):new Qs(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Ma(r,n,this.key),o=r[s],l=r[s+1],u=Qs.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case\"interpolate\":switch(this.type.kind){case\"number\":return He(h,c,u);case\"color\":return gt.interpolate(h,c,u);case\"padding\":return Ae.interpolate(h,c,u);case\"colorArray\":return se.interpolate(h,c,u);case\"numberArray\":return Se.interpolate(h,c,u);case\"variableAnchorOffsetCollection\":return De.interpolate(h,c,u,this.key);case\"array\":return Jr(h,c,u);case\"projectionDefinition\":return br.interpolate(h,c,u)}case\"interpolate-hcl\":switch(this.type.kind){case\"color\":return gt.interpolate(h,c,u,\"hcl\");case\"colorArray\":return se.interpolate(h,c,u,\"hcl\")}case\"interpolate-lab\":switch(this.type.kind){case\"color\":return gt.interpolate(h,c,u,\"lab\");case\"colorArray\":return se.interpolate(h,c,u,\"lab\")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Is(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var yr={color:gt.interpolate,number:He,padding:Ae.interpolate,numberArray:Se.interpolate,colorArray:se.interpolate,variableAnchorOffsetCollection:De.interpolate,array:Jr},Up=class qp{constructor(e){this.type=pn,this.sections=e}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[1];if(!Array.isArray(i)&&typeof i==\"object\")return r.error(\"First argument must be an image or text section.\");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o==\"object\"&&!Array.isArray(o)){a=!1;let l=null;if(o[\"font-scale\"]&&(l=r.parse(o[\"font-scale\"],1,k),!l))return null;let u=null;if(o[\"text-font\"]&&(u=r.parse(o[\"text-font\"],1,Nt(Y)),!u))return null;let h=null;if(o[\"text-color\"]&&(h=r.parse(o[\"text-color\"],1,ue),!h))return null;let c=null;if(o[\"vertical-align\"]){if(typeof o[\"vertical-align\"]==\"string\"&&!l0.includes(o[\"vertical-align\"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o[\"vertical-align\"]}' instead.`);if(c=r.parse(o[\"vertical-align\"],1,Y),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!==\"string\"&&u!==\"value\"&&u!==\"null\"&&u!==\"resolvedImage\")return r.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new qp(n)}evaluate(e){return new Be(this.sections.map(r=>{let i=r.content.evaluate(e);return At(i)===fn?new Js(\"\",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Js(Ui(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(\",\"):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function jp(t,e,r=0,i=t.length-1,n=p0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);jp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(Si(t,r,e),n(t[i],a)>0&&Si(t,r,i);s<o;){for(Si(t,s,o),s++,o--;n(t[s],a)<0;)s++;for(;n(t[o],a)>0;)o--}n(t[r],a)===0?Si(t,r,o):(o++,Si(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function Si(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function p0(t,e){return t<e?-1:+(t>e)}function Ba(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=d0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a<r.length;a++)r[a].length<=e||(jp(r[a],e,1,r[a].length-1,f0),r[a]=r[a].slice(0,e));return r}function f0(t,e){return e.area-t.area}function d0(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var $n={string:Y,number:k,boolean:Q,object:cr},Ie=class Gp{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=1,n,a=e[0];if(a===\"array\"){let o;if(e.length>2){let u=e[1];if(typeof u!=\"string\"||!(u in $n)||u===\"object\")return r.error('The item type argument of \"array\" must be one of string, number, boolean',1);o=$n[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=\"number\"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to \"array\" must be a positive integer literal',2);l=e[2],i++}n=Nt(o,l)}else{if(!$n[a])throw Error(`Types doesn't contain name = ${a}`);n=$n[a]}let s=[];for(;i<e.length;i++){let o=r.parse(e[i],i,Z);if(!o)return null;s.push(o)}return new Gp(n,s,r.key)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(!Ki(this.type,At(i)))return i;if(r===this.args.length-1)throw new ct(`Expected value to be of type ${yt(this.t
1646ype)}, but found ${yt(At(i))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},mh={\"to-boolean\":Q,\"to-color\":ue,\"to-number\":k,\"to-string\":Y},Ur=class Yp{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=e[0];if(!mh[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i===\"to-boolean\"||i===\"to-string\")&&e.length!==2)return r.error(\"Expected one argument.\");let n=mh[i],a=[];for(let s=1;s<e.length;s++){let o=r.parse(e[s],s,Z);if(!o)return null;a.push(o)}return new Yp(n,a,r.key)}evaluate(e){switch(this.type.kind){case\"boolean\":return!!this.args[0].evaluate(e);case\"color\":{let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof gt)return r;if(typeof r==\"string\"){let a=e.parseColor(r);if(a)return a}else if(Array.isArray(r)&&(i=r.length<3||r.length>4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Op(r[0],r[1],r[2],r[3]),!i))return new gt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ct(i||`Could not parse color from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"padding\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ct(`Could not parse padding from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"numberArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=Se.parse(r);if(n)return n}throw new ct(`Could not parse numberArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"colorArray\":{let r;for(let i of this.args){r=i.evaluate(e);let n=se.parse(r);if(n)return n}throw new ct(`Could not parse colorArray from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"variableAnchorOffsetCollection\":{let r;for(let i of this.args){r=i.evaluate(e);let n=De.parse(r);if(n)return n}throw new ct(`Could not parse variableAnchorOffsetCollection from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}case\"number\":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ct(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case\"formatted\":return Be.fromString(Ui(this.args[0].evaluate(e)));case\"resolvedImage\":return _e.fromString(Ui(this.args[0].evaluate(e)));case\"projectionDefinition\":{let r=this.args[0].evaluate(e);if(br.parse(r))return r;throw new ct(`Could not parse projectionDefinition from value '${typeof r==\"string\"?r:JSON.stringify(r)}'`,this.key)}default:return Ui(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Xp=class Wp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a<e.length-1;a+=2){let s=e[a];if(typeof s!=\"string\")return r.error(`Expected string, but found ${typeof s} instead.`,a);if(/[^a-zA-Z0-9_]/.test(s))return r.error(\"Variable names must contain only alphanumeric characters or '_'.\",a);let o=r.parse(e[a+1],a+1);if(!o)return null;i.push([s,o])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new Wp(i,n):null}outputDefined(){return this.result.outputDefined()}},Zp=class Hp{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!=\"string\")return r.error(\"'var' expression requires exactly one string literal argument.\");let i=e[1];return r.scope.has(i)?new Hp(i,r.scope.get(i)):r.error(`Unknown variable \"${i}\". Make sure \"${i}\" has been bound in an enclosing \"let\" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},y0=class Kp{constructor(e,r,i,n){this.type=e,this.index=r,this.input=i,this.key=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,k),n=r.parse(e[2],2,Nt(r.expectedType||Z));if(!i||!n)return null;let a=n.type;return new Kp(a.itemType,i,n,r.key)}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new ct(`Array index out of bounds: ${r} < 0.`,this.key);if(r>=i.length)throw new ct(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ct(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},m0=class Jp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=Q}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:gl(i.type,[Q,Y,k,cn,Z])?new Jp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!pr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ct(`Expected first argument to be of type boolean, string, number or null, but found ${yt(At(r))} instead.`,this.key);if(!pr(i,[\"string\",\"array\"]))throw new ct(`Expected second argument to be of type array or string, but found ${yt(At(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},g0=class to{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=k}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!gl(i.type,[Q,Y,k,cn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,k);return a?new to(i,n,r.key,a):null}return new to(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!pr(r,[\"boolean\",\"string\",\"number\",\"null\"]))throw new ct(`Expected first argument to be of type boolean, string, number or null, but found ${yt(At(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),pr(i,[\"string\"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(pr(i,[\"array\"]))return i.indexOf(r,n);throw new ct(`Expected second argument to be of type array or string, but found ${yt(At(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},x0=class Qp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error(\"Expected an even number of arguments.\");let i,n;r.expectedType&&r.expectedType.kind!==\"value\"&&(n=r.expectedType);let a={},s=[];for(let u=2;u<e.length-1;u+=2){let h=e[u],c=e[u+1];Array.isArray(h)||(h=[h]);let p=r.concat(u);if(h.length===0)return p.error(\"Expected at least one branch label.\");
1646for(let d of h){if(typeof d!=\"number\"&&typeof d!=\"string\")return p.error(\"Branch labels must be numbers or strings.\");if(typeof d==\"number\"&&Math.abs(d)>2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d==\"number\"&&Math.floor(d)!==d)return p.error(\"Numeric branch labels must be integer values.\");if(!i)i=At(d);else if(p.checkSubtype(i,At(d)))return null;if(a[String(d)]!==void 0)return p.error(\"Branch labels must be unique.\");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!==\"value\"&&r.concat(1).checkSubtype(i,o.type)?null:new Qp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(At(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},v0=class tf{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error(\"Expected an odd number of arguments.\");let i;r.expectedType&&r.expectedType.kind!==\"value\"&&(i=r.expectedType);let n=[];for(let s=1;s<e.length-1;s+=2){let o=r.parse(e[s],s,Q);if(!o)return null;let l=r.parse(e[s+1],s+1,i);if(!l)return null;n.push([o,l]),i||(i=l.type)}let a=r.parse(e[e.length-1],e.length-1,i);if(!a)return null;if(!i)throw Error(\"Can't infer output type\");return new tf(i,n,a)}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},b0=class eo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,k);if(!i||!n)return null;if(!gl(i.type,[Nt(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,k);return a?new eo(i.type,i,n,r.key,a):null}return new eo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),pr(r,[\"string\"]))return[...r].slice(i,n).join(\"\");if(pr(r,[\"array\"]))return r.slice(i,n);throw new ct(`Expected first argument to be of type array or string, but found ${yt(At(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},ef=class ro{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error(\"Expected at least one argument.\");let i=null,n=r.expectedType;n&&n.kind!==\"value\"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:\"omit\"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error(\"No output type\");return n&&a.some(s=>Ki(n,s.type))?new ro(Z,a):new ro(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof _e&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function gh(t,e){return t===\"==\"||t===\"!=\"?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 w0(t,e,r){return e===r}function D0(t,e,r){return e!==r}function _0(t,e,r){return e<r}function A0(t,e,r){return e>r}function S0(t,e,r){return e<=r}function E0(t,e,r){return e>=r}function rf(t,e,r,i){return i.compare(e,r)===0}function F0(t,e,r,i){return!rf(t,e,r,i)}function T0(t,e,r,i){return i.compare(e,r)<0}function k0(t,e,r,i){return i.compare(e,r)>0}function I0(t,e,r,i){return i.compare(e,r)<=0}function C0(t,e,r,i){return i.compare(e,r)>=0}function si(t,e,r){let i=t!==\"==\"&&t!==\"!=\";
1646return class nf{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=Q,this.hasUntypedArgument=a.type.kind===\"value\"||s.type.kind===\"value\"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error(\"Expected two or three arguments.\");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!gh(o,l.type))return s.concat(1).error(`\"${o}\" comparisons are not supported for type '${yt(l.type)}'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!gh(o,u.type))return s.concat(2).error(`\"${o}\" comparisons are not supported for type '${yt(u.type)}'.`);if(l.type.kind!==u.type.kind&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(`Cannot compare types '${yt(l.type)}' and '${yt(u.type)}'.`);i&&(l.type.kind===\"value\"&&u.type.kind!==\"value\"?l=new Ie(u.type,[l],s.key):l.type.kind!==\"value\"&&u.type.kind===\"value\"&&(u=new Ie(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!==\"string\"&&u.type.kind!==\"string\"&&l.type.kind!==\"value\"&&u.type.kind!==\"value\")return s.error(\"Cannot use collator to compare non-string types.\");if(h=s.parse(a[3],3,Ta),!h)return null}return new nf(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=At(s),u=At(o);if(l.kind!==u.kind||l.kind!==\"string\"&&l.kind!==\"number\")throw new ct(`Expected arguments for \"${t}\" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=At(s),u=At(o);if(l.kind!==\"string\"||u.kind!==\"string\")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var M0=si(\"==\",w0,rf),B0=si(\"!=\",D0,F0),P0=si(\"<\",_0,T0),z0=si(\">\",A0,k0),L0=si(\"<=\",S0,I0),V0=si(\">=\",E0,C0),af=class sf{constructor(e,r,i){this.type=Ta,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error(\"Expected one argument.\");let i=e[1];if(typeof i!=\"object\"||Array.isArray(i))return r.error(\"Collator options argument must be an object.\");let n=r.parse(i[\"case-sensitive\"]!==void 0&&i[\"case-sensitive\"],1,Q);if(!n)return null;let a=r.parse(i[\"diacritic-sensitive\"]!==void 0&&i[\"diacritic-sensitive\"],1,Q);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new sf(n,a,s)}evaluate(e){return new xl(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}},O0=class of{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,k);if(!i)return null;let n=e[2];if(typeof n!=\"object\"||Array.isArray(n))return r.error(\"NumberFormat options argument must be an object.\");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");let l=null;if(n[\"min-fraction-digits\"]&&(l=r.parse(n[\"min-fraction-digits\"],1,k),!l))return null;let u=null;return n[\"max-fraction-digits\"]&&(u=r.parse(n[\"max-fraction-digits\"],1,k),!u)?null:new of(i,a,s,o,l,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?\"currency\":this.unit?\"unit\":\"decimal\",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},R0=class lf{constructor(e){this.type=fn,this.input=e}static parse(e,r){if(e.length!==2)return r.error(\"Expected two arguments.\");let i=r.parse(e[1],1,Y);return i?new lf(i):r.error(\"No image name provided.\")}evaluate(e){let r=this.input.evaluate(e),i=_e.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},$0=class uf{constructor(e,r){this.input=e,this.key=r,this.type=k}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!==\"array\"&&i.type.kind!==\"string\"&&i.type.kind!==\"value\"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new uf(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r==\"string\")return[...r].length;if(Array.isArray(r))return r.length;throw new ct(`Expected value to be of type string or array, but found ${yt(At(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},we=8192;function N0(t,e){let r=U0(t[0]),i=j0(t[1]),n=2**e.z;return[Math.round(r*n*we),Math.round(i*n*we)]}function bl(t,e){let r=2**e.z,i=(t[0]/we+e.x)/r,n=(t[1]/we+e.y)/r;return[q0(i),G0(n)]}function U0(t){return(180+t)/360}function q0(t){return t*360-180}function j0(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function G0(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180)
vendor: 11,433 bytes, line 1646
1646)-90}function dn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ji(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Y0(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function X0(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function Pa(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return K0([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(xh(t,e,r,i)&&xh(r,i,t,e))}function W0(t,e,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(Pa(t,e,i[n],i[n+1]))return!0;return!1}function oi(t,e,r=!1){let i=!1;for(let n of e)for(let a=0;a<n.length-1;a++){if(X0(t,n[a],n[a+1]))return r;Y0(t,n[a],n[a+1])&&(i=!i)}return i}function Z0(t,e){for(let r of e)if(oi(t,r))return!0;return!1}function hf(t,e){for(let r of t)if(!oi(r,e))return!1;for(let r=0;r<t.length-1;++r)if(W0(t[r],t[r+1],e))return!1;return!0}function H0(t,e){for(let r of e)if(hf(t,r))return!0;return!1}function K0(t,e){return t[0]*e[1]-t[1]*e[0]}function xh(t,e,r,i){let n=t[0]-r[0],a=t[1]-r[1],s=e[0]-r[0],o=e[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],h=n*u-l*a,c=s*u-l*o;return h>0&&c<0||h<0&&c>0}function wl(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=[];for(let s=0;s<t[n].length;s++){let o=N0(t[n][s],r);dn(e,o),a.push(o)}i.push(a)}return i}function cf(t,e,r){let i=[];for(let n=0;n<t.length;n++){let a=wl(t[n],e,r);i.push(a)}return i}function pf(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}dn(e,t)}function J0(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function vh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];pf(u,e,r,n),s.push(u)}return s}function bh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];dn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){J0(e);for(let o of s)for(let l of o)pf(l,e,r,n)}return s}function Q0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=wl(e.coordinates,i,n),s=vh(t.geometry(),r,i,n);if(!Ji(r,i))return!1;for(let o of s)if(!oi(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=cf(e.coordinates,i,n),s=vh(t.geometry(),r,i,n);if(!Ji(r,i))return!1;for(let o of s)if(!Z0(o,a))return!1}return!0}function tm(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type===\"Polygon\"){let a=wl(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!Ji(r,i))return!1;for(let o of s)if(!hf(o,a))return!1}if(e.type===\"MultiPolygon\"){let a=cf(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!Ji(r,i))return!1;for(let o of s)if(!H0(o,a))return!1}return!0}var Dl=class na{constructor(e,r){this.type=Q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qr(e[1])){let i=e[1];if(i.type===\"FeatureCollection\"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s===\"Polygon\"&&n.push(o),s===\"MultiPolygon\"&&n.push(...o)}if(n.length)return new na(i,{type:\"MultiPolygon\",coordinates:n})}else if(i.type===\"Feature\"){let n=i.geometry.type;if(n===\"Polygon\"||n===\"MultiPolygon\")return new na(i,i.geometry)}else if(i.type===\"Polygon\"||i.type===\"MultiPolygon\")return new na(i,i)}return r.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 Q0(e,this.geometries);if(e.geometryType()===\"LineString\")return tm(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},ff=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}},wh=Math.PI/180,_l=class{constructor(t){let e=wh*6378.137*1e3,r=Math.cos(t*wh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],h=this.wrap(t[o+1][0]-l)*this.kx,c=(t[o+1][1]-u)*this.ky,p=0;(h!==0||c!==0)&&(p=(this.wrap(e[0]-l)*this.kx*h+(e[1]-u)*this.ky*c)/(h*h+c*c),p>1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f<r&&(r=f,i=l,n=u,a=o,s=p)}return{point:[i,n],index:a,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}};function df(t,e){return e[0]-t[0]}function ca(t){return t[1]-t[0]+1}function Pe(t,e){return t[1]>=t[0]&&t[1]<e}function io(t,e){if(t[0]>t[1])return[null,null];let r=ca(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function no(t,e){if(!Pe(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)dn(r,t[i]);return r}function ao(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)dn(e,i);return e}function Dh(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Al(t,e,r){if(!Dh(t)||!Dh(e))return NaN;let i=0,n=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),r.distance([0,0],[i,n])}function ur(t,e,r){let i=r.pointOnLine(e,t);return r.distance(t,i.point)}function Sl(t,e,r,i,n){let a=Math.min(ur(t,[r,i],n),ur(e,[r,i],n)),s=Math.min(ur(r,[t,e],n),ur(i,[t,e],n));return Math.min(a,s)}function em(t,e,r,i,n){if(!(Pe(e,t.length)&&Pe(i,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let o=t[s],l=t[s+1];for(let u=i[0];u<i[1];++u){let h=r[u],c=r[u+1];if(Pa(o,l,h,c))return 0;a=Math.min(a,Sl(o,l,h,c,n))}}return a}function rm(t,e,r,i,n){if(!(Pe(e,t.length)&&Pe(i,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let o=i[0];o<=i[1];++o)if(a=Math.min(a,n.distance(t[s],r[o])),a===0)return a;return a}function im(t,e,r){if(oi(t,e,!0))return 0;let i=1/0;for(let n of e){let a=n[0],s=n[n.length-1];if(a!==s&&(i=Math.min(i,ur(t,[s,a],r)),i===0))return i;let o=r.pointOnLine(n,t);if(i=Math.min(i,r.distance(t,o.point)),i===0)return i}return i}function nm(t,e,r,i){if(!Pe(e,t.length))return NaN;for(let a=e[0];a<=e[1];++a)if(oi(t[a],r,!0))return 0;let n=1/0;for(let a=e[0];a<e[1];++a){let s=t[a],o=t[a+1];for(let l of r)for(let u=0,h=l.length,c=h-1;u<h;c=u++){let p=l[c],f=l[u];if(Pa(s,o,p,f))return 0;n=Math.min(n,Sl(s,o,p,f,i))}}return n}function _h(t,e){for(let r of t)for(let i of r)if(oi(i,e,!0))return!0;return!1}function am(t,e,r,i=1/0){let n=ao(t),a=ao(e);if(i!==1/0&&Al(n,a,r)>=i)return i;if(Ji(n,a)){if(_h(t,e))return 0}else if(_h(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l<u;h=l++){let c=o[h],p=o[l];for(let f of e)for(let d=0,y=f.length,m=y-1;d<y;m=d++){let g=f[m],x=f[d];if(Pa(c,p,g,x))return 0;s=Math.min(s,Sl(c,p,g,x,r))}}return s}function Ah(t,e,r,i,n,a){if(!a)return;let s=Al(no(i,a),n,r);s<e&&t.push([s,a,[0,0]])}function Nn(t,e,r,i,n,a,s){if(!a||!s)return;let o=Al(no(i,a),no(n,s),r);o<e&&t.push([o,a,s])}function pa(t,e,r,i,n=1/0){let a=Math.min(i.distance(t[0],r[0][0]),n);if(a===0)return a;let s=new ff([[0,[0,t.length-1],[0,0]]],df),o=ao(r);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(ca(u)<=h){if(!Pe(u,t.length))return NaN;if(e){let c=nm(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=im(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=io(u,e);Ah(s,a,i,t,o,c[0]),Ah(s,a,i,t,o,c[1])}}return a}function fa(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new ff([[0,[0,t.length-1],[0,r.length-1]]],df);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(ca(u)<=c&&ca(h)<=p){if(!Pe(u,t.length)&&Pe(h,r.length))return NaN;let f;if(e&&i)f=em(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=ur(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=ur(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=rm(t,u,r,h,n),s=Math.min(s,f)}else{let f=io(u,e),d=io(h,i);Nn(o,s,n,t,r,f[0],d[0]),Nn(o,s,n,t,r,f[0],d[1]),Nn(o,s,n,t,r,f[1],d[0]),Nn(o,s,n,t,r,f[1],d[1])}}return s}function sm(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,fa(i,!1,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,fa(i,!1,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,pa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function om(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case\"Point\":a=Math.min(a,fa(i,!0,[s.coordinates],!1,n,a));break;case\"LineString\":a=Math.min(a,fa(i,!0,s.coordinates,!0,n,a));break;case\"Polygon\":a=Math.min(a,pa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function lm(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ba(r,0).map(s=>s.map(o=>o.map(l=>bl([l.x,l.y],t.canonical)))),n=new _l(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case\"Point\":a=Math.min(a,pa([s.coordinates],!1,o,n,a));break;case\"LineString\":a=Math.min(a,pa(s.coordinates,!0,o,n,a));break;case\"Polygon\":a=Math.min(a,am(o,s.coordinates,n,a))}if(a===0)return a}return a}function Cs(t){return t.type===\"MultiPolygon\"?t.coordinates.map(e=>({type:\"Polygon\",coordinates:e})):t.type===\"MultiLineString\"?t.coordinates.map(e=>({type:\"LineString\",coordinates:e})):t.type===\"MultiPoint\"?t.coordinates.map(e=>({type:\"Point\",coordinates:e})):[t]}var El=class aa{constructor(e,r){this.type=k,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qr(e[1])){let i=e[1];if(i.type===\"FeatureCollection\")return new aa(i,i.features.map(n=>Cs(n.geometry)).flat());if(i.type===\"Feature\")return new aa(i,Cs(i.geometry));if(\"type\"in i&&\"coordinates\"in i)return new aa(i,Cs(i))}return r.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 sm(e,this.geometries);if(e.geometryType()===\"LineString\")return om(e,this.geometries);if(e.geometryType()===\"Polygon\")return lm(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},um=class yf{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;
1646else{if(r===i.type)continue;r=Z;break}this.type=Nt(r??Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`'semiliteral' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Qr(e[1]))return r.error(`invalid value of type \"${typeof e[1]}\"`);let i=e[1],n=At(i);if(n.kind===\"array\"){let a=i,s=r.concat(1),o=[];for(let l=0;l<a.length;l++){let u=s.parse(a[l],l,Z);if(!u)return null;o.push(u)}return new yf(o)}return new ti(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Fl=class mf{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error(\"Global state property must be defined.\"):typeof i==\"string\"?new mf(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let r=e.globals?.globalState;return!r||Object.keys(r).length===0?null:Ni(r,this.key)??null}eachChild(){}outputDefined(){return!1}},Gr={\"==\":M0,\"!=\":B0,\">\":z0,\"<\":P0,\">=\":V0,\"<=\":L0,array:Ie,at:y0,boolean:Ie,case:v0,coalesce:ef,collator:af,format:Up,image:R0,in:m0,\"index-of\":g0,interpolate:be,\"interpolate-hcl\":be,\"interpolate-lab\":be,length:$0,let:Xp,literal:ti,match:x0,number:Ie,\"number-format\":O0,object:Ie,semiliteral:um,slice:b0,step:vl,string:Ie,\"to-boolean\":Ur,\"to-color\":Ur,\"to-number\":Ur,\"to-string\":Ur,var:Zp,within:Dl,distance:El,\"global-state\":Fl},ge=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},hm=class gf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new gf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},xf=class vf{constructor(e,r,i=[],n,a=new hm,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(\"\"),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r==null?this._parse(e,a):this.concat(r,i,n)._parse(e,a)}_parse(e,r){(e===null||typeof e==\"string\"||typeof e==\"boolean\"||typeof e==\"number\")&&(e=[\"literal\",e]);let i=this.key;function n(a,s,o){return o===\"assert\"?new Ie(s,[a],i):o===\"coerce\"?new Ur(s,[a],i):a}if(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\", []].');let a=e[0];if(typeof a!=\"string\")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind===\"string\"||l.kind===\"number\"||l.kind===\"boolean\"||l.kind===\"object\"||l.kind===\"array\")&&u.kind===\"value\")o=n(o,l,r.typeAnnotation||\"assert\");else if(l.kind===\"projectionDefinition\"&&[\"string\",\"array\",\"value\"].includes(u.kind)||[\"color\",\"formatted\",\"resolvedImage\"].includes(l.kind)&&[\"value\",\"string\"].includes(u.kind)||[\"padding\",\"numberArray\"].includes(l.kind)&&[\"value\",\"number\",\"array\"].includes(u.kind)||l.kind===\"colorArray\"&&[\"value\",\"string\",\"array\"].includes(u.kind)||l.kind===\"variableAnchorOffsetCollection\"&&[\"value\",\"array\"].includes(u.kind))o=n(o,l,r.typeAnnotation||\"coerce\");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ti)&&o.type.kind!==\"resolvedImage\"&&this._isConstant(o)){let l=new $p;try{o=new ti(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression \"${a}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return e===void 0?this.error(\"'undefined' value invalid. Use null instead.\"):typeof e==\"object\"?this.error('Bare objects invalid. Use [\"literal\", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e==\"number\"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new vf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join(\"\")}`;this.errors.push(new ge(i,e))}checkSubtype(e,r){let i=Ki(e,r);return i&&this.error(i),i}},wr=class Li{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}
vendor: 7,401 bytes, line 1646
1646eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Li.definitions[i];if(!n)return r.error(`Unknown expression \"${i}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new xf(r.registry,da,r.path,null,r.scope);let c=[],p=!1;for(let f=1;f<e.length;f++){let d=e[f],y=Array.isArray(u)?u[f-1]:u.type,m=l.parse(d,1+c.length,y);if(!m){p=!0;break}c.push(m)}if(!p){if(Array.isArray(u)&&u.length!==c.length){l.error(`Expected ${u.length} arguments, but found ${c.length} instead.`);continue}for(let f=0;f<c.length;f++){let d=Array.isArray(u)?u[f]:u.type,y=c[f];l.concat(f+1).checkSubtype(d,y.type)}if(l.errors.length===0)return new Li(i,a,h,c,r.key)}}if(o.length===1)r.errors.push(...l.errors);else{let u=(o.length?o:s).map(([c])=>pm(c)).join(\" | \"),h=[];for(let c=1;c<e.length;c++){let p=r.parse(e[c],1+h.length);if(!p)return null;h.push(yt(p.type))}r.error(`Expected arguments of type ${u}, but found (${h.join(\", \")}) instead.`)}return null}static register(e,r){Li.definitions=r;for(let i in r)e[i]=Li}};function Sh(t,[e,r,i,n],a){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);let s=n?n.evaluate(t):1,o=Op(e,r,i,s);if(o)throw new ct(o,a);return new gt(e/255,r/255,i/255,s,!1)}function Eh(t,e){return t in e&&e[t]!==void 0}function Ms(t,e){let r=e[t];return r===void 0?null:r}function cm(t,e,r,i){for(;r<=i;){let n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function ar(t){return{type:t}}wr.register(Gr,{error:[K1,[Y],(t,[e],r)=>{throw new ct(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>yt(At(e.evaluate(t)))],\"to-rgba\":[Nt(k,4),[ue],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[ue,[k,k,k],Sh],rgba:[ue,[k,k,k,k],Sh],has:{type:Q,overloads:[[[Y],(t,[e])=>Eh(e.evaluate(t),t.properties())],[[Y,cr],(t,[e,r])=>Eh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>Ms(e.evaluate(t),t.properties())],[[Y,cr],(t,[e,r])=>Ms(e.evaluate(t),r.evaluate(t))]]},\"feature-state\":[Z,[Y],(t,[e])=>Ms(e.evaluate(t),t.featureState||{})],properties:[cr,[],t=>t.properties()],\"geometry-type\":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],\"heatmap-density\":[k,[],t=>t.globals.heatmapDensity||0],elevation:[k,[],t=>t.globals.elevation||0],\"line-progress\":[k,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],\"+\":[k,ar(k),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],\"*\":[k,ar(k),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],\"-\":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},\"/\":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],\"%\":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],\"^\":[k,[k,k],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,ar(k),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[k,ar(k),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],\"filter-==\":[Q,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],\"filter-id-==\":[Q,[Z],(t,[e])=>t.id()===e.value],\"filter-type-==\":[Q,[Y],(t,[e])=>t.geometryType()===e.value],\"filter-<\":[Q,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<n}],\"filter-id-<\":[Q,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<i}],\"filter->\":[Q,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],\"filter-id->\":[Q,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],\"filter-<=\":[Q,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],\"filter-id-<=\":[Q,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],\"filter->=\":[Q,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],\"filter-id->=\":[Q,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],\"filter-has\":[Q,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],\"filter-has-id\":[Q,[],t=>t.id()!==null&&t.id()!==void 0],\"filter-type-in\":[Q,[Nt(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],\"filter-id-in\":[Q,[Nt(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],\"filter-in-small\":[Q,[Y,Nt(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],\"filter-in-large\":[Q,[Y,Nt(Z)],(t,[e,r])=>cm(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[ar(Q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:Q,overloads:[[[Q,Q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[ar(Q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},\"!\":[Q,[Q],(t,[e])=>!e.evaluate(t)],\"is-supported-script\":[Q,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,ar(Z),(t,e)=>e.map(r=>Ui(r.evaluate(t))).join(\"\")],split:[Nt(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Nt(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],\"resolved-locale\":[Y,[Ta],(t,[e])=>e.evaluate(t).resolvedLocale()]});function pm(t){return Array.isArray(t)?`(${t.map(yt).join(\", \")})`:`(${yt(t.type)}...)`}function da(t){if(t instanceof Zp)return da(t.boundExpression);if(t instanceof wr&&t.name===\"error\"||t instanceof af||t instanceof Dl||t instanceof El||t instanceof Fl)return!1;let e=t instanceof Ur||t instanceof Ie,r=!0;return t.eachChild(i=>{r&&(r=e?da(i):i instanceof ti)}),r?za(t)&&La(t,[\"zoom\",\"heatmap-density\",\"elevation\",\"line-progress\",\"accumulated\",\"is-supported-script\"]):!1}function za(t){if(t instanceof wr&&(t.name===\"get\"&&t.args.length===1||t.name===\"feature-state\"||t.name===\"has\"&&t.args.length===1||t.name===\"properties\"||t.name===\"geometry-type\"||t.name===\"id\"||/^filter-/.test(t.name))||t instanceof Dl||t instanceof El)return!1;let e=!0;return t.eachChild(r=>{e&&!za(r)&&(e=!1)}),e}function Qi(t){if(t instanceof wr&&t.name===\"feature-state\")return!1;let e=!0;return t.eachChild(r=>{e&&!Qi(r)&&(e=!1)}),e}function La(t,e){if(t instanceof wr&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!La(i,e)&&(r=!1)}),r}function ei(t){return t[\"property-type\"]===\"data-driven\"||t[\"property-type\"]===\"cross-faded-data-driven\"}function bf(t){return!!t.expression&&t.expression.parameters.indexOf(\"zoom\")>-1}
1646function Tl(t){return!!t.expression&&t.expression.interpolated}var kl=/^(.*)-transition$/;function tn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function K(t){return t instanceof Number?\"number\":t instanceof String?\"string\":t instanceof Boolean?\"boolean\":Array.isArray(t)?\"array\":t===null?\"null\":typeof t}function Va(t){return typeof t==\"object\"&&!!t&&!Array.isArray(t)&&At(t)===cr}function fm(t){return t}function dm(t){switch(t.type){case\"color\":return gt.parse;case\"padding\":return Ae.parse;case\"numberArray\":return Se.parse;case\"colorArray\":return se.parse;default:return null}}function ym(t){switch(t){case\"exponential\":return Df;case\"interval\":return gm;case\"categorical\":return mm;case\"identity\":return xm;default:throw Error(`Unknown function type \"${t}\"`)}}function wf(t,e){let r=t.stops&&typeof t.stops[0][0]==\"object\",i=r||t.property!==void 0,n=r||!i,a=t.type||(Tl(e)?\"exponential\":\"interval\"),s=dm(e);if(s&&(t=tn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!o0(t.colorSpace))throw Error(`Unknown color space: \"${t.colorSpace}\"`);let o=ym(a),l,u;if(a===\"categorical\"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;d<t.stops.length;d++){let y=t.stops[d],m=y[0].zoom;h[m]===void 0&&(h[m]={zoom:m,type:t.type,property:t.property,default:t.default,stops:[]},c.push(m)),h[m].stops.push([y[0].value,y[1]])}let p=[];for(let d of c)p.push([h[d].zoom,wf(h[d],e)]);let f={name:\"linear\"};return{kind:\"composite\",interpolationType:f,interpolationFactor:be.interpolationFactor.bind(void 0,f),zoomStops:p.map(d=>d[0]),evaluate({zoom:d},y){return Df({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a===\"exponential\"?{name:\"exponential\",base:t.base===void 0?1:t.base}:null;return{kind:\"camera\",interpolationType:h,interpolationFactor:be.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:\"source\",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?yn(t.default,e.default):o(t,e,p,l,u)}}}function yn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function mm(t,e,r,i,n){return yn(typeof r===n?i[r]:void 0,t.default,e.default)}function gm(t,e,r){if(K(r)!==\"number\")return yn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Ma(t.stops.map(a=>a[0]),r,\"\");return t.stops[n][1]}function Df(t,e,r){let i=t.base===void 0?1:t.base;if(K(r)!==\"number\")return yn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Ma(t.stops.map(h=>h[0]),r,\"\"),s=vm(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=yr[e.type]||fm;return typeof o.evaluate==\"function\"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function xm(t,e,r){switch(e.type){case\"color\":r=gt.parse(r);break;case\"formatted\":r=Be.fromString(r.toString());break;case\"resolvedImage\":r=_e.fromString(r.toString());break;case\"padding\":r=Ae.parse(r);break;case\"colorArray\":r=se.parse(r);break;case\"numberArray\":r=Se.parse(r);break;default:K(r)!==e.type&&(e.type!==\"enum\"||!e.values[r])&&(r=void 0)}return yn(r,t.default,e.default)}function vm(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function so(t){return{result:\"success\",value:t}}function Rr(t){return{result:\"error\",value:t}}var Il=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new $p,this._defaultValue=r?Tf(r):null,this._enumValues=r&&r.type===\"enum\"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ri(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ri(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s==\"number\"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ct(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(\", \")}, but found ${JSON.stringify(s)} instead.`,\"\");return s}catch(s){let o=s instanceof ct?s.path:\"\",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<\"u\"&&console.warn(_f(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function _f(t,e,r,i){return`${t}${e}: ${r}${i==null?\"\":` Falling back to ${String(i)}.`}`}function Af(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. \"layers[3].paint.line-width\".')}function Oa(t){return Array.isArray(t)&&t.length>0&&typeof t[0]==\"string\"&&t[0]in Gr}function tr(t,e,r,i){Af(e);let n=new xf(Gr,da,[],r?Dm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return a?so(new Il(a,e,r,i)):Rr(n.errors)}var en=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!==\"constant\"&&!Qi(e.expression),this.globalStateRefs=mn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ri(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ri(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},ya=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!==\"camera\"&&!Qi(e.expression),this.globalStateRefs=mn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ri(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ri(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?be.interpolationFactor(this.interpolationType,t,e,r):0}};function bm(t){return t._styleExpression!==void 0}function Sf(t,e,r,i){let n=tr(t,e,r,i);if(n.result===\"error\")return n;let a=n.value.expression,s=za(a);if(!s&&!ei(r))return Rr([new ge(\"\",\"data expressions not supported\")]);let o=La(a,[\"zoom\"]);if(!o&&!bf(r))return Rr([new ge(\"\",\"zoom expressions not supported\")]);let l=sa(a);if(!l&&!o)return Rr([new ge(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);if(l instanceof ge)return Rr([l]);if(l instanceof be&&!Tl(r))return Rr([new ge(\"\",'\"interpolate\" expressions cannot be used with this property')]);if(!l)return so(s?new en(\"constant\",n.value,i):new en(\"source\",n.value,i));
1646let u=l instanceof be?l.interpolation:void 0;return so(s?new ya(\"camera\",n.value,l.labels,u,i):new ya(\"composite\",n.value,l.labels,u,i))}var Ef=class Ff{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Af(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=Tf(i),this._warningHistory={};let n=wf(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<\"u\"&&console.warn(_f(this._rootKey,\"\",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new Ff(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function wm(t,e,r,i){if(Va(t))return new Ef(t,e,r);if(Oa(t)){let n=Sf(t,e,r,i);if(n.result===\"error\")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(\", \"));return n.value}{let n=t;return r.type===\"color\"&&typeof t==\"string\"?n=gt.parse(t):r.type===\"padding\"&&(typeof t==\"number\"||Array.isArray(t))?n=Ae.parse(t):r.type===\"numberArray\"&&(typeof t==\"number\"||Array.isArray(t))?n=Se.parse(t):r.type===\"colorArray\"&&(typeof t==\"string\"||Array.isArray(t))?n=se.parse(t):r.type===\"variableAnchorOffsetCollection\"&&Array.isArray(t)?n=De.parse(t):r.type===\"projectionDefinition\"&&typeof t==\"string\"&&(n=br.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:\"constant\",evaluate:()=>n}}}function sa(t){let e=null;if(t instanceof Xp)e=sa(t.result);else if(t instanceof ef){for(let r of t.args)if(e=sa(r),e)break}else(t instanceof vl||t instanceof be)&&t.input instanceof wr&&t.input.name===\"zoom\"&&(e=t);return e instanceof ge||t.eachChild(r=>{let i=sa(r);i instanceof ge?e=i:!e&&i?e=new ge(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):e&&i&&e!==i&&(e=new ge(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),e}function mn(t,e=new Set){return t instanceof Fl&&e.add(t.key),t.eachChild(r=>{mn(r,e)}),e}function Dm(t){let e={color:ue,string:Y,number:k,enum:Y,boolean:Q,formatted:pn,padding:ka,numberArray:Ia,colorArray:Hi,projectionDefinition:Fa,resolvedImage:fn,variableAnchorOffsetCollection:Ca};return t.type===\"array\"?Nt(e[t.value]||Z,t.length):e[t.type]}function Tf(t){if(t.type===\"color\"&&Va(t.default))return new gt(0,0,0,0);switch(t.type){case\"color\":return gt.parse(t.default)||null;case\"padding\":return Ae.parse(t.default)||null;case\"numberArray\":return Se.parse(t.default)||null;case\"colorArray\":return se.parse(t.default)||null;case\"variableAnchorOffsetCollection\":return De.parse(t.default)||null;case\"projectionDefinition\":return br.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ri(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function _m(t){let e=!1;for(let r of t){let i=kf(r);if(i===\"expression\")return\"expression\";i===\"legacy\"&&(e=!0)}return e?\"legacy\":\"neutral\"}function kf(t){if(typeof t==\"boolean\")return\"neutral\";if(!Array.isArray(t)||t.length===0)return\"legacy\";switch(t[0]){case\"has\":return t.length<2||t[1]===\"$id\"||t[1]===\"$type\"?\"legacy\":t.length===2?\"neutral\":\"expression\";case\"in\":return t.length>=3&&(typeof t[1]!=\"string\"||Array.isArray(t[2]))?\"expression\":\"legacy\";case\"!in\":case\"!has\":return\"legacy\";case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?\"expression\":\"legacy\";case\"none\":return\"legacy\";case\"any\":case\"all\":return _m(t.slice(1));default:return\"expression\"}}function Cl(t){return kf(t)!==\"legacy\"}function Fh(t){return t===\"$type\"?[\"geometry-type\"]:t===\"$id\"?[\"id\"]:[\"get\",t]}function Am(t){switch(t[0]){case\"==\":case\"!=\":case\"<\":case\"<=\":case\">\":case\">=\":return t.length!==3||typeof t[1]!=\"string\"?null:[t[0],Fh(t[1]),t[2]];case\"in\":case\"!in\":{if(t.length<2||typeof t[1]!=\"string\")return null;let e=[\"in\",Fh(t[1]),[\"literal\",t.slice(2)]];return t[0]===\"!in\"?[\"!\",e]:e}case\"has\":case\"!has\":{if(t.length!==2||typeof t[1]!=\"string\"||t[1]===\"$type\"||t[1]===\"$id\")return null;let e=[\"has\",t[1]];return t[0]===\"!has\"?[\"!\",e]:e}default:return null}}function If(t){if((t[0]===\"<\"||t[0]===\"<=\"||t[0]===\">\"||t[0]===\">=\")&&t[1]===\"$type\")return`\"$type\" cannot be use with operator \"${t[0]}\"`;let e=Am(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Bs(t,e,r){let i=r[t];return Array.isArray(i)?Cl(i)?Ml(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ml(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case\"all\":case\"any\":case\"none\":for(let r=1;r<t.length;r++){let i=Bs(r,e,t);if(i)return i}break;case\"!\":{let r=Bs(1,e,t);if(r)return r;break}case\"case\":for(let r=1;r<t.length-1;r+=2){let i=Bs(r,e,t);if(i)return i}}return null}function Sm(t,e){let r=Ml(t);if(!r||typeof console>\"u\")return;let i=r.path.map(n=>`[${n}]`).join(\"\");console.warn(`${e}${i}: ${If(r.legacyFilter)}`)}var Em={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function ii(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Cl(t)?Sm(t,e):t=ma(t);let i=tr(t,e,Em,r);if(i.result===\"error\")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(\", \"));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:Cf(t),getGlobalStateRefs:()=>mn(i.value.expression)}}function Fm(t,e){return t<e?-1:+(t>e)}function Cf(t){if(!Array.isArray(t))return!1;if(t[0]===\"within\"||t[0]===\"distance\")return!0;for(let e=1;e<t.length;e++)if(Cf(t[e]))return!0;return!1}function ma(t){if(!t)return!0;let e=t[0];return t.length<=1?e!==\"any\":e===\"==\"?Ps(t[1],t[2],\"==\"):e===\"!=\"?Un(Ps(t[1],t[2],\"==\")):e===\"<\"||e===\">\"||e===\"<=\"||e===\">=\"?Ps(t[1],t[2],e):e===\"any\"?Tm(t.slice(1)):e===\"all\"?[\"all\"].concat(t.slice(1).map(ma)):e===\"none\"?[\"all\"].concat(t.slice(1).map(ma).map(Un)):e===\"in\"?Th(t[1],t.slice(2)):e===\"!in\"?Un(Th(t[1],t.slice(2))):e===\"has\"?kh(t[1]):e!==\"!has\"||Un(kh(t[1]))}function Ps(t,e,r){switch(t){case\"$type\":return[`filter-type-${r}`,e];case\"$id\":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Tm(t){return[\"any\"].concat(t.map(ma))}function Th(t,e){if(e.length===0)return!1;switch(t){case\"$type\":return[\"filter-type-in\",[\"literal\",e]];case\"$id\":return[\"filter-id-in\",[\"literal\",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?[\"filter-in-large\",t,[\"literal\",e.sort(Fm)]]:[\"filter-in-small\",t,[\"literal\",e]]}}function kh(t){switch(t){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",t]}}function Un(t){return[\"!\",t]}function Mf(t){let e=t.key,r=t.value;return r?[new T(e,r,\"constants have been deprecated as of v8\")]:[]}function Dt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function mr(t){if(Array.isArray(t))return t.map(mr);
1646if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=mr(t[r]);return e}return Dt(t)}function Jt(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=K(r);if(u!==\"object\")return[new T(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(\".\")[0],p=Ni(i,c)||i[\"*\"],f;if(Ni(n,c))f=n[c];else if(Ni(i,c)){if(r[h]===void 0)continue;f=o}else if(n[\"*\"])f=n[\"*\"];else if(i[\"*\"])f=o;else{l.push(new T(e,r[h],`unknown property \"${h}\"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new T(e,r,`missing required property \"${h}\"`));return l}function Bl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(K(e)!==\"array\")return[new T(s,e,`array expected, ${K(e)} found`)];if(r.length&&e.length!==r.length)return[new T(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),K(r.value)===\"object\"&&(l=r.value);let u=[];for(let h=0;h<e.length;h++)u=u.concat(o({array:e,arrayIndex:h,value:e[h],valueSpec:l,validateSpec:t.validateSpec,style:n,styleSpec:a,key:`${s}[${h}]`}));return u}function Ra(t){let e=t.key,r=t.value,i=t.valueSpec,n=K(r);return n===\"number\"&&r!==r&&(n=\"NaN\"),n===\"number\"?\"minimum\"in i&&r<i.minimum?[new T(e,r,`${r} is less than the minimum value ${i.minimum}`)]:\"maximum\"in i&&r>i.maximum?[new T(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new T(e,r,`number expected, ${n} found`)]}function Bf(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!==\"categorical\"&&t.value.property===void 0,l=!o,u=K(t.value.stops)===\"array\"&&K(t.value.stops[0])===\"array\"&&K(t.value.stops[0][0])===\"object\",h=Jt({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r===\"identity\"&&o&&h.push(new T(t.key,t.value,'missing required property \"property\"')),r!==\"identity\"&&!t.value.stops&&h.push(new T(t.key,t.value,'missing required property \"stops\"')),r===\"exponential\"&&t.valueSpec.expression&&!Tl(t.valueSpec)&&h.push(new T(t.key,t.value,\"exponential functions not supported\")),t.styleSpec.$version>=8&&(l&&!ei(t.valueSpec)?h.push(new T(t.key,t.value,\"property functions not supported\")):o&&!bf(t.valueSpec)&&h.push(new T(t.key,t.value,\"zoom functions not supported\"))),(r===\"categorical\"||u)&&t.value.property===void 0&&h.push(new T(t.key,t.value,'\"property\" property is required')),h;function c(y){if(r===\"identity\")return[new T(y.key,y.value,'identity function may not have a \"stops\" property')];let m=[],g=y.value;return m=m.concat(Bl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),K(g)===\"array\"&&g.length===0&&m.push(new T(y.key,g,\"array must have at least one stop\")),m}function p(y){let m=[],g=y.value,x=y.key;if(K(g)!==\"array\")return[new T(x,g,`array expected, ${K(g)} found`)];if(g.length!==2)return[new T(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(K(g[0])!==\"object\")return[new T(x,g,`object expected, ${K(g[0])} found`)];if(g[0].zoom===void 0)return[new T(x,g,\"object stop key must have zoom\")];if(g[0].value===void 0)return[new T(x,g,\"object stop key must have value\")];if(s&&s>Dt(g[0].zoom))return[new T(x,g[0].zoom,\"stop zoom values must appear in ascending order\")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(Jt({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ra,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return Oa(mr(g[1]))?m.concat([new T(`${x}[1]`,g[1],\"expressions are not allowed in function stops.\")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=K(y.value),x=Dt(y.value),b=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new T(y.key,b,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!==\"number\"&&g!==\"string\"&&g!==\"boolean\")return[new T(y.key,b,\"stop domain value must be a number, string, or boolean\")];if(g!==\"number\"&&r!==\"categorical\"){let v=`number expected, ${g} found`;return ei(e)&&r===void 0&&(v+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new T(y.key,b,v)]}return r===\"categorical\"&&g===\"number\"&&(!isFinite(x)||Math.floor(x)!==x)?[new T(y.key,b,`integer expected, found ${x}`)]:r!==\"categorical\"&&g===\"number\"&&a!==void 0&&x<a?[new T(y.key,b,\"stop domain values must appear in ascending order\")]:(a=x,r===\"categorical\"&&x in n?[new T(y.key,b,\"stop domain values must be unique\")]:(n[x]=!0,[]))}function d(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}}function ni(t){let e=(t.expressionContext===\"property\"?Sf:tr)(mr(t.value),t.key,t.valueSpec);if(e.result===\"error\")return e.value.map(i=>new T(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext===\"property\"&&t.propertyKey===\"text-font\"&&!r.outputDefined())return[new T(t.key,t.value,`Invalid data expression for \"${t.propertyKey}\". Output values must be contained as literals within the expression.`)];if(t.expressionContext===\"property\"&&t.propertyType===\"layout\"&&!Qi(r))return[new T(t.key,t.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(t.expressionContext===\"filter\"&&!Qi(r))return[new T(t.key,t.value,'\"feature-state\" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf(\"cluster\")===0){if(!La(r,[\"zoom\",\"feature-state\"]))return[new T(t.key,t.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(t.expressionContext===\"cluster-initial\"&&!za(r))return[new T(t.key,t.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function km(t){let e=t.value,r=t.key,i=K(e);return i===\"boolean\"?[]:[new T(r,e,`boolean expected, ${i} found`)]}function oo(t){let e=t.key,r=t.value,i=K(r);return i===\"string\"?gt.parse(String(r))?[]:[new T(e,r,`color expected, \"${r}\" found`)]:[new T(e,r,`color expected, ${i} found`)]}function rn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new T(e,r,`expected one of [${i.values.join(\", \")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new T(e,r,`expected one of [${Object.keys(i.values).join(\", \")}], ${JSON.stringify(r)} found`)),n}function Im(t,e){let r=t;for(let i of e)r=r[i];return r}function Cm(t,e){let r=Ml(e);return r?[new T(`${t.key}${r.path.map(i=>`[${i}]`).join(\"\")}`,Im(t.value,r.path),If(r.legacyFilter),null,\"warning\")]:[]}function Pl(t){let e=mr(t.value);return Cl(e)?[...Cm(t,e),...ni(tn({},t,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}}))]:Pf(t)}function Pf(t){let e=t.value,r=t.key;if(K(e)!==\"array\")return[new T(r,e,`array expected, ${K(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new T(r,e,\"filter array must have at least 1 element\")];switch(a=a.concat(rn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case\"<\":case\"<=\":case\">\":case\">=\":e.length>=2&&Dt(e[1])===\"$type\"&&a.push(new T(r,e,`\"$type\" cannot be use with operator \"${e[0]}\"`));case\"==\":case\"!=\":e.length!==3&&a.push(new T(r,e,`filter array for operator \"${e[0]}\" must have 3 elements`));case\"in\":case\"!in\":e.length>=2&&(n=K(e[1]),n!==\"string\"&&a.push(new T(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s<e.length;s++)n=K(e[s]),Dt(e[1])===\"$type\"?a=a.concat(rn({key:`${r}[${s}]`,value:e[s],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):n!==\"string\"&&n!==\"number\"&&n!==\"boolean\"&&a.push(new T(`${r}[${s}]`,e[s],`string, number, or boolean expected, ${n} found`));break;case\"any\":case\"all\":case\"none\":for(let s=1;s<e.length;s++)a=a.concat(Pf({key:`${r}[${s}]`,value:e[s],style:t.style,styleSpec:t.styleSpec}));break;case\"has\":case\"!has\":n=K(e[1]),e.length===2?n!==\"string\"&&a.push(new T(`${r}[1]`,e[1],`string expected, ${n} found`)):a.push(new T(r,e,`filter array for \"${e[0]}\" operator must have 2 elements`))}return a}function zf(t,e){let r=t.key,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.value,o=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];let u=o.match(kl);if(e===\"paint\"&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let h=t.valueSpec||l[o];if(!h)return[new T(r,s,`unknown property \"${o}\"`)];let c;if(K(s)===\"string\"&&ei(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new T(r,s,`\"${o}\" does not support interpolation syntax\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(c[1])} }\\`.`)];let p=[];return t.layerType===\"symbol\"&&o===\"text-font\"&&Va(mr(s))&&Dt(s.type)===\"identity\"&&p.push(new T(r,s,'\"text-font\" does not support identity functions')),p.concat(i({key:t.key,value:s,valueSpec:h,style:n,styleSpec:a,expressionContext:\"property\",propertyType:e,propertyKey:o}))}function Lf(t){return zf(t,\"paint\")}function Vf(t){return zf(t,\"layout\")}function Of(t){let e=[],r=t.value,i=t.key,n=t.style,a=t.styleSpec;if(K(r)!==\"object\")return[new T(i,r,`object expected, ${K(r)} found`)];!r.type&&!r.ref&&e.push(new T(i,r,'either \"type\" or \"ref\" is required'));let s=Dt(r.type),o=Dt(r.ref);if(r.id){let l=Dt(r.id);for(let u=0;u<t.arrayIndex;u++){let h=n.layers[u];Dt(h.id)===l&&e.push(new T(i,r.id,`duplicate layer id \"${r.id}\", previously used at line ${h.id.__line__}`))}}if(\"ref\"in r){[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(u=>{u in r&&e.push(new T(i,r[u],`\"${u}\" is prohibited for ref layers`))});let l;
1646n.layers.forEach(u=>{Dt(u.id)===o&&(l=u)}),l?l.ref?e.push(new T(i,r.ref,\"ref cannot reference another ref layer\")):s=Dt(l.type):e.push(new T(i,r.ref,`ref layer \"${o}\" not found`))}else if(s!==\"background\")if(!r.source)e.push(new T(i,r,'missing required property \"source\"'));else{let l=n.sources&&n.sources[r.source],u=l&&Dt(l.type);l?u===\"vector\"&&s===\"raster\"?e.push(new T(i,r.source,`layer \"${r.id}\" requires a raster source`)):u!==\"raster-dem\"&&s===\"hillshade\"||u!==\"raster-dem\"&&s===\"color-relief\"?e.push(new T(i,r.source,`layer \"${r.id}\" requires a raster-dem source`)):u===\"raster\"&&s!==\"raster\"?e.push(new T(i,r.source,`layer \"${r.id}\" requires a vector source`)):u===\"vector\"&&!r[\"source-layer\"]?e.push(new T(i,r,`layer \"${r.id}\" must specify a \"source-layer\"`)):u===\"raster-dem\"&&s!==\"hillshade\"&&s!==\"color-relief\"?e.push(new T(i,r.source,\"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\")):s===\"line\"&&r.paint&&r.paint[\"line-gradient\"]&&(u!==\"geojson\"||!l.lineMetrics)&&e.push(new T(i,r,`layer \"${r.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new T(i,r.source,`source \"${r.source}\" not found`))}return s===\"raster\"&&r.paint?.resampling&&r.paint?.[\"raster-resampling\"]&&e.push(new T(i,r.paint,`layer \"${r.id}\" redundantly specifies \"resampling\" and \"raster-resampling\" paint properties, but only one is allowed. It is advised to use \"resampling\".`)),e=e.concat(Jt({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{\"*\"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:\"type\"})},filter:Pl,layout(l){return Jt({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Vf(tn({layerType:s},u))}}})},paint(l){return Jt({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{\"*\"(u){return Lf(tn({layerType:s},u))}}})}}})),e}function Je(t){let e=t.value,r=t.key,i=K(e);return i===\"string\"?[]:[new T(r,e,`string expected, ${i} found`)]}function Mm(t){let e=t.sourceName??\"\",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=K(r);if(r===void 0)return s;if(o!==\"object\")return s.push(new T(\"source_raster_dem\",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)===\"custom\",u=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],h=t.value.encoding?`\"${t.value.encoding}\"`:\"Default\";for(let c in r)!l&&u.includes(c)?s.push(new T(c,r[c],`In \"${e}\": \"${c}\" is only valid when \"encoding\" is set to \"custom\". ${h} encoding found`)):n[c]?s=s.concat(t.validateSpec({key:c,value:r[c],valueSpec:n[c],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new T(c,r[c],`unknown property \"${c}\"`));return s}var Ih={promoteId:Bm};function Rf(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new T(r,e,'\"type\" is required')];let s=Dt(e.type),o;switch(s){case\"vector\":case\"raster\":return o=Jt({key:r,value:e,valueSpec:i[`source_${s.replace(\"-\",\"_\")}`],style:t.style,styleSpec:i,objectElementValidators:Ih,validateSpec:a}),o;case\"raster-dem\":return o=Mm({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case\"geojson\":if(o=Jt({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ih}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u;o.push(...ni({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:\"cluster-map\"})),o.push(...ni({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:\"cluster-reduce\"}))}return o;case\"video\":return Jt({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case\"image\":return Jt({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case\"canvas\":return[new T(r,null,\"Please use runtime APIs to add canvas sources, rather than
1646including them in stylesheets.\",\"source.canvas\")];default:return rn({key:`${r}.type`,value:e.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:n,validateSpec:a,styleSpec:i})}}function Bm({key:t,value:e}){if(K(e)===\"string\")return Je({key:t,value:e});{let r=[];for(let i in e)r.push(...Je({key:`${t}.${i}`,value:e[i]}));return r}}function $f(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new T(\"light\",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(kl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(o,e[o],`unknown property \"${o}\"`)])}return a}function Nf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new T(\"sky\",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(kl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new T(o,e[o],`unknown property \"${o}\"`)])}return s}function Uf(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=K(e);if(e===void 0)return a;if(s!==\"object\")return a=a.concat([new T(\"terrain\",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new T(o,e[o],`unknown property \"${o}\"`)]);return a}function Pm(t){return Je(t).length===0?[]:ni(t)}function zm(t){return Je(t).length===0?[]:ni(t)}function Lm(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1||r.length>4)return[new T(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:\"number\"},n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return Ra({key:e,value:r,valueSpec:{}})}function Vm(t){let e=t.key,r=t.value;if(K(r)===\"array\"){let i={type:\"number\"};if(r.length<1)return[new T(e,r,\"array length at least 1 expected, length 0 found\")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return n}return Ra({key:e,value:r,valueSpec:{}})}function Om(t){let e=t.key,r=t.value;if(K(r)===\"array\"){if(r.length<1)return[new T(e,r,\"array length at least 1 expected, length 0 found\")];let i=[];for(let n=0;n<r.length;n++)i=i.concat(oo({key:`${e}[${n}]`,value:r[n],valueSpec:{}}));return i}return oo({key:e,value:r,valueSpec:{}})}function Rm(t){let e=t.key,r=t.value,i=K(r),n=t.styleSpec;if(i!==\"array\"||r.length<1||r.length%2!=0)return[new T(e,r,\"variableAnchorOffsetCollection requires a non-empty array of even length\")];let a=[];for(let s=0;s<r.length;s+=2)a=a.concat(rn({key:`${e}[${s}]`,value:r[s],valueSpec:n.layout_symbol[\"text-anchor\"]})),a=a.concat(Bl({key:`${e}[${s+1}]`,value:r[s+1],valueSpec:{length:2,value:\"number\"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return a}function qf(t){let e=[],r=t.value,i=t.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&e.push(new T(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&e.push(new T(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),e=e.concat(Jt({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:\"string\",required:!0},url:{type:\"string\",required:!0}},validateSpec:t.validateSpec}));return e}return Je({key:i,value:r})}function $m(t){let e=t.value,r=t.styleSpec,i=r.projection,n=t.style,a=K(e);if(e===void 0)return[];if(a!==\"object\")return[new T(\"projection\",e,`object expected, ${a} found`)];let s=[];for(let o in e)s=i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r}
1646)):s.concat([new T(o,e[o],`unknown property \"${o}\"`)]);return s}function Nm(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let i=K(r);return i===\"array\"&&!qm(r)&&!Um(r)?[new T(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:[\"array\",\"string\"].includes(i)?[]:[new T(e,r,`projection expected, invalid type \"${i}\" found`)]}function Um(t){return!![\"interpolate\",\"step\",\"literal\"].includes(t[0])}function qm(t){return Array.isArray(t)&&t.length===3&&typeof t[0]==\"string\"&&typeof t[1]==\"string\"&&typeof t[2]==\"number\"}function lo(t){return!!t&&t.constructor===Object}function jf(t){return lo(t.value)?[]:[new T(t.key,t.value,`object expected, ${K(t.value)} found`)]}var Ch=1114111,jm=/^u\\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\\?{1,6}))$/i;function Gm(t,e){if(K(e)!==\"string\")return[];let r=`${e}`,i=()=>[new T(t,e,'invalid unicode range, expected a value such as \"U+26\", \"U+0-10FFFF\" or \"U+4??\"')],n=r.match(jm);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Ch||u>Ch?[new T(t,e,\"unicode range is out of bounds, the maximum code point is U+10FFFF\")]:l>u?[new T(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Gf(t){let e=t.key??\"font-faces\",r=t.value,i=t.validateSpec,n=t.styleSpec??Tp,a=t.style;if(!lo(r))return[new T(e,r,`object expected, ${K(r)} found`)];let s=[];for(let o in r){let l=r[o],u=K(l);if(u===\"string\")s.push(...Je({key:`${e}.${o}`,value:l}));else if(u===\"array\"){let h={url:{type:\"string\",required:!0},\"unicode-range\":{type:\"array\",value:\"string\"}};for(let[c,p]of l.entries()){let f=`${e}.${o}[${c}]`;s.push(...Jt({key:f,value:p,valueSpec:h,styleSpec:n,style:a,validateSpec:i}));let d=lo(p)?p[\"unicode-range\"]:void 0;if(K(d)===\"array\")for(let[y,m]of d.entries())s.push(...Gm(`${f}.unicode-range[${y}]`,m))}}else s.push(new T(`${e}.${o}`,l,`string or array expected, ${u} found`))}return s}var Mh={\"*\"(){return[]}
vendor: 5,397 bytes, line 1646
1646,array:Bl,boolean:km,number:Ra,color:oo,constants:Mf,enum:rn,filter:Pl,function:Bf,layer:Of,object:Jt,source:Rf,light:$f,sky:Nf,terrain:Uf,projection:$m,projectionDefinition:Nm,string:Je,formatted:Pm,resolvedImage:zm,padding:Lm,numberArray:Vm,colorArray:Om,variableAnchorOffsetCollection:Rm,sprite:qf,state:jf,fontFaces:Gf};function qi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=qi,r.expression&&Va(Dt(e))?Bf(t):r.expression&&Oa(mr(e))?ni(t):r.type&&Mh[r.type]?Mh[r.type](t):Jt(tn({},t,{valueSpec:r.type?i[r.type]:r}))}function Yf(t){let e=t.value,r=t.key,i=Je(t);return i.length||(e.indexOf(\"{fontstack}\")===-1&&i.push(new T(r,e,'\"glyphs\" url must include a \"{fontstack}\" token')),e.indexOf(\"{range}\")===-1&&i.push(new T(r,e,'\"glyphs\" url must include a \"{range}\" token'))),i}function Kt(t,e=D){let r=[];return r=r.concat(qi({key:\"\",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:qi,objectElementValidators:{glyphs:Yf,\"*\"(){return[]}}})),t.constants&&(r=r.concat(Mf({key:\"constants\",value:t.constants,style:t,styleSpec:e,validateSpec:qi}))),Xf(r)}Kt.source=re(ee(Rf)),Kt.sprite=re(ee(qf)),Kt.glyphs=re(ee(Yf)),Kt.fontFaces=re(ee(Gf)),Kt.light=re(ee($f)),Kt.sky=re(ee(Nf)),Kt.terrain=re(ee(Uf)),Kt.state=re(ee(jf)),Kt.layer=re(ee(Of)),Kt.filter=re(ee(Pl)),Kt.paintProperty=re(ee(Lf)),Kt.layoutProperty=re(ee(Vf));function ee(t){return function(e){return t(Object.assign({},e,{validateSpec:qi}))}}function Xf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function re(t){return function(...e){return Xf(t.apply(this,e))}}var Ym={type:\"enum\",\"property-type\":\"data-constant\",expression:{interpolated:!1,parameters:[\"global-state\"]},values:{visible:{},none:{}},transition:!1,default:\"visible\"},Xm=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(t){if(t==null||t===\"visible\"||t===\"none\"){this._literalValue=t===\"none\"?\"none\":\"visible\",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=tr(t,this._rootKey,Ym,this._globalState);if(e.result===\"error\")throw this._literalValue=\"visible\",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(\", \"));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=mn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Wm(t,e,r){return new Xm(t,e,r)}var Bh=Kt,c5=new Set(Object.keys(D).filter(t=>t.startsWith(\"source_\")).map(t=>t.slice(7).replaceAll(\"_\",\"-\")));function Zm(t,e){let r=!1;for(let i of e){if(i.severity===\"warning\"){Mt(i.message);continue}t.fire(new ha(Error(i.message))),r=!0}return r}function Hm(t,e,r,i){return i?.validate!==!1&&Zm(t,e({styleSpec:D,...r}))}var uo=class Wf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let h=s[3+u],c=s[3+u+1];n.push(h===c?null:s.subarray(h,c))}let o=s[3+n.length],l=s[3+n.length+1];this.keys=s.subarray(o,l),this.bboxes=s.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let s=0;s<this.d*this.d;s++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;let a=i/r*e;this.min=-a,this.max=e+a}insert(e,r,i,n,a){this._forEachCell(r,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw Error(\"Cannot insert into a GridIndex created from an ArrayBuffer.\")}_insertCell(e,r,i,n,a,s){this.cells[a].push(s)}query(e,r,i,n,a){let s=this.min,o=this.max;if(e<=s&&r<=s&&o<=i&&o<=n&&!a)return[...this.keys];{let l=[];return this._forEachCell(e,r,i,n,this._queryCell,l,{},a),l}}_queryCell(e,r,i,n,a,s,o,l){let u=this.cells[a];if(u!==null){let h=this.keys,c=this.bboxes;for(let p of u)if(o[p]===void 0){let f=p*4;(l?l(c[f+0],c[f+1],c[f+2],c[f+3]):e<=c[f+2]&&r<=c[f+3]&&i>=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))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;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;s<e.length;s++){let o=e[s];n[3+s]=a,n.set(o,a),a+=o.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(e,r){let i=e.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(e){return new Wf(e.buffer)}},Ce={};function I(t,e,r={}){if(Ce[t])throw Error(`${t} is already registered.`);Object.defineProperty(e,\"_classRegistryKey\",{value:t,writeable:!1}
1646),Ce[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}I(\"Object\",Object),I(\"Set\",Set),I(\"TransferableGridIndex\",uo),I(\"Color\",gt),I(\"Error\",Error),I(\"AJAXError\",ua),I(\"ResolvedImage\",_e),I(\"StylePropertyFunction\",Ef),I(\"StyleExpression\",Il,{omit:[\"_evaluator\"]}),I(\"ZoomDependentExpression\",ya),I(\"ZoomConstantExpression\",en),I(\"CompoundExpression\",wr,{omit:[\"_evaluate\"]});for(let t in Gr)Gr[t]._classRegistryKey||I(`Expression_${t}`,Gr[t]);function Zf(t){return t&&typeof ArrayBuffer<\"u\"&&(t instanceof ArrayBuffer||t.constructor?.name===\"ArrayBuffer\")}function zl(t){let e=t.constructor;return t.$name||e._classRegistryKey}function Km(t){if(typeof t!=\"object\"||!t)return!1;let e=zl(t);return e&&e!==\"Object\"}function Hf(t){return!Km(t)&&(t==null||typeof t==\"boolean\"||typeof t==\"number\"||typeof t==\"string\"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Zf(t)||Sa(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function ji(t,e){if(Hf(t))return(Zf(t)||Sa(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let a=[];for(let s of t)a.push(ji(s,e));return a}if(typeof t!=\"object\")throw Error(`can't serialize object of type ${typeof t}`);let r=zl(t);if(!r)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Ce[r])throw Error(`${r} is not registered.`);let{klass:i}=Ce[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(n===e?.[e.length-1])throw Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let a in t){if(!t.hasOwnProperty(a)||Ce[r].omit.includes(a))continue;let s=t[a];s!==void 0&&(n[a]=Ce[r].shallow.includes(a)?s:ji(s,e))}t instanceof Error&&(n.message=t.message)}if(n.$name)throw Error(\"$name property is reserved for worker serialization logic.\");return r!==\"Object\"&&(n.$name=r),n}function Gi(t){if(Hf(t))return t;if(Array.isArray(t))return t.map(Gi);if(typeof t!=\"object\")throw Error(`can't deserialize object of type ${typeof t}`);let e=zl(t)||\"Object\";if(!Ce[e])throw Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Ce[e];
1646if(!r)throw Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n===\"$name\")continue;let a=t[n];i[n]=Ce[e].shallow.includes(n)?a:Gi(a)}return i}var Ph=class{constructor(){this.first=!0}update(t,e){let r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}},at=class{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new Ph,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ph,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},$a=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=wm(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},ho=class{constructor(t,e,r){this.property=t,this.value=new $a(t,void 0,e,r)}transitioned(t,e){return e.value===this.value?e:new zh(this.property,this.value,e,qt({},t.transition,this.transition),t.now)}untransitioned(){return new zh(this.property,this.value,null,{},0)}},Jm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return Xe(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new $a(this._values[t].property,e===null?void 0:Xe(e),this._propertyRootKey(t),this._globalState)}setValues(t){for(let e in t){let r=t[e];e.endsWith(\"-transition\")?this.setTransition(e.slice(0,-11),r):Hs(this._values[e].value.value,r)||this.setValue(e,r)}}getTransition(t){return Xe(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=Xe(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}-transition`]=i)}return t}transitioned(t,e){let r=new Lh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Lh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},zh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(t,e,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),n,V1(s))}}},Lh=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,r){let i=new Na(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Qm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return this._values[t].value!==void 0}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return Xe(this._values[t].value)}setValue(t,e){this._values[t]=new $a(this._values[t].property,e===null?void 0:Xe(e),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r)}return t}possiblyEvaluate(t,e,r){let i=new Na(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(t,e,r);return i}},ae=class{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r}isConstant(){return this.value.kind===\"constant\"}constantOr(t){return this.value.kind===\"constant\"?this.value.value:t}evaluate(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)}},Na=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}};function Vh(t){if(Array.isArray(t))return t.length;let e=t?.values;return Array.isArray(e)?e.length:void 0}
1646function Kf(t,e){let r=Vh(t),i=Vh(e);return r!==void 0&&i!==void 0&&r!==i}var L=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e){if(t.isDataDriven())throw Error(\"Value should not be data driven\");return t.expression.evaluate(e)}interpolate(t,e,r){if(Kf(t,e))return Mt(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=yr[i];return n?n(t,e,r):t}},U=class{constructor(t,e,r){this.specification=t,this.name=e,this.overrides=r}possiblyEvaluate(t,e,r,i){return t.expression.kind===\"constant\"||t.expression.kind===\"camera\"?new ae(this,{kind:\"constant\",value:t.expression.evaluate(e,null,{},r,i)},e):new ae(this,t.expression,e)}interpolate(t,e,r){if(t.value.kind!==\"constant\"||e.value.kind!==\"constant\")return t;if(t.value.value===void 0||e.value.value===void 0)return new ae(this,{kind:\"constant\",value:void 0},t.parameters);if(Kf(t.value.value,e.value.value))return Mt(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),e;let i=this.specification.type,n=yr[i];if(n){let a=n(t.value.value,e.value.value,r);return new ae(this,{kind:\"constant\",value:a},t.parameters)}return t}evaluate(t,e,r,i,n,a){return t.kind===\"constant\"?t.value:t.evaluate(e,r,i,n,a)}},nn=class extends U{possiblyEvaluate(t,e,r,i){if(t.value===void 0)return new ae(this,{kind:\"constant\",value:void 0},e);if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i),a=t.property.specification.type===\"resolvedImage\"&&typeof n!=\"string\"?n.name:n,s=this._calculate(a,a,a,e);return new ae(this,{kind:\"constant\",value:s},e)}if(t.expression.kind===\"camera\"){let n=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ae(this,{kind:\"constant\",value:n},e)}return new ae(this,t.expression,e)}evaluate(t,e,r,i,n,a){if(t.kind===\"source\"){let s=t.evaluate(e,r,i,n,a);return this._calculate(s,s,s,e)}return t.kind===\"composite\"?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Jf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind===\"constant\"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new at(Math.floor(e.zoom-1),e)),t.expression.evaluate(new at(Math.floor(e.zoom),e)),t.expression.evaluate(new at(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Ua=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},jt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new $a(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new ho(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};I(\"DataDrivenProperty\",U),I(\"DataConstantProperty\",L),I(\"CrossFadedDataDrivenProperty\",nn),I(\"CrossFadedProperty\",Jf),I(\"ColorRampProperty\",Ua);var Oh=\" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?\",zs=\" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?\",pe=class extends H1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Wm(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!==\"custom\"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!==\"background\"&&(this.source=t.source,this.sourceLayer=t[\"source-layer\"],this.filter=t.filter,this._featureFilter=ii(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Qm(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Jm(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Na(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ii(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){if(t===\"visibility\")return this.visibility;if(this._transitionablePaint?.hasProperty(t))throw Error(t+Oh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property \"${t}\" on layer type \"${this.type}\" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){let t=new globalThis.Map;if(this._transitionablePaint)for(let e in this._transitionablePaint._values){let r=this._transitionablePaint._values[e].value;for(let i of r.getGlobalStateRefs()){let n=t.get(i)??[];n.push({name:e,value:r.value}),t.set(i,n)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){if(t===\"visibility\"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if(this._transitionablePaint?.hasProperty(t)){this.fire(new ha(Error(t+Oh)));return}
1646e!=null&&this._validate(Bh.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){if(t.endsWith(\"-transition\")){let e=t.slice(0,-11);if(e===\"visibility\"||this._unevaluatedLayout?.hasProperty(e))throw Error(t+zs);return this._transitionablePaint.getTransition(e)}if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))throw Error(t+zs);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(t===\"visibility\"||this._unevaluatedLayout?.hasProperty(t))return this.fire(new ha(Error(t+zs))),!1;if(e!=null&&this._validate(Bh.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith(\"-transition\"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let i=this._transitionablePaint._values[t],n=i.property.specification[\"property-type\"]===\"cross-faded-data-driven\",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility===\"none\"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}
1646serialize(){let t={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?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),N1(t,(e,r)=>e!==void 0&&!(r===\"layout\"&&!Object.keys(e).length)&&!(r===\"paint\"&&!Object.keys(e).length))}_validate(t,e,r,i,n={}){return Hm(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof ae&&ei(e.property.specification)&&(e.value.kind===\"source\"||e.value.kind===\"composite\")&&e.value.isStateDependent)return!0}return!1}},Rh,tg=()=>Rh||(Rh=new jt({\"raster-opacity\":new L(D.paint_raster[\"raster-opacity\"],\"raster-opacity\"),\"raster-hue-rotate\":new L(D.paint_raster[\"raster-hue-rotate\"],\"raster-hue-rotate\"),\"raster-brightness-min\":new L(D.paint_raster[\"raster-brightness-min\"],\"raster-brightness-min\"),\"raster-brightness-max\":new L(D.paint_raster[\"raster-brightness-max\"],\"raster-brightness-max\"),\"raster-saturation\":new L(D.paint_raster[\"raster-saturation\"],\"raster-saturation\"),\"raster-contrast\":new L(D.paint_raster[\"raster-contrast\"],\"raster-contrast\"),resampling:new L(D.paint_raster.resampling,\"resampling\"),\"raster-resampling\":new L(D.paint_raster[\"raster-resampling\"],\"raster-resampling\"),\"raster-fade-duration\":new L(D.paint_raster[\"raster-fade-duration\"],\"raster-fade-duration\")})),eg={get paint(){return tg()}};var rg=class extends pe{constructor(t,e){super(t,eg,e)}},ig={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},gn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},xt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function St(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=ng(n.type),s=r=$h(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:$h(r,Math.max(i,e)),alignment:e}}function ng(t){return ig[t].BYTES_PER_ELEMENT}function $h(t,e){return Math.ceil(t/e)*e}var an=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};an.prototype.bytesPerElement=4,I(\"StructArrayLayout2i4\",an);var co=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};co.prototype.bytesPerElement=6,I(\"StructArrayLayout3i6\",co);var Nh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Nh.prototype.bytesPerElement=8,I(\"StructArrayLayout4i8\",Nh);var po=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};po.prototype.bytesPerElement=12,I(\"StructArrayLayout2i4i12\",po);var fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};fo.prototype.bytesPerElement=8,I(\"StructArrayLayout2i4ub8\",fo);var sn=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};sn.prototype.bytesPerElement=8,I(\"StructArrayLayout2f8\",sn);var yo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};yo.prototype.bytesPerElement=20,I(\"StructArrayLayout10ui20\",yo);var mo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};mo.prototype.bytesPerElement=16,I(\"StructArrayLayout8ui16\",mo);var go=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};go.prototype.bytesPerElement=28,I(\"StructArrayLayout4i4ui4i1f28\",go);var xo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};xo.prototype.bytesPerElement=12,I(\"StructArrayLayout3f12\",xo);var vo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};vo.prototype.bytesPerElement=4,I(\"StructArrayLayout1ul4\",vo);var bo=class extends xt{_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(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};bo.prototype.bytesPerElement=20,I(\"StructArrayLayout6i1ul2ui20\",bo);var wo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};wo.prototype.bytesPerElement=12,I(\"StructArrayLayout2i2i2i12\",wo);var Uh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Uh.prototype.bytesPerElement=16,I(\"StructArrayLayout2f1f2i16\",Uh);var Do=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Do.prototype.bytesPerElement=16,I(\"StructArrayLayout2ub2f2i16\",Do);var _o=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};_o.prototype.bytesPerElement=6,I(\"StructArrayLayout3ui6\",_o);var Ao=class extends xt{_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(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let b=t*26,v=t*13,w=t*52;return this.int16[b+0]=e,this.int16[b+1]=r,this.uint16[b+2]=i,this.uint16[b+3]=n,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[b+10]=l,this.uint16[b+11]=u,this.uint16[b+12]=h,this.float32[v+7]=c,this.float32[v+8]=p,this.uint8[w+36]=f,this.uint8[w+37]=d,this.uint8[w+38]=y,this.uint32[v+10]=m,this.int16[b+22]=g,this.float32[v+12]=x,t}};Ao.prototype.bytesPerElement=52,I(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52\",Ao);var So=class extends xt{_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(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,b,v,w,_,A,S,F,V,O,P){let R=this.length;return this.resize(R+1),this.emplace(R,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,b,v,w,_,A,S,F,V,O,P)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,b,v,w,_,A,S,F,V,O,P,R){let E=t*34,$=t*17;return this.int16[E+0]=e,this.int16[E+1]=r,this.int16[E+2]=i,this.int16[E+3]=n,this.int16[E+4]=a,this.int16[E+5]=s,this.int16[E+6]=o,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=h,this.uint16[E+10]=c,this.uint16[E+11]=p,this.uint16[E+12]=f,this.uint16[E+13]=d,this.uint16[E+14]=y,this.uint16[E+15]=m,this.uint16[E+16]=g,this.uint16[E+17]=x,this.uint16[E+18]=b,this.uint16[E+19]=v,this.uint16[E+20]=w,this.uint16[E+21]=_,this.uint16[E+22]=A,this.uint32[$+12]=S,this.float32[$+13]=F,this.float32[$+14]=V,this.uint16[E+30]=O,this.uint16[E+31]=P,this.float32[$+16]=R,t}};So.prototype.bytesPerElement=68,I(\"StructArrayLayout8i15ui1ul2f2ui1f68\",So);var ga=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};ga.prototype.bytesPerElement=4,I(\"StructArrayLayout1f4\",ga);var Eo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Eo.prototype.bytesPerElement=12,I(\"StructArrayLayout1ui2f12\",Eo);var Fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Fo.prototype.bytesPerElement=8,I(\"StructArrayLayout1ul2ui8\",Fo);var To=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};To.prototype.bytesPerElement=4,I(\"StructArrayLayout2ui4\",To);var qh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};qh.prototype.bytesPerElement=2,I(\"StructArrayLayout1ui2\",qh);var ko=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};ko.prototype.bytesPerElement=16,I(\"StructArrayLayout4f16\",ko);var Qf=class extends gn{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]}
1646get anchorPoint(){return new M(this.anchorPointX,this.anchorPointY)}};Qf.prototype.size=20;var Ll=class extends bo{get(t){return new Qf(this,t)}};I(\"CollisionBoxArray\",Ll);var td=class extends gn{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};td.prototype.size=52;var ed=class extends Ao{get(t){return new td(this,t)}};I(\"PlacedSymbolArray\",ed);var rd=class extends gn{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(t){this._structArray.uint32[this._pos4+12]=t}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]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};rd.prototype.size=68;var id=class extends So{get(t){return new rd(this,t)}};I(\"SymbolInstanceArray\",id);var nd=class extends ga{getoffsetX(t){return this.float32[t*1+0]}};I(\"GlyphOffsetArray\",nd);var ad=class extends co{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};I(\"SymbolLineVertexArray\",ad);var sd=class extends gn{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]}};sd.prototype.size=12;
1646var od=class extends Eo{get(t){return new sd(this,t)}};I(\"TextAnchorOffsetArray\",od);var ld=class extends gn{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]}};ld.prototype.size=8;var ud=class extends Fo{get(t){return new ld(this,t)}};I(\"FeatureIndexArray\",ud);var ag=class extends an{};var sg=class extends an{},og=class extends an{},lg=class extends po{},ug=class extends fo{},hg=class extends sn{},zr=class extends yo{},jh=class extends mo{},cg=class extends go{},pg=class extends xo{},fg=class extends vo{},Gh=class extends wo{};var dg=class extends Do{};var xn=class extends _o{},Io=class extends To{};var Co=St([{name:\"a_pos\",components:2,type:\"Int16\"}],4),yg=Co.members;Co.size,Co.alignment;var te=class $r{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>$r.MAX_VERTEX_ARRAY_LENGTH&&Mt(`Max vertices per segment is ${$r.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${$r.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>$r.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new $r([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};te.MAX_VERTEX_ARRAY_LENGTH=2**16-1,I(\"SegmentVector\",te);function Yh(t,e){return t=Zi(Math.floor(t),0,255),e=Zi(Math.floor(e),0,255),256*t+e}var mg=St([{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\"}]),gg=St([{name:\"a_dasharray_from\",components:4,type:\"Uint16\"},{name:\"a_dasharray_to\",components:4,type:\"Uint16\"}]),xg=fl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p<s;)c=i.charCodeAt(p)&255|(i.charCodeAt(++p)&255)<<8|(i.charCodeAt(++p)&255)<<16|(i.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),vg=fl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Mo=D1(fl(((t,e)=>{var r=xg(),i=vg();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),hd=class cd{constructor(){this.ids=[],this.positions=[],this.indexed=!1}
1646add(e,r,i,n){this.ids.push(Xh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error(\"Trying to get index, but feature positions are not indexed\");let r=Xh(e),i=0,n=this.ids.length-1;for(;i<n;){let s=i+n>>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Bo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new cd;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Xh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Mo.default)(String(t))}function Bo(t,e,r,i){for(;r<i;){let n=t[r+i>>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]<n);do s--;while(t[s]>n);if(a>=s)break;qn(t,a,s),qn(e,3*a,3*s),qn(e,3*a+1,3*s+1),qn(e,3*a+2,3*s+2)}s-r<i-s?(Bo(t,e,r,s),r=s+1):(Bo(t,e,s+1,i),i=s)}}function qn(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}I(\"FeaturePositionMap\",hd);var Vl=class{constructor(t,e){this.gl=t.gl,this.location=e}};var Ol=class extends Vl{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}};var bg=class extends Vl{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},wg=class extends Vl{constructor(t,e){super(t,e),this.current=gt.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}};var p5=new Float32Array(16);function Po(t){return[Yh(255*t.r,255*t.g),Yh(255*t.b,255*t.a)]}var Vi=class{constructor(t,e,r){this.value=t,this.uniformNames=e.map(i=>`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type===\"color\"?new wg(t,e):new Ol(t,e)}},lr=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i===\"u_pattern_to\"?n=this.patternTo:i===\"u_pattern_from\"?n=this.patternFrom:i===\"u_dasharray_to\"?n=this.dashTo:i===\"u_dasharray_from\"?n=this.dashFrom:i===\"u_pixel_ratio_to\"?n=this.pixelRatioTo:i===\"u_pixel_ratio_from\"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith(\"u_pattern\")||r.startsWith(\"u_dasharray_\")?new bg(t,e):new Ol(t,e)}},Te=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:\"Float32\",components:r===\"color\"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new at(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new at(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type===\"color\"){let i=Po(r);for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},le=class{constructor(t,e,r,i,n,a){this.expression=t,this.uniformNames=e.map(s=>`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:\"Float32\",components:r===\"color\"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new at(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new at(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new at(this.zoom,n),r,i),s=this.expression.evaluate(new at(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}
1646_setPaintValue(t,e,r,i){if(this.type===\"color\"){let n=Po(r),a=Po(i);for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,n[0],n[1],a[0],a[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(t){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){let r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,i=Zi(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(i)}getBinding(t,e,r){return new Ol(t,e)}},je=class{constructor(t,e,r,i,n,a){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,this.getPositionIds(e),r)}updatePaintArray(t,e,r,i,n){this._setPaintValues(t,e,this.getPositionIds(r),n)}_setPaintValues(t,e,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,a,s),this.emplace(this.zoomOutPaintVertexArray,l,o,s)}upload(t){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},pd=class extends je{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns?.[this.layerId]}getVertexAttributes(){return mg.members}emplace(t,e,r,i){t.emplace(e,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}},fd=class extends je{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes?.[this.layerId]}getVertexAttributes(){return gg.members}emplace(t,e,r,i){t.emplace(e,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}},dd=class{constructor(t,e,r){this.binders={},this._buffers=[];let i=[];for(let n in t.paint._values){if(!r(n))continue;let a=t.paint.get(n);if(!(a instanceof ae)||!ei(a.property.specification))continue;let s=Dg(n,t.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,h=a.property.specification[\"property-type\"],c=h===\"cross-faded\"||h===\"cross-faded-data-driven\";if(o.kind===\"constant\")this.binders[n]=c?new lr(o.value,s):new Vi(o.value,s,l),i.push(`/u_${n}`);else if(o.kind===\"source\"||c){let p=Wh(n,l,\"source\");this.binders[n]=c?n===\"line-dasharray\"?new fd(o,l,u,e,p,t.id):new pd(o,l,u,e,p,t.id):new Te(o,s,l,p),i.push(`/a_${n}`)}else{let p=Wh(n,l,\"composite\");this.binders[n]=new le(o,s,l,u,e,p),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join(\"\")}getMaxValue(t){let e=this.binders[t];return e instanceof Te||e instanceof le?e.maxValue:0}populatePaintArrays(t,e,r){for(let i in this.binders){let n=this.binders[i];(n instanceof Te||n instanceof le||n instanceof je)&&n.populatePaintArray(t,e,r)}}setConstantPatternPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof lr&&i.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(let r in this.binders){let i=this.binders[r];i instanceof lr&&i.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,r,i,n){let a=!1;for(let s of t){let o=e.getPositions(s.id);for(let l of o){let u=r.feature(l.index);for(let h in this.binders){let c=this.binders[h];(c instanceof Te||c instanceof le||c instanceof je)&&c.expression.isStateDependent===!0&&(c.expression=i.paint.get(h).value,c.updatePaintArray(l.start,l.end,u,s.state,n),a=!0)}}}return a}defines(){let t=[];for(let e in this.binders){let r=this.binders[e];(r instanceof Vi||r instanceof lr)&&t.push(...r.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Te||r instanceof le)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof je){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof Vi||r instanceof lr||r instanceof le)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Vi||n instanceof lr||n instanceof le){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);
vendor: 11,022 bytes, line 1646
1646r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof je){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof Te||r instanceof le)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof Te||r instanceof le||r instanceof je)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof Te||e instanceof le||e instanceof je)&&e.destroy()}}},gr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new dd(i,e,r);this.needsUpload=!1,this._featureMap=new hd,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function Dg(t,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-dasharray\":[\"dasharray_to\",\"dasharray_from\"],\"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\"]}[t]||[t.replace(`${e}-`,\"\").replace(/-/g,\"_\")]}function _g(t){return{\"line-pattern\":{source:zr,composite:zr},\"fill-pattern\":{source:zr,composite:zr},\"fill-extrusion-pattern\":{source:zr,composite:zr},\"line-dasharray\":{source:jh,composite:jh}}[t]}function Wh(t,e,r){let i={color:{source:sn,composite:ko},number:{source:ga,composite:sn}};return _g(t)?.[r]||i[e][r]}I(\"ConstantBinder\",Vi),I(\"CrossFadedConstantBinder\",lr),I(\"SourceExpressionBinder\",Te),I(\"CrossFadedPatternBinder\",pd),I(\"CrossFadedDasharrayBinder\",fd),I(\"CompositeExpressionBinder\",le),I(\"ProgramConfiguration\",dd,{omit:[\"_buffers\"]}),I(\"ProgramConfigurationSet\",gr);var zo=2**14-1,Zh=-zo-1;function Dr(t){let e=mt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Zi(a,Zh,zo),n.y=Zi(s,Zh,zo),(a<n.x||a>n.x+1||s<n.y||s>n.y+1)&&Mt(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}return r}function li(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Dr(t):[]}}var Hh=-32768;function Ag(t,e,r,i,n){t.emplaceBack(Hh+e*8+i,Hh+r*8+n)}var Rl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new sg,this.indexArray=new xn,this.segments=new te,this.programConfigurations=new gr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type===\"heatmap\";if(i.type===\"circle\"){let c=i;a=c.layout.get(\"circle-sort-key\"),s=!a.isConstant(),o||(o=c.paint.get(\"circle-pitch-alignment\")===\"map\")}let l=o?e.subdivisionGranularity.circle:1,u=new at(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=li(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Dr(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yg),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f<s;f++)for(let d=0;d<s;d++)Ag(this.layoutVertexArray,u,h,a[d],a[f]);for(let f=0;f<s-1;f++)for(let d=0;d<s-1;d++){let y=p+f*s+d,m=p+(f+1)*s+d;this.indexArray.emplaceBack(y,m+1,y+1),this.indexArray.emplaceBack(y,m,m+1)}c.vertexLength+=s*s,c.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:{},canonical:i})}};I(\"CircleBucket\",Rl,{omit:[\"layers\"]});function Sg(t,e){for(let r of t)if(ai(e,r))return!0;for(let r of e)if(ai(t,r))return!0;return $l(t,e)}function qa(t,e,r){return ai(t,e)?!0:Lo(e,t,r)}function yd(t,e){if(t.length===1)return Kh(e,t[0]);for(let r of e)for(let i of r)if(ai(t,i))return!0;for(let r of t)if(Kh(e,r))return!0;for(let r of e)if($l(t,r))return!0;return!1}function Eg(t,e,r){for(let i of e){if(t.length>=3){for(let n of i)if(ai(t,n))return!0}if(Fg(t,i,r))return!0}return!1}function Fg(t,e,r){if(t.length>1){if($l(t,e))return!0;for(let i of e)if(Lo(i,t,r))return!0}for(let i of t)if(Lo(i,e,r))return!0;return!1}function $l(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let i=t[r],n=t[r+1];for(let a=0;a<e.length-1;a++){let s=e[a],o=e[a+1];if(Tg(i,n,s,o))return!0}}return!1}function Tg(t,e,r,i){return We(t,r,i)!==We(e,r,i)&&We(t,e,r)!==We(t,e,i)}function Lo(t,e,r){let i=r*r;if(e.length===1)return t.distSqr(e[0])<i;for(let n=1;n<e.length;n++){let a=e[n-1],s=e[n];if(md(t,a,s)<i)return!0}return!1}function md(t,e,r){let i=e.distSqr(r);if(i===0)return t.distSqr(e);let n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Kh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;o<i.length;l=o++)n=i[o],a=i[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function ai(t,e){let r=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let a=t[i],s=t[n];a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function kg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new M(e,r),new M(e,n),new M(i,n),new M(i,r)];if(t.length>2){for(let s of a)if(ai(t,s))return!0}for(let s=0;s<t.length-1;s++){let o=t[s],l=t[s+1];if(Ig(o,l,a))return!0}return!1}function Ig(t,e,r){let i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;let a=We(t,e,r[0]);return a!==We(t,e,r[1])||a!==We(t,e,r[2])||a!==We(t,e,r[3])}function Yr(t,e,r){let i=e.paint.get(t).value;return i.kind===\"constant\"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ja(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ga(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=M.convert(e)._mult(n);r===\"viewport\"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function Cg(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r],n=e.at(-1);(r===0||n&&!i.equals(n))&&e.push(i)}return e}function Mg(t,e){let r=[];for(let i of t){let n=Cg(i),a=[];for(let s=0;s<n.length;s++){let o=n[s],l=n[s-1],u=n[s+1],h=s===0?new M(0,0):o.sub(l)._unit()._perp(),c=s===n.length-1?new M(0,0):u.sub(o)._unit()._perp(),p=h._add(c)._unit(),f=p.x*c.x+p.y*c.y;f!==0&&p._mult(1/f),a.push(p._mult(e)._add(o))}r.push(a)}return r}function Bg({queryGeometry:t,size:e},r){return qa(t,r,e)}function Pg({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){return qa(t,a,e*(r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function zg({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){let s=r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,o=e*(r.cameraToCenterDistance/s);return qa(t,Nl(a,r,i,n),o)}function Lg({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n},a){return qa(t,Nl(a,r,i,n),e)}function gd({queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a=\"map\",pitchScale:s=\"map\"},o){let l=a===\"map\"?s===\"map\"?Bg:Pg:s===\"map\"?zg:Lg,u={queryGeometry:t,size:e,transform:r,unwrappedTileID:i,getElevation:n};for(let h of o)for(let c of h)if(l(u,c))return!0;return!1}function Nl(t,e,r,i){let n=e.projectTileCoordinates(t.x,t.y,r,i?.(t.x,t.y)).point;return new M((n.x*.5+.5)*e.width,(-n.y*.5+.5)*e.height)}function Vg(t,e,r,i){return t.map(n=>Nl(n,e,r,i))}var Jh,Og=()=>Jh||(Jh=new jt({\"circle-sort-key\":new U(D.layout_circle[\"circle-sort-key\"],\"circle-sort-key\")})),Qh,Rg=()=>Qh||(Qh=new jt({\"circle-radius\":new U(D.paint_circle[\"circle-radius\"],\"circle-radius\"),\"circle-color\":new U(D.paint_circle[\"circle-color\"],\"circle-color\"),\"circle-blur\":new U(D.paint_circle[\"circle-blur\"],\"circle-blur\"),\"circle-opacity\":new U(D.paint_circle[\"circle-opacity\"],\"circle-opacity\"),\"circle-translate\":new L(D.paint_circle[\"circle-translate\"],\"circle-translate\"),\"circle-translate-anchor\":new L(D.paint_circle[\"circle-translate-anchor\"],\"circle-translate-anchor\"),\"circle-pitch-scale\":new L(D.paint_circle[\"circle-pitch-scale\"],\"circle-pitch-scale\"),\"circle-pitch-alignment\":new L(D.paint_circle[\"circle-pitch-alignment\"],\"circle-pitch-alignment\"),\"circle-stroke-width\":new U(D.paint_circle[\"circle-stroke-width\"],\"circle-stroke-width\"),\"circle-stroke-color\":new
1646U(D.paint_circle[\"circle-stroke-color\"],\"circle-stroke-color\"),\"circle-stroke-opacity\":new U(D.paint_circle[\"circle-stroke-opacity\"],\"circle-stroke-opacity\")})),$g={get paint(){return Rg()},get layout(){return Og()}};var Ng=class extends pe{constructor(t,e){super(t,$g,e)}createBucket(t){return new Rl(t)}queryRadius(t){let e=t;return Yr(\"circle-radius\",this,e)+Yr(\"circle-stroke-width\",this,e)+ja(this.paint.get(\"circle-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ga(t,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),-n.bearingInRadians,a),u=this.paint.get(\"circle-radius\").evaluate(e,r)+this.paint.get(\"circle-stroke-width\").evaluate(e,r),h=this.paint.get(\"circle-pitch-scale\"),c=this.paint.get(\"circle-pitch-alignment\"),p,f;return c===\"map\"?(p=l,f=u*a):(p=Vg(l,n,s,o),f=u),gd({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},xd=class extends Rl{};I(\"HeatmapBucket\",xd,{omit:[\"layers\"]});var tc,Ug=()=>tc||(tc=new jt({\"heatmap-radius\":new U(D.paint_heatmap[\"heatmap-radius\"],\"heatmap-radius\"),\"heatmap-weight\":new U(D.paint_heatmap[\"heatmap-weight\"],\"heatmap-weight\"),\"heatmap-intensity\":new L(D.paint_heatmap[\"heatmap-intensity\"],\"heatmap-intensity\"),\"heatmap-color\":new Ua(D.paint_heatmap[\"heatmap-color\"],\"heatmap-color\"),\"heatmap-opacity\":new L(D.paint_heatmap[\"heatmap-opacity\"],\"heatmap-opacity\")}
vendor: 5,466 bytes, line 1646
1646)),qg={get paint(){return Ug()}};function Ul(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function vd(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Ul({},{width:e,height:r},i);ql(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function ql(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError(\"out of range source coordinates for image copy\");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError(\"out of range destination coordinates for image copy\");let s=t.data,o=e.data;if(s===o)throw Error(\"srcData equals dstData, so image is already copied\");for(let l=0;l<n.height;l++){let u=((r.y+l)*t.width+r.x)*a,h=((i.y+l)*e.width+i.x)*a;for(let c=0;c<n.width*a;c++)o[h+c]=s[u+c]}return e}var Ya=class bd{constructor(e,r){Ul(this,e,1,r)}resize(e){vd(this,e,1)}clone(){return new bd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){ql(e,r,i,n,a,1)}},Wt=class wd{constructor(e,r){Ul(this,e,4,r)}resize(e){vd(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new wd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,a){ql(e,r,i,n,a,4)}setPixel(e,r,i){let n=(e*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};function Ls(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=4){let i=t[r+3];e[r+0]=Math.round(t[r+0]*i/255),e[r+1]=Math.round(t[r+1]*i/255),e[r+2]=Math.round(t[r+2]*i/255),e[r+3]=i}return e}I(\"AlphaImage\",Ya),I(\"RGBAImage\",Wt);function jg(t){let e={},r=t.resolution||256,i=t.clips?t.clips.length:1,n=t.image||new Wt({width:r,height:i});if(!$1(r))throw Error(`width is not a power of 2 - ${r}`);let a=(s,o,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s<i;++s,o+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let h=l/(r-1),{start:c,end:p}=t.clips[s],f=c*(1-h)+p*h;a(o,u,f)}else for(let s=0,o=0;s<r;s++,o+=4){let l=s/(r-1);a(0,o,l)}return n}var Gg=\"big-fb\";var Yg=class extends pe{createBucket(t){return new xd(t)}constructor(t,e){super(t,qg,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t===\"heatmap-color\"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values[\"heatmap-color\"].value.expression;this.colorRamp=jg({expression:t,evaluationKey:\"heatmapDensity\",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(\"big-fb\")&&this.heatmapFbos.delete(Gg)}queryRadius(t){return Yr(\"heatmap-radius\",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return gd({queryGeometry:t,size:this.paint.get(\"heatmap-radius\").evaluate(e,r)*a,transform:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return this.paint.get(\"heatmap-opacity\")!==0&&!this.isHidden()}},ec,Xg=()=>ec||(ec=new jt({\"hillshade-illumination-direction\":new L(D.paint_hillshade[\"hillshade-illumination-direction\"],\"hillshade-illumination-direction\"),\"hillshade-illumination-altitude\":new L(D.paint_hillshade[\"hillshade-illumination-altitude\"],\"hillshade-illumination-altitude\"),\"hillshade-illumination-anchor\":new L(D.paint_hillshade[\"hillshade-illumination-anchor\"],\"hillshade-illumination-anchor\"),\"hillshade-exaggeration\":new L(D.paint_hillshade[\"hillshade-exaggeration\"],\"hillshade-exaggeration\"),\"hillshade-shadow-color\":new L(D.paint_hillshade[\"hillshade-shadow-color\"],\"hillshade-shadow-color\"),\"hillshade-highlight-color\":new L(D.paint_hillshade[\"hillshade-highlight-color\"],\"hillshade-highlight-color\"),\"hillshade-accent-color\":new L(D.paint_hillshade[\"hillshade-accent-color\"],\"hillshade-accent-color\"),\"hillshade-method\":new L(D.paint_hillshade[\"hillshade-method\"],\"hillshade-method\"),resampling:new L(D.paint_hillshade.resampling,\"resampling\")})),Wg={get paint(){return Xg()}};var Zg=class extends pe{constructor(t,e){super(t,Wg,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get(\"hillshade-illumination-direction\").values,e=this.paint.get(\"hillshade-illumination-altitude\").values,r=this.paint.get(\"hillshade-highlight-color\").values,i=this.paint.get(\"hillshade-shadow-color\").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(hh);return{directionRadians:t.map(hh),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&!this.isHidden()}},rc,Hg=()=>rc||(rc=new jt({\"color-relief-opacity\":new L(D[\"paint_color-relief\"][\"color-relief-opacity\"],\"color-relief-opacity\"),\"color-relief-color\":new
1646Ua(D[\"paint_color-relief\"][\"color-relief-color\"],\"color-relief-color\"),resampling:new L(D[\"paint_color-relief\"].resampling,\"resampling\")})),Kg={get paint(){return Hg()}};function jn(t){return\"data\"in t}var ic=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){let{width:i,height:n}=t,a=(this.size?.[0]!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!e?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&e?.premultiply!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let u=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,u,o.RGBA8,i,n),jn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:h}=t;l&&h&&(h=Ls(h)),h&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,h)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else jn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:u,y:h}=r||{x:0,y:0};jn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,u,h,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,u,h,o))}this.useMipmap&&!(jn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Ls(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Ls(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}
vendor: 4,788 bytes, line 1646
1646bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Me,jl=(Me=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError(\"DEM tiles must be square\");if(i&&![\"mapbox\",\"terrarium\",\"custom\"].includes(i)){Mt(`\"${i}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Me.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h<l+2;h++){let c=this._idx(0,Math.max(0,Math.min(l-1,h)));(h<0||h>=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;h<l;h++)for(let c=0;c<l;c++){let p=this._idx(h,c)*4,f=this._unpackAtIndex(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let i=this._getByteView(),n=this._idx(e,r)*4;return this._unpackAtIndex(i,n)}sampleBilinear(e,r){let i=Math.floor(e),n=Math.floor(r);if(i<-1||i>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return Dd(e,this.getUnpackVector())}getPixels(){return new Wt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error(\"dem dimension mismatch\");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h<o;h++)for(let c=n;c<a;c++)this.data[this._idx(c,h)]=e.data[this._idx(c+l,h+u)]}_getByteView(){let e=Me.byteViewCache.get(this);return e?.buffer!==this.data.buffer&&(e=new Uint8Array(this.data.buffer),Me.byteViewCache.set(this,e)),e}_unpackAtIndex(e,r){return this.unpack(e[r],e[r+1],e[r+2])}},Me.byteViewCache=new WeakMap,Me);function Dd(t,e){let r=e[0],i=e[1],n=e[2],a=e[3],s=Math.min(r,i,n),o=Math.round((t+a)/s);return{r:Math.floor(o*s/r)%256,g:Math.floor(o*s/i)%256,b:Math.floor(o*s/n)%256}}I(\"DEMData\",jl);var Jg=class extends pe{constructor(t,e){super(t,Kg,e)}_createColorRamp(t){let e={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values[\"color-relief-color\"].value.expression;if(r instanceof en&&r._styleExpression.expression instanceof be){this.colorRampExpression=r;let a=r._styleExpression.expression;e.elevationStops=a.labels,e.colorStops=[];for(let s of e.elevationStops)e.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[gt.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;let i={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let a=0;a<e.elevationStops.length-.5;a+=n)i.elevationStops.push(e.elevationStops[Math.round(a)]),i.colorStops.push(e.colorStops[Math.round(a)]);return Mt(`Too many colors in specification of ${this.id}
1646 color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[\"color-relief-color\"].value.expression}getColorRampTextures(t,e,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(e),n=new Wt({width:i.colorStops.length,height:1}),a=new Wt({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let o=Dd(i.elevationStops[s],r);a.setPixel(0,s,new gt(o.r/255,o.g/255,o.b/255,1)),n.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new ic(t,a,t.gl.RGBA),colorTexture:new ic(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}},Vo=St([{name:\"a_pos\",components:2,type:\"Int16\"}],4),Qg=Vo.members;Vo.size,Vo.alignment;function xa(t,e,r){let i=r.patternDependencies,n=!1;for(let a of e){let s=a.paint.get(`${t}-pattern`);s.isConstant()||(n=!0);let o=s.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function Gl(t,e,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let o of e){let l=o.paint.get(`${t}-pattern`).value;if(l.kind!==\"constant\"){let u=l.evaluate({zoom:a-1},r,{},n.availableImages),h=l.evaluate({zoom:a},r,{},n.availableImages),c=l.evaluate({zoom:a+1},r,{},n.availableImages);u=u?.name?u.name:u,h=h?.name?h.name:h,c=c?.name?c.name:c,s[u]=!0,s[h]=!0,s[c]=!0,r.patterns[o.id]={min:u,mid:h,max:c}}}return r}var on=new Set,Oo=!1;function tx(t,e,r=2){let i=e&&e.length,n=i?e[0]*r:t.length;on.size&&on.clear();let a=_d(t,0,n,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(i&&(a=ax(t,e,a,r)),t.length>80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;p<n;p+=r){let f=t[p],d=t[p+1];f<o&&(o=f),d<l&&(l=d),f>h&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Ro(a,s,o,l,u),s}function _d(t,e,r,i,n){let a=null;if(n===xx(t,e,r,i)>0)for(let s=e;s<r;s+=i)a=sc(s/i|0,t[s],t[s+1],a);else for(let s=r-i;s>=e;s-=i)a=sc(s/i|0,t[s],t[s+1],a);return a&&ln(a,a.next)&&(hn(a),a=a.next),a}function xr(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(on.size===0||!on.has(i))&&(ln(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Oo=!0,hn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Ro(t,e,r,i,n){n&&px(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?rx(t,r,i,n):ex(t))){e.push(o.i,t.i,l.i),hn(t),t=l,a=l;continue}if(t=l,t===a){if(Oo=!1,t=xr(t),Oo){a=t;continue}if(!s){t=ix(t,e),a=t,s=!0;continue}nx(t,e,r,i,n);break}}}function ex(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&ba(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function rx(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=qo(f,d,e,r,i),x=qo(y,m,e,r,i),b=t.prevZ;for(;b&&b.z>=g;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&ba(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.prevZ}let v=t.nextZ;for(;v&&v.z<=x;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&ba(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function ix(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;Sd(n,r,r.next,a,!1)&&un(n,a)&&un(a,n)&&(e.push(n.i,r.i,a.i),hn(r),hn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?xr(r):r}function nx(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&yx(a,s)){let o=Ed(a,s);a=xr(a,a.next),o=xr(o,o.next),Ro(a,e,r,i,n),Ro(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var $o=!1;function ax(t,e,r,i){let n=[];for(let a=0,s=e.length;a<s;a++){let o=_d(t,e[a]*i,a<s-1?e[a+1]*i:t.length,i,!1);o===o.next&&on.add(o),n.push(dx(o))}n.sort(sx),lx(t.length/i,e.length),Ad(r,r),$o=!0;for(let a=0;a<n.length;a++)r=ox(n[a],r);return $o=!1,xr(r)}function sx(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function ox(t,e){let r=hx(t,e);if(!r)return e;let i=Ed(r,t),n=i.next;return Ad(r,n.next),xr(i,i.next),xr(r,r.next)}var wt=new Float64Array,va=0,No=[],Uo=[];function lx(t,e){let r=Math.ceil((t+2*e)/16)+e+2;wt.length<r*4&&(wt=new Float64Array(r*4)),va=0}function Ad(t,e){let r=t;do{let i=va++;No[i]=r;let n=1/0,a=1/0,s=-1/0,o=-1/0,l=0;do{let h=r.next;r.z=i,r.x<n&&(n=r.x),r.x>s&&(s=r.x),r.y<a&&(a=r.y),r.y>o&&(o=r.y),h.x<n&&(n=h.x),h.x>s&&(s=h.x),h.y<a&&(a=h.y),h.y>o&&(o=h.y),r=h}while(++l<16&&r!==e);Uo[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function ux(t,e){let r=t.z*4;e.x<wt[r]&&(wt[r]=e.x),e.y<wt[r+1]&&(wt[r+1]=e.y),e.x>wt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function nc(t){let e=Uo[t];for(;e.prev.next!==e;)e=e.next;return Uo[t]=e,e}function ac(t){let e=No[t];for(;e.prev.next!==e;)e=e.next;return No[t]=e,e}function hx(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(ln(t,r))return r;for(let p=0,f=0;p<va;p++,f+=4){if(n<wt[f+1]||n>wt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=nc(p);r=ac(p);do{if(r.prev.next===r){if(ln(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y
vendor: 17,502 bytes, line 1646
1646);if(y<=i&&y>a&&(a=y,s=r.x<r.next.x?r:r.next,y===i))return s}}r=r.next}while(r!==d)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(n,l),h=Math.max(n,l),c=1/0;for(let p=0,f=0;p<va;p++,f+=4){if(wt[f+2]<o||wt[f]>i||wt[f+3]<u||wt[f+1]>h)continue;let d=nc(p);r=ac(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&ba(n<l?i:a,n,o,l,n<l?a:i,n,r.x,r.y)){let y=Math.abs(n-r.y)/(i-r.x);(un(r,t)||r.y===n&&r.next.y===n&&r.next.x>i)&&(y<c||y===c&&(r.x>s.x||r.x===s.x&&cx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function cx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var ne=[],Ei=[],sr=new Uint32Array,Fi=new Uint32Array,Ti=new Uint32Array(256);function px(t,e,r,i){let n=t,a=0;do n.z=qo(n.x,n.y,e,r,i),ne[a++]=n,n=n.next;while(n!==t);fx(a);let s=null;for(let o=0;o<a;o++){let l=ne[o];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null}function fx(t){if(t<=32){for(let e=1;e<t;e++){let r=ne[e],i=r.z,n=e-1;for(;n>=0&&ne[n].z>i;)ne[n+1]=ne[n],n--;ne[n+1]=r}return}sr.length<t&&(sr=new Uint32Array(t),Fi=new Uint32Array(t),Ei=Array(t));for(let e=0;e<t;e++)sr[e]=ne[e].z;Gn(t,ne,sr,Ei,Fi,0),Gn(t,Ei,Fi,ne,sr,8),Gn(t,ne,sr,Ei,Fi,16),Gn(t,Ei,Fi,ne,sr,24)}function Gn(t,e,r,i,n,a){Ti.fill(0);for(let o=0;o<t;o++)Ti[r[o]>>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ti[o];Ti[o]=s,s+=l}for(let o=0;o<t;o++){let l=r[o],u=Ti[l>>>a&255]++;i[u]=e[o],n[u]=l}}function qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function dx(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ba(t,e,r,i,n,a,s,o){return(n-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function yx(t,e){let r=ln(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||un(t,e)&&un(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!mx(t,e)&&(r||gx(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ln(t,e){return t.x===e.x&&t.y===e.y}function Sd(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Yn(t,r,e)||s===0&&Yn(t,i,e)||o===0&&Yn(r,t,i)||l===0&&Yn(r,e,i)):!1}function Yn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function mx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<n&&o.y<n){s=o;continue}if(s.i!==t.i&&o.i!==t.i&&s.i!==e.i&&o.i!==e.i&&Sd(s,o,t,e))return!0;s=o}while(s!==t);return!1}function un(t,e){return Ft(t.prev,t,t.next)<0?Ft(t,e,t.next)>=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function gx(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function Ed(t,e){let r=jo(t.i,t.x,t.y),i=jo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function sc(t,e,r,i){let n=jo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function hn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),$o&&ux(t.prev,t.next)}function jo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function xx(t,e,r,i){let n=0;for(let a=e,s=r-i;a<r;a+=i)n+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return n}var Oi=class{constructor(t,e){if(e>t)throw Error(\"Min granularity must not be greater than base granularity.\");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<<t;return Math.max(Math.floor(this._baseZoomGranularity/e),this._minGranularity,1)}},fr,vx=(fr=class{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}},fr.noSubdivision=new fr({fill:new Oi(0,0),line:new Oi(0,0),tile:new Oi(0,0),stencil:new Oi(0,0),circle:1}),fr);I(\"SubdivisionGranularityExpression\",Oi),I(\"SubdivisionGranularitySetting\",vx);var Vs=-32768,Os=32767,bx=class{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=mt/t,this._canonical=e}_getKey(t,e){return t+=32768,e+=32768,t<<16|e<<0}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw Error(\"Vertex coordinates are out of signed 16 bit integer range.\");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i),a=this._vertexDictionary.get(n);if(a!==void 0)return a;let s=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,s),this._vertexBuffer.push(r,i),s}_subdivideTrianglesScanline(t,e){if(this._granularity<2)return _x(this._vertexBuffer,Dx(t,e));let r=[],i=t.length;for(let n=0;n<i;n+=3){let a=[e[t[n+0]],e[t[n+1]],e[t[n+2]]],s=[this._vertexBuffer[a[0]*2+0],this._vertexBuffer[a[0]*2+1],this._vertexBuffer[a[1]*2+0],this._vertexBuffer[a[1]*2+1],this._vertexBuffer[a[2]*2+0],this._vertexBuffer[a[2]*2+1]],o=1/0,l=1/0,u=-1/0,h=-1/0;for(let y=0;y<3;y++){let m=s[y*2],g=s[y*2+1];o=Math.min(o,m),u=Math.max(u,m),l=Math.min(l,g),h=Math.max(h,g)}if(o===u||l===h)continue;let c=Math.floor(o/this._granularityCellSize),p=Math.ceil(u/this._granularityCellSize),f=Math.floor(l/this._granularityCellSize),d=Math.ceil(h/this._granularityCellSize);if(c===p&&f===d){r.push(...a);continue}for(let y=f;y<d;y++){let m=this._scanlineGenerateVertexRingForCellRow(y,s,a);Ax(this._vertexBuffer,m,r)}}return r}_scanlineGenerateVertexRingForCellRow(t,e,r){let i=t*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let o=e[s*2],l=e[s*2+1],u=e[(s+1)*2%6],h=e[((s+1)*2+1)%6],c=e[(s+2)*2%6],p=e[((s+2)*2+1)%6],f=u-o,d=h-l,y=f===0,m=d===0,g=(i-l)/d,x=(n-l)/d,b=Math.min(g,x),v=Math.max(g,x);if(!m&&(b>=1||v<=0)||m&&(l<i||l>n)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&b>0){let A=o+f*b,S=l+d*b;a.push(this._vertexToIndex(A,S))}let w=o+f*Math.max(b,0),_=o+f*Math.min(v,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,w,_),!m&&v<1){let A=o+f*v,S=l+d*v;a.push(this._vertexToIndex(A,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,_,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e<i:a<s)for(let d=p;d<=f;d++){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}else for(let d=f;d>=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,v=o<g,w=p===0;if(w&&(s===l||s===u))return;if(w||y>=1||m<=0){let A=e-a,S=r-s,F=(l-s)/S,V=(u-s)/S,O=a+A*Math.min(F,V);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,v=o<O}let _=h>0?u:l;if(v)for(let A=x;A<=b;A++){let S=A*this._granularityCellSize;t.push(this._vertexToIndex(S,_))}else for(let A=b;A>=x;A--){let S=A*this._granularityCellSize;t.push(this._vertexToIndex(S,_))}}_generateOutline(t,e){let r=[],i=0;for(let n of t){let a=this._granularity<2?this._ringPathIndices(n,i,e):this._pointArrayToIndices(hr(n,this._granularity,!0));i+=n.length;let s=[];for(let o=1;o<a.length;o++)s.push(a[o-1]),s.push(a[o]);r.push(s)}return r}_ringPathIndices(t,e,r){let i=r.slice(e,e+t.length);return i.length>=2&&Td(t)&&i.push(i[0]),i}_handlePoles(t){let e=!1,r=!1;this._canonical&&(this._canonical.y===0&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(e||r)&&this._fillPoles(t,e,r)}_ensureNoPoleVertices(){let t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){let r=t[e+1];r===-32768&&(t[e+1]=-32767),r===32767&&(t[e+1]=32766)}}_generatePoleQuad(t,e,r,i,n,a){i>n==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=mt,a=t.length;for(let s=2;s<a;s+=3){let o=t[s-2],l=t[s-1],u=t[s],h=i[o*2],c=i[o*2+1],p=i[l*2],f=i[l*2+1],d=i[u*2],y=i[u*2+1];e&&(c===0&&f===0&&this._generatePoleQuad(t,o,l,h,p,Vs),f===0&&y===0&&this._generatePoleQuad(t,l,u,p,d,Vs),y===0&&c===0&&this._generatePoleQuad(t,u,o,d,h,Vs)),r&&(c===n&&f===n&&this._generatePoleQuad(t,o,l,h,p,Os),f===n&&y===n&&this._generatePoleQuad(t,l,u,p,d,Os),y===n&&c===n&&this._generatePoleQuad(t,u,o,d,h,Os))}}_initializeVertices(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(this._vertexToIndex(t[r],t[r+1]));return e}subdividePolygonInternal(t,e){if(this._used)throw Error(\"Subdivision: multiple use not allowed.\");this._used=!0;let{flattened:r,holeIndices:i}=wx(t),n=this._initializeVertices(r),a;try{let o=tx(r,i);a=this._subdivideTrianglesScanline(o,n)}catch(o){console.error(o)}let s=[];return e&&(s=this._generateOutline(t,n)),this._ensureNoPoleVertices(),this._handlePoles(a),this._granularity>=2&&this._canonical?.z===0&&(a=this._removeTrianglesOutsideTileX(a),s=s.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:s}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=3)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||this._vertexOutsideTileX(t[r+2])||e.push(t[r],t[r+1],t[r+2]);return e}_removeLinesOutsideTileX(t){let e=[];for(let r=0;r<t.length;r+=2)this._vertexOutsideTileX(t[r])||this._vertexOutsideTileX(t[r+1])||e.push(t[r],t[r+1]);return e}_pointArrayToIndices(t){let e=[];for(let r of t)e.push(this._vertexToIndex(r.x,r.y));return e}};function Fd(t,e,r,i=!0){return new bx(r,e).subdividePolygonInternal(t,i)}function hr(t,e,r=!1){if(!t||t.length<1||t.length<2)return[];let i=r&&Td(t);if(e<2)return i?[...t,t[0]]:[...t];let n=Math.floor(mt/e),a=[];a.push(new M(t[0].x,t[0].y));let s=t.length,o=i?s:s-1;for(let l=0;l<o;l++){let u=t[l],h=l<s-1?t[l+1]:t[0],c=u.x,p=u.y,f=h.x,d=h.y,y=c!==f,m=p!==d;if(!y&&!m)continue;let g=f-c,x=d-p,b=Math.abs(g),v=Math.abs(x),w=c,_=p;for(;;){let S=g>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,F=x>0?(Math.floor(_/n)+1)*n:(Math.ceil(_/n)-1)*n,V=Math.abs(w-S),O=Math.abs(_-F),P=Math.abs(w-f),R=Math.abs(_-d),E=y?V/b:1/0,$=m?O/v:1/0;if((P<=V||!y)&&(R<=O||!m))break;if(E<$&&y||!m){w=S,_+=x*E;let z=new M(w,Math.round(_));(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}else{w+=g*$,_=F;let z=new M(Math.round(w),_);(a[a.length-1].x!==z.x||a[a.length-1].y!==z.y)&&a.push(z)}}let A=new M(f,d);(a[a.length-1].x!==A.x||a[a.length-1].y!==A.y)&&a.push(A)}return a}function Td(t){return!t[0].equals(t[t.length-1])}function wx(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n of i)r.push(n.x),r.push(n.y)}return{flattened:r,holeIndices:e}}function Dx(t,e){let r=Array(t.length);for(let i=0;i<t.length;i++)r[i]=e[t[i]];return r}function _x(t,e){let r=[];for(let i=0;i<e.length;i+=3){let n=e[i],a=e[i+1],s=e[i+2],o=t[n*2],l=t[n*2+1],u=t[a*2],h=t[a*2+1],c=t[s*2],p=t[s*2+1],f=u-o,d=h-l,y=c-o;f*(p-l)-d*y>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function Ax(t,e,r){if(e.length===0)throw Error(\"Subdivision vertex ring is empty.\");let i=0,n=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<n&&(n=u,i=l)}let a=e.length,s=i,o=(s+1)%a;for(;;){let l=s-1>=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(h<p)x=!0;else if(h>p)x=!1;else{let b=g-y,v=-(m-d),w=y<g?1:-1;((h-d)*b+(c-y)*v)*w>((p-d)*b+(f-y)*v)*w&&(x=!0)}if(x){let b=e[l],v=e[s],w=e[o];b!==v&&b!==w&&v!==w&&r.push(w,v,b),s--,s<0&&(s=a-1)}else{let b=e[u],v=e[s],w=e[o];b!==v&&b!==w&&v!==w&&r.push(w,v,b),o++,o>=a&&(o=0)}if(l===u)break}}function kd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(u<te.MAX_VERTEX_ARRAY_LENGTH){let c=e.prepareSegment(u,r,i),p=c.vertexLength;for(let y=0;y<a.length;y+=3)i.emplaceBack(p+a[y],p+a[y+1],p+a[y+2]);c.vertexLength+=u,c.primitiveLength+=a.length/3;let f,d;h&&(d=s.prepareSegment(u,r,o),f=d.vertexLength,d.vertexLength+=u);for(let y=0;y<n.length;y+=2)t(n[y],n[y+1]);if(h)for(let y of l){for(let m=1;m<y.length;m+=2)o.emplaceBack(f+y[m-1],f+y[m]);d.primitiveLength+=y.length/2}}else Sx(e,r,i,n,a,t),h&&Ex(s,r,o,n,l,t),e.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function Yi(t,e,r,i,n,a,s){if(a){let o=i.count;return r(e[n*2],e[n*2+1]),t[n]=i.count,i.count++,s.vertexLength++,o}return t[n]}function Sx(t,e,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),h=u.vertexLength;for(let c=2;c<n.length;c+=3){let p=n[c-2],f=n[c-1],d=n[c],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>te.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let b=Yi(s,i,a,o,p,y,u),v=Yi(s,i,a,o,f,m,u),w=Yi(s,i,a,o,d,g,u);r.emplaceBack(h+b-l,h+v-l,h+w-l),u.primitiveLength++}}function Ex(t,e,r,i,n,a){let s=[];for(let c=0;c<i.length/2;c++)s.push(-1);let o={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),h=u.vertexLength;for(let c of n)for(let p=1;p<c.length;p+=2){let f=c[p-1],d=c[p],y=s[f]<l,m=s[d]<l,g=+!!y+ +!!m;u.vertexLength+g>te.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Yi(s,i,a,o,f,y,u),b=Yi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+b-l),u.primitiveLength++}}var Id=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new og,this.indexArray=new xn,this.indexArray2=new Io,this.programConfigurations=new gr(t.layers,t.zoom),this.segments=new te,this.segments2=new te,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=xa(\"fill\",this.layers,e);let i=this.layers[0].layout.get(\"fill-sort-key\"),n=!i.isConstant(),a=[],s=new at(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=li(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Dr(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Gl(\"fill\",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get(\"fill-pattern\").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Mt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer \"${t}\"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Qg),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,e,r,i,n,a){for(let s of Ba(e,500)){let o=Fd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;kd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};I(\"FillBucket\",Id,{omit:[\"layers\",\"patternFeatures\"]});var oc,Fx=()=>oc||(oc=new jt({\"fill-sort-key\":new U(D.layout_fill[\"fill-sort-key\"],\"fill-sort-key\")})),lc,Tx=()=>lc||(lc=new jt({\"fill-antialias\":new L(D.paint_fill[\"fill-antialias\"],\"fill-antialias\"),\"fill-opacity\":new U(D.paint_fill[\"fill-opacity\"],\"fill-opacity\"),\"fill-layer
1646-opacity\":new L(D.paint_fill[\"fill-layer-opacity\"],\"fill-layer-opacity\"),\"fill-color\":new U(D.paint_fill[\"fill-color\"],\"fill-color\"),\"fill-outline-color\":new U(D.paint_fill[\"fill-outline-color\"],\"fill-outline-color\"),\"fill-translate\":new L(D.paint_fill[\"fill-translate\"],\"fill-translate\"),\"fill-translate-anchor\":new L(D.paint_fill[\"fill-translate-anchor\"],\"fill-translate-anchor\"),\"fill-pattern\":new nn(D.paint_fill[\"fill-pattern\"],\"fill-pattern\")})),kx={get paint(){return Tx()},get layout(){return Fx()}};var Ix=class extends pe{constructor(t,e){super(t,kx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values[\"fill-outline-color\"];r.value.kind===\"constant\"&&r.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(t){return new Id(t)}queryRadius(){return ja(this.paint.get(\"fill-translate\"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return yd(Ga(t,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Go=St([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),Cx=St([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),Mx=Go.members;Go.size,Go.alignment;var wa=class Yo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Yo;return r.extend(e(new M(this.minX,this.minY))),r.extend(e(new M(this.maxX,this.minY))),r.extend(e(new M(this.minX,this.maxY))),r.extend(e(new M(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Yo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},f5=wa.fromPoints([new M(0,0),new M(mt,mt)]);function Xo(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function uc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var vn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos<e;){let a=t.readVarint();if(a===8)this.id=t.readVarint();else if(a===18){let s=t.readVarint()+t.pos;for(;t.pos<s;){let o=i[t.readVarint()],l=n[t.readVarint()];this.properties[o]=l}}else a===24?this.type=t.readVarint():(a===34&&(this._geometry=t.pos),t.skip(a))}}loadGeometry(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=[],i,n=1,a=0,s=0,o=0;for(;t.pos<e;){if(a<=0){let l=t.readVarint();if(n=l&7,a=l>>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new M(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new M(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error(\"feature has no geometry\");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos<e;){if(i<=0){let h=t.readVarint();if(r=h&7,i=h>>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>u&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;
1646if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:\"Point\",coordinates:p[0]}:{type:\"MultiPoint\",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:\"LineString\",coordinates:c[0]}:{type:\"MultiLineString\",coordinates:c}}else if(this.type===3){let c=Cd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:\"Polygon\",coordinates:p[0]}:{type:\"MultiPolygon\",coordinates:p}}else throw Error(\"unknown feature type\");let h={type:\"Feature\",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};vn.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];function Cd(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a<e;a++){let s=Bx(t[a]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[a]]):i&&i.push(t[a]))}return i&&r.push(i),r}function Bx(t){let e=0;for(let r=0,i=t.length,n=i-1,a,s;r<i;n=r++)a=t[r],s=t[n],e+=(s.x-a.x)*(a.y+s.y);return e}var Px=class{constructor(t,e){for(this.version=1,this.name=\"\",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],e===void 0&&(e=t.length);t.pos<e;){let r=t.readVarint();r===10?this.name=t.readString():r===18?(this._features.push(t.pos),t.skip(r)):r===26?this._keys.push(t.readString()):r===34?this._values.push(zx(t)):r===40?this.extent=t.readVarint():r===120?this.version=t.readVarint():t.skip(r)}this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw Error(\"feature index out of bounds\");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new vn(this._pbf,e,this.extent,this._keys,this._values)}};function zx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint();e=i===10?t.readString():i===21?t.readFloat():i===25?t.readDouble():i===32?t.readVarint(!0):i===40?t.readVarint():i===48?t.readSVarint():i===56?t.readBoolean():(t.skip(i),null)}if(e==null)throw Error(\"unknown feature value\");return e}var Yl=class{constructor(t,e=t.length){let r=Object.create(null);for(;t.pos<e;){let i=t.readVarint();if(i===26){let n=new Px(t,t.readVarint()+t.pos);n.length&&(r[n.name]=n)}else t.skip(i)}this.layers=r}},Md=63710088e-1,hc=class Ri{constructor(e,r){if(isNaN(e)||isNaN(r))throw Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new Ri(R1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return Md*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ri)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ri(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==\"object\"&&e)return new Ri(Number(\"lng\"in e?e.lng:e.lon),Number(e.lat));throw 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>]\")}},Bd=2*Math.PI*Md;function Pd(t){return Bd*Math.cos(t*Math.PI/180)}function Lx(t){return(180+t)/360}function Vx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ox(t,e){return t/Pd(e)}function Rx(t){return t*360-180}function Wo(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function $x(t,e){return t*Pd(Wo(e))}function Nx(t){return 1/Math.cos(t*Math.PI/180)}var Xl=class zd{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=hc.convert(e);return new zd(Lx(i.lng),Vx(i.lat),Ox(r,i.lat))}toLngLat(){return new hc(Rx(this.x),Wo(this.y))}toAltitude(){return $x(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Bd*Nx(Wo(this.y))}};function Ux(t,e,r){let i=1/(1<<r.z);return new Xl(t/mt*i+r.x*i,e/mt*i+r.y*i)}function qx(t,e,r){return Ux(t,e,r).toLngLat()}function jx(t,e){return e<=0||!t||t.length===0?t:t.map(r=>Yx(r,e))}function Gx(t,e){let r=qx(mt/2,mt/2,e),i=Xl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<<e.z)*mt;return t*i*n}function Yx(t,e){if(!t||t.length<3)return t;let r=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,i=r?t.length-1:t.length;if(i<3)return t;let n=[],a=Xo(t[i-1],t[0]);for(let o=0;o<i;o++){let l=t[(o-1+i)%i],u=t[o],h=t[(o+1)%i],c=Xo(u,h);a||c?n.push(u.clone()):Wx(n,l,u,h,e),a=c}let s=Xx(n);return s.length<3?t:(r&&s.push(s[0].clone()),s)}function Xx(t){let e=[];for(let r of t){let i=r.round(),n=e[e.length-1];(n?.x!==i.x||n?.y!==i.y)&&e.push(i)}for(;e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}
vendor: 4,404 bytes, line 1646
1646function Wx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var Rs=8192;function ki(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*Rs)*2+s,n*Rs*2,a*Rs*2,Math.round(o))}var Ld=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new lg,this.centroidVertexArray=new ag,this.indexArray=new xn,this.programConfigurations=new gr(t.layers,t.zoom),this.segments=new te,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=xa(\"fill-extrusion\",this.layers,e);let i=new at(this.zoom),n=this.layers[0],a=n.layout.get(\"fill-extrusion-rounded-corner-distance\"),s=a>0?Gx(a,r):0,o=n._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=li(l,o);if(!n._featureFilter.filter(i,p,r))continue;let f={id:u,sourceLayerIndex:c,index:h,geometry:jx(o?p.geometry:Dr(l),s),properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(Gl(\"fill-extrusion\",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,h,r,{},e.subdivisionGranularity),e.featureIndex.insert(l,f.geometry,h,c,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Mx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Cx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ba(e,500)){let o={x:0,y:0,sampleCount:0},l=this.layoutVertexArray.length;this.processPolygon(o,i,t,s,a);let u=this.layoutVertexArray.length-l,h=Math.floor(o.x/o.sampleCount),c=Math.floor(o.y/o.sampleCount);for(let p=0;p<u;p++)this.centroidVertexArray.emplaceBack(h,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}processPolygon(t,e,r,i,n){if(i.length<1||uc(i[0]))return;for(let h of i)h.length!==0&&Zx(t,h);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(e.z),o=vn.types[r.type]===\"Polygon\";for(let h of i){if(h.length===0||uc(h))continue;let c=hr(h,s,o);this._generateSideFaces(c,a)}if(!o)return;let l=Fd(i,e,s,!1),u=this.layoutVertexArray;kd((h,c)=>{ki(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;i<t.length;i++){let n=t[i],a=t[i-1];if(Xo(n,a))continue;e.segment.vertexLength+4>te.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),ki(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),ki(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,ki(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),ki(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function Zx(t,e){for(let r=0;r<e.length;r++){let i=e[r];(r!==e.length-1||e[0].x!==i.x||e[0].y!==i.y)&&(t.x+=i.x,t.y+=i.y,t.sampleC
1646ount++)}}I(\"FillExtrusionBucket\",Ld,{omit:[\"layers\",\"features\"]});var cc,Hx=()=>cc||(cc=new jt({\"fill-extrusion-rounded-corner-distance\":new L(D[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"],\"fill-extrusion-rounded-corner-distance\")})),pc,Kx=()=>pc||(pc=new jt({\"fill-extrusion-opacity\":new L(D[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"],\"fill-extrusion-opacity\"),\"fill-extrusion-color\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-color\"],\"fill-extrusion-color\"),\"fill-extrusion-translate\":new L(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"],\"fill-extrusion-translate\"),\"fill-extrusion-translate-anchor\":new L(D[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"],\"fill-extrusion-translate-anchor\"),\"fill-extrusion-pattern\":new nn(D[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"],\"fill-extrusion-pattern\"),\"fill-extrusion-height\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-height\"],\"fill-extrusion-height\"),\"fill-extrusion-base\":new U(D[\"paint_fill-extrusion\"][\"fill-extrusion-base\"],\"fill-extrusion-base\"),\"fill-extrusion-vertical-gradient\":new L(D[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"],\"fill-extrusion-vertical-gradient\")})),Jx={get paint(){return Kx()},get layout(){return Hx()}};var Qx=class extends pe{constructor(t,e){super(t,Jx,e)}createBucket(t){return new Ld(t)}queryRadius(){return ja(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ga(t,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),-n.bearingInRadians,a),l=this.paint.get(\"fill-extrusion-height\").evaluate(e,r),u=this.paint.get(\"fill-extrusion-base\").evaluate(e,r),h=r2(o,s,0),c=e2(i,u,l,s),p=c[0],f=c[1];return t2(p,f,h)}};function Ii(t,e){return t.x*e.x+t.y*e.y}function fc(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r<e.length;r++){let a=e[r],s=t[0],o=n.sub(i),l=a.sub(i),u=s.sub(i),h=Ii(o,o),c=Ii(o,l),p=Ii(l,l),f=Ii(u,o),d=Ii(u,l),y=h*p-c*c,m=(p*f-c*d)/y,g=(h*d-c*f)/y,x=1-m-g,b=i.z*x+n.z*m+a.z*g;if(isFinite(b))return b}return 1/0}{let r=1/0;for(let i of e)r=Math.min(r,i.z);return r}}function t2(t,e,r){let i=1/0;yd(r,e)&&(i=fc(r,e[0]));for(let n=0;n<e.length;n++){let a=e[n],s=t[n];for(let o=0;o<a.length-1;o++){let l=a[o],u=a[o+1],h=s[o],c=[l,u,s[o+1],h,l];Sg(r,c)&&(i=Math.min(i,fc(r,c)))}}return i!==1/0&&i}function e2(t,e,r,i){let n=[],a=[],s=i[8]*e,o=i[9]*e,l=i[10]*e,u=i[11]*e,h=i[8]*r,c=i[9]*r,p=i[10]*r,f=i[11]*r;for(let d of t){let y=[],m=[];for(let g of d){let x=g.x,b=g.y,v=i[0]*x+i[4]*b+i[12],w=i[1]*x+i[5]*b+i[13],_=i[2]*x+i[6]*b+i[14],A=i[3]*x+i[7]*b+i[15],S=v+s,F=w+o,V=_+l,O=A+u,P=v+h,R=w+c,E=_+p,$=A+f,z=new M(S/O,F/O);z.z=V/O,y.push(z);let B=new M(P/$,R/$);B.z=E/$,m.push(B)}n.push(y),a.push(m)}return[n,a]}function r2(t,e,r){let i=[];for(let n of t){let a=[n.x,n.y,r,1];B1(a,a,e),i.push(new M(a[0]/a[3],a[1]/a[3]))}return i}function Zo(t,e,r,i){let n=i,a=e+(r-e>>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;p<r;p+=3){let f=i2(t[p],t[p+1],l,u,h,c);if(f>n){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);d<s&&(o=p,s=d)}}n>i&&(o-e>3&&Zo(t,e,o,i),t[o+2]=n,r-o>3&&Zo(t,o,r,i))}function i2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Ct(t,e,r,i){let n={type:e,geom:r},a={id:t??null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case\"Point\":case\"MultiPoint\":Ci(a,n.geom);break;case\"LineString\":Ci(a,n.geom.points);break;case\"Polygon\":Ci(a,n.geom[0].points);break;case\"MultiLineString\":for(let s of n.geom)Ci(a,s.points);break;case\"MultiPolygon\":for(let s of n.geom)Ci(a,s[0].points)}return a}function Wl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Ci(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Zl(t,e){let r=[];switch(t.type){case\"FeatureCollection\":for(let i=0;i<t.features.length;i++)oa(r,t.features[i],e,i);break;case\"Feature\":oa(r,t,e);break;default:oa(r,{type:\"Feature\",geometry:t,properties:void 0},e)}return r}function oa(t,e,r,i,n=0){if(!e.geometry)return;if(n>
16461024)throw Error(\"GeometryCollection nesting exceeds supported depth: 1024\");if(e.geometry.type===\"GeometryCollection\"){a2(t,e,e.geometry,r,i,n+1);return}if(!e.geometry.coordinates?.length)return;let a=n2(e,r,i),s=(r.tolerance/((1<<r.maxZoom)*r.extent))**2;switch(e.geometry.type){case\"Point\":s2(t,a,e.geometry,e.properties);return;case\"MultiPoint\":o2(t,a,e.geometry,e.properties);return;case\"LineString\":l2(t,a,e.geometry,s,e.properties);return;case\"MultiLineString\":u2(t,a,e.geometry,s,r,e.properties);return;case\"Polygon\":h2(t,a,e.geometry,s,e.properties);return;case\"MultiPolygon\":c2(t,a,e.geometry,s,e.properties);return;default:throw Error(\"Input data is not a valid GeoJSON object.\")}}function n2(t,e,r){return e.promoteId?t.properties?.[e.promoteId]:e.generateId?r||0:t.id}function a2(t,e,r,i,n,a=0){for(let s of r.geometries)oa(t,{id:e.id,type:\"Feature\",geometry:s,properties:e.properties},i,n,a)}function s2(t,e,r,i){let n=[];n.push(Xr(r.coordinates[0]),Wr(r.coordinates[1]),0),t.push(Ct(e,\"Point\",n,i))}function o2(t,e,r,i){let n=[];for(let a of r.coordinates)n.push(Xr(a[0]),Wr(a[1]),0);t.push(Ct(e,\"MultiPoint\",n,i))}function l2(t,e,r,i,n){let a={points:[]};Hl(r.coordinates,a,i,!1),t.push(Ct(e,\"LineString\",a,n))}function u2(t,e,r,i,n,a){if(n.lineMetrics)for(let s of r.coordinates){let o={points:[]};Hl(s,o,i,!1),t.push(Ct(e,\"LineString\",o,a))}else{let s=[];Kl(r.coordinates,s,i,!1),t.push(Ct(e,\"MultiLineString\",s,a))}}function h2(t,e,r,i,n){let a=[];Kl(r.coordinates,a,i,!0),t.push(Ct(e,\"Polygon\",a,n))}function c2(t,e,r,i,n){let a=[];for(let s of r.coordinates){let o=[];Kl(s,o,i,!0),a.push(o)}t.push(Ct(e,\"MultiPolygon\",a,n))}function Hl(t,e,r,i){let n,a,s=0;for(let l=0;l<t.length;l++){let u=Xr(t[l][0]),h=Wr(t[l][1]);e.points.push(u,h,0),l>0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Zo(e.points,0,o,r),e.points[o+2]=1,Wl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function Kl(t,e,r,i){for(let n=0;n<t.length;n++){let a={points:[]};Hl(t[n],a,r,i),e.push(a)}}function Xr(t){return t/360+.5}function Wr(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function p2(t){return{type:\"FeatureCollection\",features:t.map(e=>Da(e))}}function Da(t){let e={type:\"Feature\",geometry:f2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function f2(t){let{type:e,geometry:r}=t;switch(e){case\"Point\":return{type:e,coordinates:Vd(r[0],r[1])};case\"MultiPoint\":return{type:e,coordinates:Xn(r)};case\"LineString\":return{type:e,coordinates:Xn(r.points)};case\"MultiLineString\":case\"Polygon\":return{type:e,coordinates:r.map(i=>Xn(i.points))};case\"MultiPolygon\":return{type:e,coordinates:r.map(i=>i.map(n=>Xn(n.points)))}}}function Xn(t){let e=[];for(let r=0;r<t.length;r+=3)e.push(Vd(t[r],t[r+1]));return e}function Vd(t,e){return[Od(t),Rd(e)]}function Od(t){return(t-.5)*360}function Rd(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ke(t,e,r,i,n,a,s,o){if(r/=e,i/=e,a>=r&&s<i)return t;if(s<r||a>=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c<i){l.push(u);continue}if(!(c<r||h>=i))switch(u.type){case\"Point\":case\"MultiPoint\":d2(u,l,r,i,n);continue;case\"LineString\":y2(u,l,r,i,n,o);continue;case\"MultiLineString\":m2(u,l,r,i,n);continue;case\"Polygon\":g2(u,l,r,i,n);continue;case\"MultiPolygon\":x2(u,l,r,i,n);continue}}return l.length?l:null}function d2(t,e,r,i,n){let a=[];if(v2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?\"Point\":\"MultiPoint\";e.push(Ct(t.id,s,a,t.tags))}function y2(t,e,r,i,n,a){let s=[];if($d(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Ct(t.id,\"LineString\",o,t.tags));return}if(s.length>1){e.push(Ct(t.id,\"MultiLineString\",s,t.tags));return}e.push(Ct(t.id,\"LineString\",s[0],t.tags))}}function m2(t,e,r,i,n){let a=[];if(Jl(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Ct(t.id,\"LineString\",a[0],t.tags));return}e.push(Ct(t.id,\"MultiLineString\",a,t.tags))}}function g2(t,e,r,i,n){let a=[];Jl(t.geometry,a,r,i,n,!0),a.length&&e.push(Ct(t.id,\"Polygon\",a,t.tags))}function x2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];Jl(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Ct(t.id,\"MultiPolygon\",a,t.tags))}function v2(t,e,r,i,n){for(let a=0;a<t.length;a+=3){let s=t[a+n];s>=r&&s<=i&&Zr(e,t[a],t[a+1],t[a+2])}}function $d(t,e,r,i,n,a,s){let o=dc(t),l=n===0?b2:w2,u=t.start,h,c;for(let g=0;g<t.points.length-3;g+=3){let x=t.points[g],b=t.points[g+1],v=t.points[g+2],w=t.points[g+3],_=t.points[g+4],A=n===0?x:b,S=n===0?w:_,F=!1;s&&(h=Math.sqrt((x-w)**2+(b-_)**2)),A<r?S>r&&(c=l(o,x,b,w,_,r),s&&(o.start=u+h*c)):A>i?S<i&&(c=l(o,x,b,w,_,i),s&&(o.start=u+h*c)):Zr(o.points,x,b,v),S<r&&A>=r&&(c=l(o,x,b,w,_,r),F=!0),S>i&&A<=i&&(c=l(o,x,b,w,_,i),F=!0),!a&&F&&(s&&(o.end=u+h*c),e.push(o),o=dc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Zr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Zr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Wl(o),e.push(o))}function dc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function Jl(t,e,r,i,n,a){for(let s of t)$d(s,e,r,i,n,a,!1)}function Zr(t,e,r,i){t.push(e,r,i)}function b2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Zr(t.points,a,r+(n-r)*s,1),s}function w2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Zr(t.points,e+(i-e)*s,a,1),s}function Ql(t,e){let r=e.buffer/e.extent,i=t,n=ke(t,1,-1-r,r,0,-1,2,e),a=ke(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=ke(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=yc(n,1).concat(i)),a&&(i=i.concat(yc(a,-1)))),i}function yc(t,e){let r=[];for(let i of t)switch(i.type){case\"Point\":case\"MultiPoint\":{let n=D2(i.geometry,e);
1646r.push(Ct(i.id,i.type,n,i.tags));continue}case\"LineString\":{let n=$s(i.geometry,e);r.push(Ct(i.id,i.type,n,i.tags));continue}case\"MultiLineString\":case\"Polygon\":{let n=[];for(let a of i.geometry)n.push($s(a,e));r.push(Ct(i.id,i.type,n,i.tags));continue}case\"MultiPolygon\":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push($s(o,e));n.push(s)}r.push(Ct(i.id,i.type,n,i.tags));continue}}return r}function D2(t,e){let r=[];for(let i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function $s(t,e){let r={points:[],size:t.size};t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let i=0;i<t.points.length;i+=3)r.points.push(t.points[i]+e,t.points[i+1],t.points[i+2]);return Wl(r),r}function _2(t,e,r){let i=S2(e,r),n=[];if(i.removeAll&&(n=t,t=[]),i.remove.size||i.add.size){let a=[];for(let s of t)(i.remove.has(s.id)||i.add.has(s.id))&&a.push(s);if(a.length){n=n.concat(a);let s=new Set(a.map(o=>o.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Zl({type:\"FeatureCollection\",features:Array.from(i.add.values())},r);s=Ql(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=A2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function A2(t,e,r){let i=!!e.newGeometry,n=e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0;if(i){let a=t[0],s=Zl({type:\"FeatureCollection\",features:[{type:\"Feature\",id:a.id,geometry:e.newGeometry,properties:n?mc(a.tags,e):a.tags}]},r);return s=Ql(s,r),s}if(n){let a=[];for(let s of t){let o={...s};o.tags=mc(o.tags,e),a.push(o)}return a}return t}function mc(t,e){if(e.removeAllProperties)return{};let r={...t||{}};if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function S2(t,e){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(r=>[e.promoteId?r.properties[e.promoteId]:r.id,r])),update:new Map(t.update?.map(r=>[r.id,r]))}:{remove:new Set,add:new Map,update:new Map}}var gc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),E2=class Nd{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error(\"Data does not appear to be in a KDBush format.\");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=gc[i&15];if(!a)throw Error(\"Unrecognized array type.\");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Nd(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=gc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ho(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>
vendor: 6,544 bytes, line 1646
1646=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error(\"Data not yet indexed - call index.finish().\");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)xc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];xc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function Ho(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Ud(t,e,s,i,n,a),Ho(t,e,r,i,s-1,1-a),Ho(t,e,r,s+1,n,1-a)}function Ud(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Ud(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(Mi(t,e,i,r),e[2*n+a]>s&&Mi(t,e,i,n);o<l;){for(Mi(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?Mi(t,e,i,l):(l++,Mi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Mi(t,e,r,i){Ns(t,r,i),Ns(e,2*r,2*i),Ns(e,2*r+1,2*i+1)}function Ns(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function xc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Ko={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},F2=class{constructor(t){this.options=Object.assign(Object.create(Ko),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Xr(i),Wr(n)],o={id:r.id,type:\"Point\",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type===\"Point\"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(Ko),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time(\"total time\");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o<t.length;o++){let l=t[o];if(!l?.geometry)continue;let[u,h]=l.geometry;u=Math.fround(u),h=Math.fround(h),a.push(u,h,1/0,o,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this.createTree(a);e&&console.timeEnd(n);for(let o=i;o>=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log(\"z%d: %d clusters in %dms\",o,s.numItems,Date.now()-l)}e&&console.timeEnd(\"total time\")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>Da(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Xr(r),Wr(a),Xr(n),Wr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?T2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error(\"No cluster with the specified id: \"+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?k2(a,p,this.clusterProps):Da(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o?.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n}createTree(t){let e=new E2(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<t.length;r+=this.stride)e.add(t[r],t[r+1]);return e.finish(),e.flatData=t,e.data=null,e}addTileFeatures(t,e,r,i,n,a){for(let s of t){let o=s*this.stride,l=e[o+5]>1,u,h,c;if(l)u=tu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;h<o.length;h+=u){if(o[h+2]<=e)continue;o[h+2]=e;let c=o[h],p=o[h+1],f=t.within(o[h],o[h+1],s),d=o[h+5],y=d;for(let m of f){let g=m*u;o[g+2]>e&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,b=-1,v=((h/u|0)<<5)+(e+1)+this.points.length;for(let w of f){let _=w*u;if(o[_+2]<=e)continue;o[_+2]=e;let A=o[_+5];m+=o[_]*A,g+=o[_+1]*A,o[_+4]=v,n&&(x||(x=this.map(o,h,!0),b=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,_)))}o[h+4]=v,l.push(m/y,g/y,1/0,v,-1,y),n&&l.push(b)}else{for(let m=0;m<u;m++)l.push(o[h+m]);if(y>1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x<u;x++)l.push(o[g+x])}}}}return l}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function T2(t,e,r){return{id:t[e+3],type:\"Point\",tags:tu(t,e,r),geometry:[t[e],t[e+1]]}}function k2(t,e,r){return{type:\"Feature\",id:t[e+3],properties:tu(t,e,r),geometry:{type:\"Point\",coordinates:[Od(t[e]),Rd(t[e+1])]}}}function tu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}
1646k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var qd=\"geojsonvt_clip_start\",jd=\"geojsonvt_clip_end\";function vc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),s={transformed:!1,features:[],source:null,x:r,y:i,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length};for(let o of t)I2(s,o,a,n);return s}function I2(t,e,r,i){switch(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type){case\"Point\":case\"MultiPoint\":C2(t,e);return;case\"LineString\":M2(t,e,r,i);return;case\"MultiLineString\":case\"Polygon\":B2(t,e,r);return;case\"MultiPolygon\":P2(t,e,r);return}}function C2(t,e){let r=[];for(let n=0;n<e.geometry.length;n+=3)r.push(e.geometry[n],e.geometry[n+1]),t.numPoints++,t.numSimplified++;if(!r.length)return;let i={type:1,tags:e.tags||null,geometry:r};e.id!==null&&(i.id=e.id),t.features.push(i)}function M2(t,e,r,i){let n=[];if(eu(n,e.geometry,t,r,!1,!1),!n.length)return;let a=e.tags||null;if(i.lineMetrics){a={};for(let o in e.tags)a[o]=e.tags[o];a[qd]=e.geometry.start/e.geometry.size,a[jd]=e.geometry.end/e.geometry.size}let s={type:2,tags:a,geometry:n};e.id!==null&&(s.id=e.id),t.features.push(s)}function B2(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++)eu(i,e.geometry[a],t,r,e.type===\"Polygon\",a===0);if(!i.length)return;let n={type:e.type===\"Polygon\"?3:2,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function P2(t,e,r){let i=[];for(let a=0;a<e.geometry.length;a++){let s=e.geometry[a];for(let o=0;o<s.length;o++)eu(i,s[o],t,r,!0,o===0)}if(!i.length)return;let n={type:3,tags:e.tags||null,geometry:i};e.id!==null&&(n.id=e.id),t.features.push(n)}function eu(t,e,r,i,n,a){let s=i*i;if(i>0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;l<e.points.length;l+=3)(i===0||e.points[l+2]>s)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&z2(o,a),t.push(o)}function z2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i<n;a=i,i+=2)r+=(t[i]-t[a])*(t[i+1]+t[a+1]);if(r>0===e)for(let i=0,n=t.length;i<n/2;i+=2){let a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}function bc(t,e){if(t.transformed)return t;let r=1<<t.z,i=t.x,n=t.y;for(let a of t.features)a.type===1?L2(a,e,r,i,n):V2(a,e,r,i,n);return t.transformed=!0,t}function L2(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l=0;l<s.length;l+=2)o.push(Gd(s[l],s[l+1],e,r,i,n));return a.geometry=o,a}function V2(t,e,r,i,n){let a=t,s=t.geometry,o=[];for(let l of s){let u=[];for(let h=0;h<l.length;h+=2)u.push(Gd(l[h],l[h+1],e,r,i,n));o.push(u)}return a.geometry=o,a}function Gd(t,e,r,i,n,a){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-a))]}var O2=class{constructor(t){this.options=t,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(t,0,0,0),this.options.debug&&(t.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)))}updateIndex(t,e,r){r.debug>1&&(console.log(\"invalidating tiles\"),console.time(\"invalidating\")),this.invalidateTiles(e),r.debug>1&&console.timeEnd(\"invalidating\");let[i,n,a]=[0,0,0],s=vc(t,i,n,a,r);s.source=t;let o=Wn(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<<t;e=e+a&a-1;let s=Wn(t,e,r);if(this.tiles[s])return bc(this.tiles[s],i);n>1&&console.log(\"drilling down to z%d-%d-%d\",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Wn(o,l,u)];return!h?.source||(n>1&&(console.log(\"found parent tile z%d-%d-%d\",o,l,u),console.time(\"drilling down\")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd(\"drilling down\"),!this.tiles[s])?null:bc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<<e,c=Wn(e,r,i),p=this.tiles[c];if(!p&&(u>1&&console.time(\"creation\"),p=this.tiles[c]=vc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd(\"creation\"));let A=`z${e}`;this.stats[A]=(this.stats[A]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let A=n-e;if(r!==a>>A||i!==s>>A)continue}}if(p.source=null,!t.length)continue;u>1&&console.time(\"clipping\");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,b=null,v=null,w=ke(t,h,r-f,r+y,0,p.minX,p.maxX,l),_=ke(t,h,r+d,r+m,0,p.minX,p.maxX,l);w&&(g=ke(w,h,i-f,i+y,1,p.minY,p.maxY,l),x=ke(w,h,i+d,i+m,1,p.minY,p.maxY,l)),_&&(b=ke(_,h,i-f,i+y,1,p.minY,p.maxY,l),v=ke(_,h,i+d,i+m,1,p.minY,p.maxY,l)),u>
16461&&console.timeEnd(\"clipping\"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(b||[],e+1,r*2+1,i*2),o.push(v||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<<h.z,p=(h.x-o)/c,f=(h.x+1+o)/c,d=(h.y-o)/c,y=(h.y+1+o)/c;if(n<p||i>=f||s<d||a>=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX<f&&g.maxY>=d&&g.minY<y){m=!0;break}if(m){if(r){r>1&&console.log(\"invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Wn(t,e,r){return((1<<t)*r+e)*32+t}var R2={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Ko,debug:0},Yd=class{constructor(t,e){e=this.options=Object.assign({},R2,e);let r=e.debug;if(r&&console.time(\"preprocess data\"),e.maxZoom<0||e.maxZoom>24)throw Error(\"maxZoom should be in the 0-24 range\");if(e.promoteId&&e.generateId)throw Error(\"promoteId and generateId cannot be used together.\");let i=Zl(t,e);r&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",e.indexMaxZoom,e.indexMaxPoints),console.time(\"generate tiles\")),i=Ql(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new F2(e.clusterOptions):new O2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error(\"to update tile geojson `updateable` option must be set to true\");let{affected:i,source:n}=_2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(Da(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error(\"to retrieve data the `updateable` option must be set to true\");return p2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Jo=St([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}],4),$2=Jo.members;Jo.size,Jo.alignment;var Qo=St([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),N2=Qo.members;Qo.size,Qo.alignment;var U2=Math.cos(75/2*(Math.PI/180)),Xd=1/2,wc=2**14/Xd,Wd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new ug,this.layoutVertexArray2=new hg,this.indexArray=new xn,this.programConfigurations=new gr(t.layers,t.zoom),this.segments=new te,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=xa(\"line\",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get(\"line-sort-key\"),n=!i.isConstant(),a=[],s=new at(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=li(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Dr(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>
1646l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(xa(\"line\",this.layers,e)?Gl(\"line\",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,N2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,\"geojsonvt_clip_start\")&&Object.hasOwn(t.properties,\"geojsonvt_clip_end\"))return{start:+t.properties[qd],end:+t.properties[jd]}}
1646addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get(\"line-join\").evaluate(t,{}),u=o.get(\"line-cap\").evaluate(t,{}),h=o.get(\"line-miter-limit\").evaluate(t,{}),c=o.get(\"line-round-limit\").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=hr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let b=0;b<t.length-1;b++)this.totalDistance+=t[b].dist(t[b+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u=vn.types[e.type]===\"Polygon\",h=t.length;for(;h>=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c<h-1&&t[c].equals(t[c+1]);)c++;if(h-c<(u?3:2))return;r===\"bevel\"&&(n=1.05);let p=this.overscaling<=16?15*mt/(512*this.overscaling):0,f=this.segments.prepareSegment(h*10,this.layoutVertexArray,this.indexArray),d,y,m,g,x;this.e1=this.e2=-1,u&&(d=t[h-2],x=t[c].sub(d)._unit()._perp());for(let b=c;b<h;b++){if(m=b===h-1?u?t[c+1]:void 0:t[b+1],m&&t[b].equals(m))continue;x&&(g=x),d&&(y=d),d=t[b],x=m?m.sub(d)._unit()._perp():g,g||(g=x);let v=g.add(x);(v.x!==0||v.y!==0)&&v._unit();let w=g.x*x.x+g.y*x.y,_=v.x*x.x+v.y*x.y,A=_===0?1/0:1/_,S=2*Math.sqrt(2-2*_),F=_<U2&&y&&m,V=g.x*x.y-g.y*x.x>0;if(F&&b>c){let R=d.dist(y);if(R>2*p){let E=d.sub(d.sub(y)._mult(p/R)._round());this.updateDistance(y,E),this.addCurrentVertex(E,g,0,0,f),y=E}}let O=y&&m,P=O?r:u?\"butt\":i;if(O&&P===\"round\"&&(A<a?P=\"miter\":A<=2&&(P=\"fakeround\")),P===\"miter\"&&A>n&&(P=\"bevel\"),P===\"bevel\"&&(A>2&&(P=\"flipbevel\"),A<n&&(P=\"miter\")),y&&this.updateDistance(y,d),P===\"miter\")v._mult(A),this.addCurrentVertex(d,v,0,0,f);else if(P===\"flipbevel\"){if(A>100)v=x.mult(-1);else{let R=A*g.add(x).mag()/g.sub(x).mag();v._perp()._mult(R*(V?-1:1))}this.addCurrentVertex(d,v,0,0,f),this.addCurrentVertex(d,v.mult(-1),0,0,f)}else if(P===\"bevel\"||P===\"fakeround\"){let R=-Math.sqrt(A*A-1),E=V?R:0,$=V?0:R;if(y&&this.addCurrentVertex(d,g,E,$,f),P===\"fakeround\"){let z=Math.round(S*180/Math.PI/20);for(let B=1;B<z;B++){let tt=B/z;if(tt!==.5){let pt=tt-.5,st=1.0904+w*(-3.2452+w*(3.55645-w*1.43519)),ft=.848013+w*(-1.06021+w*.215638);tt+=tt*pt*(tt-1)*(st*pt*pt+ft)}let it=x.sub(g)._mult(tt)._add(g)._unit()._mult(V?-1:1);this.addHalfVertex(d,it.x,it.y,!1,V,0,f)}}m&&this.addCurrentVertex(d,x,-E,-$,f)}else if(P===\"butt\")this.addCurrentVertex(d,v,0,0,f);else if(P===\"square\"){let R=y?1:-1;this.addCurrentVertex(d,v,R,R,f)}else P===\"round\"&&(y&&(this.addCurrentVertex(d,g,0,0,f),this.addCurrentVertex(d,g,1,1,f,!0)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0),this.addCurrentVertex(d,x,0,0,f)));if(F&&b<h-1){let R=d.dist(m);if(R>2*p){let E=d.add(m.sub(d)._mult(p/R)._round());this.updateDistance(d,E),this.addCurrentVertex(E,x,0,0,f),d=E}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>wc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(wc-1):this.scaledDistance)*Xd;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get(\"line-dasharray\");
1646if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get(\"line-dasharray\");if(!a||a.value.kind===\"constant\")continue;let s=n.layout.get(\"line-cap\").evaluate(e,{})===\"round\",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(\",\")},${o.round}`,c=`${l.dasharray.join(\",\")},${l.round}`,p=`${u.dasharray.join(\",\")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};I(\"LineBucket\",Wd,{omit:[\"layers\",\"patternFeatures\"]});var Dc,q2=()=>Dc||(Dc=new jt({\"line-cap\":new U(D.layout_line[\"line-cap\"],\"line-cap\"),\"line-join\":new U(D.layout_line[\"line-join\"],\"line-join\"),\"line-miter-limit\":new U(D.layout_line[\"line-miter-limit\"],\"line-miter-limit\"),\"line-round-limit\":new U(D.layout_line[\"line-round-limit\"],\"line-round-limit\"),\"line-sort-key\":new U(D.layout_line[\"line-sort-key\"],\"line-sort-key\")})),_c,j2=()=>_c||(_c=new jt({\"line-opacity\":new U(D.paint_line[\"line-opacity\"],\"line-opacity\"),\"line-layer-opacity\":new L(D.paint_line[\"line-layer-opacity\"],\"line-layer-opacity\"),\"line-color\":new U(D.paint_line[\"line-color\"],\"line-color\"),\"line-translate\":new L(D.paint_line[\"line-translate\"],\"line-translate\"),\"line-translate-anchor\":new L(D.paint_line[\"line-translate-anchor\"],\"line-translate-anchor\"),\"line-width\":new U(D.paint_line[\"line-width\"],\"line-width\"),\"line-gap-width\":new U(D.paint_line[\"line-gap-width\"],\"line-gap-width\"),\"line-offset\":new U(D.paint_line[\"line-offset\"],\"line-offset\"),\"line-blur\":new U(D.paint_line[\"line-blur\"],\"line-blur\"),\"line-dasharray\":new nn(D.paint_line[\"line-dasharray\"],\"line-dasharray\"),\"line-pattern\":new nn(D.paint_line[\"line-pattern\"],\"line-pattern\"),\"line-gradient\":new Ua(D.paint_line[\"line-gradient\"],\"line-gradient\")})),Ac={get paint(){return j2()},get layout(){return q2()}},G2=class extends U{possiblyEvaluate(t,e){return e=new at(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=qt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Zn;var Y2=class extends pe{constructor(t,e){super(t,Ac,e),this.gradientVersion=0,Zn||(Zn=new G2(Ac.paint.properties[\"line-width\"].specification,\"line-floorwidth\"),Zn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t===\"line-gradient\"){let e=this.gradientExpression();this.stepInterpolant=bm(e)?e._styleExpression.expression instanceof vl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values[\"line-floorwidth\"]=Zn.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,t)}createBucket(t){return new Wd(t)}queryRadius(t){let e=t,r=Sc(Yr(\"line-width\",this,e),Yr(\"line-gap-width\",this,e)),i=Yr(\"line-offset\",this,e);return r/2+Math.abs(i)+ja(this.paint.get(\"line-translate\"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ga(t,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),-n.bearingInRadians,a),o=a/2*Sc(this.paint.get(\"line-width\").evaluate(e,r),this.paint.get(\"line-gap-width\").evaluate(e,r)),l=this.paint.get(\"line-offset\").evaluate(e,r);return l&&(i=Mg(i,l*a)),Eg(s,i,o)}isTileClipped(){return!0}};function Sc(t,e){return e>0?e+2*t:t}var X2=St([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"},{name:\"a_height_offset\",components:1,type:\"Float32\"}],4),W2=St([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);St([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);var Z2=St([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"},{name:\"a_box_real\",components:2,type:\"Int16\"}]);St([{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\"}]);var Ec=St([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4),d5=St([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4);St([{name:\"triangle\",components:3,type:\"Uint16\"}]),St([{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\"},{type:\"Float32\",name:\"heightOffset\"}]),St([{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\"},{type:\"Float32\",name:\"heightOffset\"}]),St([{type:\"Float32\",name:\"offsetX\"}]),St([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),St([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);var vr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(vr.isParsed())throw Error(\"RTL text plugin already registered.\");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}
1646async syncState(t,e){if(this.isParsed())return this.getState();if(t.pluginStatus!==\"loading\")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(await e(r),await Promise.race([i,n]),this.isParsed()){let a={pluginStatus:\"loaded\",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:\"error\",pluginURL:\"\"}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function H2(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function K2(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function J2(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Xa(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function Q2(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function tv
vendor: 4,669 bytes, line 1646
1646(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function
1646Fc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function ev(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||/^\\p{gc=Mc}/u.test(e)}var rv={C:\"18g,1;g2,3;4nb,1\",D:\"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f\",R:\"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1\",T:\"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1\"},i
vendor: 2,288 bytes, line 1646
1646v={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},
1646nv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},Tc=1604,av=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function sv(t,e,r){let i=0;for(let n of t.split(\";\")){let[a,s]=n.split(\",\").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l<o+s;l++)r.set(l,e);i=o+s}}var Zd=new Map;for(let[t,e]of Object.entries(rv))sv(e,t,Zd);function ov(t){return Zd.get(t)??\"U\"}function lv(t){return t===\"D\"||t===\"L\"||t===\"C\"}function uv(t){return t===\"D\"||t===\"R\"||t===\"C\"}function hv(t,e,r){return t===\"D\"?e&&r?3:e?1:r?2:0:t===\"R\"?+!!e:t===\"L\"?r?2:0:null}function cv(t){return[...t].map(e=>{let r=e.codePointAt(0);return{codePoint:r,type:ov(r),form:null}})}function pv(t){let e=t.filter(r=>r.type!==\"T\");for(let r=0;r<e.length;r++){let i=e[r],n=r>0&&lv(e[r-1].type),a=r+1<e.length&&uv(e[r+1].type);i.form=hv(i.type,n,a)}}function fv(t){let e=!1;for(let r of t)r.type===\"T\"?r.form=e?3:0:e=r.form===2||r.form===3}function dv(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.codePoint!==Tc){e.push(i);continue}let n=r+1;for(;n<t.length&&t[n].type===\"T\";)n++;let a=t[n],s=a&&nv[String.fromCodePoint(Tc,a.codePoint)];if(!s){e.push(i);continue}let o=i.form===3||i.form===1;e.push({codePoint:s[+!!o],type:\"R\",form:0}),e.push(...t.slice(r+1,n)),r=n}return e}function yv(t){if(t.form===null)return t.codePoint;let e=iv[t.codePoint];return e&&(e[t.form]||e[0])||t.codePoint}function mv(t){if(!av.test(t))return t;let e=cv(t);return pv(e),fv(e),dv(e).map(r=>String.fromCodePoint(yv(r))).join(\"\")}function gv(t,e,r){let i=e.layout.get(\"text-transform\").evaluate(r,{});return i===\"uppercase\"?t=t.toLocaleUpperCase():i===\"lowercase\"&&(t=t.toLocaleLowerCase()),(vr.applyArabicShaping??mv)(t)}function xv(t,e,r){for(let i of t.sections)i.text=gv(i.text,e,r);return t}function Us(t,e,r){let i=r?e.last.points:e.first.points,n=r?i[i.length-1]:i[0];return`${t}:${n.x}:${n.y}`}function vv(t){let e=t.first.points,r=e.length;for(let a=t.first.next;a;a=a.next)r+=a.points.length-1;let i=Array(r);for(let a=0;a<e.length;a++)i[a]=e[a];let n=e.length;for(let a=t.first.next;a;a=a.next){let s=a.points;for(let o=1;o<s.length;o++)i[n++]=s[o]}return i}function kc(t,e,r,i,n){let a=e[r];delete e[r],e[i]=a;let s=t[a];return s.last.next=n.first,s.last=n.last,a}function Ic(t,e,r,i,n){let a=e[i];delete e[i],e[r]=a;let s=t[a];return n.last.next=s.first,s.first=n.first,a}function bv(t){let e={},r={},i=[];for(let a of t){let s=a.text?a.text.toString():null,o={points:a.geometry[0],next:null},l={feature:a,first:o,last:o};if(!s){i.push(l);continue}let u=Us(s,l),h=Us(s,l,!0);if(u in r&&h in e&&r[u]!==e[h]){let c=Ic(i,e,u,h,l),p=kc(i,r,u,h,i[c]);delete e[u],delete r[h],r[Us(s,i[p],!0)]=p,i[c].feature.geometry=null}else if(u in r)kc(i,r,u,h,l);else if(h in e)Ic(i,e,u,h,l);else{let c=i.push(l)-1;e[u]=c,r[h]=c}}let n=[];for(let a of i){let s=a.feature;s.geometry&&(a.first.next&&(s.geometry[0]=vv(a)),n.push(s))}return n}var Hd=typeof Intl<\"u\"&&\"Segmenter\"in Intl,qs,js;function tl(t){if(!Hd||!tv(t))return[...t];qs??(qs=new Intl.Segmenter(void 0,{granularity:\"grapheme\"}));let e=[];for(let{segment:r}of qs.segment(t)){let i=e.length-1;i>=0&&ev(e[i],r)?e[i]+=r:e.push(r)}return e}function wv(t){let e=new Set;if(Hd){js??(js=new Intl.Segmenter(void 0,{granularity:\"word\"}));for(let{index:i}of js.segment(t))e.add(i);return e}let r=0;for(let i of t.split(/\\b|(?=\\p{Ideo})/u))e.add(r),r+=i.length;return e}function Kd(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function ru(t){return/\\s/u.test(String.fromCodePoint(t))}function el(t){for(let e of t)if(Xa(e.codePointAt(0)))return!0;return!1}function Dv(t){for(let e of t)if(!_v(e.codePointAt(0)))return!1;return!0}function _v(t){return!H2(t)}function Cc(t){return!(Xa(t)||Q2(t))}function Jd(t){return/\\p{sc=Arab}/u.test(String.fromCodePoint(t))}function Qd(t){return K2(t)}function ty(t){for(let e of t)if(Qd(e.codePointAt(0)))return!0;return!1}var qr={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE4
16461\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u22EF\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};function Av(t){let e=\"\",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!Cc(s.value.codePointAt(0))||qr[s.value])&&(r.premature||!Cc(r.value.codePointAt(0))||qr[r.value])&&qr[n.value]?e+=qr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var Sv={10:!0,13:!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},Ev={40:!0};function Mc(t,e,r,i,n,a){if(\"fontStack\"in e){let s=r[e.fontStack],o=s?.[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s?.[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function Bc(t,e,r,i){let n=(t-e)**2;return i?t<e?n/2:n*2:n+Math.abs(r)*r}function Pc(t){return/^\\s+$/u.test(t)}function Fv(t,e,r){let i=0;return(t===10||t===13)&&(i-=1e4),r&&(i+=150),(t===40||t===65288)&&(i+=50),(e===41||e===65289)&&(i+=50),i}function zc(t,e,r,i,n,a){let s=null,o=Bc(e,r,n,a);for(let l of i){let u=Bc(e-l.x,r,n,a)+l.badness;u<=o&&(s=l,o=u)}return{index:t,x:e,priorBreak:s,badness:o}}function ey(t){return t?ey(t.priorBreak).concat(t.index):[]}var iu=class rl{constructor(e=\"\",r=[],i=[]){this.text=e,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this._graphemes=null}graphemes(){return this._graphemes??(this._graphemes=tl(this.text)),this._graphemes}static fromFeature(e,r){let i=new rl;for(let n of e.sections)n.image?i.addImageSection(n):i.addTextSection(n,r);return i}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=Av(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes(\"\\u200B\")}trim(){let e=this.graphemes(),r=0;for(;r<e.length&&Pc(e[r]);)r++;let i=e.length;for(;i>r&&Pc(e[i-1]);)i--;this.text=e.slice(r,i).join(\"\"),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(\"\"),n=this.sectionIndex.slice(e,r);return new rl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join(\"\").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n<this.length();n++){let a=this.getSection(n);if(\"imageName\"in a){let s=e[a.imageName];if(!s)continue;let o=s.displaySize;r=Math.max(r,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:r,maxImageHeight:i}}_appendSection(e,r){let i=this.graphemes(),n=i.length>0?i[i.length-1]:\"\",a=tl(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o<s;o++)this.sectionIndex.push(r)}addTextSection(e,r){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||\"bottom\",fontStack:e.fontStack||r}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let r=e.image?e.image.name:\"\";if(r.length===0){Mt(\"Can't add FormattedSection with an empty image.\");return}let i=this.getNextImageSectionCharCode();if(!i){Mt(\"Reached maximum number of images 6401\");return}this.sections.push({scale:1,verticalAlign:e.verticalAlign||\"bottom\",imageName:r}),this._appendSection(String.fromCharCode(i),this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f<u.length;f++){let d=u[f];if(f>0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=J2(y),x=Fc(y)&&Fc(m);
1646(Sv[y]||g||\"imageName\"in this.getSection(f-1)||u[f+1]!==void 0&&Ev[m]||x&&(h??(h=wv(this.text))).has(p))&&s.push(zc(f,c,o,s,Fv(y,m,g&&l),!1))}
vendor: 8,146 bytes, line 1646
1646ru(d.codePointAt(0))||(c+=Mc(d,this.getSection(f),i,n,e,a)),p+=d.length}return ey(zc(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=Mc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Tv(){return(function(t){var e={R:\"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73\",EN:\"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9\",ES:\"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2\",ET:\"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj\",AN:\"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u\",CS:\"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b\",B:\"a,3,f+2,2v,690\",S:\"9,2,k\",WS:\"c,k,4f4,1vk+a,u,1j,335\",ON:\"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i\",BN:\"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1\",NSM:\"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n\",AL:\"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d\",LRO:\"6ct\",RLO:\"6cu\",LRE:\"6cq\",RLE:\"6cr\",PDF:\"6cs\",LRI:\"6ee\",RLI:\"6ef\",FSI:\"6eg\",PDI:\"6eh\"},r={},i={};r.L=1,i[1]=\"L\",Object.keys(e).forEach(function(N,J){r[N]=1<<J+1,i[r[N]]=N}),Object.freeze(r);var n=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,s=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,o=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|n|r.PDI|o,u=null;function h(){if(!u){u=new Map;var N=0;for(var J in e)if(e.hasOwnProperty(J))for(var W=e[J],C=\"\",ut=void 0,G=!1,j=0,H=0;H<=W.length+1;H+=1){var $t=W[H];if($t!==\",\"&&H!==W.length)$t===\"+\"?(G=!0,j=N=j+parseInt(C,36),C=\"\"):C+=$t;else{G?ut=N+parseInt(C,36):(j=N=j+parseInt(C,36),ut=N),G=!1,C=\"\",j=ut;for(var vt=N;vt<ut+1;vt+=1)u.set(vt,r[J])}}}}function c(N){return h(),u.get(N.codePointAt(0))||r.L}function p(N){return i[c(N)]}var f={pairs:\"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1\",canonical:\"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye\"};function d(N,J){var W=0,C=new Map,ut=J&&new Map,G;return N.split(\",\").forEach(function j(H){if(H.indexOf(\"+\")!==-1)for(var $t=+H;$t--;)j(G);else{G=H;var vt=H.split(\">\"),nt=vt[0],kt=vt[1];nt=String.fromCodePoint(W+=parseInt(nt,36)),kt=String.fromCodePoint(W+=parseInt(kt,36)),C.set(nt,kt),J&&ut.set(kt,nt)}}),{map:C,reverseMap:ut}}var y,m,g;function x(){if(!y){var N=d(f.pairs,!0),J=N.map,W=N.reverseMap;y=J,m=W,g=d(f.canonical,!1).map}}function b(N){return x(),y.get(N)||null}function v(N){return x(),m.get(N)||null}function w(N){return x(),g.get(N)||null}var _=r.L,A=r.R,S=r.EN,F=r.ES,V=r.ET,O=r.AN,P=r.CS,R=r.B,E=r.S,$=r.ON,z=r.BN,B=r.NSM,tt=r.AL,it=r.LRO,pt=r.RLO,st=r.LRE,ft=r.RLE,Gt=r.PDF,ze=r.LRI,fe=r.RLI,Le=r.FSI,Zt=r.PDI;function Sr(N,J){for(var W=125,C=new Uint32Array(N.length),ut=0;ut<N.length;ut++)C[ut]=c(N[ut]);var G=new Map;function j(Yt,oe){var Xt=C[Yt];C[Yt]=oe,G.set(Xt,G.get(Xt)-1),Xt&s&&G.set(s,G.get(s)-1),G.set(oe,(G.get(oe)||0)+1),oe&s&&G.set(s,(G.get(s)||0)+1)}for(var H=new Uint8Array(N.length),$t=new Map,vt=[],nt=null,kt=0;kt<N.length;kt++)nt||vt.push(nt={start:kt,end:N.length-1,level:J===\"rtl\"?1:J===\"ltr\"?0:ih(kt,!1)}),C[kt]&R&&(nt.end=kt,nt=null);for(var pi=ft|st|pt|it|n|Zt|Gt|R,ir=function(Yt){return Yt+(Yt&1?1:2)},Ve=function(Yt){return Yt+(Yt&1?2:1)},Oe=0;Oe<vt.length;Oe++){nt=vt[Oe];var ot=[{_level:nt.level,_override:0,_isolate:0}],bt=void 0,Fe=0,Re=0,Ha=0;G.clear();for(var zt=nt.start;zt<=nt.end;zt++){var Lt=C[zt];if(bt=ot[ot.length-1],G.set(Lt,(G.get(Lt)||0)+1),Lt&s&&G.set(s,(G.get(s)||0)+1),Lt&pi)if(Lt&(ft|st)){H[zt]=bt._level;var Cu=(Lt===ft?Ve:ir)(bt._level);Cu<=W&&!Fe&&!Re?ot.push({_level:Cu,_override:0,_isolate:0}):Fe||Re++}else if(Lt&(pt|it)){H[zt]=bt._level;var Mu=(Lt===pt?Ve:ir)(bt._level);Mu<=W&&!Fe&&!Re?ot.push({_level:Mu,_override:Lt&pt?A:_,_isolate:0}):Fe||Re++}else if(Lt&n){Lt&Le&&(Lt=ih(zt+1,!0)===1?fe:ze),H[zt]=bt._level,bt._override&&j(zt,bt._override);var Bu=(Lt===fe?Ve:ir)(bt._level);Bu<=W&&Fe===0&&Re===0?(Ha++,ot.push({_level:Bu,_override:0,_isolate:1,_isolInitIndex:zt})):Fe++}else if(Lt&Zt){if(Fe>0)Fe--;else if(Ha>0){for(Re=0;!ot[ot.length-1]._isolate;)ot.pop();var Ka=ot[ot.length-1]._isolInitIndex;Ka!=null&&($t.set(Ka,zt),$t.set(zt,Ka)),ot.pop(),Ha--}bt=ot[ot.length-1],H[zt]=bt._level,bt._override&&j(zt,bt._override)}else Lt&Gt?(Fe===0&&(Re>0?Re--:!bt._isolate&&ot.length>1&&(ot.pop(),bt=ot[ot.length-1])),H[zt]=bt._level):Lt&R&&(H[zt]=nt.level);else H[zt]=bt._level,bt._override&&Lt!==z&&j(zt,bt._override)}for(var kr=[],de=null,nr=nt.start;nr<=nt.end;nr++){var Ja=C[nr];if(!(Ja&o)){var Pu=H[nr],zu=Ja&n,c1=Ja===Zt;de&&Pu===de._level?(de._end=nr,de._endsWithIsolInit=zu):kr.push(de={_start:nr,_end:nr,_level:Pu,_startsWithPDI:c1,_endsWithIsolInit:zu})}}for(var Qa=[],Dn=0;Dn<kr.length;Dn++){var _n=kr[Dn];if(!_n._startsWithPDI||_n._startsWithPDI&&!$t.has(_n._start)){for(var ts=[de=_n],Lu=void 0;de&&de._endsWithIsolInit&&(Lu=$t.get(de._end))!=null;)for(var An=Dn+1;An<kr.length;An++)if(kr[An]._start===Lu){ts.push(de=kr[An]);break}for(var Ir=[],es=0;es<ts.length;es++)for(var Vu=ts[es],rs=Vu._start;rs<=Vu._end;rs++)Ir.push(rs);for(var p1=H[Ir[0]],Ou=nt.level,Sn=Ir[0]-1;Sn>=0;Sn--)if(!(C[Sn]&o)){Ou=H[Sn];break}var is=Ir[Ir.length-1],f1=H[is],Ru=nt.level;if(!(C[is]&n)){for(var En=is+1;En<=nt.end;En++)if(!(C[En]&o)){Ru=H[En];break}}Qa.push({_seqIndices:Ir,_sosType:Math.max(Ou,p1)%2?A:_,_eosType:Math.max(Ru,f1)%2?A:_})}}for(var ns=0;ns<Qa.length;ns++){var as=Qa[ns],q=as._seqIndices,fi=as._sosType,d1=as._eosType,Cr=H[q[0]]&1?A:_;if(G.get(B))for(var Fn=0;Fn<q.length;Fn++){var $u=q[Fn];if(C[$u]&B){for(var ss=fi,Tn=Fn-1;Tn>=0;Tn--)if(!(C[q[Tn]]&o)){ss=C[q[Tn]];break}
vendor: 2,834 bytes, line 1646
1646j($u,ss&(n|Zt)?$:ss)}}if(G.get(S))for(var kn=0;kn<q.length;kn++){var Nu=q[kn];if(C[Nu]&S)for(var In=kn-1;In>=-1;In--){var Uu=In===-1?fi:C[q[In]];if(Uu&a){Uu===tt&&j(Nu,O);break}}}if(G.get(tt))for(var os=0;os<q.length;os++){var qu=q[os];C[qu]&tt&&j(qu,A)}if(G.get(F)||G.get(P))for(var di=1;di<q.length-1;di++){var ls=q[di];if(C[ls]&(F|P)){for(var Mr=0,us=0,hs=di-1;hs>=0&&(Mr=C[q[hs]],Mr&o);hs--);for(var cs=di+1;cs<q.length&&(us=C[q[cs]],us&o);cs++);Mr===us&&(C[ls]===F?Mr===S:Mr&(S|O))&&j(ls,Mr)}}if(G.get(S)){for(var ye=0;ye<q.length;ye++)if(C[q[ye]]&S){for(var Cn=ye-1;Cn>=0&&C[q[Cn]]&(V|o);Cn--)j(q[Cn],S);for(ye++;ye<q.length&&C[q[ye]]&(V|o|S);ye++)C[q[ye]]!==S&&j(q[ye],S)}}if(G.get(V)||G.get(F)||G.get(P))for(var yi=0;yi<q.length;yi++){var ju=q[yi];if(C[ju]&(V|F|P)){j(ju,$);for(var Mn=yi-1;Mn>=0&&C[q[Mn]]&o;Mn--)j(q[Mn],$);for(var Bn=yi+1;Bn<q.length&&C[q[Bn]]&o;Bn++)j(q[Bn],$)}}if(G.get(S))for(var ps=0,Gu=fi;ps<q.length;ps++){var Yu=q[ps],fs=C[Yu];fs&S?Gu===_&&j(Yu,_):fs&a&&(Gu=fs)}if(G.get(s)){for(var mi=A|S|O,Xu=mi|_,Pn=[],Br=[],Pr=0;Pr<q.length;Pr++)if(C[q[Pr]]&s){var gi=N[q[Pr]],Wu=void 0;if(b(gi)!==null)if(Br.length<63)Br.push({char:gi,seqIndex:Pr});else break;else if((Wu=v(gi))!==null)for(var xi=Br.length-1;xi>=0;xi--){var ds=Br[xi].char;if(ds===Wu||ds===v(w(gi))||b(w(ds))===gi){Pn.push([Br[xi].seqIndex,Pr]),Br.length=xi;break}}}Pn.sort(function(Yt,oe){return Yt[0]-oe[0]});for(var ys=0;ys<Pn.length;ys++){for(var Zu=Pn[ys],zn=Zu[0],ms=Zu[1],Hu=!1,me=0,gs=zn+1;gs<ms;gs++){var Ku=q[gs];if(C[Ku]&Xu){Hu=!0;var Ju=C[Ku]&mi?A:_;if(Ju===Cr){me=Ju;break}}}if(Hu&&!me){me=fi;for(var xs=zn-1;xs>=0;xs--){var Qu=q[xs];if(C[Qu]&Xu){var th=C[Qu]&mi?A:_;me=th===Cr?Cr:th;break}}}if(me){if(C[q[zn]]=C[q[ms]]=me,me!==Cr){for(var vi=zn+1;vi<q.length;vi++)if(!(C[q[vi]]&o)){c(N[q[vi]])&B&&(C[q[vi]]=me);break}}if(me!==Cr){for(var bi=ms+1;bi<q.length;bi++)if(!(C[q[bi]]&o)){c(N[q[bi]])&B&&(C[q[bi]]=me);break}}}}for(var $e=0;$e<q.length;$e++)if(C[q[$e]]&s){for(var eh=$e,vs=$e,bs=fi,wi=$e-1;wi>=0;wi--)if(C[q[wi]]&o)eh=wi;else{bs=C[q[wi]]&mi?A:_;break}for(var rh=d1,Di=$e+1;Di<q.length;Di++)if(C[q[Di]]&(s|o))vs=Di;else{rh=C[q[Di]]&mi?A:_;break}for(var ws=eh;ws<=vs;ws++)C[q[ws]]=bs===rh?bs:Cr;$e=vs}}}for(var Ht=nt.start;Ht<=nt.end;Ht++){var y1=H[Ht],Ln=C[Ht];if(y1&1?Ln&(_|S|O)&&H[Ht]++:Ln&A?H[Ht]++:Ln&(O|S)&&(H[Ht]+=2),Ln&o&&(H[Ht]=Ht===0?nt.level:H[Ht-1]),Ht===nt.end||c(N[Ht])&(E|R))for(var Vn=Ht;Vn>=0&&c(N[Vn])&l;Vn--)H[Vn]=nt.level}}return{levels:H,paragraphs:vt};function ih(Yt,oe){for(var Xt=Yt;Xt<N.length;Xt++){var Ne=C[Xt];if(Ne&(A|tt))return 1;if(Ne&(R|_)||oe&&Ne===Zt)return 0;if(Ne&n){var nh=m1(Xt);Xt=nh===-1?N.length:nh}}return 0}function m1(Yt){for(var oe=1,Xt=Yt+1;Xt<N.length;Xt++){var Ne=C[Xt];if(Ne&R)break;if(Ne&Zt){if(--oe===0)return Xt}else Ne&n&&oe++}return-1}}var Er=\"14>1,j>2,t>2,u>2,1a>g,2v3>
16461,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1\",er;function ci(){if(!er){var N=d(Er,!0),J=N.map;N.reverseMap.forEach(function(W,C){J.set(C,W)}),er=J}}function Tt(N){return ci(),er.get(N)||null}function Ee(N,J,W,C){var ut=N.length;W=Math.max(0,W==null?0:+W),C=Math.min(ut-1,C==null?ut-1:+C);for(var G=new Map,j=W;j<=C;j++)if(J[j]&1){var H=Tt(N[j]);H!==null&&G.set(j,H)}return G}function rr(N,J,W,C){var ut=N.length;W=Math.max(0,W==null?0:+W),C=Math.min(ut-1,C==null?ut-1:+C);var G=[];return J.paragraphs.forEach(function(j){var H=Math.max(W,j.start),$t=Math.min(C,j.end);if(H<$t){for(var vt=J.levels.slice(H,$t+1),nt=$t;nt>=H&&c(N[nt])&l;nt--)vt[nt]=j.level;for(var kt=j.level,pi=1/0,ir=0;ir<vt.length;ir++){var Ve=vt[ir];Ve>kt&&(kt=Ve),Ve<pi&&(pi=Ve|1)}for(var Oe=kt;Oe>=pi;Oe--)for(var ot=0;ot<vt.length;ot++)if(vt[ot]>=Oe){for(var bt=ot;ot+1<vt.length&&vt[ot+1]>=Oe;)ot++;ot>bt&&G.push([bt+H,ot+H])}}}),G}function Fr(N,J,W,C){var ut=Tr(N,J,W,C),G=[].concat(N);return ut.forEach(function(j,H){G[H]=(J.levels[j]&1?Tt(N[j]):null)||N[j]}),G.join(\"\")}function Tr(N,J,W,C){for(var ut=rr(N,J,W,C),G=[],j=0;j<N.length;j++)G[j]=j;return ut.forEach(function(H){for(var $t=H[0],vt=H[1],nt=G.slice($t,vt+1),kt=nt.length;kt--;)G[vt-kt]=nt[kt]}),G}return t.closingToOpeningBracket=v,t.getBidiCharType=c,t.getBidiCharTypeName=p,t.getCanonicalBracket=w,t.getEmbeddingLevels=Sr,t.getMirroredCharacter=Tt,t.getMirroredCharactersMap=Ee,t.getReorderSegments=rr,t.getReorderedIndices=Tr,t.getReorderedString=Fr,t.openingToClosingBracket=b,Object.defineProperty(t,\"__esModule\",{value:!0}),t})({})}var nu=Tv(),kv=/[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]/,Iv=new Set([\"WS\",\"FSI\",\"LRI\",\"RLI\",\"PDI\"]),Cv=new Set([\"S\",\"B\"]);function Mv(t,e,r,i){let n=[],a=r;for(let s of tl(t.slice(r,i)))n.push({index:a,text:s,level:e[a]}),a+=s.length;return n}function Bv(t,e){let r=!0;for(let i=t.length-1;i>=0;i--){let n=nu.getBidiCharTypeName(t[i].text[0]);Cv.has(n)?(t[i].level=e,r=!0):r&&Iv.has(n)?t[i].level=e:r=!1}}function Pv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)<i&&(i=a|1);let n=t.slice();for(let a=r;a>=i;a--)for(let s=0;s<n.length;s++){if(n[s].level<a)continue;let o=s;for(;o+1<n.length&&n[o+1].level>=a;)o++;for(let l=s,u=o;l<u;l++,u--)[n[l],n[u]]=[n[u],n[l]];s=o}return n}function zv(t){return t.level%2==0?t.text:nu.getMirroredCharacter(t.text)??t.text}function Lv(t,e){return t.find(r=>e>=r.start&&e<=r.end)?.level??0}function Vv(t,e,r,i,n){let a=Mv(t,e,i,n);Bv(a,r);let s=\"\",o=[];for(let l of Pv(a,r)){if(kv.test(l.text))continue;let u=zv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Ov(t,e){let r=e.filter(a=>a>0&&a<t.length),i=[...new Set([0,...r,t.length])].sort((a,s)=>a-s),n=[];for(let a=0;a+1<i.length;a++)n.push([i[a],i[a+1]]);return n}function ry(t,e){let{levels:r,paragraphs:i}=nu.getEmbeddingLevels(t);return Ov(t,e.concat(i.map(n=>n.start))).map(([n,a])=>Vv(t,r,Lv(i,n),n,a))}function Rv(t,e){return ry(t,e).map(r=>r.text)}function $v(t,e,r){return ry(t,r).map(i=>[i.text,i.sourceIndices.map(n=>e[n]??0)])}var il=4294967296,Lc=1/il,Vc=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf-8\"),au=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*il;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*il;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,Uv(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Vc?Vc.decode(this.buf.subarray(e,t)):rb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Nv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){let r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}
vendor: 4,531 bytes, line 1646
1646writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Lc),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Lc),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){jv(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=ib(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Oc(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Oc(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Xv,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Wv,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Kv,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Zv,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Hv,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Jv,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Qv,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,tb,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,eb,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function Uv(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return qv(t,n,e);throw Error(\"Expected varint not more than 10 bytes\")}function qv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function jv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error(\"Given varint doesn't fit into 10 bytes\");e.realloc(10),Gv(r,i,e),Yv(i,e)}function Gv(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Yv(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Oc(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function Xv(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;s<r;s++){let o=t[s];if(o<0||n+10>a){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function Wv(t,e){for(let r=0;r<t.length;r++)e.writeSVarint(t[r])}function Zv(t,e){for(let r=0;r<t.length;r++)e.writeFloat(t[r])}function Hv(t,e){for(let r=0;r<t.length;r++)e.writeDouble(t[r])}function Kv(t,e){for(let r=0;r<t.length;r++)e.writeBoolean(t[r])}function Jv(t,e){for(let r=0;r<t.length;r++)e.writeFixed32(t[r])}function Qv(t,e){for(let r=0;r<t.length;r++)e.writeSFixed32(t[r])}function tb(t,e){for(let r=0;r<t.length;
1646r++)e.writeFixed64(t[r])}function eb(t,e){for(let r=0;r<t.length;r++)e.writeSFixed64(t[r])}function rb(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function ib(t,e,r){for(let i=0,n,a;i<e.length;i++){if(n=e.charCodeAt(i),n>55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function nb(t){return typeof t?.renderWithWebGL==\"function\"}function su(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o<i.length&&(i[o]=u)}else s.h===l.h?(l.x+=s.w,l.w-=s.w):s.w===l.w?(l.y+=s.h,l.h-=s.h):(i.push({x:l.x+s.w,y:l.y,w:l.w-s.w,h:s.h}),l.y+=s.h,l.h-=s.h);break}}return{w:n,h:a,fill:e/(n*a)||0}}var iy=class{constructor(t,{pixelRatio:e,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},ou=class{constructor(t,e){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(t,r,n),this.addImages(e,i,n);let{w:a,h:s}=su(n),o=new Wt({width:a||1,height:s||1});for(let l in t){let u=t[l];if(u.isWebGLImage)continue;let h=r[l].paddedRect;Wt.copy(u.data,o,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(let l in e){let u=e[l],h=i[l].paddedRect,c=h.x+1,p=h.y+1,f=u.data.width,d=u.data.height;Wt.copy(u.data,o,{x:0,y:0},{x:c,y:p},u.data),Wt.copy(u.data,o,{x:0,y:d-1},{x:c,y:p-1},{width:f,height:1}),Wt.copy(u.data,o,{x:0,y:0},{x:c,y:p+d},{width:f,height:1}),Wt.copy(u.data,o,{x:f-1,y:0},{x:c-1,y:p},{width:1,height:d}),Wt.copy(u.data,o,{x:0,y:0},{x:c+f,y:p},{width:1,height:d})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(t,e,r){for(let i in t){let n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new iy(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(t,e){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){this.patchedUpdateVersion=t.updateVersion;for(let r in this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)}}patchUpdatedImage(t,e,r){if(!t||!e||!t.needsFirstWebGLRender&&t.version===e.version)return;t.needsFirstWebGLRender=!1,t.version=e.version;let[i,n]=t.tl,a=e.userImage?.data;if(!nb(a)){r.update(e.data,void 0,{x:i,y:n});return}let{width:s,height:o}=e.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:i,y:n,width:s,height:o}),r.context.setDirty()}};I(\"ImagePosition\",iy),I(\"ImageAtlas\",ou);var ny=(function(t){return t[t.none=0]=\"none\",t[t.horizontal=1]=\"horizontal\",t[t.vertical=2]=\"vertical\",t[t.horizontalOnly=3]=\"horizontalOnly\",t})(ny||{});function ab(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}
vendor: 3,935 bytes, line 1646
1646function sb(t,e){let r=[],i=0;for(let n of e)r.push(t.substring(i,n)),i=n;return i<t.length()&&r.push(t.substring(i,t.length())),r}var Rc=/^\\p{gc=M}$/u;function ob(t){let e=[],r=0;for(;r<t.length;){if(!Rc.test(t[r])){e.push(r),r++;continue}let i=r;for(;i<t.length&&Rc.test(t[i]);)i++;let n=t[i];if(n!==void 0&&Qd(n.codePointAt(0))){e.push(i);for(let a=i-1;a>=r;a--)e.push(a);r=i+1}else{for(let a=r;a<i;a++)e.push(a);r=i}}return e}function lb(t){let e=[],r=0;for(let i of t.graphemes())e.push(...Array(i.length).fill(t.sectionIndex[r])),r++;return e}function ub(t,e){let r=e.map(a=>t.toCodeUnitIndex(a)),i=vr.isParsed()?vr:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>$c(a,t.sections,[...a].map(()=>0))):Rv(t.toString(),r).map(a=>nl([...a],t.sections,[...a].map(()=>0)));let n=lb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>$c(a,t.sections,s)):$v(t.text,n,r).map(([a,s])=>{let o=[...a];return nl(o,t.sections,ay(o).map(l=>s[l]??0))})}function nl(t,e,r){let i=new iu(t.join(\"\"),e,[]),n=0;for(let a of i.graphemes())i.sectionIndex.push(r[n]??0),n+=[...a].length;return i}function ay(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function $c(t,e,r){let i=[...t],n=ay(i),a=ob(i);return nl(a.map(s=>i[s]),e,a.map(s=>r[n[s]]??0))}function Hn(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=iu.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=ty(y.text)?ub(y,m):sb(y,m),x=[],b={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return xb(b,e,r,i,g,s,o,l,c,u,p,d),!ab(x)&&b}function sy(t){let e=.5,r=.5;switch(t){case\"right\":case\"top-right\":case\"bottom-right\":e=1;break;case\"left\":case\"top-left\":case\"bottom-left\":e=0}switch(t){case\"bottom\":case\"bottom-right\":case\"bottom-left\":r=1;break;case\"top\":case\"top-right\":case\"top-left\":r=0}return{horizontalAlign:e,verticalAlign:r}}function hb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function oy(t){switch(t){case\"top\":return 0;case\"center\":return .5;default:return 1}}function cb(t,e,r,i){if(t?.rect)return t;let n=e[r.fontStack]?.[i];return n?{rect:null,metrics:n.metrics}:null}function pb(t,e,r){return!(t===1||!e&&!Xa(r)||e&&(ru(r)||Jd(r)))}function la(t){return/\\p{Nd}/u.test(String.fromCodePoint(t))}function ly(t){return/\\p{Lu}/u.test(String.fromCodePoint(t))}function fb(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function db(t){let e=t.some(la)&&t.every(i=>la(i)||fb(i)),r=t.length<=3&&t.every(i=>ly(i)||la(i));return e||r}function yb(t){return(la(t)||ly(t))&&!Jd(t)}function mb(t,e){let r=!1;for(let i=0;i<t.length;i++){if(e[i])continue;let n=qr[t[i]];n&&(i===0||e[i-1])&&(i===t.length-1||e[i+1])&&(t[i]=n,e[i]=!0,r=!0)}return r}function gb(t){let e=t.graphemes().slice(),r=e.map(a=>a.codePointAt(0)),i=r.map(Xa),n=a=>!i[a]&&!ru(r[a])&&!(\"imageName\"in t.getSection(a));for(let a=0;a<r.length;a++){if(!n(a))continue;let s=a;for(;s+1<r.length&&n(s+1);)s++;if(db(r.slice(a,s+1)))for(let o=a;o<=s;o++)i[o]=yb(r[o]);a=s}return mb(e,i)&&(t.text=e.join(\"\"),t._graphemes=null),i}function xb(t,e,r,i,n,a,s,o,l,u,h,c){let p=0,f=0,d=0,y=0,m=o===\"right\"?1:o===\"left\"?0:.5,g=24/c,x=0;for(let w of n){w.trim();let _=w.getMaxScale(),A={positionedGlyphs:[],lineOffset:0};t.positionedLines[x]=A;let S=A.positionedGlyphs,F=0;if(!w.length()){f+=a,++x;continue}let V=hb(i,w,g),O=l===2&&!h?gb(w):null,P=w.graphemes();for(let $=0;$<P.length;$++){let z=w.getSection($),B=P[$],tt=B.codePointAt(0),it=O?O[$]:pb(l,h,tt),pt=\"fontStack\"in z&&Kd(B)&&!e[z.fontStack]?.[B]?[...B]:[B];for(let st of pt){let ft={glyph:st.codePointAt(0),grapheme:st,imageName:null,x:p,y:f+-17,vertical:it,scale:1,fontStack:\"\",sectionIndex:w.get
1646SectionIndex($),metrics:null,rect:null},Gt;if(\"fontStack\"in z){if(Gt=vb(z,st,it,V,e,r),!Gt)continue;ft.fontStack=z.fontStack}else{if(t.iconsInText=!0,z.scale*=g,Gt=bb(z,it,_,V,i),!Gt)continue;F=Math.max(F,Gt.imageOffset),ft.imageName=z.imageName}let{rect:ze,metrics:fe,baselineOffset:Le}=Gt;if(ft.y+=Le,ft.scale=z.scale,ft.metrics=fe,ft.rect=ze,S.push(ft),!it)p+=fe.advance*z.scale+u;else{t.verticalizable=!0;let Zt=\"imageName\"in z?fe.advance:24;p+=Zt*z.scale+u}}}if(S.length!==0){let $=p-u;d=Math.max($,d),wb(S,0,S.length-1,m)}p=0;let R=(_-1)*24;A.lineOffset=Math.max(F,R);let E=a*_+F;f+=E,y=Math.max(E,y),++x}let{horizontalAlign:b,verticalAlign:v}=sy(s);Db(t.positionedLines,m,b,v,d,y,a,f,n.length),t.top+=-v*f,t.bottom=t.top+f,t.left+=-b*d,t.right=t.left+d}function vb(t,e,r,i,n,a){let s=a[t.fontStack]?.[e],o=cb(s,n,t,e);if(o===null)return null;let l;if(r)l=i.verticalLineContentWidth-t.scale*24;else{let u=oy(t.verticalAlign);l=(i.horizontalLineContentHeight-t.scale*24)*u}return{rect:o.rect,metrics:o.metrics,baselineOffset:l}}function bb(t,e,r,i,n){let a=n[t.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:e?o[1]:o[0]},u;if(e)u=i.verticalLineContentWidth-o[1]*t.scale;else{let c=oy(t.verticalAlign);u=(i.horizontalLineContentHeight-o[1]*t.scale)*c}let h=(e?o[0]:o[1])*t.scale-24*r;return{rect:s,metrics:l,baselineOffset:u,imageOffset:h}}function wb(t,e,r,i){if(i===0)return;let n=t[r],a=n.metrics.advance*n.scale,s=(t[r].x+a)*i;for(let o=e;o<=r;o++)t[o].x-=s}function Db(t,e,r,i,n,a,s,o,l){let u=(e-r)*n,h=0;h=a===s?-i*l*s+.5*s:-o*i- -17;for(let c of t)for(let p of c.positionedGlyphs)p.x+=u,p.y+=h}function _b(t,e,r){let{horizontalAlign:i,verticalAlign:n}=sy(r),a=e[0],s=e[1],o=a-t.displaySize[0]*i,l=o+t.displaySize[0],u=s-t.displaySize[1]*n;return{image:t,top:u,bottom:u+t.displaySize[1],left:o,right:l}}function uy(t){let e=t.left,r=t.top,i=t.right-e,n=t.bottom-r,a=t.image.content[2]-t.image.content[0],s=t.image.content[3]-t.image.content[1],o=t.image.textFitWidth??\"stretchOrShrink\",l=t.image.textFitHeight??\"stretchOrShrink\",u=a/s;if(l===\"proportional\"){if(o===\"stretchOnly\"&&i/n<u||o===\"proportional\"){let h=Math.ceil(n*u);e*=h/i,i=h}}else if(o===\"proportional\"&&l===\"stretchOnly\"&&u!==0&&i/n>u){let h=Math.ceil(i/u);r*=h/n,n=h}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Nc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r===\"width\"||r===\"both\"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r===\"height\"||r===\"both\"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Uc=32640;function qc(t,e){let{expression:r}=e;if(r.kind===\"constant\")return{kind:\"constant\",layoutSize:r.evaluate(new at(t+1))};if(r.kind===\"source\")return{kind:\"source\"};if(r.kind===\"composite\"){let{minZoom:i,maxZoom:n}=Ab(r.zoomStops,t);return{kind:\"composite\",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=Sb(r),n=r.evaluate(new at(t+1));return{kind:\"camera\",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Ab(t,e){let r=0;for(;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);let i=r;for(;i<t.length&&t[i]<e+1;)i++;return i=Math.min(t.length-1,i),{minZoom:t[r],maxZoom:t[i]}}function Sb(t){return t.zoomStops.map(e=>t.evaluate(new at(e===-1/0?t.zoomStops[1]-1:e)))}var Hr=class hy extends M{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new hy(this.x,this.y,this.angle,this.segment)}};I(\"Anchor\",Hr);function cy(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;o<r/2;){let h=t[s-1],c=t[s],p=t[s+1];if(!p)return!1;let f=h.angleTo(c)-c.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:o,angleDelta:f}),u+=f;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function py(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function fy(t,e,r){return t?3/5*e*r:0}function dy(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Eb(t,e,r,i,n,a){let s=fy(r,n,a),o=dy(r,i)*a,l=0,u=py(t)/2;for(let h=0;h<t.length-1;h++){let c=t[h],p=t[h+1],f=c.dist(p);if(l+f>u){let d=(u-l)/f,y=new Hr(yr.number(c.x,p.x,d),yr.number(c.y,p.y,d),p.angleTo(c),h);
vendor: 8,682 bytes, line 1646
1646return y._round(),!s||cy(t,y,o,s,e)?y:void 0}l+=f}}function Fb(t,e,r,i,n,a,s,o,l){let u=fy(i,a,s),h=dy(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c<e/4&&(e=c+e/4);let f=a*2;return yy(t,p?e/2*o%e:(h/2+f)*s*o%e,e,u,r,c,p,!1,l)}function yy(t,e,r,i,n,a,s,o,l){let u=a/2,h=py(t),c=0,p=e-r,f=[];for(let d=0;d<t.length-1;d++){let y=t[d],m=t[d+1],g=y.dist(m),x=m.angleTo(y);for(;p+r<c+g;){p+=r;let b=(p-c)/g,v=yr.number(y.x,m.x,b),w=yr.number(y.y,m.y,b);if(v>=0&&v<l&&w>=0&&w<l&&p-u>=0&&p+u<=h){let _=new Hr(v,w,x,d);_._round(),(!i||cy(t,_,a,i,n))&&f.push(_)}}c+=g}return!o&&!f.length&&!s&&(f=yy(t,c/2,r,i,n,a,s,!0,l)),f}function Tb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l<s.length-1;l++){let u=s[l],h=s[l+1];u.x<e&&h.x<e||(u.x<e?u=new M(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round():h.x<e&&(h=new M(e,u.y+(h.y-u.y)*((e-u.x)/(h.x-u.x)))._round()),!(u.y<r&&h.y<r)&&(u.y<r?u=new M(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round():h.y<r&&(h=new M(u.x+(h.x-u.x)*((r-u.y)/(h.y-u.y)),r)._round()),!(u.x>=i&&h.x>=i)&&(u.x>=i?u=new M(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new M(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new M(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new M(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function my(t,e,r,i,n,a){let s=jc(t,e,r,n,0);return s=jc(s,e,i,a,1),s}function jc(t,e,r,i,n){switch(e){case 1:return kb(t,r,i,n);case 2:return Gc(t,r,i,n,!1);case 3:return Gc(t,r,i,n,!0)}return[]}function kb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function Ib(t,e,r,i,n){let a=i===0?Cb:Mb,s=[],o=[];for(let h=0;h<t.length-1;h++){let c=t[h],p=t[h+1],f=i===0?c.x:c.y,d=i===0?p.x:p.y,y=!1;f<e?d>e&&s.push(a(c,p,e)):f>r?d<r&&s.push(a(c,p,r)):s.push(c),d<e&&f>=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new M(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Gc(t,e,r,i,n){let a=[];for(let s of t){let o=Ib(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Cb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new M(r,t.y+(e.y-t.y)*i)}function Mb(t,e,r){let i=(r-t.y)/(e.y-t.y);return new M(t.x+(e.x-t.x)*i,r)}function Yc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(E,$)=>E+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,b=0,v=d,w=0,_=y,A=0,S=m;if(a.content&&i){let E=a.content,$=E[2]-E[0],z=E[3]-E[1];(a.textFitWidth||a.textFitHeight)&&(u=uy(t)),g=Kn(h,0,E[0]),b=Kn(c,0,E[1]),x=Kn(h,E[0],E[2]),v=Kn(c,E[1],E[3]),w=E[0]-g,A=E[1]-b,_=$-x,S=z-v}let F=u.x1,V=u.y1,O=u.x2-F,P=u.y2-V,R=(E,$,z,B)=>{let tt=Jn(E.stretch-g,x,O,F),it=Qn(E.fixed-w,_,E.stretch,f),pt=Jn($.stretch-b,v,P,V),st=Qn($.fixed-A,S,$.stretch,d),ft=Jn(z.stretch-g,x,O,F),Gt=Qn(z.fixed-w,_,z.stretch,f),ze=Jn(B.stretch-b,v,P,V),fe=Qn(B.fixed-A,S,B.stretch,d),Le=new M(tt,pt),Zt=new M(ft,pt),Sr=new M(ft,ze),Er=new M(tt,ze),er=new M(it/s,st/s),ci=new M(Gt/s,fe/s),Tt=e*Math.PI/180;if(Tt){let N=Math.sin(Tt),J=Math.cos(Tt),W=[J,-N,N,J];Le._matMult(W),Zt._matMult(W),Er._matMult(W),Sr._matMult(W)}let Ee=E.stretch+E.fixed,rr=z.stretch+z.fixed,Fr=$.stretch+$.fixed,Tr=B.stretch+B.fixed;return{tl:Le,tr:Zt,bl:Er,br:Sr,tex:{x:a.paddedRect.x+1+Ee,y:a.paddedRect.y+1+Fr,w:rr-Ee,h:Tr-Fr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:er,pixelOffsetBR:ci,minFontScaleX:_/s/O,minFontScaleY:S/s/P,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(R({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let E=Xc(h,y,f),$=Xc(c,m,d);for(let z=0;z<E.length-1;z++){let B=E[z],tt=E[z+1];for(let it=0;it<$.length-1;it++){let pt=$[it],st=$[it+1];n.push(R(B,pt,tt,st))}}}return n}function Kn(t,e,r){let i=0;for(let n of t)i+=Math.max(e,Math.min(r,n[1]))-Math.max(e,Math.min(r,n[0]));return i}function Xc(t,e,r){let i=[{fixed:-1,stretch:0}];for(let[n,a]of t){let s=i[i.length-1];i.push({fixed:n-s.stretch,stretch:s.stretch}),i.push({fixed:n-s.stretch,stretch:s.stretch+(a-n)})}return i.push({fixed:e+1,stretch:r}),i}function Jn(t,e,r,i){return t/e*r+i}function Qn(t,e,r,i){return t-e*r/i}function Bb(t,e,r,i,n,a,s,o){let l=i.layout.get(\"text-rotate\").evaluate(a,{})*Math.PI/180,u=[];for(let h of e.positionedLines)for(let c of h.positionedGlyphs){if(!c.rect)continue;let p=c.rect||{},f=4,d=!0,y=1,m=0,g=(n||o)&&c.vertical,x=c.metrics.advance*c.scale/2;if(o&&e.verticalizable){let B=(c.scale-1)*24,tt=(24-c.metrics.width*c.scale)/2;m=h.lineOffset/2-(c.imageName?-tt:B)}if(c.imageName){let B=s[c.imageName];d=B.sdf,y=B.pixelRatio,f=1/y}let b=n?[c.x+x,c.y]:[0,0],v=n?[0,0]:[c.x+x+r[0],c.y+r[1]-m],w=[0,0];g&&(w=v,v=[0,0]);let _=c.metrics.isDoubleResolution?2:1,A=(c.metrics.left-f)*c.scale-x+v[0],S=(-c.metrics.top-f)*c.scale+v[1],F=A+p.w/_*c.scale/y,V=S+p.h/_*c.scale/y,O=new M(A,S),P=new M(F,S),R=new M(A,V),E=new M(F,V);if(g){let B=new M(-x,x- -17),tt=-Math.PI/2,it=12-x,pt=c.imageName?it:0,st=new M(22-it,-pt),ft=new M(...w);O._rotateAround(tt,B)._add(st)._add(ft),P._rotateAround(tt,B)._add(st)._add(ft),R._rotateAround(tt,B)._add(st)._add(ft),E._rotateAround(tt,B)._add(st)._add(ft)}if(l){let B=Math.sin(l),tt=Math.cos(l),it=[tt,-B,B,tt];O._matMult(it),P._matMult(it),R._matMult(it),E._matMult(it)}let $=new M(0,0),z=new M(0,0);u.push({tl:O,tr:P,bl:R,br:E,tex:p,writingMode:e.writingMode,glyphOffset:b,sectionIndex:c.sectionIndex,isSDF:d,pixelOffsetTL:$,pixelOffsetBR:z,minFontScaleX:0,minFontScaleY:0})}return u}var ta=class{constructor(t,e,r,i,n,a,s,o,l,u){if(this.boxStartIndex=t.length,l){let h=a.top,c=a.bottom,p=a.collisionPadding;p&&(h-=p[1],c+=p[3]);let f=c-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{let h=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?uy(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};h.y1=h.y1*s-o[0],h.y2=h.y2*s+o[2],h.x1=h.x1*s-o[3],h.x2=h.x2*s+o[1];let c=a.collisionPadding;if(c&&(h.x1-=c[0]*s,h.y1-=c[1]*s,h.x2+=c[2]*s,h.y2+=c[3]*s),u){let p=new M(h.x1,h.y1),f=new M(h.x2,h.y1),d=new M(h.x1,h.y2),y=new M(h.x2,h.y2),m=u*Math.PI/180;p._rotate(m),f._rotate(m),d._rotate(m),y._rotate(m),h.x1=Math.min(p.x,f.x,d.x,y.x),h.x2=Math.max(p.x,f.x,d.x,y.x),h.y1=Math.min(p.y,f.y,d.y,y.y),h.y2=Math.max(p.y,f.y,d.y,y.y)}t.emplaceBack(e.x,e.y,h.x1,h.y1,h.x2,h.y2,r,i,n)}this.boxEndIndex=t.length}},Pb=class{constructor(t=[],e=(r,i)=>r<i?-1:+(r>i)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t<i;){let a=(t<<1)+1,s=a+1;if(s<this.length&&r(e[s],e[a])<0&&(a=s),r(e[a],n)>=0)break;e[t]=e[a],t=a}e[t]=n}};function zb(t,e=1){let r=wa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Pb([],Lb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new M(s,o);for(let p=s;p<l;p+=i)for(let f=o;f<u;f+=i)a.push(new Nr(p+n,f+n,n,t));let h=Ob(t),c=h;for(;a.length;){let p=a.pop();(p.d>c.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new Nr(p.p.x-n,p.p.y-n,n,t)),a.push(new Nr(p.p.x+n,p.p.y-n,n,t)),a.push(new Nr(p.p.x-n,p.p.y+n,n,t)),a.push(new Nr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Lb(t,e){return e.max-t.max}var Nr=class{constructor(t,e,r,i){this.p=new M(t,e),this.h=r,this.d=Vb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function Vb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o];l.y>t.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,md(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Ob(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;a<s;o=a++){let l=n[a],u=n[o],h=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*h,i+=(l.y+u.y)*h,e+=h*3}return new Nr(r/e,i/e,0,t)}var Rb=(function(t){return t[t.center=1]=\"center\",t[t.left=2]=\"left\",t[t.right=3]=\"right\",t[t.top=4]=\"top\",t[t.bottom=5]=\"bottom\",t[t[\"top-left\"]=6]=\"top-left\",t[t[\"top-right\"]=7]=\"top-right\",t[t[\"bottom-left\"]=8]=\"bottom-left\",t[t[\"bottom-right\"]=9]=\"bottom-right\",t})({}),lu=1/0;function gy(t,e){function r(n,a){let s=0,o=0;a<0&&(a=0);let l=a/Math.SQRT2;
1646switch(n){case\"top-right\":case\"top-left\":o=l-7;break;case\"bottom-right\":case\"bottom-left\":o=-l+7;break;case\"bottom\":o=-a+7;break;case\"top\":o=a-7}switch(n){case\"top-right\":case\"bottom-right\":s=-l;break;case\"top-left\":case\"bottom-left\":s=l;break;case\"left\":s=a;break;case\"right\":s=-a}return[s,o]}function i(n,a,s){let o=0,l=0;switch(a=Math.abs(a),s=Math.abs(s),n){case\"top-right\":case\"top-left\":case\"top\":l=s-7;break;case\"bottom-right\":case\"bottom-left\":case\"bottom\":l=-s+7}switch(n){case\"top-right\":case\"bottom-right\":case\"right\":o=-a;break;case\"top-left\":case\"bottom-left\":case\"left\":o=a}return[o,l]}return e[1]===lu?r(t,e[0]):i(t,e[0],e[1])}function xy(t,e,r){let i=t.layout,n=i.get(\"text-variable-anchor-offset\")?.evaluate(e,{},r);if(n){let s=n.values,o=[];for(let l=0;l<s.length;l+=2){let u=o[l]=s[l],h=s[l+1].map(c=>c*24);u.startsWith(\"top\")?h[1]-=7:u.startsWith(\"bottom\")&&(h[1]+=7),o[l+1]=h}return new De(o)}let a=i.get(\"text-variable-anchor\");if(a){let s;s=t._unevaluatedLayout.getValue(\"text-radial-offset\")===void 0?i.get(\"text-offset\").evaluate(e,{},r).map(l=>l*24):[i.get(\"text-radial-offset\").evaluate(e,{},r)*24,lu];let o=[];for(let l of a)o.push(l,gy(l,s));return new De(o)}return null}function $b(t){var h;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=mt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n[\"icon-size\"].possiblyEvaluate(new at(t.bucket.zoom+1),t.canonical),layoutTextSize:n[\"text-size\"].possiblyEvaluate(new at(t.bucket.zoom+1),t.canonical),textMaxSize:n[\"text-size\"].possiblyEvaluate(new at(18))};if(t.bucket.textSizeData.kind===\"composite\"){let{minZoom:c,maxZoom:p}=t.bucket.textSizeData;a.compositeTextSizes=[n[\"text-size\"].possiblyEvaluate(new at(c),t.canonical),n[\"text-size\"].possiblyEvaluate(new at(p),t.canonical)]}if(t.bucket.iconSizeData.kind===\"composite\"){let{minZoom:c,maxZoom:p}=t.bucket.iconSizeData;a.compositeIconSizes=[n[\"icon-size\"].possiblyEvaluate(new at(c),t.canonical),n[\"icon-size\"].possiblyEvaluate(new at(p),t.canonical)]}let s=i.get(\"text-line-height\")*24,o=i.get(\"text-rotation-alignment\")!==\"viewport\"&&i.get(\"symbol-placement\")!==\"point\",l=i.get(\"text-keep-upright\"),u=i.get(\"text-size\");for(let c of t.bucket.features){let p=i.get(\"text-font\").evaluate(c,{},t.canonical).join(\",\"),f=u.evaluate(c,{},t.canonical),d=a.layoutTextSize.evaluate(c,{},t.canonical),y=a.layoutIconSize.evaluate(c,{},t.canonical),m={horizontal:{},vertical:void 0},g=c.text,x=[0,0];if(g){let _=g.toString(),A=i.get(\"text-letter-spacing\").evaluate(c,{},t.canonical)*24,S=Dv(_)?A:0,F=i.get(\"text-anchor\").evaluate(c,{},t.canonical),V=xy(r,c,t.canonical);if(!V){let E=i.get(\"text-radial-offset\").evaluate(c,{},t.canonical);x=E?gy(F,[E*24,lu]):i.get(\"text-offset\").evaluate(c,{},t.canonical).map($=>$*24)}let O=o?\"center\":i.get(\"text-justify\").evaluate(c,{},t.canonical),P=i.get(\"symbol-placement\")===\"point\"?i.get(\"text-max-width\").evaluate(c,{},t.canonical)*24:1/0,R=()=>{t.bucket.allowVerticalPlacement&&el(_)&&(m.vertical=Hn(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,P,s,F,\"left\",S,x,2,!0,d,f))};if(!o&&V){let E=new Set;if(O===\"auto\")for(let z=0;z<V.values.length;z+=2)E.add(Wc(V.values[z]));else E.add(O);let $=!1;for(let z of E)if(!m.horizontal[z])if($)m.horizontal[z]=m.horizontal[0];else{let B=Hn(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,P,s,\"center\",z,S,x,1,!1,d,f);B&&(m.horizontal[z]=B,$=B.positionedLines.length===1)}R()}else{O===\"auto\"&&(O=Wc(F));let E=Hn(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,P,s,F,O,S,x,1,!1,d,f);E&&(m.horizontal[O]=E),R(),el(_)&&o&&l&&(m.vertical=Hn(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,P,s,F,O,S,x,2,!1,d,f))}}let b,v=!1;if(c.icon?.name){let _=t.imageMap[c.icon.name];_&&(b=_b(t.imagePositions[c.icon.name],i.get(\"icon-offset\").evaluate(c,{},t.canonical),i.get(\"icon-anchor\").evaluate(c,{},t.canonical)),v=!!_.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&Mt(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),_.pixelRatio===t.bucket.pixelRatio?i.get(\"icon-rotate\").constantOr(1)!==0&&(t.bucket.iconsNeedLinear=!0):t.bucket.iconsNeedLinear=!0)}let w=vy(m.horizontal)||m.vertical;(h=t.bucket).iconsInText||(h.iconsInText=w?w.iconsInText:!1),(w||b)&&Nb(t.bucket,c,m,b,t.imageMap,a,d,y,x,v,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}
1646function Wc(t){switch(t){case\"right\":case\"top-right\":case\"bottom-right\":return\"right\";case\"left\":case\"top-left\":case\"bottom-left\":return\"left\"}return\"center\"}function Nb(t,e,r,i,n,a,s,o,l,u,h,c){let p=a.textMaxSize.evaluate(e,{});p===void 0&&(p=s);let f=t.layers[0].layout,d=f.get(\"icon-offset\").evaluate(e,{},h),y=vy(r.horizontal),m=s/24,g=t.tilePixelRatio*m,x=t.tilePixelRatio*p/24,b=t.tilePixelRatio*o,v=t.tilePixelRatio*f.get(\"symbol-spacing\"),w=f.get(\"text-padding\")*t.tilePixelRatio,_=Jb(f,e,h,t.tilePixelRatio),A=f.get(\"text-max-angle\")/180*Math.PI,S=f.get(\"text-rotation-alignment\")!==\"viewport\"&&f.get(\"symbol-placement\")!==\"point\",F=f.get(\"icon-rotation-alignment\").constantOr(\"viewport\")===\"map\"&&f.get(\"symbol-placement\")!==\"point\",V=f.get(\"symbol-placement\"),O=v/2,P=f.get(\"icon-text-fit\"),R;i&&P!==\"none\"&&(t.allowVerticalPlacement&&r.vertical&&(R=Nc(i,r.vertical,P,f.get(\"icon-text-fit-padding\"),d,m)),y&&(i=Nc(i,y,P,f.get(\"icon-text-fit-padding\"),d,m)));let E=h?c.line.getGranularityForZoomLevel(h.z):1,$=(z,B)=>{B.x<0||B.x>=8192||B.y<0||B.y>=8192||qb(t,B,z,r,i,n,R,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[w,w,w,w],S,l,b,_,F,d,e,a,u,h,s)};if(V===\"line\")for(let z of Tb(e.geometry,0,0,mt,mt)){let B=hr(z,E),tt=Fb(B,v,A,r.vertical||y,i,24,x,t.overscaling,mt);for(let it of tt){let pt=y;(!pt||!jb(t,pt.text,O,it))&&$(B,it)}}else if(V===\"line-center\"){for(let z of e.geometry)if(z.length>1){let B=hr(z,E),tt=Eb(B,A,r.vertical||y,i,24,x);tt&&$(B,tt)}}else if(e.type===\"Polygon\")for(let z of Ba(e.geometry,0)){let B=zb(z,16);$(hr(z[0],E,!0),new Hr(B.x,B.y,0))}else if(e.type===\"LineString\")for(let z of e.geometry){let B=hr(z,E);$(B,new Hr(B[0].x,B[0].y,0))}else if(e.type===\"Point\")for(let z of e.geometry)for(let B of z)$([B],new Hr(B.x,B.y,0))}function Ub(t,e){let r=t.length,i=e?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let a=Rb[i[n]],s=i[n+1];t.emplaceBack(a,s[0],s[1])}return[r,t.length]}function Zc(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y){let m=Bb(e,r,o,n,a,s,i,t.allowVerticalPlacement),g=t.textSizeData,x=null;g.kind===\"source\"?(x=[128*n.layout.get(\"text-size\").evaluate(s,{})],x[0]>32640&&Mt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)):g.kind===\"composite\"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Mt(`${t.layerIds[0]}: Value for \"text-size\" is >= 255. Reduce your \"text-size\".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let b of c)p[b]=t.text.placedSymbolArray.length-1;return m.length*4}function vy(t){for(let e in t)return t[e];return null}function qb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,b,v,w,_,A,S){let F=t.addToLineVertexArray(e,r),V=o.layout.get(\"symbol-height-offset\").evaluate(v,{},A);V>t.maxHeightOffset&&(t.maxHeightOffset=V);let O,P,R,E,$=0,z=0,B=0,tt=0,it=-1,pt=-1,st={},ft=(0,Mo.default)(\"\");if(t.allowVerticalPlacement&&i.vertical){let J=o.layout.get(\"text-rotate\").evaluate(v,{},A)+90,W=i.vertical;R=new ta(l,e,u,h,c,W,p,f,d,J),s&&(E=new ta(l,e,u,h,c,s,m,g,d,J))}if(n){let J=o.layout.get(\"icon-rotate\").evaluate(v,{}),W=o.layout.get(\"icon-text-fit\")!==\"none\",C=Yc(n,J,_,W),ut=s?Yc(s,J,_,W):void 0;P=new ta(l,e,u,h,c,n,m,g,!1,J),$=C.length*4;let G=t.iconSizeData,j=null;G.kind===\"source\"?(j=[128*o.layout.get(\"icon-size\").evaluate(v,{})],j[0]>32640&&Mt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)):G.kind===\"composite\"&&(j=[128*w.compositeIconSizes[0].evaluate(v,{},A),128*w.compositeIconSizes[1].evaluate(v,{},A)],(j[0]>32640||j[1]>32640)&&Mt(`${t.layerIds[0]}: Value for \"icon-size\" is >= 255. Reduce your \"icon-size\".`)),t.addSymbols(t.icon,C,j,b,x,v,0,e,F.lineStartIndex,F.lineLength,-1,A,V),it=t.icon.placedSymbolArray.length-1,ut&&(z=ut.length*4,t.addSymbols(t.icon,ut,j,b,x,v,2,e,F.lineStartIndex,F.lineLength,-1,A,V),pt=t.icon.placedSymbolArray.length-1)}let Gt=Object.keys(i.horizontal);for(let J of Gt){let W=i.horizontal[J];O||(O=(ft=(0,Mo.default)(W.text),new ta(l,e,u,h,c,W,p,f,d,o.layout.get(\"text-rotate\").evaluate(v,{},A))));let C=W.positionedLines.length===1;if(B+=Zc(t,e,W,a,o,d,v,y,V,F,i.vertical?1:3,C?Gt:[J],st,it,w,A),C)break}i.vertical&&(tt+=Zc(t,e,i.vertical,a,o,d,v,y,V,F,2,[\"vertical\"],st,pt,w,A));let ze=O?O.boxStartIndex:t.collisionBoxArray.length,fe=O?O.boxEndIndex:t.collisionBoxArray.length,Le=R?R.boxStartIndex:t.collisionBoxArray.length,Zt=R?R.boxEndIndex:t.collisionBoxArray.length,Sr=P?P.boxStartIndex:t.collisionBoxArray.length,Er=P?P.boxEndIndex:t.collisionBoxArray.length,er=E?E.boxStartIndex:t.collisionBoxArray.length,ci=E?E.boxEndIndex:t.collisionBoxArray.length,Tt=-1,Ee=(J,W)=>J?.circleDiameter?Math.max(J.circleDiameter,W):W;Tt=Ee(O,Tt),Tt=Ee(R,Tt),Tt=Ee(P,Tt),Tt=Ee(E,Tt);let rr=+(Tt>-1);rr&&(Tt*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Mt(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),v.sortKey!==void 0&&t.addToSortKey
vendor: 4,436 bytes, line 1646
1646Ranges(t.symbolInstances.length,v.sortKey);let Fr=xy(o,v,A),[Tr,N]=Ub(t.textAnchorOffsets,Fr);t.symbolInstances.emplaceBack(e.x,e.y,st.right>=0?st.right:-1,st.center>=0?st.center:-1,st.left>=0?st.left:-1,st.vertical||-1,it,pt,ft,ze,fe,Le,Zt,Sr,Er,er,ci,u,B,tt,$,z,rr,0,p,Tt,Tr,N,V)}function jb(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])<r)return!0}return n[e].push(i),!1}function Hc(t,e,r){let i=\"never\",n=t.get(e);return n?i=n:t.get(r)&&(i=\"always\"),i}var Gb=[{name:\"a_fade_opacity\",components:1,type:\"Uint8\",offset:0}];function ea(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=o?Math.min(Uc,Math.round(o[0])):0,y=o?Math.min(Uc,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(i*32),Math.round(n*32),a,s,(d<<1)+ +!!l,y,u*16,h*16,c*256,p*256,f)}function Yb(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Xb(t){for(let e of t.sections)if(ty(e.text))return!0;return!1}var al=class{constructor(t){this.layoutVertexArray=new cg,this.indexArray=new xn,this.programConfigurations=t,this.segments=new te,this.dynamicLayoutVertexArray=new pg,this.opacityVertexArray=new fg,this.hasVisibleVertices=!1,this.placedSymbolArray=new ed}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,X2.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,W2.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Gb,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};I(\"SymbolBuffers\",al);var sl=class{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new te,this.collisionVertexArray=new dg}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Z2.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};I(\"CollisionBuffers\",sl);var by=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qc(this.zoom,e[\"text-size\"]),this.iconSizeData=qc(this.zoom,e[\"icon-size\"]);let r=this.layers[0].layout,i=r.get(\"symbol-sort-key\"),n=r.get(\"symbol-z-order\");this.canOverlap=Hc(r,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||Hc(r,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||r.get(\"text-ignore-placement\")||r.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=n!==\"viewport-y\"&&!i.isConstant();let a=n===\"viewport-y\"||n===\"auto\"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get(\"symbol-placement\")===\"point\"&&(this.writingModes=r.get(\"text-writing-mode\").map(s=>ny[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new al(new gr(this.layers,this.zoom,t=>t.startsWith(\"text\"))),this.icon=new al(new gr(this.layers,this.zoom,t=>t.startsWith(\"icon\"))),this.glyphOffsetArray=new nd,this.lineVertexArray=new ad,this.symbolInstances=new id,this.textAnchorOffsets=new od}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=iu.fromFeature(t,r),o=s.graphemes();for(let u=0;u<o.length;u++){let h=s.getSection(u);if(\"imageName\"in h)continue;let c=e[l=h.fontStack]||(e[l]={}),p=o[u];
1646Kd(p)&&(c[p]=!0);for(let f of p){if(c[f]=!0,!a)continue;let d=qr[f];d&&(c[d]=!0)}}}populate(t,e,r){let i=this.layers[0],n=i.layout,a=n.get(\"text-font\"),s=n.get(\"text-field\"),o=n.get(\"icon-image\"),l=(s.value.kind!==\"constant\"||s.value.value instanceof Be&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!==\"constant\"||a.value.value.length>0),u=o.value.kind!==\"constant\"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get(\"symbol-sort-key\");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new at(this.zoom);for(let{feature:y,id:m,index:g,sourceLayerIndex:x}of t){let b=i._featureFilter.needGeometry,v=li(y,b);if(!i._featureFilter.filter(d,v,r))continue;b||(v.geometry=Dr(y));let w;if(l){let F=i.getValueAndResolveTokens(\"text-field\",v,r,f),V=Be.factory(F);this.hasRTLText||(this.hasRTLText=Xb(V)),w=xv(V,i,v)}let _;if(u){let F=i.getValueAndResolveTokens(\"icon-image\",v,r,f);_=F instanceof _e?F:_e.fromString(F)}if(!w&&!_)continue;let A=this.sortFeaturesByKey?h.evaluate(v,{},r):void 0,S={id:m,text:w,icon:_,index:g,sourceLayerIndex:x,geometry:v.geometry,properties:y.properties,type:vn.types[y.type],sortKey:A};if(this.features.push(S),_&&(c[_.name]=!0),w){let F=a.evaluate(v,{},r).join(\",\"),V=n.get(\"text-rotation-alignment\")!==\"viewport\"&&n.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=this.writingModes?.includes(2);let O=el(w.toString());this.calculateGlyphDependencies(w,p,F,V,O);for(let P of w.sections)P.image&&(c[P.image.name]=!0)}}n.get(\"symbol-placement\")===\"line\"&&(this.features=bv(this.features)),this.sortFeaturesByKey&&this.features.sort((y,m)=>y.sortKey-m.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){$b({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s<e.length;s++)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s<e.length-1&&(i+=e[s+1].dist(e[s]));for(let s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;s<e.length;s++){let o=a[s];this.lineVertexArray.emplaceBack(o.x,o.y,o.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=t.indexArray,d=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&s===2?Math.PI/2:0,b=a.text&&a.text.sections;for(let v=0;v<e.length;v++){let{tl:w,tr:_,bl:A,br:S,tex:F,pixelOffsetTL:V,pixelOffsetBR:O,minFontScaleX:P,minFontScaleY:R,glyphOffset:E,isSDF:$,sectionIndex:z}=e[v],B=y.vertexLength,tt=E[1];ea(d,o.x,o.y,w.x,tt+w.y,F.x,F.y,r,$,V.x,V.y,P,R,p),ea(d,o.x,o.y,_.x,tt+_.y,F.x+F.w,F.y,r,$,O.x,V.y,P,R,p),ea(d,o.x,o.y,A.x,tt+A.y,F.x,F.y+F.h,r,$,V.x,O.y,P,R,p),ea(d,o.x,o.y,S.x,tt+S.y,F.x+F.w,F.y+F.h,r,$,O.x,O.y,P,R,p),Yb(t.dynamicLayoutVertexArray,o,x),f.emplaceBack(B,B+2,B+1),f.emplaceBack(B+1,B+2,B+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),(v===e.length-1||z!==e[v+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:c,formattedSection:b?.[z]})}t.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,h,p)}_addCollisionDebugVertex(t,e,r,i,n,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,h=n.collisionVertexArray,c=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,c,p,new M(t,e)),this._addCollisionDebugVertex(u,h,a,c,p,new M(r,e)),this._addCollisionDebugVertex(u,h,a,c,p,new M(r,i)),this._addCollisionDebugVertex(u,h,a,c,p,new M(t,i)),o.vertexLength+=4;let f=n.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(t,e,r,i){for(let n=t;n<e;n++){let a=this.collisionBoxArray.get(n),s=a.x1,o=a.y1,l=a.x2,u=a.y2;this.addCollisionDebugVertices(s,o,l,u,i?this.textCollisionBox:this.iconCollisionBox,a.anch
vendor: 5,055 bytes, line 1646
1646orPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new sl(Gh,Ec.members,Io),this.iconCollisionBox=new sl(Gh,Ec.members,Io);for(let t=0;t<this.symbolInstances.length;t++){let e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,r,i,n,a,s,o,l){let u={};for(let h=e;h<r;h++){let c=t.get(h);u.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.textFeatureIndex=c.featureIndex;break}for(let h=i;h<n;h++){let c=t.get(h);u.verticalTextBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalTextFeatureIndex=c.featureIndex;break}for(let h=a;h<s;h++){let c=t.get(h);u.iconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.iconFeatureIndex=c.featureIndex;break}for(let h=o;h<l;h++){let c=t.get(h);u.verticalIconBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},u.verticalIconFeatureIndex=c.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}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(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;n<i;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let e=Math.sin(t),r=Math.cos(t),i=[],n=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let o=this.symbolInstances.get(s);i.push(Math.round(e*o.anchorX+r*o.anchorY)|0),n.push(o.featureIndex)}return a.sort((s,o)=>i[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n<i.length;n++){let a=i[n];a>=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};I(\"SymbolBucket\",by,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]});function Wb(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):\"\")}var Kc,Zb=()=>Kc||(Kc=new jt({\"symbol-placement\":new L(D.layout_symbol[\"symbol-placement\"],\"symbol-placement\"),\"symbol-spacing\":new L(D.layout_symbol[\"symbol-spacing\"],\"symbol-spacing\"),\"symbol-avoid-edges\":new L(D.layout_symbol[\"symbol-avoid-edges\"],\"symbol-avoid-edges\"),\"symbol-sort-key\":new U(D.layout_symbol[\"symbol-sort-key\"],\"symbol-sort-key\"),\"symbol-z-order\":new L(D.layout_symbol[\"symbol-z-order\"],\"symbol-z-order\"),\"icon-allow-overlap\":new L(D.layout_symbol[\"icon-allow-overlap\"],\"icon-allow-overlap\"),\"icon-overlap\":new L(D.layout_symbol[\"icon-overlap\"],\"icon-overlap\"),\"icon-ignore-placement\":new L(D.layout_symbol[\"icon-ignore-placement\"],\"icon-ignore-placement\"),\"icon-optional\":new L(D.layout_symbol[\"icon-optional\"],\"icon-optional\"),\"icon-rotation-alignment\":new
1646U(D.layout_symbol[\"icon-rotation-alignment\"],\"icon-rotation-alignment\"),\"icon-size\":new U(D.layout_symbol[\"icon-size\"],\"icon-size\"),\"icon-text-fit\":new L(D.layout_symbol[\"icon-text-fit\"],\"icon-text-fit\"),\"icon-text-fit-padding\":new L(D.layout_symbol[\"icon-text-fit-padding\"],\"icon-text-fit-padding\"),\"icon-image\":new U(D.layout_symbol[\"icon-image\"],\"icon-image\"),\"icon-rotate\":new U(D.layout_symbol[\"icon-rotate\"],\"icon-rotate\"),\"icon-padding\":new U(D.layout_symbol[\"icon-padding\"],\"icon-padding\"),\"icon-keep-upright\":new L(D.layout_symbol[\"icon-keep-upright\"],\"icon-keep-upright\"),\"icon-offset\":new U(D.layout_symbol[\"icon-offset\"],\"icon-offset\"),\"icon-anchor\":new U(D.layout_symbol[\"icon-anchor\"],\"icon-anchor\"),\"icon-pitch-alignment\":new L(D.layout_symbol[\"icon-pitch-alignment\"],\"icon-pitch-alignment\"),\"text-pitch-alignment\":new L(D.layout_symbol[\"text-pitch-alignment\"],\"text-pitch-alignment\"),\"text-rotation-alignment\":new L(D.layout_symbol[\"text-rotation-alignment\"],\"text-rotation-alignment\"),\"text-field\":new U(D.layout_symbol[\"text-field\"],\"text-field\"),\"text-font\":new U(D.layout_symbol[\"text-font\"],\"text-font\"),\"text-size\":new U(D.layout_symbol[\"text-size\"],\"text-size\"),\"text-max-width\":new U(D.layout_symbol[\"text-max-width\"],\"text-max-width\"),\"text-line-height\":new L(D.layout_symbol[\"text-line-height\"],\"text-line-height\"),\"text-letter-spacing\":new U(D.layout_symbol[\"text-letter-spacing\"],\"text-letter-spacing\"),\"text-justify\":new U(D.layout_symbol[\"text-justify\"],\"text-justify\"),\"text-radial-offset\":new U(D.layout_symbol[\"text-radial-offset\"],\"text-radial-offset\"),\"text-variable-anchor\":new L(D.layout_symbol[\"text-variable-anchor\"],\"text-variable-anchor\"),\"text-variable-anchor-offset\":new U(D.layout_symbol[\"text-variable-anchor-offset\"],\"text-variable-anchor-offset\"),\"text-anchor\":new U(D.layout_symbol[\"text-anchor\"],\"text-anchor\"),\"text-max-angle\":new L(D.layout_symbol[\"text-max-angle\"],\"text-max-angle\"),\"text-writing-mode\":new L(D.layout_symbol[\"text-writing-mode\"],\"text-writing-mode\"),\"text-rotate\":new U(D.layout_symbol[\"text-rotate\"],\"text-rotate\"),\"text-padding\":new L(D.layout_symbol[\"text-padding\"],\"text-padding\"),\"text-keep-upright\":new L(D.layout_symbol[\"text-keep-upright\"],\"text-keep-upright\"),\"text-transform\":new U(D.layout_symbol[\"text-transform\"],\"text-transform\"),\"text-offset\":new U(D.layout_symbol[\"text-offset\"],\"text-offset\"),\"text-allow-overlap\":new L(D.layout_symbol[\"text-allow-overlap\"],\"text-allow-overlap\"),\"text-overlap\":new L(D.layout_symbol[\"text-overlap\"],\"text-overlap\"),\"text-ignore-placement\":new L(D.layout_symbol[\"text-ignore-placement\"],\"text-ignore-placement\"),\"text-optional\":new L(D.layout_symbol[\"text-optional\"],\"text-optional\"),\"symbol-height-offset\":new U(D.layout_symbol[\"symbol-height-offset\"],\"symbol-height-offset\"),\"symbol-height-anchor\":new L(D.layout_symbol[\"symbol-height-anchor\"],\"symbol-height-anchor\")})),Jc,Hb=()=>Jc||(Jc=new jt({\"icon-opacity\":new U(D.paint_symbol[\"icon-opacity\"],\"icon-opacity\"),\"icon-color\":new U(D.paint_symbol[\"icon-color\"],\"icon-color\"),\"icon-halo-color\":new U(D.paint_symbol[\"icon-halo-color\"],\"icon-halo-color\"),\"icon-halo-width\":new U(D.paint_symbol[\"icon-halo-width\"],\"icon-halo-width\"),\"icon-halo-blur\":new U(D.paint_symbol[\"icon-halo-blur\"],\"icon-halo-blur\"),\"icon-translate\":new L(D.paint_symbol[\"icon-translate\"],\"icon-translate\"),\"icon-translate-anchor\":new L(D.paint_symbol[\"icon-translate-anchor\"],\"icon-translate-anchor\"),\"text-opacity\":new U(D.paint_symbol[\"text-opacity\"],\"text-opacity\"),\"text-color\":new U(D.paint_symbol[\"text-color\"],\"text-color\",{runtimeType:ue,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),\"text-halo-color\":new U(D.paint_symbol[\"text-halo-color\"],\"text-halo-color\"),\"text-halo-width\":new U(D.paint_symbol[\"text-halo-width\"],\"text-halo-width\"),\"text-halo-blur\":new U(D.paint_symbol[\"text-halo-blur\"],\"text-halo-blur\"),\"text-translate\":new L(D.paint_symbol[\"text-translate\"],\"text-translate\"),\"text-translate-anchor\":new L(D.paint_symbol[\"text-translate-anchor\"],\"text-translate-anchor\")})),Gs={get paint(){return Hb()},get layout(){return Zb()}},wy=class{constructor(t){if(t.property.overrides===void 0)throw Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=t.property.overrides?t.property.overrides.runtimeType:cn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e?.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};I(\"FormatSectionOverride\",wy,{omit:[\"defaultValue\"]});var Kb=class ol extends pe{constructor(e,r){super(e,Gs,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get(\"icon-rotation-alignment\");if((i.value.kind!==\"constant\"||i.value.value===\"auto\")&&(this.layout._values[\"icon-rotation-alignment\"]=new ae(i.property,{kind:\"constant\",value:this.layout.get(\"symbol-placement\")===\"point\"?\"viewport\":\"map\"},i.parameters)),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout.get(\"symbol-placement\")===\"point\"?this.layout._values[\"text-rotation-alignment\"]=\"viewport\":this.layout._values[\"text-rotation-alignment\"]=\"map\"),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\").constantOr(\"viewport\")),this.layout.get(\"symbol-placement\")===\"point\"){let n=this.layout.get(\"text-writing-mode\");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values[\"text-writing-mode\"]=a}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!Oa(s.value)&&a?Wb(r.properties,a):a}createBucket(e){return new by(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let e of Gs.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Il(new wy(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind===\"constant\"||r.value.kind===\"source\"?new en(\"source\",i):new ya(\"composite\",i,r.value.zoomStops),this.paint._values[e]=new ae(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get(\"text-field\"),n=Gs.paint.properties[r],a=!1,s=o=>{for(let l of o)if(n.overrides?.hasOverride(l)){a=!0;return}};if(i.value.kind===\"constant\"&&i.value.value instanceof Be)s(i.value.value.sections);else if(i.value.kind===\"source\"||i.value.kind===\"composite\"){let o=u=>{if(!a)if(u instanceof ti&&At(u.value)===pn){let h=u.value;s(h.sections)}else u instanceof Up?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Jb(t,e,r,i=1){let n=t.get(\"icon-padding\").evaluate(e,{},r)?.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Qc,Qb=()=>Qc||(Qc=new jt({\"background-color\":new L(D.paint_background[\"background-color\"],\"background-color\"),\"background-pattern\":new Jf(D.paint_background[\"background-pattern\"],\"background-pattern\"),\"background-opacity\":new L(D.paint_background[\"background-opacity\"],\"background-opacity\")})),tw={get paint(){return Qb()}};var ew=class extends pe{constructor(t,e){super(t,tw,e)}};var rw=class extends pe{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(\"Custom layers cannot be serialized\")}};function Dy(t,e){if(t.type===\"custom\")return new rw(t,e);switch(t.type){case\"background\":return new ew(t,e);case\"circle\":return new Ng(t,e);case\"color-relief\":return new Jg(t,e);case\"fill\":return new Ix(t,e);case\"fill-extrusion\":return new Qx(t,e);case\"heatmap\":return new Yg(t,e);case\"hillshade\":return new Zg(t,e);case\"line\":return new Y2(t,e);case\"raster\":return new rg(t,e);case\"symbol\":return new Kb(t,e)}}var iw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},nw={once:!0},_y=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new iw(()=>this.process()),this.subscription=uh(this.target,\"message\",r=>this.receive(r),!1),this.globalScope=dr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}
1646sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?uh(e.signal,\"abort\",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:\"<cancel>\",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new dl(e.signal.reason))},nw):null;this.resolveRejects[n]={resolve:l=>{a?.unsubscribe(),r(l)},reject:l=>{a?.unsubscribe(),i(l)}};let s=[],o={...t,id:n,sourceMapId:this.mapId,origin:location.origin,data:ji(t.data,s)};this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=[\"file://\",\"resource://android\",\"null\"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===\"<cancel>\"){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(dr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}async processTask(t,e){if(e.type===\"<response>\"){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Wi(Gi(e.error))):n.resolve(Gi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Gi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=await this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Wi(n))}}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:\"<response>\",sourceMapId:this.mapId,origin:location.origin,error:e?ji(e):null,data:ji(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function aw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var Ay=class{constructor(t,e,r){if(!aw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Xi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=ow(this.x,this.y,this.z),n=lw(this.z,this.x,this.y);return t[(this.x+this.y)%t.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(r===\"tms\"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?\"@2x\":\"\").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new M((t.x*e-this.x)*mt,(t.y*e-this.y)*mt)}toString(){return`${this.z}/${this.x}/${this.y}`}},sw=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Xi(t,e.z,e.z,e.x,e.y)}},uu=class ie{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e<i)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Ay(i,+n,+a),this.key=Xi(r,e,i,n,a)}clone(){return new ie(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 Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ie(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ie(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Xi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Xi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ie(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ie(r,this.wrap,r,i,n),new ie(r,this.wrap,r,i+1,n),new ie(r,this.wrap,r,i,n+1),new ie(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new ie(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ie(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new sw(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Xl(e.x-this.wrap,e.y))}normalizeCoordinates(e,r,i=mt){if(e>=0&&e<i&&r>=0&&r<i)return{tileID:this,x:e,y:r};let n=Math.floor(e/i),a=Math.floor(r/i),s=e-n*i,o=r-a*i,l=this.canonical.z,u=1<<l,h=this.canonical.y+a;if(h<0||h>=u)return null;
vendor: 4,152 bytes, line 1646
1646let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ie(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Xi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<<r;return(a*a*t+a*n+i).toString(36)+r.toString(36)+e.toString(36)}var Ys=Math.PI*6378137;function ow(t,e,r){e=2**r-e-1;let i=tp(t*256,e*256,r),n=tp((t+1)*256,(e+1)*256,r);return`${i[0]},${i[1]},${n[0]},${n[1]}`}function tp(t,e,r){let i=2*Ys/256/2**r;return[t*i-Ys,e*i-Ys]}function lw(t,e,r){let i=\"\";for(let n=t;n>0;n--){let a=1<<n-1;i+=(e&a?1:0)+(r&a?2:0)}return i}I(\"CanonicalTileID\",Ay),I(\"OverscaledTileID\",uu,{omit:[\"terrainRttPosMatrix32f\"]});var uw=class{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,\"id\"in t&&(typeof t.id==\"string\"?this.id=parseInt(t.id,10):typeof t.id==\"number\"&&!isNaN(t.id)&&(this.id=t.id))}loadGeometry(){let t=[],e=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of e){let i=[];for(let n of r)i.push(new M(n[0],n[1]));t.push(i)}return t}},ll=\"_geojsonTileLayer\",Sy=class{constructor(t,e){this.layers={[ll]:this},this.name=ll,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new uw(this.features[t],this.extent)}};function hu(t,e=\"\"){let r=new Nv;return hw(t,r,e),r.finish()}function hw(t,e,r=\"\"){for(let i in t.layers)e.writeMessage(3,(n,a)=>cw(n,a,r),t.layers[i])}function cw(t,e,r=\"\"){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||\"\"),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s<t.length;s++)i.feature=t.feature(s),e.writeMessage(2,pw,i);let n=i.keys;for(let s of n)e.writeStringField(3,s);let a=i.values;for(let s of a)e.writeMessage(4,yw,s)}function pw(t,e){if(!t.feature)return;let r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,fw,t),e.writeVarintField(3,r.type),e.writeMessage(4,dw,r)}function fw(t,e){for(let r in t.feature?.properties){let i=t.feature.properties[r],n=t.keycache[r];if(i==null)continue;n===void 0&&(t.keys.push(r),n=t.keys.length-1,t.keycache[r]=n),e.writeVarint(n),typeof i!=\"string\"&&typeof i!=\"boolean\"&&typeof i!=\"number\"&&(i=t.jsonPrefix+JSON.stringify(i));let a=typeof i+\":\"+i,s=t.valuecache[a];s===void 0&&(t.values.push(i),s=t.values.length-1,t.valuecache[a]=s),e.writeVarint(s)}}function Xs(t,e){return(e<<3)+(t&7)}function ep(t){return t<<1^t>>31}function dw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Xs(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u<l;u++){u===1&&i!==1&&e.writeVarint(Xs(2,l-1));let h=s[u].x-n,c=s[u].y-a;e.writeVarint(ep(h)),e.writeVarint(ep(c)),n+=h,a+=c}t.type===3&&e.writeVarint(Xs(7,1))}}function yw(t,e){let r=typeof t;r===\"string\"?e.writeStringField(1,t):r===\"boolean\"?e.writeBooleanField(7,t):r===\"number\"&&(t%1==0?t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t):e.writeDoubleField(3,t))}var cu=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){let r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},mw=class{constructor(t,e,r,i,n){this.type=\"Feature\",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]==\"string\"&&t.properties[a].startsWith(\"__$json__:\")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];
1646for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:\"Point\",coordinates:s[0]}:{type:\"MultiPoint\",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:\"LineString\",coordinates:a[0]}:{type:\"MultiLineString\",coordinates:a};break}case 3:{let a=Cd(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:\"Polygon\",coordinates:s[0]}:{type:\"MultiPolygon\",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!==\"_geometry\"&&e!==\"_vectorTileFeature\"&&e!==\"_x\"&&e!==\"_y\"&&e!==\"_z\"&&(t[e]=this[e]);return t}},_r=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r==\"number\"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Wa=class extends _r{},pu=class extends Wa{getValueFromBuffer(t){return this.dataBuffer[t]}},fu=class extends Wa{getValueFromBuffer(t){return this.dataBuffer[t]}},Ey=class extends _r{constructor(t,e,r,i){super(t,e,i),this.delta=r}},du=class extends Ey{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},yu=class extends _r{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},gw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error(\"Missing layer name\")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let i;if(this.idVector){let s=this.idVector.getValue(r);s!==null&&(i=this.containsMaxSafeIntegerValues(this.idVector)?Number(s):s)}let n={coordinates:e[r],type:this.geometryVector.geometryType(r)},a={};for(let s of this.propertyVectors){if(!s)continue;let o=s.name,l=s.getValue(r);l!==null&&(a[o]=l)}t.push({id:i,geometry:n,properties:a})}return t}containsMaxSafeIntegerValues(t){return t instanceof pu||t instanceof yu||t instanceof du||t instanceof fu}},$i={FEATURE:0,VERTEX:1},rt={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},Ke={GEOMETRY:0,STRUCT:1,MAP:2},Fy={ID:0},Ty=class{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}},X;(function(t){t.NONE=\"NONE\",t.DELTA=\"DELTA\",t.COMPONENTWISE_DELTA=\"COMPONENTWISE_DELTA\",t.RLE=\"RLE\",t.MORTON=\"MORTON\"})(X||(X={}));var Qt;(function(t){t.NONE=\"NONE\",t.FAST_PFOR=\"FAST_PFOR\",t.VARINT=\"VARINT\"})(Qt||(Qt={}));var mu=new Uint32Array(33);mu[0]=0;for(let t=1;t<=32;t++)mu[t]=t===32?4294967295:4294967295>>>32-t;var ul=mu,gu=65536;function xu(t,e){return t-t%e}function xw(t){return xu(t+31,32)}function ky(t){if(!Number.isFinite(t)||t<=0)return gu;let e=xu(Math.floor(t),256);return e===0?256:e}function vw(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>
vendor: 8,892 bytes, line 1646
164614&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function ww(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Dw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function _w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Aw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Sw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function Ew(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,b=t[e+14]>>>0,v=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=b>>>0&65535,r[n++]=b>>>16&65535,r[n++]=v>>>0&65535,r[n]=v>>>16&65535}function Mw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>
164626&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function Bw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Pw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Lw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Vw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function Ow(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>
vendor: 9,116 bytes, line 1646
164613&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function Nw(t,e,r,i,n){let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<<p)&a;r[u+c]=m|0,o=d}u+=32,o=0,h<7&&(l=t[s]>>>0)}}var hl=ky(gu),Uw=3*hl/256+hl|0;function Iy(){let t=new Uint8Array(Uw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function qw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:Iy()}}function jw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Gw(t,e,r,i){i.byteContainer.length<r&&(i.byteContainer=new Uint8Array(r*2),i.byteContainerI32=void 0);let n=i.byteContainer,a=r>>>2;if(n.byteOffset&3)for(let o=0;o<a;o=o+1|0){let l=t[e+o|0]|0,u=o<<2;n[u]=l&255,n[u+1|0]=l>>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length<a)&&(o=i.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u<s;u=u+1|0)n[l+u|0]=o>>>(u<<3)&255}return n}function Yw(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=xw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length<o)&&(u=n[a]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)r3(t,e,u,h,a),e=e+a|0;let c=h-s|0;e=e-(c*a>>>5)|0,r.exceptionSizes[a]=s}return e}function Xw(t,e,r,i,n){switch(n){case 1:Mw(t,e,r,i);break;case 2:Bw(t,e,r,i);break;case 3:Pw(t,e,r,i);break;case 4:zw(t,e,r,i);break;case 5:Lw(t,e,r,i);break;case 6:Vw(t,e,r,i);break;case 7:Ow(t,e,r,i);break;case 8:Rw(t,e,r,i);break;case 16:$w(t,e,r,i);break;default:Nw(t,e,r,i,n)}return e+(n<<3)|0}function Ww(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Zw(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s<i||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Hw(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Zw(n,a,s,r,i,l);if(s=c,h===1){let m=1<<r;for(let g=0;g<i;g=g+1|0){let x=n[s++];t[x+e|0]|=m}return s}let p=o.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=f[h]|0,y=o.exceptionSizes[h]|0;if(d+i>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m<i;m=m+1|0){let g=n[s++],x=p[d++]|0;t[g+e|0]|=x<<r}return f[h]=d,s}function Kw(t,e,r,i,n,a,s,o,l,u){let h=r|0,c=0;for(let p=0;p<s;p=p+1|0){let f=Ww(o,l,c,p);c=f.bytePosIn;let d=f.bitWidth,y=f.exceptionCount,m=a+p*256|0;switch(d){case 0:n.fill(0,m,m+256);break;case 32:for(let g=0;g<256;g=g+1|0)n[m+g|0]=t[h+g|0]|0;h=h+256|0;break;default:h=Xw(t,h,n,m,d)}y>0&&(c=Hw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function Jw(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Gw(t,p,h,a),y=h,m=Yw(t,f,a);return a.dataPointers.fill(0),Kw(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function Qw(t,e,r,i,n,a){let s=i+xu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(hl,s-o);l=Jw(t,e,l,o,u,a),o=o+u|0}return l}function t3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o<l&&h<c;){let d=t[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<<f,d&128)i[h++]=p|0,p=0,f=0;else if(f+=7,f>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function e3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r??Iy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=Qw(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return t3(t,i,o,a,n,l),a}function r3(t,e,r,i,n){switch(n){case 2:bw(t,e,r,i);return;case 3:ww(t,e,r,i);return;case 4:Dw(t,e,r,i);return;case 5:_w(t,e,r,i);return;case 6:Aw(t,e,r,i);return;case 7:Sw(t,e,r,i);return;case 8:Ew(t,e,r,i);return;case 9:Fw(t,e,r,i);return;case 10:Tw(t,e,r,i);return;case 11:kw(t,e,r,i);return;case 12:Iw(t,e,r,i);return;case 16:Cw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=ul[n-h]>>>0,f=(c|(l&p)<<h)&a;r[i+u]=f|0,o=n-h}}function i3(t,e,r,i){if(e<0||r<0||e+r>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${i.length} < ${s}`);if(n>0){let o=t.byteOffset+e;if(o&3)for(let l=0;l<n;l++){let u=e+l*4;i[l]=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]|0}else{let l=new Uint32Array(t.buffer,o,n);for(let u=0;u<n;u++)i[u]=vw(l[u])|0}}if(a){let o=e+n*4,l=r-n*4,u=0;for(let h=0;h<l;h++)u|=t[o+h]<<24-h*8;i[n]=u|0}return s}function Rt(t,e,r){let i=new Uint32Array(r),n=0,a=e.get();for(let s=0;s<i.length;s++){let o=t[a++],l=o&127;if(o<128){i[n++]=l;continue}if(o=t[a++],l|=(o&127)<<7,o<128){i[n++]=l;continue}if(o=t[a++],l|=(o&127)<<14,o<128){i[n++]=l;continue}if(o=t[a++],l|=(o&127)<<21,o<128){i[n++]=l;continue}o=t[a++],l|=(o&15)<<28,i[n++]=l}return e.set(a),i}function vu(t,e,r){let i=new BigUint64Array(r);for(let n=0;n<i.length;n++)i[n]=n3(t,e);return i}function n3(t,e){let r=0n,i=0,n=e.get();for(;n<t.length;){let a=t[n++];
1646if(r|=BigInt(a&127)<<BigInt(i),!(a&128))break;if(i+=7,i>=64)throw Error(\"Varint too long\")}return e.set(n),r}function a3(t,e,r){let i=new Float64Array(r);for(let n=0;n<r;n++)i[n]=s3(t,e);return i}function s3(t,e){let r,i;return i=t[e.get()],e.increment(),r=i&127,i<128||(i=t[e.get()],e.increment(),r|=(i&127)<<7,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<14,i<128)||(i=t[e.get()],e.increment(),r|=(i&127)<<21,i<128)?r:(i=t[e.get()],r|=(i&15)<<28,o3(r,t,e))}function o3(t,e,r){let i,n;if(n=e[r.get()],r.increment(),i=(n&112)>>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error(\"Expected varint not more than 10 bytes\")}function l3(t,e,r,i){return u3(t,e,r,i,qw(r>>>2))}function u3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=jw(n,s);i3(t,a,r,o);let l=e3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Ot(t){return t>>1n^-(t&1n)}function Ge(t){return t%2==1?(t+1)/-2:t/2}function h3(t){let e=new Int32Array(t.length);for(let r=0;r<t.length;r++)e[r]=et(t[r]);return e}function c3(t){let e=new BigInt64Array(t.length);for(let r=0;r<t.length;r++)e[r]=Ot(t[r]);return e}function p3(t){for(let e=0;e<t.length;e++)t[e]=Ge(t[e])}function cl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Uint32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function pl(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigUint64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function Cy(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];i.fill(o,n,n+s),n+=s}return i}function rp(t){let e=new Int32Array(t.length);e[0]=et(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=et(n)+e[i-1],e[i+1]=et(a)+e[i],e[i+2]=et(s)+e[i+1],e[i+3]=et(o)+e[i+2]}for(;i!==t.length;++i)e[i]=et(t[i])+e[i-1];return e}function ip(t){let e=new BigInt64Array(t.length);e[0]=Ot(t[0]);let r=t.length/4*4,i=1;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=Ot(n)+e[i-1],e[i+1]=Ot(a)+e[i],e[i+2]=Ot(s)+e[i+1],e[i+3]=Ot(o)+e[i+2]}for(;i!==e.length;++i)e[i]=Ot(t[i])+e[i-1];return e}function f3(t){t[0]=Ge(t[0]);let e=t.length/4*4,r=1;if(e>=4)for(;r<e-4;r+=4){let i=t[r],n=t[r+1],a=t[r+2],s=t[r+3];t[r]=Ge(i)+t[r-1],t[r+1]=Ge(n)+t[r],t[r+2]=Ge(a)+t[r+1],t[r+3]=Ge(s)+t[r+2]}for(;r!==t.length;++r)t[r]=Ge(t[r])+t[r-1]}function d3(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=t[a]}let i=new Int32Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=et(o),i.fill(o,n,n+s),n+=s}return i}function y3(t,e,r){if(r===void 0){r=0;for(let a=0;a<e;a++)r+=Number(t[a])}let i=new BigInt64Array(r),n=0;for(let a=0;a<e;a++){let s=Number(t[a]),o=t[a+e];o=Ot(o),i.fill(o,n,n+s),n+=s}return i}function m3(t,e,r){let i=new Float64Array(r),n=0;for(let a=0;a<e;a++){let s=t[a],o=t[a+e];o=Ge(o),i.fill(o,n,n+s),n+=s}return i}function bu(t){let e=t.length/4*4,r=1;if(e>=4)for(let i=t[0];r<e-4;r+=4)i=t[r]+=i,i=t[r+1]+=i,i=t[r+2]+=i,i=t[r+3]+=i;for(;r!==t.length;)t[r]+=t[r-1],++r}function g3(t){let e=0;for(let r=0;r<t.length;r++)t[r]+=e,e=t[r]}function x3(t){if(t.length<2)return new Int32Array(t);let e=new Int32Array(t.length);e[0]=et(t[0]),e[1]=et(t[1]);let r=t.length/4*4,i=2;if(r>=4)for(;i<r-4;i+=4){let n=t[i],a=t[i+1],s=t[i+2],o=t[i+3];e[i]=et(n)+e[i-2],e[i+1]=et(a)+e[i-1],e[i+2]=et(s)+e[i],e[i+3]=et(o)+e[i+1]}for(;i!==t.length;i+=2)e[i]=et(t[i])+e[i-2],e[i+1]=et(t[i+1])+e[i-1];return e}function My(t,e,r,i){if(t.length<2)return new Int32Array(t);let n=new Int32Array(t.length),a=et(t[0]),s=et(t[1]);n[0]=qe(Math.round(a*e),r,i),n[1]=qe(Math.round(s*e),r,i);let o=t.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let u=t[l],h=t[l+1],c=et(u)+a,p=et(h)+s;n[l]=qe(Math.round(c*e),r,i),n[l+1]=qe(Math.round(p*e),r,i);let f=t[l+2],d=t[l+3];a=et(f)+c,s=et(d)+p,n[l+2]=qe(Math.round(a*e),r,i),n[l+3]=qe(Math.round(s*e),r,i)}for(;l!==t.length;l+=2)a+=et(t[l]),s+=et(t[l+1]),n[l]=qe(Math.round(a*e),r,i),n[l+1]=qe(Math.round(s*e),r,i);return n}function qe(t,e,r){return Math.min(r,Math.max(e,t))}function v3(t){let e=new Int32Array(t.length+1);e[0]=0,e[1]=et(t[0]);let r=e[1];for(let i=2;i!==e.length;++i){let n=t[i-1],a=et(n);r+=a,e[i]=e[i-1]+r}return new Uint32Array(e)}function b3(t,e,r){let i=new Int32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];l=et(l);for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function w3(t,e,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let s=0;s<e;s++){let o=t[s],l=t[s+e];for(let u=n;u<n+o;u++)i[u]=l+a,a=i[u];n+=o}return i}function D3(t,e,r){let i=new Int32Array(r),n=0,a=0;for(let s=0;s<e;s++){let o=t[s],l=t[s+e],u=et(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function _3(t,e,r){let i=new BigInt64Array(r),n=0,a=0n;for(let s=0;s<e;s++){let o=Number(t[s]),l=t[s+e],u=Ot(l);for(let h=0;h<o;h++)a+=u,i[n++]=a}return i}function np(t){let e=new Uint32Array(t.length);e[0]=et(t[0])>>>0;for(let r=1;r<t.length;r++)e[r]=e[r-1]+et(t[r])>>>0;return e}function ap(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r<t.length;r++)e[r]=BigInt.asUintN(64,e[r-1]+Ot(t[r]));return e}function A3(t){if(t.length<2)return new Uint32Array(t);let e=new Uint32Array(t.length);e[0]=et(t[0])>>>0,e[1]=et(t[1])>>>0;for(let r=2;r<t.length;r+=2)e[r]=e[r-2]+et(t[r])>>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function S3(t,e,r,i){let n=My(t,e,r,i);return new Uint32Array(n)}function E3(t){return t[1]}function F3(t){return et(t[1])}function T3(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function k3(t){return t[1]}function I3(t){return Ot(t[1])}function C3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var _t;(function(t){t.PRESENT=\"PRESENT\",t.DATA=\"DATA\",t.OFFSET=\"OFFSET\",t.LENGTH=\"LENGTH\"})(_t||(_t={}));var Ut;(function(t){t.NONE=\"NONE\",t.SINGLE=\"SINGLE\",t.SHARED=\"SHARED\",t.VERTEX=\"VERTEX\",t.MORTON=\"MORTON\",t.FSST=\"FSST\"})(Ut||(Ut={}));var xe;(function(t){t.VERTEX=\"VERTEX\",t.INDEX=\"INDEX\",t.STRING=\"STRING\",t.KEY=\"KEY\"})(xe||(xe={}));var Et;(function(t){t.VAR_BINARY=\"VAR_BINARY\",t.GEOMETRIES=\"GEOMETRIES\",t.PARTS=\"PARTS\",t.RINGS=\"RINGS\",t.TRIANGLES=\"TRIANGLES\",t.SYMBOL=\"SYMBOL\",t.DICTIONARY=\"DICTIONARY\"})(Et||(Et={}));var M3=[_t.PRESENT,_t.DATA,_t.OFFSET,_t.LENGTH],sp=[X.NONE,X.DELTA,X.COMPONENTWISE_DELTA,X.RLE,X.MORTON],B3=[Qt.NONE,Qt.FAST_PFOR,Qt.VARINT],P3=[Ut.NONE,Ut.SINGLE,Ut.SHARED,Ut.VERTEX,Ut.MORTON,Ut.FSST],z3=[xe.VERTEX,xe.INDEX,xe.STRING,xe.KEY],L3=[Et.VAR_BINARY,Et.GEOMETRIES,Et.PARTS,Et.RINGS,Et.TRIANGLES,Et.SYMBOL,Et.DICTIONARY];function ht(t,e){let r=R3(t,e);return r.logicalLevelTechnique1===X.MORTON?V3(r,t,e):(X.RLE===r.logicalLevelTechnique1||X.RLE===r.logicalLevelTechnique2)&&Qt.NONE!==r.physicalLevelTechnique?O3(r,t,e):r}function V3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function O3(t,e,r){let i=Rt(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function R3(t,e){let r=t[e.get()],i=M3[r>>4],n={};switch(i){case _t.DATA:n={dictionaryType:P3[r&15]};break;case _t.OFFSET:n={offsetType:z3[r&15]};break;case _t.LENGTH:n={lengthType:L3[r&15]}}e.increment();let a=t[e.get()],s=sp[a>>5],o=sp[a>>2&7],l=B3[a&3];e.increment();let u=Rt(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var lt;(function(t){t[t.FLAT=0]=\"FLAT\",t[t.CONST=1]=\"CONST\",t[t.SEQUENCE=2]=\"SEQUENCE\",t[t.DICTIONARY=3]=\"DICTIONARY\",t[t.FSST_DICTIONARY=4]=\"FSST_DICTIONARY\"})(lt||(lt={}));var ce=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<<i}getInt(t){let e=Math.floor(t/8),r=t%8;return this.values[e]>>r&1}size(){return this._size}getBuffer(){return this.values}};function Ar(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o<i;o++)a[o]=e.get(o)?t[s++]:r;return a}function $3(t,e,r){if(!r)return t;let i=r.size(),n=new ce(t,e),a=new ce(new Uint8Array(Math.ceil(i/8)),i),s=0;for(let o=0;o<i;o++){let l=r.get(o)?n.get(s++):!1;a.set(o,l)}return a.getBuffer()}function By(t,e,r){for(let i=0;i<t;i++){let n=ht(e,r);r.add(n.byteLength)}}function ui(t,e,r,i,n){let a=N3(t,Math.ceil(e/8),r,i);return n?$3(a,e,n):a}function N3(t,e,r,i){let n=new Uint8Array(e),a=0,s=i.get()+r;for(;a<e&&!(i.get()>=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u<l&&a<e;u++)n[a++]=t[i.increment()]}}return i.set(s),n}function Py(t,e,r,i){let n=e.get(),a=n+r*Float32Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float32Array(s);return e.set(a),i?Ar(o,i,0):o}function zy(t,e,r,i){let n=e.get(),a=n+r*Float64Array.BYTES_PER_ELEMENT,s=new Uint8Array(t.subarray(n,a)).buffer,o=new Float64Array(s);return e.set(a),i?Ar(o,i,0):o}function U3(t,e,r){let i=e.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(r);for(let o=0;o<r;o++)s[o]=a.getUint32(i+o*Uint32Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}function q3(t,e,r){let i=e.get(),n=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new BigUint64Array(r);for(let o=0;o<r;o++)s[o]=a.getBigUint64(i+o*BigUint64Array.BYTES_PER_ELEMENT,!0);return e.add(n),s}var j3=new TextDecoder;function wu(t,e,r){return r-e>=12?j3.decode(t.subarray(e,r)):G3(t,e,r)}function G3(t,e,r){let i=\"\",n=e;for(;n<r;){let a=t[n],s=null,o=a>239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function _a(t,e,r,i,n){return H3(hi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return K3(hi(t,e,r),r,i,n)}function Ye(t,e,r){return Q3(hi(t,e,r),r)}function hi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case Qt.FAST_PFOR:return l3(t,r.numValues,r.byteLength,e);case Qt.VARINT:return Rt(t,e,r.numValues);case Qt.NONE:return U3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function bn(t,e,r){let i=r.physicalLevelTechnique;switch(i){case Qt.VARINT:return vu(t,e,r.numValues);case Qt.NONE:return q3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Y3(t,e,r){let i=hi(t,e,r);return i.length===1?et(i[0]):F3(i)}function Du(t,e,r){let i=hi(t,e,r);return i.length===1?r.logicalLevelTechnique1===X.DELTA?et(i[0]):i[0]:E3(i)}function Ly(t,e,r){return T3(hi(t,e,r))}
vendor: 24,103 bytes, line 1646
1646function Vy(t,e,r){return C3(vu(t,e,r.numValues))}function Oy(t,e,r,i){return $y(bn(t,e,r),r,i)}function _u(t,e,r,i){return Ny(bn(t,e,r),r,i)}function X3(t,e,r,i){let n=W3(t,e,r,!1);return i?Ar(n,i,0):n}function W3(t,e,r,i){if(r.physicalLevelTechnique===Qt.VARINT)return J3(a3(t,e,r.numValues),r,i);let n=bn(t,e,r),a=i?$y(n,r):Ny(n,r);return Float64Array.from(a,Number)}function Z3(t,e,r){let i=bn(t,e,r);return i.length===1?Ot(i[0]):I3(i)}function Ry(t,e,r){let i=bn(t,e,r);return i.length===1?r.logicalLevelTechnique1===X.DELTA?Ot(i[0]):i[0]:k3(i)}function H3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case X.DELTA:if(e.logicalLevelTechnique2===X.RLE){let a=e;if(!i)return D3(t,a.runs,a.numRleValues);t=cl(t,a.runs,a.numRleValues),n=rp(t)}else n=rp(t);break;case X.RLE:n=d3(t,e.runs,e.numRleValues);break;case X.MORTON:bu(t),n=new Int32Array(t);break;case X.COMPONENTWISE_DELTA:if(r&&!i)return My(t,r.scale,r.min,r.max);n=x3(t);break;case X.NONE:n=h3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Ar(n,i,0):n}function K3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case X.DELTA:if(e.logicalLevelTechnique2===X.RLE){let a=e;n=np(cl(t,a.runs,a.numRleValues))}else n=np(t);break;case X.RLE:n=cl(t,e.runs,e.numRleValues);break;case X.MORTON:bu(t),n=t;break;case X.COMPONENTWISE_DELTA:n=r&&!i?S3(t,r.scale,r.min,r.max):A3(t);break;case X.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Ar(n,i,0):n}function $y(t,e,r){let i;switch(e.logicalLevelTechnique1){case X.DELTA:if(e.logicalLevelTechnique2===X.RLE){let n=e;if(!r)return _3(t,n.runs,n.numRleValues);t=pl(t,n.runs,n.numRleValues),i=ip(t)}else i=ip(t);break;case X.RLE:i=y3(t,e.runs,e.numRleValues);break;case X.NONE:i=c3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Ar(i,r,0n):i}function Ny(t,e,r){let i;switch(e.logicalLevelTechnique1){case X.DELTA:if(e.logicalLevelTechnique2===X.RLE){let n=e;i=ap(pl(t,n.runs,n.numRleValues))}else i=ap(t);break;case X.RLE:i=pl(t,e.runs,e.numRleValues);break;case X.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Ar(i,r,0n):i}function J3(t,e,r){switch(e.logicalLevelTechnique1){case X.DELTA:if(e.logicalLevelTechnique2===X.RLE){let i=e;t=Cy(t,i.runs,i.numRleValues)}return f3(t),t;case X.RLE:return e6(t,e,r);case X.NONE:return r&&p3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function Q3(t,e){if(e.logicalLevelTechnique1===X.DELTA&&e.logicalLevelTechnique2===X.NONE)return v3(t);if(e.logicalLevelTechnique1===X.RLE&&e.logicalLevelTechnique2===X.NONE){let r=e;return w3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===X.NONE&&e.logicalLevelTechnique2===X.NONE){g3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===X.DELTA&&e.logicalLevelTechnique2===X.RLE){let r=e,i=b3(t,r.runs,r.numRleValues);return bu(i),new Uint32Array(i)}throw Error(\"Only delta encoding is supported for transforming length to offset streams yet.\")}function Za(t,e,r,i,n=\"int32\"){let a=t.logicalLevelTechnique1;if(a===X.RLE)return t.runs===1?lt.CONST:lt.FLAT;if(a!==X.DELTA||t.logicalLevelTechnique2!==X.RLE)return t.numValues===1?lt.CONST:lt.FLAT;let s=e instanceof ce?e.size():e,o=t;if(o.numRleValues!==s)return lt.FLAT;if(o.runs===1)return lt.SEQUENCE;if(o.runs!==2)return t.numValues===1?lt.CONST:lt.FLAT;let l=i.get();if(t.physicalLevelTechnique===Qt.VARINT)return t6(r,i,n)?lt.SEQUENCE:t.numValues===1?lt.CONST:lt.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?lt.SEQUENCE:t.numValues===1?lt.CONST:lt.FLAT}function t6(t,e,r){let i=new Ty(e.get());if(r===\"int64\"){let a=vu(t,i,4);return a[2]===2n&&a[3]===2n}let n=Rt(t,i,4);return n[2]===2&&n[3]===2}function e6(t,e,r){return r?m3(t,e.runs,e.numRleValues):Cy(t,e.runs,e.numRleValues)}var Uy=class extends Wa{getValueFromBuffer(t){return this.dataBuffer[t]}},qy=class extends Ey{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function Au(t,e,r){return{x:op(t,e)-r,y:op(t>>1,e)-r}}function op(t,e){let r=0;for(let i=0;i<e;i++)r|=(t&1<<2*i)>>i;return r}var Pt;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\",t[t.MULTIPOINT=3]=\"MULTIPOINT\",t[t.MULTILINESTRING=4]=\"MULTILINESTRING\",t[t.MULTIPOLYGON=5]=\"MULTIPOLYGON\"})(Pt||(Pt={}));var lp;(function(t){t[t.POINT=0]=\"POINT\",t[t.LINESTRING=1]=\"LINESTRING\",t[t.POLYGON=2]=\"POLYGON\"})(lp||(lp={}));var Qe;(function(t){t[t.MORTON=0]=\"MORTON\",t[t.VEC_2=1]=\"VEC_2\",t[t.VEC_3=2]=\"VEC_3\"})(Qe||(Qe={}));function r6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g<t.numGeometries;g++){let x=t.geometryType(g);switch(x){case Pt.POINT:{let b,v;if(d)b=m[s++],v=m[s++];else if(t.vertexBufferType===Qe.MORTON){let w=m[f[o++]],_=Au(w,l.numBits,l.coordinateShift);b=_.x,v=_.y}else{let w=f[o++]*2;b=m[w],v=m[w+1]}e[a++]=[[new M(b,v)]],h&&n++,c&&r++,p&&i++}break;case Pt.MULTIPOINT:{let b=h[n]-h[n-1];n++;let v;if(d){v=Array(b);for(let w=0;w<b;w++){let _=m[s++],A=m[s++];v[w]=new M(_,A)}}else v=or(t.vertexBufferType,m,f,o,b,!1,l),o+=b;e[a++]=v.map(w=>[w]),r+=b,i+=b}break;case Pt.LINESTRING:{let b;y?(b=p[i]-p[i-1],i++):b=c[r]-c[r-1],r++;let v;d?(v=Lr(m,s,b,!1),s+=b*2):(v=or(t.vertexBufferType,m,f,o,b,!1,l),o+=b),e[a++]=[v],h&&n++}break;case Pt.POLYGON:{let b=c[r]-c[r-1];r++;let v=Array(b-1),w,_=p[i]-p[i-1];if(i++,d){w=Lr(m,s,_,!0),s+=_*2;for(let A=0;A<v.length;A++)_=p[i]-p[i-1],i++,v[A]=Lr(m,s,_,!0),s+=_*2}else{w=or(t.vertexBufferType,m,f,o,_,!0,l),o+=_;for(let A=0;A<v.length;A++)_=p[i]-p[i-1],i++,v[A]=or(t.vertexBufferType,m,f,o,_,!0,l),o+=_}e[a++]=[w].concat(v),h&&n++}break;case Pt.MULTILINESTRING:{let b=h[n]-h[n-1];n++;let v=Array(b);for(let w=0;w<b;w++){let _;if(y?(_=p[i]-p[i-1],i++):_=c[r]-c[r-1],r++,d)v[w]=Lr(m,s,_,!1),s+=_*2;else{let A=or(t.vertexBufferType,m,f,o,_,!1,l);v[w]=A,o+=_}}e[a++]=v}break;case Pt.MULTIPOLYGON:{let b=h[n]-h[n-1];n++;let v=Array(b);for(let w=0;w<b;w++){let _=c[r]-c[r-1];r++;let A,S=Array(_-1),F=p[i]-p[i-1];i++,d?(A=Lr(m,s,F,!0),s+=F*2):(A=or(t.vertexBufferType,m,f,o,F,!0,l),o+=F);for(let V=0;V<S.length;V++){let O=p[i]-p[i-1];i++,d?(S[V]=Lr(m,s,O,!0),s+=O*2):(S[V]=or(t.vertexBufferType,m,f,o,O,!0,l),o+=O)}v[w]=[A].concat(S)}e[a++]=v.flat()}break;default:throw Error(`The specified geometry type (${x}) is currently not supported.`)}}return e}function or(t,e,r,i,n,a,s){return t===Qe.MORTON?n6(e,r,i,n,a,s):i6(e,r,i,n,a)}function Lr(t,e,r,i){let n=Array(i?r+1:r);for(let a=0;a<r*2;a+=2){let s=t[e+a],o=t[e+a+1];n[a/2]=new M(s,o)}return i&&(n[n.length-1]=n[0]),n}function i6(t,e,r,i,n){let a=Array(n?i+1:i);for(let s=0;s<i*2;s+=2){let o=e[r+s/2]*2,l=t[o],u=t[o+1];a[s/2]=new M(l,u)}return n&&(a[a.length-1]=a[0]),a}function n6(t,e,r,i,n,a){let s=Array(n?i+1:i);for(let o=0;o<i;o++){let l=t[e[r+o]],u=Au(l,a.numBits,a.coordinateShift);s[o]=new M(u.x,u.y)}return n&&(s[s.length-1]=s[0]),s}var jy=class{constructor(t,e,r,i,n){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[t],i=this.vertexBuffer[r],n=Au(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[n.x,n.y]}let e=this.vertexOffsets?this.vertexOffsets[t]*2:t*2;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return r6(this)}get mortonSettings(){return this._mortonSettings}};function a6(t,e,r,i,n){return new Gy(t,e,Qe.VEC_2,r,i,n)}function s6(t,e,r,i,n,a){return new Gy(t,e,Qe.MORTON,r,i,n,a)}var Gy=class extends jy{constructor(t,e,r,i,n,a,s){super(r,i,n,a,s),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Pt.POLYGON||this._geometryType===Pt.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function Yy(t,e,r,i){return new Xy(Qe.VEC_2,t,e,r,i)}function o6(t,e,r,i,n){return new Xy(Qe.MORTON,t,e,r,i,n)}var Xy=class extends jy{constructor(t,e,r,i,n,a){super(t,r,i,n,a),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===Pt.POLYGON||this.geometryType(t)===Pt.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},Wy=class{constructor(t,e,r,i){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=r,this._topologyVector=i}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error(\"Cannot convert GpuVector to coordinates without topology information\");let t=new Uint32Array(this.numGeometries);for(let e=0;e<this.numGeometries;e++)t[e]=this.geometryType(e);return Yy(t,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}};function up(t,e,r,i,n,a){return new l6(t,e,r,i,n,a)}var l6=class extends Wy{constructor(t,e,r,i,n,a){super(r,i,n,a),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}};function hp(t,e,r,i,n){return new u6(t,e,r,i,n)}var u6=class extends Wy{constructor(t,e,r,i,n){super(e,r,i,n),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function h6(t,e,r,i,n){let a=ht(t,r),s=Za(a,i,t,r),o,l,u,h;if(s===lt.CONST){let b=Du(t,r,a),v,w,_,A;for(let S=0;S<e-1;S++){let F=ht(t,r);switch(F.physicalStreamType){case _t.LENGTH:switch(F.logicalStreamType.lengthType){case Et.GEOMETRIES:v=Ye(t,r,F);break;case Et.PARTS:w=Ye(t,r,F);break;case Et.RINGS:_=Ye(t,r,F);break;case Et.TRIANGLES:A=Ye(t,r,F)}break;case _t.OFFSET:switch(F.logicalStreamType.offsetType){case xe.VERTEX:o=Vt(t,r,F);break;case xe.INDEX:h=Vt(t,r,F)}break;case _t.DATA:if(Ut.VERTEX===F.logicalStreamType.dictionaryType)l=_a(t,r,F,n);else{let V=F;u={numBits:V.numBits,coordinateShift:V.coordinateShift},l=Vt(t,r,F,n)}}}return h?v!==void 0||w!==void 0?up(i,b,A,h,l,{geometryOffsets:v,partOffsets:w,ringOffsets:_}):up(i,b,A,h,l):u===void 0?a6(i,b,{geometryOffsets:v,partOffsets:w,ringOffsets:_},o,l):s6(i,b,{geometryOffsets:v,partOffsets:w,ringOffsets:_},o,l,u)}let c=Vt(t,r,a),p,f,d,y;for(let b=0;b<e-1;b++){let v=ht(t,r);switch(v.physicalStreamType){case _t.LENGTH:switch(v.logicalStreamType.lengthType){case Et.GEOMETRIES:p=Vt(t,r,v);break;case Et.PARTS:f=Vt(t,r,v);break;case Et.RINGS:d=Vt(t,r,v);break;case Et.TRIANGLES:y=Ye(t,r,v)}break;case _t.OFFSET:switch(v.logicalStreamType.offsetType){case xe.VERTEX:o=Vt(t,r,v);break;case xe.INDEX:h=Vt(t,r,v)}break;case _t.DATA:if(Ut.VERTEX===v.logicalStreamType.dictionaryType)l=_a(t,r,v,n);else{let w=v;u={numBits:w.numBits,coordinateShift:w.coordinateShift},l=Vt(t,r,v,n)}}}let m,g,x;return p?(m=Ws(c,p,2),f&&d?(g=cp(c,m,f,!1),x=p6(c,m,g,d)):f&&(g=c6(c,m,f))):f&&d?(g=Ws(c,f,1),x=cp(c,g,d,!0)):f&&(g=Ws(c,f,0)),h&&!g?hp(c,y,h,l):h?hp(c,y,h,l,{geometryOffsets:m,partOffsets:g,ringOffsets:x}):u===void 0?Yy(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l):o6(c,{geometryOffsets:m,partOffsets:g,ringOffsets:x},o,l,u)}function Ws(t,e,r){let i=new Uint32Array(t.length+1),n=0;i[0]=n;let a=0;for(let s=0;s<t.length;s++)n=i[s+1]=n+(t[s]>r?e[a++]:1);return i}function cp(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l<t.length;l++){let u=t[l],h=e[l+1]-e[l];if(u===5||u===2||i&&(u===4||u===1))for(let c=0;c<h;c++)a=n[s++]=a+r[o++];else for(let c=0;c<h;c++)n[s++]=++a}return n}function c6(t,e,r){let i=new Uint32Array(e[e.length-1]+1),n=0;i[0]=n;let a=1,s=0;for(let o=0;o<t.length;o++){let l=t[o],u=e[o+1]-e[o];if(l===4||l===1)for(let h=0;h<u;h++)n=i[a++]=n+r[s++];else for(let h=0;h<u;h++)i[a++]=++n}return i}function p6(t,e,r,i){let n=new Uint32Array(r[r.length-1]+1),a=0;n[0]=a;let s=1,o=1,l=0;for(let u=0;u<t.length;u++){let h=t[u],c=e[u+1]-e[u];if(h!==0&&h!==3)for(let p=0;p<c;p++){let f=r[s]-r[s-1];s++;for(let d=0;d<f;d++)a=n[o++]=a+i[l++]}else for(let p=0;p<c;p++)n[o++]=++a,s++}return n}var f6=class extends _r{constructor(t,e,r){super(t,e.getBuffer(),r),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}},d6=class extends Wa{getValueFromBuffer(t){return this.dataBuffer[t]}},Zy=class extends _r{constructor(t,e,r,i){super(t,i?BigInt64Array.of(e):BigUint64Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},Su=class extends _r{constructor(t,e,r,i){super(t,r,i),this.offsetBuffer=e}},pp=class extends Su{constructor(t,e,r,i){super(t,e,r,i??e.length-1)}getValueFromBuffer(t){let e=this.offsetBuffer[t],r=this.offsetBuffer[t+1];return wu(this.dataBuffer,e,r)}},Kr=class extends Su{constructor(t,e,r,i,n){super(t,r,i,n??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return wu(this.dataBuffer,r,i)}};function y6(t,e){let r=0;for(let i=0;i<e.length;i++){let n=e[i];n===255?(r++,i++):r+=t[n]}return r}function m6(t,e,r){let i=new Uint32Array(e.length);for(let s=1;s<e.length;s++)i[s]=i[s-1]+e[s-1];let n=new Uint8Array(y6(e,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(o===255)s++,n[a++]=r[s];else{let l=e[o],u=i[o];for(;l-- >0;)n[a++]=t[u++]}}return n}var Hy=class extends Su{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s??e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return wu(this.decodedDictionary,r,i)}decodeDictionary(){return this.symbolLengthBuffer??(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),m6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i<t.length;i++){let n=t[i];e[i-1]=n-r,r=n}return e}};function Ky(t,e,r,i,n){let a,s,o,l,u,h=n,c,p;for(let f=0;f<i;f++){let d=ht(e,r);switch(d.physicalStreamType){case _t.PRESENT:{let y=new ce(ui(e,d.numValues,d.byteLength,r),d.numValues);h=n??y;break}case _t.OFFSET:s=Vt(e,r,d,void 0,h);break;case _t.LENGTH:{let y=Ye(e,r,d);Et.DICTIONARY===d.logicalStreamType.lengthType?a=y:Et.SYMBOL===d.logicalStreamType.lengthType?l=y:c=y;break}case _t.DATA:{let y=e.subarray(r.get(),r.get()+d.byteLength);r.add(d.byteLength);let m=d.logicalStreamType.dictionaryType;Ut.FSST===m?u=y:Ut.SINGLE===m||Ut.SHARED===m?o=y:Ut.NONE===m&&(p=y);break}}}return g6(t,u,s,a,o,l,h)??x6(t,o,s,a,h)??v6(t,c,p,s,h)}function g6(t,e,r,i,n,a,s){if(e){if(!r||!i||!n||!a)throw Error(`Incomplete FSST dictionary string column \"${t}\"`);return new Hy(t,r,i,n,a,e,s)}}function x6(t,e,r,i,n){if(e){if(!r||!i)throw Error(`Incomplete dictionary string column \"${t}\"`);return n?new Kr(t,r,i,e,n):new Kr(t,r,i,e)}}function v6(t,e,r,i,n){if(e&&r){if(i)return n?new Kr(t,i,e,r,n):new Kr(t,i,e,r);if(n&&n.size()!==e.length-1){let a=new Uint32Array(n.size()),s=0;for(let o=0;o<n.size();o++)n.get(o)?a[o]=s++:a[o]=0;return new Kr(t,a,e,r,n)}return n?new pp(t,e,r,n):new pp(t,e,r)}}function b6(t,e,r,i){let n,a,s,o,l=!1;for(;!l;){let f=ht(t,e);switch(f.physicalStreamType){case _t.LENGTH:Et.DICTIONARY===f.logicalStreamType.lengthType?n=Ye(t,e,f):s=Ye(t,e,f);break;case _t.DATA:Ut.SINGLE===f.logicalStreamType.dictionaryType||Ut.SHARED===f.logicalStreamType.dictionaryType?(a=t.subarray(e.get(),e.get()+f.byteLength),l=!0):o=t.subarray(e.get(),e.get()+f.byteLength),e.add(f.byteLength)}}if(r.type!==\"complexType\")throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!n||!a)throw Error(`Incomplete shared dictionary for column \"${r.name}\"`);let u=r.complexType.children,h=[],c=o?{}:void 0,p=0;for(let f of u){let d=Rt(t,e,1)[0];if(d===0)continue;let y=f.name?`${r.name}${f.name}`:r.name;if(i&&!i.has(y)){By(d,t,e);continue}if(f.type!==\"scalarField\"||f.scalarField.physicalType!==rt.STRING)throw Error(\"Currently only scalar string fields are implemented for a struct.\");if(d>1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ht(t,e);m=new ce(ui(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ht(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column \"${y}\"`);h[p++]=new Hy(y,g,n,a,s,o,m,c)}else h[p++]=new Kr(y,g,n,a,m)}return h}var fp=class extends _r{constructor(t,e,r){super(t,new Uint8Array,r??e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},ve;(function(t){t[t.STRING=1]=\"STRING\",t[t.INT32=2]=\"INT32\",t[t.UINT32=4]=\"UINT32\",t[t.INT64=8]=\"INT64\",t[t.UINT64=16]=\"UINT64\",t[t.FLOAT=32]=\"FLOAT\",t[t.DOUBLE=64]=\"DOUBLE\",t[t.PRESENCE=128]=\"PRESENCE\"})(ve||(ve={}));var Ze;(function(t){t[t.FALSE=0]=\"FALSE\",t[t.TRUE=1]=\"TRUE\",t[t.START_MAP=2]=\"START_MAP\",t[t.START_LIST=3]=\"START_LIST\",t[t.COUNT=4]=\"COUNT\"})(Ze||(Ze={}));function w6(t,e,r,i){let n=D6(r);if(i===0)return n.map(h=>new fp(h,[]));let a=_6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h<n.length;h++){let c=T6(a,h,s,l,u);o.push(new fp(n[h],c.value,c.nullabilityBuffer)),l=c.countsEnd,u=c.valuesEnd}return o}function D6(t){let e=t.type===\"complexType\"?t.complexType.children:void 0;return!e||e.length===0?[t.name]:e.map(r=>t.name+(r.name??\"\"))}function _6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ht(t,e)),a=r-1,s=[];i&ve.STRING&&(a-=A6(t,e,s)),a-=S6(t,e,i,s),a-=E6(t,e,i,s);let o,l=0;if(i&ve.PRESENCE){let h=F6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ht(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function A6(t,e,r){let i=t[e.get()];e.add(1);let n=Ky(\"\",t,e,i);if(n)for(let a=0;a<n.size;a++)r.push(n.getValue(a));return i}function S6(t,e,r,i){let n=0;return r&ve.INT32?(jr(i,_a(t,e,ht(t,e))),n++):r&ve.INT64&&(jr(i,Oy(t,e,ht(t,e))),n++),r&ve.UINT32?(jr(i,Vt(t,e,ht(t,e))),n++):r&ve.UINT64&&(jr(i,_u(t,e,ht(t,e))),n++),n}function E6(t,e,r,i){let n=0;return r&ve.FLOAT&&(jr(i,Py(t,e,ht(t,e).numValues)),n++),r&ve.DOUBLE&&(jr(i,zy(t,e,ht(t,e).numValues)),n++),n}function F6(t,e){let r=ht(t,e);if(r.physicalStreamType!==_t.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let i=r.numValues,n=e.get(),a=new ce(ui(t,i,r.byteLength,e),i);return e.set(n+r.byteLength),{value:a,count:i}}function T6(t,e,r,i,n){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=t,u=e*r,h=r,c;if(o){c=new ce(new Uint8Array(Math.ceil(r/8)),r),h=0;for(let x=0;x<r;x++)o.get(u+x)&&(c.set(x,!0),h++)}let p=i+h;if(p>a.length)throw Error(\"Merged map counts underflow while decoding child streams\");let f=Array(r),d=i,y=n;for(let x=0;x<r;x++){if(o&&!o.get(u+x)){f[x]=null;continue}let b=y+a[d++];if(b>s.length)throw Error(\"Map value stream underflow while decoding feature payload\");let v=k6(s,y,b,l);f[x]=v.value,y=v.nextIndex}let m=0;for(let x=i;x<p;x++)m+=a[x];let g=n+m;if(y!==g)throw Error(\"Unused flattened map values remain after decode\");return{value:f,nullabilityBuffer:c,countsEnd:p,valuesEnd:g}}function k6(t,e,r,i){return r-e===1||t[e]===Ze.START_LIST?Eu(t,e,r,i):Jy(t,e,r,i)}function Jy(t,e,r,i){let n=Object.create(null),a=e;for(;a<r;){let s=Qy(t[a++],i);if(typeof s!=\"string\")throw Error(`Map key dictionary index does not resolve to a string: ${s}`);let o=Eu(t,a,r,i);n[s]=o.value,a=o.nextIndex}return{value:n,nextIndex:a}}function Eu(t,e,r,i){if(e>=r)throw Error(\"Unexpected end of map value stream\");let n=t[e];if(n===Ze.FALSE)return{value:!1,nextIndex:e+1};if(n===Ze.TRUE)return{value:!0,nextIndex:e+1};if(n===Ze.START_MAP){let a=dp(t,e,r);return{value:Jy(t,e+2,a,i).value,nextIndex:a}}if(n===Ze.START_LIST){let a=dp(t,e,r),s=[],o=e+2;for(;o<a;){let l=Eu(t,o,a,i);s.push(l.value),o=l.nextIndex}return{value:s,nextIndex:a}}return{value:Qy(n,i),nextIndex:e+1}}function dp(t,e,r){if(e+1>=r)throw Error(\"Missing length for nested map/list payload\");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error(\"Nested payload exceeds containing payload bounds\");return n}function Qy(t,e){let r=t-Ze.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function jr(t,e){for(let r of e)t.push(r)}function I6(t,e,r,i,n,a){return r.type===\"scalarType\"?a&&!a.has(r.name)?(By(i,t,e),null):C6(i,t,e,n,r.scalarType,r):r.complexType?.physicalType===Ke.MAP?w6(t,e,r,i):i===0?null:b6(t,e,r,a)}function C6(t,e,r,i,n,a){let s;if(t===0)return null;if(a.nullable){let l=ht(e,r),u=l.numValues,h=r.get(),c=ui(e,u,l.byteLength,r);r.set(h+l.byteLength),s=new ce(c,l.numValues)}let o=s??i;switch(n.physicalType){case rt.UINT_32:case rt.INT_32:return L6(e,r,a,n,o);case rt.STRING:{let l=a.nullable?t-1:t;return Ky(a.name,e,r,l,s)??null}case rt.BOOLEAN:return M6(e,r,a,i,o);case rt.UINT_64:case rt.INT_64:return z6(e,r,a,o,n);case rt.FLOAT:return B6(e,r,a,o);case rt.DOUBLE:return P6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function M6(t,e,r,i,n){let a=ht(t,e),s=a.numValues,o=e.get(),l=wn(n)?n:void 0,u=ui(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new ce(u,s);return new f6(r.name,h,n)}function B6(t,e,r,i){let n=ht(t,e),a=wn(i)?i:void 0,s=Py(t,e,n.numValues,a);return new d6(r.name,s,i)}function P6(t,e,r,i){let n=ht(t,e),a=wn(i)?i:void 0,s=zy(t,e,n.numValues,a);return new fu(r.name,s,i)}function z6(t,e,r,i,n){let a=ht(t,e),s=Za(a,i,t,e,\"int64\"),o=n.physicalType===rt.INT_64;if(s===lt.FLAT){let u=wn(i)?i:void 0,h=o?Oy(t,e,a,u):_u(t,e,a,u);return new Uy(r.name,h,i)}if(s===lt.SEQUENCE){let u=Vy(t,e,a);return new qy(r.name,u[0],u[1],a.numRleValues,o)}let l=o?Z3(t,e,a):Ry(t,e,a);return new Zy(r.name,l,i,o)}function L6(t,e,r,i,n){let a=ht(t,e),s=Za(a,n,t,e),o=i.physicalType===rt.INT_32;if(s===lt.FLAT){let u=wn(n)?n:void 0,h=o?_a(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new pu(r.name,h,n)}if(s===lt.SEQUENCE){let u=Ly(t,e,a);return new du(r.name,u[0],u[1],a.numRleValues,o)}let l=o?Y3(t,e,a):Du(t,e,a);return new yu(r.name,l,n,o)}function wn(t){return t instanceof ce}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function t1(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:$i.FEATURE,type:\"scalarType\",scalarType:{longID:(t&It.ID_LONG)!==0,type:\"logicalType\",logicalType:Fy.ID}};
1646case It.GEOMETRY:return{nullable:!1,columnScope:$i.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Ke.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:$i.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Ke.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:$i.FEATURE,type:\"complexType\",complexType:{type:\"physicalType\",physicalType:Ke.MAP,children:[]}};default:return N6(t)}}function V6(t){return t>=It.SCALAR_BASE}function e1(t){return t===It.STRUCT||t===It.MAP}function O6(t){if(t.type===\"scalarType\"){let e=t.scalarType;if(e.type===\"physicalType\")switch(e.physicalType){case rt.BOOLEAN:case rt.INT_8:case rt.UINT_8:case rt.INT_32:case rt.UINT_32:case rt.INT_64:case rt.UINT_64:case rt.FLOAT:case rt.DOUBLE:return!1;case rt.STRING:return!0;default:return!1}if(e.type===\"logicalType\")return!1}else if(t.type===\"complexType\"){let e=t.complexType;if(e.type===\"physicalType\")switch(e.physicalType){case Ke.GEOMETRY:case Ke.STRUCT:case Ke.MAP:return!0;default:return!1}}return console.warn(\"Unexpected column type in hasStreamCount\",t),!1}function R6(t){return t.type===\"scalarType\"&&t.scalarType?.type===\"logicalType\"&&t.scalarType.logicalType===Fy.ID}function $6(t){return t.type===\"complexType\"&&t.complexType?.type===\"physicalType\"&&t.complexType.physicalType===Ke.GEOMETRY}function N6(t){let e;switch(t){case 10:case 11:e=rt.BOOLEAN;break;case 12:case 13:e=rt.INT_8;break;case 14:case 15:e=rt.UINT_8;break;case 16:case 17:e=rt.INT_32;break;case 18:case 19:e=rt.UINT_32;break;case 20:case 21:e=rt.INT_64;break;case 22:case 23:e=rt.UINT_64;break;case 24:case 25:e=rt.FLOAT;break;case 26:case 27:e=rt.DOUBLE;break;case 28:case 29:e=rt.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:$i.FEATURE,type:\"scalarType\",scalarType:{longID:!1,type:\"physicalType\",physicalType:e}}
1646}var U6=new TextDecoder,yp=\"0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)\";function Fu(t,e){let r=Rt(t,e,1)[0];if(r===0)return\"\";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),U6.decode(a)}function q6(t){let e=t.name,r=t.nullable;return t.type===\"scalarType\"?{type:\"scalarField\",scalarField:t.scalarType,name:e,nullable:r}:{type:\"complexField\",complexField:t.complexType,name:e,nullable:r}}function r1(t,e){let r=Rt(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?t1(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n={...i,name:Fu(t,e)};if(n.type===\"complexType\"&&e1(r)){let a=n.complexType,s=Rt(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o<s;o++)a.children[o]=r1(t,e)}return q6(n)}function j6(t,e){let r=Rt(t,e,1)[0]>>>0,i=t1(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${yp}`);let n;if(V6(r))n=Fu(t,e);else if(r<It.GEOMETRY)n=\"id\";else if(r===It.GEOMETRY)n=\"geometry\";else throw Error(`Unsupported column type code ${r}. Supported: ${yp}`);let a={...i,name:n};if(a.type===\"complexType\"&&e1(r)){let s=Rt(t,e,1)[0]>>>0,o=a.complexType;o.children=Array(s);for(let l=0;l<s;l++)o.children[l]=r1(t,e)}return a}function G6(t,e){let r={};r.featureTables=[];let i={};if(i.name=Fu(t,e),i.name.length===0)throw Error(\"Missing layer name\");let n=Rt(t,e,1)[0]>>>0,a=Rt(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s<a;s++)i.columns[s]=j6(t,e);return r.featureTables.push(i),[r,n]}function Y6(t,e,r=!0){let i=new Ty(0),n=[];for(;i.get()<t.length;){let a=Rt(t,i,1)[0]>>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=Rt(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=G6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(R6(m)){let x=null;
vendor: 4,085 bytes, line 1646
1646if(m.nullable){let v=ht(t,i),w=i.get(),_=ui(t,v.numValues,v.byteLength,i);i.set(w+v.byteLength),x=new ce(_,v.numValues)}let b=ht(t,i);d=x?x.size():b.decompressedCount,c=X6(t,m,i,g,b,x??d,r)}else if($6(m)){let x=Rt(t,i,1)[0];if(d===0){let b=i.get();d=ht(t,i).decompressedCount,i.set(b)}e&&(e.scale=e.extent/u),p=h6(t,x,i,d,e)}else{let x=O6(m)?Rt(t,i,1)[0]:1;if(x===0)continue;let b=I6(t,i,m,x,d,void 0);if(b)if(Array.isArray(b))for(let v of b)f.push(v);else f.push(b)}}let y=new gw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function X6(t,e,r,i,n,a,s=!1){let o=e.scalarType?.longID?rt.UINT_64:rt.UINT_32,l=typeof a==\"number\"?void 0:a,u=Za(n,a,t,r,o===rt.UINT_64?\"int64\":\"int32\");if(o===rt.UINT_32)switch(u){case lt.FLAT:return new pu(i,Vt(t,r,n,void 0,l),a);case lt.SEQUENCE:{let h=Ly(t,r,n);return new du(i,h[0],h[1],n.numRleValues,!1)}case lt.CONST:return new yu(i,Du(t,r,n),a,!1)}switch(u){case lt.FLAT:return s?new fu(i,X3(t,r,n,l),a):new Uy(i,_u(t,r,n,l),a);case lt.SEQUENCE:{let h=Vy(t,r,n);return new qy(i,h[0],h[1],n.numRleValues,!1)}case lt.CONST:return new Zy(i,Ry(t,r,n),a,!1)}throw Error(\"Vector type not supported for id column.\")}var Zs=ky(gu);Zs/32*4,3*Zs/256+Zs|0;var W6=class{constructor(t,e){switch(this._featureData=t,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Pt.POINT:case Pt.MULTIPOINT:this.type=1;break;case Pt.LINESTRING:case Pt.MULTILINESTRING:this.type=2;break;case Pt.POLYGON:case Pt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new M(i.x,i.y));t.push(r)}return t}},Z6=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new W6(this.features[t],this.extent)}},Tu=class{constructor(t){this.layers={};let e=Y6(new Uint8Array(t));this.layers=e.reduce((r,i)=>({...r,[i.name]:new Z6(i)}),{})}},ku=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new uo(mt,16,0),this.grid3D=new uo(mt,16,0),this.featureIndexArray=new ud,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding===\"mlt\"?this.vtLayers=new Tu(this.rawTileData).layers:this.vtLayers=new Yl(new au(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():[ll])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=mt/t.tileSize/t.scale,s=ii(n.filter,\"queryRenderedFeatures filter\",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=wa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=wa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>kg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(K6);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,b,v)=>(g||(g=Dr(x)),b.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:v,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=li(f,!0);if(!n.filter(new at(this.tileID.overscaledZ),y,this.tileID.canonical))return}
1646else if(!n.filter(new at(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||\"_geojsonTileLayer\",d));let x=qt({},l[y]);x.paint=mp(x.paint,m.paint,f,g,s),x.layout=mp(x.layout,m.layout,f,g,s);let b=!h||h(f,m,g);if(!b)continue;let v=new mw(f,this.z,this.x,this.y,d);v.layer=x;let w=t[y];w===void 0&&(w=t[y]=[]),w.push({featureIndex:i,feature:v,intersectionZ:b})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ii(n.filterSpec,\"queryRenderedFeatures symbol filter\",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){let r=t.id;if(this.promoteId){let i=typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[e];r=t.properties[i],typeof r==\"boolean\"&&(r=Number(r)),r===void 0&&t.properties?.cluster&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};I(\"FeatureIndex\",ku,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});function H6(t){return typeof t==\"object\"&&!!t&&\"evaluate\"in t}function mp(t,e,r,i,n){return Aa(t,(a,s)=>{let o=e instanceof Na?e.get(s):null;return H6(o)?o.evaluate(r,i,void 0,n):o})}function K6(t,e){return e-t}var i1=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.10.0/LICENSE.txt\n*/function Iu(t){let e=typeof t;if(e===\"number\"||e===\"boolean\"||e===\"string\"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n=\"[\";for(let a of t)n+=`${Iu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i=\"{\";for(let n=0;n<r.length;n++)i+=`${JSON.stringify(r[n])}:${Iu(t[r[n]])},`;return`${i}}`}function J6(t){let e=\"\";for(let r of kp)e+=`/${Iu(t[r])}`;return e}function Q6(t,e){let r={};for(let n=0;n<t.length;n++){let a=e&&e[t[n].id]||J6(t[n]);e&&(e[t[n].id]=a);let s=r[a];s||(s=r[a]=[]),s.push(t[n])}let i=[];for(let n in r)i.push(r[n]);return i}var t5=class{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(t,e,r){for(let n of t){this._layerConfigs[n.id]=n;let a=this._layers[n.id]=Dy(n,r);a._featureFilter=ii(a.filter,`layers[${n.id}].filter`,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let n of e)delete this.keyCache[n],delete this._layerConfigs[n],delete this._layers[n];this.familiesBySource={};let i=Q6(Object.values(this._layerConfigs),this.keyCache);for(let n of i){let a=n.map(c=>this._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||\"\",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||\"_geojsonTileLayer\",h=l[u];h||(h=l[u]=[]),h.push(a)}}},s1=class{constructor(t){let e={},r=[];for(let s in t){let o=t[s],l=e[s]={};for(let u in o){let h=o[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(c),l[u]={rect:c,metrics:h.metrics}}}let{w:i,h:n}=su(r),a=new Ya({width:i||1,height:n||1});for(let s in t){let o=t[s];for(let l in o){let u=o[l];if(!u||u.bitmap.width===0||u.bitmap.height===0)continue;let h=e[s][l].rect;Ya.copy(u.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},u.bitmap)}}this.image=a,this.positions=e}};I(\"GlyphAtlas\",s1);var o1=class{constructor(t){this.tileID=new uu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}async parse(t,e,r,i,n){this.data=t,this.collisionBoxArray=new Ll;let a=new cu(Object.keys(t.layers).sort()),s=new ku(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let F=t.layers[S];if(!F)continue;F.version===1&&Mt(`Vector tile source \"${this.source}\" layer \"${S}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let V=a.encode(S),O=[];for(let P=0;P<F.length;P++){let R=F.feature(P),E=s.getId(R,S);O.push({feature:R,id:E,index:P,sourceLayerIndex:V})}for(let P of u[S]){let R=P[0];R.source!==this.source&&Mt(`layer.source = ${R.source} does not equal this.source = ${this.source}`),!R.isHidden(this.zoom,!0)&&(n1(P,this.zoom,r),(o[R.id]=R.createBucket({index:s.bucketLayerIDs.length,layers:P,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:V,sourceID:this.source})).populate(O,l,this.tileID.canonical),s.bucketLayerIDs.push(P.map(E=>E.id)))}}let h=Aa(l.glyphDependencies,S=>Object.keys(S));for(let S of this.inFlightDependencies)S?.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:\"GG\",data:{stacks:h,source:this.source,tileID:this.tileID,type:\"glyphs\"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:\"GI\",data:{icons:p,source:this.source,tileID:this.tileID,type:\"icons\"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:\"GI\",data:{icons:d,source:this.source,tileID:this.tileID,type:\"patterns\"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:\"GDA\",data:{dashes:m}},S)}let[x,b,v,w]=await Promise.all([c,f,y,g]),_=new s1(x),A=new ou(b,v);for(let S in o){let F=o[S];F.hasDependencies&&(n1(F.layers,this.zoom,r),F.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:_.positions,iconMap:b,iconPositions:A.iconPositions,patternMap:v,patternPositions:A.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:A,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?b:null,glyphPositions:this.returnDependencies?_.positions:null}}};function n1(t,e,r){let i=new at(e);for(let n of t)n.recalculate(i,r)}var l1=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e?.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},u1=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},e5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new M(e.x,e.y)))}},r5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},i5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function n5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l<t.length;l++){let u=t.feature(l),h=u.loadGeometry();for(let c of h)for(let p of c)p.x=p.x*n-a,p.y=p.y*n-s;h=my(h,u.type,-128,-128,i+128,i+128),h.length!==0&&o.push(new e5(u.type,h,u.properties,u.id,i))}return new r5(o,t.name,i)}var a5=class{constructor(t,e,r){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new l1,this.overzoomedTileResultCache=new i1(1e3)}loadVectorTile(t,e){try{return{vectorTile:t.encoding===\"mlt\"?new Tu(e):new Yl(new au(e)),rawData:e}}catch(r){let i=new Uint8Array(e),n=i[0]===31&&i[1]===139,a=`Unable to parse the tile at ${t.request.url}, `;throw a+=n?\"please make sure the data is not gzipped and that you have configured the relevant header in the server\":`got error: ${Wi(r).message}`,Error(a)}}async loadTile(t){let{uid:e,overzoomParameters:r}=t;r&&(t.request=r.overzoomRequest);let i=this._startRequestTiming(t),n=new o1(t);this.tileState.startLoading(e,n);let a=new AbortController;n.abort=a;try{let s=await Ep(t.request,a);if(t.etag&&t.etag===s.etag)return this.tileState.finishLoading(e),this._getEtagUnmodifiedResult(s,i);let o=this.loadVectorTile(t,s.data);if(this.tileState.finishLoading(e),!o)return null;let{vectorTile:l,rawData:u}=o;r&&({vectorTile:l,rawData:u}=this._getOverzoomTile(t,l));let h=this._getExpiryData(s),c=this._finishRequestTiming(i);n.vectorTile=l,n.etag=s.etag,this.tileState.markLoaded(e,n);
1646let p={rawData:u,cacheControl:h,resourceTiming:c};return this.tileState.setParsing(e,p),await this._parseWorkerTile(n,t)}catch(s){throw this.tileState.finishLoading(e),this.tileState.markLoaded(e,n),s}}_getEtagUnmodifiedResult(t,e){let r=this._getExpiryData(t),i=this._finishRequestTiming(e);return qt({etagUnmodified:!0},r,i)}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n,cacheControl:a,resourceTiming:s}=r,o=e.overzoomParameters?\"mvt\":e.encoding;i=qt({rawTileData:n.slice(0),encoding:o},i,a,s),this.tileState.removeParsing(t.uid)}else t.etag&&(i=qt(i,{etag:t.etag}));return i}_getExpiryData({expires:t,cacheControl:e,etag:r}){let i={};return t&&(i.expires=t),e&&(i.cacheControl=e),r&&(i.etag=r),i}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new u1(t.request.url)}_finishRequestTiming(t){let e=t?.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){let{tileID:r,source:i,overzoomParameters:n}=t,{maxZoomTileID:a}=n,s=`${a.key}_${r.key}_${t.request?.url}`,o=this.overzoomedTileResultCache.get(s);if(o)return o;let l=new i5,u=this.layerIndex.familiesBySource[i];for(let c in u){let p=e.layers[c];if(!p)continue;let f=n5(p,a,r.canonical);f.length>0&&l.addLayer(f)}let h={vectorTile:l,rawData:hu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,await this._parseWorkerTile(r,t)}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}},s5=class{constructor(){this.loaded={}}async loadTile(t){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Sa(i)?new Wt({width:l,height:u},await wp(i,-2,-2,l,u)):i,c=new jl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c}removeTile(t){let e=this.loaded,r=t.uid;e?.[r]&&delete e[r]}},o5=class{constructor(t,e,r,i=l5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new l1,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(\"Unable to parse the data into a cluster or geojson\");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new Sy(n.features,{version:2,extent:mt});return{vectorTile:a,rawData:hu(a,bp).buffer}}async loadTile(t){let{uid:e}=t,r=new o1(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),await this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}}async _parseWorkerTile(t,e){let r=this.tileState.getParsing(t.uid),i=await t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=qt({rawTileData:n.slice(0),encoding:\"mvt\"},i),this.tileState.removeParsing(t.uid)}return i}async abortTile(t){this.tileState.abort(t.uid)}async removeTile(t){this.tileState.removeLoaded(t.uid)}async loadData(t){this._pendingRequest?.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let r={};return t.request&&(r.data=t.data),this._finishRequestTiming(e,t,r),r}catch(r){if(delete this._pendingRequest,!yl(r))throw r;return{abandoned:!0}}}_startRequestTiming(t){if(t.request?.collectResourceTiming)return new u1(t.request.url)}_finishRequestTiming(t,e,r){let i=t?.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}async reloadTile(t){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return await this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,await this._parseWorkerTile(r,t)}async loadAndProcessGeoJSON(t,e){if(t.request&&(t.data=(await Sp(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}
1646if(t.dataDiff){this._geoJSONIndex??(this._geoJSONIndex=this._createGeoJSONIndex({type:\"FeatureCollection\",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,h1(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}_filterGeoJSON(t,e,r){if(t.type!==\"FeatureCollection\")return t;let i=this._getFilterPredicate(e,r);return i?{type:\"FeatureCollection\",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!=\"boolean\"&&!t?.length)return;let r=tr(t,`sources.${e}.filter`,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(r.result===\"error\")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(\", \"));return i=>r.value.evaluate({zoom:0},i)}async removeSource(t){this._pendingRequest?.abort()}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function l5(t,e){let r=qt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:h1(e)});return new Yd(t,r)}function h1({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=tr(h,`sources.${r}.clusterProperties.${l}[1]`),p=tr(typeof u==\"string\"?[u,[\"accumulated\"],[\"get\",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}async function a1(t){if(t.endsWith(\".mjs\")){await import(t);return}let e=await fetch(t,{credentials:\"same-origin\"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=await e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:\"text/javascript\"}));try{await import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)}var u5=class{constructor(t){this.self=t,this.actor=new _y(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name \"${e}\" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=Dp,this.self.removeProtocol=_p,this.self.registerRTLTextPlugin=e=>{vr.setMethods(e)},this.self.makeRequest=Ea,this.actor.registerMessageHandler(\"LDT\",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RDT\",async(e,r)=>{this._getDEMWorkerSource(e,r.source).removeTile(r)}),this.actor.registerMessageHandler(\"GCEZ\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)),this.actor.registerMessageHandler(\"GCC\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)),this.actor.registerMessageHandler(\"GCL\",async(e,r)=>this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)),this.actor.registerMessageHandler(\"LD\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler(\"LT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler(\"RT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler(\"AT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler(\"RMT\",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler(\"RS\",async(e,r)=>{if(!this.workerSources[e]?.[r.type]?.[r.source])return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)}),this.actor.registerMessageHandler(\"RM\",async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler(\"SR\",async(e,r)=>{this.referrer=r}),this.actor.registerMessageHandler(\"SRPS\",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler(\"IS\",async(e,r)=>{await a1(r)}),this.actor.registerMessageHandler(\"SI\",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler(\"UL\",async(e,r)=>{this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler(\"UGS\",async(e,r)=>{let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]}),this.actor.registerMessageHandler(\"SL\",async(e,r)=>{this._getLayerIndex(e).replace(r,this._getGlobalState(e))})}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}async _setImages(t,e){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}}async _syncRTLPluginState(t,e){return await vr.syncState(e,a1)}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new t5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case\"vector\":this.workerSources[t][e][r]=new a5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case\"geojson\":this.workerSources[t][e][r]=new o5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new s5),this.demWorkerSources[t][e]}};dr(self)&&(self.worker=new u5(self));})();"; 1647 var workerURL = root.URL.createObjectURL( 1648 new root.Blob([workerSource], {type: 'text/javascript'}) 1649 ); 1650 root.maplibregl.setWorkerUrl(workerURL); 1651}(typeof globalThis !== 'undefined' ? globalThis : window)); 1652(function (root) { 1653 var L = root.L; 1654 var maplibregl = root.maplibregl; 1655 1656 if (!L || !maplibregl) { 1657 throw new Error('Leaflet and MapLibre must load before the map adapter'); 1658 } 1659 1660 // MapLibre keeps the camera transform private in current releases. 1661 function cameraTransform(gl) { 1662 if (gl && gl._camera && gl._camera.transform) { 1663 return gl._camera.transform; 1664 } 1665 if (gl && gl.transform) { 1666 return gl.transform; 1667 } 1668 throw new Error('MapLibre camera transform is unavailable'); 1669 } 1670 1671 // The overlay must allow Leaflet to handle the world latitude range. 1672 function relaxLatitude(transform) { 1673 if ('latRange' in transform) { 1674 transform.latRange = null; 1675 } 1676 if ('maxValidLatitude' in transform) { 1677 transform.maxValidLatitude = Infinity; 1678 } 1679 1680 var helper = transform._helper; 1681 if (!helper) { 1682 return; 1683 } 1684 if ('latRange' in helper) { 1685 helper.latRange = null; 1686 } 1687 if ('_latRange' in helper) { 1688 helper._latRange = null; 1689 } 1690 if ('maxValidLatitude' in helper) { 1691 helper.maxValidLatitude = Infinity; 1692 } 1693 if ('_maxValidLatitude' in helper) { 1694 helper._maxValidLatitude = Infinity; 1695 } 1696 } 1697 1698 function actualCanvas(gl) { 1699 var canvas = typeof gl.getCanvas === 'function' ? gl.getCanvas() : gl._canvas; 1700 return canvas && canvas.canvas ? canvas.canvas : canvas; 1701 } 1702 1703 L.MaplibreGL = L.Layer.extend({ 1704 options: { 1705 updateInterval: 32, 1706 // Extend the overlay view relative to the map size. 1707 padding: 0.1, 1708 // Register mouse and keyboard events on the MapLibre overlay. 1709 interactive: false, 1710 // Draw GL tiles in the tile pane by default. 1711 pane: 'tilePane' 1712 }, 1713 1714 initialize: function (options) { 1715 L.setOptions(this, options); 1716 this._throttledUpdate = L.Util.throttle(this._update, this.options.updateInterval, this); 1717 }, 1718 1719 onAdd: function (map) { 1720 if (!this._container) { 1721 this._initContainer(); 1722 } 1723 1724 var paneName = this.getPaneName();
1725 map.getPane(paneName).appendChild(this._container); 1726 1727 this._initGL(); 1728 this._offset = this._map.containerPointToLayerPoint([0, 0]); 1729 1730 // Keep the overlay aligned during Leaflet zoom animations. 1731 if (map.options.zoomAnimation) { 1732 L.DomEvent.on(map._proxy, L.DomUtil.TRANSITION_END, this._transitionEnd, this); 1733 } 1734 }, 1735 1736 onRemove: function (map) { 1737 if (this._map._proxy && this._map.options.zoomAnimation) { 1738 L.DomEvent.off(map._proxy, L.DomUtil.TRANSITION_END, this._transitionEnd, this); 1739 } 1740 var paneName = this.getPaneName(); 1741 map.getPane(paneName).removeChild(this._container); 1742 1743 this._glMap.remove(); 1744 this._glMap = null; 1745 this._actualCanvas = null; 1746 }, 1747 1748 getEvents: function () { 1749 return { 1750 move: this._throttledUpdate, 1751 zoomanim: this._animateZoom, 1752 zoom: this._pinchZoom, 1753 zoomstart: this._zoomStart, 1754 zoomend: this._zoomEnd, 1755 resize: this._resize 1756 }; 1757 }, 1758 1759 getMaplibreMap: function () { 1760 return this._glMap; 1761 }, 1762 1763 getCanvas: function () { 1764 return this._glMap.getCanvas(); 1765 }, 1766 1767 getSize: function () { 1768 return this._map.getSize().multiplyBy(1 + this.options.padding * 2); 1769 }, 1770 1771 getBounds: function () { 1772 var halfSize = this.getSize().multiplyBy(0.5); 1773 var center = this._map.latLngToContainerPoint(this._map.getCenter()); 1774 return L.latLngBounds( 1775 this._map.containerPointToLatLng(center.subtract(halfSize)), 1776 this._map.containerPointToLatLng(center.add(halfSize)) 1777 ); 1778 }, 1779 1780 getContainer: function () { 1781 return this._container; 1782 }, 1783 1784 getPaneName: function () { 1785 return this._map.getPane(this.options.pane) ? this.options.pane : 'tilePane'; 1786 }, 1787 1788 _roundPoint: function (point) { 1789 return {x: Math.round(point.x), y: Math.round(point.y)}; 1790 }, 1791 1792 _initContainer: function () { 1793 var container = this._container = L.DomUtil.create('div', 'leaflet-gl-layer'); 1794 var size = this.getSize(); 1795 var offset = this._map.getSize().multiplyBy(this.options.padding); 1796 container.style.width = size.x + 'px'; 1797 container.style.height = size.y + 'px'; 1798 1799 var topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset); 1800 L.DomUtil.setPosition(container, this._roundPoint(topLeft)); 1801 }, 1802 1803 _initGL: function () { 1804 var center = this._map.getCenter(); 1805 var options = L.extend({}, this.options, { 1806 container: this._container, 1807 center: [center.lng, center.lat], 1808 zoom: this._map.getZoom() - 1, 1809 attributionControl: false 1810 }); 1811 1812 this._glMap = new maplibregl.Map(options); 1813 relaxLatitude(cameraTransform(this._glMap)); 1814 this._transformGL(this._glMap); 1815 this._actualCanvas = actualCanvas(this._glMap); 1816 1817 L.DomUtil.addClass(this._actualCanvas, 'leaflet-image-layer'); 1818 L.DomUtil.addClass(this._actualCanvas, 'leaflet-zoom-animated'); 1819 if (this.options.interactive) { 1820 L.DomUtil.addClass(this._actualCanvas, 'leaflet-interactive'); 1821 } 1822 if (this.options.className) { 1823 L.DomUtil.addClass(this._actualCanvas, this.options.className); 1824 } 1825 }, 1826 1827 _update: function () { 1828 this._offset = this._map.containerPointToLayerPoint([0, 0]); 1829 if (this._zooming) { 1830 return; 1831 } 1832 1833 var size = this.getSize(); 1834 var container = this._container; 1835 var gl = this._glMap; 1836 var offset = this._map.getSize().multiplyBy(this.options.padding); 1837 var topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset); 1838 1839 L.DomUtil.setPosition(container, this._roundPoint(topLeft)); 1840 this._transformGL(gl); 1841 1842 var transform = cameraTransform(gl); 1843 if (transform.width !== size.x || transform.height !== size.y) { 1844 container.style.width = size.x + 'px'; 1845 container.style.height = size.y + 'px'; 1846 if (typeof gl.resize === 'function') { 1847 gl.resize(); 1848 } else if (typeof gl._resize === 'function') { 1849 gl._resize(); 1850 } 1851 } 1852 }, 1853 1854 _transformGL: function (gl) { 1855 relaxLatitude(cameraTransform(gl)); 1856 gl.jumpTo({ 1857 center: this._map.getCenter(), 1858 zoom: this._map.getZoom() - 1 1859 }); 1860 }, 1861 1862 _pinchZoom: function () { 1863 this._glMap.jumpTo({ 1864 zoom: this._map.getZoom() - 1, 1865 center: this._map.getCenter() 1866 }); 1867 }, 1868 1869 _animateZoom: function (event) { 1870 var scale = this._map.getZoomScale(event.zoom); 1871 var padding = this._map.getSize().multiplyBy(this.options.padding * scale);
1872 var viewHalf = this.getSize()._divideBy(2); 1873 var topLeft = this._map.project(event.center, event.zoom) 1874 ._subtract(viewHalf) 1875 ._add(this._map._getMapPanePos().add(padding))._round(); 1876 var offset = this._map.project(this._map.getBounds().getNorthWest(), event.zoom) 1877 ._subtract(topLeft); 1878 1879 L.DomUtil.setTransform(this._actualCanvas, offset.subtract(this._offset), scale); 1880 }, 1881 1882 _zoomStart: function () { 1883 this._zooming = true; 1884 }, 1885 1886 _zoomEnd: function () { 1887 var scale = this._map.getZoomScale(this._map.getZoom()); 1888 L.DomUtil.setTransform(this._actualCanvas, null, scale); 1889 this._zooming = false; 1890 this._update(); 1891 }, 1892 1893 _transitionEnd: function () { 1894 L.Util.requestAnimFrame(function () { 1895 var zoom = this._map.getZoom(); 1896 var center = this._map.getCenter(); 1897 var offset = this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest()); 1898 1899 L.DomUtil.setTransform(this._actualCanvas, offset, 1); 1900 this._glMap.once('moveend', L.Util.bind(function () { 1901 this._zoomEnd(); 1902 }, this)); 1903 this._glMap.jumpTo({ 1904 center: center, 1905 zoom: zoom - 1 1906 }); 1907 }, this); 1908 }, 1909 1910 _resize: function (event) { 1911 this._transitionEnd(event); 1912 } 1913 }); 1914 1915 L.maplibreGL = function (options) { 1916 return new L.MaplibreGL(options); 1917 }; 1918}(typeof globalThis !== 'undefined' ? globalThis : window));
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.