@mapgis/mapbox-gl 16.2.0 → 16.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mapbox-gl.js +4 -4
- package/dist/mapbox-gl.js.map +1 -1
- package/package.json +170 -170
package/dist/mapbox-gl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v16.
|
|
1
|
+
/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v16.8.0/LICENSE.txt */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -26,11 +26,11 @@ if (!shared) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
define(["exports"],(function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n;}n.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s;}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r;}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e;}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function l(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function c(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i]);}return r}var h=1;function f(){return h++}function y(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return !!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e));}));}function v(t,e){return -1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?g(t,b):t}var _={};function w(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0);}function A(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)e+=((o=t[i]).x-(a=t[r]).x)*(a.y+o.y);return e}function k(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function I(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r;}return e}var z=null;function C(t){if(null==z){var e=t.navigator?t.navigator.userAgent:null;z=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return z}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}}var T,M,P,B,V=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),D=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,F=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,L={now:V,frame:function(t){var e=D(t);return {cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return T||(T=self.document.createElement("a")),T.href=t,T.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return !!self.matchMedia&&(null==M&&(M=self.matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}},R={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},O={supported:!1,testSupport:function(t){!U&&B&&(q?j(t):P=t);}},U=!1,q=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,B),t.isContextLost())return;O.supported=!0;}catch(t){}t.deleteTexture(e),U=!0;}self.document&&((B=self.document.createElement("img")).onload=function(){P&&j(P),P=null,q=!0;},B.onerror=function(){U=!0,P=null;},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var N="01",G=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken();};function K(t){return 0===t.indexOf("mapbox:")}G.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return {token:["1",N,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt;},G.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},G.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},G.prototype.normalizeStyleURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeGlyphsURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSourceURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSpriteURL=function(t,e,r,n){var i=Y(t);return K(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,H(i))},G.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!K(t))return t;var r=Y(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(L.devicePixelRatio>=2||512===e?"@2x":"")+(O.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||R.ACCESS_TOKEN;return R.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,n)},G.prototype.canonicalizeTileURL=function(t,e){var r=Y(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return !t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},G.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&K(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];Z(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o);}return n},G.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Y(R.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!R.REQUIRE_ACCESS_TOKEN)return H(t);if(!(e=e||R.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return -1===t.indexOf("access_token")})),t.params.push("access_token="+e),H(t)};var X=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return X.test(t)}var J=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Y(t){var e=t.match(J);if(!e)throw new Error("Unable to parse URL object");return {protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function H(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function $(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return "%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var W=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null;};W.prototype.getStorageKey=function(t){var e,r=$(R.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):R.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},W.prototype.fetchEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i);}catch(t){w("Unable to read from LocalStorage");}},W.prototype.saveEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){w("Unable to write to LocalStorage");}},W.prototype.processRequests=function(t){},W.prototype.postEvent=function(t,e,r,n){var i=this;if(R.EVENTS_URL){var a=Y(R.EVENTS_URL);a.params.push("access_token="+(n||R.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"16.1.9",skuId:N,userId:this.anonId},s=e?p(o,e):o,u={url:H(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n);}));}},W.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var Q,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken="";}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(R.EVENTS_URL&&n||R.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return K(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=y()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0);}),t));}},e}(W),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){R.EVENTS_URL&&R.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return K(t)||Z(t)}))&&this.queueRequest(Date.now(),e);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=$(R.ACCESS_TOKEN),n=r?r.u:R.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=y(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||o.getDate()!==s.getDate();}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n);}),t);}},e}(W)),nt=rt.postTurnstileEvent.bind(rt),it=new et,at=it.postMapLoadEvent.bind(it),ot=500,st=50;function ut(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"));}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var pt,ct=1/0;function ht(t){++ct>st&&(t.getActor().send("enforceCacheSizeLimit",ot),ct=0);}function ft(){return null==pt&&(pt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),pt}var yt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(yt);var dt=function(t){function e(e,r,n){401===r&&Z(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),mt=k()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===self.location.protocol?self.parent:self).location.href};var vt,gt,xt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(mt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Z(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&a)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new dt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message));}));}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(ut(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=I(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===tt)try{new Response(new ReadableStream),tt=!0;}catch(t){tt=!1;}tt?e(t.body):t.blob().then(e);}(e,(function(e){var r=new self.Response(e,n);ut(),Q&&Q.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return w(t.message)}));})));}}(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((function(t){o||e(new Error(t.message));}));};return s?function(t,e){if(ut(),!Q)return e(null);var r=lt(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")||0),r=I(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i);})).catch(e);})).catch(e);}(i,u):u(null,null),{cancel:function(){o=!0,a||n.abort();}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new dt(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},bt=function(t,e){return xt(p(t,{type:"json"}),e)},_t=function(t,e){return xt(p(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return xt(p(t,{method:"POST"}),e)};vt=[],gt=0;var At=function(t,e){if(O.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=R.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return vt.push(r),r}gt++;var n=!1,i=function(){if(!n)for(n=!0,gt--;vt.length&><R.MAX_PARALLEL_IMAGE_REQUESTS;){var t=vt.shift();t.cancelled||(t.cancel=At(t.requestParameters,t.callback).cancel);}},a=_t(t,(function(t,r,n,a){i(),t?e(t):r&&(ft()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).then((function(t){e(null,t);})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));}));}(r,e):function(t,e,r,n){var i=new self.Image,a=self.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src);},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?a.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";}(r,e,n,a));}));return {cancel:function(){a.cancel(),i();}}};function St(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function kt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}var It=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t;},zt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r));}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(It),Ct=function(){};Ct.prototype.on=function(t,e){return this._listeners=this._listeners||{},St(t,e,this._listeners),this},Ct.prototype.off=function(t,e){return kt(t,e,this._listeners),kt(t,e,this._oneTimeListeners),this},Ct.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},St(t,e,this._oneTimeListeners),this},Ct.prototype.fire=function(t,e){"string"==typeof t&&(t=new It(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];kt(r,s,this._oneTimeListeners),s.call(this,t);}var u=this._eventedParent;u&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t));}else t instanceof zt&&console.error(t.error);return this},Ct.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Et={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{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"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["宋体","宋体"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#1890ff",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",default:"#ffffff",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#4F4F4F",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Tt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);};function Mt(t){var e=t.value;return e?[new Tt(t.key,e,"constants have been deprecated as of v8")]:[]}function Pt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function Bt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Vt(t){if(Array.isArray(t))return t.map(Vt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Vt(t[r]);return e}return Bt(t)}var Dt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Ft=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1];}};Ft.prototype.concat=function(t){return new Ft(this,t)},Ft.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Ft.prototype.has=function(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Lt={kind:"null"},Rt={kind:"number"},Ot={kind:"string"},Ut={kind:"boolean"},qt={kind:"color"},jt={kind:"object"},Nt={kind:"value"},Gt={kind:"collator"},Kt={kind:"formatted"},Xt={kind:"resolvedImage"};function Zt(t,e){return {kind:"array",itemType:t,N:e}}function Jt(t){if("array"===t.kind){var e=Jt(t.itemType);return "number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Yt=[Lt,Rt,Ot,Ut,qt,Kt,jt,Zt(Nt),Xt];function Ht(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ht(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Yt;r<n.length;r+=1)if(!Ht(n[r],e))return null}return "Expected "+Jt(t)+" but found "+Jt(e)+" instead."}var $t=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return (t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function o(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=a(c[1]),d=a(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [n(255*o(v,m,f+1/3)),n(255*o(v,m,f)),n(255*o(v,m,f-1/3)),h];default:return null}}return null};}catch(t){}})).parseCSSColor,Wt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};Wt.parse=function(t){if(t){if(t instanceof Wt)return t;if("string"==typeof t){var e=$t(t);if(e)return new Wt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Wt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return "rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},Wt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Wt.black=new Wt(0,0,0,1),Wt.white=new Wt(1,1,1,1),Wt.transparent=new Wt(0,0,0,0),Wt.red=new Wt(1,0,0,1);var Qt=function(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"});};Qt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Qt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var te=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;},ee=function(t){this.sections=t;};ee.fromString=function(t){return new ee([new te(t,null,null,null,null)])},ee.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ee.factory=function(t){return t instanceof ee?t:ee.fromString(t)},ee.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ee.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else {t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i);}}return t};var re=function(t){this.name=t.name,this.available=t.available;};function ne(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ie(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Wt)return !0;if(t instanceof Qt)return !0;if(t instanceof ee)return !0;if(t instanceof re)return !0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ie(r[e]))return !1;return !0}if("object"==typeof t){for(var n in t)if(!ie(t[n]))return !1;return !0}return !1}function ae(t){if(null===t)return Lt;if("string"==typeof t)return Ot;if("boolean"==typeof t)return Ut;if("number"==typeof t)return Rt;if(t instanceof Wt)return qt;if(t instanceof Qt)return Gt;if(t instanceof ee)return Kt;if(t instanceof re)return Xt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=ae(i[n]);if(e){if(e===a)continue;e=Nt;break}e=a;}return Zt(e||Nt,r)}return jt}function oe(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Wt||t instanceof ee||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return ["image",this.name]};var se=function(t,e){this.type=t,this.value=e;};se.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ie(t[1]))return e.error("invalid value");var r=t[1],n=ae(r),i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new se(n,r)},se.prototype.evaluate=function(){return this.value},se.prototype.eachChild=function(){},se.prototype.outputDefined=function(){return !0},se.prototype.serialize=function(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Wt?["rgba"].concat(this.value.toArray()):this.value instanceof ee?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t;};ue.prototype.toJSON=function(){return this.message};var le={string:Ot,number:Rt,boolean:Ut,object:jt},pe=function(t,e){this.type=t,this.args=e;};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=le[s],n++;}else a=Nt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++;}r=Zt(a,o);}else r=le[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,Nt);if(!l)return null;u.push(l);}return new pe(r,u)},pe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Ht(this.type,ae(r)))return r;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Jt(this.type)+", but found "+Jt(ae(r))+" instead.")}return null},pe.prototype.eachChild=function(t){this.args.forEach(t);},pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},pe.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ce=function(t){this.type=Kt,this.sections=t;};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Rt)))return null;var u=null;if(o["text-font"]&&!(u=e.parse(o["text-font"],1,Zt(Ot))))return null;var l=null;if(o["text-color"]&&!(l=e.parse(o["text-color"],1,qt)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l;}else {var c=e.parse(t[a],1,Nt);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null});}}return new ce(n)},ce.prototype.evaluate=function(t){return new ee(this.sections.map((function(e){var r=e.content.evaluate(t);return ae(r)===Xt?new te("",r,null,null,null):new te(oe(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ce.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor);}},ce.prototype.outputDefined=function(){return !1},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i);}return t};var he=function(t){this.type=Xt,this.input=t;};he.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ot);return r?new he(r):e.error("No image name provided.")},he.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=re.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},he.prototype.eachChild=function(t){t(this.input);},he.prototype.outputDefined=function(){return !1},he.prototype.serialize=function(){return ["image",this.input.serialize()]};var fe={"to-boolean":Ut,"to-color":qt,"to-number":Rt,"to-string":Ot},ye=function(t,e){this.type=t,this.args=e;};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Nt);if(!o)return null;i.push(o);}return new ye(n,i)},ye.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Wt)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ne(e[0],e[1],e[2],e[3])))return new Wt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;s<u.length;s+=1){if(null===(o=u[s].evaluate(t)))return 0;var l=Number(o);if(!isNaN(l))return l}throw new ue("Could not convert "+JSON.stringify(o)+" to number.")}return "formatted"===this.type.kind?ee.fromString(oe(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(oe(this.args[0].evaluate(t))):oe(this.args[0].evaluate(t))},ye.prototype.eachChild=function(t){this.args.forEach(t);},ye.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ye.prototype.serialize=function(){if("formatted"===this.type.kind)return new ce([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new he(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize());})),t};var de=["Unknown","Point","LineString","Polygon"],me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null;};me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?de[this.feature.type]:this.feature.type:null},me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},me.prototype.canonicalID=function(){return this.canonical},me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Wt.parse(t)),e};var ve=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n;};ve.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ve.prototype.eachChild=function(t){this.args.forEach(t);},ve.prototype.outputDefined=function(){return !1},ve.prototype.serialize=function(){return [this.name].concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){var r,n=t[0],i=ve.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return !Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new Je(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(h)?h[m-1]:h.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x);}if(!d)if(Array.isArray(h)&&h.length!==y.length)u.error("Expected "+h.length+" arguments, but found "+y.length+" instead.");else {for(var b=0;b<y.length;b++){var _=Array.isArray(h)?h[b]:h.type,w=y[b];u.concat(b+1).checkSubtype(_,w.type);}if(0===u.errors.length)return new ve(n,a,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else {for(var A=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Jt).join(", ")+")":"("+Jt(e.type)+"...)"})).join(" | "),S=[],k=1;k<t.length;k++){var I=e.parse(t[k],1+S.length);if(!I)return null;S.push(Jt(I.type));}e.error("Expected arguments of type "+A+", but found ("+S.join(", ")+") instead.");}return null},ve.register=function(t,e){for(var r in ve.definitions=e,e)t[r]=ve;};var ge=function(t,e,r){this.type=Gt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;};ge.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ut);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ut);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Ot))?null:new ge(n,i,a)},ge.prototype.evaluate=function(t){return new Qt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ge.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},ge.prototype.outputDefined=function(){return !1},ge.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var xe=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]));};xe.prototype.setNorthEast=function(t){return this._ne=t instanceof be?new be(t.lng,t.lat):be.convert(t),this},xe.prototype.setSouthWest=function(t){return this._sw=t instanceof be?new be(t.lng,t.lat):be.convert(t),this},xe.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof be)e=t,r=t;else {if(!(t instanceof xe))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(xe.convert(t)):this.extend(be.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new be(e.lng,e.lat),this._ne=new be(r.lng,r.lat)),this},xe.prototype.getCenter=function(){return new be((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xe.prototype.getSouthWest=function(){return this._sw},xe.prototype.getNorthEast=function(){return this._ne},xe.prototype.getNorthWest=function(){return new be(this.getWest(),this.getNorth())},xe.prototype.getSouthEast=function(){return new be(this.getEast(),this.getSouth())},xe.prototype.getWest=function(){return this._sw.lng},xe.prototype.getSouth=function(){return this._sw.lat},xe.prototype.getEast=function(){return this._ne.lng},xe.prototype.getNorth=function(){return this._ne.lat},xe.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},xe.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xe.prototype.isEmpty=function(){return !(this._sw&&this._ne)},xe.prototype.contains=function(t){var e=be.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},xe.convert=function(t){return !t||t instanceof xe?t:new xe(t)};var be=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};be.prototype.wrap=function(){return new be(l(this.lng,-180,180),this.lat)},be.prototype.toArray=function(){return [this.lng,this.lat]},be.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},be.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},be.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new xe(new be(this.lng-r,this.lat-e),new be(this.lng+r,this.lat+e))},be.convert=function(t){if(t instanceof be)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new be(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new be(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var _e=2*Math.PI*6371008.8;function we(t){return _e*Math.cos(t*Math.PI/180)}function Ae(t){return (180+t)/360}function Se(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ke(t,e){return t/we(e)}function Ie(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var ze=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};function Ce(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 Ee(t,e){return !(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Te(t,e){var r=ze.fromLngLat({lng:t[0],lat:t[1]},0),n=Math.pow(2,e.z);return [Math.round(r.x*n*8192),Math.round(r.y*n*8192)]}function Me(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 Pe(t,e){for(var r,n,i,a,o,s,u,l=!1,p=0,c=e.length;p<c;p++)for(var h=e[p],f=0,y=h.length;f<y-1;f++){if((a=(r=t)[0]-(n=h[f])[0])*(u=r[1]-(i=h[f+1])[1])-(s=r[0]-i[0])*(o=r[1]-n[1])==0&&a*s<=0&&o*u<=0)return !1;Me(t,h[f],h[f+1])&&(l=!l);}return l}function Be(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return !0;return !1}function Ve(t,e,r,n){var i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function De(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(0!=(c=[(p=a[o+1])[0]-(l=a[o])[0],p[1]-l[1]])[0]*(h=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-c[1]*h[0]&&Ve(s,u,l,p)&&Ve(l,p,s,u))return !0;var s,u,l,p,c,h;return !1}function Fe(t,e){for(var r=0;r<t.length;++r)if(!Pe(t[r],e))return !1;for(var n=0;n<t.length-1;++n)if(De(t[n],t[n+1],e))return !1;return !0}function Le(t,e){for(var r=0;r<e.length;r++)if(Fe(t,e[r]))return !0;return !1}function Re(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Te(t[i][o],r);Ce(e,s),a.push(s);}n.push(a);}return n}function Oe(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Re(t[i],e,r);n.push(a);}return n}function Ue(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a;}Ce(e,t);}function qe(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,u=t;s<u.length;s+=1)for(var l=0,p=u[s];l<p.length;l+=1){var c=p[l],h=[c.x+a[0],c.y+a[1]];Ue(h,e,r,i),o.push(h);}return o}function je(t,e,r,n){for(var i,a=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],u=0,l=t;u<l.length;u+=1){for(var p=[],c=0,h=l[u];c<h.length;c+=1){var f=h[c],y=[f.x+o[0],f.y+o[1]];Ce(e,y),p.push(y);}s.push(p);}if(e[2]-e[0]<=a/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var d=0,m=s;d<m.length;d+=1)for(var v=0,g=m[d];v<g.length;v+=1)Ue(g[v],e,r,a);}return s}ze.fromLngLat=function(t,e){void 0===e&&(e=0);var r=be.convert(t);return new ze(Ae(r.lng),Se(r.lat),ke(e,r.lat))},ze.prototype.toLngLat=function(){return new be(360*this.x-180,Ie(this.y))},ze.prototype.toAltitude=function(){return this.z*we(Ie(this.y))},ze.prototype.meterInMercatorCoordinateUnits=function(){return 1/_e*(t=Ie(this.y),1/Math.cos(t*Math.PI/180));var t;};var Ne=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e;};function Ge(t){if(t instanceof ve){if("get"===t.name&&1===t.args.length)return !1;if("feature-state"===t.name)return !1;if("has"===t.name&&1===t.args.length)return !1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return !1;if(/^filter-/.test(t.name))return !1}if(t instanceof Ne)return !1;var e=!0;return t.eachChild((function(t){e&&!Ge(t)&&(e=!1);})),e}function Ke(t){if(t instanceof ve&&"feature-state"===t.name)return !1;var e=!0;return t.eachChild((function(t){e&&!Ke(t)&&(e=!1);})),e}function Xe(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return !1;var r=!0;return t.eachChild((function(t){r&&!Xe(t,e)&&(r=!1);})),r}Ne.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ie(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Ne(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Ne(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Ne(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ne.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Re(e.coordinates,n,i),o=qe(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Pe(u[s],a))return !1}if("MultiPolygon"===e.type){var l=Oe(e.coordinates,n,i),p=qe(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var c=0,h=p;c<h.length;c+=1)if(!Be(h[c],l))return !1}return !0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Re(e.coordinates,n,i),o=je(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Fe(u[s],a))return !1}if("MultiPolygon"===e.type){var l=Oe(e.coordinates,n,i),p=je(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var c=0,h=p;c<h.length;c+=1)if(!Le(h[c],l))return !1}return !0}(t,this.geometries)}return !1},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return !0},Ne.prototype.serialize=function(){return ["within",this.geojson]};var Ze=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};Ze.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ze(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ze.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ze.prototype.eachChild=function(){},Ze.prototype.outputDefined=function(){return !1},Ze.prototype.serialize=function(){return ["var",this.name]};var Je=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Ft),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return "["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r;};function Ye(t,e){for(var r,n=t.length-1,i=0,a=n,o=0;i<=a;)if((r=t[o=Math.floor((i+a)/2)])<=e){if(o===n||e<t[o+1])return o;i=o+1;}else {if(!(r>e))throw new ue("Input is not a number.");a=o-1;}return 0}Je.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Je.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new pe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert");}if(!(a instanceof se)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof Ze)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return !1;if(e instanceof ge)return !1;if(e instanceof Ne)return !1;var r=e instanceof ye||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof se;})),!!n&&Ge(e)&&Xe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new me;try{a=new se(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Je.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Je(this.registry,n,e||null,i,this.errors)},Je.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return "["+t+"]"})).join("");this.errors.push(new Dt(n,t));},Je.prototype.checkSubtype=function(t,e){var r=Ht(t,e);return r&&this.error(r),r};var He=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[1];this.labels.push(a[0]),this.outputs.push(o);}};function $e(t,e,r){return t*(1-r)+e*r}He.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Rt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],u=a,l=a+1;if("number"!=typeof o)return e.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 e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([o,p]);}return new He(i,r,n)},He.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ye(e,n)].evaluate(t)},He.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e]);},He.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},He.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var We=Object.freeze({__proto__:null,number:$e,color:function(t,e,r){return new Wt($e(t.r,e.r,r),$e(t.g,e.g,r),$e(t.b,e.b,r),$e(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return $e(t,e[n],r)}))}}),Qe=6/29*3*(6/29),tr=Math.PI/180,er=180/Math.PI;function rr(t){return t>.008856451679035631?Math.pow(t,1/3):t/Qe+4/29}function nr(t){return t>6/29?t*t*t:Qe*(t-4/29)}function ir(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ar(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function or(t){var e=ar(t.r),r=ar(t.g),n=ar(t.b),i=rr((.4124564*e+.3575761*r+.1804375*n)/.95047),a=rr((.2126729*e+.7151522*r+.072175*n)/1);return {l:116*a-16,a:500*(i-a),b:200*(a-rr((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function sr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*nr(e),r=.95047*nr(r),n=1.08883*nr(n),new Wt(ir(3.2404542*r-1.5371385*e-.4985314*n),ir(-.969266*r+1.8760108*e+.041556*n),ir(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function ur(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var lr={forward:or,reverse:sr,interpolate:function(t,e,r){return {l:$e(t.l,e.l,r),a:$e(t.a,e.a,r),b:$e(t.b,e.b,r),alpha:$e(t.alpha,e.alpha,r)}}},pr={forward:function(t){var e=or(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*er;return {h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*tr,r=t.c;return sr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:ur(t.h,e.h,r),c:$e(t.c,e.c,r),l:$e(t.l,e.l,r),alpha:$e(t.alpha,e.alpha,r)}}},cr=Object.freeze({__proto__:null,lab:lr,hcl:pr}),hr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],u=s[1];this.labels.push(s[0]),this.outputs.push(u);}};function fr(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}hr.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=fr(e,t.base,n,i);else if("linear"===t.name)a=fr(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(fr(e,1,n,i));}return a},hr.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o};}else {if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return "number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Rt)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=qt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<a.length;p+=2){var c=a[p],h=a[p+1],f=p+3,y=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d]);}return "number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new hr(l,r,n,i,u):e.error("Type "+Jt(l)+" is not interpolatable.")},hr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ye(e,n),o=hr.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),u=r[a+1].evaluate(t);return "interpolate"===this.operator?We[this.type.kind.toLowerCase()](s,u,o):"interpolate-hcl"===this.operator?pr.reverse(pr.interpolate(pr.forward(s),pr.forward(u),o)):lr.reverse(lr.interpolate(lr.forward(s),lr.forward(u),o))},hr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e]);},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},hr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var yr=function(t,e){this.type=t,this.args=e;};yr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=e.parse(o[a],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s);}var u=n&&i.some((function(t){return Ht(n,t.type)}));return new yr(u?Nt:r,i)},yr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof re&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},yr.prototype.eachChild=function(t){this.args.forEach(t);},yr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},yr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize());})),t};var dr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;};dr.prototype.evaluate=function(t){return this.result.evaluate(t)},dr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result);},dr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a]);}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new dr(r,o):null},dr.prototype.outputDefined=function(){return this.result.outputDefined()},dr.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize());}return t.push(this.result.serialize()),t};var mr=function(t,e,r){this.type=t,this.index=e,this.input=r;};mr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Rt),n=e.parse(t[2],2,Zt(e.expectedType||Nt));return r&&n?new mr(n.type.itemType,r,n):null},mr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},mr.prototype.eachChild=function(t){t(this.index),t(this.input);},mr.prototype.outputDefined=function(){return !1},mr.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var vr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e;};vr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r,n=e.parse(t[1],1,Nt),i=e.parse(t[2],2,Nt);return n&&i?"boolean"!==(r=n.type).kind&&"string"!==r.kind&&"number"!==r.kind&&"null"!==r.kind&&"value"!==r.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+Jt(n.type)+" instead"):new vr(n,i):null},vr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==e||!r)return !1;if(!function(t){return "boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new ue("Expected first argument to be of type boolean, string or number, but found "+Jt(ae(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(r))throw new ue("Expected second argument to be of type array or string, but found "+Jt(ae(r))+" instead.");return r.indexOf(e)>=0},vr.prototype.eachChild=function(t){t(this.needle),t(this.haystack);},vr.prototype.outputDefined=function(){return !0},vr.prototype.serialize=function(){return ["in",this.needle.serialize(),this.haystack.serialize()]};var gr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a;};gr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],u=t[o+1];Array.isArray(s)||(s=[s]);var l=e.concat(o);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,ae(h)))return null}else r=ae(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=a.length;}var f=e.parse(u,o,n);if(!f)return null;n=n||f.type,a.push(f);}var y=e.parse(t[1],1,Nt);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new gr(r,n,y,i,a,d):null},gr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},gr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},gr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},gr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(c=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[c][1].push(o);}for(var s=function(e){return "number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize());}return e.push(this.otherwise.serialize()),e};var xr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r;};function br(t,e){return "=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function _r(t,e,r,n){return 0===n.compare(e,r)}function wr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Nt);if(!a)return null;if(!br(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Jt(a.type)+"'.");var o=e.parse(t[2],2,Nt);if(!o)return null;if(!br(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Jt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Jt(a.type)+"' and '"+Jt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new pe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new pe(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Gt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=ae(a),u=ae(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=ae(a),p=ae(o);if("string"!==l.kind||"string"!==p.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);},i.prototype.outputDefined=function(){return !0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize());})),e},i}()}xr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Ut);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type;}var s=e.parse(t[t.length-1],t.length-1,r);return s?new xr(r,n,s):null},xr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},xr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i);}t(this.otherwise);},xr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},xr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Ar=wr("==",(function(t,e,r){return e===r}),_r),Sr=wr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return !_r(0,e,r,n)})),kr=wr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Ir=wr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),zr=wr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Cr=wr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Er=function(t,e,r,n,i){this.type=Ot,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i;};Er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Rt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ot)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Ot)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Rt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Rt))?null:new Er(r,i,a,o,s)},Er.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Er.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits);},Er.prototype.outputDefined=function(){return !1},Er.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Tr=function(t){this.type=Rt,this.input=t;};Tr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Jt(r.type)+" instead."):new Tr(r):null},Tr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Jt(ae(e))+" instead.")},Tr.prototype.eachChild=function(t){t(this.input);},Tr.prototype.outputDefined=function(){return !1},Tr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Mr={"==":Ar,"!=":Sr,">":Ir,"<":kr,">=":Cr,"<=":zr,array:pe,at:mr,boolean:pe,case:xr,coalesce:yr,collator:ge,format:ce,image:he,in:vr,interpolate:hr,"interpolate-hcl":hr,"interpolate-lab":hr,length:Tr,let:dr,literal:se,match:gr,number:pe,"number-format":Er,object:pe,step:He,string:pe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ze,within:Ne};function Pr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=ne(r,n,i,o);if(s)throw new ue(s);return new Wt(r/255*o,n/255*o,i/255*o,o)}function Br(t,e){return t in e}function Vr(t,e){var r=e[t];return void 0===r?null:r}function Dr(t){return {type:t}}function Fr(t){return {result:"success",value:t}}function Lr(t){return {result:"error",value:t}}function Rr(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ur(t){return !!t.expression&&t.expression.interpolated}function qr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function jr(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function Gr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Kr(t,e,r,n,i){return Gr(typeof r===i?n[r]:void 0,t.default,e.default)}function Xr(t,e,r){if("number"!==qr(r))return Gr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ye(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Zr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==qr(r))return Gr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ye(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],u=t.stops[a+1][1],l=We[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=cr[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),o))};}return "function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,o)}}:l(s,u,o)}function Jr(t,e,r){return "color"===e.type?r=Wt.parse(r):"formatted"===e.type?r=ee.fromString(r.toString()):"resolvedImage"===e.type?r=re.fromString(r.toString()):qr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Gr(r,t.default,e.default)}ve.register(Mr,{error:[{kind:"error"},[Ot],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[Ot,[Nt],function(t,e){return Jt(ae(e[0].evaluate(t)))}],"to-rgba":[Zt(Rt,4),[qt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[qt,[Rt,Rt,Rt],Pr],rgba:[qt,[Rt,Rt,Rt,Rt],Pr],has:{type:Ut,overloads:[[[Ot],function(t,e){return Br(e[0].evaluate(t),t.properties())}],[[Ot,jt],function(t,e){var r=e[1];return Br(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Nt,overloads:[[[Ot],function(t,e){return Vr(e[0].evaluate(t),t.properties())}],[[Ot,jt],function(t,e){var r=e[1];return Vr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Nt,[Ot],function(t,e){return Vr(e[0].evaluate(t),t.featureState||{})}],properties:[jt,[],function(t){return t.properties()}],"geometry-type":[Ot,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Rt,[],function(t){return t.globals.zoom}],"heatmap-density":[Rt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Rt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Rt,Dr(Rt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Rt,Dr(Rt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Rt,overloads:[[[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Rt],function(t,e){return -e[0].evaluate(t)}]]},"/":[Rt,[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Rt,[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Rt,[],function(){return Math.LN2}],pi:[Rt,[],function(){return Math.PI}],e:[Rt,[],function(){return Math.E}],"^":[Rt,[Rt,Rt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Rt,[Rt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Rt,[Rt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Rt,[Rt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Rt,[Rt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Rt,[Rt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Rt,[Rt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Rt,[Rt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Rt,Dr(Rt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Rt,Dr(Rt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Rt,[Rt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Rt,[Rt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Rt,[Rt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Rt,[Rt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Ut,[Nt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ut,[Ot],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Zt(Ot)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Zt(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Ot,Zt(Nt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Ot,Zt(Nt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Dr(Ut),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return !1;return !0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Dr(Ut),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return !0;return !1}]]},"!":[Ut,[Ut],function(t,e){return !e[0].evaluate(t)}],"is-supported-script":[Ut,[Ot],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return !r||r(e[0].evaluate(t))}],upcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ot,Dr(Nt),function(t,e){return e.map((function(e){return oe(e.evaluate(t))})).join("")}],"resolved-locale":[Ot,[Gt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Yr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new me,this._defaultValue=e?function(t){return "color"===t.type&&jr(t.default)?new Wt(0,0,0,0):"color"===t.type?Wt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null;};function Hr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Mr}function $r(t,e){var r=new Je(Mr,[],e?function(t){var e={color:qt,string:Ot,number:Rt,enum:Ot,boolean:Ut,formatted:Kt,resolvedImage:Xt};return "array"===t.type?Zt(e[t.value]||Nt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Fr(new Yr(n,e)):Lr(r.errors)}Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Yr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Wr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ke(e.expression);};Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Wr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Qr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ke(e.expression),this.interpolationType=n;};function tn(t,e){if("error"===(t=$r(t,e)).result)return t;var r=t.value.expression,n=Ge(r);if(!n&&!Rr(e))return Lr([new Dt("","data expressions not supported")]);var i=Xe(r,["zoom"]);if(!i&&!Or(e))return Lr([new Dt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof dr)r=t(e.result);else if(e instanceof yr)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else (e instanceof He||e instanceof hr)&&e.input instanceof ve&&"zoom"===e.input.name&&(r=e);return r instanceof Dt||e.eachChild((function(e){var n=t(e);n instanceof Dt?r=n:!r&&n?r=new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));})),r}(r);return a||i?a instanceof Dt?Lr([a]):a instanceof hr&&!Ur(e)?Lr([new Dt("",'"interpolate" expressions cannot be used with this property')]):Fr(a?new Qr(n?"camera":"composite",t.value,a.labels,a instanceof hr?a.interpolation:void 0):new Wr(n?"constant":"source",t.value)):Lr([new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Qr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},Qr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?hr.interpolationFactor(this.interpolationType,t,e,r):0};var en=function(t,e){this._parameters=t,this._specification=e,Pt(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Ur(r)?"exponential":"interval");if(o&&((e=Pt({},e)).stops&&(e.stops=e.stops.map((function(t){return [t[0],Wt.parse(t[1])]}))),e.default=Wt.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!cr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=Zr;else if("interval"===l)n=Xr;else if("categorical"===l){n=Kr,i=Object.create(null);for(var p=0,c=e.stops;p<c.length;p+=1){var h=c[p];i[h[0]]=h[1];}a=typeof e.stops[0][0];}else {if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=Jr;}if(s){for(var f={},y=[],d=0;d<e.stops.length;d++){var m=e.stops[d],v=m[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},y.push(v)),f[v].stops.push([m[0].value,m[1]]);}for(var g=[],x=0,b=y;x<b.length;x+=1){var _=b[x];g.push([f[_].zoom,t(f[_],r)]);}var w={name:"linear"};return {kind:"composite",interpolationType:w,interpolationFactor:hr.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return Zr({stops:g,base:e.base},r,i).evaluate(i,n)}}}if(u){var A="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return {kind:"camera",interpolationType:A,interpolationFactor:hr.interpolationFactor.bind(void 0,A),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,a)}}}return {kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Gr(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification));};function rn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],u=qr(r);if("object"!==u)return [new Tt(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=Cn;else if(i["*"])h=i["*"];else {if(!n["*"]){s.push(new Tt(e,r[l],'unknown property "'+l+'"'));continue}h=Cn;}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:l},r));}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Tt(e,r,'missing required property "'+f+'"'));return s}function nn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Cn;if("array"!==qr(e))return [new Tt(a,e,"array expected, "+qr(e)+" found")];if(r.length&&e.length!==r.length)return [new Tt(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return [new Tt(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===qr(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(o({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:a+"["+l+"]"}));return u}function an(t){var e=t.key,r=t.value,n=t.valueSpec,i=qr(r);return "number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Tt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Tt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Tt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function on(t){var e,r,n,i=t.valueSpec,a=Bt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,l="array"===qr(t.value.stops)&&"array"===qr(t.value.stops[0])&&"object"===qr(t.value.stops[0][0]),p=rn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return [new Tt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(nn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===qr(r)&&0===r.length&&e.push(new Tt(t.key,r,"array must have at least one stop")),e},default:function(t){return Cn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&p.push(new Tt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||p.push(new Tt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Ur(t.valueSpec)&&p.push(new Tt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Rr(t.valueSpec)?p.push(new Tt(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&p.push(new Tt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!l||void 0!==t.value.property||p.push(new Tt(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],a=t.value,s=t.key;if("array"!==qr(a))return [new Tt(s,a,"array expected, "+qr(a)+" found")];if(2!==a.length)return [new Tt(s,a,"array length 2 expected, length "+a.length+" found")];if(l){if("object"!==qr(a[0]))return [new Tt(s,a,"object expected, "+qr(a[0])+" found")];if(void 0===a[0].zoom)return [new Tt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Tt(s,a,"object stop key must have value")];if(n&&n>Bt(a[0].zoom))return [new Tt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Bt(a[0].zoom)!==n&&(n=Bt(a[0].zoom),r=void 0,o={}),e=e.concat(rn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:an,value:h}}));}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Hr(Vt(a[1]))?e.concat([new Tt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Cn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=qr(t.value),u=Bt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return [new Tt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return [new Tt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var p="number expected, "+s+" found";return Rr(i)&&void 0===a&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Tt(t.key,l,p)]}return "categorical"!==a||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===s&&void 0!==r&&u<r?[new Tt(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===a&&u in o?[new Tt(t.key,l,"stop domain values must be unique")]:(o[u]=!0,[])):[new Tt(t.key,l,"integer expected, found "+u)]}}function sn(t){var e=("property"===t.expressionContext?tn:$r)(Vt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Tt(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return [new Tt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ke(r))return [new Tt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ke(r))return [new Tt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Xe(r,["zoom","feature-state"]))return [new Tt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ge(r))return [new Tt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return []}function un(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Bt(r))&&i.push(new Tt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Bt(r))&&i.push(new Tt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function ln(t){if(!0===t||!1===t)return !0;if(!Array.isArray(t)||0===t.length)return !1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!ln(n)&&"boolean"!=typeof n)return !1}return !0;default:return !0}}en.deserialize=function(t){return new en(t._parameters,t._specification)},en.serialize=function(t){return {_parameters:t._parameters,_specification:t._specification}};var pn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function cn(t){if(null==t)return {filter:function(){return !0},needGeometry:!1};ln(t)||(t=fn(t));var e=$r(t,pn);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return {filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:Array.isArray(t)&&0!==t.length&&"within"===t[0]}}function hn(t,e){return t<e?-1:t>e?1:0}function fn(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?yn(t[1],t[2],"=="):"!="===r?vn(yn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?yn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(fn))):"all"===r?["all"].concat(t.slice(1).map(fn)):"none"===r?["all"].concat(t.slice(1).map(fn).map(vn)):"in"===r?dn(t[1],t.slice(2)):"!in"===r?vn(dn(t[1],t.slice(2))):"has"===r?mn(t[1]):"!has"!==r||vn(mn(t[1]))}function yn(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 dn(t,e){if(0===e.length)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((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(hn)]]:["filter-in-small",t,["literal",e]]}}function mn(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function vn(t){return ["!",t]}function gn(t){return ln(Vt(t.value))?sn(Pt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==qr(r))return [new Tt(n,r,"array expected, "+qr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return [new Tt(n,r,"filter array must have at least 1 element")];switch(o=o.concat(un({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Bt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Bt(r[1])&&o.push(new Tt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Tt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=qr(r[1]))&&o.push(new Tt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=qr(r[s]),"$type"===Bt(r[1])?o=o.concat(un({key:n+"["+s+"]",value:r[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new Tt(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)o=o.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=qr(r[1]),2!==r.length?o.push(new Tt(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&o.push(new Tt(n+"[1]",r[1],"string expected, "+i+" found"));}return o}(t)}function xn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return [];var u=o.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Cn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[o];if(!p)return [new Tt(r,a,'unknown property "'+o+'"')];if("string"===qr(a)&&Rr(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(a)))return [new Tt(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return "symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&c.push(new Tt(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&jr(Vt(a))&&"identity"===Bt(a.type)&&c.push(new Tt(r,a,'"text-font" does not support identity functions'))),c.concat(Cn({key:t.key,value:a,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function bn(t){return xn(t,"paint")}function _n(t){return xn(t,"layout")}function wn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new Tt(n,r,'either "type" or "ref" is required'));var o,s=Bt(r.type),u=Bt(r.ref);if(r.id)for(var l=Bt(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];Bt(c.id)===l&&e.push(new Tt(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__));}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Tt(n,r[t],'"'+t+'" is prohibited for ref layers'));})),i.layers.forEach((function(t){Bt(t.id)===u&&(o=t);})),o?o.ref?e.push(new Tt(n,r.ref,"ref cannot reference another ref layer")):s=Bt(o.type):e.push(new Tt(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Bt(h.type);h?"vector"===f&&"raster"===s?e.push(new Tt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Tt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Tt(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Tt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Tt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Tt(n,r.source,'source "'+r.source+'" not found'));}else e.push(new Tt(n,r,'missing required property "source"'));return e=e.concat(rn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return []},type:function(){return Cn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:gn,layout:function(t){return rn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return _n(Pt({layerType:s},t))}}})},paint:function(t){return rn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return bn(Pt({layerType:s},t))}}})}}}))}function An(t){var e=t.value,r=t.key,n=qr(e);return "string"!==n?[new Tt(r,e,"string expected, "+n+" found")]:[]}var Sn={promoteId:function(t){var e=t.key,r=t.value;if("string"===qr(r))return An({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,An({key:e+"."+i,value:r[i]}));return n}};function kn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return [new Tt(r,e,'"type" is required')];var a,o=Bt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return rn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Sn});case"geojson":if(a=rn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Sn}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p="string"==typeof l?[l,["accumulated"],["get",s]]:l;a.push.apply(a,sn({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),a.push.apply(a,sn({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}));}return a;case"video":return rn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return rn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return [new Tt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return un({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function In(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=qr(e);if(void 0===e)return a;if("object"!==o)return a.concat([new Tt("light",e,"object expected, "+o+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);a=a.concat(u&&n[u[1]]&&n[u[1]].transition?Cn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Cn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new Tt(s,e[s],'unknown property "'+s+'"')]);}return a}var zn={"*":function(){return []},array:nn,boolean:function(t){var e=t.value,r=t.key,n=qr(e);return "boolean"!==n?[new Tt(r,e,"boolean expected, "+n+" found")]:[]},number:an,color:function(t){var e=t.key,r=t.value,n=qr(r);return "string"!==n?[new Tt(e,r,"color expected, "+n+" found")]:null===$t(r)?[new Tt(e,r,'color expected, "'+r+'" found')]:[]},constants:Mt,enum:un,filter:gn,function:on,layer:wn,object:rn,source:kn,light:In,string:An,formatted:function(t){return 0===An(t).length?[]:sn(t)},resolvedImage:function(t){return 0===An(t).length?[]:sn(t)}};function Cn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&jr(Bt(e))?on(t):r.expression&&Hr(Vt(e))?sn(t):r.type&&zn[r.type]?zn[r.type](t):rn(Pt({},t,{valueSpec:r.type?n[r.type]:r}))}function En(t){var e=t.value,r=t.key,n=An(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Tt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Tt(r,e,'"glyphs" url must include a "{range}" token'))),n}function Tn(t,e){void 0===e&&(e=Et);var r=[];return r=r.concat(Cn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:En,"*":function(){return []}}})),t.constants&&(r=r.concat(Mt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Mn(r)}function Mn(t){return [].concat(t).sort((function(t,e){return t.line-e.line}))}function Pn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Mn(t.apply(this,e))}}Tn.source=Pn(kn),Tn.light=Pn(In),Tn.layer=Pn(wn),Tn.filter=Pn(gn),Tn.paintProperty=Pn(bn),Tn.layoutProperty=Pn(_n);var Bn=Tn,Vn=Bn.light,Dn=Bn.paintProperty,Fn=Bn.layoutProperty;function Ln(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new zt(new Error(i[n].message))),r=!0;return r}var Rn=On;function On(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var a=0;a<this.d*this.d;a++){var o=i[3+a],s=i[3+a+1];n.push(o===s?null:i.subarray(o,s));}var u=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly;}else {this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[];}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p;}On.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);},On.prototype._insertReadonly=function(){throw "Cannot insert into a GridIndex created from an ArrayBuffer."},On.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a);},On.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},On.prototype._queryCell=function(t,e,r,n,i,a,o,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===o[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(o[h]=!0,a.push(l[h])):o[h]=!1;}}},On.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,a,o,s))return}},On.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[3+o]=a,i.set(s,a),a+=s.length;}return i[3+t.length]=a,i.set(this.keys,a),i[3+t.length+1]=a+=this.keys.length,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var Un=self.ImageData,qn=self.ImageBitmap,jn={};function Nn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),jn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]};}for(var Gn in Nn("Object",Object),Rn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Rn.deserialize=function(t){return new Rn(t.buffer)},Nn("Grid",Rn),Nn("Color",Wt),Nn("Error",Error),Nn("ResolvedImage",re),Nn("StylePropertyFunction",en),Nn("StyleExpression",Yr,{omit:["_evaluator"]}),Nn("ZoomDependentExpression",Qr),Nn("ZoomConstantExpression",Wr),Nn("CompoundExpression",ve,{omit:["_evaluate"]}),Mr)Mr[Gn]._classRegistryKey||Nn("Expression_"+Gn,Mr[Gn]);function Kn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Xn(t){return qn&&t instanceof qn}function Zn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Kn(t)||Xn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Un)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1)n.push(Zn(a[i],e));return n}if("object"==typeof t){var o=t.constructor,s=o._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=o.serialize?o.serialize(t,e):{};if(!o.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(jn[s].omit.indexOf(l)>=0)){var p=t[l];u[l]=jn[s].shallow.indexOf(l)>=0?p:Zn(p,e);}t instanceof Error&&(u.message=t.message);}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Jn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Kn(t)||Xn(t)||ArrayBuffer.isView(t)||t instanceof Un)return t;if(Array.isArray(t))return t.map(Jn);if("object"==typeof t){var e=t.$name||"Object",r=jn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=jn[e].shallow.indexOf(o)>=0?s:Jn(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Yn=function(){this.first=!0;};Yn.prototype.update=function(t,e){var 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))};var Hn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function $n(t){for(var e=0,r=t;e<r.length;e+=1)if(Wn(r[e].charCodeAt(0)))return !0;return !1}function Wn(t){return !(746!==t&&747!==t&&(t<4352||!(Hn["Bopomofo Extended"](t)||Hn.Bopomofo(t)||Hn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hn["CJK Compatibility Ideographs"](t)||Hn["CJK Compatibility"](t)||Hn["CJK Radicals Supplement"](t)||Hn["CJK Strokes"](t)||!(!Hn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hn["CJK Unified Ideographs Extension A"](t)||Hn["CJK Unified Ideographs"](t)||Hn["Enclosed CJK Letters and Months"](t)||Hn["Hangul Compatibility Jamo"](t)||Hn["Hangul Jamo Extended-A"](t)||Hn["Hangul Jamo Extended-B"](t)||Hn["Hangul Jamo"](t)||Hn["Hangul Syllables"](t)||Hn.Hiragana(t)||Hn["Ideographic Description Characters"](t)||Hn.Kanbun(t)||Hn["Kangxi Radicals"](t)||Hn["Katakana Phonetic Extensions"](t)||Hn.Katakana(t)&&12540!==t||!(!Hn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Hn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hn["Unified Canadian Aboriginal Syllabics"](t)||Hn["Unified Canadian Aboriginal Syllabics Extended"](t)||Hn["Vertical Forms"](t)||Hn["Yijing Hexagram Symbols"](t)||Hn["Yi Syllables"](t)||Hn["Yi Radicals"](t))))}function Qn(t){return !(Wn(t)||function(t){return !!(Hn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Hn["Letterlike Symbols"](t)||Hn["Number Forms"](t)||Hn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Hn["Control Pictures"](t)&&9251!==t||Hn["Optical Character Recognition"](t)||Hn["Enclosed Alphanumerics"](t)||Hn["Geometric Shapes"](t)||Hn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hn["CJK Symbols and Punctuation"](t)||Hn.Katakana(t)||Hn["Private Use Area"](t)||Hn["CJK Compatibility Forms"](t)||Hn["Small Form Variants"](t)||Hn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function ti(t){return t>=1424&&t<=2303||Hn["Arabic Presentation Forms-A"](t)||Hn["Arabic Presentation Forms-B"](t)}function ei(t,e){return !(!e&&ti(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hn.Khmer(t))}function ri(t){for(var e=0,r=t;e<r.length;e+=1)if(ti(r[e].charCodeAt(0)))return !0;return !1}var ni=null,ii="unavailable",ai=null,oi=function(t){ni&&ni(t);};function si(){ui.fire(new It("pluginStateChange",{pluginStatus:ii,pluginURL:ai}));}var ui=new Ct,li=function(){return ii},pi=function(){if("deferred"!==ii||!ai)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ii="loading",si(),ai&&_t({url:ai},(function(t){t?oi(t):(ii="loaded",si());}));},ci={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return "loaded"===ii||null!=ci.applyArabicShaping},isLoading:function(){return "loading"===ii},setState:function(t){ii=t.pluginStatus,ai=t.pluginURL;},isParsed:function(){return null!=ci.applyArabicShaping&&null!=ci.processBidirectionalText&&null!=ci.processStyledBidirectionalText},getPluginURL:function(){return ai}},hi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yn,this.transition={});};hi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!ei(n[r].charCodeAt(0),e))return !1;return !0}(t,ci.isLoaded())},hi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},hi.prototype.getCrossfadeParameters=function(){var 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}};var fi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(jr(t))return new en(t,e);if(Hr(t)){var r=tn(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return "string"==typeof t&&"color"===e.type&&(n=Wt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification);};fi.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},fi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var yi=function(t){this.property=t,this.value=new fi(t,void 0);};yi.prototype.transitioned=function(t,e){return new mi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},yi.prototype.untransitioned=function(){return new mi(this.property,this.value,null,{},0)};var di=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};di.prototype.getValue=function(t){return b(this._values[t].value.value)},di.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new yi(this._values[t].property)),this._values[t].value=new fi(this._values[t].property,null===e?void 0:b(e));},di.prototype.getTransition=function(t){return b(this._values[t].transition)},di.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new yi(this._values[t].property)),this._values[t].transition=b(e)||void 0;},di.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a);}return t},di.prototype.transitioned=function(t,e){for(var r=new vi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a]);}return r},di.prototype.untransitioned=function(){for(var t=new vi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned();}return t};var mi=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);};mi.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var vi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};vi.prototype.possiblyEvaluate=function(t,e){for(var r=new bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].possiblyEvaluate(t,e);}return r},vi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return !0;return !1};var gi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues);};gi.prototype.getValue=function(t){return b(this._values[t].value)},gi.prototype.setValue=function(t,e){this._values[t]=new fi(this._values[t].property,null===e?void 0:b(e));},gi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);}return t},gi.prototype.possiblyEvaluate=function(t,e){for(var r=new bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].possiblyEvaluate(t,e);}return r};var xi=function(t,e,r){this.property=t,this.value=e,this.parameters=r;};xi.prototype.isConstant=function(){return "constant"===this.value.kind},xi.prototype.constantOr=function(t){return "constant"===this.value.kind?this.value.value:t},xi.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var bi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);};bi.prototype.get=function(t){return this._values[t]};var _i=function(t){this.specification=t;};_i.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},_i.prototype.interpolate=function(t,e,r){var n=We[this.specification.type];return n?n(t,e,r):t};var wi=function(t,e){this.specification=t,this.overrides=e;};wi.prototype.possiblyEvaluate=function(t,e,r,n){return new xi(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},wi.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new xi(this,{kind:"constant",value:void 0},t.parameters);var n=We[this.specification.type];return n?new xi(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},wi.prototype.evaluate=function(t,e,r,n,i,a){return "constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var Ai=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new xi(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new xi(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=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 xi(this,{kind:"constant",value:s},e)}return new xi(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return "composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(wi),Si=function(t){this.specification=t;};Si.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new hi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new hi(Math.floor(e.zoom),e)),t.expression.evaluate(new hi(Math.floor(e.zoom+1),e)),e)}},Si.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Si.prototype.interpolate=function(t){return t};var ki=function(t){this.specification=t;};ki.prototype.possiblyEvaluate=function(t,e,r,n){return !!t.expression.evaluate(e,null,{},r,n)},ki.prototype.interpolate=function(){return !1};var Ii=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new fi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new yi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};Nn("DataDrivenProperty",wi),Nn("DataConstantProperty",_i),Nn("CrossFadedDataDrivenProperty",Ai),Nn("CrossFadedProperty",Si),Nn("ColorRampProperty",ki);var zi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return !0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new gi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new di(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned();}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return "visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Fn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e);},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Dn,"layers."+this.id+".paint."+t,t,e,r))return !1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],a=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||i||this._handleOverridablePaintPropertyUpdate(t,o,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return !1},e.prototype.isHidden=function(t){return !!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e);},e.prototype.serialize=function(){var 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&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return !(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Ln(this,t.call(Bn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Et,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return !1},e.prototype.isTileClipped=function(){return !1},e.prototype.hasOffscreenPass=function(){return !1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof xi&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1},e}(Ct),Ci={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=function(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;},Ti=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function Mi(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map((function(t){var i=Ci[t.type].BYTES_PER_ELEMENT,a=r=Pi(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:Pi(r,Math.max(n,e)),alignment:e}}function Pi(t,e){return Math.ceil(t/e)*e}Ti.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ti.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ti.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},Ti.prototype.clear=function(){this.length=0;},Ti.prototype.resize=function(t){this.reserve(t),this.length=t;},Ti.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e);}},Ti.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ti);Bi.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",Bi);var Vi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Ti);Vi.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Vi);var Di=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ti);Di.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Di);var Fi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=a,this.uint8[u+7]=o,t},e}(Ti);Fi.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fi);var Li=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p){var c=9*t,h=18*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=a,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint8[h+16]=l,this.uint8[h+17]=p,t},e}(Ti);Li.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Li);var Ri=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(Ti);Ri.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Ri);var Oi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ti);Oi.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",Oi);var Ui=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Ti);Ui.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ui);var qi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=a,this.int16[h+5]=o,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Ti);qi.prototype.bytesPerElement=24,Nn("StructArrayLayout6i1ul2ui2i24",qi);var ji=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Ti);ji.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",ji);var Ni=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Ti);Ni.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Ni);var Gi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Ti);Gi.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gi);var Ki=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k,I){var z=30*t,C=15*t;return this.int16[z+0]=e,this.int16[z+1]=r,this.int16[z+2]=n,this.int16[z+3]=i,this.int16[z+4]=a,this.int16[z+5]=o,this.int16[z+6]=s,this.int16[z+7]=u,this.uint16[z+8]=l,this.uint16[z+9]=p,this.uint16[z+10]=c,this.uint16[z+11]=h,this.uint16[z+12]=f,this.uint16[z+13]=y,this.uint16[z+14]=d,this.uint16[z+15]=m,this.uint16[z+16]=v,this.uint16[z+17]=g,this.uint16[z+18]=x,this.uint16[z+19]=b,this.uint16[z+20]=_,this.uint16[z+21]=w,this.uint32[C+11]=A,this.float32[C+12]=S,this.float32[C+13]=k,this.float32[C+14]=I,t},e}(Ti);Ki.prototype.bytesPerElement=60,Nn("StructArrayLayout8i14ui1ul3f60",Ki);var Xi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Ti);Xi.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Xi);var Zi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ti);Zi.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Zi);var Ji=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ti);Ji.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ji);var Yi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ti);Yi.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Yi);var Hi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ti);Hi.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Hi);var $i=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Ti);$i.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$i);var Wi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ti);Wi.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",Wi);var Qi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Ti);Qi.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",Qi);var ta=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ei);ta.prototype.size=24;var ea=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ta(this,t)},e}(qi);Nn("CollisionBoxArray",ea);var ra=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t;},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t;},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t;},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ei);ra.prototype.size=48;var na=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ra(this,t)},e}(Gi);Nn("PlacedSymbolArray",na);var ia=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t;},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},Object.defineProperties(e.prototype,r),e}(Ei);ia.prototype.size=60;var aa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ia(this,t)},e}(Ki);Nn("SymbolInstanceArray",aa);var oa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Xi);Nn("GlyphOffsetArray",oa);var sa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Zi);Nn("SymbolLineVertexArray",sa);var ua=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ei);ua.prototype.size=8;var la=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Ji);Nn("FeatureIndexArray",la);var pa=Mi([{name:"a_pos",components:2,type:"Int16"}],4).members,ca=function(t){void 0===t&&(t=[]),this.segments=t;};function ha(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}ca.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>ca.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ca.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>ca.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},ca.prototype.get=function(){return this.segments},ca.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy();}},ca.simpleSegment=function(t,e,r,n){return new ca([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},ca.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Nn("SegmentVector",ca);var fa=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,u,l;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};})),ya=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};})),da=fa,ma=ya;da.murmur3=fa,da.murmur2=ma;var va=function(){this.ids=[],this.positions=[],this.indexed=!1;};va.prototype.add=function(t,e,r,n){this.ids.push(xa(t)),this.positions.push(e,r,n);},va.prototype.getPositions=function(t){for(var e=xa(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1;}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},va.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(!(n>=i)){for(var a=e[n+i>>1],o=n-1,s=i+1;;){do{o++;}while(e[o]<a);do{s--;}while(e[s]>a);if(o>=s)break;ba(e,o,s),ba(r,3*o,3*s),ba(r,3*o+1,3*s+1),ba(r,3*o+2,3*s+2);}t(e,r,n,s),t(e,r,s+1,i);}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},va.deserialize=function(t){var e=new va;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ga=Math.pow(2,53)-1;function xa(t){var e=+t;return !isNaN(e)&&e<=ga?e:da(String(t))}function ba(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}Nn("FeaturePositionMap",va);var _a=function(t,e){this.gl=t.gl,this.location=e;},wa=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t));},e}(_a),Aa=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t));},e}(_a),Sa=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]));},e}(_a),ka=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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]));},e}(_a),Ia=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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]));},e}(_a),za=function(t){function e(e,r){t.call(this,e,r),this.current=Wt.transparent;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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));},e}(_a),Ca=new Float32Array(16),Ea=function(t){function e(e,r){t.call(this,e,r),this.current=Ca;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(_a);function Ta(t){return [ha(255*t.r,255*t.g),ha(255*t.b,255*t.a)]}var Ma=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return "u_"+t})),this.type=r;};Ma.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value));},Ma.prototype.getBinding=function(t,e,r){return "color"===this.type?new za(t,e):new Aa(t,e)};var Pa=function(t,e){this.uniformNames=e.map((function(t){return "u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1;};Pa.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr;},Pa.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i);},Pa.prototype.getBinding=function(t,e,r){return "u_pattern"===r.substr(0,9)?new Ia(t,e):new Aa(t,e)};var Ba=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n;};Ba.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new hi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o);},Ba.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i);},Ba.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=Ta(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else {for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r));}},Ba.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Ba.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();};var Va=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((function(t){return "u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a;};Va.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new hi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new hi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o);},Va.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a);},Va.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=Ta(r),a=Ta(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else {for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n));}},Va.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Va.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();},Va.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=u(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n);},Va.prototype.getBinding=function(t,e,r){return new Aa(t,e)};var Da=function(t,e,r,n,i,a,o){this.expression=t,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=o,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a;};Da.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r);},Da.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i);},Da.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=n[r.min],a=n[r.mid],o=n[r.max];if(i&&a&&o)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],a.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],a.pixelRatio,o.pixelRatio);}},Da.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Da.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy();};var Fa=function(t,e,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof xi&&Rr(o.property.specification)){var s=Ra(a,t.type),u=o.value,l=o.property.specification.type,p=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===u.kind)this.binders[a]=h?new Pa(u.value,s):new Ma(u.value,s,l),i.push("/u_"+a);else if("source"===u.kind||h){var f=Oa(a,l,"source");this.binders[a]=h?new Da(u,s,l,p,e,f,t.id):new Ba(u,s,l,f),i.push("/a_"+a);}else {var y=Oa(a,l,"composite");this.binders[a]=new Va(u,s,l,p,e,y),i.push("/z_"+a);}}}this.cacheKey=i.sort().join("");};Fa.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Ba||e instanceof Va?e.maxValue:0},Fa.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof Ba||o instanceof Va||o instanceof Da)&&o.populatePaintArray(t,e,r,n,i);}},Fa.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof Pa&&n.setConstantPatternPositions(t,e);}},Fa.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,u=e.getPositions(o);s<u.length;s+=1){var l=u[s],p=r.feature(l.index);for(var c in this.binders){var h=this.binders[c];if((h instanceof Ba||h instanceof Va||h instanceof Da)&&!0===h.expression.isStateDependent){var f=n.paint.get(c);h.expression=f.value,h.updatePaintArray(l.start,l.end,p,t[o],i),a=!0;}}}return a},Fa.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Ma||r instanceof Pa)&&t.push.apply(t,r.uniformNames.map((function(t){return "#define HAS_UNIFORM_"+t})));}return t},Fa.prototype.getPaintVertexBuffers=function(){return this._buffers},Fa.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof Ma||i instanceof Pa||i instanceof Va)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var u=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:u});}}}return r},Fa.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,u=o.property;this.binders[u].setUniform(o.binding,n,r.get(u),s);}},Fa.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof Da){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n);}else (r instanceof Ba||r instanceof Va)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer);}},Fa.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Ba||r instanceof Va||r instanceof Da)&&r.upload(t);}this.updatePaintBuffers();},Fa.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ba||e instanceof Va||e instanceof Da)&&e.destroy();}};var La=function(t,e,r,n){void 0===n&&(n=function(){return !0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=new Fa(o,r,n,t);}this.needsUpload=!1,this._featureMap=new va,this._bufferOffset=0;};function Ra(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-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 Oa(t,e,r){var n={color:{source:Wi,composite:Qi},number:{source:Xi,composite:Wi}},i=function(t){return {"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[t]}(t);return i&&i[r]||n[e][r]}La.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0;},La.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload;}},La.prototype.get=function(t){return this.programConfigurations[t]},La.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}},La.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy();},Nn("ConstantBinder",Ma),Nn("CrossFadedConstantBinder",Pa),Nn("SourceExpressionBinder",Ba),Nn("CrossFadedCompositeBinder",Da),Nn("CompositeExpressionBinder",Va),Nn("ProgramConfiguration",Fa,{omit:["_buffers"]}),Nn("ProgramConfigurationSet",La);var Ua={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function qa(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<Ua.min||o.x>Ua.max||o.y<Ua.min||o.y>Ua.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=u(o.x,Ua.min,Ua.max),o.y=u(o.y,Ua.min,Ua.max));}return r}function ja(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var Na=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Bi,this.indexArray=new Yi,this.segments=new ca,this.programConfigurations=new La(pa,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Ga(t,e){for(var r=0;r<t.length;r++)if(Qa(e,t[r]))return !0;for(var n=0;n<e.length;n++)if(Qa(t,e[n]))return !0;return !!Ja(t,e)}function Ka(t,e,r){return !!Qa(t,e)||!!Ha(e,t,r)}function Xa(t,e){if(1===t.length)return Wa(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Qa(t,n[i]))return !0;for(var a=0;a<t.length;a++)if(Wa(e,t[a]))return !0;for(var o=0;o<e.length;o++)if(Ja(t,e[o]))return !0;return !1}function Za(t,e,r){if(t.length>1){if(Ja(t,e))return !0;for(var n=0;n<e.length;n++)if(Ha(e[n],t,r))return !0}for(var i=0;i<t.length;i++)if(Ha(t[i],e,r))return !0;return !1}function Ja(t,e){if(0===t.length||0===e.length)return !1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(Ya(n,i,e[a],e[a+1]))return !0;return !1}function Ya(t,e,r,n){return A(t,r,n)!==A(e,r,n)&&A(t,e,r)!==A(t,e,n)}function Ha(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if($a(t,e[i-1],e[i])<n)return !0;return !1}function $a(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Wa(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,u=(r=t[o]).length-1;s<r.length;u=s++)(n=r[s]).y>e.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Qa(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r);}return r}function to(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return !1;var a=A(t,e,r[0]);return a!==A(t,e,r[1])||a!==A(t,e,r[2])||a!==A(t,e,r[3])}function eo(t,e,r){var n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ro(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function no(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(o));return s}Na.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var u=s[o],l=u.feature,p=u.id,c=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,y={type:l.type,id:p,properties:l.properties,geometry:f?qa(l):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),y,r)){f||(y.geometry=qa(l));var d=a?a.evaluate(y,{},r):void 0;i.push({id:p,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:y.geometry,patterns:{},sortKey:d});}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,v=i;m<v.length;m+=1){var g=v[m],x=g.geometry,b=g.index,_=g.sourceLayerIndex,w=t[b].feature;this.addFeature(g,x,b,r),e.featureIndex.insert(w,x,b,_,this.index);}},Na.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Na.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Na.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Na.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},Na.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},Na.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var u=s[o],l=u.x,p=u.y;if(!(l<0||l>=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;ja(this.layoutVertexArray,l,p,-1,-1),ja(this.layoutVertexArray,l,p,1,-1),ja(this.layoutVertexArray,l,p,1,1),ja(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2;}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n);},Nn("CircleBucket",Na,{omit:["layers"]});var io,ao=new Ii({"circle-sort-key":new wi(Et.layout_circle["circle-sort-key"])}),oo={paint:new Ii({"circle-radius":new wi(Et.paint_circle["circle-radius"]),"circle-color":new wi(Et.paint_circle["circle-color"]),"circle-blur":new wi(Et.paint_circle["circle-blur"]),"circle-opacity":new wi(Et.paint_circle["circle-opacity"]),"circle-translate":new _i(Et.paint_circle["circle-translate"]),"circle-translate-anchor":new _i(Et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new _i(Et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new _i(Et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new wi(Et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new wi(Et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new wi(Et.paint_circle["circle-stroke-opacity"])}),layout:ao},so="undefined"!=typeof Float32Array?Float32Array:Array;function uo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),io=new so(3),so!=Float32Array&&(io[0]=0,io[1]=0,io[2]=0),function(){var t=new so(4);so!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0);}();var lo=(function(){var t=new so(2);so!=Float32Array&&(t[0]=0,t[1]=0);}(),function(t){function e(e){t.call(this,e,oo);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Na(t)},e.prototype.queryRadius=function(t){var e=t;return eo("circle-radius",this,e)+eo("circle-stroke-width",this,e)+ro(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var u=no(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return po(t,e)}))}(u,s),h=p?l*o:l,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=p?v:po(v,s),x=h,b=uo([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/b[3]),Ka(c,g,x))return !0}return !1},e}(zi));function po(t,e){var r=uo([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Na);function ho(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function fo(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=ho({},{width:n,height:i},r);yo(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data;}}function yo(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*a,p=((n.y+u)*e.width+n.x)*a,c=0;c<i.width*a;c++)s[p+c]=o[l+c];return e}Nn("HeatmapBucket",co,{omit:["layers"]});var mo=function(t,e){ho(this,t,1,e);};mo.prototype.resize=function(t){fo(this,t,1);},mo.prototype.clone=function(){return new mo({width:this.width,height:this.height},new Uint8Array(this.data))},mo.copy=function(t,e,r,n,i){yo(t,e,r,n,i,1);};var vo=function(t,e){ho(this,t,4,e);};vo.prototype.resize=function(t){fo(this,t,4);},vo.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t;},vo.prototype.clone=function(){return new vo({width:this.width,height:this.height},new Uint8Array(this.data))},vo.copy=function(t,e,r,n,i){yo(t,e,r,n,i,4);},Nn("AlphaImage",mo),Nn("RGBAImage",vo);var go={paint:new Ii({"heatmap-radius":new wi(Et.paint_heatmap["heatmap-radius"]),"heatmap-weight":new wi(Et.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new _i(Et.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ki(Et.paint_heatmap["heatmap-color"]),"heatmap-opacity":new _i(Et.paint_heatmap["heatmap-opacity"])})};function xo(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a);}return new vo({width:256,height:1},r)}var bo=function(t){function e(e){t.call(this,e,go),this._updateColorRamp();}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new co(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp();},e.prototype._updateColorRamp=function(){this.colorRamp=xo(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null;},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null);},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(zi),_o={paint:new Ii({"hillshade-illumination-direction":new _i(Et.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new _i(Et.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new _i(Et.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new _i(Et.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new _i(Et.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new _i(Et.paint_hillshade["hillshade-accent-color"])})},wo=function(t){function e(e){t.call(this,e,_o);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(zi),Ao=Mi([{name:"a_pos",components:2,type:"Int16"}],4).members,So=Io,ko=Io;function Io(t,e,r){r=r||2;var n,i,a,o,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=zo(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=zo(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(Ro(o));for(s.sort(Vo),i=0;i<s.length;i++)r=Do(s[i],r);return r}(t,e,h,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var y=r;y<c;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>a&&(a=s),u>o&&(o=u);l=0!==(l=Math.max(a-n,o-i))?32767/l:0;}return Eo(h,f,r,n,i,l,0),f}function zo(t,e,r,n,i){var a,o;if(i===$o(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Jo(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Jo(a,t[a],t[a+1],o);return o&&jo(o,o.next)&&(Yo(o),o=o.next),o}function Co(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!jo(n,n.next)&&0!==qo(n.prev,n,n.next))n=n.next;else {if(Yo(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function Eo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=Lo(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,u,l=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n;}a.nextZ=null,l*=2;}while(o>1)}(i);}(t,n,i,a);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?Mo(t,n,i,a):To(t))e.push(s.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),Yo(t),t=u.next,l=u.next;else if((t=u)===l){o?1===o?Eo(t=Po(Co(t),e,r),e,r,n,i,a,2):2===o&&Bo(t,e,r,n,i,a):Eo(Co(t),e,r,n,i,a,1);break}}}function To(t){var e=t.prev,r=t,n=t.next;if(qo(e,r,n)>=0)return !1;for(var i=e.x,a=r.x,o=n.x,s=e.y,u=r.y,l=n.y,p=i<a?i<o?i:o:a<o?a:o,c=s<u?s<l?s:l:u<l?u:l,h=i>a?i>o?i:o:a>o?a:o,f=s>u?s>l?s:l:u>l?u:l,y=n.next;y!==e;){if(y.x>=p&&y.x<=h&&y.y>=c&&y.y<=f&&Oo(i,s,a,u,o,l,y.x,y.y)&&qo(y.prev,y,y.next)>=0)return !1;y=y.next;}return !0}function Mo(t,e,r,n){var i=t.prev,a=t,o=t.next;if(qo(i,a,o)>=0)return !1;for(var s=i.x,u=a.x,l=o.x,p=i.y,c=a.y,h=o.y,f=s<u?s<l?s:l:u<l?u:l,y=p<c?p<h?p:h:c<h?c:h,d=s>u?s>l?s:l:u>l?u:l,m=p>c?p>h?p:h:c>h?c:h,v=Lo(f,y,e,r,n),g=Lo(d,m,e,r,n),x=t.prevZ,b=t.nextZ;x&&x.z>=v&&b&&b.z<=g;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==o&&Oo(s,p,u,c,l,h,x.x,x.y)&&qo(x.prev,x,x.next)>=0)return !1;if(x=x.prevZ,b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==o&&Oo(s,p,u,c,l,h,b.x,b.y)&&qo(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}for(;x&&x.z>=v;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==o&&Oo(s,p,u,c,l,h,x.x,x.y)&&qo(x.prev,x,x.next)>=0)return !1;x=x.prevZ;}for(;b&&b.z<=g;){if(b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==o&&Oo(s,p,u,c,l,h,b.x,b.y)&&qo(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}return !0}function Po(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!jo(i,a)&&No(i,n,n.next,a)&&Xo(i,a)&&Xo(a,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(a.i/r|0),Yo(n),Yo(n.next),n=t=a),n=n.next;}while(n!==t);return Co(n)}function Bo(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Uo(o,s)){var u=Zo(o,s);return o=Co(o,o.next),u=Co(u,u.next),Eo(o,e,r,n,i,a,0),void Eo(u,e,r,n,i,a,0)}s=s.next;}o=o.next;}while(o!==t)}function Vo(t,e){return t.x-e.x}function Do(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next;}while(n!==e);if(!r)return null;var u,l=r,p=r.x,c=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&Oo(a<c?i:o,a,p,c,a<c?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),Xo(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Fo(r,n)))&&(r=n,h=u)),n=n.next;}while(n!==l);return r}(t,e);if(!r)return e;var n=Zo(r,t);return Co(n,n.next),Co(r,r.next)}function Fo(t,e){return qo(t.prev,t,e.prev)<0&&qo(e.next,t,t.next)<0}function Lo(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ro(t){var 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 Oo(t,e,r,n,i,a,o,s){return (i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function Uo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&No(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(Xo(t,e)&&Xo(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)&&(qo(t.prev,t,e.prev)||qo(t,e.prev,e))||jo(t,e)&&qo(t.prev,t,t.next)>0&&qo(e.prev,e,e.next)>0)}function qo(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function jo(t,e){return t.x===e.x&&t.y===e.y}function No(t,e,r,n){var i=Ko(qo(t,e,r)),a=Ko(qo(t,e,n)),o=Ko(qo(r,n,t)),s=Ko(qo(r,n,e));return i!==a&&o!==s||!(0!==i||!Go(t,r,e))||!(0!==a||!Go(t,n,e))||!(0!==o||!Go(r,t,n))||!(0!==s||!Go(r,e,n))}function Go(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 Ko(t){return t>0?1:t<0?-1:0}function Xo(t,e){return qo(t.prev,t,t.next)<0?qo(t,e,t.next)>=0&&qo(t,t.prev,e)>=0:qo(t,e,t.prev)<0||qo(t,t.next,e)<0}function Zo(t,e){var r=new Ho(t.i,t.x,t.y),n=new Ho(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Jo(t,e,r,n){var i=new Ho(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Yo(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);}function Ho(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1;}function $o(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Wo(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,u=Math.log(o),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(o-l)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/o+p)),Math.min(i,Math.floor(r+(o-s)*l/o+p)),a);}var c=e[r],h=n,f=i;for(Qo(e,n,r),a(e[i],c)>0&&Qo(e,n,i);h<f;){for(Qo(e,h,f),h++,f--;a(e[h],c)<0;)h++;for(;a(e[f],c)>0;)f--;}0===a(e[n],c)?Qo(e,n,f):Qo(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1);}}(t,e,r||0,n||t.length-1,i||ts);}function Qo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function ts(t,e){return t<e?-1:t>e?1:0}function es(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o<r;o++){var s=S(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]));}if(n&&a.push(n),e>1)for(var u=0;u<a.length;u++)a[u].length<=e||(Wo(a[u],e,1,a[u].length-1,rs),a[u]=a[u].slice(0,e));return a}function rs(t,e){return e.area-t.area}function ns(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0);}return i}function is(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var u=s[o],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),h=l.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,a[p=p&&p.name?p.name:p]=!0,a[c]=!0,a[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h};}}return r}Io.deviation=function(t,e,r,n){var i=e&&e.length,a=Math.abs($o(t,0,i?e[0]*r:t.length,r));if(i)for(var o=0,s=e.length;o<s;o++)a-=Math.abs($o(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r));var u=0;for(o=0;o<n.length;o+=3){var l=n[o]*r,p=n[o+1]*r,c=n[o+2]*r;u+=Math.abs((t[l]-t[c])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[c+1]-t[l+1]));}return 0===a&&0===u?0:Math.abs((u-a)/a)},Io.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&r.holes.push(n+=t[i-1].length);}return r},So.default=ko;var as=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bi,this.indexArray=new Yi,this.indexArray2=new Hi,this.programConfigurations=new La(Ao,t.layers,t.zoom),this.segments=new ca,this.segments2=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};as.prototype.populate=function(t,e,r){this.hasPattern=ns("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?qa(u):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),f,r)){h||(f.geometry=qa(u));var y=n?n.evaluate(f,{},r,e.availableImages):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y});}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var _=is("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(_);}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index);}},as.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},as.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},as.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},as.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},as.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ao),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0;},as.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy());},as.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=es(e,500);a<o.length;a+=1){for(var s=o[a],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=c.vertexLength,f=[],y=[],d=0,m=s;d<m.length;d+=1){var v=m[d];if(0!==v.length){v!==s[0]&&y.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),f.push(v[0].x),f.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),f.push(v[b].x),f.push(v[b].y);g.vertexLength+=v.length,g.primitiveLength+=v.length;}}for(var _=So(f,y),w=0;w<_.length;w+=3)this.indexArray.emplaceBack(h+_[w],h+_[w+1],h+_[w+2]);c.vertexLength+=u,c.primitiveLength+=_.length/3;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Nn("FillBucket",as,{omit:["layers","patternFeatures"]});var os=new Ii({"fill-sort-key":new wi(Et.layout_fill["fill-sort-key"])}),ss={paint:new Ii({"fill-antialias":new _i(Et.paint_fill["fill-antialias"]),"fill-opacity":new wi(Et.paint_fill["fill-opacity"]),"fill-color":new wi(Et.paint_fill["fill-color"]),"fill-outline-color":new wi(Et.paint_fill["fill-outline-color"]),"fill-translate":new _i(Et.paint_fill["fill-translate"]),"fill-translate-anchor":new _i(Et.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ai(Et.paint_fill["fill-pattern"])}),layout:os},us=function(t){function e(e){t.call(this,e,ss);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);},e.prototype.createBucket=function(t){return new as(t)},e.prototype.queryRadius=function(){return ro(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return Xa(no(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return !0},e}(zi),ls=Mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ps=cs;function cs(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(hs,this,e);}function hs(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function fs(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}cs.types=["Unknown","Point","LineString","Polygon"],cs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,u=[];t.pos<r;){if(a<=0){var l=t.readVarint();n=7&l,a=l>>3;}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(o,s));else {if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},cs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<u&&(u=a),a>l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,l]},cs.prototype.toGeoJSON=function(t,e,r,n){console.log("epsg",n),n=n||"EPSG:3857";var i,a,o=this.extent*Math.pow(2,r),s=this.extent*t,u=this.extent*e,l=this.loadGeometry(),p=cs.types[this.type];function c(t){if("EPSG:3857"===n)for(var e=0;e<t.length;e++)t[e]=[360*((r=t[e]).x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+u)/o)*Math.PI/180))-90];else if("EPSG:4326"===n)for(e=0;e<t.length;e++){var r;t[e]=[360*((r=t[e]).x+s)/o-180,90-360*(r.y+u)/o];}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],a=0;a<e;a++){var o=fs(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]));}return r&&i.push(r),i}(l),i=0;i<l.length;i++)for(a=0;a<l[i].length;a++)c(l[i][a]);}1===l.length?l=l[0]:p="Multi"+p;var f={type:"Feature",geometry:{type:p,coordinates:l},properties:this.properties};return "id"in this&&(f.id=this.id),f};var ys=ds;function ds(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ms,this,e),this.length=this._features.length;}function ms(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}function vs(t,e,r){if(3===t){var n=new ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}ds.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ps(this._pbf,e,this.extent,this._keys,this._values)};var gs={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e);},VectorTileFeature:ps,VectorTileLayer:ys},xs=gs.VectorTileFeature.types,bs=Math.pow(2,13);function _s(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*bs)+o,i*bs*2,a*bs*2,Math.round(s));}var ws=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Di,this.indexArray=new Yi,this.programConfigurations=new La(ls,t.layers,t.zoom),this.segments=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function As(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}ws.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ns("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,u=a.index,l=a.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,c={type:o.type,id:s,properties:o.properties,geometry:p?qa(o):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),c,r)){var h={id:s,sourceLayerIndex:l,index:u,geometry:p?c.geometry:qa(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(h.id=o.id),this.hasPattern?this.features.push(is("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,u,r,{}),e.featureIndex.insert(o,h.geometry,u,l,this.index,!0);}}},ws.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},ws.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},ws.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ws.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},ws.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ls),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},ws.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},ws.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=es(e,500);a<o.length;a+=1){for(var s=o[a],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=s;h<f.length;h+=1){var y=f[h];if(0!==y.length&&!((P=y).every((function(t){return t.x<0}))||P.every((function(t){return t.x>8192}))||P.every((function(t){return t.y<0}))||P.every((function(t){return t.y>8192}))))for(var d=0,m=0;m<y.length;m++){var v=y[m];if(m>=1){var g=y[m-1];if(!As(v,g)){c.vertexLength+4>ca.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),_s(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),_s(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),_s(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),_s(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var _=c.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),c.vertexLength+=4,c.primitiveLength+=2;}}}}if(c.vertexLength+u>ca.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===xs[t.type]){for(var w=[],A=[],S=c.vertexLength,k=0,I=s;k<I.length;k+=1){var z=I[k];if(0!==z.length){z!==s[0]&&A.push(w.length/2);for(var C=0;C<z.length;C++){var E=z[C];_s(this.layoutVertexArray,E.x,E.y,0,0,1,1,0),w.push(E.x),w.push(E.y);}}}for(var T=So(w,A),M=0;M<T.length;M+=3)this.indexArray.emplaceBack(S+T[M],S+T[M+2],S+T[M+1]);c.primitiveLength+=T.length/3,c.vertexLength+=u;}}var P;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Nn("FillExtrusionBucket",ws,{omit:["layers","features"]});var Ss={paint:new Ii({"fill-extrusion-opacity":new _i(Et["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new wi(Et["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new _i(Et["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new _i(Et["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ai(Et["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new wi(Et["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new wi(Et["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new _i(Et["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ks=function(t){function e(e){t.call(this,e,Ss);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ws(t)},e.prototype.queryRadius=function(){return ro(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return !0},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,u){var l=no(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,r),c=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,n){for(var a=[],o=0,s=t;o<s.length;o+=1){var u=s[o],l=[u.x,u.y,0,1];uo(l,l,e),a.push(new i(l[0]/l[3],l[1]/l[3]));}return a}(l,u),f=function(t,e,r,n){for(var a=[],o=[],s=n[8]*e,u=n[9]*e,l=n[10]*e,p=n[11]*e,c=n[8]*r,h=n[9]*r,f=n[10]*r,y=n[11]*r,d=0,m=t;d<m.length;d+=1){for(var v=[],g=[],x=0,b=m[d];x<b.length;x+=1){var _=b[x],w=_.x,A=_.y,S=n[0]*w+n[4]*A+n[12],k=n[1]*w+n[5]*A+n[13],I=n[2]*w+n[6]*A+n[14],z=n[3]*w+n[7]*A+n[15],C=I+l,E=z+p,T=S+c,M=k+h,P=I+f,B=z+y,V=new i((S+s)/E,(k+u)/E);V.z=C/E,v.push(V);var D=new i(T/B,M/B);D.z=P/B,g.push(D);}a.push(v),o.push(g);}return [a,o]}(n,c,p,u);return function(t,e,r){var n=1/0;Xa(r,e)&&(n=zs(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var u=a[s],l=[u,a[s+1],o[s+1],o[s],u];Ga(r,l)&&(n=Math.min(n,zs(r,l)));}return n!==1/0&&n}(f[0],f[1],h)},e}(zi);function Is(t,e){return t.x*e.x+t.y*e.y}function zs(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),u=a.sub(i),l=o.sub(i),p=Is(s,s),c=Is(s,u),h=Is(u,u),f=Is(l,s),y=Is(l,u),d=p*h-c*c,m=(h*f-c*y)/d,v=(p*y-c*f)/d,g=i.z*(1-m-v)+r.z*m+a.z*v;if(isFinite(g))return g}return 1/0}for(var x=1/0,b=0,_=e;b<_.length;b+=1)x=Math.min(x,_[b].z);return x}var Cs=Mi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Es=gs.VectorTileFeature.types,Ts=Math.cos(Math.PI/180*37.5),Ms=Math.pow(2,14)/.5,Ps=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Fi,this.indexArray=new Yi,this.programConfigurations=new La(Cs,t.layers,t.zoom),this.segments=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};Ps.prototype.populate=function(t,e,r){this.hasPattern=ns("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?qa(u):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),f,r)){h||(f.geometry=qa(u));var y=n?n.evaluate(f,{},r):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y});}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var _=is("line",this.layers,v,this.zoom,e);this.patternFeatures.push(_);}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index);}},Ps.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Ps.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},Ps.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ps.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Ps.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Cs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},Ps.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},Ps.prototype.addFeature=function(t,e,r,n,i){for(var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),u=a.get("line-miter-limit"),l=a.get("line-round-limit"),p=0,c=e;p<c.length;p+=1)this.addLine(c[p],t,o,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Ps.prototype.addLine=function(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance();}for(var s="Polygon"===Es[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===r&&(i=1.05);var p,c=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,y=void 0,d=void 0,m=void 0;this.e1=this.e2=-1,s&&(m=t[l].sub(p=t[u-2])._unit()._perp());for(var v=l;v<u;v++)if(!(y=v===u-1?s?t[l+1]:void 0:t[v+1])||!t[v].equals(y)){m&&(d=m),p&&(f=p),p=t[v],m=y?y.sub(p)._unit()._perp():d;var g=(d=d||m).add(m);0===g.x&&0===g.y||g._unit();var x=d.x*m.x+d.y*m.y,b=g.x*m.x+g.y*m.y,_=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),A=b<Ts&&f&&y,S=d.x*m.y-d.y*m.x>0;if(A&&v>l){var k=p.dist(f);if(k>2*c){var I=p.sub(p.sub(f)._mult(c/k)._round());this.updateDistance(f,I),this.addCurrentVertex(I,d,0,0,h),f=I;}}var z=f&&y,C=z?r:s?"butt":n;if(z&&"round"===C&&(_<a?C="miter":_<=2&&(C="fakeround")),"miter"===C&&_>i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_<i&&(C="miter")),f&&this.updateDistance(f,p),"miter"===C)g._mult(_),this.addCurrentVertex(p,g,0,0,h);else if("flipbevel"===C){if(_>100)g=m.mult(-1);else {var E=_*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(E*(S?-1:1));}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h);}else if("bevel"===C||"fakeround"===C){var T=-Math.sqrt(_*_-1),M=S?T:0,P=S?0:T;if(f&&this.addCurrentVertex(p,d,M,P,h),"fakeround"===C)for(var B=Math.round(180*w/Math.PI/20),V=1;V<B;V++){var D=V/B;if(.5!==D){var F=D-.5;D+=D*F*(D-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*F*F+(.848013+x*(.215638*x-1.06021)));}var L=m.sub(d)._mult(D)._add(d)._unit()._mult(S?-1:1);this.addHalfVertex(p,L.x,L.y,!1,S,0,h);}y&&this.addCurrentVertex(p,m,-M,-P,h);}else if("butt"===C)this.addCurrentVertex(p,g,0,0,h);else if("square"===C){var R=f?1:-1;this.addCurrentVertex(p,g,R,R,h);}else "round"===C&&(f&&(this.addCurrentVertex(p,d,0,0,h),this.addCurrentVertex(p,d,1,1,h,!0)),y&&(this.addCurrentVertex(p,m,-1,-1,h,!0),this.addCurrentVertex(p,m,0,0,h)));if(A&&v<u-1){var O=p.dist(y);if(O>2*c){var U=p.add(y.sub(p)._mult(c/O)._round());this.updateDistance(p,U),this.addCurrentVertex(U,m,0,0,h),p=U;}}}}},Ps.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>Ms/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a));},Ps.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&s)<<2,s>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u;},Ps.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Ms-1):this.distance;},Ps.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance();},Nn("LineBucket",Ps,{omit:["layers","patternFeatures"]});var Bs=new Ii({"line-cap":new _i(Et.layout_line["line-cap"]),"line-join":new wi(Et.layout_line["line-join"]),"line-miter-limit":new _i(Et.layout_line["line-miter-limit"]),"line-round-limit":new _i(Et.layout_line["line-round-limit"]),"line-sort-key":new wi(Et.layout_line["line-sort-key"])}),Vs={paint:new Ii({"line-opacity":new wi(Et.paint_line["line-opacity"]),"line-color":new wi(Et.paint_line["line-color"]),"line-translate":new _i(Et.paint_line["line-translate"]),"line-translate-anchor":new _i(Et.paint_line["line-translate-anchor"]),"line-width":new wi(Et.paint_line["line-width"]),"line-gap-width":new wi(Et.paint_line["line-gap-width"]),"line-offset":new wi(Et.paint_line["line-offset"]),"line-blur":new wi(Et.paint_line["line-blur"]),"line-dasharray":new Si(Et.paint_line["line-dasharray"]),"line-pattern":new Ai(Et.paint_line["line-pattern"]),"line-gradient":new ki(Et.paint_line["line-gradient"])}),layout:Bs},Ds=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new hi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(wi))(Vs.paint.properties["line-width"].specification);Ds.useIntegerZoom=!0;var Fs=function(t){function e(e){t.call(this,e,Vs);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient();},e.prototype._updateGradient=function(){this.gradient=xo(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ds.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new Ps(t)},e.prototype.queryRadius=function(t){var e=t,r=Ls(eo("line-width",this,e),eo("line-gap-width",this,e)),n=eo("line-offset",this,e);return r/2+Math.abs(n)+ro(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=no(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),l=s/2*Ls(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),p=this.paint.get("line-offset").evaluate(e,r);return p&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],u=0;u<o.length;u++){var l=o[u],p=o[u+1],c=0===u?n:l.sub(o[u-1])._unit()._perp(),h=u===o.length-1?n:p.sub(l)._unit()._perp(),f=c._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(l));}r.push(s);}return r}(n,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(Qa(t,i[a]))return !0;if(Za(t,i,r))return !0}return !1}(u,n,l)},e.prototype.isTileClipped=function(){return !0},e}(zi);function Ls(t,e){return e>0?e+2*t:t}var Rs=Mi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Os=Mi([{name:"a_projected_pos",components:3,type:"Float32"}],4),Us=(Mi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Mi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),qs=(Mi([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),js=Mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Ns(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ci.applyArabicShaping&&(t=ci.applyArabicShaping(t)),t}(t.text,e,r);})),t}Mi([{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"}]),Mi([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),Mi([{type:"Float32",name:"offsetX"}]),Mi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Gs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ks=function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,a=f&(1<<-p)-1,f>>=-p,p+=s;p>0;a=256*a+t[e+c],c+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t[e+c],c+=h,p-=8);if(0===a)a=1-l;else {if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=l;}return (f?-1:1)*o*Math.pow(2,a-n)},Xs=function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(1<<l)-1,c=p>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=p?(s=0,o=p):o+c>=1?(s=(e*u-1)*Math.pow(2,i),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;t[r+f]=255&o,f+=y,o/=256,l-=8);t[r+f-y]|=128*d;},Zs=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Hs(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function $s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ws(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function tu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function eu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function ru(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function nu(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function iu(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function au(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r]);}function ou(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r]);}function su(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function uu(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function lu(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function pu(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function cu(t,e,r){1===t&&r.readMessage(hu,e);}function hu(t,e,r){if(3===t){var n=r.readMessage(fu,{}),i=n.width,a=n.height,o=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new mo({width:i+6,height:a+6},n.bitmap),metrics:{width:i,height:a,left:o,top:s,advance:u}});}}function fu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}function yu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w);}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=o.length-1;h>=0;h--){var f=o[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=o.pop();h<o.length&&(o[h]=y);}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(o.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return {w:s,h:u,fill:e/(s*u)||0}}Js.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=uu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=uu(this.buf,this.pos)+4294967296*uu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=uu(this.buf,this.pos)+4294967296*pu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ks(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ks(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return $s(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return $s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,r){return Ys.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Js.Bytes)return t.push(this.readVarint(e));var r=Hs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Js.Bytes)return t.push(this.readSVarint());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Js.Bytes)return t.push(this.readBoolean());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Js.Bytes)return t.push(this.readFloat());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Js.Bytes)return t.push(this.readDouble());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed32());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed32());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed64());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed64());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Js.Varint)for(;this.buf[this.pos++]>127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else {if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),lu(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),lu(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),lu(this.buf,-1&t,this.pos),lu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),lu(this.buf,-1&t,this.pos),lu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=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++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ws(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),Xs(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),Xs(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r];},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ws(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Qs,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,tu,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,nu,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,eu,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ru,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,iu,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,au,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ou,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,su,e);},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var du=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n;},mu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};mu.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},mu.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},mu.tlbr.get=function(){return this.tl.concat(this.br)},mu.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(du.prototype,mu);var vu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=yu(i),o=new vo({width:a.w||1,height:a.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;vo.copy(u.data,o,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data);}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;vo.copy(c.data,o,{x:0,y:0},{x:f,y:y},c.data),vo.copy(c.data,o,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),vo.copy(c.data,o,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),vo.copy(c.data,o,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),vo.copy(c.data,o,{x:0,y:0},{x:f+d,y:y},{width:1,height:m});}this.image=o,this.iconPositions=r,this.patternPositions=n;};vu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new du(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n);}},vu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e);},vu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]});}},Nn("ImagePosition",du),Nn("ImageAtlas",vu);var gu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null;};xu.forText=function(t,e){var r=new xu;return r.scale=t||1,r.fontStack=e,r},xu.forImage=function(t){var e=new xu;return e.imageName=t,e};var bu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;};function _u(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d){var m,v=bu.fromFeature(t,i);c===gu.vertical&&v.verticalizePunctuation();var g=ci.processBidirectionalText,x=ci.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,_=g(v.toString(),Cu(v,l,a,e,n,f,y));b<_.length;b+=1){var w=_[b],A=new bu;A.text=w,A.sections=v.sections;for(var S=0;S<w.length;S++)A.sectionIndex.push(0);m.push(A);}}else if(x){m=[];for(var k=0,I=x(v.text,v.sectionIndex,Cu(v,l,a,e,n,f,y));k<I.length;k+=1){var z=I[k],C=new bu;C.text=z[0],C.sectionIndex=z[1],C.sections=v.sections,m.push(C);}}else m=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s;}return i<n.length&&r.push(t.substring(i,n.length)),r}(v,Cu(v,l,a,e,n,f,y));var E=[],T={positionedLines:E,text:v.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,u,l,p,c){for(var h=0,f=-17,y=0,d=0,m="right"===s?1:"left"===s?0:.5,v=0,g=0,x=i;g<x.length;g+=1){var b=x[g];b.trim();var _=b.getMaxScale(),w=24*(_-1),A={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=A;var S=A.positionedGlyphs,k=0;if(b.length()){for(var I=0;I<b.length();I++){var z=b.getSection(I),C=b.getSectionIndex(I),E=b.getCharCode(I),T=0,M=null,P=null,B=null,V=24,D=!(u===gu.horizontal||!p&&!Wn(E)||p&&(wu[E]||(G=E,Hn.Arabic(G)||Hn["Arabic Supplement"](G)||Hn["Arabic Extended-A"](G)||Hn["Arabic Presentation Forms-A"](G)||Hn["Arabic Presentation Forms-B"](G))));if(z.imageName){var F=n[z.imageName];if(!F)continue;B=z.imageName,t.iconsInText=t.iconsInText||!0,P=F.paddedRect;var L=F.displaySize;z.scale=24*z.scale/c,T=w+(24-L[1]*z.scale),V=(M={width:L[0],height:L[1],left:1,top:-3,advance:D?L[1]:L[0]}).advance;var R=D?L[0]*z.scale-24*_:L[1]*z.scale-24*_;R>0&&R>k&&(k=R);}else {var O=r[z.fontStack],U=O&&O[E];if(U&&U.rect)P=U.rect,M=U.metrics;else {var q=e[z.fontStack],j=q&&q[E];if(!j)continue;M=j.metrics;}T=24*(_-z.scale);}D?(t.verticalizable=!0,S.push({glyph:E,imageName:B,x:h,y:f+T,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:C,metrics:M,rect:P}),h+=V*z.scale+l):(S.push({glyph:E,imageName:B,x:h,y:f+T,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:C,metrics:M,rect:P}),h+=M.advance*z.scale+l);}0!==S.length&&(y=Math.max(h-l,y),Tu(S,0,S.length-1,m,k)),h=0;var N=a*_+k;A.lineOffset=Math.max(k,w),f+=N,d=Math.max(N,d),++v;}else f+=a,++v;}var G,K=f- -17,X=Eu(o),Z=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,a,o,s,u){var l,p=(e-r)*i;l=a!==o?-s*n- -17:(-n*u+.5)*o;for(var c=0,h=t;c<h.length;c+=1)for(var f=0,y=h[c].positionedGlyphs;f<y.length;f+=1){var d=y[f];d.x+=p,d.y+=l;}})(t.positionedLines,m,Z,J,y,d,a,K,i.length),t.top+=-J*K,t.bottom=t.top+K,t.left+=-Z*y,t.right=t.left+y;}(T,e,r,n,m,o,s,u,c,l,h,d),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return !1;return !0}(E)&&T}bu.fromFeature=function(t,e){for(var r=new bu,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e);}return r},bu.prototype.length=function(){return this.text.length},bu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},bu.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},bu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},bu.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Qn(n)&&!Gs[t[r+1]]||i&&Qn(i)&&!Gs[t[r-1]]||!Gs[t[r]]?t[r]:Gs[t[r]];}return e}(this.text);},bu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&wu[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&wu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},bu.prototype.substring=function(t,e){var r=new bu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},bu.prototype.toString=function(){return this.text},bu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},bu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r);},bu.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(xu.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401");}else w("Can't add FormattedSection with an empty image.");},bu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var wu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Au={};function Su(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function ku(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Iu(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function zu(t,e,r,n,i,a){for(var o=null,s=ku(e,r,i,a),u=0,l=n;u<l.length;u+=1){var p=l[u],c=ku(e-p.x,r,i,a)+p.badness;c<=s&&(o=p,s=c);}return {index:t,x:e,priorBreak:o,badness:s}}function Cu(t,e,r,n,i,a,o){if("point"!==a)return [];if(!t)return [];for(var s,u=[],l=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var u=t.getSection(s);o+=Su(t.getCharCode(s),u,n,i,e,a);}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),p=t.text.indexOf("")>=0,c=0,h=0;h<t.length();h++){var f=t.getSection(h),y=t.getCharCode(h);if(wu[y]||(c+=Su(y,f,n,i,e,o)),h<t.length()-1){var d=!((s=y)<11904||!(Hn["Bopomofo Extended"](s)||Hn.Bopomofo(s)||Hn["CJK Compatibility Forms"](s)||Hn["CJK Compatibility Ideographs"](s)||Hn["CJK Compatibility"](s)||Hn["CJK Radicals Supplement"](s)||Hn["CJK Strokes"](s)||Hn["CJK Symbols and Punctuation"](s)||Hn["CJK Unified Ideographs Extension A"](s)||Hn["CJK Unified Ideographs"](s)||Hn["Enclosed CJK Letters and Months"](s)||Hn["Halfwidth and Fullwidth Forms"](s)||Hn.Hiragana(s)||Hn["Ideographic Description Characters"](s)||Hn["Kangxi Radicals"](s)||Hn["Katakana Phonetic Extensions"](s)||Hn.Katakana(s)||Hn["Vertical Forms"](s)||Hn["Yi Radicals"](s)||Hn["Yi Syllables"](s)));(Au[y]||d||f.imageName)&&u.push(zu(h+1,c,l,u,Iu(y,t.getCharCode(h+1),d&&p),!1));}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(zu(t.length(),c,l,u,0,!0))}function Eu(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;}return {horizontalAlign:e,verticalAlign:r}}function Tu(t,e,r,n,i){if(n||i)for(var a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n,s=e;s<=r;s++)t[s].x-=o,t[s].y+=i;}function Mu(t,e,r,n,i,a){var o,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;o=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l];}var p,c,h,f,y=e.left*a,d=e.right*a;"width"===r||"both"===r?(f=i[0]+y-n[3],c=i[0]+d+n[1]):c=(f=i[0]+(y+d-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*a,v=e.bottom*a;return "height"===r||"both"===r?(p=i[1]+m-n[0],h=i[1]+v+n[2]):h=(p=i[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:p,right:c,bottom:h,left:f,collisionPadding:o}}Au[10]=!0,Au[32]=!0,Au[38]=!0,Au[40]=!0,Au[41]=!0,Au[43]=!0,Au[45]=!0,Au[47]=!0,Au[173]=!0,Au[183]=!0,Au[8203]=!0,Au[8208]=!0,Au[8211]=!0,Au[8231]=!0;var Pu=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);function Bu(t,e){var r=e.expression;if("constant"===r.kind)return {kind:"constant",layoutSize:r.evaluate(new hi(t+1))};if("source"===r.kind)return {kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],u=n[o];return "composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new hi(s)),maxSize:r.evaluate(new hi(u)),interpolationType:i}}function Vu(t,e,r){var n=e.uSize,i=r.lowerSize;return "source"===t.kind?i/128:"composite"===t.kind?$e(i/128,r.upperSize/128,e.uSizeT):n}function Du(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=i?u(hr.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=$e(t.minSize,t.maxSize,a):r=a;}return {uSizeT:r,uSize:n}}Nn("Anchor",Pu);var Fu=Object.freeze({__proto__:null,getSizeData:Bu,evaluateSizeForFeature:Vu,evaluateSizeForZoom:Du,SIZE_PACK_FACTOR:128});function Lu(t,e,r,n,i){if(void 0===e.segment)return !0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return !1;s-=t[o].dist(a),a=t[o];}s+=t[o].dist(t[o+1]),o++;for(var u=[],l=0;s<r/2;){var p=t[o],c=t[o+1];if(!c)return !1;var h=t[o-1].angleTo(p)-p.angleTo(c);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:h}),l+=h;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return !1;o++,s+=p.dist(c);}return !0}function Ru(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Ou(t,e,r){return t?.6*e*r:0}function Uu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function qu(t,e,r,n,i,a){for(var o=Ou(r,i,a),s=Uu(r,n)*a,u=0,l=Ru(t)/2,p=0;p<t.length-1;p++){var c=t[p],h=t[p+1],f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=$e(c.x,h.x,y),m=$e(c.y,h.y,y),v=new Pu(d,m,h.angleTo(c),p);return v._round(),!o||Lu(t,v,s,o,e)?v:void 0}u+=f;}}function ju(t,e,r,n,i,a,o,s,u){var l=Ou(n,a,o),p=Uu(n,i),c=p*o,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,a,o,s,u,l){for(var p=o/2,c=Ru(e),h=0,f=r-n,y=[],d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,_=$e(m.x,v.x,b),w=$e(m.y,v.y,b);if(_>=0&&_<l&&w>=0&&w<l&&f-p>=0&&f+p<=c){var A=new Pu(_,w,x,d);A._round(),i&&!Lu(e,A,o,i,a)||y.push(A);}}h+=g;}return u||y.length||s||(y=t(e,h/2,n,i,a,o,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*a)*o*s%e,e,l,r,c,h,!1,u)}function Nu(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,u=o.paddedRect.w-2,l=o.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=o.stretchX||[[0,u]],f=o.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,_=0,w=m,A=0,S=v,k=0,I=g;if(o.content&&n){var z=o.content;x=Gu(h,0,z[0]),_=Gu(f,0,z[1]),b=Gu(h,z[0],z[2]),w=Gu(f,z[1],z[3]),A=z[0]-x,k=z[1]-_,S=z[2]-z[0]-b,I=z[3]-z[1]-w;}var C=function(n,a,u,l){var h=Xu(n.stretch-x,b,p,t.left),f=Zu(n.fixed-A,S,n.stretch,d),y=Xu(a.stretch-_,w,c,t.top),v=Zu(a.fixed-k,I,a.stretch,m),g=Xu(u.stretch-x,b,p,t.left),z=Zu(u.fixed-A,S,u.stretch,d),C=Xu(l.stretch-_,w,c,t.top),E=Zu(l.fixed-k,I,l.stretch,m),T=new i(h,y),M=new i(g,y),P=new i(g,C),B=new i(h,C),V=new i(f/s,v/s),D=new i(z/s,E/s),F=e*Math.PI/180;if(F){var L=Math.sin(F),R=Math.cos(F),O=[R,-L,L,R];T._matMult(O),M._matMult(O),B._matMult(O),P._matMult(O);}var U=n.stretch+n.fixed,q=a.stretch+a.fixed;return {tl:T,tr:M,bl:B,br:P,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+q,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-q},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:V,pixelOffsetBR:D,minFontScaleX:S/s/p,minFontScaleY:I/s/c,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=Ku(h,v,d),T=Ku(f,g,m),M=0;M<E.length-1;M++)for(var P=E[M],B=E[M+1],V=0;V<T.length-1;V++)a.push(C(P,T[V],B,T[V+1]));else a.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return a}function Gu(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]));}return n}function Ku(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],u=o[1],l=n[n.length-1];n.push({fixed:s-l.stretch,stretch:l.stretch}),n.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)});}return n.push({fixed:e+1,stretch:r}),n}function Xu(t,e,r,n){return t/e*r+n}function Zu(t,e,r,n){return t-e*r/n}var Ju=function(t,e,r,n,a,o,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l,v=s.collisionPadding;if(v&&(d-=v[0]*u,f-=v[1]*u,m+=v[2]*u,y+=v[3]*u),this.boxStartIndex=t.length,p){var g=y-f,x=m-d;g>0&&(g=Math.max(10*u,g),this._addLineCollisionCircles(t,e,r,r.segment,x,g,n,a,o,c));}else {if(h){var b=new i(d,f),_=new i(m,f),w=new i(d,y),A=new i(m,y),S=h*Math.PI/180;b._rotate(S),_._rotate(S),w._rotate(S),A._rotate(S),d=Math.min(b.x,_.x,w.x,A.x),m=Math.max(b.x,_.x,w.x,A.x),f=Math.min(b.y,_.y,w.y,A.y),y=Math.max(b.y,_.y,w.y,A.y);}t.emplaceBack(r.x,r.y,d,f,m,y,n,a,o,0,0);}this.boxEndIndex=t.length;};Ju.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,u,l){var p=a/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-a/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m];}while(v>x);for(var b=e[m].dist(e[m+1]),_=-f;_<c+f;_++){var w=_*p,A=g+w;if(w<0&&(A+=w),w>i&&(A+=w-i),!(A<v)){for(;v+b<A;){if(v+=b,1+ ++m>=e.length)return;b=e[m].dist(e[m+1]);}var S=A-v,k=e[m],I=e[m+1].sub(k)._unit()._mult(S)._add(k)._round(),z=Math.abs(A-y)<p?0:.8*(A-y);t.emplaceBack(I.x,I.y,-a/2,-a/2,a/2,a/2,o,s,u,a/2,z);}}};var Yu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Hu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);};function Hu(t,e){return t<e?-1:t>e?1:0}function $u(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<n)&&(n=p.x),(!l||p.y<a)&&(a=p.y),(!l||p.x>o)&&(o=p.x),(!l||p.y>s)&&(s=p.y);}var c=Math.min(o-n,s-a),h=c/2,f=new Yu([],Wu);if(0===c)return new i(n,a);for(var y=n;y<o;y+=c)for(var d=a;d<s;d+=c)f.push(new Qu(y+h,d+h,h,t));for(var m=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var u=i[a],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p;}return new Qu(r/e,n/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>m.d||!m.d)&&(m=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Qu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Qu(g.p.x+h,g.p.y-h,h,t)),f.push(new Qu(g.p.x-h,g.p.y+h,h,t)),f.push(new Qu(g.p.x+h,g.p.y+h,h,t)),v+=4);}return r&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Wu(t,e){return e.max-t.max}function Qu(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,u=s-1;o<s;u=o++){var l=a[o],p=a[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,$a(t,l,p));}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}Yu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},Yu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Yu.prototype.peek=function(){return this.data[0]},Yu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i;}e[t]=n;},Yu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a;}e[t]=i;};var tl=Number.POSITIVE_INFINITY;function el(t,e){return e[1]!==tl?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r;}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e;}return [n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7;}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e;}return [r,n]}(t,e[0])}function rl(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 nl(t,e,r,n,a,o,s,u,l,p,c,h,f,y,d){var m=function(t,e,r,n,a,o,s,u){for(var l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,p=[],c=0,h=e.positionedLines;c<h.length;c+=1)for(var f=h[c],y=0,d=f.positionedGlyphs;y<d.length;y+=1){var m=d[y];if(m.rect){var v=m.rect||{},g=4,x=!0,b=1,_=0,w=(a||u)&&m.vertical,A=m.metrics.advance*m.scale/2;if(u&&e.verticalizable&&(_=f.lineOffset/2-(m.imageName?-(24-m.metrics.width*m.scale)/2:24*(m.scale-1))),m.imageName){var S=s[m.imageName];x=S.sdf,g=1/(b=S.pixelRatio);}var k=a?[m.x+A,m.y]:[0,0],I=a?[0,0]:[m.x+A+r[0],m.y+r[1]-_],z=[0,0];w&&(z=I,I=[0,0]);var C=(m.metrics.left-g)*m.scale-A+I[0],E=(-m.metrics.top-g)*m.scale+I[1],T=C+v.w*m.scale/b,M=E+v.h*m.scale/b,P=new i(C,E),B=new i(T,E),V=new i(C,M),D=new i(T,M);if(w){var F=new i(-A,A- -17),L=-Math.PI/2,R=12-A,O=new i(22-R,-(m.imageName?R:0)),U=new(Function.prototype.bind.apply(i,[null].concat(z)));P._rotateAround(L,F)._add(O)._add(U),B._rotateAround(L,F)._add(O)._add(U),V._rotateAround(L,F)._add(O)._add(U),D._rotateAround(L,F)._add(O)._add(U);}if(l){var q=Math.sin(l),j=Math.cos(l),N=[j,-q,q,j];P._matMult(N),B._matMult(N),V._matMult(N),D._matMult(N);}var G=new i(0,0),K=new i(0,0);p.push({tl:P,tr:B,bl:V,br:D,tex:v,writingMode:e.writingMode,glyphOffset:k,sectionIndex:m.sectionIndex,isSDF:x,pixelOffsetTL:G,pixelOffsetBR:K,minFontScaleX:0,minFontScaleY:0});}}return p}(0,r,u,a,o,s,n,t.allowVerticalPlacement),v=t.textSizeData,g=null;"source"===v.kind?(g=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*y.compositeTextSizes[0].evaluate(s,{},d),128*y.compositeTextSizes[1].evaluate(s,{},d)])[0]>32640||g[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,o,s,p,e,l.lineStartIndex,l.lineLength,f,d);for(var x=0,b=c;x<b.length;x+=1)h[b[x]]=t.text.placedSymbolArray.length-1;return 4*m.length}function il(t){for(var e in t)return t[e];return null}function al(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return !0}else i[e]=[];return i[e].push(n),!1}var ol=gs.VectorTileFeature.types,sl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ul(t,e,r,n,i,a,o,s,u,l,p,c,h){var f=s?Math.min(32640,Math.round(s[0])):0,y=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(f<<1)+(u?1:0),y,16*l,16*p,256*c,256*h);}function ll(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 pl(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(ri(r[e].text))return !0;return !1}var cl=function(t){this.layoutVertexArray=new Ri,this.indexArray=new Yi,this.programConfigurations=t,this.segments=new ca,this.dynamicLayoutVertexArray=new Oi,this.opacityVertexArray=new Ui,this.placedSymbolArray=new na;};cl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},cl.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Rs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Os.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,sl,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t));},cl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());},Nn("SymbolBuffers",cl);var hl=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ca,this.collisionVertexArray=new Ni;};hl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Us.members,!0);},hl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());},Nn("CollisionBuffers",hl);var fl=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[];var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Bu(this.zoom,e["text-size"]),this.iconSizeData=Bu(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return gu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID;};fl.prototype.createArrays=function(){this.text=new cl(new La(Rs.members,this.layers,this.zoom,(function(t){return /^text/.test(t)}))),this.icon=new cl(new La(Rs.members,this.layers,this.zoom,(function(t){return /^icon/.test(t)}))),this.glyphOffsetArray=new oa,this.lineVertexArray=new sa,this.symbolInstances=new aa;},fl.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=Gs[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0);}},fl.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),u=("constant"!==o.value.kind||o.value.value instanceof ee&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new hi(this.zoom),d=0,m=t;d<m.length;d+=1){var v=m[d],g=v.feature,x=v.id,b=v.index,_=v.sourceLayerIndex,w=n._featureFilter.needGeometry,A={type:g.type,id:x,properties:g.properties,geometry:w?qa(g):[]};if(n._featureFilter.filter(y,A,r)){w||(A.geometry=qa(g));var S=void 0;if(u){var k=n.getValueAndResolveTokens("text-field",A,r,f),I=ee.factory(k);pl(I)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===li()||this.hasRTLText&&ci.isParsed())&&(S=Ns(I,n,A));}var z=void 0;if(l){var C=n.getValueAndResolveTokens("icon-image",A,r,f);z=C instanceof re?C:re.fromString(C);}if(S||z){var E=this.sortFeaturesByKey?p.evaluate(A,{},r):void 0,T={id:x,text:S,icon:z,index:b,sourceLayerIndex:_,geometry:qa(g),properties:g.properties,type:ol[g.type],sortKey:E};if(this.features.push(T),z&&(c[z.name]=!0),S){var M=a.evaluate(A,{},r).join(","),P="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(gu.vertical)>=0;for(var B=0,V=S.sections;B<V.length;B+=1){var D=V[B];if(D.image)c[D.image.name]=!0;else {var F=$n(S.toString()),L=D.fontStack||M,R=h[L]=h[L]||{};this.calculateGlyphDependencies(D.text,R,P,this.allowVerticalPlacement,F);}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++;}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=o(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null;}else f in r?o(f,y,c):y in e?s(f,y,c):(a(l),e[f]=i-1,r[y]=i-1);}else a(l);}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}));}},fl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r));},fl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},fl.prototype.uploadPending=function(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},fl.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0;},fl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy();},fl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData();},fl.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=a[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor);}}return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},fl.prototype.addSymbols=function(t,e,r,n,i,a,o,s,u,l,p,c){for(var h=t.indexArray,f=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,f,h,a.sortKey),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&o===gu.vertical?Math.PI/2:0,g=a.text&&a.text.sections,x=0;x<e.length;x++){var b=e[x],_=b.tl,w=b.tr,A=b.bl,S=b.br,k=b.tex,I=b.pixelOffsetTL,z=b.pixelOffsetBR,C=b.minFontScaleX,E=b.minFontScaleY,T=b.glyphOffset,M=b.isSDF,P=b.sectionIndex,B=y.vertexLength,V=T[1];ul(f,s.x,s.y,_.x,V+_.y,k.x,k.y,r,M,I.x,I.y,C,E),ul(f,s.x,s.y,w.x,V+w.y,k.x+k.w,k.y,r,M,z.x,I.y,C,E),ul(f,s.x,s.y,A.x,V+A.y,k.x,k.y+k.h,r,M,I.x,z.y,C,E),ul(f,s.x,s.y,S.x,V+S.y,k.x+k.w,k.y+k.h,r,M,z.x,z.y,C,E),ll(t.dynamicLayoutVertexArray,s,v),h.emplaceBack(B,B+1,B+2),h.emplaceBack(B+1,B+2,B+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(T[0]),x!==e.length-1&&P===e[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},c,g&&g[P]);}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,p);},fl.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},fl.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s,u){var l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),p=l.vertexLength,c=a.layoutVertexArray,h=a.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,o,f,y,new i(t,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,n)),this._addCollisionDebugVertex(c,h,o,f,y,new i(t,n)),l.vertexLength+=4,u){var d=a.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2;}else {var m=a.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4;}},fl.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i),o=a.radius>0;this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,o?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r,o);}},fl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hl(ji,qs.members,Hi),this.iconCollisionBox=new hl(ji,qs.members,Hi),this.textCollisionCircle=new hl(ji,js.members,Yi),this.iconCollisionCircle=new hl(ji,js.members,Yi);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1);}},fl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,u){for(var l={},p=e;p<r;p++){var c=t.get(p);if(0===c.radius){l.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},l.textFeatureIndex=c.featureIndex;break}l.textCircles||(l.textCircles=[],l.textFeatureIndex=c.featureIndex),l.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1);}for(var h=n;h<i;h++){var f=t.get(h);if(0===f.radius){l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}}for(var y=a;y<o;y++){var d=t.get(y);if(0===d.radius){l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}}for(var m=s;m<u;m++){var v=t.get(m);if(0===v.radius){l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}}return l},fl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex));}},fl.prototype.hasTextData=function(){return this.text.segments.get().length>0},fl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},fl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},fl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},fl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},fl.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},fl.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},fl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3);},fl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex);}return a.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),a},fl.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1});},fl.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t);})),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);}},Nn("SymbolBucket",fl,{omit:["layers","collisionBoxArray","features","compareText"]}),fl.MAX_GLYPHS=65535,fl.addDynamicAttributes=ll;var yl=new Ii({"symbol-placement":new _i(Et.layout_symbol["symbol-placement"]),"symbol-spacing":new _i(Et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new _i(Et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new wi(Et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new _i(Et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new _i(Et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new _i(Et.layout_symbol["icon-ignore-placement"]),"icon-optional":new _i(Et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new _i(Et.layout_symbol["icon-rotation-alignment"]),"icon-size":new wi(Et.layout_symbol["icon-size"]),"icon-text-fit":new _i(Et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new _i(Et.layout_symbol["icon-text-fit-padding"]),"icon-image":new wi(Et.layout_symbol["icon-image"]),"icon-rotate":new wi(Et.layout_symbol["icon-rotate"]),"icon-padding":new _i(Et.layout_symbol["icon-padding"]),"icon-keep-upright":new _i(Et.layout_symbol["icon-keep-upright"]),"icon-offset":new wi(Et.layout_symbol["icon-offset"]),"icon-anchor":new wi(Et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new _i(Et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new _i(Et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new _i(Et.layout_symbol["text-rotation-alignment"]),"text-field":new wi(Et.layout_symbol["text-field"]),"text-font":new wi(Et.layout_symbol["text-font"]),"text-size":new wi(Et.layout_symbol["text-size"]),"text-max-width":new wi(Et.layout_symbol["text-max-width"]),"text-line-height":new _i(Et.layout_symbol["text-line-height"]),"text-letter-spacing":new wi(Et.layout_symbol["text-letter-spacing"]),"text-justify":new wi(Et.layout_symbol["text-justify"]),"text-radial-offset":new wi(Et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new _i(Et.layout_symbol["text-variable-anchor"]),"text-anchor":new wi(Et.layout_symbol["text-anchor"]),"text-max-angle":new _i(Et.layout_symbol["text-max-angle"]),"text-writing-mode":new _i(Et.layout_symbol["text-writing-mode"]),"text-rotate":new wi(Et.layout_symbol["text-rotate"]),"text-padding":new _i(Et.layout_symbol["text-padding"]),"text-keep-upright":new _i(Et.layout_symbol["text-keep-upright"]),"text-transform":new wi(Et.layout_symbol["text-transform"]),"text-offset":new wi(Et.layout_symbol["text-offset"]),"text-allow-overlap":new _i(Et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new _i(Et.layout_symbol["text-ignore-placement"]),"text-optional":new _i(Et.layout_symbol["text-optional"])}),dl={paint:new Ii({"icon-opacity":new wi(Et.paint_symbol["icon-opacity"]),"icon-color":new wi(Et.paint_symbol["icon-color"]),"icon-halo-color":new wi(Et.paint_symbol["icon-halo-color"]),"icon-halo-width":new wi(Et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new wi(Et.paint_symbol["icon-halo-blur"]),"icon-translate":new _i(Et.paint_symbol["icon-translate"]),"icon-translate-anchor":new _i(Et.paint_symbol["icon-translate-anchor"]),"text-opacity":new wi(Et.paint_symbol["text-opacity"]),"text-color":new wi(Et.paint_symbol["text-color"],{runtimeType:qt,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new wi(Et.paint_symbol["text-halo-color"]),"text-halo-width":new wi(Et.paint_symbol["text-halo-width"]),"text-halo-blur":new wi(Et.paint_symbol["text-halo-blur"]),"text-translate":new _i(Et.paint_symbol["text-translate"]),"text-translate-anchor":new _i(Et.paint_symbol["text-translate-anchor"])}),layout:yl},ml=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Lt,this.defaultValue=t;};ml.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},ml.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},ml.prototype.outputDefined=function(){return !1},ml.prototype.serialize=function(){return null},Nn("FormatSectionOverride",ml,{omit:["defaultValue"]});var vl=function(t){function e(e){t.call(this,e,dl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s);}this.layout._values["text-writing-mode"]=i;}else this.layout._values["text-writing-mode"]=["horizontal"];}this._setPaintOverrides();},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||Hr(a.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new fl(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype._setPaintOverrides=function(){for(var t=0,r=dl.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new ml(a),s=new Yr(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new Wr("source",s):new Qr("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new xi(a.property,i,a.parameters);}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return !(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=dl.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof ee)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){i||(t instanceof se&&ae(t.value)===Kt?a(t.value.sections):t instanceof ce?a(t.sections):t.eachChild(o));},s=r.value;s._styleExpression&&o(s._styleExpression.expression);}return i},e}(zi),gl={paint:new Ii({"background-color":new _i(Et.paint_background["background-color"]),"background-pattern":new Si(Et.paint_background["background-pattern"]),"background-opacity":new _i(Et.paint_background["background-opacity"])})},xl=function(t){function e(e){t.call(this,e,gl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(zi),bl={paint:new Ii({"raster-opacity":new _i(Et.paint_raster["raster-opacity"]),"raster-hue-rotate":new _i(Et.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new _i(Et.paint_raster["raster-brightness-min"]),"raster-brightness-max":new _i(Et.paint_raster["raster-brightness-max"]),"raster-saturation":new _i(Et.paint_raster["raster-saturation"]),"raster-contrast":new _i(Et.paint_raster["raster-contrast"]),"raster-resampling":new _i(Et.paint_raster["raster-resampling"]),"raster-fade-duration":new _i(Et.paint_raster["raster-fade-duration"])})},_l=function(t){function e(e){t.call(this,e,bl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(zi),wl=function(t){function e(e){t.call(this,e,{}),this.implementation=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return "3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl);},e}(zi),Al={circle:lo,heatmap:bo,hillshade:wo,fill:us,"fill-extrusion":ks,line:Fs,symbol:vl,background:xl,raster:_l},Sl=self.HTMLImageElement,kl=self.HTMLCanvasElement,Il=self.HTMLVideoElement,zl=self.ImageData,Cl=self.ImageBitmap,El=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n);};El.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof Sl||t instanceof kl||t instanceof Il||t instanceof zl||Cl&&t instanceof Cl?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else {var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof Sl||t instanceof kl||t instanceof Il||t instanceof zl||Cl&&t instanceof Cl?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data);}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D);},El.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e);},El.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},El.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null;};var Tl=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback();});};Tl.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback();}),0));},Tl.prototype.remove=function(){delete this._channel,this._callback=function(){};};var Ml=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Tl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:self;};function Pl(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Ml.prototype.send=function(t,e,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=C(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Zn(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId});}}},Ml.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n();}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e);},Ml.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e);}},Ml.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Jn(e.error)):n(null,Jn(e.data)));}else {var i=!1,a=C(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?Zn(e):null,data:Zn(n,a)},a);}:function(t){i=!0;},s=null,u=Jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,o);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,o);}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel);}},Ml.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1);};var Bl=function t(e,r,n){this.epsgCode=e,this.extent=r,this.unit=n||"degree",t.set(this);};Bl.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else {var r=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-r,this.extent[0]+r,this.extent[3]];}}return this._rectifyExtent},Bl.prototype.getOrigin=function(){return [this.extent[0],this.extent[3]]},Bl.prototype.getEpsgCode=function(){return this.epsgCode},Bl.prototype.getUnit=function(){return this.unit},Bl.get=function(t){for(var e in Bl)if(Bl.hasOwnProperty(e)&&Bl[e].getEpsgCode&&Bl[e].getEpsgCode()===t)return Bl[e];return null},Bl.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Bl[e]=t;},Bl.EPSG4326=new Bl("EPSG:4326",[-180,-90,180,90]),Bl.EPSG4214=new Bl("EPSG:4214",[-180,-90,180,90]),Bl.EPSG4490=new Bl("EPSG:4490",[-180,-90,180,90]),Bl.EPSG4610=new Bl("EPSG:4610",[-180,-90,180,90]),Bl.EPSG3857=new Bl("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]);var Vl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Ll(0,t,t,e,r),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0;};Vl.prototype.offsetZ=function(t){t&&(this.z+=t);},Vl.prototype.replaceX=function(t){this.x_replace=t;},Vl.prototype.replaceY=function(t){this.y_replace=t;},Vl.prototype.replaceZ=function(t){this.z_replace=t;},Vl.prototype.format=function(t,e){var r=t.length;if(r>=e)t=t.substring(r-e,r);else {for(var n="",i=0;i<e;i++)n+="0";t=n.substring(0,n.length-r)+t;}return t},Vl.prototype.replaceRule=function(t,e){var r=t.fixlength,n=t.prefix,i=t.postfix,a=e;switch(t.type){case"hex":a=e.toString(16).toUpperCase();break;case"dec":a=e.toString(10).toUpperCase();break;case"oct":a=e.toString(8).toUpperCase();break;case"bin":a=e.toString(2).toUpperCase();}return r&&(a=this.format(a,r)),n&&(a=n+a),i&&(a+=i),a},Vl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Vl.prototype.url=function(t,e){var r=this.x_replace,n=this.y_replace,i=this.z_replace,a=t[(this.x+this.y)%t.length],o=a.indexOf("reversebbox=true")>=0,s=this.getTileBBox(this.x,this.y,this.z);if(o){var u=s.split(",");s=u[1]+","+u[0]+","+u[3]+","+u[2],console.warn("reverse",s);}var l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y),p=this.z,c=this.x,h=this.y;return (r||n||i)&&(i&&(p=this.replaceRule(i,this.z)),r&&(c=this.replaceRule(r,this.x)),n&&(h=this.replaceRule(n,this.y))),a.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(p)).replace("{x}",String(c)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:h)).replace("{quadkey}",l).replace("{bbox}",s)},Vl.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Vl.prototype.getTileBBox=function(t,e,r){return function(t,e,r){var n=Pl(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Pl(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(t,e,r)},Vl.prototype.getCRS=function(){return Bl.EPSG3857},Vl.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Dl=function(t,e){this.wrap=t,this.canonical=e,this.key=Ll(t,e.z,e.z,e.x,e.y);},Fl=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Vl(r,+n,+i),this.key=Ll(e,t,r,n,i);};function Ll(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var a=1<<r;return (a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}function Rl(t,e,r){var n=function(n,i){if(n)return r(n);if(i){var a=c(p(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(a.vectorLayers=i.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=e.canonicalizeTileset(a,t.url),r(null,a);}};return t.url?bt(e.transformRequest(e.normalizeSourceURL(t.url),yt.Source),n):L.frame((function(){return n(null,t)}))}Fl.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Fl.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Fl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Fl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Ll(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Ll(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Fl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return !1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Fl.prototype.children=function(t){if(this.overscaledZ>=t)return [new Fl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new Fl(e,this.wrap,e,r,n),new Fl(e,this.wrap,e,r+1,n),new Fl(e,this.wrap,e,r,n+1),new Fl(e,this.wrap,e,r+1,n+1)]},Fl.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Fl.prototype.wrapped=function(){return new Fl(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Fl.prototype.unwrapTo=function(t){return new Fl(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Fl.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Fl.prototype.toUnwrapped=function(){return new Dl(this.wrap,this.canonical)},Fl.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Fl.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new ze(t.x-this.wrap,t.y))},Nn("CanonicalTileID",Vl),Nn("OverscaledTileID",Fl,{omit:["posMatrix"]});var Ol=function(t,e,r){this.bounds=xe.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24;};Ol.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Ol.prototype.contains=function(t){var e=Math.pow(2,t.z),r=Math.floor(Ae(this.bounds.getWest())*e),n=Math.floor(Se(this.bounds.getNorth())*e),i=Math.ceil(Ae(this.bounds.getEast())*e),a=Math.ceil(Se(this.bounds.getSouth())*e);return t.x>=r&&t.x<i&&t.y>=n&&t.y<a};var Ul=function(t){function e(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=p({type:"raster"},r),p(this,c(r,["url","scheme","tileSize"]));}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new It("dataloading",{dataType:"source"})),this._tileJSONRequest=Rl(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new zt(e)):r&&(p(t,r),r.bounds&&(t.tileBounds=new Ol(r.bounds,t.minzoom,t.maxzoom)),nt(r.tiles),at(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new It("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new It("data",{dataType:"source",sourceDataType:"content"})));}));},e.prototype.loaded=function(){return this._loaded},e.prototype.onAdd=function(t){this.map=t,this.load();},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},e.prototype.serialize=function(){return p({},this._options)},e.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,n=this._options.tileUrlReplace;n&&n.length>=3&&(t.tileID.canonical.replaceX(n[0]),t.tileID.canonical.replaceY(n[1]),t.tileID.canonical.replaceZ(n[2])),t.tileID.canonical.offsetZ(this._options.mapgisOffset);var i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.tileID.canonical.offsetZ(0-this._options.mapgisOffset),t.request=At(this.map._requestManager.transformRequest(i,yt.Tile),(function(n,i){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(n)t.state="errored",e(n);else if(i){r.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var a=r.map.painter.context,o=a.gl;t.texture=r.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new El(a,i,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),t.state="loaded",ht(r.dispatcher),e(null);}}));},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e();},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();},e.prototype.hasTransition=function(){return !1},e}(Ct),ql=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)];};ql.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return ("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},ql.prototype.getUnpackVector=function(){return "terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},ql.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return (e+1)*this.stride+(t+1)},ql.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},ql.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ql.prototype.getPixels=function(){return new vo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ql.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:a=o-1;break;case 1:o=a+1;}for(var s=-e*this.dim,u=-r*this.dim,l=a;l<o;l++)for(var p=n;p<i;p++)this.data[this._idx(p,l)]=t.data[this._idx(p+s,l+u)];},Nn("DEMData",ql);var jl=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r;}};jl.prototype.encode=function(t){return this._stringToNumber[t]},jl.prototype.decode=function(t){return this._numberToString[t]};var Nl=function(t,e,r,n,i,a){this.epsg=a||"EPSG:3857",this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i;},Gl={geometry:{configurable:!0}};Gl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z,this.epsg).geometry),this._geometry},Gl.geometry.set=function(t){this._geometry=t;},Nl.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Nl.prototype,Gl);var Kl=function(){this.state={},this.stateChanges={},this.deletedStates={};};Kl.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o];},Kl.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null;}},Kl.prototype.getState=function(t,e){var r=String(e),n=p({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return {};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return {};for(var a in i)delete n[a];}return n},Kl.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},Kl.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i;}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var u in this.state[o])s[u]={},this.state[o][u]={};else for(var l in this.deletedStates[o]){if(null===this.deletedStates[o][l])this.state[o][l]={};else for(var c=0,h=Object.keys(this.deletedStates[o][l]);c<h.length;c+=1)delete this.state[o][l][h[c]];s[l]=this.state[o][l];}r[o]=r[o]||{},p(r[o],s);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e);};var Xl=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new la,this.promoteId=e;};function Zl(t,e,r,n,i){return g(t,(function(t,a){var o=e instanceof bi?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Jl(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);}return {minX:e,minY:r,maxX:n,maxY:i}}function Yl(t,e){return e-t}Xl.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y);}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&s.insert(o,p[0],p[1],p[2],p[3]);}},Xl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new gs.VectorTile(new Zs(this.rawTileData)).layers,this.sourceLayerCoder=new jl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Xl.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,u=cn(o.filter),l=t.queryGeometry,p=t.queryPadding*s,c=Jl(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=Jl(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var u=s[o];if(e<=u.x&&r<=u.y&&n>=u.x&&a>=u.y)return !0}var l=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1)if(Qa(t,c[p]))return !0;for(var h=0;h<t.length-1;h++)if(to(t[h],t[h+1],l))return !0;return !1}(t.cameraQueryGeometry,e-p,r-p,n+p,a+p)})),d=0,m=y;d<m.length;d+=1)h.push(m[d]);h.sort(Yl);for(var v,g={},x=function(i){var p=h[i];if(p!==v){v=p;var c=a.featureIndexArray.get(p),f=null;a.loadMatchingFeature(g,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,u,o.layers,o.availableImages,e,r,n,(function(e,r,n){return f||(f=qa(e)),r.queryIntersectsFeature(l,e,n,f,a.z,t.transform,s,t.pixelPosMatrix)}));}},b=0;b<h.length;b++)x(b);return g},Xl.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,u,l,p){var c=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(a,c)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(i.filter(new hi(this.tileID.overscaledZ),f))for(var y=this.getId(f,h),d=new Vl(0,0,0),m=0;m<c.length;m++){var v=c[m];if(!(a&&a.indexOf(v)<0)){var g=s[v];if(g){var x={};void 0!==y&&l&&(x=l.getState(g.sourceLayer||"_geojsonTileLayer",y));var b=u[v];b.paint=Zl(b.paint,g.paint,f,x,o),b.layout=Zl(b.layout,g.layout,f,x,o);var _=!p||p(f,g,x);if(_){var w=new Nl(f,this.z,this.x,this.y,y,d.getCRS().getEpsgCode());w.layer=b;var A=t[v];void 0===A&&(A=t[v]=[]),A.push({featureIndex:n,feature:w,intersectionZ:_});}}}}}},Xl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var u={};this.loadVTLayers();for(var l=cn(i),p=0,c=t;p<c.length;p+=1)this.loadMatchingFeature(u,r,n,c[p],l,a,o,s,e);return u},Xl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return !0;return !1},Xl.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Nn("FeatureIndex",Xl,{omit:["rawTileData","sourceLayerCoder"]});var Hl=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading";};Hl.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<L.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e);},Hl.prototype.wasRequested=function(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state},Hl.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1)r[s[o].id]=t;}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof fl){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0;}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof fl&&o.hasRTLText){this.hasRTLText=!0,ci.isLoading()||ci.isLoaded()||"deferred"!==li()||pi();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u));}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage);}else this.collisionBoxArray=new ea;},Hl.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded";},Hl.prototype.getBucket=function(t){return this.buckets[t.id]},Hl.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t);}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new El(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new El(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null);},Hl.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture);},Hl.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*u},t,e,r):{}},Hl.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=cn(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,p=s.y,c={z:u,x:l,y:p},h=0;h<a.length;h++){var f=a.feature(h);if(o.filter(new hi(this.tileID.overscaledZ),f)){var y=r.getId(f,i),d=new Nl(f,u,l,p,y);d.tile=c,t.push(d);}}}},Hl.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},Hl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Hl.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=I(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"]);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else {var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0;}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0;}},Hl.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Hl.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(n);u&&u.paint&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(i)));}}}},Hl.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Hl.prototype.symbolFadeFinished=function(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<L.now()},Hl.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0;},Hl.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=L.now()+t;},Hl.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r;},Hl.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=this.dependencies[n[r]];if(i)for(var a=0,o=e;a<o.length;a+=1)if(i[o[a]])return !0}return !1};var $l=self.performance,Wl=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},$l.mark(this._marks.start);};Wl.prototype.finish=function(){$l.mark(this._marks.end);var t=$l.getEntriesByName(this._marks.measure);return 0===t.length&&($l.measure(this._marks.measure,this._marks.start,this._marks.end),t=$l.getEntriesByName(this._marks.measure),$l.clearMarks(this._marks.start),$l.clearMarks(this._marks.end),$l.clearMeasures(this._marks.measure)),t};var Ql=function(){};Ql.openDatabase=function(t){var e=t.split("/").slice(-1)[0],r=this;return console.log("openDatabase",self),"sqlitePlugin"in self?"device"in self?new Promise((function(t,e){"Android"===device.platform?resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory,(function(e){e.getDirectory("databases",{create:!0},(function(e){t(e);}));}),e):"iOS"===device.platform?resolveLocalFileSystemURL(cordova.file.documentsDirectory,t,e):e("Platform not supported");})).then((function(n){return new Promise((function(t,r){n.getFile(e,{},t,r);})).catch((function(){return r.copyDatabaseFile(t,e,n)}))})).then((function(){var t={name:e};return "iOS"===device.platform?t.iosDatabaseLocation="Documents":t.location="default",sqlitePlugin.openDatabase(t)})):Promise.reject(new Error("cordova-plugin-device not available. Please install the plugin and make sure this code is run after onDeviceReady event")):Promise.reject(new Error("cordova-sqlite-ext plugin not available. Please install the plugin and make sure this code is run after onDeviceReady event"))},Ql.copyDatabaseFile=function(t,e,r){return console.log("Copying database to application storage directory"),new Promise((function(e,r){var n=cordova.file.externalRootDirectory+"/"+t;resolveLocalFileSystemURL(n,e,r);})).then((function(t){return new Promise((function(n,i){t.copyTo(r,e,n,i);})).then((function(){console.log("Database copied");}))}))};var tp=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="rasteroffline",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.imageFormat="png",this._loaded=!1,this._options=p({},r),p(this,c(r,["scheme","tileSize","imageFormat"])),this._transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.db=this.openDatabase(r.path);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return Ql.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,r){return Ql.copyDatabaseFile(t,e,r)},e.prototype.loadTile=function(t,e){t.request=this._getImage(t.tileID.canonical,function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var i=this.map.painter.context,a=i.gl;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new El(i,n,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),t.state="loaded",e(null);}}.bind(this));},e.prototype._getBlob=function(t,e){var r=this,n=Math.pow(2,t.z)-1-t.y,i=[t.z,t.x,n],a="data:image/"+this.imageFormat+";base64,";this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",i,(function(t,n){n.rows.length?e(void 0,{data:a+n.rows.item(0).base64_tile_data,cacheControl:null,expires:null}):(console.error("tile "+i.join(",")+" not found"),e(void 0,{data:r._transparentPngUrl,cacheControl:null,expires:null}));}));}),(function(t){e(t);}));})).catch((function(t){e(t);}));},e.prototype._getImage=function(t,e){return this._getBlob(t,(function(t,r){if(t)return e(t);var n=new window.Image,i=window.URL||window.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src);},n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data;}))},e}(Ul);t.Actor=Ml,t.AlphaImage=mo,t.CRS=Bl,t.CanonicalTileID=Vl,t.CollisionBoxArray=ea,t.Color=Wt,t.DEMData=ql,t.DataConstantProperty=_i,t.Database=Ql,t.DictionaryCoder=jl,t.EXTENT=8192,t.ErrorEvent=zt,t.EvaluationParameters=hi,t.Event=It,t.Evented=Ct,t.FeatureIndex=Xl,t.FillBucket=as,t.FillExtrusionBucket=ws,t.GeoJSONFeature=Nl,t.ImageAtlas=vu,t.ImagePosition=du,t.LineBucket=Ps,t.LngLat=be,t.LngLatBounds=xe,t.MercatorCoordinate=ze,t.ONE_EM=24,t.OverscaledTileID=Fl,t.Point=i,t.Point$1=i,t.Properties=Ii,t.Protobuf=Zs,t.RGBAImage=vo,t.RasterTileSource=Ul,t.RasterTileSourceOffline=tp,t.RequestManager=G,t.RequestPerformance=Wl,t.ResourceType=yt,t.SegmentVector=ca,t.SourceFeatureState=Kl,t.StructArrayLayout1ui2=$i,t.StructArrayLayout2i4=Bi,t.StructArrayLayout3ui6=Yi,t.StructArrayLayout4i8=Vi,t.SymbolBucket=fl,t.Texture=El,t.Tile=Hl,t.TileBounds=Ol,t.Transitionable=di,t.Uniform1f=Aa,t.Uniform1i=wa,t.Uniform2f=Sa,t.Uniform3f=ka,t.Uniform4f=Ia,t.UniformColor=za,t.UniformMatrix4f=Ea,t.UnwrappedTileID=Dl,t.ValidationError=Tt,t.WritingMode=gu,t.ZoomHistory=Yn,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=ll,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i);}));}));},t.bezier=o,t.bindAll=m,t.browser=L,t.cacheEntryPossiblyAdded=ht,t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}));},t.clone=function(t){var e=new so(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},t.clone$1=b,t.clone$2=function(t){var e=new so(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.config=R,t.create=function(){var t=new so(16);return so!=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},t.create$1=function(){var t=new so(9);return so!=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},t.create$2=function(){var t=new so(4);return so!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=$r,t.createLayout=Mi,t.createStyleLayer=function(t){return "custom"===t.type?new wl(t):new Al[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],u=r[2];return t[0]=i*u-a*s,t[1]=a*o-n*u,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return !1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return !1;return !0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return !1;if(Object.keys(e).length!==Object.keys(r).length)return !1;for(var i in e)if(!t(e[i],r[i]))return !1;return !0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=s,t.emitValidationErrors=Ln,t.endsWith=v,t.enforceCacheSizeLimit=function(t){ut(),Q&&Q.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n]);}));}));},t.evaluateSizeForFeature=Vu,t.evaluateSizeForZoom=Du,t.evaluateVariableOffset=el,t.evented=ui,t.extend=p,t.featureFilter=cn,t.filterObject=x,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Eu,t.getAnchorJustification=rl,t.getArrayBuffer=_t,t.getImage=At,t.getJSON=bt,t.getRTLTextPluginStatus=li,t.getReferrer=mt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i);};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o);}return {cancel:function(){}}},t.identity=function(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},t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],p=e[8],c=e[9],h=e[10],f=e[11],y=e[12],d=e[13],m=e[14],v=e[15],g=r*s-n*o,x=r*u-i*o,b=r*l-a*o,_=n*u-i*s,w=n*l-a*s,A=i*l-a*u,S=p*d-c*y,k=p*m-h*y,I=p*v-f*y,z=c*m-h*d,C=c*v-f*d,E=h*v-f*m,T=g*E-x*C+b*z+_*I-w*k+A*S;return T?(t[0]=(s*E-u*C+l*z)*(T=1/T),t[1]=(i*C-n*E-a*z)*T,t[2]=(d*A-m*w+v*_)*T,t[3]=(h*w-c*A-f*_)*T,t[4]=(u*I-o*E-l*k)*T,t[5]=(r*E-i*I+a*k)*T,t[6]=(m*b-y*A-v*x)*T,t[7]=(p*A-h*b+f*x)*T,t[8]=(o*C-s*I+l*S)*T,t[9]=(n*I-r*C-a*S)*T,t[10]=(y*w-d*b+v*g)*T,t[11]=(c*b-p*w-f*g)*T,t[12]=(s*k-o*z-u*S)*T,t[13]=(r*z-n*k+i*S)*T,t[14]=(d*x-y*_-m*g)*T,t[15]=(p*_-c*x+h*g)*T,t):null},t.isChar=Hn,t.isMapboxURL=K,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.loadTileJSON=Rl,t.makeRequest=xt,t.mapObject=g,t.mercatorXfromLng=Ae,t.mercatorYfromLat=Se,t.mercatorZfromAltitude=ke,t.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*c+w*d,t[1]=x*i+b*u+_*h+w*m,t[2]=x*a+b*l+_*f+w*v,t[3]=x*o+b*p+_*y+w*g,t[4]=(x=r[4])*n+(b=r[5])*s+(_=r[6])*c+(w=r[7])*d,t[5]=x*i+b*u+_*h+w*m,t[6]=x*a+b*l+_*f+w*v,t[7]=x*o+b*p+_*y+w*g,t[8]=(x=r[8])*n+(b=r[9])*s+(_=r[10])*c+(w=r[11])*d,t[9]=x*i+b*u+_*h+w*m,t[10]=x*a+b*l+_*f+w*v,t[11]=x*o+b*p+_*y+w*g,t[12]=(x=r[12])*n+(b=r[13])*s+(_=r[14])*c+(w=r[15])*d,t[13]=x*i+b*u+_*h+w*m,t[14]=x*a+b*l+_*f+w*v,t[15]=x*o+b*p+_*y+w*g,t},t.mvt=gs,t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=$e,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),u=1/(n-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(o+a)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Zs(t).readFields(cu,[])},t.pbf=Zs,t.performSymbolLayout=function(t,e,r,n,a,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new hi(c.minZoom),s),l["text-size"].possiblyEvaluate(new hi(h),s)];}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new hi(f.minZoom),s),l["icon-size"].possiblyEvaluate(new hi(y),s)];}p.layoutTextSize=l["text-size"].possiblyEvaluate(new hi(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new hi(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new hi(18));for(var d=24*u.get("text-line-height"),m="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),v=u.get("text-keep-upright"),g=u.get("text-size"),x=function(){var o=_[b],l=u.get("text-font").evaluate(o,{},s).join(","),c=g.evaluate(o,{},s),h=p.layoutTextSize.evaluate(o,{},s),f=p.layoutIconSize.evaluate(o,{},s),y={horizontal:{},vertical:void 0},x=o.text,A=[0,0];if(x){var S=x.toString(),k=24*u.get("text-letter-spacing").evaluate(o,{},s),I=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),Hn.Arabic(n)||Hn["Arabic Supplement"](n)||Hn["Arabic Extended-A"](n)||Hn["Arabic Presentation Forms-A"](n)||Hn["Arabic Presentation Forms-B"](n))return !1;var n;return !0}(S)?k:0,z=u.get("text-anchor").evaluate(o,{},s),C=u.get("text-variable-anchor");if(!C){var E=u.get("text-radial-offset").evaluate(o,{},s);A=E?el(z,[24*E,tl]):u.get("text-offset").evaluate(o,{},s).map((function(t){return 24*t}));}var T=m?"center":u.get("text-justify").evaluate(o,{},s),M=u.get("symbol-placement"),P="point"===M?24*u.get("text-max-width").evaluate(o,{},s):0,B=function(){t.allowVerticalPlacement&&$n(S)&&(y.vertical=_u(x,e,r,a,l,P,d,z,"left",I,A,gu.vertical,!0,M,h,c));};if(!m&&C){for(var V="auto"===T?C.map((function(t){return rl(t)})):[T],D=!1,F=0;F<V.length;F++){var L=V[F];if(!y.horizontal[L])if(D)y.horizontal[L]=y.horizontal[0];else {var R=_u(x,e,r,a,l,P,d,"center",L,I,A,gu.horizontal,!1,M,h,c);R&&(y.horizontal[L]=R,D=1===R.positionedLines.length);}}B();}else {"auto"===T&&(T=rl(z));var O=_u(x,e,r,a,l,P,d,z,T,I,A,gu.horizontal,!1,M,h,c);O&&(y.horizontal[T]=O),B(),$n(S)&&m&&v&&(y.vertical=_u(x,e,r,a,l,P,d,z,T,I,A,gu.vertical,!1,M,h,c));}}var U=void 0,q=!1;if(o.icon&&o.icon.name){var j=n[o.icon.name];j&&(U=function(t,e,r){var n=Eu(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,a=e[1]-t.displaySize[1]*n.verticalAlign;return {image:t,top:a,bottom:a+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(a[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),q=j.sdf,void 0===t.sdfIcons?t.sdfIcons=j.sdf:t.sdfIcons!==j.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(j.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0));}var N=il(y.horizontal)||y.vertical;t.iconsInText=!!N&&N.iconsInText,(N||U)&&function(t,e,r,n,a,o,s,u,l,p,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var f,y=t.layers[0].layout,d=y.get("icon-offset").evaluate(e,{},c),m=il(r.horizontal),v=s/24,g=t.tilePixelRatio*v,x=t.tilePixelRatio*h/24,b=t.tilePixelRatio*u,_=t.tilePixelRatio*y.get("symbol-spacing"),A=y.get("text-padding")*t.tilePixelRatio,S=y.get("icon-padding")*t.tilePixelRatio,k=y.get("text-max-angle")/180*Math.PI,I="map"===y.get("text-rotation-alignment")&&"point"!==y.get("symbol-placement"),z="map"===y.get("icon-rotation-alignment")&&"point"!==y.get("symbol-placement"),C=y.get("symbol-placement"),E=_/2,T=y.get("icon-text-fit");n&&"none"!==T&&(t.allowVerticalPlacement&&r.vertical&&(f=Mu(n,r.vertical,T,y.get("icon-text-fit-padding"),d,v)),m&&(n=Mu(n,m,T,y.get("icon-text-fit-padding"),d,v)));var M=function(i,s){s.x<0||s.x>=8192||s.y<0||s.y>=8192||function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,A,S){var k,I,z,C,E,T=t.addToLineVertexArray(e,r),M=0,P=0,B=0,V=0,D=-1,F=-1,L={},R=da(""),O=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(O=(k=s.layout.get("text-offset").evaluate(b,{},S).map((function(t){return 24*t})))[0],U=k[1]):(O=24*s.layout.get("text-radial-offset").evaluate(b,{},S),U=tl),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(b,{},S)+90;C=new Ju(u,r,e,l,p,c,n.vertical,h,f,y,t.overscaling,q),o&&(E=new Ju(u,r,e,l,p,c,o,m,v,y,t.overscaling,q));}if(i){var j=s.layout.get("icon-rotate").evaluate(b,{}),N="none"!==s.layout.get("icon-text-fit"),G=Nu(i,j,A,N),K=o?Nu(o,j,A,N):void 0;z=new Ju(u,r,e,l,p,c,i,m,v,!1,t.overscaling,j),M=4*G.length;var X=t.iconSizeData,Z=null;"source"===X.kind?(Z=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Z=[128*_.compositeIconSizes[0].evaluate(b,{},S),128*_.compositeIconSizes[1].evaluate(b,{},S)])[0]>32640||Z[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,Z,x,g,b,!1,e,T.lineStartIndex,T.lineLength,-1,S),D=t.icon.placedSymbolArray.length-1,K&&(P=4*K.length,t.addSymbols(t.icon,K,Z,x,g,b,gu.vertical,e,T.lineStartIndex,T.lineLength,-1,S),F=t.icon.placedSymbolArray.length-1);}for(var J in n.horizontal){var Y=n.horizontal[J];if(!I){R=da(Y.text);var H=s.layout.get("text-rotate").evaluate(b,{},S);I=new Ju(u,r,e,l,p,c,Y,h,f,y,t.overscaling,H);}var $=1===Y.positionedLines.length;if(B+=nl(t,e,Y,a,s,y,b,d,T,n.vertical?gu.horizontal:gu.horizontalOnly,$?Object.keys(n.horizontal):[J],L,D,_,S),$)break}n.vertical&&(V+=nl(t,e,n.vertical,a,s,y,b,d,T,gu.vertical,["vertical"],L,F,_,S));var W=I?I.boxStartIndex:t.collisionBoxArray.length,Q=I?I.boxEndIndex:t.collisionBoxArray.length,tt=C?C.boxStartIndex:t.collisionBoxArray.length,et=C?C.boxEndIndex:t.collisionBoxArray.length,rt=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=fl.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,D,F,R,W,Q,tt,et,rt,nt,it,at,l,B,V,M,P,0,h,O,U);}(t,s,i,r,n,a,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,A,I,l,b,S,z,d,e,o,p,c);};if("line"===C)for(var P=0,B=function(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,p=0;p<u.length-1;p++){var c=u[p],h=u[p+1];c.x<0&&h.x<0||(c.x<0?c=new i(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x<0&&(h=new i(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y<0&&h.y<0||(c.y<0?c=new i(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round():h.y<0&&(h=new i(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round()),c.x>=n&&h.x>=n||(c.x>=n?c=new i(n,c.y+(n-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=n&&(h=new i(n,c.y+(n-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=a&&h.y>=a||(c.y>=a?c=new i(c.x+(a-c.y)/(h.y-c.y)*(h.x-c.x),a)._round():h.y>=a&&(h=new i(c.x+(a-c.y)/(h.y-c.y)*(h.x-c.x),a)._round()),l&&c.equals(l[l.length-1])||o.push(l=[c]),l.push(h)))));}return o}(e.geometry,0,0,8192,8192);P<B.length;P+=1)for(var V=B[P],D=0,F=ju(V,_,k,r.vertical||m,n,24,x,t.overscaling,8192);D<F.length;D+=1){var L=F[D];m&&al(t,m.text,E,L)||M(V,L);}else if("line-center"===C)for(var R=0,O=e.geometry;R<O.length;R+=1){var U=O[R];if(U.length>1){var q=qu(U,k,r.vertical||m,n,24,x);q&&M(U,q);}}else if("Polygon"===e.type)for(var j=0,N=es(e.geometry,0);j<N.length;j+=1){var G=N[j],K=$u(G,16);M(G[0],new Pu(K.x,K.y,0));}else if("LineString"===e.type)for(var X=0,Z=e.geometry;X<Z.length;X+=1){var J=Z[X];M(J,new Pu(J[0].x,J[0].y,0));}else if("Point"===e.type)for(var Y=0,H=e.geometry;Y<H.length;Y+=1)for(var $=0,W=H[Y];$<W.length;$+=1){var Q=W[$];M([Q],new Pu(Q.x,Q.y,0));}}(t,o,y,U,n,p,h,f,A,q,s);},b=0,_=t.features;b<_.length;b+=1)x();o&&t.generateCollisionDebugBuffers();},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=c,t.plugin=ci,t.polygonIntersectsPolygon=Ga,t.postMapLoadEvent=at,t.postTurnstileEvent=nt,t.potpack=yu,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Nn,t.registerForPluginStateChange=function(t){return t({pluginStatus:ii,pluginURL:ai}),ui.on("pluginStateChange",t),t},t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=n*-s+a*u,t[3]=i*-s+o*u,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],p=e[9],c=e[10],h=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]=a*i+l*n,t[5]=o*i+p*n,t[6]=s*i+c*n,t[7]=u*i+h*n,t[8]=l*i-a*n,t[9]=p*i-o*n,t[10]=c*i-s*n,t[11]=h*i-u*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],p=e[5],c=e[6],h=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]=a*i+l*n,t[1]=o*i+p*n,t[2]=s*i+c*n,t[3]=u*i+h*n,t[4]=l*i-a*n,t[5]=p*i-o*n,t[6]=c*i-s*n,t[7]=h*i-u*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){ot=t,st=e;},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===ii||"loading"===ii||"loaded"===ii)throw new Error("setRTLTextPlugin cannot be called multiple times.");ai=L.resolveURL(t),ii="deferred",ni=e,si(),r||pi();},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Et,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Fu,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=uo,t.translate=function(t,e,r){var n,i,a,o,s,u,l,p,c,h,f,y,d=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*d+e[4]*m+e[8]*v+e[12],t[13]=e[1]*d+e[5]*m+e[9]*v+e[13],t[14]=e[2]*d+e[6]*m+e[10]*v+e[14],t[15]=e[3]*d+e[7]*m+e[11]*v+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],y=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=p,t[8]=c,t[9]=h,t[10]=f,t[11]=y,t[12]=n*d+s*m+c*v+e[12],t[13]=i*d+u*m+h*v+e[13],t[14]=a*d+l*m+f*v+e[14],t[15]=o*d+p*m+y*v+e[15]),t},t.triggerPluginCompletionEvent=oi,t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Vn,t.validateStyle=Bn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=gs,t.version="16.1.9",t.warnOnce=w,t.webpSupported=O,t.window=self,t.wrap=l;}));
|
|
29
|
+
define(["exports"],(function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n;}n.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s;}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r;}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e;}function o(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s=o(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function l(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function c(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i]);}return r}var h=1;function f(){return h++}function y(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(t){return !!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e));}));}function v(t,e){return -1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?g(t,b):t}var _={};function w(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0);}function A(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function S(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)e+=((o=t[i]).x-(a=t[r]).x)*(a.y+o.y);return e}function k(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function I(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r;}return e}var z=null;function C(t){if(null==z){var e=t.navigator?t.navigator.userAgent:null;z=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return z}function E(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}}var M,T,P,B,V=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),D=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,F=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,L={now:V,frame:function(t){var e=D(t);return {cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=self.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return M||(M=self.document.createElement("a")),M.href=t,M.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return !!self.matchMedia&&(null==T&&(T=self.matchMedia("(prefers-reduced-motion: reduce)")),T.matches)}},R={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},O={supported:!1,testSupport:function(t){!U&&B&&(j?q(t):P=t);}},U=!1,j=!1;function q(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,B),t.isContextLost())return;O.supported=!0;}catch(t){}t.deleteTexture(e),U=!0;}self.document&&((B=self.document.createElement("img")).onload=function(){P&&q(P),P=null,j=!0;},B.onerror=function(){U=!0,P=null;},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var N="01",G=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken();};function K(t){return 0===t.indexOf("mapbox:")}G.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return {token:["1",N,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt;},G.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},G.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},G.prototype.normalizeStyleURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeGlyphsURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSourceURL=function(t,e){if(!K(t))return t;var r=Y(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},G.prototype.normalizeSpriteURL=function(t,e,r,n){var i=Y(t);return K(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,H(i))},G.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!K(t))return t;var r=Y(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(L.devicePixelRatio>=2||512===e?"@2x":"")+(O.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||R.ACCESS_TOKEN;return R.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,n)},G.prototype.canonicalizeTileURL=function(t,e){var r=Y(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return !t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},G.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&K(e),n=[],i=0,a=t.tiles||[];i<a.length;i+=1){var o=a[i];Z(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o);}return n},G.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Y(R.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!R.REQUIRE_ACCESS_TOKEN)return H(t);if(!(e=e||R.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return -1===t.indexOf("access_token")})),t.params.push("access_token="+e),H(t)};var X=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return X.test(t)}var J=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Y(t){var e=t.match(J);if(!e)throw new Error("Unable to parse URL object");return {protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function H(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function $(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(self.atob(e[1]).split("").map((function(t){return "%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var W=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null;};W.prototype.getStorageKey=function(t){var e,r=$(R.ACCESS_TOKEN);return e=r&&r.u?self.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):R.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},W.prototype.fetchEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i);}catch(t){w("Unable to read from LocalStorage");}},W.prototype.saveEventData=function(){var t=E("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){w("Unable to write to LocalStorage");}},W.prototype.processRequests=function(t){},W.prototype.postEvent=function(t,e,r,n){var i=this;if(R.EVENTS_URL){var a=Y(R.EVENTS_URL);a.params.push("access_token="+(n||R.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"16.8.0",skuId:N,userId:this.anonId},s=e?p(o,e):o,u={url:H(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n);}));}},W.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var Q,tt,et=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken="";}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(R.EVENTS_URL&&n||R.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return K(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),d(this.anonId)||(this.anonId=y()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0);}),t));}},e}(W),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){R.EVENTS_URL&&R.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return K(t)||Z(t)}))&&this.queueRequest(Date.now(),e);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=$(R.ACCESS_TOKEN),n=r?r.u:R.ACCESS_TOKEN,i=n!==this.eventData.tokenU;d(this.anonId)||(this.anonId=y(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||o.getDate()!==s.getDate();}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n);}),t);}},e}(W)),nt=rt.postTurnstileEvent.bind(rt),it=new et,at=it.postMapLoadEvent.bind(it),ot=500,st=50;function ut(){self.caches&&!Q&&(Q=self.caches.open("mapbox-tiles"));}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var pt,ct=1/0;function ht(t){++ct>st&&(t.getActor().send("enforceCacheSizeLimit",ot),ct=0);}function ft(){return null==pt&&(pt=self.OffscreenCanvas&&new self.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),pt}var yt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(yt);var dt=function(t){function e(e,r,n){401===r&&Z(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),mt=k()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===self.location.protocol?self.parent:self).location.href};var vt,gt,xt=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(mt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&Z(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&a)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new dt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message));}));}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(n&&s&&function(t,e,r){if(ut(),Q){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=I(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===tt)try{new Response(new ReadableStream),tt=!0;}catch(t){tt=!1;}tt?e(t.body):t.blob().then(e);}(e,(function(e){var r=new self.Response(e,n);ut(),Q&&Q.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return w(t.message)}));})));}}(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((function(t){o||e(new Error(t.message));}));};return s?function(t,e){if(ut(),!Q)return e(null);var r=lt(t.url);Q.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")||0),r=I(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i);})).catch(e);})).catch(e);}(i,u):u(null,null),{cancel:function(){o=!0,a||n.abort();}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new dt(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},bt=function(t,e){return xt(p(t,{type:"json"}),e)},_t=function(t,e){return xt(p(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return xt(p(t,{method:"POST"}),e)};vt=[],gt=0;var At=function(t,e){if(O.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=R.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return vt.push(r),r}gt++;var n=!1,i=function(){if(!n)for(n=!0,gt--;vt.length&><R.MAX_PARALLEL_IMAGE_REQUESTS;){var t=vt.shift();t.cancelled||(t.cancel=At(t.requestParameters,t.callback).cancel);}},a=_t(t,(function(t,r,n,a){i(),t?e(t):r&&(ft()?function(t,e){var r=new self.Blob([new Uint8Array(t)],{type:"image/png"});self.createImageBitmap(r).then((function(t){e(null,t);})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));}));}(r,e):function(t,e,r,n){var i=new self.Image,a=self.URL;i.onload=function(){e(null,i),a.revokeObjectURL(i.src);},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new self.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?a.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";}(r,e,n,a));}));return {cancel:function(){a.cancel(),i();}}};function St(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function kt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}var It=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t;},zt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r));}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(It),Ct=function(){};Ct.prototype.on=function(t,e){return this._listeners=this._listeners||{},St(t,e,this._listeners),this},Ct.prototype.off=function(t,e){return kt(t,e,this._listeners),kt(t,e,this._oneTimeListeners),this},Ct.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},St(t,e,this._oneTimeListeners),this},Ct.prototype.fire=function(t,e){"string"==typeof t&&(t=new It(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];kt(r,s,this._oneTimeListeners),s.call(this,t);}var u=this._eventedParent;u&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t));}else t instanceof zt&&console.error(t.error);return this},Ct.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Et={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},"*":{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"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["宋体","宋体"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#1890ff",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",default:"#ffffff",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#4F4F4F",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Mt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);};function Tt(t){var e=t.value;return e?[new Mt(t.key,e,"constants have been deprecated as of v8")]:[]}function Pt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function Bt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Vt(t){if(Array.isArray(t))return t.map(Vt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Vt(t[r]);return e}return Bt(t)}var Dt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Ft=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1];}};Ft.prototype.concat=function(t){return new Ft(this,t)},Ft.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Ft.prototype.has=function(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Lt={kind:"null"},Rt={kind:"number"},Ot={kind:"string"},Ut={kind:"boolean"},jt={kind:"color"},qt={kind:"object"},Nt={kind:"value"},Gt={kind:"collator"},Kt={kind:"formatted"},Xt={kind:"resolvedImage"};function Zt(t,e){return {kind:"array",itemType:t,N:e}}function Jt(t){if("array"===t.kind){var e=Jt(t.itemType);return "number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Yt=[Lt,Rt,Ot,Ut,jt,Kt,qt,Zt(Nt),Xt];function Ht(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ht(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Yt;r<n.length;r+=1)if(!Ht(n[r],e))return null}return "Expected "+Jt(t)+" but found "+Jt(e)+" instead."}var $t=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return (t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function o(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=a(c[1]),d=a(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [n(255*o(v,m,f+1/3)),n(255*o(v,m,f)),n(255*o(v,m,f-1/3)),h];default:return null}}return null};}catch(t){}})).parseCSSColor,Wt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};Wt.parse=function(t){if(t){if(t instanceof Wt)return t;if("string"==typeof t){var e=$t(t);if(e)return new Wt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Wt.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return "rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},Wt.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Wt.black=new Wt(0,0,0,1),Wt.white=new Wt(1,1,1,1),Wt.transparent=new Wt(0,0,0,0),Wt.red=new Wt(1,0,0,1);var Qt=function(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"});};Qt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Qt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var te=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;},ee=function(t){this.sections=t;};ee.fromString=function(t){return new ee([new te(t,null,null,null,null)])},ee.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ee.factory=function(t){return t instanceof ee?t:ee.fromString(t)},ee.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ee.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else {t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i);}}return t};var re=function(t){this.name=t.name,this.available=t.available;};function ne(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ie(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Wt)return !0;if(t instanceof Qt)return !0;if(t instanceof ee)return !0;if(t instanceof re)return !0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ie(r[e]))return !1;return !0}if("object"==typeof t){for(var n in t)if(!ie(t[n]))return !1;return !0}return !1}function ae(t){if(null===t)return Lt;if("string"==typeof t)return Ot;if("boolean"==typeof t)return Ut;if("number"==typeof t)return Rt;if(t instanceof Wt)return jt;if(t instanceof Qt)return Gt;if(t instanceof ee)return Kt;if(t instanceof re)return Xt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=ae(i[n]);if(e){if(e===a)continue;e=Nt;break}e=a;}return Zt(e||Nt,r)}return qt}function oe(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Wt||t instanceof ee||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return ["image",this.name]};var se=function(t,e){this.type=t,this.value=e;};se.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ie(t[1]))return e.error("invalid value");var r=t[1],n=ae(r),i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new se(n,r)},se.prototype.evaluate=function(){return this.value},se.prototype.eachChild=function(){},se.prototype.outputDefined=function(){return !0},se.prototype.serialize=function(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Wt?["rgba"].concat(this.value.toArray()):this.value instanceof ee?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t;};ue.prototype.toJSON=function(){return this.message};var le={string:Ot,number:Rt,boolean:Ut,object:qt},pe=function(t,e){this.type=t,this.args=e;};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=le[s],n++;}else a=Nt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++;}r=Zt(a,o);}else r=le[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,Nt);if(!l)return null;u.push(l);}return new pe(r,u)},pe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Ht(this.type,ae(r)))return r;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Jt(this.type)+", but found "+Jt(ae(r))+" instead.")}return null},pe.prototype.eachChild=function(t){this.args.forEach(t);},pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},pe.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ce=function(t){this.type=Kt,this.sections=t;};ce.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=t.length-1;++a){var o=t[a];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Rt)))return null;var u=null;if(o["text-font"]&&!(u=e.parse(o["text-font"],1,Zt(Ot))))return null;var l=null;if(o["text-color"]&&!(l=e.parse(o["text-color"],1,jt)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l;}else {var c=e.parse(t[a],1,Nt);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null});}}return new ce(n)},ce.prototype.evaluate=function(t){return new ee(this.sections.map((function(e){var r=e.content.evaluate(t);return ae(r)===Xt?new te("",r,null,null,null):new te(oe(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ce.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor);}},ce.prototype.outputDefined=function(){return !1},ce.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i);}return t};var he=function(t){this.type=Xt,this.input=t;};he.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ot);return r?new he(r):e.error("No image name provided.")},he.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=re.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},he.prototype.eachChild=function(t){t(this.input);},he.prototype.outputDefined=function(){return !1},he.prototype.serialize=function(){return ["image",this.input.serialize()]};var fe={"to-boolean":Ut,"to-color":jt,"to-number":Rt,"to-string":Ot},ye=function(t,e){this.type=t,this.args=e;};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Nt);if(!o)return null;i.push(o);}return new ye(n,i)},ye.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Wt)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ne(e[0],e[1],e[2],e[3])))return new Wt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;s<u.length;s+=1){if(null===(o=u[s].evaluate(t)))return 0;var l=Number(o);if(!isNaN(l))return l}throw new ue("Could not convert "+JSON.stringify(o)+" to number.")}return "formatted"===this.type.kind?ee.fromString(oe(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(oe(this.args[0].evaluate(t))):oe(this.args[0].evaluate(t))},ye.prototype.eachChild=function(t){this.args.forEach(t);},ye.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ye.prototype.serialize=function(){if("formatted"===this.type.kind)return new ce([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new he(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize());})),t};var de=["Unknown","Point","LineString","Polygon"],me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null;};me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?de[this.feature.type]:this.feature.type:null},me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},me.prototype.canonicalID=function(){return this.canonical},me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Wt.parse(t)),e};var ve=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n;};ve.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ve.prototype.eachChild=function(t){this.args.forEach(t);},ve.prototype.outputDefined=function(){return !1},ve.prototype.serialize=function(){return [this.name].concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){var r,n=t[0],i=ve.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(e){var r=e[0];return !Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new Je(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(h)?h[m-1]:h.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x);}if(!d)if(Array.isArray(h)&&h.length!==y.length)u.error("Expected "+h.length+" arguments, but found "+y.length+" instead.");else {for(var b=0;b<y.length;b++){var _=Array.isArray(h)?h[b]:h.type,w=y[b];u.concat(b+1).checkSubtype(_,w.type);}if(0===u.errors.length)return new ve(n,a,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else {for(var A=(s.length?s:o).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Jt).join(", ")+")":"("+Jt(e.type)+"...)"})).join(" | "),S=[],k=1;k<t.length;k++){var I=e.parse(t[k],1+S.length);if(!I)return null;S.push(Jt(I.type));}e.error("Expected arguments of type "+A+", but found ("+S.join(", ")+") instead.");}return null},ve.register=function(t,e){for(var r in ve.definitions=e,e)t[r]=ve;};var ge=function(t,e,r){this.type=Gt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;};ge.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Ut);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Ut);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Ot))?null:new ge(n,i,a)},ge.prototype.evaluate=function(t){return new Qt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ge.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},ge.prototype.outputDefined=function(){return !1},ge.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var xe=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]));};xe.prototype.setNorthEast=function(t){return this._ne=t instanceof be?new be(t.lng,t.lat):be.convert(t),this},xe.prototype.setSouthWest=function(t){return this._sw=t instanceof be?new be(t.lng,t.lat):be.convert(t),this},xe.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof be)e=t,r=t;else {if(!(t instanceof xe))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(xe.convert(t)):this.extend(be.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new be(e.lng,e.lat),this._ne=new be(r.lng,r.lat)),this},xe.prototype.getCenter=function(){return new be((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xe.prototype.getSouthWest=function(){return this._sw},xe.prototype.getNorthEast=function(){return this._ne},xe.prototype.getNorthWest=function(){return new be(this.getWest(),this.getNorth())},xe.prototype.getSouthEast=function(){return new be(this.getEast(),this.getSouth())},xe.prototype.getWest=function(){return this._sw.lng},xe.prototype.getSouth=function(){return this._sw.lat},xe.prototype.getEast=function(){return this._ne.lng},xe.prototype.getNorth=function(){return this._ne.lat},xe.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},xe.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xe.prototype.isEmpty=function(){return !(this._sw&&this._ne)},xe.prototype.contains=function(t){var e=be.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},xe.convert=function(t){return !t||t instanceof xe?t:new xe(t)};var be=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};be.prototype.wrap=function(){return new be(l(this.lng,-180,180),this.lat)},be.prototype.toArray=function(){return [this.lng,this.lat]},be.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},be.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},be.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new xe(new be(this.lng-r,this.lat-e),new be(this.lng+r,this.lat+e))},be.convert=function(t){if(t instanceof be)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new be(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new be(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var _e=2*Math.PI*6371008.8;function we(t){return _e*Math.cos(t*Math.PI/180)}function Ae(t){return (180+t)/360}function Se(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ke(t,e){return t/we(e)}function Ie(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var ze=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};function Ce(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 Ee(t,e){return !(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Me(t,e){var r=ze.fromLngLat({lng:t[0],lat:t[1]},0),n=Math.pow(2,e.z);return [Math.round(r.x*n*8192),Math.round(r.y*n*8192)]}function Te(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 Pe(t,e){for(var r,n,i,a,o,s,u,l=!1,p=0,c=e.length;p<c;p++)for(var h=e[p],f=0,y=h.length;f<y-1;f++){if((a=(r=t)[0]-(n=h[f])[0])*(u=r[1]-(i=h[f+1])[1])-(s=r[0]-i[0])*(o=r[1]-n[1])==0&&a*s<=0&&o*u<=0)return !1;Te(t,h[f],h[f+1])&&(l=!l);}return l}function Be(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return !0;return !1}function Ve(t,e,r,n){var i=n[0]-r[0],a=n[1]-r[1],o=(t[0]-r[0])*a-i*(t[1]-r[1]),s=(e[0]-r[0])*a-i*(e[1]-r[1]);return o>0&&s<0||o<0&&s>0}function De(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(0!=(c=[(p=a[o+1])[0]-(l=a[o])[0],p[1]-l[1]])[0]*(h=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-c[1]*h[0]&&Ve(s,u,l,p)&&Ve(l,p,s,u))return !0;var s,u,l,p,c,h;return !1}function Fe(t,e){for(var r=0;r<t.length;++r)if(!Pe(t[r],e))return !1;for(var n=0;n<t.length-1;++n)if(De(t[n],t[n+1],e))return !1;return !0}function Le(t,e){for(var r=0;r<e.length;r++)if(Fe(t,e[r]))return !0;return !1}function Re(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var a=[],o=0;o<t[i].length;o++){var s=Me(t[i][o],r);Ce(e,s),a.push(s);}n.push(a);}return n}function Oe(t,e,r){for(var n=[],i=0;i<t.length;i++){var a=Re(t[i],e,r);n.push(a);}return n}function Ue(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,a=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===a&&(a=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=a;}Ce(e,t);}function je(t,e,r,n){for(var i=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],o=[],s=0,u=t;s<u.length;s+=1)for(var l=0,p=u[s];l<p.length;l+=1){var c=p[l],h=[c.x+a[0],c.y+a[1]];Ue(h,e,r,i),o.push(h);}return o}function qe(t,e,r,n){for(var i,a=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],u=0,l=t;u<l.length;u+=1){for(var p=[],c=0,h=l[u];c<h.length;c+=1){var f=h[c],y=[f.x+o[0],f.y+o[1]];Ce(e,y),p.push(y);}s.push(p);}if(e[2]-e[0]<=a/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var d=0,m=s;d<m.length;d+=1)for(var v=0,g=m[d];v<g.length;v+=1)Ue(g[v],e,r,a);}return s}ze.fromLngLat=function(t,e){void 0===e&&(e=0);var r=be.convert(t);return new ze(Ae(r.lng),Se(r.lat),ke(e,r.lat))},ze.prototype.toLngLat=function(){return new be(360*this.x-180,Ie(this.y))},ze.prototype.toAltitude=function(){return this.z*we(Ie(this.y))},ze.prototype.meterInMercatorCoordinateUnits=function(){return 1/_e*(t=Ie(this.y),1/Math.cos(t*Math.PI/180));var t;};var Ne=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e;};function Ge(t){if(t instanceof ve){if("get"===t.name&&1===t.args.length)return !1;if("feature-state"===t.name)return !1;if("has"===t.name&&1===t.args.length)return !1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return !1;if(/^filter-/.test(t.name))return !1}if(t instanceof Ne)return !1;var e=!0;return t.eachChild((function(t){e&&!Ge(t)&&(e=!1);})),e}function Ke(t){if(t instanceof ve&&"feature-state"===t.name)return !1;var e=!0;return t.eachChild((function(t){e&&!Ke(t)&&(e=!1);})),e}function Xe(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return !1;var r=!0;return t.eachChild((function(t){r&&!Xe(t,e)&&(r=!1);})),r}Ne.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ie(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Ne(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Ne(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Ne(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ne.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Re(e.coordinates,n,i),o=je(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Pe(u[s],a))return !1}if("MultiPolygon"===e.type){var l=Oe(e.coordinates,n,i),p=je(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var c=0,h=p;c<h.length;c+=1)if(!Be(h[c],l))return !1}return !0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var a=Re(e.coordinates,n,i),o=qe(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var s=0,u=o;s<u.length;s+=1)if(!Fe(u[s],a))return !1}if("MultiPolygon"===e.type){var l=Oe(e.coordinates,n,i),p=qe(t.geometry(),r,n,i);if(!Ee(r,n))return !1;for(var c=0,h=p;c<h.length;c+=1)if(!Le(h[c],l))return !1}return !0}(t,this.geometries)}return !1},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return !0},Ne.prototype.serialize=function(){return ["within",this.geojson]};var Ze=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};Ze.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ze(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ze.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ze.prototype.eachChild=function(){},Ze.prototype.outputDefined=function(){return !1},Ze.prototype.serialize=function(){return ["var",this.name]};var Je=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Ft),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return "["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r;};function Ye(t,e){for(var r,n=t.length-1,i=0,a=n,o=0;i<=a;)if((r=t[o=Math.floor((i+a)/2)])<=e){if(o===n||e<t[o+1])return o;i=o+1;}else {if(!(r>e))throw new ue("Input is not a number.");a=o-1;}return 0}Je.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Je.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new pe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert");}if(!(a instanceof se)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof Ze)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return !1;if(e instanceof ge)return !1;if(e instanceof Ne)return !1;var r=e instanceof ye||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof se;})),!!n&&Ge(e)&&Xe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new me;try{a=new se(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Je.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Je(this.registry,n,e||null,i,this.errors)},Je.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return "["+t+"]"})).join("");this.errors.push(new Dt(n,t));},Je.prototype.checkSubtype=function(t,e){var r=Ht(t,e);return r&&this.error(r),r};var He=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[1];this.labels.push(a[0]),this.outputs.push(o);}};function $e(t,e,r){return t*(1-r)+e*r}He.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Rt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],u=a,l=a+1;if("number"!=typeof o)return e.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 e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([o,p]);}return new He(i,r,n)},He.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ye(e,n)].evaluate(t)},He.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e]);},He.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},He.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var We=Object.freeze({__proto__:null,number:$e,color:function(t,e,r){return new Wt($e(t.r,e.r,r),$e(t.g,e.g,r),$e(t.b,e.b,r),$e(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return $e(t,e[n],r)}))}}),Qe=6/29*3*(6/29),tr=Math.PI/180,er=180/Math.PI;function rr(t){return t>.008856451679035631?Math.pow(t,1/3):t/Qe+4/29}function nr(t){return t>6/29?t*t*t:Qe*(t-4/29)}function ir(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ar(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function or(t){var e=ar(t.r),r=ar(t.g),n=ar(t.b),i=rr((.4124564*e+.3575761*r+.1804375*n)/.95047),a=rr((.2126729*e+.7151522*r+.072175*n)/1);return {l:116*a-16,a:500*(i-a),b:200*(a-rr((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function sr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*nr(e),r=.95047*nr(r),n=1.08883*nr(n),new Wt(ir(3.2404542*r-1.5371385*e-.4985314*n),ir(-.969266*r+1.8760108*e+.041556*n),ir(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function ur(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var lr={forward:or,reverse:sr,interpolate:function(t,e,r){return {l:$e(t.l,e.l,r),a:$e(t.a,e.a,r),b:$e(t.b,e.b,r),alpha:$e(t.alpha,e.alpha,r)}}},pr={forward:function(t){var e=or(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*er;return {h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*tr,r=t.c;return sr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:ur(t.h,e.h,r),c:$e(t.c,e.c,r),l:$e(t.l,e.l,r),alpha:$e(t.alpha,e.alpha,r)}}},cr=Object.freeze({__proto__:null,lab:lr,hcl:pr}),hr=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],u=s[1];this.labels.push(s[0]),this.outputs.push(u);}};function fr(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}hr.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=fr(e,t.base,n,i);else if("linear"===t.name)a=fr(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(fr(e,1,n,i));}return a},hr.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o};}else {if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return "number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Rt)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=jt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<a.length;p+=2){var c=a[p],h=a[p+1],f=p+3,y=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d]);}return "number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new hr(l,r,n,i,u):e.error("Type "+Jt(l)+" is not interpolatable.")},hr.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Ye(e,n),o=hr.interpolationFactor(this.interpolation,n,e[a],e[a+1]),s=r[a].evaluate(t),u=r[a+1].evaluate(t);return "interpolate"===this.operator?We[this.type.kind.toLowerCase()](s,u,o):"interpolate-hcl"===this.operator?pr.reverse(pr.interpolate(pr.forward(s),pr.forward(u),o)):lr.reverse(lr.interpolate(lr.forward(s),lr.forward(u),o))},hr.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e]);},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},hr.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var yr=function(t,e){this.type=t,this.args=e;};yr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=e.parse(o[a],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s);}var u=n&&i.some((function(t){return Ht(n,t.type)}));return new yr(u?Nt:r,i)},yr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(t))&&r instanceof re&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},yr.prototype.eachChild=function(t){this.args.forEach(t);},yr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},yr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize());})),t};var dr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;};dr.prototype.evaluate=function(t){return this.result.evaluate(t)},dr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result);},dr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a]);}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new dr(r,o):null},dr.prototype.outputDefined=function(){return this.result.outputDefined()},dr.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize());}return t.push(this.result.serialize()),t};var mr=function(t,e,r){this.type=t,this.index=e,this.input=r;};mr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Rt),n=e.parse(t[2],2,Zt(e.expectedType||Nt));return r&&n?new mr(n.type.itemType,r,n):null},mr.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ue("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return r[e]},mr.prototype.eachChild=function(t){t(this.index),t(this.input);},mr.prototype.outputDefined=function(){return !1},mr.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var vr=function(t,e){this.type=Ut,this.needle=t,this.haystack=e;};vr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r,n=e.parse(t[1],1,Nt),i=e.parse(t[2],2,Nt);return n&&i?"boolean"!==(r=n.type).kind&&"string"!==r.kind&&"number"!==r.kind&&"null"!==r.kind&&"value"!==r.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+Jt(n.type)+" instead"):new vr(n,i):null},vr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==e||!r)return !1;if(!function(t){return "boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new ue("Expected first argument to be of type boolean, string or number, but found "+Jt(ae(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(r))throw new ue("Expected second argument to be of type array or string, but found "+Jt(ae(r))+" instead.");return r.indexOf(e)>=0},vr.prototype.eachChild=function(t){t(this.needle),t(this.haystack);},vr.prototype.outputDefined=function(){return !0},vr.prototype.serialize=function(){return ["in",this.needle.serialize(),this.haystack.serialize()]};var gr=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a;};gr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],u=t[o+1];Array.isArray(s)||(s=[s]);var l=e.concat(o);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,ae(h)))return null}else r=ae(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=a.length;}var f=e.parse(u,o,n);if(!f)return null;n=n||f.type,a.push(f);}var y=e.parse(t[1],1,Nt);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new gr(r,n,y,i,a,d):null},gr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},gr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},gr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},gr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(c=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[c][1].push(o);}for(var s=function(e){return "number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];e.push(1===h.length?s(h[0]):h.map(s)),e.push(this.outputs[outputIndex$1].serialize());}return e.push(this.otherwise.serialize()),e};var xr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r;};function br(t,e){return "=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function _r(t,e,r,n){return 0===n.compare(e,r)}function wr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Nt);if(!a)return null;if(!br(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Jt(a.type)+"'.");var o=e.parse(t[2],2,Nt);if(!o)return null;if(!br(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Jt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+Jt(a.type)+"' and '"+Jt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new pe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new pe(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Gt)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=ae(a),u=ae(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=ae(a),p=ae(o);if("string"!==l.kind||"string"!==p.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);},i.prototype.outputDefined=function(){return !0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize());})),e},i}()}xr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Ut);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type;}var s=e.parse(t[t.length-1],t.length-1,r);return s?new xr(r,n,s):null},xr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},xr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i);}t(this.otherwise);},xr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},xr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Ar=wr("==",(function(t,e,r){return e===r}),_r),Sr=wr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return !_r(0,e,r,n)})),kr=wr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Ir=wr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),zr=wr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Cr=wr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Er=function(t,e,r,n,i){this.type=Ot,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i;};Er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Rt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ot)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Ot)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Rt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Rt))?null:new Er(r,i,a,o,s)},Er.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Er.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits);},Er.prototype.outputDefined=function(){return !1},Er.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Mr=function(t){this.type=Rt,this.input=t;};Mr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Jt(r.type)+" instead."):new Mr(r):null},Mr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Jt(ae(e))+" instead.")},Mr.prototype.eachChild=function(t){t(this.input);},Mr.prototype.outputDefined=function(){return !1},Mr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize());})),t};var Tr={"==":Ar,"!=":Sr,">":Ir,"<":kr,">=":Cr,"<=":zr,array:pe,at:mr,boolean:pe,case:xr,coalesce:yr,collator:ge,format:ce,image:he,in:vr,interpolate:hr,"interpolate-hcl":hr,"interpolate-lab":hr,length:Mr,let:dr,literal:se,match:gr,number:pe,"number-format":Er,object:pe,step:He,string:pe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ze,within:Ne};function Pr(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=ne(r,n,i,o);if(s)throw new ue(s);return new Wt(r/255*o,n/255*o,i/255*o,o)}function Br(t,e){return t in e}function Vr(t,e){var r=e[t];return void 0===r?null:r}function Dr(t){return {type:t}}function Fr(t){return {result:"success",value:t}}function Lr(t){return {result:"error",value:t}}function Rr(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ur(t){return !!t.expression&&t.expression.interpolated}function jr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function qr(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function Gr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Kr(t,e,r,n,i){return Gr(typeof r===i?n[r]:void 0,t.default,e.default)}function Xr(t,e,r){if("number"!==jr(r))return Gr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ye(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Zr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==jr(r))return Gr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Ye(t.stops.map((function(t){return t[0]})),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],u=t.stops[a+1][1],l=We[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=cr[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),o))};}return "function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,o)}}:l(s,u,o)}function Jr(t,e,r){return "color"===e.type?r=Wt.parse(r):"formatted"===e.type?r=ee.fromString(r.toString()):"resolvedImage"===e.type?r=re.fromString(r.toString()):jr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Gr(r,t.default,e.default)}ve.register(Tr,{error:[{kind:"error"},[Ot],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[Ot,[Nt],function(t,e){return Jt(ae(e[0].evaluate(t)))}],"to-rgba":[Zt(Rt,4),[jt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[jt,[Rt,Rt,Rt],Pr],rgba:[jt,[Rt,Rt,Rt,Rt],Pr],has:{type:Ut,overloads:[[[Ot],function(t,e){return Br(e[0].evaluate(t),t.properties())}],[[Ot,qt],function(t,e){var r=e[1];return Br(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Nt,overloads:[[[Ot],function(t,e){return Vr(e[0].evaluate(t),t.properties())}],[[Ot,qt],function(t,e){var r=e[1];return Vr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Nt,[Ot],function(t,e){return Vr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Ot,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Rt,[],function(t){return t.globals.zoom}],"heatmap-density":[Rt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Rt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Rt,Dr(Rt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Rt,Dr(Rt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Rt,overloads:[[[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Rt],function(t,e){return -e[0].evaluate(t)}]]},"/":[Rt,[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Rt,[Rt,Rt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Rt,[],function(){return Math.LN2}],pi:[Rt,[],function(){return Math.PI}],e:[Rt,[],function(){return Math.E}],"^":[Rt,[Rt,Rt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Rt,[Rt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Rt,[Rt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Rt,[Rt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Rt,[Rt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Rt,[Rt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Rt,[Rt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Rt,[Rt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Rt,Dr(Rt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Rt,Dr(Rt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Rt,[Rt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Rt,[Rt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Rt,[Rt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Rt,[Rt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Ut,[Nt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Ut,[Ot],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Ut,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Ut,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Ut,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Zt(Ot)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Zt(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[Ot,Zt(Nt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Ut,[Ot,Zt(Nt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Dr(Ut),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return !1;return !0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Dr(Ut),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return !0;return !1}]]},"!":[Ut,[Ut],function(t,e){return !e[0].evaluate(t)}],"is-supported-script":[Ut,[Ot],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return !r||r(e[0].evaluate(t))}],upcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ot,Dr(Nt),function(t,e){return e.map((function(e){return oe(e.evaluate(t))})).join("")}],"resolved-locale":[Ot,[Gt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Yr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new me,this._defaultValue=e?function(t){return "color"===t.type&&qr(t.default)?new Wt(0,0,0,0):"color"===t.type?Wt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null;};function Hr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Tr}function $r(t,e){var r=new Je(Tr,[],e?function(t){var e={color:jt,string:Ot,number:Rt,enum:Ot,boolean:Ut,formatted:Kt,resolvedImage:Xt};return "array"===t.type?Zt(e[t.value]||Nt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Fr(new Yr(n,e)):Lr(r.errors)}Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},Yr.prototype.evaluate=function(t,e,r,n,i,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Wr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ke(e.expression);};Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Wr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)};var Qr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ke(e.expression),this.interpolationType=n;};function tn(t,e){if("error"===(t=$r(t,e)).result)return t;var r=t.value.expression,n=Ge(r);if(!n&&!Rr(e))return Lr([new Dt("","data expressions not supported")]);var i=Xe(r,["zoom"]);if(!i&&!Or(e))return Lr([new Dt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof dr)r=t(e.result);else if(e instanceof yr)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else (e instanceof He||e instanceof hr)&&e.input instanceof ve&&"zoom"===e.input.name&&(r=e);return r instanceof Dt||e.eachChild((function(e){var n=t(e);n instanceof Dt?r=n:!r&&n?r=new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));})),r}(r);return a||i?a instanceof Dt?Lr([a]):a instanceof hr&&!Ur(e)?Lr([new Dt("",'"interpolate" expressions cannot be used with this property')]):Fr(a?new Qr(n?"camera":"composite",t.value,a.labels,a instanceof hr?a.interpolation:void 0):new Wr(n?"constant":"source",t.value)):Lr([new Dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,a)},Qr.prototype.evaluate=function(t,e,r,n,i,a){return this._styleExpression.evaluate(t,e,r,n,i,a)},Qr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?hr.interpolationFactor(this.interpolationType,t,e,r):0};var en=function(t,e){this._parameters=t,this._specification=e,Pt(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Ur(r)?"exponential":"interval");if(o&&((e=Pt({},e)).stops&&(e.stops=e.stops.map((function(t){return [t[0],Wt.parse(t[1])]}))),e.default=Wt.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!cr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=Zr;else if("interval"===l)n=Xr;else if("categorical"===l){n=Kr,i=Object.create(null);for(var p=0,c=e.stops;p<c.length;p+=1){var h=c[p];i[h[0]]=h[1];}a=typeof e.stops[0][0];}else {if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=Jr;}if(s){for(var f={},y=[],d=0;d<e.stops.length;d++){var m=e.stops[d],v=m[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},y.push(v)),f[v].stops.push([m[0].value,m[1]]);}for(var g=[],x=0,b=y;x<b.length;x+=1){var _=b[x];g.push([f[_].zoom,t(f[_],r)]);}var w={name:"linear"};return {kind:"composite",interpolationType:w,interpolationFactor:hr.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return Zr({stops:g,base:e.base},r,i).evaluate(i,n)}}}if(u){var A="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return {kind:"camera",interpolationType:A,interpolationFactor:hr.interpolationFactor.bind(void 0,A),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,a)}}}return {kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Gr(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification));};function rn(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],u=jr(r);if("object"!==u)return [new Mt(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=Cn;else if(i["*"])h=i["*"];else {if(!n["*"]){s.push(new Mt(e,r[l],'unknown property "'+l+'"'));continue}h=Cn;}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:l},r));}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Mt(e,r,'missing required property "'+f+'"'));return s}function nn(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||Cn;if("array"!==jr(e))return [new Mt(a,e,"array expected, "+jr(e)+" found")];if(r.length&&e.length!==r.length)return [new Mt(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return [new Mt(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===jr(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(o({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:a+"["+l+"]"}));return u}function an(t){var e=t.key,r=t.value,n=t.valueSpec,i=jr(r);return "number"===i&&r!=r&&(i="NaN"),"number"!==i?[new Mt(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Mt(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Mt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function on(t){var e,r,n,i=t.valueSpec,a=Bt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,l="array"===jr(t.value.stops)&&"array"===jr(t.value.stops[0])&&"object"===jr(t.value.stops[0][0]),p=rn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return [new Mt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(nn({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===jr(r)&&0===r.length&&e.push(new Mt(t.key,r,"array must have at least one stop")),e},default:function(t){return Cn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&p.push(new Mt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||p.push(new Mt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Ur(t.valueSpec)&&p.push(new Mt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Rr(t.valueSpec)?p.push(new Mt(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&p.push(new Mt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!l||void 0!==t.value.property||p.push(new Mt(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],a=t.value,s=t.key;if("array"!==jr(a))return [new Mt(s,a,"array expected, "+jr(a)+" found")];if(2!==a.length)return [new Mt(s,a,"array length 2 expected, length "+a.length+" found")];if(l){if("object"!==jr(a[0]))return [new Mt(s,a,"object expected, "+jr(a[0])+" found")];if(void 0===a[0].zoom)return [new Mt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Mt(s,a,"object stop key must have value")];if(n&&n>Bt(a[0].zoom))return [new Mt(s,a[0].zoom,"stop zoom values must appear in ascending order")];Bt(a[0].zoom)!==n&&(n=Bt(a[0].zoom),r=void 0,o={}),e=e.concat(rn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:an,value:h}}));}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Hr(Vt(a[1]))?e.concat([new Mt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Cn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=jr(t.value),u=Bt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return [new Mt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return [new Mt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var p="number expected, "+s+" found";return Rr(i)&&void 0===a&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Mt(t.key,l,p)]}return "categorical"!==a||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===s&&void 0!==r&&u<r?[new Mt(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===a&&u in o?[new Mt(t.key,l,"stop domain values must be unique")]:(o[u]=!0,[])):[new Mt(t.key,l,"integer expected, found "+u)]}}function sn(t){var e=("property"===t.expressionContext?tn:$r)(Vt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Mt(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return [new Mt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ke(r))return [new Mt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ke(r))return [new Mt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Xe(r,["zoom","feature-state"]))return [new Mt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ge(r))return [new Mt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return []}function un(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Bt(r))&&i.push(new Mt(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Bt(r))&&i.push(new Mt(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function ln(t){if(!0===t||!1===t)return !0;if(!Array.isArray(t)||0===t.length)return !1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!ln(n)&&"boolean"!=typeof n)return !1}return !0;default:return !0}}en.deserialize=function(t){return new en(t._parameters,t._specification)},en.serialize=function(t){return {_parameters:t._parameters,_specification:t._specification}};var pn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function cn(t){if(null==t)return {filter:function(){return !0},needGeometry:!1};ln(t)||(t=fn(t));var e=$r(t,pn);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return {filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:Array.isArray(t)&&0!==t.length&&"within"===t[0]}}function hn(t,e){return t<e?-1:t>e?1:0}function fn(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?yn(t[1],t[2],"=="):"!="===r?vn(yn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?yn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(fn))):"all"===r?["all"].concat(t.slice(1).map(fn)):"none"===r?["all"].concat(t.slice(1).map(fn).map(vn)):"in"===r?dn(t[1],t.slice(2)):"!in"===r?vn(dn(t[1],t.slice(2))):"has"===r?mn(t[1]):"!has"!==r||vn(mn(t[1]))}function yn(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 dn(t,e){if(0===e.length)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((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(hn)]]:["filter-in-small",t,["literal",e]]}}function mn(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function vn(t){return ["!",t]}function gn(t){return ln(Vt(t.value))?sn(Pt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==jr(r))return [new Mt(n,r,"array expected, "+jr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return [new Mt(n,r,"filter array must have at least 1 element")];switch(o=o.concat(un({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Bt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Bt(r[1])&&o.push(new Mt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Mt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=jr(r[1]))&&o.push(new Mt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=jr(r[s]),"$type"===Bt(r[1])?o=o.concat(un({key:n+"["+s+"]",value:r[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new Mt(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)o=o.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=jr(r[1]),2!==r.length?o.push(new Mt(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&o.push(new Mt(n+"[1]",r[1],"string expected, "+i+" found"));}return o}(t)}function xn(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return [];var u=o.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return Cn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[o];if(!p)return [new Mt(r,a,'unknown property "'+o+'"')];if("string"===jr(a)&&Rr(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(a)))return [new Mt(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return "symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&c.push(new Mt(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&qr(Vt(a))&&"identity"===Bt(a.type)&&c.push(new Mt(r,a,'"text-font" does not support identity functions'))),c.concat(Cn({key:t.key,value:a,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function bn(t){return xn(t,"paint")}function _n(t){return xn(t,"layout")}function wn(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new Mt(n,r,'either "type" or "ref" is required'));var o,s=Bt(r.type),u=Bt(r.ref);if(r.id)for(var l=Bt(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];Bt(c.id)===l&&e.push(new Mt(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__));}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Mt(n,r[t],'"'+t+'" is prohibited for ref layers'));})),i.layers.forEach((function(t){Bt(t.id)===u&&(o=t);})),o?o.ref?e.push(new Mt(n,r.ref,"ref cannot reference another ref layer")):s=Bt(o.type):e.push(new Mt(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Bt(h.type);h?"vector"===f&&"raster"===s?e.push(new Mt(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Mt(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Mt(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Mt(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Mt(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Mt(n,r.source,'source "'+r.source+'" not found'));}else e.push(new Mt(n,r,'missing required property "source"'));return e=e.concat(rn({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return []},type:function(){return Cn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:gn,layout:function(t){return rn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return _n(Pt({layerType:s},t))}}})},paint:function(t){return rn({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return bn(Pt({layerType:s},t))}}})}}}))}function An(t){var e=t.value,r=t.key,n=jr(e);return "string"!==n?[new Mt(r,e,"string expected, "+n+" found")]:[]}var Sn={promoteId:function(t){var e=t.key,r=t.value;if("string"===jr(r))return An({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,An({key:e+"."+i,value:r[i]}));return n}};function kn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return [new Mt(r,e,'"type" is required')];var a,o=Bt(e.type);switch(o){case"vector":case"raster":case"raster-dem":return rn({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:Sn});case"geojson":if(a=rn({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Sn}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p="string"==typeof l?[l,["accumulated"],["get",s]]:l;a.push.apply(a,sn({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),a.push.apply(a,sn({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}));}return a;case"video":return rn({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return rn({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return [new Mt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return un({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function In(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=jr(e);if(void 0===e)return a;if("object"!==o)return a.concat([new Mt("light",e,"object expected, "+o+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);a=a.concat(u&&n[u[1]]&&n[u[1]].transition?Cn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Cn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new Mt(s,e[s],'unknown property "'+s+'"')]);}return a}var zn={"*":function(){return []},array:nn,boolean:function(t){var e=t.value,r=t.key,n=jr(e);return "boolean"!==n?[new Mt(r,e,"boolean expected, "+n+" found")]:[]},number:an,color:function(t){var e=t.key,r=t.value,n=jr(r);return "string"!==n?[new Mt(e,r,"color expected, "+n+" found")]:null===$t(r)?[new Mt(e,r,'color expected, "'+r+'" found')]:[]},constants:Tt,enum:un,filter:gn,function:on,layer:wn,object:rn,source:kn,light:In,string:An,formatted:function(t){return 0===An(t).length?[]:sn(t)},resolvedImage:function(t){return 0===An(t).length?[]:sn(t)}};function Cn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&qr(Bt(e))?on(t):r.expression&&Hr(Vt(e))?sn(t):r.type&&zn[r.type]?zn[r.type](t):rn(Pt({},t,{valueSpec:r.type?n[r.type]:r}))}function En(t){var e=t.value,r=t.key,n=An(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Mt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Mt(r,e,'"glyphs" url must include a "{range}" token'))),n}function Mn(t,e){void 0===e&&(e=Et);var r=[];return r=r.concat(Cn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:En,"*":function(){return []}}})),t.constants&&(r=r.concat(Tt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Tn(r)}function Tn(t){return [].concat(t).sort((function(t,e){return t.line-e.line}))}function Pn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Tn(t.apply(this,e))}}Mn.source=Pn(kn),Mn.light=Pn(In),Mn.layer=Pn(wn),Mn.filter=Pn(gn),Mn.paintProperty=Pn(bn),Mn.layoutProperty=Pn(_n);var Bn=Mn,Vn=Bn.light,Dn=Bn.paintProperty,Fn=Bn.layoutProperty;function Ln(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new zt(new Error(i[n].message))),r=!0;return r}var Rn=On;function On(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var a=0;a<this.d*this.d;a++){var o=i[3+a],s=i[3+a+1];n.push(o===s?null:i.subarray(o,s));}var u=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly;}else {this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[];}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p;}On.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);},On.prototype._insertReadonly=function(){throw "Cannot insert into a GridIndex created from an ArrayBuffer."},On.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a);},On.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},On.prototype._queryCell=function(t,e,r,n,i,a,o,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===o[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(o[h]=!0,a.push(l[h])):o[h]=!1;}}},On.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,a,o,s))return}},On.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[3+o]=a,i.set(s,a),a+=s.length;}return i[3+t.length]=a,i.set(this.keys,a),i[3+t.length+1]=a+=this.keys.length,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var Un=self.ImageData,jn=self.ImageBitmap,qn={};function Nn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),qn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]};}for(var Gn in Nn("Object",Object),Rn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},Rn.deserialize=function(t){return new Rn(t.buffer)},Nn("Grid",Rn),Nn("Color",Wt),Nn("Error",Error),Nn("ResolvedImage",re),Nn("StylePropertyFunction",en),Nn("StyleExpression",Yr,{omit:["_evaluator"]}),Nn("ZoomDependentExpression",Qr),Nn("ZoomConstantExpression",Wr),Nn("CompoundExpression",ve,{omit:["_evaluate"]}),Tr)Tr[Gn]._classRegistryKey||Nn("Expression_"+Gn,Tr[Gn]);function Kn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Xn(t){return jn&&t instanceof jn}function Zn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Kn(t)||Xn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Un)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1)n.push(Zn(a[i],e));return n}if("object"==typeof t){var o=t.constructor,s=o._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=o.serialize?o.serialize(t,e):{};if(!o.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(qn[s].omit.indexOf(l)>=0)){var p=t[l];u[l]=qn[s].shallow.indexOf(l)>=0?p:Zn(p,e);}t instanceof Error&&(u.message=t.message);}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Jn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Kn(t)||Xn(t)||ArrayBuffer.isView(t)||t instanceof Un)return t;if(Array.isArray(t))return t.map(Jn);if("object"==typeof t){var e=t.$name||"Object",r=qn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=qn[e].shallow.indexOf(o)>=0?s:Jn(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Yn=function(){this.first=!0;};Yn.prototype.update=function(t,e){var 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))};var Hn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function $n(t){for(var e=0,r=t;e<r.length;e+=1)if(Wn(r[e].charCodeAt(0)))return !0;return !1}function Wn(t){return !(746!==t&&747!==t&&(t<4352||!(Hn["Bopomofo Extended"](t)||Hn.Bopomofo(t)||Hn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hn["CJK Compatibility Ideographs"](t)||Hn["CJK Compatibility"](t)||Hn["CJK Radicals Supplement"](t)||Hn["CJK Strokes"](t)||!(!Hn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hn["CJK Unified Ideographs Extension A"](t)||Hn["CJK Unified Ideographs"](t)||Hn["Enclosed CJK Letters and Months"](t)||Hn["Hangul Compatibility Jamo"](t)||Hn["Hangul Jamo Extended-A"](t)||Hn["Hangul Jamo Extended-B"](t)||Hn["Hangul Jamo"](t)||Hn["Hangul Syllables"](t)||Hn.Hiragana(t)||Hn["Ideographic Description Characters"](t)||Hn.Kanbun(t)||Hn["Kangxi Radicals"](t)||Hn["Katakana Phonetic Extensions"](t)||Hn.Katakana(t)&&12540!==t||!(!Hn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Hn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hn["Unified Canadian Aboriginal Syllabics"](t)||Hn["Unified Canadian Aboriginal Syllabics Extended"](t)||Hn["Vertical Forms"](t)||Hn["Yijing Hexagram Symbols"](t)||Hn["Yi Syllables"](t)||Hn["Yi Radicals"](t))))}function Qn(t){return !(Wn(t)||function(t){return !!(Hn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Hn["Letterlike Symbols"](t)||Hn["Number Forms"](t)||Hn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Hn["Control Pictures"](t)&&9251!==t||Hn["Optical Character Recognition"](t)||Hn["Enclosed Alphanumerics"](t)||Hn["Geometric Shapes"](t)||Hn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hn["CJK Symbols and Punctuation"](t)||Hn.Katakana(t)||Hn["Private Use Area"](t)||Hn["CJK Compatibility Forms"](t)||Hn["Small Form Variants"](t)||Hn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function ti(t){return t>=1424&&t<=2303||Hn["Arabic Presentation Forms-A"](t)||Hn["Arabic Presentation Forms-B"](t)}function ei(t,e){return !(!e&&ti(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hn.Khmer(t))}function ri(t){for(var e=0,r=t;e<r.length;e+=1)if(ti(r[e].charCodeAt(0)))return !0;return !1}var ni=null,ii="unavailable",ai=null,oi=function(t){ni&&ni(t);};function si(){ui.fire(new It("pluginStateChange",{pluginStatus:ii,pluginURL:ai}));}var ui=new Ct,li=function(){return ii},pi=function(){if("deferred"!==ii||!ai)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ii="loading",si(),ai&&_t({url:ai},(function(t){t?oi(t):(ii="loaded",si());}));},ci={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return "loaded"===ii||null!=ci.applyArabicShaping},isLoading:function(){return "loading"===ii},setState:function(t){ii=t.pluginStatus,ai=t.pluginURL;},isParsed:function(){return null!=ci.applyArabicShaping&&null!=ci.processBidirectionalText&&null!=ci.processStyledBidirectionalText},getPluginURL:function(){return ai}},hi=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yn,this.transition={});};hi.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!ei(n[r].charCodeAt(0),e))return !1;return !0}(t,ci.isLoaded())},hi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},hi.prototype.getCrossfadeParameters=function(){var 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}};var fi=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(qr(t))return new en(t,e);if(Hr(t)){var r=tn(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return "string"==typeof t&&"color"===e.type&&(n=Wt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification);};fi.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},fi.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var yi=function(t){this.property=t,this.value=new fi(t,void 0);};yi.prototype.transitioned=function(t,e){return new mi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},yi.prototype.untransitioned=function(){return new mi(this.property,this.value,null,{},0)};var di=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};di.prototype.getValue=function(t){return b(this._values[t].value.value)},di.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new yi(this._values[t].property)),this._values[t].value=new fi(this._values[t].property,null===e?void 0:b(e));},di.prototype.getTransition=function(t){return b(this._values[t].transition)},di.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new yi(this._values[t].property)),this._values[t].transition=b(e)||void 0;},di.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a);}return t},di.prototype.transitioned=function(t,e){for(var r=new vi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a]);}return r},di.prototype.untransitioned=function(){for(var t=new vi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned();}return t};var mi=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);};mi.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(t,e,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return i};var vi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};vi.prototype.possiblyEvaluate=function(t,e){for(var r=new bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].possiblyEvaluate(t,e);}return r},vi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return !0;return !1};var gi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues);};gi.prototype.getValue=function(t){return b(this._values[t].value)},gi.prototype.setValue=function(t,e){this._values[t]=new fi(this._values[t].property,null===e?void 0:b(e));},gi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);}return t},gi.prototype.possiblyEvaluate=function(t,e){for(var r=new bi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].possiblyEvaluate(t,e);}return r};var xi=function(t,e,r){this.property=t,this.value=e,this.parameters=r;};xi.prototype.isConstant=function(){return "constant"===this.value.kind},xi.prototype.constantOr=function(t){return "constant"===this.value.kind?this.value.value:t},xi.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var bi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);};bi.prototype.get=function(t){return this._values[t]};var _i=function(t){this.specification=t;};_i.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},_i.prototype.interpolate=function(t,e,r){var n=We[this.specification.type];return n?n(t,e,r):t};var wi=function(t,e){this.specification=t,this.overrides=e;};wi.prototype.possiblyEvaluate=function(t,e,r,n){return new xi(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},wi.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new xi(this,{kind:"constant",value:void 0},t.parameters);var n=We[this.specification.type];return n?new xi(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},wi.prototype.evaluate=function(t,e,r,n,i,a){return "constant"===t.kind?t.value:t.evaluate(e,r,n,i,a)};var Ai=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new xi(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),a="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,e);return new xi(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var s=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 xi(this,{kind:"constant",value:s},e)}return new xi(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,a){if("source"===t.kind){var o=t.evaluate(e,r,n,i,a);return this._calculate(o,o,o,e)}return "composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(wi),Si=function(t){this.specification=t;};Si.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new hi(Math.floor(e.zoom-1),e)),t.expression.evaluate(new hi(Math.floor(e.zoom),e)),t.expression.evaluate(new hi(Math.floor(e.zoom+1),e)),e)}},Si.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Si.prototype.interpolate=function(t){return t};var ki=function(t){this.specification=t;};ki.prototype.possiblyEvaluate=function(t,e,r,n){return !!t.expression.evaluate(e,null,{},r,n)},ki.prototype.interpolate=function(){return !1};var Ii=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new fi(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new yi(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};Nn("DataDrivenProperty",wi),Nn("DataConstantProperty",_i),Nn("CrossFadedDataDrivenProperty",Ai),Nn("CrossFadedProperty",Si),Nn("ColorRampProperty",ki);var zi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return !0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new gi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new di(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned();}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return "visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Fn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e);},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Dn,"layers."+this.id+".paint."+t,t,e,r))return !1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],a=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||i||this._handleOverridablePaintPropertyUpdate(t,o,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return !1},e.prototype.isHidden=function(t){return !!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e);},e.prototype.serialize=function(){var 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&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return !(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Ln(this,t.call(Bn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Et,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return !1},e.prototype.isTileClipped=function(){return !1},e.prototype.hasOffscreenPass=function(){return !1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof xi&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1},e}(Ct),Ci={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=function(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;},Mi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function Ti(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map((function(t){var i=Ci[t.type].BYTES_PER_ELEMENT,a=r=Pi(r,Math.max(e,i)),o=t.components||1;return n=Math.max(n,i),r+=i*o,{name:t.name,type:t.type,components:o,offset:a}})),size:Pi(r,Math.max(n,e)),alignment:e}}function Pi(t,e){return Math.ceil(t/e)*e}Mi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Mi.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Mi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},Mi.prototype.clear=function(){this.length=0;},Mi.prototype.resize=function(t){this.reserve(t),this.length=t;},Mi.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e);}},Mi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Bi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Mi);Bi.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",Bi);var Vi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Mi);Vi.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Vi);var Di=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Mi);Di.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Di);var Fi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=a,this.uint8[u+7]=o,t},e}(Mi);Fi.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Fi);var Li=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p){var c=9*t,h=18*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=a,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint8[h+16]=l,this.uint8[h+17]=p,t},e}(Mi);Li.prototype.bytesPerElement=18,Nn("StructArrayLayout8ui2ub18",Li);var Ri=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,a,o,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=a,this.uint16[f+5]=o,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(Mi);Ri.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",Ri);var Oi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Mi);Oi.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",Oi);var Ui=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Mi);Ui.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Ui);var ji=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=a,this.int16[h+5]=o,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Mi);ji.prototype.bytesPerElement=24,Nn("StructArrayLayout6i1ul2ui2i24",ji);var qi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Mi);qi.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",qi);var Ni=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Mi);Ni.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",Ni);var Gi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Mi);Gi.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gi);var Ki=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,w,A,S,k,I){var z=30*t,C=15*t;return this.int16[z+0]=e,this.int16[z+1]=r,this.int16[z+2]=n,this.int16[z+3]=i,this.int16[z+4]=a,this.int16[z+5]=o,this.int16[z+6]=s,this.int16[z+7]=u,this.uint16[z+8]=l,this.uint16[z+9]=p,this.uint16[z+10]=c,this.uint16[z+11]=h,this.uint16[z+12]=f,this.uint16[z+13]=y,this.uint16[z+14]=d,this.uint16[z+15]=m,this.uint16[z+16]=v,this.uint16[z+17]=g,this.uint16[z+18]=x,this.uint16[z+19]=b,this.uint16[z+20]=_,this.uint16[z+21]=w,this.uint32[C+11]=A,this.float32[C+12]=S,this.float32[C+13]=k,this.float32[C+14]=I,t},e}(Mi);Ki.prototype.bytesPerElement=60,Nn("StructArrayLayout8i14ui1ul3f60",Ki);var Xi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Mi);Xi.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Xi);var Zi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Mi);Zi.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Zi);var Ji=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Mi);Ji.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Ji);var Yi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Mi);Yi.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",Yi);var Hi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Mi);Hi.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",Hi);var $i=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Mi);$i.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",$i);var Wi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Mi);Wi.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",Wi);var Qi=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Mi);Qi.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",Qi);var ta=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ei);ta.prototype.size=24;var ea=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ta(this,t)},e}(ji);Nn("CollisionBoxArray",ea);var ra=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t;},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t;},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t;},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ei);ra.prototype.size=48;var na=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ra(this,t)},e}(Gi);Nn("PlacedSymbolArray",na);var ia=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t;},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},Object.defineProperties(e.prototype,r),e}(Ei);ia.prototype.size=60;var aa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ia(this,t)},e}(Ki);Nn("SymbolInstanceArray",aa);var oa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Xi);Nn("GlyphOffsetArray",oa);var sa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Zi);Nn("SymbolLineVertexArray",sa);var ua=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ei);ua.prototype.size=8;var la=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ua(this,t)},e}(Ji);Nn("FeatureIndexArray",la);var pa=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,ca=function(t){void 0===t&&(t=[]),this.segments=t;};function ha(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}ca.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>ca.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ca.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>ca.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},ca.prototype.get=function(){return this.segments},ca.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy();}},ca.simpleSegment=function(t,e,r,n){return new ca([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},ca.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Nn("SegmentVector",ca);var fa=e((function(t){t.exports=function(t,e){var r,n,i,a,o,s,u,l;for(n=t.length-(r=3&t.length),i=e,o=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};})),ya=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};})),da=fa,ma=ya;da.murmur3=fa,da.murmur2=ma;var va=function(){this.ids=[],this.positions=[],this.indexed=!1;};va.prototype.add=function(t,e,r,n){this.ids.push(xa(t)),this.positions.push(e,r,n);},va.prototype.getPositions=function(t){for(var e=xa(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1;}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},va.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(!(n>=i)){for(var a=e[n+i>>1],o=n-1,s=i+1;;){do{o++;}while(e[o]<a);do{s--;}while(e[s]>a);if(o>=s)break;ba(e,o,s),ba(r,3*o,3*s),ba(r,3*o+1,3*s+1),ba(r,3*o+2,3*s+2);}t(e,r,n,s),t(e,r,s+1,i);}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},va.deserialize=function(t){var e=new va;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ga=Math.pow(2,53)-1;function xa(t){var e=+t;return !isNaN(e)&&e<=ga?e:da(String(t))}function ba(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}Nn("FeaturePositionMap",va);var _a=function(t,e){this.gl=t.gl,this.location=e;},wa=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t));},e}(_a),Aa=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t));},e}(_a),Sa=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]));},e}(_a),ka=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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]));},e}(_a),Ia=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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]));},e}(_a),za=function(t){function e(e,r){t.call(this,e,r),this.current=Wt.transparent;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(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));},e}(_a),Ca=new Float32Array(16),Ea=function(t){function e(e,r){t.call(this,e,r),this.current=Ca;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(_a);function Ma(t){return [ha(255*t.r,255*t.g),ha(255*t.b,255*t.a)]}var Ta=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return "u_"+t})),this.type=r;};Ta.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value));},Ta.prototype.getBinding=function(t,e,r){return "color"===this.type?new za(t,e):new Aa(t,e)};var Pa=function(t,e){this.uniformNames=e.map((function(t){return "u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1;};Pa.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr;},Pa.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i);},Pa.prototype.getBinding=function(t,e,r){return "u_pattern"===r.substr(0,9)?new Ia(t,e):new Aa(t,e)};var Ba=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n;};Ba.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new hi(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(a,t,o);},Ba.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i);},Ba.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=Ma(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else {for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r));}},Ba.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Ba.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();};var Va=function(t,e,r,n,i,a){this.expression=t,this.uniformNames=e.map((function(t){return "u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a;};Va.prototype.populatePaintArray=function(t,e,r,n,i){var a=this.expression.evaluate(new hi(this.zoom),e,{},n,[],i),o=this.expression.evaluate(new hi(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,a,o);},Va.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,a);},Va.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=Ma(r),a=Ma(n),o=t;o<e;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else {for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n));}},Va.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Va.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();},Va.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=u(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n);},Va.prototype.getBinding=function(t,e,r){return new Aa(t,e)};var Da=function(t,e,r,n,i,a,o){this.expression=t,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=o,this.paintVertexAttributes=e.map((function(t){return {name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a;};Da.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r);},Da.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i);},Da.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=n[r.min],a=n[r.mid],o=n[r.max];if(i&&a&&o)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],a.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,a.tl[0],a.tl[1],a.br[0],a.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],a.pixelRatio,o.pixelRatio);}},Da.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},Da.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy();};var Fa=function(t,e,r,n){this.binders={},this.layoutAttributes=n,this._buffers=[];var i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof xi&&Rr(o.property.specification)){var s=Ra(a,t.type),u=o.value,l=o.property.specification.type,p=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===u.kind)this.binders[a]=h?new Pa(u.value,s):new Ta(u.value,s,l),i.push("/u_"+a);else if("source"===u.kind||h){var f=Oa(a,l,"source");this.binders[a]=h?new Da(u,s,l,p,e,f,t.id):new Ba(u,s,l,f),i.push("/a_"+a);}else {var y=Oa(a,l,"composite");this.binders[a]=new Va(u,s,l,p,e,y),i.push("/z_"+a);}}}this.cacheKey=i.sort().join("");};Fa.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Ba||e instanceof Va?e.maxValue:0},Fa.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof Ba||o instanceof Va||o instanceof Da)&&o.populatePaintArray(t,e,r,n,i);}},Fa.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof Pa&&n.setConstantPatternPositions(t,e);}},Fa.prototype.updatePaintArrays=function(t,e,r,n,i){var a=!1;for(var o in t)for(var s=0,u=e.getPositions(o);s<u.length;s+=1){var l=u[s],p=r.feature(l.index);for(var c in this.binders){var h=this.binders[c];if((h instanceof Ba||h instanceof Va||h instanceof Da)&&!0===h.expression.isStateDependent){var f=n.paint.get(c);h.expression=f.value,h.updatePaintArray(l.start,l.end,p,t[o],i),a=!0;}}}return a},Fa.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Ta||r instanceof Pa)&&t.push.apply(t,r.uniformNames.map((function(t){return "#define HAS_UNIFORM_"+t})));}return t},Fa.prototype.getPaintVertexBuffers=function(){return this._buffers},Fa.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof Ta||i instanceof Pa||i instanceof Va)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var u=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:u});}}}return r},Fa.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,u=o.property;this.binders[u].setUniform(o.binding,n,r.get(u),s);}},Fa.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof Da){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n);}else (r instanceof Ba||r instanceof Va)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer);}},Fa.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Ba||r instanceof Va||r instanceof Da)&&r.upload(t);}this.updatePaintBuffers();},Fa.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ba||e instanceof Va||e instanceof Da)&&e.destroy();}};var La=function(t,e,r,n){void 0===n&&(n=function(){return !0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=new Fa(o,r,n,t);}this.needsUpload=!1,this._featureMap=new va,this._bufferOffset=0;};function Ra(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-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 Oa(t,e,r){var n={color:{source:Wi,composite:Qi},number:{source:Xi,composite:Wi}},i=function(t){return {"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[t]}(t);return i&&i[r]||n[e][r]}La.prototype.populatePaintArrays=function(t,e,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,i,a);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0;},La.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n)||this.needsUpload;}},La.prototype.get=function(t){return this.programConfigurations[t]},La.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}},La.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy();},Nn("ConstantBinder",Ta),Nn("CrossFadedConstantBinder",Pa),Nn("SourceExpressionBinder",Ba),Nn("CrossFadedCompositeBinder",Da),Nn("CompositeExpressionBinder",Va),Nn("ProgramConfiguration",Fa,{omit:["_buffers"]}),Nn("ProgramConfigurationSet",La);var Ua={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function ja(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<Ua.min||o.x>Ua.max||o.y<Ua.min||o.y>Ua.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=u(o.x,Ua.min,Ua.max),o.y=u(o.y,Ua.min,Ua.max));}return r}function qa(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var Na=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Bi,this.indexArray=new Yi,this.segments=new ca,this.programConfigurations=new La(pa,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Ga(t,e){for(var r=0;r<t.length;r++)if(Qa(e,t[r]))return !0;for(var n=0;n<e.length;n++)if(Qa(t,e[n]))return !0;return !!Ja(t,e)}function Ka(t,e,r){return !!Qa(t,e)||!!Ha(e,t,r)}function Xa(t,e){if(1===t.length)return Wa(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Qa(t,n[i]))return !0;for(var a=0;a<t.length;a++)if(Wa(e,t[a]))return !0;for(var o=0;o<e.length;o++)if(Ja(t,e[o]))return !0;return !1}function Za(t,e,r){if(t.length>1){if(Ja(t,e))return !0;for(var n=0;n<e.length;n++)if(Ha(e[n],t,r))return !0}for(var i=0;i<t.length;i++)if(Ha(t[i],e,r))return !0;return !1}function Ja(t,e){if(0===t.length||0===e.length)return !1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(Ya(n,i,e[a],e[a+1]))return !0;return !1}function Ya(t,e,r,n){return A(t,r,n)!==A(e,r,n)&&A(t,e,r)!==A(t,e,n)}function Ha(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if($a(t,e[i-1],e[i])<n)return !0;return !1}function $a(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Wa(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,u=(r=t[o]).length-1;s<r.length;u=s++)(n=r[s]).y>e.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Qa(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r);}return r}function to(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return !1;var a=A(t,e,r[0]);return a!==A(t,e,r[1])||a!==A(t,e,r[2])||a!==A(t,e,r[3])}function eo(t,e,r){var n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ro(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function no(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(o));return s}Na.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=t;o<s.length;o+=1){var u=s[o],l=u.feature,p=u.id,c=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,y={type:l.type,id:p,properties:l.properties,geometry:f?ja(l):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),y,r)){f||(y.geometry=ja(l));var d=a?a.evaluate(y,{},r):void 0;i.push({id:p,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:y.geometry,patterns:{},sortKey:d});}}a&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,v=i;m<v.length;m+=1){var g=v[m],x=g.geometry,b=g.index,_=g.sourceLayerIndex,w=t[b].feature;this.addFeature(g,x,b,r),e.featureIndex.insert(w,x,b,_,this.index);}},Na.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Na.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Na.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Na.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,pa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},Na.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},Na.prototype.addFeature=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var u=s[o],l=u.x,p=u.y;if(!(l<0||l>=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;qa(this.layoutVertexArray,l,p,-1,-1),qa(this.layoutVertexArray,l,p,1,-1),qa(this.layoutVertexArray,l,p,1,1),qa(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2;}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n);},Nn("CircleBucket",Na,{omit:["layers"]});var io,ao=new Ii({"circle-sort-key":new wi(Et.layout_circle["circle-sort-key"])}),oo={paint:new Ii({"circle-radius":new wi(Et.paint_circle["circle-radius"]),"circle-color":new wi(Et.paint_circle["circle-color"]),"circle-blur":new wi(Et.paint_circle["circle-blur"]),"circle-opacity":new wi(Et.paint_circle["circle-opacity"]),"circle-translate":new _i(Et.paint_circle["circle-translate"]),"circle-translate-anchor":new _i(Et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new _i(Et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new _i(Et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new wi(Et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new wi(Et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new wi(Et.paint_circle["circle-stroke-opacity"])}),layout:ao},so="undefined"!=typeof Float32Array?Float32Array:Array;function uo(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),io=new so(3),so!=Float32Array&&(io[0]=0,io[1]=0,io[2]=0),function(){var t=new so(4);so!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0);}();var lo=(function(){var t=new so(2);so!=Float32Array&&(t[0]=0,t[1]=0);}(),function(t){function e(e){t.call(this,e,oo);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Na(t)},e.prototype.queryRadius=function(t){var e=t;return eo("circle-radius",this,e)+eo("circle-stroke-width",this,e)+ro(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var u=no(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return po(t,e)}))}(u,s),h=p?l*o:l,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=p?v:po(v,s),x=h,b=uo([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/b[3]),Ka(c,g,x))return !0}return !1},e}(zi));function po(t,e){var r=uo([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Na);function ho(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function fo(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=ho({},{width:n,height:i},r);yo(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data;}}function yo(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*a,p=((n.y+u)*e.width+n.x)*a,c=0;c<i.width*a;c++)s[p+c]=o[l+c];return e}Nn("HeatmapBucket",co,{omit:["layers"]});var mo=function(t,e){ho(this,t,1,e);};mo.prototype.resize=function(t){fo(this,t,1);},mo.prototype.clone=function(){return new mo({width:this.width,height:this.height},new Uint8Array(this.data))},mo.copy=function(t,e,r,n,i){yo(t,e,r,n,i,1);};var vo=function(t,e){ho(this,t,4,e);};vo.prototype.resize=function(t){fo(this,t,4);},vo.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t;},vo.prototype.clone=function(){return new vo({width:this.width,height:this.height},new Uint8Array(this.data))},vo.copy=function(t,e,r,n,i){yo(t,e,r,n,i,4);},Nn("AlphaImage",mo),Nn("RGBAImage",vo);var go={paint:new Ii({"heatmap-radius":new wi(Et.paint_heatmap["heatmap-radius"]),"heatmap-weight":new wi(Et.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new _i(Et.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ki(Et.paint_heatmap["heatmap-color"]),"heatmap-opacity":new _i(Et.paint_heatmap["heatmap-opacity"])})};function xo(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a);}return new vo({width:256,height:1},r)}var bo=function(t){function e(e){t.call(this,e,go),this._updateColorRamp();}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new co(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp();},e.prototype._updateColorRamp=function(){this.colorRamp=xo(this._transitionablePaint._values["heatmap-color"].value.expression,"heatmapDensity"),this.colorRampTexture=null;},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null);},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(zi),_o={paint:new Ii({"hillshade-illumination-direction":new _i(Et.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new _i(Et.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new _i(Et.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new _i(Et.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new _i(Et.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new _i(Et.paint_hillshade["hillshade-accent-color"])})},wo=function(t){function e(e){t.call(this,e,_o);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(zi),Ao=Ti([{name:"a_pos",components:2,type:"Int16"}],4).members,So=Io,ko=Io;function Io(t,e,r){r=r||2;var n,i,a,o,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=zo(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=zo(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(Ro(o));for(s.sort(Vo),i=0;i<s.length;i++)r=Do(s[i],r);return r}(t,e,h,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var y=r;y<c;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>a&&(a=s),u>o&&(o=u);l=0!==(l=Math.max(a-n,o-i))?32767/l:0;}return Eo(h,f,r,n,i,l,0),f}function zo(t,e,r,n,i){var a,o;if(i===$o(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Jo(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Jo(a,t[a],t[a+1],o);return o&&qo(o,o.next)&&(Yo(o),o=o.next),o}function Co(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!qo(n,n.next)&&0!==jo(n.prev,n,n.next))n=n.next;else {if(Yo(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function Eo(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=Lo(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,u,l=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n;}a.nextZ=null,l*=2;}while(o>1)}(i);}(t,n,i,a);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?To(t,n,i,a):Mo(t))e.push(s.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),Yo(t),t=u.next,l=u.next;else if((t=u)===l){o?1===o?Eo(t=Po(Co(t),e,r),e,r,n,i,a,2):2===o&&Bo(t,e,r,n,i,a):Eo(Co(t),e,r,n,i,a,1);break}}}function Mo(t){var e=t.prev,r=t,n=t.next;if(jo(e,r,n)>=0)return !1;for(var i=e.x,a=r.x,o=n.x,s=e.y,u=r.y,l=n.y,p=i<a?i<o?i:o:a<o?a:o,c=s<u?s<l?s:l:u<l?u:l,h=i>a?i>o?i:o:a>o?a:o,f=s>u?s>l?s:l:u>l?u:l,y=n.next;y!==e;){if(y.x>=p&&y.x<=h&&y.y>=c&&y.y<=f&&Oo(i,s,a,u,o,l,y.x,y.y)&&jo(y.prev,y,y.next)>=0)return !1;y=y.next;}return !0}function To(t,e,r,n){var i=t.prev,a=t,o=t.next;if(jo(i,a,o)>=0)return !1;for(var s=i.x,u=a.x,l=o.x,p=i.y,c=a.y,h=o.y,f=s<u?s<l?s:l:u<l?u:l,y=p<c?p<h?p:h:c<h?c:h,d=s>u?s>l?s:l:u>l?u:l,m=p>c?p>h?p:h:c>h?c:h,v=Lo(f,y,e,r,n),g=Lo(d,m,e,r,n),x=t.prevZ,b=t.nextZ;x&&x.z>=v&&b&&b.z<=g;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==o&&Oo(s,p,u,c,l,h,x.x,x.y)&&jo(x.prev,x,x.next)>=0)return !1;if(x=x.prevZ,b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==o&&Oo(s,p,u,c,l,h,b.x,b.y)&&jo(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}for(;x&&x.z>=v;){if(x.x>=f&&x.x<=d&&x.y>=y&&x.y<=m&&x!==i&&x!==o&&Oo(s,p,u,c,l,h,x.x,x.y)&&jo(x.prev,x,x.next)>=0)return !1;x=x.prevZ;}for(;b&&b.z<=g;){if(b.x>=f&&b.x<=d&&b.y>=y&&b.y<=m&&b!==i&&b!==o&&Oo(s,p,u,c,l,h,b.x,b.y)&&jo(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}return !0}function Po(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!qo(i,a)&&No(i,n,n.next,a)&&Xo(i,a)&&Xo(a,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(a.i/r|0),Yo(n),Yo(n.next),n=t=a),n=n.next;}while(n!==t);return Co(n)}function Bo(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Uo(o,s)){var u=Zo(o,s);return o=Co(o,o.next),u=Co(u,u.next),Eo(o,e,r,n,i,a,0),void Eo(u,e,r,n,i,a,0)}s=s.next;}o=o.next;}while(o!==t)}function Vo(t,e){return t.x-e.x}function Do(t,e){var r=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next;}while(n!==e);if(!r)return null;var u,l=r,p=r.x,c=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&Oo(a<c?i:o,a,p,c,a<c?o:i,a,n.x,n.y)&&(u=Math.abs(a-n.y)/(i-n.x),Xo(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Fo(r,n)))&&(r=n,h=u)),n=n.next;}while(n!==l);return r}(t,e);if(!r)return e;var n=Zo(r,t);return Co(n,n.next),Co(r,r.next)}function Fo(t,e){return jo(t.prev,t,e.prev)<0&&jo(e.next,t,t.next)<0}function Lo(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ro(t){var 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 Oo(t,e,r,n,i,a,o,s){return (i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(r-o)*(e-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function Uo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&No(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(Xo(t,e)&&Xo(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)&&(jo(t.prev,t,e.prev)||jo(t,e.prev,e))||qo(t,e)&&jo(t.prev,t,t.next)>0&&jo(e.prev,e,e.next)>0)}function jo(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function qo(t,e){return t.x===e.x&&t.y===e.y}function No(t,e,r,n){var i=Ko(jo(t,e,r)),a=Ko(jo(t,e,n)),o=Ko(jo(r,n,t)),s=Ko(jo(r,n,e));return i!==a&&o!==s||!(0!==i||!Go(t,r,e))||!(0!==a||!Go(t,n,e))||!(0!==o||!Go(r,t,n))||!(0!==s||!Go(r,e,n))}function Go(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 Ko(t){return t>0?1:t<0?-1:0}function Xo(t,e){return jo(t.prev,t,t.next)<0?jo(t,e,t.next)>=0&&jo(t,t.prev,e)>=0:jo(t,e,t.prev)<0||jo(t,t.next,e)<0}function Zo(t,e){var r=new Ho(t.i,t.x,t.y),n=new Ho(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Jo(t,e,r,n){var i=new Ho(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Yo(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);}function Ho(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1;}function $o(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Wo(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,u=Math.log(o),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(o-l)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/o+p)),Math.min(i,Math.floor(r+(o-s)*l/o+p)),a);}var c=e[r],h=n,f=i;for(Qo(e,n,r),a(e[i],c)>0&&Qo(e,n,i);h<f;){for(Qo(e,h,f),h++,f--;a(e[h],c)<0;)h++;for(;a(e[f],c)>0;)f--;}0===a(e[n],c)?Qo(e,n,f):Qo(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1);}}(t,e,r||0,n||t.length-1,i||ts);}function Qo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function ts(t,e){return t<e?-1:t>e?1:0}function es(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o<r;o++){var s=S(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]));}if(n&&a.push(n),e>1)for(var u=0;u<a.length;u++)a[u].length<=e||(Wo(a[u],e,1,a[u].length-1,rs),a[u]=a[u].slice(0,e));return a}function rs(t,e){return e.area-t.area}function ns(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0);}return i}function is(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var u=s[o],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),h=l.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,a[p=p&&p.name?p.name:p]=!0,a[c]=!0,a[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h};}}return r}Io.deviation=function(t,e,r,n){var i=e&&e.length,a=Math.abs($o(t,0,i?e[0]*r:t.length,r));if(i)for(var o=0,s=e.length;o<s;o++)a-=Math.abs($o(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r));var u=0;for(o=0;o<n.length;o+=3){var l=n[o]*r,p=n[o+1]*r,c=n[o+2]*r;u+=Math.abs((t[l]-t[c])*(t[p+1]-t[l+1])-(t[l]-t[p])*(t[c+1]-t[l+1]));}return 0===a&&0===u?0:Math.abs((u-a)/a)},Io.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&r.holes.push(n+=t[i-1].length);}return r},So.default=ko;var as=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Bi,this.indexArray=new Yi,this.indexArray2=new Hi,this.programConfigurations=new La(Ao,t.layers,t.zoom),this.segments=new ca,this.segments2=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};as.prototype.populate=function(t,e,r){this.hasPattern=ns("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?ja(u):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),f,r)){h||(f.geometry=ja(u));var y=n?n.evaluate(f,{},r,e.availableImages):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y});}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var _=is("fill",this.layers,v,this.zoom,e);this.patternFeatures.push(_);}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index);}},as.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},as.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},as.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},as.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},as.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ao),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0;},as.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy());},as.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=es(e,500);a<o.length;a+=1){for(var s=o[a],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=c.vertexLength,f=[],y=[],d=0,m=s;d<m.length;d+=1){var v=m[d];if(0!==v.length){v!==s[0]&&y.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),f.push(v[0].x),f.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),f.push(v[b].x),f.push(v[b].y);g.vertexLength+=v.length,g.primitiveLength+=v.length;}}for(var _=So(f,y),w=0;w<_.length;w+=3)this.indexArray.emplaceBack(h+_[w],h+_[w+1],h+_[w+2]);c.vertexLength+=u,c.primitiveLength+=_.length/3;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Nn("FillBucket",as,{omit:["layers","patternFeatures"]});var os=new Ii({"fill-sort-key":new wi(Et.layout_fill["fill-sort-key"])}),ss={paint:new Ii({"fill-antialias":new _i(Et.paint_fill["fill-antialias"]),"fill-opacity":new wi(Et.paint_fill["fill-opacity"]),"fill-color":new wi(Et.paint_fill["fill-color"]),"fill-outline-color":new wi(Et.paint_fill["fill-outline-color"]),"fill-translate":new _i(Et.paint_fill["fill-translate"]),"fill-translate-anchor":new _i(Et.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ai(Et.paint_fill["fill-pattern"])}),layout:os},us=function(t){function e(e){t.call(this,e,ss);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);},e.prototype.createBucket=function(t){return new as(t)},e.prototype.queryRadius=function(){return ro(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return Xa(no(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return !0},e}(zi),ls=Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ps=cs;function cs(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(hs,this,e);}function hs(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function fs(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)n+=((r=t[o]).x-(e=t[i]).x)*(e.y+r.y);return n}cs.types=["Unknown","Point","LineString","Polygon"],cs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,u=[];t.pos<r;){if(a<=0){var l=t.readVarint();n=7&l,a=l>>3;}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(o,s));else {if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},cs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<u&&(u=a),a>l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,l]},cs.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=cs.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90];}}switch(this.type){case 1:var c=[];for(n=0;n<u.length;n++)c[n]=u[n][0];p(u=c);break;case 2:for(n=0;n<u.length;n++)p(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],a=0;a<e;a++){var o=fs(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]));}return r&&i.push(r),i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)p(u[n][i]);}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return "id"in this&&(h.id=this.id),h};var ys=ds;function ds(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ms,this,e),this.length=this._features.length;}function ms(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}function vs(t,e,r){if(3===t){var n=new ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}ds.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ps(this._pbf,e,this.extent,this._keys,this._values)};var gs={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e);},VectorTileFeature:ps,VectorTileLayer:ys},xs=gs.VectorTileFeature.types,bs=Math.pow(2,13);function _s(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*bs)+o,i*bs*2,a*bs*2,Math.round(s));}var ws=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Di,this.indexArray=new Yi,this.programConfigurations=new La(ls,t.layers,t.zoom),this.segments=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function As(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}ws.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ns("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,u=a.index,l=a.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,c={type:o.type,id:s,properties:o.properties,geometry:p?ja(o):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),c,r)){var h={id:s,sourceLayerIndex:l,index:u,geometry:p?c.geometry:ja(o),properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(h.id=o.id),this.hasPattern?this.features.push(is("fill-extrusion",this.layers,h,this.zoom,e)):this.addFeature(h,h.geometry,u,r,{}),e.featureIndex.insert(o,h.geometry,u,l,this.index,!0);}}},ws.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},ws.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},ws.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ws.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},ws.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ls),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},ws.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},ws.prototype.addFeature=function(t,e,r,n,i){for(var a=0,o=es(e,500);a<o.length;a+=1){for(var s=o[a],u=0,l=0,p=s;l<p.length;l+=1)u+=p[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=s;h<f.length;h+=1){var y=f[h];if(0!==y.length&&!((P=y).every((function(t){return t.x<0}))||P.every((function(t){return t.x>8192}))||P.every((function(t){return t.y<0}))||P.every((function(t){return t.y>8192}))))for(var d=0,m=0;m<y.length;m++){var v=y[m];if(m>=1){var g=y[m-1];if(!As(v,g)){c.vertexLength+4>ca.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),_s(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),_s(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),_s(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),_s(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var _=c.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),c.vertexLength+=4,c.primitiveLength+=2;}}}}if(c.vertexLength+u>ca.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===xs[t.type]){for(var w=[],A=[],S=c.vertexLength,k=0,I=s;k<I.length;k+=1){var z=I[k];if(0!==z.length){z!==s[0]&&A.push(w.length/2);for(var C=0;C<z.length;C++){var E=z[C];_s(this.layoutVertexArray,E.x,E.y,0,0,1,1,0),w.push(E.x),w.push(E.y);}}}for(var M=So(w,A),T=0;T<M.length;T+=3)this.indexArray.emplaceBack(S+M[T],S+M[T+2],S+M[T+1]);c.primitiveLength+=M.length/3,c.vertexLength+=u;}}var P;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Nn("FillExtrusionBucket",ws,{omit:["layers","features"]});var Ss={paint:new Ii({"fill-extrusion-opacity":new _i(Et["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new wi(Et["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new _i(Et["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new _i(Et["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ai(Et["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new wi(Et["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new wi(Et["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new _i(Et["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ks=function(t){function e(e){t.call(this,e,Ss);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new ws(t)},e.prototype.queryRadius=function(){return ro(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return !0},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,u){var l=no(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(e,r),c=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,n){for(var a=[],o=0,s=t;o<s.length;o+=1){var u=s[o],l=[u.x,u.y,0,1];uo(l,l,e),a.push(new i(l[0]/l[3],l[1]/l[3]));}return a}(l,u),f=function(t,e,r,n){for(var a=[],o=[],s=n[8]*e,u=n[9]*e,l=n[10]*e,p=n[11]*e,c=n[8]*r,h=n[9]*r,f=n[10]*r,y=n[11]*r,d=0,m=t;d<m.length;d+=1){for(var v=[],g=[],x=0,b=m[d];x<b.length;x+=1){var _=b[x],w=_.x,A=_.y,S=n[0]*w+n[4]*A+n[12],k=n[1]*w+n[5]*A+n[13],I=n[2]*w+n[6]*A+n[14],z=n[3]*w+n[7]*A+n[15],C=I+l,E=z+p,M=S+c,T=k+h,P=I+f,B=z+y,V=new i((S+s)/E,(k+u)/E);V.z=C/E,v.push(V);var D=new i(M/B,T/B);D.z=P/B,g.push(D);}a.push(v),o.push(g);}return [a,o]}(n,c,p,u);return function(t,e,r){var n=1/0;Xa(r,e)&&(n=zs(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var u=a[s],l=[u,a[s+1],o[s+1],o[s],u];Ga(r,l)&&(n=Math.min(n,zs(r,l)));}return n!==1/0&&n}(f[0],f[1],h)},e}(zi);function Is(t,e){return t.x*e.x+t.y*e.y}function zs(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var a=e[n],o=t[0],s=r.sub(i),u=a.sub(i),l=o.sub(i),p=Is(s,s),c=Is(s,u),h=Is(u,u),f=Is(l,s),y=Is(l,u),d=p*h-c*c,m=(h*f-c*y)/d,v=(p*y-c*f)/d,g=i.z*(1-m-v)+r.z*m+a.z*v;if(isFinite(g))return g}return 1/0}for(var x=1/0,b=0,_=e;b<_.length;b+=1)x=Math.min(x,_[b].z);return x}var Cs=Ti([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Es=gs.VectorTileFeature.types,Ms=Math.cos(Math.PI/180*37.5),Ts=Math.pow(2,14)/.5,Ps=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Fi,this.indexArray=new Yi,this.programConfigurations=new La(Cs,t.layers,t.zoom),this.segments=new ca,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};Ps.prototype.populate=function(t,e,r){this.hasPattern=ns("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=t;a<o.length;a+=1){var s=o[a],u=s.feature,l=s.id,p=s.index,c=s.sourceLayerIndex,h=this.layers[0]._featureFilter.needGeometry,f={type:u.type,id:l,properties:u.properties,geometry:h?ja(u):[]};if(this.layers[0]._featureFilter.filter(new hi(this.zoom),f,r)){h||(f.geometry=ja(u));var y=n?n.evaluate(f,{},r):void 0;i.push({id:l,properties:u.properties,type:u.type,sourceLayerIndex:c,index:p,geometry:f.geometry,patterns:{},sortKey:y});}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,m=i;d<m.length;d+=1){var v=m[d],g=v.geometry,x=v.index,b=v.sourceLayerIndex;if(this.hasPattern){var _=is("line",this.layers,v,this.zoom,e);this.patternFeatures.push(_);}else this.addFeature(v,g,x,r,{});e.featureIndex.insert(t[x].feature,g,x,b,this.index);}},Ps.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Ps.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,e,r);}},Ps.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ps.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Ps.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Cs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},Ps.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},Ps.prototype.addFeature=function(t,e,r,n,i){for(var a=this.layers[0].layout,o=a.get("line-join").evaluate(t,{}),s=a.get("line-cap"),u=a.get("line-miter-limit"),l=a.get("line-round-limit"),p=0,c=e;p<c.length;p+=1)this.addLine(c[p],t,o,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);},Ps.prototype.addLine=function(t,e,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var o=0;o<t.length-1;o++)this.totalDistance+=t[o].dist(t[o+1]);this.updateScaledDistance();}for(var s="Polygon"===Es[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===r&&(i=1.05);var p,c=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,y=void 0,d=void 0,m=void 0;this.e1=this.e2=-1,s&&(m=t[l].sub(p=t[u-2])._unit()._perp());for(var v=l;v<u;v++)if(!(y=v===u-1?s?t[l+1]:void 0:t[v+1])||!t[v].equals(y)){m&&(d=m),p&&(f=p),p=t[v],m=y?y.sub(p)._unit()._perp():d;var g=(d=d||m).add(m);0===g.x&&0===g.y||g._unit();var x=d.x*m.x+d.y*m.y,b=g.x*m.x+g.y*m.y,_=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),A=b<Ms&&f&&y,S=d.x*m.y-d.y*m.x>0;if(A&&v>l){var k=p.dist(f);if(k>2*c){var I=p.sub(p.sub(f)._mult(c/k)._round());this.updateDistance(f,I),this.addCurrentVertex(I,d,0,0,h),f=I;}}var z=f&&y,C=z?r:s?"butt":n;if(z&&"round"===C&&(_<a?C="miter":_<=2&&(C="fakeround")),"miter"===C&&_>i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_<i&&(C="miter")),f&&this.updateDistance(f,p),"miter"===C)g._mult(_),this.addCurrentVertex(p,g,0,0,h);else if("flipbevel"===C){if(_>100)g=m.mult(-1);else {var E=_*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(E*(S?-1:1));}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h);}else if("bevel"===C||"fakeround"===C){var M=-Math.sqrt(_*_-1),T=S?M:0,P=S?0:M;if(f&&this.addCurrentVertex(p,d,T,P,h),"fakeround"===C)for(var B=Math.round(180*w/Math.PI/20),V=1;V<B;V++){var D=V/B;if(.5!==D){var F=D-.5;D+=D*F*(D-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*F*F+(.848013+x*(.215638*x-1.06021)));}var L=m.sub(d)._mult(D)._add(d)._unit()._mult(S?-1:1);this.addHalfVertex(p,L.x,L.y,!1,S,0,h);}y&&this.addCurrentVertex(p,m,-T,-P,h);}else if("butt"===C)this.addCurrentVertex(p,g,0,0,h);else if("square"===C){var R=f?1:-1;this.addCurrentVertex(p,g,R,R,h);}else "round"===C&&(f&&(this.addCurrentVertex(p,d,0,0,h),this.addCurrentVertex(p,d,1,1,h,!0)),y&&(this.addCurrentVertex(p,m,-1,-1,h,!0),this.addCurrentVertex(p,m,0,0,h)));if(A&&v<u-1){var O=p.dist(y);if(O>2*c){var U=p.add(y.sub(p)._mult(c/O)._round());this.updateDistance(p,U),this.addCurrentVertex(U,m,0,0,h),p=U;}}}}},Ps.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,i),this.addHalfVertex(t,o,s,a,!0,-n,i),this.distance>Ts/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a));},Ps.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&s)<<2,s>>6);var u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u;},Ps.prototype.updateScaledDistance=function(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Ts-1):this.distance;},Ps.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance();},Nn("LineBucket",Ps,{omit:["layers","patternFeatures"]});var Bs=new Ii({"line-cap":new _i(Et.layout_line["line-cap"]),"line-join":new wi(Et.layout_line["line-join"]),"line-miter-limit":new _i(Et.layout_line["line-miter-limit"]),"line-round-limit":new _i(Et.layout_line["line-round-limit"]),"line-sort-key":new wi(Et.layout_line["line-sort-key"])}),Vs={paint:new Ii({"line-opacity":new wi(Et.paint_line["line-opacity"]),"line-color":new wi(Et.paint_line["line-color"]),"line-translate":new _i(Et.paint_line["line-translate"]),"line-translate-anchor":new _i(Et.paint_line["line-translate-anchor"]),"line-width":new wi(Et.paint_line["line-width"]),"line-gap-width":new wi(Et.paint_line["line-gap-width"]),"line-offset":new wi(Et.paint_line["line-offset"]),"line-blur":new wi(Et.paint_line["line-blur"]),"line-dasharray":new Si(Et.paint_line["line-dasharray"]),"line-pattern":new Ai(Et.paint_line["line-pattern"]),"line-gradient":new ki(Et.paint_line["line-gradient"])}),layout:Bs},Ds=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new hi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(wi))(Vs.paint.properties["line-width"].specification);Ds.useIntegerZoom=!0;var Fs=function(t){function e(e){t.call(this,e,Vs);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient();},e.prototype._updateGradient=function(){this.gradient=xo(this._transitionablePaint._values["line-gradient"].value.expression,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Ds.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new Ps(t)},e.prototype.queryRadius=function(t){var e=t,r=Ls(eo("line-width",this,e),eo("line-gap-width",this,e)),n=eo("line-offset",this,e);return r/2+Math.abs(n)+ro(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=no(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),l=s/2*Ls(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),p=this.paint.get("line-offset").evaluate(e,r);return p&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],u=0;u<o.length;u++){var l=o[u],p=o[u+1],c=0===u?n:l.sub(o[u-1])._unit()._perp(),h=u===o.length-1?n:p.sub(l)._unit()._perp(),f=c._add(h)._unit();f._mult(1/(f.x*h.x+f.y*h.y)),s.push(f._mult(e)._add(l));}r.push(s);}return r}(n,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(Qa(t,i[a]))return !0;if(Za(t,i,r))return !0}return !1}(u,n,l)},e.prototype.isTileClipped=function(){return !0},e}(zi);function Ls(t,e){return e>0?e+2*t:t}var Rs=Ti([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Os=Ti([{name:"a_projected_pos",components:3,type:"Float32"}],4),Us=(Ti([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ti([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),js=(Ti([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),qs=Ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function Ns(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ci.applyArabicShaping&&(t=ci.applyArabicShaping(t)),t}(t.text,e,r);})),t}Ti([{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"}]),Ti([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),Ti([{type:"Float32",name:"offsetX"}]),Ti([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Gs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ks=function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,a=f&(1<<-p)-1,f>>=-p,p+=s;p>0;a=256*a+t[e+c],c+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t[e+c],c+=h,p-=8);if(0===a)a=1-l;else {if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=l;}return (f?-1:1)*o*Math.pow(2,a-n)},Xs=function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(1<<l)-1,c=p>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=p?(s=0,o=p):o+c>=1?(s=(e*u-1)*Math.pow(2,i),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;t[r+f]=255&o,f+=y,o/=256,l-=8);t[r+f-y]|=128*d;},Zs=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Hs(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function $s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ws(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function Qs(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function tu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function eu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function ru(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function nu(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function iu(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function au(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r]);}function ou(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r]);}function su(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function uu(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function lu(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function pu(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function cu(t,e,r){1===t&&r.readMessage(hu,e);}function hu(t,e,r){if(3===t){var n=r.readMessage(fu,{}),i=n.width,a=n.height,o=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new mo({width:i+6,height:a+6},n.bitmap),metrics:{width:i,height:a,left:o,top:s,advance:u}});}}function fu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}function yu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w);}t.sort((function(t,e){return e.h-t.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=o.length-1;h>=0;h--){var f=o[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=o.pop();h<o.length&&(o[h]=y);}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(o.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return {w:s,h:u,fill:e/(s*u)||0}}Js.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=uu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=uu(this.buf,this.pos)+4294967296*uu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=uu(this.buf,this.pos)+4294967296*pu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ks(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ks(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return $s(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return $s(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return $s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,r){return Ys.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(o=t[i+2],128==(192&(a=t[i+1]))&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+2],s=t[i+3],128==(192&(a=t[i+1]))&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Js.Bytes)return t.push(this.readVarint(e));var r=Hs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Js.Bytes)return t.push(this.readSVarint());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Js.Bytes)return t.push(this.readBoolean());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Js.Bytes)return t.push(this.readFloat());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Js.Bytes)return t.push(this.readDouble());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed32());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed32());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed64());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed64());var e=Hs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Js.Varint)for(;this.buf[this.pos++]>127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else {if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),lu(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),lu(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),lu(this.buf,-1&t,this.pos),lu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),lu(this.buf,-1&t,this.pos),lu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=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++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ws(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),Xs(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),Xs(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r];},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ws(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Qs,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,tu,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,nu,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,eu,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ru,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,iu,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,au,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ou,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,su,e);},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var du=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,a=e.stretchY,o=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n;},mu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};mu.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},mu.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},mu.tlbr.get=function(){return this.tl.concat(this.br)},mu.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(du.prototype,mu);var vu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=yu(i),o=new vo({width:a.w||1,height:a.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;vo.copy(u.data,o,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data);}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;vo.copy(c.data,o,{x:0,y:0},{x:f,y:y},c.data),vo.copy(c.data,o,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),vo.copy(c.data,o,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),vo.copy(c.data,o,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),vo.copy(c.data,o,{x:0,y:0},{x:f+d,y:y},{width:1,height:m});}this.image=o,this.iconPositions=r,this.patternPositions=n;};vu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new du(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n);}},vu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e);},vu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]});}},Nn("ImagePosition",du),Nn("ImageAtlas",vu);var gu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null;};xu.forText=function(t,e){var r=new xu;return r.scale=t||1,r.fontStack=e,r},xu.forImage=function(t){var e=new xu;return e.imageName=t,e};var bu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;};function _u(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d){var m,v=bu.fromFeature(t,i);c===gu.vertical&&v.verticalizePunctuation();var g=ci.processBidirectionalText,x=ci.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,_=g(v.toString(),Cu(v,l,a,e,n,f,y));b<_.length;b+=1){var w=_[b],A=new bu;A.text=w,A.sections=v.sections;for(var S=0;S<w.length;S++)A.sectionIndex.push(0);m.push(A);}}else if(x){m=[];for(var k=0,I=x(v.text,v.sectionIndex,Cu(v,l,a,e,n,f,y));k<I.length;k+=1){var z=I[k],C=new bu;C.text=z[0],C.sectionIndex=z[1],C.sections=v.sections,m.push(C);}}else m=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s;}return i<n.length&&r.push(t.substring(i,n.length)),r}(v,Cu(v,l,a,e,n,f,y));var E=[],M={positionedLines:E,text:v.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,a,o,s,u,l,p,c){for(var h=0,f=-17,y=0,d=0,m="right"===s?1:"left"===s?0:.5,v=0,g=0,x=i;g<x.length;g+=1){var b=x[g];b.trim();var _=b.getMaxScale(),w=24*(_-1),A={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=A;var S=A.positionedGlyphs,k=0;if(b.length()){for(var I=0;I<b.length();I++){var z=b.getSection(I),C=b.getSectionIndex(I),E=b.getCharCode(I),M=0,T=null,P=null,B=null,V=24,D=!(u===gu.horizontal||!p&&!Wn(E)||p&&(wu[E]||(G=E,Hn.Arabic(G)||Hn["Arabic Supplement"](G)||Hn["Arabic Extended-A"](G)||Hn["Arabic Presentation Forms-A"](G)||Hn["Arabic Presentation Forms-B"](G))));if(z.imageName){var F=n[z.imageName];if(!F)continue;B=z.imageName,t.iconsInText=t.iconsInText||!0,P=F.paddedRect;var L=F.displaySize;z.scale=24*z.scale/c,M=w+(24-L[1]*z.scale),V=(T={width:L[0],height:L[1],left:1,top:-3,advance:D?L[1]:L[0]}).advance;var R=D?L[0]*z.scale-24*_:L[1]*z.scale-24*_;R>0&&R>k&&(k=R);}else {var O=r[z.fontStack],U=O&&O[E];if(U&&U.rect)P=U.rect,T=U.metrics;else {var j=e[z.fontStack],q=j&&j[E];if(!q)continue;T=q.metrics;}M=24*(_-z.scale);}D?(t.verticalizable=!0,S.push({glyph:E,imageName:B,x:h,y:f+M,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:C,metrics:T,rect:P}),h+=V*z.scale+l):(S.push({glyph:E,imageName:B,x:h,y:f+M,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:C,metrics:T,rect:P}),h+=T.advance*z.scale+l);}0!==S.length&&(y=Math.max(h-l,y),Mu(S,0,S.length-1,m,k)),h=0;var N=a*_+k;A.lineOffset=Math.max(k,w),f+=N,d=Math.max(N,d),++v;}else f+=a,++v;}var G,K=f- -17,X=Eu(o),Z=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,a,o,s,u){var l,p=(e-r)*i;l=a!==o?-s*n- -17:(-n*u+.5)*o;for(var c=0,h=t;c<h.length;c+=1)for(var f=0,y=h[c].positionedGlyphs;f<y.length;f+=1){var d=y[f];d.x+=p,d.y+=l;}})(t.positionedLines,m,Z,J,y,d,a,K,i.length),t.top+=-J*K,t.bottom=t.top+K,t.left+=-Z*y,t.right=t.left+y;}(M,e,r,n,m,o,s,u,c,l,h,d),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return !1;return !0}(E)&&M}bu.fromFeature=function(t,e){for(var r=new bu,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e);}return r},bu.prototype.length=function(){return this.text.length},bu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},bu.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},bu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},bu.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Qn(n)&&!Gs[t[r+1]]||i&&Qn(i)&&!Gs[t[r-1]]||!Gs[t[r]]?t[r]:Gs[t[r]];}return e}(this.text);},bu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&wu[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&wu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},bu.prototype.substring=function(t,e){var r=new bu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},bu.prototype.toString=function(){return this.text},bu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},bu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r);},bu.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(xu.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401");}else w("Can't add FormattedSection with an empty image.");},bu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var wu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Au={};function Su(t,e,r,n,i,a){if(e.imageName){var o=n[e.imageName];return o?o.displaySize[0]*e.scale*24/a+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function ku(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Iu(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function zu(t,e,r,n,i,a){for(var o=null,s=ku(e,r,i,a),u=0,l=n;u<l.length;u+=1){var p=l[u],c=ku(e-p.x,r,i,a)+p.badness;c<=s&&(o=p,s=c);}return {index:t,x:e,priorBreak:o,badness:s}}function Cu(t,e,r,n,i,a,o){if("point"!==a)return [];if(!t)return [];for(var s,u=[],l=function(t,e,r,n,i,a){for(var o=0,s=0;s<t.length();s++){var u=t.getSection(s);o+=Su(t.getCharCode(s),u,n,i,e,a);}return o/Math.max(1,Math.ceil(o/r))}(t,e,r,n,i,o),p=t.text.indexOf("")>=0,c=0,h=0;h<t.length();h++){var f=t.getSection(h),y=t.getCharCode(h);if(wu[y]||(c+=Su(y,f,n,i,e,o)),h<t.length()-1){var d=!((s=y)<11904||!(Hn["Bopomofo Extended"](s)||Hn.Bopomofo(s)||Hn["CJK Compatibility Forms"](s)||Hn["CJK Compatibility Ideographs"](s)||Hn["CJK Compatibility"](s)||Hn["CJK Radicals Supplement"](s)||Hn["CJK Strokes"](s)||Hn["CJK Symbols and Punctuation"](s)||Hn["CJK Unified Ideographs Extension A"](s)||Hn["CJK Unified Ideographs"](s)||Hn["Enclosed CJK Letters and Months"](s)||Hn["Halfwidth and Fullwidth Forms"](s)||Hn.Hiragana(s)||Hn["Ideographic Description Characters"](s)||Hn["Kangxi Radicals"](s)||Hn["Katakana Phonetic Extensions"](s)||Hn.Katakana(s)||Hn["Vertical Forms"](s)||Hn["Yi Radicals"](s)||Hn["Yi Syllables"](s)));(Au[y]||d||f.imageName)&&u.push(zu(h+1,c,l,u,Iu(y,t.getCharCode(h+1),d&&p),!1));}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(zu(t.length(),c,l,u,0,!0))}function Eu(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;}return {horizontalAlign:e,verticalAlign:r}}function Mu(t,e,r,n,i){if(n||i)for(var a=t[r],o=(t[r].x+a.metrics.advance*a.scale)*n,s=e;s<=r;s++)t[s].x-=o,t[s].y+=i;}function Tu(t,e,r,n,i,a){var o,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;o=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l];}var p,c,h,f,y=e.left*a,d=e.right*a;"width"===r||"both"===r?(f=i[0]+y-n[3],c=i[0]+d+n[1]):c=(f=i[0]+(y+d-s.displaySize[0])/2)+s.displaySize[0];var m=e.top*a,v=e.bottom*a;return "height"===r||"both"===r?(p=i[1]+m-n[0],h=i[1]+v+n[2]):h=(p=i[1]+(m+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:p,right:c,bottom:h,left:f,collisionPadding:o}}Au[10]=!0,Au[32]=!0,Au[38]=!0,Au[40]=!0,Au[41]=!0,Au[43]=!0,Au[45]=!0,Au[47]=!0,Au[173]=!0,Au[183]=!0,Au[8203]=!0,Au[8208]=!0,Au[8211]=!0,Au[8231]=!0;var Pu=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);function Bu(t,e){var r=e.expression;if("constant"===r.kind)return {kind:"constant",layoutSize:r.evaluate(new hi(t+1))};if("source"===r.kind)return {kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],u=n[o];return "composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new hi(s)),maxSize:r.evaluate(new hi(u)),interpolationType:i}}function Vu(t,e,r){var n=e.uSize,i=r.lowerSize;return "source"===t.kind?i/128:"composite"===t.kind?$e(i/128,r.upperSize/128,e.uSizeT):n}function Du(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=i?u(hr.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=$e(t.minSize,t.maxSize,a):r=a;}return {uSizeT:r,uSize:n}}Nn("Anchor",Pu);var Fu=Object.freeze({__proto__:null,getSizeData:Bu,evaluateSizeForFeature:Vu,evaluateSizeForZoom:Du,SIZE_PACK_FACTOR:128});function Lu(t,e,r,n,i){if(void 0===e.segment)return !0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return !1;s-=t[o].dist(a),a=t[o];}s+=t[o].dist(t[o+1]),o++;for(var u=[],l=0;s<r/2;){var p=t[o],c=t[o+1];if(!c)return !1;var h=t[o-1].angleTo(p)-p.angleTo(c);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:h}),l+=h;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return !1;o++,s+=p.dist(c);}return !0}function Ru(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Ou(t,e,r){return t?.6*e*r:0}function Uu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function ju(t,e,r,n,i,a){for(var o=Ou(r,i,a),s=Uu(r,n)*a,u=0,l=Ru(t)/2,p=0;p<t.length-1;p++){var c=t[p],h=t[p+1],f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=$e(c.x,h.x,y),m=$e(c.y,h.y,y),v=new Pu(d,m,h.angleTo(c),p);return v._round(),!o||Lu(t,v,s,o,e)?v:void 0}u+=f;}}function qu(t,e,r,n,i,a,o,s,u){var l=Ou(n,a,o),p=Uu(n,i),c=p*o,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,a,o,s,u,l){for(var p=o/2,c=Ru(e),h=0,f=r-n,y=[],d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,_=$e(m.x,v.x,b),w=$e(m.y,v.y,b);if(_>=0&&_<l&&w>=0&&w<l&&f-p>=0&&f+p<=c){var A=new Pu(_,w,x,d);A._round(),i&&!Lu(e,A,o,i,a)||y.push(A);}}h+=g;}return u||y.length||s||(y=t(e,h/2,n,i,a,o,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*a)*o*s%e,e,l,r,c,h,!1,u)}function Nu(t,e,r,n){var a=[],o=t.image,s=o.pixelRatio,u=o.paddedRect.w-2,l=o.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=o.stretchX||[[0,u]],f=o.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,_=0,w=m,A=0,S=v,k=0,I=g;if(o.content&&n){var z=o.content;x=Gu(h,0,z[0]),_=Gu(f,0,z[1]),b=Gu(h,z[0],z[2]),w=Gu(f,z[1],z[3]),A=z[0]-x,k=z[1]-_,S=z[2]-z[0]-b,I=z[3]-z[1]-w;}var C=function(n,a,u,l){var h=Xu(n.stretch-x,b,p,t.left),f=Zu(n.fixed-A,S,n.stretch,d),y=Xu(a.stretch-_,w,c,t.top),v=Zu(a.fixed-k,I,a.stretch,m),g=Xu(u.stretch-x,b,p,t.left),z=Zu(u.fixed-A,S,u.stretch,d),C=Xu(l.stretch-_,w,c,t.top),E=Zu(l.fixed-k,I,l.stretch,m),M=new i(h,y),T=new i(g,y),P=new i(g,C),B=new i(h,C),V=new i(f/s,v/s),D=new i(z/s,E/s),F=e*Math.PI/180;if(F){var L=Math.sin(F),R=Math.cos(F),O=[R,-L,L,R];M._matMult(O),T._matMult(O),B._matMult(O),P._matMult(O);}var U=n.stretch+n.fixed,j=a.stretch+a.fixed;return {tl:M,tr:T,bl:B,br:P,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+j,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:V,pixelOffsetBR:D,minFontScaleX:S/s/p,minFontScaleY:I/s/c,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var E=Ku(h,v,d),M=Ku(f,g,m),T=0;T<E.length-1;T++)for(var P=E[T],B=E[T+1],V=0;V<M.length-1;V++)a.push(C(P,M[V],B,M[V+1]));else a.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return a}function Gu(t,e,r){for(var n=0,i=0,a=t;i<a.length;i+=1){var o=a[i];n+=Math.max(e,Math.min(r,o[1]))-Math.max(e,Math.min(r,o[0]));}return n}function Ku(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o[0],u=o[1],l=n[n.length-1];n.push({fixed:s-l.stretch,stretch:l.stretch}),n.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)});}return n.push({fixed:e+1,stretch:r}),n}function Xu(t,e,r,n){return t/e*r+n}function Zu(t,e,r,n){return t-e*r/n}var Ju=function(t,e,r,n,a,o,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l,v=s.collisionPadding;if(v&&(d-=v[0]*u,f-=v[1]*u,m+=v[2]*u,y+=v[3]*u),this.boxStartIndex=t.length,p){var g=y-f,x=m-d;g>0&&(g=Math.max(10*u,g),this._addLineCollisionCircles(t,e,r,r.segment,x,g,n,a,o,c));}else {if(h){var b=new i(d,f),_=new i(m,f),w=new i(d,y),A=new i(m,y),S=h*Math.PI/180;b._rotate(S),_._rotate(S),w._rotate(S),A._rotate(S),d=Math.min(b.x,_.x,w.x,A.x),m=Math.max(b.x,_.x,w.x,A.x),f=Math.min(b.y,_.y,w.y,A.y),y=Math.max(b.y,_.y,w.y,A.y);}t.emplaceBack(r.x,r.y,d,f,m,y,n,a,o,0,0);}this.boxEndIndex=t.length;};Ju.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,u,l){var p=a/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-a/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m];}while(v>x);for(var b=e[m].dist(e[m+1]),_=-f;_<c+f;_++){var w=_*p,A=g+w;if(w<0&&(A+=w),w>i&&(A+=w-i),!(A<v)){for(;v+b<A;){if(v+=b,1+ ++m>=e.length)return;b=e[m].dist(e[m+1]);}var S=A-v,k=e[m],I=e[m+1].sub(k)._unit()._mult(S)._add(k)._round(),z=Math.abs(A-y)<p?0:.8*(A-y);t.emplaceBack(I.x,I.y,-a/2,-a/2,a/2,a/2,o,s,u,a/2,z);}}};var Yu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Hu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);};function Hu(t,e){return t<e?-1:t>e?1:0}function $u(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<n)&&(n=p.x),(!l||p.y<a)&&(a=p.y),(!l||p.x>o)&&(o=p.x),(!l||p.y>s)&&(s=p.y);}var c=Math.min(o-n,s-a),h=c/2,f=new Yu([],Wu);if(0===c)return new i(n,a);for(var y=n;y<o;y+=c)for(var d=a;d<s;d+=c)f.push(new Qu(y+h,d+h,h,t));for(var m=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var u=i[a],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p;}return new Qu(r/e,n/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>m.d||!m.d)&&(m=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Qu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Qu(g.p.x+h,g.p.y-h,h,t)),f.push(new Qu(g.p.x-h,g.p.y+h,h,t)),f.push(new Qu(g.p.x+h,g.p.y+h,h,t)),v+=4);}return r&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Wu(t,e){return e.max-t.max}function Qu(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,u=s-1;o<s;u=o++){var l=a[o],p=a[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,$a(t,l,p));}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}Yu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},Yu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Yu.prototype.peek=function(){return this.data[0]},Yu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i;}e[t]=n;},Yu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a;}e[t]=i;};var tl=Number.POSITIVE_INFINITY;function el(t,e){return e[1]!==tl?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r;}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e;}return [n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7;}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e;}return [r,n]}(t,e[0])}function rl(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 nl(t,e,r,n,a,o,s,u,l,p,c,h,f,y,d){var m=function(t,e,r,n,a,o,s,u){for(var l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,p=[],c=0,h=e.positionedLines;c<h.length;c+=1)for(var f=h[c],y=0,d=f.positionedGlyphs;y<d.length;y+=1){var m=d[y];if(m.rect){var v=m.rect||{},g=4,x=!0,b=1,_=0,w=(a||u)&&m.vertical,A=m.metrics.advance*m.scale/2;if(u&&e.verticalizable&&(_=f.lineOffset/2-(m.imageName?-(24-m.metrics.width*m.scale)/2:24*(m.scale-1))),m.imageName){var S=s[m.imageName];x=S.sdf,g=1/(b=S.pixelRatio);}var k=a?[m.x+A,m.y]:[0,0],I=a?[0,0]:[m.x+A+r[0],m.y+r[1]-_],z=[0,0];w&&(z=I,I=[0,0]);var C=(m.metrics.left-g)*m.scale-A+I[0],E=(-m.metrics.top-g)*m.scale+I[1],M=C+v.w*m.scale/b,T=E+v.h*m.scale/b,P=new i(C,E),B=new i(M,E),V=new i(C,T),D=new i(M,T);if(w){var F=new i(-A,A- -17),L=-Math.PI/2,R=12-A,O=new i(22-R,-(m.imageName?R:0)),U=new(Function.prototype.bind.apply(i,[null].concat(z)));P._rotateAround(L,F)._add(O)._add(U),B._rotateAround(L,F)._add(O)._add(U),V._rotateAround(L,F)._add(O)._add(U),D._rotateAround(L,F)._add(O)._add(U);}if(l){var j=Math.sin(l),q=Math.cos(l),N=[q,-j,j,q];P._matMult(N),B._matMult(N),V._matMult(N),D._matMult(N);}var G=new i(0,0),K=new i(0,0);p.push({tl:P,tr:B,bl:V,br:D,tex:v,writingMode:e.writingMode,glyphOffset:k,sectionIndex:m.sectionIndex,isSDF:x,pixelOffsetTL:G,pixelOffsetBR:K,minFontScaleX:0,minFontScaleY:0});}}return p}(0,r,u,a,o,s,n,t.allowVerticalPlacement),v=t.textSizeData,g=null;"source"===v.kind?(g=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*y.compositeTextSizes[0].evaluate(s,{},d),128*y.compositeTextSizes[1].evaluate(s,{},d)])[0]>32640||g[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,o,s,p,e,l.lineStartIndex,l.lineLength,f,d);for(var x=0,b=c;x<b.length;x+=1)h[b[x]]=t.text.placedSymbolArray.length-1;return 4*m.length}function il(t){for(var e in t)return t[e];return null}function al(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return !0}else i[e]=[];return i[e].push(n),!1}var ol=gs.VectorTileFeature.types,sl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ul(t,e,r,n,i,a,o,s,u,l,p,c,h){var f=s?Math.min(32640,Math.round(s[0])):0,y=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,(f<<1)+(u?1:0),y,16*l,16*p,256*c,256*h);}function ll(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 pl(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(ri(r[e].text))return !0;return !1}var cl=function(t){this.layoutVertexArray=new Ri,this.indexArray=new Yi,this.programConfigurations=t,this.segments=new ca,this.dynamicLayoutVertexArray=new Oi,this.opacityVertexArray=new Ui,this.placedSymbolArray=new na;};cl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},cl.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Rs.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Os.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,sl,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t));},cl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());},Nn("SymbolBuffers",cl);var hl=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ca,this.collisionVertexArray=new Ni;};hl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Us.members,!0);},hl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());},Nn("CollisionBuffers",hl);var fl=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[];var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Bu(this.zoom,e["text-size"]),this.iconSizeData=Bu(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return gu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID;};fl.prototype.createArrays=function(){this.text=new cl(new La(Rs.members,this.layers,this.zoom,(function(t){return /^text/.test(t)}))),this.icon=new cl(new La(Rs.members,this.layers,this.zoom,(function(t){return /^icon/.test(t)}))),this.glyphOffsetArray=new oa,this.lineVertexArray=new sa,this.symbolInstances=new aa;},fl.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=Gs[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0);}},fl.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),u=("constant"!==o.value.kind||o.value.value instanceof ee&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new hi(this.zoom),d=0,m=t;d<m.length;d+=1){var v=m[d],g=v.feature,x=v.id,b=v.index,_=v.sourceLayerIndex,w=n._featureFilter.needGeometry,A={type:g.type,id:x,properties:g.properties,geometry:w?ja(g):[]};if(n._featureFilter.filter(y,A,r)){w||(A.geometry=ja(g));var S=void 0;if(u){var k=n.getValueAndResolveTokens("text-field",A,r,f),I=ee.factory(k);pl(I)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===li()||this.hasRTLText&&ci.isParsed())&&(S=Ns(I,n,A));}var z=void 0;if(l){var C=n.getValueAndResolveTokens("icon-image",A,r,f);z=C instanceof re?C:re.fromString(C);}if(S||z){var E=this.sortFeaturesByKey?p.evaluate(A,{},r):void 0,M={id:x,text:S,icon:z,index:b,sourceLayerIndex:_,geometry:ja(g),properties:g.properties,type:ol[g.type],sortKey:E};if(this.features.push(M),z&&(c[z.name]=!0),S){var T=a.evaluate(A,{},r).join(","),P="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(gu.vertical)>=0;for(var B=0,V=S.sections;B<V.length;B+=1){var D=V[B];if(D.image)c[D.image.name]=!0;else {var F=$n(S.toString()),L=D.fontStack||T,R=h[L]=h[L]||{};this.calculateGlyphDependencies(D.text,R,P,this.allowVerticalPlacement,F);}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++;}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=o(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null;}else f in r?o(f,y,c):y in e?s(f,y,c):(a(l),e[f]=i-1,r[y]=i-1);}else a(l);}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}));}},fl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r));},fl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},fl.prototype.uploadPending=function(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},fl.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0;},fl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy();},fl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData();},fl.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=a[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor);}}return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},fl.prototype.addSymbols=function(t,e,r,n,i,a,o,s,u,l,p,c){for(var h=t.indexArray,f=t.layoutVertexArray,y=t.segments.prepareSegment(4*e.length,f,h,a.sortKey),d=this.glyphOffsetArray.length,m=y.vertexLength,v=this.allowVerticalPlacement&&o===gu.vertical?Math.PI/2:0,g=a.text&&a.text.sections,x=0;x<e.length;x++){var b=e[x],_=b.tl,w=b.tr,A=b.bl,S=b.br,k=b.tex,I=b.pixelOffsetTL,z=b.pixelOffsetBR,C=b.minFontScaleX,E=b.minFontScaleY,M=b.glyphOffset,T=b.isSDF,P=b.sectionIndex,B=y.vertexLength,V=M[1];ul(f,s.x,s.y,_.x,V+_.y,k.x,k.y,r,T,I.x,I.y,C,E),ul(f,s.x,s.y,w.x,V+w.y,k.x+k.w,k.y,r,T,z.x,I.y,C,E),ul(f,s.x,s.y,A.x,V+A.y,k.x,k.y+k.h,r,T,I.x,z.y,C,E),ul(f,s.x,s.y,S.x,V+S.y,k.x+k.w,k.y+k.h,r,T,z.x,z.y,C,E),ll(t.dynamicLayoutVertexArray,s,v),h.emplaceBack(B,B+1,B+2),h.emplaceBack(B+1,B+2,B+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),x!==e.length-1&&P===e[x+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},c,g&&g[P]);}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,p);},fl.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},fl.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s,u){var l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),p=l.vertexLength,c=a.layoutVertexArray,h=a.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,o,f,y,new i(t,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,e)),this._addCollisionDebugVertex(c,h,o,f,y,new i(r,n)),this._addCollisionDebugVertex(c,h,o,f,y,new i(t,n)),l.vertexLength+=4,u){var d=a.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2;}else {var m=a.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4;}},fl.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var a=this.collisionBoxArray.get(i),o=a.radius>0;this.addCollisionDebugVertices(a.x1,a.y1,a.x2,a.y2,o?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r,o);}},fl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hl(qi,js.members,Hi),this.iconCollisionBox=new hl(qi,js.members,Hi),this.textCollisionCircle=new hl(qi,qs.members,Yi),this.iconCollisionCircle=new hl(qi,qs.members,Yi);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1);}},fl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o,s,u){for(var l={},p=e;p<r;p++){var c=t.get(p);if(0===c.radius){l.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},l.textFeatureIndex=c.featureIndex;break}l.textCircles||(l.textCircles=[],l.textFeatureIndex=c.featureIndex),l.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1);}for(var h=n;h<i;h++){var f=t.get(h);if(0===f.radius){l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}}for(var y=a;y<o;y++){var d=t.get(y);if(0===d.radius){l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}}for(var m=s;m<u;m++){var v=t.get(m);if(0===v.radius){l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}}return l},fl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex));}},fl.prototype.hasTextData=function(){return this.text.segments.get().length>0},fl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},fl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox&&this.textCollisionCircle&&this.iconCollisionCircle},fl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},fl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},fl.prototype.hasTextCollisionCircleData=function(){return this.hasDebugData()&&this.textCollisionCircle.segments.get().length>0},fl.prototype.hasIconCollisionCircleData=function(){return this.hasDebugData()&&this.iconCollisionCircle.segments.get().length>0},fl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3);},fl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex);}return a.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),a},fl.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1});},fl.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t);})),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);}},Nn("SymbolBucket",fl,{omit:["layers","collisionBoxArray","features","compareText"]}),fl.MAX_GLYPHS=65535,fl.addDynamicAttributes=ll;var yl=new Ii({"symbol-placement":new _i(Et.layout_symbol["symbol-placement"]),"symbol-spacing":new _i(Et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new _i(Et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new wi(Et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new _i(Et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new _i(Et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new _i(Et.layout_symbol["icon-ignore-placement"]),"icon-optional":new _i(Et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new _i(Et.layout_symbol["icon-rotation-alignment"]),"icon-size":new wi(Et.layout_symbol["icon-size"]),"icon-text-fit":new _i(Et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new _i(Et.layout_symbol["icon-text-fit-padding"]),"icon-image":new wi(Et.layout_symbol["icon-image"]),"icon-rotate":new wi(Et.layout_symbol["icon-rotate"]),"icon-padding":new _i(Et.layout_symbol["icon-padding"]),"icon-keep-upright":new _i(Et.layout_symbol["icon-keep-upright"]),"icon-offset":new wi(Et.layout_symbol["icon-offset"]),"icon-anchor":new wi(Et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new _i(Et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new _i(Et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new _i(Et.layout_symbol["text-rotation-alignment"]),"text-field":new wi(Et.layout_symbol["text-field"]),"text-font":new wi(Et.layout_symbol["text-font"]),"text-size":new wi(Et.layout_symbol["text-size"]),"text-max-width":new wi(Et.layout_symbol["text-max-width"]),"text-line-height":new _i(Et.layout_symbol["text-line-height"]),"text-letter-spacing":new wi(Et.layout_symbol["text-letter-spacing"]),"text-justify":new wi(Et.layout_symbol["text-justify"]),"text-radial-offset":new wi(Et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new _i(Et.layout_symbol["text-variable-anchor"]),"text-anchor":new wi(Et.layout_symbol["text-anchor"]),"text-max-angle":new _i(Et.layout_symbol["text-max-angle"]),"text-writing-mode":new _i(Et.layout_symbol["text-writing-mode"]),"text-rotate":new wi(Et.layout_symbol["text-rotate"]),"text-padding":new _i(Et.layout_symbol["text-padding"]),"text-keep-upright":new _i(Et.layout_symbol["text-keep-upright"]),"text-transform":new wi(Et.layout_symbol["text-transform"]),"text-offset":new wi(Et.layout_symbol["text-offset"]),"text-allow-overlap":new _i(Et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new _i(Et.layout_symbol["text-ignore-placement"]),"text-optional":new _i(Et.layout_symbol["text-optional"])}),dl={paint:new Ii({"icon-opacity":new wi(Et.paint_symbol["icon-opacity"]),"icon-color":new wi(Et.paint_symbol["icon-color"]),"icon-halo-color":new wi(Et.paint_symbol["icon-halo-color"]),"icon-halo-width":new wi(Et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new wi(Et.paint_symbol["icon-halo-blur"]),"icon-translate":new _i(Et.paint_symbol["icon-translate"]),"icon-translate-anchor":new _i(Et.paint_symbol["icon-translate-anchor"]),"text-opacity":new wi(Et.paint_symbol["text-opacity"]),"text-color":new wi(Et.paint_symbol["text-color"],{runtimeType:jt,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new wi(Et.paint_symbol["text-halo-color"]),"text-halo-width":new wi(Et.paint_symbol["text-halo-width"]),"text-halo-blur":new wi(Et.paint_symbol["text-halo-blur"]),"text-translate":new _i(Et.paint_symbol["text-translate"]),"text-translate-anchor":new _i(Et.paint_symbol["text-translate-anchor"])}),layout:yl},ml=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Lt,this.defaultValue=t;};ml.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},ml.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},ml.prototype.outputDefined=function(){return !1},ml.prototype.serialize=function(){return null},Nn("FormatSectionOverride",ml,{omit:["defaultValue"]});var vl=function(t){function e(e){t.call(this,e,dl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s);}this.layout._values["text-writing-mode"]=i;}else this.layout._values["text-writing-mode"]=["horizontal"];}this._setPaintOverrides();},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||Hr(a.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new fl(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype._setPaintOverrides=function(){for(var t=0,r=dl.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new ml(a),s=new Yr(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new Wr("source",s):new Qr("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new xi(a.property,i,a.parameters);}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return !(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=dl.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof ee)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){i||(t instanceof se&&ae(t.value)===Kt?a(t.value.sections):t instanceof ce?a(t.sections):t.eachChild(o));},s=r.value;s._styleExpression&&o(s._styleExpression.expression);}return i},e}(zi),gl={paint:new Ii({"background-color":new _i(Et.paint_background["background-color"]),"background-pattern":new Si(Et.paint_background["background-pattern"]),"background-opacity":new _i(Et.paint_background["background-opacity"])})},xl=function(t){function e(e){t.call(this,e,gl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(zi),bl={paint:new Ii({"raster-opacity":new _i(Et.paint_raster["raster-opacity"]),"raster-hue-rotate":new _i(Et.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new _i(Et.paint_raster["raster-brightness-min"]),"raster-brightness-max":new _i(Et.paint_raster["raster-brightness-max"]),"raster-saturation":new _i(Et.paint_raster["raster-saturation"]),"raster-contrast":new _i(Et.paint_raster["raster-contrast"]),"raster-resampling":new _i(Et.paint_raster["raster-resampling"]),"raster-fade-duration":new _i(Et.paint_raster["raster-fade-duration"])})},_l=function(t){function e(e){t.call(this,e,bl);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(zi),wl=function(t){function e(e){t.call(this,e,{}),this.implementation=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return "3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl);},e}(zi),Al={circle:lo,heatmap:bo,hillshade:wo,fill:us,"fill-extrusion":ks,line:Fs,symbol:vl,background:xl,raster:_l},Sl=self.HTMLImageElement,kl=self.HTMLCanvasElement,Il=self.HTMLVideoElement,zl=self.ImageData,Cl=self.ImageBitmap,El=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n);};El.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof Sl||t instanceof kl||t instanceof Il||t instanceof zl||Cl&&t instanceof Cl?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else {var u=r||{x:0,y:0},l=u.x,p=u.y;t instanceof Sl||t instanceof kl||t instanceof Il||t instanceof zl||Cl&&t instanceof Cl?s.texSubImage2D(s.TEXTURE_2D,0,l,p,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,p,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data);}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D);},El.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e);},El.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},El.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null;};var Ml=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback();});};Ml.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback();}),0));},Ml.prototype.remove=function(){delete this._channel,this._callback=function(){};};var Tl=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Ml(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:self;};function Pl(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Tl.prototype.send=function(t,e,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=C(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:Zn(e,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId});}}},Tl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n();}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e);},Tl.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e);}},Tl.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Jn(e.error)):n(null,Jn(e.data)));}else {var i=!1,a=C(this.globalScope)?void 0:[],o=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?Zn(e):null,data:Zn(n,a)},a);}:function(t){i=!0;},s=null,u=Jn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,o);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,o);}else o(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel);}},Tl.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1);};var Bl=function(){};Bl.prototype.project=function(t){var e,r;return Array.isArray(t)?(e=t[0],r=t[1]):(e=t.lng,r=t.lat),[e,r]},Bl.prototype.unproject=function(t){var e,r;return Array.isArray(t)?(e=t[0],r=t[1]):(e=t.x,r=t.y),[e,r]};var Vl=function(t){function e(){t.call(this),this.bounds=[-180,-90,180,90];}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.project=function(e){var r=t.prototype.project.call(this,e),n=r[1];return [u(r[0],this.bounds[0],this.bounds[2]),u(n,this.bounds[1],this.bounds[3])]},e.prototype.unproject=function(e){var r=t.prototype.unproject.call(this,e),n=r[1];return [u(r[0],this.bounds[0],this.bounds[2]),u(n,this.bounds[1],this.bounds[3])]},e}(Bl),Dl=6378137,Fl=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.project=function(e){var r=t.prototype.project.call(this,e),n=r[0],i=Math.PI/180,a=85.0511287798,o=Math.max(Math.min(a,r[1]),-a),s=Math.sin(o*i);return [Dl*n*i,Dl*Math.log((1+s)/(1-s))/2]},e.prototype.unproject=function(e){var r=t.prototype.unproject.call(this,e),n=180/Math.PI;return [r[0]*n/Dl,(2*Math.atan(Math.exp(r[1]/Dl))-Math.PI/2)*n]},e}(Bl),Ll=function t(e,r){this._parseParams(arguments);var n=this.getExtent();if(!n)throw new Error("未设置坐标系范围bounds");this.origin||(this.origin=[n[0],n[3]]),this._setProjection(),this.getCoordsInfo(),t.set(this);};Ll.prototype._parseParams=function(t){this.epsgCode=t[0],this._parseOptions(t[1]||{});},Ll.prototype._parseOptions=function(t){this.origin=t.origin,this.dpi=t.dpi||96,this.unit=t.unit||"degree",this.extent=t.bounds,this._resolutions={},this._scale={},this._zoomOffset=0;},Ll.prototype._setProjection=function(){this.projection=function(t){var e;switch(t){case"EPSG:4326":case"EPSG:4214":case"EPSG:4490":case"EPSG:4610":e=new Vl;break;case"EPSG:3857":e=new Fl;break;default:throw new Error("未找到坐标系对应的投影信息")}return e}(this.epsgCode,this.getExtent());},Ll.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else {var r=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-r,this.extent[0]+r,this.extent[3]];}}return this._rectifyExtent},Ll.prototype.getOrigin=function(){return this.origin},Ll.prototype.getEpsgCode=function(){return this.epsgCode},Ll.prototype.getUnit=function(){return this.unit},Ll.prototype.getDpi=function(){return this.dpi},Ll.prototype.getMeterPerMapUnit=function(t){return "m"===t||"meter"===t?1:"degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},Ll.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var r=this.getExtent(),n=Math.max(r[2]-r[0],r[3]-r[1]),i=Math.pow(2,t);this._resolutions[t]=n/i/e;}return this._resolutions[t]},Ll.prototype.getScale=function(t,e){if(!this._scales[t]){var r=this.getDpi()*this.getResolution(t,e)*(1/.0254)*this.getMeterPerMapUnit(this.getUnit());this._scales[t]=1/r;}return this._scales[t]},Ll.prototype.getCoordsInfo=function(){for(var t=this.getExtent(),e=this.projection.unproject([t[0],t[3]]),r=e[0],n=e[1],i=this.projection.unproject([t[2],t[1]]),a=i[0],o=i[1];a-r<0||n-o<0||!this._isInRange(r,[-180,180])||!this._isInRange(a,[-180,180])||!this._isInRange(o,[-270,90])||!this._isInRange(n,[-270,90]);){this._zoomOffset+=1,this._rectifyExtent=null,t=this.getExtent();var s=this.projection.unproject([t[0],t[3]]),u=this.projection.unproject([t[2],t[1]]);r=s[0],n=s[1],a=u[0],o=u[1];}return this._getCoordsInfo(t,[r,o,a,n])},Ll.prototype._getCoordsInfo=function(t,e){var r=e[0],n=e[1],i=e[3],a=e[2]-r,o=i-n;return {width:t[2]-t[0],height:t[3]-t[1],centerX:(t[2]+t[0])/2,centerY:(t[3]+t[1])/2,origin:this.origin,originX:this.origin[0],originY:this.origin[1],latlngBounds:e,latlngWidth:a,latlngHeight:o,latlngCenterX:r+a/2,latlngCenterY:n+o/2,latlngOrigin:[r,i],latlngOriginX:r,latlngOriginY:i}},Ll.prototype.getZoomOffset=function(){return this._zoomOffset},Ll.prototype._isInRange=function(t,e){return !!(t>=e[0]&&t<=e[1])},Ll.get=function(t){for(var e in Ll)if(Ll.hasOwnProperty(e)&&Ll[e].getEpsgCode&&Ll[e].getEpsgCode()===t)return Ll[e];return null},Ll.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Ll[e]=t;},Ll.EPSG4326=new Ll("EPSG:4326",{bounds:[-180,-90,180,90]}),Ll.EPSG4214=new Ll("EPSG:4214",{bounds:[-180,-90,180,90]}),Ll.EPSG4490=new Ll("EPSG:4490",{bounds:[-180,-90,180,90]}),Ll.EPSG4610=new Ll("EPSG:4610",{bounds:[-180,-90,180,90]}),Ll.EPSG3857=new Ll("EPSG:3857",{bounds:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]});var Rl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=jl(0,t,t,e,r),this.z_replace=void 0,this.x_replace=void 0,this.y_replace=void 0;};Rl.prototype.offsetZ=function(t){t&&(this.z+=t);},Rl.prototype.replaceX=function(t){this.x_replace=t;},Rl.prototype.replaceY=function(t){this.y_replace=t;},Rl.prototype.replaceZ=function(t){this.z_replace=t;},Rl.prototype.format=function(t,e){var r=t.length;if(r>=e)t=t.substring(r-e,r);else {for(var n="",i=0;i<e;i++)n+="0";t=n.substring(0,n.length-r)+t;}return t},Rl.prototype.replaceRule=function(t,e){var r=t.fixlength,n=t.prefix,i=t.postfix,a=e;switch(t.type){case"hex":a=e.toString(16).toUpperCase();break;case"dec":a=e.toString(10).toUpperCase();break;case"oct":a=e.toString(8).toUpperCase();break;case"bin":a=e.toString(2).toUpperCase();}return r&&(a=this.format(a,r)),n&&(a=n+a),i&&(a+=i),a},Rl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Rl.prototype.url=function(t,e){var r=this.x_replace,n=this.y_replace,i=this.z_replace,a=t[(this.x+this.y)%t.length],o=a.indexOf("reversebbox=true")>=0,s=this.getTileBBox(this.x,this.y,this.z);if(o){var u=s.split(",");s=u[1]+","+u[0]+","+u[3]+","+u[2],console.warn("reverse",s);}var l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y),p=this.z,c=this.x,h=this.y;return (r||n||i)&&(i&&(p=this.replaceRule(i,this.z)),r&&(c=this.replaceRule(r,this.x)),n&&(h=this.replaceRule(n,this.y))),a.replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(p)).replace("{x}",String(c)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:h)).replace("{quadkey}",l).replace("{bbox}",s)},Rl.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Rl.prototype.getTileBBox=function(t,e,r){return function(t,e,r){var n=Pl(256*t,256*(e=Math.pow(2,r)-e-1),r),i=Pl(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(t,e,r)},Rl.prototype.getCRS=function(){return Ll.EPSG3857},Rl.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Ol=function(t,e){this.wrap=t,this.canonical=e,this.key=jl(t,e.z,e.z,e.x,e.y);},Ul=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Rl(r,+n,+i),this.key=jl(e,t,r,n,i);};function jl(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var a=1<<r;return (a*a*t+a*i+n).toString(36)+r.toString(36)+e.toString(36)}function ql(t,e,r){var n=function(n,i){if(n)return r(n);if(i){var a=c(p(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(a.vectorLayers=i.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=e.canonicalizeTileset(a,t.url),r(null,a);}};return t.url?bt(e.transformRequest(e.normalizeSourceURL(t.url),yt.Source),n):L.frame((function(){return n(null,t)}))}Ul.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Ul.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Ul(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ul(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Ul.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?jl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):jl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Ul.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return !1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Ul.prototype.children=function(t){if(this.overscaledZ>=t)return [new Ul(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new Ul(e,this.wrap,e,r,n),new Ul(e,this.wrap,e,r+1,n),new Ul(e,this.wrap,e,r,n+1),new Ul(e,this.wrap,e,r+1,n+1)]},Ul.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Ul.prototype.wrapped=function(){return new Ul(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Ul.prototype.unwrapTo=function(t){return new Ul(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Ul.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Ul.prototype.toUnwrapped=function(){return new Ol(this.wrap,this.canonical)},Ul.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Ul.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new ze(t.x-this.wrap,t.y))},Nn("CanonicalTileID",Rl),Nn("OverscaledTileID",Ul,{omit:["posMatrix"]});var Nl=function(t,e,r){this.bounds=xe.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24;};Nl.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Nl.prototype.contains=function(t){var e=Math.pow(2,t.z),r=Math.floor(Ae(this.bounds.getWest())*e),n=Math.floor(Se(this.bounds.getNorth())*e),i=Math.ceil(Ae(this.bounds.getEast())*e),a=Math.ceil(Se(this.bounds.getSouth())*e);return t.x>=r&&t.x<i&&t.y>=n&&t.y<a};var Gl=function(t){function e(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=p({type:"raster"},r),p(this,c(r,["url","scheme","tileSize"]));}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new It("dataloading",{dataType:"source"})),this._tileJSONRequest=ql(this._options,this.map._requestManager,(function(e,r){t._tileJSONRequest=null,t._loaded=!0,e?t.fire(new zt(e)):r&&(p(t,r),r.bounds&&(t.tileBounds=new Nl(r.bounds,t.minzoom,t.maxzoom)),nt(r.tiles),at(r.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new It("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new It("data",{dataType:"source",sourceDataType:"content"})));}));},e.prototype.loaded=function(){return this._loaded},e.prototype.onAdd=function(t){this.map=t,this.load();},e.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},e.prototype.serialize=function(){return p({},this._options)},e.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},e.prototype.loadTile=function(t,e){var r=this,n=this._options.tileUrlReplace;n&&n.length>=3&&(t.tileID.canonical.replaceX(n[0]),t.tileID.canonical.replaceY(n[1]),t.tileID.canonical.replaceZ(n[2]));var i=this._options.mapgisOffset||0;t.tileID.canonical.offsetZ(i+this.getZoomOffset());var a=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.tileID.canonical.offsetZ(0-i-this.getZoomOffset()),t.request=At(this.map._requestManager.transformRequest(a,yt.Tile),(function(n,i){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(n)t.state="errored",e(n);else if(i){r.map._refreshExpiredTiles&&t.setExpiryData(i),delete i.cacheControl,delete i.expires;var a=r.map.painter.context,o=a.gl;t.texture=r.map.painter.getTileTexture(i.width),t.texture?t.texture.update(i,{useMipmap:!0}):(t.texture=new El(a,i,o.RGBA,{useMipmap:!0}),t.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&o.texParameterf(o.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),t.state="loaded",ht(r.dispatcher),e(null);}}));},e.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e();},e.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();},e.prototype.hasTransition=function(){return !1},e}(Ct),Kl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)];};Kl.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return ("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Kl.prototype.getUnpackVector=function(){return "terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Kl.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return (e+1)*this.stride+(t+1)},Kl.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Kl.prototype.getPixels=function(){return new vo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:a=o-1;break;case 1:o=a+1;}for(var s=-e*this.dim,u=-r*this.dim,l=a;l<o;l++)for(var p=n;p<i;p++)this.data[this._idx(p,l)]=t.data[this._idx(p+s,l+u)];},Nn("DEMData",Kl);var Xl=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r;}};Xl.prototype.encode=function(t){return this._stringToNumber[t]},Xl.prototype.decode=function(t){return this._numberToString[t]};var Zl=function(t,e,r,n,i,a){this.epsg=a||"EPSG:3857",this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i;},Jl={geometry:{configurable:!0}};Jl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z,this.epsg).geometry),this._geometry},Jl.geometry.set=function(t){this._geometry=t;},Zl.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Zl.prototype,Jl);var Yl=function(){this.state={},this.stateChanges={},this.deletedStates={};};Yl.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o];},Yl.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null;}},Yl.prototype.getState=function(t,e){var r=String(e),n=p({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return {};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return {};for(var a in i)delete n[a];}return n},Yl.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},Yl.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i;}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var u in this.state[o])s[u]={},this.state[o][u]={};else for(var l in this.deletedStates[o]){if(null===this.deletedStates[o][l])this.state[o][l]={};else for(var c=0,h=Object.keys(this.deletedStates[o][l]);c<h.length;c+=1)delete this.state[o][l][h[c]];s[l]=this.state[o][l];}r[o]=r[o]||{},p(r[o],s);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e);};var Hl=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Rn(8192,16,0),this.grid3D=new Rn(8192,16,0),this.featureIndexArray=new la,this.promoteId=e;};function $l(t,e,r,n,i){return g(t,(function(t,a){var o=e instanceof bi?e.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function Wl(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);}return {minX:e,minY:r,maxX:n,maxY:i}}function Ql(t,e){return e-t}Hl.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y);}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&s.insert(o,p[0],p[1],p[2],p[3]);}},Hl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new gs.VectorTile(new Zs(this.rawTileData)).layers,this.sourceLayerCoder=new Xl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Hl.prototype.query=function(t,e,r,n){var a=this;this.loadVTLayers();for(var o=t.params||{},s=8192/t.tileSize/t.scale,u=cn(o.filter),l=t.queryGeometry,p=t.queryPadding*s,c=Wl(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=Wl(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var u=s[o];if(e<=u.x&&r<=u.y&&n>=u.x&&a>=u.y)return !0}var l=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var p=0,c=l;p<c.length;p+=1)if(Qa(t,c[p]))return !0;for(var h=0;h<t.length-1;h++)if(to(t[h],t[h+1],l))return !0;return !1}(t.cameraQueryGeometry,e-p,r-p,n+p,a+p)})),d=0,m=y;d<m.length;d+=1)h.push(m[d]);h.sort(Ql);for(var v,g={},x=function(i){var p=h[i];if(p!==v){v=p;var c=a.featureIndexArray.get(p),f=null;a.loadMatchingFeature(g,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,u,o.layers,o.availableImages,e,r,n,(function(e,r,n){return f||(f=ja(e)),r.queryIntersectsFeature(l,e,n,f,a.z,t.transform,s,t.pixelPosMatrix)}));}},b=0;b<h.length;b++)x(b);return g},Hl.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s,u,l,p){var c=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(a,c)){var h=this.sourceLayerCoder.decode(r),f=this.vtLayers[h].feature(n);if(i.filter(new hi(this.tileID.overscaledZ),f))for(var y=this.getId(f,h),d=new Rl(0,0,0),m=0;m<c.length;m++){var v=c[m];if(!(a&&a.indexOf(v)<0)){var g=s[v];if(g){var x={};void 0!==y&&l&&(x=l.getState(g.sourceLayer||"_geojsonTileLayer",y));var b=u[v];b.paint=$l(b.paint,g.paint,f,x,o),b.layout=$l(b.layout,g.layout,f,x,o);var _=!p||p(f,g,x);if(_){var w=new Zl(f,this.z,this.x,this.y,y,d.getCRS().getEpsgCode());w.layer=b;var A=t[v];void 0===A&&(A=t[v]=[]),A.push({featureIndex:n,feature:w,intersectionZ:_});}}}}}},Hl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a,o,s){var u={};this.loadVTLayers();for(var l=cn(i),p=0,c=t;p<c.length;p+=1)this.loadMatchingFeature(u,r,n,c[p],l,a,o,s,e);return u},Hl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return !0;return !1},Hl.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Nn("FeatureIndex",Hl,{omit:["rawTileData","sourceLayerCoder"]});var tp=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading";};tp.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<L.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e);},tp.prototype.wasRequested=function(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state},tp.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var o=0,s=n;o<s.length;o+=1)r[s[o].id]=t;}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof fl){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0;}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof fl&&o.hasRTLText){this.hasRTLText=!0,ci.isLoading()||ci.isLoaded()||"deferred"!==li()||pi();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u));}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage);}else this.collisionBoxArray=new ea;},tp.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded";},tp.prototype.getBucket=function(t){return this.buckets[t.id]},tp.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t);}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new El(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new El(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null);},tp.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture);},tp.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*u},t,e,r):{}},tp.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=cn(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,p=s.y,c={z:u,x:l,y:p},h=0;h<a.length;h++){var f=a.feature(h);if(o.filter(new hi(this.tileID.overscaledZ),f)){var y=r.getId(f,i),d=new Zl(f,u,l,p,y);d.tile=c,t.push(d);}}}},tp.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},tp.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},tp.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=I(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"]);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else {var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0;}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0;}},tp.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},tp.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(n);u&&u.paint&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(i)));}}}},tp.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},tp.prototype.symbolFadeFinished=function(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<L.now()},tp.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0;},tp.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=L.now()+t;},tp.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r;},tp.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=this.dependencies[n[r]];if(i)for(var a=0,o=e;a<o.length;a+=1)if(i[o[a]])return !0}return !1};var ep=self.performance,rp=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},ep.mark(this._marks.start);};rp.prototype.finish=function(){ep.mark(this._marks.end);var t=ep.getEntriesByName(this._marks.measure);return 0===t.length&&(ep.measure(this._marks.measure,this._marks.start,this._marks.end),t=ep.getEntriesByName(this._marks.measure),ep.clearMarks(this._marks.start),ep.clearMarks(this._marks.end),ep.clearMeasures(this._marks.measure)),t};var np=function(){};np.openDatabase=function(t){var e=t.split("/").slice(-1)[0],r=this;return console.log("openDatabase",self),"sqlitePlugin"in self?"device"in self?new Promise((function(t,e){"Android"===device.platform?resolveLocalFileSystemURL(cordova.file.applicationStorageDirectory,(function(e){e.getDirectory("databases",{create:!0},(function(e){t(e);}));}),e):"iOS"===device.platform?resolveLocalFileSystemURL(cordova.file.documentsDirectory,t,e):e("Platform not supported");})).then((function(n){return new Promise((function(t,r){n.getFile(e,{},t,r);})).catch((function(){return r.copyDatabaseFile(t,e,n)}))})).then((function(){var t={name:e};return "iOS"===device.platform?t.iosDatabaseLocation="Documents":t.location="default",sqlitePlugin.openDatabase(t)})):Promise.reject(new Error("cordova-plugin-device not available. Please install the plugin and make sure this code is run after onDeviceReady event")):Promise.reject(new Error("cordova-sqlite-ext plugin not available. Please install the plugin and make sure this code is run after onDeviceReady event"))},np.copyDatabaseFile=function(t,e,r){return console.log("Copying database to application storage directory"),new Promise((function(e,r){var n=cordova.file.externalRootDirectory+"/"+t;resolveLocalFileSystemURL(n,e,r);})).then((function(t){return new Promise((function(n,i){t.copyTo(r,e,n,i);})).then((function(){console.log("Database copied");}))}))};var ip=function(t){function e(e,r,n,i){t.call(this,e,r,n,i),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="rasteroffline",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.imageFormat="png",this._loaded=!1,this._options=p({},r),p(this,c(r,["scheme","tileSize","imageFormat"])),this._transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.db=this.openDatabase(r.path);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.openDatabase=function(t){return np.openDatabase(t)},e.prototype.copyDatabaseFile=function(t,e,r){return np.copyDatabaseFile(t,e,r)},e.prototype.loadTile=function(t,e){t.request=this._getImage(t.tileID.canonical,function(r,n){if(delete t.request,t.aborted)t.state="unloaded",e(null);else if(r)t.state="errored",e(r);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(n),delete n.cacheControl,delete n.expires;var i=this.map.painter.context,a=i.gl;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new El(i,n,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),t.state="loaded",e(null);}}.bind(this));},e.prototype._getBlob=function(t,e){var r=this,n=Math.pow(2,t.z)-1-t.y,i=[t.z,t.x,n],a="data:image/"+this.imageFormat+";base64,";this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?",i,(function(t,n){n.rows.length?e(void 0,{data:a+n.rows.item(0).base64_tile_data,cacheControl:null,expires:null}):(console.error("tile "+i.join(",")+" not found"),e(void 0,{data:r._transparentPngUrl,cacheControl:null,expires:null}));}));}),(function(t){e(t);}));})).catch((function(t){e(t);}));},e.prototype._getImage=function(t,e){return this._getBlob(t,(function(t,r){if(t)return e(t);var n=new window.Image,i=window.URL||window.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src);},n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data;}))},e}(Gl);t.Actor=Tl,t.AlphaImage=mo,t.CRS=Ll,t.CanonicalTileID=Rl,t.CollisionBoxArray=ea,t.Color=Wt,t.DEMData=Kl,t.DataConstantProperty=_i,t.Database=np,t.DictionaryCoder=Xl,t.EXTENT=8192,t.ErrorEvent=zt,t.EvaluationParameters=hi,t.Event=It,t.Evented=Ct,t.FeatureIndex=Hl,t.FillBucket=as,t.FillExtrusionBucket=ws,t.GeoJSONFeature=Zl,t.ImageAtlas=vu,t.ImagePosition=du,t.LineBucket=Ps,t.LngLat=be,t.LngLatBounds=xe,t.MercatorCoordinate=ze,t.ONE_EM=24,t.OverscaledTileID=Ul,t.Point=i,t.Point$1=i,t.Projection=Bl,t.Properties=Ii,t.Protobuf=Zs,t.RGBAImage=vo,t.RasterTileSource=Gl,t.RasterTileSourceOffline=ip,t.RequestManager=G,t.RequestPerformance=rp,t.ResourceType=yt,t.SegmentVector=ca,t.SourceFeatureState=Yl,t.StructArrayLayout1ui2=$i,t.StructArrayLayout2i4=Bi,t.StructArrayLayout3ui6=Yi,t.StructArrayLayout4i8=Vi,t.SymbolBucket=fl,t.Texture=El,t.Tile=tp,t.TileBounds=Nl,t.Transitionable=di,t.Uniform1f=Aa,t.Uniform1i=wa,t.Uniform2f=Sa,t.Uniform3f=ka,t.Uniform4f=Ia,t.UniformColor=za,t.UniformMatrix4f=Ea,t.UnwrappedTileID=Ol,t.ValidationError=Mt,t.WritingMode=gu,t.ZoomHistory=Yn,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=ll,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach((function(t,o){e(t,(function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i);}));}));},t.bezier=o,t.bindAll=m,t.browser=L,t.cacheEntryPossiblyAdded=ht,t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}));},t.clone=function(t){var e=new so(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},t.clone$1=b,t.clone$2=function(t){var e=new so(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.config=R,t.create=function(){var t=new so(16);return so!=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},t.create$1=function(){var t=new so(9);return so!=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},t.create$2=function(){var t=new so(4);return so!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=$r,t.createLayout=Ti,t.createStyleLayer=function(t){return "custom"===t.type?new wl(t):new Al[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],u=r[2];return t[0]=i*u-a*s,t[1]=a*o-n*u,t[2]=n*s-i*o,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return !1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return !1;return !0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return !1;if(Object.keys(e).length!==Object.keys(r).length)return !1;for(var i in e)if(!t(e[i],r[i]))return !1;return !0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=s,t.emitValidationErrors=Ln,t.endsWith=v,t.enforceCacheSizeLimit=function(t){ut(),Q&&Q.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n]);}));}));},t.evaluateSizeForFeature=Vu,t.evaluateSizeForZoom=Du,t.evaluateVariableOffset=el,t.evented=ui,t.extend=p,t.featureFilter=cn,t.filterObject=x,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Eu,t.getAnchorJustification=rl,t.getArrayBuffer=_t,t.getImage=At,t.getJSON=bt,t.getRTLTextPluginStatus=li,t.getReferrer=mt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i);};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o);}return {cancel:function(){}}},t.identity=function(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},t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],p=e[8],c=e[9],h=e[10],f=e[11],y=e[12],d=e[13],m=e[14],v=e[15],g=r*s-n*o,x=r*u-i*o,b=r*l-a*o,_=n*u-i*s,w=n*l-a*s,A=i*l-a*u,S=p*d-c*y,k=p*m-h*y,I=p*v-f*y,z=c*m-h*d,C=c*v-f*d,E=h*v-f*m,M=g*E-x*C+b*z+_*I-w*k+A*S;return M?(t[0]=(s*E-u*C+l*z)*(M=1/M),t[1]=(i*C-n*E-a*z)*M,t[2]=(d*A-m*w+v*_)*M,t[3]=(h*w-c*A-f*_)*M,t[4]=(u*I-o*E-l*k)*M,t[5]=(r*E-i*I+a*k)*M,t[6]=(m*b-y*A-v*x)*M,t[7]=(p*A-h*b+f*x)*M,t[8]=(o*C-s*I+l*S)*M,t[9]=(n*I-r*C-a*S)*M,t[10]=(y*w-d*b+v*g)*M,t[11]=(c*b-p*w-f*g)*M,t[12]=(s*k-o*z-u*S)*M,t[13]=(r*z-n*k+i*S)*M,t[14]=(d*x-y*_-m*g)*M,t[15]=(p*_-c*x+h*g)*M,t):null},t.isChar=Hn,t.isMapboxURL=K,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.loadTileJSON=ql,t.makeRequest=xt,t.mapObject=g,t.mercatorXfromLng=Ae,t.mercatorYfromLat=Se,t.mercatorZfromAltitude=ke,t.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*c+w*d,t[1]=x*i+b*u+_*h+w*m,t[2]=x*a+b*l+_*f+w*v,t[3]=x*o+b*p+_*y+w*g,t[4]=(x=r[4])*n+(b=r[5])*s+(_=r[6])*c+(w=r[7])*d,t[5]=x*i+b*u+_*h+w*m,t[6]=x*a+b*l+_*f+w*v,t[7]=x*o+b*p+_*y+w*g,t[8]=(x=r[8])*n+(b=r[9])*s+(_=r[10])*c+(w=r[11])*d,t[9]=x*i+b*u+_*h+w*m,t[10]=x*a+b*l+_*f+w*v,t[11]=x*o+b*p+_*y+w*g,t[12]=(x=r[12])*n+(b=r[13])*s+(_=r[14])*c+(w=r[15])*d,t[13]=x*i+b*u+_*h+w*m,t[14]=x*a+b*l+_*f+w*v,t[15]=x*o+b*p+_*y+w*g,t},t.mvt=gs,t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=$e,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),u=1/(n-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(o+a)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Zs(t).readFields(cu,[])},t.pbf=Zs,t.performSymbolLayout=function(t,e,r,n,a,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new hi(c.minZoom),s),l["text-size"].possiblyEvaluate(new hi(h),s)];}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new hi(f.minZoom),s),l["icon-size"].possiblyEvaluate(new hi(y),s)];}p.layoutTextSize=l["text-size"].possiblyEvaluate(new hi(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new hi(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new hi(18));for(var d=24*u.get("text-line-height"),m="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),v=u.get("text-keep-upright"),g=u.get("text-size"),x=function(){var o=_[b],l=u.get("text-font").evaluate(o,{},s).join(","),c=g.evaluate(o,{},s),h=p.layoutTextSize.evaluate(o,{},s),f=p.layoutIconSize.evaluate(o,{},s),y={horizontal:{},vertical:void 0},x=o.text,A=[0,0];if(x){var S=x.toString(),k=24*u.get("text-letter-spacing").evaluate(o,{},s),I=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),Hn.Arabic(n)||Hn["Arabic Supplement"](n)||Hn["Arabic Extended-A"](n)||Hn["Arabic Presentation Forms-A"](n)||Hn["Arabic Presentation Forms-B"](n))return !1;var n;return !0}(S)?k:0,z=u.get("text-anchor").evaluate(o,{},s),C=u.get("text-variable-anchor");if(!C){var E=u.get("text-radial-offset").evaluate(o,{},s);A=E?el(z,[24*E,tl]):u.get("text-offset").evaluate(o,{},s).map((function(t){return 24*t}));}var M=m?"center":u.get("text-justify").evaluate(o,{},s),T=u.get("symbol-placement"),P="point"===T?24*u.get("text-max-width").evaluate(o,{},s):0,B=function(){t.allowVerticalPlacement&&$n(S)&&(y.vertical=_u(x,e,r,a,l,P,d,z,"left",I,A,gu.vertical,!0,T,h,c));};if(!m&&C){for(var V="auto"===M?C.map((function(t){return rl(t)})):[M],D=!1,F=0;F<V.length;F++){var L=V[F];if(!y.horizontal[L])if(D)y.horizontal[L]=y.horizontal[0];else {var R=_u(x,e,r,a,l,P,d,"center",L,I,A,gu.horizontal,!1,T,h,c);R&&(y.horizontal[L]=R,D=1===R.positionedLines.length);}}B();}else {"auto"===M&&(M=rl(z));var O=_u(x,e,r,a,l,P,d,z,M,I,A,gu.horizontal,!1,T,h,c);O&&(y.horizontal[M]=O),B(),$n(S)&&m&&v&&(y.vertical=_u(x,e,r,a,l,P,d,z,M,I,A,gu.vertical,!1,T,h,c));}}var U=void 0,j=!1;if(o.icon&&o.icon.name){var q=n[o.icon.name];q&&(U=function(t,e,r){var n=Eu(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,a=e[1]-t.displaySize[1]*n.verticalAlign;return {image:t,top:a,bottom:a+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(a[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),j=q.sdf,void 0===t.sdfIcons?t.sdfIcons=q.sdf:t.sdfIcons!==q.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(q.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0));}var N=il(y.horizontal)||y.vertical;t.iconsInText=!!N&&N.iconsInText,(N||U)&&function(t,e,r,n,a,o,s,u,l,p,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var f,y=t.layers[0].layout,d=y.get("icon-offset").evaluate(e,{},c),m=il(r.horizontal),v=s/24,g=t.tilePixelRatio*v,x=t.tilePixelRatio*h/24,b=t.tilePixelRatio*u,_=t.tilePixelRatio*y.get("symbol-spacing"),A=y.get("text-padding")*t.tilePixelRatio,S=y.get("icon-padding")*t.tilePixelRatio,k=y.get("text-max-angle")/180*Math.PI,I="map"===y.get("text-rotation-alignment")&&"point"!==y.get("symbol-placement"),z="map"===y.get("icon-rotation-alignment")&&"point"!==y.get("symbol-placement"),C=y.get("symbol-placement"),E=_/2,M=y.get("icon-text-fit");n&&"none"!==M&&(t.allowVerticalPlacement&&r.vertical&&(f=Tu(n,r.vertical,M,y.get("icon-text-fit-padding"),d,v)),m&&(n=Tu(n,m,M,y.get("icon-text-fit-padding"),d,v)));var T=function(i,s){s.x<0||s.x>=8192||s.y<0||s.y>=8192||function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_,A,S){var k,I,z,C,E,M=t.addToLineVertexArray(e,r),T=0,P=0,B=0,V=0,D=-1,F=-1,L={},R=da(""),O=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(O=(k=s.layout.get("text-offset").evaluate(b,{},S).map((function(t){return 24*t})))[0],U=k[1]):(O=24*s.layout.get("text-radial-offset").evaluate(b,{},S),U=tl),t.allowVerticalPlacement&&n.vertical){var j=s.layout.get("text-rotate").evaluate(b,{},S)+90;C=new Ju(u,r,e,l,p,c,n.vertical,h,f,y,t.overscaling,j),o&&(E=new Ju(u,r,e,l,p,c,o,m,v,y,t.overscaling,j));}if(i){var q=s.layout.get("icon-rotate").evaluate(b,{}),N="none"!==s.layout.get("icon-text-fit"),G=Nu(i,q,A,N),K=o?Nu(o,q,A,N):void 0;z=new Ju(u,r,e,l,p,c,i,m,v,!1,t.overscaling,q),T=4*G.length;var X=t.iconSizeData,Z=null;"source"===X.kind?(Z=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Z=[128*_.compositeIconSizes[0].evaluate(b,{},S),128*_.compositeIconSizes[1].evaluate(b,{},S)])[0]>32640||Z[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,Z,x,g,b,!1,e,M.lineStartIndex,M.lineLength,-1,S),D=t.icon.placedSymbolArray.length-1,K&&(P=4*K.length,t.addSymbols(t.icon,K,Z,x,g,b,gu.vertical,e,M.lineStartIndex,M.lineLength,-1,S),F=t.icon.placedSymbolArray.length-1);}for(var J in n.horizontal){var Y=n.horizontal[J];if(!I){R=da(Y.text);var H=s.layout.get("text-rotate").evaluate(b,{},S);I=new Ju(u,r,e,l,p,c,Y,h,f,y,t.overscaling,H);}var $=1===Y.positionedLines.length;if(B+=nl(t,e,Y,a,s,y,b,d,M,n.vertical?gu.horizontal:gu.horizontalOnly,$?Object.keys(n.horizontal):[J],L,D,_,S),$)break}n.vertical&&(V+=nl(t,e,n.vertical,a,s,y,b,d,M,gu.vertical,["vertical"],L,F,_,S));var W=I?I.boxStartIndex:t.collisionBoxArray.length,Q=I?I.boxEndIndex:t.collisionBoxArray.length,tt=C?C.boxStartIndex:t.collisionBoxArray.length,et=C?C.boxEndIndex:t.collisionBoxArray.length,rt=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length,it=E?E.boxStartIndex:t.collisionBoxArray.length,at=E?E.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=fl.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,D,F,R,W,Q,tt,et,rt,nt,it,at,l,B,V,T,P,0,h,O,U);}(t,s,i,r,n,a,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,A,I,l,b,S,z,d,e,o,p,c);};if("line"===C)for(var P=0,B=function(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,p=0;p<u.length-1;p++){var c=u[p],h=u[p+1];c.x<0&&h.x<0||(c.x<0?c=new i(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x<0&&(h=new i(0,c.y+(0-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y<0&&h.y<0||(c.y<0?c=new i(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round():h.y<0&&(h=new i(c.x+(0-c.y)/(h.y-c.y)*(h.x-c.x),0)._round()),c.x>=n&&h.x>=n||(c.x>=n?c=new i(n,c.y+(n-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=n&&(h=new i(n,c.y+(n-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=a&&h.y>=a||(c.y>=a?c=new i(c.x+(a-c.y)/(h.y-c.y)*(h.x-c.x),a)._round():h.y>=a&&(h=new i(c.x+(a-c.y)/(h.y-c.y)*(h.x-c.x),a)._round()),l&&c.equals(l[l.length-1])||o.push(l=[c]),l.push(h)))));}return o}(e.geometry,0,0,8192,8192);P<B.length;P+=1)for(var V=B[P],D=0,F=qu(V,_,k,r.vertical||m,n,24,x,t.overscaling,8192);D<F.length;D+=1){var L=F[D];m&&al(t,m.text,E,L)||T(V,L);}else if("line-center"===C)for(var R=0,O=e.geometry;R<O.length;R+=1){var U=O[R];if(U.length>1){var j=ju(U,k,r.vertical||m,n,24,x);j&&T(U,j);}}else if("Polygon"===e.type)for(var q=0,N=es(e.geometry,0);q<N.length;q+=1){var G=N[q],K=$u(G,16);T(G[0],new Pu(K.x,K.y,0));}else if("LineString"===e.type)for(var X=0,Z=e.geometry;X<Z.length;X+=1){var J=Z[X];T(J,new Pu(J[0].x,J[0].y,0));}else if("Point"===e.type)for(var Y=0,H=e.geometry;Y<H.length;Y+=1)for(var $=0,W=H[Y];$<W.length;$+=1){var Q=W[$];T([Q],new Pu(Q.x,Q.y,0));}}(t,o,y,U,n,p,h,f,A,j,s);},b=0,_=t.features;b<_.length;b+=1)x();o&&t.generateCollisionDebugBuffers();},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(a=1/(n-i)),t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=c,t.plugin=ci,t.polygonIntersectsPolygon=Ga,t.postMapLoadEvent=at,t.postTurnstileEvent=nt,t.potpack=yu,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Nn,t.registerForPluginStateChange=function(t){return t({pluginStatus:ii,pluginURL:ai}),ui.on("pluginStateChange",t),t},t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=n*-s+a*u,t[3]=i*-s+o*u,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],p=e[9],c=e[10],h=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]=a*i+l*n,t[5]=o*i+p*n,t[6]=s*i+c*n,t[7]=u*i+h*n,t[8]=l*i-a*n,t[9]=p*i-o*n,t[10]=c*i-s*n,t[11]=h*i-u*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],p=e[5],c=e[6],h=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]=a*i+l*n,t[1]=o*i+p*n,t[2]=s*i+c*n,t[3]=u*i+h*n,t[4]=l*i-a*n,t[5]=p*i-o*n,t[6]=c*i-s*n,t[7]=h*i-u*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){ot=t,st=e;},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===ii||"loading"===ii||"loaded"===ii)throw new Error("setRTLTextPlugin cannot be called multiple times.");ai=L.resolveURL(t),ii="deferred",ni=e,si(),r||pi();},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Et,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Fu,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=uo,t.translate=function(t,e,r){var n,i,a,o,s,u,l,p,c,h,f,y,d=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*d+e[4]*m+e[8]*v+e[12],t[13]=e[1]*d+e[5]*m+e[9]*v+e[13],t[14]=e[2]*d+e[6]*m+e[10]*v+e[14],t[15]=e[3]*d+e[7]*m+e[11]*v+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],p=e[7],c=e[8],h=e[9],f=e[10],y=e[11],t[0]=n=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=p,t[8]=c,t[9]=h,t[10]=f,t[11]=y,t[12]=n*d+s*m+c*v+e[12],t[13]=i*d+u*m+h*v+e[13],t[14]=a*d+l*m+f*v+e[14],t[15]=o*d+p*m+y*v+e[15]),t},t.triggerPluginCompletionEvent=oi,t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Vn,t.validateStyle=Bn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=gs,t.version="16.8.0",t.warnOnce=w,t.webpSupported=O,t.window=self,t.wrap=l;}));
|
|
30
30
|
|
|
31
|
-
define(["./shared"],(function(e){"use strict";function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i="[",o=0,n=e;o<n.length;o+=1)i+=t(n[o])+",";return i+"]"}for(var a=Object.keys(e).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+t(e[a[l]])+",";return s+"}"}function r(r){for(var i="",o=0,n=e.refProperties;o<n.length;o+=1)i+="/"+t(r[n[o]]);return i}var i=function(e){this.keyCache={},e&&this.replace(e);};i.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[]);},i.prototype.update=function(t,i){for(var o=this,n=0,a=t;n<a.length;n+=1){var s=a[n];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id];}for(var u=0,h=i;u<h.length;u+=1){var c=h[u];delete this.keyCache[c],delete this._layerConfigs[c],delete this._layers[c];}this.familiesBySource={};for(var p=0,f=function(e,t){for(var i={},o=0;o<e.length;o++){var n=t&&t[e[o].id]||r(e[o]);t&&(t[e[o].id]=n);var a=i[n];a||(a=i[n]=[]),a.push(e[o]);}var s=[];for(var l in i)s.push(i[l]);return s}(e.values(this._layerConfigs),this.keyCache);p<f.length;p+=1){var d=f[p].map((function(e){return o._layers[e.id]})),g=d[0];if("none"!==g.visibility){var v=g.source||"",m=this.familiesBySource[v];m||(m=this.familiesBySource[v]={});var y=g.sourceLayer||"_geojsonTileLayer",x=m[y];x||(x=m[y]=[]),x.push(d);}}};var o=function(t){var r={},i=[];for(var o in t){var n=t[o],a=r[o]={};for(var s in n){var l=n[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};i.push(u),a[s]={rect:u,metrics:l.metrics};}}}var h=e.potpack(i),c=new e.AlphaImage({width:h.w||1,height:h.h||1});for(var p in t){var f=t[p];for(var d in f){var g=f[+d];if(g&&0!==g.bitmap.width&&0!==g.bitmap.height){var v=r[p][d].rect;e.AlphaImage.copy(g.bitmap,c,{x:0,y:0},{x:v.x+1,y:v.y+1},g.bitmap);}}}this.image=c,this.positions=r;};e.register("GlyphAtlas",o);var n=function(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId;};function a(t,r,i){for(var o=new e.EvaluationParameters(r),n=0,a=t;n<a.length;n+=1)a[n].recalculate(o,i);}function s(t,r){var i=e.getArrayBuffer(t.request,(function(t,i,o,n){t?r(t):i&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(i)),rawData:i,cacheControl:o,expires:n});}));return function(){i.cancel(),r();}}n.prototype.parse=function(t,r,i,n,s){var l=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var u=new e.DictionaryCoder(Object.keys(t.layers).sort()),h=new e.FeatureIndex(this.tileID,this.promoteId);h.bucketLayerIDs=[];var c,p,f,d,g={},v={featureIndex:h,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},m=r.familiesBySource[this.source];for(var y in m){var x=t.layers[y];if(x){1===x.version&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var w=u.encode(y),S=[],I=0;I<x.length;I++){var M=x.feature(I),b=h.getId(M,y);S.push({feature:M,id:b,index:I,sourceLayerIndex:w});}for(var P=0,_=m[y];P<_.length;P+=1){var k=_[P],T=k[0];T.minzoom&&this.zoom<Math.floor(T.minzoom)||T.maxzoom&&this.zoom>=T.maxzoom||"none"!==T.visibility&&(a(k,this.zoom,i),(g[T.id]=T.createBucket({index:h.bucketLayerIDs.length,layers:k,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:w,sourceID:this.source})).populate(S,v,this.tileID.canonical),h.bucketLayerIDs.push(k.map((function(e){return e.id}))));}}}var C=e.mapObject(v.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(C).length?n.send("getGlyphs",{uid:this.uid,stacks:C},(function(e,t){c||(c=e,p=t,z.call(l));})):p={};var D=Object.keys(v.iconDependencies);D.length?n.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){c||(c=e,f=t,z.call(l));})):f={};var L=Object.keys(v.patternDependencies);function z(){if(c)return s(c);if(p&&f&&d){var t=new o(p),r=new e.ImageAtlas(f,d);for(var n in g){var l=g[n];l instanceof e.SymbolBucket?(a(l.layers,this.zoom,i),e.performSymbolLayout(l,p,t.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(a(l.layers,this.zoom,i),l.addFeatures(v,this.tileID.canonical,r.patternPositions));}this.status="done",s(null,{buckets:e.values(g).filter((function(e){return !e.isEmpty()})),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null});}}L.length?n.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){c||(c=e,d=t,z.call(l));})):d={},z.call(this);};var l=function(e,t,r,i){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||s,this.loading={},this.loaded={};};l.prototype.loadTile=function(t,r){var i=this,o=t.uid;this.loading||(this.loading={});var a=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[o]=new n(t);s.abort=this.loadVectorData(t,(function(t,n){if(delete i.loading[o],t||!n)return s.status="done",i.loaded[o]=s,r(t);var l=n.rawData,u={};n.expires&&(u.expires=n.expires),n.cacheControl&&(u.cacheControl=n.cacheControl);var h={};if(a){var c=a.finish();c&&(h.resourceTiming=JSON.parse(JSON.stringify(c)));}s.vectorTile=n.vectorTile,s.parse(n.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(t,i){if(t||!i)return r(t);r(null,e.extend({rawTileData:l.slice(0)},i,u,h));})),i.loaded=i.loaded||{},i.loaded[o]=s;}));},l.prototype.reloadTile=function(e,t){var r=this,i=this.loaded,o=e.uid,n=this;if(i&&i[o]){var a=i[o];a.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,i){var o=a.reloadCallback;o&&(delete a.reloadCallback,a.parse(a.vectorTile,n.layerIndex,r.availableImages,n.actor,o)),t(e,i);};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s());}},l.prototype.abortTile=function(e,t){var r=this.loading,i=e.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),t();},l.prototype.removeTile=function(e,t){var r=this.loaded,i=e.uid;r&&r[i]&&delete r[i],t();};var u=e.window.ImageBitmap,h=function(){this.loaded={};};function c(e,t){if(0!==e.length){p(e[0],t);for(var r=1;r<e.length;r++)p(e[r],!t);}}function p(e,t){for(var r=0,i=0,o=0,n=e.length,a=n-1;o<n;a=o++){var s=(e[o][0]-e[a][0])*(e[a][1]+e[o][1]),l=r+s;i+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l;}r+i>=0!=!!t&&e.reverse();}h.prototype.loadTile=function(t,r){var i=t.uid,o=t.encoding,n=t.rawImageData,a=u&&n instanceof u?this.getImageData(n):n,s=new e.DEMData(i,a,o);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s);},h.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},h.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var f=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10));};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var o=i[r];t.push([new e.Point$1(o[0],o[1])]);}return t}for(var n=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],u=0,h=s[a];u<h.length;u+=1){var c=h[u];l.push(new e.Point$1(c[0],c[1]));}n.push(l);}return n},d.prototype.toGeoJSON=function(e,t,r,i){return f.call(this,e,t,r,i)};var g=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t;};g.prototype.feature=function(e){return new d(this._features[e])};var v=e.vectorTile.VectorTileFeature,m=y;function y(e,t){this.options=t||{},this.features=e,this.length=e.length;}function x(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}y.prototype.feature=function(e){return new x(this.features[e],this.options.extent)},x.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var i=t[r],o=[],n=0;n<i.length;n++)o.push(new e.Point$1(i[n][0],i[n][1]));this.geometry.push(o);}return this.geometry},x.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,o=-1/0,n=0;n<e.length;n++)for(var a=e[n],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.y);}return [t,i,r,o]},x.prototype.toGeoJSON=v.prototype.toGeoJSON;var w=I,S=m;function I(t){var r=new e.pbf;return function(e,t){for(var r in e.layers)t.writeMessage(3,M,e.layers[r]);}(t,r),r.finish()}function M(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,b,i);var o=i.keys;for(r=0;r<o.length;r++)t.writeStringField(3,o[r]);var n=i.values;for(r=0;r<n.length;r++)t.writeMessage(4,C,n[r]);}function b(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,P,e),t.writeVarintField(3,r.type),t.writeMessage(4,T,r);}function P(e,t){var r=e.feature,i=e.keys,o=e.values,n=e.keycache,a=e.valuecache;for(var s in r.properties){var l=r.properties[s],u=n[s];if(null!==l){void 0===u&&(i.push(s),n[s]=u=i.length-1),t.writeVarint(u);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var c=h+":"+l,p=a[c];void 0===p&&(o.push(l),a[c]=p=o.length-1),t.writeVarint(p);}}}function _(e,t){return (t<<3)+(7&e)}function k(e){return e<<1^e>>31}function T(e,t){for(var r=e.loadGeometry(),i=e.type,o=0,n=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;1===i&&(u=l.length),t.writeVarint(_(1,u));for(var h=3===i?l.length-1:l.length,c=0;c<h;c++){1===c&&1!==i&&t.writeVarint(_(2,h-1));var p=l[c].x-o,f=l[c].y-n;t.writeVarint(k(p)),t.writeVarint(k(f)),o+=p,n+=f;}3===i&&t.writeVarint(_(7,1));}}function C(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}function D(e,t,r,i){L(e,r,i),L(t,2*r,2*i),L(t,2*r+1,2*i+1);}function L(e,t,r){var i=e[t];e[t]=e[r],e[r]=i;}function z(e,t,r,i){var o=e-r,n=t-i;return o*o+n*n}w.fromVectorTileJs=I,w.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var i in e)r[i]=new m(e[i].features,t),r[i].name=i,r[i].version=t.version,r[i].extent=t.extent;return I({layers:r})},w.GeoJSONWrapper=S;var O=function(e){return e[0]},E=function(e){return e[1]},N=function(e,t,r,i,o){void 0===t&&(t=O),void 0===r&&(r=E),void 0===i&&(i=64),void 0===o&&(o=Float64Array),this.nodeSize=i,this.points=e;for(var n=e.length<65536?Uint16Array:Uint32Array,a=this.ids=new n(e.length),s=this.coords=new o(2*e.length),l=0;l<e.length;l++)a[l]=l,s[2*l]=t(e[l]),s[2*l+1]=r(e[l]);!function e(t,r,i,o,n,a){if(!(n-o<=i)){var s=o+n>>1;!function e(t,r,i,o,n,a){for(;n>o;){if(n-o>600){var s=n-o+1,l=i-o+1,u=Math.log(s),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(s-h)/s)*(l-s/2<0?-1:1);e(t,r,i,Math.max(o,Math.floor(i-l*h/s+c)),Math.min(n,Math.floor(i+(s-l)*h/s+c)),a);}var p=r[2*i+a],f=o,d=n;for(D(t,r,o,i),r[2*n+a]>p&&D(t,r,o,n);f<d;){for(D(t,r,f,d),f++,d--;r[2*f+a]<p;)f++;for(;r[2*d+a]>p;)d--;}r[2*o+a]===p?D(t,r,o,d):D(t,r,++d,n),d<=i&&(o=d+1),i<=d&&(n=d-1);}}(t,r,s,o,n,a%2),e(t,r,i,o,s-1,a+1),e(t,r,i,s+1,n,a+1);}}(a,s,i,0,a.length-1,0);};N.prototype.range=function(e,t,r,i){return function(e,t,r,i,o,n,a){for(var s,l,u=[0,e.length-1,0],h=[];u.length;){var c=u.pop(),p=u.pop(),f=u.pop();if(p-f<=a)for(var d=f;d<=p;d++)l=t[2*d+1],(s=t[2*d])>=r&&s<=o&&l>=i&&l<=n&&h.push(e[d]);else {var g=Math.floor((f+p)/2);l=t[2*g+1],(s=t[2*g])>=r&&s<=o&&l>=i&&l<=n&&h.push(e[g]);var v=(c+1)%2;(0===c?r<=s:i<=l)&&(u.push(f),u.push(g-1),u.push(v)),(0===c?o>=s:n>=l)&&(u.push(g+1),u.push(p),u.push(v));}}return h}(this.ids,this.coords,e,t,r,i,this.nodeSize)},N.prototype.within=function(e,t,r){return function(e,t,r,i,o,n){for(var a=[0,e.length-1,0],s=[],l=o*o;a.length;){var u=a.pop(),h=a.pop(),c=a.pop();if(h-c<=n)for(var p=c;p<=h;p++)z(t[2*p],t[2*p+1],r,i)<=l&&s.push(e[p]);else {var f=Math.floor((c+h)/2),d=t[2*f],g=t[2*f+1];z(d,g,r,i)<=l&&s.push(e[f]);var v=(u+1)%2;(0===u?r-o<=d:i-o<=g)&&(a.push(c),a.push(f-1),a.push(v)),(0===u?r+o>=d:i+o>=g)&&(a.push(f+1),a.push(h),a.push(v));}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)};var F={crs:"EPSG:3857",minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},G=function(e){this.options=X(Object.create(F),e),this.trees=new Array(this.options.maxZoom+1);};function J(e,t,r,i,o){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:o}}function Z(e,t,r){var i=e.geometry.coordinates,o=i[1];return {x:Y(i[0]),y:j(o,r),zoom:1/0,index:t,parentId:-1}}function A(e,t){return {type:"Feature",id:e.id,properties:B(e),geometry:{type:"Point",coordinates:[(r=e.x,360*(r-.5)),V(e.y,t)]}};var r;}function B(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return X(X({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function Y(e,t){return e/360+.5}function j(e,t){var r;if(t&&"EPSG:3857"!==t)r=(90-e)/360;else {var i=Math.sin(e*Math.PI/180);r=.5-.25*Math.log((1+i)/(1-i))/Math.PI;}return r<0?0:r>1?1:r}function V(e,t){if(t&&"EPSG:3857"!==t)return 90-360*e;var r=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(r))/Math.PI-90}function X(e,t){for(var r in t)e[r]=t[r];return e}function W(e){return e.x}function R(e){return e.y}function q(e,t,r,i,o,n){var a=o-r,s=n-i;if(0!==a||0!==s){var l=((e-r)*a+(t-i)*s)/(a*a+s*s);l>1?(r=o,i=n):l>0&&(r+=a*l,i+=s*l);}return (a=e-r)*a+(s=t-i)*s}function U(e,t,r,i){var o={id:null==e?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)$(o,r);else if("Polygon"===t)$(o,r[0]);else if("MultiLineString"===t)for(var n=0,a=r;n<a.length;n+=1)$(o,a[n]);else if("MultiPolygon"===t)for(var s=0,l=r;s<l.length;s+=1)$(o,l[s][0]);return o}function $(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1]);}function H(e,t,r,i){if(t.geometry){var o=r.crs,n=t.geometry.coordinates,a=t.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),l=[],u=t.id;if(r.promoteId?u=t.properties[r.promoteId]:r.generateId&&(u=i||0),"Point"===a)K(n,l,o);else if("MultiPoint"===a)for(var h=0,c=n;h<c.length;h+=1)K(c[h],l,o);else if("LineString"===a)Q(n,l,s,!1,o);else if("MultiLineString"===a){if(r.lineMetrics){for(var p=0,f=n;p<f.length;p+=1)Q(f[p],l=[],s,!1,o),e.push(U(u,"LineString",l,t.properties));return}ee(n,l,s,!1,o);}else if("Polygon"===a)ee(n,l,s,!0,o);else {if("MultiPolygon"!==a){if("GeometryCollection"===a){for(var d=0,g=t.geometry.geometries;d<g.length;d+=1)H(e,{id:u,geometry:g[d],properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(var v=0,m=n;v<m.length;v+=1){var y=[];ee(m[v],y,s,!0,o),l.push(y);}}e.push(U(u,a,l,t.properties));}}function K(e,t,r){t.push(te(e[0]),re(e[1],r),0);}function Q(e,t,r,i,o){for(var n,a,s=0,l=0;l<e.length;l++){var u=te(e[l][0]),h=re(e[l][1],o);t.push(u,h,0),l>0&&(s+=i?(n*h-u*a)/2:Math.sqrt(Math.pow(u-n,2)+Math.pow(h-a,2))),n=u,a=h;}var c=t.length-3;t[2]=1,function e(t,r,i,o){for(var n,a=o,s=i-r>>1,l=i-r,u=t[r],h=t[r+1],c=t[i],p=t[i+1],f=r+3;f<i;f+=3){var d=q(t[f],t[f+1],u,h,c,p);if(d>a)n=f,a=d;else if(d===a){var g=Math.abs(f-s);g<l&&(n=f,l=g);}}a>o&&(n-r>3&&e(t,r,n,o),t[n+2]=a,i-n>3&&e(t,n,i,o));}(t,0,c,r),t[c+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size;}function ee(e,t,r,i,o){for(var n=0;n<e.length;n++){var a=[];Q(e[n],a,r,i,o),t.push(a);}}function te(e,t){return e/360+.5}function re(e,t){var r;if(t&&"EPSG:3857"!==t)r=(90-e)/360;else {var i=Math.sin(e*Math.PI/180);r=.5-.25*Math.log((1+i)/(1-i))/Math.PI;}return r<0?0:r>1?1:r}function ie(e,t,r,i,o,n,a,s){if(i/=t,n>=(r/=t)&&a<i)return e;if(a<r||n>=i)return null;for(var l=[],u=0,h=e;u<h.length;u+=1){var c=h[u],p=c.geometry,f=c.type,d=0===o?c.minX:c.minY,g=0===o?c.maxX:c.maxY;if(d>=r&&g<i)l.push(c);else if(!(g<r||d>=i)){var v=[];if("Point"===f||"MultiPoint"===f)oe(p,v,r,i,o);else if("LineString"===f)ne(p,v,r,i,o,!1,s.lineMetrics);else if("MultiLineString"===f)se(p,v,r,i,o,!1);else if("Polygon"===f)se(p,v,r,i,o,!0);else if("MultiPolygon"===f)for(var m=0,y=p;m<y.length;m+=1){var x=[];se(y[m],x,r,i,o,!0),x.length&&v.push(x);}if(v.length){if(s.lineMetrics&&"LineString"===f){for(var w=0,S=v;w<S.length;w+=1)l.push(U(c.id,f,S[w],c.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===v.length?(f="LineString",v=v[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===v.length?"Point":"MultiPoint"),l.push(U(c.id,f,v,c.tags));}}}return l.length?l:null}function oe(e,t,r,i,o){for(var n=0;n<e.length;n+=3){var a=e[n+o];a>=r&&a<=i&&le(t,e[n],e[n+1],e[n+2]);}}function ne(e,t,r,i,o,n,a){for(var s,l,u=ae(e),h=0===o?ue:he,c=e.start,p=0;p<e.length-3;p+=3){var f=e[p],d=e[p+1],g=e[p+2],v=e[p+3],m=e[p+4],y=0===o?f:d,x=0===o?v:m,w=!1;a&&(s=Math.sqrt(Math.pow(f-v,2)+Math.pow(d-m,2))),y<r?x>r&&(l=h(u,f,d,v,m,r),a&&(u.start=c+s*l)):y>i?x<i&&(l=h(u,f,d,v,m,i),a&&(u.start=c+s*l)):le(u,f,d,g),x<r&&y>=r&&(l=h(u,f,d,v,m,r),w=!0),x>i&&y<=i&&(l=h(u,f,d,v,m,i),w=!0),!n&&w&&(a&&(u.end=c+s*l),t.push(u),u=ae(e)),a&&(c+=s);}var S=e.length-3,I=e[S],M=e[S+1],b=0===o?I:M;b>=r&&b<=i&&le(u,I,M,e[S+2]),S=u.length-3,n&&S>=3&&(u[S]!==u[0]||u[S+1]!==u[1])&&le(u,u[0],u[1],u[2]),u.length&&t.push(u);}function ae(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function se(e,t,r,i,o,n){for(var a=0,s=e;a<s.length;a+=1)ne(s[a],t,r,i,o,n,!1);}function le(e,t,r,i){e.push(t,r,i);}function ue(e,t,r,i,o,n){var a=(n-t)/(i-t);return le(e,n,r+(o-r)*a,1),a}function he(e,t,r,i,o,n){var a=(n-r)/(o-r);return le(e,t+(i-t)*a,n,1),a}function ce(e,t){for(var r=[],i=0;i<e.length;i++){var o=e[i],n=o.type,a=void 0;if("Point"===n||"MultiPoint"===n||"LineString"===n)a=pe(o.geometry,t);else if("MultiLineString"===n||"Polygon"===n){a=[];for(var s=0,l=o.geometry;s<l.length;s+=1)a.push(pe(l[s],t));}else if("MultiPolygon"===n){a=[];for(var u=0,h=o.geometry;u<h.length;u+=1){for(var c=[],p=0,f=h[u];p<f.length;p+=1)c.push(pe(f[p],t));a.push(c);}}r.push(U(o.id,n,a,o.tags));}return r}function pe(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function fe(e,t){if(e.transformed)return e;for(var r=1<<e.z,i=e.x,o=e.y,n=0,a=e.features;n<a.length;n+=1){var s=a[n],l=s.geometry,u=s.type;if(s.geometry=[],1===u)for(var h=0;h<l.length;h+=2)s.geometry.push(de(l[h],l[h+1],t,r,i,o));else for(var c=0;c<l.length;c++){for(var p=[],f=0;f<l[c].length;f+=2)p.push(de(l[c][f],l[c][f+1],t,r,i,o));s.geometry.push(p);}}return e.transformed=!0,e}function de(e,t,r,i,o,n){return [Math.round(r*(e*i-o)),Math.round(r*(t*i-n))]}function ge(e,t,r,i,o){for(var n=t===o.maxZoom?0:o.tolerance/((1<<t)*o.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0,l=e;s<l.length;s+=1)ve(a,l[s],n,o);return a}function ve(e,t,r,i){var o=t.geometry,n=t.type,a=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===n||"MultiPoint"===n)for(var s=0;s<o.length;s+=3)a.push(o[s],o[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===n)me(a,o,e,r,!1,!1);else if("MultiLineString"===n||"Polygon"===n)for(var l=0;l<o.length;l++)me(a,o[l],e,r,"Polygon"===n,0===l);else if("MultiPolygon"===n)for(var u=0;u<o.length;u++)for(var h=o[u],c=0;c<h.length;c++)me(a,h[c],e,r,!0,0===c);if(a.length){var p=t.tags||null;if("LineString"===n&&i.lineMetrics){for(var f in p={},t.tags)p[f]=t.tags[f];p.mapbox_clip_start=o.start/o.size,p.mapbox_clip_end=o.end/o.size;}var d={geometry:a,type:"Polygon"===n||"MultiPolygon"===n?3:"LineString"===n||"MultiLineString"===n?2:1,tags:p};null!==t.id&&(d.id=t.id),e.features.push(d);}}function me(e,t,r,i,o,n){var a=i*i;if(i>0&&t.size<(o?a:i))r.numPoints+=t.length/3;else {for(var s=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>a)&&(r.numSimplified++,s.push(t[l],t[l+1])),r.numPoints++;o&&function(e,t){for(var r=0,i=0,o=e.length,n=o-2;i<o;n=i,i+=2)r+=(e[i]-e[n])*(e[i+1]+e[n+1]);if(r>0===t)for(var a=0,s=e.length;a<s/2;a+=2){var l=e[a],u=e[a+1];e[a]=e[s-2-a],e[a+1]=e[s-1-a],e[s-2-a]=l,e[s-1-a]=u;}}(s,n),e.push(s);}}G.prototype.load=function(e){var t=this.options,r=t.log,i=t.minZoom,o=t.maxZoom,n=t.nodeSize,a=t.crs;r&&console.time("total time");var s="prepare "+e.length+" points";r&&console.time(s),this.points=e;for(var l=[],u=0;u<e.length;u++)e[u].geometry&&l.push(Z(e[u],u,a));this.trees[o+1]=new N(l,W,R,n,Float32Array),r&&console.timeEnd(s);for(var h=o;h>=i;h--){var c=+Date.now();l=this._cluster(l,h),this.trees[h]=new N(l,W,R,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",h,l.length,+Date.now()-c);}return r&&console.timeEnd("total time"),this},G.prototype.getClusters=function(e,t){var r=this.crs,i=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,n=180;else if(i>n){var s=this.getClusters([i,o,180,a],t),l=this.getClusters([-180,o,n,a],t);return s.concat(l)}for(var u=this.trees[this._limitZoom(t)],h=[],c=0,p=u.range(Y(i),j(a,r),Y(n),j(o,r));c<p.length;c+=1){var f=u.points[p[c]];h.push(f.numPoints?A(f,r):this.points[f.index]);}return h},G.prototype.getChildren=function(e){var t=this.crs,r=this._getOriginId(e),i=this._getOriginZoom(e),o="No cluster with the specified id.",n=this.trees[i];if(!n)throw new Error(o);var a=n.points[r];if(!a)throw new Error(o);for(var s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),l=[],u=0,h=n.within(a.x,a.y,s);u<h.length;u+=1){var c=n.points[h[u]];c.parentId===e&&l.push(c.numPoints?A(c,t):this.points[c.index]);}if(0===l.length)throw new Error(o);return l},G.prototype.getLeaves=function(e,t,r){var i=[];return this._appendLeaves(i,e,t=t||10,r=r||0,0),i},G.prototype.getTile=function(e,t,r){var i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),n=this.options,a=n.radius/n.extent,s=(r-a)/o,l=(r+1+a)/o,u={features:[]};return this._addTileFeatures(i.range((t-a)/o,s,(t+1+a)/o,l),i.points,t,r,o,u),0===t&&this._addTileFeatures(i.range(1-a/o,s,1,l),i.points,o,r,o,u),t===o-1&&this._addTileFeatures(i.range(0,s,a/o,l),i.points,-1,r,o,u),u.features.length?u:null},G.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id;}return t},G.prototype._appendLeaves=function(e,t,r,i,o){for(var n=0,a=this.getChildren(t);n<a.length;n+=1){var s=a[n],l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,r,i,o):o<i?o++:e.push(s),e.length===r)break}return o},G.prototype._addTileFeatures=function(e,t,r,i,o,n){for(var a=0,s=e;a<s.length;a+=1){var l=t[s[a]],u=l.numPoints,h={type:1,geometry:[[Math.round(this.options.extent*(l.x*o-r)),Math.round(this.options.extent*(l.y*o-i))]],tags:u?B(l):this.points[l.index].properties},c=void 0;u?c=l.id:this.options.generateId?c=l.index:this.points[l.index].id&&(c=this.points[l.index].id),void 0!==c&&(h.id=c),n.features.push(h);}},G.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))},G.prototype._cluster=function(e,t){for(var r=[],i=this.options,o=i.reduce,n=i.minPoints,a=i.radius/(i.extent*Math.pow(2,t)),s=0;s<e.length;s++){var l=e[s];if(!(l.zoom<=t)){l.zoom=t;for(var u=this.trees[t+1],h=u.within(l.x,l.y,a),c=l.numPoints||1,p=c,f=0,d=h;f<d.length;f+=1){var g=u.points[d[f]];g.zoom>t&&(p+=g.numPoints||1);}if(p>=n){for(var v=l.x*c,m=l.y*c,y=o&&c>1?this._map(l,!0):null,x=(s<<5)+(t+1)+this.points.length,w=0,S=h;w<S.length;w+=1){var I=u.points[S[w]];if(!(I.zoom<=t)){I.zoom=t;var M=I.numPoints||1;v+=I.x*M,m+=I.y*M,I.parentId=x,o&&(y||(y=this._map(l,!0)),o(y,this._map(I)));}}l.parentId=x,r.push(J(v/p,m/p,x,p,y));}else if(r.push(l),p>1)for(var b=0,P=h;b<P.length;b+=1){var _=u.points[P[b]];_.zoom<=t||(_.zoom=t,r.push(_));}}}return r},G.prototype._getOriginId=function(e){return e-this.points.length>>5},G.prototype._getOriginZoom=function(e){return (e-this.points.length)%32},G.prototype._map=function(e,t){if(e.numPoints)return t?X({},e.properties):e.properties;var r=this.points[e.index].properties,i=this.options.map(r);return t&&i===r?X({},i):i};var ye={crs:"EPSG:3857",maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},xe=function(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(ye),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)H(r,e.features[i],t,i);else H(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(e,t){var r=t.buffer/t.extent,i=e,o=ie(e,1,-1-r,r,0,-1,2,t),n=ie(e,1,1-r,2+r,0,-1,2,t);return (o||n)&&(i=ie(e,1,-r,1+r,0,-1,2,t)||[],o&&(i=ce(o,1).concat(i)),n&&(i=i.concat(ce(n,-1)))),i}(i,t)).length&&this.splitTile(i,0,0,0),r&&(i.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)));};function we(e,t,r){return 32*((1<<e)*r+t)+e}function Se(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);var o=new g(i.features),n=w(o);0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),t(null,{vectorTile:o,rawData:n.buffer});}xe.prototype.splitTile=function(e,t,r,i,o,n,a){for(var s=[e,t,r,i],l=this.options,u=l.debug;s.length;){i=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var h=1<<t,c=we(t,r,i),p=this.tiles[c];if(!p&&(u>1&&console.time("creation"),p=this.tiles[c]=ge(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(p.source=e,null==o){if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else {if(t===l.maxZoom||t===o)continue;if(null!=o){var d=o-t;if(r!==n>>d||i!==a>>d)continue}}if(p.source=null,0!==e.length){u>1&&console.time("clipping");var g=.5*l.buffer/l.extent,v=.5-g,m=.5+g,y=1+g,x=null,w=null,S=null,I=null,M=ie(e,h,r-g,r+m,0,p.minX,p.maxX,l),b=ie(e,h,r+v,r+y,0,p.minX,p.maxX,l);e=null,M&&(x=ie(M,h,i-g,i+m,1,p.minY,p.maxY,l),w=ie(M,h,i+v,i+y,1,p.minY,p.maxY,l),M=null),b&&(S=ie(b,h,i-g,i+m,1,p.minY,p.maxY,l),I=ie(b,h,i+v,i+y,1,p.minY,p.maxY,l),b=null),u>1&&console.timeEnd("clipping"),s.push(x||[],t+1,2*r,2*i),s.push(w||[],t+1,2*r,2*i+1),s.push(S||[],t+1,2*r+1,2*i),s.push(I||[],t+1,2*r+1,2*i+1);}}},xe.prototype.getTile=function(e,t,r){var i=this.options,o=i.extent,n=i.debug;if((e=+e)<0||e>24)return null;var a=1<<e,s=we(e,t=(t=+t)+a&a-1,r=+r);if(this.tiles[s])return fe(this.tiles[s],o);n>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,h=t,c=r;!l&&u>0;)u--,l=this.tiles[we(u,h>>=1,c>>=1)];return l&&l.source?(n>1&&(console.log("found parent tile z%d-%d-%d",u,h,c),console.time("drilling down")),this.splitTile(l.source,u,h,c,e,t,r),n>1&&console.timeEnd("drilling down"),this.tiles[s]?fe(this.tiles[s],o):null):null};var Ie=function(t){function r(e,r,i,o){t.call(this,e,r,i,Se),o&&(this.loadGeoJSON=o);}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData());},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var o=!!(i&&i.request&&i.request.collectResourceTiming)&&new e.RequestPerformance(i.request);this.loadGeoJSON(i,(function(n,a){if(n||!a)return r(n);if("object"!=typeof a)return r(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function e(t,r){var i,o=t&&t.type;if("FeatureCollection"===o)for(i=0;i<t.features.length;i++)e(t.features[i],r);else if("GeometryCollection"===o)for(i=0;i<t.geometries.length;i++)e(t.geometries[i],r);else if("Feature"===o)e(t.geometry,r);else if("Polygon"===o)c(t.coordinates,r);else if("MultiPolygon"===o)for(i=0;i<t.coordinates.length;i++)c(t.coordinates[i],r);return t}(a,!0);try{t._geoJSONIndex=i.cluster?new G(function(t){var r=t.superclusterOptions,i=t.clusterProperties;if(!i||!r)return r;for(var o={},n={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(i),u=0,h=l;u<h.length;u+=1){var c=h[u],p=i[c],f=p[0],d=e.createExpression(p[1]),g=e.createExpression("string"==typeof f?[f,["accumulated"],["get",c]]:f);o[c]=d.value,n[c]=g.value;}return r.map=function(e){s.properties=e;for(var t={},r=0,i=l;r<i.length;r+=1){var n=i[r];t[n]=o[n].evaluate(a,s);}return t},r.reduce=function(e,t){s.properties=t;for(var r=0,i=l;r<i.length;r+=1){var o=i[r];a.accumulated=e[o],e[o]=n[o].evaluate(a,s);}},r}(i)).load(a.features):function(e,t){return new xe(e,t)}(a,i.geojsonVtOptions);}catch(n){return r(n)}t.loaded={};var s={};if(o){var l=o.finish();l&&(s.resourceTiming={},s.resourceTiming[i.source]=JSON.parse(JSON.stringify(l)));}r(null,s);}));}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData());},r.prototype.reloadTile=function(e,r){var i=this.loaded;return i&&i[e.uid]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else {if("string"!=typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t();},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId));}catch(e){t(e);}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId));}catch(e){t(e);}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset));}catch(e){t(e);}},r}(l),Me=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,mbtiles:l,geojson:Ie,rasteroffline:e.RasterTileSourceOffline},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t;},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText;};};return Me.prototype.setReferrer=function(e,t){this.referrer=t;},Me.prototype.setImages=function(e,t,r){this.availableImages[e]=t,r();},Me.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r();},Me.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r();},Me.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r);},Me.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r);},Me.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r);},Me.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r);},Me.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r);},Me.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);},Me.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,r):r();}},Me.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r();}catch(e){r(e.toString());}},Me.prototype.syncRTLPluginState=function(t,r,i){try{e.plugin.setState(r);var o=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=o){this.self.importScripts(o);var n=e.plugin.isParsed();i(n?void 0:new Error("RTL Text Plugin failed to import scripts from "+o),n);}}catch(e){i(e.toString());}},Me.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||(t=[]),t},Me.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new i),t},Me.prototype.getWorkerSource=function(e,t,r){var i=this;return this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),this.workerSources[e][t][r]||(this.workerSources[e][t][r]=new this.workerSourceTypes[t]({send:function(t,r,o){i.actor.send(t,r,o,e);}},this.getLayerIndex(e),this.getAvailableImages(e))),this.workerSources[e][t][r]},Me.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new h),this.demWorkerSources[e][t]},Me.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit(r);},"undefined"!=typeof WorkerGlobalScope&&void 0!==e.window&&e.window instanceof WorkerGlobalScope&&(e.window.worker=new Me(e.window)),Me}));
|
|
31
|
+
define(["./shared"],(function(t){"use strict";function i(t){var s=typeof t;if("number"===s||"boolean"===s||"string"===s||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var e="[",a=0,h=t;a<h.length;a+=1)e+=i(h[a])+",";return e+"]"}for(var r=Object.keys(t).sort(),n="{",o=0;o<r.length;o++)n+=JSON.stringify(r[o])+":"+i(t[r[o]])+",";return n+"}"}function s(s){for(var e="",a=0,h=t.refProperties;a<h.length;a+=1)e+="/"+i(s[h[a]]);return e}var e=function(t){this.keyCache={},t&&this.replace(t);};e.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[]);},e.prototype.update=function(i,e){for(var a=this,h=0,r=i;h<r.length;h+=1){var n=r[h];this._layerConfigs[n.id]=n;var o=this._layers[n.id]=t.createStyleLayer(n);o._featureFilter=t.featureFilter(o.filter),this.keyCache[n.id]&&delete this.keyCache[n.id];}for(var l=0,u=e;l<u.length;l+=1){var c=u[l];delete this.keyCache[c],delete this._layerConfigs[c],delete this._layers[c];}this.familiesBySource={};for(var f=0,p=function(t,i){for(var e={},a=0;a<t.length;a++){var h=i&&i[t[a].id]||s(t[a]);i&&(i[t[a].id]=h);var r=e[h];r||(r=e[h]=[]),r.push(t[a]);}var n=[];for(var o in e)n.push(e[o]);return n}(t.values(this._layerConfigs),this.keyCache);f<p.length;f+=1){var d=p[f].map((function(t){return a._layers[t.id]})),M=d[0];if("none"!==M.visibility){var m=M.source||"",g=this.familiesBySource[m];g||(g=this.familiesBySource[m]={});var y=M.sourceLayer||"_geojsonTileLayer",v=g[y];v||(v=g[y]=[]),v.push(d);}}};var a=function(i){var s={},e=[];for(var a in i){var h=i[a],r=s[a]={};for(var n in h){var o=h[+n];if(o&&0!==o.bitmap.width&&0!==o.bitmap.height){var l={x:0,y:0,w:o.bitmap.width+2,h:o.bitmap.height+2};e.push(l),r[n]={rect:l,metrics:o.metrics};}}}var u=t.potpack(e),c=new t.AlphaImage({width:u.w||1,height:u.h||1});for(var f in i){var p=i[f];for(var d in p){var M=p[+d];if(M&&0!==M.bitmap.width&&0!==M.bitmap.height){var m=s[f][d].rect;t.AlphaImage.copy(M.bitmap,c,{x:0,y:0},{x:m.x+1,y:m.y+1},M.bitmap);}}}this.image=c,this.positions=s;};t.register("GlyphAtlas",a);var h=function(i){this.tileID=new t.OverscaledTileID(i.tileID.overscaledZ,i.tileID.wrap,i.tileID.canonical.z,i.tileID.canonical.x,i.tileID.canonical.y),this.uid=i.uid,this.zoom=i.zoom,this.pixelRatio=i.pixelRatio,this.tileSize=i.tileSize,this.source=i.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=i.showCollisionBoxes,this.collectResourceTiming=!!i.collectResourceTiming,this.returnDependencies=!!i.returnDependencies,this.promoteId=i.promoteId;};function r(i,s,e){for(var a=new t.EvaluationParameters(s),h=0,r=i;h<r.length;h+=1)r[h].recalculate(a,e);}function n(i,s){var e=t.getArrayBuffer(i.request,(function(i,e,a,h){i?s(i):e&&s(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(e)),rawData:e,cacheControl:a,expires:h});}));return function(){e.cancel(),s();}}h.prototype.parse=function(i,s,e,h,n){var o=this;this.status="parsing",this.data=i,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(i.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var c,f,p,d,M={},m={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:e},g=s.familiesBySource[this.source];for(var y in g){var v=i.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=l.encode(y),_=[],b=0;b<v.length;b++){var w=v.feature(b),S=u.getId(w,y);_.push({feature:w,id:S,index:b,sourceLayerIndex:x});}for(var C=0,P=g[y];C<P.length;C+=1){var I=P[C],N=I[0];N.minzoom&&this.zoom<Math.floor(N.minzoom)||N.maxzoom&&this.zoom>=N.maxzoom||"none"!==N.visibility&&(r(I,this.zoom,e),(M[N.id]=N.createBucket({index:u.bucketLayerIDs.length,layers:I,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(_,m,this.tileID.canonical),u.bucketLayerIDs.push(I.map((function(t){return t.id}))));}}}var k=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(k).length?h.send("getGlyphs",{uid:this.uid,stacks:k},(function(t,i){c||(c=t,f=i,A.call(o));})):f={};var E=Object.keys(m.iconDependencies);E.length?h.send("getImages",{icons:E,source:this.source,tileID:this.tileID,type:"icons"},(function(t,i){c||(c=t,p=i,A.call(o));})):p={};var O=Object.keys(m.patternDependencies);function A(){if(c)return n(c);if(f&&p&&d){var i=new a(f),s=new t.ImageAtlas(p,d);for(var h in M){var o=M[h];o instanceof t.SymbolBucket?(r(o.layers,this.zoom,e),t.performSymbolLayout(o,f,i.positions,p,s.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):o.hasPattern&&(o instanceof t.LineBucket||o instanceof t.FillBucket||o instanceof t.FillExtrusionBucket)&&(r(o.layers,this.zoom,e),o.addFeatures(m,this.tileID.canonical,s.patternPositions));}this.status="done",n(null,{buckets:t.values(M).filter((function(t){return !t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:i.image,imageAtlas:s,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?i.positions:null});}}O.length?h.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,i){c||(c=t,d=i,A.call(o));})):d={},A.call(this);};var o=function(t,i,s,e){this.actor=t,this.layerIndex=i,this.availableImages=s,this.loadVectorData=e||n,this.loading={},this.loaded={};};o.prototype.loadTile=function(i,s){var e=this,a=i.uid;this.loading||(this.loading={});var r=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request),n=this.loading[a]=new h(i);n.abort=this.loadVectorData(i,(function(i,h){if(delete e.loading[a],i||!h)return n.status="done",e.loaded[a]=n,s(i);var o=h.rawData,l={};h.expires&&(l.expires=h.expires),h.cacheControl&&(l.cacheControl=h.cacheControl);var u={};if(r){var c=r.finish();c&&(u.resourceTiming=JSON.parse(JSON.stringify(c)));}n.vectorTile=h.vectorTile,n.parse(h.vectorTile,e.layerIndex,e.availableImages,e.actor,(function(i,e){if(i||!e)return s(i);s(null,t.extend({rawTileData:o.slice(0)},e,l,u));})),e.loaded=e.loaded||{},e.loaded[a]=n;}));},o.prototype.reloadTile=function(t,i){var s=this,e=this.loaded,a=t.uid,h=this;if(e&&e[a]){var r=e[a];r.showCollisionBoxes=t.showCollisionBoxes;var n=function(t,e){var a=r.reloadCallback;a&&(delete r.reloadCallback,r.parse(r.vectorTile,h.layerIndex,s.availableImages,h.actor,a)),i(t,e);};"parsing"===r.status?r.reloadCallback=n:"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,n):n());}},o.prototype.abortTile=function(t,i){var s=this.loading,e=t.uid;s&&s[e]&&s[e].abort&&(s[e].abort(),delete s[e]),i();},o.prototype.removeTile=function(t,i){var s=this.loaded,e=t.uid;s&&s[e]&&delete s[e],i();};var l=t.window.ImageBitmap,u=function(){this.loaded={};};function c(t,i){if(0!==t.length){f(t[0],i);for(var s=1;s<t.length;s++)f(t[s],!i);}}function f(t,i){for(var s=0,e=0,a=0,h=t.length,r=h-1;a<h;r=a++){var n=(t[a][0]-t[r][0])*(t[r][1]+t[a][1]),o=s+n;e+=Math.abs(s)>=Math.abs(n)?s-o+n:n-o+s,s=o;}s+e>=0!=!!i&&t.reverse();}u.prototype.loadTile=function(i,s){var e=i.uid,a=i.encoding,h=i.rawImageData,r=l&&h instanceof l?this.getImageData(h):h,n=new t.DEMData(e,r,a);this.loaded=this.loaded||{},this.loaded[e]=n,s(null,n);},u.prototype.getImageData=function(i){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(i.width,i.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=i.width,this.offscreenCanvas.height=i.height,this.offscreenCanvasContext.drawImage(i,0,0,i.width,i.height);var s=this.offscreenCanvasContext.getImageData(-1,-1,i.width+2,i.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:s.width,height:s.height},s.data)},u.prototype.removeTile=function(t){var i=this.loaded,s=t.uid;i&&i[s]&&delete i[s];};var p=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(i){this._feature=i,this.extent=t.EXTENT,this.type=i.type,this.properties=i.tags,"id"in i&&!isNaN(i.id)&&(this.id=parseInt(i.id,10));};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var i=[],s=0,e=this._feature.geometry;s<e.length;s+=1){var a=e[s];i.push([new t.Point$1(a[0],a[1])]);}return i}for(var h=[],r=0,n=this._feature.geometry;r<n.length;r+=1){for(var o=[],l=0,u=n[r];l<u.length;l+=1){var c=u[l];o.push(new t.Point$1(c[0],c[1]));}h.push(o);}return h},d.prototype.toGeoJSON=function(t,i,s,e){return p.call(this,t,i,s,e)};var M=function(i){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=i.length,this._features=i;};M.prototype.feature=function(t){return new d(this._features[t])};var m=t.vectorTile.VectorTileFeature,g=y;function y(t,i){this.options=i||{},this.features=t,this.length=t.length;}function v(t,i){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=i||4096;}y.prototype.feature=function(t){return new v(this.features[t],this.options.extent)},v.prototype.loadGeometry=function(){var i=this.rawGeometry;this.geometry=[];for(var s=0;s<i.length;s++){for(var e=i[s],a=[],h=0;h<e.length;h++)a.push(new t.Point$1(e[h][0],e[h][1]));this.geometry.push(a);}return this.geometry},v.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,i=1/0,s=-1/0,e=1/0,a=-1/0,h=0;h<t.length;h++)for(var r=t[h],n=0;n<r.length;n++){var o=r[n];i=Math.min(i,o.x),s=Math.max(s,o.x),e=Math.min(e,o.y),a=Math.max(a,o.y);}return [i,e,s,a]},v.prototype.toGeoJSON=m.prototype.toGeoJSON;var x=b,_=g;function b(i){var s=new t.pbf;return function(t,i){for(var s in t.layers)i.writeMessage(3,w,t.layers[s]);}(i,s),s.finish()}function w(t,i){var s;i.writeVarintField(15,t.version||1),i.writeStringField(1,t.name||""),i.writeVarintField(5,t.extent||4096);var e={keys:[],values:[],keycache:{},valuecache:{}};for(s=0;s<t.length;s++)e.feature=t.feature(s),i.writeMessage(2,S,e);var a=e.keys;for(s=0;s<a.length;s++)i.writeStringField(3,a[s]);var h=e.values;for(s=0;s<h.length;s++)i.writeMessage(4,k,h[s]);}function S(t,i){var s=t.feature;void 0!==s.id&&i.writeVarintField(1,s.id),i.writeMessage(2,C,t),i.writeVarintField(3,s.type),i.writeMessage(4,N,s);}function C(t,i){var s=t.feature,e=t.keys,a=t.values,h=t.keycache,r=t.valuecache;for(var n in s.properties){var o=s.properties[n],l=h[n];if(null!==o){void 0===l&&(e.push(n),h[n]=l=e.length-1),i.writeVarint(l);var u=typeof o;"string"!==u&&"boolean"!==u&&"number"!==u&&(o=JSON.stringify(o));var c=u+":"+o,f=r[c];void 0===f&&(a.push(o),r[c]=f=a.length-1),i.writeVarint(f);}}}function P(t,i){return (i<<3)+(7&t)}function I(t){return t<<1^t>>31}function N(t,i){for(var s=t.loadGeometry(),e=t.type,a=0,h=0,r=s.length,n=0;n<r;n++){var o=s[n],l=1;1===e&&(l=o.length),i.writeVarint(P(1,l));for(var u=3===e?o.length-1:o.length,c=0;c<u;c++){1===c&&1!==e&&i.writeVarint(P(2,u-1));var f=o[c].x-a,p=o[c].y-h;i.writeVarint(I(f)),i.writeVarint(I(p)),a+=f,h+=p;}3===e&&i.writeVarint(P(7,1));}}function k(t,i){var s=typeof t;"string"===s?i.writeStringField(1,t):"boolean"===s?i.writeBooleanField(7,t):"number"===s&&(t%1!=0?i.writeDoubleField(3,t):t<0?i.writeSVarintField(6,t):i.writeVarintField(5,t));}function E(t,i,s,e){O(t,s,e),O(i,2*s,2*e),O(i,2*s+1,2*e+1);}function O(t,i,s){var e=t[i];t[i]=t[s],t[s]=e;}function A(t,i,s,e){var a=t-s,h=i-e;return a*a+h*h}x.fromVectorTileJs=b,x.fromGeojsonVt=function(t,i){i=i||{};var s={};for(var e in t)s[e]=new g(t[e].features,i),s[e].name=e,s[e].version=i.version,s[e].extent=i.extent;return b({layers:s})},x.GeoJSONWrapper=_;var q=function(t){return t[0]},L=function(t){return t[1]},T=function(t,i,s,e,a){void 0===i&&(i=q),void 0===s&&(s=L),void 0===e&&(e=64),void 0===a&&(a=Float64Array),this.nodeSize=e,this.points=t;for(var h=t.length<65536?Uint16Array:Uint32Array,r=this.ids=new h(t.length),n=this.coords=new a(2*t.length),o=0;o<t.length;o++)r[o]=o,n[2*o]=i(t[o]),n[2*o+1]=s(t[o]);!function t(i,s,e,a,h,r){if(!(h-a<=e)){var n=a+h>>1;!function t(i,s,e,a,h,r){for(;h>a;){if(h-a>600){var n=h-a+1,o=e-a+1,l=Math.log(n),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(n-u)/n)*(o-n/2<0?-1:1);t(i,s,e,Math.max(a,Math.floor(e-o*u/n+c)),Math.min(h,Math.floor(e+(n-o)*u/n+c)),r);}var f=s[2*e+r],p=a,d=h;for(E(i,s,a,e),s[2*h+r]>f&&E(i,s,a,h);p<d;){for(E(i,s,p,d),p++,d--;s[2*p+r]<f;)p++;for(;s[2*d+r]>f;)d--;}s[2*a+r]===f?E(i,s,a,d):E(i,s,++d,h),d<=e&&(a=d+1),e<=d&&(h=d-1);}}(i,s,n,a,h,r%2),t(i,s,e,a,n-1,r+1),t(i,s,e,n+1,h,r+1);}}(r,n,e,0,r.length-1,0);};T.prototype.range=function(t,i,s,e){return function(t,i,s,e,a,h,r){for(var n,o,l=[0,t.length-1,0],u=[];l.length;){var c=l.pop(),f=l.pop(),p=l.pop();if(f-p<=r)for(var d=p;d<=f;d++)o=i[2*d+1],(n=i[2*d])>=s&&n<=a&&o>=e&&o<=h&&u.push(t[d]);else {var M=Math.floor((p+f)/2);o=i[2*M+1],(n=i[2*M])>=s&&n<=a&&o>=e&&o<=h&&u.push(t[M]);var m=(c+1)%2;(0===c?s<=n:e<=o)&&(l.push(p),l.push(M-1),l.push(m)),(0===c?a>=n:h>=o)&&(l.push(M+1),l.push(f),l.push(m));}}return u}(this.ids,this.coords,t,i,s,e,this.nodeSize)},T.prototype.within=function(t,i,s){return function(t,i,s,e,a,h){for(var r=[0,t.length-1,0],n=[],o=a*a;r.length;){var l=r.pop(),u=r.pop(),c=r.pop();if(u-c<=h)for(var f=c;f<=u;f++)A(i[2*f],i[2*f+1],s,e)<=o&&n.push(t[f]);else {var p=Math.floor((c+u)/2),d=i[2*p],M=i[2*p+1];A(d,M,s,e)<=o&&n.push(t[p]);var m=(l+1)%2;(0===l?s-a<=d:e-a<=M)&&(r.push(c),r.push(p-1),r.push(m)),(0===l?s+a>=d:e+a>=M)&&(r.push(p+1),r.push(u),r.push(m));}}return n}(this.ids,this.coords,t,i,s,this.nodeSize)};var z={crs:"EPSG:3857",minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},j=function(t){this.options=J(Object.create(z),t),this.trees=new Array(this.options.maxZoom+1);};function G(t,i,s,e,a){return {x:t,y:i,zoom:1/0,id:s,parentId:-1,numPoints:e,properties:a}}function D(t,i,s){var e=t.geometry.coordinates,a=e[1];return {x:F(e[0]),y:U(a,s),zoom:1/0,index:i,parentId:-1}}function B(t,i){return {type:"Feature",id:t.id,properties:R(t),geometry:{type:"Point",coordinates:[(s=t.x,360*(s-.5)),W(t.y,i)]}};var s;}function R(t){var i=t.numPoints,s=i>=1e4?Math.round(i/1e3)+"k":i>=1e3?Math.round(i/100)/10+"k":i;return J(J({},t.properties),{cluster:!0,cluster_id:t.id,point_count:i,point_count_abbreviated:s})}function F(t,i){return t/360+.5}function U(t,i){var s;if(i&&"EPSG:3857"!==i)s=(90-t)/360;else {var e=Math.sin(t*Math.PI/180);s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;}return s<0?0:s>1?1:s}function W(t,i){if(i&&"EPSG:3857"!==i)return 90-360*t;var s=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(s))/Math.PI-90}function J(t,i){for(var s in i)t[s]=i[s];return t}function X(t){return t.x}function Z(t){return t.y}j.prototype.load=function(t){var i=this.options,s=i.log,e=i.minZoom,a=i.maxZoom,h=i.nodeSize,r=i.crs;s&&console.time("total time");var n="prepare "+t.length+" points";s&&console.time(n),this.points=t;for(var o=[],l=0;l<t.length;l++)t[l].geometry&&o.push(D(t[l],l,r));this.trees[a+1]=new T(o,X,Z,h,Float32Array),s&&console.timeEnd(n);for(var u=a;u>=e;u--){var c=+Date.now();o=this._cluster(o,u),this.trees[u]=new T(o,X,Z,h,Float32Array),s&&console.log("z%d: %d clusters in %dms",u,o.length,+Date.now()-c);}return s&&console.timeEnd("total time"),this},j.prototype.getClusters=function(t,i){var s=this.crs,e=((t[0]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[1])),h=180===t[2]?180:((t[2]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)e=-180,h=180;else if(e>h){var n=this.getClusters([e,a,180,r],i),o=this.getClusters([-180,a,h,r],i);return n.concat(o)}for(var l=this.trees[this._limitZoom(i)],u=[],c=0,f=l.range(F(e),U(r,s),F(h),U(a,s));c<f.length;c+=1){var p=l.points[f[c]];u.push(p.numPoints?B(p,s):this.points[p.index]);}return u},j.prototype.getChildren=function(t){var i=this.crs,s=this._getOriginId(t),e=this._getOriginZoom(t),a="No cluster with the specified id.",h=this.trees[e];if(!h)throw new Error(a);var r=h.points[s];if(!r)throw new Error(a);for(var n=this.options.radius/(this.options.extent*Math.pow(2,e-1)),o=[],l=0,u=h.within(r.x,r.y,n);l<u.length;l+=1){var c=h.points[u[l]];c.parentId===t&&o.push(c.numPoints?B(c,i):this.points[c.index]);}if(0===o.length)throw new Error(a);return o},j.prototype.getLeaves=function(t,i,s){var e=[];return this._appendLeaves(e,t,i=i||10,s=s||0,0),e},j.prototype.getTile=function(t,i,s){var e=this.trees[this._limitZoom(t)],a=Math.pow(2,t),h=this.options,r=h.radius/h.extent,n=(s-r)/a,o=(s+1+r)/a,l={features:[]};return this._addTileFeatures(e.range((i-r)/a,n,(i+1+r)/a,o),e.points,i,s,a,l),0===i&&this._addTileFeatures(e.range(1-r/a,n,1,o),e.points,a,s,a,l),i===a-1&&this._addTileFeatures(e.range(0,n,r/a,o),e.points,-1,s,a,l),l.features.length?l:null},j.prototype.getClusterExpansionZoom=function(t){for(var i=this._getOriginZoom(t)-1;i<=this.options.maxZoom;){var s=this.getChildren(t);if(i++,1!==s.length)break;t=s[0].properties.cluster_id;}return i},j.prototype._appendLeaves=function(t,i,s,e,a){for(var h=0,r=this.getChildren(i);h<r.length;h+=1){var n=r[h],o=n.properties;if(o&&o.cluster?a+o.point_count<=e?a+=o.point_count:a=this._appendLeaves(t,o.cluster_id,s,e,a):a<e?a++:t.push(n),t.length===s)break}return a},j.prototype._addTileFeatures=function(t,i,s,e,a,h){for(var r=0,n=t;r<n.length;r+=1){var o=i[n[r]],l=o.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(o.x*a-s)),Math.round(this.options.extent*(o.y*a-e))]],tags:l?R(o):this.points[o.index].properties},c=void 0;l?c=o.id:this.options.generateId?c=o.index:this.points[o.index].id&&(c=this.points[o.index].id),void 0!==c&&(u.id=c),h.features.push(u);}},j.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},j.prototype._cluster=function(t,i){for(var s=[],e=this.options,a=e.reduce,h=e.minPoints,r=e.radius/(e.extent*Math.pow(2,i)),n=0;n<t.length;n++){var o=t[n];if(!(o.zoom<=i)){o.zoom=i;for(var l=this.trees[i+1],u=l.within(o.x,o.y,r),c=o.numPoints||1,f=c,p=0,d=u;p<d.length;p+=1){var M=l.points[d[p]];M.zoom>i&&(f+=M.numPoints||1);}if(f>=h){for(var m=o.x*c,g=o.y*c,y=a&&c>1?this._map(o,!0):null,v=(n<<5)+(i+1)+this.points.length,x=0,_=u;x<_.length;x+=1){var b=l.points[_[x]];if(!(b.zoom<=i)){b.zoom=i;var w=b.numPoints||1;m+=b.x*w,g+=b.y*w,b.parentId=v,a&&(y||(y=this._map(o,!0)),a(y,this._map(b)));}}o.parentId=v,s.push(G(m/f,g/f,v,f,y));}else if(s.push(o),f>1)for(var S=0,C=u;S<C.length;S+=1){var P=l.points[C[S]];P.zoom<=i||(P.zoom=i,s.push(P));}}}return s},j.prototype._getOriginId=function(t){return t-this.points.length>>5},j.prototype._getOriginZoom=function(t){return (t-this.points.length)%32},j.prototype._map=function(t,i){if(t.numPoints)return i?J({},t.properties):t.properties;var s=this.points[t.index].properties,e=this.options.map(s);return i&&e===s?J({},e):e};var Q=484813681109536e-20,V=Math.PI/2,Y=.017453292519943295,H=57.29577951308232,K=Math.PI/4,$=2*Math.PI,tt=3.14159265359,it={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},st={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},et=/[\s_\-\/\(\)]/g;function at(t,i){if(t[i])return t[i];for(var s,e=Object.keys(t),a=i.toLowerCase().replace(et,""),h=-1;++h<e.length;)if((s=e[h]).toLowerCase().replace(et,"")===a)return t[s]}function ht(t){var i,s,e,a={},h=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),r={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t);},lat_0:function(t){a.lat0=t*Y;},lat_1:function(t){a.lat1=t*Y;},lat_2:function(t){a.lat2=t*Y;},lat_ts:function(t){a.lat_ts=t*Y;},lon_0:function(t){a.long0=t*Y;},lon_1:function(t){a.long1=t*Y;},lon_2:function(t){a.long2=t*Y;},alpha:function(t){a.alpha=parseFloat(t)*Y;},gamma:function(t){a.rectified_grid_angle=parseFloat(t);},lonc:function(t){a.longc=t*Y;},x_0:function(t){a.x0=parseFloat(t);},y_0:function(t){a.y0=parseFloat(t);},k_0:function(t){a.k0=parseFloat(t);},k:function(t){a.k0=parseFloat(t);},a:function(t){a.a=parseFloat(t);},b:function(t){a.b=parseFloat(t);},r_a:function(){a.R_A=!0;},zone:function(t){a.zone=parseInt(t,10);},south:function(){a.utmSouth=!0;},towgs84:function(t){a.datum_params=t.split(",").map((function(t){return parseFloat(t)}));},to_meter:function(t){a.to_meter=parseFloat(t);},units:function(t){a.units=t;var i=at(st,t);i&&(a.to_meter=i.to_meter);},from_greenwich:function(t){a.from_greenwich=t*Y;},pm:function(t){var i=at(it,t);a.from_greenwich=(i||parseFloat(t))*Y;},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t;},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(a.axis=t);},approx:function(){a.approx=!0;}};for(i in h)s=h[i],i in r?"function"==typeof(e=r[i])?e(s):a[e]=s:a[i]=s;return "string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}var rt=/\s/,nt=/[A-Za-z]/,ot=/[A-Za-z84_]/,lt=/[,\]]/,ut=/[\d\.E\-\+]/;function ct(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1;}function ft(t,i,s){Array.isArray(i)&&(s.unshift(i),i=null);var e=s.reduce((function(t,i){return pt(i,t),t}),i?{}:t);i&&(t[i]=e);}function pt(t,i){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(i[s]={},void pt(t[0],i[s])):void(i[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in i||(i[s]=[]),void i[s].push(t);var e;switch(Array.isArray(s)||(i[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&pt(t[2],i[s]));case"SPHEROID":case"ELLIPSOID":return i[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&pt(t[3],i[s]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void ft(i,s,t);default:for(e=-1;++e<t.length;)if(!Array.isArray(t[e]))return pt(t,i[s]);return ft(i,s,t)}}else i[s]=t;else i[s]=!0;}else i[t]=!0;}function dt(t){return .017453292519943295*t}function Mt(t){var i=new ct(t).output(),s=i.shift(),e=i.shift();i.unshift(["name",e]),i.unshift(["type",s]);var a={};return pt(i,a),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var i="",s=0,e=t.AXIS.length;s<e;++s){var a=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?i+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?i+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?i+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(i+="w");}2===i.length&&(i+="u"),3===i.length&&(t.axis=i);}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var h=t.GEOGCS;function r(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(h=t),h&&(t.datumCode=h.DATUM?h.DATUM.name.toLowerCase():h.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),h.DATUM&&h.DATUM.SPHEROID&&(t.ellps=h.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=h.DATUM.SPHEROID.a,t.rf=parseFloat(h.DATUM.SPHEROID.rf,10)),h.DATUM&&h.DATUM.TOWGS84&&(t.datum_params=h.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",dt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",dt],["x0","false_easting",r],["y0","false_northing",r],["long0","central_meridian",dt],["lat0","latitude_of_origin",dt],["lat0","standard_parallel_1",dt],["lat1","standard_parallel_1",dt],["lat2","standard_parallel_2",dt],["azimuth","Azimuth"],["alpha","azimuth",dt],["srsCode","name"]].forEach((function(i){return function(t,i){var s=i[0],e=i[1];!(s in t)&&e in t&&(t[s]=t[e],3===i.length&&(t[s]=i[2](t[s])));}(t,i)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName?!t.lat_ts&&t.lat0&&"Polar_Stereographic"===t.projName&&(t.lat_ts=t.lat0,t.lat0=dt(t.lat0>0?90:-90)):(t.lat0=dt(t.lat1>0?90:-90),t.lat_ts=t.lat1);}(a),a}function mt(t){var i=this;if(2===arguments.length){var s=arguments[1];mt[t]="string"==typeof s?"+"===s.charAt(0)?ht(arguments[1]):Mt(arguments[1]):s;}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?mt.apply(i,t):mt(t);}));if("string"==typeof t){if(t in mt)return mt[t]}else "EPSG"in t?mt["EPSG:"+t.EPSG]=t:"ESRI"in t?mt["ESRI:"+t.ESRI]=t:"IAU2000"in t?mt["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ct.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;rt.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++];}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},ct.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(lt.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},ct.prototype.afterItem=function(t){return ","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},ct.prototype.number=function(t){if(!ut.test(t)){if(lt.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t;},ct.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5;},ct.prototype.keyword=function(t){if(ot.test(t))this.word+=t;else {if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!lt.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t);}},ct.prototype.neutral=function(t){if(nt.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(ut.test(t))return this.word=t,void(this.state=3);if(!lt.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t);},ct.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)},function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"];}(mt);var gt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],yt=["3857","900913","3785","102113"];function vt(t,i){var s,e;if(t=t||{},!i)return t;for(e in i)void 0!==(s=i[e])&&(t[e]=s);return t}function xt(t,i,s){var e=t*i;return s/Math.sqrt(1-e*e)}function _t(t){return t<0?-1:1}function bt(t){return Math.abs(t)<=tt?t:t-_t(t)*$}function wt(t,i,s){var e=t*s;return e=Math.pow((1-e)/(1+e),.5*t),Math.tan(.5*(V-i))/e}function St(t,i){for(var s,e,a=.5*t,h=V-2*Math.atan(i),r=0;r<=15;r++)if(s=t*Math.sin(h),h+=e=V-2*Math.atan(i*Math.pow((1-s)/(1+s),a))-h,Math.abs(e)<=1e-10)return h;return -9999}function Ct(t){return t}var Pt=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1);},forward:function(t){var i,s,e=t.x,a=t.y;if(a*H>90&&a*H<-90&&e*H>180&&e*H<-180)return null;if(Math.abs(Math.abs(a)-V)<=1e-10)return null;if(this.sphere)i=this.x0+this.a*this.k0*bt(e-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(K+.5*a));else {var h=Math.sin(a),r=wt(this.e,a,h);i=this.x0+this.a*this.k0*bt(e-this.long0),s=this.y0-this.a*this.k0*Math.log(r);}return t.x=i,t.y=s,t},inverse:function(t){var i,s,e=t.x-this.x0,a=t.y-this.y0;if(this.sphere)s=V-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else {var h=Math.exp(-a/(this.a*this.k0));if(-9999===(s=St(this.e,h)))return null}return i=bt(this.long0+e/(this.a*this.k0)),t.x=i,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Ct,inverse:Ct,names:["longlat","identity"]}],It={},Nt=[];function kt(t,i){var s=Nt.length;return t.names?(Nt[s]=t,t.names.forEach((function(t){It[t.toLowerCase()]=s;})),this):(console.log(i),!0)}var Et={start:function(){Pt.forEach(kt);},add:kt,get:function(t){if(!t)return !1;var i=t.toLowerCase();return void 0!==It[i]&&Nt[It[i]]?Nt[It[i]]:void 0}},Ot={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},At=Ot.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ot.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var qt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Lt={};function Tt(t){if(0===t.length)return null;var i="@"===t[0];return i&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:Lt[t]||null,isNull:!1}}function zt(t){return t/3600*Math.PI/180}function jt(t,i,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,s)))}function Gt(t){return t.map((function(t){return [zt(t.longitudeShift),zt(t.latitudeShift)]}))}function Dt(t,i,s){return {name:jt(t,i+8,i+16).trim(),parent:jt(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,s),upperLatitude:t.getFloat64(i+88,s),lowerLongitude:t.getFloat64(i+104,s),upperLongitude:t.getFloat64(i+120,s),latitudeInterval:t.getFloat64(i+136,s),longitudeInterval:t.getFloat64(i+152,s),gridNodeCount:t.getInt32(i+168,s)}}function Bt(t,i,s,e){for(var a=i+176,h=[],r=0;r<s.gridNodeCount;r++){var n={latitudeShift:t.getFloat32(a+16*r,e),longitudeShift:t.getFloat32(a+16*r+4,e),latitudeAccuracy:t.getFloat32(a+16*r+8,e),longitudeAccuracy:t.getFloat32(a+16*r+12,e)};h.push(n);}return h}function Rt(t,i){if(!(this instanceof Rt))return new Rt(t);i=i||function(t){if(t)throw t};var s=function(t){if(!function(t){return "string"==typeof t}(t))return t;if(function(t){return t in mt}(t))return mt[t];if(function(t){return gt.some((function(i){return t.indexOf(i)>-1}))}(t)){var i=Mt(t);if(function(t){var i=at(t,"authority");if(i){var s=at(i,"epsg");return s&&yt.indexOf(s)>-1}}(i))return mt["EPSG:3857"];var s=function(t){var i=at(t,"extension");if(i)return at(i,"proj4")}(i);return s?ht(s):i}return function(t){return "+"===t[0]}(t)?ht(t):void 0}(t);if("object"==typeof s){var e=Rt.projections.get(s.projName);if(e){if(s.datumCode&&"none"!==s.datumCode){var a=at(qt,s.datumCode);a&&(s.datum_params=s.datum_params||(a.towgs84?a.towgs84.split(","):null),s.ellps=a.ellipse,s.datumName=a.datumName?a.datumName:s.datumCode);}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var h,r,n,o,l,u,c=function(t,i,s,e,a){if(!t){var h=at(Ot,e);h||(h=At),t=h.a,i=h.b,s=h.rf;}return s&&!i&&(i=(1-1/s)*t),(0===s||Math.abs(t-i)<1e-10)&&(a=!0,i=t),{a:t,b:i,rf:s,sphere:a}}(s.a,s.b,s.rf,s.ellps,s.sphere),f=(l=((n=(h=c.a)*h)-(o=(r=c.b)*r))/n,u=0,s.R_A?(n=(h*=1-l*(.16666666666666666+l*(.04722222222222222+.022156084656084655*l)))*h,l=0):u=Math.sqrt(l),{es:l,e:u,ep2:(n-o)/o}),p=function(t){return void 0===t?null:t.split(",").map(Tt)}(s.nadgrids),d=s.datum||function(t,i,s,e,a,h,r){var n={};return n.datum_type=void 0===t||"none"===t?5:4,i&&(n.datum_params=i.map(parseFloat),0===n.datum_params[0]&&0===n.datum_params[1]&&0===n.datum_params[2]||(n.datum_type=1),n.datum_params.length>3&&(0===n.datum_params[3]&&0===n.datum_params[4]&&0===n.datum_params[5]&&0===n.datum_params[6]||(n.datum_type=2,n.datum_params[3]*=Q,n.datum_params[4]*=Q,n.datum_params[5]*=Q,n.datum_params[6]=n.datum_params[6]/1e6+1))),r&&(n.datum_type=3,n.grids=r),n.a=s,n.b=e,n.es=a,n.ep2=h,n}(s.datumCode,s.datum_params,c.a,c.b,f.es,f.ep2,p);vt(this,s),vt(this,e),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=d,this.init(),i(null,this);}else i(t);}else i(t);}function Ft(t,i,s){var e,a,h,r=t.x,n=t.y,o=t.z?t.z:0;if(n<-V&&n>-1.001*V)n=-V;else if(n>V&&n<1.001*V)n=V;else {if(n<-V)return {x:-1/0,y:-1/0,z:t.z};if(n>V)return {x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(n),h=Math.cos(n),{x:((e=s/Math.sqrt(1-i*(a*a)))+o)*h*Math.cos(r),y:(e+o)*h*Math.sin(r),z:(e*(1-i)+o)*a}}function Ut(t,i,s,e){var a,h,r,n,o,l,u,c,f,p,d,M,m,g,y,v=t.x,x=t.y,_=t.z?t.z:0;if(a=Math.sqrt(v*v+x*x),h=Math.sqrt(v*v+x*x+_*_),a/s<1e-12){if(g=0,h/s<1e-12)return y=-e,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(x,v);r=_/h,c=(n=a/h)*(1-i)*(o=1/Math.sqrt(1-i*(2-i)*n*n)),f=r*o,m=0;do{m++,l=i*(u=s/Math.sqrt(1-i*f*f))/(u+(y=a*c+_*f-u*(1-i*f*f))),M=(d=r*(o=1/Math.sqrt(1-l*(2-l)*n*n)))*c-(p=n*(1-l)*o)*f,c=p,f=d;}while(M*M>1e-24&&m<30);return {x:g,y:Math.atan(d/Math.abs(p)),z:y}}function Wt(t){return 1===t||2===t}function Jt(t,i,s){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var e={x:-s.x,y:s.y},a={x:Number.NaN,y:Number.NaN},h=[];t:for(var r=0;r<t.grids.length;r++){var n=t.grids[r];if(h.push(n.name),n.isNull){a=e;break}if(null!==n.grid)for(var o=n.grid.subgrids,l=0,u=o.length;l<u;l++){var c=o[l],f=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4;if(!(c.ll[1]-f>e.y||c.ll[0]-f>e.x||c.ll[1]+(c.lim[1]-1)*c.del[1]+f<e.y||c.ll[0]+(c.lim[0]-1)*c.del[0]+f<e.x||(a=Xt(e,i,c),isNaN(a.x))))break t}else if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-e.x*H+" "+e.y*H+" tried: '"+h+"'"),-1):(s.x=-a.x,s.y=a.y,0)}function Xt(t,i,s){var e={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return e;var a={x:t.x,y:t.y};a.x-=s.ll[0],a.y-=s.ll[1],a.x=bt(a.x-Math.PI)+Math.PI;var h=Zt(a,s);if(i){if(isNaN(h.x))return e;h.x=a.x-h.x,h.y=a.y-h.y;var r,n,o=9;do{if(n=Zt(h,s),isNaN(n.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h.x+=(r={x:a.x-(n.x+h.x),y:a.y-(n.y+h.y)}).x,h.y+=r.y;}while(o--&&Math.abs(r.x)>1e-12&&Math.abs(r.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),e;e.x=bt(h.x+s.ll[0]),e.y=h.y+s.ll[1];}else isNaN(h.x)||(e.x=t.x+h.x,e.y=t.y+h.y);return e}function Zt(t,i){var s,e={x:t.x/i.del[0],y:t.y/i.del[1]},a=Math.floor(e.x),h=Math.floor(e.y),r=e.x-1*a,n=e.y-1*h,o={x:Number.NaN,y:Number.NaN};if(a<0||a>=i.lim[0])return o;if(h<0||h>=i.lim[1])return o;var l=i.cvs[s=h*i.lim[0]+a][0],u=i.cvs[s][1];s++;var c=i.cvs[s][0],f=i.cvs[s][1],p=i.cvs[s+=i.lim[0]][0],d=i.cvs[s][1];s--;var M=i.cvs[s][1],m=r*n,g=r*(1-n),y=(1-r)*(1-n),v=(1-r)*n;return o.x=y*l+g*c+v*i.cvs[s][0]+m*p,o.y=y*u+g*f+v*M+m*d,o}function Qt(t,i,s){var e,a,h,r=s.x,n=s.y,o=s.z||0,l={};for(h=0;h<3;h++)if(!i||2!==h||void 0!==s.z)switch(0===h?(e=r,a=-1!=="ew".indexOf(t.axis[h])?"x":"y"):1===h?(e=n,a=-1!=="ns".indexOf(t.axis[h])?"y":"x"):(e=o,a="z"),t.axis[h]){case"e":l[a]=e;break;case"w":l[a]=-e;break;case"n":l[a]=e;break;case"s":l[a]=-e;break;case"u":void 0!==s[a]&&(l.z=e);break;case"d":void 0!==s[a]&&(l.z=-e);break;default:return null}return l}function Vt(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Yt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Ht(t,i,s,e){var a,h=void 0!==(s=Array.isArray(s)?Vt(s):{x:s.x,y:s.y,z:s.z,m:s.m}).z;if(function(t){Yt(t.x),Yt(t.y);}(s),t.datum&&i.datum&&function(t,i){return (1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type||3===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(s=Ht(t,a=new Rt("WGS84"),s,e),t=a),e&&"enu"!==t.axis&&(s=Qt(t,!1,s)),"longlat"===t.projName)s={x:s.x*Y,y:s.y*Y,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),!(s=t.inverse(s)))return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,i,s){if(function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i))return s;if(5===t.datum_type||5===i.datum_type)return s;var e=t.a,a=t.es;if(3===t.datum_type){if(0!==Jt(t,!1,s))return;e=6378137,a=.0066943799901413165;}var h=i.a,r=i.b,n=i.es;return 3===i.datum_type&&(h=6378137,r=6356752.314,n=.0066943799901413165),a!==n||e!==h||Wt(t.datum_type)||Wt(i.datum_type)?(s=Ft(s,a,e),Wt(t.datum_type)&&(s=function(t,i,s){if(1===i)return {x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===i){var e=s[3],a=s[4],h=s[5],r=s[6];return {x:r*(t.x-h*t.y+a*t.z)+s[0],y:r*(h*t.x+t.y-e*t.z)+s[1],z:r*(-a*t.x+e*t.y+t.z)+s[2]}}}(s,t.datum_type,t.datum_params)),Wt(i.datum_type)&&(s=function(t,i,s){if(1===i)return {x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===i){var e=s[3],a=s[4],h=s[5],r=s[6],n=(t.x-s[0])/r,o=(t.y-s[1])/r,l=(t.z-s[2])/r;return {x:n+h*o-a*l,y:-h*n+o+e*l,z:a*n-e*o+l}}}(s,i.datum_type,i.datum_params)),s=Ut(s,n,h,r),3!==i.datum_type||0===Jt(i,!0,s)?s:void 0):s}(t.datum,i.datum,s))return i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}),"longlat"===i.projName?s={x:s.x*H,y:s.y*H,z:s.z||0}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0})),e&&"enu"!==i.axis?Qt(i,!0,s):(s&&!h&&delete s.z,s)}(Rt.projections=Et).start();var Kt=Rt("WGS84");function $t(t,i,s,e){var a,h,r;return Array.isArray(s)?(a=Ht(t,i,s,e)||{x:NaN,y:NaN},s.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(s.splice(3)):[a.x,a.y,s[2]].concat(s.splice(3)):[a.x,a.y].concat(s.splice(2)):[a.x,a.y]):(h=Ht(t,i,s,e),2===(r=Object.keys(s)).length||r.forEach((function(e){if(void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name){if("x"===e||"y"===e||"z"===e)return}else if("x"===e||"y"===e)return;h[e]=s[e];})),h)}function ti(t){return t instanceof Rt?t:t.oProj?t.oProj:Rt(t)}function ii(t,i,s){t=ti(t);var e,a=!1;return void 0===i?(i=t,t=Kt,a=!0):(void 0!==i.x||Array.isArray(i))&&(s=i,i=t,t=Kt,a=!0),i=ti(i),s?$t(t,i,s):(e={forward:function(s,e){return $t(t,i,s,e)},inverse:function(s,e){return $t(i,t,s,e)}},a&&(e.oProj=i),e)}var si=65,ei=73,ai=79,hi={forward:ri,inverse:function(t){var i=ui(fi(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]},toPoint:ni};function ri(t,i){return i=i||5,function(t,i){var s,e,a,h,r,n,o,l,u,c,f,p="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(u=t.easting,c=t.northing,f=ci(t.zoneNumber),s=Math.floor(u/1e5),e=Math.floor(c/1e5)%20,h="AJSAJS".charCodeAt(a=f-1),r="AFAFAF".charCodeAt(a),l=!1,(n=h+s-1)>90&&(n=n-90+si-1,l=!0),(n===ei||h<ei&&n>ei||(n>ei||h<ei)&&l)&&n++,(n===ai||h<ai&&n>ai||(n>ai||h<ai)&&l)&&++n===ei&&n++,n>90&&(n=n-90+si-1),(o=r+e)>86?(o=o-86+si-1,l=!0):l=!1,(o===ei||r<ei&&o>ei||(o>ei||r<ei)&&l)&&o++,(o===ai||r<ai&&o>ai||(o>ai||r<ai)&&l)&&++o===ei&&o++,o>86&&(o=o-86+si-1),String.fromCharCode(n)+String.fromCharCode(o))+p.substr(p.length-5,i)+d.substr(d.length-5,i)}(function(t){var i,s,e,a,h,r,n=t.lat,o=t.lon,l=6378137,u=oi(n),c=oi(o);r=Math.floor((o+180)/6)+1,180===o&&(r=60),n>=56&&n<64&&o>=3&&o<12&&(r=32),n>=72&&n<84&&(o>=0&&o<9?r=31:o>=9&&o<21?r=33:o>=21&&o<33?r=35:o>=33&&o<42&&(r=37)),h=oi(6*(r-1)-180+3),i=l/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),s=Math.tan(u)*Math.tan(u),e=.006739496752268451*Math.cos(u)*Math.cos(u);var f,p,d=.9996*i*((a=Math.cos(u)*(c-h))+(1-s+e)*a*a*a/6+(5-18*s+s*s+72*e-.39089081163157013)*a*a*a*a*a/120)+5e5,M=.9996*(l*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u))+i*Math.tan(u)*(a*a/2+(5-s+9*e+4*e*e)*a*a*a*a/24+(61-58*s+s*s+600*e-2.2240339282485886)*a*a*a*a*a*a/720));return n<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(d),zoneNumber:r,zoneLetter:(f=n,p="Z",84>=f&&f>=72?p="X":72>f&&f>=64?p="W":64>f&&f>=56?p="V":56>f&&f>=48?p="U":48>f&&f>=40?p="T":40>f&&f>=32?p="S":32>f&&f>=24?p="R":24>f&&f>=16?p="Q":16>f&&f>=8?p="P":8>f&&f>=0?p="N":0>f&&f>=-8?p="M":-8>f&&f>=-16?p="L":-16>f&&f>=-24?p="K":-24>f&&f>=-32?p="J":-32>f&&f>=-40?p="H":-40>f&&f>=-48?p="G":-48>f&&f>=-56?p="F":-56>f&&f>=-64?p="E":-64>f&&f>=-72?p="D":-72>f&&f>=-80&&(p="C"),p)}}({lat:t[1],lon:t[0]}),i)}function ni(t){var i=ui(fi(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function oi(t){return t*(Math.PI/180)}function li(t){return t/Math.PI*180}function ui(t){var i=t.northing,s=t.easting,e=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var h,r,n,o,l,u,c,f,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),M=s-5e5,m=i;e<"N"&&(m-=1e7),u=6*(a-1)-180+3,f=(c=m/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*c)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*c)+151*d*d*d/96*Math.sin(6*c),h=p/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),o=.99330562*p/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),l=M/(.9996*h);var g=f-h*Math.tan(f)/o*(l*l/2-(5+3*r+10*n-4*n*n-.06065547077041606)*l*l*l*l/24+(61+90*r+298*n+45*r*r-1.6983531815716497-3*n*n)*l*l*l*l*l*l/720);g=li(g);var y,v=(l-(1+2*r+n)*l*l*l/6+(5-2*n+28*r-3*n*n+.05391597401814761+24*r*r)*l*l*l*l*l/120)/Math.cos(f);if(v=u+li(v),t.accuracy){var x=ui({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:x.lat,right:x.lon,bottom:g,left:v};}else y={lat:g,lon:v};return y}function ci(t){var i=t%6;return 0===i&&(i=6),i}function fi(t){if(t&&0===t.length)throw "MGRSPoint coverting from nothing";for(var i,s=t.length,e=null,a="",h=0;!/[A-Z]/.test(i=t.charAt(h));){if(h>=2)throw "MGRSPoint bad conversion from: "+t;a+=i,h++;}var r=parseInt(a,10);if(0===h||h+3>s)throw "MGRSPoint bad conversion from: "+t;var n=t.charAt(h++);if(n<="A"||"B"===n||"Y"===n||n>="Z"||"I"===n||"O"===n)throw "MGRSPoint zone letter "+n+" not handled: "+t;e=t.substring(h,h+=2);for(var o=ci(r),l=function(t,i){for(var s="AJSAJS".charCodeAt(i-1),e=1e5,a=!1;s!==t.charCodeAt(0);){if(++s===ei&&s++,s===ai&&s++,s>90){if(a)throw "Bad character: "+t;s=si,a=!0;}e+=1e5;}return e}(e.charAt(0),o),u=function(t,i){if(t>"V")throw "MGRSPoint given invalid Northing "+t;for(var s="AFAFAF".charCodeAt(i-1),e=0,a=!1;s!==t.charCodeAt(0);){if(++s===ei&&s++,s===ai&&s++,s>86){if(a)throw "Bad character: "+t;s=si,a=!0;}e+=1e5;}return e}(e.charAt(1),o);u<pi(n);)u+=2e6;var c=s-h;if(c%2!=0)throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,M=c/2,m=0,g=0;return M>0&&(f=1e5/Math.pow(10,M),p=t.substring(h,h+M),m=parseFloat(p)*f,d=t.substring(h+M),g=parseFloat(d)*f),{easting:m+l,northing:g+u,zoneLetter:n,zoneNumber:r,accuracy:f}}function pi(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1;}if(i>=0)return i;throw "Invalid zone letter: "+t}function di(t,i,s){if(!(this instanceof di))return new di(t,i,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var e=t.split(",");this.x=parseFloat(e[0],10),this.y=parseFloat(e[1],10),this.z=parseFloat(e[2],10)||0;}else this.x=t,this.y=i,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");}di.fromMGRS=function(t){return new di(ni(t))},di.prototype.toMGRS=function(t){return ri([this.x,this.y],t)};var Mi=.01068115234375;function mi(t){var i=[];i[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Mi))),i[1]=t*(.75-t*(.046875+t*(.01953125+t*Mi)));var s=t*t;return i[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),i[3]=(s*=t)*(.3645833333333333-.005696614583333333*t),i[4]=s*t*.3076171875,i}function gi(t,i,s,e){return e[0]*t-(s*=i)*(e[1]+(i*=i)*(e[2]+i*(e[3]+i*e[4])))}function yi(t,i,s){for(var e=1/(1-i),a=t,h=20;h;--h){var r=Math.sin(a),n=1-i*r*r;if(a-=n=(gi(a,r,Math.cos(a),s)-t)*(n*Math.sqrt(n))*e,Math.abs(n)<1e-10)return a}return a}var vi={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=mi(this.es),this.ml0=gi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en));},forward:function(t){var i,s,e,a=t.y,h=bt(t.x-this.long0),r=Math.sin(a),n=Math.cos(a);if(this.es){var o=n*h,l=Math.pow(o,2),u=this.ep2*Math.pow(n,2),c=Math.pow(u,2),f=Math.abs(n)>1e-10?Math.tan(a):0,p=Math.pow(f,2),d=Math.pow(p,2);i=1-this.es*Math.pow(r,2),o/=Math.sqrt(i);var M=gi(a,r,n,this.en);s=this.a*(this.k0*o*(1+l/6*(1-p+u+l/20*(5-18*p+d+14*u-58*p*u+l/42*(61+179*d-d*p-479*p)))))+this.x0,e=this.a*(this.k0*(M-this.ml0+r*h*o/2*(1+l/12*(5-p+9*u+4*c+l/30*(61+d-58*p+270*u-330*p*u+l/56*(1385+543*d-d*p-3111*p))))))+this.y0;}else {var m=n*Math.sin(h);if(Math.abs(Math.abs(m)-1)<1e-10)return 93;if(s=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,e=n*Math.cos(h)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(e))>=1){if(m-1>1e-10)return 93;e=0;}else e=Math.acos(e);a<0&&(e=-e),e=this.a*this.k0*(e-this.lat0)+this.y0;}return t.x=s,t.y=e,t},inverse:function(t){var i,s,e,a,h=1/this.a*(t.x-this.x0),r=1/this.a*(t.y-this.y0);if(this.es)if(s=yi(i=this.ml0+r/this.k0,this.es,this.en),Math.abs(s)<V){var n=Math.sin(s),o=Math.cos(s),l=Math.abs(o)>1e-10?Math.tan(s):0,u=this.ep2*Math.pow(o,2),c=Math.pow(u,2),f=Math.pow(l,2),p=Math.pow(f,2);i=1-this.es*Math.pow(n,2);var d=h*Math.sqrt(i)/this.k0,M=Math.pow(d,2);e=s-(i*=l)*M/(1-this.es)*.5*(1-M/12*(5+3*f-9*u*f+u-4*c-M/30*(61+90*f-252*u*f+45*p+46*u-M/56*(1385+3633*f+4095*p+1574*p*f)))),a=bt(this.long0+d*(1-M/6*(1+2*f+u-M/20*(5+28*f+24*p+8*u*f+6*u-M/42*(61+662*f+1320*p+720*p*f))))/o);}else e=V*_t(r),a=0;else {var m=Math.exp(h/this.k0),g=.5*(m-1/m),y=Math.cos(this.lat0+r/this.k0);i=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(g,2))),e=Math.asin(i),r<0&&(e=-e),a=0===g&&0===y?0:bt(Math.atan2(g,y)+this.long0);}return t.x=a,t.y=e,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function xi(t){var i=Math.exp(t);return (i-1/i)/2}function _i(t,i){t=Math.abs(t),i=Math.abs(i);var s=Math.max(t,i),e=Math.min(t,i)/(s||1);return s*Math.sqrt(1+Math.pow(e,2))}function bi(t,i){for(var s,e=2*Math.cos(2*i),a=t.length-1,h=t[a],r=0;--a>=0;)s=e*h-r+t[a],r=h,h=s;return i+s*Math.sin(2*i)}function wi(t,i,s){for(var e,a,h=Math.sin(i),r=Math.cos(i),n=xi(s),o=function(t){var i=Math.exp(t);return (i+1/i)/2}(s),l=2*r*o,u=-2*h*n,c=t.length-1,f=t[c],p=0,d=0,M=0;--c>=0;)e=d,a=p,f=l*(d=f)-e-u*(p=M)+t[c],M=u*d-a+l*p;return [(l=h*o)*f-(u=r*n)*M,l*M+u*f]}var Si={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(vi.init.apply(this),this.forward=vi.forward,this.inverse=vi.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),s=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),this.cgb[1]=(s*=i)*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),this.cgb[2]=(s*=i)*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=s*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),this.cgb[3]=(s*=i)*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=s*(1237/630+i*(i*(-24832/14175)-2.4)),this.cgb[4]=(s*=i)*(4174/315+i*(-144838/6237)),this.cbg[4]=s*(-734/315+i*(109598/31185)),this.cgb[5]=(s*=i)*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=s*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),this.utg[2]=(s*=i)*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),this.utg[3]=(s*=i)*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600))),this.utg[4]=(s*=i)*(-4583/161280+i*(108847/3991680)),this.gtu[4]=s*(34729/80640+i*(-3418889/1995840)),this.utg[5]=(s*=i)*(-20648693/638668800),this.gtu[5]=.6650675310896665*s;var e=bi(this.cbg,this.lat0);this.Zb=-this.Qn*(e+function(t,i){for(var s,e=2*Math.cos(i),a=t.length-1,h=t[a],r=0;--a>=0;)s=e*h-r+t[a],r=h,h=s;return Math.sin(i)*s}(this.gtu,2*e));},forward:function(t){var i=bt(t.x-this.long0),s=t.y;s=bi(this.cbg,s);var e=Math.sin(s),a=Math.cos(s),h=Math.sin(i),r=Math.cos(i);s=Math.atan2(e,r*a),i=Math.atan2(h*a,_i(e,a*r)),i=function(t){var i=Math.abs(t);return i=function(t){var i=1+t,s=i-1;return 0===s?t:t*Math.log(i)/s}(i*(1+i/(_i(1,i)+1))),t<0?-i:i}(Math.tan(i));var n,o,l=wi(this.gtu,2*s,2*i);return s+=l[0],i+=l[1],Math.abs(i)<=2.623395162778?(n=this.a*(this.Qn*i)+this.x0,o=this.a*(this.Qn*s+this.Zb)+this.y0):(n=1/0,o=1/0),t.x=n,t.y=o,t},inverse:function(t){var i,s,e=1/this.a*(t.x-this.x0),a=1/this.a*(t.y-this.y0);if(a=(a-this.Zb)/this.Qn,e/=this.Qn,Math.abs(e)<=2.623395162778){var h=wi(this.utg,2*a,2*e);a+=h[0],e+=h[1],e=Math.atan(xi(e));var r=Math.sin(a),n=Math.cos(a),o=Math.sin(e),l=Math.cos(e);a=Math.atan2(r*l,_i(o,l*n)),i=bt((e=Math.atan2(o,l*n))+this.long0),s=bi(this.cgb,a);}else i=1/0,s=1/0;return t.x=i,t.y=s,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Ci={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(bt(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Y,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Si.init.apply(this),this.forward=Si.forward,this.inverse=Si.inverse;},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Pi(t,i){return Math.pow((1-t)/(1+t),i)}var Ii={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+K)/(Math.pow(Math.tan(.5*this.lat0+K),this.C)*Pi(this.e*t,this.ratexp));},forward:function(t){var i=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+K),this.C)*Pi(this.e*Math.sin(s),this.ratexp))-V,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,s=t.y,e=Math.pow(Math.tan(.5*s+K)/this.K,1/this.C),a=20;a>0&&(s=2*Math.atan(e*Pi(this.e*Math.sin(t.y),-.5*this.e))-V,!(Math.abs(s-t.y)<1e-14));--a)t.y=s;return a?(t.x=i,t.y=s,t):null},names:["gauss"]},Ni={init:function(){Ii.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"));},forward:function(t){var i,s,e,a;return t.x=bt(t.x-this.long0),Ii.forward.apply(this,[t]),i=Math.sin(t.y),s=Math.cos(t.y),e=Math.cos(t.x),t.x=(a=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*e))*s*Math.sin(t.x),t.y=a*(this.cosc0*i-this.sinc0*s*e),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,s,e,a,h;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,h=Math.sqrt(t.x*t.x+t.y*t.y)){var r=2*Math.atan2(h,this.R2);i=Math.sin(r),s=Math.cos(r),a=Math.asin(s*this.sinc0+t.y*i*this.cosc0/h),e=Math.atan2(t.x*i,h*this.cosc0*s-t.y*this.sinc0*i);}else a=this.phic0,e=0;return t.x=e,t.y=a,Ii.inverse.apply(this,[t]),t.x=bt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ki={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+_t(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/wt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=xt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-V,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0));},forward:function(t){var i,s,e,a,h,r,n=t.x,o=t.y,l=Math.sin(o),u=Math.cos(o),c=bt(n-this.long0);return Math.abs(Math.abs(n-this.long0)-Math.PI)<=1e-10&&Math.abs(o+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*l+this.coslat0*u*Math.cos(c)),t.x=this.a*i*u*Math.sin(c)+this.x0,t.y=this.a*i*(this.coslat0*l-this.sinlat0*u*Math.cos(c))+this.y0,t):(s=2*Math.atan(this.ssfn_(o,l,this.e))-V,a=Math.cos(s),e=Math.sin(s),Math.abs(this.coslat0)<=1e-10?(h=wt(this.e,o*this.con,this.con*l),t.x=this.x0+(r=2*this.a*this.k0*h/this.cons)*Math.sin(n-this.long0),t.y=this.y0-this.con*r*Math.cos(n-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(i=2*this.a*this.k0/(1+a*Math.cos(c)),t.y=i*e):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*e+this.cosX0*a*Math.cos(c))),t.y=i*(this.cosX0*e-this.sinX0*a*Math.cos(c))+this.y0),t.x=i*a*Math.sin(c)+this.x0,t))},inverse:function(t){var i,s,e,a;t.x-=this.x0,t.y-=this.y0;var h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(h/(2*this.a*this.k0));return i=this.long0,s=this.lat0,h<=1e-10?(t.x=i,t.y=s,t):(s=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/h),i=Math.abs(this.coslat0)<1e-10?bt(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):bt(this.long0+Math.atan2(t.x*Math.sin(r),h*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r))),t.x=i,t.y=s,t)}if(Math.abs(this.coslat0)<=1e-10){if(h<=1e-10)return s=this.lat0,t.x=i=this.long0,t.y=s,t;t.x*=this.con,t.y*=this.con,s=this.con*St(this.e,h*this.cons/(2*this.a*this.k0)),i=this.con*bt(this.con*this.long0+Math.atan2(t.x,-1*t.y));}else e=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,h<=1e-10?a=this.X0:(a=Math.asin(Math.cos(e)*this.sinX0+t.y*Math.sin(e)*this.cosX0/h),i=bt(this.long0+Math.atan2(t.x*Math.sin(e),h*this.cosX0*Math.cos(e)-t.y*this.sinX0*Math.sin(e)))),s=-1*St(this.e,Math.tan(.5*(V+a)));return t.x=i,t.y=s,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,i,s){return i*=s,Math.tan(.5*(V+t))*Math.pow((1-i)/(1+i),.5*s)}},Ei={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),s=this.a,e=1/this.rf,a=2*e-Math.pow(e,2),h=this.e=Math.sqrt(a);this.R=this.k0*s*Math.sqrt(1-a)/(1-a*Math.pow(i,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var r=Math.log(Math.tan(Math.PI/4+this.b0/2)),n=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+h*i)/(1-h*i));this.K=r-this.alpha*n+this.alpha*h/2*o;},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),e=2*(Math.atan(Math.exp(-this.alpha*(i+s)+this.K))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),h=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(e)+Math.cos(this.b0)*Math.cos(a))),r=Math.asin(Math.cos(this.b0)*Math.sin(e)-Math.sin(this.b0)*Math.cos(e)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*h+this.x0,t},inverse:function(t){for(var i=(t.x-this.x0)/this.R,s=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),e=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),h=this.lambda0+a/this.alpha,r=0,n=e,o=-1e3,l=0;Math.abs(n-o)>1e-7;){if(++l>20)return;r=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(n))/2)),o=n,n=2*Math.atan(Math.exp(r))-Math.PI/2;}return t.x=h,t.y=n,t},names:["somerc"]},Oi={init:function(){var t,i,s,e,a,h,r,n,o,l,u,c,f,p=0,d=0,M=0,m=0,g=0,y=0,v=0;this.no_off=(f="object"==typeof(c=this).PROJECTION?Object.keys(c.PROJECTION)[0]:c.PROJECTION,"no_uoff"in c||"no_off"in c||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(f)),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),x&&(v=this.alpha),_&&(p=this.rectified_grid_angle*Y),x||_)d=this.longc;else if(M=this.long1,g=this.lat1,m=this.long2,y=this.lat2,Math.abs(g-y)<=1e-7||(t=Math.abs(g))<=1e-7||Math.abs(t-V)<=1e-7||Math.abs(Math.abs(this.lat0)-V)<=1e-7||Math.abs(Math.abs(y)-V)<=1e-7)throw new Error;var b=1-this.es;i=Math.sqrt(b),Math.abs(this.lat0)>1e-10?(n=Math.sin(this.lat0),s=Math.cos(this.lat0),t=1-this.es*n*n,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*i/t,(a=(e=this.B*i/(s*Math.sqrt(t)))*e-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=e,this.E*=Math.pow(wt(this.e,this.lat0,n),this.B)):(this.B=1/i,this.A=this.k0,this.E=e=a=1),x||_?(x?(u=Math.asin(Math.sin(v)/e),_||(p=v)):(u=p,v=Math.asin(e*Math.sin(u))),this.lam0=d-Math.asin(.5*(a-1/a)*Math.tan(u))/this.B):(h=Math.pow(wt(this.e,g,Math.sin(g)),this.B),r=Math.pow(wt(this.e,y,Math.sin(y)),this.B),a=this.E/h,o=(r-h)/(r+h),l=((l=this.E*this.E)-r*h)/(l+r*h),(t=M-m)<-Math.pi?m-=$:t>Math.pi&&(m+=$),this.lam0=bt(.5*(M+m)-Math.atan(l*Math.tan(.5*this.B*(M-m))/o)/this.B),u=Math.atan(2*Math.sin(this.B*bt(M-this.lam0))/(a-1/a)),p=v=Math.asin(e*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(e*e-1)/Math.cos(v))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(K-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(K+a));},forward:function(t){var i,s,e,a,h,r,n,o,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-V)>1e-10){if(i=.5*((h=this.E/Math.pow(wt(this.e,t.y,Math.sin(t.y)),this.B))-(r=1/h)),s=.5*(h+r),a=Math.sin(this.B*t.x),e=(i*this.singam-a*this.cosgam)/s,Math.abs(Math.abs(e)-1)<1e-10)throw new Error;o=.5*this.ArB*Math.log((1-e)/(1+e)),r=Math.cos(this.B*t.x),n=Math.abs(r)<1e-7?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+a*this.singam,r);}else o=t.y>0?this.v_pole_n:this.v_pole_s,n=this.ArB*t.y;return this.no_rot?(l.x=n,l.y=o):(l.x=o*this.cosrot+(n-=this.u_0)*this.sinrot,l.y=n*this.cosrot-o*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var i,s,e,a,h,r,n,o={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(s=t.y,i=t.x):(s=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=.5*((e=Math.exp(-this.BrA*s))-1/e),h=.5*(e+1/e),n=((r=Math.sin(this.BrA*i))*this.cosgam+a*this.singam)/h,Math.abs(Math.abs(n)-1)<1e-10)o.x=0,o.y=n<0?-V:V;else {if(o.y=this.E/Math.sqrt((1+n)/(1-n)),o.y=St(this.e,Math.pow(o.y,1/this.B)),o.y===1/0)throw new Error;o.x=-this.rB*Math.atan2(a*this.cosgam-r*this.singam,Math.cos(this.BrA*i));}return o.x+=this.lam0,o},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ai={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),s=Math.cos(this.lat1),e=xt(this.e,i,s),a=wt(this.e,this.lat1,i),h=Math.sin(this.lat2),r=Math.cos(this.lat2),n=xt(this.e,h,r),o=wt(this.e,this.lat2,h),l=wt(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(e/n)/Math.log(a/o):i,isNaN(this.ns)&&(this.ns=i),this.f0=e/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic");}},forward:function(t){var i=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=1e-10&&(s=_t(s)*(V-2e-10));var e,a,h=Math.abs(Math.abs(s)-V);if(h>1e-10)e=wt(this.e,s,Math.sin(s)),a=this.a*this.f0*Math.pow(e,this.ns);else {if((h=s*this.ns)<=0)return null;a=0;}var r=this.ns*bt(i-this.long0);return t.x=this.k0*(a*Math.sin(r))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(r))+this.y0,t},inverse:function(t){var i,s,e,a,h,r=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(r*r+n*n),s=1):(i=-Math.sqrt(r*r+n*n),s=-1);var o=0;if(0!==i&&(o=Math.atan2(s*r,s*n)),0!==i||this.ns>0){if(s=1/this.ns,e=Math.pow(i/(this.a*this.f0),s),-9999===(a=St(this.e,e)))return null}else a=-V;return h=bt(o/this.ns+this.long0),t.x=h,t.y=a,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},qi={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq;},forward:function(t){var i,s,e,a,h,r,n,o=t.y,l=bt(t.x-this.long0);return i=Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(o/2+this.s45),this.alfa)/i)-this.s45),e=-l*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(e)),h=Math.asin(Math.cos(s)*Math.sin(e)/Math.cos(a)),r=this.n*h,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=n*Math.cos(r)/1,t.x=n*Math.sin(r)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,s,e,a,h,r,n,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),h=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x)/Math.sin(this.s0),e=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(e)-Math.sin(this.ad)*Math.cos(e)*Math.cos(a)),s=Math.asin(Math.cos(e)*Math.sin(a)/Math.cos(i)),t.x=this.long0-s/this.alfa,r=i,n=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(r))/(1-this.e*Math.sin(r)),this.e/2))-this.s45),Math.abs(r-t.y)<1e-10&&(n=1),r=t.y,l+=1;}while(0===n&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function Li(t,i,s,e,a){return t*a-i*Math.sin(2*a)+s*Math.sin(4*a)-e*Math.sin(6*a)}function Ti(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function zi(t){return .375*t*(1+.25*t*(1+.46875*t))}function ji(t){return .05859375*t*t*(1+.75*t)}function Gi(t){return t*t*t*(35/3072)}function Di(t,i,s){var e=i*s;return t/Math.sqrt(1-e*e)}function Bi(t){return Math.abs(t)<V?t:t-_t(t)*Math.PI}function Ri(t,i,s,e,a){var h,r;h=t/i;for(var n=0;n<15;n++)if(h+=r=(t-(i*h-s*Math.sin(2*h)+e*Math.sin(4*h)-a*Math.sin(6*h)))/(i-2*s*Math.cos(2*h)+4*e*Math.cos(4*h)-6*a*Math.cos(6*h)),Math.abs(r)<=1e-10)return h;return NaN}var Fi={init:function(){this.sphere||(this.e0=Ti(this.es),this.e1=zi(this.es),this.e2=ji(this.es),this.e3=Gi(this.es),this.ml0=this.a*Li(this.e0,this.e1,this.e2,this.e3,this.lat0));},forward:function(t){var i,s,e=t.x,a=t.y;if(e=bt(e-this.long0),this.sphere)i=this.a*Math.asin(Math.cos(a)*Math.sin(e)),s=this.a*(Math.atan2(Math.tan(a),Math.cos(e))-this.lat0);else {var h=Math.sin(a),r=Math.cos(a),n=Di(this.a,this.e,h),o=Math.tan(a)*Math.tan(a),l=e*Math.cos(a),u=l*l,c=this.es*r*r/(1-this.es);i=n*l*(1-u*o*(1/6-(8-o+8*c)*u/120)),s=this.a*Li(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+n*h/r*u*(.5+(5-o+6*c)*u/24);}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,e=t.x/this.a,a=t.y/this.a;if(this.sphere){var h=a+this.lat0;i=Math.asin(Math.sin(h)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(h));}else {var r=Ri(this.ml0/this.a+a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-V)<=1e-10)return t.x=this.long0,t.y=V,a<0&&(t.y*=-1),t;var n=Di(this.a,this.e,Math.sin(r)),o=n*n*n/this.a/this.a*(1-this.es),l=Math.pow(Math.tan(r),2),u=e*this.a/n,c=u*u;i=r-n*Math.tan(r)/o*u*u*(.5-(1+3*l)*u*u/24),s=u*(1-c*(l/3+(1+3*l)*l*c/15))/Math.cos(r);}return t.x=bt(s+this.long0),t.y=Bi(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Ui(t,i){var s;return t>1e-7?(1-t*t)*(i/(1-(s=t*i)*s)-.5/t*Math.log((1-s)/(1+s))):2*i}var Wi={init:function(){var t,i=Math.abs(this.lat0);if(this.mode=Math.abs(i-V)<1e-10?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(i)<1e-10?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=Ui(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,s=[];return s[0]=.3333333333333333*t,s[0]+=.17222222222222222*(i=t*t),s[1]=.06388888888888888*i,s[0]+=.10257936507936508*(i*=t),s[1]+=.0664021164021164*i,s[2]=.016415012942191543*i,s}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ui(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0));},forward:function(t){var i,s,e,a,h,r,n,o,l,u,c=t.x,f=t.y;if(c=bt(c-this.long0),this.sphere){if(h=Math.sin(f),u=Math.cos(f),e=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((s=this.mode===this.EQUIT?1+u*e:1+this.sinph0*h+this.cosph0*u*e)<=1e-10)return null;i=(s=Math.sqrt(2/s))*u*Math.sin(c),s*=this.mode===this.EQUIT?h:this.cosph0*h-this.sinph0*u*e;}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),Math.abs(f+this.lat0)<1e-10)return null;s=K-.5*f,i=(s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)))*Math.sin(c),s*=e;}}else {switch(n=0,o=0,l=0,e=Math.cos(c),a=Math.sin(c),h=Math.sin(f),r=Ui(this.e,h),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(n=r/this.qp,o=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:l=1+this.sinb1*n+this.cosb1*o*e;break;case this.EQUIT:l=1+o*e;break;case this.N_POLE:l=V+f,r=this.qp-r;break;case this.S_POLE:l=f-V,r=this.qp+r;}if(Math.abs(l)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),s=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*n-this.sinb1*o*e):(l=Math.sqrt(2/(1+o*e)))*n*this.ymf,i=this.xmf*l*o*a;break;case this.N_POLE:case this.S_POLE:r>=0?(i=(l=Math.sqrt(r))*a,s=e*(this.mode===this.S_POLE?l:-l)):i=s=0;}}return t.x=this.a*i+this.x0,t.y=this.a*s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,e,a,h,r,n,o,l,u,c=t.x/this.a,f=t.y/this.a;if(this.sphere){var p,d=0,M=0;if((s=.5*(p=Math.sqrt(c*c+f*f)))>1)return null;switch(s=2*Math.asin(s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(M=Math.sin(s),d=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(p)<=1e-10?0:Math.asin(f*M/p),c*=M,f=d*p;break;case this.OBLIQ:s=Math.abs(p)<=1e-10?this.lat0:Math.asin(d*this.sinph0+f*M*this.cosph0/p),c*=M*this.cosph0,f=(d-Math.sin(s)*this.sinph0)*p;break;case this.N_POLE:f=-f,s=V-s;break;case this.S_POLE:s-=V;}i=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,f):0;}else {if(n=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,f*=this.dd,(r=Math.sqrt(c*c+f*f))<1e-10)return t.x=this.long0,t.y=this.lat0,t;a=2*Math.asin(.5*r/this.rq),e=Math.cos(a),c*=a=Math.sin(a),this.mode===this.OBLIQ?(h=this.qp*(n=e*this.sinb1+f*a*this.cosb1/r),f=r*this.cosb1*e-f*this.sinb1*a):(h=this.qp*(n=f*a/r),f=r*e);}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(h=c*c+f*f))return t.x=this.long0,t.y=this.lat0,t;n=1-h/this.qp,this.mode===this.S_POLE&&(n=-n);}i=Math.atan2(c,f),u=(o=Math.asin(n))+o,s=o+(l=this.apa)[0]*Math.sin(u)+l[1]*Math.sin(u+u)+l[2]*Math.sin(u+u+u);}return t.x=bt(this.long0+i),t.y=s,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ji(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Xi={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=xt(this.e3,this.sin_po,this.cos_po),this.qs1=Ui(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=xt(this.e3,this.sin_po,this.cos_po),this.qs2=Ui(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ui(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0);},forward:function(t){var i=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var e=Ui(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*e)/this.ns0,h=this.ns0*bt(i-this.long0),r=a*Math.sin(h)+this.x0,n=this.rh-a*Math.cos(h)+this.y0;return t.x=r,t.y=n,t},inverse:function(t){var i,s,e,a,h;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),e=0,0!==i&&(e=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,h=this.sphere?Math.asin((this.c-s*s)/(2*this.ns0)):this.phi1z(this.e3,(this.c-s*s)/this.ns0),a=bt(e/this.ns0+this.long0),t.x=a,t.y=h,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,i){var s,e,a,h,r=Ji(.5*i);if(t<1e-10)return r;for(var n=t*t,o=1;o<=25;o++)if(r+=h=.5*(a=1-(e=t*(s=Math.sin(r)))*e)*a/Math.cos(r)*(i/(1-n)-s/a+.5/t*Math.log((1-e)/(1+e))),Math.abs(h)<=1e-7)return r;return null}},Zi={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1;},forward:function(t){var i,s,e,a,h,r,n,o=t.y;return e=bt(t.x-this.long0),i=Math.sin(o),s=Math.cos(o),a=Math.cos(e),(h=this.sin_p14*i+this.cos_p14*s*a)>0||Math.abs(h)<=1e-10?(r=this.x0+1*this.a*s*Math.sin(e)/h,n=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*a)/h):(r=this.x0+this.infinity_dist*s*Math.sin(e),n=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*a)),t.x=r,t.y=n,t},inverse:function(t){var i,s,e,a,h,r;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(i,this.rc),s=Math.sin(a),r=Ji((e=Math.cos(a))*this.sin_p14+t.y*s*this.cos_p14/i),h=Math.atan2(t.x*s,i*this.cos_p14*e-t.y*this.sin_p14*s),h=bt(this.long0+h)):(r=this.phic0,h=0),t.x=h,t.y=r,t},names:["gnom"]},Qi={init:function(){this.sphere||(this.k0=xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)));},forward:function(t){var i,s,e=t.y,a=bt(t.x-this.long0);if(this.sphere)i=this.x0+this.a*a*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else {var h=Ui(this.e,Math.sin(e));i=this.x0+this.a*this.k0*a,s=this.y0+this.a*h*.5/this.k0;}return t.x=i,t.y=s,t},inverse:function(t){var i,s;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=bt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=function(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6)return i<0?-1*V:V;for(var e,a,h,r,n=Math.asin(.5*i),o=0;o<30;o++)if(a=Math.sin(n),h=Math.cos(n),r=t*a,n+=e=Math.pow(1-r*r,2)/(2*h)*(i/(1-t*t)-a/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),Math.abs(e)<=1e-10)return n;return NaN}(this.e,2*t.y*this.k0/this.a),i=bt(this.long0+t.x/(this.a*this.k0))),t.x=i,t.y=s,t},names:["cea"]},Vi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts);},forward:function(t){var i=t.y,s=bt(t.x-this.long0),e=Bi(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*e,t},inverse:function(t){var i=t.y;return t.x=bt(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=Bi(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Yi={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ti(this.es),this.e1=zi(this.es),this.e2=ji(this.es),this.e3=Gi(this.es),this.ml0=this.a*Li(this.e0,this.e1,this.e2,this.e3,this.lat0);},forward:function(t){var i,s,e,a=t.y,h=bt(t.x-this.long0);if(e=h*Math.sin(a),this.sphere)Math.abs(a)<=1e-10?(i=this.a*h,s=-1*this.a*this.lat0):(i=this.a*Math.sin(e)/Math.tan(a),s=this.a*(Bi(a-this.lat0)+(1-Math.cos(e))/Math.tan(a)));else if(Math.abs(a)<=1e-10)i=this.a*h,s=-1*this.ml0;else {var r=Di(this.a,this.e,Math.sin(a))/Math.tan(a);i=r*Math.sin(e),s=this.a*Li(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+r*(1-Math.cos(e));}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){var i,s,e,a,h,r,n,o,l;if(e=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=1e-10)i=bt(e/this.a+this.long0),s=0;else {var u;for(n=e*e/this.a/this.a+(r=this.lat0+a/this.a)*r,o=r,h=20;h;--h)if(o+=l=-1*(r*(o*(u=Math.tan(o))+1)-o-.5*(o*o+n)*u)/((o-r)/u-1),Math.abs(l)<=1e-10){s=o;break}i=bt(this.long0+Math.asin(e*Math.tan(o)/this.a)/Math.sin(s));}else if(Math.abs(a+this.ml0)<=1e-10)s=0,i=bt(this.long0+e/this.a);else {var c,f,p,d,M;for(n=e*e/this.a/this.a+(r=(this.ml0+a)/this.a)*r,o=r,h=20;h;--h)if(M=this.e*Math.sin(o),c=Math.sqrt(1-M*M)*Math.tan(o),f=this.a*Li(this.e0,this.e1,this.e2,this.e3,o),p=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=l=(r*(c*(d=f/this.a)+1)-d-.5*c*(d*d+n))/(this.es*Math.sin(2*o)*(d*d+n-2*r*d)/(4*c)+(r-d)*(c*p-2/Math.sin(2*o))-p),Math.abs(l)<=1e-10){s=o;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),i=bt(this.long0+Math.asin(e*c/this.a)/Math.sin(s));}return t.x=i,t.y=s,t},names:["Polyconic","poly"]},Hi={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013;},forward:function(t){var i,s=(t.y-this.lat0)/Q*1e-5,e=t.x-this.long0,a=1,h=0;for(i=1;i<=10;i++)h+=this.A[i]*(a*=s);var r,n=h,o=e,l=1,u=0,c=0,f=0;for(i=1;i<=6;i++)r=u*n+l*o,c=c+this.B_re[i]*(l=l*n-u*o)-this.B_im[i]*(u=r),f=f+this.B_im[i]*l+this.B_re[i]*u;return t.x=f*this.a+this.x0,t.y=c*this.a+this.y0,t},inverse:function(t){var i,s,e=(t.y-this.y0)/this.a,a=(t.x-this.x0)/this.a,h=1,r=0,n=0,o=0;for(i=1;i<=6;i++)s=r*e+h*a,n=n+this.C_re[i]*(h=h*e-r*a)-this.C_im[i]*(r=s),o=o+this.C_im[i]*h+this.C_re[i]*r;for(var l=0;l<this.iterations;l++){var u,c=n,f=o,p=e,d=a;for(i=2;i<=6;i++)u=f*n+c*o,p+=(i-1)*(this.B_re[i]*(c=c*n-f*o)-this.B_im[i]*(f=u)),d+=(i-1)*(this.B_im[i]*c+this.B_re[i]*f);c=1,f=0;var M=this.B_re[1],m=this.B_im[1];for(i=2;i<=6;i++)u=f*n+c*o,M+=i*(this.B_re[i]*(c=c*n-f*o)-this.B_im[i]*(f=u)),m+=i*(this.B_im[i]*c+this.B_re[i]*f);var g=M*M+m*m;n=(p*M+d*m)/g,o=(d*M-p*m)/g;}var y=n,v=o,x=1,_=0;for(i=1;i<=9;i++)_+=this.D[i]*(x*=y);var b=this.lat0+_*Q*1e5;return t.x=this.long0+v,t.y=b,t},names:["New_Zealand_Map_Grid","nzmg"]},Ki={init:function(){},forward:function(t){var i=t.y,s=bt(t.x-this.long0),e=this.x0+this.a*s,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=e,t.y=a,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=bt(this.long0+t.x/this.a),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=s,t},names:["Miller_Cylindrical","mill"]},$i={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=mi(this.es);},forward:function(t){var i,s,e=t.x,a=t.y;if(e=bt(e-this.long0),this.sphere){if(this.m)for(var h=this.n*Math.sin(a),r=20;r;--r){var n=(this.m*a+Math.sin(a)-h)/(this.m+Math.cos(a));if(a-=n,Math.abs(n)<1e-10)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;i=this.a*this.C_x*e*(this.m+Math.cos(a)),s=this.a*this.C_y*a;}else {var o=Math.sin(a),l=Math.cos(a);s=this.a*gi(a,o,l,this.en),i=this.a*e*l/Math.sqrt(1-this.es*o*o);}return t.x=i,t.y=s,t},inverse:function(t){var i,s,e;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s/=this.C_x*(this.m+Math.cos(i)),this.m?i=Ji((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=Ji(Math.sin(i)/this.n)),s=bt(s+this.long0),i=Bi(i)):(i=yi(t.y/this.a,this.es,this.en),(e=Math.abs(i))<V?(e=Math.sin(i),s=bt(this.long0+t.x*Math.sqrt(1-this.es*e*e)/(this.a*Math.cos(i)))):e-1e-10<V&&(s=this.long0)),t.x=s,t.y=i,t},names:["Sinusoidal","sinu"]},ts={init:function(){},forward:function(t){for(var i=t.y,s=bt(t.x-this.long0),e=i,a=Math.PI*Math.sin(i);;){var h=-(e+Math.sin(e)-a)/(1+Math.cos(e));if(e+=h,Math.abs(h)<1e-10)break}e/=2,Math.PI/2-Math.abs(i)<1e-10&&(s=0);var r=.900316316158*this.a*s*Math.cos(e)+this.x0,n=1.4142135623731*this.a*Math.sin(e)+this.y0;return t.x=r,t.y=n,t},inverse:function(t){var i,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),i=Math.asin(s);var e=bt(this.long0+t.x/(.900316316158*this.a*Math.cos(i)));e<-Math.PI&&(e=-Math.PI),e>Math.PI&&(e=Math.PI),s=(2*i+Math.sin(2*i))/Math.PI,Math.abs(s)>1&&(s=1);var a=Math.asin(s);return t.x=e,t.y=a,t},names:["Mollweide","moll"]},is={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ti(this.es),this.e1=zi(this.es),this.e2=ji(this.es),this.e3=Gi(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=xt(this.e,this.sinphi,this.cosphi),this.ml1=Li(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=xt(this.e,this.sinphi,this.cosphi),this.ml2=Li(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Li(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0));},forward:function(t){var i,s=t.x,e=t.y;if(this.sphere)i=this.a*(this.g-e);else {var a=Li(this.e0,this.e1,this.e2,this.e3,e);i=this.a*(this.g-a);}var h=this.ns*bt(s-this.long0),r=this.x0+i*Math.sin(h),n=this.y0+this.rh-i*Math.cos(h);return t.x=r,t.y=n,t},inverse:function(t){var i,s,e,a;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var h=0;return 0!==s&&(h=Math.atan2(i*t.x,i*t.y)),this.sphere?(a=bt(this.long0+h/this.ns),e=Bi(this.g-s/this.a),t.x=a,t.y=e,t):(e=Ri(this.g-s/this.a,this.e0,this.e1,this.e2,this.e3),a=bt(this.long0+h/this.ns),t.x=a,t.y=e,t)},names:["Equidistant_Conic","eqdc"]},ss={init:function(){this.R=this.a;},forward:function(t){var i,s,e=t.y,a=bt(t.x-this.long0);Math.abs(e)<=1e-10&&(i=this.x0+this.R*a,s=this.y0);var h=Ji(2*Math.abs(e/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(e)-V)<=1e-10)&&(i=this.x0,s=e>=0?this.y0+Math.PI*this.R*Math.tan(.5*h):this.y0+Math.PI*this.R*-Math.tan(.5*h));var r=.5*Math.abs(Math.PI/a-a/Math.PI),n=r*r,o=Math.sin(h),l=Math.cos(h),u=l/(o+l-1),c=u*(2/o-1),f=c*c,p=Math.PI*this.R*(r*(u-f)+Math.sqrt(n*(u-f)*(u-f)-(f+n)*(u*u-f)))/(f+n);a<0&&(p=-p),i=this.x0+p;var d=n+u;return p=Math.PI*this.R*(c*d-r*Math.sqrt((f+n)*(n+1)-d*d))/(f+n),s=e>=0?this.y0+p:this.y0-p,t.x=i,t.y=s,t},inverse:function(t){var i,s,e,a,h,r,n,o,l,u,c,f;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,h=(e=t.x/c)*e+(a=t.y/c)*a,c=3*(a*a/(o=-2*(r=-Math.abs(a)*(1+h))+1+2*a*a+h*h)+(2*(n=r-2*a*a+e*e)*n*n/o/o/o-9*r*n/o/o)/27)/(l=(r-n*n/3/o)/o)/(u=2*Math.sqrt(-l/3)),Math.abs(c)>1&&(c=c>=0?1:-1),f=Math.acos(c)/3,s=t.y>=0?(-u*Math.cos(f+Math.PI/3)-n/3/o)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-n/3/o)*Math.PI,i=Math.abs(e)<1e-10?this.long0:bt(this.long0+Math.PI*(h-1+Math.sqrt(1+2*(e*e-a*a)+h*h))/2/e),t.x=i,t.y=s,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},es={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0);},forward:function(t){var i,s,e,a,h,r,n,o,l,u,c,f,p,d,M,m,g,y,v,x,_,b,w=t.x,S=t.y,C=Math.sin(t.y),P=Math.cos(t.y),I=bt(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(V-S)*Math.sin(I),t.y=this.y0-this.a*(V-S)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(V+S)*Math.sin(I),t.y=this.y0+this.a*(V+S)*Math.cos(I),t):(y=this.sin_p12*C+this.cos_p12*P*Math.cos(I),g=(m=Math.acos(y))?m/Math.sin(m):1,t.x=this.x0+this.a*g*P*Math.sin(I),t.y=this.y0+this.a*g*(this.cos_p12*C-this.sin_p12*P*Math.cos(I)),t):(i=Ti(this.es),s=zi(this.es),e=ji(this.es),a=Gi(this.es),Math.abs(this.sin_p12-1)<=1e-10?(h=this.a*Li(i,s,e,a,V),r=this.a*Li(i,s,e,a,S),t.x=this.x0+(h-r)*Math.sin(I),t.y=this.y0-(h-r)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(h=this.a*Li(i,s,e,a,V),r=this.a*Li(i,s,e,a,S),t.x=this.x0+(h+r)*Math.sin(I),t.y=this.y0+(h+r)*Math.cos(I),t):(n=C/P,o=Di(this.a,this.e,this.sin_p12),l=Di(this.a,this.e,C),u=Math.atan((1-this.es)*n+this.es*o*this.sin_p12/(l*P)),v=0===(c=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(c)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(I)*Math.cos(u)/Math.sin(c)),f=this.e*this.sin_p12/Math.sqrt(1-this.es),p=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es),t.x=this.x0+(m=o*v*(1-(x=v*v)*(M=p*p)*(1-M)/6+(_=x*v)/8*(d=f*p)*(1-2*M)+(b=_*v)/120*(M*(4-7*M)-3*f*f*(1-7*M))-b*v/48*d))*Math.sin(c),t.y=this.y0+m*Math.cos(c),t))},inverse:function(t){var i,s,e,a,h,r,n,o,l,u,c,f,p,d,M,m,g,y,v,x,_,b,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*V*this.a)return;return s=i/this.a,e=Math.sin(s),a=Math.cos(s),h=this.long0,Math.abs(i)<=1e-10?r=this.lat0:(r=Ji(a*this.sin_p12+t.y*e*this.cos_p12/i),n=Math.abs(this.lat0)-V,h=Math.abs(n)<=1e-10?bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):bt(this.long0+Math.atan2(t.x*e,i*this.cos_p12*a-t.y*this.sin_p12*e))),t.x=h,t.y=r,t}return o=Ti(this.es),l=zi(this.es),u=ji(this.es),c=Gi(this.es),Math.abs(this.sin_p12-1)<=1e-10?(r=Ri(((f=this.a*Li(o,l,u,c,V))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,o,l,u,c),h=bt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=h,t.y=r,t):Math.abs(this.sin_p12+1)<=1e-10?(f=this.a*Li(o,l,u,c,V),r=Ri(((i=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,o,l,u,c),h=bt(this.long0+Math.atan2(t.x,t.y)),t.x=h,t.y=r,t):(i=Math.sqrt(t.x*t.x+t.y*t.y),M=Math.atan2(t.x,t.y),p=Di(this.a,this.e,this.sin_p12),m=Math.cos(M),v=3*this.es*(1-(y=-(g=this.e*this.cos_p12*m)*g/(1-this.es)))*this.sin_p12*this.cos_p12*m/(1-this.es),b=1-y*(_=(x=i/p)-y*(1+y)*Math.pow(x,3)/6-v*(1+3*y)*Math.pow(x,4)/24)*_/2-x*_*_*_/6,d=Math.asin(this.sin_p12*Math.cos(_)+this.cos_p12*Math.sin(_)*m),h=bt(this.long0+Math.asin(Math.sin(M)*Math.sin(_)/Math.cos(d))),w=Math.sin(d),r=Math.atan2((w-this.es*b*this.sin_p12)*Math.tan(d),w*(1-this.es)),t.x=h,t.y=r,t)},names:["Azimuthal_Equidistant","aeqd"]},as={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0);},forward:function(t){var i,s,e,a,h,r,n,o=t.y;return e=bt(t.x-this.long0),i=Math.sin(o),s=Math.cos(o),a=Math.cos(e),((h=this.sin_p14*i+this.cos_p14*s*a)>0||Math.abs(h)<=1e-10)&&(r=1*this.a*s*Math.sin(e),n=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*a)),t.x=r,t.y=n,t},inverse:function(t){var i,s,e,a,h,r,n;return t.x-=this.x0,t.y-=this.y0,s=Ji((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),e=Math.sin(s),a=Math.cos(s),r=this.long0,Math.abs(i)<=1e-10?(n=this.lat0,t.x=r,t.y=n,t):(n=Ji(a*this.sin_p14+t.y*e*this.cos_p14/i),h=Math.abs(this.lat0)-V,Math.abs(h)<=1e-10?(r=bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=r,t.y=n,t):(r=bt(this.long0+Math.atan2(t.x*e,i*this.cos_p14*a-t.y*this.sin_p14*e)),t.x=r,t.y=n,t))},names:["ortho"]};function hs(t,i,s,e){var a;return t<1e-10?(e.value=1,a=0):(a=Math.atan2(i,s),Math.abs(a)<=K?e.value=1:a>K&&a<=V+K?(e.value=2,a-=V):a>V+K||a<=-(V+K)?(e.value=3,a=a>=0?a-tt:a+tt):(e.value=4,a+=V)),a}function rs(t,i){var s=t+i;return s<-tt?s+=$:s>+tt&&(s-=$),s}var ns={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=V-K/2?5:this.lat0<=-(V-K/2)?6:Math.abs(this.long0)<=K?1:Math.abs(this.long0)<=V+K?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f);},forward:function(t){var i,s,e,a,h,r,n={x:0,y:0},o={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,s=t.x,5===this.face)a=V-i,s>=K&&s<=V+K?(o.value=1,e=s-V):s>V+K||s<=-(V+K)?(o.value=2,e=s>0?s-tt:s+tt):s>-(V+K)&&s<=-K?(o.value=3,e=s+V):(o.value=4,e=s);else if(6===this.face)a=V+i,s>=K&&s<=V+K?(o.value=1,e=-s+V):s<K&&s>=-K?(o.value=2,e=-s):s<-K&&s>=-(V+K)?(o.value=3,e=-s-V):(o.value=4,e=s>0?-s+tt:-s-tt);else {var l,u,c,f,p,d;2===this.face?s=rs(s,+V):3===this.face?s=rs(s,+tt):4===this.face&&(s=rs(s,-V)),f=Math.sin(i),p=Math.cos(i),d=Math.sin(s),l=p*Math.cos(s),u=p*d,c=f,1===this.face?e=hs(a=Math.acos(l),c,u,o):2===this.face?e=hs(a=Math.acos(u),c,-l,o):3===this.face?e=hs(a=Math.acos(-l),c,-u,o):4===this.face?e=hs(a=Math.acos(-u),c,l,o):(a=e=0,o.value=1);}return r=Math.atan(12/tt*(e+Math.acos(Math.sin(e)*Math.cos(K))-V)),h=Math.sqrt((1-Math.cos(a))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(e))))),2===o.value?r+=V:3===o.value?r+=tt:4===o.value&&(r+=1.5*tt),n.x=h*Math.cos(r),n.y=h*Math.sin(r),n.x=n.x*this.a+this.x0,n.y=n.y*this.a+this.y0,t.x=n.x,t.y=n.y,t},inverse:function(t){var i,s,e,a,h,r,n,o,l,u,c,f,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=2,i-=V):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=3,i=i<0?i+tt:i-tt):(d.value=4,i+=V),l=tt/12*Math.tan(i),h=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),r=Math.atan(h),(n=1-(e=Math.cos(i))*e*(a=Math.tan(s))*a*(1-Math.cos(Math.atan(1/Math.cos(r)))))<-1?n=-1:n>1&&(n=1),5===this.face)o=Math.acos(n),p.phi=V-o,p.lam=1===d.value?r+V:2===d.value?r<0?r+tt:r-tt:3===d.value?r-V:r;else if(6===this.face)o=Math.acos(n),p.phi=o-V,p.lam=1===d.value?-r+V:2===d.value?-r:3===d.value?-r-V:r<0?-r-tt:-r+tt;else {var M,m,g;l=(M=n)*M,m=(l+=(g=l>=1?0:Math.sqrt(1-l)*Math.sin(r))*g)>=1?0:Math.sqrt(1-l),2===d.value?(l=m,m=-g,g=l):3===d.value?(m=-m,g=-g):4===d.value&&(l=m,m=g,g=-l),2===this.face?(l=M,M=-m,m=l):3===this.face?(M=-M,m=-m):4===this.face&&(l=M,M=m,m=-l),p.phi=Math.acos(-g)-V,p.lam=Math.atan2(m,M),2===this.face?p.lam=rs(p.lam,-V):3===this.face?p.lam=rs(p.lam,-tt):4===this.face&&(p.lam=rs(p.lam,+V));}return 0!==this.es&&(u=p.phi<0?1:0,c=Math.tan(p.phi),f=this.b/Math.sqrt(c*c+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},os=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ls=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],us=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},cs={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson";},forward:function(t){var i=bt(t.x-this.long0),s=Math.abs(t.y),e=Math.floor(11.459155902616464*s);e<0?e=0:e>=18&&(e=17);var a={x:us(os[e],s=H*(s-.08726646259971647*e))*i,y:us(ls[e],s)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*.8487+this.x0,a.y=a.y*this.a*1.3523+this.y0,a},inverse:function(t){var i={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(i.y>=1)i.x/=os[18][0],i.y=t.y<0?-V:V;else {var s=Math.floor(18*i.y);for(s<0?s=0:s>=18&&(s=17);;)if(ls[s][0]>i.y)--s;else {if(!(ls[s+1][0]<=i.y))break;++s;}var e=ls[s],a=5*(i.y-e[0])/(ls[s+1][0]-e[0]);a=function(t,i,s,e){for(var a=i;e;--e){var h=t(a);if(a-=h,Math.abs(h)<1e-10)break}return a}((function(t){return (us(e,t)-i.y)/function(t,i){return t[1]+i*(2*t[2]+3*i*t[3])}(e,t)}),a,0,100),i.x/=us(os[s],a),i.y=(5*s+a)*Y,t.y<0&&(i.y=-i.y);}return i.x=bt(i.x+this.long0),i},names:["Robinson","robin"]},fs={init:function(){this.name="geocent";},forward:function(t){return Ft(t,this.es,this.a)},inverse:function(t){return Ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},ps={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},ds={init:function(){if(Object.keys(ps).forEach(function(t){if(void 0===this[t])this[t]=ps[t].def;else {if(ps[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);ps[t].num&&(this[t]=parseFloat(this[t]));}ps[t].degrees&&(this[t]=this[t]*Y);}.bind(this)),Math.abs(Math.abs(this.lat0)-V)<1e-10?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<1e-10?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t);},forward:function(t){t.x-=this.long0;var i,s,e,a,h=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x);switch(this.mode){case 3:s=this.sinph0*h+this.cosph0*r*n;break;case 2:s=r*n;break;case 1:s=-h;break;case 0:s=h;}switch(i=(s=this.pn1/(this.p-s))*r*Math.sin(t.x),this.mode){case 3:s*=this.cosph0*h-this.sinph0*r*n;break;case 2:s*=h;break;case 0:s*=-r*n;break;case 1:s*=r*n;}return i=(i*this.cg-s*this.sg)*this.cw*(a=1/((e=s*this.cg+i*this.sg)*this.sw*this.h1+this.cw)),s=e*a,t.x=i*this.a,t.y=s*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var i,s,e,a={x:t.x,y:t.y};t.x=(i=this.pn1*t.x*(e=1/(this.pn1-t.y*this.sw)))*this.cg+(s=this.pn1*t.y*this.cw*e)*this.sg,t.y=s*this.cg-i*this.sg;var h=_i(t.x,t.y);if(Math.abs(h)<1e-10)a.x=0,a.y=t.y;else {var r,n;switch(n=1-h*h*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/h+h/this.pn1),r=Math.sqrt(1-n*n),this.mode){case 3:a.y=Math.asin(r*this.sinph0+t.y*n*this.cosph0/h),t.y=(r-this.sinph0*Math.sin(a.y))*h,t.x*=n*this.cosph0;break;case 2:a.y=Math.asin(t.y*n/h),t.y=r*h,t.x*=n;break;case 0:a.y=Math.asin(r),t.y=-t.y;break;case 1:a.y=-Math.asin(r);}a.x=Math.atan2(t.x,t.y);}return t.x=a.x+this.long0,t.y=a.y,t},names:["Tilted_Perspective","tpers"]},Ms={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse";}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View");},forward:function(t){var i,s,e,a,h=t.x,r=t.y;if(h-=this.long0,"ellipse"===this.shape){r=Math.atan(this.radius_p2*Math.tan(r));var n=this.radius_p/_i(this.radius_p*Math.cos(r),Math.sin(r));if(s=n*Math.cos(h)*Math.cos(r),e=n*Math.sin(h)*Math.cos(r),a=n*Math.sin(r),(this.radius_g-s)*s-e*e-a*a*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(e/_i(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(e/i),t.y=this.radius_g_1*Math.atan(a/_i(e,i)));}else "sphere"===this.shape&&(i=Math.cos(r),s=Math.cos(h)*i,e=Math.sin(h)*i,a=Math.sin(r),i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(e/_i(a,i)),t.y=this.radius_g_1*Math.atan(a/i)):(t.x=this.radius_g_1*Math.atan(e/i),t.y=this.radius_g_1*Math.atan(a/_i(e,i))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var i,s,e,a,h=-1,r=0,n=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(n=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*_i(1,n)):(r=Math.tan(t.x/this.radius_g_1),n=Math.tan(t.y/this.radius_g_1)*_i(1,r));var o=n/this.radius_p;if((e=(s=2*this.radius_g*h)*s-4*(i=r*r+o*o+h*h)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(e))/(2*i),h=this.radius_g+a*h,r*=a,n*=a,t.x=Math.atan2(r,h),t.y=Math.atan(n*Math.cos(t.x)/h),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y));}else if("sphere"===this.shape){if(this.flip_axis?(n=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+n*n)):(r=Math.tan(t.x/this.radius_g_1),n=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+r*r)),(e=(s=2*this.radius_g*h)*s-4*(i=r*r+n*n+h*h)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(e))/(2*i),h=this.radius_g+a*h,r*=a,n*=a,t.x=Math.atan2(r,h),t.y=Math.atan(n*Math.cos(t.x)/h);}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};ii.defaultDatum="WGS84",ii.Proj=Rt,ii.WGS84=new ii.Proj("WGS84"),ii.Point=di,ii.toPoint=Vt,ii.defs=mt,ii.nadgrid=function(t,i){var s=new DataView(i),e=function(t){var i=t.getInt32(8,!1);return 11!==i&&(11!==(i=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(s),a=function(t,i){return {nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:jt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}(s,e),h={header:a,subgrids:function(t,i,s){for(var e=176,a=[],h=0;h<i.nSubgrids;h++){var r=Dt(t,e,s),n=Bt(t,e,r,s),o=Math.round(1+(r.upperLongitude-r.lowerLongitude)/r.longitudeInterval),l=Math.round(1+(r.upperLatitude-r.lowerLatitude)/r.latitudeInterval);a.push({ll:[zt(r.lowerLongitude),zt(r.lowerLatitude)],del:[zt(r.longitudeInterval),zt(r.latitudeInterval)],lim:[o,l],count:r.gridNodeCount,cvs:Gt(n)}),e+=176+16*r.gridNodeCount;}return a}(s,a,e)};return Lt[t]=h,h},ii.transform=Ht,ii.mgrs=hi,ii.version="__VERSION__",function(t){t.Proj.projections.add(vi),t.Proj.projections.add(Si),t.Proj.projections.add(Ci),t.Proj.projections.add(Ni),t.Proj.projections.add(ki),t.Proj.projections.add(Ei),t.Proj.projections.add(Oi),t.Proj.projections.add(Ai),t.Proj.projections.add(qi),t.Proj.projections.add(Fi),t.Proj.projections.add(Wi),t.Proj.projections.add(Xi),t.Proj.projections.add(Zi),t.Proj.projections.add(Qi),t.Proj.projections.add(Vi),t.Proj.projections.add(Yi),t.Proj.projections.add(Hi),t.Proj.projections.add(Ki),t.Proj.projections.add($i),t.Proj.projections.add(ts),t.Proj.projections.add(is),t.Proj.projections.add(ss),t.Proj.projections.add(es),t.Proj.projections.add(as),t.Proj.projections.add(ns),t.Proj.projections.add(cs),t.Proj.projections.add(fs),t.Proj.projections.add(ds),t.Proj.projections.add(Ms);}(ii);var ms=function(t,i,s,e,a){if(this.bounds=s,this.width=e,this.height=a,!i)throw new Error("自定义参考系必须指定参数系信息def");if(!ii)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");var h=this._isProj4Obj(t);this._proj=h?t:this._projFromCodeDef(t,i);};function gs(t,i,s,e,a,h){var r=a-s,n=h-e;if(0!==r||0!==n){var o=((t-s)*r+(i-e)*n)/(r*r+n*n);o>1?(s=a,e=h):o>0&&(s+=r*o,e+=n*o);}return (r=t-s)*r+(n=i-e)*n}function ys(t,i,s,e){var a={id:null==t?null:t,type:i,geometry:s,tags:e,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===i||"MultiPoint"===i||"LineString"===i)vs(a,s);else if("Polygon"===i)vs(a,s[0]);else if("MultiLineString"===i)for(var h=0,r=s;h<r.length;h+=1)vs(a,r[h]);else if("MultiPolygon"===i)for(var n=0,o=s;n<o.length;n+=1)vs(a,o[n][0]);return a}function vs(t,i){for(var s=0;s<i.length;s+=3)t.minX=Math.min(t.minX,i[s]),t.minY=Math.min(t.minY,i[s+1]),t.maxX=Math.max(t.maxX,i[s]),t.maxY=Math.max(t.maxY,i[s+1]);}function xs(t,i,s,e){if(i.geometry){var a,h=s.crs,r=s.projectionParams;r&&r.def&&(a=new ms(r.code,r.def,r.bounds,r.width,r.height));var n=i.geometry.coordinates,o=i.geometry.type,l=Math.pow(s.tolerance/((1<<s.maxZoom)*s.extent),2),u=[],c=i.id;if(s.promoteId?c=i.properties[s.promoteId]:s.generateId&&(c=e||0),"Point"===o)_s(n,u,h,a);else if("MultiPoint"===o)for(var f=0,p=n;f<p.length;f+=1)_s(p[f],u,h,a);else if("LineString"===o)bs(n,u,l,!1,h,a);else if("MultiLineString"===o){if(s.lineMetrics){for(var d=0,M=n;d<M.length;d+=1)bs(M[d],u=[],l,!1,h,a),t.push(ys(c,"LineString",u,i.properties));return}ws(n,u,l,!1,h,a);}else if("Polygon"===o)ws(n,u,l,!0,h,a);else {if("MultiPolygon"!==o){if("GeometryCollection"===o){for(var m=0,g=i.geometry.geometries;m<g.length;m+=1)xs(t,{id:c,geometry:g[m],properties:i.properties},s,e);return}throw new Error("Input data is not a valid GeoJSON object.")}for(var y=0,v=n;y<v.length;y+=1){var x=[];ws(v[y],x,l,!0,h,a),u.push(x);}}t.push(ys(c,o,u,i.properties));}}function _s(t,i,s,e){console.log("convertPoint: ",_s);var a=Ss(t,s,e);i.push(a[0],a[1],0);}function bs(t,i,s,e,a,h){for(var r,n,o=0,l=0;l<t.length;l++){var u=Ss(t[l],a,h),c=u[0],f=u[1];i.push(c,f,0),l>0&&(o+=e?(r*f-c*n)/2:Math.sqrt(Math.pow(c-r,2)+Math.pow(f-n,2))),r=c,n=f;}var p=i.length-3;i[2]=1,function t(i,s,e,a){for(var h,r=a,n=e-s>>1,o=e-s,l=i[s],u=i[s+1],c=i[e],f=i[e+1],p=s+3;p<e;p+=3){var d=gs(i[p],i[p+1],l,u,c,f);if(d>r)h=p,r=d;else if(d===r){var M=Math.abs(p-n);M<o&&(h=p,o=M);}}r>a&&(h-s>3&&t(i,s,h,a),i[h+2]=r,e-h>3&&t(i,h,e,a));}(i,0,p,s),i[p+2]=1,i.size=Math.abs(o),i.start=0,i.end=i.size;}function ws(t,i,s,e,a,h){for(var r=0;r<t.length;r++){var n=[];bs(t[r],n,s,e,a,h),i.push(n);}}function Ss(t,i,s){var e=[];if(s)(e=s.project([t[0],t[1]]))[1]=e[1]<0?0:e[1]>1?1:e[1];else if("EPSG:3857"===i){var a=t[0]/360+.5,h=Math.sin(t[1]*Math.PI/180),r=.5-.25*Math.log((1+h)/(1-h))/Math.PI;e=[a,r=r<0?0:r>1?1:r];}else {if("EPSG:4326"!==i)throw new Error("未预定义投影转换方法");var n=(90-t[1])/360;e=[t[0]/360+.5,n=n<0?0:n>1?1:n];}return e}function Cs(t,i,s,e,a,h,r,n){if(e/=i,h>=(s/=i)&&r<e)return t;if(r<s||h>=e)return null;for(var o=[],l=0,u=t;l<u.length;l+=1){var c=u[l],f=c.geometry,p=c.type,d=0===a?c.minX:c.minY,M=0===a?c.maxX:c.maxY;if(d>=s&&M<e)o.push(c);else if(!(M<s||d>=e)){var m=[];if("Point"===p||"MultiPoint"===p)Ps(f,m,s,e,a);else if("LineString"===p)Is(f,m,s,e,a,!1,n.lineMetrics);else if("MultiLineString"===p)ks(f,m,s,e,a,!1);else if("Polygon"===p)ks(f,m,s,e,a,!0);else if("MultiPolygon"===p)for(var g=0,y=f;g<y.length;g+=1){var v=[];ks(y[g],v,s,e,a,!0),v.length&&m.push(v);}if(m.length){if(n.lineMetrics&&"LineString"===p){for(var x=0,_=m;x<_.length;x+=1)o.push(ys(c.id,p,_[x],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),o.push(ys(c.id,p,m,c.tags));}}}return o.length?o:null}function Ps(t,i,s,e,a){for(var h=0;h<t.length;h+=3){var r=t[h+a];r>=s&&r<=e&&Es(i,t[h],t[h+1],t[h+2]);}}function Is(t,i,s,e,a,h,r){for(var n,o,l=Ns(t),u=0===a?Os:As,c=t.start,f=0;f<t.length-3;f+=3){var p=t[f],d=t[f+1],M=t[f+2],m=t[f+3],g=t[f+4],y=0===a?p:d,v=0===a?m:g,x=!1;r&&(n=Math.sqrt(Math.pow(p-m,2)+Math.pow(d-g,2))),y<s?v>s&&(o=u(l,p,d,m,g,s),r&&(l.start=c+n*o)):y>e?v<e&&(o=u(l,p,d,m,g,e),r&&(l.start=c+n*o)):Es(l,p,d,M),v<s&&y>=s&&(o=u(l,p,d,m,g,s),x=!0),v>e&&y<=e&&(o=u(l,p,d,m,g,e),x=!0),!h&&x&&(r&&(l.end=c+n*o),i.push(l),l=Ns(t)),r&&(c+=n);}var _=t.length-3,b=t[_],w=t[_+1],S=0===a?b:w;S>=s&&S<=e&&Es(l,b,w,t[_+2]),_=l.length-3,h&&_>=3&&(l[_]!==l[0]||l[_+1]!==l[1])&&Es(l,l[0],l[1],l[2]),l.length&&i.push(l);}function Ns(t){var i=[];return i.size=t.size,i.start=t.start,i.end=t.end,i}function ks(t,i,s,e,a,h){for(var r=0,n=t;r<n.length;r+=1)Is(n[r],i,s,e,a,h,!1);}function Es(t,i,s,e){t.push(i,s,e);}function Os(t,i,s,e,a,h){var r=(h-i)/(e-i);return Es(t,h,s+(a-s)*r,1),r}function As(t,i,s,e,a,h){var r=(h-s)/(a-s);return Es(t,i+(e-i)*r,h,1),r}function qs(t,i){for(var s=[],e=0;e<t.length;e++){var a=t[e],h=a.type,r=void 0;if("Point"===h||"MultiPoint"===h||"LineString"===h)r=Ls(a.geometry,i);else if("MultiLineString"===h||"Polygon"===h){r=[];for(var n=0,o=a.geometry;n<o.length;n+=1)r.push(Ls(o[n],i));}else if("MultiPolygon"===h){r=[];for(var l=0,u=a.geometry;l<u.length;l+=1){for(var c=[],f=0,p=u[l];f<p.length;f+=1)c.push(Ls(p[f],i));r.push(c);}}s.push(ys(a.id,h,r,a.tags));}return s}function Ls(t,i){var s=[];s.size=t.size,void 0!==t.start&&(s.start=t.start,s.end=t.end);for(var e=0;e<t.length;e+=3)s.push(t[e]+i,t[e+1],t[e+2]);return s}function Ts(t,i){if(t.transformed)return t;for(var s=1<<t.z,e=t.x,a=t.y,h=0,r=t.features;h<r.length;h+=1){var n=r[h],o=n.geometry,l=n.type;if(n.geometry=[],1===l)for(var u=0;u<o.length;u+=2)n.geometry.push(zs(o[u],o[u+1],i,s,e,a));else for(var c=0;c<o.length;c++){for(var f=[],p=0;p<o[c].length;p+=2)f.push(zs(o[c][p],o[c][p+1],i,s,e,a));n.geometry.push(f);}}return t.transformed=!0,t}function zs(t,i,s,e,a,h){return [Math.round(s*(t*e-a)),Math.round(s*(i*e-h))]}function js(t,i,s,e,a){for(var h=i===a.maxZoom?0:a.tolerance/((1<<i)*a.extent),r={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:s,y:e,z:i,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},n=0,o=t;n<o.length;n+=1)Gs(r,o[n],h,a);return r}function Gs(t,i,s,e){var a=i.geometry,h=i.type,r=[];if(t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),"Point"===h||"MultiPoint"===h)for(var n=0;n<a.length;n+=3)r.push(a[n],a[n+1]),t.numPoints++,t.numSimplified++;else if("LineString"===h)Ds(r,a,t,s,!1,!1);else if("MultiLineString"===h||"Polygon"===h)for(var o=0;o<a.length;o++)Ds(r,a[o],t,s,"Polygon"===h,0===o);else if("MultiPolygon"===h)for(var l=0;l<a.length;l++)for(var u=a[l],c=0;c<u.length;c++)Ds(r,u[c],t,s,!0,0===c);if(r.length){var f=i.tags||null;if("LineString"===h&&e.lineMetrics){for(var p in f={},i.tags)f[p]=i.tags[p];f.mapbox_clip_start=a.start/a.size,f.mapbox_clip_end=a.end/a.size;}var d={geometry:r,type:"Polygon"===h||"MultiPolygon"===h?3:"LineString"===h||"MultiLineString"===h?2:1,tags:f};null!==i.id&&(d.id=i.id),t.features.push(d);}}function Ds(t,i,s,e,a,h){var r=e*e;if(e>0&&i.size<(a?r:e))s.numPoints+=i.length/3;else {for(var n=[],o=0;o<i.length;o+=3)(0===e||i[o+2]>r)&&(s.numSimplified++,n.push(i[o],i[o+1])),s.numPoints++;a&&function(t,i){for(var s=0,e=0,a=t.length,h=a-2;e<a;h=e,e+=2)s+=(t[e]-t[h])*(t[e+1]+t[h+1]);if(s>0===i)for(var r=0,n=t.length;r<n/2;r+=2){var o=t[r],l=t[r+1];t[r]=t[n-2-r],t[r+1]=t[n-1-r],t[n-2-r]=o,t[n-1-r]=l;}}(n,h),t.push(n);}}ms.prototype.project=function(t){var i,s;Array.isArray(t)?(i=t[0],s=t[1]):(i=t.lng,s=t.lat);var e=this._proj.forward([i,s]),a=this.bounds;return [(e[0]-a[0])/this.width,(a[3]-e[1])/this.height]},ms.prototype.unproject=function(t){var i,s;return Array.isArray(t)?(i=t[0],s=t[1]):(i=t.x,s=t.y),this._proj.inverse([i,s])},ms.prototype._projFromCodeDef=function(t,i){if(i)ii.defs(t,i);else if(void 0===ii.defs[t]){var s=t.split(":");if(s.length>3&&(t=s[s.length-3]+":"+s[s.length-1]),void 0===ii.defs[t])throw new Error("No projection definition for code "+t)}return ii(t)},ms.prototype._isProj4Obj=function(t){return void 0!==t.inverse&&void 0!==t.forward};var Bs={crs:"EPSG:3857",maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Rs=function(t,i){var s=(i=this.options=function(t,i){for(var s in i)t[s]=i[s];return t}(Object.create(Bs),i)).debug;if(s&&console.time("preprocess data"),i.maxZoom<0||i.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(i.promoteId&&i.generateId)throw new Error("promoteId and generateId cannot be used together.");var e=function(t,i){var s=[];if("FeatureCollection"===t.type)for(var e=0;e<t.features.length;e++)xs(s,t.features[e],i,e);else xs(s,"Feature"===t.type?t:{geometry:t},i);return s}(t,i);this.tiles={},this.tileCoords=[],s&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",i.indexMaxZoom,i.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(e=function(t,i){var s=i.buffer/i.extent,e=t,a=Cs(t,1,-1-s,s,0,-1,2,i),h=Cs(t,1,1-s,2+s,0,-1,2,i);return (a||h)&&(e=Cs(t,1,-s,1+s,0,-1,2,i)||[],a&&(e=qs(a,1).concat(e)),h&&(e=e.concat(qs(h,-1)))),e}(e,i)).length&&this.splitTile(e,0,0,0),s&&(e.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)));};function Fs(t,i,s){return 32*((1<<t)*s+i)+t}function Us(t,i){var s=t.tileID.canonical;if(!this._geoJSONIndex)return i(null,null);var e=this._geoJSONIndex.getTile(s.z,s.x,s.y);if(!e)return i(null,null);var a=new M(e.features),h=x(a);0===h.byteOffset&&h.byteLength===h.buffer.byteLength||(h=new Uint8Array(h)),i(null,{vectorTile:a,rawData:h.buffer});}Rs.prototype.splitTile=function(t,i,s,e,a,h,r){for(var n=[t,i,s,e],o=this.options,l=o.debug;n.length;){e=n.pop(),s=n.pop(),i=n.pop(),t=n.pop();var u=1<<i,c=Fs(i,s,e),f=this.tiles[c];if(!f&&(l>1&&console.time("creation"),f=this.tiles[c]=js(t,i,s,e,o),this.tileCoords.push({z:i,x:s,y:e}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",i,s,e,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+i;this.stats[p]=(this.stats[p]||0)+1,this.total++;}if(f.source=t,null==a){if(i===o.indexMaxZoom||f.numPoints<=o.indexMaxPoints)continue}else {if(i===o.maxZoom||i===a)continue;if(null!=a){var d=a-i;if(s!==h>>d||e!==r>>d)continue}}if(f.source=null,0!==t.length){l>1&&console.time("clipping");var M=.5*o.buffer/o.extent,m=.5-M,g=.5+M,y=1+M,v=null,x=null,_=null,b=null,w=Cs(t,u,s-M,s+g,0,f.minX,f.maxX,o),S=Cs(t,u,s+m,s+y,0,f.minX,f.maxX,o);t=null,w&&(v=Cs(w,u,e-M,e+g,1,f.minY,f.maxY,o),x=Cs(w,u,e+m,e+y,1,f.minY,f.maxY,o),w=null),S&&(_=Cs(S,u,e-M,e+g,1,f.minY,f.maxY,o),b=Cs(S,u,e+m,e+y,1,f.minY,f.maxY,o),S=null),l>1&&console.timeEnd("clipping"),n.push(v||[],i+1,2*s,2*e),n.push(x||[],i+1,2*s,2*e+1),n.push(_||[],i+1,2*s+1,2*e),n.push(b||[],i+1,2*s+1,2*e+1);}}},Rs.prototype.getTile=function(t,i,s){var e=this.options,a=e.extent,h=e.debug;if((t=+t)<0||t>24)return null;var r=1<<t,n=Fs(t,i=(i=+i)+r&r-1,s=+s);if(this.tiles[n])return Ts(this.tiles[n],a);h>1&&console.log("drilling down to z%d-%d-%d",t,i,s);for(var o,l=t,u=i,c=s;!o&&l>0;)l--,o=this.tiles[Fs(l,u>>=1,c>>=1)];return o&&o.source?(h>1&&(console.log("found parent tile z%d-%d-%d",l,u,c),console.time("drilling down")),this.splitTile(o.source,l,u,c,t,i,s),h>1&&console.timeEnd("drilling down"),this.tiles[n]?Ts(this.tiles[n],a):null):null};var Ws=function(i){function s(t,s,e,a){i.call(this,t,s,e,Us),a&&(this.loadGeoJSON=a);}return i&&(s.__proto__=i),(s.prototype=Object.create(i&&i.prototype)).constructor=s,s.prototype.loadData=function(t,i){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=i,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData());},s.prototype._loadData=function(){var i=this;if(this._pendingCallback&&this._pendingLoadDataParams){var s=this._pendingCallback,e=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request);this.loadGeoJSON(e,(function(h,r){if(h||!r)return s(h);if("object"!=typeof r)return s(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));!function t(i,s){var e,a=i&&i.type;if("FeatureCollection"===a)for(e=0;e<i.features.length;e++)t(i.features[e],s);else if("GeometryCollection"===a)for(e=0;e<i.geometries.length;e++)t(i.geometries[e],s);else if("Feature"===a)t(i.geometry,s);else if("Polygon"===a)c(i.coordinates,s);else if("MultiPolygon"===a)for(e=0;e<i.coordinates.length;e++)c(i.coordinates[e],s);return i}(r,!0);try{i._geoJSONIndex=e.cluster?new j(function(i){var s=i.superclusterOptions,e=i.clusterProperties;if(!e||!s)return s;for(var a={},h={},r={accumulated:null,zoom:0},n={properties:null},o=Object.keys(e),l=0,u=o;l<u.length;l+=1){var c=u[l],f=e[c],p=f[0],d=t.createExpression(f[1]),M=t.createExpression("string"==typeof p?[p,["accumulated"],["get",c]]:p);a[c]=d.value,h[c]=M.value;}return s.map=function(t){n.properties=t;for(var i={},s=0,e=o;s<e.length;s+=1){var h=e[s];i[h]=a[h].evaluate(r,n);}return i},s.reduce=function(t,i){n.properties=i;for(var s=0,e=o;s<e.length;s+=1){var a=e[s];r.accumulated=t[a],t[a]=h[a].evaluate(r,n);}},s}(e)).load(r.features):function(t,i){return new Rs(t,i)}(r,e.geojsonVtOptions);}catch(h){return s(h)}i.loaded={};var n={};if(a){var o=a.finish();o&&(n.resourceTiming={},n.resourceTiming[e.source]=JSON.parse(JSON.stringify(o)));}s(null,n);}));}},s.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData());},s.prototype.reloadTile=function(t,s){var e=this.loaded;return e&&e[t.uid]?i.prototype.reloadTile.call(this,t,s):this.loadTile(t,s)},s.prototype.loadGeoJSON=function(i,s){if(i.request)t.getJSON(i.request,s);else {if("string"!=typeof i.data)return s(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));try{return s(null,JSON.parse(i.data))}catch(t){return s(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."))}}},s.prototype.removeSource=function(t,i){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),i();},s.prototype.getClusterExpansionZoom=function(t,i){try{i(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId));}catch(t){i(t);}},s.prototype.getClusterChildren=function(t,i){try{i(null,this._geoJSONIndex.getChildren(t.clusterId));}catch(t){i(t);}},s.prototype.getClusterLeaves=function(t,i){try{i(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset));}catch(t){i(t);}},s}(o),Js=function(i){var s=this;this.self=i,this.actor=new t.Actor(i,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:o,mbtiles:o,geojson:Ws,rasteroffline:t.RasterTileSourceOffline},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,i){if(s.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');s.workerSourceTypes[t]=i;},this.self.registerRTLTextPlugin=function(i){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=i.applyArabicShaping,t.plugin.processBidirectionalText=i.processBidirectionalText,t.plugin.processStyledBidirectionalText=i.processStyledBidirectionalText;};};return Js.prototype.setReferrer=function(t,i){this.referrer=i;},Js.prototype.setImages=function(t,i,s){this.availableImages[t]=i,s();},Js.prototype.setLayers=function(t,i,s){this.getLayerIndex(t).replace(i),s();},Js.prototype.updateLayers=function(t,i,s){this.getLayerIndex(t).update(i.layers,i.removedIds),s();},Js.prototype.loadTile=function(t,i,s){this.getWorkerSource(t,i.type,i.source).loadTile(i,s);},Js.prototype.loadDEMTile=function(t,i,s){this.getDEMWorkerSource(t,i.source).loadTile(i,s);},Js.prototype.reloadTile=function(t,i,s){this.getWorkerSource(t,i.type,i.source).reloadTile(i,s);},Js.prototype.abortTile=function(t,i,s){this.getWorkerSource(t,i.type,i.source).abortTile(i,s);},Js.prototype.removeTile=function(t,i,s){this.getWorkerSource(t,i.type,i.source).removeTile(i,s);},Js.prototype.removeDEMTile=function(t,i){this.getDEMWorkerSource(t,i.source).removeTile(i);},Js.prototype.removeSource=function(t,i,s){if(this.workerSources[t]&&this.workerSources[t][i.type]&&this.workerSources[t][i.type][i.source]){var e=this.workerSources[t][i.type][i.source];delete this.workerSources[t][i.type][i.source],void 0!==e.removeSource?e.removeSource(i,s):s();}},Js.prototype.loadWorkerSource=function(t,i,s){try{this.self.importScripts(i.url),s();}catch(t){s(t.toString());}},Js.prototype.syncRTLPluginState=function(i,s,e){try{t.plugin.setState(s);var a=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=a){this.self.importScripts(a);var h=t.plugin.isParsed();e(h?void 0:new Error("RTL Text Plugin failed to import scripts from "+a),h);}}catch(t){e(t.toString());}},Js.prototype.getAvailableImages=function(t){var i=this.availableImages[t];return i||(i=[]),i},Js.prototype.getLayerIndex=function(t){var i=this.layerIndexes[t];return i||(i=this.layerIndexes[t]=new e),i},Js.prototype.getWorkerSource=function(t,i,s){var e=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][i]||(this.workerSources[t][i]={}),this.workerSources[t][i][s]||(this.workerSources[t][i][s]=new this.workerSourceTypes[i]({send:function(i,s,a){e.actor.send(i,s,a,t);}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][i][s]},Js.prototype.getDEMWorkerSource=function(t,i){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][i]||(this.demWorkerSources[t][i]=new u),this.demWorkerSources[t][i]},Js.prototype.enforceCacheSizeLimit=function(i,s){t.enforceCacheSizeLimit(s);},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Js(t.window)),Js}));
|
|
32
32
|
|
|
33
|
-
define(["./shared"],(function(t){"use strict";var e=t.createCommonjsModule((function(t){function e(t){return !i(t)}function i(t){return "undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0;}catch(e){t=!1;}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return !1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return !1;var r=i.createShader(i.VERTEX_SHADER);return !(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i;}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};})),i={create:function(e,i,r){var o=t.window.document.createElement(e);return void 0!==i&&(o.className=i),r&&r.appendChild(o),o},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},r=t.window.document.documentElement.style;function o(t){if(!r)return t[0];for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var n,a=o(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){r&&a&&(n=r[a],r[a]="none");},i.enableDrag=function(){r&&a&&(r[a]=n);};var s=o(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[s]=e;};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0;}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c);}catch(t){l=!1;}i.addEventListener=function(t,e,i,r){void 0===r&&(r={}),t.addEventListener(e,i,"passive"in r&&l?r:r.capture);},i.removeEventListener=function(t,e,i,r){void 0===r&&(r={}),t.removeEventListener(e,i,"passive"in r&&l?r:r.capture);};var h=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",h,!0);};function u(t){var e=t.userImage;return !!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",h,!0);}),0);},i.mousePos=function(e,i){var r=e.getBoundingClientRect(),o=t.window.TouchEvent&&i instanceof t.window.TouchEvent?i.touches[0]:i;return new t.Point(o.clientX-r.left-e.clientLeft,o.clientY-r.top-e.clientTop)},i.touchPos=function(e,i){for(var r=e.getBoundingClientRect(),o=[],n="touchend"===i.type?i.changedTouches:i.touches,a=0;a<n.length;a++)o.push(new t.Point(n[a].clientX-r.left-e.clientLeft,n[a].clientY-r.top-e.clientTop));return o},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var p=function(e){function i(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var r=i[e];this._notify(r.ids,r.callback);}this.requestors=[];}},i.prototype.getImage=function(t){return this.images[t]},i.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e);},i.prototype._validate=function(e,i){var r=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},i.prototype._validateStretch=function(t,e){if(!t)return !0;for(var i=0,r=0,o=t;r<o.length;r+=1){var n=o[r];if(n[0]<i||n[1]<n[0]||e<n[1])return !1;i=n[1];}return !0},i.prototype._validateContent=function(t,e){return !(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},i.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0;},i.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove();},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var r=0,o=t;r<o.length;r+=1)this.images[o[r]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});},i.prototype._notify=function(e,i){for(var r={},o=0,n=e;o<n.length;o+=1){var a=n[o];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.');}i(null,r);},i.prototype.getPixelSize=function(){var t=this.atlasImage;return {width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns[e],r=this.getImage(e);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else {var o={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new t.ImagePosition(o,r);this.patterns[e]={bin:o,position:n};}return this._updatePatternAtlas(),this.patterns[e].position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE);},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var r=t.potpack(e),o=r.w,n=r.h,a=this.atlasImage;for(var s in a.resize({width:o||1,height:n||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,h=l.y+1,u=this.images[s].data,p=u.width,d=u.height;t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h},{width:p,height:d}),t.RGBAImage.copy(u,a,{x:0,y:d-1},{x:c,y:h-1},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h+d},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:p-1,y:0},{x:c-1,y:h},{width:1,height:d}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c+p,y:h},{width:1,height:d});}this.dirty=!0;},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={};},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var o=this.images[r];u(o)&&this.updateImage(r,o);}}},i}(t.Evented),d=m,_=m,f=1e20;function m(t,e,i,r,o,n){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=o||"sans-serif",this.fontWeight=n||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer,s=a+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1));}function g(t,e,i,r,o,n){for(var a=0;a<e;a++)v(t,a,e,i,r,o,n);for(var s=0;s<i;s++)v(t,s*e,1,e,r,o,n);}function v(t,e,i,r,o,n,a){var s,l,c,h;for(n[0]=0,a[0]=-f,a[1]=f,s=0;s<r;s++)o[s]=t[e+s*i];for(s=1,l=0,c=0;s<r;s++){do{c=(o[s]-o[h=n[l]]+s*s-h*h)/(s-h)/2;}while(c<=a[l]&&--l>-1);n[++l]=s,a[l]=c,a[l+1]=f;}for(s=0,l=0;s<r;s++){for(;a[l+1]<s;)l++;t[e+s*i]=o[h=n[l]]+(s-h)*(s-h);}}m.prototype._draw=function(t,e){var i,r,o,n,a,s,l,c,h,u=this.ctx.measureText(t),p=u.width,d=2*this.buffer;e&&this.useMetrics?(a=Math.floor(u.actualBoundingBoxAscent),c=this.buffer+Math.ceil(u.actualBoundingBoxAscent),s=this.buffer,l=this.buffer,i=(r=Math.min(this.size,Math.ceil(u.actualBoundingBoxRight-u.actualBoundingBoxLeft)))+d,o=(n=Math.min(this.size-s,Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent)))+d,this.ctx.textBaseline="alphabetic"):(i=r=this.size,o=n=this.size,a=19*this.fontSize/24,s=l=0,c=this.middle,this.ctx.textBaseline="middle"),r&&n&&(this.ctx.clearRect(l,s,r,n),this.ctx.fillText(t,this.buffer,c),h=this.ctx.getImageData(l,s,r,n));var _=new Uint8ClampedArray(i*o);return function(t,e,i,r,o,n,a){n.fill(f,0,e*i),a.fill(0,0,e*i);for(var s=(e-r)/2,l=0;l<o;l++)for(var c=0;c<r;c++){var h=(l+s)*e+c+s,u=t.data[4*(l*r+c)+3]/255;if(1===u)n[h]=0,a[h]=f;else if(0===u)n[h]=f,a[h]=0;else {var p=Math.max(0,.5-u),d=Math.max(0,u-.5);n[h]=p*p,a[h]=d*d;}}}(h,i,o,r,n,this.gridOuter,this.gridInner),g(this.gridOuter,i,o,this.f,this.v,this.z),g(this.gridInner,i,o,this.f,this.v,this.z),function(t,e,i,r,o,n,a){for(var s=0;s<e*i;s++){var l=Math.sqrt(r[s])-Math.sqrt(o[s]);t[s]=Math.round(255-255*(l/n+a));}}(_,i,o,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:_,metrics:{width:r,height:n,sdfWidth:i,sdfHeight:o,top:a,left:0,advance:p}}},m.prototype.draw=function(t){return this._draw(t,!1).data},m.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},d.default=_;var y=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={};};y.prototype.setURL=function(t){this.url=t;},y.prototype.getGlyphs=function(e,i){var r=this,o=[];for(var n in e)for(var a=0,s=e[n];a<s.length;a+=1)o.push({stack:n,id:s[a]});t.asyncAll(o,(function(t,e){var i=t.stack,o=t.id,n=r.entries[i];n||(n=r.entries[i]={glyphs:{},requests:{},ranges:{}});var a=n.glyphs[o];if(void 0===a){if(a=r._tinySDF(n,i,o))return n.glyphs[o]=a,void e(null,{stack:i,id:o,glyph:a});var s=Math.floor(o/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(n.ranges[s])e(null,{stack:i,id:o,glyph:a});else {var l=n.requests[s];l||(l=n.requests[s]=[],y.loadGlyphRange(i,s,r.url,r.requestManager,(function(t,e){if(e){for(var i in e)r._doesCharSupportLocalGlyph(+i)||(n.glyphs[+i]=e[+i]);n.ranges[s]=!0;}for(var o=0,a=l;o<a.length;o+=1)(0,a[o])(t,e);delete n.requests[s];}))),l.push((function(t,r){t?e(t):r&&e(null,{stack:i,id:o,glyph:r[o]||null});}));}}else e(null,{stack:i,id:o,glyph:a});}),(function(t,e){if(t)i(t);else if(e){for(var r={},o=0,n=e;o<n.length;o+=1){var a=n[o],s=a.stack,l=a.id,c=a.glyph;(r[s]||(r[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics};}i(null,r);}}));},y.prototype._doesCharSupportLocalGlyph=function(e){return !!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},y.prototype._tinySDF=function(e,i,r){var o=this.localIdeographFontFamily;if(o&&this._doesCharSupportLocalGlyph(r)){var n=e.tinySDF;if(!n){var a="400";/bold/i.test(i)?a="900":/medium/i.test(i)?a="500":/light/i.test(i)&&(a="200"),n=e.tinySDF=new y.TinySDF(24,3,8,.25,o,a);}return {id:r,bitmap:new t.AlphaImage({width:30,height:30},n.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=function(e,i,r,o,n){var a=256*i,s=a+255,l=o.transformRequest(o.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,i){if(e)n(e);else if(i){for(var r={},o=0,a=t.parseGlyphPBF(i);o<a.length;o+=1){var s=a[o];r[s.id]=s;}n(null,r);}}));},y.TinySDF=d;var x=function(){this.specification=t.styleSpec.light.position;};x.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},x.prototype.interpolate=function(e,i,r){return {x:t.number(e.x,i.x,r),y:t.number(e.y,i.y,r),z:t.number(e.z,i.z,r)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(i),this._transitioning=this._transitionable.untransitioned();}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var r in e){var o=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),o):this._transitionable.setValue(r,o);}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t);},i.prototype._validate=function(e,i,r){return (!r||!1!==r.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),E=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={};};E.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]},E.prototype.getDashRanges=function(t,e,i){var r=[],o=t.length%2==1?-t[t.length-1]*i:0,n=t[0]*i,a=!0;r.push({left:o,right:n,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var c=t[l];r.push({left:o=s*i,right:n=(s+=c)*i,isDash:a=!a,zeroLength:0===c});}return r},E.prototype.addRoundDash=function(t,e,i){for(var r=e/2,o=-i;o<=i;o++)for(var n=this.width*(this.nextRow+i+o),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var c=Math.abs(l-s.left),h=Math.abs(l-s.right),u=Math.min(c,h),p=void 0,d=o/i*(r+1);if(s.isDash){var _=r-Math.abs(d);p=Math.sqrt(u*u+_*_);}else p=r-Math.sqrt(u*u+d*d);this.data[n+l]=Math.max(0,Math.min(255,p+128));}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1));}var o=t[0],n=t[t.length-1];o.isDash===n.isDash&&(o.left=n.left-this.width,n.right=o.right+this.width);for(var a=this.width*this.nextRow,s=0,l=t[s],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var h=Math.abs(c-l.left),u=Math.abs(c-l.right),p=Math.min(h,u);this.data[a+c]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128));}},E.prototype.addDash=function(e,i){var r=i?7:0,o=2*r+1;if(this.nextRow+o>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a<e.length;a++)n+=e[a];if(0!==n){var s=this.width/n,l=this.getDashRanges(e,this.width,s);i?this.addRoundDash(l,s,r):this.addRegularDash(l);}var c={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:n};return this.nextRow+=o,this.dirty=!0,c},E.prototype.bind=function(t){var 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));};var T=function e(i,r){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var o=this.workerPool.acquire(this.id),n=0;n<o.length;n++){var a=new e.Actor(o[n],r,this.id);a.name="Worker "+n,this.actors.push(a);}};T.prototype.broadcast=function(e,i,r){t.asyncAll(this.actors,(function(t,r){t.send(e,i,r);}),r=r||function(){});},T.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},T.prototype.remove=function(){this.actors.forEach((function(t){t.remove();})),this.actors=[],this.workerPool.release(this.id);},T.Actor=t.Actor;var C=function(e){function i(i,r,o,n){if(e.call(this),this.id=i,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=t.loadTileJSON(this._options,this.map._requestManager,(function(i,r){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new t.TileBounds(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),o={request:this.map._requestManager.transformRequest(r,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function n(r,o){return delete e.request,e.aborted?i(null):r&&404!==r.status?i(r):(o&&o.resourceTiming&&(e.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}o.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",o,n.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",o,n.bind(this)));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.hasTransition=function(){return !1},i}(t.Evented),I=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox";}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.serialize=function(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function o(t,r){t&&(e.state="errored",i(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",i(null));}e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),function(r,n){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(r)e.state="errored",i(r);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,o.bind(this)));}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID);},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,r=Math.pow(2,i.z),o=(i.x-1+r)%r,n=0===i.x?e.wrap-1:e.wrap,a=(i.x+1+r)%r,s=i.x+1===r?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),l},i.prototype.unloadTile=function(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&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id});},i}(t.RasterTileSource),S=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=function(e){function i(t,i,r,o){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(o,n){r._loaded=!0,o?r.fire(new t.ErrorEvent(o)):n&&(r.image=n,e&&(r.coordinates=e),i&&i(),r._finishLoading());}));},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null;})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y);}var c=Math.max(o-i,n-r),h=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),u=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+o)/2*u),Math.floor((r+n)/2*u))}(r),this.minzoom=this.maxzoom=this.tileID.z;var o=r.map((function(t){return i.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.serialize=function(){return {type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return !1},i}(t.Evented),M=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.rebaseRequestUrl=i.rebaseRequestUrl||function(){},this.coordinates=[],this.type="image-map";}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCoordinates=function(){return this.coordinates},i.prototype.onAdd=function(t){this.map=t,t.on("resize",this.innerResize.bind(this)),t.on("rotateend",this.innnerRotateEnd.bind(this)),t.on("pitchend",this.innnerPitchEnd.bind(this)),t.on("moveend",this.innerMoveEnd.bind(this)),this.load();},i.prototype.innerResize=function(){this.loadImage();},i.prototype.innnerRotateEnd=function(){this.loadImage();},i.prototype.innnerPitchEnd=function(){this.loadImage();},i.prototype.innerMoveEnd=function(){this.loadImage();},i.prototype.loadImage=function(){this.load();},i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url;var o=e||this.transfromMapCoords(),n=this.map._containerDimensions(),a=this.applyUrl(this.url,o,n[0],n[1]);t.getImage(this.map._requestManager.transformRequest(a,t.ResourceType.Image),(function(e,n){r._loaded=!0,e?r.fire(new t.ErrorEvent(e)):n&&(r.image=n,o&&(r.coordinates=o),i&&i(),r._finishLoading());}));},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.refreshedUponExpiration=!0,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.transfromMapCoords=function(){var t=this.map.getBounds().toArray();return [[t[0][0],t[1][1]],[t[1][0],t[1][1]],[t[1][0],t[0][1]],[t[0][0],t[0][1]]]},i.prototype.transfromCoordsToBound=function(t){var e=[],i=[];return t.forEach((function(t){e.push(t[0]),i.push(t[1]);})),[Math.min.apply(Math,e),Math.min.apply(Math,i),Math.max.apply(Math,e),Math.max.apply(Math,i)]},i.prototype.applyUrl=function(e,i,r,o){var n=this.transfromCoordsToBound(i),a=this._project(new t.LngLat(n[0],n[1])),s=this._project(new t.LngLat(n[2],n[3])),l=[a.x,a.y,s.x,s.y];return e.indexOf("reversebbox=true")>=0&&[n,l].forEach((function(t){var e=t[0],i=t[2],r=t[3];t[0]=t[1],t[1]=e,t[2]=r,t[3]=i;})),this.rebaseRequestUrl(e,{latlngBounds:n,mercatorBound:l,imageSize:[r,o]})},i.prototype._project=function(t){var e={};e.x=t.lng*Math.PI/180*6378137;var i=t.lat*Math.PI/180;return e.y=3189068.5*Math.log((1+Math.sin(i))/(1-Math.sin(i))),e},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(this.coordinates,(function(){e.texture=null;})),this):this},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y);}var c=Math.max(o-i,n-r),h=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),u=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+o)/2*u),Math.floor((r+n)/2*u))}(r),this.minzoom=this.maxzoom=this.tileID.z;var o=r.map((function(t){return i.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.texture.update(this.image),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i}(P);function z(t){var e=(90+t)/180*90;return e||45+e/2}function L(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t[1]=z(t[1]),t})),t}function A(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t[1]=z(t[1]),t}))})),t}function D(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t.map((function(t){return t[1]=z(t[1]),t}))})),t})),t}var R=function(e){function i(i,r,o,n){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(n),this.crs=this.getCrs(),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({crs:this.crs,source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1,crs:this.getCrs()},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1,crs:this.getCrs()},clusterProperties:r.clusterProperties},r.workerOptions);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCrs=function(){return "EPSG:3857"},i.prototype.fixCrsData=function(e){return this.getCrs()!==t.CRS.EPSG3857.getEpsgCode()&&(e=function(t,e){return "FeatureCollection"===t.type?t=function(t){return t.features=t.features.map((function(e){var i;return "Point"===e.geometry.type?((i=e).geometry.coordinates[1]=z(i.geometry.coordinates[1]),e=i):"LineString"===e.geometry.type||"MultiPoint"===t.type?e=L(e):"Polygon"===e.geometry.type||"MultiLineString"===t.type?e=A(e):"MultiPolygon"===e.geometry.type&&(e=D(e)),e})),t}(t):"Point"===t.type?t=oopPoint(t):"LineString"===t.type||"MultiPoint"===t.type?t=L(t):"Polygon"===t.type||"MultiLineString"===t.type?t=A(t):"MultiPolygon"===t.type&&(t=D(t)),console.log("loopdata",t),t}(e)),e},i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(i){if(i)e.fire(new t.ErrorEvent(i));else {var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r));}}));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else {var r={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(r.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",r));}})),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var r=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(o),this.actor.send(this.type+".loadData",r,(function(t,o){i._removed||o&&o.abandoned||(i._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[i.id]&&(i._resourceTiming=o.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:r.source},null),e(t));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var r=this,o=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(o,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,n){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(n,r.map.painter,"reloadTile"===o),i(null))}));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),k=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.roundZoom=!0,this.type="video",this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1;var i=this.options;this.urls=[];for(var r=0,o=i.urls;r<o.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(o[r],t.ResourceType.Source).url);t.getVideo(this.urls,(function(i,r){e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(e.video=r,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint();})),e.map&&e.video.play(),e._finishLoading());}));},i.prototype.pause=function(){this.video&&this.video.pause();},i.prototype.play=function(){this.video&&this.video.play();},i.prototype.seek=function(e){if(this.video){var i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e;}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(P),B=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return !Array.isArray(t)||2!==t.length||t.some((function(t){return "number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,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 t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1);},this._finishLoading());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,r=i.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return !0}return !1},i}(P),O={vector:C,raster:t.RasterTileSource,"raster-dem":I,"image-map":M,geojson:R,video:k,image:P,canvas:B};function F(e,i){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(i.toUnwrapped()))}function U(t,e,i,r,o,n){var a=function(t,e,i){if(t)for(var r=0,o=t;r<o.length;r+=1){var n=e[o[r]];if(n&&n.source===i&&"fill-extrusion"===n.type)return !0}else for(var a in e){var s=e[a];if(s.source===i&&"fill-extrusion"===s.type)return !0}return !1}(o&&o.layers,e,t.id),s=n.maxPitchScaleFactor(),l=t.tilesIn(r,s,a);l.sort(N);for(var c=[],h=0,u=l;h<u.length;h+=1){var p=u[h];c.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,i,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,o,n,s,F(t.transform,p.tileID))});}var d=function(t){for(var e={},i={},r=0,o=t;r<o.length;r+=1){var n=o[r],a=n.queryResults,s=n.wrappedTileID,l=i[s]=i[s]||{};for(var c in a)for(var h=a[c],u=l[c]=l[c]||{},p=e[c]=e[c]||[],d=0,_=h;d<_.length;d+=1){var f=_[d];u[f.featureIndex]||(u[f.featureIndex]=!0,p.push(f));}}return e}(c);for(var _ in d)d[_].forEach((function(e){var i=e.feature,r=t.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;}));return d}function N(t,e){var 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}var Z=function(t,e){this.max=t,this.onRemove=e,this.reset();};Z.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var r=i[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);}return this.data={},this.order=[],this},Z.prototype.add=function(t,e,i){var r=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((function(){r.remove(t,n);}),i)),this.data[o].push(n),this.order.push(o),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a);}return this},Z.prototype.has=function(t){return t.wrapped().key in this.data},Z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},Z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Z.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][r];return this.data[i].splice(r,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this},Z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e);}return this},Z.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,o=this.data[i];r<o.length;r+=1){var n=o[r];t(n.value)||e.push(n);}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l);}};var j=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(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||delete e.arrayBuffer;};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},j.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},j.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);};var q={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer);},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer);},V.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r);}},V.prototype.setVertexAttribPointers=function(t,e,i){for(var r=0;r<this.attributes.length;r++){var o=this.attributes[r],n=e.attributes[o.name];void 0!==n&&t.vertexAttribPointer(n,o.components,t[q[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0));}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);};var G=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1;};G.prototype.get=function(){return this.current},G.prototype.set=function(t){},G.prototype.getDefault=function(){return this.default},G.prototype.setDefault=function(){this.set(this.default);};var W=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var 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);},i}(G),X=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1);},e}(G),H=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1);},e}(G),K=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return [!0,!0,!0,!0]},e.prototype.set=function(t){var 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);},e}(G),Y=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1);},e}(G),J=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1);},e}(G),Q=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return {func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var 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);},e}(G),$=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var 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);},e}(G),tt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1;}},e}(G),et=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return [0,1]},e.prototype.set=function(t){var 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);},e}(G),it=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1;}},e}(G),rt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1);},e}(G),ot=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1;}},e}(G),nt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [t.ONE,t.ZERO]},e.prototype.set=function(t){var 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);},e}(G),at=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var 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);},i}(G),st=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1);},e}(G),lt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1;}},e}(G),ct=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1);},e}(G),ht=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1);},e}(G),ut=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1);},e}(G),pt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1);},e}(G),dt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var 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);},e}(G),_t=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1;}},e}(G),ft=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}},e}(G),mt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1;}},e}(G),gt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1;}},e}(G),vt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1;},e}(G),yt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1);},e}(G),xt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1;}},e}(G),bt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1;}},e}(G),wt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1;}},e}(G),Et=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(G),Tt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0;},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1;}},e}(Et),Ct=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}},e}(Et),It=function(t,e,i,r){this.context=t,this.width=e,this.height=i;var o=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new Tt(t,o),r&&(this.depthAttachment=new Ct(t,o));};It.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i);}t.deleteFramebuffer(this.framebuffer);};var St=function(t,e,i){this.func=t,this.mask=e,this.range=i;};St.ReadOnly=!1,St.ReadWrite=!0,St.disabled=new St(519,St.ReadOnly,[0,1]);var Pt=function(t,e,i,r,o,n){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=o,this.pass=n;};Pt.disabled=new Pt({func:519,mask:0},0,0,7680,7680,7680);var Mt=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i;};Mt.disabled=new Mt(Mt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Mt.unblended=new Mt(Mt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Mt.alphaBlended=new Mt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var zt=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i;};zt.disabled=new zt(!1,1029,2305),zt.backCCW=new zt(!0,1029,2305);var Lt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new W(this),this.clearDepth=new X(this),this.clearStencil=new H(this),this.colorMask=new K(this),this.depthMask=new Y(this),this.stencilMask=new J(this),this.stencilFunc=new Q(this),this.stencilOp=new $(this),this.stencilTest=new tt(this),this.depthRange=new et(this),this.depthTest=new it(this),this.depthFunc=new rt(this),this.blend=new ot(this),this.blendFunc=new nt(this),this.blendColor=new at(this),this.blendEquation=new st(this),this.cullFace=new lt(this),this.cullFaceSide=new ct(this),this.frontFace=new ht(this),this.program=new ut(this),this.activeTexture=new pt(this),this.viewport=new dt(this),this.bindFramebuffer=new _t(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new mt(this),this.bindVertexBuffer=new gt(this),this.bindElementBuffer=new vt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new xt(this),this.pixelStoreUnpackPremultiplyAlpha=new bt(this),this.pixelStoreUnpackFlipY=new wt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query");};Lt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault();},Lt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0;},Lt.prototype.createIndexBuffer=function(t,e){return new j(this,t,e)},Lt.prototype.createVertexBuffer=function(t,e,i){return new V(this,t,e,i)},Lt.prototype.createRenderbuffer=function(t,e,i){var r=this.gl,o=r.createRenderbuffer();return this.bindRenderbuffer.set(o),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),o},Lt.prototype.createFramebuffer=function(t,e,i){return new It(this,t,e,i)},Lt.prototype.clear=function(t){var e=t.color,i=t.depth,r=this.gl,o=0;e&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(o);},Lt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace));},Lt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1);},Lt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1);},Lt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Mt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask);},Lt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null);};var At=function(e){function i(i,r,o){var n=this;e.call(this),this.id=i,this.dispatcher=o,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform));})),this.on("error",(function(){n._sourceErrored=!0;})),this._source=function(e,i,r,o){var n=new O[i.type](e,i,r,o);if(n.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+n.id);return t.bindAll(["load","abort","unload","serialize","prepare"],n),n}(i,r,o,this),this._tiles={},this._cache=new Z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t);},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t);},i.prototype.loaded=function(){if(this._sourceErrored)return !0;if(!this._sourceLoaded)return !1;if(!this._source.loaded())return !1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return !1}return !0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0;},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform);}},i.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager);}},i.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},i.prototype.getRenderableIds=function(e){var i=this,r=[];for(var o in this._tiles)this._isIdRenderable(o,e)&&r.push(this._tiles[o]);return e?r.sort((function(e,r){var o=e.tileID,n=r.tileID,a=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle),s=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle);return o.overscaledZ-n.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return !!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading");},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)));},i.prototype._tileLoaded=function(e,i,r,o){if(o)return e.state="errored",void(404!==o.status?this._source.fire(new t.ErrorEvent(o,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}));},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var r=e[i];if(t.neighboringTiles&&t.neighboringTiles[r]){var o=this.getTileByID(r);n(t,o),n(o,t);}}function n(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),n=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,r){for(var o in this._tiles){var n=this._tiles[o];if(!(r[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>i)){for(var a=n.tileID;n&&n.tileID.overscaledZ>e+1;){var s=n.tileID.scaledTo(n.tileID.overscaledZ-1);(n=this._tiles[s.key])&&n.hasData()&&(a=s);}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){r[a.key]=a;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var o=t.scaledTo(r),n=this._getLoadedTile(o);if(n)return n}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*i*5),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(o);},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var o=this._tiles[r];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o;}for(var n in this._tiles=i,this._timers)clearTimeout(this._timers[n]),delete this._timers[n];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a]);}},i.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var o;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(o=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(o=o.filter((function(t){return r._source.hasTile(t)})))):o=[];var n=e.coveringZoomLevel(this._source),a=Math.max(n-i.maxOverzooming,this._source.minzoom),s=Math.max(n+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(Rt(this._source.type)){for(var c={},h={},u=0,p=Object.keys(l);u<p.length;u+=1){var d=p[u],_=l[d],f=this._tiles[d];if(f&&!(f.fadeEndTime&&f.fadeEndTime<=t.browser.now())){var m=this.findLoadedParent(_,a);m&&(this._addTile(m.tileID),c[m.tileID.key]=m.tileID),h[d]=_;}}for(var g in this._retainLoadedChildren(h,n,s,l),c)l[g]||(this._coveredTiles[g]=!0,l[g]=c[g]);}for(var v in l)this._tiles[v].clearFadeHold();for(var y=0,x=t.keysDifference(this._tiles,l);y<x.length;y+=1){var b=x[y],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b);}this._updateLoadedParentTileCache();}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t);},i.prototype._updateRetainedTiles=function(t,e){for(var r={},o={},n=Math.max(e-i.maxOverzooming,this._source.minzoom),a=Math.max(e+i.maxUnderzooming,this._source.minzoom),s={},l=0,c=t;l<c.length;l+=1){var h=c[l],u=this._addTile(h);r[h.key]=h,u.hasData()||e<this._source.maxzoom&&(s[h.key]=h);}this._retainLoadedChildren(s,e,a,r);for(var p=0,d=t;p<d.length;p+=1){var _=d[p],f=this._tiles[_.key];if(!f.hasData()){if(e+1>this._source.maxzoom){var m=_.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){r[m.key]=m;continue}}else {var v=_.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var y=f.wasRequested(),x=_.overscaledZ-1;x>=n;--x){var b=_.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(f=this.getTile(b))&&y&&(f=this._addTile(b)),f&&(r[b.key]=b,y=f.wasRequested(),f.hasData()))break}}}return r},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var o=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(o))break;r=o;}for(var n=0,a=e;n<a.length;n+=1)this._loadedParentTiles[a[n]]=i;}},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var r=Boolean(i);return r||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){i._reloadTile(t,"expired"),delete i._timers[t];}),r));},i.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i,r){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=r?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),h=this.getIds(),u=1/0,p=1/0,d=-1/0,_=-1/0,f=0,m=c;f<m.length;f+=1){var g=m[f];u=Math.min(u,g.x),p=Math.min(p,g.y),d=Math.max(d,g.x),_=Math.max(_,g.y);}for(var v=function(e){var r=o._tiles[h[e]];if(!r.holdingForFade()){var s=r.tileID,f=Math.pow(2,a.zoom-r.tileID.overscaledZ),m=i*r.queryPadding*t.EXTENT/r.tileSize/f,g=[s.getTilePoint(new t.MercatorCoordinate(u,p)),s.getTilePoint(new t.MercatorCoordinate(d,_))];if(g[0].x-m<t.EXTENT&&g[0].y-m<t.EXTENT&&g[1].x+m>=0&&g[1].y+m>=0){var v=l.map((function(t){return s.getTilePoint(t)})),y=c.map((function(t){return s.getTilePoint(t)}));n.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:f});}}},y=0;y<h.length;y++)v(y);return n},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,o=i;r<o.length;r+=1){var n=o[r];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return !0;if(Rt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i);},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return !i.hasDependency(t,e)}));},i}(t.Evented);function Dt(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Rt(t){return "raster"===t||"image"===t||"video"===t}function kt(){return new t.window.Worker(Sn.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var Bt=function(){this.active={};};Bt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Bt.workerCount;)this.workers.push(new kt);return this.active[t]=!0,this.workers.slice()},Bt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate();})),this.workers=null);};var Ot,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Ut(e,i){var r={};for(var o in e)"ref"!==o&&(r[o]=e[o]);return t.refProperties.forEach((function(t){t in i&&(r[t]=i[t]);})),r}function Nt(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Ut(t[r],e[t[r].ref]));return t}Bt.workerCount=Math.max(Math.min(Ft,6),1);var Zt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function jt(t,e,i){i.push({command:Zt.addSource,args:[t,e[t]]});}function qt(t,e,i){e.push({command:Zt.removeSource,args:[t]}),i[t]=!0;}function Vt(t,e,i,r){qt(t,i,r),jt(t,e,i);}function Gt(e,i,r){var o;for(o in e[r])if(e[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;for(o in i[r])if(i[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;return !0}function Wt(e,i,r,o,n,a){var s;for(s in i=i||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));for(s in i)i.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));}function Xt(t){return t.id}function Ht(t,e){return t[e.id]=e,t}var Kt=function(t,e,i){var r=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var n=0;n<this.xCellCount*this.yCellCount;n++)r.push([]),o.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;};function Yt(e,i,r,o,n){var a=t.create();return i?(t.scale(a,a,[1/n,1/n,1]),r||t.rotateZ(a,a,o.angle)):t.multiply(a,o.labelPlaneMatrix,e),a}function Jt(e,i,r,o,n){if(i){var a=t.clone(e);return t.scale(a,a,[n,n,1]),r||t.rotateZ(a,a,-o.angle),a}return o.glCoordMatrix}function Qt(e,i){var r=[e.x,e.y,0,1];le(r,r,i);var o=r[3];return {point:new t.Point(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function $t(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function te(e,i,r,o,n,a,s,l){var c=o?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(c,r.transform.zoom),u=[256/r.width*2+1,256/r.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,_=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=r.transform.width/r.transform.height,m=!1,g=0;g<_.length;g++){var v=_.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)se(v.numGlyphs,p);else {m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),$t(y,u)){var x=.5+y[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,h,v),w=s?b*x:b/x,E=new t.Point(v.anchorX,v.anchorY),T=Qt(E,n).point,C={},I=re(v,w,!1,l,i,n,a,e.glyphOffsetArray,d,p,T,E,C,f);m=I.useVertical,(I.notEnoughRoom||m||I.needsFlipping&&re(v,w,!0,l,i,n,a,e.glyphOffsetArray,d,p,T,E,C,f).notEnoughRoom)&&se(v.numGlyphs,p);}else se(v.numGlyphs,p);}}o?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function ee(t,e,i,r,o,n,a,s,l,c,h,u){var p=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,_=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),g=ne(t*f,i,r,o,n,a,s.segment,d,_,l,c,h,u);if(!g)return null;var v=ne(t*m,i,r,o,n,a,s.segment,d,_,l,c,h,u);return v?{first:g,last:v}:null}function ie(e,i,r,o){return e===t.WritingMode.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function re(e,i,r,o,n,a,s,l,c,h,u,p,d,_){var f,m=i/24,g=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ee(m,l,g,v,r,u,p,e,c,a,d,!1);if(!w)return {notEnoughRoom:!0};var E=Qt(w.first.point,s).point,T=Qt(w.last.point,s).point;if(o&&!r){var C=ie(e.writingMode,E,T,_);if(C)return C}f=[w.first];for(var I=e.glyphStartIndex+1;I<y-1;I++)f.push(ne(m*l.getoffsetX(I),g,v,r,u,p,e.segment,x,b,c,a,d,!1));f.push(w.last);}else {if(o&&!r){var S=Qt(p,n).point,P=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(P),c.gety(P)),z=Qt(M,n),L=z.signedDistanceFromCamera>0?z.point:oe(p,M,S,1,n),A=ie(e.writingMode,S,L,_);if(A)return A}var D=ne(m*l.getoffsetX(e.glyphStartIndex),g,v,r,u,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d,!1);if(!D)return {notEnoughRoom:!0};f=[D];}for(var R=0,k=f;R<k.length;R+=1){var B=k[R];t.addDynamicAttributes(h,B.point,B.angle);}return {}}function oe(t,e,i,r,o){var n=Qt(t.add(t.sub(e)._unit()),o).point,a=i.sub(n);return i.add(a._mult(r/a.mag()))}function ne(e,i,r,o,n,a,s,l,c,h,u,p,d){var _=o?e-i:e+i,f=_>0?1:-1,m=0;o&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,v=g,y=n,x=n,b=0,w=0,E=Math.abs(_);b+w<=E;){if((g+=f)<l||g>=c)return null;if(x=y,void 0===(y=p[g])){var T=new t.Point(h.getx(g),h.gety(g)),C=Qt(T,u);if(C.signedDistanceFromCamera>0)y=p[g]=C.point;else {var I=g-f;y=oe(0===b?a:new t.Point(h.getx(I),h.gety(I)),T,x,E-b+1,u);}}b+=w,w=x.dist(y);}var S=(E-b)/w,P=y.sub(x),M=P.mult(S)._add(x);return M._add(P._unit()._perp()._mult(r*f)),{point:M,angle:m+Math.atan2(y.y-x.y,y.x-x.x),tileDistance:d?{prevTileDistance:g-f===v?0:h.gettileUnitDistanceFromAnchor(g-f),lastSegmentViewportDistance:E-b}:null}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,i,r,o){this._forEachCell(e,i,r,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(o);},Kt.prototype.insertCircle=function(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);},Kt.prototype._insertBoxCell=function(t,e,i,r,o,n){this.boxCells[o].push(n);},Kt.prototype._insertCircleCell=function(t,e,i,r,o,n){this.circleCells[o].push(n);},Kt.prototype._query=function(t,e,i,r,o,n){if(i<0||t>this.width||r<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(o)return !0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],h=this.circles[3*l+1],u=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:c-u,y1:h-u,x2:c+u,y2:h+u});}return n?a.filter(n):a}return this._forEachCell(t,e,i,r,this._queryCell,a,{hitTest:o,seenUids:{box:{},circle:{}}},n),o?a.length>0:a},Kt.prototype._queryCircle=function(t,e,i,r,o){var n=t-i,a=t+i,s=e-i,l=e+i;if(a<0||n>this.width||l<0||s>this.height)return !r&&[];var c=[];return this._forEachCell(n,s,a,l,this._queryCellCircle,c,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},o),r?c.length>0:c},Kt.prototype.query=function(t,e,i,r,o){return this._query(t,e,i,r,!1,o)},Kt.prototype.hitTest=function(t,e,i,r,o){return this._query(t,e,i,r,!0,o)},Kt.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Kt.prototype._queryCell=function(t,e,i,r,o,n,a,s){var l=a.seenUids,c=this.boxCells[o];if(null!==c)for(var h=this.bboxes,u=0,p=c;u<p.length;u+=1){var d=p[u];if(!l.box[d]){l.box[d]=!0;var _=4*d;if(t<=h[_+2]&&e<=h[_+3]&&i>=h[_+0]&&r>=h[_+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:h[_],y1:h[_+1],x2:h[_+2],y2:h[_+3]});}}}var f=this.circleCells[o];if(null!==f)for(var m=this.circles,g=0,v=f;g<v.length;g+=1){var y=v[g];if(!l.circle[y]){l.circle[y]=!0;var x=3*y;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,i,r)&&(!s||s(this.circleKeys[y]))){if(a.hitTest)return n.push(!0),!0;var b=m[x],w=m[x+1],E=m[x+2];n.push({key:this.circleKeys[y],x1:b-E,y1:w-E,x2:b+E,y2:w+E});}}}},Kt.prototype._queryCellCircle=function(t,e,i,r,o,n,a,s){var l=a.circle,c=a.seenUids,h=this.boxCells[o];if(null!==h)for(var u=this.bboxes,p=0,d=h;p<d.length;p+=1){var _=d[p];if(!c.box[_]){c.box[_]=!0;var f=4*_;if(this._circleAndRectCollide(l.x,l.y,l.radius,u[f+0],u[f+1],u[f+2],u[f+3])&&(!s||s(this.boxKeys[_])))return n.push(!0),!0}}var m=this.circleCells[o];if(null!==m)for(var g=this.circles,v=0,y=m;v<y.length;v+=1){var x=y[v];if(!c.circle[x]){c.circle[x]=!0;var b=3*x;if(this._circlesCollide(g[b],g[b+1],g[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return n.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,i,r,o,n,a,s){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r),p=l;p<=h;p++)for(var d=c;d<=u;d++)if(o.call(this,t,e,i,r,this.xCellCount*d+p,n,a,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,i,r,o,n){var a=r-t,s=o-e,l=i+n;return l*l>a*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,i,r,o,n,a){var s=(n-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return !1;var c=(a-o)/2,h=Math.abs(e-(o+c));if(h>c+i)return !1;if(l<=s||h<=c)return !0;var u=l-s,p=h-c;return u*u+p*p<=i*i};var ae=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function se(t,e){for(var i=0;i<t;i++){var r=e.length;e.resize(r+4),e.float32.set(ae,3*r);}}function le(t,e,i){var r=e[0],o=e[1];return t[0]=i[0]*r+i[4]*o+i[12],t[1]=i[1]*r+i[5]*o+i[13],t[3]=i[3]*r+i[7]*o+i[15],t}var ce=function(t,e,i){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===i&&(i=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200;};function he(t,e,i){t[e+4]=i?1:0;}function ue(e,i,r){return i*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ce.prototype.placeCollisionBox=function(t,e,i,r,o){var n=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=i*n.perspectiveRatio,s=t.x1*a+n.point.x,l=t.y1*a+n.point.y,c=t.x2*a+n.point.x,h=t.y2*a+n.point.y;return !this.isInsideGrid(s,l,c,h)||!e&&this.grid.hitTest(s,l,c,h,o)?{box:[],offscreen:!1}:{box:[s,l,c,h],offscreen:this.isOffscreen(s,l,c,h)}},ce.prototype.approximateTileDistance=function(t,e,i,r,o){var n=t.lastSegmentViewportDistance*i;return t.prevTileDistance+n+((o?1:r/this.pitchfactor)-1)*n*Math.abs(Math.sin(e))},ce.prototype.placeCollisionCircles=function(e,i,r,o,n,a,s,l,c,h,u,p,d){var _=[],f=this.projectAnchor(c,n.anchorX,n.anchorY),m=l/24,g=n.lineOffsetX*l,v=n.lineOffsetY*l,y=new t.Point(n.anchorX,n.anchorY),x=ee(m,s,g,v,!1,Qt(y,h).point,y,n,a,h,{},!0),b=!1,w=!1,E=!0,T=f.perspectiveRatio*o,C=1/(o*r),I=0,S=0;x&&(I=this.approximateTileDistance(x.first.tileDistance,x.first.angle,C,f.cameraDistance,p),S=this.approximateTileDistance(x.last.tileDistance,x.last.angle,C,f.cameraDistance,p));for(var P=0;P<e.length;P+=5){var M=e[P],z=e[P+1],L=e[P+2],A=e[P+3];if(!x||A<-I||A>S)he(e,P,!1);else {var D=this.projectPoint(c,M,z),R=L*T;if(_.length>0){var k=D.x-_[_.length-4],B=D.y-_[_.length-3];if(R*R*2>k*k+B*B&&P+8<e.length){var O=e[P+8];if(O>-I&&O<S){he(e,P,!1);continue}}}_.push(D.x,D.y,R,P/5),he(e,P,!0);var F=D.x-R,U=D.y-R,N=D.x+R,Z=D.y+R;if(E=E&&this.isOffscreen(F,U,N,Z),w=w||this.isInsideGrid(F,U,N,Z),!i&&this.grid.hitTestCircle(D.x,D.y,R,d)){if(!u)return {circles:[],offscreen:!1};b=!0;}}}return {circles:b||!w?[]:_,offscreen:E}},ce.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};for(var i=[],r=1/0,o=1/0,n=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var c=l[s],h=new t.Point(c.x+100,c.y+100);r=Math.min(r,h.x),o=Math.min(o,h.y),n=Math.max(n,h.x),a=Math.max(a,h.y),i.push(h);}for(var u={},p={},d=0,_=this.grid.query(r,o,n,a).concat(this.ignoredGrid.query(r,o,n,a));d<_.length;d+=1){var f=_[d],m=f.key;if(void 0===u[m.bucketInstanceId]&&(u[m.bucketInstanceId]={}),!u[m.bucketInstanceId][m.featureIndex]){var g=[new t.Point(f.x1,f.y1),new t.Point(f.x2,f.y1),new t.Point(f.x2,f.y2),new t.Point(f.x1,f.y2)];t.polygonIntersectsPolygon(i,g)&&(u[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex));}}return p},ce.prototype.insertCollisionBox=function(t,e,i,r,o){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:r,collisionGroupID:o},t[0],t[1],t[2],t[3]);},ce.prototype.insertCollisionCircles=function(t,e,i,r,o){for(var n=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:r,collisionGroupID:o},s=0;s<t.length;s+=4)n.insertCircle(a,t[s],t[s+1],t[s+2]);},ce.prototype.projectAnchor=function(t,e,i){var r=[e,i,0,1];return le(r,r,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}},ce.prototype.projectPoint=function(e,i,r){var o=[i,r,0,1];return le(o,o,e),new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100)},ce.prototype.projectAndGetPerspectiveRatio=function(e,i,r){var o=[i,r,0,1];return le(o,o,e),{point:new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o[3]*.5}},ce.prototype.isOffscreen=function(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ce.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary};var pe=function(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;};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,i,r,o){this.text=new pe(t?t.text:null,e,i,o),this.icon=new pe(t?t.icon:null,e,r,o);};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var _e=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i;},fe=function(t,e,i,r,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=o;},me=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={};};function ge(e,i,r,o,n){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*i,l=-(a.verticalAlign-.5)*r,c=t.evaluateVariableOffset(e,o);return new t.Point(s+c[0]*n,l+c[1]*n)}function ve(e,i,r,o,n,a){var s=e.x1,l=e.x2,c=e.y1,h=e.y2,u=e.anchorPointX,p=e.anchorPointY,d=new t.Point(i,r);return o&&d._rotate(n?a:-a),{x1:s+d.x,y1:c+d.y,x2:l+d.x,y2:h+d.y,anchorPointX:u,anchorPointY:p}}me.prototype.get=function(t){if(this.crossSourceCollisions)return {ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}};}return this.collisionGroups[t]};var ye=function(t,e,i,r){this.transform=t.clone(),this.collisionIndex=new ce(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new me(i),this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={};};function xe(t,e,i,r,o){t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0);}ye.prototype.getBucketParts=function(e,i,r,o){var n=r.getBucket(i),a=r.latestFeatureIndex;if(n&&a&&i.id===n.layerIds[0]){var s=r.collisionBoxArray,l=n.layers[0].layout,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/t.EXTENT,u=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p=Yt(u,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom));this.retainedQueryData[n.bucketInstanceId]=new fe(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,r.tileID);var d={bucket:n,layout:l,posMatrix:u,textLabelPlaneMatrix:p,scale:c,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(o)for(var _=0,f=n.sortKeyRanges;_<f.length;_+=1){var m=f[_];e.push({sortKey:m.sortKey,symbolInstanceStart:m.symbolInstanceStart,symbolInstanceEnd:m.symbolInstanceEnd,parameters:d});}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:d});}},ye.prototype.attemptAnchorPlacement=function(t,e,i,r,o,n,a,s,l,c,h,u,p,d,_){var f,m=[u.textOffset0,u.textOffset1],g=ge(t,i,r,m,o),v=this.collisionIndex.placeCollisionBox(ve(e,g.x,g.y,n,a,this.transform.angle),h,s,l,c.predicate);if(!_||0!==this.collisionIndex.placeCollisionBox(ve(_,g.x,g.y,n,a,this.transform.angle),h,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(f=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:m,width:i,height:r,anchor:t,textBoxScale:o,prevAnchor:f},this.markUsedJustification(p,t,u,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,u),this.placedOrientations[u.crossTileID]=d),{shift:g,placedGlyphBoxes:v}):void 0},ye.prototype.placeLayerBucketPart=function(e,i,r){var o=this,n=e.parameters,a=n.bucket,s=n.layout,l=n.posMatrix,c=n.textLabelPlaneMatrix,h=n.scale,u=n.textPixelRatio,p=n.holdingForFade,d=n.collisionBoxArray,_=n.partiallyEvaluatedTextSize,f=n.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),T=v&&(y||!a.hasIconData()||g),C=y&&(v||!a.hasTextData()||m);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var I=function(e,n){if(!i[e.crossTileID])if(p)o.placements[e.crossTileID]=new _e(!1,!1,!1);else {var d,E=!1,I=!1,S=!0,P=null,M={box:null,offscreen:null},z={box:null,offscreen:null},L=null,A=null,D=0,R=0,k=0;n.textFeatureIndex&&(D=n.textFeatureIndex),n.verticalTextFeatureIndex&&(R=n.verticalTextFeatureIndex);var B=n.textBox;if(B){var O=function(i){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!i&&o.prevPlacement){var n=o.prevPlacement.placedOrientations[e.crossTileID];n&&(o.placedOrientations[e.crossTileID]=n,o.markUsedOrientation(a,r=n,e));}return r},F=function(i,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var o=0,s=a.writingModes;o<s.length&&(s[o]===t.WritingMode.vertical?(M=r(),z=M):M=i(),!(M&&M.box&&M.box.length));o+=1);else M=i();};if(s.get("text-variable-anchor")){var U=s.get("text-variable-anchor");if(o.prevPlacement&&o.prevPlacement.variableOffsets[e.crossTileID]){var N=o.prevPlacement.variableOffsets[e.crossTileID];U.indexOf(N.anchor)>0&&(U=U.filter((function(t){return t!==N.anchor}))).unshift(N.anchor);}var Z=function(t,i,r){for(var n=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,h=w&&!y?i:null,p={box:[],offscreen:!1},d=v?2*U.length:U.length,_=0;_<d;++_){var m=o.attemptAnchorPlacement(U[_%U.length],t,n,s,c,x,b,u,l,f,_>=U.length,e,a,r,h);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,P=m.shift;break}}return p};F((function(){return Z(B,n.iconBox,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&i?Z(i,n.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(E=M.box,S=M.offscreen);var j=O(M&&M.box);if(!E&&o.prevPlacement){var q=o.prevPlacement.variableOffsets[e.crossTileID];q&&(o.variableOffsets[e.crossTileID]=q,o.markUsedJustification(a,q.anchor,e,j));}}else {var V=function(t,i){var r=o.collisionIndex.placeCollisionBox(t,v,u,l,f.predicate);return r&&r.box&&r.box.length&&(o.markUsedOrientation(a,i,e),o.placedOrientations[e.crossTileID]=i),r};F((function(){return V(B,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?V(i,t.WritingMode.vertical):{box:null,offscreen:null}})),O(M&&M.box&&M.box.length);}}E=(d=M)&&d.box&&d.box.length>0,S=d&&d.offscreen;var G=n.textCircles;if(G){var W=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),X=t.evaluateSizeForFeature(a.textSizeData,_,W);L=o.collisionIndex.placeCollisionCircles(G,v,h,u,W,a.lineVertexArray,a.glyphOffsetArray,X,l,c,r,b,f.predicate),E=v||L.circles.length>0,S=S&&L.offscreen;}if(n.iconFeatureIndex&&(k=n.iconFeatureIndex),n.iconBox){var H=function(t){var e=w&&P?ve(t,P.x,P.y,x,b,o.transform.angle):t;return o.collisionIndex.placeCollisionBox(e,y,u,l,f.predicate)};I=z&&z.box&&z.box.length&&n.verticalIconBox?(A=H(n.verticalIconBox)).box.length>0:(A=H(n.iconBox)).box.length>0,S=S&&A.offscreen;}var K=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Y=g||0===e.numIconVertices;K||Y?Y?K||(I=I&&E):E=I&&E:I=E=I&&E,E&&d&&d.box&&o.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,z&&z.box&&R?R:D,f.ID),I&&A&&o.collisionIndex.insertCollisionBox(A.box,s.get("icon-ignore-placement"),a.bucketInstanceId,k,f.ID),E&&L&&o.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,D,f.ID),o.placements[e.crossTileID]=new _e(E||T,I||C,S||a.justReloaded),i[e.crossTileID]=!0;}};if(E)for(var S=a.getSortedSymbolIndexes(this.transform.angle),P=S.length-1;P>=0;--P){var M=S[P];I(a.symbolInstances.get(M),a.collisionArrays[M]);}else for(var z=e.symbolInstanceStart;z<e.symbolInstanceEnd;z++)I(a.symbolInstances.get(z),a.collisionArrays[z]);a.justReloaded=!1;},ye.prototype.markUsedJustification=function(e,i,r,o){var n;n=o===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var l=s[a];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=n>=0&&l!==n?0:r.crossTileID);}},ye.prototype.markUsedOrientation=function(e,i,r){for(var o=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,n=i===t.WritingMode.vertical?i:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=o;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n);},ye.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,o=e?e.opacities:{},n=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=o[s];c?(this.opacities[s]=new de(c,r,l.text,l.icon),i=i||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new de(null,r,l.text,l.icon,l.skipFade),i=i||l.text||l.icon);}for(var h in o){var u=o[h];if(!this.opacities[h]){var p=new de(u,r,!1,!1);p.isHidden()||(this.opacities[h]=p,i=i||u.text.placed||u.icon.placed);}}for(var d in n)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=n[d]);for(var _ in a)this.placedOrientations[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.placedOrientations[_]=a[_]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t);},ye.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,o=e;r<o.length;r+=1){var n=o[r],a=n.getBucket(t);a&&n.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,n.collisionBoxArray);}},ye.prototype.updateBucketOpacities=function(e,i,r){var o=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear(),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexArray.clear(),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexArray.clear();var n=e.layers[0].layout,a=new de(null,0,!1,!1,!0),s=n.get("text-allow-overlap"),l=n.get("icon-allow-overlap"),c=n.get("text-variable-anchor"),h="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),p="none"!==n.get("icon-text-fit"),d=new de(null,0,s&&(l||!e.hasIconData()||n.get("icon-optional")),l&&(s||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData())&&e.deserializeCollisionBoxes(r);for(var _=function(t,e,i){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);},f=function(r){var n=e.symbolInstances.get(r),s=n.numHorizontalGlyphVertices,l=n.numVerticalGlyphVertices,f=n.crossTileID,m=i[f],g=o.opacities[f];m?g=a:g||(o.opacities[f]=g=d),i[f]=!0;var v=n.numIconVertices>0,y=o.placedOrientations[n.crossTileID],x=y===t.WritingMode.vertical,b=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(s>0||l>0){var w=Pe(g.text);_(e.text,s,x?Me:w),_(e.text,l,b?Me:w);var E=g.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=E||x?1:0);})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=E||b?1:0);var T=o.variableOffsets[n.crossTileID];T&&o.markUsedJustification(e,T.anchor,n,y);var C=o.placedOrientations[n.crossTileID];C&&(o.markUsedJustification(e,"left",n,C),o.markUsedOrientation(e,C,n));}if(v){var I=Pe(g.icon),S=!(p&&n.verticalPlacedIconSymbolIndex&&x);n.placedIconSymbolIndex>=0&&(_(e.icon,n.numIconVertices,S?I:Me),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=g.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(_(e.icon,n.numVerticalIconVertices,S?Me:I),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var P=e.collisionArrays[r];if(P){var M=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var z=!0;if(c){var L=o.variableOffsets[f];L?(M=ge(L.anchor,L.width,L.height,L.textOffset,L.textBoxScale),h&&M._rotate(u?o.transform.angle:-o.transform.angle)):z=!1;}P.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!z||x,M.x,M.y),P.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!z||b,M.x,M.y);}var A=Boolean(!b&&P.verticalIconBox);P.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,A,p?M.x:0,p?M.y:0),P.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!A,p?M.x:0,p?M.y:0);var D=P.textCircles;if(D&&e.hasTextCollisionCircleData())for(var R=0;R<D.length;R+=5)xe(e.textCollisionCircle.collisionVertexArray,g.text.placed,m||0===D[R+4]);}}},m=0;m<e.symbolInstances.length;m++)f(m);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexBuffer&&e.iconCollisionCircle.collisionVertexBuffer.updateData(e.iconCollisionCircle.collisionVertexArray),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexBuffer&&e.textCollisionCircle.collisionVertexBuffer.updateData(e.textCollisionCircle.collisionVertexArray);},ye.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ye.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ye.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ye.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},ye.prototype.setStale=function(){this.stale=!0;};var be=Math.pow(2,25),we=Math.pow(2,24),Ee=Math.pow(2,17),Te=Math.pow(2,16),Ce=Math.pow(2,9),Ie=Math.pow(2,8),Se=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*be+e*we+i*Ee+e*Te+i*Ce+e*Ie+i*Se+e}var Me=0,ze=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];};ze.prototype.continuePlacement=function(t,e,i,r,o){for(var n=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(n,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,o())return !0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<n.length;)if(e.placeLayerBucketPart(n[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,o())return !0;return !1};var Le=function(t,e,i,r,o,n,a){this.placement=new ye(t,o,n,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1;};Le.prototype.isDone=function(){return this._done},Le.prototype.continuePlacement=function(e,i,r){for(var o=this,n=t.browser.now(),a=function(){var e=t.browser.now()-n;return !o._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=i[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ze(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},Le.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ae=512/t.EXTENT/2,De=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;r<e.length;r++){var o=e.get(r),n=o.key;this.indexedSymbolInstances[n]||(this.indexedSymbolInstances[n]=[]),this.indexedSymbolInstances[n].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)});}};De.prototype.getScaledCoordinates=function(e,i){var r=Ae/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return {x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*r)}},De.prototype.findMatches=function(t,e,i){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),o=0;o<t.length;o++){var n=t.get(o);if(!n.crossTileID){var a=this.indexedSymbolInstances[n.key];if(a)for(var s=this.getScaledCoordinates(n,e),l=0,c=a;l<c.length;l+=1){var h=c[l];if(Math.abs(h.coord.x-s.x)<=r&&Math.abs(h.coord.y-s.y)<=r&&!i[h.crossTileID]){i[h.crossTileID]=!0,n.crossTileID=h.crossTileID;break}}}}};var Re=function(){this.maxCrossTileID=0;};Re.prototype.generate=function(){return ++this.maxCrossTileID};var ke=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0;};ke.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var r=this.indexes[i],o={};for(var n in r){var a=r[n];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a;}this.indexes[i]=o;}this.lng=t;},ke.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&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(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var n in this.indexes){var a=this.indexes[n];if(Number(n)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o);}else {var c=a[t.scaledTo(Number(n)).key];c&&c.findMatches(e.symbolInstances,t,o);}}for(var h=0;h<e.symbolInstances.length;h++){var u=e.symbolInstances.get(h);u.crossTileID||(u.crossTileID=i.generate(),o[u.crossTileID]=!0);}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0},ke.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var r=0,o=e.indexedSymbolInstances[i];r<o.length;r+=1)delete this.usedCrossTileIDs[t][o[r].crossTileID];},ke.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var r=this.indexes[i];for(var o in r)t[r[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[o]),delete r[o],e=!0);}return e};var Be=function(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};};Be.prototype.addLayer=function(t,e,i){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new ke);var o=!1,n={};r.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(l.tileID,c,this.crossTileIDs)&&(o=!0),n[c.bucketInstanceId]=!0);}return r.removeStaleBuckets(n)&&(o=!0),o},Be.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach((function(t){e[t]=!0;})),this.layerIndexes)e[i]||delete this.layerIndexes[i];};var Oe=function(e,i){return t.emitValidationErrors(e,i&&i.filter((function(t){return "source.canvas"!==t.identifier})))},Fe=t.pick(Zt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Zt,["setCenter","setZoom","setBearing","setPitch"]),Ne=function(){var e={},i=t.styleSpec.$version;for(var r in t.styleSpec.$root){var o,n=t.styleSpec.$root[r];if(n.required)null!=(o="version"===r?i:"array"===n.type?[]:{})&&(e[r]=o);}return e}(),Ze=function(e){function i(r,o){var n=this;void 0===o&&(o={}),e.call(this),this.map=r,this.dispatcher=new T((Ot||(Ot=new Bt),Ot),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new y(r._requestManager,o.localIdeographFontFamily),this.lineAtlas=new E(256,512),this.crossTileSymbolIndex=new Be,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=i.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,i){if(t.triggerPluginCompletionEvent(e),i&&i.every((function(t){return t})))for(var r in a.sourceCaches)a.sourceCaches[r].reload();}));})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var r in n._layers){var o=n._layers[r];o.source===i.id&&n._validateLayer(o);}}}}));}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadURL=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var o="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);var n=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(n,(function(e,i){r._request=null,e?r.fire(new t.ErrorEvent(e)):i&&r._load(i,o);}));},i.prototype.loadJSON=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==i.validate);}));},i.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ne,!1);},i.prototype._load=function(e,i){if(!i||!Oe(this,t.validateStyle(e))){for(var r in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(r,e.sources[r],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=Nt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,a=o;n<a.length;n+=1){var s=a[n];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize();}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"));}},i.prototype._loadSprite=function(e){var i=this;this._spriteRequest=function(e,i,r){var o,n,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,o=e,h());})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,n=e,h());}));function h(){if(a)r(a);else if(o&&n){var e=t.browser.getImageData(n),i={};for(var s in o){var l=o[s],c=l.width,h=l.height,u=l.x,p=l.y,d=l.sdf,_=l.pixelRatio,f=l.stretchX,m=l.stretchY,g=l.content,v=new t.RGBAImage({width:c,height:h});t.RGBAImage.copy(e,v,{x:u,y:p},{x:0,y:0},{width:c,height:h}),i[s]={data:v,pixelRatio:_,sdf:d,stretchX:f,stretchY:m,content:g};}r(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}(e,this.map._requestManager,(function(e,r){if(i._spriteRequest=null,e)i.fire(new t.ErrorEvent(e));else if(r)for(var o in r)i.imageManager.addImage(o,r[o]);i.imageManager.setLoaded(!0),i._availableImages=i.imageManager.listImages(),i.dispatcher.broadcast("setImages",i._availableImages),i.fire(new t.Event("data",{dataType:"style"}));}));},i.prototype._validateLayer=function(e){var i=this.sourceCaches[e.source];if(i){var r=e.sourceLayer;if(r){var o=i.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+o.id+'" as specified by style layer "'+e.id+'"')));}}},i.prototype.loaded=function(){if(!this._loaded)return !1;if(Object.keys(this._updatedSources).length)return !1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return !1;return !!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var o=this._layers[r[i]];"custom"!==o.type&&e.push(o.serialize());}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return !0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return !0;for(var e in this._layers)if(this._layers[e].hasTransition())return !0;return !1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){var i=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);for(var n in (r.length||o.length)&&this._updateWorkerLayers(r,o),this._updatedSources){var a=this._updatedSources[n];"reload"===a?this._reloadSource(n):"clear"===a&&this._clearSource(n);}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates();}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var c=0,h=this._order;c<h.length;c+=1){var u=this._layers[h[c]];u.recalculate(e,this._availableImages),!u.isHidden(e.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0);}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}));}},i.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={};}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e});},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={};},i.prototype.setState=function(e){var i=this;if(this._checkLoaded(),Oe(this,t.validateStyle(e)))return !1;(e=t.clone$1(e)).layers=Nt(e.layers);var r=function(e,i){if(!e)return [{command:Zt.setStyle,args:[i]}];var r=[];try{if(!t.deepEqual(e.version,i.version))return [{command:Zt.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||r.push({command:Zt.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||r.push({command:Zt.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||r.push({command:Zt.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||r.push({command:Zt.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||r.push({command:Zt.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||r.push({command:Zt.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||r.push({command:Zt.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||r.push({command:Zt.setLight,args:[i.light]});var o={},n=[];!function(e,i,r,o){var n;for(n in i=i||{},e=e||{})e.hasOwnProperty(n)&&(i.hasOwnProperty(n)||qt(n,r,o));for(n in i)i.hasOwnProperty(n)&&(e.hasOwnProperty(n)?t.deepEqual(e[n],i[n])||("geojson"===e[n].type&&"geojson"===i[n].type&&Gt(e,i,n)?r.push({command:Zt.setGeoJSONSourceData,args:[n,i[n].data]}):Vt(n,i,r,o)):jt(n,i,r));}(e.sources,i.sources,n,o);var a=[];e.layers&&e.layers.forEach((function(t){o[t.source]?r.push({command:Zt.removeLayer,args:[t.id]}):a.push(t);})),r=r.concat(n),function(e,i,r){i=i||[];var o,n,a,s,l,c,h,u=(e=e||[]).map(Xt),p=i.map(Xt),d=e.reduce(Ht,{}),_=i.reduce(Ht,{}),f=u.slice(),m=Object.create(null);for(o=0,n=0;o<u.length;o++)_.hasOwnProperty(a=u[o])?n++:(r.push({command:Zt.removeLayer,args:[a]}),f.splice(f.indexOf(a,n),1));for(o=0,n=0;o<p.length;o++)f[f.length-1-o]!==(a=p[p.length-1-o])&&(d.hasOwnProperty(a)?(r.push({command:Zt.removeLayer,args:[a]}),f.splice(f.lastIndexOf(a,f.length-n),1)):n++,r.push({command:Zt.addLayer,args:[_[a],c=f[f.length-o]]}),f.splice(f.length-o,0,a),m[a]=!0);for(o=0;o<p.length;o++)if(s=d[a=p[o]],l=_[a],!m[a]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(h in Wt(s.layout,l.layout,r,a,null,Zt.setLayoutProperty),Wt(s.paint,l.paint,r,a,null,Zt.setPaintProperty),t.deepEqual(s.filter,l.filter)||r.push({command:Zt.setFilter,args:[a,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||r.push({command:Zt.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Wt(s[h],l[h],r,a,h.slice(6),Zt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Zt.setLayerProperty,args:[a,h,l[h]]}));for(h in l)l.hasOwnProperty(h)&&!s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Wt(s[h],l[h],r,a,h.slice(6),Zt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Zt.setLayerProperty,args:[a,h,l[h]]}));}else r.push({command:Zt.removeLayer,args:[a]}),c=f[f.lastIndexOf(a)+1],r.push({command:Zt.addLayer,args:[l,c]});}(a,i.layers,r);}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Zt.setStyle,args:[i]}];}return r}(this.serialize(),e).filter((function(t){return !(t.command in Ue)}));if(0===r.length)return !1;var o=r.filter((function(t){return !(t.command in Fe)}));if(o.length>0)throw new Error("Unimplemented: "+o.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args);})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e);},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,r){var o=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,r))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var n=this.sourceCaches[e]=new At(e,i,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return {isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}})),n.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else {var n;if("custom"===e.type){if(Oe(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e);}else {if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},r))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize();}var a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {if(this._order.splice(a,0,o),this._layerOrderChanged=!0,this._layers[o]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type){var s=this._removedLayers[o];delete this._removedLayers[o],s.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause());}this._updateLayer(n),n.onAdd&&n.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var r=this._order.indexOf(e);this._order.splice(r,1);var o=i?this._order.indexOf(i):this._order.length;i&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(o,0,e),this._layerOrderChanged=!0);}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,r){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===i&&o.maxzoom===r||(null!=i&&(o.minzoom=i),null!=r&&(o.maxzoom=r),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")));},i.prototype.setFilter=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,i))return null==i?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",i,null,r)||(o.filter=t.clone$1(i),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(i),r)||(n.setLayoutProperty(i,r,o),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getLayoutProperty=function(e,i){var r=this.getLayer(e);if(r)return r.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(i),r)||(n.setPaintProperty(i,r,o)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){var a=n.getSource().type;"geojson"===a&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.setFeatureState(o,e.id,i)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=this.sourceCaches[r];if(void 0!==o){var n=o.getSource().type,a="vector"===n?e.sourceLayer:void 0;"vector"!==n||a?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):o.removeFeatureState(a,e.id,i):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.sourceCaches[i];if(void 0!==o){if("vector"!==o.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.getFeatureState(r,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return "fill-extrusion"===e._layers[t].type},r={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(i(a)){r[a]=n;for(var s=0,l=t;s<l.length;s+=1){var c=l[s][a];if(c)for(var h=0,u=c;h<u.length;h+=1)o.push(u[h]);}}}o.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var _=this._order[d];if(i(_))for(var f=o.length-1;f>=0;f--){var m=o[f].feature;if(r[m.layer.id]<d)break;p.push(m),o.pop();}else for(var g=0,v=t;g<v.length;g+=1){var y=v[g][_];if(y)for(var x=0,b=y;x<b.length;x+=1)p.push(b[x].feature);}}return p},i.prototype.queryRenderedFeatures=function(e,i,r){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);var o={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var n=0,a=i.layers;n<a.length;n+=1){var s=a[n],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];o[l.source]=!0;}}var c=[];for(var h in i.availableImages=this._availableImages,this.sourceCaches)i.layers&&!o[h]||c.push(U(this.sourceCaches[h],this._layers,this._serializedLayers,e,i,r));return this.placement&&c.push(function(t,e,i,r,o,n,a){for(var s={},l=n.queryRenderedSymbols(r),c=[],h=0,u=Object.keys(l).map(Number);h<u.length;h+=1)c.push(a[u[h]]);c.sort(N);for(var p=function(){var i=_[d],r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,o.filter,o.layers,o.availableImages,t);for(var n in r){var a=s[n]=s[n]||[],c=r[n];c.sort((function(t,e){var r=i.featureSortOrder;if(r){var o=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-o}return e.featureIndex-t.featureIndex}));for(var h=0,u=c;h<u.length;h+=1)a.push(u[h]);}},d=0,_=c;d<_.length;d+=1)p();var f=function(e){s[e].forEach((function(r){var o=r.feature,n=i[t[e].source].getFeatureState(o.layer["source-layer"],o.id);o.source=o.layer.source,o.layer["source-layer"]&&(o.sourceLayer=o.layer["source-layer"]),o.state=n;}));};for(var m in s)f(m);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);var r=this.sourceCaches[e];return r?function(t,e){for(var i=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],o={},n=0;n<i.length;n++){var a=i[n],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(r,e));}return r}(r,i):[]},i.prototype.addSourceType=function(t,e,r){return i.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.light.getLight(),o=!1;for(var n in e)if(!t.deepEqual(e[n],r[n])){o=!0;break}if(o){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(a);}},i.prototype._validate=function(e,i,r,o,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Oe(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:r,styleSpec:t.styleSpec},o)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var i in this.sourceCaches)this.sourceCaches[i].clearTiles(),this.sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove();},i.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles();},i.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload();},i.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t);},i.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t);},i.prototype._updatePlacement=function(e,i,r,o,n){void 0===n&&(n=!1);for(var a=!1,s=!1,l={},c=0,h=this._order;c<h.length;c+=1){var u=this._layers[h[c]];if("symbol"===u.type){if(!l[u.source]){var p=this.sourceCaches[u.source];l[u.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}));}var d=this.crossTileSymbolIndex.addLayer(u,l[u.source],e.center.lng);a=a||d;}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Le(e,this._order,n,i,r,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var _=0,f=this._order;_<f.length;_+=1){var m=this._layers[f[_]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,l[m.source]);}return !this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles();},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var r=this.sourceCaches[e.source];r&&r.setDependencies(e.tileID.key,e.type,e.icons);},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i);},i.prototype.getResource=function(e,i,r){return t.makeRequest(i,r)},i}(t.Evented);Ze.getSourceType=function(t){return O[t]},Ze.setSourceType=function(t,e){O[t]=e;},Ze.registerForPluginStateChange=t.registerForPluginStateChange;var je=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),qe=fi("#ifdef GL_ES\r\nprecision mediump float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif","#ifdef GL_ES\r\nprecision highp float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\nvec2 unpack_float(const float packedValue) {\r\nint packedIntValue=int(packedValue);\r\nint v0=packedIntValue/256;\r\nreturn vec2(v0,packedIntValue-v0*256);\r\n}\r\nvec2 unpack_opacity(const float packedOpacity) {\r\nint intOpacity=int(packedOpacity)/2;\r\nreturn vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));\r\n}vec4 decode_color(const vec2 encodedColor) {\r\nreturn vec4(\r\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\r\n);\r\n}float unpack_mix_vec2(const vec2 packedValue,const float t) {\r\nreturn mix(packedValue[0],packedValue[1],t);\r\n}vec4 unpack_mix_color(const vec4 packedColors,const float t) {\r\nvec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));\r\nvec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));\r\nreturn mix(minColor,maxColor,t);\r\n}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) {\r\nvec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);\r\nreturn (tile_units_to_pixels*pos+offset)/pattern_size;\r\n}"),Ve=fi("uniform vec4 u_color;\r\nuniform float u_opacity;\r\nvoid main() {\r\ngl_FragColor=u_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Ge=fi("uniform vec2 u_pattern_tl_a;\r\nuniform vec2 u_pattern_br_a;\r\nuniform vec2 u_pattern_tl_b;\r\nuniform vec2 u_pattern_br_b;\r\nuniform vec2 u_texsize;\r\nuniform float u_mix;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_mix)*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pattern_size_a;\r\nuniform vec2 u_pattern_size_b;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_scale_a;\r\nuniform float u_scale_b;\r\nuniform float u_tile_units_to_pixels;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_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);\r\nv_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);\r\n}"),We=fi("varying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\r\nvec2 extrude=v_data.xy;\r\nfloat extrude_length=length(extrude);\r\nlowp float antialiasblur=v_data.z;\r\nfloat antialiased_blur=-max(blur,antialiasblur);\r\nfloat opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);\r\nfloat color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\r\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\r\n);\r\ngl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform bool u_scale_with_map;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\r\nif (u_pitch_with_map) {\r\nvec2 corner_position=circle_center;\r\nif (u_scale_with_map) {\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale;\r\n} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);\r\n}\r\ngl_Position=u_matrix*vec4(corner_position,0,1);\r\n} else {\r\ngl_Position=u_matrix*vec4(circle_center,0,1);\r\nif (u_scale_with_map) {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;\r\n} else {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;\r\n}\r\n}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n}"),Xe=fi("void main() {\r\ngl_FragColor=vec4(1.0);\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),He=fi("uniform highp float u_intensity;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main() {\r\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);\r\nfloat val=weight*u_intensity*GAUSS_COEF*exp(d);\r\ngl_FragColor=vec4(val,1.0,1.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform float u_extrude_scale;\r\nuniform float u_opacity;\r\nuniform float u_intensity;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\r\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp float weight\r\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);\r\ngl_Position=u_matrix*pos;\r\n}"),Ke=fi("uniform sampler2D u_image;\r\nuniform sampler2D u_color_ramp;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\nfloat t=texture2D(u_image,v_pos).r;\r\nvec4 color=texture2D(u_color_ramp,vec2(t,0.5));\r\ngl_FragColor=color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"),Ye=fi("varying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nfloat alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),Je=fi("uniform float u_overscale_factor;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nfloat alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ncolor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {color*=.2;\r\n}\r\nfloat extrude_scale_length=length(v_extrude_scale);\r\nfloat extrude_length=length(v_extrude)*extrude_scale_length;\r\nfloat stroke_width=15.0*extrude_scale_length/u_overscale_factor;\r\nfloat radius=v_radius*extrude_scale_length;\r\nfloat distance_to_edge=abs(extrude_length-radius);\r\nfloat opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);\r\ngl_FragColor=opacity_t*color;\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\nhighp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\nv_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;\r\nv_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;\r\n}"),Qe=fi("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),$e=fi("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),ti=fi("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ei=fi("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ii=fi("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),ri=fi("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\nv_color*=u_opacity;\r\n}"),oi=fi("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n}"),ni=fi("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform float u_maxzoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),ai=fi("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat 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);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),si=fi("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),li=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),ci=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat 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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),hi=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),ui=fi("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(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;\r\nrgb+=(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);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),pi=fi("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),di=fi("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"),_i=fi("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}");function fi(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return {fragmentSource:t=t.replace(i,(function(t,e,i,o,n){return r[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,o,n){var a="float"===o?"vec2":"vec4",s=n.match(/color/)?"color":a;return r[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"}))}}var mi=Object.freeze({__proto__:null,prelude:qe,background:Ve,backgroundPattern:Ge,circle:We,clippingMask:Xe,heatmap:He,heatmapTexture:Ke,collisionBox:Ye,collisionCircle:Je,debug:Qe,fill:$e,fillOutline:ti,fillOutlinePattern:ei,fillPattern:ii,fillExtrusion:ri,fillExtrusionPattern:oi,hillshadePrepare:ni,hillshade:ai,line:si,lineGradient:li,linePattern:ci,lineSDF:hi,raster:ui,symbolIcon:pi,symbolSDF:di,symbolTextAndIcon:_i}),gi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};gi.prototype.bind=function(t,e,i,r,o,n,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==r.length,c=0;!l&&c<r.length;c++)this.boundPaintVertexBuffers[c]!==r[c]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!l&&this.boundIndexBuffer===o&&this.boundVertexOffset===n&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),o&&o.dynamicDraw&&o.bind(),s&&s.bind()):this.freshBind(e,i,r,o,n,a,s);},gi.prototype.freshBind=function(t,e,i,r,o,n,a){var s,l=t.numAttributes,c=this.context,h=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=a;else {s=c.currentNumAttributes||0;for(var u=l;u<s;u++)h.disableVertexAttribArray(u);}e.enableAttributes(h,t);for(var p=0,d=i;p<d.length;p+=1)d[p].enableAttributes(h,t);n&&n.enableAttributes(h,t),a&&a.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,o);for(var _=0,f=i;_<f.length;_+=1){var m=f[_];m.bind(),m.setVertexAttribPointers(h,t,o);}n&&(n.bind(),n.setVertexAttribPointers(h,t,o)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,t,o)),c.currentNumAttributes=l;},gi.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null);};var vi=function(t,e,i,r,o){var n=t.gl;this.program=n.createProgram();var a=i?i.defines():[];o&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(qe.fragmentSource,e.fragmentSource).join("\n"),l=a.concat(qe.vertexSource,e.vertexSource).join("\n"),c=n.createShader(n.FRAGMENT_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(c,s),n.compileShader(c),n.attachShader(this.program,c);var h=n.createShader(n.VERTEX_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(h,l),n.compileShader(h),n.attachShader(this.program,h);for(var u=i?i.layoutAttributes:[],p=0;p<u.length;p++)n.bindAttribLocation(this.program,p,u[p].name);n.linkProgram(this.program),this.numAttributes=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),this.attributes={};for(var d={},_=0;_<this.numAttributes;_++){var f=n.getActiveAttrib(this.program,_);f&&(this.attributes[f.name]=n.getAttribLocation(this.program,f.name));}for(var m=n.getProgramParameter(this.program,n.ACTIVE_UNIFORMS),g=0;g<m;g++){var v=n.getActiveUniform(this.program,g);v&&(d[v.name]=n.getUniformLocation(this.program,v.name));}this.fixedUniforms=r(t,d),this.binderUniforms=i?i.getUniforms(t,d):[];}}};function yi(t,e,i){var r=1/ue(i,1,e.transform.tileZoom),o=Math.pow(2,i.tileID.overscaledZ),n=i.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=n*(i.tileID.canonical.x+i.tileID.wrap*o),s=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:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}vi.prototype.draw=function(t,e,i,r,o,n,a,s,l,c,h,u,p,d,_,f){var m,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=h.get();x<b.length;x+=1){var w=b[x],E=w.vaos||(w.vaos={});(E[s]||(E[s]=new gi)).bind(t,this,l,d?d.getPaintVertexBuffers():[],c,w.vertexOffset,_,f),g.drawElements(e,w.primitiveLength*y,g.UNSIGNED_SHORT,w.primitiveOffset*y*2);}}};var xi=function(e,i,r,o){var n=i.style.light,a=n.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===n.properties.get("anchor")&&t.fromRotation(l,-i.transform.angle),t.transformMat3(s,s,l);var c=n.properties.get("color");return {u_matrix:e,u_lightpos:s,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+r,u_opacity:o}},bi=function(e,i,r,o,n,a,s){return t.extend(xi(e,i,r,o),yi(a,i,s),{u_height_factor:-Math.pow(2,n.overscaledZ)/s.tileSize/8})},wi=function(t){return {u_matrix:t}},Ei=function(e,i,r,o){return t.extend(wi(e),yi(r,i,o))},Ti=function(t,e){return {u_matrix:t,u_world:e}},Ci=function(e,i,r,o,n){return t.extend(Ei(e,i,r,o),{u_world:n})},Ii=function(e,i,r,o){var n,a,s=e.transform;if("map"===o.paint.get("circle-pitch-alignment")){var l=ue(r,1,s.zoom);n=!0,a=[l,l];}else n=!1,a=s.pixelsToGLUnits;return {u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===o.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(i.posMatrix,r,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},Si=function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},Pi=function(t,e,i){var r=ue(i,1,e.zoom),o=Math.pow(2,e.zoom-i.tileID.overscaledZ),n=i.tileID.overscaleFactor();return {u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*o),e.pixelsToGLUnits[1]/(r*o)],u_overscale_factor:n}},Mi=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},zi=function(t){return {u_matrix:t}},Li=function(t,e,i,r){return {u_matrix:t,u_extrude_scale:ue(e,1,i),u_intensity:r}},Ai=function(e,i,r){var o=e.transform;return {u_matrix:Oi(e,i,r),u_ratio:1/ue(i,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Di=function(e,i,r){return t.extend(Ai(e,i,r),{u_image:0})},Ri=function(e,i,r,o){var n=e.transform,a=Bi(i,n);return {u_matrix:Oi(e,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:1/ue(i,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},ki=function(e,i,r,o,n){var a=e.lineAtlas,s=Bi(i,e.transform),l="round"===r.layout.get("line-cap"),c=a.getDash(o.from,l),h=a.getDash(o.to,l),u=c.width*n.fromScale,p=h.width*n.toScale;return t.extend(Ai(e,i,r),{u_patternscale_a:[s/u,-c.height/2],u_patternscale_b:[s/p,-h.height/2],u_sdfgamma:a.width/(256*Math.min(u,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:n.t})};function Bi(t,e){return 1/ue(t,1,e.tileZoom)}function Oi(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Fi=function(t,e,i,r,o){return {u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(a=o.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(n=o.paint.get("raster-contrast"),n>0?1/(1-n):1+n),u_spin_weights:Ui(o.paint.get("raster-hue-rotate"))};var n,a;};function Ui(t){t*=Math.PI/180;var 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]}var Ni=function(t,e,i,r,o,n,a,s,l,c){var h=o.transform;return {u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:n,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},Zi=function(e,i,r,o,n,a,s,l,c,h,u){var p=n.transform;return t.extend(Ni(e,i,r,o,n,a,s,l,c,h),{u_gamma_scale:o?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+u})},ji=function(e,i,r,o,n,a,s,l,c,h){return t.extend(Zi(e,i,r,o,n,a,s,l,!0,c,!0),{u_texsize_icon:h,u_texture_icon:1})},qi=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Vi=function(e,i,r,o,n,a){return t.extend(function(t,e,i,r){var o=i.imageManager.getPattern(t.from.toString()),n=i.imageManager.getPattern(t.to.toString()),a=i.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,i.transform.tileZoom)/c,u=h*(r.tileID.canonical.x+r.tileID.wrap*c),p=h*r.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ue(r,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,p>>16],u_pixel_coord_lower:[65535&u,65535&p]}}(o,a,r,n),{u_matrix:e,u_opacity:i})},Gi={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:Si,collisionCircle:Si,debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_maxzoom:new t.Uniform1f(e,i.u_maxzoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function Wi(t,e,i,r,o,n,a,s){for(var l=t.context,c=l.gl,h=t.useProgram(o?"collisionCircle":"collisionBox"),u=0;u<r.length;u++){var p=r[u],d=e.getTile(p),_=d.getBucket(i);if(_){var f=o?s?_.textCollisionCircle:_.iconCollisionCircle:s?_.textCollisionBox:_.iconCollisionBox;if(f){var m=p.posMatrix;0===n[0]&&0===n[1]||(m=t.translatePosMatrix(p.posMatrix,d,n,a)),h.draw(l,o?c.TRIANGLES:c.LINES,St.disabled,Pt.disabled,t.colorModeForRenderPass(),zt.disabled,Pi(m,t.transform,d),i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,t.transform.zoom,null,null,f.collisionVertexBuffer);}}}}function Xi(t,e,i,r,o,n,a){Wi(t,e,i,r,!1,o,n,a),Wi(t,e,i,r,!0,o,n,a);}var Hi=t.identity(new Float32Array(16));function Ki(e,i,r,o,n,a){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*i,c=-(s.verticalAlign-.5)*r,h=t.evaluateVariableOffset(e,o);return new t.Point((l/n+h[0])*a,(c/n+h[1])*a)}function Yi(e,i,r,o,n,a,s,l,c,h,u){var p=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,_=e.icon.dynamicLayoutVertexArray,f={};d.clear();for(var m=0;m<p.length;m++){var g=p.get(m),v=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:o[g.crossTileID];if(v){var y=new t.Point(g.anchorX,g.anchorY),x=Qt(y,r?l:s),b=.5+a.cameraToCenterDistance/x.signedDistanceFromCamera*.5,w=n.evaluateSizeForFeature(e.textSizeData,h,g)*b/t.ONE_EM;r&&(w*=e.tilePixelRatio/c);for(var E=Ki(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,w),T=r?Qt(y.add(E),s).point:x.point.add(i?E.rotate(-a.angle):E),C=e.allowVerticalPlacement&&g.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,I=0;I<g.numGlyphs;I++)t.addDynamicAttributes(d,T,C);u&&g.associatedIconIndex>=0&&(f[g.associatedIconIndex]={shiftedAnchor:T,angle:C});}else se(g.numGlyphs,d);}if(u){_.clear();for(var S=e.icon.placedSymbolArray,P=0;P<S.length;P++){var M=S.get(P);if(M.hidden)se(M.numGlyphs,_);else {var z=f[P];if(z)for(var L=0;L<M.numGlyphs;L++)t.addDynamicAttributes(_,z.shiftedAnchor,z.angle);else se(M.numGlyphs,_);}}e.icon.dynamicLayoutVertexBuffer.updateData(_);}e.text.dynamicLayoutVertexBuffer.updateData(d);}function Ji(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Qi(e,i,r,o,n,a,s,l,c,h,u,p){for(var d,_,f=e.context,m=f.gl,g=e.transform,v="map"===l,y="map"===c,x=v&&"point"!==r.layout.get("symbol-placement"),b=v&&!y&&!x,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),E=e.depthModeForSublayer(0,St.ReadOnly),T=r.layout.get("text-variable-anchor"),C=[],I=0,S=o;I<S.length;I+=1){var P=S[I],M=i.getTile(P),z=M.getBucket(r);if(z){var L=n?z.text:z.icon;if(L&&L.segments.get().length){var A=L.programConfigurations.get(r.id),D=n||z.sdfIcons,R=n?z.textSizeData:z.iconSizeData,k=y||0!==g.pitch;d||(d=e.useProgram(Ji(D,n,z),A),_=t.evaluateSizeForZoom(R,g.zoom));var B=void 0,O=[0,0],F=void 0,U=void 0,N=null,Z=void 0;if(n)F=M.glyphAtlasTexture,U=m.LINEAR,B=M.glyphAtlasTexture.size,z.iconsInText&&(O=M.imageAtlasTexture.size,N=M.imageAtlasTexture,Z=k||e.options.rotating||e.options.zooming||"composite"===R.kind||"camera"===R.kind?m.LINEAR:m.NEAREST);else {var j=1!==r.layout.get("icon-size").constantOr(0)||z.iconsNeedLinear;F=M.imageAtlasTexture,U=D||e.options.rotating||e.options.zooming||j||k?m.LINEAR:m.NEAREST,B=M.imageAtlasTexture.size;}var q=ue(M,1,e.transform.zoom),V=Yt(P.posMatrix,y,v,e.transform,q),G=Jt(P.posMatrix,y,v,e.transform,q),W=T&&z.hasTextData(),X="none"!==r.layout.get("icon-text-fit")&&W&&z.hasIconData();x&&te(z,P.posMatrix,e,n,V,G,y,h);var H=e.translatePosMatrix(P.posMatrix,M,a,s),K=x||n&&T||X?Hi:V,Y=e.translatePosMatrix(G,M,a,s,!0),J=D&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:d,buffers:L,uniformValues:D?z.iconsInText?ji(R.kind,_,b,y,e,H,K,Y,B,O):Zi(R.kind,_,b,y,e,H,K,Y,n,B,!0):Ni(R.kind,_,b,y,e,H,K,Y,n,B),atlasTexture:F,atlasTextureIcon:N,atlasInterpolation:U,atlasInterpolationIcon:Z,isSDF:D,hasHalo:J};if(w)for(var $=0,tt=L.segments.get();$<tt.length;$+=1){var et=tt[$];C.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q});}else C.push({segments:L.segments,sortKey:0,state:Q});}}}w&&C.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,rt=C;it<rt.length;it+=1){var ot=rt[it],nt=ot.state;if(f.activeTexture.set(m.TEXTURE0),nt.atlasTexture.bind(nt.atlasInterpolation,m.CLAMP_TO_EDGE),nt.atlasTextureIcon&&(f.activeTexture.set(m.TEXTURE1),nt.atlasTextureIcon&&nt.atlasTextureIcon.bind(nt.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),nt.isSDF){var at=nt.uniformValues;nt.hasHalo&&(at.u_is_halo=1,$i(nt.buffers,ot.segments,r,e,nt.program,E,u,p,at)),at.u_is_halo=0;}$i(nt.buffers,ot.segments,r,e,nt.program,E,u,p,nt.uniformValues);}}function $i(t,e,i,r,o,n,a,s,l){var c=r.context;o.draw(c,c.gl.TRIANGLES,n,a,s,zt.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer);}function tr(t,e,i,r,o,n,a){var s,l,c,h,u,p=t.context.gl,d=i.paint.get("fill-pattern"),_=d&&d.constantOr(1),f=i.getCrossfadeParameters();a?(l=_&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=_?"fillPattern":"fill",s=p.TRIANGLES);for(var m=0,g=r;m<g.length;m+=1){var v=g[m],y=e.getTile(v);if(!_||y.patternsLoaded()){var x=y.getBucket(i);if(x){var b=x.programConfigurations.get(i.id),w=t.useProgram(l,b);_&&(t.context.activeTexture.set(p.TEXTURE0),y.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePaintBuffers(f));var E=d.constantOr(null);if(E&&y.imageAtlas){var T=y.imageAtlas,C=T.patternPositions[E.to.toString()],I=T.patternPositions[E.from.toString()];C&&I&&b.setConstantPatternPositions(C,I);}var S=t.translatePosMatrix(v.posMatrix,y,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){h=x.indexBuffer2,u=x.segments2;var P=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&_?Ci(S,t,f,y,P):Ti(S,P);}else h=x.indexBuffer,u=x.segments,c=_?Ei(S,t,f,y):wi(S);w.draw(t.context,s,o,t.stencilModeForClipping(v),n,zt.disabled,c,i.id,x.layoutVertexBuffer,h,u,i.paint,t.transform.zoom,b);}}}}function er(t,e,i,r,o,n,a){for(var s=t.context,l=s.gl,c=i.paint.get("fill-extrusion-pattern"),h=c.constantOr(1),u=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),d=0,_=r;d<_.length;d+=1){var f=_[d],m=e.getTile(f),g=m.getBucket(i);if(g){var v=g.programConfigurations.get(i.id),y=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",v);h&&(t.context.activeTexture.set(l.TEXTURE0),m.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(u));var x=c.constantOr(null);if(x&&m.imageAtlas){var b=m.imageAtlas,w=b.patternPositions[x.to.toString()],E=b.patternPositions[x.from.toString()];w&&E&&v.setConstantPatternPositions(w,E);}var T=t.translatePosMatrix(f.posMatrix,m,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),C=i.paint.get("fill-extrusion-vertical-gradient"),I=h?bi(T,t,C,p,f,u,m):xi(T,t,C,p);y.draw(s,s.gl.TRIANGLES,o,n,a,zt.backCCW,I,i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,t.transform.zoom,v);}}}function ir(e,i,r,o,n,a){var s=e.context,l=s.gl,c=i.fbo;if(c){var h=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());var u=function(e,i,r){var o=r.paint.get("hillshade-shadow-color"),n=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,c,h,u=!e.options.moving;return {u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),u),u_image:0,u_latrange:(l=i.tileID,c=Math.pow(2,l.canonical.z),h=l.canonical.y,[new t.MercatorCoordinate(0,h/c).toLngLat().lat,new t.MercatorCoordinate(0,(h+1)/c).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:o,u_highlight:n,u_accent:a}}(e,i,r);h.draw(s,l.TRIANGLES,o,n,a,zt.disabled,u,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments);}}function rr(e,i,r,o,n,a,s){var l=e.context,c=l.gl,h=i.dem;if(h&&h.data){var u=h.dim,p=h.stride,d=h.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(p),i.demTexture){var _=i.demTexture;_.update(d,{premultiply:!1}),_.bind(c.NEAREST,c.CLAMP_TO_EDGE);}else i.demTexture=new t.Texture(l,d,c.RGBA,{premultiply:!1}),i.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);var f=i.fbo;if(!f){var m=new t.Texture(l,{width:u,height:u,data:null},c.RGBA);m.bind(c.LINEAR,c.CLAMP_TO_EDGE),(f=i.fbo=l.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture);}l.bindFramebuffer.set(f.framebuffer),l.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,n,a,s,zt.disabled,function(e,i,r){var o=i.stride,n=t.create();return t.ortho(n,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(n,n,[0,-t.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[o,o],u_zoom:e.overscaledZ,u_maxzoom:r,u_unpack:i.getUnpackVector()}}(i.tileID,h,o),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1;}}function or(e,i,r,o,n){var a=o.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,c=i?(s-i.timeAdded)/a:-1,h=r.getSource(),u=n.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}var nr=new t.Color(1,0,0,1),ar=new t.Color(0,1,0,1),sr=new t.Color(0,0,1,1),lr=new t.Color(1,0,1,1),cr=new t.Color(0,1,1,1);function hr(t,e,i,r){pr(t,0,e+i/2,t.transform.width,i,r);}function ur(t,e,i,r){pr(t,e-i/2,0,i,t.transform.height,r);}function pr(e,i,r,o,n,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST);}function dr(e,i,r){var o=e.context,n=o.gl,a=r.posMatrix,s=e.useProgram("debug"),l=St.disabled,c=Pt.disabled,h=e.colorModeForRenderPass();o.activeTexture.set(n.TEXTURE0),e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),s.draw(o,n.LINE_STRIP,l,c,h,zt.disabled,Mi(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var u=i.getTileByID(r.key).latestRawTileData,p=Math.floor((u&&u.byteLength||0)/1024),d=i.getTile(r).tileSize,_=512/Math.min(d,512)*(r.overscaledZ/e.transform.zoom)*.5,f=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(f+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(e,5,5),o.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE);}(e,f+" "+p+"kb"),s.draw(o,n.TRIANGLES,l,c,Mt.alphaBlended,zt.disabled,Mi(a,t.Color.transparent,_),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments);}var _r={symbol:function(e,i,r,o,n){if("translucent"===e.renderPass){var a=Pt.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,i,r,o,n,a,s){for(var l=i.transform,c="map"===n,h="map"===a,u=0,p=e;u<p.length;u+=1){var d=p[u],_=o.getTile(d),f=_.getBucket(r);if(f&&f.text&&f.text.segments.get().length){var m=t.evaluateSizeForZoom(f.textSizeData,l.zoom),g=ue(_,1,i.transform.zoom),v=Yt(d.posMatrix,h,c,i.transform,g),y="none"!==r.layout.get("icon-text-fit")&&f.hasIconData();if(m){var x=Math.pow(2,l.zoom-_.tileID.overscaledZ);Yi(f,c,h,s,t.symbolSize,l,v,d.posMatrix,x,m,y);}}}}(o,e,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),n),0!==r.paint.get("icon-opacity").constantOr(1)&&Qi(e,i,r,o,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&Qi(e,i,r,o,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),i.map.showCollisionBoxes&&(Xi(e,i,r,o,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Xi(e,i,r,o,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1));}},circle:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,h=c.gl,u=e.depthModeForSublayer(0,St.ReadOnly),p=Pt.disabled,d=e.colorModeForRenderPass(),_=[],f=0;f<o.length;f++){var m=o[f],g=i.getTile(m),v=g.getBucket(r);if(v){var y=v.programConfigurations.get(r.id),x={programConfiguration:y,program:e.useProgram("circle",y),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Ii(e,m,g,r)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var E=w[b];_.push({segments:new t.SegmentVector([E]),sortKey:E.sortKey,state:x});}else _.push({segments:v.segments,sortKey:0,state:x});}}l&&_.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,C=_;T<C.length;T+=1){var I=C[T],S=I.state;S.program.draw(c,h.TRIANGLES,u,p,d,zt.disabled,S.uniformValues,r.id,S.layoutVertexBuffer,S.indexBuffer,I.segments,r.paint,e.transform.zoom,S.programConfiguration);}}}},heatmap:function(e,i,r,o){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var n=e.context,a=n.gl,s=Pt.disabled,l=new Mt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=i.heatmapFbo;if(o)r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else {var n=r.createTexture();r.bindTexture(r.TEXTURE_2D,n),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),o=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function t(e,i,r,o){var n=e.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,i.width/4,i.height/4,0,n.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),o.colorAttachment.set(r),e.extTextureHalfFloat&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,o.colorAttachment.setDirty(),t(e,i,r,o));}(t,e,n,o);}}(n,e,r),n.clear({color:t.Color.transparent});for(var c=0;c<o.length;c++){var h=o[c];if(!i.hasRenderableParent(h)){var u=i.getTile(h),p=u.getBucket(r);if(p){var d=p.programConfigurations.get(r.id);e.useProgram("heatmap",d).draw(n,a.TRIANGLES,St.disabled,s,l,zt.disabled,Li(h.posMatrix,u,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.zoom,d);}}}n.viewport.set([0,0,e.width,e.height]);}else "translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var r=e.context,o=r.gl,n=i.heatmapFbo;if(n){r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.colorAttachment.get()),r.activeTexture.set(o.TEXTURE1);var a=i.colorRampTexture;a||(a=i.colorRampTexture=new t.Texture(r,i.colorRamp,o.RGBA)),a.bind(o.LINEAR,o.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,o.TRIANGLES,St.disabled,Pt.disabled,e.colorModeForRenderPass(),zt.disabled,function(e,i,r,o){var n=t.create();t.ortho(n,0,e.width,e.height,0,0,1);var a=e.context.gl;return {u_matrix:n,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}}(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom);}}(e,r));},line:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==n.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,St.ReadOnly),l=e.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),h=r.paint.get("line-pattern"),u=h.constantOr(1),p=r.paint.get("line-gradient"),d=r.getCrossfadeParameters(),_=u?"linePattern":c?"lineSDF":p?"lineGradient":"line",f=e.context,m=f.gl,g=!0;if(p){f.activeTexture.set(m.TEXTURE0);var v=r.gradientTexture;if(!r.gradient)return;v||(v=r.gradientTexture=new t.Texture(f,r.gradient,m.RGBA)),v.bind(m.LINEAR,m.CLAMP_TO_EDGE);}for(var y=0,x=o;y<x.length;y+=1){var b=x[y],w=i.getTile(b);if(!u||w.patternsLoaded()){var E=w.getBucket(r);if(E){var T=E.programConfigurations.get(r.id),C=e.context.program.get(),I=e.useProgram(_,T),S=g||I.program!==C,P=h.constantOr(null);if(P&&w.imageAtlas){var M=w.imageAtlas,z=M.patternPositions[P.to.toString()],L=M.patternPositions[P.from.toString()];z&&L&&T.setConstantPatternPositions(z,L);}var A=u?Ri(e,w,r,d):c?ki(e,w,r,c,d):p?Di(e,w,r):Ai(e,w,r);u?(f.activeTexture.set(m.TEXTURE0),w.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),T.updatePaintBuffers(d)):c&&(S||e.lineAtlas.dirty)&&(f.activeTexture.set(m.TEXTURE0),e.lineAtlas.bind(f)),I.draw(f,m.TRIANGLES,s,e.stencilModeForClipping(b),l,zt.disabled,A,r.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,r.paint,e.transform.zoom,T),g=!1;}}}}}},fill:function(e,i,r,o){var n=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===n.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var h=e.depthModeForSublayer(1,"opaque"===e.renderPass?St.ReadWrite:St.ReadOnly);tr(e,i,r,o,h,s,!1);}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var u=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,St.ReadOnly);tr(e,i,r,o,u,s,!0);}}},"fill-extrusion":function(t,e,i,r){var o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){var n=new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))er(t,e,i,r,n,Pt.disabled,Mt.disabled),er(t,e,i,r,n,t.stencilModeFor3D(),t.colorModeForRenderPass());else {var a=t.colorModeForRenderPass();er(t,e,i,r,n,Pt.disabled,a);}}},hillshade:function(t,e,i,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,n=e.getSource().maxzoom,a=t.depthModeForSublayer(0,St.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],c=l[0],h=0,u=l[1];h<u.length;h+=1){var p=u[h],d=e.getTile(p);d.needsHillshadePrepare&&"offscreen"===t.renderPass?rr(t,d,i,n,a,Pt.disabled,s):"translucent"===t.renderPass&&ir(t,d,i,a,c[p.overscaledZ],s);}o.viewport.set([0,0,t.width,t.height]);}},raster:function(t,e,i,r){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&r.length)for(var o=t.context,n=o.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=a instanceof P?[{},r]:t.stencilConfigForOverlap(r),h=c[0],u=c[1],p=u[u.length-1].overscaledZ,d=!t.options.moving,_=0,f=u;_<f.length;_+=1){var m=f[_],g=t.depthModeForSublayer(m.overscaledZ-p,1===i.paint.get("raster-opacity")?St.ReadWrite:St.ReadOnly,n.LESS),v=e.getTile(m),y=t.transform.calculatePosMatrix(m.toUnwrapped(),d);v.registerFadeDuration(i.paint.get("raster-fade-duration"));var x=e.findLoadedParent(m,0),b=or(v,x,e,i,t.transform),w=void 0,E=void 0,T="nearest"===i.paint.get("raster-resampling")?n.NEAREST:n.LINEAR;o.activeTexture.set(n.TEXTURE0),v.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(n.TEXTURE1),x?(x.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-v.tileID.overscaledZ),E=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST);var C=Fi(y,E||[0,0],w||1,b,i);a instanceof P?s.draw(o,n.TRIANGLES,g,Pt.disabled,l,zt.disabled,C,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(o,n.TRIANGLES,g,h[m.overscaledZ],l,zt.disabled,C,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments);}},background:function(t,e,i){var r=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0!==o){var n=t.context,a=n.gl,s=t.transform,l=s.tileSize,c=i.paint.get("background-pattern");if(!t.isPatternMissing(c)){var h=!c&&1===r.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===h){var u=Pt.disabled,p=t.depthModeForSublayer(0,"opaque"===h?St.ReadWrite:St.ReadOnly),d=t.colorModeForRenderPass(),_=t.useProgram(c?"backgroundPattern":"background"),f=s.coveringTiles({tileSize:l});c&&(n.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var m=i.getCrossfadeParameters(),g=0,v=f;g<v.length;g+=1){var y=v[g],x=t.transform.calculatePosMatrix(y.toUnwrapped()),b=c?Vi(x,o,t,c,{tileID:y,tileSize:l},m):qi(x,o,r);_.draw(n,a.TRIANGLES,p,u,d,zt.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments);}}}}},debug:function(t,e,i){for(var r=0;r<i.length;r++)dr(t,e,i[r]);},custom:function(t,e,i){var r=t.context,o=i.implementation;if("offscreen"===t.renderPass){var n=o.prerender;n&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),n.call(o,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState());}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Pt.disabled);var a="3d"===o.renderingMode?new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,St.ReadOnly);r.setDepthMode(a),o.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null);}}},fr=function(t,e){this.context=new Lt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=At.maxUnderzooming+At.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Be,this.gpuTimers={};};fr.prototype.resize=function(e,i){if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,o=this.style._order;r<o.length;r+=1)this.style._layers[o[r]].resize();},fr.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,je.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,je.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(o,S.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(n,je.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Pt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO);},fr.prototype.clearStencil=function(){var e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,St.disabled,this.stencilClearMode,Mt.disabled,zt.disabled,zi(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments);},fr.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Mt.disabled),i.setDepthMode(St.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var n=0,a=e;n<a.length;n+=1){var s=a[n],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;o.draw(i,r.TRIANGLES,St.disabled,new Pt({func:r.ALWAYS,mask:0},l,255,r.KEEP,r.KEEP,r.REPLACE),Mt.disabled,zt.disabled,zi(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);}}},fr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Pt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Pt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),o=r[r.length-1].overscaledZ,n=r[0].overscaledZ-o+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();for(var a={},s=0;s<n;s++)a[s+o]=new Pt({func:i.GEQUAL,mask:255},s+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=n,[a,r]}return [(e={},e[o]=Pt.disabled,e),r]},fr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Mt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Mt.unblended:Mt.alphaBlended},fr.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return St.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new St(i||this.context.gl.LEQUAL,e,[r,r])},fr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},fr.prototype.render=function(e,i){var r=this;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var o=this.style._order,n=this.style.sourceCaches;for(var a in n){var s=n[a];s.used&&s.prepare(this.context);}var l,c,h={},u={},p={};for(var d in n){var _=n[d];h[d]=_.getVisibleCoordinates(),u[d]=h[d].slice().reverse(),p[d]=_.getVisibleCoordinates(!0).reverse();}this.opaquePassCutoff=1/0;for(var f=0;f<o.length;f++)if(this.style._layers[o[f]].is3D()){this.opaquePassCutoff=f;break}this.renderPass="offscreen";for(var m=0,g=o;m<g.length;m+=1){var v=this.style._layers[g[m]];if(v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)){var y=u[v.source];("custom"===v.type||y.length)&&this.renderLayer(this,n[v.source],v,y);}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=n[x.source],w=h[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w);}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var E=this.style._layers[o[this.currentLayer]],T=n[E.source],C=("symbol"===E.type?p:u)[E.source];this._renderTileClippingMasks(E,h[E.source]),this.renderLayer(this,T,E,C);}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(c&&c.id)&&(c=r.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c));})),l&&_r.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;hr(t,t.transform.height-(e.top||0),3,nr),hr(t,e.bottom||0,3,ar),ur(t,e.left||0,3,sr),ur(t,t.transform.width-(e.right||0),3,lr);var i=t.transform.centerPoint;!function(t,e,i,r){pr(t,e-1,i-10,2,20,r),pr(t,e-10,i-1,20,2,r);}(t,i.x,t.transform.height-i.y,cr);}(this),this.context.setDefault();},fr.prototype.renderLayer=function(t,e,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,this.gpuTimingStart(i),_r[i.type](t,e,i,r,this.style.placement.variableOffsets),this.gpuTimingEnd());},fr.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query);}},fr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT);}},fr.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},fr.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var r=t[i],o=this.context.extTimerQuery,n=o.getQueryObjectEXT(r.query,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r.query),e[i]=n;}return e},fr.prototype.translatePosMatrix=function(e,i,r,o,n){if(!r[0]&&!r[1])return e;var a=n?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);r=[r[0]*l-r[1]*s,r[0]*s+r[1]*l];}var c=[n?r[0]:ue(i,r[0],this.transform.zoom),n?r[1]:ue(i,r[1],this.transform.zoom),0],h=new Float32Array(16);return t.translate(h,e,c),h},fr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t];},fr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},fr.prototype.isPatternMissing=function(t){if(!t)return !1;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return !e||!i},fr.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new vi(this.context,mi[t],e,Gi[t],this._showOverdrawInspector)),this.cache[i]},fr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault();},fr.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD);},fr.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA));},fr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy();};var mr=function(t,e){this.points=t,this.planes=e;};mr.fromInvProjectionMatrix=function(e,i,r){var o=Math.pow(2,r),n=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(i){return t.transformMat4([],i,e)})).map((function(e){return t.scale$1([],e,1/e[3]/i*o)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var i=t.sub([],n[e[0]],n[e[1]]),r=t.sub([],n[e[2]],n[e[1]]),o=t.normalize([],t.cross([],i,r)),a=-t.dot(o,n[e[1]]);return o.concat(a)}));return new mr(n,a)};var gr=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5);};gr.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],r=t.clone$2(this.min),o=t.clone$2(this.max),n=0;n<i.length;n++)r[n]=i[n]?this.min[n]:this.center[n],o[n]=i[n]?this.center[n]:this.max[n];return o[2]=this.max[2],new gr(r,o)},gr.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},gr.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},gr.prototype.intersects=function(e){for(var i=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],r=!0,o=0;o<e.planes.length;o++){for(var n=e.planes[o],a=0,s=0;s<i.length;s++)a+=t.dot$1(n,i[s])>=0;if(0===a)return 0;a!==i.length&&(r=!1);}if(r)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,h=-Number.MAX_VALUE,u=0;u<e.points.length;u++){var p=e.points[u][l]-this.min[l];c=Math.min(c,p),h=Math.max(h,p);}if(h<0||c>this.max[l]-this.min[l])return 0}return 1};var vr=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r;};vr.prototype.interpolate=function(e,i,r){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,r)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,r)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,r)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,r)),this},vr.prototype.getCenter=function(e,i){var r=t.clamp((this.left+e-this.right)/2,0,e),o=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(r,o)},vr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},vr.prototype.clone=function(){return new vr(this.top,this.bottom,this.left,this.right)},vr.prototype.toJSON=function(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var yr=function(e,i,r,o,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==r?0:r,this._maxPitch=null==o?60:o,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vr,this._posMatrixCache={},this._alignedPosMatrixCache={};},xr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};yr.prototype.clone=function(){var t=new yr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},xr.minZoom.get=function(){return this._minZoom},xr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},xr.maxZoom.get=function(){return this._maxZoom},xr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},xr.minPitch.get=function(){return this._minPitch},xr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},xr.maxPitch.get=function(){return this._maxPitch},xr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},xr.renderWorldCopies.get=function(){return this._renderWorldCopies},xr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},xr.worldSize.get=function(){return this.tileSize*this.scale},xr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},xr.size.get=function(){return new t.Point(this.width,this.height)},xr.bearing.get=function(){return -this.angle/Math.PI*180},xr.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},xr.pitch.get=function(){return this._pitch/Math.PI*180},xr.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());},xr.fov.get=function(){return this._fov/Math.PI*180},xr.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices());},xr.zoom.get=function(){return this._zoom},xr.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices());},xr.center.get=function(){return this._center},xr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},xr.padding.get=function(){return this._edgeInsets.toJSON()},xr.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},xr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},yr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},yr.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices();},yr.prototype.coveringZoomLevel=function(t){return (t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},yr.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),o=this.pointCoordinate(new t.Point(this.width,0)),n=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,o.x,n.x,a.x)),l=Math.floor(Math.max(r.x,o.x,n.x,a.x)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},yr.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),r=i;if(void 0!==e.minzoom&&i<e.minzoom)return [];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center),n=Math.pow(2,i),a=[n*o.x,n*o.y,0],s=mr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var c=function(t){return {aabb:new gr([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},h=[],u=[],p=i,d=e.reparseOverscaled?r:i;if(this._renderWorldCopies)for(var _=1;_<=3;_++)h.push(c(-_)),h.push(c(_));for(h.push(c(0));h.length>0;){var f=h.pop(),m=f.x,g=f.y,v=f.fullyVisible;if(!v){var y=f.aabb.intersects(s);if(0===y)continue;v=2===y;}var x=f.aabb.distanceX(a),b=f.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(f.zoom===p||w>3+(1<<p-f.zoom)-2&&f.zoom>=l)u.push({tileID:new t.OverscaledTileID(f.zoom===p?d:f.zoom,f.wrap,f.zoom,m,g),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-g])});else for(var E=0;E<4;E++){var T=(m<<1)+E%2,C=(g<<1)+(E>>1);h.push({aabb:f.aabb.quadrant(E),zoom:f.zoom+1,x:T,y:C,wrap:f.wrap,fullyVisible:v});}}return u.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},yr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},xr.unmodified.get=function(){return this._unmodified},yr.prototype.zoomScale=function(t){return Math.pow(2,t)},yr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},yr.prototype.project=function(e){var i=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(this.lngX(e.lng),this.latY(i))},yr.prototype.unproject=function(e){return new t.LngLat(this.xLng(e.x),this.yLat(e.y))},xr.point.get=function(){return this.project(this.center)},yr.prototype.lngX=function(t){return (180+t)*this.worldSize/360},yr.prototype.latY=function(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},yr.prototype.xLng=function(t){return 360*t/this.worldSize-180},yr.prototype.yLat=function(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t/this.worldSize)*Math.PI/180))-90},yr.prototype.setLocationAtPoint=function(e,i){var r=this.pointCoordinate(i),o=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(e),a=new t.MercatorCoordinate(n.x-(r.x-o.x),n.y-(r.y-o.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap());},yr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},yr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},yr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},yr.prototype.coordinateLocation=function(t){return t.toLngLat()},yr.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var o=i[3],n=r[3],a=i[1]/o,s=r[1]/n,l=i[2]/o,c=r[2]/n,h=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(i[0]/o,r[0]/n,h)/this.worldSize,t.number(a,s,h)/this.worldSize)},yr.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},yr.prototype.getBounds=function(){return (new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},yr.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},yr.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude]);},yr.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var r=e.key,o=i?this._alignedPosMatrixCache:this._posMatrixCache;if(o[r])return o[r];var n=e.canonical,a=this.worldSize/this.zoomScale(n.z),s=n.x+Math.pow(2,n.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,n.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),o[r]=new Float32Array(l),o[r]},yr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},yr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,r,o,n=-90,a=90,s=-180,l=180,c=this.size,h=this._unmodified;if(this.latRange){var u=this.latRange;n=this.latY(u[1]),e=(a=this.latY(u[0]))-n<c.y?c.y/(a-n):0;}if(this.lngRange){var p=this.lngRange;s=this.lngX(p[0]),i=(l=this.lngX(p[1]))-s<c.x?c.x/(l-s):0;}var d=this.point,_=Math.max(i||0,e||0);if(_)return this.center=this.unproject(new t.Point(i?(l+s)/2:d.x,e?(a+n)/2:d.y)),this.zoom+=this.scaleZoom(_),this._unmodified=h,void(this._constraining=!1);if(this.latRange){var f=d.y,m=c.y/2;f-m<n&&(o=n+m),f+m>a&&(o=a-m);}if(this.lngRange){var g=d.x,v=c.x/2;g-v<s&&(r=s+v),g+v>l&&(r=l-v);}void 0===r&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==r?r:d.x,void 0!==o?o:d.y))),this._unmodified=h,this._constraining=!1;}},yr.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),o=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-r,.01,Math.PI-.01)),n=this.point,a=n.x,s=n.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*o+this.cameraToCenterDistance),c=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,c,l),h[8]=2*-e.x/this.width,h[9]=2*e.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-a,-s,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]);var u=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"===this.units&&(u=this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(h,h,[1,1,u,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,_=Math.cos(this.angle),f=Math.sin(this.angle),m=a-Math.round(a)+_*p+f*d,g=s-Math.round(s)+_*d+f*p,v=new Float64Array(h);if(t.translate(v,v,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={};}},yr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},yr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},yr.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return [e[0],i];for(var r=i.x,o=i.y,n=i.x,a=i.y,s=0,l=e;s<l.length;s+=1){var c=l[s];r=Math.min(r,c.x),o=Math.min(o,c.y),n=Math.max(n,c.x),a=Math.max(a,c.y);}return [new t.Point(r,o),new t.Point(n,o),new t.Point(n,a),new t.Point(r,a),new t.Point(r,o)]},Object.defineProperties(yr.prototype,xr);var br=function(e){var i,r,o,n;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(i=this._updateHashUnthrottled.bind(this),r=!1,o=null,n=function(){o=null,r&&(i(),o=setTimeout(n,300),r=!1);},function(){return r=!0,o||n(),o});};br.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},br.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},br.prototype.getHashString=function(e){var i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,o=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,o),a=Math.round(i.lng*n)/n,s=Math.round(i.lat*n)/n,l=this._map.getBearing(),c=this._map.getPitch(),h="";if(h+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+="/"+Math.round(c)),this._hashName){var u=this._hashName,p=!1,d=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===u?(p=!0,e+"="+h):t})).filter((function(t){return t}));return p||d.push(u+"="+h),"#"+d.join("&")}return "#"+h},br.prototype._getCurrentHash=function(){var e,i=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===i._hashName&&(e=t);})),(e&&e[1]||"").split("/")):r.split("/")},br.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return !1},br.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var wr=function(e){function r(r,o,n,a){void 0===a&&(a={});var s=i.mousePos(o.getCanvasContainer(),n),l=o.unproject(s);e.call(this,r,t.extend({point:s,lngLat:l,originalEvent:n},a)),this._defaultPrevented=!1,this.target=o;}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),Er=function(e){function r(r,o,n){var a=i.touchPos(o.getCanvasContainer(),n),s=a.map((function(t){return o.unproject(t)})),l=a.reduce((function(t,e,i,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=o.unproject(l);e.call(this,r,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:n}),this._defaultPrevented=!1;}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),Tr=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1;}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0;},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),Cr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};Cr.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},Cr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},Cr.prototype.isEnabled=function(){return !!this._enabled},Cr.prototype.isActive=function(){return !!this._active},Cr.prototype.isZooming=function(){return !!this._zooming},Cr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},Cr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Cr.prototype.onWheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),o=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this.isActive()||this._start(e)),e.preventDefault();}},Cr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t);},Cr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame));}},Cr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var i=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var a="number"==typeof this._targetZoom?this._targetZoom:i.zoom,s=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&s&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),u=l(h);i.zoom=t.number(s,a,u),h<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0;}else i.zoom=a,c=!0;i.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom;}),200));}},Cr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var r=this._prevEase,o=(t.browser.now()-r.start)/r.duration,n=r.easing(o+.01)-r.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=t.bezier(a,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i};var Ir=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this);};Ir.prototype.isEnabled=function(){return !!this._enabled},Ir.prototype.isActive=function(){return !!this._active},Ir.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Ir.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Ir.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=this._lastPos=i.mousePos(this._el,e),this._active=!0);},Ir.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(r.x,e.x),n=Math.max(r.x,e.x),a=Math.min(r.y,e.y),s=Math.max(r.y,e.y);i.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=n-o+"px",this._box.style.height=s-a+"px";}},Ir.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,o=i.mousePos(this._el,e);this._finish(),i.suppressClick(),r.x===o.x&&r.y===o.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(r,o,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}));}},Ir.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t));},Ir.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos;},Ir.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var Sr=t.bezier(0,0,.25,1),Pr=function(e,i){this._map=e,this._el=i.element||e.getCanvasContainer(),this._state="disabled",this._button=i.button||"right",this._bearingSnap=i.bearingSnap||0,this._pitchWithRotate=!1!==i.pitchWithRotate,this._clickTolerance=i.clickTolerance||1,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this);};Pr.prototype.isEnabled=function(){return "disabled"!==this._state},Pr.prototype.isActive=function(){return "active"===this._state},Pr.prototype.enable=function(){this.isEnabled()||(this._state="enabled");},Pr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},Pr.prototype.onMouseDown=function(e){if("enabled"===this._state){var r="touchstart"===e.type;if(r)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=i.mouseButton(e),e.altKey||e.metaKey)return;if(this._eventButton!==(e.ctrlKey?0:2))return}else {if(e.ctrlKey||0!==i.mouseButton(e))return;this._eventButton=0;}i.disableDrag(),r?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault();}},Pr.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._startPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},Pr.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var i=this._map.transform,r=this._prevPos,o=this._lastPos,n=i.bearing-.8*(r.x-o.x),a=i.pitch- -.5*(r.y-o.y),s=this._inertia,l=s[s.length-1];this._drainInertiaBuffer(),s.push([t.browser.now(),this._map._normalizeBearing(n,l[1])]);var c=i.bearing;if(i.bearing=n,this._pitchWithRotate){var h=i.pitch;i.pitch=a,i.pitch!==h&&this._fireEvent("pitch",e);}i.bearing!==c&&this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos;}},Pr.prototype._onMouseUp=function(t){var e="touchend"===t.type;if(e&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),e||i.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind();}},Pr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind();}},Pr.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),i.enableDrag();},Pr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos;},Pr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var i=this._map,r=i.getBearing(),o=this._inertia,n=function(){Math.abs(r)<e._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t);};if(o.length<2)n();else {var a=o[0],s=o[o.length-1],l=i._normalizeBearing(r,o[o.length-2][1]),c=s[1]-a[1],h=c<0?-1:1,u=(s[0]-a[0])/1e3;if(0!==c&&0!==u){var p=Math.abs(c*(.25/u));p>180&&(p=180);var d=p/180;l+=h*p*(d/2),Math.abs(i._normalizeBearing(l,0))<this._bearingSnap&&(l=i._normalizeBearing(0,l)),i.rotateTo(l,{duration:1e3*d,easing:Sr,noMoveStart:!0},{originalEvent:t});}else n();}},Pr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},Pr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var Mr={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},zr=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=i.clickTolerance||1,this._inertiaOptions=Mr,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this);};zr.prototype.isEnabled=function(){return "disabled"!==this._state},zr.prototype.isActive=function(){return "active"===this._state},zr.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(Mr,e));},zr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},zr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==i.mouseButton(e)||(i.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)));},zr.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(i.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)));},zr.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]];},zr.prototype._touchesMatch=function(t,e){return !(!t||!e||t.length!==e.length)&&t.every((function(t,i){return e[i]===t}))},zr.prototype._onMove=function(e){e.preventDefault();var r=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,o=i.mousePos(this._el,e);(r?this._touchesMatch(this._lastTouch,r):this._lastPos.equals(o))||"pending"===this._state&&o.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=o,this._lastTouch=r,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},zr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent;}},zr.prototype._onMouseUp=function(t){if(0===i.mouseButton(t))switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();}},zr.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t);}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind();}},zr.prototype._abort=function(e){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",e),this._fireEvent("moveend",e)),this._unbind(),this._deactivate(),t.window.TouchEvent&&e instanceof t.window.TouchEvent&&e.touches.length>1&&i.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind();}},zr.prototype._onBlur=function(t){this._abort(t);},zr.prototype._unbind=function(){i.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onTouchEnd),i.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.removeEventListener(t.window.document,"mouseup",this._onMouseUp),i.removeEventListener(t.window,"blur",this._onBlur);},zr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart;},zr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else {var i=e[e.length-1],r=e[0],o=i[1].sub(r[1]),n=(i[0]-r[0])/1e3;if(0===n||i[1].equals(r[1]))this._fireEvent("moveend",t);else {var a=this._inertiaOptions,s=a.linearity,l=a.easing,c=a.maxSpeed,h=a.deceleration,u=o.mult(s/n),p=u.mag();p>c&&(p=c,u._unit()._mult(p));var d=p/(h*s),_=u.mult(-d/2);this._map.panBy(_,{duration:1e3*d,easing:l,noMoveStart:!0},{originalEvent:t});}}},zr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},zr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var Lr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this);};function Ar(t){return t*(2-t)}Lr.prototype.isEnabled=function(){return !!this._enabled},Lr.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0);},Lr.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1);},Lr.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,r=0,o=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(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(n=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:Ar,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*i,pitch:a.getPitch()+10*r,offset:[100*-o,100*-n],center:a.getCenter()};a.easeTo(l,{originalEvent:t});}};var Dr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this);};Dr.prototype.isEnabled=function(){return !!this._enabled},Dr.prototype.isActive=function(){return !!this._active},Dr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Dr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Dr.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var i=this._tappedPoint;if(i&&i.dist(t.points[0])<=30){t.originalEvent.preventDefault();var r=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped();},o=function(){e._map.off("touchend",r),e._resetTapped();};this._map.once("touchend",r),this._map.once("touchcancel",o);}else this._resetTapped();}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null;}),300);},Dr.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null;},Dr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t));},Dr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t);},Dr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd);};var Rr=t.bezier(0,0,.15,1),kr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this);};kr.prototype.isEnabled=function(){return !!this._enabled},kr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around);},kr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1);},kr.prototype.disableRotation=function(){this._rotationDisabled=!0;},kr.prototype.enableRotation=function(){this._rotationDisabled=!1;},kr.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},kr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=i.mousePos(this._el,e.touches[0]),o=i.mousePos(this._el,e.touches[1]),n=r.add(o).div(2);this._startVec=r.sub(o),this._startAround=this._map.transform.pointLocation(n),this._gestureIntent=void 0,this._inertia=[],i.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(t.window.document,"touchend",this._onEnd);}},kr.prototype._getTouchEventData=function(t){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),o=e.sub(r);return {vec:o,center:e.add(r).div(2),scale:o.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI}},kr.prototype._onMove=function(e){if(2===e.touches.length){var i=this._getTouchEventData(e),r=i.vec,o=i.scale,n=i.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==o||Math.abs(1-o)>.15;Math.abs(n)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=r);}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault();}},kr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var i=this._map.transform;this._startScale||(this._startScale=i.scale,this._startBearing=i.bearing);var r=this._getTouchEventData(this._lastTouchEvent),o=r.center,n=r.bearing,a=r.scale,s=i.pointLocation(o),l=i.locationPoint(s);"rotate"===e&&(i.bearing=this._startBearing+n),i.zoom=i.scaleZoom(this._startScale*a),i.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,o]);}},kr.prototype._onEnd=function(e){i.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,o=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var n=this._inertia,a=this._map;if(n.length<2)a.snapToNorth({},{originalEvent:e});else {var s=n[n.length-1],l=n[0],c=a.transform.scaleZoom(o*s[1]),h=a.transform.scaleZoom(o*l[1]),u=(s[0]-l[0])/1e3,p=s[2];if(0!==u&&c!==h){var d=.15*(c-h)/u;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var _=1e3*Math.abs(d/(12*.15));a.easeTo({zoom:c+d*_/2e3,duration:_,easing:Rr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e});}else a.snapToNorth({},{originalEvent:e});}}},kr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>2&&i-e[0][0]>160;)e.shift();};var Br={scrollZoom:Cr,boxZoom:Ir,dragRotate:Pr,dragPan:zr,keyboard:Lr,doubleClickZoom:Dr,touchZoomRotate:kr},Or=function(e){function i(i,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),r)},i.prototype.panTo=function(e,i,r){return this.easeTo(t.extend({center:e},i),r)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,r){return this.easeTo(t.extend({zoom:e},i),r)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.getPadding=function(){return this.transform.padding},i.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},i.prototype.rotateTo=function(e,i,r){return this.easeTo(t.extend({bearing:e},i),r)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.resetNorthPitch=function(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(e,i){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,i)},i.prototype._cameraForBoxAndBearing=function(e,i,r,o){var n={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=t.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){var a=o.padding;o.padding={top:a,bottom:a,right:a,left:a};}o.padding=t.extend(n,o.padding);var s=this.transform,l=s.padding,c=s.project(t.LngLat.convert(e)),h=s.project(t.LngLat.convert(i)),u=c.rotate(-r*Math.PI/180),p=h.rotate(-r*Math.PI/180),d=new t.Point(Math.max(u.x,p.x),Math.max(u.y,p.y)),_=new t.Point(Math.min(u.x,p.x),Math.min(u.y,p.y)),f=d.sub(_),m=(s.width-(l.left+l.right+o.padding.left+o.padding.right))/f.x,g=(s.height-(l.top+l.bottom+o.padding.top+o.padding.bottom))/f.y;if(!(g<0||m<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(m,g)),o.maxZoom),y=t.Point.convert(o.offset),x=new t.Point(y.x+(o.padding.left-o.padding.right)/2,y.y+(o.padding.top-o.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return {center:s.unproject(c.add(h).div(2).sub(x)),zoom:v,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,r,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),r,o),o,n)},i.prototype._fitInternal=function(e,i,r){return e?(i=t.extend(e,i)).linear?this.easeTo(i,r):this.flyTo(i,r):this},i.prototype.jumpTo=function(e,i){this.stop();var r=this.transform,o=!1,n=!1,a=!1;return "zoom"in e&&r.zoom!==+e.zoom&&(o=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(n=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),o&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),n&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),a&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var r=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var o=this.transform,n=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:n,h="bearing"in e?this._normalizeBearing(e.bearing,a):a,u="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:o.padding,d=t.Point.convert(e.offset),_=o.centerPoint.add(d),f=o.pointLocation(_),m=t.LngLat.convert(e.center||f);this._normalizeCenter(m);var g,v,y=o.project(f),x=o.project(m).sub(y),b=o.zoomScale(c-n);return e.around&&(g=t.LngLat.convert(e.around),v=o.locationPoint(g)),this._zooming=c!==n,this._rotating=a!==h,this._pitching=u!==s,this._padding=!o.isPaddingEqual(p),this._prepareEase(i,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(o.zoom=t.number(n,c,e)),r._rotating&&(o.bearing=t.number(a,h,e)),r._pitching&&(o.pitch=t.number(s,u,e)),r._padding&&(o.interpolatePadding(l,p,e),_=o.centerPoint.add(d)),g)o.setLocationAtPoint(g,v);else {var f=o.zoomScale(o.zoom-n),m=c>n?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=o.unproject(y.add(x.mult(e*w)).mult(f));o.setLocationAtPoint(o.renderWorldCopies?E.wrap():E,_);}r._fireMoveEvents(i);}),(function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(i)}),e.delayEndEvents):r._afterEase(i);}),e),this},i.prototype._prepareEase=function(e,i){this._moving=!0,i||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e){var i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));},i.prototype.flyTo=function(e,i){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var n=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),h="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:n.padding,_=n.zoomScale(h-a),f=t.Point.convert(e.offset),m=n.centerPoint.add(f),g=n.pointLocation(m);e.center&&e.center.length>=2&&(0==e.center[0]&&(e.center[0]=1e-6),0==e.center[1]&&(e.center[1]=1e-6));var v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var y=n.project(g),x=n.project(v).sub(y),b=e.curve,w=Math.max(n.width,n.height),E=w/_,T=x.mag();if("minZoom"in e){var C=t.clamp(Math.min(e.minZoom,a,h),n.minZoom,n.maxZoom),I=w/n.zoomScale(C-a);b=Math.sqrt(I/T*2);}var S=b*b;function P(t){var e=(E*E-w*w+(t?-1:1)*S*S*T*T)/(2*(t?E:w)*S*T);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return (Math.exp(t)-Math.exp(-t))/2}function z(t){return (Math.exp(t)+Math.exp(-t))/2}var L=P(0),A=function(t){return z(L)/z(L+b*t)},D=function(t){return w*((z(L)*(M(e=L+b*t)/z(e))-M(L))/S)/T;var e;},R=(P(1)-L)/b;if(Math.abs(T)<1e-6||!isFinite(R)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,i);var k=E<w?-1:1;R=Math.abs(Math.log(E/w))/b,D=function(){return 0},A=function(t){return Math.exp(k*b*t)};}return e.duration="duration"in e?+e.duration:1e3*R/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=p!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(i,!1),this._ease((function(e){var o=e*R,_=1/A(o);n.zoom=1===e?h:a+n.scaleZoom(_),r._rotating&&(n.bearing=t.number(s,u,e)),r._pitching&&(n.pitch=t.number(l,p,e)),r._padding&&(n.interpolatePadding(c,d,e),m=n.centerPoint.add(f));var g=1===e?v:n.unproject(y.add(x.mult(D(o))).mult(_));n.setLocationAtPoint(n.renderWorldCopies?g.wrap():g,m),r._fireMoveEvents(i);}),(function(){return r._afterEase(i)}),e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this);}return this},i.prototype._ease=function(e,i,r){!1===r.animate||0===r.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var r=Math.abs(e-i);return Math.abs(e-360-i)<r&&(e-=360),Math.abs(e+360-i)<r&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0;}},i}(t.Evented),Fr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};Fr.prototype.getDefaultPosition=function(){return "bottom-right"},Fr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=i.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Fr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0;},Fr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var r=i.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow";}},Fr.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink());},Fr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return "string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id;}var i=this._map.style.sourceCaches;for(var r in i){var o=i[r];if(o.used){var n=o.getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution);}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,i){for(var r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return !1;return !0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null);}},Fr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Ur=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Ur.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ur.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Ur.prototype.getDefaultPosition=function(){return "bottom-left"},Ur.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Ur.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return !0;return !1}},Ur.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact");}};var Nr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};Nr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Nr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;i<r.length;i+=1){var o=r[i];if(o.id===t)return void(o.cancelled=!0)}},Nr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!r.cancelled&&(r.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1;},Nr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[];};var Zr={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},jr=t.window.HTMLImageElement,qr=t.window.HTMLElement,Vr=t.window.ImageBitmap,Gr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Wr=function(r){function o(e){var o=this;if(null!=(e=t.extend({},Gr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var n=new yr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,n,e),this.crs=this.initCRS(e.crs),this.setCRS(this.crs),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Nr,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Zr,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else {if(!(e.container instanceof qr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return o._update(!1)})),this.on("moveend",(function(){return o._update(!1)})),this.on("zoom",(function(){return o._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),o=null,n=!1,a=null;for(var s in Br)t[s]=new Br[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);i.addEventListener(r,"mouseout",(function(e){t.fire(new wr("mouseout",t,e));})),i.addEventListener(r,"mousedown",(function(o){n=!0,a=i.mousePos(r,o);var s=new wr("mousedown",t,o);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(o),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(o),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(o));})),i.addEventListener(r,"mouseup",(function(e){var i=t.dragRotate.isActive();o&&!i&&t.fire(new wr("contextmenu",t,o)),o=null,n=!1,t.fire(new wr("mouseup",t,e));})),i.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new wr("mousemove",t,e));}})),i.addEventListener(r,"mouseover",(function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new wr("mouseover",t,e));})),i.addEventListener(r,"touchstart",(function(i){var r=new Er("touchstart",t,i);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(i),t.touchZoomRotate.onStart(i),t.doubleClickZoom.onTouchStart(r));}),{passive:!1}),i.addEventListener(r,"touchmove",(function(e){t.fire(new Er("touchmove",t,e));}),{passive:!1}),i.addEventListener(r,"touchend",(function(e){t.fire(new Er("touchend",t,e));})),i.addEventListener(r,"touchcancel",(function(e){t.fire(new Er("touchcancel",t,e));})),i.addEventListener(r,"click",(function(o){var n=i.mousePos(r,o);(!a||n.equals(a)||n.dist(a)<e.clickTolerance)&&t.fire(new wr("click",t,o));})),i.addEventListener(r,"dblclick",(function(e){var i=new wr("dblclick",t,e);t.fire(i),i.defaultPrevented||t.doubleClickZoom.onDblClick(i);})),i.addEventListener(r,"contextmenu",(function(e){var i=t.dragRotate.isActive();n||i?n&&(o=e):t.fire(new wr("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault();})),i.addEventListener(r,"wheel",(function(i){e.interactive&&t.stop();var r=new Tr("wheel",t,i);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(i);}),{passive:!1});}(this,e),this._hash=e.hash&&new br("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Fr({customAttribution:e.customAttribution})),this.addControl(new Ur,e.logoPosition),this.on("style.load",(function(){o.transform.unmodified&&o.jumpTo(o.style.stylesheet);})),this.on("data",(function(e){o._update("style"===e.dataType),o.fire(new t.Event(e.dataType+"data",e));})),this.on("dataloading",(function(e){o.fire(new t.Event(e.dataType+"dataloading",e));})),this.overlayLayersManager={};}r&&(o.__proto__=r),(o.prototype=Object.create(r&&r.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(r,o.firstChild):o.appendChild(r),this},o.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},o.prototype.resize=function(e){var i=this._containerDimensions(),r=i[0],o=i[1];return this._resizeCanvas(r,o),this.transform.resize(r,o),this.painter.resize(r,o),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},o.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},o.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},o.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},o.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},o.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},o.prototype._createDelegatedListener=function(t,e,i){var r,o=this;if("mouseenter"===t||"mouseover"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){var a=o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(o,new wr(t,o,r.originalEvent,{features:a}))):n=!1;},mouseout:function(){n=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){(o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(o,new wr(t,o,r.originalEvent)));},mouseout:function(e){a&&(a=!1,i.call(o,new wr(t,o,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(o,t),delete t.features);},r)}},o.prototype.on=function(t,e,i){if(void 0===i)return r.prototype.on.call(this,t,e);var o=this._createDelegatedListener(t,e,i);for(var n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(n,o.delegates[n]);return this},o.prototype.once=function(t,e,i){if(void 0===i)return r.prototype.once.call(this,t,e);var o=this._createDelegatedListener(t,e,i);for(var n in o.delegates)this.once(n,o.delegates[n]);return this},o.prototype.off=function(t,e,i){var o=this;return void 0===i?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var n=r[t],a=0;a<n.length;a++){var s=n[a];if(s.layer===e&&s.listener===i){for(var l in s.delegates)o.off(l,s.delegates[l]);return n.splice(a,1),o}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return [];var r;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else {var o=t.Point.convert(e[0]),n=t.Point.convert(e[1]);r=[o,new t.Point(n.x,o.y),n,new t.Point(o.x,n.y),o];}return this.style.queryRenderedFeatures(r,i,this.transform)},o.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},o.prototype.setStyle=function(e,i){return !1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(e,i))},o.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},o.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Ze(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ze(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty());},o.prototype._diffStyle=function(e,i){var r=this;if("string"==typeof e){var o=this._requestManager.normalizeStyleURL(e),n=this._requestManager.transformRequest(o,t.ResourceType.Style);t.getJSON(n,(function(e,o){e?r.fire(new t.ErrorEvent(e)):o&&r._updateDiff(o,i);}));}else "object"==typeof e&&this._updateDiff(e,i);},o.prototype._updateDiff=function(e,i){try{this.style.setState(e)&&this._update(!0);}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(e,i);}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},o.prototype.isSourceLoaded=function(e){var i=this.style&&this.style.sourceCaches[e];if(void 0!==i)return i.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")));},o.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var r in i){var o=i[r];if("loaded"!==o.state&&"errored"!==o.state)return !1}}return !0},o.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},o.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},o.prototype.getSource=function(t){return this.style.getSource(t)},o.prototype.addImage=function(e,i,r){void 0===r&&(r={});var o=r.pixelRatio;void 0===o&&(o=1);var n=r.sdf;void 0===n&&(n=!1);var a=r.stretchX,s=r.stretchY,l=r.content;if(this._lazyInitEmptyStyle(),i instanceof jr||Vr&&i instanceof Vr){var c=t.browser.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:c.width,height:c.height},c.data),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0});}else {if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var h=i;this.style.addImage(e,{data:new t.RGBAImage({width:i.width,height:i.height},new Uint8Array(i.data)),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0,userImage:h}),h.onAdd&&h.onAdd(this,e);}},o.prototype.updateImage=function(e,i){var r=this.style.getImage(e);if(!r)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var o=i instanceof jr||Vr&&i instanceof Vr?t.browser.getImageData(i):i,n=o.width,a=o.height,s=o.data;return void 0===n||void 0===a?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):n!==r.data.width||a!==r.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(s,!(i instanceof jr||Vr&&i instanceof Vr)),void this.style.updateImage(e,r))},o.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(t){this.style.removeImage(t);},o.prototype.loadImage=function(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),i);},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayerBak=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},o.prototype._addLayer=function(t,e){t.onAdd&&t.onAdd(e);},o.prototype._removeLayer=function(t){t.removeFromMap&&t.removeFromMap();},o.prototype._setVisibility=function(t,e){t.setVisibility&&t.setVisibility(e);},o.prototype._moveLayer=function(e,i){var r=document.getElementById(e);if(i){var o=document.getElementById(i);o||t.window.mapboxgl.Evented.prototype.fire("error",{error:new Error('Layer with id "'+i+'" does not exist on this document.')});}r&&o?o.parentNode.insertBefore(r,o):r.parentNode.appendChild(r);},o.prototype.addLayer=function(t,e){return t.source||"custom"===t.type||"background"===t.type?(this.addLayerBak(t,e),this):this.overlayLayersManager[t.id]||this.style._layers[t.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(this._addLayer(t,this),this.overlayLayersManager[t.id]=t,this)},o.prototype.moveLayer=function(t,e){return this.overlayLayersManager[t]?(this._moveLayer(t,e),this):this.style._layers[t]?(this.style.moveLayer(t,e),this._update(!0),this):void 0},o.prototype.removeLayer=function(t){return this.overlayLayersManager[t]?(this._removeLayer(this.overlayLayersManager[t]),delete this.overlayLayersManager[t],this):(this.style.removeLayer(t),this._update(!0),this)},o.prototype.getLayer=function(t){return this.overlayLayersManager[t]?this.overlayLayersManager[t]:this.style.getLayer(t)},o.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},o.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},o.prototype.getFilter=function(t){return this.style.getFilter(t)},o.prototype.setPaintProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,i,r),this._update(!0)},o.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},o.prototype.setLayoutProperty=function(t,e,i,r){return void 0===r&&(r={}),this.overlayLayersManager[t]?("visibility"===e&&(this._setVisibility(this.overlayLayersManager[t],i="visible"===i),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(t,e,i,r),this._update(!0),this)},o.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},o.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},o.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},o.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},o.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.");},o.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=i.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=i.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=i.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var o=this._controlContainer=i.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=i.create("div","mapboxgl-ctrl-"+t,o);}));},o.prototype._resizeCanvas=function(e,i){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px";},o.prototype._setupPainter=function(){var i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);r?(this.painter=new fr(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));},o.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}));},o.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}));},o.prototype.loaded=function(){return !this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},o.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t);},o.prototype._render=function(){var e,i=this,r=0,o=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(e=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,e),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,s=t.browser.now();this.style.zoomHistory.update(a,s);var l=new t.EvaluationParameters(a,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=l.crossFadingFactor();1===c&&c===this._crossFadingFactor||(n=!0,this._crossFadingFactor=c),this.style.update(l);}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;o.endQueryEXT(o.TIME_ELAPSED_EXT,e),setTimeout((function(){var r=o.getQueryObjectEXT(e,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(e),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:r}));}),50);}if(this.listens("gpu-timing-layer")){var u=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(u);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}));}),50);}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new t.Event("idle"))),this},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,i=this._controls;e<i.length;e+=1)i[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Xr(this._canvasContainer),Xr(this._controlContainer),Xr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"));},o.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render();})));},o.prototype._onWindowOnline=function(){this._update();},o.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update();},n.showTileBoundaries.get=function(){return !!this._showTileBoundaries},n.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update());},n.showPadding.get=function(){return !!this._showPadding},n.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update());},n.showCollisionBoxes.get=function(){return !!this._showCollisionBoxes},n.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update());},n.showOverdrawInspector.get=function(){return !!this._showOverdrawInspector},n.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update());},n.repaint.get=function(){return !!this._repaint},n.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint());},n.vertices.get=function(){return !!this._vertices},n.vertices.set=function(t){this._vertices=t,this._update();},o.prototype._setCacheLimits=function(e,i){t.setCacheLimits(e,i);},o.prototype.initCRS=function(e){if(e&&"string"==typeof e&&!(e=t.CRS.get(e)))throw new Error("crs "+e+" is not define");return e||t.CRS.EPSG3857},o.prototype.getCRS=function(){return this.crs},o.prototype.setCRS=function(e){if(e!==t.CRS.EPSG3857){this._tileExtent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],this._mapCRS=e;var i=e.getExtent();if(i&&Array.isArray(i)&&4===i.length){this._tileExtent=i;var r=this._tileExtent[2]-this._tileExtent[0],o=this._tileExtent[3]-this._tileExtent[1],n=(this._tileExtent[2]+this._tileExtent[0])/2,a=(this._tileExtent[3]+this._tileExtent[1])/2,s=this._tileExtent[0],l=this._tileExtent[3];t.RasterTileSource.prototype.getMeterPerMapUnit=function(t){return "degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},t.RasterTileSource.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e;}return this._resolutions[t]},t.RasterTileSource.prototype.getScale=function(t,i){if(!this._scales[t]){var r=96*this.getResolution(t,i)*(1/.0254)*this.getMeterPerMapUnit(e.getUnit());this._scales[t]=1/r;}return this._scales[t]},C.prototype.getMeterPerMapUnit=function(t){return "degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},C.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e;}return this._resolutions[t]},C.prototype.getScale=function(t,i){if(!this._scales[t]){var r=96*this.getResolution(t,i)*(1/.0254)*this.getMeterPerMapUnit(e.getUnit());this._scales[t]=1/r;}return this._scales[t]},R.prototype.getMeterPerMapUnit=function(t){return "degree"===t||"degrees"===t||"d"===t?2*Math.PI*6378137/360:"kilometer"===t||"km"===t?.001:"inch"===t?1/.025399999918:.3048},R.prototype.getResolution=function(t,e){if(!this._resolutions[t]){var i=Math.pow(2,t);this._resolutions[t]=r/i/e;}return this._resolutions[t]},R.prototype.getScale=function(t,i){if(!this._scales[t]){var r=96*this.getResolution(t,i)*(1/.0254)*this.getMeterPerMapUnit(e.getUnit());this._scales[t]=1/r;}return this._scales[t]},R.prototype.getCrs=function(t,e){return "EPSG:4326"},t.CanonicalTileID.prototype.getTileBBox=function(){var t=Math.max(r,o)/Math.pow(2,this.z);return t*this.x+i[0]+","+(i[3]-t*(this.y+1))+","+(t*(this.x+1)+i[0])+","+(i[3]-t*this.y)},t.CanonicalTileID.prototype.getViewBounds=function(){var t=Math.pow(2,this.z);return '{"leftBottom":{"x":'+(i[0]+r*this.x/t)+',"y":'+(i[3]-o*(this.y+1)/t)+'},"rightTop":{"x":'+(i[0]+r*(this.x+1)/t)+',"y": '+(i[3]-o*this.y/t)+"}}"},t.CanonicalTileID.prototype.getCRS=function(){return t.CRS.EPSG4326},yr.prototype.lngX=function(t){return (t-s)*this.worldSize/r},yr.prototype.latY=function(t){return (l-t)*this.worldSize/o},yr.prototype.xLng=function(t){return t*r/this.worldSize+s},yr.prototype.yLat=function(t){return l-t*o/this.worldSize},t.TileBounds.prototype.contains=function(t){var e=Math.pow(2,t.z),i=Math.floor((this.bounds.getWest()-s)*e/r),n=Math.floor((l-this.bounds.getNorth())*e/o),a=Math.ceil((this.bounds.getEast()-s)*e/r),c=Math.ceil((l-this.bounds.getSouth())*e/o);return t.x>=i&&t.x<a&&t.y>=n&&t.y<c},t.GeoJSONFeature.prototype.yLat=function(t,e){return l-t*o/e},t.GeoJSONFeature.prototype.latY=function(t){return (l-t)*this.worldSize/o},this.updateTransform&&(this.mercatorZfromAltitude=t.mercatorZfromAltitude,this.updateTransform(e.getUnit(),s,l,n,a,r,o));}}},o.prototype.updateTransform=function(e,i,r,o,n,a,s){this.transform.units=e,this.transform.latRange=[this._tileExtent[1],this._tileExtent[3]],this.transform.lngRange=[this._tileExtent[0],this._tileExtent[2]];var l=this.mercatorZfromAltitude;t.MercatorCoordinate.fromLngLat=function(e,o){o=o||0;var n=t.LngLat.convert(e);return n.lng&&n.lat?new t.MercatorCoordinate((n.lng-i)/a,(r-n.lat)/s,l(o,n.lat)):new t.MercatorCoordinate(t.mercatorXfromLng(0),t.mercatorYfromLat(0),0)},t.MercatorCoordinate.prototype.toLngLat=function(){var e=r-this.y*s;if(e<=90&&e>=-90)return new t.LngLat(this.x*a+i,r-this.y*s)},this.customConvertPoint=t.window.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+o+") / "+a+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+n+") / "+s+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+s+"+"+n+";}}"],{type:"text/javascript"}));},n.version.get=function(){return t.version},Object.defineProperties(o.prototype,n),o}(Or);function Xr(t){t.parentNode&&t.parentNode.removeChild(t);}var Hr=function(t,e,i,r){for(var o=65535&t|0,n=t>>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{n=n+(o=o+e[r++]|0)|0;}while(--a);o%=65521,n%=65521;}return o|n<<16|0},Kr=new Uint32Array(function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t;}return e}()),Yr=function(t,e,i,r){var o=Kr,n=r+i;t^=-1;for(var a=r;a<n;a++)t=t>>>8^o[255&(t^e[a])];return -1^t},Jr=function(t,e){var i,r,o,n,a,s,l,c,h,u,p,d,_,f,m,g,v,y,x,b,w,E,T,C,I=t.state;T=t.input,r=(i=t.next_in)+(t.avail_in-5),C=t.output,n=(o=t.next_out)-(e-t.avail_out),a=o+(t.avail_out-257),s=I.dmax,l=I.wsize,c=I.whave,h=I.wnext,u=I.window,p=I.hold,d=I.bits,_=I.lencode,f=I.distcode,m=(1<<I.lenbits)-1,g=(1<<I.distbits)-1;t:do{d<15&&(p+=T[i++]<<d,p+=T[i++]<<(d+=8),d+=8),v=_[p&m];e:for(;;){if(p>>>=y=v>>>24,d-=y,0==(y=v>>>16&255))C[o++]=65535&v;else {if(!(16&y)){if(0==(64&y)){v=_[(65535&v)+(p&(1<<y)-1)];continue e}if(32&y){I.mode=16191;break t}t.msg="invalid literal/length code",I.mode=16209;break t}x=65535&v,(y&=15)&&(d<y&&(p+=T[i++]<<d,d+=8),x+=p&(1<<y)-1,p>>>=y,d-=y),d<15&&(p+=T[i++]<<d,p+=T[i++]<<(d+=8),d+=8),v=f[p&g];i:for(;;){if(p>>>=y=v>>>24,d-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=f[(65535&v)+(p&(1<<y)-1)];continue i}t.msg="invalid distance code",I.mode=16209;break t}if(b=65535&v,d<(y&=15)&&(p+=T[i++]<<d,(d+=8)<y&&(p+=T[i++]<<d,d+=8)),(b+=p&(1<<y)-1)>s){t.msg="invalid distance too far back",I.mode=16209;break t}if(p>>>=y,d-=y,b>(y=o-n)){if((y=b-y)>c&&I.sane){t.msg="invalid distance too far back",I.mode=16209;break t}if(w=0,E=u,0===h){if(w+=l-y,y<x){x-=y;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}}else if(h<y){if(w+=l+h-y,(y-=h)<x){x-=y;do{C[o++]=u[w++];}while(--y);if(w=0,h<x){x-=y=h;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}}}else if(w+=h-y,y<x){x-=y;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}for(;x>2;)C[o++]=E[w++],C[o++]=E[w++],C[o++]=E[w++],x-=3;x&&(C[o++]=E[w++],x>1&&(C[o++]=E[w++]));}else {w=o-b;do{C[o++]=C[w++],C[o++]=C[w++],C[o++]=C[w++],x-=3;}while(x>2);x&&(C[o++]=C[w++],x>1&&(C[o++]=C[w++]));}break}}break}}while(i<r&&o<a);p&=(1<<(d-=(x=d>>3)<<3))-1,t.next_in=i-=x,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),I.hold=p,I.bits=d;},Qr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),$r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),to=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),eo=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),io=function(t,e,i,r,o,n,a,s){var l,c,h,u,p,d,_,f,m,g=s.bits,v=0,y=0,x=0,b=0,w=0,E=0,T=0,C=0,I=0,S=0,P=null,M=new Uint16Array(16),z=new Uint16Array(16),L=null;for(v=0;v<=15;v++)M[v]=0;for(y=0;y<r;y++)M[e[i+y]]++;for(w=g,b=15;b>=1&&0===M[b];b--);if(w>b&&(w=b),0===b)return o[n++]=20971520,o[n++]=20971520,s.bits=1,0;for(x=1;x<b&&0===M[x];x++);for(w<x&&(w=x),C=1,v=1;v<=15;v++)if(C<<=1,(C-=M[v])<0)return -1;if(C>0&&(0===t||1!==b))return -1;for(z[1]=0,v=1;v<15;v++)z[v+1]=z[v]+M[v];for(y=0;y<r;y++)0!==e[i+y]&&(a[z[e[i+y]]++]=y);if(0===t?(P=L=a,d=20):1===t?(P=Qr,L=$r,d=257):(P=to,L=eo,d=0),S=0,y=0,v=x,p=n,E=w,T=0,h=-1,u=(I=1<<w)-1,1===t&&I>852||2===t&&I>592)return 1;for(;;){_=v-T,a[y]+1<d?(f=0,m=a[y]):a[y]>=d?(f=L[a[y]-d],m=P[a[y]-d]):(f=96,m=0),l=1<<v-T,x=c=1<<E;do{o[p+(S>>T)+(c-=l)]=_<<24|f<<16|m|0;}while(0!==c);for(l=1<<v-1;S&l;)l>>=1;if(0!==l?(S&=l-1,S+=l):S=0,y++,0==--M[v]){if(v===b)break;v=e[i+a[y]];}if(v>w&&(S&u)!==h){for(0===T&&(T=w),p+=x,C=1<<(E=v-T);E+T<b&&!((C-=M[E+T])<=0);)E++,C<<=1;if(I+=1<<E,1===t&&I>852||2===t&&I>592)return 1;o[h=S&u]=w<<24|E<<16|p-n|0;}}return 0!==S&&(o[p+S]=v-T<<24|64<<16|0),s.bits=w,0},ro={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},oo=ro.Z_FINISH,no=ro.Z_BLOCK,ao=ro.Z_TREES,so=ro.Z_OK,lo=ro.Z_STREAM_END,co=ro.Z_NEED_DICT,ho=ro.Z_STREAM_ERROR,uo=ro.Z_DATA_ERROR,po=ro.Z_MEM_ERROR,_o=ro.Z_BUF_ERROR,fo=ro.Z_DEFLATED,mo=function(t){return (t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function go(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}var vo,yo,xo=function(t){if(!t)return 1;var e=t.state;return !e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},bo=function(t){if(xo(t))return ho;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,function(t){if(xo(t))return ho;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,so}(t)},wo=!0,Eo=function(t){if(wo){vo=new Int32Array(512),yo=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(io(1,t.lens,0,288,vo,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;io(2,t.lens,0,32,yo,0,t.work,{bits:5}),wo=!1;}t.lencode=vo,t.lenbits=9,t.distcode=yo,t.distbits=5;},To=function(t,e,i,r){var o,n=t.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(e.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):((o=n.wsize-n.wnext)>r&&(o=r),n.window.set(e.subarray(i-r,i-r+o),n.wnext),(r-=o)?(n.window.set(e.subarray(i-r,i),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=o,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=o))),0},Co=bo,Io=function(t,e){if(!t)return ho;var i=new go;t.state=i,i.strm=t,i.window=null,i.mode=16180;var r=function(t,e){var i;if(xo(t))return ho;var r=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ho:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,bo(t))}(t,e);return r!==so&&(t.state=null),r},So=function(t,e){var i,r,o,n,a,s,l,c,h,u,p,d,_,f,m,g,v,y,x,b,w,E,T,C,I=0,S=new Uint8Array(4),P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(xo(t)||!t.output||!t.input&&0!==t.avail_in)return ho;16191===(i=t.state).mode&&(i.mode=16192),a=t.next_out,o=t.output,n=t.next_in,r=t.input,c=i.hold,h=i.bits,u=s=t.avail_in,p=l=t.avail_out,E=so;t:for(;;)switch(i.mode){case 16180:if(0===i.wrap){i.mode=16192;break}for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(2&i.wrap&&35615===c){0===i.wbits&&(i.wbits=15),i.check=0,S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0),c=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",i.mode=16209;break}if((15&c)!==fo){t.msg="unknown compression method",i.mode=16209;break}if(h-=4,w=8+(15&(c>>>=4)),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){t.msg="invalid window size",i.mode=16209;break}i.dmax=1<<i.wbits,i.flags=0,t.adler=i.check=1,i.mode=512&c?16189:16191,c=0,h=0;break;case 16181:for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(i.flags=c,(255&i.flags)!==fo){t.msg="unknown compression method",i.mode=16209;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=16209;break}i.head&&(i.head.text=c>>8&1),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.head&&(i.head.time=c),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,i.check=Yr(i.check,S,4,0)),c=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.head&&(i.head.xflags=255&c,i.head.os=c>>8),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.length=c,i.head&&(i.head.extra_len=c),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0;}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&((d=i.length)>s&&(d=s),d&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(n,n+d),w)),512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,i.length-=d),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===s)break t;d=0;do{w=r[n+d++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w));}while(w&&d<s);if(512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,w)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===s)break t;d=0;do{w=r[n+d++],i.head&&w&&i.length<65536&&(i.head.comment+=String.fromCharCode(w));}while(w&&d<s);if(512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,w)break t}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(4&i.wrap&&c!==(65535&i.check)){t.msg="header crc mismatch",i.mode=16209;break}c=0,h=0;}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=16191;break;case 16189:for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}t.adler=i.check=mo(c),c=0,h=0,i.mode=16190;case 16190:if(0===i.havedict)return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,co;t.adler=i.check=1,i.mode=16191;case 16191:if(e===no||e===ao)break t;case 16192:if(i.last){c>>>=7&h,h-=7&h,i.mode=16206;break}for(;h<3;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}switch(i.last=1&c,h-=1,3&(c>>>=1)){case 0:i.mode=16193;break;case 1:if(Eo(i),i.mode=16199,e===ao){c>>>=2,h-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=16209;}c>>>=2,h-=2;break;case 16193:for(c>>>=7&h,h-=7&h;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",i.mode=16209;break}if(i.length=65535&c,c=0,h=0,i.mode=16194,e===ao)break t;case 16194:i.mode=16195;case 16195:if(d=i.length){if(d>s&&(d=s),d>l&&(d=l),0===d)break t;o.set(r.subarray(n,n+d),a),s-=d,n+=d,l-=d,a+=d,i.length-=d;break}i.mode=16191;break;case 16196:for(;h<14;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(i.nlen=257+(31&c),h-=5,i.ndist=1+(31&(c>>>=5)),h-=5,i.ncode=4+(15&(c>>>=5)),c>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=16209;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.lens[P[i.have++]]=7&c,c>>>=3,h-=3;}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,E=io(0,i.lens,0,19,i.lencode,0,i.work,T={bits:i.lenbits}),i.lenbits=T.bits,E){t.msg="invalid code lengths set",i.mode=16209;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;g=(I=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(v<16)c>>>=m,h-=m,i.lens[i.have++]=v;else {if(16===v){for(C=m+2;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(c>>>=m,h-=m,0===i.have){t.msg="invalid bit length repeat",i.mode=16209;break}w=i.lens[i.have-1],d=3+(3&c),c>>>=2,h-=2;}else if(17===v){for(C=m+3;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}h-=m,w=0,d=3+(7&(c>>>=m)),c>>>=3,h-=3;}else {for(C=m+7;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}h-=m,w=0,d=11+(127&(c>>>=m)),c>>>=7,h-=7;}if(i.have+d>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=16209;break}for(;d--;)i.lens[i.have++]=w;}}if(16209===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=16209;break}if(i.lenbits=9,E=io(1,i.lens,0,i.nlen,i.lencode,0,i.work,T={bits:i.lenbits}),i.lenbits=T.bits,E){t.msg="invalid literal/lengths set",i.mode=16209;break}if(i.distbits=6,i.distcode=i.distdyn,E=io(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,T={bits:i.distbits}),i.distbits=T.bits,E){t.msg="invalid distances set",i.mode=16209;break}if(i.mode=16199,e===ao)break t;case 16199:i.mode=16200;case 16200:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,Jr(t,p),a=t.next_out,o=t.output,l=t.avail_out,n=t.next_in,r=t.input,s=t.avail_in,c=i.hold,h=i.bits,16191===i.mode&&(i.back=-1);break}for(i.back=0;g=(I=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(g&&0==(240&g)){for(y=m,x=g,b=v;g=(I=i.lencode[b+((c&(1<<y+x)-1)>>y)])>>>16&255,v=65535&I,!(y+(m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}c>>>=y,h-=y,i.back+=y;}if(c>>>=m,h-=m,i.back+=m,i.length=v,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=16191;break}if(64&g){t.msg="invalid literal/length code",i.mode=16209;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(C=i.extra;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra;}i.was=i.length,i.mode=16202;case 16202:for(;g=(I=i.distcode[c&(1<<i.distbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(0==(240&g)){for(y=m,x=g,b=v;g=(I=i.distcode[b+((c&(1<<y+x)-1)>>y)])>>>16&255,v=65535&I,!(y+(m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}c>>>=y,h-=y,i.back+=y;}if(c>>>=m,h-=m,i.back+=m,64&g){t.msg="invalid distance code",i.mode=16209;break}i.offset=v,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(C=i.extra;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra;}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=16209;break}i.mode=16204;case 16204:if(0===l)break t;if(i.offset>(d=p-l)){if((d=i.offset-d)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=16209;break}_=d>i.wnext?i.wsize-(d-=i.wnext):i.wnext-d,d>i.length&&(d=i.length),f=i.window;}else f=o,_=a-i.offset,d=i.length;d>l&&(d=l),l-=d,i.length-=d;do{o[a++]=f[_++];}while(--d);0===i.length&&(i.mode=16200);break;case 16205:if(0===l)break t;o[a++]=i.length,l--,i.mode=16200;break;case 16206:if(i.wrap){for(;h<32;){if(0===s)break t;s--,c|=r[n++]<<h,h+=8;}if(t.total_out+=p-=l,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Yr(i.check,o,p,a-p):Hr(i.check,o,p,a-p)),p=l,4&i.wrap&&(i.flags?c:mo(c))!==i.check){t.msg="incorrect data check",i.mode=16209;break}c=0,h=0;}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(4&i.wrap&&c!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=16209;break}c=0,h=0;}i.mode=16208;case 16208:E=lo;break t;case 16209:E=uo;break t;case 16210:return po;case 16211:default:return ho}return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,(i.wsize||p!==t.avail_out&&i.mode<16209&&(i.mode<16206||e!==oo))&&To(t,t.output,t.next_out,p-t.avail_out),p-=t.avail_out,t.total_in+=u-=t.avail_in,t.total_out+=p,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Yr(i.check,o,p,t.next_out-p):Hr(i.check,o,p,t.next_out-p)),t.data_type=i.bits+(i.last?64:0)+(16191===i.mode?128:0)+(16199===i.mode||16194===i.mode?256:0),(0===u&&0===p||e===oo)&&E===so&&(E=_o),E},Po=function(t){if(xo(t))return ho;var e=t.state;return e.window&&(e.window=null),t.state=null,so},Mo=function(t,e){var i,r=e.length;return xo(t)||0!==(i=t.state).wrap&&16190!==i.mode?ho:16190===i.mode&&Hr(1,e,r,0)!==i.check?uo:To(t,e,r,r)?(i.mode=16210,po):(i.havedict=1,so)},zo=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Lo=!0;try{String.fromCharCode.apply(null,new Uint8Array(1));}catch(t){Lo=!1;}for(var Ao=new Uint8Array(256),Do=0;Do<256;Do++)Ao[Do]=Do>=252?6:Do>=248?5:Do>=240?4:Do>=224?3:Do>=192?2:1;Ao[254]=Ao[254]=1;var Ro=function(t,e){var i,r,o=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return (new TextDecoder).decode(t.subarray(0,e));var n=new Array(2*o);for(r=0,i=0;i<o;){var a=t[i++];if(a<128)n[r++]=a;else {var s=Ao[a];if(s>4)n[r++]=65533,i+=s-1;else {for(a&=2===s?31:3===s?15:7;s>1&&i<o;)a=a<<6|63&t[i++],s--;s>1?n[r++]=65533:a<65536?n[r++]=a:(n[r++]=55296|(a-=65536)>>10&1023,n[r++]=56320|1023&a);}}}return function(t,e){if(e<65534&&t.subarray&&Lo)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var i="",r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i}(n,r)},ko=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Ao[t[i]]>e?i:e},Bo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Oo=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;},Fo=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1;},Uo=Object.prototype.toString,No=ro.Z_NO_FLUSH,Zo=ro.Z_FINISH,jo=ro.Z_OK,qo=ro.Z_STREAM_END,Vo=ro.Z_NEED_DICT,Go=ro.Z_STREAM_ERROR,Wo=ro.Z_DATA_ERROR,Xo=ro.Z_MEM_ERROR;function Ho(t){this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)zo(i,r)&&(t[r]=i[r]);}}return t}({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oo,this.strm.avail_out=0;var i=Io(this.strm,e.windowBits);if(i!==jo)throw new Error(Bo[i]);if(this.header=new Fo,function(t,e){if(xo(t))return ho;var i=t.state;0==(2&i.wrap)||(i.head=e,e.done=!1);}(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return (new TextEncoder).encode(t);var e,i,r,o,n,a=t.length,s=0;for(o=0;o<a;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),s+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(s),n=0,o=0;n<s;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?e[n++]=i:i<2048?(e[n++]=192|i>>>6,e[n++]=128|63&i):i<65536?(e[n++]=224|i>>>12,e[n++]=128|i>>>6&63,e[n++]=128|63&i):(e[n++]=240|i>>>18,e[n++]=128|i>>>12&63,e[n++]=128|i>>>6&63,e[n++]=128|63&i);return e}(e.dictionary):"[object ArrayBuffer]"===Uo.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Mo(this.strm,e.dictionary))!==jo))throw new Error(Bo[i])}function Ko(t,e){var i=new Ho(e);if(i.push(t),i.err)throw i.msg||Bo[i.err];return i.result}Ho.prototype.push=function(t,e){var i,r,o,n=this.strm,a=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return !1;for(r=e===~~e?e:!0===e?Zo:No,n.input="[object ArrayBuffer]"===Uo.call(t)?new Uint8Array(t):t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),(i=So(n,r))===Vo&&s&&((i=Mo(n,s))===jo?i=So(n,r):i===Wo&&(i=Vo));n.avail_in>0&&i===qo&&n.state.wrap>0&&0!==t[n.next_in];)Co(n),i=So(n,r);switch(i){case Go:case Wo:case Vo:case Xo:return this.onEnd(i),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||i===qo))if("string"===this.options.to){var l=ko(n.output,n.next_out),c=n.next_out-l,h=Ro(n.output,l);n.next_out=c,n.avail_out=a-c,c&&n.output.set(n.output.subarray(l,l+c),0),this.onData(h);}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==jo||0!==o){if(i===qo)return i=Po(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return !0},Ho.prototype.onData=function(t){this.chunks.push(t);},Ho.prototype.onEnd=function(t){t===jo&&(this.result="string"===this.options.to?this.chunks.join(""):function(t){for(var e=0,i=0,r=t.length;i<r;i++)e+=t[i].length;for(var o=new Uint8Array(e),n=0,a=0,s=t.length;n<s;n++){var l=t[n];o.set(l,a),a+=l.length;}return o}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};for(var Yo={Inflate:Ho,inflate:Ko,inflateRaw:function(t,e){return (e=e||{}).raw=!0,Ko(t,e)},ungzip:Ko,constants:ro},Jo=[],Qo=[],$o="undefined"!=typeof Uint8Array?Uint8Array:Array,tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en=0,rn=tn.length;en<rn;++en)Jo[en]=tn[en],Qo[tn.charCodeAt(en)]=en;function on(t,e,i){for(var r,o=[],n=e;n<i;n+=3)o.push(Jo[(r=(t[n]<<16&16711680)+(t[n+1]<<8&65280)+(255&t[n+2]))>>18&63]+Jo[r>>12&63]+Jo[r>>6&63]+Jo[63&r]);return o.join("")}Qo["-".charCodeAt(0)]=62,Qo["_".charCodeAt(0)]=63;var nn=function(t){var e,i,r=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return -1===i&&(i=e),[i,i===e?0:4-i%4]}(t),o=r[0],n=r[1],a=new $o(function(t,e,i){return 3*(e+i)/4-i}(0,o,n)),s=0,l=n>0?o-4:o;for(i=0;i<l;i+=4)e=Qo[t.charCodeAt(i)]<<18|Qo[t.charCodeAt(i+1)]<<12|Qo[t.charCodeAt(i+2)]<<6|Qo[t.charCodeAt(i+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===n&&(e=Qo[t.charCodeAt(i)]<<2|Qo[t.charCodeAt(i+1)]>>4,a[s++]=255&e),1===n&&(e=Qo[t.charCodeAt(i)]<<10|Qo[t.charCodeAt(i+1)]<<4|Qo[t.charCodeAt(i+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},an=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.dispatcher=r,this.setEventedParent(o),this.type="mbtiles",this.db=this.openDatabase(i.path);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.openDatabase=function(e){return t.Database.openDatabase(e)},i.prototype.copyDatabaseFile=function(e,i,r){return t.Database.copyDatabaseFile(e,i,r)},i.prototype.readTile=function(t,e,i,r){var o=[t,e,i];this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level=? AND tile_column=? AND tile_row=?",o,(function(t,e){if(e.rows.length){var i=e.rows.item(0).base64_tile_data,n=Yo.inflate(nn(i));r(void 0,function(t){for(var e,i=t.length,r=i%3,o=[],n=0,a=i-r;n<a;n+=16383)o.push(on(t,n,n+16383>a?a:n+16383));return 1===r?o.push(Jo[(e=t[i-1])>>2]+Jo[e<<4&63]+"=="):2===r&&o.push(Jo[(e=(t[i-2]<<8)+t[i-1])>>10]+Jo[e>>4&63]+Jo[e<<2&63]+"="),o.join("")}(n));}else r(new Error("tile "+o.join(",")+" not found"));}));}),(function(t){r(t);}));})).catch((function(t){r(t);}));},i.prototype.loadTile=function(t,e){var i=t.tileID.canonical,r=i.z>this.maxzoom?Math.pow(2,i.z-this.maxzoom):1,o=Math.min(i.z,this.maxzoom||i.z),n=i.x,a=Math.pow(2,o)-i.y-1;this.readTile(o,n,a,function(o,n){if(o)return e(o);if(void 0===n)return e(new Error("empty data"));var a={request:{url:"data:application/x-protobuf;base64,"+n},uid:t.uid,tileID:t.tileID,zoom:i.z,tileSize:this.tileSize*r,type:this.type,source:this.id,pixelRatio:window.devicePixelRatio||1,overscaling:r,showCollisionBoxes:this.map.showCollisionBoxes};function s(i,r){if(!t.aborted){if(i)return e(i);this.map._refreshExpiredTiles&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null);}}t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",a,s.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",a,s.bind(this)));}.bind(this));},i}(C),sn=function(e){var i=e.style,r=/^.+:\/\//,o=t.window.location.origin+t.window.location.pathname.split("/").slice(0,-1).join("/");return "sprite"in i&&!i.sprite.match(r)&&"glyphs"in i&&!i.glyphs.match(r)&&(i.sprite=o+"/"+i.sprite,i.glyphs=o+"/"+i.glyphs),console.log("获取离线显示配置",e),e},ln={showCompass:!0,showZoom:!0,visualizePitch:!1},cn=function(e){var r=this;this.options=t.extend({},ln,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return r._map.zoomIn({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return r._map.zoomOut({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:t}):r._map.resetNorth({},{originalEvent:t});})),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0));};function hn(e,i,r){if(e=new t.LngLat(e.lng,e.lat),i){var o=new t.LngLat(e.lng-360,e.lat),n=new t.LngLat(e.lng+360,e.lat),a=r.locationPoint(e).distSqr(i);r.locationPoint(o).distSqr(i)<a?e=o:r.locationPoint(n).distSqr(i)<a&&(e=n);}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360;}return e}cn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom();},cn.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t;},cn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Pr(t,{button:"left",element:this._compass,clickTolerance:t.dragRotate._clickTolerance}),i.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},cn.prototype.onRemove=function(){i.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),i.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map;},cn.prototype._createButton=function(t,e){var r=i.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},cn.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i);};var un={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 pn(t,e,i){var r=t.classList;for(var o in un)r.remove("mapboxgl-"+i+"-anchor-"+o);r.add("mapboxgl-"+i+"-anchor-"+e);}var dn,_n=function(e){function r(r,o){var n=this;if(e.call(this),(r instanceof t.window.HTMLElement||o)&&(r=t.extend({element:r},o)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else {this._defaultMarker=!0,this._element=i.create("div"),this._element.setAttribute("aria-label","Map marker");var a=i.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=i.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var c=i.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var h=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];h<u.length;h+=1){var p=u[h],d=i.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",p.rx),d.setAttributeNS(null,"ry",p.ry),c.appendChild(d);}var _=i.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"fill",this._color);var f=i.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),_.appendChild(f);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=i.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(g);var v=i.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var y=i.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=i.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=i.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),y.appendChild(x),y.appendChild(b),l.appendChild(c),l.appendChild(_),l.appendChild(m),l.appendChild(v),l.appendChild(y),a.appendChild(l),this._element.appendChild(a),this._offset=t.Point.convert(r&&r.offset||[0,-14]);}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault();})),this._element.addEventListener("mousedown",(function(t){t.preventDefault();})),this._element.addEventListener("focus",(function(){var t=n._map.getContainer();t.scrollTop=0,t.scrollLeft=0;})),pn(this._element,this._anchor,"marker"),this._popup=null;}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},r.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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),i.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset;}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress);}return this},r.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup();},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup();},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=hn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,un[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+e);}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"));},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive";},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),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));},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),fn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},mn=0,gn=!1,vn=function(e){function r(i){e.call(this),this.options=t.extend({},fn,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this);}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==dn?r(dn):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){r(dn="denied"!==t.state);})):r(dn=!!t.window.navigator.geolocation),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,mn=0,gn=!1;},r.prototype._isOutOfMapMaxBounds=function(t){var 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())},r.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");}},r.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();}},r.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,o=this._map.getBearing(),n=t.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(r),n,{geolocateSource:!0});},r.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(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.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove();},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),o=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=o+"px",this._circleElement.style.height=o+"px";},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();},r.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch();}else {if(3===e.code&&gn)return;this._setErrorState();}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish();}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0;},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o);}else {var n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n);}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new _n(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new _n({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")));}));},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":mn--,gn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++mn>1?(e={maximumAge:6e5,timeout:0},gn=!0):(e=this.options.positionOptions,gn=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e);}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return !0},r.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},r}(t.Evented),yn={maxWidth:100,unit:"metric"},xn=function(e){this.options=t.extend({},yn,e),t.bindAll(["_onMove","setUnit"],this);};function bn(t,e,i){var r=i&&i.maxWidth||100,o=t._container.clientHeight/2,n=t.unproject([0,o]),a=t.unproject([r,o]),s=n.distanceTo(a);if(i&&"imperial"===i.unit){var l=3.2808*s;l>5280?wn(e,r,l/5280,t._getUIString("ScaleControl.Miles")):wn(e,r,l,t._getUIString("ScaleControl.Feet"));}else i&&"nautical"===i.unit?wn(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?wn(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):wn(e,r,s,t._getUIString("ScaleControl.Meters"));}function wn(t,e,i,r){var o,n,a,s=(o=i,(n=Math.pow(10,(""+Math.floor(o)).length-1))*(a=(a=o/n)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+r;}xn.prototype.getDefaultPosition=function(){return "bottom-left"},xn.prototype._onMove=function(){bn(this._map,this._container,this.options);},xn.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},xn.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},xn.prototype.setUnit=function(t){this.options.unit=t,bn(this._map,this._container,this.options);};var En=function(e){t.bindAll(["onMoveStart","onMoveEnd","onRender","getFPS","updateGraph"],this);var i=window.devicePixelRatio,r={background:"rgba(0,0,0,0.9)",barWidth:4*i,color:"#7cf859",font:"Monaco, Consolas, Courier, monospace",graphHeight:60*i,graphWidth:120*i,graphTop:0,graphRight:5*i,width:130*i};this.frames=0,this.totalTime=0,this.totalFrames=0,this.options=Object.assign({},r,e);};En.prototype.onAdd=function(t){this.map=t,console.log("onAdd",this.map);var e=window.devicePixelRatio,i=this.options,r=i.width,o=i.graphHeight,n=i.color,a=i.background,s=i.font,l=this.container=document.createElement("div");return l.className="mapboxgl-ctrl mapboxgl-ctrl-fps",l.style.backgroundColor=a,l.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=n,this.readOutput.style.fontFamily=s,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="mapboxgl-ctrl-canvas",this.canvas.width=r,this.canvas.height=o,this.canvas.style.cssText="width: "+r/e+"px; height: "+o/e+"px;",l.appendChild(this.readOutput),l.appendChild(this.canvas),this.map.on("movestart",this.onMoveStart),this.map.on("moveend",this.onMoveEnd),this.container},En.prototype.onMoveStart=function(){this.frames=0,this.time=performance.now(),this.map.on("render",this.onRender);},En.prototype.onMoveEnd=function(){var t=performance.now();this.updateGraph(this.getFPS(t)),this.frames=0,this.time=null,this.map.off("render",this.onRender);},En.prototype.onRender=function(){this.frames++;var t=performance.now();t>=this.time+1e3&&(this.updateGraph(this.getFPS(t)),this.frames=0,this.time=t);},En.prototype.getFPS=function(t){return this.totalTime+=t-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(t-this.time))||0},En.prototype.updateGraph=function(t){var e=this.options,i=e.barWidth,r=e.graphRight,o=e.graphTop,n=e.graphWidth,a=e.graphHeight,s=e.background,l=e.color,c=this.canvas.getContext("2d"),h=Math.round(1e3*this.totalFrames/this.totalTime)||0,u=i;c.fillStyle=s,c.globalAlpha=1,c.fillRect(0,0,n,o),c.fillStyle=l,this.readOutput.textContent="当前:"+t+" (平均:"+h+" )",c.drawImage(this.canvas,r+u,o,n-u,a,r,o,n-u,a),c.fillRect(r+n-u,o,u,a),c.fillStyle=s,c.globalAlpha=.75,c.fillRect(r+n-u,o,u,(1-t/100)*a);},En.prototype.onRemove=function(){return this.map.off("render",this.onRender),this.map.off("movestart",this.onMoveStart),this.map.off("moveend",this.onMoveEnd),this.container.parentNode.removeChild(this.container),this.map=null,this};var Tn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange");};Tn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Tn.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Tn.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Tn.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Tn.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Tn.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Tn.prototype._isFullscreen=function(){return this._fullscreen},Tn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle());},Tn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen();};var Cn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},In=function(e){function r(i){e.call(this),this.options=t.extend(Object.create(Cn),i),t.bindAll(["_update","_onClose","remove"],this);}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(e){var i=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){i._update(t.point);})),this._map.on("mouseup",(function(t){i._update(t.point);})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return !!this._map},r.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},r.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point);})),this._map.on("drag",(function(e){t._update(e.point);})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var i,r=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;i=o.firstChild;)r.appendChild(i);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t);},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t);},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose));},r.prototype._update=function(e){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return r._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=hn(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=this.options.anchor,a=function e(i){if(i){if("number"==typeof i){var r=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-i),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var o=t.Point.convert(i);return {center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return {center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!n){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=o.y+a.bottom.y<c?["top"]:o.y>this._map.transform.height-c?["bottom"]:[],o.x<l/2?s.push("left"):o.x>this._map.transform.width-l/2&&s.push("right"),n=0===s.length?"bottom":s.join("-");}var h=o.add(a[n]).round();i.setTransform(this._container,un[n]+" translate("+h.x+"px,"+h.y+"px)"),pn(this._container,n,"popup");}},r.prototype._onClose=function(){this.remove();},r}(t.Evented),Sn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Wr,OfflineMap:function(e){return function(e){return "string"==typeof e.style||e.style instanceof String?(i=e.style,new Promise((function(e,r){var o=new t.window.XMLHttpRequest;return o.open("GET",i,!0),o.setRequestHeader("Accept","application/json"),o.onerror=function(t){return r(t)},o.onload=function(){var t=0===o.responseURL.indexOf("file://");if((o.status>=200&&o.status<300||t)&&o.response)try{e(JSON.parse(o.response));}catch(t){r(t);}else r(new Error(o.statusText,o.status));},o.send(),o}))).then((function(i){return t.extend({},e,{style:i})})):Promise.resolve(e);var i;}(e).then(sn).then((function(e){return function(e){return new Promise((function(i){var r=t.extend({},e.style,{sources:{},layers:[]}),o=t.extend({},e,{style:r}),n=new Wr(o);console.log("创建空离线地图",o,n),n.once("load",(function(){var e=new Promise((function(t){n.addSourceType("mbtiles",an,(function(){return t()}));})),r=new Promise((function(e){n.addSourceType("rasteroffline",t.RasterTileSourceOffline,(function(){return e()}));}));Promise.all([e,r]).then((function(){return i(n)}));}));}))}(e).then((i=e.style,function(t){return Object.keys(i.sources).map((function(e){return t.addSource(e,i.sources[e])})),console.log("离线地图-加载数据源",i,t),t})).then(function(t){return function(e){return t.layers.map((function(t){return e.addLayer(t)})),console.log("离线地图-加载图层",t,e),e}}(e.style));var i;}))},NavigationControl:cn,GeolocateControl:vn,AttributionControl:Fr,ScaleControl:xn,FullscreenControl:Tn,FpsControl:En,Popup:In,Marker:_n,Style:Ze,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,CRS:t.CRS,CanonicalTileID:t.CanonicalTileID,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e;},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e;},get workerCount(){return Bt.workerCount},set workerCount(t){Bt.workerCount=t;},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e;},clearStorage:function(e){t.clearTileCache(e);},workerUrl:""};return Sn}));
|
|
33
|
+
define(["./shared"],(function(t){"use strict";var e=t.createCommonjsModule((function(t){function e(t){return !i(t)}function i(t){return "undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var t,e,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0;}catch(e){t=!1;}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return !1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[i=t&&t.failIfMajorPerformanceCaveat]&&(r[i]=function(t){var i=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(t);if(!i)return !1;var r=i.createShader(i.VERTEX_SHADER);return !(!r||i.isContextLost())&&(i.shaderSource(r,"void main() {}"),i.compileShader(r),!0===i.getShaderParameter(r,i.COMPILE_STATUS))}(i)),r[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i;}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};})),i={create:function(e,i,r){var o=t.window.document.createElement(e);return void 0!==i&&(o.className=i),r&&r.appendChild(o),o},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},r=t.window.document.documentElement.style;function o(t){if(!r)return t[0];for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var n,a=o(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){r&&a&&(n=r[a],r[a]="none");},i.enableDrag=function(){r&&a&&(r[a]=n);};var s=o(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[s]=e;};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0;}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c);}catch(t){l=!1;}i.addEventListener=function(t,e,i,r){void 0===r&&(r={}),t.addEventListener(e,i,"passive"in r&&l?r:r.capture);},i.removeEventListener=function(t,e,i,r){void 0===r&&(r={}),t.removeEventListener(e,i,"passive"in r&&l?r:r.capture);};var h=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",h,!0);};function u(t){var e=t.userImage;return !!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",h,!0);}),0);},i.mousePos=function(e,i){var r=e.getBoundingClientRect(),o=t.window.TouchEvent&&i instanceof t.window.TouchEvent?i.touches[0]:i;return new t.Point(o.clientX-r.left-e.clientLeft,o.clientY-r.top-e.clientTop)},i.touchPos=function(e,i){for(var r=e.getBoundingClientRect(),o=[],n="touchend"===i.type?i.changedTouches:i.touches,a=0;a<n.length;a++)o.push(new t.Point(n[a].clientX-r.left-e.clientLeft,n[a].clientY-r.top-e.clientTop));return o},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var p=function(e){function i(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var r=i[e];this._notify(r.ids,r.callback);}this.requestors=[];}},i.prototype.getImage=function(t){return this.images[t]},i.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e);},i.prototype._validate=function(e,i){var r=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},i.prototype._validateStretch=function(t,e){if(!t)return !0;for(var i=0,r=0,o=t;r<o.length;r+=1){var n=o[r];if(n[0]<i||n[1]<n[0]||e<n[1])return !1;i=n[1];}return !0},i.prototype._validateContent=function(t,e){return !(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},i.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0;},i.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove();},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var r=0,o=t;r<o.length;r+=1)this.images[o[r]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});},i.prototype._notify=function(e,i){for(var r={},o=0,n=e;o<n.length;o+=1){var a=n[o];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.');}i(null,r);},i.prototype.getPixelSize=function(){var t=this.atlasImage;return {width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns[e],r=this.getImage(e);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else {var o={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new t.ImagePosition(o,r);this.patterns[e]={bin:o,position:n};}return this._updatePatternAtlas(),this.patterns[e].position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE);},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var r=t.potpack(e),o=r.w,n=r.h,a=this.atlasImage;for(var s in a.resize({width:o||1,height:n||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,h=l.y+1,u=this.images[s].data,p=u.width,d=u.height;t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h},{width:p,height:d}),t.RGBAImage.copy(u,a,{x:0,y:d-1},{x:c,y:h-1},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h+d},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:p-1,y:0},{x:c-1,y:h},{width:1,height:d}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c+p,y:h},{width:1,height:d});}this.dirty=!0;},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={};},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var o=this.images[r];u(o)&&this.updateImage(r,o);}}},i}(t.Evented),d=m,_=m,f=1e20;function m(t,e,i,r,o,n){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=o||"sans-serif",this.fontWeight=n||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer,s=a+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1));}function g(t,e,i,r,o,n){for(var a=0;a<e;a++)v(t,a,e,i,r,o,n);for(var s=0;s<i;s++)v(t,s*e,1,e,r,o,n);}function v(t,e,i,r,o,n,a){var s,l,c,h;for(n[0]=0,a[0]=-f,a[1]=f,s=0;s<r;s++)o[s]=t[e+s*i];for(s=1,l=0,c=0;s<r;s++){do{c=(o[s]-o[h=n[l]]+s*s-h*h)/(s-h)/2;}while(c<=a[l]&&--l>-1);n[++l]=s,a[l]=c,a[l+1]=f;}for(s=0,l=0;s<r;s++){for(;a[l+1]<s;)l++;t[e+s*i]=o[h=n[l]]+(s-h)*(s-h);}}m.prototype._draw=function(t,e){var i,r,o,n,a,s,l,c,h,u=this.ctx.measureText(t),p=u.width,d=2*this.buffer;e&&this.useMetrics?(a=Math.floor(u.actualBoundingBoxAscent),c=this.buffer+Math.ceil(u.actualBoundingBoxAscent),s=this.buffer,l=this.buffer,i=(r=Math.min(this.size,Math.ceil(u.actualBoundingBoxRight-u.actualBoundingBoxLeft)))+d,o=(n=Math.min(this.size-s,Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent)))+d,this.ctx.textBaseline="alphabetic"):(i=r=this.size,o=n=this.size,a=19*this.fontSize/24,s=l=0,c=this.middle,this.ctx.textBaseline="middle"),r&&n&&(this.ctx.clearRect(l,s,r,n),this.ctx.fillText(t,this.buffer,c),h=this.ctx.getImageData(l,s,r,n));var _=new Uint8ClampedArray(i*o);return function(t,e,i,r,o,n,a){n.fill(f,0,e*i),a.fill(0,0,e*i);for(var s=(e-r)/2,l=0;l<o;l++)for(var c=0;c<r;c++){var h=(l+s)*e+c+s,u=t.data[4*(l*r+c)+3]/255;if(1===u)n[h]=0,a[h]=f;else if(0===u)n[h]=f,a[h]=0;else {var p=Math.max(0,.5-u),d=Math.max(0,u-.5);n[h]=p*p,a[h]=d*d;}}}(h,i,o,r,n,this.gridOuter,this.gridInner),g(this.gridOuter,i,o,this.f,this.v,this.z),g(this.gridInner,i,o,this.f,this.v,this.z),function(t,e,i,r,o,n,a){for(var s=0;s<e*i;s++){var l=Math.sqrt(r[s])-Math.sqrt(o[s]);t[s]=Math.round(255-255*(l/n+a));}}(_,i,o,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:_,metrics:{width:r,height:n,sdfWidth:i,sdfHeight:o,top:a,left:0,advance:p}}},m.prototype.draw=function(t){return this._draw(t,!1).data},m.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},d.default=_;var y=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={};};y.prototype.setURL=function(t){this.url=t;},y.prototype.getGlyphs=function(e,i){var r=this,o=[];for(var n in e)for(var a=0,s=e[n];a<s.length;a+=1)o.push({stack:n,id:s[a]});t.asyncAll(o,(function(t,e){var i=t.stack,o=t.id,n=r.entries[i];n||(n=r.entries[i]={glyphs:{},requests:{},ranges:{}});var a=n.glyphs[o];if(void 0===a){if(a=r._tinySDF(n,i,o))return n.glyphs[o]=a,void e(null,{stack:i,id:o,glyph:a});var s=Math.floor(o/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(n.ranges[s])e(null,{stack:i,id:o,glyph:a});else {var l=n.requests[s];l||(l=n.requests[s]=[],y.loadGlyphRange(i,s,r.url,r.requestManager,(function(t,e){if(e){for(var i in e)r._doesCharSupportLocalGlyph(+i)||(n.glyphs[+i]=e[+i]);n.ranges[s]=!0;}for(var o=0,a=l;o<a.length;o+=1)(0,a[o])(t,e);delete n.requests[s];}))),l.push((function(t,r){t?e(t):r&&e(null,{stack:i,id:o,glyph:r[o]||null});}));}}else e(null,{stack:i,id:o,glyph:a});}),(function(t,e){if(t)i(t);else if(e){for(var r={},o=0,n=e;o<n.length;o+=1){var a=n[o],s=a.stack,l=a.id,c=a.glyph;(r[s]||(r[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics};}i(null,r);}}));},y.prototype._doesCharSupportLocalGlyph=function(e){return !!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},y.prototype._tinySDF=function(e,i,r){var o=this.localIdeographFontFamily;if(o&&this._doesCharSupportLocalGlyph(r)){var n=e.tinySDF;if(!n){var a="400";/bold/i.test(i)?a="900":/medium/i.test(i)?a="500":/light/i.test(i)&&(a="200"),n=e.tinySDF=new y.TinySDF(24,3,8,.25,o,a);}return {id:r,bitmap:new t.AlphaImage({width:30,height:30},n.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=function(e,i,r,o,n){var a=256*i,s=a+255,l=o.transformRequest(o.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,i){if(e)n(e);else if(i){for(var r={},o=0,a=t.parseGlyphPBF(i);o<a.length;o+=1){var s=a[o];r[s.id]=s;}n(null,r);}}));},y.TinySDF=d;var x=function(){this.specification=t.styleSpec.light.position;};x.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},x.prototype.interpolate=function(e,i,r){return {x:t.number(e.x,i.x,r),y:t.number(e.y,i.y,r),z:t.number(e.z,i.z,r)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(i),this._transitioning=this._transitionable.untransitioned();}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var r in e){var o=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),o):this._transitionable.setValue(r,o);}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t);},i.prototype._validate=function(e,i,r){return (!r||!1!==r.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),E=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={};};E.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]},E.prototype.getDashRanges=function(t,e,i){var r=[],o=t.length%2==1?-t[t.length-1]*i:0,n=t[0]*i,a=!0;r.push({left:o,right:n,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var c=t[l];r.push({left:o=s*i,right:n=(s+=c)*i,isDash:a=!a,zeroLength:0===c});}return r},E.prototype.addRoundDash=function(t,e,i){for(var r=e/2,o=-i;o<=i;o++)for(var n=this.width*(this.nextRow+i+o),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var c=Math.abs(l-s.left),h=Math.abs(l-s.right),u=Math.min(c,h),p=void 0,d=o/i*(r+1);if(s.isDash){var _=r-Math.abs(d);p=Math.sqrt(u*u+_*_);}else p=r-Math.sqrt(u*u+d*d);this.data[n+l]=Math.max(0,Math.min(255,p+128));}},E.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1));}var o=t[0],n=t[t.length-1];o.isDash===n.isDash&&(o.left=n.left-this.width,n.right=o.right+this.width);for(var a=this.width*this.nextRow,s=0,l=t[s],c=0;c<this.width;c++){c/l.right>1&&(l=t[++s]);var h=Math.abs(c-l.left),u=Math.abs(c-l.right),p=Math.min(h,u);this.data[a+c]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128));}},E.prototype.addDash=function(e,i){var r=i?7:0,o=2*r+1;if(this.nextRow+o>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a<e.length;a++)n+=e[a];if(0!==n){var s=this.width/n,l=this.getDashRanges(e,this.width,s);i?this.addRoundDash(l,s,r):this.addRegularDash(l);}var c={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:n};return this.nextRow+=o,this.dirty=!0,c},E.prototype.bind=function(t){var 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));};var T=function e(i,r){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var o=this.workerPool.acquire(this.id),n=0;n<o.length;n++){var a=new e.Actor(o[n],r,this.id);a.name="Worker "+n,this.actors.push(a);}};T.prototype.broadcast=function(e,i,r){t.asyncAll(this.actors,(function(t,r){t.send(e,i,r);}),r=r||function(){});},T.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},T.prototype.remove=function(){this.actors.forEach((function(t){t.remove();})),this.actors=[],this.workerPool.release(this.id);},T.Actor=t.Actor;var C=function(e){function i(i,r,o,n){if(e.call(this),this.id=i,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=t.loadTileJSON(this._options,this.map._requestManager,(function(i,r){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new t.TileBounds(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var r=this._options.mapgisOffset||0;e.tileID.canonical.offsetZ(r+this.getZoomOffset());var o=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme));e.tileID.canonical.offsetZ(0-r-this.getZoomOffset());var n={request:this.map._requestManager.transformRequest(o,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(r,o){return delete e.request,e.aborted?i(null):r&&404!==r.status?i(r):(o&&o.resourceTiming&&(e.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}n.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",n,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",n,a.bind(this)));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0);},i.prototype.hasTransition=function(){return !1},i}(t.Evented),I=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox";}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.serialize=function(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function o(t,r){t&&(e.state="errored",i(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",i(null));}e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),function(r,n){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(r)e.state="errored",i(r);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,o.bind(this)));}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID);},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,r=Math.pow(2,i.z),o=(i.x-1+r)%r,n=0===i.x?e.wrap-1:e.wrap,a=(i.x+1+r)%r,s=i.x+1===r?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new t.OverscaledTileID(e.overscaledZ,n,i.z,o,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),l},i.prototype.unloadTile=function(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&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id});},i}(t.RasterTileSource),S=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=function(e){function i(t,i,r,o){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(o,n){r._loaded=!0,o?r.fire(new t.ErrorEvent(o)):n&&(r.image=n,e&&(r.coordinates=e),i&&i(),r._finishLoading());}));},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null;})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y);}var c=Math.max(o-i,n-r),h=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),u=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+o)/2*u),Math.floor((r+n)/2*u))}(r),this.minzoom=this.maxzoom=this.tileID.z;var o=r.map((function(t){return i.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.serialize=function(){return {type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return !1},i}(t.Evented),M=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.rebaseRequestUrl=i.rebaseRequestUrl||function(){},this.coordinates=[],this.type="image-map";}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCoordinates=function(){return this.coordinates},i.prototype.onAdd=function(t){this.map=t,t.on("resize",this.innerResize.bind(this)),t.on("rotateend",this.innnerRotateEnd.bind(this)),t.on("pitchend",this.innnerPitchEnd.bind(this)),t.on("moveend",this.innerMoveEnd.bind(this)),this.load();},i.prototype.innerResize=function(){this.loadImage();},i.prototype.innnerRotateEnd=function(){this.loadImage();},i.prototype.innnerPitchEnd=function(){this.loadImage();},i.prototype.innerMoveEnd=function(){this.loadImage();},i.prototype.loadImage=function(){this.load();},i.prototype.load=function(e,i){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url;var o=e||this.transfromMapCoords(),n=this.map._containerDimensions(),a=this.applyUrl(this.url,o,n[0],n[1]);t.getImage(this.map._requestManager.transformRequest(a,t.ResourceType.Image),(function(e,n){r._loaded=!0,e?r.fire(new t.ErrorEvent(e)):n&&(r.image=n,o&&(r.coordinates=o),i&&i(),r._finishLoading());}));},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.refreshedUponExpiration=!0,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.transfromMapCoords=function(){var t=this.map.getBounds().toArray();return [[t[0][0],t[1][1]],[t[1][0],t[1][1]],[t[1][0],t[0][1]],[t[0][0],t[0][1]]]},i.prototype.transfromCoordsToBound=function(t){var e=[],i=[];return t.forEach((function(t){e.push(t[0]),i.push(t[1]);})),[Math.min.apply(Math,e),Math.min.apply(Math,i),Math.max.apply(Math,e),Math.max.apply(Math,i)]},i.prototype.applyUrl=function(e,i,r,o){var n=this.transfromCoordsToBound(i),a=this._project(new t.LngLat(n[0],n[1])),s=this._project(new t.LngLat(n[2],n[3])),l=[a.x,a.y,s.x,s.y];return e.indexOf("reversebbox=true")>=0&&[n,l].forEach((function(t){var e=t[0],i=t[2],r=t[3];t[0]=t[1],t[1]=e,t[2]=r,t[3]=i;})),this.rebaseRequestUrl(e,{latlngBounds:n,mercatorBound:l,imageSize:[r,o]})},i.prototype._project=function(t){var e={};e.x=t.lng*Math.PI/180*6378137;var i=t.lat*Math.PI/180;return e.y=3189068.5*Math.log((1+Math.sin(i))/(1-Math.sin(i))),e},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(this.coordinates,(function(){e.texture=null;})),this):this},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),n=Math.max(n,l.y);}var c=Math.max(o-i,n-r),h=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),u=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((i+o)/2*u),Math.floor((r+n)/2*u))}(r),this.minzoom=this.maxzoom=this.tileID.z;var o=r.map((function(t){return i.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.texture.update(this.image),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i}(P);function z(t){var e=(90+t)/180*90;return e||45+e/2}function L(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t[1]=z(t[1]),t})),t}function A(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t[1]=z(t[1]),t}))})),t}function D(t){return t.geometry.coordinates=t.geometry.coordinates.map((function(t){return t.map((function(t){return t.map((function(t){return t[1]=z(t[1]),t}))})),t})),t}var R=function(e){function i(i,r,o,n){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=o.getActor(),this.setEventedParent(n),this.crs=this.getCrs(),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({crs:this.getCrs(),source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1,crs:this.getCrs(),projectionParams:this.getProjectionParams()},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1,crs:this.getCrs()},clusterProperties:r.clusterProperties},r.workerOptions);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCrs=function(){return "EPSG:3857"},i.prototype.fixCrsData=function(e){return this.getCrs()!==t.CRS.EPSG3857.getEpsgCode()&&(e=function(t,e){return "FeatureCollection"===t.type?t=function(t){return t.features=t.features.map((function(e){var i;return "Point"===e.geometry.type?((i=e).geometry.coordinates[1]=z(i.geometry.coordinates[1]),e=i):"LineString"===e.geometry.type||"MultiPoint"===t.type?e=L(e):"Polygon"===e.geometry.type||"MultiLineString"===t.type?e=A(e):"MultiPolygon"===e.geometry.type&&(e=D(e)),e})),t}(t):"Point"===t.type?t=oopPoint(t):"LineString"===t.type||"MultiPoint"===t.type?t=L(t):"Polygon"===t.type||"MultiLineString"===t.type?t=A(t):"MultiPolygon"===t.type&&(t=D(t)),console.log("loopdata",t),t}(e)),e},i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(i){if(i)e.fire(new t.ErrorEvent(i));else {var r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r));}}));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else {var r={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(r.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",r));}})),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var r=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(o),this.actor.send(this.type+".loadData",r,(function(t,o){i._removed||o&&o.abandoned||(i._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[i.id]&&(i._resourceTiming=o.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:r.source},null),e(t));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var r=this,o=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(o,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,n){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(n,r.map.painter,"reloadTile"===o),i(null))}));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),k=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.roundZoom=!0,this.type="video",this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1;var i=this.options;this.urls=[];for(var r=0,o=i.urls;r<o.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(o[r],t.ResourceType.Source).url);t.getVideo(this.urls,(function(i,r){e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):r&&(e.video=r,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint();})),e.map&&e.video.play(),e._finishLoading());}));},i.prototype.pause=function(){this.video&&this.video.pause();},i.prototype.play=function(){this.video&&this.video.play();},i.prototype.seek=function(e){if(this.video){var i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e;}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(P),B=function(e){function i(i,r,o,n){e.call(this,i,r,o,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return !Array.isArray(t)||2!==t.length||t.some((function(t){return "number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,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 t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1);},this._finishLoading());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,r=i.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,S.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return !0}return !1},i}(P),O={vector:C,raster:t.RasterTileSource,"raster-dem":I,"image-map":M,geojson:R,video:k,image:P,canvas:B};function F(e,i){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(i.toUnwrapped()))}function U(t,e,i,r,o,n){var a=function(t,e,i){if(t)for(var r=0,o=t;r<o.length;r+=1){var n=e[o[r]];if(n&&n.source===i&&"fill-extrusion"===n.type)return !0}else for(var a in e){var s=e[a];if(s.source===i&&"fill-extrusion"===s.type)return !0}return !1}(o&&o.layers,e,t.id),s=n.maxPitchScaleFactor(),l=t.tilesIn(r,s,a);l.sort(N);for(var c=[],h=0,u=l;h<u.length;h+=1){var p=u[h];c.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,i,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,o,n,s,F(t.transform,p.tileID))});}var d=function(t){for(var e={},i={},r=0,o=t;r<o.length;r+=1){var n=o[r],a=n.queryResults,s=n.wrappedTileID,l=i[s]=i[s]||{};for(var c in a)for(var h=a[c],u=l[c]=l[c]||{},p=e[c]=e[c]||[],d=0,_=h;d<_.length;d+=1){var f=_[d];u[f.featureIndex]||(u[f.featureIndex]=!0,p.push(f));}}return e}(c);for(var _ in d)d[_].forEach((function(e){var i=e.feature,r=t.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;}));return d}function N(t,e){var 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}var Z=function(t,e){this.max=t,this.onRemove=e,this.reset();};Z.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var r=i[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);}return this.data={},this.order=[],this},Z.prototype.add=function(t,e,i){var r=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((function(){r.remove(t,n);}),i)),this.data[o].push(n),this.order.push(o),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a);}return this},Z.prototype.has=function(t){return t.wrapped().key in this.data},Z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},Z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Z.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][r];return this.data[i].splice(r,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this},Z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e);}return this},Z.prototype.filter=function(t){var e=[];for(var i in this.data)for(var r=0,o=this.data[i];r<o.length;r+=1){var n=o[r];t(n.value)||e.push(n);}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l);}};var j=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(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||delete e.arrayBuffer;};j.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},j.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},j.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);};var q={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer);},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer);},V.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r);}},V.prototype.setVertexAttribPointers=function(t,e,i){for(var r=0;r<this.attributes.length;r++){var o=this.attributes[r],n=e.attributes[o.name];void 0!==n&&t.vertexAttribPointer(n,o.components,t[q[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0));}},V.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);};var G=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1;};G.prototype.get=function(){return this.current},G.prototype.set=function(t){},G.prototype.getDefault=function(){return this.default},G.prototype.setDefault=function(){this.set(this.default);};var W=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var 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);},i}(G),X=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1);},e}(G),H=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1);},e}(G),K=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return [!0,!0,!0,!0]},e.prototype.set=function(t){var 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);},e}(G),Y=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1);},e}(G),J=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1);},e}(G),Q=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return {func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var 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);},e}(G),$=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var 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);},e}(G),tt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1;}},e}(G),et=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return [0,1]},e.prototype.set=function(t){var 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);},e}(G),it=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1;}},e}(G),rt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1);},e}(G),ot=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1;}},e}(G),nt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [t.ONE,t.ZERO]},e.prototype.set=function(t){var 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);},e}(G),at=function(e){function i(){e.apply(this,arguments);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var 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);},i}(G),st=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1);},e}(G),lt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1;}},e}(G),ct=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1);},e}(G),ht=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1);},e}(G),ut=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1);},e}(G),pt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1);},e}(G),dt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return [0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var 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);},e}(G),_t=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1;}},e}(G),ft=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}},e}(G),mt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1;}},e}(G),gt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1;}},e}(G),vt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1;},e}(G),yt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1);},e}(G),xt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1;}},e}(G),bt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1;}},e}(G),wt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return !1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1;}},e}(G),Et=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(G),Tt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0;},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1;}},e}(Et),Ct=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}},e}(Et),It=function(t,e,i,r){this.context=t,this.width=e,this.height=i;var o=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new Tt(t,o),r&&(this.depthAttachment=new Ct(t,o));};It.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i);}t.deleteFramebuffer(this.framebuffer);};var St=function(t,e,i){this.func=t,this.mask=e,this.range=i;};St.ReadOnly=!1,St.ReadWrite=!0,St.disabled=new St(519,St.ReadOnly,[0,1]);var Pt=function(t,e,i,r,o,n){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=o,this.pass=n;};Pt.disabled=new Pt({func:519,mask:0},0,0,7680,7680,7680);var Mt=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i;};Mt.disabled=new Mt(Mt.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Mt.unblended=new Mt(Mt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Mt.alphaBlended=new Mt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var zt=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i;};zt.disabled=new zt(!1,1029,2305),zt.backCCW=new zt(!0,1029,2305);var Lt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new W(this),this.clearDepth=new X(this),this.clearStencil=new H(this),this.colorMask=new K(this),this.depthMask=new Y(this),this.stencilMask=new J(this),this.stencilFunc=new Q(this),this.stencilOp=new $(this),this.stencilTest=new tt(this),this.depthRange=new et(this),this.depthTest=new it(this),this.depthFunc=new rt(this),this.blend=new ot(this),this.blendFunc=new nt(this),this.blendColor=new at(this),this.blendEquation=new st(this),this.cullFace=new lt(this),this.cullFaceSide=new ct(this),this.frontFace=new ht(this),this.program=new ut(this),this.activeTexture=new pt(this),this.viewport=new dt(this),this.bindFramebuffer=new _t(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new mt(this),this.bindVertexBuffer=new gt(this),this.bindElementBuffer=new vt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new xt(this),this.pixelStoreUnpackPremultiplyAlpha=new bt(this),this.pixelStoreUnpackFlipY=new wt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query");};Lt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault();},Lt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0;},Lt.prototype.createIndexBuffer=function(t,e){return new j(this,t,e)},Lt.prototype.createVertexBuffer=function(t,e,i){return new V(this,t,e,i)},Lt.prototype.createRenderbuffer=function(t,e,i){var r=this.gl,o=r.createRenderbuffer();return this.bindRenderbuffer.set(o),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),o},Lt.prototype.createFramebuffer=function(t,e,i){return new It(this,t,e,i)},Lt.prototype.clear=function(t){var e=t.color,i=t.depth,r=this.gl,o=0;e&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(o);},Lt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace));},Lt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1);},Lt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1);},Lt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Mt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask);},Lt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null);};var At=function(e){function i(i,r,o){var n=this;e.call(this),this.id=i,this.dispatcher=o,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform));})),this.on("error",(function(){n._sourceErrored=!0;})),this._source=function(e,i,r,o){var n=new O[i.type](e,i,r,o);if(n.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+n.id);return t.bindAll(["load","abort","unload","serialize","prepare"],n),n}(i,r,o,this),this._tiles={},this._cache=new Z(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t);},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t);},i.prototype.loaded=function(){if(this._sourceErrored)return !0;if(!this._sourceLoaded)return !1;if(!this._source.loaded())return !1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return !1}return !0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0;},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform);}},i.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager);}},i.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},i.prototype.getRenderableIds=function(e){var i=this,r=[];for(var o in this._tiles)this._isIdRenderable(o,e)&&r.push(this._tiles[o]);return e?r.sort((function(e,r){var o=e.tileID,n=r.tileID,a=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle),s=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle);return o.overscaledZ-n.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return !!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading");},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)));},i.prototype._tileLoaded=function(e,i,r,o){if(o)return e.state="errored",void(404!==o.status?this._source.fire(new t.ErrorEvent(o,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}));},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var r=e[i];if(t.neighboringTiles&&t.neighboringTiles[r]){var o=this.getTileByID(r);n(t,o),n(o,t);}}function n(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),n=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,r){for(var o in this._tiles){var n=this._tiles[o];if(!(r[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>i)){for(var a=n.tileID;n&&n.tileID.overscaledZ>e+1;){var s=n.tileID.scaledTo(n.tileID.overscaledZ-1);(n=this._tiles[s.key])&&n.hasData()&&(a=s);}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){r[a.key]=a;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var r=t.overscaledZ-1;r>=e;r--){var o=t.scaledTo(r),n=this._getLoadedTile(o);if(n)return n}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*i*5),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(o);},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var r in this._tiles){var o=this._tiles[r];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o;}for(var n in this._tiles=i,this._timers)clearTimeout(this._timers[n]),delete this._timers[n];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a]);}},i.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var o;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(o=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(o=o.filter((function(t){return r._source.hasTile(t)})))):o=[];var n=e.coveringZoomLevel(this._source),a=Math.max(n-i.maxOverzooming,this._source.minzoom),s=Math.max(n+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(Rt(this._source.type)){for(var c={},h={},u=0,p=Object.keys(l);u<p.length;u+=1){var d=p[u],_=l[d],f=this._tiles[d];if(f&&!(f.fadeEndTime&&f.fadeEndTime<=t.browser.now())){var m=this.findLoadedParent(_,a);m&&(this._addTile(m.tileID),c[m.tileID.key]=m.tileID),h[d]=_;}}for(var g in this._retainLoadedChildren(h,n,s,l),c)l[g]||(this._coveredTiles[g]=!0,l[g]=c[g]);}for(var v in l)this._tiles[v].clearFadeHold();for(var y=0,x=t.keysDifference(this._tiles,l);y<x.length;y+=1){var b=x[y],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b);}this._updateLoadedParentTileCache();}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t);},i.prototype._updateRetainedTiles=function(t,e){for(var r={},o={},n=Math.max(e-i.maxOverzooming,this._source.minzoom),a=Math.max(e+i.maxUnderzooming,this._source.minzoom),s={},l=0,c=t;l<c.length;l+=1){var h=c[l],u=this._addTile(h);r[h.key]=h,u.hasData()||e<this._source.maxzoom&&(s[h.key]=h);}this._retainLoadedChildren(s,e,a,r);for(var p=0,d=t;p<d.length;p+=1){var _=d[p],f=this._tiles[_.key];if(!f.hasData()){if(e+1>this._source.maxzoom){var m=_.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){r[m.key]=m;continue}}else {var v=_.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var y=f.wasRequested(),x=_.overscaledZ-1;x>=n;--x){var b=_.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(f=this.getTile(b))&&y&&(f=this._addTile(b)),f&&(r[b.key]=b,y=f.wasRequested(),f.hasData()))break}}}return r},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);var o=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(o))break;r=o;}for(var n=0,a=e;n<a.length;n+=1)this._loadedParentTiles[a[n]]=i;}},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var r=Boolean(i);return r||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,r||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){i._reloadTile(t,"expired"),delete i._timers[t];}),r));},i.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i,r){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=r?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),h=this.getIds(),u=1/0,p=1/0,d=-1/0,_=-1/0,f=0,m=c;f<m.length;f+=1){var g=m[f];u=Math.min(u,g.x),p=Math.min(p,g.y),d=Math.max(d,g.x),_=Math.max(_,g.y);}for(var v=function(e){var r=o._tiles[h[e]];if(!r.holdingForFade()){var s=r.tileID,f=Math.pow(2,a.zoom-r.tileID.overscaledZ),m=i*r.queryPadding*t.EXTENT/r.tileSize/f,g=[s.getTilePoint(new t.MercatorCoordinate(u,p)),s.getTilePoint(new t.MercatorCoordinate(d,_))];if(g[0].x-m<t.EXTENT&&g[0].y-m<t.EXTENT&&g[1].x+m>=0&&g[1].y+m>=0){var v=l.map((function(t){return s.getTilePoint(t)})),y=c.map((function(t){return s.getTilePoint(t)}));n.push({tile:r,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:f});}}},y=0;y<h.length;y++)v(y);return n},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,o=i;r<o.length;r+=1){var n=o[r];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return !0;if(Rt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var r=this._tiles[t];r&&r.setDependencies(e,i);},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return !i.hasDependency(t,e)}));},i}(t.Evented);function Dt(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Rt(t){return "raster"===t||"image"===t||"video"===t}function kt(){return new t.window.Worker(Sn.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var Bt=function(){this.active={};};Bt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Bt.workerCount;)this.workers.push(new kt);return this.active[t]=!0,this.workers.slice()},Bt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate();})),this.workers=null);};var Ot,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Ut(e,i){var r={};for(var o in e)"ref"!==o&&(r[o]=e[o]);return t.refProperties.forEach((function(t){t in i&&(r[t]=i[t]);})),r}function Nt(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=Ut(t[r],e[t[r].ref]));return t}Bt.workerCount=Math.max(Math.min(Ft,6),1);var Zt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function jt(t,e,i){i.push({command:Zt.addSource,args:[t,e[t]]});}function qt(t,e,i){e.push({command:Zt.removeSource,args:[t]}),i[t]=!0;}function Vt(t,e,i,r){qt(t,i,r),jt(t,e,i);}function Gt(e,i,r){var o;for(o in e[r])if(e[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;for(o in i[r])if(i[r].hasOwnProperty(o)&&"data"!==o&&!t.deepEqual(e[r][o],i[r][o]))return !1;return !0}function Wt(e,i,r,o,n,a){var s;for(s in i=i||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));for(s in i)i.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],i[s])||r.push({command:a,args:[o,s,i[s],n]}));}function Xt(t){return t.id}function Ht(t,e){return t[e.id]=e,t}var Kt=function(t,e,i){var r=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var n=0;n<this.xCellCount*this.yCellCount;n++)r.push([]),o.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;};function Yt(e,i,r,o,n){var a=t.create();return i?(t.scale(a,a,[1/n,1/n,1]),r||t.rotateZ(a,a,o.angle)):t.multiply(a,o.labelPlaneMatrix,e),a}function Jt(e,i,r,o,n){if(i){var a=t.clone(e);return t.scale(a,a,[n,n,1]),r||t.rotateZ(a,a,-o.angle),a}return o.glCoordMatrix}function Qt(e,i){var r=[e.x,e.y,0,1];le(r,r,i);var o=r[3];return {point:new t.Point(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function $t(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function te(e,i,r,o,n,a,s,l){var c=o?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(c,r.transform.zoom),u=[256/r.width*2+1,256/r.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,_=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=r.transform.width/r.transform.height,m=!1,g=0;g<_.length;g++){var v=_.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)se(v.numGlyphs,p);else {m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),$t(y,u)){var x=.5+y[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,h,v),w=s?b*x:b/x,E=new t.Point(v.anchorX,v.anchorY),T=Qt(E,n).point,C={},I=re(v,w,!1,l,i,n,a,e.glyphOffsetArray,d,p,T,E,C,f);m=I.useVertical,(I.notEnoughRoom||m||I.needsFlipping&&re(v,w,!0,l,i,n,a,e.glyphOffsetArray,d,p,T,E,C,f).notEnoughRoom)&&se(v.numGlyphs,p);}else se(v.numGlyphs,p);}}o?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function ee(t,e,i,r,o,n,a,s,l,c,h,u){var p=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,_=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),g=ne(t*f,i,r,o,n,a,s.segment,d,_,l,c,h,u);if(!g)return null;var v=ne(t*m,i,r,o,n,a,s.segment,d,_,l,c,h,u);return v?{first:g,last:v}:null}function ie(e,i,r,o){return e===t.WritingMode.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function re(e,i,r,o,n,a,s,l,c,h,u,p,d,_){var f,m=i/24,g=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ee(m,l,g,v,r,u,p,e,c,a,d,!1);if(!w)return {notEnoughRoom:!0};var E=Qt(w.first.point,s).point,T=Qt(w.last.point,s).point;if(o&&!r){var C=ie(e.writingMode,E,T,_);if(C)return C}f=[w.first];for(var I=e.glyphStartIndex+1;I<y-1;I++)f.push(ne(m*l.getoffsetX(I),g,v,r,u,p,e.segment,x,b,c,a,d,!1));f.push(w.last);}else {if(o&&!r){var S=Qt(p,n).point,P=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(P),c.gety(P)),z=Qt(M,n),L=z.signedDistanceFromCamera>0?z.point:oe(p,M,S,1,n),A=ie(e.writingMode,S,L,_);if(A)return A}var D=ne(m*l.getoffsetX(e.glyphStartIndex),g,v,r,u,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d,!1);if(!D)return {notEnoughRoom:!0};f=[D];}for(var R=0,k=f;R<k.length;R+=1){var B=k[R];t.addDynamicAttributes(h,B.point,B.angle);}return {}}function oe(t,e,i,r,o){var n=Qt(t.add(t.sub(e)._unit()),o).point,a=i.sub(n);return i.add(a._mult(r/a.mag()))}function ne(e,i,r,o,n,a,s,l,c,h,u,p,d){var _=o?e-i:e+i,f=_>0?1:-1,m=0;o&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,v=g,y=n,x=n,b=0,w=0,E=Math.abs(_);b+w<=E;){if((g+=f)<l||g>=c)return null;if(x=y,void 0===(y=p[g])){var T=new t.Point(h.getx(g),h.gety(g)),C=Qt(T,u);if(C.signedDistanceFromCamera>0)y=p[g]=C.point;else {var I=g-f;y=oe(0===b?a:new t.Point(h.getx(I),h.gety(I)),T,x,E-b+1,u);}}b+=w,w=x.dist(y);}var S=(E-b)/w,P=y.sub(x),M=P.mult(S)._add(x);return M._add(P._unit()._perp()._mult(r*f)),{point:M,angle:m+Math.atan2(y.y-x.y,y.x-x.x),tileDistance:d?{prevTileDistance:g-f===v?0:h.gettileUnitDistanceFromAnchor(g-f),lastSegmentViewportDistance:E-b}:null}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,i,r,o){this._forEachCell(e,i,r,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(o);},Kt.prototype.insertCircle=function(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);},Kt.prototype._insertBoxCell=function(t,e,i,r,o,n){this.boxCells[o].push(n);},Kt.prototype._insertCircleCell=function(t,e,i,r,o,n){this.circleCells[o].push(n);},Kt.prototype._query=function(t,e,i,r,o,n){if(i<0||t>this.width||r<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(o)return !0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],h=this.circles[3*l+1],u=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:c-u,y1:h-u,x2:c+u,y2:h+u});}return n?a.filter(n):a}return this._forEachCell(t,e,i,r,this._queryCell,a,{hitTest:o,seenUids:{box:{},circle:{}}},n),o?a.length>0:a},Kt.prototype._queryCircle=function(t,e,i,r,o){var n=t-i,a=t+i,s=e-i,l=e+i;if(a<0||n>this.width||l<0||s>this.height)return !r&&[];var c=[];return this._forEachCell(n,s,a,l,this._queryCellCircle,c,{hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},o),r?c.length>0:c},Kt.prototype.query=function(t,e,i,r,o){return this._query(t,e,i,r,!1,o)},Kt.prototype.hitTest=function(t,e,i,r,o){return this._query(t,e,i,r,!0,o)},Kt.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Kt.prototype._queryCell=function(t,e,i,r,o,n,a,s){var l=a.seenUids,c=this.boxCells[o];if(null!==c)for(var h=this.bboxes,u=0,p=c;u<p.length;u+=1){var d=p[u];if(!l.box[d]){l.box[d]=!0;var _=4*d;if(t<=h[_+2]&&e<=h[_+3]&&i>=h[_+0]&&r>=h[_+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:h[_],y1:h[_+1],x2:h[_+2],y2:h[_+3]});}}}var f=this.circleCells[o];if(null!==f)for(var m=this.circles,g=0,v=f;g<v.length;g+=1){var y=v[g];if(!l.circle[y]){l.circle[y]=!0;var x=3*y;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,i,r)&&(!s||s(this.circleKeys[y]))){if(a.hitTest)return n.push(!0),!0;var b=m[x],w=m[x+1],E=m[x+2];n.push({key:this.circleKeys[y],x1:b-E,y1:w-E,x2:b+E,y2:w+E});}}}},Kt.prototype._queryCellCircle=function(t,e,i,r,o,n,a,s){var l=a.circle,c=a.seenUids,h=this.boxCells[o];if(null!==h)for(var u=this.bboxes,p=0,d=h;p<d.length;p+=1){var _=d[p];if(!c.box[_]){c.box[_]=!0;var f=4*_;if(this._circleAndRectCollide(l.x,l.y,l.radius,u[f+0],u[f+1],u[f+2],u[f+3])&&(!s||s(this.boxKeys[_])))return n.push(!0),!0}}var m=this.circleCells[o];if(null!==m)for(var g=this.circles,v=0,y=m;v<y.length;v+=1){var x=y[v];if(!c.circle[x]){c.circle[x]=!0;var b=3*x;if(this._circlesCollide(g[b],g[b+1],g[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return n.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,i,r,o,n,a,s){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r),p=l;p<=h;p++)for(var d=c;d<=u;d++)if(o.call(this,t,e,i,r,this.xCellCount*d+p,n,a,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,i,r,o,n){var a=r-t,s=o-e,l=i+n;return l*l>a*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,i,r,o,n,a){var s=(n-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return !1;var c=(a-o)/2,h=Math.abs(e-(o+c));if(h>c+i)return !1;if(l<=s||h<=c)return !0;var u=l-s,p=h-c;return u*u+p*p<=i*i};var ae=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function se(t,e){for(var i=0;i<t;i++){var r=e.length;e.resize(r+4),e.float32.set(ae,3*r);}}function le(t,e,i){var r=e[0],o=e[1];return t[0]=i[0]*r+i[4]*o+i[12],t[1]=i[1]*r+i[5]*o+i[13],t[3]=i[3]*r+i[7]*o+i[15],t}var ce=function(t,e,i){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===i&&(i=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200;};function he(t,e,i){t[e+4]=i?1:0;}function ue(e,i,r){return i*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ce.prototype.placeCollisionBox=function(t,e,i,r,o){var n=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=i*n.perspectiveRatio,s=t.x1*a+n.point.x,l=t.y1*a+n.point.y,c=t.x2*a+n.point.x,h=t.y2*a+n.point.y;return !this.isInsideGrid(s,l,c,h)||!e&&this.grid.hitTest(s,l,c,h,o)?{box:[],offscreen:!1}:{box:[s,l,c,h],offscreen:this.isOffscreen(s,l,c,h)}},ce.prototype.approximateTileDistance=function(t,e,i,r,o){var n=t.lastSegmentViewportDistance*i;return t.prevTileDistance+n+((o?1:r/this.pitchfactor)-1)*n*Math.abs(Math.sin(e))},ce.prototype.placeCollisionCircles=function(e,i,r,o,n,a,s,l,c,h,u,p,d){var _=[],f=this.projectAnchor(c,n.anchorX,n.anchorY),m=l/24,g=n.lineOffsetX*l,v=n.lineOffsetY*l,y=new t.Point(n.anchorX,n.anchorY),x=ee(m,s,g,v,!1,Qt(y,h).point,y,n,a,h,{},!0),b=!1,w=!1,E=!0,T=f.perspectiveRatio*o,C=1/(o*r),I=0,S=0;x&&(I=this.approximateTileDistance(x.first.tileDistance,x.first.angle,C,f.cameraDistance,p),S=this.approximateTileDistance(x.last.tileDistance,x.last.angle,C,f.cameraDistance,p));for(var P=0;P<e.length;P+=5){var M=e[P],z=e[P+1],L=e[P+2],A=e[P+3];if(!x||A<-I||A>S)he(e,P,!1);else {var D=this.projectPoint(c,M,z),R=L*T;if(_.length>0){var k=D.x-_[_.length-4],B=D.y-_[_.length-3];if(R*R*2>k*k+B*B&&P+8<e.length){var O=e[P+8];if(O>-I&&O<S){he(e,P,!1);continue}}}_.push(D.x,D.y,R,P/5),he(e,P,!0);var F=D.x-R,U=D.y-R,N=D.x+R,Z=D.y+R;if(E=E&&this.isOffscreen(F,U,N,Z),w=w||this.isInsideGrid(F,U,N,Z),!i&&this.grid.hitTestCircle(D.x,D.y,R,d)){if(!u)return {circles:[],offscreen:!1};b=!0;}}}return {circles:b||!w?[]:_,offscreen:E}},ce.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};for(var i=[],r=1/0,o=1/0,n=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var c=l[s],h=new t.Point(c.x+100,c.y+100);r=Math.min(r,h.x),o=Math.min(o,h.y),n=Math.max(n,h.x),a=Math.max(a,h.y),i.push(h);}for(var u={},p={},d=0,_=this.grid.query(r,o,n,a).concat(this.ignoredGrid.query(r,o,n,a));d<_.length;d+=1){var f=_[d],m=f.key;if(void 0===u[m.bucketInstanceId]&&(u[m.bucketInstanceId]={}),!u[m.bucketInstanceId][m.featureIndex]){var g=[new t.Point(f.x1,f.y1),new t.Point(f.x2,f.y1),new t.Point(f.x2,f.y2),new t.Point(f.x1,f.y2)];t.polygonIntersectsPolygon(i,g)&&(u[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex));}}return p},ce.prototype.insertCollisionBox=function(t,e,i,r,o){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:r,collisionGroupID:o},t[0],t[1],t[2],t[3]);},ce.prototype.insertCollisionCircles=function(t,e,i,r,o){for(var n=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:r,collisionGroupID:o},s=0;s<t.length;s+=4)n.insertCircle(a,t[s],t[s+1],t[s+2]);},ce.prototype.projectAnchor=function(t,e,i){var r=[e,i,0,1];return le(r,r,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}},ce.prototype.projectPoint=function(e,i,r){var o=[i,r,0,1];return le(o,o,e),new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100)},ce.prototype.projectAndGetPerspectiveRatio=function(e,i,r){var o=[i,r,0,1];return le(o,o,e),{point:new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o[3]*.5}},ce.prototype.isOffscreen=function(t,e,i,r){return i<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ce.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary};var pe=function(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;};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,i,r,o){this.text=new pe(t?t.text:null,e,i,o),this.icon=new pe(t?t.icon:null,e,r,o);};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var _e=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i;},fe=function(t,e,i,r,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=o;},me=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={};};function ge(e,i,r,o,n){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*i,l=-(a.verticalAlign-.5)*r,c=t.evaluateVariableOffset(e,o);return new t.Point(s+c[0]*n,l+c[1]*n)}function ve(e,i,r,o,n,a){var s=e.x1,l=e.x2,c=e.y1,h=e.y2,u=e.anchorPointX,p=e.anchorPointY,d=new t.Point(i,r);return o&&d._rotate(n?a:-a),{x1:s+d.x,y1:c+d.y,x2:l+d.x,y2:h+d.y,anchorPointX:u,anchorPointY:p}}me.prototype.get=function(t){if(this.crossSourceCollisions)return {ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}};}return this.collisionGroups[t]};var ye=function(t,e,i,r){this.transform=t.clone(),this.collisionIndex=new ce(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new me(i),this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={};};function xe(t,e,i,r,o){t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0),t.emplaceBack(e?1:0,i?1:0,r||0,o||0);}ye.prototype.getBucketParts=function(e,i,r,o){var n=r.getBucket(i),a=r.latestFeatureIndex;if(n&&a&&i.id===n.layerIds[0]){var s=r.collisionBoxArray,l=n.layers[0].layout,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/t.EXTENT,u=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p=Yt(u,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom));this.retainedQueryData[n.bucketInstanceId]=new fe(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,r.tileID);var d={bucket:n,layout:l,posMatrix:u,textLabelPlaneMatrix:p,scale:c,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(o)for(var _=0,f=n.sortKeyRanges;_<f.length;_+=1){var m=f[_];e.push({sortKey:m.sortKey,symbolInstanceStart:m.symbolInstanceStart,symbolInstanceEnd:m.symbolInstanceEnd,parameters:d});}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:d});}},ye.prototype.attemptAnchorPlacement=function(t,e,i,r,o,n,a,s,l,c,h,u,p,d,_){var f,m=[u.textOffset0,u.textOffset1],g=ge(t,i,r,m,o),v=this.collisionIndex.placeCollisionBox(ve(e,g.x,g.y,n,a,this.transform.angle),h,s,l,c.predicate);if(!_||0!==this.collisionIndex.placeCollisionBox(ve(_,g.x,g.y,n,a,this.transform.angle),h,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(f=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:m,width:i,height:r,anchor:t,textBoxScale:o,prevAnchor:f},this.markUsedJustification(p,t,u,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,u),this.placedOrientations[u.crossTileID]=d),{shift:g,placedGlyphBoxes:v}):void 0},ye.prototype.placeLayerBucketPart=function(e,i,r){var o=this,n=e.parameters,a=n.bucket,s=n.layout,l=n.posMatrix,c=n.textLabelPlaneMatrix,h=n.scale,u=n.textPixelRatio,p=n.holdingForFade,d=n.collisionBoxArray,_=n.partiallyEvaluatedTextSize,f=n.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),T=v&&(y||!a.hasIconData()||g),C=y&&(v||!a.hasTextData()||m);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var I=function(e,n){if(!i[e.crossTileID])if(p)o.placements[e.crossTileID]=new _e(!1,!1,!1);else {var d,E=!1,I=!1,S=!0,P=null,M={box:null,offscreen:null},z={box:null,offscreen:null},L=null,A=null,D=0,R=0,k=0;n.textFeatureIndex&&(D=n.textFeatureIndex),n.verticalTextFeatureIndex&&(R=n.verticalTextFeatureIndex);var B=n.textBox;if(B){var O=function(i){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!i&&o.prevPlacement){var n=o.prevPlacement.placedOrientations[e.crossTileID];n&&(o.placedOrientations[e.crossTileID]=n,o.markUsedOrientation(a,r=n,e));}return r},F=function(i,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var o=0,s=a.writingModes;o<s.length&&(s[o]===t.WritingMode.vertical?(M=r(),z=M):M=i(),!(M&&M.box&&M.box.length));o+=1);else M=i();};if(s.get("text-variable-anchor")){var U=s.get("text-variable-anchor");if(o.prevPlacement&&o.prevPlacement.variableOffsets[e.crossTileID]){var N=o.prevPlacement.variableOffsets[e.crossTileID];U.indexOf(N.anchor)>0&&(U=U.filter((function(t){return t!==N.anchor}))).unshift(N.anchor);}var Z=function(t,i,r){for(var n=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,h=w&&!y?i:null,p={box:[],offscreen:!1},d=v?2*U.length:U.length,_=0;_<d;++_){var m=o.attemptAnchorPlacement(U[_%U.length],t,n,s,c,x,b,u,l,f,_>=U.length,e,a,r,h);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,P=m.shift;break}}return p};F((function(){return Z(B,n.iconBox,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&i?Z(i,n.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(E=M.box,S=M.offscreen);var j=O(M&&M.box);if(!E&&o.prevPlacement){var q=o.prevPlacement.variableOffsets[e.crossTileID];q&&(o.variableOffsets[e.crossTileID]=q,o.markUsedJustification(a,q.anchor,e,j));}}else {var V=function(t,i){var r=o.collisionIndex.placeCollisionBox(t,v,u,l,f.predicate);return r&&r.box&&r.box.length&&(o.markUsedOrientation(a,i,e),o.placedOrientations[e.crossTileID]=i),r};F((function(){return V(B,t.WritingMode.horizontal)}),(function(){var i=n.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?V(i,t.WritingMode.vertical):{box:null,offscreen:null}})),O(M&&M.box&&M.box.length);}}E=(d=M)&&d.box&&d.box.length>0,S=d&&d.offscreen;var G=n.textCircles;if(G){var W=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),X=t.evaluateSizeForFeature(a.textSizeData,_,W);L=o.collisionIndex.placeCollisionCircles(G,v,h,u,W,a.lineVertexArray,a.glyphOffsetArray,X,l,c,r,b,f.predicate),E=v||L.circles.length>0,S=S&&L.offscreen;}if(n.iconFeatureIndex&&(k=n.iconFeatureIndex),n.iconBox){var H=function(t){var e=w&&P?ve(t,P.x,P.y,x,b,o.transform.angle):t;return o.collisionIndex.placeCollisionBox(e,y,u,l,f.predicate)};I=z&&z.box&&z.box.length&&n.verticalIconBox?(A=H(n.verticalIconBox)).box.length>0:(A=H(n.iconBox)).box.length>0,S=S&&A.offscreen;}var K=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Y=g||0===e.numIconVertices;K||Y?Y?K||(I=I&&E):E=I&&E:I=E=I&&E,E&&d&&d.box&&o.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,z&&z.box&&R?R:D,f.ID),I&&A&&o.collisionIndex.insertCollisionBox(A.box,s.get("icon-ignore-placement"),a.bucketInstanceId,k,f.ID),E&&L&&o.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),a.bucketInstanceId,D,f.ID),o.placements[e.crossTileID]=new _e(E||T,I||C,S||a.justReloaded),i[e.crossTileID]=!0;}};if(E)for(var S=a.getSortedSymbolIndexes(this.transform.angle),P=S.length-1;P>=0;--P){var M=S[P];I(a.symbolInstances.get(M),a.collisionArrays[M]);}else for(var z=e.symbolInstanceStart;z<e.symbolInstanceEnd;z++)I(a.symbolInstances.get(z),a.collisionArrays[z]);a.justReloaded=!1;},ye.prototype.markUsedJustification=function(e,i,r,o){var n;n=o===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var l=s[a];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=n>=0&&l!==n?0:r.crossTileID);}},ye.prototype.markUsedOrientation=function(e,i,r){for(var o=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,n=i===t.WritingMode.vertical?i:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=o;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=n);},ye.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var r=e?e.symbolFadeChange(t):1,o=e?e.opacities:{},n=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=o[s];c?(this.opacities[s]=new de(c,r,l.text,l.icon),i=i||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new de(null,r,l.text,l.icon,l.skipFade),i=i||l.text||l.icon);}for(var h in o){var u=o[h];if(!this.opacities[h]){var p=new de(u,r,!1,!1);p.isHidden()||(this.opacities[h]=p,i=i||u.text.placed||u.icon.placed);}}for(var d in n)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=n[d]);for(var _ in a)this.placedOrientations[_]||!this.opacities[_]||this.opacities[_].isHidden()||(this.placedOrientations[_]=a[_]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t);},ye.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,o=e;r<o.length;r+=1){var n=o[r],a=n.getBucket(t);a&&n.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,n.collisionBoxArray);}},ye.prototype.updateBucketOpacities=function(e,i,r){var o=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear(),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexArray.clear(),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexArray.clear();var n=e.layers[0].layout,a=new de(null,0,!1,!1,!0),s=n.get("text-allow-overlap"),l=n.get("icon-allow-overlap"),c=n.get("text-variable-anchor"),h="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),p="none"!==n.get("icon-text-fit"),d=new de(null,0,s&&(l||!e.hasIconData()||n.get("icon-optional")),l&&(s||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData())&&e.deserializeCollisionBoxes(r);for(var _=function(t,e,i){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);},f=function(r){var n=e.symbolInstances.get(r),s=n.numHorizontalGlyphVertices,l=n.numVerticalGlyphVertices,f=n.crossTileID,m=i[f],g=o.opacities[f];m?g=a:g||(o.opacities[f]=g=d),i[f]=!0;var v=n.numIconVertices>0,y=o.placedOrientations[n.crossTileID],x=y===t.WritingMode.vertical,b=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(s>0||l>0){var w=Pe(g.text);_(e.text,s,x?Me:w),_(e.text,l,b?Me:w);var E=g.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=E||x?1:0);})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=E||b?1:0);var T=o.variableOffsets[n.crossTileID];T&&o.markUsedJustification(e,T.anchor,n,y);var C=o.placedOrientations[n.crossTileID];C&&(o.markUsedJustification(e,"left",n,C),o.markUsedOrientation(e,C,n));}if(v){var I=Pe(g.icon),S=!(p&&n.verticalPlacedIconSymbolIndex&&x);n.placedIconSymbolIndex>=0&&(_(e.icon,n.numIconVertices,S?I:Me),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=g.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(_(e.icon,n.numVerticalIconVertices,S?Me:I),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var P=e.collisionArrays[r];if(P){var M=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var z=!0;if(c){var L=o.variableOffsets[f];L?(M=ge(L.anchor,L.width,L.height,L.textOffset,L.textBoxScale),h&&M._rotate(u?o.transform.angle:-o.transform.angle)):z=!1;}P.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!z||x,M.x,M.y),P.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!z||b,M.x,M.y);}var A=Boolean(!b&&P.verticalIconBox);P.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,A,p?M.x:0,p?M.y:0),P.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!A,p?M.x:0,p?M.y:0);var D=P.textCircles;if(D&&e.hasTextCollisionCircleData())for(var R=0;R<D.length;R+=5)xe(e.textCollisionCircle.collisionVertexArray,g.text.placed,m||0===D[R+4]);}}},m=0;m<e.symbolInstances.length;m++)f(m);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexBuffer&&e.iconCollisionCircle.collisionVertexBuffer.updateData(e.iconCollisionCircle.collisionVertexArray),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexBuffer&&e.textCollisionCircle.collisionVertexBuffer.updateData(e.textCollisionCircle.collisionVertexArray);},ye.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ye.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ye.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ye.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},ye.prototype.setStale=function(){this.stale=!0;};var be=Math.pow(2,25),we=Math.pow(2,24),Ee=Math.pow(2,17),Te=Math.pow(2,16),Ce=Math.pow(2,9),Ie=Math.pow(2,8),Se=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*be+e*we+i*Ee+e*Te+i*Ce+e*Ie+i*Se+e}var Me=0,ze=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];};ze.prototype.continuePlacement=function(t,e,i,r,o){for(var n=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(n,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,o())return !0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<n.length;)if(e.placeLayerBucketPart(n[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,o())return !0;return !1};var Le=function(t,e,i,r,o,n,a){this.placement=new ye(t,o,n,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1;};Le.prototype.isDone=function(){return this._done},Le.prototype.continuePlacement=function(e,i,r){for(var o=this,n=t.browser.now(),a=function(){var e=t.browser.now()-n;return !o._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=i[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new ze(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},Le.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Ae=512/t.EXTENT/2,De=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;r<e.length;r++){var o=e.get(r),n=o.key;this.indexedSymbolInstances[n]||(this.indexedSymbolInstances[n]=[]),this.indexedSymbolInstances[n].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)});}};De.prototype.getScaledCoordinates=function(e,i){var r=Ae/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return {x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*r)}},De.prototype.findMatches=function(t,e,i){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),o=0;o<t.length;o++){var n=t.get(o);if(!n.crossTileID){var a=this.indexedSymbolInstances[n.key];if(a)for(var s=this.getScaledCoordinates(n,e),l=0,c=a;l<c.length;l+=1){var h=c[l];if(Math.abs(h.coord.x-s.x)<=r&&Math.abs(h.coord.y-s.y)<=r&&!i[h.crossTileID]){i[h.crossTileID]=!0,n.crossTileID=h.crossTileID;break}}}}};var Re=function(){this.maxCrossTileID=0;};Re.prototype.generate=function(){return ++this.maxCrossTileID};var ke=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0;};ke.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var r=this.indexes[i],o={};for(var n in r){var a=r[n];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a;}this.indexes[i]=o;}this.lng=t;},ke.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&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(var r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var n in this.indexes){var a=this.indexes[n];if(Number(n)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o);}else {var c=a[t.scaledTo(Number(n)).key];c&&c.findMatches(e.symbolInstances,t,o);}}for(var h=0;h<e.symbolInstances.length;h++){var u=e.symbolInstances.get(h);u.crossTileID||(u.crossTileID=i.generate(),o[u.crossTileID]=!0);}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0},ke.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var r=0,o=e.indexedSymbolInstances[i];r<o.length;r+=1)delete this.usedCrossTileIDs[t][o[r].crossTileID];},ke.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var r=this.indexes[i];for(var o in r)t[r[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[o]),delete r[o],e=!0);}return e};var Be=function(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};};Be.prototype.addLayer=function(t,e,i){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new ke);var o=!1,n={};r.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(l.tileID,c,this.crossTileIDs)&&(o=!0),n[c.bucketInstanceId]=!0);}return r.removeStaleBuckets(n)&&(o=!0),o},Be.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach((function(t){e[t]=!0;})),this.layerIndexes)e[i]||delete this.layerIndexes[i];};var Oe=function(e,i){return t.emitValidationErrors(e,i&&i.filter((function(t){return "source.canvas"!==t.identifier})))},Fe=t.pick(Zt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Zt,["setCenter","setZoom","setBearing","setPitch"]),Ne=function(){var e={},i=t.styleSpec.$version;for(var r in t.styleSpec.$root){var o,n=t.styleSpec.$root[r];if(n.required)null!=(o="version"===r?i:"array"===n.type?[]:{})&&(e[r]=o);}return e}(),Ze=function(e){function i(r,o){var n=this;void 0===o&&(o={}),e.call(this),this.map=r,this.dispatcher=new T((Ot||(Ot=new Bt),Ot),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new y(r._requestManager,o.localIdeographFontFamily),this.lineAtlas=new E(256,512),this.crossTileSymbolIndex=new Be,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=i.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,i){if(t.triggerPluginCompletionEvent(e),i&&i.every((function(t){return t})))for(var r in a.sourceCaches)a.sourceCaches[r].reload();}));})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var r in n._layers){var o=n._layers[r];o.source===i.id&&n._validateLayer(o);}}}}));}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadURL=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var o="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);var n=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(n,(function(e,i){r._request=null,e?r.fire(new t.ErrorEvent(e)):i&&r._load(i,o);}));},i.prototype.loadJSON=function(e,i){var r=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==i.validate);}));},i.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ne,!1);},i.prototype._load=function(e,i){if(!i||!Oe(this,t.validateStyle(e))){for(var r in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(r,e.sources[r],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=Nt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,a=o;n<a.length;n+=1){var s=a[n];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize();}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"));}},i.prototype._loadSprite=function(e){var i=this;this._spriteRequest=function(e,i,r){var o,n,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,o=e,h());})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,n=e,h());}));function h(){if(a)r(a);else if(o&&n){var e=t.browser.getImageData(n),i={};for(var s in o){var l=o[s],c=l.width,h=l.height,u=l.x,p=l.y,d=l.sdf,_=l.pixelRatio,f=l.stretchX,m=l.stretchY,g=l.content,v=new t.RGBAImage({width:c,height:h});t.RGBAImage.copy(e,v,{x:u,y:p},{x:0,y:0},{width:c,height:h}),i[s]={data:v,pixelRatio:_,sdf:d,stretchX:f,stretchY:m,content:g};}r(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}(e,this.map._requestManager,(function(e,r){if(i._spriteRequest=null,e)i.fire(new t.ErrorEvent(e));else if(r)for(var o in r)i.imageManager.addImage(o,r[o]);i.imageManager.setLoaded(!0),i._availableImages=i.imageManager.listImages(),i.dispatcher.broadcast("setImages",i._availableImages),i.fire(new t.Event("data",{dataType:"style"}));}));},i.prototype._validateLayer=function(e){var i=this.sourceCaches[e.source];if(i){var r=e.sourceLayer;if(r){var o=i.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+o.id+'" as specified by style layer "'+e.id+'"')));}}},i.prototype.loaded=function(){if(!this._loaded)return !1;if(Object.keys(this._updatedSources).length)return !1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return !1;return !!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,r=t;i<r.length;i+=1){var o=this._layers[r[i]];"custom"!==o.type&&e.push(o.serialize());}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return !0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return !0;for(var e in this._layers)if(this._layers[e].hasTransition())return !0;return !1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){var i=this._changed;if(this._changed){var r=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);for(var n in (r.length||o.length)&&this._updateWorkerLayers(r,o),this._updatedSources){var a=this._updatedSources[n];"reload"===a?this._reloadSource(n):"clear"===a&&this._clearSource(n);}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates();}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var c=0,h=this._order;c<h.length;c+=1){var u=this._layers[h[c]];u.recalculate(e,this._availableImages),!u.isHidden(e.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0);}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}));}},i.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={};}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e});},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={};},i.prototype.setState=function(e){var i=this;if(this._checkLoaded(),Oe(this,t.validateStyle(e)))return !1;(e=t.clone$1(e)).layers=Nt(e.layers);var r=function(e,i){if(!e)return [{command:Zt.setStyle,args:[i]}];var r=[];try{if(!t.deepEqual(e.version,i.version))return [{command:Zt.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||r.push({command:Zt.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||r.push({command:Zt.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||r.push({command:Zt.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||r.push({command:Zt.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||r.push({command:Zt.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||r.push({command:Zt.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||r.push({command:Zt.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||r.push({command:Zt.setLight,args:[i.light]});var o={},n=[];!function(e,i,r,o){var n;for(n in i=i||{},e=e||{})e.hasOwnProperty(n)&&(i.hasOwnProperty(n)||qt(n,r,o));for(n in i)i.hasOwnProperty(n)&&(e.hasOwnProperty(n)?t.deepEqual(e[n],i[n])||("geojson"===e[n].type&&"geojson"===i[n].type&&Gt(e,i,n)?r.push({command:Zt.setGeoJSONSourceData,args:[n,i[n].data]}):Vt(n,i,r,o)):jt(n,i,r));}(e.sources,i.sources,n,o);var a=[];e.layers&&e.layers.forEach((function(t){o[t.source]?r.push({command:Zt.removeLayer,args:[t.id]}):a.push(t);})),r=r.concat(n),function(e,i,r){i=i||[];var o,n,a,s,l,c,h,u=(e=e||[]).map(Xt),p=i.map(Xt),d=e.reduce(Ht,{}),_=i.reduce(Ht,{}),f=u.slice(),m=Object.create(null);for(o=0,n=0;o<u.length;o++)_.hasOwnProperty(a=u[o])?n++:(r.push({command:Zt.removeLayer,args:[a]}),f.splice(f.indexOf(a,n),1));for(o=0,n=0;o<p.length;o++)f[f.length-1-o]!==(a=p[p.length-1-o])&&(d.hasOwnProperty(a)?(r.push({command:Zt.removeLayer,args:[a]}),f.splice(f.lastIndexOf(a,f.length-n),1)):n++,r.push({command:Zt.addLayer,args:[_[a],c=f[f.length-o]]}),f.splice(f.length-o,0,a),m[a]=!0);for(o=0;o<p.length;o++)if(s=d[a=p[o]],l=_[a],!m[a]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(h in Wt(s.layout,l.layout,r,a,null,Zt.setLayoutProperty),Wt(s.paint,l.paint,r,a,null,Zt.setPaintProperty),t.deepEqual(s.filter,l.filter)||r.push({command:Zt.setFilter,args:[a,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||r.push({command:Zt.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Wt(s[h],l[h],r,a,h.slice(6),Zt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Zt.setLayerProperty,args:[a,h,l[h]]}));for(h in l)l.hasOwnProperty(h)&&!s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?Wt(s[h],l[h],r,a,h.slice(6),Zt.setPaintProperty):t.deepEqual(s[h],l[h])||r.push({command:Zt.setLayerProperty,args:[a,h,l[h]]}));}else r.push({command:Zt.removeLayer,args:[a]}),c=f[f.lastIndexOf(a)+1],r.push({command:Zt.addLayer,args:[l,c]});}(a,i.layers,r);}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Zt.setStyle,args:[i]}];}return r}(this.serialize(),e).filter((function(t){return !(t.command in Ue)}));if(0===r.length)return !1;var o=r.filter((function(t){return !(t.command in Fe)}));if(o.length>0)throw new Error("Unimplemented: "+o.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args);})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e);},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,r){var o=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,r))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var n=this.sourceCaches[e]=new At(e,i,this.dispatcher);n.style=this,n.setEventedParent(this,(function(){return {isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}})),n.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else {var n;if("custom"===e.type){if(Oe(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e);}else {if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},r))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize();}var a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {if(this._order.splice(a,0,o),this._layerOrderChanged=!0,this._layers[o]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type){var s=this._removedLayers[o];delete this._removedLayers[o],s.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause());}this._updateLayer(n),n.onAdd&&n.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var r=this._order.indexOf(e);this._order.splice(r,1);var o=i?this._order.indexOf(i):this._order.length;i&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(o,0,e),this._layerOrderChanged=!0);}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,r){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===i&&o.maxzoom===r||(null!=i&&(o.minzoom=i),null!=r&&(o.maxzoom=r),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")));},i.prototype.setFilter=function(e,i,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,i))return null==i?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",i,null,r)||(o.filter=t.clone$1(i),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(i),r)||(n.setLayoutProperty(i,r,o),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getLayoutProperty=function(e,i){var r=this.getLayer(e);if(r)return r.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,r,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(i),r)||(n.setPaintProperty(i,r,o)&&this._updateLayer(n),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){var a=n.getSource().type;"geojson"===a&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.setFeatureState(o,e.id,i)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var r=e.source,o=this.sourceCaches[r];if(void 0!==o){var n=o.getSource().type,a="vector"===n?e.sourceLayer:void 0;"vector"!==n||a?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):o.removeFeatureState(a,e.id,i):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.sourceCaches[i];if(void 0!==o){if("vector"!==o.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.getFeatureState(r,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return "fill-extrusion"===e._layers[t].type},r={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(i(a)){r[a]=n;for(var s=0,l=t;s<l.length;s+=1){var c=l[s][a];if(c)for(var h=0,u=c;h<u.length;h+=1)o.push(u[h]);}}}o.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var _=this._order[d];if(i(_))for(var f=o.length-1;f>=0;f--){var m=o[f].feature;if(r[m.layer.id]<d)break;p.push(m),o.pop();}else for(var g=0,v=t;g<v.length;g+=1){var y=v[g][_];if(y)for(var x=0,b=y;x<b.length;x+=1)p.push(b[x].feature);}}return p},i.prototype.queryRenderedFeatures=function(e,i,r){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);var o={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var n=0,a=i.layers;n<a.length;n+=1){var s=a[n],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];o[l.source]=!0;}}var c=[];for(var h in i.availableImages=this._availableImages,this.sourceCaches)i.layers&&!o[h]||c.push(U(this.sourceCaches[h],this._layers,this._serializedLayers,e,i,r));return this.placement&&c.push(function(t,e,i,r,o,n,a){for(var s={},l=n.queryRenderedSymbols(r),c=[],h=0,u=Object.keys(l).map(Number);h<u.length;h+=1)c.push(a[u[h]]);c.sort(N);for(var p=function(){var i=_[d],r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,o.filter,o.layers,o.availableImages,t);for(var n in r){var a=s[n]=s[n]||[],c=r[n];c.sort((function(t,e){var r=i.featureSortOrder;if(r){var o=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-o}return e.featureIndex-t.featureIndex}));for(var h=0,u=c;h<u.length;h+=1)a.push(u[h]);}},d=0,_=c;d<_.length;d+=1)p();var f=function(e){s[e].forEach((function(r){var o=r.feature,n=i[t[e].source].getFeatureState(o.layer["source-layer"],o.id);o.source=o.layer.source,o.layer["source-layer"]&&(o.sourceLayer=o.layer["source-layer"]),o.state=n;}));};for(var m in s)f(m);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);var r=this.sourceCaches[e];return r?function(t,e){for(var i=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],o={},n=0;n<i.length;n++){var a=i[n],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(r,e));}return r}(r,i):[]},i.prototype.addSourceType=function(t,e,r){return i.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e,i){void 0===i&&(i={}),this._checkLoaded();var r=this.light.getLight(),o=!1;for(var n in e)if(!t.deepEqual(e[n],r[n])){o=!0;break}if(o){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(a);}},i.prototype._validate=function(e,i,r,o,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Oe(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:r,styleSpec:t.styleSpec},o)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var i in this.sourceCaches)this.sourceCaches[i].clearTiles(),this.sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove();},i.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles();},i.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload();},i.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t);},i.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t);},i.prototype._updatePlacement=function(e,i,r,o,n){void 0===n&&(n=!1);for(var a=!1,s=!1,l={},c=0,h=this._order;c<h.length;c+=1){var u=this._layers[h[c]];if("symbol"===u.type){if(!l[u.source]){var p=this.sourceCaches[u.source];l[u.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}));}var d=this.crossTileSymbolIndex.addLayer(u,l[u.source],e.center.lng);a=a||d;}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Le(e,this._order,n,i,r,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var _=0,f=this._order;_<f.length;_+=1){var m=this._layers[f[_]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,l[m.source]);}return !this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles();},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var r=this.sourceCaches[e.source];r&&r.setDependencies(e.tileID.key,e.type,e.icons);},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i);},i.prototype.getResource=function(e,i,r){return t.makeRequest(i,r)},i}(t.Evented);Ze.getSourceType=function(t){return O[t]},Ze.setSourceType=function(t,e){O[t]=e;},Ze.registerForPluginStateChange=t.registerForPluginStateChange;var je=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),qe=fi("#ifdef GL_ES\r\nprecision mediump float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif","#ifdef GL_ES\r\nprecision highp float;\r\n#else\r\n#if !defined(lowp)\r\n#define lowp\r\n#endif\r\n#if !defined(mediump)\r\n#define mediump\r\n#endif\r\n#if !defined(highp)\r\n#define highp\r\n#endif\r\n#endif\nvec2 unpack_float(const float packedValue) {\r\nint packedIntValue=int(packedValue);\r\nint v0=packedIntValue/256;\r\nreturn vec2(v0,packedIntValue-v0*256);\r\n}\r\nvec2 unpack_opacity(const float packedOpacity) {\r\nint intOpacity=int(packedOpacity)/2;\r\nreturn vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));\r\n}vec4 decode_color(const vec2 encodedColor) {\r\nreturn vec4(\r\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\r\n);\r\n}float unpack_mix_vec2(const vec2 packedValue,const float t) {\r\nreturn mix(packedValue[0],packedValue[1],t);\r\n}vec4 unpack_mix_color(const vec4 packedColors,const float t) {\r\nvec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));\r\nvec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));\r\nreturn mix(minColor,maxColor,t);\r\n}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) {\r\nvec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);\r\nreturn (tile_units_to_pixels*pos+offset)/pattern_size;\r\n}"),Ve=fi("uniform vec4 u_color;\r\nuniform float u_opacity;\r\nvoid main() {\r\ngl_FragColor=u_color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Ge=fi("uniform vec2 u_pattern_tl_a;\r\nuniform vec2 u_pattern_br_a;\r\nuniform vec2 u_pattern_tl_b;\r\nuniform vec2 u_pattern_br_b;\r\nuniform vec2 u_texsize;\r\nuniform float u_mix;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_mix)*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pattern_size_a;\r\nuniform vec2 u_pattern_size_b;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_scale_a;\r\nuniform float u_scale_b;\r\nuniform float u_tile_units_to_pixels;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_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);\r\nv_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);\r\n}"),We=fi("varying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\r\nvec2 extrude=v_data.xy;\r\nfloat extrude_length=length(extrude);\r\nlowp float antialiasblur=v_data.z;\r\nfloat antialiased_blur=-max(blur,antialiasblur);\r\nfloat opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);\r\nfloat color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\r\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\r\n);\r\ngl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform bool u_scale_with_map;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_extrude_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nattribute vec2 a_pos;\r\nvarying vec3 v_data;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define mediump float radius\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp vec4 stroke_color\r\n#pragma mapbox: define mediump float stroke_width\r\n#pragma mapbox: define lowp float stroke_opacity\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize mediump float radius\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp vec4 stroke_color\r\n#pragma mapbox: initialize mediump float stroke_width\r\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);\r\nif (u_pitch_with_map) {\r\nvec2 corner_position=circle_center;\r\nif (u_scale_with_map) {\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale;\r\n} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);\r\ncorner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);\r\n}\r\ngl_Position=u_matrix*vec4(corner_position,0,1);\r\n} else {\r\ngl_Position=u_matrix*vec4(circle_center,0,1);\r\nif (u_scale_with_map) {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;\r\n} else {\r\ngl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;\r\n}\r\n}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);\r\nv_data=vec3(extrude.x,extrude.y,antialiasblur);\r\n}"),Xe=fi("void main() {\r\ngl_FragColor=vec4(1.0);\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),He=fi("uniform highp float u_intensity;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main() {\r\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);\r\nfloat val=weight*u_intensity*GAUSS_COEF*exp(d);\r\ngl_FragColor=vec4(val,1.0,1.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform float u_extrude_scale;\r\nuniform float u_opacity;\r\nuniform float u_intensity;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_extrude;\r\n#pragma mapbox: define highp float weight\r\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\r\nvoid main(void) {\r\n#pragma mapbox: initialize highp float weight\r\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);\r\ngl_Position=u_matrix*pos;\r\n}"),Ke=fi("uniform sampler2D u_image;\r\nuniform sampler2D u_color_ramp;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\nfloat t=texture2D(u_image,v_pos).r;\r\nvec4 color=texture2D(u_color_ramp,vec2(t,0.5));\r\ngl_FragColor=color*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"),Ye=fi("varying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nfloat alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),Je=fi("uniform float u_overscale_factor;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nfloat alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ncolor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {color*=.2;\r\n}\r\nfloat extrude_scale_length=length(v_extrude_scale);\r\nfloat extrude_length=length(v_extrude)*extrude_scale_length;\r\nfloat stroke_width=15.0*extrude_scale_length/u_overscale_factor;\r\nfloat radius=v_radius*extrude_scale_length;\r\nfloat distance_to_edge=abs(extrude_length-radius);\r\nfloat opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);\r\ngl_FragColor=opacity_t*color;\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\nhighp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\nv_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;\r\nv_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;\r\n}"),Qe=fi("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),$e=fi("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),ti=fi("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ei=fi("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ii=fi("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),ri=fi("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\nv_color*=u_opacity;\r\n}"),oi=fi("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n}"),ni=fi("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform float u_maxzoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),ai=fi("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat 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);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),si=fi("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),li=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),ci=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat 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;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),hi=fi("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat 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;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),ui=fi("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(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;\r\nrgb+=(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);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),pi=fi("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),di=fi("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"),_i=fi("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}");function fi(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return {fragmentSource:t=t.replace(i,(function(t,e,i,o,n){return r[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,o,n){var a="float"===o?"vec2":"vec4",s=n.match(/color/)?"color":a;return r[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"}))}}var mi=Object.freeze({__proto__:null,prelude:qe,background:Ve,backgroundPattern:Ge,circle:We,clippingMask:Xe,heatmap:He,heatmapTexture:Ke,collisionBox:Ye,collisionCircle:Je,debug:Qe,fill:$e,fillOutline:ti,fillOutlinePattern:ei,fillPattern:ii,fillExtrusion:ri,fillExtrusionPattern:oi,hillshadePrepare:ni,hillshade:ai,line:si,lineGradient:li,linePattern:ci,lineSDF:hi,raster:ui,symbolIcon:pi,symbolSDF:di,symbolTextAndIcon:_i}),gi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};gi.prototype.bind=function(t,e,i,r,o,n,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==r.length,c=0;!l&&c<r.length;c++)this.boundPaintVertexBuffers[c]!==r[c]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!l&&this.boundIndexBuffer===o&&this.boundVertexOffset===n&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),o&&o.dynamicDraw&&o.bind(),s&&s.bind()):this.freshBind(e,i,r,o,n,a,s);},gi.prototype.freshBind=function(t,e,i,r,o,n,a){var s,l=t.numAttributes,c=this.context,h=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=n,this.boundDynamicVertexBuffer2=a;else {s=c.currentNumAttributes||0;for(var u=l;u<s;u++)h.disableVertexAttribArray(u);}e.enableAttributes(h,t);for(var p=0,d=i;p<d.length;p+=1)d[p].enableAttributes(h,t);n&&n.enableAttributes(h,t),a&&a.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,o);for(var _=0,f=i;_<f.length;_+=1){var m=f[_];m.bind(),m.setVertexAttribPointers(h,t,o);}n&&(n.bind(),n.setVertexAttribPointers(h,t,o)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,t,o)),c.currentNumAttributes=l;},gi.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null);};var vi=function(t,e,i,r,o){var n=t.gl;this.program=n.createProgram();var a=i?i.defines():[];o&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(qe.fragmentSource,e.fragmentSource).join("\n"),l=a.concat(qe.vertexSource,e.vertexSource).join("\n"),c=n.createShader(n.FRAGMENT_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(c,s),n.compileShader(c),n.attachShader(this.program,c);var h=n.createShader(n.VERTEX_SHADER);if(n.isContextLost())this.failedToCreate=!0;else {n.shaderSource(h,l),n.compileShader(h),n.attachShader(this.program,h);for(var u=i?i.layoutAttributes:[],p=0;p<u.length;p++)n.bindAttribLocation(this.program,p,u[p].name);n.linkProgram(this.program),this.numAttributes=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),this.attributes={};for(var d={},_=0;_<this.numAttributes;_++){var f=n.getActiveAttrib(this.program,_);f&&(this.attributes[f.name]=n.getAttribLocation(this.program,f.name));}for(var m=n.getProgramParameter(this.program,n.ACTIVE_UNIFORMS),g=0;g<m;g++){var v=n.getActiveUniform(this.program,g);v&&(d[v.name]=n.getUniformLocation(this.program,v.name));}this.fixedUniforms=r(t,d),this.binderUniforms=i?i.getUniforms(t,d):[];}}};function yi(t,e,i){var r=1/ue(i,1,e.transform.tileZoom),o=Math.pow(2,i.tileID.overscaledZ),n=i.tileSize*Math.pow(2,e.transform.tileZoom)/o,a=n*(i.tileID.canonical.x+i.tileID.wrap*o),s=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:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}vi.prototype.draw=function(t,e,i,r,o,n,a,s,l,c,h,u,p,d,_,f){var m,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=h.get();x<b.length;x+=1){var w=b[x],E=w.vaos||(w.vaos={});(E[s]||(E[s]=new gi)).bind(t,this,l,d?d.getPaintVertexBuffers():[],c,w.vertexOffset,_,f),g.drawElements(e,w.primitiveLength*y,g.UNSIGNED_SHORT,w.primitiveOffset*y*2);}}};var xi=function(e,i,r,o){var n=i.style.light,a=n.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===n.properties.get("anchor")&&t.fromRotation(l,-i.transform.angle),t.transformMat3(s,s,l);var c=n.properties.get("color");return {u_matrix:e,u_lightpos:s,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+r,u_opacity:o}},bi=function(e,i,r,o,n,a,s){return t.extend(xi(e,i,r,o),yi(a,i,s),{u_height_factor:-Math.pow(2,n.overscaledZ)/s.tileSize/8})},wi=function(t){return {u_matrix:t}},Ei=function(e,i,r,o){return t.extend(wi(e),yi(r,i,o))},Ti=function(t,e){return {u_matrix:t,u_world:e}},Ci=function(e,i,r,o,n){return t.extend(Ei(e,i,r,o),{u_world:n})},Ii=function(e,i,r,o){var n,a,s=e.transform;if("map"===o.paint.get("circle-pitch-alignment")){var l=ue(r,1,s.zoom);n=!0,a=[l,l];}else n=!1,a=s.pixelsToGLUnits;return {u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===o.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(i.posMatrix,r,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+n,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},Si=function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},Pi=function(t,e,i){var r=ue(i,1,e.zoom),o=Math.pow(2,e.zoom-i.tileID.overscaledZ),n=i.tileID.overscaleFactor();return {u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*o),e.pixelsToGLUnits[1]/(r*o)],u_overscale_factor:n}},Mi=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},zi=function(t){return {u_matrix:t}},Li=function(t,e,i,r){return {u_matrix:t,u_extrude_scale:ue(e,1,i),u_intensity:r}},Ai=function(e,i,r){var o=e.transform;return {u_matrix:Oi(e,i,r),u_ratio:1/ue(i,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Di=function(e,i,r){return t.extend(Ai(e,i,r),{u_image:0})},Ri=function(e,i,r,o){var n=e.transform,a=Bi(i,n);return {u_matrix:Oi(e,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:1/ue(i,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},ki=function(e,i,r,o,n){var a=e.lineAtlas,s=Bi(i,e.transform),l="round"===r.layout.get("line-cap"),c=a.getDash(o.from,l),h=a.getDash(o.to,l),u=c.width*n.fromScale,p=h.width*n.toScale;return t.extend(Ai(e,i,r),{u_patternscale_a:[s/u,-c.height/2],u_patternscale_b:[s/p,-h.height/2],u_sdfgamma:a.width/(256*Math.min(u,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:h.y,u_mix:n.t})};function Bi(t,e){return 1/ue(t,1,e.tileZoom)}function Oi(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Fi=function(t,e,i,r,o){return {u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(a=o.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(n=o.paint.get("raster-contrast"),n>0?1/(1-n):1+n),u_spin_weights:Ui(o.paint.get("raster-hue-rotate"))};var n,a;};function Ui(t){t*=Math.PI/180;var 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]}var Ni=function(t,e,i,r,o,n,a,s,l,c){var h=o.transform;return {u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:n,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},Zi=function(e,i,r,o,n,a,s,l,c,h,u){var p=n.transform;return t.extend(Ni(e,i,r,o,n,a,s,l,c,h),{u_gamma_scale:o?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+u})},ji=function(e,i,r,o,n,a,s,l,c,h){return t.extend(Zi(e,i,r,o,n,a,s,l,!0,c,!0),{u_texsize_icon:h,u_texture_icon:1})},qi=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Vi=function(e,i,r,o,n,a){return t.extend(function(t,e,i,r){var o=i.imageManager.getPattern(t.from.toString()),n=i.imageManager.getPattern(t.to.toString()),a=i.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,r.tileID.overscaledZ),h=r.tileSize*Math.pow(2,i.transform.tileZoom)/c,u=h*(r.tileID.canonical.x+r.tileID.wrap*c),p=h*r.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ue(r,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,p>>16],u_pixel_coord_lower:[65535&u,65535&p]}}(o,a,r,n),{u_matrix:e,u_opacity:i})},Gi={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:Si,collisionCircle:Si,debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_maxzoom:new t.Uniform1f(e,i.u_maxzoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function Wi(t,e,i,r,o,n,a,s){for(var l=t.context,c=l.gl,h=t.useProgram(o?"collisionCircle":"collisionBox"),u=0;u<r.length;u++){var p=r[u],d=e.getTile(p),_=d.getBucket(i);if(_){var f=o?s?_.textCollisionCircle:_.iconCollisionCircle:s?_.textCollisionBox:_.iconCollisionBox;if(f){var m=p.posMatrix;0===n[0]&&0===n[1]||(m=t.translatePosMatrix(p.posMatrix,d,n,a)),h.draw(l,o?c.TRIANGLES:c.LINES,St.disabled,Pt.disabled,t.colorModeForRenderPass(),zt.disabled,Pi(m,t.transform,d),i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,t.transform.zoom,null,null,f.collisionVertexBuffer);}}}}function Xi(t,e,i,r,o,n,a){Wi(t,e,i,r,!1,o,n,a),Wi(t,e,i,r,!0,o,n,a);}var Hi=t.identity(new Float32Array(16));function Ki(e,i,r,o,n,a){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*i,c=-(s.verticalAlign-.5)*r,h=t.evaluateVariableOffset(e,o);return new t.Point((l/n+h[0])*a,(c/n+h[1])*a)}function Yi(e,i,r,o,n,a,s,l,c,h,u){var p=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,_=e.icon.dynamicLayoutVertexArray,f={};d.clear();for(var m=0;m<p.length;m++){var g=p.get(m),v=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:o[g.crossTileID];if(v){var y=new t.Point(g.anchorX,g.anchorY),x=Qt(y,r?l:s),b=.5+a.cameraToCenterDistance/x.signedDistanceFromCamera*.5,w=n.evaluateSizeForFeature(e.textSizeData,h,g)*b/t.ONE_EM;r&&(w*=e.tilePixelRatio/c);for(var E=Ki(v.anchor,v.width,v.height,v.textOffset,v.textBoxScale,w),T=r?Qt(y.add(E),s).point:x.point.add(i?E.rotate(-a.angle):E),C=e.allowVerticalPlacement&&g.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,I=0;I<g.numGlyphs;I++)t.addDynamicAttributes(d,T,C);u&&g.associatedIconIndex>=0&&(f[g.associatedIconIndex]={shiftedAnchor:T,angle:C});}else se(g.numGlyphs,d);}if(u){_.clear();for(var S=e.icon.placedSymbolArray,P=0;P<S.length;P++){var M=S.get(P);if(M.hidden)se(M.numGlyphs,_);else {var z=f[P];if(z)for(var L=0;L<M.numGlyphs;L++)t.addDynamicAttributes(_,z.shiftedAnchor,z.angle);else se(M.numGlyphs,_);}}e.icon.dynamicLayoutVertexBuffer.updateData(_);}e.text.dynamicLayoutVertexBuffer.updateData(d);}function Ji(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Qi(e,i,r,o,n,a,s,l,c,h,u,p){for(var d,_,f=e.context,m=f.gl,g=e.transform,v="map"===l,y="map"===c,x=v&&"point"!==r.layout.get("symbol-placement"),b=v&&!y&&!x,w=void 0!==r.layout.get("symbol-sort-key").constantOr(1),E=e.depthModeForSublayer(0,St.ReadOnly),T=r.layout.get("text-variable-anchor"),C=[],I=0,S=o;I<S.length;I+=1){var P=S[I],M=i.getTile(P),z=M.getBucket(r);if(z){var L=n?z.text:z.icon;if(L&&L.segments.get().length){var A=L.programConfigurations.get(r.id),D=n||z.sdfIcons,R=n?z.textSizeData:z.iconSizeData,k=y||0!==g.pitch;d||(d=e.useProgram(Ji(D,n,z),A),_=t.evaluateSizeForZoom(R,g.zoom));var B=void 0,O=[0,0],F=void 0,U=void 0,N=null,Z=void 0;if(n)F=M.glyphAtlasTexture,U=m.LINEAR,B=M.glyphAtlasTexture.size,z.iconsInText&&(O=M.imageAtlasTexture.size,N=M.imageAtlasTexture,Z=k||e.options.rotating||e.options.zooming||"composite"===R.kind||"camera"===R.kind?m.LINEAR:m.NEAREST);else {var j=1!==r.layout.get("icon-size").constantOr(0)||z.iconsNeedLinear;F=M.imageAtlasTexture,U=D||e.options.rotating||e.options.zooming||j||k?m.LINEAR:m.NEAREST,B=M.imageAtlasTexture.size;}var q=ue(M,1,e.transform.zoom),V=Yt(P.posMatrix,y,v,e.transform,q),G=Jt(P.posMatrix,y,v,e.transform,q),W=T&&z.hasTextData(),X="none"!==r.layout.get("icon-text-fit")&&W&&z.hasIconData();x&&te(z,P.posMatrix,e,n,V,G,y,h);var H=e.translatePosMatrix(P.posMatrix,M,a,s),K=x||n&&T||X?Hi:V,Y=e.translatePosMatrix(G,M,a,s,!0),J=D&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:d,buffers:L,uniformValues:D?z.iconsInText?ji(R.kind,_,b,y,e,H,K,Y,B,O):Zi(R.kind,_,b,y,e,H,K,Y,n,B,!0):Ni(R.kind,_,b,y,e,H,K,Y,n,B),atlasTexture:F,atlasTextureIcon:N,atlasInterpolation:U,atlasInterpolationIcon:Z,isSDF:D,hasHalo:J};if(w)for(var $=0,tt=L.segments.get();$<tt.length;$+=1){var et=tt[$];C.push({segments:new t.SegmentVector([et]),sortKey:et.sortKey,state:Q});}else C.push({segments:L.segments,sortKey:0,state:Q});}}}w&&C.sort((function(t,e){return t.sortKey-e.sortKey}));for(var it=0,rt=C;it<rt.length;it+=1){var ot=rt[it],nt=ot.state;if(f.activeTexture.set(m.TEXTURE0),nt.atlasTexture.bind(nt.atlasInterpolation,m.CLAMP_TO_EDGE),nt.atlasTextureIcon&&(f.activeTexture.set(m.TEXTURE1),nt.atlasTextureIcon&&nt.atlasTextureIcon.bind(nt.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),nt.isSDF){var at=nt.uniformValues;nt.hasHalo&&(at.u_is_halo=1,$i(nt.buffers,ot.segments,r,e,nt.program,E,u,p,at)),at.u_is_halo=0;}$i(nt.buffers,ot.segments,r,e,nt.program,E,u,p,nt.uniformValues);}}function $i(t,e,i,r,o,n,a,s,l){var c=r.context;o.draw(c,c.gl.TRIANGLES,n,a,s,zt.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer);}function tr(t,e,i,r,o,n,a){var s,l,c,h,u,p=t.context.gl,d=i.paint.get("fill-pattern"),_=d&&d.constantOr(1),f=i.getCrossfadeParameters();a?(l=_&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=_?"fillPattern":"fill",s=p.TRIANGLES);for(var m=0,g=r;m<g.length;m+=1){var v=g[m],y=e.getTile(v);if(!_||y.patternsLoaded()){var x=y.getBucket(i);if(x){var b=x.programConfigurations.get(i.id),w=t.useProgram(l,b);_&&(t.context.activeTexture.set(p.TEXTURE0),y.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePaintBuffers(f));var E=d.constantOr(null);if(E&&y.imageAtlas){var T=y.imageAtlas,C=T.patternPositions[E.to.toString()],I=T.patternPositions[E.from.toString()];C&&I&&b.setConstantPatternPositions(C,I);}var S=t.translatePosMatrix(v.posMatrix,y,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){h=x.indexBuffer2,u=x.segments2;var P=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&_?Ci(S,t,f,y,P):Ti(S,P);}else h=x.indexBuffer,u=x.segments,c=_?Ei(S,t,f,y):wi(S);w.draw(t.context,s,o,t.stencilModeForClipping(v),n,zt.disabled,c,i.id,x.layoutVertexBuffer,h,u,i.paint,t.transform.zoom,b);}}}}function er(t,e,i,r,o,n,a){for(var s=t.context,l=s.gl,c=i.paint.get("fill-extrusion-pattern"),h=c.constantOr(1),u=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),d=0,_=r;d<_.length;d+=1){var f=_[d],m=e.getTile(f),g=m.getBucket(i);if(g){var v=g.programConfigurations.get(i.id),y=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",v);h&&(t.context.activeTexture.set(l.TEXTURE0),m.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(u));var x=c.constantOr(null);if(x&&m.imageAtlas){var b=m.imageAtlas,w=b.patternPositions[x.to.toString()],E=b.patternPositions[x.from.toString()];w&&E&&v.setConstantPatternPositions(w,E);}var T=t.translatePosMatrix(f.posMatrix,m,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),C=i.paint.get("fill-extrusion-vertical-gradient"),I=h?bi(T,t,C,p,f,u,m):xi(T,t,C,p);y.draw(s,s.gl.TRIANGLES,o,n,a,zt.backCCW,I,i.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,i.paint,t.transform.zoom,v);}}}function ir(e,i,r,o,n,a){var s=e.context,l=s.gl,c=i.fbo;if(c){var h=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());var u=function(e,i,r){var o=r.paint.get("hillshade-shadow-color"),n=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,c,h,u=!e.options.moving;return {u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),u),u_image:0,u_latrange:(l=i.tileID,c=Math.pow(2,l.canonical.z),h=l.canonical.y,[new t.MercatorCoordinate(0,h/c).toLngLat().lat,new t.MercatorCoordinate(0,(h+1)/c).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:o,u_highlight:n,u_accent:a}}(e,i,r);h.draw(s,l.TRIANGLES,o,n,a,zt.disabled,u,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments);}}function rr(e,i,r,o,n,a,s){var l=e.context,c=l.gl,h=i.dem;if(h&&h.data){var u=h.dim,p=h.stride,d=h.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(p),i.demTexture){var _=i.demTexture;_.update(d,{premultiply:!1}),_.bind(c.NEAREST,c.CLAMP_TO_EDGE);}else i.demTexture=new t.Texture(l,d,c.RGBA,{premultiply:!1}),i.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);var f=i.fbo;if(!f){var m=new t.Texture(l,{width:u,height:u,data:null},c.RGBA);m.bind(c.LINEAR,c.CLAMP_TO_EDGE),(f=i.fbo=l.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture);}l.bindFramebuffer.set(f.framebuffer),l.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,n,a,s,zt.disabled,function(e,i,r){var o=i.stride,n=t.create();return t.ortho(n,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(n,n,[0,-t.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[o,o],u_zoom:e.overscaledZ,u_maxzoom:r,u_unpack:i.getUnpackVector()}}(i.tileID,h,o),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1;}}function or(e,i,r,o,n){var a=o.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,c=i?(s-i.timeAdded)/a:-1,h=r.getSource(),u=n.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}var nr=new t.Color(1,0,0,1),ar=new t.Color(0,1,0,1),sr=new t.Color(0,0,1,1),lr=new t.Color(1,0,1,1),cr=new t.Color(0,1,1,1);function hr(t,e,i,r){pr(t,0,e+i/2,t.transform.width,i,r);}function ur(t,e,i,r){pr(t,e-i/2,0,i,t.transform.height,r);}function pr(e,i,r,o,n,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST);}function dr(e,i,r){var o=e.context,n=o.gl,a=r.posMatrix,s=e.useProgram("debug"),l=St.disabled,c=Pt.disabled,h=e.colorModeForRenderPass();o.activeTexture.set(n.TEXTURE0),e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),s.draw(o,n.LINE_STRIP,l,c,h,zt.disabled,Mi(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var u=i.getTileByID(r.key).latestRawTileData,p=Math.floor((u&&u.byteLength||0)/1024),d=i.getTile(r).tileSize,_=512/Math.min(d,512)*(r.overscaledZ/e.transform.zoom)*.5,f=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(f+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(e,5,5),o.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE);}(e,f+" "+p+"kb"),s.draw(o,n.TRIANGLES,l,c,Mt.alphaBlended,zt.disabled,Mi(a,t.Color.transparent,_),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments);}var _r={symbol:function(e,i,r,o,n){if("translucent"===e.renderPass){var a=Pt.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,i,r,o,n,a,s){for(var l=i.transform,c="map"===n,h="map"===a,u=0,p=e;u<p.length;u+=1){var d=p[u],_=o.getTile(d),f=_.getBucket(r);if(f&&f.text&&f.text.segments.get().length){var m=t.evaluateSizeForZoom(f.textSizeData,l.zoom),g=ue(_,1,i.transform.zoom),v=Yt(d.posMatrix,h,c,i.transform,g),y="none"!==r.layout.get("icon-text-fit")&&f.hasIconData();if(m){var x=Math.pow(2,l.zoom-_.tileID.overscaledZ);Yi(f,c,h,s,t.symbolSize,l,v,d.posMatrix,x,m,y);}}}}(o,e,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),n),0!==r.paint.get("icon-opacity").constantOr(1)&&Qi(e,i,r,o,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&Qi(e,i,r,o,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),i.map.showCollisionBoxes&&(Xi(e,i,r,o,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Xi(e,i,r,o,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1));}},circle:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,h=c.gl,u=e.depthModeForSublayer(0,St.ReadOnly),p=Pt.disabled,d=e.colorModeForRenderPass(),_=[],f=0;f<o.length;f++){var m=o[f],g=i.getTile(m),v=g.getBucket(r);if(v){var y=v.programConfigurations.get(r.id),x={programConfiguration:y,program:e.useProgram("circle",y),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:Ii(e,m,g,r)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var E=w[b];_.push({segments:new t.SegmentVector([E]),sortKey:E.sortKey,state:x});}else _.push({segments:v.segments,sortKey:0,state:x});}}l&&_.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,C=_;T<C.length;T+=1){var I=C[T],S=I.state;S.program.draw(c,h.TRIANGLES,u,p,d,zt.disabled,S.uniformValues,r.id,S.layoutVertexBuffer,S.indexBuffer,I.segments,r.paint,e.transform.zoom,S.programConfiguration);}}}},heatmap:function(e,i,r,o){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var n=e.context,a=n.gl,s=Pt.disabled,l=new Mt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=i.heatmapFbo;if(o)r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else {var n=r.createTexture();r.bindTexture(r.TEXTURE_2D,n),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),o=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function t(e,i,r,o){var n=e.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,i.width/4,i.height/4,0,n.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),o.colorAttachment.set(r),e.extTextureHalfFloat&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,o.colorAttachment.setDirty(),t(e,i,r,o));}(t,e,n,o);}}(n,e,r),n.clear({color:t.Color.transparent});for(var c=0;c<o.length;c++){var h=o[c];if(!i.hasRenderableParent(h)){var u=i.getTile(h),p=u.getBucket(r);if(p){var d=p.programConfigurations.get(r.id);e.useProgram("heatmap",d).draw(n,a.TRIANGLES,St.disabled,s,l,zt.disabled,Li(h.posMatrix,u,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.zoom,d);}}}n.viewport.set([0,0,e.width,e.height]);}else "translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var r=e.context,o=r.gl,n=i.heatmapFbo;if(n){r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.colorAttachment.get()),r.activeTexture.set(o.TEXTURE1);var a=i.colorRampTexture;a||(a=i.colorRampTexture=new t.Texture(r,i.colorRamp,o.RGBA)),a.bind(o.LINEAR,o.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,o.TRIANGLES,St.disabled,Pt.disabled,e.colorModeForRenderPass(),zt.disabled,function(e,i,r,o){var n=t.create();t.ortho(n,0,e.width,e.height,0,0,1);var a=e.context.gl;return {u_matrix:n,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}}(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom);}}(e,r));},line:function(e,i,r,o){if("translucent"===e.renderPass){var n=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==n.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,St.ReadOnly),l=e.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),h=r.paint.get("line-pattern"),u=h.constantOr(1),p=r.paint.get("line-gradient"),d=r.getCrossfadeParameters(),_=u?"linePattern":c?"lineSDF":p?"lineGradient":"line",f=e.context,m=f.gl,g=!0;if(p){f.activeTexture.set(m.TEXTURE0);var v=r.gradientTexture;if(!r.gradient)return;v||(v=r.gradientTexture=new t.Texture(f,r.gradient,m.RGBA)),v.bind(m.LINEAR,m.CLAMP_TO_EDGE);}for(var y=0,x=o;y<x.length;y+=1){var b=x[y],w=i.getTile(b);if(!u||w.patternsLoaded()){var E=w.getBucket(r);if(E){var T=E.programConfigurations.get(r.id),C=e.context.program.get(),I=e.useProgram(_,T),S=g||I.program!==C,P=h.constantOr(null);if(P&&w.imageAtlas){var M=w.imageAtlas,z=M.patternPositions[P.to.toString()],L=M.patternPositions[P.from.toString()];z&&L&&T.setConstantPatternPositions(z,L);}var A=u?Ri(e,w,r,d):c?ki(e,w,r,c,d):p?Di(e,w,r):Ai(e,w,r);u?(f.activeTexture.set(m.TEXTURE0),w.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),T.updatePaintBuffers(d)):c&&(S||e.lineAtlas.dirty)&&(f.activeTexture.set(m.TEXTURE0),e.lineAtlas.bind(f)),I.draw(f,m.TRIANGLES,s,e.stencilModeForClipping(b),l,zt.disabled,A,r.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,r.paint,e.transform.zoom,T),g=!1;}}}}}},fill:function(e,i,r,o){var n=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===n.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var h=e.depthModeForSublayer(1,"opaque"===e.renderPass?St.ReadWrite:St.ReadOnly);tr(e,i,r,o,h,s,!1);}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var u=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,St.ReadOnly);tr(e,i,r,o,u,s,!0);}}},"fill-extrusion":function(t,e,i,r){var o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){var n=new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))er(t,e,i,r,n,Pt.disabled,Mt.disabled),er(t,e,i,r,n,t.stencilModeFor3D(),t.colorModeForRenderPass());else {var a=t.colorModeForRenderPass();er(t,e,i,r,n,Pt.disabled,a);}}},hillshade:function(t,e,i,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,n=e.getSource().maxzoom,a=t.depthModeForSublayer(0,St.ReadOnly),s=t.colorModeForRenderPass(),l="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],c=l[0],h=0,u=l[1];h<u.length;h+=1){var p=u[h],d=e.getTile(p);d.needsHillshadePrepare&&"offscreen"===t.renderPass?rr(t,d,i,n,a,Pt.disabled,s):"translucent"===t.renderPass&&ir(t,d,i,a,c[p.overscaledZ],s);}o.viewport.set([0,0,t.width,t.height]);}},raster:function(t,e,i,r){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&r.length)for(var o=t.context,n=o.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=a instanceof P?[{},r]:t.stencilConfigForOverlap(r),h=c[0],u=c[1],p=u[u.length-1].overscaledZ,d=!t.options.moving,_=0,f=u;_<f.length;_+=1){var m=f[_],g=t.depthModeForSublayer(m.overscaledZ-p,1===i.paint.get("raster-opacity")?St.ReadWrite:St.ReadOnly,n.LESS),v=e.getTile(m),y=t.transform.calculatePosMatrix(m.toUnwrapped(),d);v.registerFadeDuration(i.paint.get("raster-fade-duration"));var x=e.findLoadedParent(m,0),b=or(v,x,e,i,t.transform),w=void 0,E=void 0,T="nearest"===i.paint.get("raster-resampling")?n.NEAREST:n.LINEAR;o.activeTexture.set(n.TEXTURE0),v.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(n.TEXTURE1),x?(x.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-v.tileID.overscaledZ),E=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(T,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST);var C=Fi(y,E||[0,0],w||1,b,i);a instanceof P?s.draw(o,n.TRIANGLES,g,Pt.disabled,l,zt.disabled,C,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(o,n.TRIANGLES,g,h[m.overscaledZ],l,zt.disabled,C,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments);}},background:function(t,e,i){var r=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0!==o){var n=t.context,a=n.gl,s=t.transform,l=s.tileSize,c=i.paint.get("background-pattern");if(!t.isPatternMissing(c)){var h=!c&&1===r.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===h){var u=Pt.disabled,p=t.depthModeForSublayer(0,"opaque"===h?St.ReadWrite:St.ReadOnly),d=t.colorModeForRenderPass(),_=t.useProgram(c?"backgroundPattern":"background"),f=s.coveringTiles({tileSize:l});c&&(n.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var m=i.getCrossfadeParameters(),g=0,v=f;g<v.length;g+=1){var y=v[g],x=t.transform.calculatePosMatrix(y.toUnwrapped()),b=c?Vi(x,o,t,c,{tileID:y,tileSize:l},m):qi(x,o,r);_.draw(n,a.TRIANGLES,p,u,d,zt.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments);}}}}},debug:function(t,e,i){for(var r=0;r<i.length;r++)dr(t,e,i[r]);},custom:function(t,e,i){var r=t.context,o=i.implementation;if("offscreen"===t.renderPass){var n=o.prerender;n&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),n.call(o,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState());}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Pt.disabled);var a="3d"===o.renderingMode?new St(t.context.gl.LEQUAL,St.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,St.ReadOnly);r.setDepthMode(a),o.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null);}}},fr=function(t,e){this.context=new Lt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=At.maxUnderzooming+At.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Be,this.gpuTimers={};};fr.prototype.resize=function(e,i){if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,o=this.style._order;r<o.length;r+=1)this.style._layers[o[r]].resize();},fr.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,je.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,je.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(o,S.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(n,je.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Pt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO);},fr.prototype.clearStencil=function(){var e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,St.disabled,this.stencilClearMode,Mt.disabled,zt.disabled,zi(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments);},fr.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Mt.disabled),i.setDepthMode(St.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var n=0,a=e;n<a.length;n+=1){var s=a[n],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;o.draw(i,r.TRIANGLES,St.disabled,new Pt({func:r.ALWAYS,mask:0},l,255,r.KEEP,r.KEEP,r.REPLACE),Mt.disabled,zt.disabled,zi(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);}}},fr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Pt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Pt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},fr.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),o=r[r.length-1].overscaledZ,n=r[0].overscaledZ-o+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();for(var a={},s=0;s<n;s++)a[s+o]=new Pt({func:i.GEQUAL,mask:255},s+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=n,[a,r]}return [(e={},e[o]=Pt.disabled,e),r]},fr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Mt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Mt.unblended:Mt.alphaBlended},fr.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return St.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new St(i||this.context.gl.LEQUAL,e,[r,r])},fr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},fr.prototype.render=function(e,i){var r=this;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var o=this.style._order,n=this.style.sourceCaches;for(var a in n){var s=n[a];s.used&&s.prepare(this.context);}var l,c,h={},u={},p={};for(var d in n){var _=n[d];h[d]=_.getVisibleCoordinates(),u[d]=h[d].slice().reverse(),p[d]=_.getVisibleCoordinates(!0).reverse();}this.opaquePassCutoff=1/0;for(var f=0;f<o.length;f++)if(this.style._layers[o[f]].is3D()){this.opaquePassCutoff=f;break}this.renderPass="offscreen";for(var m=0,g=o;m<g.length;m+=1){var v=this.style._layers[g[m]];if(v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)){var y=u[v.source];("custom"===v.type||y.length)&&this.renderLayer(this,n[v.source],v,y);}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=n[x.source],w=h[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w);}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var E=this.style._layers[o[this.currentLayer]],T=n[E.source],C=("symbol"===E.type?p:u)[E.source];this._renderTileClippingMasks(E,h[E.source]),this.renderLayer(this,T,E,C);}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(c&&c.id)&&(c=r.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c));})),l&&_r.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;hr(t,t.transform.height-(e.top||0),3,nr),hr(t,e.bottom||0,3,ar),ur(t,e.left||0,3,sr),ur(t,t.transform.width-(e.right||0),3,lr);var i=t.transform.centerPoint;!function(t,e,i,r){pr(t,e-1,i-10,2,20,r),pr(t,e-10,i-1,20,2,r);}(t,i.x,t.transform.height-i.y,cr);}(this),this.context.setDefault();},fr.prototype.renderLayer=function(t,e,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,this.gpuTimingStart(i),_r[i.type](t,e,i,r,this.style.placement.variableOffsets),this.gpuTimingEnd());},fr.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query);}},fr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT);}},fr.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},fr.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var r=t[i],o=this.context.extTimerQuery,n=o.getQueryObjectEXT(r.query,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r.query),e[i]=n;}return e},fr.prototype.translatePosMatrix=function(e,i,r,o,n){if(!r[0]&&!r[1])return e;var a=n?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);r=[r[0]*l-r[1]*s,r[0]*s+r[1]*l];}var c=[n?r[0]:ue(i,r[0],this.transform.zoom),n?r[1]:ue(i,r[1],this.transform.zoom),0],h=new Float32Array(16);return t.translate(h,e,c),h},fr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t];},fr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},fr.prototype.isPatternMissing=function(t){if(!t)return !1;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return !e||!i},fr.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new vi(this.context,mi[t],e,Gi[t],this._showOverdrawInspector)),this.cache[i]},fr.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault();},fr.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD);},fr.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA));},fr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy();};var mr=function(t,e){this.points=t,this.planes=e;};mr.fromInvProjectionMatrix=function(e,i,r){var o=Math.pow(2,r),n=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(i){return t.transformMat4([],i,e)})).map((function(e){return t.scale$1([],e,1/e[3]/i*o)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var i=t.sub([],n[e[0]],n[e[1]]),r=t.sub([],n[e[2]],n[e[1]]),o=t.normalize([],t.cross([],i,r)),a=-t.dot(o,n[e[1]]);return o.concat(a)}));return new mr(n,a)};var gr=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5);};gr.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],r=t.clone$2(this.min),o=t.clone$2(this.max),n=0;n<i.length;n++)r[n]=i[n]?this.min[n]:this.center[n],o[n]=i[n]?this.center[n]:this.max[n];return o[2]=this.max[2],new gr(r,o)},gr.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},gr.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},gr.prototype.intersects=function(e){for(var i=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],r=!0,o=0;o<e.planes.length;o++){for(var n=e.planes[o],a=0,s=0;s<i.length;s++)a+=t.dot$1(n,i[s])>=0;if(0===a)return 0;a!==i.length&&(r=!1);}if(r)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,h=-Number.MAX_VALUE,u=0;u<e.points.length;u++){var p=e.points[u][l]-this.min[l];c=Math.min(c,p),h=Math.max(h,p);}if(h<0||c>this.max[l]-this.min[l])return 0}return 1};var vr=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r;};vr.prototype.interpolate=function(e,i,r){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,r)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,r)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,r)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,r)),this},vr.prototype.getCenter=function(e,i){var r=t.clamp((this.left+e-this.right)/2,0,e),o=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(r,o)},vr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},vr.prototype.clone=function(){return new vr(this.top,this.bottom,this.left,this.right)},vr.prototype.toJSON=function(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var yr=function(e,i,r,o,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==r?0:r,this._maxPitch=null==o?60:o,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._resetZoomScale=!0;},xr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},resetZoomScale:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};yr.prototype.clone=function(){var t=new yr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},xr.minZoom.get=function(){return this._minZoom},xr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},xr.maxZoom.get=function(){return this._maxZoom},xr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},xr.minPitch.get=function(){return this._minPitch},xr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},xr.maxPitch.get=function(){return this._maxPitch},xr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},xr.renderWorldCopies.get=function(){return this._renderWorldCopies},xr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},xr.worldSize.get=function(){return this.tileSize*this.scale},xr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},xr.size.get=function(){return new t.Point(this.width,this.height)},xr.bearing.get=function(){return -this.angle/Math.PI*180},xr.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},xr.pitch.get=function(){return this._pitch/Math.PI*180},xr.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());},xr.fov.get=function(){return this._fov/Math.PI*180},xr.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices());},xr.zoom.get=function(){return this._zoom},xr.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices());},xr.center.get=function(){return this._center},xr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},xr.padding.get=function(){return this._edgeInsets.toJSON()},xr.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},xr.resetZoomScale.set=function(t){this._resetZoomScale=t;},xr.resetZoomScale.get=function(){return this._resetZoomScale},xr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},yr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},yr.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices();},yr.prototype.coveringZoomLevel=function(t){return (t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},yr.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),o=this.pointCoordinate(new t.Point(this.width,0)),n=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,o.x,n.x,a.x)),l=Math.floor(Math.max(r.x,o.x,n.x,a.x)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},yr.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),r=i;if(void 0!==e.minzoom&&i<e.minzoom)return [];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center),n=Math.pow(2,i),a=[n*o.x,n*o.y,0],s=mr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var c=function(t){return {aabb:new gr([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},h=[],u=[],p=i,d=e.reparseOverscaled?r:i;if(this._renderWorldCopies)for(var _=1;_<=3;_++)h.push(c(-_)),h.push(c(_));for(h.push(c(0));h.length>0;){var f=h.pop(),m=f.x,g=f.y,v=f.fullyVisible;if(!v){var y=f.aabb.intersects(s);if(0===y)continue;v=2===y;}var x=f.aabb.distanceX(a),b=f.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(f.zoom===p||w>3+(1<<p-f.zoom)-2&&f.zoom>=l)u.push({tileID:new t.OverscaledTileID(f.zoom===p?d:f.zoom,f.wrap,f.zoom,m,g),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-g])});else for(var E=0;E<4;E++){var T=(m<<1)+E%2,C=(g<<1)+(E>>1);h.push({aabb:f.aabb.quadrant(E),zoom:f.zoom+1,x:T,y:C,wrap:f.wrap,fullyVisible:v});}}return u.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},yr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},xr.unmodified.get=function(){return this._unmodified},yr.prototype.zoomScale=function(t){return Math.pow(2,t)},yr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},yr.prototype.project=function(e){var i=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(this.lngX(e.lng),this.latY(i))},yr.prototype.unproject=function(e){return new t.LngLat(this.xLng(e.x),this.yLat(e.y))},xr.point.get=function(){return this.project(this.center)},yr.prototype.lngX=function(t){return (180+t)*this.worldSize/360},yr.prototype.latY=function(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},yr.prototype.xLng=function(t){return 360*t/this.worldSize-180},yr.prototype.yLat=function(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t/this.worldSize)*Math.PI/180))-90},yr.prototype.setLocationAtPoint=function(e,i){var r=this.pointCoordinate(i),o=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(e),a=new t.MercatorCoordinate(n.x-(r.x-o.x),n.y-(r.y-o.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap());},yr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},yr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},yr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},yr.prototype.coordinateLocation=function(t){return t.toLngLat()},yr.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var o=i[3],n=r[3],a=i[1]/o,s=r[1]/n,l=i[2]/o,c=r[2]/n,h=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(i[0]/o,r[0]/n,h)/this.worldSize,t.number(a,s,h)/this.worldSize)},yr.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},yr.prototype.getBounds=function(){return (new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},yr.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},yr.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude]);},yr.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var r=e.key,o=i?this._alignedPosMatrixCache:this._posMatrixCache;if(o[r])return o[r];var n=e.canonical,a=this.worldSize/this.zoomScale(n.z),s=n.x+Math.pow(2,n.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,n.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),o[r]=new Float32Array(l),o[r]},yr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},yr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,r,o,n=-90,a=90,s=-180,l=180,c=this.size,h=this._unmodified;if(this.lngRange&&this.latRange){var u=this.lngRange,p=this.latRange,d=this.project({lng:u[0],lat:p[1]}),_=this.project({lng:u[1],lat:p[0]}),f=d.x,m=d.y,g=_.x,v=_.y,y=Math.min(f,g),x=Math.max(f,g),b=Math.min(v,m),w=Math.max(v,m);i=(l=x)-(s=y)<c.x?c.x/(l-s):0,e=(a=w)-(n=b)<c.y?c.y/(a-n):0;}else if(this.lngRange){var E=this.lngRange;s=this.project({lng:E[0],lat:0}).x,i=(l=this.project({lng:E[1],lat:0}).x)-s<c.x?c.x/(l-s):0;}else if(this.latRange){var T=this.latRange;n=this.project({lng:0,lat:T[1]}).y,e=(a=this.project({lng:0,lat:T[0]}).y)-n<c.y?c.y/(a-n):0;}var C=this.point,I=Math.max(i||0,e||0);if(I&&this._resetZoomScale)return this.center=this.unproject(new t.Point(i?(l+s)/2:C.x,e?(a+n)/2:C.y)),this.zoom+=this.scaleZoom(I),this._unmodified=h,void(this._constraining=!1);if(this.latRange){var S=C.y,P=c.y/2;S-P<n&&(o=n+P),S+P>a&&(o=a-P);}if(this.lngRange){var M=C.x,z=c.x/2;M-z<s&&(r=s+z),M+z>l&&(r=l-z);}r>Number.MAX_VALUE||r<-Number.MAX_VALUE||o>Number.MAX_VALUE||o<-Number.MAX_VALUE||(void 0===r&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==r?r:C.x,void 0!==o?o:C.y))),this._unmodified=h,this._constraining=!1);}},yr.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),o=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-r,.01,Math.PI-.01)),n=this.point,a=n.x,s=n.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*o+this.cameraToCenterDistance),c=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,c,l),h[8]=2*-e.x/this.width,h[9]=2*e.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-a,-s,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]);var u=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"===this.units&&(u=this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(h,h,[1,1,u,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,_=Math.cos(this.angle),f=Math.sin(this.angle),m=a-Math.round(a)+_*p+f*d,g=s-Math.round(s)+_*d+f*p,v=new Float64Array(h);if(t.translate(v,v,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={};}},yr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},yr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},yr.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return [e[0],i];for(var r=i.x,o=i.y,n=i.x,a=i.y,s=0,l=e;s<l.length;s+=1){var c=l[s];r=Math.min(r,c.x),o=Math.min(o,c.y),n=Math.max(n,c.x),a=Math.max(a,c.y);}return [new t.Point(r,o),new t.Point(n,o),new t.Point(n,a),new t.Point(r,a),new t.Point(r,o)]},Object.defineProperties(yr.prototype,xr);var br=function(e){var i,r,o,n;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(i=this._updateHashUnthrottled.bind(this),r=!1,o=null,n=function(){o=null,r&&(i(),o=setTimeout(n,300),r=!1);},function(){return r=!0,o||n(),o});};br.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},br.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},br.prototype.getHashString=function(e){var i=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,o=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,o),a=Math.round(i.lng*n)/n,s=Math.round(i.lat*n)/n,l=this._map.getBearing(),c=this._map.getPitch(),h="";if(h+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+="/"+Math.round(c)),this._hashName){var u=this._hashName,p=!1,d=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===u?(p=!0,e+"="+h):t})).filter((function(t){return t}));return p||d.push(u+"="+h),"#"+d.join("&")}return "#"+h},br.prototype._getCurrentHash=function(){var e,i=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===i._hashName&&(e=t);})),(e&&e[1]||"").split("/")):r.split("/")},br.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return !1},br.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var wr=function(e){function r(r,o,n,a){void 0===a&&(a={});var s=i.mousePos(o.getCanvasContainer(),n),l=o.unproject(s);e.call(this,r,t.extend({point:s,lngLat:l,originalEvent:n},a)),this._defaultPrevented=!1,this.target=o;}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),Er=function(e){function r(r,o,n){var a=i.touchPos(o.getCanvasContainer(),n),s=a.map((function(t){return o.unproject(t)})),l=a.reduce((function(t,e,i,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=o.unproject(l);e.call(this,r,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:n}),this._defaultPrevented=!1;}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),Tr=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),this._defaultPrevented=!1;}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0;},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),Cr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};Cr.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},Cr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},Cr.prototype.isEnabled=function(){return !!this._enabled},Cr.prototype.isActive=function(){return !!this._active},Cr.prototype.isZooming=function(){return !!this._zooming},Cr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},Cr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Cr.prototype.onWheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),o=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this.isActive()||this._start(e)),e.preventDefault();}},Cr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t);},Cr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame));}},Cr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var i=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var a="number"==typeof this._targetZoom?this._targetZoom:i.zoom,s=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&s&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),u=l(h);i.zoom=t.number(s,a,u),h<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0;}else i.zoom=a,c=!0;i.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom;}),200));}},Cr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var r=this._prevEase,o=(t.browser.now()-r.start)/r.duration,n=r.easing(o+.01)-r.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=t.bezier(a,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i};var Ir=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this);};Ir.prototype.isEnabled=function(){return !!this._enabled},Ir.prototype.isActive=function(){return !!this._active},Ir.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Ir.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Ir.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=this._lastPos=i.mousePos(this._el,e),this._active=!0);},Ir.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(r.x,e.x),n=Math.max(r.x,e.x),a=Math.min(r.y,e.y),s=Math.max(r.y,e.y);i.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=n-o+"px",this._box.style.height=s-a+"px";}},Ir.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,o=i.mousePos(this._el,e);this._finish(),i.suppressClick(),r.x===o.x&&r.y===o.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(r,o,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}));}},Ir.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t));},Ir.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos;},Ir.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var Sr=t.bezier(0,0,.25,1),Pr=function(e,i){this._map=e,this._el=i.element||e.getCanvasContainer(),this._state="disabled",this._button=i.button||"right",this._bearingSnap=i.bearingSnap||0,this._pitchWithRotate=!1!==i.pitchWithRotate,this._clickTolerance=i.clickTolerance||1,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this);};Pr.prototype.isEnabled=function(){return "disabled"!==this._state},Pr.prototype.isActive=function(){return "active"===this._state},Pr.prototype.enable=function(){this.isEnabled()||(this._state="enabled");},Pr.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},Pr.prototype.onMouseDown=function(e){if("enabled"===this._state){var r="touchstart"===e.type;if(r)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=i.mouseButton(e),e.altKey||e.metaKey)return;if(this._eventButton!==(e.ctrlKey?0:2))return}else {if(e.ctrlKey||0!==i.mouseButton(e))return;this._eventButton=0;}i.disableDrag(),r?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault();}},Pr.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);this._lastPos.equals(e)||"pending"===this._state&&e.dist(this._startPos)<this._clickTolerance||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},Pr.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var i=this._map.transform,r=this._prevPos,o=this._lastPos,n=i.bearing-.8*(r.x-o.x),a=i.pitch- -.5*(r.y-o.y),s=this._inertia,l=s[s.length-1];this._drainInertiaBuffer(),s.push([t.browser.now(),this._map._normalizeBearing(n,l[1])]);var c=i.bearing;if(i.bearing=n,this._pitchWithRotate){var h=i.pitch;i.pitch=a,i.pitch!==h&&this._fireEvent("pitch",e);}i.bearing!==c&&this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos;}},Pr.prototype._onMouseUp=function(t){var e="touchend"===t.type;if(e&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),e||i.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind();}},Pr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind();}},Pr.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),i.enableDrag();},Pr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos;},Pr.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var i=this._map,r=i.getBearing(),o=this._inertia,n=function(){Math.abs(r)<e._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t);};if(o.length<2)n();else {var a=o[0],s=o[o.length-1],l=i._normalizeBearing(r,o[o.length-2][1]),c=s[1]-a[1],h=c<0?-1:1,u=(s[0]-a[0])/1e3;if(0!==c&&0!==u){var p=Math.abs(c*(.25/u));p>180&&(p=180);var d=p/180;l+=h*p*(d/2),Math.abs(i._normalizeBearing(l,0))<this._bearingSnap&&(l=i._normalizeBearing(0,l)),i.rotateTo(l,{duration:1e3*d,easing:Sr,noMoveStart:!0},{originalEvent:t});}else n();}},Pr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},Pr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var Mr={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},zr=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=i.clickTolerance||1,this._inertiaOptions=Mr,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this);};zr.prototype.isEnabled=function(){return "disabled"!==this._state},zr.prototype.isActive=function(){return "active"===this._state},zr.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(Mr,e));},zr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},zr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==i.mouseButton(e)||(i.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)));},zr.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(i.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)));},zr.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=i.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]];},zr.prototype._touchesMatch=function(t,e){return !(!t||!e||t.length!==e.length)&&t.every((function(t,i){return e[i]===t}))},zr.prototype._onMove=function(e){e.preventDefault();var r=t.window.TouchEvent&&e instanceof t.window.TouchEvent?i.touchPos(this._el,e):null,o=i.mousePos(this._el,e);(r?this._touchesMatch(this._lastTouch,r):this._lastPos.equals(o))||"pending"===this._state&&o.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=o,this._lastTouch=r,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},zr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent;}},zr.prototype._onMouseUp=function(t){if(0===i.mouseButton(t))switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();}},zr.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t);}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind();}},zr.prototype._abort=function(e){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",e),this._fireEvent("moveend",e)),this._unbind(),this._deactivate(),t.window.TouchEvent&&e instanceof t.window.TouchEvent&&e.touches.length>1&&i.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind();}},zr.prototype._onBlur=function(t){this._abort(t);},zr.prototype._unbind=function(){i.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onTouchEnd),i.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.removeEventListener(t.window.document,"mouseup",this._onMouseUp),i.removeEventListener(t.window,"blur",this._onBlur);},zr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart;},zr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else {var i=e[e.length-1],r=e[0],o=i[1].sub(r[1]),n=(i[0]-r[0])/1e3;if(0===n||i[1].equals(r[1]))this._fireEvent("moveend",t);else {var a=this._inertiaOptions,s=a.linearity,l=a.easing,c=a.maxSpeed,h=a.deceleration,u=o.mult(s/n),p=u.mag();p>c&&(p=c,u._unit()._mult(p));var d=p/(h*s),_=u.mult(-d/2);this._map.panBy(_,{duration:1e3*d,easing:l,noMoveStart:!0},{originalEvent:t});}}},zr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},zr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var Lr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this);};function Ar(t){return t*(2-t)}Lr.prototype.isEnabled=function(){return !!this._enabled},Lr.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0);},Lr.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1);},Lr.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,r=0,o=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(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(n=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:Ar,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*i,pitch:a.getPitch()+10*r,offset:[100*-o,100*-n],center:a.getCenter()};a.easeTo(l,{originalEvent:t});}};var Dr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this);};Dr.prototype.isEnabled=function(){return !!this._enabled},Dr.prototype.isActive=function(){return !!this._active},Dr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Dr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Dr.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var i=this._tappedPoint;if(i&&i.dist(t.points[0])<=30){t.originalEvent.preventDefault();var r=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped();},o=function(){e._map.off("touchend",r),e._resetTapped();};this._map.once("touchend",r),this._map.once("touchcancel",o);}else this._resetTapped();}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null;}),300);},Dr.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null;},Dr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t));},Dr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t);},Dr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd);};var Rr=t.bezier(0,0,.15,1),kr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this);};kr.prototype.isEnabled=function(){return !!this._enabled},kr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around);},kr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1);},kr.prototype.disableRotation=function(){this._rotationDisabled=!0;},kr.prototype.enableRotation=function(){this._rotationDisabled=!1;},kr.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},kr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=i.mousePos(this._el,e.touches[0]),o=i.mousePos(this._el,e.touches[1]),n=r.add(o).div(2);this._startVec=r.sub(o),this._startAround=this._map.transform.pointLocation(n),this._gestureIntent=void 0,this._inertia=[],i.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(t.window.document,"touchend",this._onEnd);}},kr.prototype._getTouchEventData=function(t){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),o=e.sub(r);return {vec:o,center:e.add(r).div(2),scale:o.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI}},kr.prototype._onMove=function(e){if(2===e.touches.length){var i=this._getTouchEventData(e),r=i.vec,o=i.scale,n=i.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==o||Math.abs(1-o)>.15;Math.abs(n)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=r);}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault();}},kr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var i=this._map.transform;this._startScale||(this._startScale=i.scale,this._startBearing=i.bearing);var r=this._getTouchEventData(this._lastTouchEvent),o=r.center,n=r.bearing,a=r.scale,s=i.pointLocation(o),l=i.locationPoint(s);"rotate"===e&&(i.bearing=this._startBearing+n),i.zoom=i.scaleZoom(this._startScale*a),i.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,o]);}},kr.prototype._onEnd=function(e){i.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,o=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var n=this._inertia,a=this._map;if(n.length<2)a.snapToNorth({},{originalEvent:e});else {var s=n[n.length-1],l=n[0],c=a.transform.scaleZoom(o*s[1]),h=a.transform.scaleZoom(o*l[1]),u=(s[0]-l[0])/1e3,p=s[2];if(0!==u&&c!==h){var d=.15*(c-h)/u;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var _=1e3*Math.abs(d/(12*.15));a.easeTo({zoom:c+d*_/2e3,duration:_,easing:Rr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e});}else a.snapToNorth({},{originalEvent:e});}}},kr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>2&&i-e[0][0]>160;)e.shift();};var Br={scrollZoom:Cr,boxZoom:Ir,dragRotate:Pr,dragPan:zr,keyboard:Lr,doubleClickZoom:Dr,touchZoomRotate:kr},Or=function(e){function i(i,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),r)},i.prototype.panTo=function(e,i,r){return this.easeTo(t.extend({center:e},i),r)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,r){return this.easeTo(t.extend({zoom:e},i),r)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.getPadding=function(){return this.transform.padding},i.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},i.prototype.rotateTo=function(e,i,r){return this.easeTo(t.extend({bearing:e},i),r)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.resetNorthPitch=function(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(e,i){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,i)},i.prototype._cameraForBoxAndBearing=function(e,i,r,o){var n={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=t.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){var a=o.padding;o.padding={top:a,bottom:a,right:a,left:a};}o.padding=t.extend(n,o.padding);var s=this.transform,l=s.padding,c=s.project(t.LngLat.convert(e)),h=s.project(t.LngLat.convert(i)),u=c.rotate(-r*Math.PI/180),p=h.rotate(-r*Math.PI/180),d=new t.Point(Math.max(u.x,p.x),Math.max(u.y,p.y)),_=new t.Point(Math.min(u.x,p.x),Math.min(u.y,p.y)),f=d.sub(_),m=(s.width-(l.left+l.right+o.padding.left+o.padding.right))/f.x,g=(s.height-(l.top+l.bottom+o.padding.top+o.padding.bottom))/f.y;if(!(g<0||m<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(m,g)),o.maxZoom),y=t.Point.convert(o.offset),x=new t.Point(y.x+(o.padding.left-o.padding.right)/2,y.y+(o.padding.top-o.padding.bottom)/2).mult(s.scale/s.zoomScale(v));return {center:s.unproject(c.add(h).div(2).sub(x)),zoom:v,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,r,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),r,o),o,n)},i.prototype._fitInternal=function(e,i,r){return e?(i=t.extend(e,i)).linear?this.easeTo(i,r):this.flyTo(i,r):this},i.prototype.jumpTo=function(e,i){this.stop();var r=this.transform,o=!1,n=!1,a=!1;return "zoom"in e&&r.zoom!==+e.zoom&&(o=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(n=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),o&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),n&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),a&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var r=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var o=this.transform,n=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:n,h="bearing"in e?this._normalizeBearing(e.bearing,a):a,u="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:o.padding,d=t.Point.convert(e.offset),_=o.centerPoint.add(d),f=o.pointLocation(_),m=t.LngLat.convert(e.center||f);this._normalizeCenter(m);var g,v,y=o.project(f),x=o.project(m).sub(y),b=o.zoomScale(c-n);return e.around&&(g=t.LngLat.convert(e.around),v=o.locationPoint(g)),this._zooming=c!==n,this._rotating=a!==h,this._pitching=u!==s,this._padding=!o.isPaddingEqual(p),this._prepareEase(i,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(o.zoom=t.number(n,c,e)),r._rotating&&(o.bearing=t.number(a,h,e)),r._pitching&&(o.pitch=t.number(s,u,e)),r._padding&&(o.interpolatePadding(l,p,e),_=o.centerPoint.add(d)),g)o.setLocationAtPoint(g,v);else {var f=o.zoomScale(o.zoom-n),m=c>n?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=o.unproject(y.add(x.mult(e*w)).mult(f));o.setLocationAtPoint(o.renderWorldCopies?E.wrap():E,_);}r._fireMoveEvents(i);}),(function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(i)}),e.delayEndEvents):r._afterEase(i);}),e),this},i.prototype._prepareEase=function(e,i){this._moving=!0,i||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e){var i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));},i.prototype.flyTo=function(e,i){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var n=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),h="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:n.padding,_=n.zoomScale(h-a),f=t.Point.convert(e.offset),m=n.centerPoint.add(f),g=n.pointLocation(m);e.center&&e.center.length>=2&&(0==e.center[0]&&(e.center[0]=1e-6),0==e.center[1]&&(e.center[1]=1e-6));var v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var y=n.project(g),x=n.project(v).sub(y),b=e.curve,w=Math.max(n.width,n.height),E=w/_,T=x.mag();if("minZoom"in e){var C=t.clamp(Math.min(e.minZoom,a,h),n.minZoom,n.maxZoom),I=w/n.zoomScale(C-a);b=Math.sqrt(I/T*2);}var S=b*b;function P(t){var e=(E*E-w*w+(t?-1:1)*S*S*T*T)/(2*(t?E:w)*S*T);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return (Math.exp(t)-Math.exp(-t))/2}function z(t){return (Math.exp(t)+Math.exp(-t))/2}var L=P(0),A=function(t){return z(L)/z(L+b*t)},D=function(t){return w*((z(L)*(M(e=L+b*t)/z(e))-M(L))/S)/T;var e;},R=(P(1)-L)/b;if(Math.abs(T)<1e-6||!isFinite(R)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,i);var k=E<w?-1:1;R=Math.abs(Math.log(E/w))/b,D=function(){return 0},A=function(t){return Math.exp(k*b*t)};}return e.duration="duration"in e?+e.duration:1e3*R/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=p!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(i,!1),this._ease((function(e){var o=e*R,_=1/A(o);n.zoom=1===e?h:a+n.scaleZoom(_),r._rotating&&(n.bearing=t.number(s,u,e)),r._pitching&&(n.pitch=t.number(l,p,e)),r._padding&&(n.interpolatePadding(c,d,e),m=n.centerPoint.add(f));var g=1===e?v:n.unproject(y.add(x.mult(D(o))).mult(_));n.setLocationAtPoint(n.renderWorldCopies?g.wrap():g,m),r._fireMoveEvents(i);}),(function(){return r._afterEase(i)}),e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this);}return this},i.prototype._ease=function(e,i,r){!1===r.animate||0===r.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var r=Math.abs(e-i);return Math.abs(e-360-i)<r&&(e-=360),Math.abs(e+360-i)<r&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0;}},i}(t.Evented),Fr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};Fr.prototype.getDefaultPosition=function(){return "bottom-right"},Fr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=i.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Fr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0;},Fr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var r=i.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow";}},Fr.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink());},Fr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return "string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id;}var i=this._map.style.sourceCaches;for(var r in i){var o=i[r];if(o.used){var n=o.getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution);}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,i){for(var r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return !1;return !0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null);}},Fr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Ur=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Ur.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ur.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Ur.prototype.getDefaultPosition=function(){return "bottom-left"},Ur.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Ur.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return !0;return !1}},Ur.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact");}};var Nr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};Nr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Nr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;i<r.length;i+=1){var o=r[i];if(o.id===t)return void(o.cancelled=!0)}},Nr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,i=t;e<i.length;e+=1){var r=i[e];if(!r.cancelled&&(r.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1;},Nr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[];};var Zr={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},jr=t.window.HTMLImageElement,qr=t.window.HTMLElement,Vr=t.window.ImageBitmap,Gr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Wr=function(r){function o(e){var o=this;if(null!=(e=t.extend({},Gr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var n=new yr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,n,e),this.crs=this.initCRS(e.crs),this.setCRS(this.crs),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new Nr,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Zr,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else {if(!(e.container instanceof qr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return o._update(!1)})),this.on("moveend",(function(){return o._update(!1)})),this.on("zoom",(function(){return o._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),o=null,n=!1,a=null;for(var s in Br)t[s]=new Br[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);i.addEventListener(r,"mouseout",(function(e){t.fire(new wr("mouseout",t,e));})),i.addEventListener(r,"mousedown",(function(o){n=!0,a=i.mousePos(r,o);var s=new wr("mousedown",t,o);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(o),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(o),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(o));})),i.addEventListener(r,"mouseup",(function(e){var i=t.dragRotate.isActive();o&&!i&&t.fire(new wr("contextmenu",t,o)),o=null,n=!1,t.fire(new wr("mouseup",t,e));})),i.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new wr("mousemove",t,e));}})),i.addEventListener(r,"mouseover",(function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new wr("mouseover",t,e));})),i.addEventListener(r,"touchstart",(function(i){var r=new Er("touchstart",t,i);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(i),t.touchZoomRotate.onStart(i),t.doubleClickZoom.onTouchStart(r));}),{passive:!1}),i.addEventListener(r,"touchmove",(function(e){t.fire(new Er("touchmove",t,e));}),{passive:!1}),i.addEventListener(r,"touchend",(function(e){t.fire(new Er("touchend",t,e));})),i.addEventListener(r,"touchcancel",(function(e){t.fire(new Er("touchcancel",t,e));})),i.addEventListener(r,"click",(function(o){var n=i.mousePos(r,o);(!a||n.equals(a)||n.dist(a)<e.clickTolerance)&&t.fire(new wr("click",t,o));})),i.addEventListener(r,"dblclick",(function(e){var i=new wr("dblclick",t,e);t.fire(i),i.defaultPrevented||t.doubleClickZoom.onDblClick(i);})),i.addEventListener(r,"contextmenu",(function(e){var i=t.dragRotate.isActive();n||i?n&&(o=e):t.fire(new wr("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault();})),i.addEventListener(r,"wheel",(function(i){e.interactive&&t.stop();var r=new Tr("wheel",t,i);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(i);}),{passive:!1});}(this,e),this._hash=e.hash&&new br("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Fr({customAttribution:e.customAttribution})),this.addControl(new Ur,e.logoPosition),this.on("style.load",(function(){o.transform.unmodified&&o.jumpTo(o.style.stylesheet);})),this.on("data",(function(e){o._update("style"===e.dataType),o.fire(new t.Event(e.dataType+"data",e));})),this.on("dataloading",(function(e){o.fire(new t.Event(e.dataType+"dataloading",e));})),this.overlayLayersManager={};}r&&(o.__proto__=r),(o.prototype=Object.create(r&&r.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(r,o.firstChild):o.appendChild(r),this},o.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},o.prototype.resize=function(e){var i=this._containerDimensions(),r=i[0],o=i[1];return this._resizeCanvas(r,o),this.transform.resize(r,o),this.painter.resize(r,o),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},o.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},o.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},o.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},o.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},o.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},o.prototype._createDelegatedListener=function(t,e,i){var r,o=this;if("mouseenter"===t||"mouseover"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){var a=o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(o,new wr(t,o,r.originalEvent,{features:a}))):n=!1;},mouseout:function(){n=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){(o.getLayer(e)?o.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(o,new wr(t,o,r.originalEvent)));},mouseout:function(e){a&&(a=!1,i.call(o,new wr(t,o,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(r={},r[t]=function(t){var r=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(o,t),delete t.features);},r)}},o.prototype.on=function(t,e,i){if(void 0===i)return r.prototype.on.call(this,t,e);var o=this._createDelegatedListener(t,e,i);for(var n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(n,o.delegates[n]);return this},o.prototype.once=function(t,e,i){if(void 0===i)return r.prototype.once.call(this,t,e);var o=this._createDelegatedListener(t,e,i);for(var n in o.delegates)this.once(n,o.delegates[n]);return this},o.prototype.off=function(t,e,i){var o=this;return void 0===i?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var n=r[t],a=0;a<n.length;a++){var s=n[a];if(s.layer===e&&s.listener===i){for(var l in s.delegates)o.off(l,s.delegates[l]);return n.splice(a,1),o}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return [];var r;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])r=[t.Point.convert(e)];else {var o=t.Point.convert(e[0]),n=t.Point.convert(e[1]);r=[o,new t.Point(n.x,o.y),n,new t.Point(o.x,n.y),o];}return this.style.queryRenderedFeatures(r,i,this.transform)},o.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},o.prototype.setStyle=function(e,i){return !1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(e,i))},o.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},o.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Ze(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ze(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty());},o.prototype._diffStyle=function(e,i){var r=this;if("string"==typeof e){var o=this._requestManager.normalizeStyleURL(e),n=this._requestManager.transformRequest(o,t.ResourceType.Style);t.getJSON(n,(function(e,o){e?r.fire(new t.ErrorEvent(e)):o&&r._updateDiff(o,i);}));}else "object"==typeof e&&this._updateDiff(e,i);},o.prototype._updateDiff=function(e,i){try{this.style.setState(e)&&this._update(!0);}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+". Rebuilding the style from scratch."),this._updateStyle(e,i);}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},o.prototype.isSourceLoaded=function(e){var i=this.style&&this.style.sourceCaches[e];if(void 0!==i)return i.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")));},o.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var r in i){var o=i[r];if("loaded"!==o.state&&"errored"!==o.state)return !1}}return !0},o.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},o.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},o.prototype.getSource=function(t){return this.style.getSource(t)},o.prototype.addImage=function(e,i,r){void 0===r&&(r={});var o=r.pixelRatio;void 0===o&&(o=1);var n=r.sdf;void 0===n&&(n=!1);var a=r.stretchX,s=r.stretchY,l=r.content;if(this._lazyInitEmptyStyle(),i instanceof jr||Vr&&i instanceof Vr){var c=t.browser.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:c.width,height:c.height},c.data),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0});}else {if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var h=i;this.style.addImage(e,{data:new t.RGBAImage({width:i.width,height:i.height},new Uint8Array(i.data)),pixelRatio:o,stretchX:a,stretchY:s,content:l,sdf:n,version:0,userImage:h}),h.onAdd&&h.onAdd(this,e);}},o.prototype.updateImage=function(e,i){var r=this.style.getImage(e);if(!r)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var o=i instanceof jr||Vr&&i instanceof Vr?t.browser.getImageData(i):i,n=o.width,a=o.height,s=o.data;return void 0===n||void 0===a?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):n!==r.data.width||a!==r.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(s,!(i instanceof jr||Vr&&i instanceof Vr)),void this.style.updateImage(e,r))},o.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(t){this.style.removeImage(t);},o.prototype.loadImage=function(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),i);},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayerBak=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},o.prototype._addLayer=function(t,e){t.onAdd&&t.onAdd(e);},o.prototype._removeLayer=function(t){t.removeFromMap&&t.removeFromMap();},o.prototype._setVisibility=function(t,e){t.setVisibility&&t.setVisibility(e);},o.prototype._moveLayer=function(e,i){var r=document.getElementById(e);if(i){var o=document.getElementById(i);o||t.window.mapboxgl.Evented.prototype.fire("error",{error:new Error('Layer with id "'+i+'" does not exist on this document.')});}r&&o?o.parentNode.insertBefore(r,o):r.parentNode.appendChild(r);},o.prototype.addLayer=function(t,e){return t.source||"custom"===t.type||"background"===t.type?(this.addLayerBak(t,e),this):this.overlayLayersManager[t.id]||this.style._layers[t.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(this._addLayer(t,this),this.overlayLayersManager[t.id]=t,this)},o.prototype.moveLayer=function(t,e){return this.overlayLayersManager[t]?(this._moveLayer(t,e),this):this.style._layers[t]?(this.style.moveLayer(t,e),this._update(!0),this):void 0},o.prototype.removeLayer=function(t){return this.overlayLayersManager[t]?(this._removeLayer(this.overlayLayersManager[t]),delete this.overlayLayersManager[t],this):(this.style.removeLayer(t),this._update(!0),this)},o.prototype.getLayer=function(t){return this.overlayLayersManager[t]?this.overlayLayersManager[t]:this.style.getLayer(t)},o.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},o.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},o.prototype.getFilter=function(t){return this.style.getFilter(t)},o.prototype.setPaintProperty=function(t,e,i,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,i,r),this._update(!0)},o.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},o.prototype.setLayoutProperty=function(t,e,i,r){return void 0===r&&(r={}),this.overlayLayersManager[t]?("visibility"===e&&(this._setVisibility(this.overlayLayersManager[t],i="visible"===i),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(t,e,i,r),this._update(!0),this)},o.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},o.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},o.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},o.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},o.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.");},o.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=i.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=i.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=i.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var o=this._controlContainer=i.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=i.create("div","mapboxgl-ctrl-"+t,o);}));},o.prototype._resizeCanvas=function(e,i){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px";},o.prototype._setupPainter=function(){var i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);r?(this.painter=new fr(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));},o.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}));},o.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}));},o.prototype.loaded=function(){return !this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},o.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t);},o.prototype._render=function(){var e,i=this,r=0,o=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(e=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,e),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,s=t.browser.now();this.style.zoomHistory.update(a,s);var l=new t.EvaluationParameters(a,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=l.crossFadingFactor();1===c&&c===this._crossFadingFactor||(n=!0,this._crossFadingFactor=c),this.style.update(l);}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;o.endQueryEXT(o.TIME_ELAPSED_EXT,e),setTimeout((function(){var r=o.getQueryObjectEXT(e,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(e),i.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:r}));}),50);}if(this.listens("gpu-timing-layer")){var u=this.painter.collectGpuTimers();setTimeout((function(){var e=i.painter.queryGpuTimers(u);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}));}),50);}return this._sourcesDirty||this._styleDirty||this._placementDirty||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&(this._fullyLoaded||(this._fullyLoaded=!0),this.fire(new t.Event("idle"))),this},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,i=this._controls;e<i.length;e+=1)i[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Xr(this._canvasContainer),Xr(this._controlContainer),Xr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"));},o.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render();})));},o.prototype._onWindowOnline=function(){this._update();},o.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update();},n.showTileBoundaries.get=function(){return !!this._showTileBoundaries},n.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update());},n.showPadding.get=function(){return !!this._showPadding},n.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update());},n.showCollisionBoxes.get=function(){return !!this._showCollisionBoxes},n.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update());},n.showOverdrawInspector.get=function(){return !!this._showOverdrawInspector},n.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update());},n.repaint.get=function(){return !!this._repaint},n.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint());},n.vertices.get=function(){return !!this._vertices},n.vertices.set=function(t){this._vertices=t,this._update();},o.prototype._setCacheLimits=function(e,i){t.setCacheLimits(e,i);},o.prototype.initCRS=function(e){if(e){if("object"==typeof e)return e;if("string"==typeof e&&!(e=t.CRS.get(e)))throw new Error("crs "+e+" is not define")}return e||t.CRS.EPSG3857},o.prototype.getCRS=function(){return this.crs},o.prototype.setCRS=function(e){this._tileExtent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892];var i=e.getExtent(),r=e.projection,o=e.getCoordsInfo();if(i&&Array.isArray(i)&&4===i.length){this._tileExtent=i;var n=o.width,a=o.height,s=o.originX,l=o.originY,c=o.latlngBounds;if(e.extent){var h=e.extent,u=r.unproject([h[0],h[3]]),p=u[0],d=u[1],_=r.unproject([h[2],h[1]]),f=_[0],m=_[1],g=Math.min(p,f),v=Math.max(p,f),y=Math.min(m,d),x=Math.max(m,d);c=[g,y,v,x];}[t.RasterTileSource,C,R].forEach((function(t){t.prototype.getMeterPerMapUnit=function(t){return e.getMeterPerMapUnit(t)},t.prototype.getResolution=function(t,i){return this._resolutions[t]||(this._resolutions[t]=e.getResolution(t,i)),this._resolutions[t]},t.prototype.getScale=function(t,i){return this._scales[t]||(this._scales[t]=e.getScale(t,i)),this._scales[t]},t.prototype.getCrs=function(t,i){return e.epsgCode},t.prototype.getProjectionParams=function(){return {code:e.epsgCode,def:r._def,originX:s,originY:l,width:n,height:a,bounds:Array.from(i)}},t.prototype.getZoomOffset=function(){return e.getZoomOffset()};})),t.CanonicalTileID.prototype.getTileBBox=function(){var t,i=e.tileSize;return (t=void 0===i?Math.max(n,a)/Math.pow(2,this.z):e.getResolution(this.z,i)*i)*this.x+s+","+(l-t*(this.y+1))+","+(t*(this.x+1)+s)+","+(l-t*this.y)},t.CanonicalTileID.prototype.getViewBounds=function(){var t=Math.pow(2,this.z);return '{"leftBottom":{"x":'+(s+n*this.x/t)+',"y":'+(l-a*(this.y+1)/t)+'},"rightTop":{"x":'+(s+n*(this.x+1)/t)+',"y": '+(l-a*this.y/t)+"}}"},t.CanonicalTileID.prototype.getCRS=function(){return e},yr.prototype.project=function(e){var i=e.lng,o=e.lat;o=t.clamp(o,c[1],c[3]);var h=r.project([i,o]);return new t.Point((h[0]-s)*this.worldSize/n,(l-h[1])*this.worldSize/a)},yr.prototype.unproject=function(e){var i=r.unproject([n*e.x/this.worldSize+s,l-a*e.y/this.worldSize]);return new t.LngLat(i[0],i[1])},t.TileBounds.prototype.contains=function(t){var e=Math.pow(2,t.z),i=Math.floor((this.bounds.getWest()-s)*e/n),r=Math.floor((l-this.bounds.getNorth())*e/a),o=Math.ceil((this.bounds.getEast()-s)*e/n),c=Math.ceil((l-this.bounds.getSouth())*e/a);return t.x>=i&&t.x<o&&t.y>=r&&t.y<c},t.GeoJSONFeature.prototype.yLat=function(t,e){return r.unproject([0,l-t*a/e])[1]},t.GeoJSONFeature.prototype.latY=function(t){var e=r.project([0,t])[1];return (l-e)*this.worldSize/a},this.updateTransform&&(this.mercatorZfromAltitude=t.mercatorZfromAltitude,this.updateTransform(e.getUnit(),o,r));}},o.prototype.updateTransform=function(e,i,r){var o=i.width,n=i.height,a=i.centerX,s=i.centerY,l=i.originX,c=i.originY,h=i.latlngBounds;this.transform.units=e,this.transform.latRange=[h[1],h[3]],this.transform.lngRange=[h[0],h[2]];var u=this.mercatorZfromAltitude;t.MercatorCoordinate.fromLngLat=function(e,i){i=i||0;var a=t.LngLat.convert(e);if(a.lng&&a.lat){var s=r.project(a);return new t.MercatorCoordinate((s[0]-l)/o,(c-s[1])/n,u(i,a.lat))}return new t.MercatorCoordinate(t.mercatorXfromLng(0),t.mercatorYfromLat(0),0)},t.MercatorCoordinate.prototype.toLngLat=function(){var e=r.unproject([l+this.x*o,c-this.y*n]),i=e[1];if(i<=90&&i>=-90)return new t.LngLat(e[0],i)},this.customConvertPoint=t.window.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+a+") / "+o+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+s+") / "+n+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+n+"+"+s+";}}"],{type:"text/javascript"}));},n.version.get=function(){return t.version},Object.defineProperties(o.prototype,n),o}(Or);function Xr(t){t.parentNode&&t.parentNode.removeChild(t);}var Hr=function(t,e,i,r){for(var o=65535&t|0,n=t>>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{n=n+(o=o+e[r++]|0)|0;}while(--a);o%=65521,n%=65521;}return o|n<<16|0},Kr=new Uint32Array(function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t;}return e}()),Yr=function(t,e,i,r){var o=Kr,n=r+i;t^=-1;for(var a=r;a<n;a++)t=t>>>8^o[255&(t^e[a])];return -1^t},Jr=function(t,e){var i,r,o,n,a,s,l,c,h,u,p,d,_,f,m,g,v,y,x,b,w,E,T,C,I=t.state;T=t.input,r=(i=t.next_in)+(t.avail_in-5),C=t.output,n=(o=t.next_out)-(e-t.avail_out),a=o+(t.avail_out-257),s=I.dmax,l=I.wsize,c=I.whave,h=I.wnext,u=I.window,p=I.hold,d=I.bits,_=I.lencode,f=I.distcode,m=(1<<I.lenbits)-1,g=(1<<I.distbits)-1;t:do{d<15&&(p+=T[i++]<<d,p+=T[i++]<<(d+=8),d+=8),v=_[p&m];e:for(;;){if(p>>>=y=v>>>24,d-=y,0==(y=v>>>16&255))C[o++]=65535&v;else {if(!(16&y)){if(0==(64&y)){v=_[(65535&v)+(p&(1<<y)-1)];continue e}if(32&y){I.mode=16191;break t}t.msg="invalid literal/length code",I.mode=16209;break t}x=65535&v,(y&=15)&&(d<y&&(p+=T[i++]<<d,d+=8),x+=p&(1<<y)-1,p>>>=y,d-=y),d<15&&(p+=T[i++]<<d,p+=T[i++]<<(d+=8),d+=8),v=f[p&g];i:for(;;){if(p>>>=y=v>>>24,d-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=f[(65535&v)+(p&(1<<y)-1)];continue i}t.msg="invalid distance code",I.mode=16209;break t}if(b=65535&v,d<(y&=15)&&(p+=T[i++]<<d,(d+=8)<y&&(p+=T[i++]<<d,d+=8)),(b+=p&(1<<y)-1)>s){t.msg="invalid distance too far back",I.mode=16209;break t}if(p>>>=y,d-=y,b>(y=o-n)){if((y=b-y)>c&&I.sane){t.msg="invalid distance too far back",I.mode=16209;break t}if(w=0,E=u,0===h){if(w+=l-y,y<x){x-=y;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}}else if(h<y){if(w+=l+h-y,(y-=h)<x){x-=y;do{C[o++]=u[w++];}while(--y);if(w=0,h<x){x-=y=h;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}}}else if(w+=h-y,y<x){x-=y;do{C[o++]=u[w++];}while(--y);w=o-b,E=C;}for(;x>2;)C[o++]=E[w++],C[o++]=E[w++],C[o++]=E[w++],x-=3;x&&(C[o++]=E[w++],x>1&&(C[o++]=E[w++]));}else {w=o-b;do{C[o++]=C[w++],C[o++]=C[w++],C[o++]=C[w++],x-=3;}while(x>2);x&&(C[o++]=C[w++],x>1&&(C[o++]=C[w++]));}break}}break}}while(i<r&&o<a);p&=(1<<(d-=(x=d>>3)<<3))-1,t.next_in=i-=x,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),I.hold=p,I.bits=d;},Qr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),$r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),to=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),eo=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),io=function(t,e,i,r,o,n,a,s){var l,c,h,u,p,d,_,f,m,g=s.bits,v=0,y=0,x=0,b=0,w=0,E=0,T=0,C=0,I=0,S=0,P=null,M=new Uint16Array(16),z=new Uint16Array(16),L=null;for(v=0;v<=15;v++)M[v]=0;for(y=0;y<r;y++)M[e[i+y]]++;for(w=g,b=15;b>=1&&0===M[b];b--);if(w>b&&(w=b),0===b)return o[n++]=20971520,o[n++]=20971520,s.bits=1,0;for(x=1;x<b&&0===M[x];x++);for(w<x&&(w=x),C=1,v=1;v<=15;v++)if(C<<=1,(C-=M[v])<0)return -1;if(C>0&&(0===t||1!==b))return -1;for(z[1]=0,v=1;v<15;v++)z[v+1]=z[v]+M[v];for(y=0;y<r;y++)0!==e[i+y]&&(a[z[e[i+y]]++]=y);if(0===t?(P=L=a,d=20):1===t?(P=Qr,L=$r,d=257):(P=to,L=eo,d=0),S=0,y=0,v=x,p=n,E=w,T=0,h=-1,u=(I=1<<w)-1,1===t&&I>852||2===t&&I>592)return 1;for(;;){_=v-T,a[y]+1<d?(f=0,m=a[y]):a[y]>=d?(f=L[a[y]-d],m=P[a[y]-d]):(f=96,m=0),l=1<<v-T,x=c=1<<E;do{o[p+(S>>T)+(c-=l)]=_<<24|f<<16|m|0;}while(0!==c);for(l=1<<v-1;S&l;)l>>=1;if(0!==l?(S&=l-1,S+=l):S=0,y++,0==--M[v]){if(v===b)break;v=e[i+a[y]];}if(v>w&&(S&u)!==h){for(0===T&&(T=w),p+=x,C=1<<(E=v-T);E+T<b&&!((C-=M[E+T])<=0);)E++,C<<=1;if(I+=1<<E,1===t&&I>852||2===t&&I>592)return 1;o[h=S&u]=w<<24|E<<16|p-n|0;}}return 0!==S&&(o[p+S]=v-T<<24|64<<16|0),s.bits=w,0},ro={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},oo=ro.Z_FINISH,no=ro.Z_BLOCK,ao=ro.Z_TREES,so=ro.Z_OK,lo=ro.Z_STREAM_END,co=ro.Z_NEED_DICT,ho=ro.Z_STREAM_ERROR,uo=ro.Z_DATA_ERROR,po=ro.Z_MEM_ERROR,_o=ro.Z_BUF_ERROR,fo=ro.Z_DEFLATED,mo=function(t){return (t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function go(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}var vo,yo,xo=function(t){if(!t)return 1;var e=t.state;return !e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},bo=function(t){if(xo(t))return ho;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,function(t){if(xo(t))return ho;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,so}(t)},wo=!0,Eo=function(t){if(wo){vo=new Int32Array(512),yo=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(io(1,t.lens,0,288,vo,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;io(2,t.lens,0,32,yo,0,t.work,{bits:5}),wo=!1;}t.lencode=vo,t.lenbits=9,t.distcode=yo,t.distbits=5;},To=function(t,e,i,r){var o,n=t.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(e.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):((o=n.wsize-n.wnext)>r&&(o=r),n.window.set(e.subarray(i-r,i-r+o),n.wnext),(r-=o)?(n.window.set(e.subarray(i-r,i),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=o,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=o))),0},Co=bo,Io=function(t,e){if(!t)return ho;var i=new go;t.state=i,i.strm=t,i.window=null,i.mode=16180;var r=function(t,e){var i;if(xo(t))return ho;var r=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ho:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,bo(t))}(t,e);return r!==so&&(t.state=null),r},So=function(t,e){var i,r,o,n,a,s,l,c,h,u,p,d,_,f,m,g,v,y,x,b,w,E,T,C,I=0,S=new Uint8Array(4),P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(xo(t)||!t.output||!t.input&&0!==t.avail_in)return ho;16191===(i=t.state).mode&&(i.mode=16192),a=t.next_out,o=t.output,n=t.next_in,r=t.input,c=i.hold,h=i.bits,u=s=t.avail_in,p=l=t.avail_out,E=so;t:for(;;)switch(i.mode){case 16180:if(0===i.wrap){i.mode=16192;break}for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(2&i.wrap&&35615===c){0===i.wbits&&(i.wbits=15),i.check=0,S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0),c=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",i.mode=16209;break}if((15&c)!==fo){t.msg="unknown compression method",i.mode=16209;break}if(h-=4,w=8+(15&(c>>>=4)),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){t.msg="invalid window size",i.mode=16209;break}i.dmax=1<<i.wbits,i.flags=0,t.adler=i.check=1,i.mode=512&c?16189:16191,c=0,h=0;break;case 16181:for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(i.flags=c,(255&i.flags)!==fo){t.msg="unknown compression method",i.mode=16209;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=16209;break}i.head&&(i.head.text=c>>8&1),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.head&&(i.head.time=c),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,i.check=Yr(i.check,S,4,0)),c=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.head&&(i.head.xflags=255&c,i.head.os=c>>8),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.length=c,i.head&&(i.head.extra_len=c),512&i.flags&&4&i.wrap&&(S[0]=255&c,S[1]=c>>>8&255,i.check=Yr(i.check,S,2,0)),c=0,h=0;}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&((d=i.length)>s&&(d=s),d&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(n,n+d),w)),512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,i.length-=d),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===s)break t;d=0;do{w=r[n+d++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w));}while(w&&d<s);if(512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,w)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===s)break t;d=0;do{w=r[n+d++],i.head&&w&&i.length<65536&&(i.head.comment+=String.fromCharCode(w));}while(w&&d<s);if(512&i.flags&&4&i.wrap&&(i.check=Yr(i.check,r,d,n)),s-=d,n+=d,w)break t}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(4&i.wrap&&c!==(65535&i.check)){t.msg="header crc mismatch",i.mode=16209;break}c=0,h=0;}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=16191;break;case 16189:for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}t.adler=i.check=mo(c),c=0,h=0,i.mode=16190;case 16190:if(0===i.havedict)return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,co;t.adler=i.check=1,i.mode=16191;case 16191:if(e===no||e===ao)break t;case 16192:if(i.last){c>>>=7&h,h-=7&h,i.mode=16206;break}for(;h<3;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}switch(i.last=1&c,h-=1,3&(c>>>=1)){case 0:i.mode=16193;break;case 1:if(Eo(i),i.mode=16199,e===ao){c>>>=2,h-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=16209;}c>>>=2,h-=2;break;case 16193:for(c>>>=7&h,h-=7&h;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",i.mode=16209;break}if(i.length=65535&c,c=0,h=0,i.mode=16194,e===ao)break t;case 16194:i.mode=16195;case 16195:if(d=i.length){if(d>s&&(d=s),d>l&&(d=l),0===d)break t;o.set(r.subarray(n,n+d),a),s-=d,n+=d,l-=d,a+=d,i.length-=d;break}i.mode=16191;break;case 16196:for(;h<14;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(i.nlen=257+(31&c),h-=5,i.ndist=1+(31&(c>>>=5)),h-=5,i.ncode=4+(15&(c>>>=5)),c>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=16209;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.lens[P[i.have++]]=7&c,c>>>=3,h-=3;}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,E=io(0,i.lens,0,19,i.lencode,0,i.work,T={bits:i.lenbits}),i.lenbits=T.bits,E){t.msg="invalid code lengths set",i.mode=16209;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;g=(I=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(v<16)c>>>=m,h-=m,i.lens[i.have++]=v;else {if(16===v){for(C=m+2;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(c>>>=m,h-=m,0===i.have){t.msg="invalid bit length repeat",i.mode=16209;break}w=i.lens[i.have-1],d=3+(3&c),c>>>=2,h-=2;}else if(17===v){for(C=m+3;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}h-=m,w=0,d=3+(7&(c>>>=m)),c>>>=3,h-=3;}else {for(C=m+7;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}h-=m,w=0,d=11+(127&(c>>>=m)),c>>>=7,h-=7;}if(i.have+d>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=16209;break}for(;d--;)i.lens[i.have++]=w;}}if(16209===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=16209;break}if(i.lenbits=9,E=io(1,i.lens,0,i.nlen,i.lencode,0,i.work,T={bits:i.lenbits}),i.lenbits=T.bits,E){t.msg="invalid literal/lengths set",i.mode=16209;break}if(i.distbits=6,i.distcode=i.distdyn,E=io(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,T={bits:i.distbits}),i.distbits=T.bits,E){t.msg="invalid distances set",i.mode=16209;break}if(i.mode=16199,e===ao)break t;case 16199:i.mode=16200;case 16200:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,Jr(t,p),a=t.next_out,o=t.output,l=t.avail_out,n=t.next_in,r=t.input,s=t.avail_in,c=i.hold,h=i.bits,16191===i.mode&&(i.back=-1);break}for(i.back=0;g=(I=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(g&&0==(240&g)){for(y=m,x=g,b=v;g=(I=i.lencode[b+((c&(1<<y+x)-1)>>y)])>>>16&255,v=65535&I,!(y+(m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}c>>>=y,h-=y,i.back+=y;}if(c>>>=m,h-=m,i.back+=m,i.length=v,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=16191;break}if(64&g){t.msg="invalid literal/length code",i.mode=16209;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(C=i.extra;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra;}i.was=i.length,i.mode=16202;case 16202:for(;g=(I=i.distcode[c&(1<<i.distbits)-1])>>>16&255,v=65535&I,!((m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(0==(240&g)){for(y=m,x=g,b=v;g=(I=i.distcode[b+((c&(1<<y+x)-1)>>y)])>>>16&255,v=65535&I,!(y+(m=I>>>24)<=h);){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}c>>>=y,h-=y,i.back+=y;}if(c>>>=m,h-=m,i.back+=m,64&g){t.msg="invalid distance code",i.mode=16209;break}i.offset=v,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(C=i.extra;h<C;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra;}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=16209;break}i.mode=16204;case 16204:if(0===l)break t;if(i.offset>(d=p-l)){if((d=i.offset-d)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=16209;break}_=d>i.wnext?i.wsize-(d-=i.wnext):i.wnext-d,d>i.length&&(d=i.length),f=i.window;}else f=o,_=a-i.offset,d=i.length;d>l&&(d=l),l-=d,i.length-=d;do{o[a++]=f[_++];}while(--d);0===i.length&&(i.mode=16200);break;case 16205:if(0===l)break t;o[a++]=i.length,l--,i.mode=16200;break;case 16206:if(i.wrap){for(;h<32;){if(0===s)break t;s--,c|=r[n++]<<h,h+=8;}if(t.total_out+=p-=l,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Yr(i.check,o,p,a-p):Hr(i.check,o,p,a-p)),p=l,4&i.wrap&&(i.flags?c:mo(c))!==i.check){t.msg="incorrect data check",i.mode=16209;break}c=0,h=0;}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===s)break t;s--,c+=r[n++]<<h,h+=8;}if(4&i.wrap&&c!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=16209;break}c=0,h=0;}i.mode=16208;case 16208:E=lo;break t;case 16209:E=uo;break t;case 16210:return po;case 16211:default:return ho}return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=s,i.hold=c,i.bits=h,(i.wsize||p!==t.avail_out&&i.mode<16209&&(i.mode<16206||e!==oo))&&To(t,t.output,t.next_out,p-t.avail_out),p-=t.avail_out,t.total_in+=u-=t.avail_in,t.total_out+=p,i.total+=p,4&i.wrap&&p&&(t.adler=i.check=i.flags?Yr(i.check,o,p,t.next_out-p):Hr(i.check,o,p,t.next_out-p)),t.data_type=i.bits+(i.last?64:0)+(16191===i.mode?128:0)+(16199===i.mode||16194===i.mode?256:0),(0===u&&0===p||e===oo)&&E===so&&(E=_o),E},Po=function(t){if(xo(t))return ho;var e=t.state;return e.window&&(e.window=null),t.state=null,so},Mo=function(t,e){var i,r=e.length;return xo(t)||0!==(i=t.state).wrap&&16190!==i.mode?ho:16190===i.mode&&Hr(1,e,r,0)!==i.check?uo:To(t,e,r,r)?(i.mode=16210,po):(i.havedict=1,so)},zo=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Lo=!0;try{String.fromCharCode.apply(null,new Uint8Array(1));}catch(t){Lo=!1;}for(var Ao=new Uint8Array(256),Do=0;Do<256;Do++)Ao[Do]=Do>=252?6:Do>=248?5:Do>=240?4:Do>=224?3:Do>=192?2:1;Ao[254]=Ao[254]=1;var Ro=function(t,e){var i,r,o=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return (new TextDecoder).decode(t.subarray(0,e));var n=new Array(2*o);for(r=0,i=0;i<o;){var a=t[i++];if(a<128)n[r++]=a;else {var s=Ao[a];if(s>4)n[r++]=65533,i+=s-1;else {for(a&=2===s?31:3===s?15:7;s>1&&i<o;)a=a<<6|63&t[i++],s--;s>1?n[r++]=65533:a<65536?n[r++]=a:(n[r++]=55296|(a-=65536)>>10&1023,n[r++]=56320|1023&a);}}}return function(t,e){if(e<65534&&t.subarray&&Lo)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var i="",r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i}(n,r)},ko=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Ao[t[i]]>e?i:e},Bo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Oo=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;},Fo=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1;},Uo=Object.prototype.toString,No=ro.Z_NO_FLUSH,Zo=ro.Z_FINISH,jo=ro.Z_OK,qo=ro.Z_STREAM_END,Vo=ro.Z_NEED_DICT,Go=ro.Z_STREAM_ERROR,Wo=ro.Z_DATA_ERROR,Xo=ro.Z_MEM_ERROR;function Ho(t){this.options=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)zo(i,r)&&(t[r]=i[r]);}}return t}({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Oo,this.strm.avail_out=0;var i=Io(this.strm,e.windowBits);if(i!==jo)throw new Error(Bo[i]);if(this.header=new Fo,function(t,e){if(xo(t))return ho;var i=t.state;0==(2&i.wrap)||(i.head=e,e.done=!1);}(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return (new TextEncoder).encode(t);var e,i,r,o,n,a=t.length,s=0;for(o=0;o<a;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),s+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(s),n=0,o=0;n<s;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?e[n++]=i:i<2048?(e[n++]=192|i>>>6,e[n++]=128|63&i):i<65536?(e[n++]=224|i>>>12,e[n++]=128|i>>>6&63,e[n++]=128|63&i):(e[n++]=240|i>>>18,e[n++]=128|i>>>12&63,e[n++]=128|i>>>6&63,e[n++]=128|63&i);return e}(e.dictionary):"[object ArrayBuffer]"===Uo.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Mo(this.strm,e.dictionary))!==jo))throw new Error(Bo[i])}function Ko(t,e){var i=new Ho(e);if(i.push(t),i.err)throw i.msg||Bo[i.err];return i.result}Ho.prototype.push=function(t,e){var i,r,o,n=this.strm,a=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return !1;for(r=e===~~e?e:!0===e?Zo:No,n.input="[object ArrayBuffer]"===Uo.call(t)?new Uint8Array(t):t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),(i=So(n,r))===Vo&&s&&((i=Mo(n,s))===jo?i=So(n,r):i===Wo&&(i=Vo));n.avail_in>0&&i===qo&&n.state.wrap>0&&0!==t[n.next_in];)Co(n),i=So(n,r);switch(i){case Go:case Wo:case Vo:case Xo:return this.onEnd(i),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||i===qo))if("string"===this.options.to){var l=ko(n.output,n.next_out),c=n.next_out-l,h=Ro(n.output,l);n.next_out=c,n.avail_out=a-c,c&&n.output.set(n.output.subarray(l,l+c),0),this.onData(h);}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==jo||0!==o){if(i===qo)return i=Po(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return !0},Ho.prototype.onData=function(t){this.chunks.push(t);},Ho.prototype.onEnd=function(t){t===jo&&(this.result="string"===this.options.to?this.chunks.join(""):function(t){for(var e=0,i=0,r=t.length;i<r;i++)e+=t[i].length;for(var o=new Uint8Array(e),n=0,a=0,s=t.length;n<s;n++){var l=t[n];o.set(l,a),a+=l.length;}return o}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg;};for(var Yo={Inflate:Ho,inflate:Ko,inflateRaw:function(t,e){return (e=e||{}).raw=!0,Ko(t,e)},ungzip:Ko,constants:ro},Jo=[],Qo=[],$o="undefined"!=typeof Uint8Array?Uint8Array:Array,tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en=0,rn=tn.length;en<rn;++en)Jo[en]=tn[en],Qo[tn.charCodeAt(en)]=en;function on(t,e,i){for(var r,o=[],n=e;n<i;n+=3)o.push(Jo[(r=(t[n]<<16&16711680)+(t[n+1]<<8&65280)+(255&t[n+2]))>>18&63]+Jo[r>>12&63]+Jo[r>>6&63]+Jo[63&r]);return o.join("")}Qo["-".charCodeAt(0)]=62,Qo["_".charCodeAt(0)]=63;var nn=function(t){var e,i,r=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return -1===i&&(i=e),[i,i===e?0:4-i%4]}(t),o=r[0],n=r[1],a=new $o(function(t,e,i){return 3*(e+i)/4-i}(0,o,n)),s=0,l=n>0?o-4:o;for(i=0;i<l;i+=4)e=Qo[t.charCodeAt(i)]<<18|Qo[t.charCodeAt(i+1)]<<12|Qo[t.charCodeAt(i+2)]<<6|Qo[t.charCodeAt(i+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===n&&(e=Qo[t.charCodeAt(i)]<<2|Qo[t.charCodeAt(i+1)]>>4,a[s++]=255&e),1===n&&(e=Qo[t.charCodeAt(i)]<<10|Qo[t.charCodeAt(i+1)]<<4|Qo[t.charCodeAt(i+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},an=function(e){function i(t,i,r,o){e.call(this,t,i,r,o),this.dispatcher=r,this.setEventedParent(o),this.type="mbtiles",this.db=this.openDatabase(i.path);}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.openDatabase=function(e){return t.Database.openDatabase(e)},i.prototype.copyDatabaseFile=function(e,i,r){return t.Database.copyDatabaseFile(e,i,r)},i.prototype.readTile=function(t,e,i,r){var o=[t,e,i];this.db.then((function(t){t.transaction((function(t){t.executeSql("SELECT BASE64(tile_data) AS base64_tile_data FROM tiles WHERE zoom_level=? AND tile_column=? AND tile_row=?",o,(function(t,e){if(e.rows.length){var i=e.rows.item(0).base64_tile_data,n=Yo.inflate(nn(i));r(void 0,function(t){for(var e,i=t.length,r=i%3,o=[],n=0,a=i-r;n<a;n+=16383)o.push(on(t,n,n+16383>a?a:n+16383));return 1===r?o.push(Jo[(e=t[i-1])>>2]+Jo[e<<4&63]+"=="):2===r&&o.push(Jo[(e=(t[i-2]<<8)+t[i-1])>>10]+Jo[e>>4&63]+Jo[e<<2&63]+"="),o.join("")}(n));}else r(new Error("tile "+o.join(",")+" not found"));}));}),(function(t){r(t);}));})).catch((function(t){r(t);}));},i.prototype.loadTile=function(t,e){var i=t.tileID.canonical,r=i.z>this.maxzoom?Math.pow(2,i.z-this.maxzoom):1,o=Math.min(i.z,this.maxzoom||i.z),n=i.x,a=Math.pow(2,o)-i.y-1;this.readTile(o,n,a,function(o,n){if(o)return e(o);if(void 0===n)return e(new Error("empty data"));var a={request:{url:"data:application/x-protobuf;base64,"+n},uid:t.uid,tileID:t.tileID,zoom:i.z,tileSize:this.tileSize*r,type:this.type,source:this.id,pixelRatio:window.devicePixelRatio||1,overscaling:r,showCollisionBoxes:this.map.showCollisionBoxes};function s(i,r){if(!t.aborted){if(i)return e(i);this.map._refreshExpiredTiles&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null);}}t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=e:t.request=t.actor.send("reloadTile",a,s.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",a,s.bind(this)));}.bind(this));},i}(C),sn=function(e){var i=e.style,r=/^.+:\/\//,o=t.window.location.origin+t.window.location.pathname.split("/").slice(0,-1).join("/");return "sprite"in i&&!i.sprite.match(r)&&"glyphs"in i&&!i.glyphs.match(r)&&(i.sprite=o+"/"+i.sprite,i.glyphs=o+"/"+i.glyphs),console.log("获取离线显示配置",e),e},ln={showCompass:!0,showZoom:!0,visualizePitch:!1},cn=function(e){var r=this;this.options=t.extend({},ln,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return r._map.zoomIn({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return r._map.zoomOut({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:t}):r._map.resetNorth({},{originalEvent:t});})),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0));};function hn(e,i,r){if(e=new t.LngLat(e.lng,e.lat),i){var o=new t.LngLat(e.lng-360,e.lat),n=new t.LngLat(e.lng+360,e.lat),a=r.locationPoint(e).distSqr(i);r.locationPoint(o).distSqr(i)<a?e=o:r.locationPoint(n).distSqr(i)<a&&(e=n);}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360;}return e}cn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom();},cn.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t;},cn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Pr(t,{button:"left",element:this._compass,clickTolerance:t.dragRotate._clickTolerance}),i.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},cn.prototype.onRemove=function(){i.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),i.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),i.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map;},cn.prototype._createButton=function(t,e){var r=i.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},cn.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i);};var un={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 pn(t,e,i){var r=t.classList;for(var o in un)r.remove("mapboxgl-"+i+"-anchor-"+o);r.add("mapboxgl-"+i+"-anchor-"+e);}var dn,_n=function(e){function r(r,o){var n=this;if(e.call(this),(r instanceof t.window.HTMLElement||o)&&(r=t.extend({element:r},o)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else {this._defaultMarker=!0,this._element=i.create("div"),this._element.setAttribute("aria-label","Map marker");var a=i.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=i.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"fill-rule","nonzero");var c=i.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var h=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];h<u.length;h+=1){var p=u[h],d=i.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",p.rx),d.setAttributeNS(null,"ry",p.ry),c.appendChild(d);}var _=i.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"fill",this._color);var f=i.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),_.appendChild(f);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=i.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(g);var v=i.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var y=i.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=i.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=i.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),y.appendChild(x),y.appendChild(b),l.appendChild(c),l.appendChild(_),l.appendChild(m),l.appendChild(v),l.appendChild(y),a.appendChild(l),this._element.appendChild(a),this._offset=t.Point.convert(r&&r.offset||[0,-14]);}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault();})),this._element.addEventListener("mousedown",(function(t){t.preventDefault();})),this._element.addEventListener("focus",(function(){var t=n._map.getContainer();t.scrollTop=0,t.scrollLeft=0;})),pn(this._element,this._anchor,"marker"),this._popup=null;}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},r.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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),i.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset;}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress);}return this},r.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup();},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup();},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=hn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,un[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+e);}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"));},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive";},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),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));},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),fn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},mn=0,gn=!1,vn=function(e){function r(i){e.call(this),this.options=t.extend({},fn,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this);}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==dn?r(dn):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){r(dn="denied"!==t.state);})):r(dn=!!t.window.navigator.geolocation),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,mn=0,gn=!1;},r.prototype._isOutOfMapMaxBounds=function(t){var 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())},r.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");}},r.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();}},r.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,o=this._map.getBearing(),n=t.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(r),n,{geolocateSource:!0});},r.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(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.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove();},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),r=e.distanceTo(i),o=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=o+"px",this._circleElement.style.height=o+"px";},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();},r.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch();}else {if(3===e.code&&gn)return;this._setErrorState();}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish();}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0;},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o);}else {var n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n);}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new _n(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new _n({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")));}));},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":mn--,gn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++mn>1?(e={maximumAge:6e5,timeout:0},gn=!0):(e=this.options.positionOptions,gn=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e);}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return !0},r.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},r}(t.Evented),yn={maxWidth:100,unit:"metric"},xn=function(e){this.options=t.extend({},yn,e),t.bindAll(["_onMove","setUnit"],this);};function bn(t,e,i){var r=i&&i.maxWidth||100,o=t._container.clientHeight/2,n=t.unproject([0,o]),a=t.unproject([r,o]),s=n.distanceTo(a);if(i&&"imperial"===i.unit){var l=3.2808*s;l>5280?wn(e,r,l/5280,t._getUIString("ScaleControl.Miles")):wn(e,r,l,t._getUIString("ScaleControl.Feet"));}else i&&"nautical"===i.unit?wn(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?wn(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):wn(e,r,s,t._getUIString("ScaleControl.Meters"));}function wn(t,e,i,r){var o,n,a,s=(o=i,(n=Math.pow(10,(""+Math.floor(o)).length-1))*(a=(a=o/n)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+r;}xn.prototype.getDefaultPosition=function(){return "bottom-left"},xn.prototype._onMove=function(){bn(this._map,this._container,this.options);},xn.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},xn.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},xn.prototype.setUnit=function(t){this.options.unit=t,bn(this._map,this._container,this.options);};var En=function(e){t.bindAll(["onMoveStart","onMoveEnd","onRender","getFPS","updateGraph"],this);var i=window.devicePixelRatio,r={background:"rgba(0,0,0,0.9)",barWidth:4*i,color:"#7cf859",font:"Monaco, Consolas, Courier, monospace",graphHeight:60*i,graphWidth:120*i,graphTop:0,graphRight:5*i,width:130*i};this.frames=0,this.totalTime=0,this.totalFrames=0,this.options=Object.assign({},r,e);};En.prototype.onAdd=function(t){this.map=t,console.log("onAdd",this.map);var e=window.devicePixelRatio,i=this.options,r=i.width,o=i.graphHeight,n=i.color,a=i.background,s=i.font,l=this.container=document.createElement("div");return l.className="mapboxgl-ctrl mapboxgl-ctrl-fps",l.style.backgroundColor=a,l.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=n,this.readOutput.style.fontFamily=s,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="mapboxgl-ctrl-canvas",this.canvas.width=r,this.canvas.height=o,this.canvas.style.cssText="width: "+r/e+"px; height: "+o/e+"px;",l.appendChild(this.readOutput),l.appendChild(this.canvas),this.map.on("movestart",this.onMoveStart),this.map.on("moveend",this.onMoveEnd),this.container},En.prototype.onMoveStart=function(){this.frames=0,this.time=performance.now(),this.map.on("render",this.onRender);},En.prototype.onMoveEnd=function(){var t=performance.now();this.updateGraph(this.getFPS(t)),this.frames=0,this.time=null,this.map.off("render",this.onRender);},En.prototype.onRender=function(){this.frames++;var t=performance.now();t>=this.time+1e3&&(this.updateGraph(this.getFPS(t)),this.frames=0,this.time=t);},En.prototype.getFPS=function(t){return this.totalTime+=t-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(t-this.time))||0},En.prototype.updateGraph=function(t){var e=this.options,i=e.barWidth,r=e.graphRight,o=e.graphTop,n=e.graphWidth,a=e.graphHeight,s=e.background,l=e.color,c=this.canvas.getContext("2d"),h=Math.round(1e3*this.totalFrames/this.totalTime)||0,u=i;c.fillStyle=s,c.globalAlpha=1,c.fillRect(0,0,n,o),c.fillStyle=l,this.readOutput.textContent="当前:"+t+" (平均:"+h+" )",c.drawImage(this.canvas,r+u,o,n-u,a,r,o,n-u,a),c.fillRect(r+n-u,o,u,a),c.fillStyle=s,c.globalAlpha=.75,c.fillRect(r+n-u,o,u,(1-t/100)*a);},En.prototype.onRemove=function(){return this.map.off("render",this.onRender),this.map.off("movestart",this.onMoveStart),this.map.off("moveend",this.onMoveEnd),this.container.parentNode.removeChild(this.container),this.map=null,this};var Tn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange");};Tn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Tn.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Tn.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Tn.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Tn.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Tn.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Tn.prototype._isFullscreen=function(){return this._fullscreen},Tn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle());},Tn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen();};var Cn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},In=function(e){function r(i){e.call(this),this.options=t.extend(Object.create(Cn),i),t.bindAll(["_update","_onClose","remove"],this);}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(e){var i=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){i._update(t.point);})),this._map.on("mouseup",(function(t){i._update(t.point);})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return !!this._map},r.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},r.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point);})),this._map.on("drag",(function(e){t._update(e.point);})),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var i,r=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;i=o.firstChild;)r.appendChild(i);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t);},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t);},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose));},r.prototype._update=function(e){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return r._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=hn(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=this.options.anchor,a=function e(i){if(i){if("number"==typeof i){var r=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-i),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var o=t.Point.convert(i);return {center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return {center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!n){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=o.y+a.bottom.y<c?["top"]:o.y>this._map.transform.height-c?["bottom"]:[],o.x<l/2?s.push("left"):o.x>this._map.transform.width-l/2&&s.push("right"),n=0===s.length?"bottom":s.join("-");}var h=o.add(a[n]).round();i.setTransform(this._container,un[n]+" translate("+h.x+"px,"+h.y+"px)"),pn(this._container,n,"popup");}},r.prototype._onClose=function(){this.remove();},r}(t.Evented),Sn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Wr,OfflineMap:function(e){return function(e){return "string"==typeof e.style||e.style instanceof String?(i=e.style,new Promise((function(e,r){var o=new t.window.XMLHttpRequest;return o.open("GET",i,!0),o.setRequestHeader("Accept","application/json"),o.onerror=function(t){return r(t)},o.onload=function(){var t=0===o.responseURL.indexOf("file://");if((o.status>=200&&o.status<300||t)&&o.response)try{e(JSON.parse(o.response));}catch(t){r(t);}else r(new Error(o.statusText,o.status));},o.send(),o}))).then((function(i){return t.extend({},e,{style:i})})):Promise.resolve(e);var i;}(e).then(sn).then((function(e){return function(e){return new Promise((function(i){var r=t.extend({},e.style,{sources:{},layers:[]}),o=t.extend({},e,{style:r}),n=new Wr(o);console.log("创建空离线地图",o,n),n.once("load",(function(){var e=new Promise((function(t){n.addSourceType("mbtiles",an,(function(){return t()}));})),r=new Promise((function(e){n.addSourceType("rasteroffline",t.RasterTileSourceOffline,(function(){return e()}));}));Promise.all([e,r]).then((function(){return i(n)}));}));}))}(e).then((i=e.style,function(t){return Object.keys(i.sources).map((function(e){return t.addSource(e,i.sources[e])})),console.log("离线地图-加载数据源",i,t),t})).then(function(t){return function(e){return t.layers.map((function(t){return e.addLayer(t)})),console.log("离线地图-加载图层",t,e),e}}(e.style));var i;}))},NavigationControl:cn,GeolocateControl:vn,AttributionControl:Fr,ScaleControl:xn,FullscreenControl:Tn,FpsControl:En,Popup:In,Marker:_n,Style:Ze,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,CRS:t.CRS,Projection:t.Projection,CanonicalTileID:t.CanonicalTileID,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e;},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e;},get workerCount(){return Bt.workerCount},set workerCount(t){Bt.workerCount=t;},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e;},clearStorage:function(e){t.clearTileCache(e);},workerUrl:""};return Sn}));
|
|
34
34
|
|
|
35
35
|
//
|
|
36
36
|
|