!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).maplibregl=e()}(this,(function(){"use strict";var t,e,r;function i(i,o){if(t)if(e){var n="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a);r=o(a);"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([n],{type:"text/javascript"})))}else e=o;else t=o}i(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){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*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,o,n,a;for(void 0===e&&(e=1e-6),o=t,a=0;a<8;a++){if(n=this.sampleCurveX(o)-t,Math.abs(n)(i=1))return i;for(;rn?r=o:i=o,o=.5*(i-r)+r}return o},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var o=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(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),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function l(t,e,i,o){var n=new r(t,e,i,o);return function(t){return n.solve(t)}}var u=l(.25,.1,.25,1);function p(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var i=r-e,o=((t-e)%i+i)%i+e;return o===e?r:o}function h(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,o=e;i>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(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 _(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var i={};for(var o in t)i[o]=e.call(r||this,t[o],o,t);return i}function x(t,e,r){var i={};for(var o in t)e.call(r||this,t[o],o,t)&&(i[o]=t[o]);return i}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var w={};function C(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function k(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,i=t.length,o=i-1,n=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,o){var n=i||o;return e[r]=!n||n.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var T=null;function A(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function P(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var I,L,z,R,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),F=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,B=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,O={now:D,frame:function(t){var e=F(t);return{cancel:function(){return B(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return I||(I=a.document.createElement("a")),I.href=t,I.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==L&&(L=a.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},j={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,REGISTERED_PROTOCOLS:{}},U={supported:!1,testSupport:function(t){!V&&R&&(N?q(t):z=t)}},V=!1,N=!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,R),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),V=!0}a.document&&((R=a.document.createElement("img")).onload=function(){z&&q(z),z=null,N=!0},R.onerror=function(){V=!0,z=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Z="01",$=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function G(t){return 0===t.indexOf("mapbox:")}$.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Z,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},$.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},$.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},$.prototype.normalizeStyleURL=function(t,e){if(!G(t))return t;var r=W(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeGlyphsURL=function(t,e){if(!G(t))return t;var r=W(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeSourceURL=function(t,e){if(!G(t))return t;var r=W(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeSpriteURL=function(t,e,r,i){var o=W(t);return G(t)?(o.path="/styles/v1"+o.path+"/sprite"+e+r,this._makeAPIURL(o,this._customAccessToken||i)):(o.path+=""+e+r,K(o))},$.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=W(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(O.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(o,1)}if("/"!==i.path&&(t.path=""+i.path+t.path),!j.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||j.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),K(t)},$.prototype.setTransformRequest=function(t){this._transformRequestFn=t};var H=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return H.test(t)}var Q=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function W(t){var e=t.match(Q);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 K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Y=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Y.prototype.getStorageKey=function(t){var e,r=J(j.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):j.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Y.prototype.fetchEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=a.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i));var o=a.localStorage.getItem(r);o&&(this.anonId=o)}catch(t){C("Unable to read from LocalStorage")}},Y.prototype.saveEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){C("Unable to write to LocalStorage")}},Y.prototype.processRequests=function(t){},Y.prototype.postEvent=function(t,e,r,i){var o=this;if(j.EVENTS_URL){var n=W(j.EVENTS_URL);n.params.push("access_token="+(i||j.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.15.2",skuId:Z,userId:this.anonId},s=e?h(a,e):a,l={url:K(n),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=wt(l,(function(t){o.pendingRequest=null,r(t),o.saveEventData(),o.processRequests(i)}))}},Y.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=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,i){this.skuToken=r,(j.EVENTS_URL&&i||j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||X(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,o=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=m()),this.postEvent(o,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0)}),t))}},e}(Y),it=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){j.EVENTS_URL&&j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||X(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=J(j.ACCESS_TOKEN),i=r?r.u:j.ACCESS_TOKEN,o=i!==this.eventData.tokenU;y(this.anonId)||(this.anonId=m(),o=!0);var n=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(n),l=(n-this.eventData.lastSuccess)/864e5;o=o||l>=1||l<-1||a.getDate()!==s.getDate()}else o=!0;if(!o)return this.processRequests();this.postEvent(n,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=n,e.eventData.tokenU=i)}),t)}},e}(Y)),ot=it.postTurnstileEvent.bind(it),nt=new rt,at=nt.postMapLoadEvent.bind(nt),st=500,lt=50;function ut(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function pt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ct,ht=1/0;function dt(){return null==ct&&(ct=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ct}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var mt=function(t){function e(e,r,i){401===r&&X(i)&&(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=i,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),yt=E()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};function _t(t,e){var r,i=new a.AbortController,o=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:i.signal}),n=!1,s=!1,l=(r=o.url).indexOf("sku=")>0&&X(r);"json"===t.type&&o.headers.set("Accept","application/json");var u=function(r,i,n){if(!s){if(r&&"SecurityError"!==r.message&&C(r),i&&n)return p(i);var u=Date.now();a.fetch(o).then((function(r){if(r.ok){var i=l?r.clone():null;return p(r,i,u)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},p=function(r,i,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(i&&l&&function(t,e,r){if(ut(),tt){var i={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var o=M(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&i.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,i);ut(),tt&&tt.then((function(e){return e.put(pt(t.url),r)})).catch((function(t){return C(t.message)}))})))}}(o,i,l),n=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return l?function(t,e){if(ut(),!tt)return e(null);var r=pt(t.url);tt.then((function(t){t.match(r).then((function(i){var o=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),o&&t.put(r,i.clone()),e(null,i,o)})).catch(e)})).catch(e)}(o,u):u(null,null),{cancel:function(){s=!0,n||i.abort()}}}var gt,vt,xt=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e);if(!E()){var r=t.url.substring(0,t.url.indexOf("://"));return(j.REGISTERED_PROTOCOLS[r]||_t)(t,e)}}if(!(/^file:/.test(i=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(i))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return _t(t,e);if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var r=new a.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);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 i=r.response;if("json"===t.type)try{i=JSON.parse(r.response)}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new mt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},bt=function(t,e){return xt(h(t,{type:"arrayBuffer"}),e)},wt=function(t,e){return xt(h(t,{method:"POST"}),e)},Ct="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";gt=[],vt=0;var kt=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),vt>=j.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}vt++;var i=!1,o=function(){if(!i)for(i=!0,vt--;gt.length&&vt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},At.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pt={$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"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{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},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},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":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"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"}}},It=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Lt(t){var e=t.value;return e?[new It(t.key,e,"constants have been deprecated as of v8")]:[]}function zt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,o=e;i":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Wt=[Ot,jt,Ut,Vt,Nt,Gt,qt,Xt(Zt),Ht];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(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,i=Wt;r255?255:t}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function n(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(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 l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var p=s.substr(0,l),c=s.substr(l+1,u-(l+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=n(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),h];case"hsla":if(4!==c.length)return null;h=n(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=n(c[1]),m=n(c[2]),y=m<=.5?m*(f+1):m+f-m*f,_=2*m-y;return[i(255*a(_,y,d+1/3)),i(255*a(_,y,d)),i(255*a(_,y,d-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,ee=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ee.parse=function(t){if(t){if(t instanceof ee)return t;if("string"==typeof t){var e=te(t);if(e)return new ee(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ee.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},ee.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]},ee.black=new ee(0,0,0,1),ee.white=new ee(1,1,1,1),ee.transparent=new ee(0,0,0,0),ee.red=new ee(1,0,0,1);var re=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"})};re.prototype.compare=function(t,e){return this.collator.compare(t,e)},re.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ie=function(t,e,r,i,o){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=o},oe=function(t){this.sections=t};oe.fromString=function(t){return new oe([new ie(t,null,null,null,null)])},oe.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}))},oe.factory=function(t){return t instanceof oe?t:oe.fromString(t)},oe.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},oe.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function se(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 ee)return!0;if(t instanceof re)return!0;if(t instanceof oe)return!0;if(t instanceof ne)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=he[s],i++}else n=Zt;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);a=t[2],i++}r=Xt(n,a)}else r=he[o];for(var l=[];i1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Gt,this.sections=t};fe.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 i=[],o=!1,n=1;n<=t.length-1;++n){var a=t[n];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,jt)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,Xt(Ut))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,Nt)))return null;var p=i[i.length-1];p.scale=s,p.font=l,p.textColor=u}else{var c=e.parse(t[n],1,Zt);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'.");o=!0,i.push({content:c,scale:null,font:null,textColor:null})}}return new fe(i)},fe.prototype.evaluate=function(t){return new oe(this.sections.map((function(e){var r=e.content.evaluate(t);return le(r)===Ht?new ie("",r,null,null,null):new ie(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},me.prototype.eachChild=function(t){t(this.input)},me.prototype.outputDefined=function(){return!1},me.prototype.serialize=function(){return["image",this.input.serialize()]};var ye={"to-boolean":Vt,"to-color":Nt,"to-number":jt,"to-string":Ut},_e=function(t,e){this.type=t,this.args=e};_e.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 i=ye[r],o=[],n=1;n4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ae(e[0],e[1],e[2],e[3])))return new ee(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ke(t,e){var r=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*8192),Math.round(i*o*8192)]}function Se(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 Ee(t,e){for(var r,i,o,n,a,s,l,u=!1,p=0,c=e.length;p0&&s<0||a<0&&s>0}function Ae(t,e,r){for(var i=0,o=r;ir[2]){var o=.5*i,n=t[0]-r[0]>o?-i:r[0]-t[0]>o?i:0;0===n&&(n=t[0]-r[2]>o?-i:r[2]-t[0]>o?i:0),t[0]+=n}we(e,t)}function De(t,e,r,i){for(var o=8192*Math.pow(2,i.z),n=[8192*i.x,8192*i.y],a=[],s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Ue(t,e)&&(r=!1)})),r}Be.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(se(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;ie))throw new ce("Input is not a number.");n=a-1}return 0}Ne.prototype.parse=function(t,e,r,i,o){return void 0===o&&(o={}),e?this.concat(e,r,i)._parse(t,o):this._parse(t,o)},Ne.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new de(e,[t]):"coerce"===r?new _e(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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var o=this.registry[i];if(o){var n=o.parse(t,this);if(!n)return null;if(this.expectedType){var a=this.expectedType,s=n.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else n=r(n,a,e.typeAnnotation||"coerce");else n=r(n,a,e.typeAnnotation||"assert")}if(!(n instanceof pe)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ve)return t(e.boundExpression);if(e instanceof xe&&"error"===e.name)return!1;if(e instanceof be)return!1;if(e instanceof Be)return!1;var r=e instanceof _e||e instanceof de,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof pe})),!!i&&Oe(e)&&Ue(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(n)){var l=new ve;try{n=new pe(n.type,n.evaluate(l))}catch(t){return this.error(t.message),null}}return n}return this.error('Unknown expression "'+i+'". 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.")},Ne.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,o=r?this.scope.concat(r):this.scope;return new Ne(this.registry,i,e||null,o,this.errors)},Ne.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ft(i,t))},Ne.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var Ze=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,o=r;i=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,o);if(!p)return null;o=o||p.type,i.push([a,p])}return new Ze(o,r,i)},Ze.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var o=e.length;return i>=e[o-1]?r[o-1].evaluate(t):r[qe(e,i)].evaluate(t)},Ze.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ge=Object.freeze({__proto__:null,number:$e,color:function(t,e,r){return new ee($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,i){return $e(t,e[i],r)}))}}),He=6/29*3*(6/29),Xe=Math.PI/180,Qe=180/Math.PI;function We(t){return t>.008856451679035631?Math.pow(t,1/3):t/He+4/29}function Ke(t){return t>6/29?t*t*t:He*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=Ye(t.r),r=Ye(t.g),i=Ye(t.b),o=We((.4124564*e+.3575761*r+.1804375*i)/.95047),n=We((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*n-16,a:500*(o-n),b:200*(n-We((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),i=1.08883*Ke(i),new ee(Je(3.2404542*r-1.5371385*e-.4985314*i),Je(-.969266*r+1.8760108*e+.041556*i),Je(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function rr(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var ir={forward:tr,reverse:er,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)}}},or={forward:function(t){var e=tr(t),r=e.l,i=e.a,o=e.b,n=Math.atan2(o,i)*Qe;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:rr(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)}}},nr=Object.freeze({__proto__:null,lab:ir,hcl:or}),ar=function(t,e,r,i,o){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var n=0,a=o;n1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={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(!(o=e.parse(o,2,jt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Nt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=e.parse(h,f,u);if(!m)return null;u=u||m.type,l.push([c,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new ar(u,r,i,o,l):e.error("Type "+Qt(u)+" is not interpolatable.")},ar.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var o=e.length;if(i>=e[o-1])return r[o-1].evaluate(t);var n=qe(e,i),a=ar.interpolationFactor(this.interpolation,i,e[n],e[n+1]),s=r[n].evaluate(t),l=r[n+1].evaluate(t);return"interpolate"===this.operator?Ge[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?or.reverse(or.interpolate(or.forward(s),or.forward(l),a)):ir.reverse(ir.interpolate(ir.forward(s),ir.forward(l),a))},ar.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},pr.prototype.eachChild=function(t){t(this.index),t(this.input)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Vt,this.needle=t,this.haystack=e};cr.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,Zt),i=e.parse(t[2],2,Zt);return r&&i?Jt(r.type,[Vt,Ut,jt,Ot,Zt])?new cr(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Qt(le(e))+" instead.");if(!Yt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Qt(le(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=jt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),i=e.parse(t[2],2,Zt);if(!r||!i)return null;if(!Jt(r.type,[Vt,Ut,jt,Ot,Zt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(r.type)+" instead");if(4===t.length){var o=e.parse(t[3],3,jt);return o?new hr(r,i,o):null}return new hr(r,i)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Qt(le(e))+" instead.");if(!Yt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Qt(le(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var dr=function(t,e,r,i,o,n){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=o,this.otherwise=n};dr.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,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o={},n=[],a=2;aNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,le(h)))return null}else r=le(h);if(void 0!==o[String(h)])return u.error("Branch labels must be unique.");o[String(h)]=n.length}var d=e.parse(l,a,i);if(!d)return null;i=i||d.type,n.push(d)}var f=e.parse(t[1],1,Zt);if(!f)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new dr(r,i,f,o,n,m):null},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(le(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},dr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},dr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},dr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},o=0,n=Object.keys(this.cases).sort();o=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Zt),i=e.parse(t[2],2,jt);if(!r||!i)return null;if(!Jt(r.type,[Xt(Zt),Ut,Zt]))return e.error("Expected first argument to be of type array or string, but found "+Qt(r.type)+" instead");if(4===t.length){var o=e.parse(t[3],3,jt);return o?new mr(r.type,r,i,o):null}return new mr(r.type,r,i)},mr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Qt(le(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},mr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},mr.prototype.outputDefined=function(){return!1},mr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vr=gr("==",(function(t,e,r){return e===r}),_r),xr=gr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!_r(0,e,r,i)})),br=gr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),Cr=gr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),kr=gr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Sr=function(t,e,r,i,o){this.type=Ut,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=o};Sr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,jt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=e.parse(i.locale,1,Ut)))return null;var n=null;if(i.currency&&!(n=e.parse(i.currency,1,Ut)))return null;var a=null;if(i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,jt)))return null;var s=null;return i["max-fraction-digits"]&&!(s=e.parse(i["max-fraction-digits"],1,jt))?null:new Sr(r,o,n,a,s)},Sr.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))},Sr.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)},Sr.prototype.outputDefined=function(){return!1},Sr.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 Er=function(t){this.type=jt,this.input=t};Er.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 "+Qt(r.type)+" instead."):new Er(r):null},Er.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 ce("Expected value to be of type string or array, but found "+Qt(le(e))+" instead.")},Er.prototype.eachChild=function(t){t(this.input)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Mr={"==":vr,"!=":xr,">":wr,"<":br,">=":kr,"<=":Cr,array:de,at:pr,boolean:de,case:fr,coalesce:lr,collator:be,format:fe,image:me,in:cr,"index-of":hr,interpolate:ar,"interpolate-hcl":ar,"interpolate-lab":ar,length:Er,let:ur,literal:pe,match:dr,number:de,"number-format":Sr,object:de,slice:mr,step:Ze,string:de,"to-boolean":_e,"to-color":_e,"to-number":_e,"to-string":_e,var:Ve,within:Be};function Tr(t,e){var r=e[0],i=e[1],o=e[2],n=e[3];r=r.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var a=n?n.evaluate(t):1,s=ae(r,i,o,a);if(s)throw new ce(s);return new ee(r/255*a,i/255*a,o/255*a,a)}function Ar(t,e){return t in e}function Pr(t,e){var r=e[t];return void 0===r?null:r}function Ir(t){return{type:t}}function Lr(t){return{result:"success",value:t}}function zr(t){return{result:"error",value:t}}function Rr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Fr(t){return!!t.expression&&t.expression.interpolated}function Br(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Or(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function jr(t){return t}function Ur(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Vr(t,e,r,i,o){return Ur(typeof r===o?i[r]:void 0,t.default,e.default)}function Nr(t,e,r){if("number"!==Br(r))return Ur(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 o=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[o][1]}function qr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Br(r))return Ur(t.default,e.default);var o=t.stops.length;if(1===o)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[o-1][0])return t.stops[o-1][1];var n=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,i){var o=i-r,n=t-r;return 0===o?0:1===e?n/o:(Math.pow(e,n)-1)/(Math.pow(e,o)-1)}(r,i,t.stops[n][0],t.stops[n+1][0]),s=t.stops[n][1],l=t.stops[n+1][1],u=Ge[e.type]||jr;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=nr[t.colorSpace];u=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}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),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,a)}}:u(s,l,a)}function Zr(t,e,r){return"color"===e.type?r=ee.parse(r):"formatted"===e.type?r=oe.fromString(r.toString()):"resolvedImage"===e.type?r=ne.fromString(r.toString()):Br(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ur(r,t.default,e.default)}xe.register(Mr,{error:[{kind:"error"},[Ut],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Ut,[Zt],function(t,e){return Qt(le(e[0].evaluate(t)))}],"to-rgba":[Xt(jt,4),[Nt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Nt,[jt,jt,jt],Tr],rgba:[Nt,[jt,jt,jt,jt],Tr],has:{type:Vt,overloads:[[[Ut],function(t,e){return Ar(e[0].evaluate(t),t.properties())}],[[Ut,qt],function(t,e){var r=e[1];return Ar(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Zt,overloads:[[[Ut],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Ut,qt],function(t,e){var r=e[1];return Pr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Zt,[Ut],function(t,e){return Pr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Ut,[],function(t){return t.geometryType()}],id:[Zt,[],function(t){return t.id()}],zoom:[jt,[],function(t){return t.globals.zoom}],"heatmap-density":[jt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[jt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Zt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[jt,Ir(jt),function(t,e){for(var r=0,i=0,o=e;i":[Vt,[Ut,Zt],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Vt,[Zt],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i>o}],"filter-<=":[Vt,[Ut,Zt],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Vt,[Zt],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i<=o}],"filter->=":[Vt,[Ut,Zt],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Vt,[Zt],function(t,e){var r=e[0],i=t.id(),o=r.value;return typeof i==typeof o&&i>=o}],"filter-has":[Vt,[Zt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Vt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Vt,[Xt(Ut)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Vt,[Xt(Zt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Vt,[Ut,Xt(Zt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Vt,[Ut,Xt(Zt)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var o=r+i>>1;if(e[o]===t)return!0;e[o]>t?i=o-1:r=o+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:Vt,overloads:[[[Vt,Vt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ir(Vt),function(t,e){for(var r=0,i=e;r0&&"string"==typeof t[0]&&t[0]in Mr}function Hr(t,e){var r=new Ne(Mr,[],e?function(t){var e={color:Nt,string:Ut,number:jt,enum:Ut,boolean:Vt,formatted:Gt,resolvedImage:Ht};return"array"===t.type?Xt(e[t.value]||Zt,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Lr(new $r(i,e)):zr(r.errors)}$r.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,o,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},$r.prototype.evaluate=function(t,e,r,i,o,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=n||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Xr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!je(e.expression)};Xr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,o,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,o,n)},Xr.prototype.evaluate=function(t,e,r,i,o,n){return this._styleExpression.evaluate(t,e,r,i,o,n)};var Qr=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!je(e.expression),this.interpolationType=i};function Wr(t,e){if("error"===(t=Hr(t,e)).result)return t;var r=t.value.expression,i=Oe(r);if(!i&&!Rr(e))return zr([new Ft("","data expressions not supported")]);var o=Ue(r,["zoom"]);if(!o&&!Dr(e))return zr([new Ft("","zoom expressions not supported")]);var n=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof lr)for(var i=0,o=e.args;ii.maximum?[new It(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function ei(t){var e,r,i,o=t.valueSpec,n=Rt(t.value.type),a={},s="categorical"!==n&&void 0===t.value.property,l=!s,u="array"===Br(t.value.stops)&&"array"===Br(t.value.stops[0])&&"object"===Br(t.value.stops[0][0]),p=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===n)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Yr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Br(r)&&0===r.length&&e.push(new It(t.key,r,"array must have at least one stop")),e},default:function(t){return Ci({key:t.key,value:t.value,valueSpec:o,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===n&&s&&p.push(new It(t.key,t.value,'missing required property "property"')),"identity"===n||t.value.stops||p.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===n&&t.valueSpec.expression&&!Fr(t.valueSpec)&&p.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Rr(t.valueSpec)?p.push(new It(t.key,t.value,"property functions not supported")):s&&!Dr(t.valueSpec)&&p.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==n&&!u||void 0!==t.value.property||p.push(new It(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],n=t.value,s=t.key;if("array"!==Br(n))return[new It(s,n,"array expected, "+Br(n)+" found")];if(2!==n.length)return[new It(s,n,"array length 2 expected, length "+n.length+" found")];if(u){if("object"!==Br(n[0]))return[new It(s,n,"object expected, "+Br(n[0])+" found")];if(void 0===n[0].zoom)return[new It(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new It(s,n,"object stop key must have value")];if(i&&i>Rt(n[0].zoom))return[new It(s,n[0].zoom,"stop zoom values must appear in ascending order")];Rt(n[0].zoom)!==i&&(i=Rt(n[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:ti,value:h}}))}else e=e.concat(h({key:s+"[0]",value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Gr(Dt(n[1]))?e.concat([new It(s+"[1]",n[1],"expressions are not allowed in function stops.")]):e.concat(Ci({key:s+"[1]",value:n[1],valueSpec:o,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=Br(t.value),l=Rt(t.value),u=null!==t.value?t.value:i;if(e){if(s!==e)return[new It(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new It(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){var p="number expected, "+s+" found";return Rr(o)&&void 0===n&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,u,p)]}return"categorical"!==n||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&void 0!==r&&l=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);ee?1:0}function li(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?ui(t[1],t[2],"=="):"!="===r?hi(ui(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?ui(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(li))):"all"===r?["all"].concat(t.slice(1).map(li)):"none"===r?["all"].concat(t.slice(1).map(li).map(hi)):"in"===r?pi(t[1],t.slice(2)):"!in"===r?hi(pi(t[1],t.slice(2))):"has"===r?ci(t[1]):"!has"===r?hi(ci(t[1])):"within"!==r||t}function ui(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 pi(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(si)]]:["filter-in-small",t,["literal",e]]}}function ci(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hi(t){return["!",t]}function di(t){return oi(Dt(t.value))?ri(zt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Br(r))return[new It(i,r,"array expected, "+Br(r)+" found")];var o,n=e.styleSpec,a=[];if(r.length<1)return[new It(i,r,"filter array must have at least 1 element")];switch(a=a.concat(ii({key:i+"[0]",value:r[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Rt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Rt(r[1])&&a.push(new It(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new It(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=Br(r[1]))&&a.push(new It(i+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s=p[d+0]&&i>=p[d+1])?(a[h]=!0,n.push(u[h])):a[h]=!1}}},Ri.prototype._forEachCell=function(t,e,r,i,o,n,a,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(i),h=l;h<=p;h++)for(var d=u;d<=c;d++){var f=this.d*d+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(d),this._convertFromCellCoord(h+1),this._convertFromCellCoord(d+1)))&&o.call(this,t,e,r,i,f,n,a,s))return}},Ri.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Ri.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Ri.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i=0)){var p=t[u];l[u]=Bi[s].shallow.indexOf(u)>=0?p:Ni(p,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function qi(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||Ui(t)||Vi(t)||ArrayBuffer.isView(t)||t instanceof Di)return t;if(Array.isArray(t))return t.map(qi);if("object"==typeof t){var e=t.$name||"Object",r=Bi[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),o=0,n=Object.keys(t);o=0?s:qi(s)}}return i}throw new Error("can't deserialize object of type "+typeof t)}var Zi=function(){this.first=!0};Zi.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=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 Gi(t){for(var e=0,r=t;e=65097&&t<=65103)||$i["CJK Compatibility Ideographs"](t)||$i["CJK Compatibility"](t)||$i["CJK Radicals Supplement"](t)||$i["CJK Strokes"](t)||!(!$i["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||$i["CJK Unified Ideographs Extension A"](t)||$i["CJK Unified Ideographs"](t)||$i["Enclosed CJK Letters and Months"](t)||$i["Hangul Compatibility Jamo"](t)||$i["Hangul Jamo Extended-A"](t)||$i["Hangul Jamo Extended-B"](t)||$i["Hangul Jamo"](t)||$i["Hangul Syllables"](t)||$i.Hiragana(t)||$i["Ideographic Description Characters"](t)||$i.Kanbun(t)||$i["Kangxi Radicals"](t)||$i["Katakana Phonetic Extensions"](t)||$i.Katakana(t)&&12540!==t||!(!$i["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)||!(!$i["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||$i["Unified Canadian Aboriginal Syllabics"](t)||$i["Unified Canadian Aboriginal Syllabics Extended"](t)||$i["Vertical Forms"](t)||$i["Yijing Hexagram Symbols"](t)||$i["Yi Syllables"](t)||$i["Yi Radicals"](t))))}function Xi(t){return!(Hi(t)||function(t){return!!($i["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||$i["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)||$i["Letterlike Symbols"](t)||$i["Number Forms"](t)||$i["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)||$i["Control Pictures"](t)&&9251!==t||$i["Optical Character Recognition"](t)||$i["Enclosed Alphanumerics"](t)||$i["Geometric Shapes"](t)||$i["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||$i["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||$i["CJK Symbols and Punctuation"](t)||$i.Katakana(t)||$i["Private Use Area"](t)||$i["CJK Compatibility Forms"](t)||$i["Small Form Variants"](t)||$i["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 Qi(t){return t>=1424&&t<=2303||$i["Arabic Presentation Forms-A"](t)||$i["Arabic Presentation Forms-B"](t)}function Wi(t,e){return!(!e&&Qi(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||$i.Khmer(t))}function Ki(t){for(var e=0,r=t;e-1&&(Yi="error"),Ji&&Ji(t)};function ro(){io.fire(new Mt("pluginStateChange",{pluginStatus:Yi,pluginURL:to}))}var io=new At,oo=function(){return Yi},no=function(){if("deferred"!==Yi||!to)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yi="loading",ro(),to&&bt({url:to},(function(t){t?eo(t):(Yi="loaded",ro())}))},ao={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Yi||null!=ao.applyArabicShaping},isLoading:function(){return"loading"===Yi},setState:function(t){Yi=t.pluginStatus,to=t.pluginURL},isParsed:function(){return null!=ao.applyArabicShaping&&null!=ao.processBidirectionalText&&null!=ao.processStyledBidirectionalText},getPluginURL:function(){return to}},so=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 Zi,this.transition={})};so.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var lo=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Or(t))return new Kr(t,e);if(Gr(t)){var r=Wr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ee.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)};lo.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},lo.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var uo=function(t){this.property=t,this.value=new lo(t,void 0)};uo.prototype.transitioned=function(t,e){return new co(this.property,this.value,e,h({},t.transition,this.transition),t.now)},uo.prototype.untransitioned=function(){return new co(this.property,this.value,null,{},0)};var po=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};po.prototype.getValue=function(t){return b(this._values[t].value.value)},po.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new uo(this._values[t].property)),this._values[t].value=new lo(this._values[t].property,null===e?void 0:b(e))},po.prototype.getTransition=function(t){return b(this._values[t].transition)},po.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new uo(this._values[t].property)),this._values[t].transition=b(e)||void 0},po.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return o};var ho=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ho.prototype.possiblyEvaluate=function(t,e,r){for(var i=new yo(this._properties),o=0,n=Object.keys(this._values);oi.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(go),xo=function(t){this.specification=t};xo.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var o=t.expression.evaluate(e,null,{},r,i);return this._calculate(o,o,o,e)}return this._calculate(t.expression.evaluate(new so(Math.floor(e.zoom-1),e)),t.expression.evaluate(new so(Math.floor(e.zoom),e)),t.expression.evaluate(new so(Math.floor(e.zoom+1),e)),e)}},xo.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},xo.prototype.interpolate=function(t){return t};var bo=function(t){this.specification=t};bo.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},bo.prototype.interpolate=function(){return!1};var wo=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 i=this.defaultPropertyValues[e]=new lo(r,void 0),o=this.defaultTransitionablePropertyValues[e]=new uo(r);this.defaultTransitioningPropertyValues[e]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Oi("DataDrivenProperty",go),Oi("DataConstantProperty",_o),Oi("CrossFadedDataDrivenProperty",vo),Oi("CrossFadedProperty",xo),Oi("ColorRampProperty",bo);var Co=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.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 fo(r.layout)),r.paint)){for(var i in this._transitionablePaint=new po(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new yo(r.paint)}}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(Ii,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return g(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(Pi,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),a=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||n||o||this._handleOverridablePaintPropertyUpdate(t,a,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.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,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,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,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Li(this,t.call(Ti,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Pt,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 mo&&Rr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(At),ko={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},So=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},Eo=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Mo(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var o=ko[t.type].BYTES_PER_ELEMENT,n=r=To(r,Math.max(e,o)),a=t.components||1;return i=Math.max(i,o),r+=o*a,{name:t.name,type:t.type,components:a,offset:n}})),size:To(r,Math.max(i,e)),alignment:e}}function To(t,e){return Math.ceil(t/e)*e}Eo.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Eo.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},Eo.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Eo.prototype.clear=function(){this.length=0},Eo.prototype.resize=function(t){this.reserve(t),this.length=t},Eo.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)}},Eo.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ao=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 i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(Eo);Ao.prototype.bytesPerElement=4,Oi("StructArrayLayout2i4",Ao);var Po=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,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=4*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,this.int16[n+3]=o,t},e}(Eo);Po.prototype.bytesPerElement=8,Oi("StructArrayLayout4i8",Po);var Io=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,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=o,this.int16[s+4]=n,this.int16[s+5]=a,t},e}(Eo);Io.prototype.bytesPerElement=12,Oi("StructArrayLayout2i4i12",Io);var Lo=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,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=o,this.uint8[l+6]=n,this.uint8[l+7]=a,t},e}(Eo);Lo.prototype.bytesPerElement=8,Oi("StructArrayLayout2i4ub8",Lo);var zo=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 i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(Eo);zo.prototype.bytesPerElement=8,Oi("StructArrayLayout2f8",zo);var Ro=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,i,o,n,a,s,l,u){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,i,o,n,a,s,l,u)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,u,p){var c=10*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=o,this.uint16[c+4]=n,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=p,t},e}(Eo);Ro.prototype.bytesPerElement=20,Oi("StructArrayLayout10ui20",Ro);var Do=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,i,o,n,a,s,l,u,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,o,n,a,s,l,u,p,c)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,u,p,c,h){var d=12*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=o,this.uint16[d+4]=n,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=p,this.int16[d+10]=c,this.int16[d+11]=h,t},e}(Eo);Do.prototype.bytesPerElement=24,Oi("StructArrayLayout4i4ui4i24",Do);var Fo=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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,t},e}(Eo);Fo.prototype.bytesPerElement=12,Oi("StructArrayLayout3f12",Fo);var Bo=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}(Eo);Bo.prototype.bytesPerElement=4,Oi("StructArrayLayout1ul4",Bo);var Oo=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,i,o,n,a,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,o,n,a,s,l)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,u){var p=10*t,c=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=i,this.int16[p+3]=o,this.int16[p+4]=n,this.int16[p+5]=a,this.uint32[c+3]=s,this.uint16[p+8]=l,this.uint16[p+9]=u,t},e}(Eo);Oo.prototype.bytesPerElement=20,Oi("StructArrayLayout6i1ul2ui20",Oo);var jo=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,i,o,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,o,n)},e.prototype.emplace=function(t,e,r,i,o,n,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=o,this.int16[s+4]=n,this.int16[s+5]=a,t},e}(Eo);jo.prototype.bytesPerElement=12,Oi("StructArrayLayout2i2i2i12",jo);var Uo=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),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,o){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i,o)},e.prototype.emplace=function(t,e,r,i,o,n){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.int16[s+6]=o,this.int16[s+7]=n,t},e}(Eo);Uo.prototype.bytesPerElement=16,Oi("StructArrayLayout2f1f2i16",Uo);var Vo=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,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=12*t,a=3*t;return this.uint8[n+0]=e,this.uint8[n+1]=r,this.float32[a+1]=i,this.float32[a+2]=o,t},e}(Eo);Vo.prototype.bytesPerElement=12,Oi("StructArrayLayout2ub2f12",Vo);var No=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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.uint16[o+0]=e,this.uint16[o+1]=r,this.uint16[o+2]=i,t},e}(Eo);No.prototype.bytesPerElement=6,Oi("StructArrayLayout3ui6",No);var qo=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,i,o,n,a,s,l,u,p,c,h,d,f,m,y){var _=this.length;return this.resize(_+1),this.emplace(_,t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m,y)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m,y,_){var g=24*t,v=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=i,this.uint16[g+3]=o,this.uint32[v+2]=n,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=p,this.float32[v+7]=c,this.float32[v+8]=h,this.uint8[x+36]=d,this.uint8[x+37]=f,this.uint8[x+38]=m,this.uint32[v+10]=y,this.int16[g+22]=_,t},e}(Eo);qo.prototype.bytesPerElement=48,Oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qo);var Zo=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,i,o,n,a,s,l,u,p,c,h,d,f,m,y,_,g,v,x,b,w,C,k,S,E,M){var T=this.length;return this.resize(T+1),this.emplace(T,t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m,y,_,g,v,x,b,w,C,k,S,E,M)},e.prototype.emplace=function(t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m,y,_,g,v,x,b,w,C,k,S,E,M,T){var A=34*t,P=17*t;return this.int16[A+0]=e,this.int16[A+1]=r,this.int16[A+2]=i,this.int16[A+3]=o,this.int16[A+4]=n,this.int16[A+5]=a,this.int16[A+6]=s,this.int16[A+7]=l,this.uint16[A+8]=u,this.uint16[A+9]=p,this.uint16[A+10]=c,this.uint16[A+11]=h,this.uint16[A+12]=d,this.uint16[A+13]=f,this.uint16[A+14]=m,this.uint16[A+15]=y,this.uint16[A+16]=_,this.uint16[A+17]=g,this.uint16[A+18]=v,this.uint16[A+19]=x,this.uint16[A+20]=b,this.uint16[A+21]=w,this.uint16[A+22]=C,this.uint32[P+12]=k,this.float32[P+13]=S,this.float32[P+14]=E,this.float32[P+15]=M,this.float32[P+16]=T,t},e}(Eo);Zo.prototype.bytesPerElement=68,Oi("StructArrayLayout8i15ui1ul4f68",Zo);var $o=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}(Eo);$o.prototype.bytesPerElement=4,Oi("StructArrayLayout1f4",$o);var Go=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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=3*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,t},e}(Eo);Go.prototype.bytesPerElement=6,Oi("StructArrayLayout3i6",Go);var Ho=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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var o=4*t;return this.uint32[2*t+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=i,t},e}(Eo);Ho.prototype.bytesPerElement=8,Oi("StructArrayLayout1ul2ui8",Ho);var Xo=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 i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(Eo);Xo.prototype.bytesPerElement=4,Oi("StructArrayLayout2ui4",Xo);var Qo=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}(Eo);Qo.prototype.bytesPerElement=2,Oi("StructArrayLayout1ui2",Qo);var Wo=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,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,o){var n=4*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,this.float32[n+3]=o,t},e}(Eo);Wo.prototype.bytesPerElement=16,Oi("StructArrayLayout4f16",Wo);var Ko=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},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.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(So);Ko.prototype.size=20;var Jo=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 Ko(this,t)},e}(Oo);Oi("CollisionBoxArray",Jo);var Yo=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}(So);Yo.prototype.size=48;var tn=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 Yo(this,t)},e}(qo);Oi("PlacedSymbolArray",tn);var en=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},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{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.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(So);en.prototype.size=68;var rn=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 en(this,t)},e}(Zo);Oi("SymbolInstanceArray",rn);var on=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}($o);Oi("GlyphOffsetArray",on);var nn=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}(Go);Oi("SymbolLineVertexArray",nn);var an=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}(So);an.prototype.size=8;var sn=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 an(this,t)},e}(Ho);Oi("FeatureIndexArray",sn);var ln=Mo([{name:"a_pos",components:2,type:"Int16"}],4).members,un=function(t){void 0===t&&(t=[]),this.segments=t};function pn(t,e){return 256*(t=p(Math.floor(t),0,255))+p(Math.floor(e),0,255)}un.prototype.prepareSegment=function(t,e,r,i){var o=this.segments[this.segments.length-1];return t>un.MAX_VERTEX_ARRAY_LENGTH&&C("Max vertices per segment is "+un.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!o||o.vertexLength+t>un.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(o.sortKey=i),this.segments.push(o)),o},un.prototype.get=function(){return this.segments},un.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(n>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:o^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return o^=t.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0}})),dn=e((function(t){t.exports=function(t,e){for(var r,i=t.length,o=e^i,n=0;i>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++n;switch(i){case 3:o^=(255&t.charCodeAt(n+2))<<16;case 2:o^=(255&t.charCodeAt(n+1))<<8;case 1:o=1540483477*(65535&(o^=255&t.charCodeAt(n)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0}})),fn=hn,mn=dn;fn.murmur3=hn,fn.murmur2=mn;var yn=function(){this.ids=[],this.positions=[],this.indexed=!1};yn.prototype.add=function(t,e,r,i){this.ids.push(gn(t)),this.positions.push(e,r,i)},yn.prototype.getPositions=function(t){for(var e=gn(t),r=0,i=this.ids.length-1;r>1;this.ids[o]>=e?i=o:r=o+1}for(var n=[];this.ids[r]===e;)n.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return n},yn.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,o){for(;i>1],a=i-1,s=o+1;;){do{a++}while(e[a]n);if(a>=s)break;vn(e,a,s),vn(r,3*a,3*s),vn(r,3*a+1,3*s+1),vn(r,3*a+2,3*s+2)}s-ia.x+1||la.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Nn(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Vn(t):[]}}function qn(t,e,r,i,o){t.emplaceBack(2*e+(i+1)/2,2*r+(o+1)/2)}var Zn=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 Ao,this.indexArray=new No,this.segments=new un,this.programConfigurations=new Fn(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function $n(t,e){for(var r=0;r1){if(Qn(t,e))return!0;for(var i=0;i1?r:r.sub(e)._mult(o)._add(e))}function Yn(t,e){for(var r,i,o,n=!1,a=0;ae.y!=(o=r[l]).y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(n=!n);return n}function ta(t,e){for(var r=!1,i=0,o=t.length-1;ie.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function ea(t,e,r){var i=r[0],o=r[2];if(t.xo.x&&e.x>o.x||t.yo.y&&e.y>o.y)return!1;var n=k(t,e,r[0]);return n!==k(t,e,r[1])||n!==k(t,e,r[2])||n!==k(t,e,r[3])}function ra(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ia(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function oa(t,e,r,i,n){if(!e[0]&&!e[1])return t;var a=o.convert(e)._mult(n);"viewport"===r&&a._rotate(-i);for(var s=[],l=0;l=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;qn(this.layoutVertexArray,u,p,-1,-1),qn(this.layoutVertexArray,u,p,1,-1),qn(this.layoutVertexArray,u,p,1,1),qn(this.layoutVertexArray,u,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,{},i)},Oi("CircleBucket",Zn,{omit:["layers"]});var na=new wo({"circle-sort-key":new go(Pt.layout_circle["circle-sort-key"])}),aa={paint:new wo({"circle-radius":new go(Pt.paint_circle["circle-radius"]),"circle-color":new go(Pt.paint_circle["circle-color"]),"circle-blur":new go(Pt.paint_circle["circle-blur"]),"circle-opacity":new go(Pt.paint_circle["circle-opacity"]),"circle-translate":new _o(Pt.paint_circle["circle-translate"]),"circle-translate-anchor":new _o(Pt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new _o(Pt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new _o(Pt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new go(Pt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new go(Pt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new go(Pt.paint_circle["circle-stroke-opacity"])}),layout:na},sa="undefined"!=typeof Float32Array?Float32Array:Array;function la(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ua(t,e,r){var i=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],u=e[6],p=e[7],c=e[8],h=e[9],d=e[10],f=e[11],m=e[12],y=e[13],_=e[14],g=e[15],v=r[0],x=r[1],b=r[2],w=r[3];return t[0]=v*i+x*s+b*c+w*m,t[1]=v*o+x*l+b*h+w*y,t[2]=v*n+x*u+b*d+w*_,t[3]=v*a+x*p+b*f+w*g,t[4]=(v=r[4])*i+(x=r[5])*s+(b=r[6])*c+(w=r[7])*m,t[5]=v*o+x*l+b*h+w*y,t[6]=v*n+x*u+b*d+w*_,t[7]=v*a+x*p+b*f+w*g,t[8]=(v=r[8])*i+(x=r[9])*s+(b=r[10])*c+(w=r[11])*m,t[9]=v*o+x*l+b*h+w*y,t[10]=v*n+x*u+b*d+w*_,t[11]=v*a+x*p+b*f+w*g,t[12]=(v=r[12])*i+(x=r[13])*s+(b=r[14])*c+(w=r[15])*m,t[13]=v*o+x*l+b*h+w*y,t[14]=v*n+x*u+b*d+w*_,t[15]=v*a+x*p+b*f+w*g,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)});var pa,ca=ua;function ha(t,e,r){var i=e[0],o=e[1],n=e[2],a=e[3];return t[0]=r[0]*i+r[4]*o+r[8]*n+r[12]*a,t[1]=r[1]*i+r[5]*o+r[9]*n+r[13]*a,t[2]=r[2]*i+r[6]*o+r[10]*n+r[14]*a,t[3]=r[3]*i+r[7]*o+r[11]*n+r[15]*a,t}pa=new sa(3),sa!=Float32Array&&(pa[0]=0,pa[1]=0,pa[2]=0),function(){var t=new sa(4);sa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var da=(function(){var t=new sa(2);sa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,aa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Zn(t)},e.prototype.queryRadius=function(t){var e=t;return ra("circle-radius",this,e)+ra("circle-stroke-width",this,e)+ia(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,o,n,a,s){for(var l=oa(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),n.angle,a),u=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?l:function(t,e){return t.map((function(t){return fa(t,e)}))}(l,s),h=p?u*a:u,d=0,f=i;dt.width||o.height>t.height||r.x>t.width-o.width||r.y>t.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||i.x>e.width-o.width||i.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l80*r){i=n=t[0],o=a=t[1];for(var f=r;fn&&(n=s),l>a&&(a=l);u=0!==(u=Math.max(n-i,a-o))?1/u:0}return La(h,d,r,i,o,u),d}function Pa(t,e,r,i,o){var n,a;if(o===ts(t,e,r,i)>0)for(n=e;n=e;n-=i)a=Ka(n,t[n],t[n+1],a);return a&&$a(a,a.next)&&(Ja(a),a=a.next),a}function Ia(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!$a(i,i.next)&&0!==Za(i.prev,i,i.next))i=i.next;else{if(Ja(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function La(t,e,r,i,o,n,a){if(t){!a&&n&&function(t,e,r,i){var o=t;do{null===o.z&&(o.z=Ua(o.x,o.y,e,r,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,r,i,o,n,a,s,l,u=1;do{for(r=t,t=null,n=null,a=0;r;){for(a++,i=r,s=0,e=0;e0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(o=r,r=r.nextZ,s--):(o=i,i=i.nextZ,l--),n?n.nextZ=o:t=o,o.prevZ=n,n=o;r=i}n.nextZ=null,u*=2}while(a>1)}(o)}(t,i,o,n);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,n?Ra(t,i,o,n):za(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ja(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?La(t=Da(Ia(t),e,r),e,r,i,o,n,2):2===a&&Fa(t,e,r,i,o,n):La(Ia(t),e,r,i,o,n,1);break}}}function za(t){var e=t.prev,r=t,i=t.next;if(Za(e,r,i)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(Na(e.x,e.y,r.x,r.y,i.x,i.y,o.x,o.y)&&Za(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function Ra(t,e,r,i){var o=t.prev,n=t,a=t.next;if(Za(o,n,a)>=0)return!1;for(var s=o.x>n.x?o.x>a.x?o.x:a.x:n.x>a.x?n.x:a.x,l=o.y>n.y?o.y>a.y?o.y:a.y:n.y>a.y?n.y:a.y,u=Ua(o.x=u&&h&&h.z<=p;){if(c!==t.prev&&c!==t.next&&Na(o.x,o.y,n.x,n.y,a.x,a.y,c.x,c.y)&&Za(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==t.prev&&h!==t.next&&Na(o.x,o.y,n.x,n.y,a.x,a.y,h.x,h.y)&&Za(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=u;){if(c!==t.prev&&c!==t.next&&Na(o.x,o.y,n.x,n.y,a.x,a.y,c.x,c.y)&&Za(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=p;){if(h!==t.prev&&h!==t.next&&Na(o.x,o.y,n.x,n.y,a.x,a.y,h.x,h.y)&&Za(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function Da(t,e,r){var i=t;do{var o=i.prev,n=i.next.next;!$a(o,n)&&Ga(o,i,i.next,n)&&Qa(o,n)&&Qa(n,o)&&(e.push(o.i/r),e.push(i.i/r),e.push(n.i/r),Ja(i),Ja(i.next),i=t=n),i=i.next}while(i!==t);return Ia(i)}function Fa(t,e,r,i,o,n){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var l=Wa(a,s);return a=Ia(a,a.next),l=Ia(l,l.next),La(a,e,r,i,o,n),void La(l,e,r,i,o,n)}s=s.next}a=a.next}while(a!==t)}function Ba(t,e){return t.x-e.x}function Oa(t,e){if(e=function(t,e){var r,i=e,o=t.x,n=t.y,a=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var s=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=o&&s>a){if(a=s,s===o){if(n===i.y)return i;if(n===i.next.y)return i.next}r=i.x=i.x&&i.x>=p&&o!==i.x&&Na(nr.x||i.x===r.x&&ja(r,i)))&&(r=i,h=l)),i=i.next}while(i!==u);return r}(t,e)){var r=Wa(e,t);Ia(e,e.next),Ia(r,r.next)}}function ja(t,e){return Za(t.prev,t,e.prev)<0&&Za(e.next,t,t.next)<0}function Ua(t,e,r,i,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Va(t){var e=t,r=t;do{(e.x=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(n-s)-(o-a)*(i-s)>=0}function qa(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&&Ga(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Qa(t,e)&&Qa(e,t)&&function(t,e){var r=t,i=!1,o=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>n&&r.next.y!==r.y&&o<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(Za(t.prev,t,e.prev)||Za(t,e.prev,e))||$a(t,e)&&Za(t.prev,t,t.next)>0&&Za(e.prev,e,e.next)>0)}function Za(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function $a(t,e){return t.x===e.x&&t.y===e.y}function Ga(t,e,r,i){var o=Xa(Za(t,e,r)),n=Xa(Za(t,e,i)),a=Xa(Za(r,i,t)),s=Xa(Za(r,i,e));return o!==n&&a!==s||!(0!==o||!Ha(t,r,e))||!(0!==n||!Ha(t,i,e))||!(0!==a||!Ha(r,t,i))||!(0!==s||!Ha(r,e,i))}function Ha(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 Xa(t){return t>0?1:t<0?-1:0}function Qa(t,e){return Za(t.prev,t,t.next)<0?Za(t,e,t.next)>=0&&Za(t,t.prev,e)>=0:Za(t,e,t.prev)<0||Za(t,t.next,e)<0}function Wa(t,e){var r=new Ya(t.i,t.x,t.y),i=new Ya(e.i,e.x,e.y),o=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=o,o.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function Ka(t,e,r,i){var o=new Ya(t,e,r);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function Ja(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 Ya(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ts(t,e,r,i){for(var o=0,n=e,a=r-i;ni;){if(o-i>600){var a=o-i+1,s=r-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-s*u/a+p)),Math.min(o,Math.floor(r+(a-s)*u/a+p)),n)}var c=e[r],h=i,d=o;for(rs(e,i,r),n(e[o],c)>0&&rs(e,i,o);h0;)d--}0===n(e[i],c)?rs(e,i,d):rs(e,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,e,r||0,i||t.length-1,o||is)}function rs(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function is(t,e){return te?1:0}function os(t,e){var r=t.length;if(r<=1)return[t];for(var i,o,n=[],a=0;a1)for(var l=0;l0&&r.holes.push(i+=t[o-1].length)}return r},Ma.default=Ta;var ls=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 Ao,this.indexArray=new No,this.indexArray2=new Xo,this.programConfigurations=new Fn(t.layers,t.zoom),this.segments=new un,this.segments2=new un,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ls.prototype.populate=function(t,e,r){this.hasPattern=as("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),n=[],a=0,s=t;a>3}if(n--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&l.push(e),e=[]),e.push(new o(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&l.push(e),l},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,o=0,n=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos>3}if(i--,1===r||2===r)(o+=t.readSVarint())s&&(s=o),(n+=t.readSVarint())u&&(u=n);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},fs.prototype.toGeoJSON=function(t,e,r){var i,o,n=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=fs.types[this.type];function p(t){for(var e=0;e>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}function xs(t,e,r){if(3===t){var i=new _s(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}gs.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 ds(this._pbf,e,this.extent,this._keys,this._values)};var bs={VectorTile:function(t,e){this.layers=t.readFields(xs,{},e)},VectorTileFeature:ds,VectorTileLayer:_s},ws=bs.VectorTileFeature.types,Cs=Math.pow(2,13);function ks(t,e,r,i,o,n,a,s){t.emplaceBack(e,r,2*Math.floor(i*Cs)+a,o*Cs*2,n*Cs*2,Math.round(s))}var Ss=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 Io,this.indexArray=new No,this.programConfigurations=new Fn(t.layers,t.zoom),this.segments=new un,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Es(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Ss.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=as("fill-extrusion",this.layers,e);for(var i=0,o=t;i8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var m=0,y=0;y=1){var g=f[y-1];if(!Es(_,g)){c.vertexLength+4>un.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=_.sub(g)._perp()._unit(),x=g.dist(_);m+x>32768&&(m=0),ks(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,m),ks(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,m),ks(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,m+=x),ks(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,m);var b=c.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+l>un.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ws[t.type]){for(var w=[],C=[],k=c.vertexLength,S=0,E=s;S=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u0;if(C&&_>u){var S=p.dist(d);if(S>2*c){var E=p.sub(p.sub(d)._mult(c/S)._round());this.updateDistance(d,E),this.addCurrentVertex(E,m,0,0,h),d=E}}var M=d&&f,T=M?r:s?"butt":i;if(M&&"round"===T&&(bo&&(T="bevel"),"bevel"===T&&(b>2&&(T="flipbevel"),b100)g=y.mult(-1);else{var A=b*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(A*(k?-1:1))}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h)}else if("bevel"===T||"fakeround"===T){var P=-Math.sqrt(b*b-1),I=k?P:0,L=k?0:P;if(d&&this.addCurrentVertex(p,m,I,L,h),"fakeround"===T)for(var z=Math.round(180*w/Math.PI/20),R=1;R2*c){var U=p.add(f.sub(p)._mult(c/j)._round());this.updateDistance(p,U),this.addCurrentVertex(U,y,0,0,h),p=U}}}}},Fs.prototype.addCurrentVertex=function(t,e,r,i,o,n){void 0===n&&(n=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,n,!1,r,o),this.addHalfVertex(t,a,s,n,!0,-i,o),this.distance>Ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,o,n))},Fs.prototype.addHalfVertex=function(t,e,r,i,o,n,a){var s=.5*(this.lineClips?this.scaledDistance*(Ds-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(o?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===n?0:n<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l},Fs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Oi("LineBucket",Fs,{omit:["layers","patternFeatures"]});var Bs=new wo({"line-cap":new _o(Pt.layout_line["line-cap"]),"line-join":new go(Pt.layout_line["line-join"]),"line-miter-limit":new _o(Pt.layout_line["line-miter-limit"]),"line-round-limit":new _o(Pt.layout_line["line-round-limit"]),"line-sort-key":new go(Pt.layout_line["line-sort-key"])}),Os={paint:new wo({"line-opacity":new go(Pt.paint_line["line-opacity"]),"line-color":new go(Pt.paint_line["line-color"]),"line-translate":new _o(Pt.paint_line["line-translate"]),"line-translate-anchor":new _o(Pt.paint_line["line-translate-anchor"]),"line-width":new go(Pt.paint_line["line-width"]),"line-gap-width":new go(Pt.paint_line["line-gap-width"]),"line-offset":new go(Pt.paint_line["line-offset"]),"line-blur":new go(Pt.paint_line["line-blur"]),"line-dasharray":new xo(Pt.paint_line["line-dasharray"]),"line-pattern":new vo(Pt.paint_line["line-pattern"]),"line-gradient":new bo(Pt.paint_line["line-gradient"])}),layout:Bs},js=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 so(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,i,o){return r=h({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,o)},e}(go))(Os.paint.properties["line-width"].specification);js.useIntegerZoom=!0;var Us=function(t){function e(e){t.call(this,e,Os),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ze,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=js.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Fs(t)},e.prototype.queryRadius=function(t){var e=t,r=Vs(ra("line-width",this,e),ra("line-gap-width",this,e)),i=ra("line-offset",this,e);return r/2+Math.abs(i)+ia(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a,s){var l=oa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),u=s/2*Vs(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&&(i=function(t,e){for(var r=[],i=new o(0,0),n=0;n=3)for(var n=0;n0?e+2*t:t}var Ns=Mo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=Mo([{name:"a_projected_pos",components:3,type:"Float32"}],4),Zs=(Mo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Mo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),$s=(Mo([{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"}]),Mo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Gs=Mo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Hs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),ao.applyArabicShaping&&(t=ao.applyArabicShaping(t)),t}(t.text,e,r)})),t}Mo([{name:"triangle",components:3,type:"Uint16"}]),Mo([{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"}]),Mo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Mo([{type:"Float32",name:"offsetX"}]),Mo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Xs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Qs=function(t,e,r,i,o){var n,a,s=8*o-i-1,l=(1<>1,p=-7,c=r?o-1:0,h=r?-1:1,d=t[e+c];for(c+=h,n=d&(1<<-p)-1,d>>=-p,p+=s;p>0;n=256*n+t[e+c],c+=h,p-=8);for(a=n&(1<<-p)-1,n>>=-p,p+=i;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===n)n=1-u;else{if(n===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),n-=u}return(d?-1:1)*a*Math.pow(2,n-i)},Ws=function(t,e,r,i,o,n){var a,s,l,u=8*n-o-1,p=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:n-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?h/l:h*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*l-1)*Math.pow(2,o),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&s,d+=f,s/=256,o-=8);for(a=a<0;t[r+d]=255&a,d+=f,a/=256,u-=8);t[r+d-f]|=128*m},Ks=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 tl(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function el(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function rl(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var o=r.pos-1;o>=t;o--)r.buf[o+i]=r.buf[o]}function il(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ml(t,e,r){1===t&&r.readMessage(yl,e)}function yl(t,e,r){if(3===t){var i=r.readMessage(_l,{}),o=i.width,n=i.height,a=i.left,s=i.top,l=i.advance;e.push({id:i.id,bitmap:new va({width:o+6,height:n+6},i.bitmap),metrics:{width:o,height:n,left:a,top:s,advance:l}})}}function _l(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 gl(t){for(var e=0,r=0,i=0,o=t;i=0;h--){var d=a[h];if(!(c.w>d.w||c.h>d.h)){if(c.x=d.x,c.y=d.y,l=Math.max(l,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===d.w&&c.h===d.h){var f=a.pop();h>3,n=this.pos;this.type=7&i,t(o,e,this),this.pos===n&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Qs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Qs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,o,n=r.buf;if(i=(112&(o=n[r.pos++]))>>4,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<3,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<10,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<17,o<128)return el(t,i,e);if(i|=(127&(o=n[r.pos++]))<<24,o<128)return el(t,i,e);if(i|=(1&(o=n[r.pos++]))<<31,o<128)return el(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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 i="",o=e;o239?4:l>223?3:l>191?2:1;if(o+p>r)break;1===p?l<128&&(u=l):2===p?128==(192&(n=t[o+1]))&&(u=(31&l)<<6|63&n)<=127&&(u=null):3===p?(a=t[o+2],128==(192&(n=t[o+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&n)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(a=t[o+2],s=t[o+3],128==(192&(n=t[o+1]))&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),o+=p}return i}(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=tl(this);for(t=t||[];this.pos127;);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;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+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)))))}(i,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 i,o,n=0;n55295&&i<57344){if(!o){i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}i=o-55296<<10|i-56320|65536,o=null}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&rl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ws(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ws(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=128&&rl(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cl,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 vl=function(t,e){var r=e.pixelRatio,i=e.version,o=e.stretchX,n=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=o,this.stretchY=n,this.content=a,this.version=i},xl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};xl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},xl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},xl.tlbr.get=function(){return this.tl.concat(this.br)},xl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vl.prototype,xl);var bl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var o=[];this.addImages(t,r,o),this.addImages(e,i,o);var n=gl(o),a=new xa({width:n.w||1,height:n.h||1});for(var s in t){var l=t[s],u=r[s].paddedRect;xa.copy(l.data,a,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var p in e){var c=e[p],h=i[p].paddedRect,d=h.x+1,f=h.y+1,m=c.data.width,y=c.data.height;xa.copy(c.data,a,{x:0,y:0},{x:d,y:f},c.data),xa.copy(c.data,a,{x:0,y:y-1},{x:d,y:f-1},{width:m,height:1}),xa.copy(c.data,a,{x:0,y:0},{x:d,y:f+y},{width:m,height:1}),xa.copy(c.data,a,{x:m-1,y:0},{x:d-1,y:f},{width:1,height:y}),xa.copy(c.data,a,{x:0,y:0},{x:d+m,y:f},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=i};bl.prototype.addImages=function(t,e,r){for(var i in t){var o=t[i],n={x:0,y:0,w:o.data.width+2,h:o.data.height+2};r.push(n),e[i]=new vl(n,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},bl.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)},bl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]})}},Oi("ImagePosition",vl),Oi("ImageAtlas",bl);var wl={horizontal:1,vertical:2,horizontalOnly:3},Cl=function(){this.scale=1,this.fontStack="",this.imageName=null};Cl.forText=function(t,e){var r=new Cl;return r.scale=t||1,r.fontStack=e,r},Cl.forImage=function(t){var e=new Cl;return e.imageName=t,e};var kl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Sl(t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m){var y,_=kl.fromFeature(t,o);c===wl.vertical&&_.verticalizePunctuation();var g=ao.processBidirectionalText,v=ao.processStyledBidirectionalText;if(g&&1===_.sections.length){y=[];for(var x=0,b=g(_.toString(),Ll(_,u,n,e,i,d,f));x0&&O>S&&(S=O)}else{var j=r[M.fontStack],U=j&&j[A];if(U&&U.rect)L=U.rect,I=U.metrics;else{var V=e[M.fontStack],N=V&&V[A];if(!N)continue;I=N.metrics}P=24*(b-M.scale)}D?(t.verticalizable=!0,k.push({glyph:A,imageName:z,x:h,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:T,metrics:I,rect:L}),h+=R*M.scale+u):(k.push({glyph:A,imageName:z,x:h,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:T,metrics:I,rect:L}),h+=I.advance*M.scale+u)}0!==k.length&&(f=Math.max(h-u,f),Rl(k,0,k.length-1,y,S)),h=0;var q=n*b+S;C.lineOffset=Math.max(S,w),d+=q,m=Math.max(q,m),++_}else d+=n,++_}var Z,$=d- -17,G=zl(a),H=G.horizontalAlign,X=G.verticalAlign;(function(t,e,r,i,o,n,a,s,l){var u,p=(e-r)*o;u=n!==a?-s*i- -17:(-i*l+.5)*a;for(var c=0,h=t;c=0&&i>=t&&El[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},kl.prototype.substring=function(t,e){var r=new kl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},kl.prototype.toString=function(){return this.text},kl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},kl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Cl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var El={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ml={};function Tl(t,e,r,i,o,n){if(e.imageName){var a=i[e.imageName];return a?a.displaySize[0]*e.scale*24/n+o:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+o:0}function Al(t,e,r,i){var o=Math.pow(t-e,2);return i?t=0,c=0,h=0;h-r/2;){if(--a<0)return!1;s-=t[a].dist(n),n=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;si;)u-=l.shift().angleDelta;if(u>o)return!1;a++,s+=p.dist(c)}return!0}function Nl(t){for(var e=0,r=0;ru){var f=(u-l)/d,m=$e(c.x,h.x,f),y=$e(c.y,h.y,f),_=new Fl(m,y,h.angleTo(c),p);return _._round(),!a||Vl(t,_,s,a,e)?_:void 0}l+=d}}function Gl(t,e,r,i,o,n,a,s,l){var u=ql(i,n,a),p=Zl(i,o),c=p*a,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-c=0&&b=0&&w=0&&d+p<=c){var C=new Fl(b,w,v,m);C._round(),o&&!Vl(e,C,a,o,n)||f.push(C)}}h+=g}return l||f.length||s||(f=t(e,h/2,i,o,n,a,s,!0,u)),f}(t,h?e/2*s%e:(p/2+2*n)*a*s%e,e,u,r,c,h,!1,l)}function Hl(t,e,r,i,n){for(var a=[],s=0;s=i&&h.x>=i||(c.x>=i?c=new o(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new o(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=n&&h.y>=n||(c.y>=n?c=new o(c.x+(n-c.y)/(h.y-c.y)*(h.x-c.x),n)._round():h.y>=n&&(h=new o(c.x+(n-c.y)/(h.y-c.y)*(h.x-c.x),n)._round()),u&&c.equals(u[u.length-1])||a.push(u=[c]),u.push(h)))))}return a}function Xl(t,e,r,i){var n=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,u=a.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=a.stretchX||[[0,l]],d=a.stretchY||[[0,u]],f=function(t,e){return t+e[1]-e[0]},m=h.reduce(f,0),y=d.reduce(f,0),_=l-m,g=u-y,v=0,x=m,b=0,w=y,C=0,k=_,S=0,E=g;if(a.content&&i){var M=a.content;v=Ql(h,0,M[0]),b=Ql(d,0,M[1]),x=Ql(h,M[0],M[2]),w=Ql(d,M[1],M[3]),C=M[0]-v,S=M[1]-b,k=M[2]-M[0]-x,E=M[3]-M[1]-w}var T=function(i,n,l,u){var h=Kl(i.stretch-v,x,p,t.left),d=Jl(i.fixed-C,k,i.stretch,m),f=Kl(n.stretch-b,w,c,t.top),_=Jl(n.fixed-S,E,n.stretch,y),g=Kl(l.stretch-v,x,p,t.left),M=Jl(l.fixed-C,k,l.stretch,m),T=Kl(u.stretch-b,w,c,t.top),A=Jl(u.fixed-S,E,u.stretch,y),P=new o(h,f),I=new o(g,f),L=new o(g,T),z=new o(h,T),R=new o(d/s,_/s),D=new o(M/s,A/s),F=e*Math.PI/180;if(F){var B=Math.sin(F),O=Math.cos(F),j=[O,-B,B,O];P._matMult(j),I._matMult(j),z._matMult(j),L._matMult(j)}var U=i.stretch+i.fixed,V=n.stretch+n.fixed;return{tl:P,tr:I,bl:z,br:L,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+V,w:l.stretch+l.fixed-U,h:u.stretch+u.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:k/s/p,minFontScaleY:E/s/c,isSDF:r}};if(i&&(a.stretchX||a.stretchY))for(var A=Wl(h,_,m),P=Wl(d,g,y),I=0;I0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=a.top*s-l,y=a.bottom*s+l,_=a.left*s-l,g=a.right*s+l,v=a.collisionPadding;if(v&&(_-=v[0]*s,m-=v[1]*s,g+=v[2]*s,y+=v[3]*s),p){var x=new o(_,m),b=new o(g,m),w=new o(_,y),C=new o(g,y),k=p*Math.PI/180;x._rotate(k),b._rotate(k),w._rotate(k),C._rotate(k),_=Math.min(x.x,b.x,w.x,C.x),g=Math.max(x.x,b.x,w.x,C.x),m=Math.min(x.y,b.y,w.y,C.y),y=Math.max(x.y,b.y,w.y,C.y)}t.emplaceBack(e.x,e.y,_,m,g,y,r,i,n)}this.boxEndIndex=t.length},tu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=eu),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 eu(t,e){return te?1:0}function ru(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,n=1/0,a=-1/0,s=-1/0,l=t[0],u=0;ua)&&(a=p.x),(!u||p.y>s)&&(s=p.y)}var c=Math.min(a-i,s-n),h=c/2,d=new tu([],iu);if(0===c)return new o(i,n);for(var f=i;fy.d||!y.d)&&(y=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,_)),g.max-y.d<=e||(d.push(new ou(g.p.x-(h=g.h/2),g.p.y-h,h,t)),d.push(new ou(g.p.x+h,g.p.y-h,h,t)),d.push(new ou(g.p.x-h,g.p.y+h,h,t)),d.push(new ou(g.p.x+h,g.p.y+h,h,t)),_+=4)}return r&&(console.log("num probes: "+_),console.log("best distance: "+y.d)),y.p}function iu(t,e){return e.max-t.max}function ou(t,e,r,i){this.p=new o(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,o=0;ot.y!=p.y>t.y&&t.x<(p.x-u.x)*(t.y-u.y)/(p.y-u.y)+u.x&&(r=!r),i=Math.min(i,Jn(t,u,p))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}tu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},tu.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}},tu.prototype.peek=function(){return this.data[0]},tu.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var o=t-1>>1,n=e[o];if(r(i,n)>=0)break;e[t]=n,t=o}e[t]=i},tu.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,o=e[t];t=0)break;e[t]=a,t=n}e[t]=o};var nu=Number.POSITIVE_INFINITY;function au(t,e){return e[1]!==nu?function(t,e,r){var i=0,o=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":o=r-7;break;case"bottom-right":case"bottom-left":case"bottom":o=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,o]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var o=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=o-7;break;case"bottom-right":case"bottom-left":i=7-o;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-o;break;case"top-left":case"bottom-left":r=o;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}function su(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 lu(t,e,r,i,n,a,s,l,u,p,c,h,d,f,m){var y=function(t,e,r,i,n,a,s,l){for(var u=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,p=[],c=0,h=e.positionedLines;c32640&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===_.kind&&((g=[128*f.compositeTextSizes[0].evaluate(s,{},m),128*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||g[1]>32640)&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,g,l,a,s,p,e,u.lineStartIndex,u.lineLength,d,m);for(var v=0,x=c;v=0;a--)if(i.dist(n[a])0)&&("constant"!==n.value.kind||n.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],l||u){for(var c=e.iconDependencies,h=e.glyphDependencies,d=e.availableImages,f=new so(this.zoom),m=0,y=t;m=0;for(var L=0,z=k.sections;L=0;s--)n[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=e[s-1].dist(e[s]));for(var l=0;l0},gu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},gu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},gu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},gu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},gu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,o=r.vertexStartIndex;o1||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,i=this.symbolInstanceIndexes;r=0&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oi("SymbolBucket",gu,{omit:["layers","collisionBoxArray","features","compareText"]}),gu.MAX_GLYPHS=65535,gu.addDynamicAttributes=fu;var vu=new wo({"symbol-placement":new _o(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new _o(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new _o(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new go(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new _o(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new _o(Pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new _o(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new _o(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new _o(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new go(Pt.layout_symbol["icon-size"]),"icon-text-fit":new _o(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new _o(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new go(Pt.layout_symbol["icon-image"]),"icon-rotate":new go(Pt.layout_symbol["icon-rotate"]),"icon-padding":new _o(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new _o(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new go(Pt.layout_symbol["icon-offset"]),"icon-anchor":new go(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new _o(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new _o(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new _o(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new go(Pt.layout_symbol["text-field"]),"text-font":new go(Pt.layout_symbol["text-font"]),"text-size":new go(Pt.layout_symbol["text-size"]),"text-max-width":new go(Pt.layout_symbol["text-max-width"]),"text-line-height":new _o(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new go(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new go(Pt.layout_symbol["text-justify"]),"text-radial-offset":new go(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new _o(Pt.layout_symbol["text-variable-anchor"]),"text-anchor":new go(Pt.layout_symbol["text-anchor"]),"text-max-angle":new _o(Pt.layout_symbol["text-max-angle"]),"text-writing-mode":new _o(Pt.layout_symbol["text-writing-mode"]),"text-rotate":new go(Pt.layout_symbol["text-rotate"]),"text-padding":new _o(Pt.layout_symbol["text-padding"]),"text-keep-upright":new _o(Pt.layout_symbol["text-keep-upright"]),"text-transform":new go(Pt.layout_symbol["text-transform"]),"text-offset":new go(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new _o(Pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new _o(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new _o(Pt.layout_symbol["text-optional"])}),xu={paint:new wo({"icon-opacity":new go(Pt.paint_symbol["icon-opacity"]),"icon-color":new go(Pt.paint_symbol["icon-color"]),"icon-halo-color":new go(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new go(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new go(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new _o(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new _o(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new go(Pt.paint_symbol["text-opacity"]),"text-color":new go(Pt.paint_symbol["text-color"],{runtimeType:Nt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new go(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new go(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new go(Pt.paint_symbol["text-halo-blur"]),"text-translate":new _o(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new _o(Pt.paint_symbol["text-translate-anchor"])}),layout:vu},bu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ot,this.defaultValue=t};bu.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},bu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},bu.prototype.outputDefined=function(){return!1},bu.prototype.serialize=function(){return null},Oi("FormatSectionOverride",bu,{omit:["defaultValue"]});var wu=function(t){function e(e){t.call(this,e,xu)}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 i=this.layout.get("text-writing-mode");if(i){for(var o=[],n=0,a=i;n",targetMapId:i,sourceMapId:n.mapId})}}},Fu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i()}else E()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Fu.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)}},Fu.prototype.processTask=function(t,e){var r=this;if(""===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(qi(e.error)):i(null,qi(e.data)))}else{var o=!1,n=A(this.globalScope)?void 0:[],a=e.hasCallback?function(e,i){o=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?Ni(e):null,data:Ni(i,n)},n)}:function(t){o=!0},s=null,l=qi(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,a);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,a)}else a(new Error("Could not find function "+e.type));!o&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Fu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ou=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]))};Ou.prototype.setNorthEast=function(t){return this._ne=t instanceof ju?new ju(t.lng,t.lat):ju.convert(t),this},Ou.prototype.setSouthWest=function(t){return this._sw=t instanceof ju?new ju(t.lng,t.lat):ju.convert(t),this},Ou.prototype.extend=function(t){var e,r,i=this._sw,o=this._ne;if(t instanceof ju)e=t,r=t;else{if(!(t instanceof Ou))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ou.convert(t)):this.extend(ju.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||o?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new ju(e.lng,e.lat),this._ne=new ju(r.lng,r.lat)),this},Ou.prototype.getCenter=function(){return new ju((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Ou.prototype.getSouthWest=function(){return this._sw},Ou.prototype.getNorthEast=function(){return this._ne},Ou.prototype.getNorthWest=function(){return new ju(this.getWest(),this.getNorth())},Ou.prototype.getSouthEast=function(){return new ju(this.getEast(),this.getSouth())},Ou.prototype.getWest=function(){return this._sw.lng},Ou.prototype.getSouth=function(){return this._sw.lat},Ou.prototype.getEast=function(){return this._ne.lng},Ou.prototype.getNorth=function(){return this._ne.lat},Ou.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Ou.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Ou.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Ou.prototype.contains=function(t){var e=ju.convert(t),r=e.lng,i=e.lat,o=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&o},Ou.convert=function(t){return!t||t instanceof Ou?t:new Ou(t)};var ju=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")};ju.prototype.wrap=function(){return new ju(c(this.lng,-180,180),this.lat)},ju.prototype.toArray=function(){return[this.lng,this.lat]},ju.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},ju.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,o=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(o,1))},ju.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 Ou(new ju(this.lng-r,this.lat-e),new ju(this.lng+r,this.lat+e))},ju.convert=function(t){if(t instanceof ju)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new ju(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new ju(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Uu=2*Math.PI*6371008.8;function Vu(t){return Uu*Math.cos(t*Math.PI/180)}function Nu(t){return(180+t)/360}function qu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Zu(t,e){return t/Vu(e)}function $u(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Gu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Gu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=ju.convert(t);return new Gu(Nu(r.lng),qu(r.lat),Zu(e,r.lat))},Gu.prototype.toLngLat=function(){return new ju(360*this.x-180,$u(this.y))},Gu.prototype.toAltitude=function(){return this.z*Vu($u(this.y))},Gu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Uu*(t=$u(this.y),1/Math.cos(t*Math.PI/180));var t};var Hu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Wu(0,t,t,e,r)};Hu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Hu.prototype.url=function(t,e){var r,i,o,n,a,s=(i=this.y,o=this.z,n=Bu(256*(r=this.x),256*(i=Math.pow(2,o)-i-1),o),a=Bu(256*(r+1),256*(i+1),o),n[0]+","+n[1]+","+a[0]+","+a[1]),l=function(t,e,r){for(var i,o="",n=t;n>0;n--)o+=(e&(i=1<this.canonical.z?new Qu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Qu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Wu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Wu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Qu.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>e&&t.canonical.y===this.canonical.y>>e},Qu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Qu(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,i=2*this.canonical.y;return[new Qu(e,this.wrap,e,r,i),new Qu(e,this.wrap,e,r+1,i),new Qu(e,this.wrap,e,r,i+1),new Qu(e,this.wrap,e,r+1,i+1)]},Qu.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},Ku.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Ku.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Ku.prototype.getPixels=function(){return new xa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ku.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,o=e*this.dim+this.dim,n=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=o-1;break;case 1:o=i+1}switch(r){case-1:n=a-1;break;case 1:a=n+1}for(var s=-e*this.dim,l=-r*this.dim,u=n;u=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},rp.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new bs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Ju(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},rp.prototype.query=function(t,e,r,i){var n=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,l=ai(a.filter),u=t.queryGeometry,p=t.queryPadding*s,c=op(u),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),d=op(t.cameraQueryGeometry),f=this.grid3D.query(d.minX-p,d.minY-p,d.maxX+p,d.maxY+p,(function(e,r,i,n){return function(t,e,r,i,n){for(var a=0,s=t;a=l.x&&n>=l.y)return!0}var u=[new o(e,r),new o(e,n),new o(i,n),new o(i,r)];if(t.length>2)for(var p=0,c=u;p=0)return!0;return!1}(n,c)){var d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(i);if(o.needGeometry){var m=Nn(f,!0);if(!o.filter(new so(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!o.filter(new so(this.tileID.overscaledZ),f))return;for(var y=this.getId(f,d),_=0;_i)o=!1;else if(e)if(this.expirationTimelt&&(t.getActor().send("enforceCacheSizeLimit",st),ht=0)},t.clamp=p,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Hl,t.clone=function(t){var e=new sa(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 sa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Gs,t.config=j,t.create=function(){var t=new sa(16);return sa!=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 sa(9);return sa!=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 sa(4);return sa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Hr,t.createLayout=Mo,t.createStyleLayer=function(t){return"custom"===t.type?new Mu(t):new Tu[t.type](t)},t.cross=function(t,e,r){var i=e[0],o=e[1],n=e[2],a=r[0],s=r[1],l=r[2];return t[0]=o*l-n*s,t[1]=n*a-i*l,t[2]=i*s-o*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},t.number=$e,t.offscreenCanvasSupported=dt,t.ortho=function(t,e,r,i,o,n,a){var s=1/(e-r),l=1/(i-o),u=1/(n-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(o+i)*l,t[14]=(a+n)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(ml,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,i,o,n,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,c=p.maxZoom;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new so(p.minZoom),a),l["text-size"].possiblyEvaluate(new so(c),a)]}if("composite"===t.iconSizeData.kind){var h=t.iconSizeData,d=h.maxZoom;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new so(h.minZoom),a),l["icon-size"].possiblyEvaluate(new so(d),a)]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new so(t.zoom+1),a),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new so(t.zoom+1),a),u.textMaxSize=l["text-size"].possiblyEvaluate(new so(18));for(var f=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),_=s.get("text-size"),g=function(){var n=x[v],l=s.get("text-font").evaluate(n,{},a).join(","),p=_.evaluate(n,{},a),c=u.layoutTextSize.evaluate(n,{},a),h=u.layoutIconSize.evaluate(n,{},a),d={horizontal:{},vertical:void 0},g=n.text,b=[0,0];if(g){var w=g.toString(),k=24*s.get("text-letter-spacing").evaluate(n,{},a),S=function(t){for(var e=0,r=t;e=8192||c.y<0||c.y>=8192||function(t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m,y,_,g,v,x,b,w,k,S){var E,M,T,A,P,I=t.addToLineVertexArray(e,r),L=0,z=0,R=0,D=0,F=-1,B=-1,O={},j=fn(""),U=0,V=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(E=s.layout.get("text-offset").evaluate(x,{},k).map((function(t){return 24*t})))[0],V=E[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},k),V=nu),t.allowVerticalPlacement&&i.vertical){var N=s.layout.get("text-rotate").evaluate(x,{},k)+90;A=new Yl(l,e,u,p,c,i.vertical,h,d,f,N),a&&(P=new Yl(l,e,u,p,c,a,y,_,f,N))}if(o){var q=s.layout.get("icon-rotate").evaluate(x,{}),Z="none"!==s.layout.get("icon-text-fit"),$=Xl(o,q,w,Z),G=a?Xl(a,q,w,Z):void 0;T=new Yl(l,e,u,p,c,o,y,_,!1,q),L=4*$.length;var H=t.iconSizeData,X=null;"source"===H.kind?(X=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===H.kind&&((X=[128*b.compositeIconSizes[0].evaluate(x,{},k),128*b.compositeIconSizes[1].evaluate(x,{},k)])[0]>32640||X[1]>32640)&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,$,X,v,g,x,!1,e,I.lineStartIndex,I.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1,G&&(z=4*G.length,t.addSymbols(t.icon,G,X,v,g,x,wl.vertical,e,I.lineStartIndex,I.lineLength,-1,k),B=t.icon.placedSymbolArray.length-1)}for(var Q in i.horizontal){var W=i.horizontal[Q];if(!M){j=fn(W.text);var K=s.layout.get("text-rotate").evaluate(x,{},k);M=new Yl(l,e,u,p,c,W,h,d,f,K)}var J=1===W.positionedLines.length;if(R+=lu(t,e,W,n,s,f,x,m,I,i.vertical?wl.horizontal:wl.horizontalOnly,J?Object.keys(i.horizontal):[Q],O,F,b,k),J)break}i.vertical&&(D+=lu(t,e,i.vertical,n,s,f,x,m,I,wl.vertical,["vertical"],O,B,b,k));var Y=M?M.boxStartIndex:t.collisionBoxArray.length,tt=M?M.boxEndIndex:t.collisionBoxArray.length,et=A?A.boxStartIndex:t.collisionBoxArray.length,rt=A?A.boxEndIndex:t.collisionBoxArray.length,it=T?T.boxStartIndex:t.collisionBoxArray.length,ot=T?T.boxEndIndex:t.collisionBoxArray.length,nt=P?P.boxStartIndex:t.collisionBoxArray.length,at=P?P.boxEndIndex:t.collisionBoxArray.length,st=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=lt(M,st),st=lt(A,st),st=lt(T,st);var ut=(st=lt(P,st))>-1?1:0;ut&&(st*=S/24),t.glyphOffsetArray.length>=gu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,O.right>=0?O.right:-1,O.center>=0?O.center:-1,O.left>=0?O.left:-1,O.vertical||-1,F,B,j,Y,tt,et,rt,it,ot,nt,at,u,R,D,L,z,ut,0,h,U,V,st)}(t,c,s,r,i,o,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,_,b,S,l,v,w,E,f,e,n,u,p,a)};if("line"===M)for(var I=0,L=Hl(e.geometry,0,0,8192,8192);I1){var U=$l(j,k,r.vertical||m,i,24,g);U&&P(j,U)}}else if("Polygon"===e.type)for(var V=0,N=os(e.geometry,0);V=T.maxzoom||"none"!==T.visibility&&(a(M,this.zoom,i),(m[T.id]=T.createBucket({index:p.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),p.bucketLayerIDs.push(M.map((function(t){return t.id}))))}}}var A=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(A).length?n.send("getGlyphs",{uid:this.uid,stacks:A},(function(t,e){c||(c=t,h=e,L.call(l))})):h={};var P=Object.keys(y.iconDependencies);P.length?n.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){c||(c=t,d=e,L.call(l))})):d={};var I=Object.keys(y.patternDependencies);function L(){if(c)return s(c);if(h&&d&&f){var e=new o(h),r=new t.ImageAtlas(d,f);for(var n in m){var l=m[n];l instanceof t.SymbolBucket?(a(l.layers,this.zoom,i),t.performSymbolLayout(l,h,e.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(a(l.layers,this.zoom,i),l.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:p,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}I.length?n.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){c||(c=t,f=e,L.call(l))})):f={},L.call(this)};var l=function(t,e,r,i){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=i||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var i=this,o=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[o]=new n(e);s.abort=this.loadVectorData(e,(function(e,n){if(delete i.loading[o],e||!n)return s.status="done",i.loaded[o]=s,r(e);var l=n.rawData,u={};n.expires&&(u.expires=n.expires),n.cacheControl&&(u.cacheControl=n.cacheControl);var p={};if(a){var c=a.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}s.vectorTile=n.vectorTile,s.parse(n.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){if(e||!i)return r(e);r(null,t.extend({rawTileData:l.slice(0)},i,u,p))})),i.loaded=i.loaded||{},i.loaded[o]=s}))},l.prototype.reloadTile=function(t,e){var r=this,i=this.loaded,o=t.uid,n=this;if(i&&i[o]){var a=i[o];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,i){var o=a.reloadCallback;o&&(delete a.reloadCallback,a.parse(a.vectorTile,n.layerIndex,r.availableImages,n.actor,o)),e(t,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(t,e){var r=this.loading,i=t.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,i=t.uid;r&&r[i]&&delete r[i],e()};var u=t.window.ImageBitmap,p=function(){this.loaded={}};function c(t,e){if(0!==t.length){h(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}p.prototype.loadTile=function(e,r){var i=e.uid,o=e.encoding,n=e.rawImageData,a=u&&n instanceof u?this.getImageData(n):n,s=new t.DEMData(i,a,o);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s)},p.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},p.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var d=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,f=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};f.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r>31}function T(t,e){for(var r=t.loadGeometry(),i=t.type,o=0,n=0,a=r.length,s=0;s>1;!function t(e,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),p=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*p*(s-p)/s)*(l-s/2<0?-1:1);t(e,r,i,Math.max(o,Math.floor(i-l*p/s+c)),Math.min(n,Math.floor(i+(s-l)*p/s+c)),a)}var h=r[2*i+a],d=o,f=n;for(P(e,r,o,i),r[2*n+a]>h&&P(e,r,o,n);dh;)f--}r[2*o+a]===h?P(e,r,o,f):P(e,r,++f,n),f<=i&&(o=f+1),i<=f&&(n=f-1)}}(e,r,s,o,n,a%2),t(e,r,i,o,s-1,a+1),t(e,r,i,s+1,n,a+1)}}(a,s,i,0,a.length-1,0)};D.prototype.range=function(t,e,r,i){return function(t,e,r,i,o,n,a){for(var s,l,u=[0,t.length-1,0],p=[];u.length;){var c=u.pop(),h=u.pop(),d=u.pop();if(h-d<=a)for(var f=d;f<=h;f++)l=e[2*f+1],(s=e[2*f])>=r&&s<=o&&l>=i&&l<=n&&p.push(t[f]);else{var m=Math.floor((d+h)/2);l=e[2*m+1],(s=e[2*m])>=r&&s<=o&&l>=i&&l<=n&&p.push(t[m]);var y=(c+1)%2;(0===c?r<=s:i<=l)&&(u.push(d),u.push(m-1),u.push(y)),(0===c?o>=s:n>=l)&&(u.push(m+1),u.push(h),u.push(y))}}return p}(this.ids,this.coords,t,e,r,i,this.nodeSize)},D.prototype.within=function(t,e,r){return function(t,e,r,i,o,n){for(var a=[0,t.length-1,0],s=[],l=o*o;a.length;){var u=a.pop(),p=a.pop(),c=a.pop();if(p-c<=n)for(var h=c;h<=p;h++)L(e[2*h],e[2*h+1],r,i)<=l&&s.push(t[h]);else{var d=Math.floor((c+p)/2),f=e[2*d],m=e[2*d+1];L(f,m,r,i)<=l&&s.push(t[d]);var y=(u+1)%2;(0===u?r-o<=f:i-o<=m)&&(a.push(c),a.push(d-1),a.push(y)),(0===u?r+o>=f:i+o>=m)&&(a.push(d+1),a.push(p),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var F={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},B=function(t){this.options=Z(Object.create(F),t),this.trees=new Array(this.options.maxZoom+1)};function O(t,e,r,i,o){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:i,properties:o}}function j(t,e){var r=t.geometry.coordinates,i=r[1];return{x:N(r[0]),y:q(i),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:V(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,i}function V(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Z(Z({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function N(t){return t/360+.5}function q(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Z(t,e){for(var r in e)t[r]=e[r];return t}function $(t){return t.x}function G(t){return t.y}function H(t,e,r,i,o,n){var a=o-r,s=n-i;if(0!==a||0!==s){var l=((t-r)*a+(e-i)*s)/(a*a+s*s);l>1?(r=o,i=n):l>0&&(r+=a*l,i+=s*l)}return(a=t-r)*a+(s=e-i)*s}function X(t,e,r,i){var o={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Q(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i0&&(a+=i?(o*u-l*n)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-n,2))),o=l,n=u}var p=e.length-3;e[2]=1,function t(e,r,i,o){for(var n,a=o,s=i-r>>1,l=i-r,u=e[r],p=e[r+1],c=e[i],h=e[i+1],d=r+3;da)n=d,a=f;else if(f===a){var m=Math.abs(d-s);mo&&(n-r>3&&t(e,r,n,o),e[n+2]=a,i-n>3&&t(e,n,i,o))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Y(t,e,r,i){for(var o=0;o1?1:r}function rt(t,e,r,i,o,n,a,s){if(i/=e,n>=(r/=e)&&a=i)return null;for(var l=[],u=0;u=r&&f=i)){var m=[];if("Point"===h||"MultiPoint"===h)it(c,m,r,i,o);else if("LineString"===h)ot(c,m,r,i,o,!1,s.lineMetrics);else if("MultiLineString"===h)at(c,m,r,i,o,!1);else if("Polygon"===h)at(c,m,r,i,o,!0);else if("MultiPolygon"===h)for(var y=0;y=r&&a<=i&&(e.push(t[n]),e.push(t[n+1]),e.push(t[n+2]))}}function ot(t,e,r,i,o,n,a){for(var s,l,u=nt(t),p=0===o?lt:ut,c=t.start,h=0;hr&&(l=p(u,d,f,y,_,r),a&&(u.start=c+s*l)):g>i?v=r&&(l=p(u,d,f,y,_,r),x=!0),v>i&&g<=i&&(l=p(u,d,f,y,_,i),x=!0),!n&&x&&(a&&(u.end=c+s*l),e.push(u),u=nt(t)),a&&(c+=s)}var b=t.length-3;d=t[b],f=t[b+1],m=t[b+2],(g=0===o?d:f)>=r&&g<=i&&st(u,d,f,m),b=u.length-3,n&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&st(u,u[0],u[1],u[2]),u.length&&e.push(u)}function nt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,i,o,n){for(var a=0;aa.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function mt(t,e,r,i){var o=e.geometry,n=e.type,a=[];if("Point"===n||"MultiPoint"===n)for(var s=0;s0&&e.size<(o?a:i))r.numPoints+=e.length/3;else{for(var s=[],l=0;la)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;o&&function(t,e){for(var r=0,i=0,o=t.length,n=o-2;i0===e)for(i=0,o=t.length;i24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i=i;u--){var p=+Date.now();s=this._cluster(s,u),this.trees[u]=new D(s,$,G,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){var a=this.getClusters([r,i,180,n],e),s=this.getClusters([-180,i,o,n],e);return a.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],p=0,c=l.range(N(r),q(n),N(o),q(i));pe&&(h+=m.numPoints||1)}if(h>=n){for(var y=l.x*c,_=l.y*c,g=o&&c>1?this._map(l,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=p;x1)for(var k=0,S=p;k>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},B.prototype._map=function(t,e){if(t.numPoints)return e?Z({},t.properties):t.properties;var r=this.points[t.index].properties,i=this.options.map(r);return e&&i===r?Z({},i):i},_t.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_t.prototype.splitTile=function(t,e,r,i,o,n,a){for(var s=[t,e,r,i],l=this.options,u=l.debug;s.length;){i=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<1&&console.time("creation"),h=this.tiles[c]=ft(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(h.source=t,o){if(e===l.maxZoom||e===o)continue;var f=1<1&&console.time("clipping");var m,y,_,g,v,x,b=.5*l.buffer/l.extent,w=.5-b,C=.5+b,k=1+b;m=y=_=g=null,v=rt(t,p,r-b,r+C,0,h.minX,h.maxX,l),x=rt(t,p,r+w,r+k,0,h.minX,h.maxX,l),t=null,v&&(m=rt(v,p,i-b,i+C,1,h.minY,h.maxY,l),y=rt(v,p,i+w,i+k,1,h.minY,h.maxY,l),v=null),x&&(_=rt(x,p,i-b,i+C,1,h.minY,h.maxY,l),g=rt(x,p,i+w,i+k,1,h.minY,h.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*i),s.push(y||[],e+1,2*r,2*i+1),s.push(_||[],e+1,2*r+1,2*i),s.push(g||[],e+1,2*r+1,2*i+1)}}},_t.prototype.getTile=function(t,e,r){var i=this.options,o=i.extent,n=i.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,p=e,c=r;!l&&u>0;)u--,p=Math.floor(p/2),c=Math.floor(c/2),l=this.tiles[gt(u,p,c)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",u,p,c),n>1&&console.time("drilling down"),this.splitTile(l.source,u,p,c,t,e,r),n>1&&console.timeEnd("drilling down"),this.tiles[s]?ht(this.tiles[s],o):null):null};var xt=function(e){function r(t,r,i,o){e.call(this,t,r,i,vt),o&&(this.loadGeoJSON=o)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=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 t.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 t(e,r){var i,o=e&&e.type;if("FeatureCollection"===o)for(i=0;i=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){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&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function _(t,e,r,i,o,n,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(n.ranges[s])e(null,{stack:r,id:o,glyph:a});else{var l=n.requests[s];l||(l=n.requests[s]=[],v.loadGlyphRange(r,s,i.url,i.requestManager,(function(t,e){if(e){for(var r in e)i._doesCharSupportLocalGlyph(+r)||(n.glyphs[+r]=e[+r]);n.ranges[s]=!0}for(var o=0,a=l;o1&&(s=t[++a]);var u=Math.abs(l-s.left),p=Math.abs(l-s.right),c=Math.min(u,p),h=void 0,d=o/r*(i+1);if(s.isDash){var f=i-Math.abs(d);h=Math.sqrt(c*c+f*f)}else h=i-Math.sqrt(c*c+d*d);this.data[n+l]=Math.max(0,Math.min(255,h+128))}},C.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.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],u=0;u1&&(l=t[++s]);var p=Math.abs(u-l.left),c=Math.abs(u-l.right),h=Math.min(p,c);this.data[a+u]=Math.max(0,Math.min(255,(l.isDash?h:-h)+128))}},C.prototype.addDash=function(e,r){var i=r?7:0,o=2*i+1;if(this.nextRow+o>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a=i&&e.x=o&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(i.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",i))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(o),this.actor.send(this.type+".loadData",i,(function(t,o){r._removed||o&&o.abandoned||(r._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[r.id]&&(r._resourceTiming=o.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var i=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?r(null):t?r(t):(e.loadVectorData(n,i.map.painter,"reloadTile"===o),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),L=function(e){function r(t,r,i,o){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var i=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){i._loaded=!0,o?i.fire(new t.ErrorEvent(o)):n&&(i.image=n,e&&(i.coordinates=e),r&&r(),i._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.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},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,i=1/0,o=-1/0,n=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(L),R=function(e){function r(r,i,o,n){e.call(this,r,i,o,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.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."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,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."+r,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.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())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.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 r=this.map.painter.context,i=r.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.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(r,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.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},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),o=this.data[r][i];return this.data[r].splice(i,1),o.timeout&&clearTimeout(o.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(o.value),this.order.splice(this.order.indexOf(r),1),this},j.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},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var i=0,o=this.data[r];i1||(Math.abs(r)>1&&(1===Math.abs(r+o)?r+=o:1===Math.abs(r-o)&&(r-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,i){for(var o in this._tiles){var n=this._tiles[o];if(!(i[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>r)){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]){i[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;i>=e;i--){var o=t.scaledTo(i),n=this._getLoadedTile(o);if(n)return n}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,i=Math.floor(e*r*5),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(o)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),r[o.tileID.key]=o}for(var n in this._tiles=r,this._timers)clearTimeout(this._timers[n]),delete this._timers[n];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var i=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 i._source.hasTile(t)})))):o=[];var n=e.coveringZoomLevel(this._source),a=Math.max(n-r.maxOverzooming,this._source.minzoom),s=Math.max(n+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(Lt(this._source.type)){for(var u={},p={},c=0,h=Object.keys(l);cthis._source.maxzoom){var y=f.children(this._source.maxzoom)[0],_=this.getTile(y);if(_&&_.hasData()){i[y.key]=y;continue}}else{var g=f.children(this._source.maxzoom);if(i[g[0].key]&&i[g[1].key]&&i[g[2].key]&&i[g[3].key])continue}for(var v=m.wasRequested(),x=f.overscaledZ-1;x>=n;--x){var b=f.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(m=this.getTile(b))&&v&&(m=this._addTile(b)),m&&(i[b.key]=b,v=m.wasRequested(),m.hasData()))break}}}return i},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var o=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(o))break;i=o}for(var n=0,a=e;n0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,i){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=i?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),u=s.map((function(t){return a.pointCoordinate(t)})),p=this.getIds(),c=1/0,h=1/0,d=-1/0,f=-1/0,m=0,y=u;m=0&&_[1].y+y>=0){var g=l.map((function(t){return s.getTilePoint(t)})),v=u.map((function(t){return s.getTilePoint(t)}));n.push({tile:i,tileID:s,queryGeometry:g,cameraQueryGeometry:v,scale:m})}}},v=0;v=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var i=this._tiles[t];i&&i.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function It(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),i=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Lt(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(Qo.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(o-a)/s:0;return this.points[n].mult(1-l).add(this.points[r].mult(l))};var Wt=function(t,e,r){var i=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var n=0;n=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function re(e,r,i,o,n,a,s,l){var u=o?e.textSizeData:e.iconSizeData,p=t.evaluateSizeForZoom(u,i.transform.zoom),c=[256/i.width*2+1,256/i.height*2+1],h=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var d=e.lineVertexArray,f=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,_=0;_Math.abs(i.x-r.x)*o?{useVertical:!0}:(e===t.WritingMode.vertical?r.yi.x)?{needsFlipping:!0}:null}function ne(e,r,i,o,n,a,s,l,u,p,c,h,d,f){var m,y=r/24,_=e.lineOffsetX*y,g=e.lineOffsetY*y;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ie(y,l,_,g,i,c,h,e,u,a,d);if(!w)return{notEnoughRoom:!0};var C=Yt(w.first.point,s).point,k=Yt(w.last.point,s).point;if(o&&!i){var S=oe(e.writingMode,C,k,f);if(S)return S}m=[w.first];for(var E=e.glyphStartIndex+1;E0?P.point:ae(h,A,M,1,n),L=oe(e.writingMode,M,I,f);if(L)return L}var z=se(y*l.getoffsetX(e.glyphStartIndex),_,g,i,c,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,a,d);if(!z)return{notEnoughRoom:!0};m=[z]}for(var R=0,D=m;R0?1:-1,m=0;o&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var y=f>0?l+s:l+s+1,_=n,g=n,v=0,x=0,b=Math.abs(d),w=[];v+x<=b;){if((y+=f)=u)return null;if(g=_,w.push(_),void 0===(_=h[y])){var C=new t.Point(p.getx(y),p.gety(y)),k=Yt(C,c);if(k.signedDistanceFromCamera>0)_=h[y]=k.point;else{var S=y-f;_=ae(0===v?a:new t.Point(p.getx(S),p.gety(S)),C,g,b-v+1,c)}}v+=x,x=g.dist(_)}var E=(b-v)/x,M=_.sub(g),T=M.mult(E)._add(g);T._add(M._unit()._perp()._mult(i*f));var A=m+Math.atan2(_.y-g.y,_.x-g.x);return w.push(T),{point:T,angle:A,path:w}}Wt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Wt.prototype.insert=function(t,e,r,i,o){this._forEachCell(e,r,i,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(o)},Wt.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Wt.prototype._insertBoxCell=function(t,e,r,i,o,n){this.boxCells[o].push(n)},Wt.prototype._insertCircleCell=function(t,e,r,i,o,n){this.circleCells[o].push(n)},Wt.prototype._query=function(t,e,r,i,o,n){if(r<0||t>this.width||i<0||e>this.height)return!o&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(o)return!0;for(var s=0;s0:a},Wt.prototype._queryCircle=function(t,e,r,i,o){var n=t-r,a=t+r,s=e-r,l=e+r;if(a<0||n>this.width||l<0||s>this.height)return!i&&[];var u=[];return this._forEachCell(n,s,a,l,this._queryCellCircle,u,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},o),i?u.length>0:u},Wt.prototype.query=function(t,e,r,i,o){return this._query(t,e,r,i,!1,o)},Wt.prototype.hitTest=function(t,e,r,i,o){return this._query(t,e,r,i,!0,o)},Wt.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Wt.prototype._queryCell=function(t,e,r,i,o,n,a,s){var l=a.seenUids,u=this.boxCells[o];if(null!==u)for(var p=this.bboxes,c=0,h=u;c=p[f+0]&&i>=p[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:p[f],y1:p[f+1],x2:p[f+2],y2:p[f+3]})}}}var m=this.circleCells[o];if(null!==m)for(var y=this.circles,_=0,g=m;_a*a+s*s},Wt.prototype._circleAndRectCollide=function(t,e,r,i,o,n,a){var s=(n-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return!1;var u=(a-o)/2,p=Math.abs(e-(o+u));if(p>u+r)return!1;if(l<=s||p<=u)return!0;var c=l-s,h=p-u;return c*c+h*h<=r*r};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r=1;I--)P.push(T.path[I]);for(var L=1;L0){for(var F=P[0].clone(),B=P[0].clone(),O=1;O=S.x&&B.x<=E.x&&F.y>=S.y&&B.y<=E.y?[P]:B.xE.x||B.yE.y?[]:t.clipLine([P],S.x,S.y,E.x,E.y)}for(var j=0,U=D;j=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},ce.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID]&&this.prevPlacement.placements[c.crossTileID].text&&(m=this.prevPlacement.variableOffsets[c.crossTileID].anchor),this.variableOffsets[c.crossTileID]={textOffset:y,width:r,height:i,anchor:t,textBoxScale:o,prevAnchor:m},this.markUsedJustification(h,t,c,d),h.allowVerticalPlacement&&(this.markUsedOrientation(h,d,c),this.placedOrientations[c.crossTileID]=d),{shift:_,placedGlyphBoxes:g}):void 0},be.prototype.placeLayerBucketPart=function(e,r,i){var o=this,n=e.parameters,a=n.bucket,s=n.layout,l=n.posMatrix,u=n.textLabelPlaneMatrix,p=n.labelToScreenMatrix,c=n.textPixelRatio,h=n.holdingForFade,d=n.collisionBoxArray,f=n.partiallyEvaluatedTextSize,m=n.collisionGroup,y=s.get("text-optional"),_=s.get("icon-optional"),g=s.get("text-allow-overlap"),v=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"),C="viewport-y"===s.get("symbol-z-order"),k=g&&(v||!a.hasIconData()||_),S=v&&(g||!a.hasTextData()||y);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var E=function(e,n){if(!r[e.crossTileID])if(h)o.placements[e.crossTileID]=new me(!1,!1,!1);else{var d,C=!1,E=!1,M=!0,T=null,A={box:null,offscreen:null},P={box:null,offscreen:null},I=null,L=null,z=0,R=0,D=0;n.textFeatureIndex?z=n.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),n.verticalTextFeatureIndex&&(R=n.verticalTextFeatureIndex);var F=n.textBox;if(F){var B=function(r){var i=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&o.prevPlacement){var n=o.prevPlacement.placedOrientations[e.crossTileID];n&&(o.placedOrientations[e.crossTileID]=n,o.markUsedOrientation(a,i=n,e))}return i},O=function(r,i){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n.verticalTextBox)for(var o=0,s=a.writingModes;o0&&(j=j.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var V=function(t,r,i){for(var n=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,p=w&&!v?r:null,h={box:[],offscreen:!1},d=g?2*j.length:j.length,f=0;f=j.length,e,a,i,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){C=!0,T=y.shift;break}}return h};O((function(){return V(F,n.iconBox,t.WritingMode.horizontal)}),(function(){var r=n.verticalTextBox;return a.allowVerticalPlacement&&!(A&&A.box&&A.box.length)&&e.numVerticalGlyphVertices>0&&r?V(r,n.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),A&&(C=A.box,M=A.offscreen);var N=B(A&&A.box);if(!C&&o.prevPlacement){var q=o.prevPlacement.variableOffsets[e.crossTileID];q&&(o.variableOffsets[e.crossTileID]=q,o.markUsedJustification(a,q.anchor,e,N))}}else{var Z=function(t,r){var i=o.collisionIndex.placeCollisionBox(t,g,c,l,m.predicate);return i&&i.box&&i.box.length&&(o.markUsedOrientation(a,r,e),o.placedOrientations[e.crossTileID]=r),i};O((function(){return Z(F,t.WritingMode.horizontal)}),(function(){var r=n.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?Z(r,t.WritingMode.vertical):{box:null,offscreen:null}})),B(A&&A.box&&A.box.length)}}if(C=(d=A)&&d.box&&d.box.length>0,M=d&&d.offscreen,e.useRuntimeCollisionCircles){var $=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),G=t.evaluateSizeForFeature(a.textSizeData,f,$),H=s.get("text-padding");I=o.collisionIndex.placeCollisionCircles(g,$,a.lineVertexArray,a.glyphOffsetArray,G,l,u,p,i,b,m.predicate,e.collisionCircleDiameter,H),C=g||I.circles.length>0&&!I.collisionDetected,M=M&&I.offscreen}if(n.iconFeatureIndex&&(D=n.iconFeatureIndex),n.iconBox){var X=function(t){var e=w&&T?xe(t,T.x,T.y,x,b,o.transform.angle):t;return o.collisionIndex.placeCollisionBox(e,v,c,l,m.predicate)};E=P&&P.box&&P.box.length&&n.verticalIconBox?(L=X(n.verticalIconBox)).box.length>0:(L=X(n.iconBox)).box.length>0,M=M&&L.offscreen}var Q=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,W=_||0===e.numIconVertices;if(Q||W?W?Q||(E=E&&C):C=E&&C:E=C=E&&C,C&&d&&d.box&&o.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,P&&P.box&&R?R:z,m.ID),E&&L&&o.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,m.ID),I&&(C&&o.collisionIndex.insertCollisionCircles(I.circles,s.get("text-ignore-placement"),a.bucketInstanceId,z,m.ID),i)){var K=a.bucketInstanceId,J=o.collisionCircleArrays[K];void 0===J&&(J=o.collisionCircleArrays[K]=new ye);for(var Y=0;Y=0;--T){var A=M[T];E(a.symbolInstances.get(A),a.collisionArrays[A])}else for(var P=e.symbolInstanceStart;P=0&&(e.text.placedSymbolArray.get(l).crossTileID=n>=0&&l!==n?0:i.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,i){for(var o=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,n=r===t.WritingMode.vertical?r:0,a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];a0,g=o.placedOrientations[n.crossTileID],v=g===t.WritingMode.vertical,x=g===t.WritingMode.horizontal||g===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Pe(y.text);f(e.text,s,v?Ie:b),f(e.text,l,x?Ie:b);var w=y.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||v?1:0)})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var C=o.variableOffsets[n.crossTileID];C&&o.markUsedJustification(e,C.anchor,n,g);var k=o.placedOrientations[n.crossTileID];k&&(o.markUsedJustification(e,"left",n,k),o.markUsedOrientation(e,k,n))}if(_){var S=Pe(y.icon),E=!(h&&n.verticalPlacedIconSymbolIndex&&v);n.placedIconSymbolIndex>=0&&(f(e.icon,n.numIconVertices,E?S:Ie),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=y.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,n.numVerticalIconVertices,E?Ie:S),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var M=e.collisionArrays[i];if(M){var T=new t.Point(0,0);if(M.textBox||M.verticalTextBox){var A=!0;if(u){var P=o.variableOffsets[m];P?(T=ve(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),p&&T._rotate(c?o.transform.angle:-o.transform.angle)):A=!1}M.textBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!A||v,T.x,T.y),M.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!A||x,T.x,T.y)}var I=Boolean(!x&&M.verticalIconBox);M.iconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,I,h?T.x:0,h?T.y:0),M.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!I,h?T.x:0,h?T.y:0)}}},y=0;yt},be.prototype.setStale=function(){this.stale=!0};var Ce=Math.pow(2,25),ke=Math.pow(2,24),Se=Math.pow(2,17),Ee=Math.pow(2,16),Me=Math.pow(2,9),Te=Math.pow(2,8),Ae=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,r=Math.floor(127*t.opacity);return r*Ce+e*ke+r*Se+e*Ee+r*Me+e*Te+r*Ae+e}var Ie=0,Le=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Le.prototype.continuePlacement=function(t,e,r,i,o){for(var n=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[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 Le(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,De=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;it.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o)}else{var u=a[t.scaledTo(Number(n)).key];u&&u.findMatches(e.symbolInstances,t,o)}}for(var p=0;p1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,o=e,p())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,a||(a=t,n=e,p())}));function p(){if(a)i(a);else if(o&&n){var e=t.browser.getImageData(n),r={};for(var s in o){var l=o[s],u=l.width,p=l.height,c=l.x,h=l.y,d=l.sdf,f=l.pixelRatio,m=l.stretchX,y=l.stretchY,_=l.content,g=new t.RGBAImage({width:u,height:p});t.RGBAImage.copy(e,g,{x:c,y:h},{x:0,y:0},{width:u,height:p}),r[s]={data:g,pixelRatio:f,sdf:d,stretchX:m,stretchY:y,content:_}}i(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,i){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(i)for(var o in i)r.imageManager.addImage(o,i[o]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var i=e.sourceLayer;if(i){var o=r.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+o.id+'" as specified by style layer "'+e.id+'"')))}}},r.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()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r0)throw new Error("Unimplemented: "+o.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.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._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,i){var o=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,i))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var n=this.sourceCaches[e]=new Pt(e,r,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}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),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(je(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},i))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" 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)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var i=this._order.indexOf(e);this._order.splice(i,1);var o=r?this._order.indexOf(r):this._order.length;r&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" 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.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.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.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===r&&o.maxzoom===i||(null!=r&&(o.minzoom=r),null!=i&&(o.maxzoom=i),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.")))},r.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,r))return null==r?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",r,null,i)||(o.filter=t.clone$1(r),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.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(r),i)||(n.setLayoutProperty(r,i,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.")))},r.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(r),i)||(n.setPaintProperty(r,i,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.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=e.sourceLayer,n=this.sourceCaches[i];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,r)):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.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=this.sourceCaches[i];if(void 0!==o){var n=o.getSource().type,a="vector"===n?e.sourceLayer:void 0;"vector"!==n||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(a,e.id,r):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.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r];if(void 0!==o){if("vector"!==o.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.getFeatureState(i,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 '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.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}))},r.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},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(r(a)){i[a]=n;for(var s=0,l=t;s=0;d--){var f=this._order[d];if(r(f))for(var m=o.length-1;m>=0;m--){var y=o[m].feature;if(i[y.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ye=_r("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=_r("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=_r("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=_r("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=_r("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),or=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),nr=_r("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/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*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\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);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=_r("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),lr=_r("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=_r("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\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;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\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;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=_r("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),hr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\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;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dr=_r("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),fr=_r("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_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);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=_r("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=_r("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function _r(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),o=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=n?n.concat(o):o,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,i,o){return s[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,o){var n="float"===i?"vec2":"vec4",a=o.match(/color/)?"color":n;return s[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+n+" a_"+o+";\nvarying "+r+" "+i+" "+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+r+" "+n+" a_"+o+";\n#else\nuniform "+r+" "+i+" u_"+o+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = a_"+o+";\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+r+" "+i+" "+o+" = unpack_mix_"+a+"(a_"+o+", u_"+o+"_t);\n#else\n "+r+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),staticAttributes:i,staticUniforms:a}}var gr=Object.freeze({__proto__:null,prelude:$e,background:Ge,backgroundPattern:He,circle:Xe,clippingMask:Qe,heatmap:We,heatmapTexture:Ke,collisionBox:Je,collisionCircle:Ye,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:ir,fillPattern:or,fillExtrusion:nr,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:lr,line:ur,lineGradient:pr,linePattern:cr,lineSDF:hr,raster:dr,symbolIcon:fr,symbolSDF:mr,symbolTextAndIcon:yr}),vr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,i,o,n,a,s,l,u,p,c,h,d,f,m){var y,_=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);d&&d.setUniforms(t,this.binderUniforms,c,{zoom:h});for(var v=(y={},y[_.LINES]=2,y[_.TRIANGLES]=3,y[_.LINE_STRIP]=1,y)[e],x=0,b=p.get();x0?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:Nr(o.paint.get("raster-hue-rotate"))};var n,a};function Nr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var qr,Zr=function(t,e,r,i,o,n,a,s,l,u){var p=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:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:p.width/p.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:+i,u_texsize:u,u_texture:0}},$r=function(e,r,i,o,n,a,s,l,u,p,c){var h=n.transform;return t.extend(Zr(e,r,i,o,n,a,s,l,u,p),{u_gamma_scale:o?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+c})},Gr=function(e,r,i,o,n,a,s,l,u,p){return t.extend($r(e,r,i,o,n,a,s,l,!0,u,!0),{u_texsize_icon:p,u_texture_icon:1})},Hr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,i,o,n,a){return t.extend(function(t,e,r,i){var o=r.imageManager.getPattern(t.from.toString()),n=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,u=Math.pow(2,i.tileID.overscaledZ),p=i.tileSize*Math.pow(2,r.transform.tileZoom)/u,c=p*(i.tileID.canonical.x+i.tileID.wrap*u),h=p*i.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/he(i,1,r.transform.tileZoom),u_pixel_coord_upper:[c>>16,h>>16],u_pixel_coord_lower:[65535&c,65535&h]}}(o,a,i,n),{u_matrix:e,u_opacity:r})},Qr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Wr(e,r,i,o,n,a,s){for(var l=e.context,u=l.gl,p=e.useProgram("collisionBox"),c=[],h=0,d=0,f=0;f0){var b=t.create(),w=g;t.mul(b,_.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,_.placementViewportMatrix),c.push({circleArray:x,circleOffset:d,transform:w,invTransform:b}),d=h+=x.length/4}v&&p.draw(l,u.LINES,St.disabled,Et.disabled,e.colorModeForRenderPass(),Tt.disabled,Pr(g,e.transform,y),i.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(s&&c.length){var C=e.useProgram("collisionCircle"),k=new t.StructArrayLayout2f1f2i16;k.resize(4*h),k._trim();for(var S=0,E=0,M=c;E=0&&(m[_.associatedIconIndex]={shiftedAnchor:k,angle:S})}else ue(_.numGlyphs,d)}if(c){f.clear();for(var M=e.icon.placedSymbolArray,T=0;T0){var s=t.browser.now(),l=(s-e.timeAdded)/a,u=r?(s-r.timeAdded)/a:-1,p=i.getSource(),c=n.coveringZoomLevel({tileSize:p.tileSize,roundZoom:p.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-c)>Math.abs(e.tileID.overscaledZ-c),d=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var li=new t.Color(1,0,0,1),ui=new t.Color(0,1,0,1),pi=new t.Color(0,0,1,1),ci=new t.Color(1,0,1,1),hi=new t.Color(0,1,1,1);function di(t,e,r,i){mi(t,0,e+r/2,t.transform.width,r,i)}function fi(t,e,r,i){mi(t,e-r/2,0,r,t.transform.height,i)}function mi(e,r,i,o,n,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function yi(e,r,i){var o=e.context,n=o.gl,a=i.posMatrix,s=e.useProgram("debug"),l=St.disabled,u=Et.disabled,p=e.colorModeForRenderPass();o.activeTexture.set(n.TEXTURE0),e.emptyTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE),s.draw(o,n.LINE_STRIP,l,u,p,Tt.disabled,Lr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var c=r.getTileByID(i.key).latestRawTileData,h=Math.floor((c&&c.byteLength||0)/1024),d=r.getTile(i).tileSize,f=512/Math.min(d,512)*(i.overscaledZ/e.transform.zoom)*.5,m=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(m+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,r.width,r.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(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,m+" "+h+"kb"),s.draw(o,n.TRIANGLES,l,u,Mt.alphaBlended,Tt.disabled,Lr(a,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var _i={symbol:function(e,r,i,o,n){if("translucent"===e.renderPass){var a=Et.disabled,s=e.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(e,r,i,o,n,a,s){for(var l=r.transform,u="map"===n,p="map"===a,c=0,h=e;c256&&this.clearStencil(),r.setColorMode(Mt.disabled),r.setDepthMode(St.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var n=0,a=e;n256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},gi.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},gi.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,i=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),o=i[i.length-1].overscaledZ,n=i[0].overscaledZ-o+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=n[x.source],w=p[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},gi.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},gi.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,gr[t],e,Qr[t],this._showOverdrawInspector)),this.cache[r]},gi.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()},gi.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)},gi.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))},gi.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var vi=function(t,e){this.points=t,this.planes=e};vi.fromInvProjectionMatrix=function(e,r,i){var o=Math.pow(2,i),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(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*o)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],n[e[0]],n[e[1]]),i=t.sub([],n[e[2]],n[e[1]]),o=t.normalize([],t.cross([],r,i)),a=-t.dot(o,n[e[1]]);return o.concat(a)}));return new vi(n,a)};var xi=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xi.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],i=t.clone$2(this.min),o=t.clone$2(this.max),n=0;n=0;if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,p=-Number.MAX_VALUE,c=0;cthis.max[l]-this.min[l])return 0}return 1};var bi=function(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<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=r,this.right=i};bi.prototype.interpolate=function(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,i)),this},bi.prototype.getCenter=function(e,r){var i=t.clamp((this.left+e-this.right)/2,0,e),o=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(i,o)},bi.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},bi.prototype.clone=function(){return new bi(this.top,this.bottom,this.left,this.right)},bi.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wi=function(e,r,i,o,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,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 bi,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ci={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}};wi.prototype.clone=function(){var t=new wi(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},Ci.minZoom.get=function(){return this._minZoom},Ci.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Ci.maxZoom.get=function(){return this._maxZoom},Ci.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Ci.minPitch.get=function(){return this._minPitch},Ci.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Ci.maxPitch.get=function(){return this._maxPitch},Ci.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Ci.renderWorldCopies.get=function(){return this._renderWorldCopies},Ci.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Ci.worldSize.get=function(){return this.tileSize*this.scale},Ci.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ci.size.get=function(){return new t.Point(this.width,this.height)},Ci.bearing.get=function(){return-this.angle/Math.PI*180},Ci.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ci.pitch.get=function(){return this._pitch/Math.PI*180},Ci.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Ci.fov.get=function(){return this._fov/Math.PI*180},Ci.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())},Ci.zoom.get=function(){return this._zoom},Ci.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())},Ci.center.get=function(){return this._center},Ci.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Ci.padding.get=function(){return this._edgeInsets.toJSON()},Ci.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Ci.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wi.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wi.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},wi.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wi.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=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(i.x,o.x,n.x,a.x)),l=Math.floor(Math.max(i.x,o.x,n.x,a.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},wi.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center),n=Math.pow(2,r),a=[n*o.x,n*o.y,0],s=vi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new xi([t*n,0,0],[(t+1)*n,n,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},p=[],c=[],h=r,d=e.reparseOverscaled?i:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)p.push(u(-f)),p.push(u(f));for(p.push(u(0));p.length>0;){var m=p.pop(),y=m.x,_=m.y,g=m.fullyVisible;if(!g){var v=m.aabb.intersects(s);if(0===v)continue;g=2===v}var x=m.aabb.distanceX(a),b=m.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(m.zoom===h||w>3+(1<=l)c.push({tileID:new t.OverscaledTileID(m.zoom===h?d:m.zoom,m.wrap,m.zoom,y,_),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-_])});else for(var C=0;C<4;C++){var k=(y<<1)+C%2,S=(_<<1)+(C>>1);p.push({aabb:m.aabb.quadrant(C),zoom:m.zoom+1,x:k,y:S,wrap:m.wrap,fullyVisible:g})}}return c.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wi.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Ci.unmodified.get=function(){return this._unmodified},wi.prototype.zoomScale=function(t){return Math.pow(2,t)},wi.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wi.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},wi.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Ci.point.get=function(){return this.project(this.center)},wi.prototype.setLocationAtPoint=function(e,r){var i=this.pointCoordinate(r),o=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(e),a=new t.MercatorCoordinate(n.x-(i.x-o.x),n.y-(i.y-o.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},wi.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wi.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wi.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wi.prototype.coordinateLocation=function(t){return t.toLngLat()},wi.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var o=r[3],n=i[3],a=r[1]/o,s=i[1]/n,l=r[2]/o,u=i[2]/n,p=l===u?0:(0-l)/(u-l);return new t.MercatorCoordinate(t.number(r[0]/o,i[0]/n,p)/this.worldSize,t.number(a,s,p)/this.worldSize)},wi.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},wi.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)))},wi.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},wi.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])},wi.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,o=r?this._alignedPosMatrixCache:this._posMatrixCache;if(o[i])return o[i];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,r?this.alignedProjMatrix:this.projMatrix,l),o[i]=new Float32Array(l),o[i]},wi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,o,n=-90,a=90,s=-180,l=180,u=this.size,p=this._unmodified;if(this.latRange){var c=this.latRange;n=t.mercatorYfromLat(c[1])*this.worldSize,e=(a=t.mercatorYfromLat(c[0])*this.worldSize)-na&&(o=a-y)}if(this.lngRange){var _=d.x,g=u.x/2;_-gl&&(i=l-g)}void 0===i&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==i?i:d.x,void 0!==o?o:d.y))),this._unmodified=p,this._constraining=!1}},wi.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),o=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-i,.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),u=this.height/50,p=new Float64Array(16);t.perspective(p,this._fov,this.width/this.height,u,l),p[8]=2*-e.x/this.width,p[9]=2*e.y/this.height,t.scale(p,p,[1,-1,1]),t.translate(p,p,[0,0,-this.cameraToCenterDistance]),t.rotateX(p,p,this._pitch),t.rotateZ(p,p,this.angle),t.translate(p,p,[-a,-s,0]),this.mercatorMatrix=t.scale([],p,[this.worldSize,this.worldSize,this.worldSize]),t.scale(p,p,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=p,this.invProjMatrix=t.invert([],this.projMatrix);var c=this.width%2/2,h=this.height%2/2,d=Math.cos(this.angle),f=Math.sin(this.angle),m=a-Math.round(a)+d*c+f*h,y=s-Math.round(s)+d*h+f*c,_=new Float64Array(p);if(t.translate(_,_,[m>.5?m-1:m,y>.5?y-1:y,0]),this.alignedProjMatrix=_,p=t.create(),t.scale(p,p,[this.width/2,-this.height/2,1]),t.translate(p,p,[1,-1,0]),this.labelPlaneMatrix=p,p=t.create(),t.scale(p,p,[1,-1,1]),t.translate(p,p,[-1,-1,0]),t.scale(p,p,[2/this.width,2/this.height,1]),this.glCoordMatrix=p,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(p=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=p,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},wi.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wi.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var i=r.x,o=r.y,n=r.x,a=r.y,s=0,l=e;s=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},ki.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Si={linearity:.3,easing:t.bezier(0,0,.3,1)},Ei=t.extend({deceleration:2500,maxSpeed:1400},Si),Mi=t.extend({deceleration:20,maxSpeed:1400},Si),Ti=t.extend({deceleration:1e3,maxSpeed:360},Si),Ai=t.extend({deceleration:1e3,maxSpeed:90},Si),Pi=function(t){this._map=t,this.clear()};function Ii(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Pi.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,o=this._inertiaBuffer;i=this._clickTolerance||this._map.fire(new zi(t.type,this._map,t))},Fi.prototype.dblclick=function(t){return this._firePreventable(new zi(t.type,this._map,t))},Fi.prototype.mouseover=function(t){this._map.fire(new zi(t.type,this._map,t))},Fi.prototype.mouseout=function(t){this._map.fire(new zi(t.type,this._map,t))},Fi.prototype.touchstart=function(t){return this._firePreventable(new Ri(t.type,this._map,t))},Fi.prototype.touchmove=function(t){this._map.fire(new Ri(t.type,this._map,t))},Fi.prototype.touchend=function(t){this._map.fire(new Ri(t.type,this._map,t))},Fi.prototype.touchcancel=function(t){this._map.fire(new Ri(t.type,this._map,t))},Fi.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fi.prototype.isEnabled=function(){return!0},Fi.prototype.isActive=function(){return!1},Fi.prototype.enable=function(){},Fi.prototype.disable=function(){};var Bi=function(t){this._map=t};Bi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bi.prototype.mousemove=function(t){this._map.fire(new zi(t.type,this._map,t))},Bi.prototype.mousedown=function(){this._delayContextMenu=!0},Bi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new zi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bi.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new zi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Bi.prototype.isEnabled=function(){return!0},Bi.prototype.isActive=function(){return!1},Bi.prototype.enable=function(){},Bi.prototype.disable=function(){};var Oi=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function ji(t,e){for(var r={},i=0;ithis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),i=0,o=e;i30)&&(this.aborted=!0)}}},Ui.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var i=!this.aborted&&this.centroid;if(this.reset(),i)return i}};var Vi=function(t){this.singleTap=new Ui(t),this.numTaps=t.numTaps,this.reset()};Vi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Vi.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Vi.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Vi.prototype.touchend=function(t,e,r){var i=this.singleTap.touchend(t,e,r);if(i){var o=t.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(i)<30;if(o&&n||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}};var Ni=function(){this._zoomIn=new Vi({numTouches:1,numTaps:2}),this._zoomOut=new Vi({numTouches:2,numTaps:1}),this.reset()};Ni.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Ni.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Ni.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Ni.prototype.touchend=function(t,e,r){var i=this,o=this._zoomIn.touchend(t,e,r),n=this._zoomOut.touchend(t,e,r);return o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(o)},{originalEvent:t})}}):n?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(n)},{originalEvent:t})}}):void 0},Ni.prototype.touchcancel=function(){this.reset()},Ni.prototype.enable=function(){this._enabled=!0},Ni.prototype.disable=function(){this._enabled=!1,this.reset()},Ni.prototype.isEnabled=function(){return this._enabled},Ni.prototype.isActive=function(){return this._active};var qi={0:1,2:2},Zi=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Zi.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Zi.prototype._correctButton=function(t,e){return!1},Zi.prototype._move=function(t,e){return{}},Zi.prototype.mousedown=function(t,e){if(!this._lastPoint){var i=r.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}},Zi.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=qi[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var o=ji(i,r),n=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var l in o){var u=o[l],p=this._touches[l];p&&(n._add(u),a._add(u.sub(p)),s++,o[l]=u)}if(this._touches=o,!(sMath.abs(t.x)}var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,eo(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var i=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,o,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+o.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var i=t.mag()>=2,o=e.mag()>=2;if(i||o){if(!i||!o)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var n=t.y>0==e.y>0;return eo(t)&&eo(e)&&n}},e}(Qi),io={panStep:100,bearingStep:15,pitchStep:10},oo=function(){var t=io;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function no(t){return t*(2-t)}oo.prototype.reset=function(){this._active=!1},oo.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,i=0,o=0,n=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?o=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?o=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,o=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:no,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+i*e._bearingStep,pitch:s.getPitch()+o*e._pitchStep,offset:[-n*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oo.prototype.enable=function(){this._enabled=!0},oo.prototype.disable=function(){this._enabled=!1,this.reset()},oo.prototype.isEnabled=function(){return this._enabled},oo.prototype.isActive=function(){return this._active},oo.prototype.disableRotation=function(){this._rotationDisabled=!0},oo.prototype.enableRotation=function(){this._rotationDisabled=!1};var ao=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};ao.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ao.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ao.prototype.isEnabled=function(){return!!this._enabled},ao.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ao.prototype.isZooming=function(){return!!this._zooming},ao.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ao.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ao.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),o=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},ao.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ao.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var i=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ao.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,p=!1;if("wheel"===this._type&&l&&u){var c=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(c);a=t.number(l,s,h),c<1?this._frameId||(this._frameId=!0):p=!0}else a=s,p=!0;return this._active=!0,p&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!p,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ao.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var i=this._prevEase,o=(t.browser.now()-i.start)/i.duration,n=i.easing(o+.01)-i.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},ao.prototype.reset=function(){this._active=!1};var so=function(t,e){this._clickZoom=t,this._tapZoom=e};so.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},so.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},so.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},so.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var lo=function(){this.reset()};lo.prototype.reset=function(){this._active=!1},lo.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},lo.prototype.enable=function(){this._enabled=!0},lo.prototype.disable=function(){this._enabled=!1,this.reset()},lo.prototype.isEnabled=function(){return this._enabled},lo.prototype.isActive=function(){return this._active};var uo=function(){this._tap=new Vi({numTouches:1,numTaps:1}),this.reset()};uo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},uo.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},uo.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var i=e[0],o=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(t,e,r)},uo.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},uo.prototype.touchcancel=function(){this.reset()},uo.prototype.enable=function(){this._enabled=!0},uo.prototype.disable=function(){this._enabled=!1,this.reset()},uo.prototype.isEnabled=function(){return this._enabled},uo.prototype.isActive=function(){return this._active};var po=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};po.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},po.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},po.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},po.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var co=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};co.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},co.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},co.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},co.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var ho=function(t,e,r,i){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0};ho.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},ho.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},ho.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},ho.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},ho.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},ho.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var fo=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var _o=function(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pi(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this);var o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[t.window,"blur",void 0]];for(var n=0,a=this._listeners;nn?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),C=o.unproject(v.add(x.mult(e*w)).mult(m));o.setLocationAtPoint(o.renderWorldCopies?C.wrap():C,f)}i._fireMoveEvents(r)}),(function(t){i._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,i){void 0===i&&(i={}),this._moving=!0,r||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},r.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))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var i=this._zooming,o=this._rotating,n=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)),o&&this.fire(new t.Event("rotateend",e)),n&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,r)}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(),u=this.getPadding(),p="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,c="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:n.padding,f=n.zoomScale(p-a),m=t.Point.convert(e.offset),y=n.centerPoint.add(m),_=n.pointLocation(y),g=t.LngLat.convert(e.center||_);this._normalizeCenter(g);var v=n.project(_),x=n.project(g).sub(v),b=e.curve,w=Math.max(n.width,n.height),C=w/f,k=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,a,p),n.minZoom,n.maxZoom),E=w/n.zoomScale(S-a);b=Math.sqrt(E/k*2)}var M=b*b;function T(t){var e=(C*C-w*w+(t?-1:1)*M*M*k*k)/(2*(t?C:w)*M*k);return Math.log(Math.sqrt(e*e+1)-e)}function A(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var I=T(0),L=function(t){return P(I)/P(I+b*t)},z=function(t){return w*((P(I)*(A(e=I+b*t)/P(e))-A(I))/M)/k;var e},R=(T(1)-I)/b;if(Math.abs(k)<1e-6||!isFinite(R)){if(Math.abs(w-C)<1e-6)return this.easeTo(e,r);var D=Ce.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==c,this._pitching=h!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(e){var o=e*R,f=1/L(o);n.zoom=1===e?p:a+n.scaleZoom(f),i._rotating&&(n.bearing=t.number(s,c,e)),i._pitching&&(n.pitch=t.number(l,h,e)),i._padding&&(n.interpolatePadding(u,d,e),y=n.centerPoint.add(m));var _=1===e?g:n.unproject(v.add(x.mult(z(o))).mult(f));n.setLocationAtPoint(n.renderWorldCopies?_.wrap():_,y),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var i=this.handlers;i&&i.stop(!1)}return this},r.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.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()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),vo=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vo.prototype.getDefaultPosition=function(){return"bottom-right"},vo.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.type="button",this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("maplibregl-compact","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},vo.prototype.onRemove=function(){r.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},vo.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},vo.prototype._toggleAttribution=function(){this._container.classList.contains("maplibregl-compact-show")||this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vo.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{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 i=r.reduce((function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._editLink=null)}},vo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("maplibregl-compact","mapboxgl-compact"):this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show")};var xo=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xo.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","maplibregl-ctrl mapboxgl-ctrl");var e=r.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xo.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xo.prototype.getDefaultPosition=function(){return"bottom-left"},xo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xo.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}},xo.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("maplibregl-compact","mapboxgl-compact"):e.classList.remove("maplibregl-compact","mapboxgl-compact")}};var bo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bo.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bo.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;re.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 o=new wi(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,o,e),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 bo,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wo,e.locale),this._clickTolerance=e.clickTolerance,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 ko))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","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new _o(this,e),this._hash=e.hash&&new ki("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 vo({customAttribution:e.customAttribution})),this.addControl(new xo,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.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,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"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 i=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[r];return-1!==r.indexOf("bottom")?o.insertBefore(i,o.firstChild):o.appendChild(i),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 r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},o.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},o.prototype.resize=function(e){var r=this._containerDimensions(),i=r[0],o=r[1];this._resizeCanvas(i,o),this.transform.resize(i,o),this.painter.resize(i,o);var n=!this._moving;return n&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),n&&this.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()=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()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.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(t,e,r){var i,o=this;if("mouseenter"===t||"mouseover"===t){var n=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?n||(n=!0,r.call(o,new zi(t,o,i.originalEvent,{features:a}))):n=!1},mouseout:function(){n=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(o,new zi(t,o,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(o,new zi(t,o,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(i={},i[t]=function(t){var i=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(o,t),delete t.features)},i)}},o.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var o=this._createDelegatedListener(t,e,r);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,r){if(void 0===r)return i.prototype.once.call(this,t,e);var o=this._createDelegatedListener(t,e,r);for(var n in o.delegates)this.once(n,o.delegates[n]);return this},o.prototype.off=function(t,e,r){var o=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var n=i[t],a=0;a180;){var s=i.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}Io.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Io.prototype.move=function(t,e){var r=this.map,i=this.mouseRotate.mousemoveWindow(t,e);if(i&&i.bearingDelta&&r.setBearing(r.getBearing()+i.bearingDelta),this.mousePitch){var o=this.mousePitch.mousemoveWindow(t,e);o&&o.pitchDelta&&r.setPitch(r.getPitch()+o.pitchDelta)}},Io.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Io.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Io.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Io.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Io.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Io.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Io.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Io.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},i.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},i.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},i.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},i.prototype.isDraggable=function(){return this._draggable},i.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},i.prototype.getRotation=function(){return this._rotation},i.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},i.prototype.getRotationAlignment=function(){return this._rotationAlignment},i.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},i.prototype.getPitchAlignment=function(){return this._pitchAlignment},i}(t.Evented),Bo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Oo=0,jo=!1,Uo=function(e){function i(r){e.call(this),this.options=t.extend({},Bo,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(e){var i;return this._map=e,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Do?i(Do):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(Do="denied"!==t.state)})):i(Do=!!t.window.navigator.geolocation),this._container},i.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Oo=0,jo=!1},i.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},i.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}},i.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("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","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("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},i.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,o=this._map.getBearing(),n=t.extend({bearing:o},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),n,{geolocateSource:!0})},i.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},i.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),i=e.distanceTo(r),o=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=o+"px",this._circleElement.style.height=o+"px"},i.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},i.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&jo)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},i.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},i.prototype._setupUI=function(e){var i=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon 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=r.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fo(this._dotElement),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fo({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"!==i._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(i._watchState="BACKGROUND",i._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),i._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),i.fire(new t.Event("trackuserlocationend")))}))},i.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":Oo--,jo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","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("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","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("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Oo>1?(e={maximumAge:6e5,timeout:0},jo=!0):(e=this.options.positionOptions,jo=!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},i.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},i}(t.Evented),Vo={maxWidth:100,unit:"metric"},No=function(e){this.options=t.extend({},Vo,e),t.bindAll(["_onMove","setUnit"],this)};function qo(t,e,r){var i=r&&r.maxWidth||100,o=t._container.clientHeight/2,n=t.unproject([0,o]),a=t.unproject([i,o]),s=n.distanceTo(a);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Zo(e,i,l/5280,t._getUIString("ScaleControl.Miles")):Zo(e,i,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Zo(e,i,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Zo(e,i,s/1e3,t._getUIString("ScaleControl.Kilometers")):Zo(e,i,s,t._getUIString("ScaleControl.Meters"))}function Zo(t,e,r,i){var o,n,a,s=(o=r,(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/r)+"px",t.innerHTML=s+" "+i}No.prototype.getDefaultPosition=function(){return"bottom-left"},No.prototype._onMove=function(){qo(this._map,this._container,this.options)},No.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},No.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},No.prototype.setUnit=function(t){this.options.unit=t,qo(this._map,this._container,this.options)};var $o=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")};$o.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group 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},$o.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},$o.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},$o.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon 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)},$o.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},$o.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},$o.prototype._isFullscreen=function(){return this._fullscreen},$o.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("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},$o.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 Go={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ho=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Xo=function(e){function i(r){e.call(this),this.options=t.extend(Object.create(Go),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.addTo=function(e){return this._map&&this.remove(),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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},i.prototype.isOpen=function(){return!!this._map},i.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat},i.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._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this},i.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;r=o.firstChild;)i.appendChild(r);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},i.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},i.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},i.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},i.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},i.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","maplibregl-popup-close-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))},i.prototype._onMouseUp=function(t){this._update(t.point)},i.prototype._onMouseMove=function(t){this._update(t.point)},i.prototype._onDrag=function(t){this._update(t.point)},i.prototype._update=function(e){var i=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return i._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","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=Lo(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(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var o=t.Point.convert(r);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(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!n){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=o.y+a.bottom.ythis._map.transform.height-u?["bottom"]:[],o.xthis._map.transform.width-l/2&&s.push("right"),n=0===s.length?"bottom":s.join("-")}var p=o.add(a[n]).round();r.setTransform(this._container,zo[n]+" translate("+p.x+"px,"+p.y+"px)"),Ro(this._container,n,"popup")}},i.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Ho);t&&t.focus()}},i.prototype._onClose=function(){this.remove()},i}(t.Evented),Qo={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Mo,NavigationControl:Po,GeolocateControl:Uo,AttributionControl:vo,ScaleControl:No,FullscreenControl:$o,Popup:Xo,Marker:Fo,Style:qe,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ot().acquire(Rt)},clearPrewarmedResources:function(){var t=Ft;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Ft=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},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 Dt.workerCount},set workerCount(t){Dt.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:"",addProtocol:function(e,r){t.config.REGISTERED_PROTOCOLS[e]=r},removeProtocol:function(e){delete t.config.REGISTERED_PROTOCOLS[e]}};return Qo}));return r}));!function t(e,r,i){function o(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(n)return n(a,!0);throw(s=new Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",s}l=r[a]={exports:{}},e[a][0].call(l.exports,(function(t){return o(e[a][1][t]||t)}),l,l.exports,t,e,r,i)}return r[a].exports}for(var n="function"==typeof require&&require,a=0;athis._bounds.width?this._bounds.width:t},_getY:function(t){return(t=(t=(t=t.touches?t.touches[0]:t).clientY-this._bounds.top)<0?0:t)>this._bounds.height?this._bounds.height:t},setSlider:function(t){this._setPosition(t)},on:function(t,e){return this._ev.on(t,e),this},fire:function(t,e){return this._ev.emit(t,e),this},off:function(t,e){return this._ev.removeListener(t,e),this},remove:function(){this._clearSync(),this._mapB.off("resize",this._onResize);var t;(t=((t=this._mapA.getContainer())&&(t.style.clip=null,t.removeEventListener("mousemove",this._onMove)),this._mapB.getContainer()))&&(t.style.clip=null,t.removeEventListener("mousemove",this._onMove)),this._swiper.removeEventListener("mousedown",this._onDown),this._swiper.removeEventListener("touchstart",this._onDown),this._controlContainer.remove()}},window.maplibregl?maplibregl.Compare=n:void 0!==e&&(e.exports=n)},{"@mapbox/mapbox-gl-sync-move":2,events:3}],2:[function(t,e,r){e.exports=function(){var t=arguments.length;if(1===t)e=arguments[0];else for(var e=[],r=0;ro&&!n.warned&&(n.warned=!0,(i=new Error("Possible EventEmitter memory leak detected. "+n.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",i.emitter=t,i.type=e,i.count=n.length,r=i,console&&console.warn&&console.warn(r))),t}function h(t,e,r){e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t={fired:!1,wrapFn:void 0,target:t,type:e,listener:r});return e.listener=r,t.wrapFn=e}function d(t,e,r){if(void 0===(t=t._events))return[];if(void 0===(t=t[e]))return[];if("function"==typeof t)return r?[t.listener||t]:[t];if(r){for(var i=t,o=new Array(i.length),n=0;n=u&&p===i.length-1);p++){if(u>=e){var c=e-u;if(c){var h=o.default(i[p],i[p-1])-180;return n.default(i[p],c,h,r)}return s.point(i[p])}u+=a.default(i[p],i[p+1],r)}return s.point(i[i.length-1])}},{"@turf/bearing":4,"@turf/destination":8,"@turf/distance":9,"@turf/helpers":11,"@turf/invariant":12}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/meta");function o(t){var e=[1/0,1/0,-1/0,-1/0];i.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]);e[1]>t[1]&&(e[1]=t[1]);e[2]=t[0]&&e[3]>=t[1]}(n,l))return!1;"Polygon"===s&&(u=[u]);for(var p=!1,c=0;ct[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a&&(i=!i)}return i}},{"@turf/invariant":12}],6:[function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=i(t("@turf/bbox")),n=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=o.default(t),i=(r[0]+r[2])/2,a=(r[1]+r[3])/2;return n.point([i,a],e.properties,e)}},{"@turf/bbox":3,"@turf/helpers":11}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function i(t){var e={type:"Feature"};Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}}));e.properties=o(t.properties);e.geometry=n(t.geometry);return e}function o(t){var e={};if(!t)return e;Object.keys(t).forEach((function(r){var i=t[r];"object"==typeof i?null===i?e[r]=null:Array.isArray(i)?e[r]=i.map((function(t){return t})):e[r]=o(i):e[r]=i}));return e}function n(t){var e={type:t.type};t.bbox&&(e.bbox=t.bbox);if("GeometryCollection"===t.type){e.geometries=t.geometries.map((function(t){return n(t)}));return e}e.coordinates=a(t.coordinates);return e}function a(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return a(t)}))}r.default=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return i(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}}));e.features=t.features.map((function(t){return i(t)}));return e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return n(t);default:throw new Error("unknown GeoJSON type")}}},{}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers"),o=t("@turf/invariant");r.default=function(t,e,r,n){void 0===n&&(n={});var a=o.getCoord(t),s=i.degreesToRadians(a[0]),l=i.degreesToRadians(a[1]),u=i.degreesToRadians(r),p=i.lengthToRadians(e,n.units),c=Math.asin(Math.sin(l)*Math.cos(p)+Math.cos(l)*Math.sin(p)*Math.cos(u)),h=s+Math.atan2(Math.sin(u)*Math.sin(p)*Math.cos(l),Math.cos(p)-Math.sin(l)*Math.sin(c)),d=i.radiansToDegrees(h),f=i.radiansToDegrees(c);return i.point([d,f],n.properties)}},{"@turf/helpers":11,"@turf/invariant":12}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/invariant"),o=t("@turf/helpers");r.default=function(t,e,r){void 0===r&&(r={});var n=i.getCoord(t),a=i.getCoord(e),s=o.degreesToRadians(a[1]-n[1]),l=o.degreesToRadians(a[0]-n[0]),u=o.degreesToRadians(n[1]),p=o.degreesToRadians(a[1]),c=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(u)*Math.cos(p);return o.radiansToLength(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}},{"@turf/helpers":11,"@turf/invariant":12}],10:[function(t,e,r){"use strict";var i=t("@turf/meta"),o=t("@turf/helpers");function n(t){var e=[];"FeatureCollection"===t.type?i.featureEach(t,(function(t){i.coordEach(t,(function(r){e.push(o.point(r,t.properties))}))})):i.coordEach(t,(function(r){e.push(o.point(r,t.properties))}));return o.featureCollection(e)}e.exports=n;e.exports.default=n},{"@turf/helpers":11,"@turf/meta":16}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.earthRadius=6371008.8;r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius};r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133};r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(t,e,r){void 0===r&&(r={});var i={type:"Feature"};(0===r.id||r.id)&&(i.id=r.id);r.bbox&&(i.bbox=r.bbox);i.properties=e||{};i.geometry=t;return i}r.feature=i;r.geometry=function(t,e,r){void 0===r&&(r={});switch(t){case"Point":return o(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return n(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return p(e).geometry;default:throw new Error(t+" is invalid")}};function o(t,e,r){void 0===r&&(r={});if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:t},e,r)}r.point=o;r.points=function(t,e,r){void 0===r&&(r={});return s(t.map((function(t){return o(t,e)})),r)};function n(t,e,r){void 0===r&&(r={});for(var o=0,n=t;o=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r};function c(t,e){void 0===e&&(e="kilometers");var i=r.factors[e];if(!i)throw new Error(e+" units is invalid");return t*i}r.radiansToLength=c;function h(t,e){void 0===e&&(e="kilometers");var i=r.factors[e];if(!i)throw new Error(e+" units is invalid");return t/i}r.lengthToRadians=h;r.lengthToDegrees=function(t,e){return d(h(t,e))};r.bearingToAzimuth=function(t){var e=t%360;e<0&&(e+=360);return e};function d(t){return 180*(t%(2*Math.PI))/Math.PI}r.radiansToDegrees=d;r.degreesToRadians=function(t){return t%360*Math.PI/180};r.convertLength=function(t,e,r){void 0===e&&(e="kilometers");void 0===r&&(r="kilometers");if(!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),r)};r.convertArea=function(t,e,i){void 0===e&&(e="meters");void 0===i&&(i="kilometers");if(!(t>=0))throw new Error("area must be a positive number");var o=r.areaFactors[e];if(!o)throw new Error("invalid original units");var n=r.areaFactors[i];if(!n)throw new Error("invalid final units");return t/o*n};function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}r.isNumber=f;r.isObject=function(t){return!!t&&t.constructor===Object};r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))};r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},{}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers");r.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")};r.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")};r.containsNumber=function t(e){if(e.length>1&&i.isNumber(e[0])&&i.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")};r.geojsonType=function(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)};r.featureOf=function(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)};r.collectionOf=function(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var i=0,o=t.features;i line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var a=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],p=i[0][0],c=i[0][1],h=i[1][0],d=i[1][1],f=(d-c)*(l-a)-(h-p)*(u-s),m=(h-p)*(s-c)-(d-c)*(a-p),y=(l-a)*(s-c)-(u-s)*(a-p);if(0===f)return null;var _=m/f,g=y/f;if(_>=0&&_<=1&&g>=0&&g<=1){var v=a+_*(l-a),x=s+_*(u-s);return o.point([v,x])}return null}r.default=function(t,e){var r={},i=[];"LineString"===t.type&&(t=o.feature(t));"LineString"===e.type&&(e=o.feature(e));if("Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var p=u(t,e);p&&i.push(p);return o.featureCollection(i)}var c=l.default();c.load(a.default(e));s.featureEach(a.default(t),(function(t){s.featureEach(c.search(t),(function(e){var o=u(t,e);if(o){var a=n.getCoords(o).join(",");if(!r[a]){r[a]=!0;i.push(o)}}}))}));return o.featureCollection(i)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/line-segment":15,"@turf/meta":16,"geojson-rbush":20}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers"),o=t("@turf/invariant"),n=t("@turf/meta");r.default=function(t){if(!t)throw new Error("geojson is required");var e=[];n.flattenEach(t,(function(t){!function(t,e){var r=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":r=o.getCoords(n);break;case"LineString":r=[o.getCoords(n)]}r.forEach((function(r){var o=function(t,e){var r=[];t.reduce((function(t,o){var n,a,s,l,u,p,c=i.lineString([t,o],e);c.bbox=(a=o,s=(n=t)[0],l=n[1],u=a[0],p=a[1],[su?s:u,l>p?l:p]);r.push(c);return o}));return r}(r,t.properties);o.forEach((function(t){t.id=e.length;e.push(t)}))}))}}(t,e)}));return i.featureCollection(e)}},{"@turf/helpers":11,"@turf/invariant":12,"@turf/meta":16}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("@turf/helpers");function o(t,e,r){if(null!==t)for(var i,n,a,s,l,u,p,c,h=0,d=0,f=t.type,m="FeatureCollection"===f,y="Feature"===f,_=m?t.features.length:1,g=0;g<_;g++){l=(c=!!(p=m?t.features[g].geometry:y?t.geometry:t)&&"GeometryCollection"===p.type)?p.geometries.length:1;for(var v=0;vu||d>p||f>c){l=o;u=r;p=d;c=f;a=0}else{var m=i.lineString([l,o],t.properties);if(!1===e(m,r,n,f,a))return!1;a++;l=o}}))&&void 0}}}))}function p(t,e){if(!t)throw new Error("geojson is required");l(t,(function(t,r,o){if(null!==t.geometry){var n=t.geometry.type,a=t.geometry.coordinates;switch(n){case"LineString":if(!1===e(t,r,o,0,0))return!1;break;case"Polygon":for(var s=0;s0){(b=x.features[0]).properties.dist=n.default(e,b,r);b.properties.location=c+n.default(d,b,r)}if(d.properties.disto;){if(n-o>600){var s=n-o+1,l=i-o+1,u=Math.log(s),p=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*p*(s-p)/s)*(l-s/2<0?-1:1);t(r,i,Math.max(o,Math.floor(i-l*p/s+c)),Math.min(n,Math.floor(i+(s-l)*p/s+c)),a)}var h=r[i],d=o,f=n;for(e(r,o,i),a(r[n],h)>0&&e(r,o,n);d0;)f--}0===a(r[o],h)?e(r,o,f):e(r,++f,n),f<=i&&(o=f+1),i<=f&&(n=f-1)}}(t,i,o||0,n||t.length-1,a||r)}function e(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function r(t,e){return te?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,r){if(!r)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,r,i,o,n){for(var a=[r,i];a.length;)if(!((i=a.pop())-(r=a.pop())<=o)){var s=r+Math.ceil((i-r)/o/2)*o;t(e,s,r,i,n),a.push(r,s,s,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,r=[];if(!d(t,e))return r;for(var i=this.toBBox,o=[];e;){for(var n=0;n=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},i.prototype._split=function(t,e){var r=t[e],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);var a=this._chooseSplitIndex(r,o,i),s=f(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,n(r,this.toBBox),n(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},i.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,r){for(var i,o,n,s,l,u,c,h=1/0,d=1/0,f=e;f<=r-e;f++){var m=a(t,0,f,this.toBBox),y=a(t,f,r,this.toBBox),_=(o=m,n=y,s=Math.max(o.minX,n.minX),l=Math.max(o.minY,n.minY),u=Math.min(o.maxX,n.maxX),c=Math.min(o.maxY,n.maxY),Math.max(0,u-s)*Math.max(0,c-l)),g=p(m)+p(y);_=e;d--){var f=t.children[d];s(l,t.leaf?o(f):f),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,r){for(var i=r;i>=0;i--)s(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():n(t[e],this.toBBox)},i},"object"==typeof r&&void 0!==e?e.exports=o():(i=i||self).RBush=o();var i,o},{}]},{},[1])(1)}));class CustomHTMLControl{constructor(t){this.custom_html=t.custom_html}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.innerHTML=this.custom_html;return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class DownloadControl{constructor(t,e,r,i){this.interact_with_filters=t.interact_with_filters;this.notify_on_download=t.notify_on_download;this.included_fields=t.included_fields;this.features=e.concat(r.concat(i))}addListeners(){jQuery(document).on("click",".mapster-data-download",(()=>{this.downloadFeatures()}))}downloadFeatures(){let t=this.processFeatures();t.length>0?this.downloadCSV(t):alert("No features selected for download.")}processFeatures(t){let e=[];this.features.forEach((t=>{if(this.interact_with_filters&&window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.indexOf(t.id)>-1)return;let r=t.data.location?t.data.location:t.data.line?t.data.line:t.data.polygon?t.data.polygon:null,i={};i.title=t.title;i.permalink=t.permalink;i.categories=t.categories.map((t=>t.name)).join(",");this.getRecursivePropertyValue(i,t.data.additional_details,"");i.geography=JSON.stringify(r);if(this.included_fields&&""!==this.included_fields){let t={};this.included_fields.split(",").forEach((e=>{let r=e.trim();i[r]&&(t[r]=i[r])}));i=t}e.push(i)}));return e}getRecursivePropertyValue(t,e,r){for(let i in e)Array.isArray(e[i])?t[r+i]=e[i].join(","):"object"==typeof e[i]?this.getRecursivePropertyValue(t,e[i],r+i+"_"):t[r+i]=JSON.stringify(e[i])}downloadCSV(t){const e=(t,e)=>null===e?"":e;let r=[];t.forEach((t=>{for(let e in t)-1===r.indexOf(e)&&r.push(e)}));t.forEach((t=>{r.forEach((e=>{t[e]||(t[e]="")}))}));let i=t.map((t=>r.map((r=>JSON.stringify(t[r],e).replace(/\\"/g,'""'))).join(",")));i.unshift(r.join(","));i=i.join("\r\n");var o=document.createElement("a"),n=new Blob(["\ufeff",i]),a=URL.createObjectURL(n);o.href=a;o.download="map-data-download.csv";document.body.appendChild(o);o.click();document.body.removeChild(o);if(this.notify_on_download){let t=[];jQuery(".mapster-category-control input").each((function(){jQuery(this).is(":checked")&&t.push(jQuery(this).closest("li").text().trim())}));fetch(`${window.mapster_params.rest_url}mapster-wp-maps/send-email`,{method:"POST",body:JSON.stringify({users:this.notify_on_download,active_filters:t})})}}onAdd(t){this.map=t;this.storedBounds=this.map.getBounds();this._container=document.createElement("div");if(window.mapster_params.public){this._container.className="mapboxgl-ctrl mapster-download-control";this._container.innerHTML='\n
\n \n
\n ';this.addListeners()}return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class ListControl{constructor(t,e,r,i,o,n){this.sort_by_distance=t.sort_by_distance;this.show_distance=t.show_distance;this.units=t.units;this.markers=o;this.mapLibrary=n;this.listing_type=t.listing_type;this.number_of_locations=t.number_of_locations;this.store_locator=t.store_locator_options.enable;this.sort_hours_by_day=t.store_locator_options.sort_hours_by_day;this.features=e.concat(r.concat(i));this.currentPage=1;this.storedBounds=null}storeLocatorHTML(t){return"
Upgrade to Mapster Pro to enable this functionality.
"}setHTML(t){const e=new MapsterHelpers;var r="
    ",i=[];this.features.forEach(((t,r)=>{if(!(window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.indexOf(t.id)>-1)){var o=e.makeFeatureJSON(t.data);if(this.show_distance||this.sort_by_distance){var n=turf.distance(turf.center(o).geometry.coordinates,this.getCenter());t.distance=n*("imperial"===this.units?.621371:1)}i.push(t)}}));this.sort_by_distance&&(i=i.sort(((t,e)=>t.distance>e.distance?1:-1)));var o=[];i.forEach(((t,e)=>{"paginate"===this.listing_type?this.number_of_locations*(this.currentPage-1)<=e&&this.number_of_locations*this.currentPage>e&&o.push(t):o=i}));this.store_locator?r=this.storeLocatorHTML(r,o):o.forEach((t=>{r+=`\n
  • \n ${t.title}\n ${t.distance?t.distance.toFixed(2)+("imperial"===this.units?" miles":" km"):""}\n
  • \n `}));r+="
";if("paginate"===this.listing_type){r+='
';this.currentPage>1&&(r+='');this.number_of_locations*this.currentPage');r+="
"}if(t)return r;jQuery(".mapster-list-control-content").html(r)}getStoreHTML(t){return""}getCenter(){return[this.map.getCenter().lng,this.map.getCenter().lat]}addListeners(){var t=this;const e=new MapsterHelpers;jQuery(document).on("click",".mapster-list-control li",(function(r){if(!r.isTrigger){var i=t.features.find((t=>parseInt(t.id)==jQuery(this).data("id"))),o=e.makeFeatureJSON(i.data).features[0];if("Point"===o.geometry.type){const e=t.markers.find((t=>t.mapsterProperties.id===i.id));e&&i.data.enable_popup&&t.openPopup(e,i);!e&&i.data.enable_popup&&t.openPopupNonMarker(i);t.centerMap(o.geometry.coordinates,15)}else{var n=turf.bbox(o);t.fitBounds(n,{padding:20})}if(t.store_locator){jQuery(".mapster-list-control-content").hide();jQuery(".mapster-list-control-single-content").show();jQuery(".mapster-list-control-single-content").html(t.getStoreHTML(i))}}}));jQuery(document).on("click",".mapster-next",(()=>{this.currentPage=this.currentPage+1;this.setHTML()}));jQuery(document).on("click",".mapster-back",(()=>{this.currentPage=this.currentPage-1;this.setHTML()}));jQuery(document).on("click",".mapster-store-locator-results",(()=>{jQuery(".mapster-list-control-content").show();jQuery(".mapster-list-control-single-content").hide();jQuery(".mapster-list-control-single-content").empty();this.fitBounds(this.storedBounds)}));jQuery(document).on("change",".mapster-cat-toggle",(()=>{this.setHTML()}))}openPopup(t,e){const r=new MapsterHelpers;t.setPopup(new this.mapLibrary.Popup(r.returnPopupOptions(e.data)).setHTML(r.getPopupHTML(e.id,e.data))).togglePopup()}openPopupNonMarker(t){let e=this;const r=setInterval((()=>{if(e.map.getBounds().contains(t.data.location.coordinates)){e.map.fire("click",{lngLat:t.data.location.coordinates,originalEvent:{}});clearInterval(r)}}),100)}centerMap(t,e){this.map.flyTo({center:t,zoom:e})}fitBounds(t,e){this.map.fitBounds(t,e)}onAdd(t){this.map=t;this.storedBounds=this.map.getBounds();this._container=document.createElement("div");this._container.className="mapboxgl-ctrl mapster-list-control"+(this.store_locator?" mapster-store-locator":"")+(window.innerWidth<768?" mapster-mobile":"");this._container.innerHTML=`
`+this.setHTML(!0)+`
`;if(window.innerWidth<768&&this.store_locator){jQuery(this.map._container).css("overflow","visible");this._container.style.marginTop=`${jQuery(this.map._container).height()}px`;jQuery(this.map._container).after(`
`);jQuery(".maplibregl-control-container > div, .mapboxgl-control-container > div").width("100%");jQuery(".mapboxgl-ctrl-geocoder").width("100%")}this.addListeners();this.map.on("moveend",(()=>{this.setHTML()}));setTimeout((()=>{this.store_locator&&!jQuery(".mapster-store-locator .mapboxgl-ctrl-geocoder").length&&jQuery(".mapboxgl-ctrl-geocoder").prependTo(".mapster-store-locator")}),100);return this._container}onAddGoogleMap(t){this.map=t;this._container=document.createElement("div");this._container.className="mapboxgl-ctrl mapster-list-control mapster-list-control-google"+(this.store_locator?" mapster-store-locator":"")+(window.innerWidth<768?" mapster-mobile":"");this._container.innerHTML=`
`+this.setHTML(!0)+`
`;this.addListeners();this.map.addListener("dragend",(()=>{this.setHTML()}));google.maps.event.addListenerOnce(this.map,"idle",(()=>{this.store_locator&&setTimeout((()=>{jQuery(".mapster-google-geocoder-input").addClass("geocoder-google-store-locator");jQuery(".mapster-google-geocoder-input").prependTo(".mapster-store-locator")}),1e3);const t=this.map.getBounds();this.storedBounds=[t.getSouthWest().lng(),t.getSouthWest().lat(),t.getNorthEast().lng(),t.getNorthEast().lat()]}));return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}} ;class PitchToggle{constructor(t=-20,e=70,r=null){this._bearing=-20;this._pitch=70;this._minpitchzoom=r}onAdd(t){this._map=t;let e=this;this._btn=document.createElement("button");this._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-3d";this._btn.type="button";this._btn["aria-label"]="Toggle Pitch";this._btn.onclick=function(){if(0===t.getPitch()){let r={pitch:e._pitch,bearing:e._bearing};e._minpitchzoom&&t.getZoom()>e._minpitchzoom&&(r.zoom=e._minpitchzoom);t.easeTo(r);e._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-2d"}else{t.easeTo({pitch:0,bearing:0});e._btn.className="mapboxgl-ctrl-icon mapboxgl-ctrl-pitchtoggle-3d"}};this._container=document.createElement("div");this._container.className="mapboxgl-ctrl-group mapboxgl-ctrl";this._container.appendChild(this._btn);return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class CategoryControl{constructor(t,e,r,i,o,n,a,s,l,u,p){this.displayMode=t.category_display;this.checkboxMode=t.checkbox_display;this.initialVisibility=t.initial_visibility;this.preSelectedCategories=t.pre_selected_categories;this.independentChildren=t.independent_children;this.excludedCategories=t.excluded_categories;this.functionality=t.functionality;this.additional_filters=t.additional_filters;this.accordion_layout=t.accordion_layout;this.show_number_of_features=t.show_number_of_features;this.did_one_accordion=!1;this.markers=r;this.map_provider=s;this.circle_clustering=l;this.label_icon_clustering=u;this.marker_clustering=p;this.cluster_options=e;this.features=o.concat(n.concat(a));this.dataLayers=i;this.locations=o;this.lines=n;this.polygons=a}setMarkers(t){this.markers=t}organizeCategories(){var t=[];this.features.forEach((e=>{e.categories.forEach((e=>{-1===t.findIndex((t=>t.id===e.id))&&t.push(e)}))}));return t=this.filterCategories(t)}returnHTML(){return`\n
\n ${this.returnCategoryHTML(this.organizeCategories())}\n
\n `}returnCategoryHTML(t){var e="
    ";t.filter((t=>0===t.parent)).forEach(((r,i)=>{var o=t.filter((t=>t.parent===r.id));e+=this.returnInputHTML(r,o);e+=this.returnChildrenHTML(r,t)}));return e+="
"}returnChildrenHTML(t,e){var r="
    ",i=e.filter((e=>e.parent===t.id));i.forEach((t=>{r+=this.returnInputHTML(t,[]);r+=this.returnChildrenHTML(t,e)}));r+="
";0===i.length&&(r="");return r}returnInputHTML(t,e){var r=!0;!this.initialVisibility&&this.preSelectedCategories&&-1===this.preSelectedCategories.indexOf(t.id)&&(r=!1);return this.returnAccordionHTML(`\n
  • \n ${"checkbox"===this.checkboxMode?`\n \n `:`\n \n `}\n ${"colors"===this.displayMode?`
    `:""}\n ${"icons"===this.displayMode?`
    `:""}\n \n
  • \n `,t,e)}setToggles(t){var e=jQuery(t).data("term"),r=jQuery(t).data("parent"),i=jQuery(t).is(":checked");if(!this.independentChildren)if(0===r)i?jQuery(`.mapster-cat-toggle[data-parent="${e}"]`).prop("checked",!0):jQuery(`.mapster-cat-toggle[data-parent="${e}"]`).prop("checked",!1);else if(i)jQuery(`.mapster-cat-toggle[data-term="${r}"]`).prop("checked",!0);else{var o=!0;jQuery(`.mapster-cat-toggle[data-parent="${r}"]`).each((function(){jQuery(this).is(":checked")&&(o=!1)}));o&&jQuery(`.mapster-cat-toggle[data-term="${r}"]`).prop("checked",!1)}}returnIDsToHideFeatures(t){let e=[];this.features.forEach((r=>{if(r.categories.length>0)if("exclusive"===this.functionality)r.categories.find((e=>t.indexOf(e.id)>-1))&&e.push(r.id);else if("inclusive"===this.functionality){var i=!0;r.categories.forEach((e=>{-1===t.indexOf(e.id)&&(i=!1)}));i&&e.push(r.id)}}));return e}returnNumberOfFeatures(){return!1}adjustMarkers(t){let e=[];this.markers.forEach((r=>{const i=this.returnMarkerProperties(r);if(i.categories.length>0)if("exclusive"===this.functionality)if(i.categories.find((e=>t.indexOf(e.id)>-1))){this.changeMarker("hide",r);e.push(r.mapsterProperties.id)}else this.changeMarker("show",r);else if("inclusive"===this.functionality){var o=!0;if(i.categories.length>0){i.categories.forEach((e=>{-1===t.indexOf(e.id)&&(o=!1)}));if(o){this.changeMarker("hide",r);e.push(r.mapsterProperties.id)}else this.changeMarker("show",r)}}}));this.adjustMarkerClusters(e)}adjustMarkerClusters(t){if(this.marker_clustering){let e=["marker"];(new MapsterHelpers).makeClusters(this.map,this.map_provider,this.cluster_options,e,this.locations,[],[],t)}}returnAccordionHTML(t,e,r){return t}filterCategories(t){return t}changeMarker(t,e){"hide"===t?e.remove():"show"===t&&e.addTo(this.map)}changeLayerVisibility(){var t=[];jQuery(".mapster-cat-toggle").each((function(){jQuery(this).is(":checked")||t.push(jQuery(this).data("term"))}));var e=this.returnIDsToHideFeatures(t);this.setHiddenFeatures(e);this.adjustMarkers(t)}setHiddenFeatures(t){if(this.map.getLayer("symbol")){this.map.getLayer("symbol-clusters")&&(new MapsterHelpers).setClustering(this.map,this.map_provider,this.cluster_options,this.circle_clustering,this.label_icon_clustering,this.marker_clustering,this.markers,this.locations,this.lines,this.polygons,t);this.map.setLayoutProperty("symbol","text-size",["case",["in",["get","post_id"],["literal",t]],0,["==",!1,["get","label_label_on"]],0,["has","label_text_properties_text-size"],["to-number",["get","label_text_properties_text-size"]],16]);this.map.setLayoutProperty("symbol","icon-size",["case",["in",["get","post_id"],["literal",t]],0,["==",!1,["get","icon_icon_on"]],0,["has","icon_icon_properties_icon-size"],["/",["to-number",["get","icon_icon_properties_icon-size"]],100],1])}if(this.map.getLayer("circle")){this.map.setPaintProperty("circle","circle-radius",["case",["in",["get","post_id"],["literal",t]],0,["has","circle_radius"],["to-number",["get","circle_radius"]],0]);this.map.setPaintProperty("circle","circle-stroke-width",["case",["in",["get","post_id"],["literal",t]],0,["has","circle_radius"],["to-number",["get","circle_radius"]],0])}this.map.getLayer("line")&&this.map.setPaintProperty("line","line-width",["case",["in",["get","post_id"],["literal",t]],0,["has","width"],["to-number",["get","width"]],2]);if(this.map.getLayer("fill")){const e=new MapsterHelpers;let r=this.polygons.filter((e=>-1===t.indexOf(e.id))),i=e.createLayerGeoJSON(this.map,"polygon","fill",[],[],r);this.map.getSource("fill").setData(i)}}returnMarkerProperties(t){return t.mapsterProperties}addListeners(){var t=this;jQuery(document).on("change",".mapster-cat-toggle",(function(){t.setToggles(this);t.changeLayerVisibility()}));jQuery(document).on("click",".mapster-accordion-indicator",(function(){let t=!1;jQuery(this).parent().hasClass("mapster-accordion-indicator-open")&&(t=!0);jQuery(".mapster-accordion-indicator").each((function(){if(jQuery(this).parent().next("ul").is(":visible")){jQuery(this).parent().next("ul").slideToggle(400,(()=>jQuery(this).parent().addClass("mapster-accordion-indicator-closed")));jQuery(this).parent().removeClass("mapster-accordion-indicator-open")}}));if(t)jQuery(this).parent().addClass("mapster-accordion-indicator-closed");else{jQuery(this).parent().addClass("mapster-accordion-indicator-open");jQuery(this).parent().next("ul").slideToggle()}}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className="mapboxgl-ctrl mapster-category-control";this._container.innerHTML=this.returnHTML();this.initialVisibility||setTimeout((()=>{this.changeLayerVisibility()}),10);this.addListeners();return this._container}onAddGoogleMap(t){this.map=t;this._container=document.createElement("div");this._container.className="mapster-category-control mapster-google-category-control";this._container.innerHTML=this.returnHTML();this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this.map=void 0}} ;class LayerControl{constructor(t){this.toggleable_layers=t.toggleable_layers;this.toggleable_layer_titles=t.toggleable_layer_titles;this.checkbox_type=t.checkbox_type}returnHTML(){let t='
      ';const e=this.toggleable_layers.replace("\r","").split("\n"),r=this.toggleable_layer_titles.replace("\r","").split("\n");e.forEach(((e,i)=>{t+="
    • ";const o=e.split(",");let n=!0,a=!0;o.forEach((t=>{if(""!==t){this.map.getLayer(t.trim())||(n=!1);"hidden"!==this.map.getLayoutProperty(t.trim(),"visibility")&&void 0===this.map.getLayoutProperty(t.trim(),"visibility")||(a=!1)}}));n?"checkbox"===this.checkbox_type?t+=` ${r[i]}`:"radio"===this.checkbox_type?t+=` ${r[i]}`:"switch"===this.checkbox_type&&(t+=` ${r[i]}`):alert("Please double check the layers you've set for the layer control: some don't exist in the style!");t+="
    • "}));t+="
    ";return t}changeLayerVisibility(){let t=this;jQuery(".mapster-layer-toggle").each((function(){jQuery(this).data("layers").split(",").forEach((e=>{jQuery(this).is(":checked")?t.map.setLayoutProperty(e.trim(),"visibility","visible"):t.map.setLayoutProperty(e.trim(),"visibility","none")}))}))}addListeners(){var t=this;jQuery(document).on("change",".mapster-layer-toggle",(function(){t.changeLayerVisibility()}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className="mapboxgl-ctrl mapster-layer-control";const e=setInterval((()=>{if(this.map.isStyleLoaded()){this._container.innerHTML=this.returnHTML();clearInterval(e)}}),100);this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class StyleControl{constructor(t){this.toggleable_styles=t.toggleable_styles;this.toggleable_styles_titles=t.toggleable_styles_titles;this.initial_style_title=t.initial_style_title;this.default_style=!1}returnHTML(){let t='
      ';this.default_style=this.map.getStyle();t+=`
    • ${this.initial_style_title}`;const e=this.toggleable_styles.replace("\r","").split("\n"),r=this.toggleable_styles_titles.replace("\r","").split("\n");e.forEach(((e,i)=>{if(""!==e){t+="
    • ";t+=` ${r[i]}`;t+="
    • "}}));t+="
    ";return t}addListeners(){var t=this;new MapsterHelpers;jQuery(document).on("change",".mapster-style-toggle",(function(){const e=jQuery(this).data("index");if("default"!==e){const r=t.toggleable_styles.split("\n");r[e].indexOf("{")>-1?t.map.setStyle(JSON.parse(r[e])):t.map.setStyle(r[e]);t.map.fire("mapster_custom_style_load")}else{t.map.setStyle(t.default_style);t.map.fire("mapster_custom_style_load")}}))}onAdd(t){this.map=t;this._container=document.createElement("div");this._container.className="mapboxgl-ctrl mapster-style-control";const e=setInterval((()=>{if(this.map.isStyleLoaded()){this._container.innerHTML=this.returnHTML();clearInterval(e)}}),100);this.addListeners();return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class ElevationControl{constructor(t){this.lines=t.lines;this.post_id=t.post_id;this.single_line=t.single_line;this.open_on_load=t.open_on_load;this.profile_color=t.profile_color;this.units=t.units;this.show_line_length=t.show_line_length;this.profile_displayed=!1;this.last_line_displayed=!1}addListeners(){jQuery(document).on("click",".mapster-elevation-control-content",(()=>{if(this.profile_displayed){this.removeElevation();this.profile_displayed=!1;jQuery(".mapster-elevation-control-content").removeClass("mapster-elevation-control-active")}else{jQuery(".mapster-elevation-control-content");if(this.map.getSource("mapbox-dem"))this.addElevation(this.last_line_displayed);else{this.loadElevationData();this.map.once("idle",(()=>{this.addElevation(this.last_line_displayed)}))}this.profile_displayed=!0;jQuery(".mapster-elevation-control-content").addClass("mapster-elevation-control-active")}}));this.single_line&&this.open_on_load&&setTimeout((()=>{this.last_line_displayed=this.lines[0];jQuery(".mapster-elevation-control-content").click()}),1e3);this.single_line||this.map.on("click","line",(t=>{this.last_line_displayed=this.lines.find((e=>e.id===t.features[0].properties.post_id));this.profile_displayed&&jQuery(".mapster-elevation-control-content").click();jQuery(".mapster-elevation-control-content").click()}));this.map.on("mousemove",(()=>{this.map.getLayer("elevation-point-along-layer")&&this.map.setLayoutProperty("elevation-point-along-layer","visibility","none")}))}loadElevationData(){this.map.addSource("mapbox-dem",{type:"raster-dem",url:"mapbox://mapbox.terrain-rgb",tileSize:512,maxzoom:14});this.map.setTerrain({source:"mapbox-dem",exaggeration:1.5})}removeElevation(){document.getElementById("mapster-chartjs-container").remove()}addElevation(t){let e=[],r=turf.length(t.data.line);for(let i=0;i""));if(this.show_line_length){a=[];e.forEach(((t,e)=>{let i=r/50;"feet"===this.units&&(i*=.621371);let o=parseInt(e*i*10)/10;a.push(o)}))}new Chart(document.getElementById("mapster-chartjs"),{type:"line",data:{labels:a,datasets:[{label:"Elevation",data:e,fill:!1,borderColor:this.profile_color,pointRadius:0,tension:.2}]},options:n.returnElevationChartOptions(this.units,this.show_line_length),plugins:[n.returnElevationChartPlugin(this.map,t)]})}onAdd(t){this.map=t;this.storedBounds=this.map.getBounds();this._container=document.createElement("div");if(window.mapster_params.public){this._container.className="mapboxgl-ctrl mapster-elevation-control";this._container.innerHTML='\n
    \n \n
    \n ';this.addListeners()}return this._container}onRemove(){this._container.parentNode.removeChild(this._container);this._map=void 0}}class MapsterConstants{returnElevationChartPlugin(t,e){return{id:"corsair",afterInit:t=>{t.corsair={x:0,y:0}},afterEvent:(t,e)=>{const{chartArea:{top:r,bottom:i,left:o,right:n}}=t,{event:{x:a,y:s}}=e;if(an||si){t.corsair={x:a,y:s,draw:!1};t.draw()}else{t.corsair={x:a,y:s,draw:!0};t.draw()}},afterDatasetsDraw:(r,i,o)=>{const{ctx:n,chartArea:{top:a,bottom:s,left:l,right:u}}=r,{x:p,y:c,draw:h}=r.corsair;if(!h)return;n.lineWidth=o.width||0;n.setLineDash(o.dash||[]);n.strokeStyle=o.color||"black";n.save();n.beginPath();n.moveTo(p,s);n.lineTo(p,a);n.stroke();n.restore();const d=(p-l)/(u-l);let f=turf.length(e.data.line),m=turf.along(e.data.line,f*d);if(t.getSource("elevation-point-along")&&t.getLayer("elevation-point-along-layer")){t.getSource("elevation-point-along").setData(m);t.setLayoutProperty("elevation-point-along-layer","visibility","visible")}else{t.addSource("elevation-point-along",{type:"geojson",data:m});t.addLayer({id:"elevation-point-along-layer",type:"circle",source:"elevation-point-along"})}}}}returnElevationChartOptions(t,e){return{interaction:{intersect:!1,mode:"index"},scales:{x:{title:{display:!!e,text:"meters"===t?"KM":"Miles",font:{style:"italic",size:10}},grid:{display:!0},ticks:{font:{size:10}}}},maintainAspectRatio:!1,plugins:{legend:{display:!1},title:{display:!0,text:`Elevation (${"meters"===t?"m":"ft"})`},tooltip:{displayColors:!1,callbacks:{label:function(e){return parseInt(10*e.parsed.y)/10+" "+("meters"===t?"m":"ft")}}},corsair:{color:"#333",width:1}}}}returnStyleProviders(){return[{id:"streets",style:"mapbox://styles/mapbox/streets-v12"},{id:"outdoors",style:"mapbox://styles/mapbox/outdoors-v12"},{id:"light",style:"mapbox://styles/mapbox/light-v11"},{id:"dark",style:"mapbox://styles/mapbox/dark-v11"},{id:"satellite",style:"mapbox://styles/mapbox/satellite-v9"},{id:"satellite-streets",style:"mapbox://styles/mapbox/satellite-streets-v12"},{id:"custom-image",style:{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[{id:"background",type:"background",paint:{"background-color":"rgba(255,255,255,1)"}}]}},{id:"empty",style:{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[{id:"background",type:"background",paint:{"background-color":"rgba(255,255,255,1)"}}]}},{id:"open-street-map",style:this.returnJsonStyle("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",'© OpenStreetMap contributors')},{id:"open-topo-map",style:this.returnJsonStyle("https://a.tile.opentopomap.org/{z}/{x}/{y}.png",'Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)')},{id:"cyclo-osm",style:this.returnJsonStyle("https://a.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png",'CyclOSM | Map data: © OpenStreetMap contributors')},{id:"toner-stamen",style:this.returnJsonStyle("https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors')},{id:"watercolor-stamen",style:this.returnJsonStyle("https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png",'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors')},{id:"terrain-stamen",style:this.returnJsonStyle("https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png",'Map tiles by Stamen Design, CC BY 3.0 — Map data © OpenStreetMap contributors')},{id:"esri-satellite",style:this.returnJsonStyle("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}","Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community")},{id:"blank-map",style:this.returnJsonStyle("https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",'© OpenStreetMap contributors')}]}returnJsonStyle(t,e){return{version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{"raster-tiles":{type:"raster",tiles:[t],tileSize:256,attribution:e}},layers:[{id:"simple-tiles",type:"raster",source:"raster-tiles",minzoom:0,maxzoom:22}]}}loaderHTML(){return'\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
    \n\t\t'}markerAsSVG(t){return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `)}}class MapsterHelpers{constructor(){this.queuedImages=[]}isMobile(){let t=!1;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(t=!0);return t}changeCursor(t,e,r){e.data.enable_popup&&(t.getCanvas().style.cursor="on"===r?"pointer":"grab")}formatResponse(t){["location","line","polygon"].forEach((e=>{t[e+"s"].forEach((r=>{this.setObjectProperties(r,t[e+"_template"]);this.setPopupStyles(r,t.popup_styles)}))}));return new Promise((e=>{e(t)}))}getDefaultCenter(){let t=[0,0];"1"===window.mapster_params.activated&&window.mapster_params.mapster_default_lat&&window.mapster_params.mapster_default_lng&&(t=[parseFloat(window.mapster_params.mapster_default_lng),parseFloat(window.mapster_params.mapster_default_lat)]);return t}getDefaultZoom(){let t=2;"1"===window.mapster_params.activated&&window.mapster_params.mapster_default_zoom&&(t=parseFloat(window.mapster_params.mapster_default_zoom));return t}doHover(t,e){let r=e.data.line?"line":e.data.symbol?"symbol":e.data.circle?"circle":e.data.polygon?"fill":[],i="line"===r||"fill"===r?e.data:"circle"===r?e.data.circle:e.data.symbol;if(i.hover_effects&&i.hover_effects.hover_enabled){t.removeFeatureState({source:r});t.setFeatureState({source:r,id:e.id},{hover:!0})}}doHoverOut(t,e){let r=e.data.line?"line":e.data.symbol?"symbol":e.data.circle?"circle":e.data.polygon?"fill":[],i="line"===r||"fill"===r?e.data:"circle"===r?e.data.circle:e.data.symbol;i.hover_effects&&i.hover_effects.hover_enabled&&t.setFeatureState({source:r,id:e.id},{hover:!1})}doMarkerHover(t,e,r){let i=r.mapsterProperties.data;if(i.marker.hover_effects.hover_enabled){const o=new e.Marker({color:i.marker.hover_effects.hover_color,scale:parseFloat(i.marker.hover_effects.hover_scale)/100,rotation:parseFloat(i.marker.hover_effects.hover_rotation),anchor:i.marker.anchor});-1===o._element.className.indexOf("mapster-remove-hover")&&(o._element.className+=" mapster-remove-hover");-1===r._element.className.indexOf("mapster-hide-original")&&(r._element.className+=" mapster-hide-original");o.setLngLat([r._lngLat.lng,r._lngLat.lat]).addTo(t);return o}return!1}doMarkerHoverOut(t,e){e._element.className.indexOf("mapster-hide-original")>-1&&(e._element.className=e._element.className.replace(" mapster-hide-original",""));t.remove()}setMapCompare(t,e,r,i){ }applyProSearchFilter(t,e){ return e}setGeolocationOnLoad(t){ }setMapBreakpointSizes(t,e){ }async getImageData(t){return wp.media.attachment(t).fetch().then((t=>t))}async setCustomImageMap(t,e,r){ }loadModalSteps(t,e,r,i,o,n){const a=new MapsterConstants;let s=!1,l=[];if("create_point"===i){if(o)if(1===o.length){s=o[0].term_id;if(n.submission_interface.include_address_search){u(t);p()}else{p();c()}}else{u(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n
    \n ${o.map((t=>`\n
    \n ${t.icon?`
    `:""}\n ${t.name?`

    ${t.name}

    `:""}\n ${t.description?`

    ${t.description}

    `:""}\n
    \n `)).join("")}\n
    \n `)}else{u(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n
    \n
    ${n.custom_texts.add_point_text}
    \n
    \n `)}jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-cat-set`,(function(){"none"!==jQuery(this).data("category")&&(s=jQuery(this).data("category"));p()}))}if("edit_point"===i){const e=window.mapster_params.user_submission_permalink;u(t);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n ${a.loaderHTML()}\n \n \n `)}window.onmessage=function(t){if(t.data&&t.data.indexOf){t.data.indexOf("set_point")>-1&&p(t.data.replace("set_point-",""));if(t.data.indexOf("close_modal")>-1){jQuery(".mapster-submission-modal-overlay").fadeOut(50);jQuery(".mapster-submission-modal").fadeOut(100)}}};function u(t){jQuery(`.mapster-submit-${t} #mapster-submission-modal-overlay-${t}`).fadeIn(100);jQuery(`.mapster-submit-${t} #mapster-submission-modal-${t}`).fadeIn(150)}function p(i){n.submission_interface.include_address_search?jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n

    ${n.custom_texts.choose_how}

    \n
    \n ${n.submission_interface.include_address_search?`

    ${n.custom_texts.address_search}

    `:""}\n

    ${n.custom_texts.map_click}

    \n
    \n `):c();jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-method-set`,(function(){if("address"===jQuery(this).data("method")){const i=new MapboxGeocoder({accessToken:n.submission_interface.mapbox_geocoder_access_token,mapboxgl:r,marker:!1});jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`

    ${n.custom_texts.search_location}

    `);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`)[0].appendChild(i.onAdd(e));i.on("result",(function(){c()}))}"click"===jQuery(this).data("method")&&c()}));jQuery(document).on("click",`#mapster-wp-maps-${t} .mapster-selection-instructions button`,(function(r){const i=e.getCenter();let o=!0;if(n.administration.allowed_area){const t=JSON.parse(n.administration.allowed_area);turf.booleanPointInPolygon([i.lng,i.lat],t.features[0])||(o=!1)}jQuery(".mapboxgl-ctrl").show();jQuery(".mapster-selection-overlay").remove();l=[i.lng,i.lat];jQuery(`#mapster-submission-modal-overlay-${t}`).fadeIn(100);jQuery(`#mapster-submission-modal-${t}`).fadeIn(150);jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n

    ${o?n.custom_texts.selection_saved:n.custom_texts.selection_error}

    \n
    \n

    ${n.custom_texts.try_again}

    \n ${o?`

    ${n.custom_texts.confirm}

    `:""}\n
    \n `)}));jQuery(document).on("click",`#mapster-submission-modal-${t} .mapster-category-tile.mapster-coords-set`,(function(){const e=window.mapster_params.user_submission_permalink;let r=!!n.administration.template_post&&n.administration.template_post.ID;if(n.administration.multiple_templates){let t=n.submission_interface.categories.indexOf(s);r=n.administration.template_posts[t]}let o=i?"&type=edit&post_id="+i:"";jQuery(`#mapster-submission-modal-${t} .mapster-submission-modal-content`).html(`\n ${a.loaderHTML()}\n \n \n `)}))}function c(){jQuery(".mapster-submission-modal-close").trigger("click");jQuery(".mapboxgl-ctrl").hide();jQuery(e._container).append(`\n
    \n
    \n

    ${n.custom_texts.drag_zoom}

    \n \n
    \n \n \n \n \n
    \n `)}}setProjectionGlobe(t,e){ }create3DModels(t,e){ }setPopupStyles(t,e){if(t.data.popup_style){let r=t.data.popup_style,i=e.find((t=>t.id===r));t.data.popup_style=i}}setObjectProperties(t,e){for(var r in e)if(this.isObject(e[r])){null==t[r]&&(t[r]={});this.setObjectProperties(t[r],e[r])}else null==t[r]&&(t[r]=e[r])}isObject(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}makeFeatureJSON(t){let e=t.line?t.line:t.location?t.location:!!t.polygon&&t.polygon;return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:e.type,coordinates:e.coordinates}}]}}getStyle(t){const e=new MapsterConstants;if(""!==t.custom_mapbox_style)return t.custom_mapbox_style;if("custom-image"===t.map_provider)return e.returnStyleProviders().find((t=>"custom-image"===t.id)).style;if(""!==t.access_token){var r=t.map_tile_style_access_token;return e.returnStyleProviders().find((t=>t.id===r)).style}r=t.map_tile_style_no_access_token;return e.returnStyleProviders().find((t=>t.id===r)).style}addMapControl(t,e,r,i,o,n={}){e&&t.removeControl(e);if(r){const e=new o(n);t.addControl(e,i);return e}return!1}searchLocalFeatures(t,e,r,i,o){var n={type:"FeatureCollection",features:[]};r.concat(i.concat(o)).forEach((t=>{var e=this.makeFeatureJSON(t.data);n.features.push(this.makeGeocoderResult(t,e))}));let a=this.localFeaturesTextMatch(t,e,n.features);a.sort(((t,e)=>t.place_name>e.place_name?1:-1));return a}localFeaturesTextMatch(t,e,r){let i=[];const o=e.split(" ").filter((t=>""!==t));r.forEach((r=>{var n=!1;r.properties.searchableTexts.forEach((a=>{var s={type:"Feature",id:r.properties.id,place_name:jQuery("
    ").html(r.properties.place_name).text()};if(!(window.mapster_categories_hidden_features&&window.mapster_categories_hidden_features.length>0&&-1!==window.mapster_categories_hidden_features.indexOf(r.properties.id))){if("exact-match"===t&&a&&(a.toLowerCase().indexOf(e.toLowerCase())>-1||" "===e)&&!n){s.center=turf.center(r).geometry.coordinates;"Point"!==r.geometry.type&&(s.bbox=turf.bbox(r));i.push(s);n=!0} }}))}));return i}initializeSlider(t,e){const r=t=>{jQuery("#mapster-slider ul").animate({left:jQuery("#mapster-slider ul li").width()*("right"===t?-1:1)},200,(()=>{jQuery("#mapster-slider ul li:first-child").appendTo("#mapster-slider ul");jQuery("#mapster-slider ul").css("left","")}))};if(!window.sliderClicksInitialized){jQuery(document).on("click","#mapster-slider .mapster-slider-control_prev",(function(){r("left")}));jQuery(document).on("click","#mapster-slider .mapster-slider-control_next",(function(){r("right")}));window.sliderClicksInitialized=!0}}makeHeatmap(t,e,r,i){ }createHeatmapProperties(t,e,r,i){ }fadeHeatmapFeatures(t,e){ }setClustering(t,e,r,i,o,n,a,s,l,u,p){if(o||i)return this.doSymbolClustering(t,e,r,i,o,s,l,u,p);n&&this.doMarkerClustering(t,e,r,n,a,s,p);return[]}doMarkerClustering(t,e,r,i,o,n,a){let s=r.cluster_by_category?r.categories_to_cluster.map((t=>"marker-"+t)):["marker"];this.makeClusters(t,e,r,s,n,[],[],a);t.on("render",(()=>{let e=[];s.forEach((r=>{if(!t.isSourceLoaded(r))return;const i=t.querySourceFeatures(r);e=e.concat(i.filter((t=>t.properties.id)).map((t=>t.properties.id)))}));o.forEach((r=>{-1===e.indexOf(r.mapsterProperties.id)?r.remove():(!r._popup||r._popup&&!r._popup.isOpen())&&r.addTo(t)}))}))}doSymbolClustering(t,e,r,i,o,n,a,s,l){var u=[];o&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{u.push("symbol-"+t)})):u.push("symbol"));i&&(r.cluster_by_category?r.categories_to_cluster.forEach((t=>{u.push("circle-"+t)})):u.push("circle"));this.makeClusters(t,e,r,u,n,a,s,l);return u}makeClusters(t,e,r,i,o,n,a,s){i.forEach((e=>{t.getLayer(`${e}-cluster-count`)&&t.removeLayer(`${e}-cluster-count`);t.getLayer(`${e}-clusters`)&&t.removeLayer(`${e}-clusters`);t.getLayer(`${e}-clusters-border`)&&t.removeLayer(`${e}-clusters-border`);t.getLayer(e)&&t.removeLayer(e);if(t.getSource(e))try{t.removeSource(e)}catch(t){}}));i.forEach(((i,l)=>{let u,p=i.split("-")[0];if(t.getLayer(p)&&t.getSource(p)){t.removeLayer(p);t.removeSource(p)}u=i.indexOf("marker")>-1?this.createMarkerGeoJSON(o,i):this.createLayerGeoJSON(t,"location",i,o,n,a);s=s||[];var c=u.features.filter((t=>-1===s.indexOf(t.properties.post_id)));let h=!1;if(r.show_category_name){let t=o.concat(n.concat(a)),e=parseInt(i.split("-")[1]);t.forEach((t=>{h||(h=t.categories.find((t=>t.id===e)))}))}t.addSource(i,{type:"geojson",data:{type:"FeatureCollection",features:c},cluster:!0,clusterMaxZoom:14,clusterRadius:50});if(i.indexOf("marker")>-1)t.addLayer({id:i,source:i,type:"circle",filter:["!",["has","point_count"]],paint:{"circle-radius":0}});else{var d=this.getLayerExpressions("location",i.indexOf("symbol")>-1?"symbol":"circle",e);t.addLayer({id:i,source:i,type:i.split("-")[0],filter:["!",["has","point_count"]],paint:d.paint,layout:d.layout})}this.addIcons(t,i,u);let f="#51bbd6",m=100,y=20,_="#f1f075",g=750,v=30,x="#f28cb1",b=40; t.addLayer({id:`${i}-clusters`,type:"circle",source:i,filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],f,m,_,g,x],"circle-radius":["step",["get","point_count"],y,m,v,g,b]}});t.addLayer({id:`${i}-cluster-count`,type:"symbol",source:i,filter:["has","point_count"],layout:{"text-field":h?h.name:"{point_count_abbreviated}","text-font":"mapbox"===e?["DIN Offc Pro Medium","Arial Unicode MS Bold"]:["Open Sans Regular"],"text-size":12}});setTimeout((()=>{t.on("click",`${i}-clusters`,(e=>{const r=t.queryRenderedFeatures(e.point,{layers:[`${i}-clusters`]}),o=r[0].properties.cluster_id;t.getSource(i).getClusterExpansionZoom(o,((e,i)=>{t.easeTo({center:r[0].geometry.coordinates,zoom:i+1})}))}))}),500)}))}makeGeocoderResult(t,e){var r=e.features[0];r.properties={searchableTexts:[t.data.popup?t.data.popup.header_text:"",t.data.popup?t.data.popup.body_text:"",t.title,t.content],id:t.id,place_name:t.title};return r}modifyDropdown(t){t.container.classList.add("mapster-maps-dropdown");jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--icon.mapboxgl-ctrl-geocoder--icon-search").replaceWith('');jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--input").wrap('
    ');jQuery(".mapster-maps-dropdown").find(".mapboxgl-ctrl-geocoder--input").attr("disabled",!0);jQuery(document).on("click",".mapster-maps-dropdown .input-wrapper",(()=>{t.setInput("");jQuery(".suggestions-wrapper .suggestions li").removeClass("active")}));jQuery(document).on("click",".mapboxgl-ctrl-geocoder--icon.mapboxgl-ctrl-geocoder--icon-close",(()=>{t.clear();jQuery(".suggestions-wrapper .suggestions").hide()}))}openExternalLink(t){t&&t.data.open_link_on_click&&t.data.click_link&&t.data.click_link.url&&(t.data.click_link.open_link_in_new_tab?window.open(t.data.click_link.url):window.open(t.data.click_link.url,"_self"))}getMapBounds(t,e,r){var i={type:"FeatureCollection",features:[]};[["location",t],["line",e],["polygon",r]].forEach((t=>{t[1].forEach((t=>{var e=this.makeFeatureJSON(t.data);i.features.push(e.features[0])}))}));return i.features.length>0?turf.bbox(i):null}openStoreLocatorClick(t,e){t.enable&&jQuery(`.mapster-store-locator-list[data-id="${e}"]`).click()}openSidebarClick(t,e,r,i,o,n){!t.enable&&e&&this.setSidebarHTML(r.data,i,o,n)}openPopup(t,e,r,i,o,n,a){if(!n.enable&&!a){r&&r.remove();if(i.data.popup_style){i.data.location&&"Point"===i.data.location.type&&(o=i.data.location.coordinates);let r=new e.Popup(this.returnPopupOptions(i.data)).setLngLat(o).setHTML(this.getPopupHTML(i.id,i.data));this.centerPopup(t,r,i);r.addTo(t);return r}}}centerPopup(t,e,r){ }mouseIsNear(t,e,r){if(t&&t.offset()){var i=t.offset().left-e,o=t.offset().top-e,n=i+t.width()+2*e,a=o+t.height()+2*e,s=r.pageX,l=r.pageY;return s>i&&so&&l{this.initializeSlider(`mapster-popup-${e.popup_style.id}`,n.images.length+1)}),400);return`\n \n ${o.use_custom_css?``:""}\n ${o.use_custom_html?this.replaceHTMLValues(a.html_editor,n):`
    \n ${o.enable_header?`
    \n

    ${n.header_text}

    \n
    `:""}\n ${o.enable_image&&"feature-image"===n.image_type?'
    ':""}\n ${o.enable_image&&"gallery"===n.image_type?``:""}\n ${o.enable_body?`
    \n

    ${n.body_text}

    \n
    `:""}\n ${o.enable_footer?``:""}\n
    `}\n `}getPopupStyle(t){var e=this.returnPopupCSS(t),r=this.returnPopupLayout(t),i=this.returnPopupContent(t),o=t.popup_style.id;return`\n .mapboxgl-popup .mapboxgl-popup-content, .maplibregl-popup .maplibregl-popup-content {\n padding: 0px;\n background: none;\n border: none;\n border-radius: none;\n box-shadow: none;\n }\n #mapster-popup-${o}.map-popup-background {\n background : ${e.background};\n text-align : ${e.align};\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n }\n #mapster-popup-${o} .map-popup-header {\n background : ${e.header};\n padding: 10px;\n }\n #mapster-popup-${o} .map-popup-header h2 {\n all : revert;\n color : ${e.header_text};\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n #mapster-popup-${o} .map-popup-image {\n background-image : url("${i.featured_image?i.featured_image.url:""}");\n background-position : center center;\n background-size: cover;\n height : ${e.image_height}px;\n width: 100%;\n }\n #mapster-popup-${o} .map-popup-body {\n margin-top: -1px;\n background : ${e.body};\n padding: 10px;\n color : ${e.body_text};\n }\n #mapster-popup-${o} .map-popup-body p {\n padding: 0px;\n margin: 0px;\n }\n #mapster-popup-${o} .map-popup-footer {\n margin-top: -1px;\n background : ${e.footer};\n padding: 10px;\n }\n #mapster-popup-${o} .map-popup-footer .map-popup-footer-button {\n all : revert;\n background : ${e.button};\n border-color: ${e.button};\n color : ${e.button_text};\n padding: 5px;\n text-decoration: none;\n text-shadow: none;\n }\n #mapster-popup-${o} .map-popup-footer .map-popup-footer-button:hover {\n cursor: pointer;\n filter: brightness(1.15);\n }\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n border-bottom-color : ${e.pointer};\n display : ${r.enable_pointer?"block":"none"};\n }\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n\t\t\t\tborder-left-color : ${e.pointer};\n display : ${r.enable_pointer?"block":"none"};\n\t\t\t}\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n\t\t\t\tborder-right-color : ${e.pointer};\n display : ${r.enable_pointer?"block":"none"};\n\t\t\t}\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,\n\t\t\t.mapboxgl-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip, .maplibregl-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n border-top-color : ${e.pointer};\n display : ${r.enable_pointer?"block":"none"};\n }\n `}setSidebarHTML(t,e,r,i){var o="#mapster-wp-maps-"+i;jQuery(".mapster-sidebar-popup").remove();var n=jQuery(o).height(),a=(jQuery(o).width(),this.getPopupStyle(t)),s=this.returnPopupCSS(t),l=this.returnPopupLayout(t),u=this.returnPopupContent(t);l.enable_image&&"gallery"===u.image_type&&setTimeout((()=>{this.initializeSlider(`mapster-sidebar-popup-${t.popup_style.id}`,u.images.length+1)}),400);jQuery(document).on("click",".mapster-sidebar-popup-exit",(()=>{jQuery(".mapster-sidebar-popup").remove()}));const p=parseFloat(e),c=parseFloat(r),h=`\n \n ${l.use_custom_css?``:""}\n
    \n
    \n ${l.enable_header?`
    \n

    ${u.header_text}

    \n
    `:""}\n ${l.enable_image&&"feature-image"===u.image_type?'
    ':""}\n ${l.enable_image&&"gallery"===u.image_type?``:""}\n ${l.enable_body?`
    \n

    ${u.body_text}

    \n
    `:""}\n ${l.enable_footer?``:""}\n
    \n `;jQuery(o).append(h)}replaceHTMLValues(t,e){let r; return r}returnPopupHTML(t){return{html_editor:t.popup_style.html_editor}}returnPopupContent(t){return{header_text:t.popup.header_text,image_type:t.popup.image_type,featured_image:t.popup.featured_image,images:t.popup.images,body_text:t.popup.body_text,button_text:t.popup.button_text,button_action:t.popup.button_action,button_url:t.popup.button_url,modal_details:t.popup.modal_details,additional_details:t.additional_details,open_link_in_new_tab:t.popup.open_link_in_new_tab}}returnPopupLayout(t){return{enable_header:t.popup_style.enable_header,enable_image:t.popup_style.enable_image,enable_body:t.popup_style.enable_body,enable_footer:t.popup_style.enable_footer,enable_pointer:t.popup_style.enable_pointer,use_custom_css:t.popup_style.use_custom_css,use_custom_html:t.popup_style.use_custom_html,popup_class:t.popup_style.popup_class}}returnPopupOptions(t){return{className:"hover"===t.interaction?"mapster-hover-popup":"",closeButton:t.popup_style.close_button,closeOnClick:t.popup_style.close_on_click,closeMapMove:t.popup_style.close_on_map_move,maxWidth:t.popup_style.max_width+"px"}}returnPopupCSS(t){return{background:t.popup_style.background,header:t.popup_style.header,image_height:t.popup_style.image_height,body:t.popup_style.body,footer:t.popup_style.footer,button:t.popup_style.button,pointer:t.popup_style.pointer,header_text:t.popup_style.header_text,body_text:t.popup_style.body_text,button_text:t.popup_style.button_text,align:t.popup_style.align,css_editor:t.popup_style.css_editor,max_width:t.popup_style.max_width}}getMarkerStyles(t){var e=t.data;return{color:e.marker.color,scale:parseFloat(e.marker.scale)/100,rotation:parseFloat(e.marker.rotation),anchor:e.marker.anchor}}getLayerExpressions(t,e,r){if("line"===t)return{layout:{},paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"line-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","hover_effects_hover_opacity"]],100],["has","opacity"],["/",["to-number",["get","opacity"]],100],1],"line-width":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","hover_effects_hover_width"]],["has","width"],["to-number",["get","width"]],2],"line-dasharray":"mapbox"===r?["case",["==",!0,["to-boolean",["get","dashed_line"]]],["get","dash_properties_line_dash_array"],["literal",[1,0]]]:[1,0]}};if("polygon"===t){if("fill"===e)return{layout:{},paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"fill-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","hover_effects_opacity"]],100],["has","opacity"],["/",["to-number",["get","opacity"]],100],1],"fill-outline-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_outline-color"],["has","outline-color"],["get","outline-color"],"rgba(0,0,0,0)"]}};if("fill-extrusion"===e)return"1"===window.mapster_params.activated?{layout:{},paint:{"fill-extrusion-color":["case",["boolean",["feature-state","hover"],!1],["get","hover_effects_hover_color"],["has","color"],["get","color"],"#000"],"fill-extrusion-opacity":.75,"fill-extrusion-base":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","3d_polygon_base"]],100],["has","3d_polygon_base"],["to-number",["get","3d_polygon_base"]],0],"fill-extrusion-height":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","3d_polygon_height"]],["has","3d_polygon_height"],["to-number",["get","3d_polygon_height"]],0]}}:{layout:{},paint:{}}}if("location"===t){if("circle"===e)return{layout:{},paint:{"circle-color":["case",["boolean",["feature-state","hover"],!1],["get","circle_hover_effects_hover_color"],["has","circle_color"],["get","circle_color"],"#000"],"circle-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","circle_hover_effects_hover_opacity"]],100],["has","circle_opacity"],["/",["to-number",["get","circle_opacity"]],100],1],"circle-radius":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_radius"]],["has","circle_radius"],["to-number",["get","circle_radius"]],0],"circle-stroke-width":["case",["boolean",["feature-state","hover"],!1],["to-number",["get","circle_hover_effects_hover_stroke-width"]],["has","circle_stroke-width"],["to-number",["get","circle_stroke-width"]],0],"circle-stroke-color":["case",["boolean",["feature-state","hover"],!1],["get","circle_hover_effects_hover_stroke-color"],["has","circle_stroke-color"],["get","circle_stroke-color"],"#000"],"circle-stroke-opacity":["case",["boolean",["feature-state","hover"],!1],["/",["to-number",["get","circle_hover_effects_hover_stroke-opacity"]],100],["has","circle_stroke-opacity"],["/",["to-number",["get","circle_stroke-opacity"]],100],1]}};if("symbol"===e)return{layout:{"text-field":["case",["has","label_text_properties_text-field"],["get","label_text_properties_text-field"],"New Text"],"text-font":["case",["==","Open Sans Regular",["get","label_text_properties_text-font"]],["literal",["Open Sans Regular"]],["==","Open Sans Bold",["get","label_text_properties_text-font"]],["literal",["Open Sans Bold"]],["==","Open Sans Italic",["get","label_text_properties_text-font"]],["literal",["Open Sans Italic"]],["==","Klokantech Noto Sans Regular",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Regular"]],["==","Klokantech Noto Sans Bold",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Bold"]],["==","Klokantech Noto Sans Italic",["get","label_text_properties_text-font"]],["literal",["Klokantech Noto Sans Italic"]],["==","Metropolis",["get","label_text_properties_text-font"]],["literal",["Metropolis"]],["==","Metropolis Bold",["get","label_text_properties_text-font"]],["literal",["Metropolis Bold"]],["==","Metropolis Regular Italic",["get","label_text_properties_text-font"]],["literal",["Metropolis Regular Italic"]],["literal",["Open Sans Regular"]]],"text-rotate":["case",["has","label_text_properties_text-rotate"],["to-number",["get","label_text_properties_text-rotate"]],0],"text-size":["case",["==",!1,["get","label_label_on"]],0,["has","label_text_properties_text-size"],["to-number",["get","label_text_properties_text-size"]],16],"icon-size":["case",["==",!1,["get","icon_icon_on"]],0,["has","icon_icon_properties_icon-size"],["/",["to-number",["get","icon_icon_properties_icon-size"]],100],1],"icon-rotate":["case",["has","icon_icon_properties_icon-rotate"],["to-number",["get","icon_icon_properties_icon-rotate"]],0],"icon-allow-overlap":!0,"icon-ignore-placement":!0,"icon-anchor":["case",["has","icon_icon_properties_icon-anchor"],["get","icon_icon_properties_icon-anchor"],"center"],"icon-offset":["case",["has","icon_icon_properties_offset_array"],["get","icon_icon_properties_offset_array"],["literal",[0,0]]],"text-offset":["case",["has","label_text_properties_offset_array"],["get","label_text_properties_offset_array"],["literal",[0,0]]]},paint:{"text-color":["case",["has","label_text_properties_text-color"],["get","label_text_properties_text-color"],"#000000"],"text-halo-width":["case",["has","label_text_properties_text-halo-width"],["to-number",["get","label_text_properties_text-halo-width"]],1],"text-halo-color":["case",["has","label_text_properties_text-halo-color"],["get","label_text_properties_text-halo-color"],"#FFFFFF"],"text-halo-blur":["case",["has","label_text_properties_text-halo-blur"],["/",["to-number",["get","label_text_properties_text-halo-blur"]],100],1],"text-opacity":["case",["has","label_text_properties_text-opacity"],["/",["to-number",["get","label_text_properties_text-opacity"]],100],1],"icon-opacity":["case",["has","icon_icon_properties_icon-opacity"],["/",["to-number",["get","icon_icon_properties_icon-opacity"]],100],1]}}}}addIcons(t,e,r){e.indexOf("symbol")>-1&&r.features.forEach((r=>{r.properties.icon_icon_on&&r.properties["icon_icon_properties_icon-image_url"]&&this.addNewIcon(t,r.properties["icon_icon_properties_icon-image_url"],r.properties["icon_icon_properties_icon-image_id"],(()=>{t.getLayer(e)&&t.setLayoutProperty(e,"icon-image",["case",["has","icon_icon_properties_icon-image_id"],["concat","icon-image-",["get","icon_icon_properties_icon-image_id"]],"none"])}))}))}addNewIcon(t,e,r,i){if(this.queuedImages.indexOf(`icon-image-${r}`)>-1)i();else{this.queuedImages.push(`icon-image-${r}`);e||i();"https:"===window.location.protocol&&e.indexOf("http://")>-1&&(e=e.replace("http","https"));var o=new Image;o.src=e;o.crossOrigin="";o.onload=function(){if(t.loaded()){t.hasImage(`icon-image-${r}`)?t.updateImage(`icon-image-${r}`,o):t.addImage(`icon-image-${r}`,o);i()}else t.once("idle",(()=>{t.hasImage(`icon-image-${r}`)?t.updateImage(`icon-image-${r}`,o):t.addImage(`icon-image-${r}`,o);i()}))}}}createLayerGeoJSON(t,e,r,i,o,n){var a={type:"FeatureCollection",features:[]};let s="line"===e?o:"location"===e?i:"polygon"===e?n:[],l=r.indexOf("-")>-1&&r.split("-")[1],u=r.indexOf("-")>-1?r.split("-")[0]:r;if("fill-extrusion"===r){u=r;l=!1}s.forEach((i=>{if(i.data[e]&&u===this.getLayerType(e,i.data)&&(!l||i.categories.find((t=>t.id===parseFloat(l))))){var o=this.makeFeatureJSON(i.data);if(o.features[0]){var n=this.makeFeatureWithProperties(i,o.features[0]);a.features.push(n)}i.data.open_popup_on_load&&-1===r.indexOf("-")&&setTimeout((()=>{if(t){const e=turf.pointOnFeature(o);t.fire("click",{lngLat:e.geometry.coordinates})}}),500)}}));return a}createMarkerGeoJSON(t,e){let r=!!e.indexOf("-")&&e.split("-")[1];var i={type:"FeatureCollection",features:[]};i.features=t.filter((t=>!r&&"marker"===t.data.location_style||!(!r||"marker"!==t.data.location_style||!t.categories.find((t=>t.id===parseFloat(r)))))).map((t=>{t.post_id=t.id;return{type:"Feature",properties:t,geometry:t.data.location}}));return i}makeFeatureWithProperties(t,e){var r=JSON.parse(JSON.stringify(e));r.id=t.id;r.properties.post_id=t.id;for(var i in t.data)-1===["polygon","line","location","popup","popup_style"].indexOf(i)&&this.assignToProperty(r,t.data,i);r.properties.dashed_line&&r.properties.dash_properties_dash_length&&(r.properties.dash_properties_line_dash_array=[parseFloat(r.properties.dash_properties_dash_length),parseFloat(r.properties.dash_properties_gap_length)]);(r.properties["label_text_properties_text-translate-x"]||r.properties["label_text_properties_text-translate-y"])&&(r.properties.label_text_properties_offset_array=[parseFloat(r.properties["label_text_properties_text-translate-x"]),parseFloat(r.properties["label_text_properties_text-translate-y"])]);(r.properties["icon_icon_properties_icon-translate-x"]||r.properties["icon_icon_properties_icon-translate-y"])&&(r.properties.icon_icon_properties_offset_array=[parseFloat(r.properties["icon_icon_properties_icon-translate-x"]),parseFloat(r.properties["icon_icon_properties_icon-translate-y"])]);return r}assignToProperty(t,e,r,i){if("object"==typeof e[r])for(var o in e[r])this.assignToProperty(t,e[r],o,i?i+"_"+r:r);else{var n=i?i+"_"+r:r;t.properties[n]=e[r]}}getLayerType(t,e){if("line"===t)return"line";if("polygon"===t){if(!e.polygon_style||"fill"===e.polygon_style)return"fill";if("fill-extrusion"===e.polygon_style)return"fill-extrusion"}if("location"===t){if("circle"===e.location_style)return"circle";if("label"===e.location_style)return"symbol"}}}class MapsterCore{constructor(){}setDataLayers(){}getPostData({post_id:t,single_feature_id:e}){const r=new MapsterHelpers;let i=e?`&single_feature_id=${e}`:"";return fetch(`${window.mapster_params.rest_url}mapster-wp-maps/map${window.mapster_params.qd}id=${t}${i}`).then((t=>t.json())).then((t=>r.formatResponse(t)))}getFeaturesAdmin({locations_ids:t,lines_ids:e,polygons_ids:r,cats:i}){const o=t.concat(e.concat(r));return fetch(`${window.mapster_params.rest_url}mapster-wp-maps/features${window.mapster_params.qd}ids=${JSON.stringify(o)}&categories=${JSON.stringify(i)}`).then((t=>t.json()))}sortLocations({adminFeatures:t}){return t.filter((t=>t.data.location))}sortLines({adminFeatures:t}){return t.filter((t=>t.data.line))}sortPolygons({adminFeatures:t}){return t.filter((t=>t.data.polygon))}doClustering({map:t,map_provider:e,cluster_options:r,circle_clustering:i,label_icon_clustering:o,marker_clustering:n,markers:a,locations:s,lines:l,polygons:u,idsToHide:p}){return(new MapsterHelpers).setClustering(t,e,r,i,o,n,a,s,l,u,p)}loadCustomScripts({map:t,javascript:e,locations:r,lines:i,polygons:o}){e&&window[e]&&(0,window[e])(t,r.concat(i.concat(o)))}setMapStyle({map:t,map_type:e}){const r=new MapsterHelpers;"custom-image"===e.map_provider?r.setCustomImageMap(t,e,!0):e.custom_style_json&&""!==e.custom_style_json?t.setStyle(JSON.parse(e.custom_style_json)):t.setStyle(r.getStyle(e))}loadProjection({map:t,map_provider:e,projection:r}){"mapbox"===e&&t.setProjection({name:r,center:[0,30],parallels:[30,30]})}loadTerrain({map:t,map_provider:e,terrain:r}){if("mapbox"===e)if(r){if(!t.getSource("mapbox-mapster-dem")){t.addSource("mapbox-mapster-dem",{type:"raster-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1",tileSize:512,maxzoom:14});t.setTerrain({source:"mapbox-mapster-dem",exaggeration:1.5});t.addLayer({id:"sky",type:"sky",paint:{"sky-type":"atmosphere","sky-atmosphere-sun":[0,0],"sky-atmosphere-sun-intensity":15}})}}else{t.getLayer("sky")&&t.removeLayer("sky");t.setTerrain(null);t.getSource("mapbox-mapster-dem")&&t.removeSource("mapbox-mapster-dem")}}layerClick({map:t,interactivity:e,clickedEvent:r,locations:i,lines:o,polygons:n}){if(e){let e=r.point?r.point:t.project(r.lngLat);var a=t.queryRenderedFeatures(e).filter((t=>["symbol","line","fill","circle"].indexOf(t.source.split("-")[0])>-1));return!(!a[0]||"fill"===a[0].layer.id&&("fill"!==a[0].layer.id||0===a[0].layer.paint["fill-opacity"]))&&i.concat(o.concat(n)).find((t=>t.id===a[0].properties.post_id))}return!1}storeLocatorClick({clickedFeature:t,store_locator_options:e}){const r=new MapsterHelpers;t&&t.data.enable_popup&&("click"===t.data.interaction||r.isMobile()&&t.data.click_on_mobile)&&r.openStoreLocatorClick(e,t.id)}sidebarClick({post_id:t,clickedFeature:e,minimum_sidebar_width:r,maximum_sidebar_width:i,store_locator_options:o,open_popups_in_sidebar:n}){const a=new MapsterHelpers;e&&e.data.enable_popup&&("click"===e.data.interaction||a.isMobile()&&e.data.click_on_mobile)&&a.openSidebarClick(o,n,e,r,i,t)}externalClickLayer({clickedFeature:t}){(new MapsterHelpers).openExternalLink(t)}externalClickMarker({clickedMarker:t}){(new MapsterHelpers).openExternalLink(t)}popupClick({map:t,mapLibrary:e,clickedPopup:r,clickedFeature:i,clickedEvent:o,store_locator_options:n,open_popups_in_sidebar:a}){const s=new MapsterHelpers;if(i&&i.data.enable_popup&&("click"===i.data.interaction||s.isMobile()&&i.data.click_on_mobile))return s.openPopup(t,e,r,i,o.lngLat,n,a)}layerHover({map:t,interactivity:e,hoveredEvent:r,locations:i,lines:o,polygons:n}){if(e){var a=t.queryRenderedFeatures(r.point).filter((t=>["symbol","line","fill","circle"].indexOf(t.source.split("-")[0])>-1));return!(!a[0]||"fill"===a[0].layer.id&&("fill"!==a[0].layer.id||0===a[0].layer.paint["fill-opacity"]))&&i.concat(o.concat(n)).find((t=>t.id===a[0].properties.post_id))}return!1}layerHoverEffect({map:t,interactivity:e,hoveredFeature:r}){const i=new MapsterHelpers;i.changeCursor(t,r,"on"); }popupHover({map:t,mapLibrary:e,hoveredPopup:r,hoveredFeature:i,hoveredEvent:o,store_locator_options:n}){const a=new MapsterHelpers;if(i&&i.data.enable_popup&&"hover"===i.data.interaction&&(!a.isMobile()||a.isMobile()&&i.data.click_on_mobile))return a.openPopup(t,e,r,i,o.lngLat,n)}markerClick({interactivity:t,clickedMarker:e}){return!!t&&e.mapsterProperties}markerHover({interactivity:t,hoveredMarker:e}){return!!t&&e.mapsterProperties}markerHoverEffect({map:t,mapLibrary:e,interactivity:r,hoveredMarker:i}){ }openMarkerClickPopup({map:t,mapLibrary:e,clickedMarker:r,clickedFeature:i,clickedPopup:o,store_locator_options:n,open_popups_in_sidebar:a}){const s=new MapsterHelpers;if(!n.enable&&!a&&i&&i.data.enable_popup&&("click"===i.data.interaction||s.isMobile()&&i.data.click_on_mobile)&&i.data.popup_style){const o=new e.Popup(s.returnPopupOptions(i.data));o.setHTML(s.getPopupHTML(i.id,i.data));s.centerPopup(t,o,i);r.setPopup(o)}}openMarkerHoverPopup({map:t,mapLibrary:e,hoveredMarker:r,hoveredFeature:i}){const o=new MapsterHelpers;if(i&&i.data.enable_popup&&"hover"===i.data.interaction&&!o.isMobile()&&i.data.popup_style&&!r.getPopup()){const n=new e.Popup(o.returnPopupOptions(i.data));n.setHTML(o.getPopupHTML(i.id,i.data));o.centerPopup(t,n,i);r.setPopup(n).togglePopup()}}markerHoverEffectOff({tempHoverMarker:t,hoveredMarker:e}){ }removeMarkerHoverPopup({hoveredMarker:t,hoveredFeature:e}){const r=new MapsterHelpers;e&&e.data.enable_popup&&"hover"===e.data.interaction&&!r.isMobile()&&(t&&!e.data.keep_popup_open_on_hover?t.setPopup(null):t&&e.data.keep_popup_open_on_hover&&jQuery(document).on("mousemove.mapster",(function(t){let i=jQuery(`.mapster-feature-popup-${e.id}`).closest(".mapboxgl-popup");r.mouseIsNear(i,2,t)?i.one("mouseleave",(function(){jQuery(document).off("mousemove.mapster")})):jQuery(document).off("mousemove.mapster")})))}layerHoverEffectOff({map:t,interactivity:e,hoveredFeature:r}){const i=new MapsterHelpers;i.changeCursor(t,r,"off"); }removePopupHover({hoveredFeature:t,hoveredPopup:e}){e&&!t.data.keep_popup_open_on_hover?e.remove():e&&t.data.keep_popup_open_on_hover&&jQuery(document).one("mousemove",(function(r){let i=jQuery(`.mapster-feature-popup-${t.id}`).closest(".mapboxgl-popup:hover");i.length?i.one("mouseleave",(function(){e.remove()})):e.remove()}))}setInteractivity({map:t,zoom_on_scroll:e,interactivity:r,allow_rotation_and_pitch:i}){e||t.scrollZoom.disable();if(!r){t.scrollZoom.disable();t.boxZoom.disable();t.dragRotate.disable();t.dragPan.disable();t.keyboard.disable();t.doubleClickZoom.disable();t.touchZoomRotate.disable()}if(r&&!i){t.dragRotate.disable();t.touchZoomRotate.disable()}}setFeaturesToMap({map:t,map_provider:e,locations:r,lines:i,polygons:o}){const n=new MapsterHelpers;[["line","line"],["polygon","fill"],["polygon","fill-extrusion"],["location","circle"],["location","symbol"],["location","3d-model"]].forEach((a=>{var s=n.createLayerGeoJSON(t,a[0],a[1],r,i,o);if("3d-model"!==a[1])if(t.getSource(a[1])){t.getSource(a[1]).setData(s);n.addIcons(t,a[1],s)}else{t.addSource(a[1],{type:"geojson",data:s});var l=n.getLayerExpressions(a[0],a[1],e);t.addLayer({id:a[1],source:a[1],type:a[1],paint:l.paint,layout:l.layout});n.addIcons(t,a[1],s)}else n.create3DModels(t,r)}))}setMarkersToMap({map:t,markers:e,mapLibrary:r,locations:i,marker_clustering:o}){const n=new MapsterHelpers;let a=[];e.forEach((t=>{i.find((e=>e.id===t.id))?a.push(t):t.remove()}));let s=[];s=s.concat(a);const l=i.filter((t=>"marker"===t.data.location_style));let u=[];l.sort(((t,e)=>{if(t.data.location.coordinates&&e.data.location.coordinates)return t.data.location.coordinates[1]>e.data.location.coordinates[1]?-1:1;if(!t.data.location.coordinates&&-1===u.indexOf(t.title)){alert(`A point is missing coordinates. See ${t.title}.`);u.push(t.title)}if(!e.data.location.coordinates&&-1===u.indexOf(e.title)){alert(`A point is missing coordinates. See ${e.title}.`);u.push(e.title)}}));l.forEach((e=>{if(!a.find((t=>t.mapsterProperties.id===e.id))){var i=n.getMarkerStyles(e),l=n.makeFeatureJSON(e.data).features[0].geometry.coordinates,u=new r.Marker(i).setLngLat(l);u.mapsterProperties=e;o||u.addTo(t);s.push(u);e.data.open_popup_on_load&&setTimeout((()=>{jQuery(u.getElement()).click()}),100)}}));return s}setHeatmap({map:t,mapLibrary:e,markers:r,locations:i,heatmap:o}){ }setMapSize({post_id:t,layout:e}){var r="#mapster-wp-maps-"+t;const i=new MapsterHelpers;if(!e.full_page){jQuery(r).height(e.height+e.height_units);jQuery(r).width(e.width+e.width_units);i.setMapBreakpointSizes(t,e)}if(e.full_page){jQuery(r).height(window.innerHeight+e.height_units);jQuery(r).width("100%")}if(e.full_page&&e.ignore_container){jQuery(`
    `).insertAfter(r);jQuery(r).css("marginLeft",-1*jQuery(r).offset().left+"px");jQuery(r).width(window.innerWidth+"px");jQuery(r).css("position","absolute")}}setMapMoveEndVariables({map:t}){jQuery('.acf-field[data-name="manual_pitch"]').find(".acf-label label").html(`Manual Pitch (currently: ${t.getPitch()})`);jQuery('.acf-field[data-name="manual_zoom"]').find(".acf-label label").html(`Manual Zoom (currently: ${t.getZoom()})`);jQuery('.acf-field[data-name="manual_rotation"]').find(".acf-label label").html(`Manual Rotation (currently: ${t.getBearing()})`);const{lng:e,lat:r}=t.getCenter();jQuery('.acf-field[data-name="manual_latitude"]').find(".acf-label label").html(`Manual Latitude (currently: ${r})`);jQuery('.acf-field[data-name="manual_longitude"]').find(".acf-label label").html(`Manual Longitude (currently: ${e})`)}setDefaultAccessToken(){""===jQuery('.acf-field[data-name="access_token"]').find(":input").val()&&jQuery('.acf-field[data-name="access_token"]').find(":input").val(window.mapster_params.mapbox_access_token)}setMapType({map_type:t}){if("mapbox"!==t.map_provider){""!==t.access_token&&(maplibregl.accessToken=t.access_token);return maplibregl}if(""!==t.access_token){mapboxgl.accessToken=t.access_token;return mapboxgl}window.alert(window.mapster_params.strings["Mapbox Token Warning"])}setSubmissionModal({post_id:t,map:e,mapLibrary:r,submission:i}){const o=new MapsterHelpers;jQuery(document).on("click",`#mapster-submit-${t}`,(function(){const n=jQuery(this).data("type"),a=jQuery(this).data("header");jQuery(`.mapster-submit-${t} .mapster-submission-modal-title`).text(a);jQuery(`.mapster-submit-${t} #mapster-submission-modal-overlay-${t}`).parent().detach().appendTo("body");jQuery(`.mapster-submit-${t} #mapster-submission-modal-${t}`).parent().detach().appendTo("body");i.submission_interface.categories.length>0?fetch(`${window.mapster_params.rest_url}mapster-wp-maps/submission-info${window.mapster_params.qd}categories=${i.submission_interface.categories.join(",")}`).then((t=>t.json())).then((a=>{o.loadModalSteps(t,e,r,n,a,i)})):o.loadModalSteps(t,e,r,n,!1,i)}));jQuery(document).on("click",".mapster-submission-modal-close",(function(){jQuery(".mapster-submission-modal-overlay").fadeOut(50);jQuery(".mapster-submission-modal").fadeOut(100)}))}setMap({post_id:t,mapLibrary:e,map:r,locations:i,lines:o,polygons:n}){var a="mapster-wp-maps-"+t;const s=new MapsterHelpers;let l=!0,u="manual"===r.view.initial_load?[parseFloat(r.view.manual_longitude),parseFloat(r.view.manual_latitude)]:s.getDefaultCenter();if(jQuery(`#${a}`).data("latitude")&&"null"!==jQuery(`#${a}`).data("latitude")&&jQuery(`#${a}`).data("longitude")&&"null"!==jQuery(`#${a}`).data("longitude")){u=[parseFloat(jQuery(`#${a}`).data("longitude")),parseFloat(jQuery(`#${a}`).data("latitude"))];l=!1}let p="manual"===r.view.initial_load?parseFloat(r.view.manual_zoom):s.getDefaultZoom();if(jQuery(`#${a}`).data("zoom")&&"null"!==jQuery(`#${a}`).data("zoom")){p=parseFloat(jQuery(`#${a}`).data("zoom"));l=!1}const c={renderWorldCopies:r.layout.duplicate_horizontally,style:s.getStyle(r.map_type),container:a,fitBoundsOptions:{padding:20,maxZoom:18},projection:{name:r.map_type.projection?r.map_type.projection:"mercator",center:[0,30],parallels:[30,30]},bounds:"fit-features"===r.view.initial_load&&l?s.getMapBounds(i,o,n):null,center:u,zoom:p,pitch:r.view.manual_pitch?parseFloat(r.view.manual_pitch):0,bearing:r.view.manual_rotation?parseFloat(r.view.manual_rotation):0,attributionControl:!1,logoPosition:r.logo_control?r.logo_control.position:"bottom-left"};if("1"===window.mapster_params.activated&&r.restricted_movement.restrict_movement){let t=r.restricted_movement.allowed_bounds.southwest_longitude,e=r.restricted_movement.allowed_bounds.southwest_latitude,i=r.restricted_movement.allowed_bounds.northeast_longitude,o=r.restricted_movement.allowed_bounds.northeast_latitude;if(""!==t&&""!==e&&""!==i&&""!==o){let r=[[parseFloat(t),parseFloat(e)],[parseFloat(i),parseFloat(o)]];c.maxBounds=r}let n=r.restricted_movement.allowed_zoom.min_zoom;""!==n&&(c.minZoom=parseFloat(n));let a=r.restricted_movement.allowed_zoom.max_zoom;""!==a&&(c.maxZoom=parseFloat(a))}const h=new e.Map(c);r.map_type.custom_style_json&&""!==r.map_type.custom_style_json&&h.setStyle(JSON.parse(r.map_type.custom_style_json));"custom-image"===r.map_type.map_provider&&s.setCustomImageMap(h,r.map_type);r.map_compare&&r.map_compare.enable_map_slider&&r.map_compare.compared_map&&s.setMapCompare(e,h,t,r.map_compare);window[`mapsterMap${t}`]=h;s.setProjectionGlobe(h,r.map_type);jQuery(".mapster-wp-maps-loader-container").hide();return h}setLoader({post_id:t}){const e=new MapsterConstants;jQuery("#mapster-wp-maps-"+t).append(e.loaderHTML())}setLoaderDone({post_id:t}){jQuery("#mapster-wp-maps-"+t+" .mapster-map-loader").fadeOut()}setMapResize({map:t}){t.resize()}setStreetViewControl(){}setMapTypeControl(){}setZoomControl({map:t,mapLibrary:e,controls:r,zoom_control:i}){return(new MapsterHelpers).addMapControl(t,r.zoomControl,i.enable,i.position,e.NavigationControl)}setAttributionControl({map:t,mapLibrary:e,controls:r,attribution_control:i,map_type:o}){}setElevationControl({map:t,mapLibrary:e,controls:r,elevation_line_chart:i,post_id:o,lines:n}){ }set3DControl(t){const{map:e,mapLibrary:r,controls:i}=t;return(new MapsterHelpers).addMapControl(e,i["3dControl"],t["3d_control"].enable,t["3d_control"].position,PitchToggle)}setScaleControl({map:t,mapLibrary:e,controls:r,scale_control:i}){return(new MapsterHelpers).addMapControl(t,r.scaleControl,i.enable,i.position,e.ScaleControl)}setGeolocationControl({map:t,mapLibrary:e,controls:r,geolocation_control:i}){const o=new MapsterHelpers,n={showAccuracyCircle:i.show_accuracy_circle,showUserHeading:i.show_user_heading,trackUserLocation:i.show_user_heading||i.track_user_location},a=o.addMapControl(t,r.geolocationControl,i.enable,i.position,e.GeolocateControl,n);o.setGeolocationOnLoad(i);return a}setFullscreenControl({map:t,mapLibrary:e,controls:r,fullscreen_control:i}){return(new MapsterHelpers).addMapControl(t,r.fullscreenControl,i.enable,i.position,e.FullscreenControl)}setGeocoderControl({map:t,mapLibrary:e,controls:r,geocoder_control:i}){const o=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var n={accessToken:e.accessToken,mapboxgl:e,placeholder:i.placeholder};return o.addMapControl(t,r.geocoderControl,i.enable,i.position,MapboxGeocoder,n)}}setDirectionsControl({map:t,mapLibrary:e,controls:r,directions_control:i}){if("undefined"!=typeof MapboxDirections){const n=new MapsterHelpers;var o={accessToken:e.accessToken,mapboxgl:e,unit:i.unit,profile:i.profile,placeholderOrigin:i.placeholderOrigin};return n.addMapControl(t,r.directionsControl,i.enable,i.position,MapboxDirections,o)}}setCustomSearchFilterControl({map:t,mapLibrary:e,controls:r,custom_search_filter:i,locations:o,lines:n,polygons:a,markers:s}){const l=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var u={mapboxgl:e,marker:!1,placeholder:i.placeholder};i.include_geocoder?u.accessToken=e.accessToken:u.localGeocoderOnly=!0;""!==i.limit_results&&(u.countries=i.limit_results);(u=l.applyProSearchFilter(i,u)).localGeocoder=t=>l.searchLocalFeatures(i.search_type,t,o,n,a);const p=l.addMapControl(t,r.customSearchControl,i.enable,i.position,MapboxGeocoder,u);if(p){p.on("result",(({result:t})=>{var r=document.createElement("div");r.innerHTML=t.place_name;jQuery(p._inputEl).val(r.innerHTML);const i=s.find((e=>e.mapsterProperties.id===t.id));i&&i.mapsterProperties.data.enable_popup&&i.setPopup(new e.Popup(l.returnPopupOptions(i.mapsterProperties.data)).setHTML(l.getPopupHTML(i.mapsterProperties.id,i.mapsterProperties.data))).togglePopup()}));return p}}}setFilterDropdownControl({map:t,mapLibrary:e,controls:r,filter_dropdown:i,locations:o,lines:n,polygons:a,markers:s}){const l=new MapsterHelpers;if("undefined"!=typeof MapboxGeocoder){var u={mapboxgl:e,localGeocoderOnly:!0,marker:!1,placeholder:i.placeholder,minLength:0,limit:1e3,localGeocoder:t=>l.searchLocalFeatures("exact-match",t,o,n,a)};const p=l.addMapControl(t,r.filterDropdownControl,i.enable,i.position,MapboxGeocoder,u);if(p){i.enable&&l.modifyDropdown(p);p.on("result",(t=>{const r=s.find((e=>e.mapsterProperties.id===t.result.id));r&&r.mapsterProperties.data.enable_popup&&r.setPopup(new e.Popup(l.returnPopupOptions(r.mapsterProperties.data)).setHTML(l.getPopupHTML(r.mapsterProperties.id,r.mapsterProperties.data))).togglePopup()}))}return p}}setCategoryFilterControl({map:t,mapLibrary:e,controls:r,cluster_options:i,category_filter:o,markers:n,dataLayers:a,locations:s,lines:l,polygons:u,map_provider:p,label_icon_clustering:c,circle_clustering:h,marker_clustering:d}){new MapsterHelpers;const f={functionality:o.functionality,independent_children:o.independent_children,initial_visibility:o.initial_visibility,category_display:o.category_display,checkbox_display:o.checkbox_display,pre_selected_categories:o.pre_selected_categories,additional_filters:o.additional_filters,accordion_layout:o.accordion_layout,excluded_categories:o.excluded_categories,show_number_of_features:o.show_number_of_features};r.categoryFilterControl&&t.removeControl(r.categoryFilterControl);if(o.enable){const e=new CategoryControl(f,i,n,a,s,l,u,p,h,c,d);""!==o.render_in_external_div&&document.getElementById(o.render_in_external_div)?document.getElementById(o.render_in_external_div).appendChild(e.onAdd(t)):t.addControl(e,o.position);return e}return!1}setListControl({map:t,mapLibrary:e,controls:r,list:i,locations:o,lines:n,polygons:a,markers:s}){new MapsterHelpers;r.listControl&&t.removeControl(r.listControl);if(i.enable){const r=new ListControl(i,o,n,a,s,e);t.addControl(r,i.position);return r}return!1}setDownloadControl({map:t,mapLibrary:e,controls:r,download_control:i,locations:o,lines:n,polygons:a}){ }setCustomHTMLControl({map:t,mapLibrary:e,controls:r,custom_html_control:i}){ }setLayerControl({map:t,mapLibrary:e,controls:r,layer_control:i}){ }setStyleControl({map:t,mapLibrary:e,controls:r,style_control:i}){ }setListingPosts({post_id:t,map:e,listing_page:r,locations:i,lines:o,polygons:n}){ }setJqueryEvents(){ }}class MapsterContainer{constructor(t,e,r){this.core={};this.MapsterMap=r;this.post_id=t;this.single_feature_id=e;this.postResponse;this.mapLibrary;this.markers=[];this.controls=[];this.clusterLayers=[];this.clickedEvent;this.clickedFeature;this.clickedPopup;this.clickedMarker;this.hoveredEvent;this.hoveredFeature;this.hoveredPopup;this.hoveredMarker;this.tempHoverMarker;this.map;this.postResponseAdmin;this.adminFeatures;this.dataLayers;this.defineCore()}defineCore(){const t=new MapsterCore;this.core.set_accesstokendefault={args:[],hook:"access_token_set",func:t.setDefaultAccessToken};this.core.define_postResponse={args:["post_id","single_feature_id"],hook:"data_fetched",func:t.getPostData,promise:!0};this.core.set_mapSize={args:["post_id","postResponse.map.layout"],hook:"map_size_set",func:t.setMapSize};this.core.define_mapLibrary={args:["postResponse.map.map_type"],hook:"map_library_set",func:t.setMapType};this.core.set_submissionModal={args:["post_id","map","mapLibrary","postResponse.map.submission"],hook:"submission_modal_initialized",func:t.setSubmissionModal};this.core.define_map={args:["post_id","mapLibrary","postResponse.map","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_set",func:t.setMap};this.core.set_moveendVariables={args:["map"],hook:"map_moveend",func:t.setMapMoveEndVariables};this.core.set_jquery_events={args:[],hook:"jquery_events_set",func:t.setJqueryEvents};this.core.set_loader={args:["post_id"],hook:"loading_icon_started",func:t.setLoader};this.core.set_loaderdone={args:["post_id"],hook:"loading_icon_done",func:t.setLoaderDone};this.core.set_mapresize={args:["map"],hook:"map_resize_set",func:t.setMapResize};this.core.set_listingposts={args:["post_id","map","postResponse.map.listing_page","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_set_listing_posts",func:t.setListingPosts};this.core.define_dataLayers={args:["map","postResponse.map.map_type.map_provider","dataLayers","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_datalayers_set",func:t.setDataLayers,callback:this.MapsterMap.setDataLayerEvents};this.core.set_mapfeatures={args:["map","postResponse.map.map_type.map_provider","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_features_set",func:t.setFeaturesToMap,callback:this.MapsterMap.setLayerEvents};this.core.define_markers={args:["map","markers","mapLibrary","postResponse.locations","postResponse.map.marker_clustering"],hook:"map_markers_set",func:t.setMarkersToMap,callback:this.MapsterMap.setMarkerEvents};this.core.set_heatmap={args:["map","markers","postResponse.locations","postResponse.map.heatmap"],hook:"map_heatmap_set",func:t.setHeatmap};this.core["define_controls.elevationControl"]={args:["map","mapLibrary","controls","postResponse.map.elevation_line_chart","post_id","postResponse.lines"],hook:"elevation_control_set",func:t.setElevationControl};this.core["define_controls.zoomControl"]={args:["map","mapLibrary","controls","postResponse.map.zoom_control"],hook:"zoom_control_set",func:t.setZoomControl};this.core["define_controls.attributionControl"]={args:["map","mapLibrary","controls","postResponse.map.attribution_control","postResponse.map.map_type"],hook:"attribution_control_set",func:t.setAttributionControl};this.core["define_controls.streetViewControl"]={args:["map","mapLibrary","controls","postResponse.map.street_view_control"],hook:"street_view_control_set",func:t.setStreetViewControl};this.core["define_controls.mapTypeControl"]={args:["map","mapLibrary","controls","postResponse.map.map_type_control"],hook:"map_type_control_set",func:t.setMapTypeControl};this.core["define_controls.geocoderControl"]={args:["map","mapLibrary","controls","postResponse.map.geocoder_control"],hook:"geocoder_control_set",func:t.setGeocoderControl};this.core["define_controls.directionsControl"]={args:["map","mapLibrary","controls","postResponse.map.directions_control"],hook:"directions_control_set",func:t.setDirectionsControl};this.core["define_controls.3dControl"]={args:["map","mapLibrary","controls","postResponse.map.3d_control"],hook:"3d_control_set",func:t.set3DControl};this.core["define_controls.scaleControl"]={args:["map","mapLibrary","controls","postResponse.map.scale_control"],hook:"scale_control_set",func:t.setScaleControl};this.core["define_controls.geolocationControl"]={args:["map","mapLibrary","controls","postResponse.map.geolocation_control"],hook:"geolocation_control_set",func:t.setGeolocationControl};this.core["define_controls.fullscreenControl"]={args:["map","mapLibrary","controls","postResponse.map.fullscreen_control"],hook:"fullscreen_control_set",func:t.setFullscreenControl};this.core["define_controls.downloadControl"]={args:["map","mapLibrary","controls","postResponse.map.download_control","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"download_control_set",func:t.setDownloadControl};this.core["define_controls.customHTMLControl"]={args:["map","mapLibrary","controls","postResponse.map.custom_html_control"],hook:"custom_html_control_set",func:t.setCustomHTMLControl};this.core["define_controls.layerControl"]={args:["map","mapLibrary","controls","postResponse.map.layer_control"],hook:"layer_control_set",func:t.setLayerControl};this.core["define_controls.styleControl"]={args:["map","mapLibrary","controls","postResponse.map.style_control"],hook:"style_control_set",func:t.setStyleControl};this.core["define_controls.customSearchControl"]={args:["map","mapLibrary","controls","postResponse.map.filter.custom_search_filter","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"customSearch_control_set",func:t.setCustomSearchFilterControl};this.core["define_controls.filterDropdownControl"]={args:["map","mapLibrary","controls","postResponse.map.filter.filter_dropdown","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"filterDropdown_control_set",func:t.setFilterDropdownControl};this.core["define_controls.categoryFilterControl"]={args:["map","mapLibrary","controls","postResponse.map.cluster_options","postResponse.map.filter.category_filter","markers","dataLayers","postResponse.locations","postResponse.lines","postResponse.polygons","postResponse.map.map_type.map_provider","postResponse.map.circle_clustering","postResponse.map.label_icon_clustering","postResponse.map.marker_clustering"],hook:"categoryFilter_control_set",func:t.setCategoryFilterControl};this.core["define_controls.listControl"]={args:["map","mapLibrary","controls","postResponse.map.list","postResponse.locations","postResponse.lines","postResponse.polygons","markers"],hook:"list_control_set",func:t.setListControl};this.core.define_clusterLayers={args:["map","postResponse.map.map_type.map_provider","postResponse.map.cluster_options","postResponse.map.circle_clustering","postResponse.map.label_icon_clustering","postResponse.map.marker_clustering","markers","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"map_clustering_set",func:t.doClustering,callback:this.MapsterMap.setDynamicLayerEvents};this.core.set_customscripts={args:["map","postResponse.map.javascript","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"custom_scripts_set",func:t.loadCustomScripts};this.core.set_interactivity={args:["map","postResponse.map.zoom_on_scroll","postResponse.map.interactivity","postResponse.map.allow_rotation_and_pitch"],hook:"interactivity_set",func:t.setInteractivity};this.core.set_mapstyle={args:["map","postResponse.map.map_type"],hook:"map_style_set",func:t.setMapStyle,callback:this.MapsterMap.idleReload};this.core.set_terrain={args:["map","postResponse.map.map_type.map_provider","postResponse.map.map_type.terrain"],hook:"map_terrain_set",func:t.loadTerrain};this.core.set_projection={args:["map","postResponse.map.map_type.map_provider","postResponse.map.map_type.projection"],hook:"map_projection_set",func:t.loadProjection};this.core.define_clickedFeature={args:["map","postResponse.map.interactivity","clickedEvent","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"layer_feature_clicked",func:t.layerClick};this.core.set_storelocatorclick={args:["clickedFeature","postResponse.map.list.store_locator_options"],hook:"",func:t.storeLocatorClick};this.core.set_sidebarclick={args:["post_id","clickedFeature","postResponse.map.minimum_sidebar_width","postResponse.map.maximum_sidebar_width","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"",func:t.sidebarClick};this.core.define_clickedPopup={args:["map","mapLibrary","clickedPopup","clickedFeature","clickedEvent","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_layer_click",func:t.popupClick};this.core.define_hoveredFeature={args:["map","postResponse.map.interactivity","hoveredEvent","postResponse.locations","postResponse.lines","postResponse.polygons"],hook:"layer_feature_hovered",func:t.layerHover};this.core.set_hoverEffects={args:["map","postResponse.map.interactivity","hoveredFeature","dataLayers"],hook:"",func:t.layerHoverEffect};this.core.define_hoveredPopup={args:["map","mapLibrary","hoveredPopup","hoveredFeature","hoveredEvent","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_layer_hover",func:t.popupHover};this.core.set_hoverEffectsOff={args:["map","postResponse.map.interactivity","hoveredFeature","dataLayers"],hook:"",func:t.layerHoverEffectOff};this.core.set_hoveredPopupOff={args:["hoveredFeature","hoveredPopup"],hook:"popup_closed_from_layer_hover",func:t.removePopupHover};this.core.set_externallink={args:["clickedFeature"],hook:"external_link_opened",func:t.externalClickLayer};this.core.define_clickedFeature_fromMarker={args:["clickedMarker","postResponse.map.interactivity"],hook:"marker_feature_clicked",func:t.markerClick};this.core.define_hoveredFeature_fromMarker={args:["hoveredMarker","postResponse.map.interactivity"],hook:"marker_feature_hovered",func:t.markerHover};this.core.define_tempHoverMarker={args:["map","mapLibrary","postResponse.map.interactivity","hoveredMarker"],hook:"",func:t.markerHoverEffect};this.core.define_clickedPopup_fromMarker={args:["map","mapLibrary","clickedMarker","clickedFeature","clickedPopup","postResponse.map.list.store_locator_options","postResponse.map.open_popups_in_sidebar"],hook:"popup_opened_from_marker_click",func:t.openMarkerClickPopup};this.core.define_hoveredPopup_fromMarker={args:["map","mapLibrary","hoveredMarker","hoveredFeature","hoveredPopup"],hook:"popup_opened_from_marker_hover",func:t.openMarkerHoverPopup};this.core.set_hoverEffectsOff_fromMarker={args:["tempHoverMarker","hoveredMarker"],hook:"",func:t.markerHoverEffectOff};this.core.set_hoveredPopupOff_fromMarker={args:["hoveredMarker","hoveredFeature","hoveredPopup"],hook:"popup_closed_from_marker_hover",func:t.removeMarkerHoverPopup};this.core.define_adminFeatures={args:["postResponseAdmin.locations_ids","postResponseAdmin.lines_ids","postResponseAdmin.polygons_ids","postResponse.cats"],hook:"",func:t.getFeaturesAdmin,promise:!0};this.core["define_postResponse.locations"]={args:["adminFeatures"],hook:"locations_fetched",func:t.sortLocations};this.core["define_postResponse.lines"]={args:["adminFeatures"],hook:"lines_fetched",func:t.sortLines};this.core["define_postResponse.polygons"]={args:["adminFeatures"],hook:"polygons_fetched",func:t.sortPolygons}}doCore(t){let e=this.core[t].args,r=this.core[t].func,i={};for(var o=0;o{this.defineThisObject(t,e);this.core[t].callback&&this.core[t].callback(this,this.MapsterMap);this.core[t].hook&&this.MapsterMap.runHookActions(t,e)}));{const e=r(i);this.defineThisObject(t,e);this.core[t].callback&&this.core[t].callback(this,this.MapsterMap);this.core[t].hook&&this.MapsterMap.runHookActions(t,e);return e}}registerListener(t,e,r,i){this.setStarterValue(t,e,r);jQuery(document).on("change","select"!==e?t:t.replace("select",":input"),(()=>{"check"===e&&this.setObjectProperty(this,r,jQuery(t).is(":checked"));"val"===e&&this.setObjectProperty(this,r,jQuery(t).val());"select"===e&&this.setObjectProperty(this,r,jQuery(t).select2("data").map((t=>t.id)));if(i&&i.length>0)for(var o=0;o{for(var t=o+1;tt.id)))}defineThisObject(t,e){t.indexOf("define_")>-1&&this.setObjectProperty(this,t.split("_")[1],e)}getObjectProperty(t,e){return e.split(".").reduce(((t,e)=>t?.[e]),t)}setObjectProperty(t,e,r){e.split(".").reduce(((t,i)=>{i===e.split(".")[e.split(".").length-1]&&(t[i]=r);void 0===t[i]&&(i===e.split(".")[e.split(".").length-1]?t[i]="":t[i]={});return t?.[i]}),t)}}class MapsterMap{constructor(t,e,r){this.MapsterContainer=new MapsterContainer(t,r,this);this.post_id=t;this.isPublic=e;this.dynamicLayerListenersSet=!1;this.isPublic||this.registerAdminEventListeners()}preInitMap(){return this.isPublic?this.doCoreAndRunActions("define_postResponse"):this.doCoreAndRunActions("define_adminFeatures")}init(){this.preInitMap().then((()=>{if(!this.isPublic){this.doCoreAndRunActions("set_accesstokendefault");this.doCoreAndRunActions("define_postResponse.locations");this.doCoreAndRunActions("define_postResponse.lines");this.doCoreAndRunActions("define_postResponse.polygons")}this.initMap();this.MapsterContainer.map.on("load",(()=>{this.postLoad();this.setMoveEvents(this.MapsterContainer.map)}));this.MapsterContainer.map.on("mapster_custom_style_load",(()=>{this.postStyleSwitch(this.MapsterContainer,this)}))}))}initMap(){this.isPublic&&this.doCoreAndRunActions("set_mapSize");this.doCoreAndRunActions("define_mapLibrary");this.doCoreAndRunActions("define_map");this.doCoreAndRunActions("set_jquery_events");this.doCoreAndRunActions("set_loader");if(this.isPublic){this.doCoreAndRunActions("set_submissionModal");this.doCoreAndRunActions("set_interactivity");this.doCoreAndRunActions("set_listingposts")}}postLoad(){this.doCoreAndRunActions("set_mapresize");this.doCoreAndRunActions("set_terrain");this.doCoreAndRunActions("set_mapfeatures");this.doCoreAndRunActions("define_dataLayers");this.doCoreAndRunActions("define_markers");this.doCoreAndRunActions("set_heatmap");this.setControls();this.isPublic&&this.doCoreAndRunActions("define_clusterLayers");this.doCoreAndRunActions("set_loaderdone");this.doCoreAndRunActions("set_customscripts")}setControls(){this.doCoreAndRunActions("define_controls.zoomControl");this.doCoreAndRunActions("define_controls.mapTypeControl");this.doCoreAndRunActions("define_controls.streetViewControl");this.doCoreAndRunActions("define_controls.attributionControl");this.doCoreAndRunActions("define_controls.geocoderControl");this.doCoreAndRunActions("define_controls.directionsControl");this.doCoreAndRunActions("define_controls.3dControl");this.doCoreAndRunActions("define_controls.scaleControl");this.doCoreAndRunActions("define_controls.geolocationControl");this.doCoreAndRunActions("define_controls.fullscreenControl");this.doCoreAndRunActions("define_controls.downloadControl");this.doCoreAndRunActions("define_controls.customHTMLControl");this.doCoreAndRunActions("define_controls.layerControl");this.doCoreAndRunActions("define_controls.styleControl");this.doCoreAndRunActions("define_controls.customSearchControl");this.doCoreAndRunActions("define_controls.filterDropdownControl");this.doCoreAndRunActions("define_controls.categoryFilterControl");this.doCoreAndRunActions("define_controls.elevationControl");this.doCoreAndRunActions("define_controls.listControl")}idleReload(t,e){t.map.once("idle",(()=>{e.doCoreAndRunActions("set_loader");e.doCoreAndRunActions("set_terrain");e.doCoreAndRunActions("set_mapfeatures");e.doCoreAndRunActions("define_dataLayers");e.doCoreAndRunActions("define_markers");e.doCoreAndRunActions("define_clusterLayers");e.doCoreAndRunActions("set_loaderdone")}))}postStyleSwitch(t,e){t.map.once("idle",(()=>{e.doCoreAndRunActions("set_terrain");e.doCoreAndRunActions("set_mapfeatures");e.doCoreAndRunActions("define_dataLayers");e.doCoreAndRunActions("define_markers");e.doCoreAndRunActions("define_clusterLayers")}))}setLayerEvents(t,e){["symbol","circle","line","fill"].forEach((r=>{t.map.on("click",r,(r=>{t.clickedEvent=r;e.doCoreAndRunActions("define_clickedFeature");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup")}));t.map.on("mousemove",r,(r=>{t.hoveredEvent=r;e.doCoreAndRunActions("define_hoveredFeature");e.doCoreAndRunActions("set_hoverEffects");e.doCoreAndRunActions("define_hoveredPopup")}));t.map.on("mouseout",r,(t=>{e.doCoreAndRunActions("set_hoverEffectsOff");e.doCoreAndRunActions("set_hoveredPopupOff")}))}))}setDynamicLayerEvents(t,e){if(t.clusterLayers.length>0&&!this.dynamicLayerListenersSet){t.clusterLayers.forEach((r=>{if(r.indexOf("-")>-1){t.map.on("click",r,(r=>{t.clickedEvent=r;e.doCoreAndRunActions("define_clickedFeature");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup")}));t.map.on("mousemove",r,(r=>{t.hoveredEvent=r;e.doCoreAndRunActions("define_hoveredFeature");e.doCoreAndRunActions("set_hoverEffects");e.doCoreAndRunActions("define_hoveredPopup")}));t.map.on("mouseout",r,(t=>{e.doCoreAndRunActions("set_hoverEffectsOff");e.doCoreAndRunActions("set_hoveredPopupOff")}))}}));this.dynamicLayerListenersSet=!0}}setDataLayerEvents(t,e){}setMarkerEvents(t,e){t.markers.forEach((r=>{r.getElement().addEventListener("click",(()=>{t.clickedMarker=r;e.doCoreAndRunActions("define_clickedFeature_fromMarker");e.doCoreAndRunActions("set_storelocatorclick");e.doCoreAndRunActions("set_sidebarclick");e.doCoreAndRunActions("set_externallink");e.doCoreAndRunActions("define_clickedPopup_fromMarker")}));r.getElement().addEventListener("mouseenter",(i=>{t.hoveredMarker=r;e.doCoreAndRunActions("define_hoveredFeature_fromMarker");e.doCoreAndRunActions("define_tempHoverMarker");e.doCoreAndRunActions("define_hoveredPopup_fromMarker")}));r.getElement().addEventListener("mouseleave",(t=>{e.doCoreAndRunActions("set_hoverEffectsOff_fromMarker");e.doCoreAndRunActions("set_hoveredPopupOff_fromMarker")}))}))}setMoveEvents(t){if(!this.isPublic){t.once("idle",(t=>{this.doCoreAndRunActions("set_moveendVariables")}));t.on("moveend",(t=>{this.doCoreAndRunActions("set_moveendVariables")}))}}doCoreAndRunActions(t){return this.MapsterContainer.doCore(t)}runHookActions(t,e){if(window.mwm){let i=this.MapsterContainer.core[t].hook;const o=`${i}/mapster-${this.isPublic?this.post_id:"admin"}`;if(window.mwm.actions[o]){window.mwm.actions[o].funcs;if(window.mwm.actions[o].funcs.length>0)for(var r=0;r0)for(r=0;r{if(document.querySelector(n))return t(document.querySelector(n));const e=new MutationObserver((r=>{if(document.querySelector(n)){t(document.querySelector(n));e.disconnect()}}));e.observe(document.body,{childList:!0,subtree:!0})}))).then((e=>{t(".mapster-wp-maps").each((function(){const e=t(this).attr("id").replace("mapster-wp-maps-",""),r=""!==t(this).data("single_feature_id")&&t(this).data("single_feature_id");new MapsterMap(e,window.mapster_params.public,r).init()}))}));else{let a="Publish this post to generate an embed code.";const s=new URLSearchParams(window.location.search);if(s.has("post")){let u=window.mapster_params.directory.replace("/admin/","/admin/includes/mapster-embed-map.php");u=u+window.mapster_params.qd+"map_id="+s.get("post");a=``}let l="Publish this post to generate an listing code.";s.has("post")&&(l=`[mapster_listing_posts id="${s.get("post")}"]`);if(document.body.classList.contains("block-editor-page")){t("#mapster-wp-maps-preview").prependTo("#normal-sortables");t(".acf-field-625df5ebf4ecc .acf-input").text(a);t(".acf-field-6507ba6e3053a .acf-input").text(l)}else{t("#mapster-wp-maps-preview").prependTo("#acf_after_title-sortables");t(".acf-field-625df5ebf4ecc .acf-input").text(a);t(".acf-field-6507ba6e3053a .acf-input").text(l)}if(s.has("post")){let p=`\n [mapster_wp_map_submit map_id="${s.get("post")}" type="create_point"]
    \n [mapster_wp_map_submit map_id="${s.get("post")}" type="edit_point" button_text="Edit Point" header_text="Edit Point"]\n `;t(".acf-field-62bf86b094491 .acf-input").append(p)}var e=acf.getFields().length,r=0,i=0;function o(t){"select"!==t&&(r+=1);r===e&&4===i&&new MapsterMap("map",window.mapster_params.public,!1).init()}acf.add_action("ready_field",o);acf.addAction("select2_init",(function(t,e,r,n){i+=1;o("select")}))}var n}(jQuery);