1function getDistance(t,e,r,i){var n=Math.PI*t/180,o=Math.PI*r/180,a=(Math.PI*e/180,Math.PI*i/180,e-i),s=Math.PI*a/180,l=Math.sin(n)*Math.sin(o)+Math.cos(n)*Math.cos(o)*Math.cos(s);return l=Math.acos(l),l=180*l/Math.PI,l=60*l*1.1515}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.mapboxgl=e()}(this,function(){"use strict";function t(t,n){if(e)if(r){var o="var sharedChunk = {}; ("+e+")(sharedChunk); ("+r+")(sharedChunk);",a={};e(a),i=n(a),i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else r=n;else e=n}var e,r,i;return t(["exports"],function(t){function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function r(t,e){return t(e={exports:{}},e.exports),e.exports}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}function n(t,e){this.x=t,this.y=e}function o(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!o(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var i in t)if(!o(t[i],e[i]))return!1;return!0}return t===e}function a(t,e,r,i){var n=new ii(t,e,r,i);return function(t){return n.solve(t)}}function s(t,e,r){return Math.min(r,Math.max(e,t))}function l(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function u(){return si++}function c(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function h(t,e){return-1!==t.indexOf(e,t.length-e.length)}function p(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function f(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function d(t){return Array.isArray(t)?t.map(d):"object"==typeof t&&t?p(t,d):t}function m(t){li[t]||("undefined"!=typeof console&&console.warn(t),li[t]=!0)}function y(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function v(t){for(var e=0,r=0,i=t.length,n=i-1,o=void 0,a=void 0;r<i;n=r++)o=t[r],e+=((a=t[n]).x-o.x)*(o.y+a.y);return e}function g(t){var e=new self.XMLHttpRequest;for(var r in e.open("GET",t.url,!0),t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}function _(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function x(t,e,r){if(r&&r[t]){var i=r[t].indexOf(e);-1!==i&&r[t].splice(i,1)}}function b(t){var e=t.key,r=t.value;return r?[new yi(e,r,"constants have been deprecated as of v8")]:[]}function w(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o=n[i];for(var a in o)t[a]=o[a]}return t}function E(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function S(t){return Array.isArray(t)?t.map(S):E(t)}function T(t,e){return{kind:"array",itemType:t,N:e}}function z(t){if("array"===t.kind){var e=z(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}function A(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!A(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=Ai;r<i.length;r+=1)if(!A(i[r],e))return null}return"Expected "+z(t)+" but found "+z(e)+" instead."}function M(t,e,r,i){return"number"==typeof t&&t>=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 k(t){if(null===t)return _i;if("string"==typeof t)return bi;if("boolean"==typeof t)return wi;if("number"==typeof t)return xi;if(t instanceof ki)return Ei;if(t instanceof Ii)return zi;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=k(n[i]);if(e){if(e===o)continue;e=Ti;break}e=o}return T(e||Ti,r)}return Si}function I(t){if(t instanceof Ui){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild(function(t){e&&!I(t)&&(e=!1)}),e}function C(t){if(t instanceof Ui&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!C(t)&&(e=!1)}),e}function L(t,e){if(t instanceof Ui&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!L(t,e)&&(r=!1)}),r}function P(t,e){for(var r,i,n=0,o=t.length-1,a=0;n<=o;){if(r=t[a=Math.floor((n+o)/2)],i=t[a+1],e===r||e>r&&e<i)return a;
1if(r<e)n=a+1;else{if(!(r>e))throw new Pi("Input is not a number.");o=a-1}}return Math.max(a-1,0)}function D(t,e,r){return t*(1-r)+e*r}function B(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}function R(t){return"string"===t.kind||"number"===t.kind||"boolean"===t.kind||"null"===t.kind}function O(t,e){return function(){function r(t,e,r){this.type=wi,this.lhs=t,this.rhs=e,this.collator=r}return r.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=e.parse(t[1],1,Ti);if(!i)return null;var n=e.parse(t[2],2,Ti);if(!n)return null;if(!R(i.type)&&!R(n.type))return e.error("Expected at least one argument to be a string, number, boolean, or null, but found ("+z(i.type)+", "+z(n.type)+") instead.");if(i.type.kind!==n.type.kind&&"value"!==i.type.kind&&"value"!==n.type.kind)return e.error("Cannot compare "+z(i.type)+" and "+z(n.type)+".");var o=null;if(4===t.length){if("string"!==i.type.kind&&"string"!==n.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(o=e.parse(t[3],3,zi)))return null}return new r(i,n,o)},r.prototype.evaluate=function(t){var r=this.collator?0===this.collator.evaluate(t).compare(this.lhs.evaluate(t),this.rhs.evaluate(t)):this.lhs.evaluate(t)===this.rhs.evaluate(t);return e?!r:r},r.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},r.prototype.possibleOutputs=function(){return[!0,!1]},r.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},r}()}function F(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var a=o?o.evaluate(t):1,s=M(r,i,n,a);if(s)throw new Pi(s);return new ki(r/255*a,i/255*a,n/255*a,a)}function V(t,e){return t in e}function N(t,e){var r=e[t];return void 0===r?null:r}function j(t,e){var r=e[0],i=e[1];return r.evaluate(t)<i.evaluate(t)}function U(t,e){var r=e[0],i=e[1];return r.evaluate(t)>i.evaluate(t)}function $(t,e){var r=e[0],i=e[1];return r.evaluate(t)<=i.evaluate(t)}function q(t,e){var r=e[0],i=e[1];return r.evaluate(t)>=i.evaluate(t)}function Z(t){return{type:t}}function G(t){return{result:"success",value:t}}function W(t){return{result:"error",value:t}}function H(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function X(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function K(t){return!!t.expression&&t.expression.interpolated}function Y(t){return t>cn?Math.pow(t,1/3):t/un+sn}function J(t){return t>ln?t*t*t:un*(t-sn)}
1function Q(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function et(t){var e=tt(t.r),r=tt(t.g),i=tt(t.b),n=Y((.4124564*e+.3575761*r+.1804375*i)/nn),o=Y((.2126729*e+.7151522*r+.072175*i)/on);return{l:116*o-16,a:500*(n-o),b:200*(o-Y((.0193339*e+.119192*r+.9503041*i)/an)),alpha:t.a}}function rt(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=on*J(e),r=nn*J(r),i=an*J(i),new ki(Q(3.2404542*r-1.5371385*e-.4985314*i),Q(-.969266*r+1.8760108*e+.041556*i),Q(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function it(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function nt(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ot(t){return t}function at(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function st(t,e,r,i,n){return at(typeof r===n?i[r]:void 0,t["default"],e["default"])}function lt(t,e,r){if("number"!==it(r))return at(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 n=ht(t.stops,r);return t.stops[n][1]}function ut(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==it(r))return at(t["default"],e["default"]);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o=ht(t.stops,r),a=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=Gi[e.type]||ot;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=mn[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.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 ct(t,e,r){return"color"===e.type?r=ki.parse(r):it(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),at(r,t["default"],e["default"])}function ht(t,e){for(var r,i,n=0,o=t.length-1,a=0;n<=o;){if(r=t[a=Math.floor((n+o)/2)][0],i=t[a+1][0],e===r||e>r&&e<i)return a;r<e?n=a+1:r>e&&(o=a-1)}return Math.max(a-1,0)}function pt(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in rn}function ft(t,e){var r=new qi(rn,[],function(t){var e={color:Ei,string:bi,number:xi,"enum":bi,"boolean":wi};return"array"===t.type?T(e[t.value]||Ti,t.length):e[t.type]||null}(e)),i=r.parse(t);return i?G(new yn(i,e)):W(r.errors)}function dt(t,e){if("error"===(t=ft(t,e)).result)return t;var r=t.value.expression,i=I(r);if(!i&&!H(e))return W([new vi("","data expressions not supported")]);var n=L(r,["zoom"]);if(!n&&!X(e))return W([new vi("","zoom expressions not supported")]);var o=function a(t){var e=null;if(t instanceof Xi)e=a(t.result);else if(t instanceof Hi)for(var r=0,i=t.args;r<i.length;r+=1){var n=i[r];if(e=a(n))break}else(t instanceof Zi||t instanceof Wi)&&t.input instanceof Ui&&"zoom"===t.input.name&&(e=t);return e instanceof vi?e:(t.eachChild(function(t){var r=a(t);r instanceof vi?e=r:!e&&r?e=new vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new vi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e)}(r);return o||n?o instanceof vi?W([o]):o instanceof Wi&&!K(e)?W([new vi("",'"interpolate" expressions cannot be used with this property')]):G(o?new gn(i?"camera":"composite",t.value,o):new vn(i?"constant":"source",t.value)):W([new vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}function mt(t,e){if(nt(t))return new _n(t,e);if(pt(t)){var r=dt(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=ki.parse(t)),{kind:"constant",evaluate:function(){return i}}}function yt(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],l=it(r);if("object"!==l)return[new yi(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=i[c]||i["*"],p=void 0;if(n[c])p=n[c];else if(i[c])p=Ft;else if(n["*"])p=n["*"];else{if(!i["*"]){s.push(new yi(e,r[u],'unknown property "'+u+'"'));continue}p=Ft}s=s.concat(p({key:(e?e+".":e)+u,value:r[u],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:u},r))}for(var f in i)n[f]||i[f].required&&void 0===i[f]["default"]&&void 0===r[f]&&s.push(new yi(e,r,'missing required property "'+f+'"'));return s}function vt(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||Ft;if("array"!==it(e))return[new yi(o,e,"array expected, "+it(e)+" found")];if(r.length&&e.length!==r.length)return[new yi(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new yi(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value};n.$version<7&&(s["function"]=r["function"]),"object"===it(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:i,styleSpec:n,key:o+"["+u+"]"}));return l}function gt(t){var e=t.key,r=t.value,i=t.valueSpec,n=it(r);return"number"!==n?[new yi(e,r,"number expected, "+n+" found")]:"minimum"in i&&r<i.minimum?[new yi(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new yi(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function _t(t){function e(t){var e=[],i=t.value,s=t.key;if("array"!==it(i))return[new yi(s,i,"array expected, "+it(i)+" found")];if(2!==i.length)return[new yi(s,i,"array length 2 expected, length "+i.length+" found")];if(h){if("object"!==it(i[0]))return[new yi(s,i,"object expected, "+it(i[0])+" found")];if(void 0===i[0].zoom)return[new yi(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new yi(s,i,"object stop key must have value")];if(o&&o>E(i[0].zoom))return[new yi(s,i[0].zoom,"stop zoom values must appear in ascending order")];E(i[0].zoom)!==o&&(o=E(i[0].zoom),n=void 0,l={}),e=e.concat(yt({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:gt,value:r}}))}else e=e.concat(r({key:s+"[0]",value:i[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},i));return e.concat(Ft({key:s+"[1]",value:i[1],valueSpec:a,style:t.style,styleSpec:t.styleSpec}))}function r(t,e){var r=it(t.value),o=E(t.value),u=null!==t.value?t.value:e;if(i){if(r!==i)return[new yi(t.key,u,r+" stop domain type must match previous stop domain type "+i)]}else i=r;if("number"!==r&&"string"!==r&&"boolean"!==r)return[new yi(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==r&&"categorical"!==s){var c="number expected, "+r+" found";return H(a)&&void 0===s&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new yi(t.key,u,c)]}return"categorical"!==s||"number"!==r||isFinite(o)&&Math.floor(o)===o?"categorical"!==s&&"number"===r&&void 0!==n&&o<n?[new yi(t.key,u,"stop domain values must appear in ascending order")]:(n=o,"categorical"===s&&o in l?[new yi(t.key,u,"stop domain values must be unique")]:(l[o]=!0,[])):[new yi(t.key,u,"integer expected, found "+o)]}var i,n,o,a=t.valueSpec,s=E(t.value.type),l={},u="categorical"!==s&&void 0===t.value.property,c=!u,h="array"===it(t.value.stops)&&"array"===it(t.value.stops[0])&&"object"===it(t.value.stops[0][0]),p=yt({key:t.key,value:t.value,valueSpec:t.styleSpec["function"],style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===s)return[new yi(t.key,t.value,'identity function may not have a "stops" property')];var r=[],i=t.value;return r=r.concat(vt({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:e})),"array"===it(i)&&0===i.length&&r.push(new yi(t.key,i,"array must have at least one stop")),r},"default":function(t){return Ft({key:t.key,value:t.value,valueSpec:a,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===s&&u&&p.push(new yi(t.key,t.value,'missing required property "property"')),"identity"===s||t.value.stops||p.push(new yi(t.key,t.value,'missing required property "stops"')),"exponential"===s&&t.valueSpec.expression&&!K(t.valueSpec)&&p.push(new yi(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!H(t.valueSpec)?p.push(new yi(t.key,t.value,"property functions not supported")):u&&!X(t.valueSpec)&&p.push(new yi(t.key,t.value,"zoom functions not supported"))),"categorical"!==s&&!h||void 0!==t.value.property||p.push(new yi(t.key,t.value,'"property" property is required')),p}function xt(t){var e=("property"===t.expressionContext?dt:ft)(S(t.value),t.valueSpec);return"error"===e.result?e.value.map(function(e){return new yi(""+t.key+e.key,t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new yi(t.key,t.value,'Invalid data expression for "text-font". Output values must be contained as literals within the expression.')]:"property"!==t.expressionContext||"layout"!==t.propertyType||C(e.value._styleExpression.expression)?[]:[new yi(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]}function bt(t){var e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(E(r))&&n.push(new yi(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(E(r))&&n.push(new yi(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function wt(t){if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===t.length&&(Array.isArray(t[1])||Array.isArray(t[2]));case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!wt(i)&&"boolean"!=typeof i)return!1}return!0;default:return!0}}function Et(t){if(!t)return function(){return!0};wt(t)||(t=Tt(t));var e=ft(t,xn);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function St(t,e){return t<e?-1:t>e?1:0}function Tt(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?zt(t[1],t[2],"=="):"!="===r?kt(zt(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?zt(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Tt))):"all"===r?["all"].concat(t.slice(1).map(Tt)):"none"===r?["all"].concat(t.slice(1).map(Tt).map(kt)):"in"===r?At(t[1],t.slice(2)):"!in"===r?kt(At(t[1],t.slice(2))):"has"===r?Mt(t[1]):"!has"!==r||kt(Mt(t[1]))}function zt(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 At(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(St)]]:["filter-in-small",t,["literal",e]]}}function Mt(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function kt(t){return["!",t]}function It(t){return wt(S(t.value))?xt(w({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var r=t.value,i=t.key;if("array"!==it(r))return[new yi(i,r,"array expected, "+it(r)+" found")];var n,o=t.styleSpec,a=[];if(r.length<1)return[new yi(i,r,"filter array must have at least 1 element")];switch(a=a.concat(bt({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:t.style,styleSpec:t.styleSpec})),E(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===E(r[1])&&a.push(new yi(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new yi(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=it(r[1]))&&a.push(new yi(i+"[1]",r[1],"string expected, "+n+" found"));for(var s=2;s<r.length;s++)n=it(r[s]),"$type"===E(r[1])?a=a.concat(bt({key:i+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new yi(i+"["+s+"]",r[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;
1l++)a=a.concat(e({key:i+"["+l+"]",value:r[l],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=it(r[1]),2!==r.length?a.push(new yi(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new yi(i+"[1]",r[1],"string expected, "+n+" found"))}return a}(t)}function Ct(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Ft({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});var u,c=t.valueSpec||s[a];if(!c)return[new yi(r,o,'unknown property "'+a+'"')];if("string"===it(o)&&H(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new yi(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&h.push(new yi(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&nt(S(o))&&"identity"===E(o.type)&&h.push(new yi(r,o,'"text-font" does not support identity functions'))),h.concat(Ft({key:t.key,value:o,valueSpec:c,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function Lt(t){return Ct(t,"paint")}function Pt(t){return Ct(t,"layout")}function Dt(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new yi(i,r,'either "type" or "ref" is required'));var a,s=E(r.type),l=E(r.ref);if(r.id)for(var u=E(r.id),c=0;c<t.arrayIndex;c++){var h=n.layers[c];E(h.id)===u&&e.push(new yi(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new yi(i,r[t],'"'+t+'" is prohibited for ref layers'))}),n.layers.forEach(function(t){E(t.id)===l&&(a=t)}),a?a.ref?e.push(new yi(i,r.ref,"ref cannot reference another ref layer")):s=E(a.type):e.push(new yi(i,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=n.sources&&n.sources[r.source],f=p&&E(p.type);p?"vector"===f&&"raster"===s?e.push(new yi(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new yi(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new yi(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new yi(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new yi(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new yi(i,r.source,'source "'+r.source+'" not found'))}else e.push(new yi(i,r,'missing required property "source"'));return e=e.concat(yt({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Ft({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:It,layout:function(t){return yt({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Pt(w({layerType:s},t))}}})},paint:function(t){return yt({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Lt(w({layerType:s},t))}}})}}}))}function Bt(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new yi(r,e,'"type" is required')];var o=E(e.type),a=[];switch(o){case"vector":case"raster":case"raster-dem":if(a=a.concat(yt({key:r,value:e,valueSpec:i["source_"+o.replace("-","_")],style:t.style,styleSpec:i})),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&a.push(new yi(r+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return a;case"geojson":return yt({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i});case"video":return yt({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return yt({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return a.push(new yi(r,null,"Please use runtime APIs to add canvas sources, rather than
1including them in stylesheets.","source.canvas")),a;default:return bt({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function Rt(t){var e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],a=it(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new yi("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);o=l&&i[l[1]]&&i[l[1]].transition?o.concat(Ft({key:s,value:e[s],valueSpec:r.transition,style:n,styleSpec:r})):i[s]?o.concat(Ft({key:s,value:e[s],valueSpec:i[s],style:n,styleSpec:r})):o.concat([new yi(s,e[s],'unknown property "'+s+'"')])}return o}function Ot(t){var e=t.value,r=t.key,i=it(e);return"string"!==i?[new yi(r,e,"string expected, "+i+" found")]:[]}function Ft(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&nt(E(e))?_t(t):r.expression&&pt(S(e))?xt(t):r.type&&bn[r.type]?bn[r.type](t):yt(w({},t,{valueSpec:r.type?i[r.type]:r}))}function Vt(t){var e=t.value,r=t.key,i=Ot(t);return i.length?i:(-1===e.indexOf("{fontstack}")&&i.push(new yi(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&i.push(new yi(r,e,'"glyphs" url must include a "{range}" token')),i)}function Nt(t,e){e=e||mi;var r=[];return r=r.concat(Ft({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Vt,"*":function(){return[]}}})),t.constants&&(r=r.concat(b({key:"constants",value:t.constants,style:t,styleSpec:e}))),jt(r)}function jt(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function Ut(t){return function(){return jt(t.apply(this,arguments))}}function $t(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1){var o=n[i];t.fire(new fi(new Error(o.message))),r=!0}return r}function qt(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],e=n[1],r=n[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var a=n[An+o],s=n[An+o+1];i.push(a===s?null:n.subarray(a,s))}var l=n[An+i.length],u=n[An+i.length+1];this.keys=n.subarray(l,u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}function Zt(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),kn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}function Gt(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Mn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1){var a=o[n];i.push(Gt(a,e))}return i}if("object"==typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u={};if(s.serialize)u._serialized=s.serialize(t,e);else{for(var c in t)if(t.hasOwnProperty(c)&&!(kn[l].omit.indexOf(c)>=0)){var h=t[c];u[c]=kn[l].shallow.indexOf(c)>=0?h:Gt(h,e)}t instanceof Error&&(u.message=t.message)}return{name:l,properties:u}}throw new Error("can't serialize object of type "+typeof t)}function Wt(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||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Mn)return t;if(Array.isArray(t))return t.map(function(t){return Wt(t)});if("object"==typeof t){var e=t,r=e.name,i=e.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var n=kn[r].klass;if(!n)throw new Error("can't deserialize unregistered class "+r);if(n.deserialize)return n.deserialize(i._serialized);for(var o=Object.create(n.prototype),a=0,s=Object.keys(i);a<s.length;a+=1){var l=s[a];o[l]=kn[r].shallow.indexOf(l)>=0?i[l]:Wt(i[l])}return o}throw new Error("can't deserialize object of type "+typeof t)}function Ht(t){for(var e=0,r=t;e<r.length;e+=1)if(Kt(r[e].charCodeAt(0)))return!0;return!1}function Xt(t){return!(Pn.Arabic(t)||Pn["Arabic Supplement"](t)||Pn["Arabic Extended-A"](t)||Pn["Arabic Presentation Forms-A"](t)||Pn["Arabic Presentation Forms-B"](t))}function Kt(t){return!!(746===t||747===t||!(t<4352)&&(Pn["Bopomofo Extended"](t)||Pn.Bopomofo(t)||Pn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Pn["CJK Compatibility Ideographs"](t)||Pn["CJK Compatibility"](t)||Pn["CJK Radicals Supplement"](t)||Pn["CJK Strokes"](t)||!(!Pn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Pn["CJK Unified Ideographs Extension A"](t)||Pn["CJK Unified Ideographs"](t)||Pn["Enclosed CJK Letters and Months"](t)||Pn["Hangul Compatibility Jamo"](t)||Pn["Hangul Jamo Extended-A"](t)||Pn["Hangul Jamo Extended-B"](t)||Pn["Hangul Jamo"](t)||Pn["Hangul Syllables"](t)||Pn.Hiragana(t)||Pn["Ideographic Description Characters"](t)||Pn.Kanbun(t)||Pn["Kangxi Radicals"](t)||Pn["Katakana Phonet
1ic Extensions"](t)||Pn.Katakana(t)&&12540!==t||!(!Pn["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)||!(!Pn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Pn["Unified Canadian Aboriginal Syllabics"](t)||Pn["Unified Canadian Aboriginal Syllabics Extended"](t)||Pn["Vertical Forms"](t)||Pn["Yijing Hexagram Symbols"](t)||Pn["Yi Syllables"](t)||Pn["Yi Radicals"](t)))}function Yt(t){return!(Kt(t)||function(t){return!!(Pn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Pn["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)||Pn["Letterlike Symbols"](t)||Pn["Number Forms"](t)||Pn["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)||Pn["Control Pictures"](t)&&9251!==t||Pn["Optical Character Recognition"](t)||Pn["Enclosed Alphanumerics"](t)||Pn["Geometric Shapes"](t)||Pn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Pn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Pn["CJK Symbols and Punctuation"](t)||Pn.Katakana(t)||Pn["Private Use Area"](t)||Pn["CJK Compatibility Forms"](t)||Pn["Small Form Variants"](t)||Pn["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 Jt(t,e){return!(!e&&(t>=1424&&t<=2303||Pn["Arabic Presentation Forms-A"](t)||Pn["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||Pn.Khmer(t))}function Qt(t,e){ 2void 0===e&&(e=1);var r=0,i=0;return{members:t.map(function(t){var n,o=(n=t.type,to[n].BYTES_PER_ELEMENT),a=r=te(r,Math.max(e,o)),s=t.components||1;return i=Math.max(i,o),r+=o*s,{name:t.name,type:t.type,components:s,offset:a}}),size:te(r,Math.max(i,e)),alignment:e}}function te(t,e){return Math.ceil(t/e)*e}function ee(t){return[Do(255*t.r,255*t.g),Do(255*t.b,255*t.a)]}function re(t,e){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[t]||t.replace(e+"-","").replace(/-/g,"_")}function ie(t){for(var e=jo/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<Uo.min||a.x>Uo.max||a.y<Uo.min||a.y>Uo.max)&&m("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ne(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}function oe(t,e,r){for(var i=0;i<t.length;i++){var n=t[i];if(de(n,e))return!0;if(he(e,n,r))return!0}return!1}function ae(t,e){if(1===t.length&&1===t[0].length)return fe(e,t[0][0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(fe(t,i[n]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++)if(fe(e,a[s]))return!0;for(var l=0;l<e.length;l++)if(ue(a,e[l]))return!0}return!1}function se(t,e,r){for(var i=0;i<e.length;i++)for(var n=e[i],o=0;o<t.length;o++){var a=t[o];if(a.length>=3)for(var s=0;s<n.length;s++)if(de(a,n[s]))return!0;if(le(a,n,r))return!0}return!1}function le(t,e,r){if(t.length>1){if(ue(t,e))return!0;for(var i=0;i<e.length;i++)if(he(e[i],t,r))return!0}for(var n=0;n<t.length;n++)if(he(t[n],e,r))return!0;return!1}function ue(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var i=t[r],n=t[r+1],o=0;o<e.length-1;o++)if(ce(i,n,e[o],e[o+1]))return!0;return!1}function ce(t,e,r,i){return y(t,r,i)!==y(e,r,i)&&y(t,e,r)!==y(t,e,i)}function he(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++)if(pe(t,e[n-1],e[n])<i)return!0;return!1}function pe(t,e,r){var i=e.distSqr(r);if(0===i)return t.distSqr(e);var n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;return n<0?t.distSqr(e):n>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function fe(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)i=r[s],n=r[l],i.y>e.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function de(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function me(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).binders[t].statistics.max}function ye(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ve(t,e,r,i,n){if(!e[0]&&!e[1])return t;var o=oi.convert(e);"viewport"===r&&o._rotate(-i);for(var a=[],s=0;s<t.length;s++){for(var l=t[s],u=[],c=0;c<l.length;c++)u.push(l[c].sub(o._mult(n)));a.push(u)}return a}function ge(){var t=new Zo(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function _e(){var t=new Zo(3);return t[0]=0,t[1]=0,t[2]=0,t}function xe(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function be(t,e,r){var i=new Zo(3);return i[0]=t,i[1]=e,i[2]=r,i}function we(t,e){var r=e[0],i=e[1],n=e[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function Ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Se(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=n*l-o*s,t[1]=o*a-i*l,t[2]=i*s-n*a,t}function Te(){var t=new Zo(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function ze(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=r*r+i*i+n*n+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=r*a,t[1]=i*a,t[2]=n*a,t[3]=o*a),t}function Ae(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,t}function Me(){var t=new Zo(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}
2function ke(t,e,r){var i=Ae([],[t.x,t.y,0,1],e);return new oi((i[0]/i[3]+1)*r.width*.5,(i[1]/i[3]+1)*r.height*.5)}function Ie(t,e,r,i){var n=e.width,o=e.height;if(i){if(i.length!==n*o*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*o*r);return t.width=n,t.height=o,t.data=i,t}function Ce(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var o=Ie({},{width:i,height:n},r);Le(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=o.data}}function Le(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<n.height;l++)for(var u=((r.y+l)*t.width+r.x)*o,c=((i.y+l)*e.width+i.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return e}function Pe(t,e){for(var r=new Uint8Array(1024),i={},n=0,o=0;n<256;n++,o+=4){i[e]=n/255;var a=t.evaluate(i);r[o+0]=Math.floor(255*a.r/a.a),r[o+1]=Math.floor(255*a.g/a.a),r[o+2]=Math.floor(255*a.b/a.a),r[o+3]=Math.floor(255*a.a)}return new oa({width:256,height:1},r)}function De(t,e,r){r=r||2;var i,n,o,a,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,p=Be(t,0,h,r,!0),f=[];if(!p)return f;if(c&&(p=function(t,e,r,i){var n,o,a,s,l,u=[];for(n=0,o=e.length;n<o;n++)a=e[n]*i,s=n<o-1?e[n+1]*i:t.length,(l=Be(t,a,s,i,!1))===l.next&&(l.steiner=!0),u.push(Ze(l));for(u.sort(Ue),n=0;n<u.length;n++)$e(u[n],r),r=Re(r,r.next);return r}(t,e,p,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var d=r;d<h;d+=r)(s=t[d])<i&&(i=s),(l=t[d+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-i,a-n))?1/u:0}return Oe(p,f,r,i,n,u),f}function Be(t,e,r,i,n){var o,a;if(n===rr(t,e,r,i)>0)for(o=e;o<r;o+=i)a=Qe(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=Qe(o,t[o],t[o+1],a);return a&&Xe(a,a.next)&&(tr(a),a=a.next),a}function Re(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!Xe(i,i.next)&&0!==He(i.prev,i,i.next))i=i.next;else{if(tr(i),(i=e=i.prev)===i.next)break;r=!0}while(r||i!==e);return e}function Oe(t,e,r,i,n,o,a){if(t){!a&&o&&function(t,e,r,i){var n=t;do null===n.z&&(n.z=qe(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,i=r,s=0,e=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1)}(n)}(t,i,n,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?Ve(t,i,n,o):Fe(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),tr(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?Oe(t=Ne(t,e,r),e,r,i,n,o,2):2===a&&je(t,e,r,i,n,o):Oe(Re(t),e,r,i,n,o,1);break}}}function Fe(t){var e=t.prev,r=t,i=t.next;if(He(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(Ge(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&He(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Ve(t,e,r,i){var n=t.prev,o=t,a=t.next;if(He(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=qe(s,l,e,r,i),p=qe(u,c,e,r,i),f=t.prevZ,d=t.nextZ;f&&f.z>=h&&d&&d.z<=p;){if(f!==t.prev&&f!==t.next&&Ge(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&He(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&Ge(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&He(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&Ge(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&He(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&Ge(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&He(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Ne(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!Xe(n,o)&&Ke(n,i,i.next,o)&&Ye(n,o)&&Ye(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),tr(i),tr(i.next),i=t=o),i=i.next}while(i!==t);return i}function je(t,e,r,i,n,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&We(a,s)){var l=Je(a,s);return a=Re(a,a.next),l=Re(l,l.next),Oe(a,e,r,i,n,o),void Oe(l,e,r,i,n,o)}s=s.next}a=a.next}while(a!==t)}function Ue(t,e){return t.x-e.x}function $e(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===a)return r.prev;var l,u=r,c=r.x,h=r.y,p=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=c&&n!==i.x&&Ge(o<h?n:a,o,c,h,o<h?a:n,o,i.x,i.y)&&((l=Math.abs(o-i.y)/(n-i.x))<p||l===p&&i.x>r.x)&&Ye(i,t)&&(r=i,p=l),i=i.next;return r}(t,e)){var r=Je(e,t);Re(r,r.next)}}function qe(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ze(t){var e=t,r=t;do e.x<r.x&&(r=e),e=e.next;while(e!==t);return r}function Ge(t,e,r,i,n,o,a,s){return(n-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function We(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&&Ke(r,r.next,t,e))return!0;r=r.next}
2while(r!==t);return!1}(t,e)&&Ye(t,e)&&Ye(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}(t,e)}function He(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Xe(t,e){return t.x===e.x&&t.y===e.y}function Ke(t,e,r,i){return!!(Xe(t,e)&&Xe(r,i)||Xe(t,i)&&Xe(r,e))||He(t,e,r)>0!=He(t,e,i)>0&&He(r,i,t)>0!=He(r,i,e)>0}function Ye(t,e){return He(t.prev,t,t.next)<0?He(t,e,t.next)>=0&&He(t,t.prev,e)>=0:He(t,e,t.prev)<0||He(t,t.next,e)<0}function Je(t,e){var r=new er(t.i,t.x,t.y),i=new er(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Qe(t,e,r,i){var n=new er(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function tr(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 er(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 rr(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function ir(t,e,r,i,n){!function o(t,e,r,i,n){for(;i>r;){if(i-r>600){var a=i-r+1,s=e-r+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),h=Math.max(r,Math.floor(e-s*u/a+c)),p=Math.min(i,Math.floor(e+(a-s)*u/a+c));o(t,e,h,p,n)}var f=t[e],d=r,m=i;for(nr(t,r,e),n(t[i],f)>0&&nr(t,r,i);d<m;){for(nr(t,d,m),d++,m--;n(t[d],f)<0;)d++;for(;n(t[m],f)>0;)m--}0===n(t[r],f)?nr(t,r,m):nr(t,++m,i),m<=e&&(r=m+1),e<=m&&(i=m-1)}}(t,e,r||0,i||t.length-1,n||or)}function nr(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function or(t,e){return t<e?-1:t>e?1:0}function ar(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o=[],a=0;a<r;a++){var s=v(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(i&&o.push(i),i=[t[a]]):i.push(t[a]))}if(i&&o.push(i),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(fa(o[l],e,1,o[l].length-1,sr),o[l]=o[l].slice(0,e));return o}function sr(t,e){return e.area-t.area}function lr(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*_a)+a,n*_a*2,o*_a*2,Math.round(s))}function ur(t,e){return t.x===e.x&&(t.x<0||t.x>jo)||t.y===e.y&&(t.y<0||t.y>jo)}function cr(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>jo})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>jo})}function hr(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(pr,this,e)}function pr(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function fr(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)e=t[n],i+=((r=t[a]).x-e.x)*(e.y+r.y);return i}function dr(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(mr,this,e),this.length=this._features.length}function mr(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>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 yr(t,e,r){if(3===t){var i=new Ta(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}function vr(t,e,r,i,n,o,a){t.emplaceBack(e.x,e.y,i?1:0,n?1:-1,Math.round(Ma*r.x)+128,Math.round(Ma*r.y)+128,1+(0===o?0:o<0?-1:1)|(a*Ia&63)<<2,a*Ia>>6)}function gr(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*(Ca-1)}function _r(t,e){return e>0?e+2*t:t}function xr(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),Fn.applyArabicShaping&&(t=Fn.applyArabicShaping(t)),t}function br(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate(new Vn(t+1))};if("source"===r.kind)return{functionType:"source"};for(var i=r.zoomStops,n=0;n<i.length&&i[n]<=t;)n++;for(var o=n=Math.max(0,n-1);o<i.length&&i[o]<t+1;)o++;o=Math.min(i.length-1,o);var a={min:i[n],max:i[o]};return"composite"===r.kind?{functionType:"composite",zoomRange:a,propertyValue:e.value}:{functionType:"camera",layoutSize:r.evaluate(new Vn(t+1)),zoomRange:a,sizeRange:{min:r.evaluate(new Vn(a.min)),max:r.evaluate(new Vn(a.max))},propertyValue:e.value}}function wr(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,Math.round(32*i),Math.round(32*n),o,a,s?s[0]:0,s?s[1]:0)}function Er(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Sr(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function Tr(t){return t.type===Sr.Bytes?t.readVarint()+t.pos:t.pos+1}function zr(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ar(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function Mr(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function kr(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ir(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Cr(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Lr(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Pr(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Dr(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Br(t,e){for(var r=0;r<t.length;
2r++)e.writeFixed64(t[r])}function Rr(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Or(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Fr(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Vr(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Nr(t,e,r){1===t&&r.readMessage(jr,e)}function jr(t,e,r){if(3===t){var i=r.readMessage(Ur,{}),n=i.id,o=i.bitmap,a=i.width,s=i.height,l=i.left,u=i.top,c=i.advance;e.push({id:n,bitmap:new na({width:a+2*ds,height:s+2*ds},o),metrics:{width:a,height:s,left:l,top:u,advance:c}})}}function Ur(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 $r(t,e,r,i){(t*=2)<0&&(t=-1*t-1);var n=1<<e;return 32*(n*n*t+n*i+r)+e}function qr(t,e){return e-t}function Zr(t,e,r,i){var n=Math.pow(t-e,2);return i?t<e?n/2:2*n:n+Math.abs(r)*r}function Gr(t,e){var r=0;return 10===t&&(r-=1e4),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Wr(t,e,r,i,n,o){for(var a=null,s=Zr(e,r,n,o),l=0,u=i;l<u.length;l+=1){var c=u[l],h=Zr(e-c.x,r,n,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function Hr(t,e,r,i){if(!r)return[];if(!t)return[];for(var n,o=[],a=function(t,e,r,i){for(var n=0,o=0;o<t.length;o++){var a=i[t.charCodeAt(o)];a&&(n+=a.metrics.advance+e)}return n/Math.max(1,Math.ceil(n/r))}(t,e,r,i),s=0,l=0;l<t.length;l++){var u=t.charCodeAt(l),c=i[u];c&&!Ls[u]&&(s+=c.metrics.advance+e),l<t.length-1&&(Ps[u]||!((n=u)<11904)&&(Pn["Bopomofo Extended"](n)||Pn.Bopomofo(n)||Pn["CJK Compatibility Forms"](n)||Pn["CJK Compatibility Ideographs"](n)||Pn["CJK Compatibility"](n)||Pn["CJK Radicals Supplement"](n)||Pn["CJK Strokes"](n)||Pn["CJK Symbols and Punctuation"](n)||Pn["CJK Unified Ideographs Extension A"](n)||Pn["CJK Unified Ideographs"](n)||Pn["Enclosed CJK Letters and Months"](n)||Pn["Halfwidth and Fullwidth Forms"](n)||Pn.Hiragana(n)||Pn["Ideographic Description Characters"](n)||Pn["Kangxi Radicals"](n)||Pn["Katakana Phonetic Extensions"](n)||Pn.Katakana(n)||Pn["Vertical Forms"](n)||Pn["Yi Radicals"](n)||Pn["Yi Syllables"](n)))&&o.push(Wr(l+1,s,a,o,Gr(u,t.charCodeAt(l+1)),!1))}return function h(t){return t?h(t.priorBreak).concat(t.index):[]}(Wr(t.length,s,a,o,0,!0))}function Xr(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Kr(t,e,r,i,n){if(n){var o=e[t[i].glyph];if(o)for(var a=o.metrics.advance,s=(t[i].x+a)*n,l=r;l<=i;l++)t[l].x-=s}}var Yr="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Jr=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),Qr=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,ti=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,ei={now:Jr,frame:function(t){return Qr(t)},cancelFrame:function(t){return ti(t)},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){var e=self.document.createElement("a");return e.href=t,e.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},supportsWebp:!1};if(self.document){var ri=self.document.createElement("img");ri.onload=function(){ei.supportsWebp=!0},ri.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var ii=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,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);
2if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;t>o?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ni=function(t,e,r){this.column=t,this.row=e,this.zoom=r};ni.prototype.clone=function(){return new ni(this.column,this.row,this.zoom)},ni.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},ni.prototype.sub=function(t){return this.clone()._sub(t)},ni.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},ni.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var oi=n;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[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add: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=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,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 ai=a(.25,.1,.25,1),si=1,li={},ui={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ui);var ci=function(t){function e(e,r,i){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),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),hi=function(t,e){var r=g(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var i=r.response;return 0===i.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,{data:i,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new ci(r.statusText,r.status,t.url)))},r.send(),r},pi=function(t,e){void 0===e&&(e={}),l(this,e),this.type=t},fi=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",l({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(pi),di=function(){};di.prototype.on=function(t,e){return this._listeners=this._listeners||{},_(t,e,this._listeners),this},di.prototype.off=function(t,e){return x(t,e,this._listeners),x(t,e,this._oneTimeListeners),this},di.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},_(t,e,this._oneTimeListeners),this},di.prototype.fire=function(t){"string"==typeof t&&(t=new pi(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,i=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r<i.length;r+=1)i[r].call(this,t);for(var n=0,o=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[];n<o.length;n+=1){var a=o[n];x(e,a,this._oneTimeListeners),a.call(this,t)}var s=this._eventedParent;s&&(l(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof fi&&console.error(t.error);return this},di.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},di.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var mi={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"}
2,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.0511,180,85.0511]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},attribution:{type:"string"},"*":{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.0511,180,85.0511]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},"default":"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,"default":[-180,-85.0511,180,85.0511]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},"default":"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number","default":18},attribution:{type:"string"},buffer:{type:"number","default":128,maximum:512,minimum:0},tolerance:{type:"number","default":.375},cluster:{type:"boolean","default":!1},clusterRadius:{type:"number","default":50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean","default":!1}},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:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_circle:{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_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"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{}},"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"},"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:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven" 3}
3,"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"}],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:"string","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:{left:{},center:{},right:{}},"default":"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center",requires:["text-field"],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"}],expression:{interpolated:!0,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"}],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"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean","default":!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean","default":!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean","default":!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{"let":{group:"Variable binding"},"var":{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},"case":{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},"typeof":{group:"Types"},string:{group:"Types"},number:{group:"Types"},"boolean":{group:"Types"},object:{group:"Types"},collator:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum","default":"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array","default":[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant","default":"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant","default":.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","default":!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature"]},"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:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"}},paint_line:{"line-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"property-type":"data-driven"},"line-gap-width":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-offset":{type:"number","default":0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"}
3,"line-blur":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"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:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"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"]},"property-type":"data-driven"},"circle-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-blur":{type:"number","default":0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number","default":30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"heatmap-weight":{type:"number","default":1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"property-type":"data-driven"},"icon-color":{type:"color","default":"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"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"]},"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"]},"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"]},"property-type":"data-driven"},"text-color":{type:"color","default":"#000000",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"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"]},"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"]},"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"}
3,"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-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:"string",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"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},"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}},"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"]},"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:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"fill-extrusion-height":{type:"number","default":0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"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"]},"property-type":"data-driven"}},"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"}}},yi=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)},vi=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),gi=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r],o=n[0],a=n[1];this.bindings[o]=a}};gi.prototype.concat=function(t){return new gi(this,t)},gi.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},gi.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var _i={kind:"null"},xi={kind:"number"},bi={kind:"string"},wi={kind:"boolean"},Ei={kind:"color"},Si={kind:"object"},Ti={kind:"value"},zi={kind:"collator"},Ai=[_i,xi,bi,wi,Ei,Si,T(Ti)],Mi=r(function(t,e){function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function n(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}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}var s={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in s)return s[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.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===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),h=i.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[n(h[0]),n(h[1]),n(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[r(255*a(v,y,f+1/3)),r(255*a(v,y,f)),r(255*a(v,y,f-1/3)),p];default:return null}}return null}}catch(t){}}).parseCSSColor,ki=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ki.parse=function(t){if(t){if(t instanceof ki)return t;if("string"==typeof t){var e=Mi(t);
3if(e)return new ki(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},ki.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],i=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(i)+","+n+")"},ki.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,i=this.a;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]},ki.black=new ki(0,0,0,1),ki.white=new ki(1,1,1,1),ki.transparent=new ki(0,0,0,0);var Ii=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"})};Ii.prototype.compare=function(t,e){return this.collator.compare(t,e)},Ii.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ci=function(t,e,r){this.type=zi,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Ci.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,wi);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,wi);if(!n)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,bi))?null:new Ci(i,n,o)},Ci.prototype.evaluate=function(t){return new Ii(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ci.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ci.prototype.possibleOutputs=function(){return[void 0]},Ci.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Li=function(t,e){this.type=t,this.value=e};Li.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function o(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 ki)return!0;if(t instanceof Ii)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!o(r[e]))return!1;return!0}if("object"==typeof t){for(var i in t)if(!o(t[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],i=k(r),n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new Li(i,r)},Li.prototype.evaluate=function(){return this.value},Li.prototype.eachChild=function(){},Li.prototype.possibleOutputs=function(){return[this.value]},Li.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ki?["rgba"].concat(this.value.toArray()):this.value};var Pi=function(t){this.name="ExpressionEvaluationError",this.message=t};Pi.prototype.toJSON=function(){return this.message};var Di={string:bi,number:xi,"boolean":wi,object:Si},Bi=function(t,e){this.type=t,this.args=e};Bi.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],i=Di[r],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Ti);if(!a)return null;n.push(a)}return new Bi(i,n)},Bi.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!A(this.type,k(r)))return r;if(e===this.args.length-1)throw new Pi("Expected value to be of type "+z(this.type)+", but found "+z(k(r))+" instead.")}return null},Bi.prototype.eachChild=function(t){this.args.forEach(t)},Bi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},Bi.prototype.serialize=function(){return[this.type.kind].concat(this.args.map(function(t){return t.serialize()}))};var Ri={string:bi,number:xi,"boolean":wi},Oi=function(t,e){this.type=t,this.input=e};Oi.parse=function(t,e){if(t.length<2||t.length>4)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,i;if(t.length>2){var n=t[1];if("string"!=typeof n||!(n in Ri))return e.error('The item type argument of "array" must be one of string, number, boolean',1); 4r=Ri[n]}else r=Ti;if(t.length>3){if("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);i=t[2]}var o=T(r,i),a=e.parse(t[t.length-1],t.length-1,Ti);return a?new Oi(o,a):null},Oi.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(A(this.type,k(e)))throw new Pi("Expected value to be of type "+z(this.t
4ype)+", but found "+z(k(e))+" instead.");return e},Oi.prototype.eachChild=function(t){t(this.input)},Oi.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},Oi.prototype.serialize=function(){var t=["array"],e=this.type.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){t.push(e.kind);var r=this.type.N;"number"==typeof r&&t.push(r)}return t.push(this.input.serialize()),t};var Fi={"to-number":xi,"to-color":Ei},Vi=function(t,e){this.type=t,this.args=e};Vi.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],i=Fi[r],n=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Ti);if(!a)return null;n.push(a)}return new Vi(i,n)},Vi.prototype.evaluate=function(t){if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1)if(r=null,"string"==typeof(e=n[i].evaluate(t))){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":M(e[0],e[1],e[2],e[3])))return new ki(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new Pi(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var a=null,s=0,l=this.args;s<l.length;s+=1)if(null!==(a=l[s].evaluate(t))){var u=Number(a);if(!isNaN(u))return u}throw new Pi("Could not convert "+JSON.stringify(a)+" to number.")},Vi.prototype.eachChild=function(t){this.args.forEach(t)},Vi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},Vi.prototype.serialize=function(){var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ni=["Unknown","Point","LineString","Polygon"],ji=function(){this._parseColorCache={}};ji.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ji.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Ni[this.feature.type]:this.feature.type:null},ji.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ji.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ki.parse(t)),e};var Ui=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};Ui.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ui.prototype.eachChild=function(t){this.args.forEach(t)},Ui.prototype.possibleOutputs=function(){return[void 0]},Ui.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},Ui.parse=function(t,e){var r=t[0],i=Ui.definitions[r];if(!i)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=o.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),s=[],l=1;l<t.length;l++){var u=t[l],c=void 0;if(1===a.length){var h=a[0][0];c=Array.isArray(h)?h[l-1]:h.type}var p=e.parse(u,1+s.length,c);if(!p)return null;s.push(p)}for(var f=null,d=0,m=a;d<m.length;d+=1){var y=m[d],v=y[0],g=y[1];if(f=new qi(e.registry,e.path,null,e.scope),Array.isArray(v)&&v.length!==s.length)f.error("Expected "+v.length+" arguments, but found "+s.length+" instead.");else{for(var _=0;_<s.length;_++){var x=Array.isArray(v)?v[_]:v.type,b=s[_];f.concat(_+1).checkSubtype(x,b.type)}if(0===f.errors.length)return new Ui(r,n,g,s)}}if(1===a.length)e.errors.push.apply(e.errors,f.errors);else{var w=(a.length?a:o).map(function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(z).join(", ")+")":"("+z(e.type)+"...)"}).join(" | "),E=s.map(function(t){return z(t.type)}).join(", ");e.error("Expected arguments of type "+w+", but found ("+E+") instead.")}return null},Ui.register=function(t,e){for(var r in Ui.definitions=e,e)t[r]=Ui};var $i=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};$i.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];
4return e.scope.has(r)?new $i(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},$i.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},$i.prototype.eachChild=function(){},$i.prototype.possibleOutputs=function(){return[void 0]},$i.prototype.serialize=function(){return["var",this.name]};var qi=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new gi),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=i,this.errors=n,this.expectedType=r};qi.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},qi.prototype._parse=function(t,e){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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var n=i.parse(t,this);if(!n)return null;if(this.expectedType){var o=this.expectedType,a=n.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind||"value"!==a.kind)if("array"===o.kind&&"value"===a.kind)e.omitTypeAnnotations||(n=new Oi(o,n));else if("color"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(this.expectedType,n.type))return null}else e.omitTypeAnnotations||(n=new Vi(o,[n]));else e.omitTypeAnnotations||(n=new Bi(o,[n]))}if(!(n instanceof Li)&&function l(t){if(t instanceof $i)return l(t.boundExpression);if(t instanceof Ui&&"error"===t.name)return!1;if(t instanceof Ci)return!1;var e=t instanceof Vi||t instanceof Bi||t instanceof Oi,r=!0;return t.eachChild(function(t){r=e?r&&l(t):r&&t instanceof Li}),!!r&&(I(t)&&L(t,["zoom","heatmap-density","line-progress","is-supported-script"]))}(n)){var s=new ji;try{n=new Li(n.type,n.evaluate(s))}catch(t){return this.error(t.message),null}}return n}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},qi.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new qi(this.registry,i,e||null,n,this.errors)},qi.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 vi(i,t))},qi.prototype.checkSubtype=function(t,e){var r=A(t,e);return r&&this.error(r),r};var Zi=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};Zi.parse=function(t,e){var r=t[1],i=t.slice(2);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(!(r=e.parse(r,1,xi)))return null;var n=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType),i.unshift(-1/0);for(var a=0;a<i.length;a+=2){var s=i[a],l=i[a+1],u=a+1,c=a+2;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var h=e.parse(l,c,o);if(!h)return null;o=o||h.type,n.push([s,h])}return new Zi(o,r,n)},Zi.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 n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[P(e,i)].evaluate(t)},Zi.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Zi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},Zi.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Gi=Object.freeze({number:D,color:function(t,e,r){return new ki(D(t.r,e.r,r),D(t.g,e.g,r),D(t.b,e.b,r),D(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,i){return D(t,e[i],r)})}}),Wi=function(t,e,r,i){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var n=0,o=i;n<o.length;n+=1){var a=o[n],s=a[0],l=a[1];this.labels.push(s),this.outputs.push(l)}};Wi.interpolationFactor=function(t,e,r,i){var n=0;
4if("exponential"===t.name)n=B(e,t.base,r,i);else if("linear"===t.name)n=B(e,1,r,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;n=new ii(o[0],o[1],o[2],o[3]).solve(B(e,1,r,i))}return n},Wi.parse=function(t,e){var r=t[1],i=t[2],n=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var a=r.slice(1);if(4!==a.length||a.some(function(t){return"number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,xi)))return null;var s=[],l=null;e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var u=0;u<n.length;u+=2){var c=n[u],h=n[u+1],p=u+3,f=u+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(s.length&&s[s.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var d=e.parse(h,f,l);if(!d)return null;l=l||d.type,s.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Wi(l,r,i,s):e.error("Type "+z(l)+" is not interpolatable.")},Wi.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 n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=P(e,i),a=e[o],s=e[o+1],l=Wi.interpolationFactor(this.interpolation,i,a,s),u=r[o].evaluate(t),c=r[o+1].evaluate(t);return Gi[this.type.kind.toLowerCase()](u,c,l)},Wi.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Wi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},Wi.prototype.serialize=function(){for(var t=["interpolate","linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints),this.input.serialize()],e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t};var Hi=function(t,e){this.type=t,this.args=e};Hi.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],l=e.parse(s,1+n.length,r,void 0,{omitTypeAnnotations:!0});if(!l)return null;r=r||l.type,n.push(l)}var u=i&&n.some(function(t){return A(i,t.type)});return new Hi(u?Ti:r,n)},Hi.prototype.evaluate=function(t){for(var e=null,r=0,i=this.args;r<i.length&&null===(e=i[r].evaluate(t));r+=1);return e},Hi.prototype.eachChild=function(t){this.args.forEach(t)},Hi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},Hi.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Xi=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Xi.prototype.evaluate=function(t){return this.result.evaluate(t)},Xi.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Xi.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;
vendor: 10,365 bytes, line 4
4r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,void 0,r);return a?new Xi(r,a):null},Xi.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Xi.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t.push(n,o.serialize())}return t.push(this.result.serialize()),t};var Ki=function(t,e,r){this.type=t,this.index=e,this.input=r};Ki.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,xi),i=e.parse(t[2],2,T(e.expectedType||Ti));if(!r||!i)return null;var n=i.type;return new Ki(n.itemType,r,i)},Ki.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new Pi("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new Pi("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Pi("Array index must be an integer, but found "+e+" instead.");return r[e]},Ki.prototype.eachChild=function(t){t(this.index),t(this.input)},Ki.prototype.possibleOutputs=function(){return[void 0]},Ki.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Yi=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};Yi.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 n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,k(p)))return null}else r=k(p);if(void 0!==n[String(p)])return u.error("Branch labels must be unique.");n[String(p)]=o.length}var f=e.parse(l,a,i);if(!f)return null;i=i||f.type,o.push(f)}var d=e.parse(t[1],1,Ti);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,i);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Yi(r,i,d,n,o,m):null},Yi.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(k(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Yi.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Yi.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Yi.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n],s=i[t.cases[a]];void 0===s?(i[t.cases[a]]=r.length,r.push([t.cases[a],[a]])):r[s][1].push(a)}for(var l=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,c=r;u<c.length;u+=1){var h=c[u],p=h[0],f=h[1];1===f.length?e.push(l(f[0])):e.push(f.map(l)),e.push(t.outputs[p].serialize())}return e.push(this.otherwise.serialize()),e};var Ji=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};Ji.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,wi);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Ji(r,i,s):null},Ji.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];if(n.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},Ji.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[0],o=i[1];t(n),t(o)}t(this.otherwise)},Ji.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.branches.map(function(t){return t[0],t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Ji.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Qi=O("==",!1),tn=O("!=",!0),en=function(t){this.type=xi,this.input=t};en.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 "+z(r.type)+" instead."):new en(r):null},en.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 Pi("Expected value to be of type string or array, but found "+z(k(e))+" instead.")},en.prototype.eachChild=function(t){t(this.input)},en.prototype.possibleOutputs=function(){return[void 0]},en.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var rn={"==":Qi,"!=":tn,array:Oi,at:Ki,"boolean":Bi,"case":Ji,coalesce:Hi,collator:Ci,interpolate:Wi,length:en,"let":Xi,literal:Li,match:Yi,number:Bi,object:Bi,step:Zi,string:Bi,"to-color":Vi,"to-number":Vi,"var":$i};Ui.register(rn,{error:[{kind:"error"},[bi],function(t,e){var r=e[0];throw new Pi(r.evaluate(t))}],"typeof":[bi,[Ti],function(t,e){return z(k(e[0].evaluate(t)))}],"to-string":[bi,[Ti],function(t,e){var r=e[0],i=typeof(r=r.evaluate(t));return null===r?"":"string"===i||"number"===i||"boolean"===i?String(r):r instanceof ki?r.toString():JSON.stringify(r)}],"to-boolean":[wi,[Ti],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[T(xi,4),[Ei],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ei,[xi,xi,xi],F],rgba:[Ei,[xi,xi,xi,xi],F],has:{type:wi,overloads:[[[bi],function(t,e){return V(e[0].evaluate(t),t.properties())}],[[bi,Si],function(t,e){var r=e[0],i=e[1];return V(r.evaluate(t),i.evaluate(t))}]]},get:{type:Ti,overloads:[[[bi],function(t,e){return N(e[0].evaluate(t),t.properties())}],[[bi,Si],function(t,e){var r=e[0],i=e[1];return N(r.evaluate(t),i.evaluate(t))}]]},"feature-state":[Ti,[bi],function(t,e){return N(e[0].evaluate(t),t.featureState||{})}],properties:[Si,[],function(t){return t.properties()}],"geometry-type":[bi,[],function(t){return t.geometryType()}],id:[Ti,[],function(t){return t.id()}],zoom:[xi,[],function(t){return t.globals.zoom}],"heatmap-density":[xi,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[xi,[],function(t){return t.globals.lineProgress||0}],"+":[xi,Z(xi),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[xi,Z(xi),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:xi,overloads:[[[xi,xi],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)-i.evaluate(t)}],[[xi],function(t,e){return-e[0].evaluate(t)}]]},"/":[xi,[xi,xi],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)/i.evaluate(t)}],"%":[xi,[xi,xi],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[xi,[],function(){return Math.LN2}],pi:[xi,[],function(){return Math.PI}],e:[xi,[],function(){return Math.E}],"^":[xi,[xi,xi],function(t,e){var r=e[0],i=e[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[xi,[xi],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[xi,[xi],function(t,e){var r=e[0];return Math.log10(r.evaluate(t))}],ln:[xi,[xi],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[xi,[xi],function(t,e){var r=e[0];return Math.log2(r.evaluate(t))}],sin:[xi,[xi],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[xi,[xi],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[xi,[xi],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[xi,[xi],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[xi,[xi],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[xi,[xi],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[xi,Z(xi),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[xi,Z(xi),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[xi,[xi],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[xi,[xi],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[xi,[xi],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[xi,[xi],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[wi,[bi,Ti],function(t,e){var r=e[0],i=e[1];return t.properties()[r.value]===i.value}],"filter-id-==":[wi,[Ti],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[wi,[bi],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[wi,[bi,Ti],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<o}],"filter-id-<":[wi,[Ti],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<n}],"filter->":[wi,[bi,Ti],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[wi,[Ti],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[wi,[bi,Ti],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[wi,[Ti],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[wi,[bi,Ti],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[wi,[Ti],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[wi,[Ti],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[wi,[],function(t){return null!==t.id()}],"filter-type-in":[wi,[T(bi)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}
4],"filter-id-in":[wi,[T(Ti)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[wi,[bi,T(Ti)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[wi,[bi,T(Ti)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],">":{type:wi,overloads:[[[xi,xi],U],[[bi,bi],U],[[bi,bi,zi],function(t,e){var r=e[0],i=e[1];return e[2].evaluate(t).compare(r.evaluate(t),i.evaluate(t))>0}]]},"<":{type:wi,overloads:[[[xi,xi],j],[[bi,bi],j],[[bi,bi,zi],function(t,e){var r=e[0],i=e[1];return e[2].evaluate(t).compare(r.evaluate(t),i.evaluate(t))<0}]]},">=":{type:wi,overloads:[[[xi,xi],q],[[bi,bi],q],[[bi,bi,zi],function(t,e){var r=e[0],i=e[1];return e[2].evaluate(t).compare(r.evaluate(t),i.evaluate(t))>=0}]]},"<=":{type:wi,overloads:[[[xi,xi],$],[[bi,bi],$],[[bi,bi,zi],function(t,e){var r=e[0],i=e[1];return e[2].evaluate(t).compare(r.evaluate(t),i.evaluate(t))<=0}]]},all:{type:wi,overloads:[[[wi,wi],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[Z(wi),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:wi,overloads:[[[wi,wi],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)||i.evaluate(t)}],[Z(wi),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[wi,[wi],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[wi,[bi],function(t,e){var r=e[0],i=t.globals&&t.globals.isSupportedScript;return!i||i(r.evaluate(t))}],upcase:[bi,[bi],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[bi,[bi],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[bi,Z(bi),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}],"resolved-locale":[bi,[zi],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var nn=.95047,on=1,an=1.08883,sn=4/29,ln=6/29,un=3*ln*ln,cn=ln*ln*ln,hn=Math.PI/180,pn=180/Math.PI,fn={forward:et,reverse:rt,interpolate:function(t,e,r){return{l:D(t.l,e.l,r),a:D(t.a,e.a,r),b:D(t.b,e.b,r),alpha:D(t.alpha,e.alpha,r)}}},dn={forward:function(t){var e=et(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*pn;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*hn,r=t.c;return rt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}(t.h,e.h,r),c:D(t.c,e.c,r),l:D(t.l,e.l,r),alpha:D(t.alpha,e.alpha,r)}}},mn=Object.freeze({lab:fn,hcl:dn}),yn=function(t,e){var r;this.expression=t,this._warningHistory={},this._defaultValue="color"===(r=e).type&&nt(r["default"])?new ki(0,0,0,0):"color"===r.type?ki.parse(r["default"])||null:void 0===r["default"]?null:r["default"],"enum"===e.type&&(this._enumValues=e.values)};yn.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._evaluator||(this._evaluator=new ji),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this.expression.evaluate(this._evaluator)},yn.prototype.evaluate=function(t,e,r){this._evaluator||(this._evaluator=new ji),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new Pi("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(i)+" instead.");return i}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var vn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!C(e.expression)};vn.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},vn.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)};var gn=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!C(e.expression),r instanceof Wi&&(this._interpolationType=r.interpolation)};gn.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},gn.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)},gn.prototype.interpolationFactor=function(t,e,r){return this._interpolationType?Wi.interpolationFactor(this._interpolationType,t,e,r):0};var _n=function(t,e){this._parameters=t,this._specification=e,w(this,function r(t,e){var i,n,o,a="color"===e.type,s=t.stops&&"object"==typeof t.stops[0][0],l=s||void 0!==t.property,u=s||!l,c=t.type||(K(e)?"exponential":"interval");
4if(a&&((t=w({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],ki.parse(t[1])]})),t["default"]?t["default"]=ki.parse(t["default"]):t["default"]=ki.parse(e["default"])),t.colorSpace&&"rgb"!==t.colorSpace&&!mn[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===c)i=ut;else if("interval"===c)i=lt;else if("categorical"===c){i=st,n=Object.create(null);for(var h=0,p=t.stops;h<p.length;h+=1){var f=p[h];n[f[0]]=f[1]}o=typeof t.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');i=ct}if(s){for(var d={},m=[],y=0;y<t.stops.length;y++){var v=t.stops[y],g=v[0].zoom;void 0===d[g]&&(d[g]={zoom:g,type:t.type,property:t.property,"default":t["default"],stops:[]},m.push(g)),d[g].stops.push([v[0].value,v[1]])}for(var _=[],x=0,b=m;x<b.length;x+=1){var E=b[x];_.push([d[E].zoom,r(d[E],e)])}return{kind:"composite",interpolationFactor:Wi.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:_.map(function(t){return t[0]}),evaluate:function(r,i){var n=r.zoom;return ut({stops:_,base:t.base},e,n).evaluate(n,i)}}}return u?{kind:"camera",interpolationFactor:"exponential"===c?Wi.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==t.base?t.base:1}):function(){return 0},zoomStops:t.stops.map(function(t){return t[0]}),evaluate:function(r){var a=r.zoom;return i(t,e,a,n,o)}}:{kind:"source",evaluate:function(r,a){var s=a&&a.properties?a.properties[t.property]:void 0;return void 0===s?at(t["default"],e["default"]):i(t,e,s,n,o)}}}(this._parameters,this._specification))};_n.deserialize=function(t){return new _n(t._parameters,t._specification)},_n.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var xn={type:"boolean","default":!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},bn={"*":function(){return[]},array:vt,"boolean":function(t){var e=t.value,r=t.key,i=it(e);return"boolean"!==i?[new yi(r,e,"boolean expected, "+i+" found")]:[]},number:gt,color:function(t){var e=t.key,r=t.value,i=it(r);return"string"!==i?[new yi(e,r,"color expected, "+i+" found")]:null===Mi(r)?[new yi(e,r,'color expected, "'+r+'" found')]:[]},constants:b,"enum":bt,filter:It,"function":_t,layer:Dt,object:yt,source:Bt,light:Rt,string:Ot};Nt.source=Ut(Bt),Nt.light=Ut(Rt),Nt.layer=Ut(Dt),Nt.filter=Ut(It),Nt.paintProperty=Ut(Lt),Nt.layoutProperty=Ut(Pt);var wn=Nt,En=Nt.light,Sn=Nt.paintProperty,Tn=Nt.layoutProperty,zn=qt,An=3;qt.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},qt.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."; 5},qt.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},qt.prototype.query=function(t,e,r,i){var n=this.min,o=this.max;if(t<=n&&e<=n&&o<=r&&o<=i)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,r,i,this._queryCell,a,{}),a},qt.prototype._queryCell=function(t,e,r,i,n,o,a){var s=this.cells[n];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===a[h]){var p=4*h;t<=u[p+2]&&e<=u[p+3]&&r>=u[p+0]&&i>=u[p+1]?(a[h]=!0,o.push(l[h])):a[h]=!1}}},qt.prototype._forEachCell=function(t,e,r,i,n,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(i),h=s;h<=u;h++)for(var p=l;p<=c;p++){var f=this.d*p+h;if(n.call(this,t,e,r,i,f,o,a))return}},qt.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},qt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=An+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[An+a]=o,n.set(s,o),o+=s.length}return n[An+t.length]=o,n.set(this.keys,o),o+=this.keys.length,n[An+t.length+1]=o,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Mn=self.ImageData,kn={};for(var In in Zt("Object",Object),zn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),r},zn.deserialize=function(t){return new zn(t)},Zt("Grid",zn),Zt("Color",ki),Zt("Error",Error),Zt("StylePropertyFunction",_n),Zt("StyleExpression",yn,{omit:["_evaluator"]}),Zt("ZoomDependentExpression",gn),Zt("ZoomConstantExpression",vn),Zt("CompoundExpression",Ui,{omit:["_evaluate"]}
5),rn)rn[In]._classRegistryKey||Zt("Expression_"+In,rn[In]);var Cn=function(){this.first=!0};Cn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Ln,Pn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}},Dn=!1,Bn=null,Rn=!1,On=new di,Fn={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Rn||null!=Fn.applyArabicShaping}},Vn=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 Cn,this.transition={})};Vn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;r<i.length;r+=1)if(!Jt(i[r].charCodeAt(0),e))return!1;return!0}(t,Fn.isLoaded())},Vn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)};var Nn=function(t,e){this.property=t,this.value=e,this.expression=mt(void 0===e?t.specification["default"]:e,t.specification)};Nn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Nn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var jn=function(t){this.property=t,this.value=new Nn(t,(void 0))};jn.prototype.transitioned=function(t,e){return new $n(this.property,this.value,e,l({},t.transition,this.transition),t.now)},jn.prototype.untransitioned=function(){return new $n(this.property,this.value,
5null,{},0)};var Un=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Un.prototype.getValue=function(t){return d(this._values[t].value.value)},Un.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new jn(this._values[t].property)),this._values[t].value=new Nn(this._values[t].property,null===e?void 0:d(e))},Un.prototype.getTransition=function(t){return d(this._values[t].transition)},Un.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new jn(this._values[t].property)),this._values[t].transition=d(e)||void 0},Un.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n);var o=this.getTransition(i);void 0!==o&&(t[i+"-transition"]=o)}return t},Un.prototype.transitioned=function(t,e){for(var r=new qn(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Un.prototype.untransitioned=function(){for(var t=new qn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var $n=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};$n.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),i=this.prior;if(i){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return i.possiblyEvaluate(t);var n=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(n))}return r};var qn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};qn.prototype.possiblyEvaluate=function(t){for(var e=new Wn(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e},qn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var Zn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Zn.prototype.getValue=function(t){return d(this._values[t].value)},Zn.prototype.setValue=function(t,e){this._values[t]=new Nn(this._values[t].property,null===e?void 0:d(e))},Zn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},Zn.prototype.possiblyEvaluate=function(t){for(var e=new Wn(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var n=i[r];e._values[n]=this._values[n].possiblyEvaluate(t)}return e};var Gn=function(t,e,r){this.property=t,this.value=e,this.globals=r};Gn.prototype.isConstant=function(){return"constant"===this.value.kind},Gn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Gn.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.globals,t,e)};var Wn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Wn.prototype.get=function(t){return this._values[t]};var Hn=function(t){this.specification=t};Hn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Hn.prototype.interpolate=function(t,e,r){var i=Gi[this.specification.type];return i?i(t,e,r):t};var Xn=function(t){this.specification=t};Xn.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Gn(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Gn(this,t.expression,e)},Xn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Gn(this,{kind:"constant",value:void 0},t.globals);var i=Gi[this.specification.type];return i?new Gn(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.globals):t},Xn.prototype.evaluate=function(t,e,r,i){return"constant"===t.kind?t.value:t.evaluate(e,r,i)};var Kn=function(t){this.specification=t};Kn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Vn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Vn(Math.floor(e.zoom),e)),t.expression.evaluate(new Vn(Math.floor(e.zoom+1),e)),e)}},Kn.prototype._calculate=function(t,e,r,i){var n=i.zoom,o=n-Math.floor(n),a=i.crossFadingFactor();return n>i.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:o+(1-o)*a}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-a)*o}},Kn.prototype.interpolate=function(t){return t};var Yn=function(t){this.specification=t};Yn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Yn.prototype.interpolate=function(){return!1};var Jn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],i=this.defaultPropertyValues[e]=new Nn(r,(void 0)),n=this.defaultTransitionablePropertyValues[e]=new jn(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}};Zt("DataDrivenProperty",Xn),Zt("DataConstantProperty",Hn),Zt("CrossFadedProperty",Kn),Zt("ColorRampProperty",Yn);var Qn=function(t){function e(e,r){for(var i in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new Zn(r.layout)),this._transitionablePaint=new Un(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var i="layers."+this.id+".layout."+t;
5if(this._validate(Tn,i,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return h(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var i="layers."+this.id+".paint."+t;if(this._validate(Sn,i,t,e,r))return!1}if(h(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t].value.isDataDriven();this._transitionablePaint.setValue(t,e);var o=this._transitionablePaint._values[t].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(t),o||n},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)}
vendor: 16,384 bytes, line 5
5,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"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),f(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,n){return(!n||!1!==n.validate)&&$t(this,t.call(wn,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:mi,style:{glyphs:!0,sprite:!0}}))},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 Gn&&H(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(di),to={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},eo=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},ro=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};ro.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ro.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},ro.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ro.prototype.clear=function(){this.length=0},ro.prototype.resize=function(t){this.reserve(t),this.length=t},ro.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)}},ro.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var i=2*r;return this.int16[i+0]=t,this.int16[i+1]=e,r},e.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(ro);io.prototype.bytesPerElement=4,Zt("StructArrayLayout2i4",io);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;this.resize(n+1);var o=4*n;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=r,this.int16[o+3]=i,n},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,t},e}(ro);no.prototype.bytesPerElement=8,Zt("StructArrayLayout4i8",no);var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=n,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,r,i,n,o,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]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(ro);oo.prototype.bytesPerElement=12,Zt("StructArrayLayout2i4i12",oo);var ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o,a,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=i,this.uint8[c+8]=n,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,l},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l){var u=6*t,c=12*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=i,this.int16[u+3]=n,this.uint8[c+8]=o,this.uint8[c+9]=a,this.uint8[c+10]=s,this.uint8[c+11]=l,t},e}(ro);ao.prototype.bytesPerElement=12,Zt("StructArrayLayout4i4ub12",ao);var so=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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,n,o,a,s){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=i,this.uint16[u+4]=n,this.uint16[u+5]=o,this.uint16[u+6]=a,this.uint16[u+7]=s,l},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l){var u=8*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=i,this.int16[u+3]=n,this.uint16[u+4]=o,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(ro);so.prototype.bytesPerElement=16,Zt("StructArrayLayout4i4ui16",so);var lo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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;this.resize(i+1);var n=3*i;return this.float32[n+0]=t,this.float32[n+1]=e,this.float32[n+2]=r,i},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(ro);lo.prototype.bytesPerElement=12,Zt("StructArrayLayout3f12",lo);var uo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(ro);uo.prototype.bytesPerElement=4,Zt("StructArrayLayout1ul4",uo);var co=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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,n,o,a,s,l,u,c){var h=this.length;this.resize(h+1);var p=12*h,f=6*h;return this.int16[p+0]=t,this.int16[p+1]=e,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=n,this.int16[p+5]=o,this.uint32[f+3]=a,this.uint16[p+8]=s,this.uint16[p+9]=l,this.int16[p+10]=u,this.int16[p+11]=c,h},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,h){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=i,this.int16[p+3]=n,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[f+3]=s,this.uint16[p+8]=l,this.uint16[p+9]=u,this.int16[p+10]=c,this.int16[p+11]=h,t},e}(ro);co.prototype.bytesPerElement=24,Zt("StructArrayLayout6i1ul2ui2i24",co);var ho=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=n,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,r,i,n,o,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]=n,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(ro);ho.prototype.bytesPerElement=12,Zt("StructArrayLayout2i2i2i12",ho);var po=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var i=4*r;return this.uint8[i+0]=t,this.uint8[i+1]=e,r},e.prototype.emplace=function(t,e,r){var i=4*t;return this.uint8[i+0]=e,this.uint8[i+1]=r,t},e}(ro);po.prototype.bytesPerElement=4,Zt("StructArrayLayout2ub4",po);var fo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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,n,o,a,s,l,u,c,h,p,f){var d=this.length;this.resize(d+1);var m=20*d,y=10*d,v=40*d;return this.int16[m+0]=t,this.int16[m+1]=e,this.uint16[m+2]=r,this.uint16[m+3]=i,this.uint32[y+2]=n,this.uint32[y+3]=o,this.uint32[y+4]=a,this.uint16[m+10]=s,this.uint16[m+11]=l,this.uint16[m+12]=u,this.float32[y+7]=c,this.float32[y+8]=h,this.uint8[v+36]=p,this.uint8[v+37]=f,d},e.prototype.emplace=function(t,e,r,i,n,o,a,s,l,u,c,h,p,f,d){var m=20*t,y=10*t,v=40*t;return this.int16[m+0]=e,this.int16[m+1]=r,this.uint16[m+2]=i,this.uint16[m+3]=n,this.uint32[y+2]=o,this.uint32[y+3]=a,this.uint32[y+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=u,this.uint16[m+12]=c,this.float32[y+7]=h,this.float32[y+8]=p,this.uint8[v+36]=f,this.uint8[v+37]=d,t},e}(ro);fo.prototype.bytesPerElement=40,Zt("StructArrayLayout2i2ui3ul3ui2f2ub40",fo);var mo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(ro);mo.prototype.bytesPerElement=4,Zt("StructArrayLayout1f4",mo);var yo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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;this.resize(i+1);var n=3*i;return this.int16[n+0]=t,this.int16[n+1]=e,this.int16[n+2]=r,i},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(ro);yo.prototype.bytesPerElement=6,Zt("StructArrayLayout3i6",yo);var vo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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;this.resize(i+1);var n=2*i,o=4*i;return this.uint32[n+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=r,i},e.prototype.emplace=function(t,e,r,i){var n=2*t,o=4*t;return this.uint32[n+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=i,t},e}(ro);vo.prototype.bytesPerElement=8,Zt("StructArrayLayout1ul2ui8",vo);var go=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._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;this.resize(i+1);var n=3*i;return this.uint16[n+0]=t,this.uint16[n+1]=e,this.uint16[n+2]=r,i},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(ro);go.prototype.bytesPerElement=6,Zt("StructArrayLayout3ui6",go);var _o=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var i=2*r;return this.uint16[i+0]=t,this.uint16[i+1]=e,r},e.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(ro);_o.prototype.bytesPerElement=4,Zt("StructArrayLayout2ui4",_o);var xo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var i=2*r;return this.float32[i+0]=t,this.float32[i+1]=e,r},e.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(ro);xo.prototype.bytesPerElement=8,Zt("StructArrayLayout2f8",xo);var bo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,i){var n=this.length;this.resize(n+1);var o=4*n;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=r,this.float32[o+3]=i,n},e.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,t},e}(ro);bo.prototype.bytesPerElement=16,Zt("StructArrayLayout4f16",bo);var wo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function
vendor: 5,093 bytes, lines 5-6
5(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new oi(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(eo);wo.prototype.size=24;var Eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new wo(this,t)},e}(co);Zt("CollisionBoxArray",Eo); 6var So=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(eo);So.prototype.size=40;var To=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new So(this,t)},e}(fo);Zt("PlacedSymbolArray",To);var zo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(eo);zo.prototype.size=4;var Ao=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new zo(this,t)},e}(mo);Zt("GlyphOffsetArray",Ao);var Mo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]}
6,r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(eo);Mo.prototype.size=6;var ko=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.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.prototype.get=function(t){return new Mo(this,t)},e}(yo);Zt("SymbolLineVertexArray",ko);var Io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(eo);Io.prototype.size=8;var Co=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Io(this,t)},e}(vo);Zt("FeatureIndexArray",Co);var Lo=Qt([{name:"a_pos",components:2,type:"Int16"}],4).members,Po=function(t){void 0===t&&(t=[]),this.segments=t};Po.prototype.prepareSegment=function(t,e,r){var i=this.segments[this.segments.length-1];return t>Po.MAX_VERTEX_ARRAY_LENGTH&&m("Max vertices per segment is "+Po.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Po.MAX_VERTEX_ARRAY_LENGTH)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(i)),i},Po.prototype.get=function(){return this.segments},Po.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var i in r.vaos)r.vaos[i].destroy()}},Po.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Zt("SegmentVector",Po);var Do=function(t,e){return 256*(t=s(Math.floor(t),0,255))+(e=s(Math.floor(e),0,255))},Bo=function(t,e,r){this.value=t,this.name=e,this.type=r,this.statistics={max:-1/0}};Bo.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},Bo.prototype.populatePaintArray=function(){},Bo.prototype.updatePaintArray=function(){},Bo.prototype.upload=function(){},Bo.prototype.destroy=function(){},Bo.prototype.setUniforms=function(t,e,r,i){var n=i.constantOr(this.value),o=t.gl;"color"===this.type?o.uniform4f(e.uniforms["u_"+this.name],n.r,n.g,n.b,n.a):o.uniform1f(e.uniforms["u_"+this.name],n)};var Ro=function(t,e,r){this.expression=t,this.name=e,this.type=r,this.statistics={max:-1/0};var i="color"===r?xo:mo;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}],this.paintVertexArray=new i};Ro.prototype.defines=function(){return[]},Ro.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,i=r.length;r.reserve(t);var n=this.expression.evaluate(new Vn(0),e,{});if("color"===this.type)for(var o=ee(n),a=i;a<t;a++)r.emplaceBack(o[0],o[1]);else{for(var s=i;s<t;s++)r.emplaceBack(n);this.statistics.max=Math.max(this.statistics.max,n)}},Ro.prototype.updatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:0},r,i);if("color"===this.type)for(var a=ee(o),s=t;s<e;s++)n.emplace(s,a[0],a[1]);else{for(var l=t;l<e;l++)n.emplace(l,o);this.statistics.max=Math.max(this.statistics.max,o)}},Ro.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ro.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Ro.prototype.setUniforms=function(t,e){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],0)};var Oo=function(t,e,r,i,n){this.expression=t,this.name=e,this.type=r,this.useIntegerZoom=i,this.zoom=n,this.statistics={max:-1/0};var o="color"===r?bo:xo;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}],this.paintVertexArray=new o};Oo.prototype.defines=function(){return[]},Oo.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,i=r.length;r.reserve(t);var n=this.expression.evaluate(new Vn(this.zoom),e,{}),o=this.expression.evaluate(new Vn(this.zoom+1),e,{});if("color"===this.type)for(var a=ee(n),s=ee(o),l=i;l<t;l++)r.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var u=i;u<t;u++)r.emplaceBack(n,o);this.statistics.max=Math.max(this.statistics.max,n,o)}},Oo.prototype.updatePaintArray=function(t,e,r,i){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},r,i),a=this.expression.evaluate({zoom:this.zoom+1},r,i);if("color"===this.type)for(var s=ee(o),l=ee(a),u=t;u<e;u++)n.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=t;c<e;c++)n.emplace(c,o,a);this.statistics.max=Math.max(this.statistics.max,o,a)}},Oo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Oo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Oo.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},Oo.prototype.setUniforms=function(t,e,r){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],this.interpolationFactor(r.zoom))};var Fo=function(){this.binders={},this.cacheKey="",this._buffers=[],this._idMap={},this._bufferOffset=0};Fo.createDynamic=function(t,e,r){var i=new Fo,n=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Gn&&H(a.property.specification)){var s=re(o,t.type),l=a.property.specification.type,u=a.property.useIntegerZoom;"constant"===a.value.kind?(i.binders[o]=new Bo(a.value,s,l),n.push("/u_"+s)):"source"===a.value.kind?(i.binders[o]=new Ro(a.value,s,l),n.push("/a_"+s)):(i.binders[o]=new Oo(a.value,s,l,u,e),n.push("/z_"+s))}}return i.cacheKey=n.sort().join(""),i},Fo.prototype.populatePaintArrays=function(t,e,r){for(var i in this.binders)this.binders[i].populatePaintArray(t,e);if(e.id){var n=String(e.id);this._idMap[n]=this._idMap[n]||[],this._idMap[n].push({index:r,start:this._bufferOffset,end:t})}this._bufferOffset=t},Fo.prototype.updatePaintArrays=function(t,e,r){var i=!1;for(var n in t){var o=this._idMap[n];if(o)for(var a=t[n],s=0,l=o;s<l.length;s+=1){var u=l[s],c=e.feature(u.index);for(var h in this.binders){var p=this.binders[h];if(!(p instanceof Bo)&&!0===p.expression.isStateDependent){var f=r.paint.get(h);p.expression=f.value,p.updatePaintArray(u.start,u.end,c,a),i=!0}}}}return i},Fo.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},Fo.prototype.setUniforms=function(t,e,r,i){for(var n in this.binders)this.binders[n].setUniforms(t,e,i,r.get(n))},Fo.prototype.getPaintVertexBuffers=function(){return this._buffers},Fo.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var i in this.binders){var n=this.binders[i];(n instanceof Ro||n instanceof Oo)&&n.paintVertexBuffer&&r.push(n.paintVertexBuffer)}this._buffers=r},Fo.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var Vo=function(t,e,r,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var n=0,o=e;n<o.length;n+=1){var a=o[n];this.programConfigurations[a.id]=Fo.createDynamic(a,r,i),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};Vo.prototype.populatePaintArrays=function(t,e,r){for(var i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,r);this.needsUpload=!0},Vo.prototype.updatePaintArrays=function(t,e,r){for(var i=0,n=r;i<n.length;i+=1){var o=n[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,e,o)||this.needsUpload}},Vo.prototype.get=function(t){return this.programConfigurations[t]},Vo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Vo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Zt("ConstantBinder",Bo),Zt("SourceExpressionBinder",Ro),Zt("CompositeExpressionBinder",Oo),Zt("ProgramConfiguration",Fo,{omit:["_buffers"]}),Zt("ProgramConfigurationSet",Vo);var No,jo=8192,Uo=(No=16,{min:-1*Math.pow(2,No-1),max:Math.pow(2,No-1)-1}),$o=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.layoutVertexArray=new io,this.indexArray=new go,this.segments=new Po,this.programConfigurations=new Vo(Lo,t.layers,t.zoom)};$o.prototype.populate=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=i[r],o=n.feature,a=n.index,s=n.sourceLayerIndex;if(this.layers[0]._featureFilter(new Vn(this.zoom),o)){var l=ie(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},$o.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},$o.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},$o.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},$o.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Lo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},$o.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},$o.prototype.addFeature=function(t,e,r){for(var i=0,n=e;i<n.length;i+=1)for(var o=0,a=n[i];o<a.length;o+=1){var s=a[o],l=s.x,u=s.y;if(!(l<0||l>=jo||u<0||u>=jo)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;ne(this.layoutVertexArray,l,u,-1,-1),ne(this.layoutVertexArray,l,u,1,-1),ne(this.layoutVertexArray,l,u,1,1),ne(this.layoutVertexArray,l,u,-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)},Zt("CircleBucket",$o,{omit:["layers"]});var qo={paint:new Jn({"circle-radius":new Xn(mi.paint_circle["circle-radius"]),"circle-color":new Xn(mi.paint_circle["circle-color"]),"circle-blur":new Xn(mi.paint_circle["circle-blur"]),"circle-opacity":new Xn(mi.paint_circle["circle-opacity"]),"circle-translate":new Hn(mi.paint_circle["circle-translate"]),"circle-translate-anchor":new Hn(mi.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Hn(mi.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Hn(mi.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Xn(mi.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Xn(mi.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Xn(mi.paint_circle["circle-stroke-opacity"])})},Zo="undefined"!=typeof Float32Array?Float32Array:Array;Math.PI;var Go,Wo,Ho,Xo,Ko,Yo,Jo,Qo=xe,ta=(Go=_e(),function(t,e,r,i,n,o){var a,s;for(e||(e=3),r||(r=0),s=i?Math.min(i*e+r,t.length):t.length,a=r;a<s;a+=e)Go[0]=t[a],Go[1]=t[a+1],Go[2]=t[a+2],n(Go,Go,o),t[a]=Go[0],t[a+1]=Go[1],t[a+2]=Go[2];return t}),ea=function(){var t=Te();return function(e,r,i,n,o,a){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();
vendor: 13,629 bytes, line 6
6Wo=_e(),Ho=be(1,0,0),Xo=be(0,1,0),Ko=Me(),Yo=Me(),Jo=ge(),!function(){var t;(t=new Zo(2))[0]=0,t[1]=0,t}();var ra=function(t){function e(e){t.call(this,e,qo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new $o(t)},e.prototype.queryRadius=function(t){var e=t;return me("circle-radius",this,e)+me("circle-stroke-width",this,e)+ye(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){for(var l=ve(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e,r){return t.map(function(t){return t.map(function(t){return ke(t,e,r)})})}(l,s,o),p=c?u*a:u,f=0,d=i;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var v=y[m],g=c?v:ke(v,s,o),_=p,x=Ae([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/x[3]),oe(h,g,_))return!0}return!1},e}(Qn),ia=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($o);Zt("HeatmapBucket",ia,{omit:["layers"]});var na=function(t,e){Ie(this,t,1,e)};na.prototype.resize=function(t){Ce(this,t,1)},na.prototype.clone=function(){return new na({width:this.width,height:this.height},new Uint8Array(this.data))},na.copy=function(t,e,r,i,n){Le(t,e,r,i,n,1)};var oa=function(t,e){Ie(this,t,4,e)};oa.prototype.resize=function(t){Ce(this,t,4)},oa.prototype.clone=function(){return new oa({width:this.width,height:this.height},new Uint8Array(this.data))},oa.copy=function(t,e,r,i,n){Le(t,e,r,i,n,4)},Zt("AlphaImage",na),Zt("RGBAImage",oa);var aa={paint:new Jn({"heatmap-radius":new Xn(mi.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Xn(mi.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Hn(mi.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Yn(mi.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Hn(mi.paint_heatmap["heatmap-opacity"])})},sa=function(t){function e(e){t.call(this,e,aa),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new ia(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Pe(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Qn),la={paint:new Jn({"hillshade-illumination-direction":new Hn(mi.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Hn(mi.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Hn(mi.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Hn(mi.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Hn(mi.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Hn(mi.paint_hillshade["hillshade-accent-color"])})},ua=function(t){function e(e){t.call(this,e,la)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Qn),ca=Qt([{name:"a_pos",components:2,type:"Int16"}],4).members,ha=De,pa=De;De.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,a=Math.abs(rr(t,0,o,r));if(n)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;a-=Math.abs(rr(t,u,c,r))}var h=0;for(s=0;s<i.length;s+=3){var p=i[s]*r,f=i[s+1]*r,d=i[s+2]*r;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},De.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r},ha["default"]=pa;var fa=ir,da=ir;fa["default"]=da;var ma=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.layoutVertexArray=new io,this.indexArray=new go,this.indexArray2=new _o,this.programConfigurations=new Vo(ca,t.layers,t.zoom),this.segments=new Po,this.segments2=new Po};ma.prototype.populate=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=i[r],o=n.feature,a=n.index,s=n.sourceLayerIndex;if(this.layers[0]._featureFilter(new Vn(this.zoom),o)){var l=ie(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},ma.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},ma.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ma.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ma.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ca),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ma.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ma.prototype.addFeature=function(t,e,r){for(var i=0,n=ar(e,500);i<n.length;i+=1){for(var o=n[i],a=0,s=0,l=o;s<l.length;s+=1)a+=l[s].length;for(var u=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray),c=u.vertexLength,h=[],p=[],f=0,d=o;f<d.length;f+=1){var m=d[f];if(0!==m.length){m!==o[0]&&p.push(h.length/2);var y=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),v=y.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(v+m.length-1,v),h.push(m[0].x),h.push(m[0].y);for(var g=1;g<m.length;g++)this.layoutVertexArray.emplaceBack(m[g].x,m[g].y),this.indexArray2.emplaceBack(v+g-1,v+g),h.push(m[g].x),h.push(m[g].y);y.vertexLength+=m.length,y.primitiveLength+=m.length}}for(var _=ha(h,p),x=0;x<_.length;x+=3)this.indexArray.emplaceBack(c+_[x],c+_[x+1],c+_[x+2]);u.vertexLength+=a,u.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r)},Zt("FillBucket",ma,{omit:["layers"]});var ya={paint:new Jn({"fill-antialias":new Hn(mi.paint_fill["fill-antialias"]),"fill-opacity":new Xn(mi.paint_fill["fill-opacity"]),"fill-color":new Xn(mi.paint_fill["fill-color"]),"fill-outline-color":new Xn(mi.paint_fill["fill-outline-color"]),"fill-translate":new Hn(mi.paint_fill["fill-translate"]),"fill-translate-anchor":new Hn(mi.paint_fill["fill-translate-anchor"]),"fill-pattern":new Kn(mi.paint_fill["fill-pattern"])})},va=function(t){function e(e){t.call(this,e,ya)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(t){this.paint=this._transitioningPaint.possiblyEvaluate(t);var e=this.paint._values["fill-outline-color"];"constant"===e.value.kind&&void 0===e.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new ma(t)},e.prototype.queryRadius=function(){return ye(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return ae(ve(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},e}(Qn),ga=Qt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,_a=Math.pow(2,13),xa=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.layoutVertexArray=new oo,this.indexArray=new go,this.programConfigurations=new Vo(ga,t.layers,t.zoom),this.segments=new Po};xa.prototype.populate=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=i[r],o=n.feature,a=n.index,s=n.sourceLayerIndex;if(this.layers[0]._featureFilter(new Vn(this.zoom),o)){var l=ie(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},xa.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},xa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ga),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},xa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xa.prototype.addFeature=function(t,e,r){for(var i=0,n=ar(e,500);i<n.length;i+=1){for(var o=n[i],a=0,s=0,l=o;s<l.length;s+=1)a+=l[s].length;for(var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=o;c<h.length;c+=1){var p=h[c];if(0!==p.length&&!cr(p))for(var f=0,d=0;d<p.length;d++){var m=p[d];if(d>=1){var y=p[d-1];if(!ur(m,y)){u.vertexLength+4>Po.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=m.sub(y)._perp()._unit(),g=y.dist(m);f+g>32768&&(f=0),lr(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,f),lr(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,f),f+=g,lr(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,f),lr(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,f);var _=u.vertexLength;this.indexArray.emplaceBack(_,_+1,_+2),this.indexArray.emplaceBack(_+1,_+2,_+3),u.vertexLength+=4,u.primitiveLength+=2}}}}u.vertexLength+a>Po.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray));for(var x=[],b=[],w=u.vertexLength,E=0,S=o;E<S.length;E+=1){var T=S[E];if(0!==T.length){T!==o[0]&&b.push(x.length/2);for(var z=0;z<T.length;z++){var A=T[z];lr(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),x.push(A.x),x.push(A.y)}}}for(var M=ha(x,b),k=0;k<M.length;k+=3)this.indexArray.emplaceBack(w+M[k],w+M[k+1],w+M[k+2]);u.primitiveLength+=M.length/3,u.vertexLength+=a}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r)},Zt("FillExtrusionBucket",xa,{omit:["layers"]});var ba={paint:new Jn({"fill-extrusion-opacity":new Hn(mi["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Xn(mi["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Hn(mi["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Hn(mi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Kn(mi["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Xn(mi["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Xn(mi["paint_fill-extrusion"]["fill-extrusion-base"])})},wa=function(t){function e(e){t.call(this,e,ba)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new xa(t)},e.prototype.queryRadius=function(){return ye(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return ae(ve(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,a),i)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},e}(Qn),Ea=Qt([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Sa=hr;hr.types=["Unknown","Point","LineString","Polygon"],hr.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,n=0,o=0,a=0,s=[];t.pos<r;){if(n<=0){var l=t.readVarint();i=7&l,n=l>>3}if(n--,1===i||2===i)o+=t.readSVarint(),a+=t.readSVarint(),1===i&&(e&&s.push(e),e=[]),e.push(new oi(o,a));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&s.push(e),s},hr.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},hr.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],i=180-360*(r.y+l)/a;t[e]=[360*(r.x+s)/a-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180)
6)-90]}}var n,o,a=this.extent*Math.pow(2,r),s=this.extent*t,l=this.extent*e,u=this.loadGeometry(),c=hr.types[this.type];switch(this.type){case 1:var h=[];for(n=0;n<u.length;n++)h[n]=u[n][0];i(u=h);break;case 2:for(n=0;n<u.length;n++)i(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=fr(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}return r&&n.push(r),n}(u),n=0;n<u.length;n++)for(o=0;o<u[n].length;o++)i(u[n][o])}1===u.length?u=u[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Ta=dr;dr.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 Sa(this._pbf,e,this.extent,this._keys,this._values)};var za={VectorTile:function(t,e){this.layers=t.readFields(yr,{},e)},VectorTileFeature:Sa,VectorTileLayer:Ta},Aa=za.VectorTileFeature.types,Ma=63,ka=Math.cos(Math.PI/180*37.5),Ia=.5,Ca=Math.pow(2,14)/Ia,La=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.layoutVertexArray=new ao,this.indexArray=new go,this.programConfigurations=new Vo(Ea,t.layers,t.zoom),this.segments=new Po};La.prototype.populate=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=i[r],o=n.feature,a=n.index,s=n.sourceLayerIndex;if(this.layers[0]._featureFilter(new Vn(this.zoom),o)){var l=ie(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},La.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},La.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},La.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload; 7},La.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ea),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},La.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},La.prototype.addFeature=function(t,e,r){for(var i=this.layers[0].layout,n=i.get("line-join").evaluate(t,{}),o=i.get("line-cap"),a=i.get("line-miter-limit"),s=i.get("line-round-limit"),l=0,u=e;l<u.length;l+=1){var c=u[l];this.addLine(c,t,n,o,a,s,r)}},La.prototype.addLine=function(t,e,r,i,n,o,a){var s=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(s={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var l="Polygon"===Aa[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c<u-1&&t[c].equals(t[c+1]);)c++;if(!(u<(l?3:2))){s&&(s.tileTotal=function(t,e,r){for(var i,n,o=0,a=e;a<r-1;a++)i=t[a],n=t[a+1],o+=i.dist(n);return o}(t,c,u)),"bevel"===r&&(n=1.05);var h=jo/(512*this.overscaling)*15,p=t[c],f=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray);this.distance=0;var d,m,y,v=i,g=l?"butt":i,_=!0,x=void 0,b=void 0,w=void 0,E=void 0;this.e1=this.e2=this.e3=-1,l&&(d=t[u-2],E=p.sub(d)._unit()._perp());for(var S=c;S<u;S++)if(!(b=l&&S===u-1?t[c+1]:t[S+1])||!t[S].equals(b)){E&&(w=E),d&&(x=d),d=t[S],E=b?b.sub(d)._unit()._perp():w;var T=(w=w||E).add(E);0===T.x&&0===T.y||T._unit();var z=T.x*E.x+T.y*E.y,A=0!==z?1/z:1/0,M=z<ka&&x&&b;if(M&&S>c){var k=d.dist(x);if(k>2*h){var I=d.sub(d.sub(x)._mult(h/k)._round());this.distance+=I.dist(x),this.addCurrentVertex(I,this.distance,w.mult(1),0,0,!1,f,s),x=I}}var C=x&&b,L=C?r:b?v:g;if(C&&"round"===L&&(A<o?L="miter":A<=2&&(L="fakeround")),"miter"===L&&A>n&&(L="bevel"),"bevel"===L&&(A>2&&(L="flipbevel"),A<n&&(L="miter")),x&&(this.distance+=d.dist(x)),"miter"===L)T._mult(A),this.addCurrentVertex(d,this.distance,T,0,0,!1,f,s);else if("flipbevel"===L){if(A>100)T=E.clone().mult(-1);else{var P=w.x*E.y-w.y*E.x>
70?-1:1,D=A*w.add(E).mag()/w.sub(E).mag();T._perp()._mult(D*P)}this.addCurrentVertex(d,this.distance,T,0,0,!1,f,s),this.addCurrentVertex(d,this.distance,T.mult(-1),0,0,!1,f,s)}else if("bevel"===L||"fakeround"===L){var B=w.x*E.y-w.y*E.x>0,R=-Math.sqrt(A*A-1);if(B?(y=0,m=R):(m=0,y=R),_||this.addCurrentVertex(d,this.distance,w,m,y,!1,f,s),"fakeround"===L){for(var O=Math.floor(8*(.5-(z-.5))),F=void 0,V=0;V<O;V++)F=E.mult((V+1)/(O+1))._add(w)._unit(),this.addPieSliceVertex(d,this.distance,F,B,f,s);this.addPieSliceVertex(d,this.distance,T,B,f,s);for(var N=O-1;N>=0;N--)F=w.mult((N+1)/(O+1))._add(E)._unit(),this.addPieSliceVertex(d,this.distance,F,B,f,s)}b&&this.addCurrentVertex(d,this.distance,E,-m,-y,!1,f,s)}else"butt"===L?(_||this.addCurrentVertex(d,this.distance,w,0,0,!1,f,s),b&&this.addCurrentVertex(d,this.distance,E,0,0,!1,f,s)):"square"===L?(_||(this.addCurrentVertex(d,this.distance,w,1,1,!1,f,s),this.e1=this.e2=-1),b&&this.addCurrentVertex(d,this.distance,E,-1,-1,!1,f,s)):"round"===L&&(_||(this.addCurrentVertex(d,this.distance,w,0,0,!1,f,s),this.addCurrentVertex(d,this.distance,w,1,1,!0,f,s),this.e1=this.e2=-1),b&&(this.addCurrentVertex(d,this.distance,E,-1,-1,!0,f,s),this.addCurrentVertex(d,this.distance,E,0,0,!1,f,s)));if(M&&S<u-1){var j=d.dist(b);if(j>2*h){var U=d.add(b.sub(d)._mult(h/j)._round());this.distance+=U.dist(d),this.addCurrentVertex(U,this.distance,E.mult(1),0,0,!1,f,s),d=U}}_=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a)}},La.prototype.addCurrentVertex=function(t,e,r,i,n,o,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=gr(e,s)),l=r.clone(),i&&l._sub(r.perp()._mult(i)),vr(u,t,l,o,!1,i,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),n&&l._sub(r.perp()._mult(n)),vr(u,t,l,o,!0,-n,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>Ca/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,i,n,o,a))},La.prototype.addPieSliceVertex=function(t,e,r,i,n,o){r=r.mult(i?-1:1);var a=this.layoutVertexArray,s=this.indexArray;o&&(e=gr(e,o)),vr(a,t,r,!1,i,0,e),this.e3=n.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),n.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},Zt("LineBucket",La,{omit:["layers"]});var Pa=new Jn({"line-cap":new Hn(mi.layout_line["line-cap"]),"line-join":new Xn(mi.layout_line["line-join"]),"line-miter-limit":new Hn(mi.layout_line["line-miter-limit"]),"line-round-limit":new Hn(mi.layout_line["line-round-limit"])}),Da={paint:new Jn({"line-opacity":new Xn(mi.paint_line["line-opacity"]),"line-color":new Xn(mi.paint_line["line-color"]),"line-translate":new Hn(mi.paint_line["line-translate"]),"line-translate-anchor":new Hn(mi.paint_line["line-translate-anchor"]),"line-width":new Xn(mi.paint_line["line-width"]),"line-gap-width":new Xn(mi.paint_line["line-gap-width"]),"line-offset":new Xn(mi.paint_line["line-offset"]),"line-blur":new Xn(mi.paint_line["line-blur"]),"line-dasharray":new Kn(mi.paint_line["line-dasharray"]),"line-pattern":new Kn(mi.paint_line["line-pattern"]),"line-gradient":new Yn(mi.paint_line["line-gradient"])}),layout:Pa},Ba=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Vn(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,n){return r=l({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}(Xn))(Da.paint.properties["line-width"].specification);Ba.useIntegerZoom=!0;var Ra=function(t){function e(e){t.call(this,e,Da)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Pe(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Ba.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}
vendor: 6,174 bytes, line 7
7,e.prototype.createBucket=function(t){return new La(t)},e.prototype.queryRadius=function(t){var e=t,r=_r(me("line-width",this,e),me("line-gap-width",this,e)),i=me("line-offset",this,e);return r/2+Math.abs(i)+ye(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){var s=ve(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,a),l=a/2*_r(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(i=function(t,e){for(var r=[],i=new oi(0,0),n=0;n<t.length;n++){for(var o=t[n],a=[],s=0;s<o.length;s++){var l=o[s-1],u=o[s],c=o[s+1],h=0===s?i:u.sub(l)._unit()._perp(),p=s===o.length-1?i:c.sub(u)._unit()._perp(),f=h._add(p)._unit(),d=f.x*p.x+f.y*p.y;f._mult(1/d),a.push(f._mult(e)._add(u))}r.push(a)}return r}(i,u*a)),se(s,i,l)},e}(Qn),Oa=Qt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Fa=Qt([{name:"a_projected_pos",components:3,type:"Float32"}],4),Va=(Qt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qt([{name:"a_placed",components:2,type:"Uint8"}],4)),Na=(Qt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Qt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ja=Qt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Qt([{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:"hidden"}]),Qt([{type:"Float32",name:"offsetX"}]),Qt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ua={"!":"ï¸","#":"ï¼",$:"ï¼","%":"ï¼
","&":"ï¼","(":"︵",")":"︶","*":"ï¼","+":"ï¼",",":"ï¸","-":"︲",".":"ã»","/":"ï¼",":":"ï¸",";":"ï¸","<":"︿","=":"ï¼",">":"ï¹","?":"ï¸","@":"ï¼ ","[":"ï¹","\\":"ï¼¼","]":"ï¹","^":"ï¼¾",_:"︳","`":"ï½","{":"︷","|":"â","}":"︸","~":"ï½","¢":"ï¿ ","£":"ï¿¡","Â¥":"ï¿¥","¦":"¦","¬":"ï¿¢","¯":"ï¿£","â":"︲","â":"︱","â":"ï¹","â":"ï¹","â":"ï¹","â":"ï¹","â¦":"ï¸","â§":"ã»","â©":"₩","ã":"ï¸","ã":"ï¸","ã":"︿","ã":"ï¹","ã":"︽","ã":"︾","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"ï¹","ã":"︻","ã":"︼","ã":"︹","ã":"︺","ã":"ï¸","ã":"ï¸","ï¼":"ï¸","ï¼":"︵","ï¼":"︶","ï¼":"ï¸","ï¼":"︲","ï¼":"ã»","ï¼":"ï¸","ï¼":"ï¸","ï¼":"︿","ï¼":"ï¹","ï¼":"ï¸","ï¼»":"ï¹","ï¼½":"ï¹","_":"︳","ï½":"︷","ï½":"â","ï½":"︸","ï½":"︵","ï½ ":"︶","。":"ï¸","ï½¢":"ï¹","ï½£":"ï¹"},$a=function(t){function e(e,r,i,n){t.call(this,e,r),this.angle=i,void 0!==n&&(this.segment=n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(oi);Zt("Anchor",$a);var qa=za.VectorTileFeature.types,Za=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],Ga=function(t){this.layoutVertexArray=new so,this.indexArray=new go,this.programConfigurations=t,this.segments=new Po,this.dynamicLayoutVertexArray=new lo,this.opacityVertexArray=new uo,this.placedSymbolArray=new To};Ga.prototype.upload=function(t,e,r,i){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Oa.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Fa.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Za,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t)},Ga.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Zt("SymbolBuffers",Ga);var Wa=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Po,this.collisionVertexArray=new po};Wa.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Va.members,!0)},Wa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Zt("CollisionBuffers",Wa);var Ha=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=br(this.zoom,e["text-size"]),this.iconSizeData=br(this.zoom,e["icon-size"]);var r=this.layers[0].layout;this.sortFeaturesByY=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sourceID=t.sourceID};Ha.prototype.createArrays=function(){this.text=new Ga(new Vo(Oa.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new Ga(new Vo(Oa.members,this.layers,this.zoom,function(t){return/^icon/.test(t)}
7)),this.collisionBox=new Wa(ho,Na.members,_o),this.collisionCircle=new Wa(ho,ja.members,go),this.glyphOffsetArray=new Ao,this.lineVertexArray=new ko},Ha.prototype.populate=function(t,e){var r=this.layers[0],i=r.layout,n=i.get("text-font"),o=i.get("text-field"),a=i.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.length>0)&&("constant"!==n.value.kind||n.value.value.length>0),l="constant"!==a.value.kind||a.value.value&&a.value.value.length>0;if(this.features=[],s||l){for(var u=e.iconDependencies,c=e.glyphDependencies,h=new Vn(this.zoom),p=0,f=t;p<f.length;p+=1){var d=f[p],m=d.feature,y=d.index,v=d.sourceLayerIndex;if(r._featureFilter(h,m)){var g=void 0;s&&(g=xr(g=r.getValueAndResolveTokens("text-field",m),r,m));var _=void 0;if(l&&(_=r.getValueAndResolveTokens("icon-image",m)),g||_){var x={text:g,icon:_,index:y,sourceLayerIndex:v,geometry:ie(m),properties:m.properties,type:qa[m.type]};if(void 0!==m.id&&(x.id=m.id),this.features.push(x),_&&(u[_]=!0),g)for(var b=n.evaluate(m,{}).join(","),w=c[b]=c[b]||{},E="map"===i.get("text-rotation-alignment")&&"line"===i.get("symbol-placement"),S=Ht(g),T=0;T<g.length;T++)if(w[g.charCodeAt(T)]=!0,E&&S){var z=Ua[g.charAt(T)];z&&(w[z.charCodeAt(0)]=!0)}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){function e(e){s.push(t[e]),l++}function r(t,e,r){var i=a[t];return delete a[t],a[e]=i,s[i].geometry[0].pop(),s[i].geometry[0]=s[i].geometry[0].concat(r[0]),i}function i(t,e,r){var i=o[e];return delete o[e],o[t]=i,s[i].geometry[0].shift(),s[i].geometry[0]=r[0].concat(s[i].geometry[0]),i}function n(t,e,r){var i=r?e[0][e[0].length-1]:e[0][0];return t+":"+i.x+":"+i.y}for(var o={},a={},s=[],l=0,u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.text;if(p){var f=n(p,h),d=n(p,h,!0);if(f in a&&d in o&&a[f]!==o[d]){var m=i(f,d,h),y=r(f,d,s[m].geometry);delete o[f],delete a[d],a[n(p,s[y].geometry,!0)]=y,s[m].geometry=null}else f in a?r(f,d,h):d in o?i(f,d,h):(e(u),o[f]=l-1,a[d]=l-1)}else e(u)}return s.filter(function(t){return t.geometry})}(this.features))}},Ha.prototype.update=function(t,e){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers))},Ha.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ha.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ha.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ha.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},Ha.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ha.prototype.addSymbols=function(t,e,r,i,n,o,a,s,l,u){for(var c=t.indexArray,h=t.layoutVertexArray,p=t.dynamicLayoutVertexArray,f=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),d=this.glyphOffsetArray.length,m=f.vertexLength,y=0,v=e;y<v.length;y+=1){var g=v[y],_=g.tl,x=g.tr,b=g.bl,w=g.br,E=g.tex,S=f.vertexLength,T=g.glyphOffset[1];wr(h,s.x,s.y,_.x,T+_.y,E.x,E.y,r),wr(h,s.x,s.y,x.x,T+x.y,E.x+E.w,E.y,r),wr(h,s.x,s.y,b.x,T+b.y,E.x,E.y+E.h,r),wr(h,s.x,s.y,w.x,T+w.y,E.x+E.w,E.y+E.h,r),Er(p,s,0),c.emplaceBack(S,S+1,S+2),c.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(g.glyphOffset[0])}t.placedSymbolArray.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,m,l,u,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,!1),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index)},Ha.prototype._addCollisionDebugVertex=function(t,e,r,i,n){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i.x,i.y,Math.round(n.x),Math.round(n.y))},Ha.prototype.addCollisionDebugVertices=function(t,e,r,i,n,o,a,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),u=l.vertexLength,c=n.layoutVertexArray,h=n.collisionVertexArray;
7if(this._addCollisionDebugVertex(c,h,o,a.anchor,new oi(t,e)),this._addCollisionDebugVertex(c,h,o,a.anchor,new oi(r,e)),this._addCollisionDebugVertex(c,h,o,a.anchor,new oi(r,i)),this._addCollisionDebugVertex(c,h,o,a.anchor,new oi(t,i)),l.vertexLength+=4,s){var p=n.indexArray;p.emplaceBack(u,u+1,u+2),p.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var f=n.indexArray;f.emplaceBack(u,u+1),f.emplaceBack(u+1,u+2),f.emplaceBack(u+2,u+3),f.emplaceBack(u+3,u),l.primitiveLength+=4}},Ha.prototype.generateCollisionDebugBuffers=function(){for(var t=0,e=this.symbolInstances;t<e.length;t+=1){var r=e[t];r.textCollisionFeature={boxStartIndex:r.textBoxStartIndex,boxEndIndex:r.textBoxEndIndex},r.iconCollisionFeature={boxStartIndex:r.iconBoxStartIndex,boxEndIndex:r.iconBoxEndIndex};for(var i=0;i<2;i++){var n=r[0===i?"textCollisionFeature":"iconCollisionFeature"];if(n)for(var o=n.boxStartIndex;o<n.boxEndIndex;o++){var a=this.collisionBoxArray.get(o),s=a.x1,l=a.y1,u=a.x2,c=a.y2,h=a.radius>0;this.addCollisionDebugVertices(s,l,u,c,h?this.collisionCircle:this.collisionBox,a.anchorPoint,r,h)}}}},Ha.prototype.deserializeCollisionBoxes=function(t,e,r,i,n){for(var o={},a=e;a<r;a++){var s=t.get(a);if(0===s.radius){o.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},o.textFeatureIndex=s.featureIndex;break}o.textCircles||(o.textCircles=[],o.textFeatureIndex=s.featureIndex),o.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=i;l<n;l++){var u=t.get(l);if(0===u.radius){o.iconBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY},o.iconFeatureIndex=u.featureIndex;break}}return o},Ha.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ha.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ha.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ha.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ha.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var r=[],i=0;i<this.symbolInstances.length;i++)r.push(i);var n=Math.sin(t),o=Math.cos(t);r.sort(function(t,r){var i=e.symbolInstances[t],a=e.symbolInstances[r];return(n*i.anchor.x+o*i.anchor.y|0)-(n*a.anchor.x+o*a.anchor.y|0)||a.featureIndex-i.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var a=0,s=r;a<s.length;a+=1){var l=s[a],u=e.symbolInstances[l];e.featureSortOrder.push(u.featureIndex);for(var c=0,h=u.placedTextSymbolIndices;c<h.length;c+=1)for(var p=h[c],f=e.text.placedSymbolArray.get(p),d=f.vertexStartIndex+4*f.numGlyphs,m=f.vertexStartIndex;m<d;m+=4)e.text.indexArray.emplaceBack(m,m+1,m+2),e.text.indexArray.emplaceBack(m+1,m+2,m+3);var y=e.icon.placedSymbolArray.get(l);if(y.numGlyphs){var v=y.vertexStartIndex;e.icon.indexArray.emplaceBack(v,v+1,v+2),e.icon.indexArray.emplaceBack(v+1,v+2,v+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Zt("SymbolBucket",Ha,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),Ha.MAX_GLYPHS=65535,Ha.addDynamicAttributes=Er;var Xa=new Jn({"symbol-placement":new Hn(mi.layout_symbol["symbol-placement"]),"symbol-spacing":new Hn(mi.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Hn(mi.layout_symbol["symbol-avoid-edges"]),"icon-allow-overlap":new Hn(mi.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Hn(mi.layout_symbol["icon-ignore-placement"]),"icon-optional":new Hn(mi.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Hn(mi.layout_symbol["icon-rotation-alignment"]),"icon-size":new Xn(mi.layout_symbol["icon-size"]),"icon-text-fit":new Hn(mi.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Hn(mi.layout_symbol["icon-text-fit-padding"]),"icon-image":new Xn(mi.layout_symbol["icon-image"]),"icon-rotate":new Xn(mi.layout_symbol["icon-rotate"]),"icon-padding":new Hn(mi.layout_symbol["icon-padding"]),"icon-keep-upright":new Hn(mi.layout_symbol["icon-keep-upright"]),"icon-offset":new Xn(mi.layout_symbol["icon-offset"]),"icon-anchor":new Xn(mi.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Hn(mi.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Hn(mi.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Hn(mi.layout_symbol["text-rotation-alignment"]),"text-field":new Xn(mi.layout_symbol["text-field"]),"text-font":new Xn(mi.layout_symbol["text-font"]),"text-size":new Xn(mi.layout_symbol["text-size"]),"text-max-width":new Xn(mi.layout_symbol["text-max-width"]),"text-line-height":new Hn(mi.layout_symbol["text-line-height"]),"text-letter-spacing":new Xn(mi.layout_symbol["text-letter-spacing"]),"text-justify":new Xn(mi.layout_symbol["text-justify"]),"text-anchor":new Xn(mi.layout_symbol["text-anchor"]),"text-max-angle":new Hn(mi.layout_symbol["text-max-angle"]),"text-rotate":new Xn(mi.layout_symbol["text-rotate"]),"text-padding":new Hn(mi.layout_symbol["text-padding"]),"text-keep-upright":new Hn(mi.layout_symbol["text-keep-upright"]),"text-transform":new Xn(mi.layout_symbol["text-transform"]),"text-offset":new Xn(mi.layout_symbol["text-offset"]),"text-allow-overlap":new Hn(mi.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Hn(mi.layout_symbol["text-ignore-placement"]),"text-optional":new Hn(mi.layout_symbol["text-optional"])}),Ka={paint:new Jn({"icon-opacity":new Xn(mi.paint_symbol["icon-opacity"]),"icon-color":new Xn(mi.paint_symbol["icon-color"]),"icon-halo-color":new Xn(mi.paint_symbol["icon-halo-color"]),"icon-halo-width":new Xn(mi.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Xn(mi.paint_symbol["icon-halo-blur"]),"icon-translate":new Hn(mi.paint_symbol["icon-translate"]),"icon-translate-anchor":new Hn(mi.paint_symbol["icon-translate-anchor"]),"text-opacity":new Xn(mi.paint_symbol["text-opacity"]),"text-color":new Xn(mi.paint_symbol["text-color"]),"text-halo-color":new Xn(mi.paint_symbol["text-halo-color"]),"text-halo-width":new Xn(mi.paint_symbol["text-halo-width"]),"text-halo-blur":new Xn(mi.paint_symbol["text-halo-blur"]),"text-translate":new Hn(mi.paint_symbol["text-translate"]),"text-translate-anchor":new Hn(mi.paint_symbol["text-translate-anchor"])}),layout:Xa},Ya=function(t){function e(e){t.call(this,e,Ka)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="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"))},e.prototype.getValueAndResolveTokens=function(t,e){var r,i=this.layout.get(t).evaluate(e,{}),n=this._unevaluatedLayout._values[t];return n.isDataDriven()||pt(n.value)?i:(r=e.properties,i.replace(/{([^{}]+)}/g,function(t,e){return e in r?String(r[e]):""}))},e.prototype.createBucket=function(t){return new Ha(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e}(Qn),Ja={paint:new Jn({"background-color":new Hn(mi.paint_background["background-color"]),"background-pattern":new Kn(mi.paint_background["background-pattern"]),"background-opacity":new Hn(mi.paint_background["background-opacity"])})},Qa=function(t){function e(e){t.call(this,e,Ja)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Qn),ts={paint:new Jn({"raster-opacity":new Hn(mi.paint_raster["raster-opacity"]),"raster-hue-rotate":new Hn(mi.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Hn(mi.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Hn(mi.paint_raster["raster-brightness-max"]),"raster-saturation":new Hn(mi.paint_raster["raster-saturation"]),"raster-contrast":new Hn(mi.paint_raster["raster-contrast"]),"raster-fade-duration":new Hn(mi.paint_raster["raster-fade-duration"])})},es={circle:ra,heatmap:sa,hillshade:ua,fill:va,"fill-extrusion":wa,line:Ra,symbol:Ya,background:Qa,raster:function(t){function e(e){t.call(this,e,ts)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Qn)},rs=r(function(t,e){t.exports=function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,i,n,o,a=[],s=0;s<t.length;s++)if(r=t[s].w||t[s].width,i=t[s].h||t[s].height,n=t[s].id,r&&i){if(!(o=this.packOne(r,i,n)))continue;e.inPlace&&(t[s].x=o.x,t[s].y=o.y,t[s].id=o.id),a.push(o)}return this.shrink(),a},t.prototype.packOne=function(t,r,i){var n,o,a,s,l,u,c,h,p={freebin:-1,shelf:-1,waste:1/0},f=0;if("string"==typeof i||"number"==typeof i){if(n=this.getBin(i))return this.ref(n),n;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(s=0;s<this.freebins.length;s++){if(r===(n=this.freebins[s]).maxh&&t===n.maxw)return this.allocFreebin(s,t,r,i);r>n.maxh||t>n.maxw||r<=n.maxh&&t<=n.maxw&&(a=n.maxw*n.maxh-t*r)<p.waste&&(p.waste=a,p.freebin=s)}for(s=0;s<this.shelves.length;s++)if(f+=(o=this.shelves[s]).h,!(t>o.free)){if(r===o.h)return this.allocShelf(s,t,r,i);r>o.h||r<o.h&&(a=(o.h-r)*t)<p.waste&&(p.freebin=-1,p.waste=a,p.shelf=s)}return-1!==p.freebin?this.allocFreebin(p.freebin,t,r,i):-1!==p.shelf?this.allocShelf(p.shelf,t,r,i
7):r<=this.h-f&&t<=this.w?(o=new e(f,this.w,r),this.allocShelf(this.shelves.push(o)-1,t,r,i)):this.autoResize?(l=u=this.h,((c=h=this.w)<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r,i)):null},t.prototype.allocFreebin=function(t,e,r,i){var n=this.freebins.splice(t,1)[0];return n.id=i,n.w=e,n.h=r,n.refcount=0,this.bins[i]=n,this.ref(n),n},t.prototype.allocShelf=function(t,e,r,i){var n=this.shelves[t].alloc(e,r,i);return this.bins[i]=n,this.ref(n),n},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,r=0;r<this.shelves.length;r++){var i=this.shelves[r];e+=i.h,t=Math.max(i.w-i.free,t)}this.resize(t,e)}},t.prototype.getBin=function(t){return this.bins[t]},t.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},t.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},t.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e,r){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new function(t,e,r,i,n,o,a){this.id=t,this.x=e,this.y=r,this.w=i,this.h=n,this.maxw=o||i,this.maxh=a||n,this.refcount=0}(r,i,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t}()}),is=function(t,e){var r=e.pixelRatio;this.paddedRect=t,this.pixelRatio=r},ns={tl:{configurable:!0},br:{configurable:!0},displaySize:{configurable:!0}};ns.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},ns.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ns.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(is.prototype,ns);var os=function(t){var e=new oa({width:0,height:0}),r={},i=new rs(0,0,{autoResize:!0});for(var n in t){var o=t[n],a=i.packOne(o.data.width+2,o.data.height+2);e.resize({width:i.w,height:i.h}),oa.copy(o.data,e,{x:0,y:0},{x:a.x+1,y:a.y+1},o.data),r[n]=new is(a,o)}i.shrink(),e.resize({width:i.w,height:i.h}),this.image=e,this.positions=r};Zt("ImagePosition",is),Zt("ImageAtlas",os);var as=self.HTMLImageElement,ss=self.HTMLCanvasElement,ls=self.HTMLVideoElement,us=self.ImageData,cs=function(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)};cs.prototype.update=function(t,e){var r=t.width,i=t.height,n=!this.size||this.size[0]!==r||this.size[1]!==i,o=this.context,a=o.gl;this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),n?(this.size=[r,i],o.pixelStoreUnpack.set(1),this.format!==a.RGBA||e&&!1===e.premultiply||o.pixelStoreUnpackPremultiplyAlpha.set(!0),t instanceof as||t instanceof ss||t instanceof ls||t instanceof us?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,r,i,0,this.format,a.UNSIGNED_BYTE,t.data)):t instanceof as||t instanceof ss||t instanceof ls||t instanceof us?a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,0,0,r,i,a.RGBA,a.UNSIGNED_BYTE,t.data),this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)},cs.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},cs.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},cs.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var hs=function(t,e,r,i,n){var o,a,s=8*n-i-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?n-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=u}return(f?-1:1)*a*Math.pow(2,o-i); 8},ps=function(t,e,r,i,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,h=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[r+f]=255&s,f+=d,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m},fs=Sr;Sr.Varint=0,Sr.Fixed64=1,Sr.Bytes=2,Sr.Fixed32=5,Sr.prototype={de
vendor: 5,618 bytes, line 8
8stroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Or(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Vr(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Or(this.buf,this.pos)+4294967296*Or(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Or(this.buf,this.pos)+4294967296*Vr(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=hs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=hs(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,n,o=r.buf;if(n=o[r.pos++],i=(112&n)>>4,n<128)return zr(t,i,e);if(n=o[r.pos++],i|=(127&n)<<3,n<128)return zr(t,i,e);if(n=o[r.pos++],i|=(127&n)<<10,n<128)return zr(t,i,e);if(n=o[r.pos++],i|=(127&n)<<17,n<128)return zr(t,i,e);if(n=o[r.pos++],i|=(127&n)<<24,n<128)return zr(t,i,e);if(n=o[r.pos++],i|=(1&n)<<31,n<128)return zr(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=function(t,e,r){for(var i="",n=e;n<r;){var o,a,s,l=t[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=Tr(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=Tr(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Sr.Varint)for(;this.buf[this.pos++]>127;);else if(e===Sr.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Sr.Fixed32)this.pos+=4;else{if(e!==Sr.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Fr(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Fr(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Fr(this.buf,-1&t,this.pos),Fr(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Fr(this.buf,-1&t,this.pos),Fr(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,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,t>>>=7,r.buf[r.pos]=127&t}(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,n,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>
855295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=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&&Ar(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ps(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ps(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&Ar(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,Sr.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,Mr,e)},writePackedSVarint:function(t,e){this.writeMessage(t,kr,e)},writePackedBoolean:function(t,e){this.writeMessage(t,Lr,e)},writePackedFloat:function(t,e){this.writeMessage(t,Ir,e)},writePackedDouble:function(t,e){this.writeMessage(t,Cr,e)},writePackedFixed32:function(t,e){this.writeMessage(t,Pr,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,Dr,e)},writePackedFixed64:function(t,e){this.writeMessage(t,Br,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,Rr,e)},writeBytesField:function(t,e){this.writeTag(t,Sr.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Sr.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Sr.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Sr.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Sr.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Sr.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Sr.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Sr.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Sr.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Sr.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ds=3,ms=ds,ys=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,c(["receive"],this),this.target.addEventListener("message",this.receive,!1)};ys.prototype.send=function(t,e,r,i){var n=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[n]=r);var o=[];this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(n),data:Gt(e,o)},o)},ys.prototype.receive=function(t){var e,r=this,i=t.data,n=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var o=function(t,e){var i=[];r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(n),error:t?Gt(t):null,data:Gt(e,i)},i)};if("<response>"===i.type)e=this.callbacks[i.id],delete this.callbacks[i.id],e&&i.error?e(Wt(i.error)):e&&e(null,Wt(i.data));else if(void 0!==i.id&&this.parent[i.type])this.parent[i.type](i.sourceMapId,Wt(i.data),o);
8else if(void 0!==i.id&&this.parent.getWorkerSource){var a=i.type.split("."),s=Wt(i.data);this.parent.getWorkerSource(i.sourceMapId,a[0],s.source)[a[1]](s,o)}else this.parent[i.type](Wt(i.data))}},ys.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var vs=r(function(t,e){!function(t){function e(t,e,i){e=Math.pow(2,i)-e-1;var n=r(256*t,256*e,i),o=r(256*(t+1),256*(e+1),i);return n[0]+","+n[1]+","+o[0]+","+o[1]}function r(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r),n=t*i-2*Math.PI*6378137/2,o=e*i-2*Math.PI*6378137/2;return[n,o]}t.getURL=function(t,r,i,n,o,a){return a=a||{},t+"?"+["bbox="+e(i,n,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0})}(e)});e(vs);var gs=vs.getTileBBox,_s=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=$r(0,t,e,r)};_s.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},_s.prototype.url=function(t,e){var r=gs(this.x,this.y,this.z),i=function(t,e,r){for(var i,n="",o=t;o>0;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",i).replace("{bbox-epsg-3857}",r)};var xs=function(t,e){this.wrap=t,this.canonical=e,this.key=$r(t,e.z,e.x,e.y)},bs=function(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new _s(r,(+i),(+n)),this.key=$r(e,t,i,n)};bs.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},bs.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new bs(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bs(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},bs.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},bs.prototype.children=function(t){if(this.overscaledZ>=t)return[new bs(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 bs(e,this.wrap,e,r,i),new bs(e,this.wrap,e,r+1,i),new bs(e,this.wrap,e,r,i+1),new bs(e,this.wrap,e,r+1,i+1)]},bs.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},bs.prototype.wrapped=function(){return new bs(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},bs.prototype.unwrapTo=function(t){return new bs(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},bs.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},bs.prototype.toUnwrapped=function(){return new xs(this.wrap,this.canonical)},bs.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},bs.prototype.toCoordinate=function(){return new ni(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)},Zt("CanonicalTileID",_s),Zt("OverscaledTileID",bs,{omit:["posMatrix"]});var ws=function(t,e,r){if(t<=0)throw new RangeError("Level must have positive dimension");this.dim=t,this.border=e,this.stride=this.dim+2*this.border,this.data=r||new Int32Array((this.dim+2*this.border)*(this.dim+2*this.border))};ws.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},ws.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},ws.prototype._idx=function(t,e){if(t<-this.border||t>=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)},Zt("Level",ws);var Es=function(t,e,r){this.uid=t,this.scale=e||1,this.level=r||new ws(256,512),this.loaded=!!r};Es.prototype.loadFromImage=function(t,e){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");if(e&&"mapbox"!==e&&"terrarium"!==e)return m('"'+e+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var r=this.level=new ws(t.width,t.width/2),i=t.data;this._unpackData(r,i,e||"mapbox");for(var n=0;n<r.dim;n++)r.set(-1,n,r.get(0,n)),r.set(r.dim,n,r.get(r.dim-1,n)),r.set(n,-1,r.get(n,0)),r.set(n,r.dim,r.get(n,r.dim-1));r.set(-1,-1,r.get(0,0)),r.set(r.dim,-1,r.get(r.dim-1,0)),r.set(-1,r.dim,r.get(0,r.dim-1)),r.set(r.dim,r.dim,r.get(r.dim-1,r.dim-1)),this.loaded=!0},Es.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Es.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Es.prototype._unpackData=function(t,e,r){for(var i={mapbox:this._unpackMapbox,terrarium:this._unpackTerrarium}[r],n=0;n<t.dim;n++)for(var o=0;o<t.dim;o++){var a=4*(n*t.dim+o);t.set(o,n,this.scale*i(e[a],e[a+1],e[a+2]))}},Es.prototype.getPixels=function(){return new oa({width:this.level.dim+2*this.level.border,height:this.level.dim+2*this.level.border},new Uint8Array(this.level.data.buffer))},Es.prototype.backfillBorder=function(t,e,r){var i=this.level,n=t.level;if(i.dim!==n.dim)throw new Error("level mismatch (dem dimension)");var o=e*i.dim,a=e*i.dim+i.dim,l=r*i.dim,u=r*i.dim+i.dim;switch(e){case-1:o=a-1;break;case 1:a=o+1}switch(r){case-1:l=u-1;break;case 1:u=l+1}for(var c=s(o,-i.border,i.dim+i.border),h=s(a,-i.border,i.dim+i.border),p=s(l,-i.border,i.dim+i.border),f=s(u,-i.border,i.dim+i.border),d=-e*i.dim,m=-r*i.dim,y=p;y<f;y++)for(var v=c;v<h;v++)i.set(v,y,n.get(v+d,y+m))},Zt("DEMData",Es);var Ss=Qt([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Ts=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Ts.prototype.encode=function(t){return this._stringToNumber[t]},Ts.prototype.decode=function(t){return this._numberToString[t]};var zs=function(t,e,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=i,this.properties=t.properties,null!=t.id&&(this.id=t.id)},As={geometry:{configurable:!0}};As.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}
8,As.geometry.set=function(t){this._geometry=t},zs.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(zs.prototype,As);var Ms=function(){this.state={},this.stateChanges={}};Ms.prototype.updateState=function(t,e,r){e=String(e),this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][e]=this.stateChanges[t][e]||{},l(this.stateChanges[t][e],r)},Ms.prototype.getState=function(t,e){e=String(e);var r=this.state[t]||{},i=this.stateChanges[t]||{};return l({},r[e],i[e])},Ms.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Ms.prototype.coalesceChanges=function(t,e){var r={};for(var i in this.stateChanges){this.state[i]=this.state[i]||{};var n={};for(var o in this.stateChanges[i])this.state[i][o]||(this.state[i][o]={}),l(this.state[i][o],this.stateChanges[i][o]),n[o]=this.state[i][o];r[i]=n}if(this.stateChanges={},0!==Object.keys(r).length)for(var a in t)t[a].setFeatureState(r,e)};var ks=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new zn(jo,16,0),this.featureIndexArray=r||new Co};ks.prototype.insert=function(t,e,r,i,n){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var a=0;a<e.length;a++){for(var s=e[a],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var c=s[u];l[0]=Math.min(l[0],c.x),l[1]=Math.min(l[1],c.y),l[2]=Math.max(l[2],c.x),l[3]=Math.max(l[3],c.y)}l[0]<jo&&l[1]<jo&&l[2]>=0&&l[3]>=0&&this.grid.insert(o,l[0],l[1],l[2],l[3])}},ks.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new za.VectorTile(new fs(this.rawTileData)).layers,this.sourceLayerCoder=new Ts(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ks.prototype.query=function(t,e,r){var i=this;this.loadVTLayers();for(var n=t.params||{},o=jo/t.tileSize/t.scale,a=Et(n.filter),s=t.queryGeometry,l=t.queryPadding*o,u=1/0,c=1/0,h=-1/0,p=-1/0,f=0;f<s.length;f++)for(var d=s[f],m=0;m<d.length;m++){var y=d[m];u=Math.min(u,y.x),c=Math.min(c,y.y),h=Math.max(h,y.x),p=Math.max(p,y.y)}var v=this.grid.query(u-l,c-l,h+l,p+l);v.sort(qr);for(var g,_={},x=function(l){var u=v[l];if(u!==g){g=u;var c=i.featureIndexArray.get(u),h=null;i.loadMatchingFeature(_,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,a,n.layers,e,function(e,n){h||(h=ie(e));var a={};return e.id&&(a=r.getState(n.sourceLayer||"_geojsonTileLayer",String(e.id))),n.queryIntersectsFeature(s,e,a,h,i.z,t.transform,o,t.posMatrix)})}},b=0;b<v.length;b++)x(b);return _},ks.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s){var l=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,l)){var u=this.sourceLayerCoder.decode(r),c=this.vtLayers[u].feature(i);if(n(new Vn(this.tileID.overscaledZ),c))for(var h=0;h<l.length;h++){var p=l[h];if(!(o&&o.indexOf(p)<0)){var f=a[p];if(f&&(!s||s(c,f))){var d=new zs(c,this.z,this.x,this.y);d.layer=f.serialize();var m=t[p];void 0===m&&(m=t[p]=[]),m.push({featureIndex:i,feature:d})}}}}},ks.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o){var a={};this.loadVTLayers();for(var s=Et(i),l=0,u=t;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(a,e,r,c,s,n,o)}return a},ks.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1)if(t===n[i])return!0;return!1},Zt("FeatureIndex",ks,{omit:["rawTileData","sourceLayerCoder"]});var Is=function(t,e){this.tileID=t,this.uid=u(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.expiredRequestCount=0,this.state="loading"};Is.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<ei.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Is.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Is.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){if(t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.layerIds.map(function(t){return e.getLayer(t)}
8).filter(Boolean);if(0!==a.length){o.layers=a,o.stateDependentLayers=a.filter(function(t){return t.isStateDependent()});for(var s=0,l=a;s<l.length;s+=1)r[l[s].id]=o}}return r}(t.buckets,e.style),r)for(var i in this.buckets){var n=this.buckets[i];n instanceof Ha&&(n.justReloaded=!0)}for(var o in this.queryPadding=0,this.buckets){var a=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a.layerIds[0]).queryRadius(a))}t.iconAtlasImage&&(this.iconAtlasImage=t.iconAtlasImage),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Eo},Is.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.iconAtlasTexture&&this.iconAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Is.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},Is.prototype.getBucket=function(t){return this.buckets[t.id]},Is.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.iconAtlasImage&&(this.iconAtlasTexture=new cs(t,this.iconAtlasImage,i.RGBA),this.iconAtlasImage=null),this.glyphAtlasImage&&(this.glyphAtlasTexture=new cs(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},Is.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,scale:i,tileSize:this.tileSize,posMatrix:s,transform:o,params:n,queryPadding:this.queryPadding*a},t,e):{}},Is.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),i=e?e.sourceLayer:"",n=r._geojsonTileLayer||r[i];if(n)for(var o=Et(e&&e.filter),a={z:this.tileID.overscaledZ,x:this.tileID.canonical.x,y:this.tileID.canonical.y},s=0;s<n.length;s++){var l=n.feature(s);if(o(new Vn(this.tileID.overscaledZ),l)){var u=new zs(l,a.z,a.x,a.y);u.tile=a,t.push(u)}}}},Is.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Is.prototype.setMask=function(t,e){if(!o(this.mask,t)&&(this.mask=t,this.clearMask(),!o(t,{0:!0}))){var r=new no,i=new go;this.segments=new Po,this.segments.prepareSegment(0,r,i);for(var n=Object.keys(t),a=0;a<n.length;a++){var s=t[n[a]],l=jo>>s.z,u=new oi(s.x*l,s.y*l),c=new oi(u.x+l,u.y+l),h=this.segments.prepareSegment(4,r,i);r.emplaceBack(u.x,u.y,u.x,u.y),r.emplaceBack(c.x,u.y,c.x,u.y),r.emplaceBack(u.x,c.y,u.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var p=h.vertexLength;i.emplaceBack(p,p+1,p+2),i.emplaceBack(p+1,p+2,p+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,Ss.members),this.maskedIndexBuffer=e.createIndexBuffer(i)}},Is.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Is.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=function(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,i,n){var o=i||n;return e[r]=!o||o.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(e)if(this.expirationTime<e)n=!0;else{var o=this.expirationTime-e;o?this.expirationTime=i+Math.max(o,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Is.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Is.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var i in this.buckets){var n=this.buckets[i],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];a&&s&&0!==Object.keys(s).length&&(n.update(s,a),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n.layerIds[0]).queryRadius(n))))}}};var Cs={horizontal:1,vertical:2,horizontalOnly:3},Ls={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ps={};Ps[10]=!0,Ps[32]=!0,Ps[38]=!0,Ps[40]=!0,Ps[41]=!0,Ps[43]=!0,Ps[45]=!0,Ps[47]=!0,Ps[173]=!0,Ps[183]=!0,Ps[8203]=!0,Ps[8208]=!0,Ps[8211]=!0,Ps[8231]=!0,t.commonjsGlobal=Yr,t.unwrapExports=e,t.createCommonjsModule=r,t["default"]=oi,t.default$1=self,t.default$2=ei,t.getJSON=function(t,e){var r=g(t);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(i){return e(i)}e(null,t)}
8else e(401===r.status&&i.url.match(/mapbox.com/)?new ci(r.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",r.status,i.url):new ci(r.statusText,r.status,i.url))},r.send(),r},t.getImage=function(t,e){return hi(t,function(t,r){if(t)e(t);else if(r){var i=new self.Image,n=self.URL||self.webkitURL;i.onload=function(){e(null,i),n.revokeObjectURL(i.src)};var o=new self.Blob([new Uint8Array(r.data)],{type:"image/png"});i.cacheControl=r.cacheControl,i.expires=r.expires,i.src=r.data.byteLength?n.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},t.ResourceType=ui,t.RGBAImage=oa,t.default$3=rs,t.ImagePosition=is,t.default$4=cs,t.getArrayBuffer=hi,t.default$5=function(t){return new fs(t).readFields(Nr,[])},t.default$6=Pn,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)})})},t.AlphaImage=na,t.default$7=mi,t.endsWith=h,t.extend=l,t.sphericalToCartesian=function(t){var e=t[0],r=t[1],i=t[2];return r+=90,r*=Math.PI/180,i*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(i),y:e*Math.sin(r)*Math.sin(i),z:e*Math.cos(i)}},t.Evented=di,t.validateStyle=wn,t.validateLight=En,t.emitValidationErrors=$t,t.default$8=ki,t.number=D,t.Properties=Jn,t.Transitionable=Un,t.Transitioning=qn,t.PossiblyEvaluated=Wn,t.DataConstantProperty=Hn,t.warnOnce=m,t.uniqueId=u,t.default$9=ys,t.pick=function(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r},t.wrap=function(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n},t.clamp=s,t.Event=pi,t.ErrorEvent=fi,t.OverscaledTileID=bs,t.default$10=jo,t.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),i=Math.max(i,t[o].column),n=Math.max(n,t[o].row);var a=i-e,s=n-r,l=Math.max(a,s),u=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));return new ni((e+i)/2,(r+n)/2,0).zoomTo(u)},t.CanonicalTileID=_s,t.RasterBoundsArray=no,t.default$11=Ss,t.getVideo=function(t,e){var r,i,n=self.document.createElement("video");n.onloadstart=function(){e(null,n)};for(var o=0;o<t.length;o++){var a=self.document.createElement("source");r=t[o],i=void 0,(i=self.document.createElement("a")).href=r,(i.protocol!==self.document.location.protocol||i.host!==self.document.location.host)&&(n.crossOrigin="Anonymous"),a.src=t[o],n.appendChild(a)}return n},t.default$12=yi,t.bindAll=c,t.default$13=o,t.default$14=Is,t.default$15=ni,t.keysDifference=function(t,e){var r=[];for(var i in t)i in e||r.push(i);return r},t.default$16=Ms,t.default$17=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.create=function(){var t=new Zo(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=r*s-i*a,_=r*l-n*a,x=r*u-o*a,b=i*l-n*s,w=i*u-o*s,E=n*u-o*l,S=c*m-h*d,T=c*y-p*d,z=c*v-f*d,A=h*y-p*m,M=h*v-f*m,k=p*v-f*y,I=g*k-_*M+x*A+b*z-w*T+E*S;return I?(I=1/I,t[0]=(s*k-l*M+u*A)*I,t[1]=(n*M-i*k-o*A)*I,t[2]=(m*E-y*w+v*b)*I,t[3]=(p*w-h*E-f*b)*I,t[4]=(l*z-a*k-u*T)*I,t[5]=(r*k-n*z+o*T)*I,t[6]=(y*x-d*E-v*_)*I,t[7]=(c*E-p*x+f*_)*I,t[8]=(a*M-s*z+u*S)*I,t[9]=(i*z-r*M-o*S)*I,t[10]=(d*w-m*x+v*g)*I,t[11]=(h*x-c*w-f*g)*I,t[12]=(s*T-a*A-l*S)*I,t[13]=(r*A-i*T+n*S)
8*I,t[14]=(m*_-d*b-y*g)*I,t[15]=(c*b-h*_+p*g)*I,t):null},t.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*i+x*s+b*h+w*m,t[1]=_*n+x*l+b*p+w*y,t[2]=_*o+x*u+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*i+x*s+b*h+w*m,t[5]=_*n+x*l+b*p+w*y,t[6]=_*o+x*u+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*i+x*s+b*h+w*m,t[9]=_*n+x*l+b*p+w*y,t[10]=_*o+x*u+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*i+x*s+b*h+w*m,t[13]=_*n+x*l+b*p+w*y,t[14]=_*o+x*u+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t},t.translate=function(t,e,r){var i,n,o,a,s,l,u,c,h,p,f,d,m=r[0],y=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=i*m+s*y+h*v+e[12],t[13]=n*m+l*y+p*v+e[13],t[14]=o*m+u*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]),t},t.scale=function(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+u*i,t[5]=a*n+c*i,t[6]=s*n+h*i,t[7]=l*n+p*i,t[8]=u*n-o*i,t[9]=c*n-a*i,t[10]=h*n-s*i,t[11]=p*n-l*i,t},t.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+u*i,t[1]=a*n+c*i,t[2]=s*n+h*i,t[3]=l*n+p*i,t[4]=u*n-o*i,t[5]=c*n-a*i,t[6]=h*n-s*i,t[7]=p*n-l*i,t},t.perspective=function(t,e,r,i,n){ 9var o=1/Math.tan(e/2),a=1/(i-n);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*a,t[15]=0,t},t.ortho=function(t,e,r,i,n,o,a){var s=1/(e-r),l=1/(i-n),u=1/(o-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]=(n+i)*l,t[14]=(a+o)*u,t[15]=1,t},t.create$1=Te,t.normalize=ze,t.transformMat4=Ae,t.forEach=ea,t.getSizeData=br,t.evaluateSizeForFeature=function(t,e,r){var i=e;return"source"===t.functionType?r.lowerSize/10:"composite"===t.functionType?D(r.lowerSize/10,r.upperSize/10,i.uSizeT):i.uSize},t.evaluateSizeForZoom=function(t,e,r){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var i=t.propertyValue,n=t.zoomRange,o=t.sizeRange,a=s(mt(i,r.specification).interpolationFactor(e,n.min,n.max),0,1);return{uSizeT:0,uSize:o.min+a*(o.max-o.min)}}var l=t.propertyValue,u=t.zoomRange;return{uSizeT:s(mt(l,r.specification).interpolationFactor(e,u.min,u.max),0,1),uSize:0}},t.addDynamicAttributes=Er,t.default$18=Ka,t.WritingMode=Cs,t.multiPolygonIntersectsBufferedPoint=oe,t.multiPolygonIntersectsMultiPolygon=ae,t.multiPolygonIntersectsBufferedMultiLine=se,t.polygonIntersectsPolygon=function(t,e){for(var r=0;r<t.length;r++)if(de(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(de(t,e[i]))return!0;return!!ue(t,e)},t.distToSegmentSquared=pe,t.default$19=Qn,t.default$20=function(t){return new es[t.type](t)},t.clone=d,t.filterObject=f,t.mapObject=p,t.registerForPluginAvailability=function(t){return Bn?t({pluginURL:Bn,completionCallback:Ln}):On.once("pluginAvailable",t),t},t.evented=On,t.default$21=Cn,t.createLayout=Qt,t.default$22=Fo,t.create$2=ge,t.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.create$3=_e,t.length=xe,t.fromValues=be,t.normalize$1=we,t.dot=Ee,t.cross=Se,t.transformMat3=function(t,e,r){var i=e[0],n=e[1],o=e[2];return t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8],t},t.len=Qo,t.forEach$1=ta,t.PosArray=io,t.UnwrappedTileID=xs,t.create$4=function(){var t=new Zo(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},t.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*s,t[1]=n*l+a*s,t[2]=i*-s+o*l,t[3]=n*-s+a*l,t},t.ease=ai,t.bezier=a,t.default$23=Vn,t.setRTLTextPlugin=function(t,e){if(Dn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Dn=!0,Bn=ei.resolveURL(t),Ln=function(t){t?(Dn=!1,Bn=null,e&&e(t)):Rn=!0},On.fire(new pi("pluginAvailable",{pluginURL:Bn,completionCallback:Ln}))},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.default$24=Et,t.default$25=$a,t.register=Zt,t.GLYPH_PBF_BORDER=ms,t.shapeText=function(t,e,r,i,n,o,a,s,l,u){var c=t.trim();u===Cs.vertical&&(c=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,n=t.charCodeAt(r-1)||null;e+=i&&Yt(i)&&!Ua[t[r+1]]||n&&Yt(n)&&!Ua[t[r-1]]||!Ua[t[r]]?t[r]:Ua[t[r]]}return e}(c));var h=[],p={positionedGlyphs:h,text:c,top:s[1],bottom:s[1],left:s[0],right:s[0],writingMode:u},f=Fn.processBidirectionalText;return function(t,e,r,i,n,o,a,s,l){for(var u=0,c=-17,h=0,p=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5,d=0,m=r;d<m.length;d+=1){var y=m[d];if((y=y.trim()).length){for(var v=p.length,g=0;g<y.length;g++){var _=y.charCodeAt(g),x=e[_];x&&(Kt(_)&&a!==Cs.horizontal?(p.push({glyph:_,x:u,y:0,vertical:!0}),u+=l+s):(p.push({glyph:_,x:u,y:c,vertical:!1}),u+=x.metrics.advance+s))}if(p.length!==v){var b=u-s;h=Math.max(b,h),Kr(p,e,v,p.length-1,f)}u=0,c+=i}else c+=i}var w=Xr(n),E=w.horizontalAlign,S=w.verticalAlign;!function(t,e,r,i,n,o,a){for(var s=(e-r)*n,l=(-i*a+.5)*o,u=0;u<t.length;u++)t[u].x+=s,t[u].y+=l}(p,f,E,S,h,i,r.length);var T=r.length*i;t.top+=-S*T,t.bottom=t.top+T,t.left+=-E*h,t.right=t.left+h}(p,e,f?f(c,Hr(c,a,r,e)):function(t,e){for(var r=[],i=0,n=0,o=e;n<o.length;n+=1){var a=o[n];r.push(t.substring(i,a)),i=a}return i<t.length&&r.push(t.substring(i,t.length)),r}(c,Hr(c,a,r,e)),i,n,o,u,a,l),!!h.length&&p},t.shapeIcon=function(t,e,r){var i=Xr(r),n=i.horizontalAlign,o=i.verticalAlign,a=e[0],s=e[1],l=a-t.displaySize[0]*n,u=l+t.displaySize[0],c=s-t.displaySize[1]*o;return{image:t,top:c,bottom:c+t.displaySize[1],left:l,right:u}},t.allowsVerticalWritingMode=Ht,t.allowsLetterSpacing=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!Xt(r[e].charCodeAt(0)))return!1;return!0}
9,t.default$26=ar,t.default$27=Ha,t.default$28=ks,t.CollisionBoxArray=Eo,t.default$29=Ts,t.default$30=os,t.default$31=za,t.default$32=fs,t.default$33=Es,t.__moduleExports=za,t.default$34=oi,t.__moduleExports$1=fs,t.plugin=Fn}),t(["./chunk1.js"],function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var i="[",n=0,o=t;n<o.length;n+=1)i+=e(o[n])+",";return i+"]"}for(var a=Object.keys(t).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+e(t[a[l]])+",";return s+"}"}function r(r){for(var i="",n=0,o=t.default$17;n<o.length;n+=1)i+="/"+e(r[o[n]]);return i}function i(t,e,r,i,n){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;s<r/2;){var c=t[a-1],h=t[a],p=t[a+1];if(!p)return!1;var f=c.angleTo(h)-h.angleTo(p);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:f}),u+=f;s-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;a++,s+=h.dist(p)}return!0}function n(e,r,n,o,a,s,l,u,c){var h=o?.6*s*l:0,p=Math.max(o?o.right-o.left:0,a?a.right-a.left:0),f=0===e[0].x||e[0].x===c||0===e[0].y||e[0].y===c;return r-p*l<r/4&&(r=p*l+r/4),function d(e,r,n,o,a,s,l,u,c){for(var h=s/2,p=0,f=0;f<e.length-1;f++)p+=e[f].dist(e[f+1]);for(var m=0,y=r-n,v=[],g=0;g<e.length-1;g++){for(var _=e[g],x=e[g+1],b=_.dist(x),w=x.angleTo(_);y+n<m+b;){var E=((y+=n)-m)/b,S=t.number(_.x,x.x,E),T=t.number(_.y,x.y,E);if(S>=0&&S<c&&T>=0&&T<c&&y-h>=0&&y+h<=p){var z=new t.default$25(S,T,w,g);z._round(),o&&!i(e,z,s,o,a)||v.push(z)}}m+=b}return u||v.length||l||(v=d(e,m/2,n,o,a,s,l,!0,c)),v}(e,f?r/2*u%r:(p/2+2*s)*l*u%r,r,h,n,p*l,f,!1,c)}function o(t,e){if(!(this instanceof o))return new o(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||a,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}function a(t,e){return t<e?-1:t>e?1:0}function s(e,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,c=e[0],h=0;h<c.length;h++){var p=c[h];(!h||p.x<n)&&(n=p.x),(!h||p.y<o)&&(o=p.y),(!h||p.x>a)&&(a=p.x),(!h||p.y>s)&&(s=p.y)}var f=a-n,d=s-o,m=Math.min(f,d),y=m/2,v=new St(null,l);if(0===m)return new t["default"](n,o);for(var g=n;g<a;g+=m)for(var _=o;_<s;_+=m)v.push(new u(g+y,_+y,y,e));for(var x=function(t){for(var e=0,r=0,i=0,n=t[0],o=0,a=n.length,s=a-1;o<a;s=o++){var l=n[o],c=n[s],h=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*h,i+=(l.y+c.y)*h,e+=3*h}return new u(r/e,i/e,0,t)}(e),b=v.length;v.length;){var w=v.pop();(w.d>x.d||!x.d)&&(x=w,i&&console.log("found best %d after %d probes",Math.round(1e4*w.d)/1e4,b)),w.max-x.d<=r||(y=w.h/2,v.push(new u(w.p.x-y,w.p.y-y,y,e)),v.push(new u(w.p.x+y,w.p.y-y,y,e)),v.push(new u(w.p.x-y,w.p.y+y,y,e)),v.push(new u(w.p.x+y,w.p.y+y,y,e)),b+=4)}return i&&(console.log("num probes: "+b),console.log("best distance: "+x.d)),x.p}function l(t,e){return e.max-t.max}function u(e,r,i,n){this.p=new t["default"](e,r),this.h=i,this.d=function(e,r){for(var i=!1,n=1/0,o=0;o<r.length;o++)for(var a=r[o],s=0,l=a.length,u=l-1;s<l;u=s++){var c=a[s],h=a[u];c.y>e.y!=h.y>e.y&&e.x<(h.x-c.x)*(e.y-c.y)/(h.y-c.y)+c.x&&(i=!i),n=Math.min(n,t.distToSegmentSquared(e,c,h))}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}function c(e,r,i,n,o,a){e.createArrays(),e.symbolInstances=[];var s=512*e.overscaling;e.tilePixelRatio=t.default$10/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={};if("composite"===e.textSizeData.functionType){var p=e.textSizeData.zoomRange,f=p.min,d=p.max;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new t.default$23(f)),u["text-size"].possiblyEvaluate(new t.default$23(d))]}if("composite"===e.iconSizeData.functionType){var m=e.iconSizeData.zoomRange,y=m.min,v=m.max;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new t.default$23(y)),u["icon-size"].possiblyEvaluate(new t.default$23(v))]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new t.default$23(e.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new t.default$23(e.zoom+1)),c.textMaxSize=u["text-size"].possiblyEvaluate(new t.default$23(18));for(var g=24*l.get("text-line-height"),_="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),x=l.get("text-keep-upright"),b=0,w=e.features;b<w.length;b+=1){var E=w[b],S=l.get("text-font").evaluate(E,{}).join(","),T=r[S]||{},z=i[S]||{},A={},M=E.text;if(M){var k=l.get("text-offset").evaluate(E,{}).map(function(t){return 24*t}),I=24*l.get("text-letter-spacing").evaluate(E,{}),C=t.allowsLetterSpacing(M)?I:0,L=l.get("text-anchor").evaluate(E,{}
9),P=l.get("text-justify").evaluate(E,{}),D="line"!==l.get("symbol-placement")?24*l.get("text-max-width").evaluate(E,{}):0;A.horizontal=t.shapeText(M,T,D,g,L,P,C,k,24,t.WritingMode.horizontal),t.allowsVerticalWritingMode(M)&&_&&x&&(A.vertical=t.shapeText(M,T,D,g,L,P,C,k,24,t.WritingMode.vertical))}var B=void 0;if(E.icon){var R=n[E.icon];R&&(B=t.shapeIcon(o[E.icon],l.get("icon-offset").evaluate(E,{}),l.get("icon-anchor").evaluate(E,{})),void 0===e.sdfIcons?e.sdfIcons=R.sdf:e.sdfIcons!==R.sdf&&t.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),R.pixelRatio!==e.pixelRatio?e.iconsNeedLinear=!0:0!==l.get("icon-rotate").constantOr(1)&&(e.iconsNeedLinear=!0))}(A.horizontal||B)&&h(e,E,A,B,z,c)}a&&e.generateCollisionDebugBuffers()}function h(e,r,i,o,a,l){var u=l.layoutTextSize.evaluate(r,{}),c=l.layoutIconSize.evaluate(r,{}),h=l.textMaxSize.evaluate(r,{});void 0===h&&(h=u);var d=e.layers[0].layout,m=d.get("text-offset").evaluate(r,{}),y=d.get("icon-offset").evaluate(r,{}),v=u/24,g=e.tilePixelRatio*v,_=e.tilePixelRatio*h/24,x=e.tilePixelRatio*c,b=e.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*e.tilePixelRatio,E=d.get("icon-padding")*e.tilePixelRatio,S=d.get("text-max-angle")/180*Math.PI,T="map"===d.get("text-rotation-alignment")&&"line"===d.get("symbol-placement"),z="map"===d.get("icon-rotation-alignment")&&"line"===d.get("symbol-placement"),A=b/2,M=function(n,s){s.x<0||s.x>=t.default$10||s.y<0||s.y>=t.default$10||e.symbolInstances.push(function(e,r,i,n,o,a,s,l,u,c,h,f,d,m,y,v,g,_,x,b,w){var E,S,T=e.addToLineVertexArray(r,i),z=0,A=0,M=0,k=n.horizontal?n.horizontal.text:"",I=[];if(n.horizontal){var C=a.layout.get("text-rotate").evaluate(x,{});E=new Et(s,i,r,l,u,c,n.horizontal,h,f,d,e.overscaling,C),A+=p(e,r,n.horizontal,a,d,x,m,T,n.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,I,b,w),n.vertical&&(M+=p(e,r,n.vertical,a,d,x,m,T,t.WritingMode.vertical,I,b,w))}var L=E?E.boxStartIndex:e.collisionBoxArray.length,P=E?E.boxEndIndex:e.collisionBoxArray.length;if(o){var D=function(e,r,i,n,o,a){var s,l,u,c,h=r.image,p=i.layout,f=r.top-1/h.pixelRatio,d=r.left-1/h.pixelRatio,m=r.bottom+1/h.pixelRatio,y=r.right+1/h.pixelRatio;if("none"!==p.get("icon-text-fit")&&o){var v=y-d,g=m-f,_=p.get("text-size").evaluate(a,{})/24,x=o.left*_,b=o.right*_,w=o.top*_,E=b-x,S=o.bottom*_-w,T=p.get("icon-text-fit-padding")[0],z=p.get("icon-text-fit-padding")[1],A=p.get("icon-text-fit-padding")[2],M=p.get("icon-text-fit-padding")[3],k="width"===p.get("icon-text-fit")?.5*(S-g):0,I="height"===p.get("icon-text-fit")?.5*(E-v):0,C="width"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?E:v,L="height"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?S:g;s=new t["default"](x+I-M,w+k-T),l=new t["default"](x+I+z+C,w+k-T),u=new t["default"](x+I+z+C,w+k+A+L),c=new t["default"](x+I-M,w+k+A+L)}else s=new t["default"](d,f),l=new t["default"](y,f),u=new t["default"](y,m),c=new t["default"](d,m);var P=i.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(P){var D=Math.sin(P),B=Math.cos(P),R=[B,-D,D,B];s._matMult(R),l._matMult(R),c._matMult(R),u._matMult(R)}return[{tl:s,tr:l,bl:c,br:u,tex:h.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,o,a,0,n.horizontal,x),B=a.layout.get("icon-rotate").evaluate(x,{});S=new Et(s,i,r,l,u,c,o,y,v,(!1),e.overscaling,B),z=4*D.length;var R=e.iconSizeData,O=null;"source"===R.functionType?O=[10*a.layout.get("icon-size").evaluate(x,{})]:"composite"===R.functionType&&(O=[10*w.compositeIconSizes[0].evaluate(x,{}),10*w.compositeIconSizes[1].evaluate(x,{})]),e.addSymbols(e.icon,D,O,_,g,x,!1,r,T.lineStartIndex,T.lineLength)}var F=S?S.boxStartIndex:e.collisionBoxArray.length,V=S?S.boxEndIndex:e.collisionBoxArray.length;e.glyphOffsetArray.length>=t.default$27.MAX_GLYPHS&&t.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var N=new wt,j=new wt;return{key:k,textBoxStartIndex:L,textBoxEndIndex:P,iconBoxStartIndex:F,iconBoxEndIndex:V,textOffset:m,iconOffset:_,anchor:r,line:i,featureIndex:l,feature:x,numGlyphVertices:A,numVerticalGlyphVertices:M,numIconVertices:z,textOpacityState:N,iconOpacityState:j,isDuplicate:!1,placedTextSymbolIndices:I,crossTileID:0}}(e,s,n,i,o,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,g,w,T,m,x,E,z,y,r,a,l))};if("line"===d.get("symbol-placement"))for(var k=0,I=function(e,r,i,n,o){for(var a=[],s=0;s<e.length;s++)for(var l=e[s],u=void 0,c=0;c<l.length-1;c++){var h=l[c],p=l[c+1];h.x<r&&p.x<r||(h.x<r?h=new t["default"](r,h.y+(p.y-h.y)*((r-h.x)/(p.x-h.x)))._round():p.x<r&&(p=new t["default"](r,h.y+(p.y-h.y)*((r-h.x)/(p.x-h.x)))._round()),h.y<i&&p.y<i||(h.y<i?h=new t["default"](h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round():p.y<i&&(p=new t["default"](h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round()),h.x>=n&&p.x>=n||(h.x>=n?h=new t["default"](n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round():p.x>=n&&(p=new t["default"](n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new t["default"](h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round():p.y>=o&&(p=new t["default"](h.x+(p.x-h.x)*((o-h.y)/(p.y-h.y)),o)._round()),u&&h.equals(u[u.length-1])||(u=[h],a.push(u)),u.push(p)))))}return a}(r.geometry,0,0,t.default$10,t.default$10);k<I.length;k+=1)for(var C=I[k],L=0,P=n(C,b,S,i.vertical||i.horizontal,o,24,_,e.overscaling,t.default$10);L<P.length;L+=1){var D=P[L],B=i.horizontal;B&&f(e,B.text,A,D)||M(C,D)}else if("Polygon"===r.type)for(var R=0,O=t.default$26(r.geometry,0);R<O.length;R+=1){var F=O[R],V=s(F,16);M(F[0],new t.default$25(V.x,V.y,0))}else if("LineString"===r.type)for(var N=0,j=r.geometry;N<j.length;N+=1){var U=j[N];M(U,new t.default$25(U[0].x,U[0].y,0))}else if("Point"===r.type)for(var $=0,q=r.geometry;$<q.length;$+=1)for(var Z=0,G=q[$];Z<G.length;Z+=1){var W=G[Z];M([W],new t.default$25(W.x,W.y,0))}}function p(e,r,i,n,o,a,s,l,u,c,h,p){var f=function(e,r,i,n,o,a){for(var s=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,l=i.layout.get("text-offset").evaluate(o,{}).map(function(t){return 24*t}),u=r.positionedGlyphs,c=[],h=0;h<u.length;h++){var p=u[h],f=a[p.glyph];if(f){var d=f.rect;if(d){var m=t.GLYPH_PBF_BORDER+1,y=f.metrics.advance/2,v=n?[p.x+y,p.y]:[0,0],g=n?[0,0]:[p.x+y+l[0],p.y+l[1]],_=f.metrics.left-m-y+g[0],x=-f.metrics.top-m+g[1],b=_+d.w,w=x+d.h,E=new t["default"](_,x),S=new t["default"](b,x),T=new t["default"](_,w),z=new t["default"](b,w);if(n&&p.vertical){var A=new t["default"]((-y),y),M=-Math.PI/2,k=new t["default"](5,0);
9E._rotateAround(M,A)._add(k),S._rotateAround(M,A)._add(k),T._rotateAround(M,A)._add(k),z._rotateAround(M,A)._add(k)}if(s){var I=Math.sin(s),C=Math.cos(s),L=[C,-I,I,C];E._matMult(L),S._matMult(L),T._matMult(L),z._matMult(L)}c.push({tl:E,tr:S,bl:T,br:z,tex:d,writingMode:r.writingMode,glyphOffset:v})}}}return c}(0,i,n,o,a,h),d=e.textSizeData,m=null;return"source"===d.functionType?m=[10*n.layout.get("text-size").evaluate(a,{})]:"composite"===d.functionType&&(m=[10*p.compositeTextSizes[0].evaluate(a,{}),10*p.compositeTextSizes[1].evaluate(a,{})]),e.addSymbols(e.text,f,m,s,o,a,u,r,l.lineStartIndex,l.lineLength),c.push(e.text.placedSymbolArray.length-1),4*f.length}function f(t,e,r,i){var n=t.compareText;if(e in n){for(var o=n[e],a=o.length-1;a>=0;a--)if(i.dist(o[a])<r)return!0}else n[e]=[];return n[e].push(i),!1}function d(e,r){for(var i=new t.default$23(r),n=0,o=e;n<o.length;n+=1)o[n].recalculate(i)}function m(e,r){var i=t.getArrayBuffer(e.request,function(e,i){e?r(e):i&&r(null,{vectorTile:new t.default$31.VectorTile(new t.default$32(i.data)),rawData:i.data,cacheControl:i.cacheControl,expires:i.expires})});return function(){i.abort(),r()}}function y(t){var e=0;if(t&&t.length>0){e+=Math.abs(v(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(v(t[r]))}return e}function v(t){var e,r,i,n,o,a,s=0,l=t.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,n=l-1,o=0):a===l-1?(i=l-1,n=0,o=1):(i=a,n=a+1,o=a+2),e=t[i],r=t[n],s+=(g(t[o][0])-g(e[0]))*Math.sin(g(r[1]));s=s*Pt.RADIUS*Pt.RADIUS/2}return s}function g(t){return t*Math.PI/180}function _(t,e){return function(r){return t(r,e)}}function x(t,e){e=!!e,t[0]=b(t[0],e);for(var r=1;r<t.length;r++)t[r]=b(t[r],!e);return t}function b(t,e){return function(t){return Dt.ring(t)>=0}(t)===e?t:t.reverse()}function w(t,e){this.options=e||{},this.features=t,this.length=t.length}function E(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}function S(e){var r=new t.__moduleExports$1;return function(t,e){for(var r in t.layers)e.writeMessage(3,T,t.layers[r])}(e,r),r.finish()}function T(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)i.feature=t.feature(r),e.writeMessage(2,z,i);var n=i.keys;for(r=0;r<n.length;r++)e.writeStringField(3,n[r]);var o=i.values;for(r=0;r<o.length;r++)e.writeMessage(4,C,o[r])}function z(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,A,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function A(t,e){var r=t.feature,i=t.keys,n=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var l=o[s];void 0===l&&(i.push(s),l=i.length-1,o[s]=l),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var h=c+":"+u,p=a[h];void 0===p&&(n.push(u),p=n.length-1,a[h]=p),e.writeVarint(p)}}function M(t,e){return(e<<3)+(7&t)}function k(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;1===i&&(u=l.length),e.writeVarint(M(1,u));for(var c=3===i?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==i&&e.writeVarint(M(2,c-1));var p=l[h].x-n,f=l[h].y-o;e.writeVarint(k(p)),e.writeVarint(k(f)),n+=p,o+=f}3===i&&e.writeVarint(M(7,0))}}function C(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function L(t,e,r,i){P(t,r,i),P(e,2*r,2*i),P(e,2*r+1,2*i+1)}function P(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function D(t,e,r,i){var n=t-r,o=e-i;return n*n+o*o}function B(t,e,r,i,n){e=e||R,r=r||O,n=n||Array,this.nodeSize=i||64,this.points=t,this.ids=new n(t.length),this.coords=new n(2*t.length);for(var o=0;o<t.length;o++)this.ids[o]=o,this.coords[2*o]=e(t[o]),this.coords[2*o+1]=r(t[o]);Zt(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function R(t){return t[0]}function O(t){return t[1]}function F(t){this.options=Z(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function V(t,e,r,i,n){return{x:t,y:e,zoom:1/0,id:i,properties:n,parentId:-1,numPoints:r}}function N(t,e){var r=t.geometry.coordinates;return{x:$(r[0]),y:q(r[1]),zoom:1/0,id:e,parentId:-1}}function j(t){return{type:"Feature",properties:U(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 U(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 $(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 G(t){return t.x}function W(t){return t.y}function H(t,e,r,i,n,o){var a=n-r,s=o-i;if(0!==a||0!==s){var l=((t-r)*a+(e-i)*s)/(a*a+s*s);l>1?(r=n,i=o):l>0&&(r+=a*l,i+=s*l)}return(a=t-r)*a+(s=e-i)*s}function X(t,e,r,i){var n={id:t||null,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)K(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)K(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)K(t,e[i][n])}(n),n}function K(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Y(t,e,r){if(e.geometry){var i=e.geometry.coordinates,n=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),a=[];if("Point"===n)J(i,a);else if("MultiPoint"===n)for(var s=0;s<i.length;s++)J(i[s],a);else if("LineString"===n)Q(i,a,o,!1);else if("MultiLineString"===n){if(r.lineMetrics){for(s=0;s<i.length;s++)a=[],Q(i[s],a,o,!1),t.push(X(e.id,"LineString",a,e.properties));return}tt(i,a,o,!1)}else if("Polygon"===n)tt(i,a,o,!0);else{if("MultiPolygon"!==n){if("GeometryCollection"===n){for(s=0;s<e.geometry.geometries.length;s++)Y(t,{id:e.id,geometry:e.geometry.geometries[s],properties:e.properties},r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(s=0;s<i.length;s++){var l=[];
vendor: 4,690 bytes, line 9
9tt(i[s],l,o,!0),a.push(l)}}t.push(X(e.id,n,a,e.properties))}}function J(t,e){e.push(et(t[0])),e.push(rt(t[1])),e.push(0)}function Q(t,e,r,i){for(var n,o,a=0,s=0;s<t.length;s++){var l=et(t[s][0]),u=rt(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(a+=i?(n*u-l*o)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(u-o,2))),n=l,o=u}var c=e.length-3;e[2]=1,function h(t,e,r,i){for(var n,o=i,a=t[e],s=t[e+1],l=t[r],u=t[r+1],c=e+3;c<r;c+=3){var p=H(t[c],t[c+1],a,s,l,u);p>o&&(n=c,o=p)}o>i&&(n-e>3&&h(t,e,n,i),t[n+2]=o,r-n>3&&h(t,n,r,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function tt(t,e,r,i){for(var n=0;n<t.length;n++){var o=[];Q(t[n],o,r,i),e.push(o)}}function et(t){return t/360+.5}function rt(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 it(t,e,r,i,n,o,a,s){if(i/=e,o>=(r/=e)&&a<i)return t;if(a<r||o>=i)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.type,f=0===n?c.minX:c.minY,d=0===n?c.maxX:c.maxY;if(f>=r&&d<i)l.push(c);else if(!(d<r||f>=i)){var m=[];if("Point"===p||"MultiPoint"===p)nt(h,m,r,i,n);else if("LineString"===p)ot(h,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===p)st(h,m,r,i,n,!1);else if("Polygon"===p)st(h,m,r,i,n,!0);else if("MultiPolygon"===p)for(var y=0;y<h.length;y++){var v=[];st(h[y],v,r,i,n,!0),v.length&&m.push(v)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(y=0;y<m.length;y++)l.push(X(c.id,p,m[y],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(X(c.id,p,m,c.tags))}}}return l.length?l:null}function nt(t,e,r,i,n){for(var o=0;o<t.length;o+=3){var a=t[o+n];a>=r&&a<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function ot(t,e,r,i,n,o,a){for(var s,l,u=at(t),c=0===n?ut:ct,h=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],y=t[p+3],v=t[p+4],g=0===n?f:d,_=0===n?y:v,x=!1;a&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-v,2))),g<r?_>=r&&(l=c(u,f,d,y,v,r),a&&(u.start=h+s*l)):g>=i?_<i&&(l=c(u,f,d,y,v,i),a&&(u.start=h+s*l)):lt(u,f,d,m),_<r&&g>=r&&(l=c(u,f,d,y,v,r),x=!0),_>i&&g<=i&&(l=c(u,f,d,y,v,i),x=!0),!o&&x&&(a&&(u.end=h+s*l),e.push(u),u=at(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(g=0===n?f:d)>=r&&g<=i&<(u,f,d,m),b=u.length-3,o&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&<(u,u[0],u[1],u[2]),u.length&&e.push(u)}function at(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function st(t,e,r,i,n,o){for(var a=0;a<t.length;a++)ot(t[a],e,r,i,n,o,!1)}function lt(t,e,r,i){t.push(e),t.push(r),t.push(i)}function ut(t,e,r,i,n,o){var a=(o-e)/(i-e);return t.push(o),t.push(r+(n-r)*a),t.push(1),a}function ct(t,e,r,i,n,o){var a=(o-r)/(n-r);return t.push(e+(i-e)*a),t.push(o),t.push(1),a}function ht(t,e){for(var r=[],i=0;i<t.length;i++){var n,o=t[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=pt(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var s=0;s<o.geometry.length;s++)n.push(pt(o.geometry[s],e))}else if("MultiPolygon"===a)for(n=[],s=0;s<o.geometry.length;s++){for(var l=[],u=0;u<o.geometry[s].length;u++)l.push(pt(o.geometry[s][u],e));n.push(l)}r.push(X(o.id,a,n,o.tags))}return r}function pt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function ft(t,e){if(t.transformed)return t;var r,i,n,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<u.length;i+=2)l.geometry.push(dt(u[i],u[i+1],e,o,a,s));else for(i=0;i<u.length;i++){var h=[];for(n=0;n<u[i].length;n+=2)h.push(dt(u[i][n],u[i][n+1],e,o,a,s));l.geometry.push(h)}}return t.transformed=!0,t}function dt(t,e,r,i,n,o){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-o))]}function mt(t,e,r,i,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,yt(a,t[s],o,n);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function yt(t,e,r,i){var n=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<n.length;s+=3)a.push(n[s]),a.push(n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)vt(a,n,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<n.length;s++)vt(a,n[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<n.length;l++){var u=n[l];for(s=0;s<u.length;s++)vt(a,u[s],t,r,!0,0===s)}
9if(a.length){var c=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function vt(t,e,r,i,n,o){var a=i*i;if(i>0&&e.size<(n?a:i))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===i||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;n&&function(t,e){for(var r=0,i=0,n=t.length,o=n-2;i<n;o=i,i+=2)r+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(r>0===e)for(i=0,n=t.length;i<n/2;i+=2){var a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}(s,o),t.push(s)}}function gt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");var i=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)Y(r,t.features[i],e);else"Feature"===t.type?Y(r,t,e):Y(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(t,e){var r=e.buffer/e.extent,i=t,n=it(t,1,-1-r,r,0,-1,2,e),o=it(t,1,1-r,2+r,0,-1,2,e);return(n||o)&&(i=it(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=ht(n,1).concat(i)),o&&(i=i.concat(ht(o,-1)))),i}(i,e)).length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function _t(t,e,r){return 32*((1<<t)*r+e)+t}function xt(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return e(null,null);var n=new Ft(i.features),o=jt(n);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:n,rawData:o.buffer})}var bt=function(t){t&&this.replace(t)};bt.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},bt.prototype.update=function(e,i){for(var n=this,o=0,a=e;o<a.length;o+=1){var s=a[o];n._layerConfigs[s.id]=s;var l=n._layers[s.id]=t.default$20(s);l._featureFilter=t.default$24(l.filter)}for(var u=0,c=i;u<c.length;u+=1){var h=c[u];delete n._layerConfigs[h],delete n._layers[h]}this.familiesBySource={};for(var p=0,f=function(t){for(var e={},i=0;i<t.length;i++){var n=r(t[i]),o=e[n];o||(o=e[n]=[]),o.push(t[i])}var a=[];for(var s in e)a.push(e[s]);return a}(t.values(this._layerConfigs));p<f.length;p+=1){var d=f[p].map(function(t){return n._layers[t.id]}),m=d[0];if("none"!==m.visibility){var y=m.source||"",v=n.familiesBySource[y];v||(v=n.familiesBySource[y]={});var g=m.sourceLayer||"_geojsonTileLayer",_=v[g];_||(_=v[g]=[]),_.push(d)}}};var wt=function(){this.opacity=0,this.targetOpacity=0,this.time=0};wt.prototype.clone=function(){var t=new wt;return t.opacity=this.opacity,t.targetOpacity=this.targetOpacity,t.time=this.time,t},t.register("OpacityState",wt);var Et=function(e,r,i,n,o,a,s,l,u,c,h,p){var f=s.top*l-u,d=s.bottom*l+u,m=s.left*l-u,y=s.right*l+u;if(this.boxStartIndex=e.length,c){var v=d-f,g=y-m;v>0&&(v=Math.max(10*l,v),this._addLineCollisionCircles(e,r,i,i.segment,g,v,n,o,a,h))}else{if(p){var _=new t["default"](m,f),x=new t["default"](y,f),b=new t["default"](m,d),w=new t["default"](y,d),E=p*Math.PI/180;_._rotate(E),x._rotate(E),b._rotate(E),w._rotate(E),m=Math.min(_.x,x.x,b.x,w.x),y=Math.max(_.x,x.x,b.x,w.x),f=Math.min(_.y,x.y,b.y,w.y),d=Math.max(_.y,x.y,b.y,w.y)}e.emplaceBack(i.x,i.y,m,f,y,d,n,o,a,0,0)}this.boxEndIndex=e.length};Et.prototype._addLineCollisionCircles=function(t,e,r,i,n,o,a,s,l,u){var c=o/2,h=Math.floor(n/c),p=1+.4*Math.log(u)/Math.LN2,f=Math.floor(h*p/2),d=-o/2,m=r,y=i+1,v=d,g=-n/2,_=g-n/4;do{if(--y<0){if(v>g)return;y=0;break}v-=e[y].dist(m),m=e[y]}while(v>_);for(var x=e[y].dist(e[y+1]),b=-f;b<h+f;b++){var w=b*c,E=g+w;if(w<0&&(E+=w),w>n&&(E+=w-n),!(E<v)){for(;v+x<E;){if(v+=x,++y+1>=e.length)return;x=e[y].dist(e[y+1])}var S=E-v,T=e[y],z=e[y+1].sub(T)._unit()._mult(S)._add(T)._round(),A=Math.abs(E-d)<c?0:.8*(E-d);t.emplaceBack(z.x,z.y,-o/2,-o/2,o/2,o/2,a,s,l,o/2,A)}}};var St=o,Tt=o;o.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var n=t-1>>1,o=e[n];if(r(i,o)>=0)break;e[t]=o,t=n}e[t]=i},_down:function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t<i;){var o=1+(t<<1),a=o+1,s=e[o];if(a<this.length&&r(e[a],s)<0&&(o=a,s=e[a]),r(s,n)>=0)break;e[t]=s,t=o}e[t]=n}},St["default"]=Tt;var zt=function(e){var r=new t.AlphaImage({width:0,height:0 10}),i={},n=new t.default$3(0,0,{autoResize:!0});for(var o in e){var a=e[o],s=i[o]={};for(var l in a){var u=a[+l];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var c=n.packOne(u.bitmap.width+2,u.bitmap.height+2);r.resize({width:n.w,height:n.h}),t.AlphaImage.copy(u.bitmap,r,{x:0,y:0},{x:c.x+1,y:c.y+1},u.bitmap),s[l]={rect:c,metrics:u.metrics}}}}n.shrink(),r.resize({width:n.w,height:n.h}),this.image=r,this.positions=i};t.register("GlyphAtlas",zt);var At=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming};At.prototype.parse=function(e,r,i,n){function o(){if(u)return n(u);if(h&&p){var e=new zt(h),r=new t.default$30(p);for(var i in f){var o=f[i];o instanceof t.default$27&&(d(o.layers,this.zoom),c(o,h,e.positions,p,r.positions,this.showCollisionBoxes))}this.status="done",n(null,{buckets:t.values(f).filter(function(t){return!t.isEmpty()}),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,iconAtlasImage:r.image})}}var a=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;
10var s=new t.default$29(Object.keys(e.layers).sort()),l=new t.default$28(this.tileID);l.bucketLayerIDs=[];var u,h,p,f={},m={featureIndex:l,iconDependencies:{},glyphDependencies:{}},y=r.familiesBySource[this.source];for(var v in y){var g=e.layers[v];if(g){1===g.version&&t.warnOnce('Vector tile source "'+a.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=s.encode(v),x=[],b=0;b<g.length;b++){var w=g.feature(b);x.push({feature:w,index:b,sourceLayerIndex:_})}for(var E=0,S=y[v];E<S.length;E+=1){var T=S[E],z=T[0];z.minzoom&&a.zoom<Math.floor(z.minzoom)||z.maxzoom&&a.zoom>=z.maxzoom||"none"!==z.visibility&&(d(T,a.zoom),(f[z.id]=z.createBucket({index:l.bucketLayerIDs.length,layers:T,zoom:a.zoom,pixelRatio:a.pixelRatio,overscaling:a.overscaling,collisionBoxArray:a.collisionBoxArray,sourceLayerIndex:_,sourceID:a.source})).populate(x,m),l.bucketLayerIDs.push(T.map(function(t){return t.id})))}}}var A=t.mapObject(m.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(A).length?i.send("getGlyphs",{uid:this.uid,stacks:A},function(t,e){u||(u=t,h=e,o.call(a))}):h={};var M=Object.keys(m.iconDependencies);M.length?i.send("getImages",{icons:M},function(t,e){u||(u=t,p=e,o.call(a))}):p={},o.call(this)};var Mt="undefined"!=typeof performance,kt={getEntriesByName:function(t){return!!(Mt&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(Mt&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(Mt&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(Mt&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(Mt&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},It=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},kt.mark(this._marks.start)};It.prototype.finish=function(){kt.mark(this._marks.end);var t=kt.getEntriesByName(this._marks.measure);return 0===t.length&&(kt.measure(this._marks.measure,this._marks.start,this._marks.end),t=kt.getEntriesByName(this._marks.measure),kt.clearMarks(this._marks.start),kt.clearMarks(this._marks.end),kt.clearMeasures(this._marks.measure)),t},kt.Performance=It;var Ct=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||m,this.loading={},this.loaded={}};Ct.prototype.loadTile=function(e,r){var i=this,n=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new kt.Performance(e.request),a=this.loading[n]=new At(e);a.abort=this.loadVectorData(e,function(e,s){if(delete i.loading[n],e||!s)return r(e);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(o){var h=o.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,i.layerIndex,i.actor,function(e,i){return e||!i?r(e):void r(null,t.extend({rawTileData:l.slice(0)},i,u,c))}),i.loaded=i.loaded||{},i.loaded[n]=a})},Ct.prototype.reloadTile=function(t,e){var r=this.loaded,i=t.uid,n=this;if(r&&r[i]){var o=r[i];o.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,r){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,n.layerIndex,n.actor,i)),e(t,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&o.parse(o.vectorTile,this.layerIndex,this.actor,a)}},Ct.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()},Ct.prototype.removeTile=function(t,e){var r=this.loaded,i=t.uid;r&&r[i]&&delete r[i],e()};var Lt=function(){this.loading={},this.loaded={}};Lt.prototype.loadTile=function(e,r){var i=e.uid,n=e.encoding,o=new t.default$33(i);this.loading[i]=o,o.loadFromImage(e.rawImageData,n),delete this.loading[i],this.loaded=this.loaded||{},this.loaded[i]=o,r(null,o)},Lt.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Pt={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142},Dt={geometry:function Jt(t){var e,r=0;switch(t.type){case"Polygon":return y(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=y(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)r+=Jt(t.geometries[e]);return r}},ring:v},Bt=function Qt(t,e){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(_(Qt,e)),t;
10case"Feature":return t.geometry=Qt(t.geometry,e),t;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=x(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(_(x,e))),t}(t,e);default:return t}},Rt=t.default$31.VectorTileFeature.prototype.toGeoJSON,Ot=function(e){this._feature=e,this.extent=t.default$10,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};Ot.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var n=i[r];e.push([new t["default"](n[0],n[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],u=0,c=s[a];u<c.length;u+=1){var h=c[u];l.push(new t["default"](h[0],h[1]))}o.push(l)}return o},Ot.prototype.toGeoJSON=function(t,e,r){return Rt.call(this,t,e,r)};var Ft=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.default$10,this.length=e.length,this._features=e};Ft.prototype.feature=function(t){return new Ot(this._features[t])};var Vt=t.__moduleExports.VectorTileFeature,Nt=w;w.prototype.feature=function(t){return new E(this.features[t],this.options.extent)},E.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<i.length;o++)n.push(new t.default$34(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},E.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[e,i,r,n]},E.prototype.toGeoJSON=Vt.prototype.toGeoJSON;var jt=S,Ut=S,$t=function(t,e){e=e||{};var r={};for(var i in t)r[i]=new Nt(t[i].features,e),r[i].name=i,r[i].version=e.version,r[i].extent=e.extent;return S({layers:r})},qt=Nt;jt.fromVectorTileJs=Ut,jt.fromGeojsonVt=$t,jt.GeoJSONWrapper=qt;var Zt=function te(t,e,r,i,n,o){if(!(n-i<=r)){var a=Math.floor((i+n)/2);!function s(t,e,r,i,n,o){for(;n>i;){if(n-i>600){var a=n-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1),p=Math.max(i,Math.floor(r-l*c/a+h)),f=Math.min(n,Math.floor(r+(a-l)*c/a+h));s(t,e,r,p,f,o)}var d=e[2*r+o],m=i,y=n;for(L(t,e,i,r),e[2*n+o]>d&&L(t,e,i,n);m<y;){for(L(t,e,m,y),m++,y--;e[2*m+o]<d;)m++;for(;e[2*y+o]>d;)y--}e[2*i+o]===d?L(t,e,i,y):L(t,e,++y,n),y<=r&&(i=y+1),r<=y&&(n=y-1)}}(t,e,a,i,n,o%2),te(t,e,r,i,a-1,o+1),te(t,e,r,a+1,n,o+1)}},Gt=function(t,e,r,i,n,o,a){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),p=u.pop(),f=u.pop();if(p-f<=a)for(var d=f;d<=p;d++)s=e[2*d],l=e[2*d+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(t[m]);var y=(h+1)%2;(0===h?r<=s:i<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===h?n>=s:o>=l)&&(u.push(m+1),u.push(p),u.push(y))}}return c},Wt=function(t,e,r,i,n,o){for(var a=[0,t.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)D(e[2*p],e[2*p+1],r,i)<=l&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],m=e[2*f+1];D(d,m,r,i)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?r-n<=d:i-n<=m)&&(a.push(h),a.push(f-1),a.push(y)),(0===u?r+n>=d:i+n>=m)&&(a.push(f+1),a.push(c),a.push(y))}}return s},Ht=function(t,e,r,i,n){return new B(t,e,r,i,n)};B.prototype={range:function(t,e,r,i){return Gt(this.ids,this.coords,t,e,r,i,this.nodeSize)},within:function(t,e,r){return Wt(this.ids,this.coords,t,e,r,this.nodeSize)}};var Xt=function(t){return new F(t)};F.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var i=t.map(N);e&&console.timeEnd(r);for(var n=this.options.maxZoom;n>=this.options.minZoom;n--){var o=+Date.now();this.trees[n+1]=Ht(i,G,W,this.options.nodeSize,Float32Array),i=this._cluster(i,n),e&&console.log("z%d: %d clusters in %dms",n,i.length,+Date.now()-o)}return this.trees[this.options.minZoom]=Ht(i,G,W,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],i=r.range($(t[0]),q(t[3]),$(t[2]),q(t[1])),n=[],o=0;o<i.length;o++){var a=r.points[i[o]];n.push(a.numPoints?j(a):this.points[a.id])}return n},getChildren:function(t,e){for(var r=this.trees[e+1].points[t],i=this.options.radius/(this.options.extent*Math.pow(2,e)),n=this.trees[e+1].within(r.x,r.y,i),o=[],a=0;a<n.length;a++){var s=this.trees[e+1].points[n[a]];s.parentId===t&&o.push(s.numPoints?j(s):this.points[s.id])}return o},getLeaves:function(t,e,r,i){r=r||10,i=i||0;var n=[];return this._appendLeaves(n,t,e,r,i,0),n},getTile:function(t,e,r){var i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),o=this.options.extent,a=this.options.radius/o,s=(r-a)/n,l=(r+1+a)/n,u={features:[]};return this._addTileFeatures(i.range((e-a)/n,s,(e+1+a)/n,l),i.points,e,r,n,u),0===e&&this._addTileFeatures(i.range(1-a/n,s,1,l),i.points,n,r,n,u),e===n-1&&this._addTileFeatures(i.range(0,s,a/n,l),i.points,-1,r,n,u),u.features.length?u:null},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var r=this.getChildren(t,e);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},_appendLeaves:function(t,e,r,i,n,o){for(var a=this.getChildren(e,r),s=0;s<a.length;s++){var l=a[s].properties;if(l.cluster?o+l.point_count<=n?o+=l.point_count:o=this._appendLeaves(t,l.cluster_id,r+1,i,n,o):o<n?o++:t.push(a[s]),t.length===i)break}return o},_addTileFeatures:function(t,e,r,i,n,o){for(var a=0;a<t.length;a++){var s=e[t[a]];o.features.push({type:1,geometry:[[Math.round(this.options.extent*(s.x*n-r)),Math.round(this.options.extent*(s.y*n-i))]],tags:s.numPoints?U(s):this.points[s.id].properties})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],i=this.options.radius/(this.options.extent*Math.pow(2,e)),n=0;n<t.length;n++){var o=t[n];if(!(o.zoom<=e)){o.zoom=e;var a=this.trees[e+1],s=a.within(o.x,o.y,i),l=o.numPoints||1,u=o.x*l,c=o.y*l,h=null;this.options.reduce&&(h=this.options.initial(),this._accumulate(h,o));for(var p=0;p<s.length;p++){var f=a.points[s[p]];if(e<f.zoom){var d=f.numPoints||1;f.zoom=e,u+=f.x*d,c+=f.y*d,l+=d,f.parentId=n,this.options.reduce&&this._accumulate(h,f)}}1===l?r.push(o):(o.parentId=n,r.push(V(u/l,c/l,l,n,h)))}}return r},_accumulate:function(t,e){var r=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,r)}},gt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,debug:0},gt.prototype.splitTile=function(t,e,r,i,n,o,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 c=1<<e,h=_t(e,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=mt(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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,n){if(e===l.maxZoom||e===n)continue;var d=1<<n-e;if(r!==Math.floor(o/d)||i!==Math.floor(a/d))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){u>1&&console.time("clipping");var m,y,v,g,_,x,b=.5*l.buffer/l.extent,w=.5-b,E=.5+b,S=1+b;m=y=v=g=null,_=it(t,c,r-b,r+E,0,p.minX,p.maxX,l),x=it(t,c,r+w,r+S,0,p.minX,p.maxX,l),t=null,_&&(m=it(_,c,i-b,i+E,1,p.minY,p.maxY,l),y=it(_,c,i+w,i+S,1,p.minY,p.maxY,l),_=null),x&&(v=it(x,c,i-b,i+E,1,p.minY,p.maxY,l),g=it(x,c,i+w,i+S,1,p.minY,p.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(v||[],e+1,2*r+1,2*i),s.push(g||[],e+1,2*r+1,2*i+1)}}},gt.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,o=i.debug;if(t<0||t>24)return null;var a=1<<t,s=_t(t,e=(e%a+a)%a,r);if(this.tiles[s])return ft(this.tiles[s],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[_t(u,c,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",u,c,h),o>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ft(this.tiles[s],n):null):null};var Kt=function(t){function e(e,r,i){t.call(this,e,r,xt),i&&(this.loadGeoJSON=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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())},e.prototype._loadData=function(){var t=this;
10if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new kt.Performance(r.request);this.loadGeoJSON(r,function(n,o){if(n||!o)return e(n);if("object"!=typeof o)return e(new Error("Input data is not a valid GeoJSON object."));Bt(o,!0);try{t._geoJSONIndex=r.cluster?Xt(r.superclusterOptions).load(o.features):function(t,e){return new gt(t,e)}(o,r.geojsonVtOptions)}catch(n){return e(n)}t.loaded={};var a={};if(i){var s=i.finish();s&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(s)))}e(null,a)})}},e.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},e.prototype.reloadTile=function(e,r){var i=this.loaded,n=e.uid;return i&&i[n]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)r.getJSON(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(r){return e(new Error("Input data is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},e}(Ct),Yt=function(e){var r=this;this.self=e,this.actor=new t.default$9(e,this),this.layerIndexes={},this.workerSourceTypes={vector:Ct,geojson:Kt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText}};return Yt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Yt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Yt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Yt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Yt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Yt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Yt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Yt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Yt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var i=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,r):r()}},Yt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Yt.prototype.loadRTLTextPlugin=function(t,e,r){try{i.plugin.isLoaded()||(this.self.importScripts(e),r(i.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(i){r(i.toString())}},Yt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new bt),e},Yt.prototype.getWorkerSource=function(t,e,r){var i=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var n={send:function(e,r,n){i.actor.send(e,r,n,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](n,this.getLayerIndex(t))}return this.workerSources[t][e][r]},Yt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new Lt),this.demWorkerSources[t][e]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new Yt(self),Yt}),t(["./chunk1.js"],function(t){function e(t){if(!mt)return null;for(var e=0;e<t.length;e++)if(t[e]in mt)return t[e];return t[0]}function r(t,e){var r=n(bt.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!bt.REQUIRE_ACCESS_TOKEN)return o(t);if(!(e=e||bt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+wt);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+wt);return t.params.push("access_token="+e),o(t)}function i(t){return 0===t.indexOf("mapbox:")}function n(t){var e=t.match(Mt);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 o(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function a(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function s(t,e,r,i,n,o,a){for(var s=0;s<e;s++){for(var u=0;u<r;u++)i[u]=t[u*e+s];for(l(i,n,o,a,r),u=0;u<r;u++)t[u*e+s]=n[u]}for(u=0;
10u<r;u++){for(s=0;s<e;s++)i[s]=t[u*e+s];for(l(i,n,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(n[s])}}function l(t,e,r,i,n){r[0]=0,i[0]=-Ct,i[1]=+Ct;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=i[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,i[a]=s,i[a+1]=+Ct}for(o=0,a=0;o<n;o++){for(;i[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}function u(e,r,i){var n=function(e,r){if(e)return i(e);if(r){var n=t.pick(r,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);r.vector_layers&&(n.vectorLayers=r.vector_layers,n.vectorLayerIds=n.vectorLayers.map(function(t){return t.id})),i(null,n)}};e.url?t.getJSON(r(St(e.url),t.ResourceType.Source),n):t.default$2.frame(function(){return n(null,e)})}function c(t,e,r,i,n){var o=n.maxPitchScaleFactor(),a=t.tilesIn(r,o);a.sort(h);for(var s=[],l=0,u=a;l<u.length;l+=1){var c=u[l];s.push({wrappedTileID:c.tileID.wrapped().key,queryResults:c.tile.queryRenderedFeatures(e,t._state,c.queryGeometry,c.scale,i,n,o,t.transform.calculatePosMatrix(c.tileID.toUnwrapped()))})}var p=function(t){for(var e={},r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=o.queryResults,s=o.wrappedTileID,l=r[s]=r[s]||{};for(var u in a)for(var c=a[u],h=l[u]=l[u]||{},p=e[u]=e[u]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m.feature))}}return e}(s);for(var f in p)p[f].forEach(function(e){var r=t.getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=r});return p}function h(t,e){var r=t.tileID,i=e.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}function p(e,r){var i=r.zoomTo(e.canonical.z);return new t["default"]((i.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.default$10,(i.row-e.canonical.y)*t.default$10)}function f(t){return"raster"===t||"image"===t||"video"===t}function d(){return new t.default$1.Worker(hi.workerUrl)}function m(e,r){var i={};for(var n in e)"ref"!==n&&(i[n]=e[n]);
10return t.default$17.forEach(function(t){t in r&&(i[t]=r[t])}),i}function y(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=m(t[i],e[t[i].ref]));return t}function v(t,e,r){r.push({command:Fe.addSource,args:[t,e[t]]})}function g(t,e,r){e.push({command:Fe.removeSource,args:[t]}),r[t]=!0}function _(t,e,r,i){g(t,r,i),v(t,e,r)}function x(e,r,i){var n;for(n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!t.default$13(e[i][n],r[i][n]))return!1;for(n in r[i])if(r[i].hasOwnProperty(n)&&"data"!==n&&!t.default$13(e[i][n],r[i][n]))return!1;return!0}function b(e,r,i,n,o,a){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.default$13(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.default$13(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}))}function w(t){return t.id}function E(t,e){return t[e.id]=e,t}function S(t,e){if(!t)return[{command:Fe.setStyle,args:[e]}];var r=[];try{if(!a.default$13(t.version,e.version))return[{command:Fe.setStyle,args:[e]}];a.default$13(t.center,e.center)||r.push({command:Fe.setCenter,args:[e.center]}),a.default$13(t.zoom,e.zoom)||r.push({command:Fe.setZoom,args:[e.zoom]}),a.default$13(t.bearing,e.bearing)||r.push({command:Fe.setBearing,args:[e.bearing]}),a.default$13(t.pitch,e.pitch)||r.push({command:Fe.setPitch,args:[e.pitch]}),a.default$13(t.sprite,e.sprite)||r.push({command:Fe.setSprite,args:[e.sprite]}),a.default$13(t.glyphs,e.glyphs)||r.push({command:Fe.setGlyphs,args:[e.glyphs]}),a.default$13(t.transition,e.transition)||r.push({command:Fe.setTransition,args:[e.transition]}),a.default$13(t.light,e.light)||r.push({command:Fe.setLight,args:[e.light]});var i={},n=[];!function(t,e,r,i){var n;for(n in e=e||{},t=t||{})t.hasOwnProperty(n)&&(e.hasOwnProperty(n)||g(n,r,i));for(n in e)e.hasOwnProperty(n)&&(t.hasOwnProperty(n)?a.default$13(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&x(t,e,n)?r.push({command:Fe.setGeoJSONSourceData,args:[n,e[n].data]}):_(n,e,r,i)):v(n,e,r))}(t.sources,e.sources,n,i);var o=[];t.layers&&t.layers.forEach(function(t){i[t.source]?r.push({command:Fe.removeLayer,args:[t.id]}):o.push(t)}),r=r.concat(n),function(t,e,r){e=e||[];var i,n,o,s,l,u,c,h=(t=t||[]).map(w),p=e.map(w),f=t.reduce(E,{}),d=e.reduce(E,{}),m=h.slice(),y=Object.create(null);for(i=0,n=0;i<h.length;i++)o=h[i],d.hasOwnProperty(o)?n++:(r.push({command:Fe.removeLayer,args:[o]}),m.splice(m.indexOf(o,n),1));for(i=0,n=0;i<p.length;i++)o=p[p.length-1-i],m[m.length-1-i]!==o&&(f.hasOwnProperty(o)?(r.push({command:Fe.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-n),1)):n++,u=m[m.length-i],r.push({command:Fe.addLayer,args:[d[o],u]}),m.splice(m.length-i,0,o),y[o]=!0);for(i=0;i<p.length;i++)if(s=f[o=p[i]],l=d[o],!y[o]&&!a.default$13(s,l))if(a.default$13(s.source,l.source)&&a.default$13(s["source-layer"],l["source-layer"])&&a.default$13(s.type,l.type)){for(c in b(s.layout,l.layout,r,o,null,Fe.setLayoutProperty),b(s.paint,l.paint,r,o,null,Fe.setPaintProperty),a.default$13(s.filter,l.filter)||r.push({command:Fe.setFilter,args:[o,l.filter]}),a.default$13(s.minzoom,l.minzoom)&&a.default$13(s.maxzoom,l.maxzoom)||r.push({command:Fe.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?b(s[c],l[c],r,o,c.slice(6),Fe.setPaintProperty):a.default$13(s[c],l[c])||r.push({command:Fe.setLayerProperty,args:[o,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?b(s[c],l[c],r,o,c.slice(6),Fe.setPaintProperty):a.default$13(s[c],l[c])||r.push({command:Fe.setLayerProperty,args:[o,c,l[c]]}))}else r.push({command:Fe.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],r.push({command:Fe.addLayer,args:[l,u]})}(o,e.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:Fe.setStyle,args:[e]}]}return r}function T(e,r,i,n,o){var a=t.identity(new Float32Array(16));return r?(t.identity(a),t.scale(a,a,[1/o,1/o,1]),i||t.rotateZ(a,a,n.angle)):(t.scale(a,a,[n.width/2,-n.height/2,1]),t.translate(a,a,[1,-1,0]),t.multiply(a,a,e)),a}function z(e,r,i,n,o){var a=t.identity(new Float32Array(16));return r?(t.multiply(a,a,e),t.scale(a,a,[o,o,1]),i||t.rotateZ(a,a,-n.angle)):(t.scale(a,a,[1,-1,1]),t.translate(a,a,[-1,-1,0]),t.scale(a,a,[2/n.width,2/n.height,1])),a}function A(e,r){var i=[e.x,e.y,0,1];R(i,i,r);var n=i[3];return{point:new t["default"](i[0]/n,i[1]/n),signedDistanceFromCamera:n}}function M(t,e){var r=t[0]/t[3],i=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function k(e,r,i,n,o,a,s,l){var u=n?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,i.transform.zoom,Ne.properties[n?"text-size":"icon-size"]),h=[256/i.width*2+1,256/i.height*2+1],p=n?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=n?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,v=0;v<d.length;v++){var g=d.get(v);if(g.hidden||g.writingMode===t.WritingMode.vertical&&!y)B(g.numGlyphs,p);else{y=!1;var _=[g.anchorX,g.anchorY,0,1];if(t.transformMat4(_,_,r),M(_,h)){var x=.5+_[3]/i.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature
vendor: 2,408 bytes, line 10
10(u,c,g),w=s?b*x:b/x,E=new t["default"](g.anchorX,g.anchorY),S=A(E,o).point,T={},z=L(g,w,!1,l,r,o,a,e.glyphOffsetArray,f,p,S,E,T,m);y=z.useVertical,(z.notEnoughRoom||y||z.needsFlipping&&L(g,w,!0,l,r,o,a,e.glyphOffsetArray,f,p,S,E,T,m).notEnoughRoom)&&B(g.numGlyphs,p)}else B(g.numGlyphs,p)}}n?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function I(t,e,r,i,n,o,a,s,l,u,c,h){var p=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(p-1),v=D(t*m,r,i,n,o,a,s.segment,f,d,l,u,c,h);if(!v)return null;var g=D(t*y,r,i,n,o,a,s.segment,f,d,l,u,c,h);return g?{first:v,last:g}:null}function C(e,r,i,n){return e===t.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function L(e,r,i,n,o,a,s,l,u,c,h,p,f,d){var m,y=r/24,v=e.lineOffsetX*r,g=e.lineOffsetY*r;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=I(y,l,v,g,i,h,p,e,u,a,f,!1);if(!w)return{notEnoughRoom:!0};var E=A(w.first.point,s).point,S=A(w.last.point,s).point;if(n&&!i){var T=C(e.writingMode,E,S,d);if(T)return T}m=[w.first];for(var z=e.glyphStartIndex+1;z<_-1;z++)m.push(D(y*l.getoffsetX(z),v,g,i,h,p,e.segment,x,b,u,a,f,!1));m.push(w.last)}else{if(n&&!i){var M=A(p,o).point,k=e.lineStartIndex+e.segment+1,L=new t["default"](u.getx(k),u.gety(k)),B=A(L,o),R=B.signedDistanceFromCamera>0?B.point:P(p,L,M,1,o),O=C(e.writingMode,M,R,d);if(O)return O}var F=D(y*l.getoffsetX(e.glyphStartIndex),v,g,i,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,a,f,!1);if(!F)return{notEnoughRoom:!0};m=[F]}for(var V=0,N=m;V<N.length;V+=1){var j=N[V];t.addDynamicAttributes(c,j.point,j.angle)}return{}}function P(t,e,r,i,n){var o=A(t.add(t.sub(e)._unit()),n).point,a=r.sub(o);return r.add(a._mult(i/a.mag()))}function D(e,r,i,n,o,a,s,l,u,c,h,p,f){var d=n?e-r:e+r,m=d>0?1:-1,y=0;n&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var v=m>0?l+s:l+s+1,g=v,_=o,x=o,b=0,w=0,E=Math.abs(d);b+w<=E;){if((v+=m)<l||v>=u)return null;if(x=_,void 0===(_=p[v])){var S=new t["default"](c.getx(v),c.gety(v)),T=A(S,h);if(T.signedDistanceFromCamera>0)_=p[v]=T.point;else{var z=v-m;_=P(0===b?a:new t["default"](c.getx(z),c.gety(z)),S,x,E-b+1,h)}}b+=w,w=x.dist(_)}var M=(E-b)/w,k=_.sub(x),I=k.mult(M)._add(x);
10return I._add(k._unit()._perp()._mult(i*m)),{point:I,angle:y+Math.atan2(_.y-x.y,_.x-x.x),tileDistance:f?{prevTileDistance:v-m===g?0:c.gettileUnitDistanceFromAnchor(v-m),lastSegmentViewportDistance:E-b}:null}}function B(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(je,3*i)}}function R(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t[3]=r[3]*i+r[7]*n+r[15],t}function O(t,e,r){t[e+4]=r?1:0}function F(e,r,i){return r*(t.default$10/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function V(t,e,r){t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0),t.emplaceBack(e?1:0,r?1:0)}function N(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*Xe+e*Ke+r*Ye+e*Je+r*Qe+e*tr+r*er+e}function j(e,r,i,n,o){for(var a=0;a<i.length;a++){var s=i[a];if(n.isLessThan(s.tileID))break;if(r.key===s.tileID.key)return;if(s.tileID.isChildOf(r)){for(var l=r.children(1/0),u=0;u<l.length;u++)j(e,l[u],i.slice(a),n,o);return}}var c=r.overscaledZ-e.overscaledZ,h=new t.CanonicalTileID(c,r.canonical.x-(e.canonical.x<<c),r.canonical.y-(e.canonical.y<<c)); 11o[h.key]=o[h.key]||h}function U(t,e,r,i,n){var o=t.context,a=o.gl,s=n?t.useProgram("collisionCircle"):t.useProgram("collisionBox");o.setDepthMode(Ce.disabled),o.setStencilMode(Le.disabled),o.setColorMode(t.colorModeForRenderPass());for(var l=0;l<i.length;l++){var u=i[l],c=e.getTile(u),h=c.getBucket(r);if(h){var p=n?h.collisionCircle:h.collisionBox;if(p){a.uniformMatrix4fv(s.uniforms.u_matrix,!1,u.posMatrix),a.uniform1f(s.uniforms.u_camera_to_center_distance,t.transform.cameraToCenterDistance);var f=F(c,1,t.transform.zoom),d=Math.pow(2,t.transform.zoom-c.tileID.overscaledZ);a.uniform1f(s.uniforms.u_pixels_to_tile_units,f),a.uniform2f(s.uniforms.u_extrude_scale,t.transform.pixelsToGLUnits[0]/(f*d),t.transform.pixelsToGLUnits[1]/(f*d)),a.uniform1f(s.uniforms.u_overscale_factor,c.tileID.overscaleFactor()),s.draw(o,n?a.TRIANGLES:a.LINES,r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,p.collisionVertexBuffer,null)}}}}function $(t,e,r,i,n,o,a,s,l,u){var c,h=t.context,p=h.gl,f=t.transform,d="map"===s,m="map"===l,y=d&&"line"===r.layout.get("symbol-placement"),v=d&&!m&&!y,g=m;h.setDepthMode(g?t.depthModeForSublayer(0,Ce.ReadOnly):Ce.disabled);for(var _=0,x=i;_<x.length;_+=1){var b=x[_],w=e.getTile(b),E=w.getBucket(r);if(E){var S=n?E.text:E.icon;if(S&&S.segments.get().length){var A=S.programConfigurations.get(r.id),M=n||E.sdfIcons,I=n?E.textSizeData:E.iconSizeData;if(c||(c=t.useProgram(M?"symbolSDF":"symbolIcon",A),A.setUniforms(t.context,c,r.paint,{zoom:t.transform.zoom}),q(c,t,r,n,v,m,I)),h.activeTexture.set(p.TEXTURE0),p.uniform1i(c.uniforms.u_texture,0),n)w.glyphAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),p.uniform2fv(c.uniforms.u_texsize,w.glyphAtlasTexture.size);else{var C=1!==r.layout.get("icon-size").constantOr(0)||E.iconsNeedLinear,L=m||0!==f.pitch;w.iconAtlasTexture.bind(M||t.options.rotating||t.options.zooming||C||L?p.LINEAR:p.NEAREST,p.CLAMP_TO_EDGE),p.uniform2fv(c.uniforms.u_texsize,w.iconAtlasTexture.size)}p.uniformMatrix4fv(c.uniforms.u_matrix,!1,t.translatePosMatrix(b.posMatrix,w,o,a));var P=F(w,1,t.transform.zoom),D=T(b.posMatrix,m,d,t.transform,P),B=z(b.posMatrix,m,d,t.transform,P);p.uniformMatrix4fv(c.uniforms.u_gl_coord_matrix,!1,t.translatePosMatrix(B,w,o,a,!0)),y?(p.uniformMatrix4fv(c.uniforms.u_label_plane_matrix,!1,xr),k(E,b.posMatrix,t,n,D,B,m,u)):p.uniformMatrix4fv(c.uniforms.u_label_plane_matrix,!1,D),p.uniform1f(c.uniforms.u_fade_change,t.options.fadeDuration?t.symbolFadeChange:1),Z(c,A,t,r,w,S,n,M,m)}}}}function q(e,r,i,n,o,a,s){var l=r.context.gl,u=r.transform;l.uniform1i(e.uniforms.u_pitch_with_map,a?1:0),l.uniform1f(e.uniforms.u_is_text,n?1:0),l.uniform1f(e.uniforms.u_pitch,u.pitch/360*2*Math.PI);var c="constant"===s.functionType||"source"===s.functionType,h="constant"===s.functionType||"camera"===s.functionType;l.uniform1i(e.uniforms.u_is_size_zoom_constant,c?1:0),l.uniform1i(e.uniforms.u_is_size_feature_constant,h?1:0),l.uniform1f(e.uniforms.u_camera_to_center_distance,u.cameraToCenterDistance);var p=t.evaluateSizeForZoom(s,u.zoom,br.properties[n?"text-size":"icon-size"]);void 0!==p.uSizeT&&l.uniform1f(e.uniforms.u_size_t,p.uSizeT),void 0!==p.uSize&&l.uniform1f(e.uniforms.u_size,p.uSize),l.uniform1f(e.uniforms.u_aspect_ratio,u.width/u.height),l.uniform1i(e.uniforms.u_rotate_symbol,o?1:0)}function Z(t,e,r,i,n,o,a,s,l){var u=r.context,c=u.gl,h=r.transform;if(s){var p=0!==i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),f=l?Math.cos(h._pitch)*h.cameraToCenterDistance:1;c.uniform1f(t.uniforms.u_gamma_scale,f),p&&(c.uniform1f(t.uniforms.u_is_halo,1),G(o,i,u,t)),c.uniform1f(t.uniforms.u_is_halo,0)}
11G(o,i,u,t)}function G(t,e,r,i){i.draw(r,r.gl.TRIANGLES,e.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,t.programConfigurations.get(e.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function W(e,r,i,n,o,a,s,l,u){var c,h,p,f,d=r.context,m=d.gl,y=o.paint.get("line-dasharray"),v=o.paint.get("line-pattern");if(l||u){var g=1/F(i,1,r.transform.tileZoom);if(y){c=r.lineAtlas.getDash(y.from,"round"===o.layout.get("line-cap")),h=r.lineAtlas.getDash(y.to,"round"===o.layout.get("line-cap"));var _=c.width*y.fromScale,x=h.width*y.toScale;m.uniform2f(e.uniforms.u_patternscale_a,g/_,-c.height/2),m.uniform2f(e.uniforms.u_patternscale_b,g/x,-h.height/2),m.uniform1f(e.uniforms.u_sdfgamma,r.lineAtlas.width/(256*Math.min(_,x)*t.default$2.devicePixelRatio)/2)}else if(v){if(p=r.imageManager.getPattern(v.from),f=r.imageManager.getPattern(v.to),!p||!f)return;m.uniform2f(e.uniforms.u_pattern_size_a,p.displaySize[0]*v.fromScale/g,p.displaySize[1]),m.uniform2f(e.uniforms.u_pattern_size_b,f.displaySize[0]*v.toScale/g,f.displaySize[1]);var b=r.imageManager.getPixelSize(),w=b.width,E=b.height;m.uniform2fv(e.uniforms.u_texsize,[w,E])}m.uniform2f(e.uniforms.u_gl_units_to_pixels,1/r.transform.pixelsToGLUnits[0],1/r.transform.pixelsToGLUnits[1])}l&&(y?(m.uniform1i(e.uniforms.u_image,0),d.activeTexture.set(m.TEXTURE0),r.lineAtlas.bind(d),m.uniform1f(e.uniforms.u_tex_y_a,c.y),m.uniform1f(e.uniforms.u_tex_y_b,h.y),m.uniform1f(e.uniforms.u_mix,y.t)):v&&(m.uniform1i(e.uniforms.u_image,0),d.activeTexture.set(m.TEXTURE0),r.imageManager.bind(d),m.uniform2fv(e.uniforms.u_pattern_tl_a,p.tl),m.uniform2fv(e.uniforms.u_pattern_br_a,p.br),m.uniform2fv(e.uniforms.u_pattern_tl_b,f.tl),m.uniform2fv(e.uniforms.u_pattern_br_b,f.br),m.uniform1f(e.uniforms.u_fade,v.t))),d.setStencilMode(r.stencilModeForClipping(a));var S=r.translatePosMatrix(a.posMatrix,i,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"));if(m.uniformMatrix4fv(e.uniforms.u_matrix,!1,S),m.uniform1f(e.uniforms.u_ratio,1/F(i,1,r.transform.zoom)),o.paint.get("line-gradient")){d.activeTexture.set(m.TEXTURE0);var T=o.gradientTexture;if(!o.gradient)return;T||(T=o.gradientTexture=new t.default$4(d,o.gradient,m.RGBA)),T.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.uniform1i(e.uniforms.u_image,0)}e.draw(d,m.TRIANGLES,o.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,s)}function H(t,e,r,i,n){if(!wr(r.paint.get("fill-pattern"),t))for(var o=!0,a=0,s=i;a<s.length;a+=1){var l=s[a],u=e.getTile(l),c=u.getBucket(r);c&&(t.context.setStencilMode(t.stencilModeForClipping(l)),n(t,e,r,u,l,c,o),o=!1)}}function X(t,e,r,i,n,o,a){var s=t.context.gl,l=o.programConfigurations.get(r.id);Y("fill",r.paint.get("fill-pattern"),t,l,r,i,n,a).draw(t.context,s.TRIANGLES,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,l)}function K(t,e,r,i,n,o,a){var s=t.context.gl,l=o.programConfigurations.get(r.id),u=Y("fillOutline",r.getPaintProperty("fill-outline-color")?null:r.paint.get("fill-pattern"),t,l,r,i,n,a);s.uniform2f(u.uniforms.u_world,s.drawingBufferWidth,s.drawingBufferHeight),u.draw(t.context,s.LINES,r.id,o.layoutVertexBuffer,o.indexBuffer2,o.segments2,l)}function Y(t,e,r,i,n,o,a,s){var l,u=r.context.program.get();return e?(l=r.useProgram(t+"Pattern",i),(s||l.program!==u)&&(i.setUniforms(r.context,l,n.paint,{zoom:r.transform.zoom}),Er(e,r,l)),Sr(o,r,l)):(l=r.useProgram(t,i),(s||l.program!==u)&&i.setUniforms(r.context,l,n.paint,{zoom:r.transform.zoom})),r.context.gl.uniformMatrix4fv(l.uniforms.u_matrix,!1,r.translatePosMatrix(a.posMatrix,o,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"))),l}function J(e,r,i,n,o,a,s){var l=e.context,u=l.gl,c=i.paint.get("fill-extrusion-pattern"),h=e.context.program.get(),p=a.programConfigurations.get(i.id),f=e.useProgram(c?"fillExtrusionPattern":"fillExtrusion",p);if((s||f.program!==h)&&p.setUniforms(l,f,i.paint,{zoom:e.transform.zoom}),c){if(wr(c,e))return;Er(c,e,f),Sr(n,e,f),u.uniform1f(f.uniforms.u_height_factor,-Math.pow(2,o.overscaledZ)/n.tileSize/8)}e.context.gl.uniformMatrix4fv(f.uniforms.u_matrix,!1,e.translatePosMatrix(o.posMatrix,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor"))),function(e,r){var i=r.context.gl,n=r.style.light,o=n.properties.get("position"),a=[o.x,o.y,o.z],s=t.create$2();"viewport"===n.properties.get("anchor")&&t.fromRotation(s,-r.transform.angle),t.transformMat3(a,a,s);var l=n.properties.get("color");i.uniform3fv(e.uniforms.u_lightpos,a),i.uniform1f(e.uniforms.u_lightintensity,n.properties.get("intensity")),i.uniform3f(e.uniforms.u_lightcolor,l.r,l.g,l.b)}(f,e),f.draw(l,u.TRIANGLES,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,p)}function Q(e,r,i){var n=e.context,o=n.gl,a=r.fbo;if(a){var s=e.useProgram("hillshade"),l=e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),!0);!function(t,e,r){var i=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(i-=e.transform.angle),e.context.gl.uniform2f(t.uniforms.u_light,r.paint.get("hillshade-exaggeration"),i)}(s,e,i);var u=function(e,r){var i=r.toCoordinate(),n=new t.default$15(i.column,i.row+1,i.zoom);return[e.transform.coordinateLocation(i).lat,e.transform.coordinateLocation(n).lat]}(e,r.tileID);n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,a.colorAttachment.get()),o.uniformMatrix4fv(s.uniforms.u_matrix,!1,l),o.uniform2fv(s.uniforms.u_latrange,u),o.uniform1i(s.uniforms.u_image,0);var c=i.paint.get("hillshade-shadow-color");o.uniform4f(s.uniforms.u_shadow,c.r,c.g,c.b,c.a);var h=i.paint.get("hillshade-highlight-color");o.uniform4f(s.uniforms.u_highlight,h.r,h.g,h.b,h.a);var p=i.paint.get("hillshade-accent-color");
11if(o.uniform4f(s.uniforms.u_accent,p.r,p.g,p.b,p.a),r.maskedBoundsBuffer&&r.maskedIndexBuffer&&r.segments)s.draw(n,o.TRIANGLES,i.id,r.maskedBoundsBuffer,r.maskedIndexBuffer,r.segments);else{var f=e.rasterBoundsBuffer;e.rasterBoundsVAO.bind(n,s,f,[]),o.drawArrays(o.TRIANGLE_STRIP,0,f.length)}}}function tt(e,r,i){var n=e.context,o=n.gl;if(r.dem&&r.dem.level){var a=r.dem.level.dim,s=r.dem.getPixels();if(n.activeTexture.set(o.TEXTURE1),n.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(r.tileSize),r.demTexture){var l=r.demTexture;l.update(s,{premultiply:!1}),l.bind(o.NEAREST,o.CLAMP_TO_EDGE)}else r.demTexture=new t.default$4(n,s,o.RGBA,{premultiply:!1}),r.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);n.activeTexture.set(o.TEXTURE0);var u=r.fbo;if(!u){var c=new t.default$4(n,{width:a,height:a,data:null},o.RGBA);c.bind(o.LINEAR,o.CLAMP_TO_EDGE),(u=r.fbo=n.createFramebuffer(a,a)).colorAttachment.set(c.texture)}n.bindFramebuffer.set(u.framebuffer),n.viewport.set([0,0,a,a]);var h=t.create();t.ortho(h,0,t.default$10,-t.default$10,0,0,1),t.translate(h,h,[0,-t.default$10,0]);var p=e.useProgram("hillshadePrepare");o.uniformMatrix4fv(p.uniforms.u_matrix,!1,h),o.uniform1f(p.uniforms.u_zoom,r.tileID.overscaledZ),o.uniform2fv(p.uniforms.u_dimension,[2*a,2*a]),o.uniform1i(p.uniforms.u_image,1),o.uniform1f(p.uniforms.u_maxzoom,i);var f=e.rasterBoundsBuffer;e.rasterBoundsVAO.bind(n,p,f,[]),o.drawArrays(o.TRIANGLE_STRIP,0,f.length),r.needsHillshadePrepare=!1}}function et(e,r,i,n,o){var a=n.paint.get("raster-fade-duration");if(a>0){var s=t.default$2.now(),l=(s-e.timeAdded)/a,u=r?(s-r.timeAdded)/a:-1,c=i.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function rt(e,r,i){var n=e.context,o=n.gl,a=i.posMatrix,s=e.useProgram("debug");n.setDepthMode(Ce.disabled),n.setStencilMode(Le.disabled),n.setColorMode(e.colorModeForRenderPass()),o.uniformMatrix4fv(s.uniforms.u_matrix,!1,a),o.uniform4f(s.uniforms.u_color,1,0,0,1),e.debugVAO.bind(n,s,e.debugBuffer,[]),o.drawArrays(o.LINE_STRIP,0,e.debugBuffer.length);for(var l=function(t,e,r,i){i=i||1;var n,o,a,s,l,u,c,h,p=[];for(n=0,o=t.length;n<o;n++)if(l=Tr[t[n]]){for(h=null,a=0,s=l[1].length;a<s;a+=2)-1===l[1][a]&&-1===l[1][a+1]?h=null:(u=e+l[1][a]*i,c=r-l[1][a+1]*i,h&&p.push(h.x,h.y,u,c),h={x:u,y:c});e+=l[0]*i}return p}(i.toString(),50,200,5),u=new t.PosArray,c=0;c<l.length;c+=2)u.emplaceBack(l[c],l[c+1]);var h=n.createVertexBuffer(u,fr.members);(new Zt).bind(n,s,h,[]),o.uniform4f(s.uniforms.u_color,1,1,1,1);for(var p=r.getTile(i).tileSize,f=t.default$10/(Math.pow(2,e.transform.zoom-i.overscaledZ)*p),d=[[-1,-1],[-1,1],[1,-1],[1,1]],m=0;m<d.length;m++){var y=d[m];o.uniformMatrix4fv(s.uniforms.u_matrix,!1,t.translate([],a,[f*y[0],f*y[1],0])),o.drawArrays(o.LINES,0,h.length)}o.uniform4f(s.uniforms.u_color,0,0,0,1),o.uniformMatrix4fv(s.uniforms.u_matrix,!1,a),o.drawArrays(o.LINES,0,h.length)}function it(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function nt(t,e,r,i,n){var o=Math.max(r,Math.floor(e.y0)),a=Math.min(i,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,h=e.dx<0,p=o;p<a;p++){var f=l*Math.max(0,Math.min(t.dy,p+c-t.y0))+t.x0,d=u*Math.max(0,Math.min(e.dy,p+h-e.y0))+e.x0;n(Math.floor(d),Math.ceil(f),p)}}function ot(t,e,r,i,n,o){var a,s=it(t,e),l=it(e,r),u=it(r,t);s.dy>l.dy&&(a=s,s=l,l=a),s.dy>u.dy&&(a=s,s=u,u=a),l.dy>u.dy&&(a=l,l=u,u=a),s.dy&&nt(u,s,i,n,o),l.dy&&nt(u,l,i,n,o)}function at(t){return t*(2-t)}function st(t){t.parentNode&&t.parentNode.removeChild(t)}function lt(t,e,r){if(t=new Ft(t.lng,t.lat),e){var i=new Ft(t.lng-360,t.lat),n=new Ft(t.lng+360,t.lat),o=r.locationPoint(t).distSqr(e);r.locationPoint(i).distSqr(e)<o?t=i:r.locationPoint(n).distSqr(e)<o&&(t=n)}for(;Math.abs(t.lng-r.center.lng)>180;){var a=r.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}function ut(t,e,r){var i=t.classList;for(var n in ri)i.remove("mapboxgl-"+r+"-anchor-"+n);i.add("mapboxgl-"+r+"-anchor-"+e)}function ct(t,e,r){var i,n,o,a,s,l,u=r&&r.maxWidth||100,c=t._container.clientHeight/2,h=(i=t.unproject([0,c]),n=t.unproject([u,c]),o=Math.PI/180,a=i.lat*o,s=n.lat*o,l=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((n.lng-i.lng)*o),6371e3*Math.acos(Math.min(l,1)));if(r&&"imperial"===r.unit){var p=3.2808*h;p>5280?ht(e,u,p/5280,"mi"):ht(e,u,p,"ft")}else r&&"nautical"===r.unit?ht(e,u,h/1852,"nm"):ht(e,u,h,"m")}function ht(t,e,r,i){var n,o,a,s=(n=r,(o=Math.pow(10,(""+Math.floor(n)).length-1))*(a=(a=n/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:1)),l=s/r;"m"===i&&s>=1e3&&(s/=1e3,i="km"),t.style.width=e*l+"px",t.innerHTML=s+i}var pt,ft=t.createCommonjsModule(function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),i=Object.create(e.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",i)||r.probablySupportsContext("experimental-webgl",i):r.supp
11ortsContext?r.supportsContext("webgl",i)||r.supportsContext("experimental-webgl",i):r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),dt={create:function(e,r,i){var n=t.default$1.document.createElement(e);return r&&(n.className=r),i&&i.appendChild(n),n},createNS:function(e,r){return t.default$1.document.createElementNS(e,r)}},mt=t.default$1.document?t.default$1.document.documentElement.style:null,yt=e(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);dt.disableDrag=function(){mt&&yt&&(pt=mt[yt],mt[yt]="none")},dt.enableDrag=function(){mt&&yt&&(mt[yt]=pt)};var vt=e(["transform","WebkitTransform"]);dt.setTransform=function(t,e){t.style[vt]=e};var gt=!1;try{var _t=Object.defineProperty({},"passive",{get:function(){gt=!0}});t.default$1.addEventListener("test",_t,_t),t.default$1.removeEventListener("test",_t,_t)}catch(t){gt=!1}dt.addEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&>?t.addEventListener(e,r,i):t.addEventListener(e,r,i.capture)},dt.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),"passive"in i&>?t.removeEventListener(e,r,i):t.removeEventListener(e,r,i.capture)};var xt=function(e){e.preventDefault(),e.stopPropagation(),t.default$1.removeEventListener("click",xt,!0)};dt.suppressClick=function(){t.default$1.addEventListener("click",xt,!0),t.default$1.setTimeout(function(){t.default$1.removeEventListener("click",xt,!0)},0)},dt.mousePos=function(e,r){var i=e.getBoundingClientRect();return r=r.touches?r.touches[0]:r,new t["default"](r.clientX-i.left-e.clientLeft,r.clientY-i.top-e.clientTop)},dt.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),n=[],o="touchend"===r.type?r.changedTouches:r.touches,a=0;a<o.length;a++)n.push(new t["default"](o[a].clientX-i.left-e.clientLeft,o[a].clientY-i.top-e.clientTop));return n},dt.mouseButton=function(e){return void 0!==t.default$1.InstallTrigger&&2===e.button&&e.ctrlKey&&t.default$1.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},dt.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var bt={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},wt="See https://www.mapbox.com/api-documentation/#access-tokens",Et=function(t,e){if(!i(t))return t;var o=n(t);return o.path="/fonts/v1"+o.path,r(o,e)},St=function(t,e){if(!i(t))return t;var o=n(t);return o.path="/v4/"+o.authority+".json",o.params.push("secure"),r(o,e)},Tt=function(t,e,a,s){var l=n(t);return i(t)?(l.path="/styles/v1"+l.path+"/sprite"+e+a,r(l,s)):(l.path+=""+e+a,o(l))},zt=/(\.(png|jpg)\d*)(?=$)/,At=function(e,r,a){if(!r||!i(r))return e;var s=n(e),l=t.default$2.devicePixelRatio>=2||512===a?"@2x":"",u=t.default$2.supportsWebp?".webp":"$1";return s.path=s.path.replace(zt,""+l+u),function(t){for(var e=0;e<t.length;e++)0===t[e].indexOf("access_token=tk.")&&(t[e]="access_token="+(bt.ACCESS_TOKEN||""))}(s.params),o(s)},Mt=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/,kt=function(){this.images={},this.loaded=!1,this.requestors=[],this.shelfPack=new t.default$3(64,64,{autoResize:!0}),this.patterns={},this.atlasImage=new t.RGBAImage({width:64,height:64}),this.dirty=!0};kt.prototype.isLoaded=function(){return this.loaded},kt.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e],n=i.ids,o=i.callback;this._notify(n,o)}this.requestors=[]}},kt.prototype.getImage=function(t){return this.images[t]},kt.prototype.addImage=function(t,e){this.images[t]=e},kt.prototype.removeImage=function(t){delete this.images[t];var e=this.patterns[t];e&&(this.shelfPack.unref(e.bin),delete this.patterns[t])},kt.prototype.listImages=function(){return Object.keys(this.images)},kt.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.images[o]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},kt.prototype._notify=function(t,e){for(var r={},i=0,n=t;i<n.length;i+=1){var o=n[i],a=this.images[o];a&&(r[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf})}e(null,r)},kt.prototype.getPixelSize=function(){return{width:this.shelfPack.w,height:this.shelfPack.h}},kt.prototype.getPattern=function(e){var r=this.patterns[e];if(r)return r.position;var i=this.getImage(e);if(!i)return null;var n=i.data.width+2,o=i.data.height+2,a=this.shelfPack.packOne(n,o);if(!a)return null;this.atlasImage.resize(this.getPixelSize());var s=i.data,l=this.atlasImage,u=a.x+1,c=a.y+1,h=s.width,p=s.height;t.RGBAImage.copy(s,l,{x:0,y:0},{x:u,y:c},{width:h,height:p}),t.RGBAImage.copy(s,l,{x:0,y:p-1},{x:u,y:c-1},{width:h,height:1}),t.RGBAImage.copy(s,l,{x:0,y:0},{x:u,y:c+p},{width:h,height:1}),t.RGBAImage.copy(s,l,{x:h-1,y:0},{x:u-1,y:c},{width:1,height:p}),t.RGBAImage.copy(s,l,{x:0,y:0},{x:u+h,y:c},{width:1,height:p}),this.dirty=!0;var f=new t.ImagePosition(a,i);return this.patterns[e]={bin:a,position:f},f},kt.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.default$4(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)};var It=a,Ct=1e20;a.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var n=e.data[4*i+3]/255;this.gridOuter[i]=1===n?0:0===n?Ct:Math.pow(Math.max(0,.5-n),2),this.gridInner[i]=1===n?Ct:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(s(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),s(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++){var o=this.gridOuter[i]-this.gridInner[i];r[i]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return r};var Lt=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={}};Lt.prototype.setURL=function(t){this.url=t},Lt.prototype.getGlyphs=function(e,r){var i=this,n=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1){var l=s[a];n.push({stack:o,id:l})}t.asyncAll(n,function(t,e){var r=t.stack,n=t.id,o=i.entries[r];o||(o=i.entries[r]={glyphs:{},requests:{}});var a=o.glyphs[n];if(void 0===a)if(a=i._tinySDF(o,r,n))e(null,{stack:r,id:n,glyph:a});else{var s=Math.floor(n/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var l=o.requests[s];l||(l=o.requests[s]=[],Lt.loadGlyphRange(r,s,i.url,i.requestTransform,function(t,e){if(e)for(var r in e)o.glyphs[+r]=e[+r];for(var i=0,n=l;i<n.length;i+=1)(0,n[i])(t,e);delete o.requests[s]})),l.push(function(t,i){t?e(t):i&&e(null,{stack:r,id:n,glyph:i[n]||null})})}}else e(null,{stack:r,id:n,glyph:a})},function(t,e){if(t)r(t);else if(e){for(var i={},n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.stack,l=a.id,u=a.glyph;(i[s]||(i[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,i)}})},Lt.prototype._tinySDF=function(e,r,i){var n=this.localIdeographFontFamily;if(n&&(t.default$6["CJK Unified Ideographs"](i)||t.default$6["Hangul Syllables"](i))){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(r)?a="900":/medium/i.test(r)?a="500":/light/i.test(r)&&(a="200"),o=e.tinySDF=new Lt.TinySDF(24,3,8,.25,n,a)}return{id:i,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},Lt.loadGlyphRange=function(e,r,i,n,o){var a=256*r,s=a+255,l=n(Et(i).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,function(e,r){if(e)o(e);else if(r){for(var i={},n=0,a=t.default$5(r.data);n<a.length;n+=1){var s=a[n];i[s.id]=s}o(null,i)}})},Lt.TinySDF=It;var Pt=function(){this.specification=t.default$7.light.position};Pt.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},Pt.prototype.interpolate=function(e,r,i){return{x:t.number(e.x,r.x,i),y:t.number(e.y,r.y,i),z:t.number(e.z,r.z,i)}};var Dt=new t.Properties({anchor:new t.DataConstantProperty(t.default$7.light.anchor),position:new Pt,color:new t.DataConstantProperty(t.default$7.light.color),intensity:new t.DataConstantProperty(t.default$7.light.intensity)}),Bt=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(Dt),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()}
11,r.prototype.setLight=function(e){if(!this._validate(t.validateLight,e))for(var r in e){var i=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-"-transition".length),i):this._transitionable.setValue(r,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r){return t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.default$7})))},r}(t.Evented),Rt=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};Rt.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},Rt.prototype.addDash=function(e,r){var i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];for(var s=this.width/o,l=s/2,u=e.length%2==1,c=-i;c<=i;c++)for(var h=this.nextRow+i+c,p=this.width*h,f=u?-e[e.length-1]:0,d=e[0],m=1,y=0;y<this.width;y++){for(;d<y/s;)f=d,d+=e[m],u&&m===e.length-1&&(d+=e[0]),m++;var v=Math.abs(y-f*s),g=Math.abs(y-d*s),_=Math.min(v,g),x=m%2==1,b=void 0;if(r){var w=i?c/i*(l+1):0;if(x){var E=l-Math.abs(w);b=Math.sqrt(_*_+E*E)}else b=l-Math.sqrt(_*_+w*w)}else b=(x?1:-1)*_;this.data[3+4*(p+y)]=Math.max(0,Math.min(255,b+128))}var S={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=n,this.dirty=!0,S},Rt.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var Ot=function pi(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),n=0;n<i.length;n++){var o=i[n],a=new pi.Actor(o,r,this.id);a.name="Worker "+n,this.actors.push(a)}};Ot.prototype.broadcast=function(e,r,i){i=i||function(){},t.asyncAll(this.actors,function(t,i){t.send(e,r,i)},i)},Ot.prototype.send=function(t,e,r,i){return("number"!=typeof i||isNaN(i))&&(i=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[i].send(t,e,r),i},Ot.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},Ot.Actor=t.default$9;var Ft=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")};Ft.prototype.wrap=function(){return new Ft(t.wrap(this.lng,-180,180),this.lat)},Ft.prototype.toArray=function(){return[this.lng,this.lat]},Ft.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ft.prototype.toBounds=function(t){var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Vt(new Ft(this.lng-r,this.lat-e),new Ft(this.lng+r,this.lat+e))},Ft.convert=function(t){if(t instanceof Ft)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ft(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ft(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Vt=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest
11([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Vt.prototype.setNorthEast=function(t){return this._ne=t instanceof Ft?new Ft(t.lng,t.lat):Ft.convert(t),this},Vt.prototype.setSouthWest=function(t){return this._sw=t instanceof Ft?new Ft(t.lng,t.lat):Ft.convert(t),this},Vt.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof Ft)e=t,r=t;else{if(!(t instanceof Vt))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Vt.convert(t)):this.extend(Ft.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new Ft(e.lng,e.lat),this._ne=new Ft(r.lng,r.lat)),this},Vt.prototype.getCenter=function(){return new Ft((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Vt.prototype.getSouthWest=function(){return this._sw},Vt.prototype.getNorthEast=function(){return this._ne},Vt.prototype.getNorthWest=function(){return new Ft(this.getWest(),this.getNorth())},Vt.prototype.getSouthEast=function(){return new Ft(this.getEast(),this.getSouth())},Vt.prototype.getWest=function(){return this._sw.lng},Vt.prototype.getSouth=function(){return this._sw.lat},Vt.prototype.getEast=function(){return this._ne.lng},Vt.prototype.getNorth=function(){return this._ne.lat},Vt.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Vt.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Vt.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Vt.convert=function(t){return!t||t instanceof Vt?t:new Vt(t)};var Nt=function(t,e,r){this.bounds=Vt.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=r||24};Nt.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Nt.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),r=Math.floor(this.latY(this.bounds.getNorth(),t.z)),i=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),n=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x<i&&t.y>=r&&t.y<n},Nt.prototype.lngX=function(t,e){return(t+180)*(Math.pow(2,e)/360)},Nt.prototype.latY=function(e,r){var i=t.clamp(Math.sin(Math.PI/180*e),-.9999,.9999),n=Math.pow(2,r)/(2*Math.PI);return Math.pow(2,r-1)+.5*Math.log((1+i)/(1-i))*-n};var jt=function(e){function r(r,i,n,o){if(e.call(this),this.id=r,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,t.extend(this,t.pick(i,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),u(this._options,this.map._transformRequest,function(r,i){r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new Nt(i.bounds,e.minzoom,e.maxzoom)),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})}, 12r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){function i(t,i){return e.aborted?r(null):t?r(t):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}var n=At(e.tileID.canonical.url(this.tiles,this.scheme),this.url),o={request:this.map._transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.t
12ype,source:this.id,pixelRatio:t.default$2.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};o.request.collectResourceTiming=this._collectResourceTiming,void 0===e.workerID||"expired"===e.state?e.workerID=this.dispatcher.send("loadTile",o,i.bind(this)):"loading"===e.state?e.reloadCallback=r:this.dispatcher.send("reloadTile",o,i.bind(this),e.workerID)},r.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),Ut=function(e){function r(r,i,n,o){e.call(this),this.id=r,this.dispatcher=n,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),u(this._options,this.map._transformRequest,function(r,i){r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new Nt(i.bounds,e.minzoom,e.maxzoom)),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var i=this,n=At(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(n,t.ResourceType.Tile),function(n,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(o){i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=i.map.painter.context,s=a.gl;e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.default$4(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",r(null)}})},r.prototype.abortTile=function(t,e){t.request&&(t.request.abort(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),$t=function(e){function r(r,i,n,o){e.call(this,r,i,n,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({},i),this.encoding=i.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var i=At(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(i,t.ResourceType.Tile),function(i,n){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(n){this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var o=t.default$2.getImageData(n),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:o,encoding:this.encoding};e.workerID&&"expired"!==e.state||(e.workerID=this.dispatcher.send("loadDEMTile",a,function(t,i){t&&(e.state="errored",r(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,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+1<i&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,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}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID)},r}(Ut),qt=function(e){function r(r,i,n,o){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this.dispatcher=n,this.setEventedParent(o),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,this._resourceTiming=[],void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.t
12ype=i.type),i.attribution&&(this.attribution=i.attribution);var a=t.default$10/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*a,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*a,extent:t.default$10,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?Math.min(i.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.default$10,radius:(i.clusterRadius||50)*a,log:!1}},i.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(r){if(r)e.fire(new t.ErrorEvent(r));else{var i={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(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)return r.fire(new t.ErrorEvent(e));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._updateWorkerData=function(e){var r=this,i=t.extend({},this.workerOptions),n=this._data;"string"==typeof n?(i.request=this.map._transformRequest(t.default$2.resolveURL(n),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this.workerID=this.dispatcher.send(this.type+".loadData",i,function(t,n){r._removed||n&&n.abandoned||(r._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[r.id]&&(r._resourceTiming=n.resourceTiming[r.id].slice(0)),r.dispatcher.send(r.type+".coalesce",{source:i.source},null,r.workerID),e(t))},this.workerID)},r.prototype.loadTile=function(e,r){var i=this,n=void 0===e.workerID?"loadTile":"reloadTile",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.default$2.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.workerID=this.dispatcher.send(n,o,function(t,o){return e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,i.map.painter,"reloadTile"===n),r(null))},this.workerID)},r.prototype.abortTile=function(t){t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.t
12ype,source:this.id},null,t.workerID)},r.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),Zt=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Zt.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,u=0;!l&&u<i.length;u++)this.boundPaintVertexBuffers[u]!==i[u]&&(l=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==n||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,r,i,n,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind())},Zt.prototype.freshBind=function(t,e,r,i,n,o,a){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,f=r;p<f.length;p+=1)f[p].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),u.currentNumAttributes=l},Zt.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Gt=function(e){function r(t,r,i,n){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.setEventedParent(n),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._transformRequest(this.url,t.ResourceType.Image),function(r,i){r?e.fire(new t.ErrorEvent(r)):i&&(e.image=t.default$2.getImageData(i),e._finishLoading())})},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){this.coordinates=e;var r=this.map,i=e.map(function(t){return r.transform.locationCoordinate(Ft.convert(t)).zoomTo(0)}),n=this.centerCoord=t.getCoordinatesCenter(i);n.column=Math.floor(n.column),n.row=Math.floor(n.row),this.tileID=new t.CanonicalTileID(n.zoom,n.column,n.row),this.minzoom=this.maxzoom=n.zoom;var o=i.map(function(e){var r=e.zoomTo(n.zoom);return new t["default"](Math.round((r.column-n.column)*t.default$10),Math.round((r.row-n.row)*t.default$10))});return this._boundsArray=new t.RasterBoundsArray,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.default$10,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.default$10),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.default$10,t.default$10),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.default$11.members)),this.boundsVAO||(this.boundsVAO=new Zt),this.texture||(this.texture=new t.default$4(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),Wt=function(e){function r(t,r,i,n){e.call(this,t,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this,r=this.options;this.urls=[];for(var i=0,n=r.urls;i<n.length;i+=1){var o=n[i];e.urls.push(e.map._transformRequest(o,t.ResourceType.Source).url)}t.getVideo(this.urls,function(r,i){r?e.fire(new t.ErrorEvent(r)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",function(){e.map._rerender()}),e.map&&e.video.play(),e._finishLoading())})},r.prototype.getVideo=function(){return this.video}
12,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,t.default$11.members)),this.boundsVAO||(this.boundsVAO=new Zt),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.default$4(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[i];"loaded"!==n.state&&(n.state="loaded",n.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}(Gt),Ht=function(e){function r(r,i,n,o){e.call(this,r,i,n,o),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.default$12("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.default$12("sources."+r,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.default$12("sources."+r,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.default$1.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.default$12("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.default$12("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),r.prototype.constructor=r,r.prototype.load=function(){this.canvas||(this.canvas=this.options.canvas instanceof t.default$1.HTMLCanvasElement?this.options.canvas:t.default$1.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._rerender()},this.pause=function(){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 n in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,t.default$11.members)),this.boundsVAO||(this.boundsVAO=new Zt),this.texture?e?this.texture.update(this.canvas):this._playing&&(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.canvas)):(this.texture=new t.default$4(r,this.canvas,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[n];"loaded"!==o.state&&(o.state="loaded",o.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];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(Gt),Xt={vector:jt,raster:Ut,"raster-dem":$t,geojson:qt,video:Wt,image:Gt,canvas:Ht},Kt=function(e,r,i,n){var o=new Xt[r.type](e,r,i,n);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o},Yt=function(t,e){this.max=t,this.onRemove=e,this.reset()};Yt.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},Yt.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout(function(){i.remove(t,o)},r)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},Yt.prototype.has=function(t){return t.wrapped().key in this.data},Yt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Yt.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},Yt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Yt.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),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this},Yt.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};var Jt=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Jt.prototype.unbindVAO=function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)},Jt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Jt.prototype.updateData=function(t){var e=this.context.gl;this.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},Jt.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var Qt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},te=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};te.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},te.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},te.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],n=e.attributes[i.name];void 0!==n&&t.enableVertexAttribArray(n)}},te.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[Qt[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},te.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var ee=function(e){this.context=e,this.current=t.default$8.transparent};ee.prototype.get=function(){return this.current},ee.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a||(this.context.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t)};var re=function(t){this.context=t,this.current=1};re.prototype.get=function(){return this.current},re.prototype.set=function(t){this.current!==t&&(this.context.gl.clearDepth(t),this.current=t)};var ie=function(t){this.context=t,this.current=0};ie.prototype.get=function(){return this.current},ie.prototype.set=function(t){this.current!==t&&(this.context.gl.clearStencil(t),this.current=t)};var ne=function(t){this.context=t,this.current=[!0,!0,!0,!0]};ne.prototype.get=function(){return this.current},ne.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]||(this.context.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t)};var oe=function(t){this.context=t,this.current=!0};oe.prototype.get=function(){return this.current},oe.prototype.set=function(t){this.current!==t&&(this.context.gl.depthMask(t),this.current=t)};var ae=function(t){this.context=t,this.current=255};ae.prototype.get=function(){return this.current},ae.prototype.set=function(t){this.current!==t&&(this.context.gl.stencilMask(t),this.current=t)};var se=function(t){this.context=t,this.current={func:t.gl.ALWAYS,ref:0,mask:255}};se.prototype.get=function(){return this.current},se.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask||(this.context.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t)};var le=function(t){this.context=t;var e=this.context.gl;this.current=[e.KEEP,e.KEEP,e.KEEP]};le.prototype.get=function(){return this.current},le.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]||(this.context.gl.stencilOp(t[0],t[1],t[2]),this.current=t)};var ue=function(t){this.context=t,this.current=!1};ue.prototype.get=function(){return this.current},ue.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t}};var ce=function(t){this.context=t,this.current=[0,1]};ce.prototype.get=function(){return this.current},ce.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]||(this.context.gl.depthRange(t[0],t[1]),this.current=t)};var he=function(t){this.context=t,this.current=!1};he.prototype.get=function(){return this.current},he.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t}};var pe=function(t){this.context=t,this.current=t.gl.LESS};pe.prototype.get=function(){return this.current},pe.prototype.set=function(t){this.current!==t&&(this.context.gl.depthFunc(t),this.current=t)};var fe=function(t){this.context=t,this.current=!1};fe.prototype.get=function(){return this.current},fe.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t}};var de=function(t){this.context=t;var e=this.context.gl;this.current=[e.ONE,e.ZERO]};de.prototype.get=function(){return this.current},de.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]||(this.context.gl.blendFunc(t[0],t[1]),this.current=t)};var me=function(e){this.context=e,this.current=t.default$8.transparent};me.prototype.get=function(){return this.current},me.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a||(this.context.gl.blendColor
12(t.r,t.g,t.b,t.a),this.current=t)};var ye=function(t){this.context=t,this.current=null};ye.prototype.get=function(){return this.current},ye.prototype.set=function(t){this.current!==t&&(this.context.gl.useProgram(t),this.current=t)};var ve=function(t){this.context=t,this.current=t.gl.TEXTURE0};ve.prototype.get=function(){return this.current},ve.prototype.set=function(t){this.current!==t&&(this.context.gl.activeTexture(t),this.current=t)};var ge=function(t){this.context=t;var e=this.context.gl;this.current=[0,0,e.drawingBufferWidth,e.drawingBufferHeight]};ge.prototype.get=function(){return this.current},ge.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]||(this.context.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t)};var _e=function(t){this.context=t,this.current=null};_e.prototype.get=function(){return this.current},_e.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t}};var xe=function(t){this.context=t,this.current=null};xe.prototype.get=function(){return this.current},xe.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t}};var be=function(t){this.context=t,this.current=null};be.prototype.get=function(){return this.current},be.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t}};var we=function(t){this.context=t,this.current=null};we.prototype.get=function(){return this.current},we.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t}};var Ee=function(t){this.context=t,this.current=null};Ee.prototype.get=function(){return this.current},Ee.prototype.set=function(t){var e=this.context.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t};var Se=function(t){this.context=t,this.current=null};Se.prototype.get=function(){return this.current},Se.prototype.set=function(t){this.current!==t&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(t),this.current=t)};var Te=function(t){this.context=t,this.current=4};Te.prototype.get=function(){return this.current},Te.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t}};var ze=function(t){this.context=t,this.current=!1};ze.prototype.get=function(){return this.current},ze.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t}};var Ae=function(t,e){this.context=t,this.current=null,this.parent=e};Ae.prototype.get=function(){return this.current};var Me=function(t){function e(e,r){t.call(this,e,r),this.dirty=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(this.dirty||this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e.prototype.setDirty=function(){this.dirty=!0},e}(Ae),ke=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t}},e}(Ae),Ie=function(t,e,r){this.context=t,this.width=e,this.height=r;var i=t.gl,n=this.framebuffer=i.createFramebuffer();this.colorAttachment=new Me(t,n),this.depthAttachment=new ke(t,n)};Ie.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)};var Ce=function(t,e,r){this.func=t,this.mask=e,this.range=r};Ce.ReadOnly=!1,Ce.ReadWrite=!0,Ce.disabled=new Ce(519,Ce.ReadOnly,[0,1]);var Le=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};Le.disabled=new Le({func:519,mask:0},0,0,7680,7680,7680);var Pe=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};
12Pe.Replace=[1,0],Pe.disabled=new Pe(Pe.Replace,t.default$8.transparent,[!1,!1,!1,!1]),Pe.unblended=new Pe(Pe.Replace,t.default$8.transparent,[!0,!0,!0,!0]),Pe.alphaBlended=new Pe([1,771],t.default$8.transparent,[!0,!0,!0,!0]);var De=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new ee(this),this.clearDepth=new re(this),this.clearStencil=new ie(this),this.colorMask=new ne(this),this.depthMask=new oe(this),this.stencilMask=new ae(this),this.stencilFunc=new se(this),this.stencilOp=new le(this),this.stencilTest=new ue(this),this.depthRange=new ce(this),this.depthTest=new he(this),this.depthFunc=new pe(this),this.blend=new fe(this),this.blendFunc=new de(this),this.blendColor=new me(this),this.program=new ye(this),this.activeTexture=new ve(this),this.viewport=new ge(this),this.bindFramebuffer=new _e(this),this.bindRenderbuffer=new xe(this),this.bindTexture=new be(this),this.bindVertexBuffer=new we(this),this.bindElementBuffer=new Ee(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Se(this),this.pixelStoreUnpack=new Te(this),this.pixelStoreUnpackPremultiplyAlpha=new ze(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")};De.prototype.createIndexBuffer=function(t,e){return new Jt(this,t,e)},De.prototype.createVertexBuffer=function(t,e,r){return new te(this,t,e,r)},De.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n}, 13De.prototype.createFramebuffer=function(t,e){return new Ie(this,t,e)},De.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(n|=i.DEPTH_BUFFER_BIT,this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(n)},De.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},De.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},De.prototype.setColorMode=function(e){t.default$13(e.blendFunction,Pe.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)};var Be=function(e){function r(r,i,n){var o=this;e.call(this),this.id=r,this.dispatcher=n,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))}),this.on("error",function(){o._sourceErrored=!0}),this._source=Kt(r,i,n,this),this._tiles={},this._cache=new Yt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._isIdRenderable=this._isIdRenderable.bind(this),this._coveredTiles={},this._state=new t.default$16}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles)this._tiles[e].upload(t)},r.prototype.getIds=function(){var e=this;return Object.keys(this._tiles).map(Number).sort(function(r,i){var n=e._tiles[r].tileID,o=e._tiles[i].tileID,a=new t["default"](n.canonical.x,n.canonical.y).rotate(e.transform.angle),s=new t["default"](o.canonical.x,o.canonical.y).rotate(e.transform.angle);return n.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})},r.prototype.getRenderableIds=function(){return this.getIds().filter(this._isIdRenderable)},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0,{});return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,i,n){return n?(e.state="errored",void(4
1304!==n.status?this._source.fire(new t.ErrorEvent(n,{tile:e})):this.update(this.transform))):(e.timeAdded=t.default$2.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID})),this.map&&(this.map.painter.tileExtentVAO.vao=null),void 0)},r.prototype._backfillDEM=function(t){function e(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}for(var r=this.getRenderableIds(),i=0;i<r.length;i++){var n=r[i];if(t.neighboringTiles&&t.neighboringTiles[n]){var o=this.getTileByID(n);e(t,o),e(o,t)}}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._findLoadedChildren=function(t,e,r){var i=!1;for(var n in this._tiles){var o=this._tiles[n];if(!(r[n]||!o.hasData()||o.tileID.overscaledZ<=t.overscaledZ||o.tileID.overscaledZ>e)){var a=Math.pow(2,o.tileID.canonical.z-t.canonical.z);if(Math.floor(o.tileID.canonical.x/a)===t.canonical.x&&Math.floor(o.tileID.canonical.y/a)===t.canonical.y)for(r[n]=o.tileID,i=!0;o&&o.tileID.overscaledZ-1>t.overscaledZ;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);if(!s)break;(o=this._tiles[s.key])&&o.hasData()&&(delete r[n],r[s.key]=s)}}}return i},r.prototype.findLoadedParent=function(t,e,r){for(var i=t.overscaledZ-1;i>=e;i--){var n=t.scaledTo(i);if(!n)return;var o=String(n.key),a=this._tiles[o];if(a&&a.hasData())return r[o]=n,a;if(this._cache.has(n))return r[o]=n,this._cache.get(n)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var i={};for(var n in this._tiles){var o=this._tiles[n];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+r),i[o.tileID.key]=o}for(var a in this._tiles=i,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var n;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?n=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)}):(n=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&&(n=n.filter(function(t){return i._source.hasTile(t)}))):n=[];var o,a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),s=Math.max(a-r.maxOverzooming,this._source.minzoom),l=Math.max(a+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(n,a),c={};if(f(this._source.type))for(var h=Object.keys(u),p=0;p<h.length;p++){var d=h[p],m=u[d],y=i._tiles[d];if(y&&(void 0===y.fadeEndTime||y.fadeEndTime>=t.default$2.now())){i._findLoadedChildren(m,l,u)&&(u[d]=m);var v=i.findLoadedParent(m,s,c);v&&i._addTile(v.tileID)}}for(o in c)u[o]||(i._coveredTiles[o]=!0);for(o in c)u[o]=c[o];for(var g=t.keysDifference(this._tiles,u),_=0;_<g.length;_++)i._removeTile(g[_])}},r.prototype._updateRetainedTiles=function(t,e){for(var i={},n={},o=Math.max(e-r.maxOverzooming,this._source.minzoom),a=Math.max(e+r.maxUnderzooming,this._source.minzoom),s=0;s<t.length;s++){var l=t[s],u=this._addTile(l),c=!1;if(u.hasData())i[l.key]=l;else{c=u.wasRequested(),i[l.key]=l;var h=!0;if(e+1>this._source.maxzoom){var p=l.children(this._source.maxzoom)[0],f=this.getTile(p);f&&f.hasData()?i[p.key]=p:h=!1}else{this._findLoadedChildren(l,a,i);for(var d=l.children(this._source.maxzoom),m=0;m<d.length;m++)if(!i[d[m].key]){h=!1;break}}if(!h)for(var y=l.overscaledZ-1;y>=o;--y){var v=l.scaledTo(y);if(n[v.key])break;if(n[v.key]=!0,!(u=this.getTile(v))&&c&&(u=this._addTile(v)),u&&(i[v.key]=v,c=u.wasRequested(),u.hasData()))break}}}return i},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);
13return i||(r=new t.default$14(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},i))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?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){for(var i=[],n=this.getIds(),o=1/0,a=1/0,s=-1/0,l=-1/0,u=e[0].zoom,c=0;c<e.length;c++){var h=e[c];o=Math.min(o,h.column),a=Math.min(a,h.row),s=Math.max(s,h.column),l=Math.max(l,h.row)}for(var f=0;f<n.length;f++){var d=this._tiles[n[f]],m=d.tileID,y=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),v=r*d.queryPadding*t.default$10/d.tileSize/y,g=[p(m,new t.default$15(o,a,u)),p(m,new t.default$15(s,l,u))];if(g[0].x-v<t.default$10&&g[0].y-v<t.default$10&&g[1].x+v>=0&&g[1].y+v>=0){for(var _=[],x=0;x<e.length;x++)_.push(p(m,e[x]));i.push({tile:d,tileID:m,queryGeometry:[_],scale:y})}}return i},r.prototype.getVisibleCoordinates=function(){for(var t=this,e=this.getRenderableIds().map(function(e){return t._tiles[e].tileID}),r=0,i=e;r<i.length;r+=1){var n=i[r];n.posMatrix=t.transform.calculatePosMatrix(n.toUnwrapped())}return e},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(f(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.default$2.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r}(t.Evented);Be.maxOverzooming=10,Be.maxUnderzooming=3;var Re,Oe=function(){this.active={}};Oe.prototype.acquire=function(t){if(!this.workers){var e=hi.workerCount;for(this.workers=[];this.workers.length<e;)this.workers.push(new d)}return this.active[t]=!0,this.workers.slice()},Oe.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)};var Fe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"},Ve=function(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};Ve.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ve.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Ve.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)},Ve.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)}
vendor: 4,526 bytes, line 13
13,Ve.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Ve.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return o?a.filter(o):a}var p={hitTest:n,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,i,this._queryCell,a,p,o),n?a.length>0:a},Ve.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,l=e+r;if(a<0||o>this.width||l<0||s>this.height)return!i&&[];var u=[],c={hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,l,this._queryCellCircle,u,c,n),i?u.length>0:u},Ve.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Ve.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Ve.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Ve.prototype._queryCell=function(t,e,r,i,n,o,a,s){var l=a.seenUids,u=this.boxCells[n];if(null!==u)for(var c=this.bboxes,h=0,p=u;h<p.length;h+=1){var f=p[h];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&i>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[n];if(null!==m)for(var y=this.circles,v=0,g=m;v<g.length;v+=1){var _=g[v];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,i)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],E=y[x+2];o.push({key:this.circleKeys[_],x1:b-E,y1:w-E,x2:b+E,y2:w+E})}}}},Ve.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var l=a.circle,u=a.seenUids,c=this.boxCells[n];if(null!==c)for(var h=this.bboxes,p=0,f=c;p<f.length;p+=1){var d=f[p];if(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var y=this.circleCells[n];if(null!==y)for(var v=this.circles,g=0,_=y;g<_.length;g+=1){var x=_[g];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(v[b],v[b+1],v[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},Ve.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i),p=l;p<=c;p++)for(var f=u;f<=h;f++){var d=this.xCellCount*f+p;if(n.call(this,t,e,r,i,d,o,a,s))return}},Ve.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Ve.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Ve.prototype._circlesCollide=function(t,e,r,i,n,o){var a=i-t,s=n-e,l=r+o;return l*l>a*a+s*s},Ve.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){var s=(o-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return!1;var u=(a-n)/2,c=Math.abs(e-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,p=c-u;return h*h+p*p<=r*r};var Ne=t.default$18.layout,je=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]),Ue=function(t,e,r){void 0===e&&(e=new Ve(t.width+200,t.height+200,25)),void 0===r&&(r=new Ve(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};Ue.prototype.placeCollisionBox=function(t,e,r,i,n){var o=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,l=t.y1*a+o.point.y,u=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,n)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},Ue.prototype.approximateTileDistance=function(t,e,r,i,n){var o=n?1:i/this.pitchfactor,a=t.lastSegmentViewportDistance*r;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},Ue.prototype.placeCollisionCircles=function(e,r,i,n,o,a,s,l,u,c,h,p,f,d){var m=[],y=this.projectAnchor(c,a.anchorX,a.anch
13orY),v=u/24,g=a.lineOffsetX*u,_=a.lineOffsetY*u,x=new t["default"](a.anchorX,a.anchorY),b=I(v,l,g,_,!1,A(x,h).point,x,a,s,h,{},!0),w=!1,E=!1,S=!0,T=y.perspectiveRatio*n,z=1/(n*i),M=0,k=0;b&&(M=this.approximateTileDistance(b.first.tileDistance,b.first.angle,z,y.cameraDistance,f),k=this.approximateTileDistance(b.last.tileDistance,b.last.angle,z,y.cameraDistance,f));for(var C=0;C<e.length;C+=5){var L=e[C],P=e[C+1],D=e[C+2],B=e[C+3];if(!b||B<-M||B>k)O(e,C,!1);else{var R=this.projectPoint(c,L,P),F=D*T;if(m.length>0){var V=R.x-m[m.length-4],N=R.y-m[m.length-3];if(F*F*2>V*V+N*N&&C+8<e.length){var j=e[C+8];if(j>-M&&j<k){O(e,C,!1);continue}}}var U=C/5;m.push(R.x,R.y,F,U),O(e,C,!0);var $=R.x-F,q=R.y-F,Z=R.x+F,G=R.y+F;if(S=S&&this.isOffscreen($,q,Z,G),E=E||this.isInsideGrid($,q,Z,G),!r&&this.grid.hitTestCircle(R.x,R.y,F,d)){if(!p)return{circles:[],offscreen:!1};w=!0}}}return{circles:w||!E?[]:m,offscreen:S}},Ue.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],i=1/0,n=1/0,o=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t["default"](u.x+100,u.y+100);i=Math.min(i,c.x),n=Math.min(n,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),r.push(c)}for(var h={},p={},f=0,d=this.grid.query(i,n,o,a).concat(this.ignoredGrid.query(i,n,o,a));f<d.length;f+=1){var m=d[f],y=m.key;if(void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]={}),!h[y.bucketInstanceId][y.featureIndex]){var v=[new t["default"](m.x1,m.y1),new t["default"](m.x2,m.y1),new t["default"](m.x2,m.y2),new t["default"](m.x1,m.y2)];t.polygonIntersectsPolygon(r,v)&&(h[y.bucketInstanceId][y.featureIndex]=!0,void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]=[]),p[y.bucketInstanceId].push(y.featureIndex))}}return p},Ue.prototype.insertCollisionBox=function(t,e,r,i,n){var o={bucketInstanceId:r,featureIndex:i,collisionGroupID:n};(e?this.ignoredGrid:this.grid).insert(o,t[0],t[1],t[2],t[3])},Ue.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},Ue.prototype.projectAnchor=function(t,e,r){var i=[e,r,0,1];return R(i,i,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5,cameraDistance:i[3]}},Ue.prototype.projectPoint=function(e,r,i){var n=[r,i,0,1];return R(n,n,e),new t["default"]((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100)},Ue.prototype.projectAndGetPerspectiveRatio=function(e,r,i){var n=[r,i,0,1];return R(n,n,e),{point:new t["default"]((n[0]/n[3]+1)/2*this.transform.width+100,(-n[1]/n[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5}},Ue.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},Ue.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t<this.gridRightBoundary&&i>=0&&e<this.gridBottomBoundary};var $e=t.default$18.layout,qe=function(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r};qe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ze=function(t,e,r,i,n){this.text=new qe(t?t.text:null,e,r,n),this.icon=new qe(t?t.icon:null,e,i,n)};Ze.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ge=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},We=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};We.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var He=function(t,e,r){this.transform=t.clone(),this.collisionIndex=new Ue(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new We(r)};He.prototype.placeLayerTile=function(e,r,i,n){var o=r.getBucket(e),a=r.latestFeatureIndex;if(o&&a&&e.id===o.layerIds[0]){var s=r.collisionBoxArray,l=o.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ
13),c=r.tileSize/t.default$10,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),p=T(h,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,F(r,1,this.transform.zoom)),f=T(h,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,F(r,1,this.transform.zoom));this.retainedQueryData[o.bucketInstanceId]=new function(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID),this.placeLayerBucket(o,h,p,f,u,c,i,n,s)}},He.prototype.placeLayerBucket=function(e,r,i,n,o,a,s,l,u){for(var c=e.layers[0].layout,h=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,$e.properties["text-size"]),p=!e.hasTextData()||c.get("text-optional"),f=!e.hasIconData()||c.get("icon-optional"),d=this.collisionGroups.get(e.sourceID),m=0,y=e.symbolInstances;m<y.length;m+=1){var v=y[m];if(!l[v.crossTileID]){var g=void 0!==v.feature.text,_=void 0!==v.feature.icon,x=!0,b=null,w=null,E=null,S=0,T=0;v.collisionArrays||(v.collisionArrays=e.deserializeCollisionBoxes(u,v.textBoxStartIndex,v.textBoxEndIndex,v.iconBoxStartIndex,v.iconBoxEndIndex)),v.collisionArrays.textFeatureIndex&&(S=v.collisionArrays.textFeatureIndex),v.collisionArrays.textBox&&(g=(b=this.collisionIndex.placeCollisionBox(v.collisionArrays.textBox,c.get("text-allow-overlap"),a,r,d.predicate)).box.length>0,x=x&&b.offscreen);var z=v.collisionArrays.textCircles;if(z){var A=e.text.placedSymbolArray.get(v.placedTextSymbolIndices[0]),M=t.evaluateSizeForFeature(e.textSizeData,h,A);w=this.collisionIndex.placeCollisionCircles(z,c.get("text-allow-overlap"),o,a,v.key,A,e.lineVertexArray,e.glyphOffsetArray,M,r,i,s,"map"===c.get("text-pitch-alignment"),d.predicate),g=c.get("text-allow-overlap")||w.circles.length>0,x=x&&w.offscreen}v.collisionArrays.iconFeatureIndex&&(T=v.collisionArrays.iconFeatureIndex),v.collisionArrays.iconBox&&(_=(E=this.collisionIndex.placeCollisionBox(v.collisionArrays.iconBox,c.get("icon-allow-overlap"),a,r,d.predicate)).box.length>0,x=x&&E.offscreen),p||f?f?p||(_=_&&g):g=_&&g:_=g=_&&g,g&&b&&this.collisionIndex.insertCollisionBox(b.box,c.get("text-ignore-placement"),e.bucketInstanceId,S,d.ID),_&&E&&this.collisionIndex.insertCollisionBox(E.box,c.get("icon-ignore-placement"),e.bucketInstanceId,T,d.ID),g&&w&&this.collisionIndex.insertCollisionCircles(w.circles,c.get("text-ignore-placement"),e.bucketInstanceId,S,d.ID),this.placements[v.crossTileID]=new Ge(g,_,x||e.justReloaded),l[v.crossTileID]=!0}}e.justReloaded=!1},He.prototype.commit=function(t,e){this.commitTime=e;var r=!1,i=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,n=t?t.opacities:{};for(var o in this.placements){var a=this.placements[o],s=n[o];s?(this.opacities[o]=new Ze(s,i,a.text,a.icon),r=r||a.text!==s.text.placed||a.icon!==s.icon.placed):(this.opacities[o]=new Ze(null,i,a.text,a.icon,a.skipFade),r=r||a.text||a.icon)}for(var l in n){var u=n[l];if(!this.opacities[l]){var c=new Ze(u,i,(!1),(!1));c.isHidden()||(this.opacities[l]=c,r=r||u.text.placed||u.icon.placed)}}r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},He.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},He.prototype.updateBucketOpacities=function(t,e,r){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexArray.clear(),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexArray.clear();for(var i=t.layers[0].layout,n=new Ze(null,0,(!1),(!1),(!0)),o=new Ze(null,0,i.get("text-allow-overlap"),i.get("icon-allow-overlap"),(!0)),a=0;a<t.symbolInstances.length;a++){var s=t.symbolInstances[a],l=e[s.crossTileID],u=this.opacities[s.crossTileID];l?u=n:u||(u=o,this.opacities[s.crossTileID]=u),e[s.crossTileID]=!0;var c=s.numGlyphVertices>0||s.numVerticalGlyphVertices>0,h=s.numIconVertices>0;if(c){for(var p=N(u.text),f=(s.numGlyphVertices+s.numVerticalGlyphVertices)/4,d=0;d<f;d++)t.text.opacityVertexArray.emplaceBack(p);for(var m=0,y=s.placedTextSymbolIndices;m<y.length;m+=1){var v=y[m];t.text.placedSymbolArray.get(v).hidden=u.text.isHidden()}}if(h){for(var g=N(u.icon),_=0;_<s.numIconVertices/4;_++)t.icon.opacityVertexArray.emplaceBack(g);t.icon.placedSymbolArray.get(a).hidden=u.icon.isHidden()}s.collisionArrays||(s.collisionArrays=t.deserializeCollisionBoxes(r,s.textBoxStartIndex,s.textBoxEndIndex,s.iconBoxStartIndex,s.iconBoxEndIndex));var x=s.collisionArrays;if(x){x.textBox&&t.hasCollisionBoxData()&&V(t.collisionBox.collisionVertexArray,u.text.placed,!1),x.iconBox&&t.hasCollisionBoxData()&&V(t.collisionBox.collisionVertexArray,u.icon.placed,!1);var b=x.textCircles;if(b&&t.hasCollisionCircleData())for(var w=0;w<b.length;w+=5){var E=l||0===b[w+4];V(t.collisionCircle.collisionVertexArray,u.text.placed,E)}}}t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexBuffer&&t.collisionBox.collisionVertexBuffer.updateData(t.collisionBox.collisionVertexArray),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexBuffer&&t.collisionCircle.collisionVertexBuffer.updateData(t.collisionCircle.collisionVertexArray)},He.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},He.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},He.prototype.stillRecent=function(t){return"undefined"!==this.commitTime&&this.commitTime+this.fadeDuration>t},He.prototype.setStale=function(){this.stale=!0};var Xe=Math.pow(2,25),Ke=Math.pow(2,24),Ye=Math.pow(2,17),Je=Math.pow(2,16),Qe=Math.pow(2,9),tr=Math.pow(2,8),er=Math.pow(2,1),rr=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};rr.prototype.continuePlacement=function(t,e,r,i,n){for(;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.placeLayerTile(i,o,r,this._seenCrossTileIDs),this._currentTileIndex++,n())return!0}};var ir=function(t,e,r,i,n,o){this.placement=new He(t,n,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1};ir.prototype.isDone=function(){return this._done},ir.prototype.continuePlacement=function(e,r,i){for(var n=this,o=t.default$2.now(),a=function(){var e=t.default$2.now()-o;return!n._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[n._currentPlacementIndex]],l=n.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(n._inProgressLayer||(n._inProgressLayer=new rr),n._inProgressLayer.continuePlacement(i[s.source],n.placement,n._showCollisionBoxes,s,a))return;delete n._inProgressLayer}n._currentPlacementIndex--}this._done=!0},ir.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var nr=512/t.default$10/2,or=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)})}};or.prototype.getScaledCoordinates=function(e,r){var i=r.canonical.z-this.tileID.canonical.z,n=nr/Math.pow(2,i),o=e.anchor;return{x:Math.floor((r.canonical.x*t.default$10+o.x)*n),y:Math.floor((r.canonical.y*t.default$10+o.y)*n)}},or.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0,o=t;n<o.length;n+=1){var a=o[n];if(!a.crossTileID){var s=this.indexedSymbolInstances[a.key];if(s)for(var l=this.getScaledCoordinates(a,e),u=0,c=s;u<c.length;u+=1){var h=c[u];if(Math.abs(h.coord.x-l.x)<=i&&Math.abs(h.coord.y-l.y)<=i&&!r[h.crossTileID]){r[h.crossTileID]=!0,a.crossTileID=h.crossTileID;break}}}}};var ar=function(){this.maxCrossTileID=0};ar.prototype.generate=function(){return++this.maxCrossTileID};var sr=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};sr.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i=this.indexes[r],n={};for(var o in i){var a=i[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),n[a.tileID.key]=a}this.indexes[r]=n}this.lng=t},sr.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if
13(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0,n=e.symbolInstances;i<n.length;i+=1)n[i].crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var s=this.indexes[a];if(Number(a)>t.overscaledZ)for(var l in s){var u=s[l];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,o)}else{var c=s[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,o)}}for(var h=0,p=e.symbolInstances;h<p.length;h+=1){var f=p[h];f.crossTileID||(f.crossTileID=r.generate(),o[f.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}), 14this.indexes[t.overscaledZ][t.key]=new or(t,e.symbolInstances,e.bucketInstanceId),!0},sr.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1){var o=n[i];delete this.usedCrossTileIDs[t][o.crossTileID]}},sr.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var i=this.indexes[r];for(var n in i)t[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],e=!0)}return e};var lr=function(){this.layerIndexes={},this.crossTileIDs=new ar,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};lr.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new sr);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(l.tileID,u,this.crossTileIDs)&&(n=!0),o[u.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},lr.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach(function(t){e[t]=!0}),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var ur=function(e,r){return t.emitValidationErrors(e,r&&r.filter(function(t){return"source.canvas"!==t.identifier}))},cr=t.pick(Fe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),hr=t.pick(Fe,["setCenter","setZoom","setBearing","setPitch"]),pr=function(e){function o(r,i){var n=this;void 0===i&&(i={}),e.call(this),this.map=r,this.dispatcher=new Ot((Re||(Re=new Oe),Re),this),this.imageManager=new kt,this.glyphManager=new Lt(r._transformRequest,i.localIdeographFontFamily),this.lineAtlas=new Rt(256,512),this.crossTileSymbolIndex=new lr,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.default$21,this._loaded=!1,this._resetUpdates();var a=this;this._rtlTextPluginCallback=o.registerForPluginAvailability(function(t){for(var e in a.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),a.sourceCaches)a.sourceCaches[e].reload()}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=n.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var i in n._layers){var o=n._layers[i];o.source===r.id&&n._validateLayer(o)}}}})}return e&&(o.__proto__=e),o.prototype=Object.create(e&&e.prototype),o.prototype.constructor=o,o.prototype.loadURL=function(e,o){var a=this;void 0===o&&(o={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var s="boolean"==typeof o.validate?o.validate:!i(e);e=function(t,e){if(!i(t))return t;var o=n(t);return o.path="/styles/v1"+o.path,r(o,e)}(e,o.accessToken);var l=this.map._transformRequest(e,t.ResourceType.Style);t.getJSON(l,function(e,r){e?a.fire(new t.ErrorEvent(e)):r&&a._load(r,s)})},o.prototype.loadJSON=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),t.default$2.frame(function(){i._load(e,!1!==r.validate)})},o.prototype._load=function(e,r){var i=this;if(!r||!ur(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)i.addSource(n,e.sources[n],{validate:!1});e.sprite?function(e,r,i){function n(){if(s)i(s);else if(o&&a){var e=t.default$2.getImageData(a),r={};for(var n in o){var l=o[n],u=l.width,c=l.height,h=l.x,p=l.y,f=l.sdf,d=l.pixelRatio,m=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,m,{x:h,y:p},{x:0,y:0},{width:u,height:c}),r[n]={data:m,pixelRatio:d,sdf:f}}i(null,r)}}var o,a,s,l=t.default$2.devicePixelRatio>1?"@2x":"";t.getJSON(r(Tt(e,l,".json"),t.ResourceType.SpriteJSON),function(t,e){s||(s=t,o=e,n())}),t.getImage(r(Tt(e,l,".png"),t.ResourceType.SpriteImage),function(t,e){s||(s=t,a=e,n())})}(e.sprite,this.map._transformRequest,function(e,r){if(e)i.fire(new t.ErrorEvent(e));else if(r)for(var n in r)i.imageManager.addImage(n,r[n]);i.imageManager.setLoaded(!0),i.fire(new t.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);
14var o=y(this.stylesheet.layers);this._order=o.map(function(t){return t.id}),this._layers={};for(var a=0,s=o;a<s.length;a+=1){var l=s[a];(l=t.default$20(l)).setEventedParent(i,{layer:{id:l.id}}),i._layers[l.id]=l}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Bt(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},o.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var i=e.sourceLayer;if(i){var n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+i+'" does not exist on source "'+n.id+'" as specified by style layer "'+e.id+'"')))}}},o.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()},o.prototype._serializeLayers=function(t){var e=this;return t.map(function(t){return e._layers[t].serialize()})},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(e){if(this._loaded){if(this._changed){var r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var n in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var o=this._updatedSources[n];"reload"===o?this._reloadSource(n):"clear"===o&&this._clearSource(n)}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates(),this.fire(new t.Event("data",{dataType:"style"}))}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var l=0,u=this._order;l<u.length;l+=1){var c=u[l],h=this._layers[c];h.recalculate(e),!h.isHidden(e.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}this.light.recalculate(e),this.z=e.zoom}},o.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},o.prototype.setState=function(e){var r=this;if(this._checkLoaded(),ur(this,t.validateStyle(e)))return!1;(e=t.clone(e)).layers=y(e.layers);var i=S(this.serialize(),e).filter(function(t){return!(t.command in hr)});if(0===i.length)return!1;var n=i.filter(function(t){return!(t.command in cr)});if(n.length>0)throw new Error("Unimplemented: "+n.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},o.prototype.addImage=function(e,r){return this.getImage(e)?this.fire(new t.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(e,r),void this.fire(new t.Event("data",{dataType:"style"})))},o.prototype.getImage=function(t){return this.imageManager.getImage(t)},o.prototype.removeImage=function(e){return this.getImage(e)?(this.imageManager.removeImage(e),void this.fire(new t.Event("data",{dataType:"style"}))):this.fire(new t.ErrorEvent(new Error("No image with this name exists.")))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(e,r,i){var n=this;if(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 the 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 o=this.sourceCaches[e]=new Be(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:n.loaded(),source:o.serialize(),sourceId:e}}),o.onAdd(this.map),this._changed=!0}},o.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},o.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},o.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},o.prototype.addLayer=function(e,r,i){this._checkLoaded();var n=e.id;if(this.getLayer(n))this.fire(new t.ErrorEvent(new Error('Layer with i
14d "'+n+'" already exists on this map')));else if("object"==typeof e.source&&(this.addSource(n,e.source),e=t.clone(e),e=t.extend(e,{source:n})),!this._validate(t.validateStyle.layer,"layers."+n,e,{arrayIndex:-1},i)){var o=t.default$20(e);this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}});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,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source){var s=this._removedLayers[n];delete this._removedLayers[n],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o)}}},o.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 n=r?this._order.indexOf(r):this._order.length;r&&-1===n?this.fire(new t.ErrorEvent(new Error('Layer with i
14d "'+r+'" does not exist on this map.'))):(this._order.splice(n,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.")))},o.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._updatedLayers[e],delete this._updatedPaintProps[e]}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(t){return this._layers[t]},o.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(e,r){this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.default$13(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r)||(i.filter=t.clone(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(e){return t.clone(this.getLayer(e).filter)},o.prototype.setLayoutProperty=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?t.default$13(n.getLayoutProperty(r),i)||(n.setLayoutProperty(r,i),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.")))},o.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},o.prototype.setPaintProperty=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?t.default$13(n.getPaintProperty(r),i)||(n.setPaintProperty(r,i)&&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.")))},o.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},o.prototype.setFeatureState=function(e,r){this._checkLoaded();var i=e.source,n=e.sourceLayer,o=this.sourceCaches[i];void 0!==o?"vector"!==o.getSource().type||n?o.setFeatureState(n,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){if("vector"!==n.getSource().type||i)return n.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.")))},o.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){var e=this;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._order.map(function(t){return e._layers[t].serialize()})},function(t){return void 0!==t})},o.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},o.prototype._flattenRenderedFeatures=function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var i=this._order[r],n=0,o=t;n<o.length;n+=1){var a=o[n][i];if(a)for(var s=0,l=a;s<l.length;s+=1){var u=l[s];e.push(u)}}return e},o.prototype.queryRenderedFeatures=function(e,r,i){r&&r.filter&&this._val
14idate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter);var n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];n[l.source]=!0}}var u=[];for(var p in this.sourceCaches)r.layers&&!n[p]||u.push(c(this.sourceCaches[p],this._layers,e.worldCoordinate,r,i));return this.placement&&u.push(function(t,e,r,i,n,o){for(var a={},s=n.queryRenderedSymbols(r),l=[],u=0,c=Object.keys(s).map(Number);u<c.length;u+=1){var p=c[u];l.push(o[p])}l.sort(h);for(var f=function(){var e=m[d],r=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,i.filter,i.layers,t);for(var n in r){var o=a[n]=a[n]||[],l=r[n];l.sort(function(t,r){var i=e.featureSortOrder;if(i){var n=i.indexOf(t.featureIndex);return i.indexOf(r.featureIndex)-n}return r.featureIndex-t.featureIndex});for(var u=0,c=l;u<c.length;u+=1){var h=c[u];o.push(h.feature)}}},d=0,m=l;d<m.length;d+=1)f();var y=function(r){a[r].forEach(function(i){var n=t[r],o=e[n.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o})};for(var v in a)y(v);return a}(this._layers,this.sourceCaches,e.viewport,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenRenderedFeatures(u)},o.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter);var i=this.sourceCaches[e];return i?function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(i,r):[]},o.prototype.addSourceType=function(t,e,r){return o.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(o.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(e){this._checkLoaded();var r=this.light.getLight(),i=!1;for(var n in e)if(!t.default$13(e[n],r[n])){i=!0;break}if(i){var o={now:t.default$2.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e),this.light.updateTransitions(o)}},o.prototype._validate=function(e,r,i,n,o){return(!o||!1!==o.validate)&&ur(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:i,styleSpec:t.default$7},n)))},o.prototype._remove=function(){for(var e in t.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove()},o.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},o.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},o.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},o.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},o.prototype._updatePlacement=function(e,r,i,n){for(var o=!1,a=!1,s={},l=0,u=this._order;l<u.length;l+=1){var c=u[l],h=this._layers[c];if("symbol"===h.type){if(!s[h.source]){var p=this.sourceCaches[h.source];s[h.source]=p.getRenderableIds().map(function(t){return p.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)})}var f=this.crossTileSymbolIndex.addLayer(h,s[h.source],e.center.lng);o=o||f}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.default$2.now()))&&(this.pauseablePlacement=new ir(e,this._order,d,r,i,n),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(this.placement,t.default$2.now()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(var m=0,y=this._order;m<y.length;m+=1){var v=y[m],g=this._layers[v];"symbol"===g.type&&this.placement.updateLayerOpacities(g,s[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.default$2.now())},o.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r)},o.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},o}(t.Evented);pr.getSourceType=function(t){return Xt[t]},pr.setSourceType=function(t,e){Xt[t]=e},pr.registerForPluginAvailability=t.registerForPluginAvailability;var fr=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),dr={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},background:{fragmentSource:"uniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},backgroundPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;
14\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},circle:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main(void) {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n if (u_pitch_with_map) {\n vec2 corner_position = circle_center;\n if (u_scale_with_map) {\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n } else {\n // Pitching the circle with the map effectively scales it with the map\n // To counteract the effect for pitch-scale: viewport, we rescale the\n // whole circle based on the pitch scaling effect at its central point\n vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n }\n\n gl_Position = u_matrix * vec4(corner_position, 0, 1);\n } else {\n gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n } else {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n }\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},clippingMask:{fragmentSource:"void main() {\n gl_FragColor = vec4(1.0);\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n #pragma mapbox: initialize mediump float radius\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);
14\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n" 15},collisionBox:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2;
15 // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;
15\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is t
15inted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;
15\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = ga
15pwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\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\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\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = ga
15pwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_a.y + 2.0) / 2.0) / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (u_pattern_size_b.y + 2.0) / 2.0) / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n", 16vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\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\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\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = ga
16pwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\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\n\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\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = ga
16pwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\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\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\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\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\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\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}}
16,mr=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,yr=function(t){var e=dr[t],r={};e.fragmentSource=e.fragmentSource.replace(mr,function(t,e,i,n,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(mr,function(t,e,i,n,o){var a="float"===n?"vec2":"vec4";return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = unpack_mix_"+a+"(a_"+o+", a_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"})};for(var vr in dr)yr(vr);var gr=dr,_r=function(e,r,i,n){var o=e.gl;this.program=o.createProgram();var a=i.defines().concat("#define DEVICE_PIXEL_RATIO "+t.default$2.devicePixelRatio.toFixed(1));n&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(gr.prelude.fragmentSource,r.fragmentSource).join("\n"),l=a.concat(gr.prelude.vertexSource,r.vertexSource).join("\n"),u=o.createShader(o.FRAGMENT_SHADER);o.shaderSource(u,s),o.compileShader(u),o.attachShader(this.program,u);var c=o.createShader(o.VERTEX_SHADER);o.shaderSource(c,l),o.compileShader(c),o.attachShader(this.program,c);for(var h=i.layoutAttributes||[],p=0;p<h.length;p++)o.bindAttribLocation(this.program,p,h[p].name);o.linkProgram(this.program),this.numAttributes=o.getProgramParameter(this.program,o.ACTIVE_ATTRIBUTES),this.attributes={},this.uniforms={};for(var f=0;f<this.numAttributes;f++){var d=o.getActiveAttrib(this.program,f);d&&(this.attributes[d.name]=o.getAttribLocation(this.program,d.name))}for(var m=o.getProgramParameter(this.program,o.ACTIVE_UNIFORMS),y=0;y<m;y++){var v=o.getActiveUniform(this.program,y);v&&(this.uniforms[v.name]=o.getUniformLocation(this.program,v.name))}};_r.prototype.draw=function(t,e,r,i,n,o,a,s,l){for(var u,c=t.gl,h=(u={},u[c.LINES]=2,u[c.TRIANGLES]=3,u)[e],p=0,f=o.get();p<f.length;p+=1){var d=f[p],m=d.vaos||(d.vaos={});(m[r]||(m[r]=new Zt)).bind(t,this,i,a?a.getPaintVertexBuffers():[],n,d.vertexOffset,s,l),c.drawElements(e,d.primitiveLength*h,c.UNSIGNED_SHORT,d.primitiveOffset*h*2)}};var xr=t.identity(new Float32Array(16)),br=t.default$18.layout,wr=function(t,e){if(!t)return!1;var r=e.imageManager.getPattern(t.from),i=e.imageManager.getPattern(t.to);return!r||!i},Er=function(t,e,r){var i=e.context,n=i.gl,o=e.imageManager.getPattern(t.from),a=e.imageManager.getPattern(t.to);n.uniform1i(r.uniforms.u_image,0),n.uniform2fv(r.uniforms.u_pattern_tl_a,o.tl),n.uniform2fv(r.uniforms.u_pattern_br_a,o.br),n.uniform2fv(r.uniforms.u_pattern_tl_b,a.tl),n.uniform2fv(r.uniforms.u_pattern_br_b,a.br);var s=e.imageManager.getPixelSize(),l=s.width,u=s.height;n.uniform2fv(r.uniforms.u_texsize,[l,u]),n.uniform1f(r.uniforms.u_mix,t.t),n.uniform2fv(r.uniforms.u_pattern_size_a,o.displaySize),n.uniform2fv(r.uniforms.u_pattern_size_b,a.displaySize),n.uniform1f(r.uniforms.u_scale_a,t.fromScale),n.uniform1f(r.uniforms.u_scale_b,t.toScale),i.activeTexture.set(n.TEXTURE0),e.imageManager.bind(e.context)},Sr=function(t,e,r){var i=e.context.gl;i.uniform1f(r.uniforms.u_tile_units_to_pixels,1/F(t,1,e.transform.tileZoom));var n=Math.pow(2,t.tileID.overscaledZ),o=t.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(t.tileID.canonical.x+t.tileID.wrap*n),s=o*t.tileID.canonical.y;i.uniform2f(r.uniforms.u_pixel_coord_upper,a>>16,s>>16),i.uniform2f(r.uniforms.u_pixel_coord_lower,65535&a,65535&s)},Tr={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,
1617,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]], 17"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},zr={symbol:function(t,e,r,i){if("translucent"===t.renderPass){var n=t.context;n.setStencilMode(Le.disabled),n.setColorMode(t.colorModeForRenderPass()),0!==r.paint.get("icon-opacity").constantOr(1)&&$(t,e,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright")),0!==r.paint.get("text-opacity").constantOr(1)&&$(t,e,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&function(t,e,r,i){U(t,e,r,i,!1),U(t,e,r,i,!0)}(t,e,r,i)}},circle:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("circle-opacity"),o=r.paint.get("circle-stroke-width"),a=r.paint.get("circle-stroke-opacity");if(0!==n.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1)){var s=t.context,l=s.gl;s.setDepthMode(t.depthModeForSublayer(0,Ce.ReadOnly)),s.setStencilMode(Le.disabled),s.setColorMode(t.colorModeForRenderPass());for(var u=!0,c=0;c<i.length;c++){var h=i[c],p=e.getTile(h),f=p.getBucket(r);
17if(f){var d=t.context.program.get(),m=f.programConfigurations.get(r.id),y=t.useProgram("circle",m);if((u||y.program!==d)&&(m.setUniforms(s,y,r.paint,{zoom:t.transform.zoom}),u=!1),l.uniform1f(y.uniforms.u_camera_to_center_distance,t.transform.cameraToCenterDistance),l.uniform1i(y.uniforms.u_scale_with_map,"map"===r.paint.get("circle-pitch-scale")?1:0),"map"===r.paint.get("circle-pitch-alignment")){l.uniform1i(y.uniforms.u_pitch_with_map,1);var v=F(p,1,t.transform.zoom);l.uniform2f(y.uniforms.u_extrude_scale,v,v)}else l.uniform1i(y.uniforms.u_pitch_with_map,0),l.uniform2fv(y.uniforms.u_extrude_scale,t.transform.pixelsToGLUnits);l.uniformMatrix4fv(y.uniforms.u_matrix,!1,t.translatePosMatrix(h.posMatrix,p,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor"))),y.draw(s,l.TRIANGLES,r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,m)}}}}},heatmap:function(e,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl;o.setDepthMode(e.depthModeForSublayer(0,Ce.ReadOnly)),o.setStencilMode(Le.disabled),function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),t.bindFramebuffer.set(n.framebuffer);else{var o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function a(t,e,r,i){var n=t.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e.width/4,e.height/4,0,n.RGBA,t.extTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),i.colorAttachment.set(r),t.extTextureHalfFloat&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&(t.extTextureHalfFloat=null,i.colorAttachment.setDirty(),a(t,e,r,i))}(t,e,o,n)}}(o,e,i),o.clear({color:t.default$8.transparent}),o.setColorMode(new Pe([a.ONE,a.ONE],t.default$8.transparent,[!0,!0,!0,!0]));for(var s=!0,l=0;l<n.length;l++){var u=n[l];if(!r.hasRenderableParent(u)){var c=r.getTile(u),h=c.getBucket(i);if(h){var p=e.context.program.get(),f=h.programConfigurations.get(i.id),d=e.useProgram("heatmap",f),m=e.transform.zoom;(s||d.program!==p)&&(f.setUniforms(e.context,d,i.paint,{zoom:m}),s=!1),a.uniform1f(d.uniforms.u_extrude_scale,F(c,1,m)),a.uniform1f(d.uniforms.u_intensity,i.paint.get("heatmap-intensity")),a.uniformMatrix4fv(d.uniforms.u_matrix,!1,u.posMatrix),d.draw(o,a.TRIANGLES,i.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,f)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var i=e.context,n=i.gl,o=r.heatmapFbo;if(o){i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);var a=r.colorRampTexture;a||(a=r.colorRampTexture=new t.default$4(i,r.colorRamp,n.RGBA)),a.bind(n.LINEAR,n.CLAMP_TO_EDGE),i.setDepthMode(Ce.disabled),i.setStencilMode(Le.disabled);var s=e.useProgram("heatmapTexture"),l=r.paint.get("heatmap-opacity");n.uniform1f(s.uniforms.u_opacity,l),n.uniform1i(s.uniforms.u_image,0),n.uniform1i(s.uniforms.u_color_ramp,1);var u=t.create();t.ortho(u,0,e.width,e.height,0,0,1),n.uniformMatrix4fv(s.uniforms.u_matrix,!1,u),n.uniform2f(s.uniforms.u_world,n.drawingBufferWidth,n.drawingBufferHeight),e.viewportVAO.bind(e.context,s,e.viewportBuffer,[]),n.drawArrays(n.TRIANGLE_STRIP,0,4)}}(e,i))},line:function(t,e,r,i){if("translucent"===t.renderPass){var n=r.paint.get("line-opacity"),o=r.paint.get("line-width");if(0!==n.constantOr(1)&&0!==o.constantOr(1)){var a=t.context;a.setDepthMode(t.depthModeForSublayer(0,Ce.ReadOnly)),a.setColorMode(t.colorModeForRenderPass());for(var s,l=r.paint.get("line-dasharray")?"lineSDF":r.paint.get("line-pattern")?"linePattern":r.paint.get("line-gradient")?"lineGradient":"line",u=!0,c=0,h=i;c<h.length;c+=1){var p=h[c],f=e.getTile(p),d=f.getBucket(r);
17if(d){var m=d.programConfigurations.get(r.id),y=t.context.program.get(),v=t.useProgram(l,m),g=u||v.program!==y,_=s!==f.tileID.overscaledZ;g&&m.setUniforms(t.context,v,r.paint,{zoom:t.transform.zoom}),W(v,t,f,d,r,p,m,g,_),s=f.tileID.overscaledZ,u=!1}}}}},fill:function(e,r,i,n){var o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.context;s.setColorMode(e.colorModeForRenderPass());var l=i.paint.get("fill-pattern")||1!==o.constantOr(t.default$8.transparent).a||1!==a.constantOr(0)?"translucent":"opaque";e.renderPass===l&&(s.setDepthMode(e.depthModeForSublayer(1,"opaque"===e.renderPass?Ce.ReadWrite:Ce.ReadOnly)),H(e,r,i,n,X)),"translucent"===e.renderPass&&i.paint.get("fill-antialias")&&(s.setDepthMode(e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Ce.ReadOnly)),H(e,r,i,n,K))}},"fill-extrusion":function(e,r,i,n){if(0!==i.paint.get("fill-extrusion-opacity"))if("offscreen"===e.renderPass){!function(e,r){var i=e.context,n=i.gl,o=r.viewportFrame;if(e.depthRboNeedsClear&&e.setupOffscreenDepthRenderbuffer(),!o){var a=new t.default$4(i,{width:e.width,height:e.height,data:null},n.RGBA);a.bind(n.LINEAR,n.CLAMP_TO_EDGE),(o=r.viewportFrame=i.createFramebuffer(e.width,e.height)).colorAttachment.set(a.texture)}i.bindFramebuffer.set(o.framebuffer),o.depthAttachment.set(e.depthRbo),e.depthRboNeedsClear&&(i.clear({depth:1}),e.depthRboNeedsClear=!1),i.clear({color:t.default$8.transparent}),i.setStencilMode(Le.disabled),i.setDepthMode(new Ce(n.LEQUAL,Ce.ReadWrite,[0,1])),i.setColorMode(e.colorModeForRenderPass())}(e,i);for(var o=!0,a=0,s=n;a<s.length;a+=1){var l=s[a],u=r.getTile(l),c=u.getBucket(i);c&&(J(e,0,i,u,l,c,o),o=!1)}}else"translucent"===e.renderPass&&function(e,r){var i=r.viewportFrame;if(i){var n=e.context,o=n.gl,a=e.useProgram("extrusionTexture");n.setStencilMode(Le.disabled),n.setDepthMode(Ce.disabled),n.setColorMode(e.colorModeForRenderPass()),n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,i.colorAttachment.get()),o.uniform1f(a.uniforms.u_opacity,r.paint.get("fill-extrusion-opacity")),o.uniform1i(a.uniforms.u_image,0);var s=t.create();t.ortho(s,0,e.width,e.height,0,0,1),o.uniformMatrix4fv(a.uniforms.u_matrix,!1,s),o.uniform2f(a.uniforms.u_world,o.drawingBufferWidth,o.drawingBufferHeight),e.viewportVAO.bind(n,a,e.viewportBuffer,[]),o.drawArrays(o.TRIANGLE_STRIP,0,4)}}(e,i)},hillshade:function(t,e,r,i){if("offscreen"===t.renderPass||"translucent"===t.renderPass){var n=t.context,o=e.getSource().maxzoom;n.setDepthMode(t.depthModeForSublayer(0,Ce.ReadOnly)),n.setStencilMode(Le.disabled),n.setColorMode(t.colorModeForRenderPass());for(var a=0,s=i;a<s.length;a+=1){var l=s[a],u=e.getTile(l);u.needsHillshadePrepare&&"offscreen"===t.renderPass?tt(t,u,o):"translucent"===t.renderPass&&Q(t,u,r)}n.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,i){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")){var n,o,a=t.context,s=a.gl,l=e.getSource(),u=t.useProgram("raster");a.setStencilMode(Le.disabled),a.setColorMode(t.colorModeForRenderPass()),s.uniform1f(u.uniforms.u_brightness_low,r.paint.get("raster-brightness-min")),s.uniform1f(u.uniforms.u_brightness_high,r.paint.get("raster-brightness-max")),s.uniform1f(u.uniforms.u_saturation_factor,(n=r.paint.get("raster-saturation"))>0?1-1/(1.001-n):-n),s.uniform1f(u.uniforms.u_contrast_factor,(o=r.paint.get("raster-contrast"))>0?1/(1-o):1+o),s.uniform3fv(u.uniforms.u_spin_weights,function(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]}(r.paint.get("raster-hue-rotate"))),s.uniform1f(u.uniforms.u_buffer_scale,1),s.uniform1i(u.uniforms.u_image0,0),s.uniform1i(u.uniforms.u_image1,1);for(var c=i.length&&i[0].overscaledZ,h=0,p=i;h<p.length;h+=1){var f=p[h];a.setDepthMode(t.depthModeForSublayer(f.overscaledZ-c,1===r.paint.get("raster-opacity")?Ce.ReadWrite:Ce.ReadOnly,s.LESS));var d=e.getTile(f),m=t.transform.calculatePosMatrix(f.toUnwrapped(),!0);d.registerFadeDuration(r.paint.get("raster-fade-duration")),s.uniformMatrix4fv(u.uniforms.u_matrix,!1,m);var y=e.findLoadedParent(f,0,{}),v=et(d,y,e,r,t.transform),g=void 0,_=void 0;if(a.activeTexture.set(s.TEXTURE0),d.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(s.TEXTURE1),y?(y.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),g=Math.pow(2,y.tileID.overscaledZ-d.tileID.overscaledZ
17),_=[d.tileID.canonical.x*g%1,d.tileID.canonical.y*g%1]):d.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),s.uniform2fv(u.uniforms.u_tl_parent,_||[0,0]),s.uniform1f(u.uniforms.u_scale_parent,g||1),s.uniform1f(u.uniforms.u_fade_t,v.mix),s.uniform1f(u.uniforms.u_opacity,v.opacity*r.paint.get("raster-opacity")),l instanceof Gt){var x=l.boundsBuffer;l.boundsVAO.bind(a,u,x,[]),s.drawArrays(s.TRIANGLE_STRIP,0,x.length)}else if(d.maskedBoundsBuffer&&d.maskedIndexBuffer&&d.segments)u.draw(a,s.TRIANGLES,r.id,d.maskedBoundsBuffer,d.maskedIndexBuffer,d.segments);else{var b=t.rasterBoundsBuffer;t.rasterBoundsVAO.bind(a,u,b,[]),s.drawArrays(s.TRIANGLE_STRIP,0,b.length)}}}},background:function(t,e,r){var i=r.paint.get("background-color"),n=r.paint.get("background-opacity");if(0!==n){var o=t.context,a=o.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern"),c=u||1!==i.a||1!==n?"translucent":"opaque";if(t.renderPass===c){var h;if(o.setStencilMode(Le.disabled),o.setDepthMode(t.depthModeForSublayer(0,"opaque"===c?Ce.ReadWrite:Ce.ReadOnly)),o.setColorMode(t.colorModeForRenderPass()),u){if(wr(u,t))return;h=t.useProgram("backgroundPattern"),Er(u,t,h),t.tileExtentPatternVAO.bind(o,h,t.tileExtentBuffer,[])}else h=t.useProgram("background"),a.uniform4fv(h.uniforms.u_color,[i.r,i.g,i.b,i.a]),t.tileExtentVAO.bind(o,h,t.tileExtentBuffer,[]);a.uniform1f(h.uniforms.u_opacity,n);for(var p=0,f=s.coveringTiles({tileSize:l});p<f.length;p+=1){var d=f[p];u&&Sr({tileID:d,tileSize:l},t,h),a.uniformMatrix4fv(h.uniforms.u_matrix,!1,t.transform.calculatePosMatrix(d.toUnwrapped())),a.drawArrays(a.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)rt(t,e,r[i])}},Ar=function(e,r){this.context=new De(e),this.transform=r,this._tileTextures={},this.setup(),this.numSublayers=Be.maxUnderzooming+Be.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.default$22,this.crossTileSymbolIndex=new lr};Ar.prototype.resize=function(e,r){var i=this.context.gl;if(this.width=e*t.default$2.devicePixelRatio,this.height=r*t.default$2.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,o=this.style._order;n<o.length;n+=1){var a=o[n];this.style._layers[a].resize()}this.depthRbo&&(i.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},Ar.prototype.setup=function(){var e=this.context,r=new t.PosArray;r.emplaceBack(0,0),r.emplaceBack(t.default$10,0),r.emplaceBack(0,t.default$10),r.emplaceBack(t.default$10,t.default$10),this.tileExtentBuffer=e.createVertexBuffer(r,fr.members),this.tileExtentVAO=new Zt,this.tileExtentPatternVAO=new Zt;var i=new t.PosArray;i.emplaceBack(0,0),i.emplaceBack(t.default$10,0),i.emplaceBack(t.default$10,t.default$10),i.emplaceBack(0,t.default$10),i.emplaceBack(0,0),this.debugBuffer=e.createVertexBuffer(i,fr.members),this.debugVAO=new Zt;var n=new t.RasterBoundsArray;n.emplaceBack(0,0,0,0),n.emplaceBack(t.default$10,0,t.default$10,0),n.emplaceBack(0,t.default$10,0,t.default$10),n.emplaceBack(t.default$10,t.default$10,t.default$10,t.default$10),this.rasterBoundsBuffer=e.createVertexBuffer(n,t.default$11.members),this.rasterBoundsVAO=new Zt;var o=new t.PosArray;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,fr.members),this.viewportVAO=new Zt},Ar.prototype.clearStencil=function(){var e=this.context,r=e.gl;e.setColorMode(Pe.disabled),e.setDepthMode(Ce.disabled),e.setStencilMode(new Le({func:r.ALWAYS,mask:0},0,255,r.ZERO,r.ZERO,r.ZERO));var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]);var n=this.useProgram("clippingMask");r.uniformMatrix4fv(n.uniforms.u_matrix,!1,i),this.viewportVAO.bind(e,n,this.viewportBuffer,[]),r.drawArrays(r.TRIANGLE_STRIP,0,4)},Ar.prototype._renderTileClippingMasks=function(t){var e=this.context,r=e.gl;e.setColorMode(Pe.disabled),e.setDepthMode(Ce.disabled);var i=1;this._tileClippingMaskIDs={};for(var n=0,o=t;n<o.length;n+=1){var a=o[n],s=this._tileClippingMaskIDs[a.key]=i++;
17e.setStencilMode(new Le({func:r.ALWAYS,mask:0},s,255,r.KEEP,r.KEEP,r.REPLACE));var l=this.useProgram("clippingMask");r.uniformMatrix4fv(l.uniforms.u_matrix,!1,a.posMatrix),this.tileExtentVAO.bind(this.context,l,this.tileExtentBuffer,[]),r.drawArrays(r.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}},Ar.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Le({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Ar.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Pe([e.CONSTANT_COLOR,e.ONE],new t.default$8(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Pe.unblended:Pe.alphaBlended},Ar.prototype.depthModeForSublayer=function(t,e,r){var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,n=i-1+this.depthRange;return new Ce(r||this.context.gl.LEQUAL,e,[n,i])},Ar.prototype.render=function(e,r){var i=this;for(var n in this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.default$2.now()),e.sourceCaches){var o=i.style.sourceCaches[n];o.used&&o.prepare(i.context)}var a=this.style._order,s=t.filterObject(this.style.sourceCaches,function(t){return"raster"===t.getSource().type||"raster-dem"===t.getSource().type}),l=function(e){var r=s[e];!function(e,r){for(var i=e.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),n=0;n<i.length;n++){var o={},a=i[n],s=i.slice(n+1);j(a.tileID.wrapped(),a.tileID,s,new t.OverscaledTileID(0,a.tileID.wrap+1,0,0,0),o),a.setMask(o,r)}}(r.getVisibleCoordinates().map(function(t){return r.getTile(t)}),i.context)};for(var u in s)l(u);this.renderPass="offscreen";var c,h=[];this.depthRboNeedsClear=!0;for(var p=0;p<a.length;p++){var f=i.style._layers[a[p]];f.hasOffscreenPass()&&!f.isHidden(i.transform.zoom)&&(f.source!==(c&&c.id)&&(h=[],(c=i.style.sourceCaches[f.source])&&(h=c.getVisibleCoordinates()).reverse()),h.length&&i.renderLayer(i,c,f,h))}this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.default$8.black:t.default$8.transparent,depth:1}),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRange=(e._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque";var d,m=[];for(this.currentLayer=a.length-1,this.currentLayer;this.currentLayer>=0;this.currentLayer--){var y=i.style._layers[a[i.currentLayer]];y.source!==(d&&d.id)&&(m=[],(d=i.style.sourceCaches[y.source])&&(i.clearStencil(),m=d.getVisibleCoordinates(),d.getSource().isTileClipped&&i._renderTileClippingMasks(m))),i.renderLayer(i,d,y,m)}this.renderPass="translucent";var v,g=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer<a.length;this.currentLayer++){var _=i.style._layers[a[i.currentLayer]];_.source!==(v&&v.id)&&(g=[],(v=i.style.sourceCaches[_.source])&&(i.clearStencil(),g=v.getVisibleCoordinates(),v.getSource().isTileClipped&&i._renderTileClippingMasks(g)),g.reverse()),i.renderLayer(i,v,_,g)}if(this.options.showTileBoundaries){var x=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]];x&&zr.debug(this,x,x.getVisibleCoordinates())}},Ar.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},Ar.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||i.length)&&(this.id=r.id,zr[r.type](t,e,r,i))},Ar.prototype.translatePosMatrix=function(e,r,i,n,o){if(!i[0]&&!i[1])return e;var a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);i=[i[0]*l-i[1]*s,i[0]*s+i[1]*l]}var u=[o?i[0]:F(r,i[0],this.transform.zoom),o?i[1]:F(r,i[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},Ar.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},Ar.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Ar.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new _r(this.context,gr[t],e,this._showOverdrawInspector)),this.cache[r]},Ar.prototype.useProgram=function(t,e){var r=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.context.program.set(r.program),r};var Mr=function(t,e,r){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new Ft(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},kr={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};Mr.prototype.clone=function(){var t=new Mr(this._minZoom,this._maxZoom,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._calcMatrices(),t},kr.minZoom.get=function(){return this._minZoom},kr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},kr.maxZoom.get=function(){return this._maxZoom},kr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},kr.renderWorldCopies.get=function(){return this._renderWorldCopies},kr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},kr.worldSize.get=function(){return this.tileSize*this.scale},kr.centerPoint.get=function(){return this.size._div(2)},kr.size.get=function(){return new t["default"](this.width,this.height)},kr.bearing.get=function(){return-this.angle/Math.PI*180}
17,kr.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$4(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},kr.pitch.get=function(){return this._pitch/Math.PI*180},kr.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},kr.fov.get=function(){return this._fov/Math.PI*180},kr.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())},kr.zoom.get=function(){return this._zoom},kr.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())},kr.center.get=function(){return this._center},kr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Mr.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Mr.prototype.getVisibleUnwrappedCoordinates=function(e){var r=this.pointCoordinate(new t["default"](0,0),0),i=this.pointCoordinate(new t["default"](this.width,0),0),n=Math.floor(r.column),o=Math.floor(i.column),a=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var s=n;s<=o;s++)0!==s&&a.push(new t.UnwrappedTileID(s,e));return a},Mr.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var n=this.pointCoordinate(this.centerPoint,r),o=new t["default"](n.column-.5,n.row-.5);return function(e,r,i,n){function o(r,o,l){var u,c,h,p;if(l>=0&&l<=a)for(u=r;u<o;u++)c=Math.floor(u/a),h=(u%a+a)%a,0!==c&&!0!==n||(p=new t.OverscaledTileID(i,c,e,h,l),s[p.key]=p)}void 0===n&&(n=!0);var a=1<<e,s={};return ot(r[0],r[1],r[2],0,a,o),ot(r[2],r[3],r[0],0,a,o),Object.keys(s).map(function(t){return s[t]})}(r,[this.pointCoordinate(new t["default"](0,0),r),this.pointCoordinate(new t["default"](this.width,0),r),this.pointCoordinate(new t["default"](this.width,this.height),r),this.pointCoordinate(new t["default"](0,this.height),r)],e.reparseOverscaled?i:r,this._renderWorldCopies).sort(function(t,e){return o.dist(t.canonical)-o.dist(e.canonical)})},Mr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},kr.unmodified.get=function(){return this._unmodified},Mr.prototype.zoomScale=function(t){return Math.pow(2,t)},Mr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Mr.prototype.project=function(e){return new t["default"](this.lngX(e.lng),this.latY(e.lat))},Mr.prototype.unproject=function(t){return new Ft(this.xLng(t.x),this.yLat(t.y))},kr.x.get=function(){return this.lngX(this.center.lng)},kr.y.get=function(){return this.latY(this.center.lat)},kr.point.get=function(){return new t["default"](this.x,this.y)},Mr.prototype.lngX=function(t){return(180+t)*this.worldSize/360},Mr.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},Mr.prototype.xLng=function(t){return 360*t/this.worldSize-180},Mr.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},Mr.prototype.setLocationAtPoint=function(t,e){var r=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(r)),this._renderWorldCopies&&
17(this.center=this.center.wrap())},Mr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Mr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Mr.prototype.locationCoordinate=function(e){return new t.default$15(this.lngX(e.lng)/this.tileSize,this.latY(e.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},Mr.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new Ft(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},Mr.prototype.pointCoordinate=function(e,r){void 0===r&&(r=this.tileZoom);var i=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var o=i[3],a=n[3],s=i[0]/o,l=n[0]/a,u=i[1]/o,c=n[1]/a,h=i[2]/o,p=n[2]/a,f=h===p?0:(0-h)/(p-h);return new t.default$15(t.number(s,l,f)/this.tileSize,t.number(u,c,f)/this.tileSize,this.zoom)._zoomTo(r)},Mr.prototype.coordinatePoint=function(e){var r=e.zoomTo(this.zoom),i=[r.column*this.tileSize,r.row*this.tileSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t["default"](i[0]/i[3],i[1]/i[3])},Mr.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,o.y*a,0]),t.scale(l,l,[a/t.default$10,a/t.default$10,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),n[i]=new Float32Array(l),n[i]},Mr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,n,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=this.latY(h[1]),e=(a=this.latY(h[0]))-o<u.y?u.y/(a-o):0}if(this.lngRange){var p=this.lngRange;s=this.lngX(p[0]),r=(l=this.lngX(p[1]))-s<u.x?u.x/(l-s):0}var f=Math.max(r||0,e||0);if(f)return this.center=this.unproject(new t["default"](r?(l+s)/2:this.x,e?(a+o)/2:this.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var d=this.y,m=u.y/2;d-m<o&&(n=o+m),d+m>a&&(n=a-m)}if(this.lngRange){var y=this.x,v=u.x/2;y-v<s&&(i=s+v),y+v>l&&(i=l-v)}void 0===i&&void 0===n||(this.center=this.unproject(new t["default"](void 0!==i?i:this.x,void 0!==n?n:this.y))),this._unmodified=c,this._constraining=!1}},Mr.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,i=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),n=this.x,o=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),s=new Float64Array(16);t.perspective(s,this._fov,this.width/this.height,1,a),t.scale(s,s,[1,-1,1]),t.translate(s,s,[0,0,-this.cameraToCenterDistance]),t.rotateX(s,s,this._pitch),t.rotateZ(s,s,this.angle),t.translate(s,s,[-n,-o,0]);var l=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));t.scale(s,s,[1,1,l,1]),this.projMatrix=s;var u=this.width%2/2,c=this.height%2/2,h=Math.cos(this.angle),p=Math.sin(this.angle),f=n-Math.round(n)+h*u+p*c,d=o-Math.round(o)+h*c+p*u,m=new Float64Array(s);if(t.translate(m,m,[f>.5?f-1:f,d>.5?d-1:d,0]),this.alignedProjMatrix=m,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.pixelMatrix=t.multiply(new Float64Array(16),s,this.projMatrix),!(s=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Mr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t["default"](0,0)).zoomTo(this.zoom),r=[e.column*this.tileSize,e.row*this.tileSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(Mr.prototype,kr);var Ir=function(){var e,r,i,n,o;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),r=300,i=!1,n=0,o=function(){n=0,i&&(e(),n=setTimeout(o,r),i=!1)},function(){return i=!0,n||o(),n})};Ir.prototype.addTo=function(e){return this._map=e,t.default$1.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ir.prototype.remove=function(){return t.default$1.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ir.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+o+"/"+a+"/"+r:"#"+r+"/"+a+"/"+o,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},Ir.prototype._onHashChange=function(){var e=t.default$1.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},Ir.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.default$1.history.replaceState(t.default$1.history.state,"",e)};var Cr=function(e){function r(r,i,n,o){void 0===o&&(o={});var a=dt.mousePos(i.getCanvasContainer(),n),s=i.unproject(a);e.call(this,r,t.extend({point:a,lngLat:s,originalEvent:n},o)),this._defaultPrevented=!1,this.target=i}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented}
17,Object.defineProperties(r.prototype,i),r}(t.Event),Lr=function(e){function r(r,i,n){var o=dt.touchPos(i.getCanvasContainer(),n),a=o.map(function(t){return i.unproject(t)}),s=o.reduce(function(t,e,r,i){return t.add(e.div(i.length))},new t["default"](0,0)),l=i.unproject(s);e.call(this,r,{points:o,point:s,lngLats:a,lngLat:l,originalEvent:n}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Pr=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Dr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};Dr.prototype.isEnabled=function(){return!!this._enabled},Dr.prototype.isActive=function(){return!!this._active},Dr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},Dr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Dr.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.default$1.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.default$2.now(),n=i-(this._lastWheelEventTime||0); 18this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*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.isActive()||this._start(e)),e.preventDefault()}}
18,Dr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},Dr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=dt.mousePos(this._el,e);this._around=Ft.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},Dr.prototype._onScrollFrame=function(){var e=this;if(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?1/450:.01,n=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==n&&(n=1/n);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*n))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a=!1;if("wheel"===this._type){var s=Math.min((t.default$2.now()-this._lastWheelEventTime)/200,1),l=this._easing(s);r.zoom=t.number(this._startZoom,this._targetZoom,l),s<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):a=!0}else r.zoom=this._targetZoom,a=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),a&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom},200))}},Dr.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var i=this._prevEase,n=(t.default$2.now()-i.start)/i.duration,o=i.easing(n+.01)-i.easing(n),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.default$2.now(),duration:e,easing:r},r};var Br=function(e){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};Br.prototype.isEnabled=function(){return!!this._enabled},Br.prototype.isActive=function(){return!!this._active},Br.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Br.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Br.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.default$1.document.addEventListener("mousemove",this._onMouseMove,!1),t.default$1.document.addEventListener("keydown",this._onKeyDown,!1),t.default$1.document.addEventListener("mouseup",this._onMouseUp,!1),dt.disableDrag(),this._startPos=this._lastPos=dt.mousePos(this._el,e),this._active=!0)},Br.prototype._onMouseMove=function(t){var e=dt.mousePos(this._el,t);if(!this._lastPos.equals(e)){var r=this._startPos;this._lastPos=e,this._box||(this._box=dt.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(r.x,e.x),n=Math.max(r.x,e.x),o=Math.min(r.y,e.y),a=Math.max(r.y,e.y);dt.setTransform(this._box,"translate("+i+"px,"+o+"px)"),this._box.style.width=n-i+"px",this._box.style.height=a-o+"px"}},Br.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,i=dt.mousePos(this._el,e),n=(new Vt).extend(this._map.unproject(r)).extend(this._map.unproject(i));this._finish(),dt.suppressClick(),r.x===i.x&&r.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitBounds(n,{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e,boxZoomBounds:n}))}},Br.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},Br.prototype._finish=function(){this._active=!1,t.default$1.document.removeEventListener("mousemove",this._onMouseMove,!1),t.default$1.document.removeEventListener("keydown",this._onKeyDown,!1),t.default$1.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(dt.remove(this._box),this._box=null),dt.enableDrag(),delete this._startPos,delete this._lastPos},Br.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Rr=t.bezier(0,0,.25,1),Or=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};Or.prototype.isEnabled=function(){return"disabled"!==this._state},Or.prototype.isActive=function(){return"active"===this._state},Or.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},Or.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;
18case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Or.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=dt.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==dt.mouseButton(e))return;this._eventButton=0}dt.disableDrag(),t.default$1.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default$1.document.addEventListener("mouseup",this._onMouseUp),t.default$1.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.default$2.now(),this._map.getBearing()]],this._startPos=this._lastPos=dt.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},Or.prototype._onMouseMove=function(t){var e=dt.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Or.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var r=this._map.transform,i=this._startPos,n=this._lastPos,o=.8*(i.x-n.x),a=-.5*(i.y-n.y),s=r.bearing-o,l=r.pitch-a,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([t.default$2.now(),this._map._normalizeBearing(s,c[1])]),r.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),r.pitch=l),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._startPos=this._lastPos}},Or.prototype._onMouseUp=function(t){if(dt.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",dt.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},Or.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Or.prototype._unbind=function(){t.default$1.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.default$1.document.removeEventListener("mouseup",this._onMouseUp),t.default$1.removeEventListener("blur",this._onBlur),dt.enableDrag()},Or.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos},Or.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,i=r.getBearing(),n=this._inertia,o=function(){Math.abs(i)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(n.length<2)o();else{var a=n[0],s=n[n.length-1],l=n[n.length-2],u=r._normalizeBearing(i,l[1]),c=s[1]-a[1],h=c<0?-1:1,p=(s[0]-a[0])/1e3;if(0!==c&&0!==p){var f=Math.abs(c*(.25/p));f>180&&(f=180);var d=f/180;u+=h*f*(d/2),Math.abs(r._normalizeBearing(u,0))<this._bearingSnap&&(u=r._normalizeBearing(0,u)),r.rotateTo(u,{duration:1e3*d,easing:Rr,noMoveStart:!0},{originalEvent:t})}else o()}},Or.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Or.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.default$2.now();e.length>0&&r-e[0][0]>160;)e.shift()};var Fr=t.bezier(0,0,.3,1),Vr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};Vr.prototype.isEnabled=function(){return"disabled"!==this._state},Vr.prototype.isActive=function(){return"active"===this._state},Vr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},Vr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;
18case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},Vr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==dt.mouseButton(e)||(dt.addEventListener(t.default$1.document,"mousemove",this._onMove,{capture:!0}),dt.addEventListener(t.default$1.document,"mouseup",this._onMouseUp),this._start(e)))},Vr.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(dt.addEventListener(t.default$1.document,"touchmove",this._onMove,{capture:!0,passive:!1}),dt.addEventListener(t.default$1.document,"touchend",this._onTouchEnd),this._start(e)))},Vr.prototype._start=function(e){t.default$1.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._lastPos=dt.mousePos(this._el,e),this._inertia=[[t.default$2.now(),this._startPos]]},Vr.prototype._onMove=function(e){e.preventDefault();var r=dt.mousePos(this._el,e);this._lastPos.equals(r)||(this._lastMoveEvent=e,this._lastPos=r,this._drainInertiaBuffer(),this._inertia.push([t.default$2.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",e),this._fireEvent("movestart",e)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},Vr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._startPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._startPos=this._lastPos,delete this._lastMoveEvent}},Vr.prototype._onMouseUp=function(t){if(0===dt.mouseButton(t))switch(this._state){case"active":this._state="enabled",dt.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Vr.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},Vr.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},Vr.prototype._unbind=function(){dt.removeEventListener(t.default$1.document,"touchmove",this._onMove,{capture:!0,passive:!1}),dt.removeEventListener(t.default$1.document,"touchend",this._onTouchEnd),dt.removeEventListener(t.default$1.document,"mousemove",this._onMove,{capture:!0}),dt.removeEventListener(t.default$1.document,"mouseup",this._onMouseUp),dt.removeEventListener(t.default$1,"blur",this._onBlur)},Vr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos},Vr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],i=e[0],n=r[1].sub(i[1]),o=(r[0]-i[0])/1e3;if(0===o||r[1].equals(i[1]))this._fireEvent("moveend",t);else{var a=n.mult(.3/o),s=a.mag();s>1400&&(s=1400,a._unit()._mult(s));var l=s/750,u=a.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:Fr,noMoveStart:!0},{originalEvent:t})}}},Vr.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Vr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.default$2.now();e.length>0&&r-e[0][0]>160;)e.shift()};var Nr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};Nr.prototype.isEnabled=function(){return!!this._enabled},Nr.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},Nr.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},Nr.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,i=0,n=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?i=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:at,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*r,pitch:a.getPitch()+10*i,offset:[100*-n,100*-o],center:a.getCenter()};a.easeTo(l,{originalEvent:t})}};var jr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};jr.prototype.isEnabled=function(){return!!this._enabled},jr.prototype.isActive=function(){return!!this._active},jr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},jr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},jr.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout(function(){e._tapped=null},300)))},jr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},jr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},jr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};
18var Ur=t.bezier(0,0,.15,1),$r=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};$r.prototype.isEnabled=function(){return!!this._enabled},$r.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},$r.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},$r.prototype.disableRotation=function(){this._rotationDisabled=!0},$r.prototype.enableRotation=function(){this._rotationDisabled=!1},$r.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=dt.mousePos(this._el,e.touches[0]),i=dt.mousePos(this._el,e.touches[1]);this._startVec=r.sub(i),this._gestureIntent=void 0,this._inertia=[],dt.addEventListener(t.default$1.document,"touchmove",this._onMove,{passive:!1}),dt.addEventListener(t.default$1.document,"touchend",this._onEnd)}},$r.prototype._getTouchEventData=function(t){var e=dt.mousePos(this._el,t.touches[0]),r=dt.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},$r.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),i=r.vec,n=r.scale,o=r.bearing;if(!this._gestureIntent){var a=Math.abs(1-n)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=i)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},$r.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var i=this._getTouchEventData(this._lastTouchEvent),n=i.center,o=i.bearing,a=i.scale,s=r.pointLocation(n),l=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+o),r.zoom=r.scaleZoom(this._startScale*a),r.setLocationAtPoint(s,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.default$2.now(),a,n])}},$r.prototype._onEnd=function(e){dt.removeEventListener(t.default$1.document,"touchmove",this._onMove,{passive:!1}),dt.removeEventListener(t.default$1.document,"touchend",this._onEnd);var r=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var n=this._inertia,o=this._map;if(n.length<2)o.snapToNorth({},{originalEvent:e});else{var a=n[n.length-1],s=n[0],l=o.transform.scaleZoom(i*a[1]),u=o.transform.scaleZoom(i*s[1]),c=l-u,h=(a[0]-s[0])/1e3,p=a[2];if(0!==h&&l!==u){var f=.15*c/h;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var d=1e3*Math.abs(f/(12*.15)),m=l+f*d/2e3;m<0&&(m=0),o.easeTo({zoom:m,duration:d,easing:Ur,around:this._aroundCenter?o.getCenter():o.unproject(p),noMoveStart:!0},{originalEvent:e})}else o.snapToNorth({},{originalEvent:e})}}},$r.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.default$2.now();e.length>2&&r-e[0][0]>160;)e.shift()};var qr={scrollZoom:Dr,boxZoom:Br,dragRotate:Or,dragPan:Vr,keyboard:Nr,doubleClickZoom:jr,touchZoomRotate:$r},Zr=function(e){function r(r,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return this.transform.center},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,i){return e=t["default"].convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},r.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){if("number"==typeof(r=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var i=r.padding;r.padding={top:i,bottom:i,right:i,left:i}}if(t.default$13(Object.keys(r.padding).sort(function(t,e){return t<e?-1:t>e?1:0}),["bottom","left","right","top"])){e=Vt.convert(e);var n=[(r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2],o=Math.min(r.padding.right,r.padding.left),a=Math.min(r.padding.top,r.padding.bottom);r.offset=[r.offset[0]+n[0],r.offset[1]+n[1]];var s=t["default"].convert(r.offset),l=this.transform,u=l.project(e.getNorthWest()),c=l.project(e.getSouthEast()),h=c.sub(u),p=(l.width-2*o-2*Math.abs(s.x))/h.x,f=(l.height-2*a-2*Math.abs(s.y))/h.y;if(!(f<0||p<0))return r.center=l.unproject(u.add(c).div(2)),r.zoom=Math.min(l.scaleZoom(l.scale*Math.min(p,f)),r.maxZoom),r.bearing=0,r;t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},r.prototype.fitBounds=function(e,r,i){var n=this.cameraForBounds(e,r);return n?(r=t.extend(n,r)).linear?this.easeTo(r,i):this.flyTo(r,i):this},r.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,n=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(n=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=Ft.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),n&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var i=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var n=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:o,u="bearing"in e?this._normalizeBearing(e.bearing,a):a,c="pitch"in e?+e.pitch:s,h=n.centerPoint.add(t["default"].convert(e.offset)),p=n.pointLocation(h),f=Ft.convert(e.center||p);this._normalizeCenter(f);var d,m,y=n.project(p),v=n.project(f).sub(y),g=n.zoomScale(l-o);return e.around&&(d=Ft.convert(e.around),m=n.locationPoint(d)),this._zooming=l!==o,this._rotating=a!==u,this._pitching=c!==s,this._prepareEase(r,e.
18noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(i._zooming&&(n.zoom=t.number(o,l,e)),i._rotating&&(n.bearing=t.number(a,u,e)),i._pitching&&(n.pitch=t.number(s,c,e)),d)n.setLocationAtPoint(d,m);else{var p=n.zoomScale(n.zoom-o),f=l>o?Math.min(2,g):Math.max(.5,g),_=Math.pow(f,1-e),x=n.unproject(y.add(v.mult(e*_)).mult(p));n.setLocationAtPoint(n.renderWorldCopies?x.wrap():x,h)}i._fireMoveEvents(r)},function(){e.delayEndEvents?i._easeEndTimeoutID=setTimeout(function(){return i._afterEase(r)},e.delayEndEvents):i._afterEase(r)},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},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){var r=this._zooming,i=this._rotating,n=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),i&&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){function i(t){var e=(w*w-b*b+(t?-1:1)*z*z*E*E)/(2*(t?w:b)*z*E);return Math.log(Math.sqrt(e*e+1)-e)}function n(t){return(Math.exp(t)-Math.exp(-t))/2}function o(t){return(Math.exp(t)+Math.exp(-t))/2}var a=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var s=this.transform,l=this.getZoom(),u=this.getBearing(),c=this.getPitch(),h="zoom"in e?t.clamp(+e.zoom,s.minZoom,s.maxZoom):l,p="bearing"in e?this._normalizeBearing(e.bearing,u):u,f="pitch"in e?+e.pitch:c,d=s.zoomScale(h-l),m=s.centerPoint.add(t["default"].convert(e.offset)),y=s.pointLocation(m),v=Ft.convert(e.center||y);this._normalizeCenter(v);var g=s.project(y),_=s.project(v).sub(g),x=e.curve,b=Math.max(s.width,s.height),w=b/d,E=_.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,l,h),s.minZoom,s.maxZoom),T=b/s.zoomScale(S-l);x=Math.sqrt(T/E*2)}var z=x*x,A=i(0),M=function(t){return o(A)/o(A+x*t)},k=function(t){return b*((o(A)*(n(e=A+x*t)/o(e))-n(A))/z)/E;var e},I=(i(1)-A)/x;if(Math.abs(E)<1e-6||!isFinite(I)){if(Math.abs(b-w)<1e-6)return this.easeTo(e,r);var C=w<b?-1:1;I=Math.abs(Math.log(w/b))/x,k=function(){return 0},M=function(t){return Math.exp(C*x*t)}}if("duration"in e)e.duration=+e.duration;else{var L="screenSpeed"in e?+e.screenSpeed/x:+e.speed;e.duration=1e3*I/L}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=u!==p,this._pitching=f!==c,this._prepareEase(r,!1),this._ease(function(e){var i=e*I,n=1/M(i);s.zoom=l+s.scaleZoom(n),a._rotating&&(s.bearing=t.number(u,p,e)),a._pitching&&(s.pitch=t.number(c,f,e));var o=s.unproject(g.add(_.mult(k(i))).mult(n));s.setLocationAtPoint(s.renderWorldCopies?o.wrap():o,m),a._fireMoveEvents(r)},function(){return a._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.default$2.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.default$2.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)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),Gr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Gr.prototype.getDefaultPosition=function(){return"bottom-right"},Gr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=dt.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),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},Gr.prototype.onRemove=function(){dt.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},Gr.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:bt.ACCESS_TOKEN}];if(t){var r=e.reduce(function(t,r,i){return r.value&&(t+=r.key+"="+r.value+(i<e.length-1?"&":"")),t},"?");t.href="https://www.mapbox.com/feedback/"+r+(this._map._hash?this._map._hash.getHashString(!0):"")}},Gr.prototype._updateData=function(t){t&&"metadata"===t.sourceDataType&&(this._updateAttributions(),this._updateEditLink())},Gr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var i in r){var n=r[i].getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution)}t.sort(function(t,e){return t.length-e.length}),(t=t.filter(function(e,r){for(var i=r+1;i<t.length;i++)if(t[i].indexOf(e)>=0)return!1;return!0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},Gr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};
18var Wr=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Wr.prototype.onAdd=function(t){this._map=t,this._container=dt.create("div","mapboxgl-ctrl");var e=dt.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener"),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},Wr.prototype.onRemove=function(){dt.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Wr.prototype.getDefaultPosition=function(){return"bottom-left"},Wr.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Wr.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}},Wr.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var Hr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Hr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Hr.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},Hr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var i=r[e];if(!i.cancelled&&(i.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Hr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Xr=t.default$1.HTMLImageElement,Kr=t.default$1.HTMLElement,Yr={ 19center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Jr=function(e){function r(r){if(null!=(r=t.extend({},Yr,r)).minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i=new Mr(r.minZoom,r.maxZoom,r.renderWorldCopies);e.call(this,i,r),this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._failIfMajorPerformanceCaveat=r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=r.preserveDrawingBuffer,this._trackResize=r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=r.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=r.collectResourceTiming,this._renderTaskQueue=new Hr;var n=r.transformRequest;if(this._transformRequest=n?function(t,e){return n(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof r.container){var o=t.default$1.document.getElementById(r.container);if(!o)throw new Error("Container '"+r.container+"' not found.");this._container=o}else{if(!(r.container instanceof Kr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),void 0!==t.default$1&&(t.default$1.addEventListener("online",this._onWindowOnline,!1),t.default$1.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,n=!1,o=null;
19for(var a in qr)t[a]=new qr[a](t,e),e.interactive&&e[a]&&t[a].enable(e[a]);dt.addEventListener(r,"mouseout",function(e){t.fire(new Cr("mouseout",t,e))}),dt.addEventListener(r,"mousedown",function(i){n=!0,o=dt.mousePos(r,i);var a=new Cr("mousedown",t,i);t.fire(a),a.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))}),dt.addEventListener(r,"mouseup",function(e){var r=t.dragRotate.isActive();i&&!r&&t.fire(new Cr("contextmenu",t,i)),i=null,n=!1,t.fire(new Cr("mouseup",t,e))}),dt.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new Cr("mousemove",t,e))}}),dt.addEventListener(r,"mouseover",function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new Cr("mouseover",t,e))}),dt.addEventListener(r,"touchstart",function(r){var i=new Lr("touchstart",t,r);t.fire(i),i.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(i))},{passive:!1}),dt.addEventListener(r,"touchmove",function(e){t.fire(new Lr("touchmove",t,e))},{passive:!1}),dt.addEventListener(r,"touchend",function(e){t.fire(new Lr("touchend",t,e))}),dt.addEventListener(r,"touchcancel",function(e){t.fire(new Lr("touchcancel",t,e))}),dt.addEventListener(r,"click",function(e){dt.mousePos(r,e).equals(o)&&t.fire(new Cr("click",t,e))}),dt.addEventListener(r,"dblclick",function(e){var r=new Cr("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)}),dt.addEventListener(r,"contextmenu",function(e){var r=t.dragRotate.isActive();n||r?n&&(i=e):t.fire(new Cr("contextmenu",t,e)),e.preventDefault()}),dt.addEventListener(r,"wheel",function(e){var r=new Pr("wheel",t,e);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(e)},{passive:!1})}(this,r),this._hash=r.hash&&(new Ir).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),this.resize(),r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Gr),this.addControl(new Wr,r.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return r.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var r=t.onAdd(this),i=this._controlPositions[e];return-1!==e.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},r.prototype.removeControl=function(t){return t.onRemove(this),this},r.prototype.resize=function(e){var r=this._containerDimensions(),i=r[0],n=r[1];return this._resizeCanvas(i,n),this.transform.resize(i,n),this.painter.resize(i,n),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e))},r.prototype.getBounds=function(){var e=new Vt(this.transform.pointLocation(new t["default"](0,this.transform.height)),this.transform.pointLocation(new t["default"](this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(e.extend(this.transform.pointLocation(new t["default"](this.transform.size.x,0))),e.extend(this.transform.pointLocation(new t["default"](0,this.transform.size.y)))),e},r.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new Vt([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},r.prototype.setMaxBounds=function(t){if(t){var e=Vt.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null==t&&(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},r.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")}
19,r.prototype.getMinZoom=function(){return this.transform.minZoom},r.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update(),this},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.project=function(t){return this.transform.locationPoint(Ft.convert(t))},r.prototype.unproject=function(e){return this.transform.pointLocation(t["default"].convert(e))},r.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},r.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},r.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},r.prototype.on=function(t,r,i){var n,o=this;if(void 0===i)return e.prototype.on.call(this,t,r);var a=function(){if("mouseenter"===t||"mouseover"===t){var e=!1;return{layer:r,listener:i,delegates:{mousemove:function(n){var a=o.getLayer(r)?o.queryRenderedFeatures(n.point,{layers:[r]}):[];a.length?e||(e=!0,i.call(o,new Cr(t,o,n.originalEvent,{features:a}))):e=!1},mouseout:function(){e=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:r,listener:i,delegates:{mousemove:function(e){(o.getLayer(r)?o.queryRenderedFeatures(e.point,{layers:[r]}):[]).length?a=!0:a&&(a=!1,i.call(o,new Cr(t,o,e.originalEvent)))},mouseout:function(e){a&&(a=!1,i.call(o,new Cr(t,o,e.originalEvent)))}}}}return{layer:r,listener:i,delegates:(n={},n[t]=function(t){var e=o.getLayer(r)?o.queryRenderedFeatures(t.point,{layers:[r]}):[];e.length&&(t.features=e,i.call(o,t),delete t.features)},n)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)o.on(s,a.delegates[s]);return this},r.prototype.off=function(t,r,i){if(void 0===i)return e.prototype.off.call(this,t,r);if(this._delegatedListeners&&this._delegatedListeners[t])for(var n=this._delegatedListeners[t],o=0;o<n.length;o++){var a=n[o];if(a.layer===r&&a.listener===i){for(var s in a.delegates)this.off(s,a.delegates[s]);return n.splice(o,1),this}}return this},r.prototype.queryRenderedFeatures=function(e,r){var i;return 2===arguments.length?(e=arguments[0],r=arguments[1]):1===arguments.length&&((i=arguments[0])instanceof t["default"]||Array.isArray(i))?(e=arguments[0],r={}):1===arguments.length?(e=void 0,r=arguments[0]):(e=void 0,r={}),this.style?this.style.queryRenderedFeatures(this._makeQueryGeometry(e),r,this.transform):[]},r.prototype._makeQueryGeometry=function(e){var r,i=this;if(void 0===e&&(e=[t["default"].convert([0,0]),t["default"].convert([this.transform.width,this.transform.height])]),e instanceof t["default"]||"number"==typeof e[0])r=[t["default"].convert(e)];else{var n=[t["default"].convert(e[0]),t["default"].convert(e[1])];r=[n[0],new t["default"](n[1].x,n[0].y),n[1],new t["default"](n[0].x,n[1].y),n[0]]}return{viewport:r,worldCoordinate:r.map(function(t){return i.transform.pointCoordinate(t)})}},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(e,r){if((!r||!1!==r.diff&&!r.localIdeographFontFamily)&&this.style&&e&&"object"==typeof e)try{return this.style.setState(e)&&this._update(!0),this}catch(e){t.warnOnce("Unable to perform style diff: "+(e.message||e.error||e)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new pr(this,r||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},r.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];return void 0!==r?r.loaded():void this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(e,r,i){void 0===i&&(i={});var n=i.pixelRatio;void 0===n&&(n=1);var o=i.sdf;if(void 0===o&&(o=!1),r instanceof Xr){var a=t.default$2.getImageData(r),s=a.width,l=a.height,u=a.data;this.style.addImage(e,{data:new t.RGBAImage({width:s,height:l},u),pixelRatio:n,sdf:o})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r.width,h=r.height,p=r.data;this.style.addImage(e,{data:new t.RGBAImage({width:c,height:h},new Uint8Array(p)),pixelRatio:n,sdf:o})}},r.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(e,r){t.getImage(this._transformRequest(e,t.ResourceType.Image),r)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},r.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},r.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},r.prototype.getLayer=function(t){return this.style.getLayer(t)},r.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},r.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,r){return this.style.setPaintProperty(t,e,r),this._update(!0),this},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){this.style.setFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.default$1.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described
19in https://www.mapbox.com/mapbox-gl-js/api/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=dt.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=dt.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=dt.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=this._controlContainer=dt.create("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=dt.create("div","mapboxgl-ctrl-"+t,i)})},r.prototype._resizeCanvas=function(e,r){var i=t.default$1.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},r.prototype._setupPainter=function(){var e=t.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},ft.webGLContextAttributes),r=this._canvas.getContext("webgl",e)||this._canvas.getContext("experimental-webgl",e);r?this.painter=new Ar(r,this.transform):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(e){e.preventDefault(),this._frameId&&(t.default$2.cancelFrame(this._frameId),this._frameId=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},r.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},r.prototype._update=function(t){this.style&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender())},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(){this._renderTaskQueue.run();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var r=this.transform.zoom,i=t.default$2.now();this.style.zoomHistory.update(r,i);var n=new t.default$23(r,{now:i,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=n.crossFadingFactor();1===o&&o===this._crossFadingFactor||(e=!0,this._crossFadingFactor=o),this.style.update(n)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty)&&this._rerender(),this},r.prototype.remove=function(){this._hash&&this._hash.remove(),t.default$2.cancelFrame(this._frameId),this._renderTaskQueue.clear(),this._frameId=null,this.setStyle(null),void 0!==t.default$1&&(t.default$1.removeEventListener("resize",this._onWindowResize,!1),t.default$1.removeEventListener("online",this._onWindowOnline,!1));var e=this.painter.context.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),st(this._canvasContainer),st(this._controlContainer),st(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},r.prototype._rerender=function(){var e=this;this.style&&!this._frameId&&(this._frameId=t.default$2.frame(function(){e._frameId=null,e._render()}))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},i.showTileBoundaries.get=function(){return!!this._showTileBoundaries},i.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},i.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},i.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},i.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},i.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},i.repaint.get=function(){return!!this._repaint},i.repaint.set=function(t){this._repaint=t,this._update()},i.vertices.get=function(){return!!this._vertices}
19,i.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._onData=function(e){this._update("style"===e.dataType),this.fire(new t.Event(e.dataType+"data",e))},r.prototype._onDataLoading=function(e){this.fire(new t.Event(e.dataType+"dataloading",e))},Object.defineProperties(r.prototype,i),r}(Zr),Qr={showCompass:!0,showZoom:!0},ti=function(e){var r=this;this.options=t.extend({},Qr,e),this._container=dt.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return r._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return r._map.zoomOut()})),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return r._map.resetNorth()}),this._compassArrow=dt.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};ti.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},ti.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Or(t,{button:"left",element:this._compass}),dt.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},ti.prototype.onRemove=function(){dt.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),dt.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map},ti.prototype._createButton=function(t,e,r){var i=dt.create("button",t,this._container);return i.type="button",i.setAttribute("aria-label",e),i.addEventListener("click",r),i};var ei,ri={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},ii=function(e){function r(r){if(e.call(this),(arguments[0]instanceof t.default$1.HTMLElement||2===arguments.length)&&(r=t.extend({element:r},arguments[1])),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",r&&r.element)this._element=r.element,this._offset=t["default"].convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=dt.create("div");var i=dt.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var n=dt.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");var o=dt.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");var a=dt.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(var s=0,l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];s<l.length;s+=1){var u=l[s],c=dt.createNS("http://www.w3.org/2000/svg","ellipse");c.setAttributeNS(null,"opacity","0.04"),c.setAttributeNS(null,"cx","10.5"),c.setAttributeNS(null,"cy","5.80029008"),c.setAttributeNS(null,"rx",u.rx),c.setAttributeNS(null,"ry",u.ry),a.appendChild(c)}var h=dt.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill",this._color);var p=dt.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),h.appendChild(p);var f=dt.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");var d=dt.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(d);var m=dt.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");var y=dt.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=dt.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var g=dt.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#FFFFFF"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962"),y.appendChild(v),y.appendChild(g),o.appendChild(a),o.appendChild(h),o.appendChild(f),o.appendChild(m),o.appendChild(y),i.appendChild(o),this._element.appendChild(i),this._offset=t["default"].convert(r&&r.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._popup=null}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},r.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),delete this._map),dt.remove(this._element),this._popup&&this._popup.remove(),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=Ft.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
190,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=lt(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),dt.setTransform(this._element,ri[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"),ut(this._element,this._anchor,"marker"))},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t["default"].convert(e),this._update(),this},r.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r}(t.Evented),ni={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},oi=function(e){function r(r){e.call(this),this.options=t.extend({},ni,r),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=dt.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==ei?r(ei):void 0!==t.default$1.navigator.permissions?t.default$1.navigator.permissions.query({name:"geolocation"}).then(function(t){ei="denied"!==t.state,r(ei)}):(ei=!!t.default$1.navigator.geolocation,r(ei)),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.default$1.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),dt.remove(this._container),this._map=void 0},r.prototype._onSuccess=function(e){if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},r.prototype._updateCamera=function(t){var e=new Ft(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy; 20this._map.fitBounds(e.toBounds(r),this.options.fitBoundsOptions,{geolocateSource:!0})},r.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.co
20ords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},r.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;!1!==e&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=dt.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=dt.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new ii(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;
20case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.default$1.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.default$1.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){t.default$1.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},r}(t.Evented),ai={maxWidth:100,unit:"metric"},si=function(e){this.options=t.extend({},ai,e),t.bindAll(["_onMove","setUnit"],this)};si.prototype.getDefaultPosition=function(){return"bottom-left"},si.prototype._onMove=function(){ct(this._map,this._container,this.options)},si.prototype.onAdd=function(t){return this._map=t,this._container=dt.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},si.prototype.onRemove=function(){dt.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},si.prototype.setUnit=function(t){this.options.unit=t,ct(this._map,this._container,this.options)};var li=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.default$1.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.default$1.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.default$1.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.default$1.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};li.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=dt.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},li.prototype.onRemove=function(){dt.remove(this._container),this._map=null,t.default$1.document.removeEventListener(this._fullscreenchange,this._changeIcon)},li.prototype._checkFullscreenSupport=function(){return!!(t.default$1.document.fullscreenEnabled||t.default$1.document.mozFullScreenEnabled||t.default$1.document.msFullscreenEnabled||t.default$1.document.webkitFullscreenEnabled)},li.prototype._setupUI=function(){var e=this._fullscreenButton=dt.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.default$1.document.addEventListener(this._fullscreenchange,this._changeIcon)},li.prototype._isFullscreen=function(){return this._fullscreen},li.prototype._changeIcon=function(){(t.default$1.document.fullscreenElement||t.default$1.document.mozFullScreenElement||t.default$1.document.webkitFullscreenElement||t.default$1.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},li.prototype._onClickFullscreen=function(){this._isFullscreen()?t.default$1.document.exitFullscreen?t.default$1.document.exitFullscreen():t.default$1.document.mozCancelFullScreen?t.default$1.document.mozCancelFullScreen():t.default$1.document.msExitFullscreen?t.default$1.document.msExitFullscreen():t.default$1.document.webkitCancelFullScreen&&t.default$1.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};var ui={closeButton:!0,closeOnClick:!0,className:""},ci=function(e){function r(r){e.call(this),this.options=t.extend(Object.create(ui),r),t.bindAll(["_update","_onClickClose"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&dt.remove(this._content),this._container&&(dt.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=Ft.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.default$1.document.createTextNode(e))},r.prototype.setHTML=function(e){var r,i=t.default$1.document.createDocumentFragment(),n=t.default$1.document.createElement("body");for(n.innerHTML=e;r=n.firstChild;)i.appendChild(r);return this.setDOMContent(i)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&dt.remove(this._content),this._content=dt.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=dt.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(){var e=this;if(this._map&&this._lngLat&&this._content){this._container||(this._container=dt.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=dt.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return e._container.classList.add(t)}
20)),this._map.transform.renderWorldCopies&&(this._lngLat=lt(this._lngLat,this._pos,this._map.transform));var r=this._pos=this._map.project(this._lngLat),i=this.options.anchor,n=function u(e){if(e){if("number"==typeof e){var r=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t["default"](0,0),top:new t["default"](0,e),"top-left":new t["default"](r,r),"top-right":new t["default"]((-r),r),bottom:new t["default"](0,(-e)),"bottom-left":new t["default"](r,(-r)),"bottom-right":new t["default"]((-r),(-r)),left:new t["default"](e,0),right:new t["default"]((-e),0)}}if(e instanceof t["default"]||Array.isArray(e)){var i=t["default"].convert(e);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t["default"].convert(e.center||[0,0]),top:t["default"].convert(e.top||[0,0]),"top-left":t["default"].convert(e["top-left"]||[0,0]),"top-right":t["default"].convert(e["top-right"]||[0,0]),bottom:t["default"].convert(e.bottom||[0,0]),"bottom-left":t["default"].convert(e["bottom-left"]||[0,0]),"bottom-right":t["default"].convert(e["bottom-right"]||[0,0]),left:t["default"].convert(e.left||[0,0]),right:t["default"].convert(e.right||[0,0])}}return u(new t["default"](0,0))}(this.options.offset);if(!i){var o,a=this._container.offsetWidth,s=this._container.offsetHeight;o=r.y+n.bottom.y<s?["top"]:r.y>this._map.transform.height-s?["bottom"]:[],r.x<a/2?o.push("left"):r.x>this._map.transform.width-a/2&&o.push("right"),i=0===o.length?"bottom":o.join("-")}var l=r.add(n[i]).round();dt.setTransform(this._container,ri[i]+" translate("+l.x+"px,"+l.y+"px)"),ut(this._container,i,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),hi={version:"0.46.0",supported:ft,workerCount:Math.max(Math.floor(t.default$2.hardwareConcurrency/2),1),setRTLTextPlugin:t.setRTLTextPlugin,Map:Jr,NavigationControl:ti,GeolocateControl:oi,AttributionControl:Gr,ScaleControl:si,FullscreenControl:li,Popup:ci,Marker:ii,Style:pr,LngLat:Ft,LngLatBounds:Vt,Point:t["default"],Evented:t.Evented,config:bt,get accessToken(){return bt.ACCESS_TOKEN},set accessToken(t){bt.ACCESS_TOKEN=t},workerUrl:""};return hi}),i}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.geoViewport=t()}}(function(){return function t(e,r,i){function n(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return n(r||t)},c,c.exports,t,e,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,r){function i(t){return t=t||256,l[t]||(l[t]=new s({size:t})),l[t]}function n(t,e,r){var i=Math.min(t-Math.log(e[0])/Math.log(2),t-Math.log(e[1])/Math.log(2));return r?i:Math.floor(i)}function o(t,e,r,o,a,s){r=void 0===r?0:r,o=void 0===o?20:o;var l=i(a),u=o,c=l.px([t[0],t[1]],u),h=l.px([t[2],t[3]],u),p=h[0]-c[0],f=c[1]-h[1],d=[p/e[0],f/e[1]],m=[(t[0]+t[2])/2,(t[1]+t[3])/2],y=n(u,d,s);return{center:m,zoom:Math.max(r,Math.min(o,y))}}function a(t,e,r,n){void 0!==t.lon&&(t=[t.lon,t.lat]);var o=i(n),a=o.px(t,e),s=o.ll([a[0]-r[0]/2,a[1]-r[1]/2],e),l=o.ll([a[0]+r[0]/2,a[1]+r[1]/2],e);return[s[0],l[1],l[0],s[1]]}var s=t("@mapbox/sphericalmercator"),l={};e.exports.viewport=o,e.exports.bounds=a},{"@mapbox/sphericalmercator":2}],2:[function(t,e,r){var i=function(){function t(t){return Number(t)===t&&t%1!=0}function e(t){if(t=t||{},this.size=t.size||256,!r[this.size]){var e=this.size,i=r[this.size]={};i.Bc=[],i.Cc=[],i.zc=[],i.Ac=[];for(var n=0;n<30;n++)i.Bc.push(e/360),i.Cc.push(e/(2*Math.PI)),i.zc.push(e/2),i.Ac.push(e),e*=2}this.Bc=r[this.size].Bc,this.Cc=r[this.size].Cc,this.zc=r[this.size].zc,this.Ac=r[this.size].Ac}var r={},i=Math.PI/180,n=180/Math.PI,o=6378137,a=20037508.342789244;return e.prototype.px=function(e,r){if(t(r)){var n=this.size*Math.pow(2,r),o=n/2,a=n/360,s=n/(2*Math.PI),l=n,u=Math.min(Math.max(Math.sin(i*e[1]),-.9999),.9999),c=o+e[0]*a,h=o+.5*Math.log((1+u)/(1-u))*-s;return c>l&&(c=l),h>l&&(h=l),[c,h]}var o=this.zc[r],u=Math.min(Math.max(Math.sin(i*e[1]),-.9999),.9999),c=Math.round(o+e[0]*this.Bc[r]),h=Math.round(o+.5*Math.log((1+u)/(1-u))*-this.Cc[r]);return c>this.Ac[r]&&(c=this.Ac[r]),h>this.Ac[r]&&(h=this.Ac[r]),[c,h]},e.prototype.ll=function(e,r){if(t(r)){var i=this.size*Math.pow(2,r),o=i/360,a=i/(2*Math.PI),s=i/2,l=(e[1]-s)/-a,u=(e[0]-s)/o,c=n*(2*Math.atan(Math.exp(l))-.5*Math.PI);return[u,c]}var l=(e[1]-this.zc[r])/-this.Cc[r],u=(e[0]-this.zc[r])/this.Bc[r],c=n*(2*Math.atan(Math.exp(l))-.5*Math.PI);return[u,c]},e.prototype.bbox=function(t,e,r,i,n){i&&(e=Math.pow(2,r)-1-e);var o=[t*this.size,(+e+1)*this.size],a=[(+t+1)*this.size,e*this.size],s=this.ll(o,r).concat(this.ll(a,r));return"900913"===n?this.convert(s,"900913"):s},e.prototype.xyz=function(t,e,r,i){"900913"===i&&(t=this.convert(t,"WGS84"));var n=[t[0],t[1]],o=[t[2],t[3]],a=this.px(n,e),s=this.px(o,e),l=[Math.floor(a[0]/this.size),Math.floor((s[0]-1)/this.size)],u=[Math.floor(s[1]/this.size),Math.floor((a[1]-1)/this.size)],c={minX:Math.min.apply(Math,l)<0?0:Math.min.apply(Math,l),minY:Math.min.apply(Math,u)<0?0:Math.min.apply(Math,u),maxX:Math.max.apply(Math,l),maxY:M
20ath.max.apply(Math,u)};if(r){var h={minY:Math.pow(2,e)-1-c.maxY,maxY:Math.pow(2,e)-1-c.minY};c.minY=h.minY,c.maxY=h.maxY}return c},e.prototype.convert=function(t,e){return"900913"===e?this.forward(t.slice(0,2)).concat(this.forward(t.slice(2,4))):this.inverse(t.slice(0,2)).concat(this.inverse(t.slice(2,4)))},e.prototype.forward=function(t){var e=[o*t[0]*i,o*Math.log(Math.tan(.25*Math.PI+.5*t[1]*i))];return e[0]>a&&(e[0]=a),e[0]<-a&&(e[0]=-a),e[1]>a&&(e[1]=a),e[1]<-a&&(e[1]=-a),e},e.prototype.inverse=function(t){return[t[0]*n/o,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/o)))*n]},e}();void 0!==e&&void 0!==r&&(e.exports=r=i)},{}]},{},[1])(1)}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.geojsonExtent=t()}}(function(){return function t(e,r,i){function n(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return n(r?r:t)},c,c.exports,t,e,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e){function r(t){for(var e=o(),r=i(t),n=0;n<r.length;n++)e.include(r[n]);return e}var i=t("geojson-coords"),n=t("traverse"),o=t("extent"),a=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Feature","FeatureCollection","GeometryCollection"];e.exports=function(t){return r(t).bbox()},e.exports.polygon=function(t){return r(t).polygon()},e.exports.bboxify=function(t){return n(t).map(function(t){t&&-1!==typeof a.indexOf(t.type)&&(console.log(t.type,t),t.bbox=r(t).bbox(),this.update(t))})}},{extent:2,"geojson-coords":4,traverse:7}],2:[function(t,e){function r(){return this instanceof r?(this._bbox=[1/0,1/0,-(1/0),-(1/0)],void(this._valid=!1)):new r}e.exports=r,r.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},r.prototype.union=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[2]),this._bbox[3]=Math.max(this._bbox[3],t[3]),this},r.prototype.bbox=function(){return this._valid?this._bbox:null},r.prototype.contains=function(t){return this._valid?this._bbox[0]<=t[0]&&this._bbox[1]<=t[1]&&this._bbox[2]>=t[0]&&this._bbox[3]>=t[1]:null},r.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null}},{}],3:[function(t,e){e.exports=function(t){function e(t){return Array.isArray(t)&&t.length&&"number"==typeof t[0]?[t]:t.reduce(function(t,r){return Array.isArray(r)&&Array.isArray(r[0])?t.concat(e(r)):(t.push(r),t)},[])}return e(t)}},{}],4:[function(t,e){var r=t("geojson-normalize"),i=t("geojson-flatten"),n=t("./flatten");e.exports=function(t){if(!t)return[];var e=i(r(t)),o=[];return e.features.forEach(function(t){t.geometry&&(o=o.concat(n(t.geometry.coordinates)))}),o}},{"./flatten":3,"geojson-flatten":5,"geojson-normalize":6}],5:[function(t,e){function r(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce(function(t,e){return t.concat(r(e))},[]),t;case"Feature":return r(t.geometry).map(function(e){return{type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e}});case"MultiPoint":return t.coordinates.map(function(t){return{type:"Point",coordinates:t}});case"MultiPolygon":return t.coordinates.map(function(t){return{type:"Polygon",coordinates:t}});case"MultiLineString":return t.coordinates.map(function(t){return{type:"LineString",coordinates:t}});case"GeometryCollection":return t.geometries;case"Point":case"Polygon":case"LineString":return[t];default:return t}}e.exports=r},{}],6:[function(t,e){function r(t){if(!t||!t.type)return null;var e=i[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null}e.exports=r;var i={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},{}],7:[function(t,e){function r(t){this.value=t}function i(t,e,r){var i=[],o=[],a=!0;return function s(t){function l(){if("object"==typeof p.node&&null!==p.node){p.keys&&p.node_===p.node||(p.keys=f(p.node)),p.isLeaf=0==p.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===t){p.circular=o[e];break}}else p.isLeaf=!0,p.keys=null;p.notLeaf=!p.isLeaf,p.notRoot=!p.isRoot}var u=r?n(t):t,c={},h=!0,p={node:u,node_:t,path:[].concat(i),parent:o[o.length-1],parents:o,key:i.slice(-1)[0],isRoot:0===i.length,level:i.length,circular:null,update:function(t,e){p.isRoot||(p.parent.node[p.key]=t),p.node=t,e&&(h=!1)},"delete":function(t){delete p.parent.node[p.key],t&&(h=!1)},remove:function(t){d(p.parent.node)?p.parent.node.splice(p.key,1):delete p.parent.node[p.key],t&&(h=!1)},keys:null,before:function(t){c.before=t},after:function(t){c.after=t},pre:function(t){c.pre=t},post:function(t){c.post=t},stop:function(){a=!1},block:function(){h=!1}};if(!a)return p;l();var v=e.call(p,p.node);return void 0!==v&&p.update&&p.update(v),c.before&&c.before.call(p,p.node),h?("object"!=typeof p.node||null===p.node||p.circular||(o.push(p),l(),m(p.keys,function(t,e){i.push(t),c.pre&&c.pre.call(p,p.node[t],t);var n=s(p.node[t]);r&&y.call(p.node,t)&&(p.node[t]=n.node),n.isLast=e==p.keys.length-1,n.isFirst=0==e,c.post&&c.post.call(p,n),i.pop()}),o.pop()),c.after&&c.after.call(p,p.node),p):p}(t).node}function n(t){if("object"==typeof t&&null!==t){var e;if(d(t))e=[];else if(a(t))e=new Date(t.getTime?t.getTime():t);else if(s(t))e=new RegExp(t);else if(l(t))e={message:t.message};else if(u(t))e=new Boolean(t);else if(c(t))e=new Number(t);else if(h(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var r=t.constructor&&t.constructor.prototype||t.__proto__||{},i=function(){};i.prototype=r,e=new i}return m(f(t),function(r){e[r]=t[r]}),e}return t}function o(t){return Object.prototype.toString.call(t)}function a(t){return"[object Date]"===o(t)}function s(t){return"[object RegExp]"===o(t)}function l(t){return"[object Error]"===o(t)}function u(t){return"[object Boolean]"===o(t)}function c(t){return"[object Number]"===o(t)}function h(t){return"[object String]"===o(t)}var p=e.exports=function(t){return new r(t)};r.prototype.get=function(t){for(var e=this.value,r=0;r<t.length;r++){var i=t[r];
20if(!e||!y.call(e,i)){e=void 0;break}e=e[i]}return e},r.prototype.has=function(t){for(var e=this.value,r=0;r<t.length;r++){var i=t[r];if(!e||!y.call(e,i))return!1;e=e[i]}return!0},r.prototype.set=function(t,e){for(var r=this.value,i=0;i<t.length-1;i++){var n=t[i];y.call(r,n)||(r[n]={}),r=r[n]}return r[t[i]]=e,e},r.prototype.map=function(t){return i(this.value,t,!0)},r.prototype.forEach=function(t){return this.value=i(this.value,t,!1),this.value},r.prototype.reduce=function(t,e){var r=1===arguments.length,i=r?this.value:e;return this.forEach(function(e){this.isRoot&&r||(i=t.call(this,i,e))}),i},r.prototype.paths=function(){var t=[];return this.forEach(function(){t.push(this.path)}),t},r.prototype.nodes=function(){var t=[];return this.forEach(function(){t.push(this.node)}),t},r.prototype.clone=function(){var t=[],e=[];return function r(i){for(var o=0;o<t.length;o++)if(t[o]===i)return e[o];if("object"==typeof i&&null!==i){var a=n(i);return t.push(i),e.push(a),m(f(i),function(t){a[t]=r(i[t])}),t.pop(),e.pop(),a}return i}(this.value)};var f=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},m=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)};m(f(r.prototype),function(t){p[t]=function(e){var i=[].slice.call(arguments,1),n=new r(e);return n[t].apply(n,i)}});var y=Object.hasOwnProperty||function(t,e){return e in t}},{}]},{},[1])(1)}),"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var analyticsCategory={select:"Select Store",directions:"Get Directions",email:"Email Store",call:"Call Store"},analyticsEvent={click:"Click"},doubleClick=!1,recordAnalyticsEvent=function(t,e,r){t==analyticsCategory.select&&0!=doubleClick||(doubleClick=!0,record(t,e,r),setTimeout(function(){doubleClick=!1},200))},record=function(t,e,r){"undefined"!=typeof _gaq?_gaq.push(["_trackEvent",t,e,r]):"undefined"!=typeof pageTracker&&pageTracker._trackEvent(t,e,r)},directionsTracking="",emailTracking="",phoneTracking="",emailLink="",currentFeature=[],nameLink="",storeDetailsLink="",stores=[],locationIds=[],widgetLocator=function(){$(".seSingleStoreMap").each(function(){mapboxgl.accessToken=$(this).data("key"),mapLongitude=$(this).data("long"),mapLatitude=$(this).data("lat"),mapContainer=$(this).attr("id");var t=new mapboxgl.Map({container:mapContainer,style:"mapbox://styles/smartetailing/cjkcpthxmce2f2sqklxdhmpod",center:[mapLongitude,mapLatitude],zoom:13,attributionControl:!1});t.addControl(new mapboxgl.AttributionControl({compact:!0}));var e=document.createElement("div");e.id="marker-"+mapContainer,e.className="marker",e.innerHTML='<span class="seIcon seLocationIcon"></span>',new mapboxgl.Marker(e,{offset:[0,-23]}).setLngLat([mapLongitude,mapLatitude]).addTo(t)})},seStoreLocator=function(){$.ajax({type:"GET",url:"/webservices/ajax/storelocator.cfc?method=getGeojson",dataType:"json",cache:!1,success:function(t){"undefined"!=typeof t&&(stores=t)},error:function(t,e){$(settings.listDiv).css("display","block"),throwWsm(),Map.canEventFire=!0}}).done(function(){function t(t){function e(e){if("undefined"!=typeof e&&""!=e)for(userLocationLat=e.coords.latitude,userLocationLong=e.coords.longitude,i=0;i<t.features.length;i++){var r=t.features[i],n=r.properties,o=r.geometry.coordinates,a=getDistance(userLocationLat,userLocationLong,o[1],o[0]);n.distance=a}}navigator.geolocation.getCurrentPosition(e)}function e(t){for(i=0;i<t.features.length;i++)if(1===t.features[i].properties.ipickup){var e=t.features[i],r=e.properties;locationIds.push(r.id);var o=document.getElementById("sestoreslist");if(null!=o){var a=o.appendChild(document.createElement("li"));a.dataPosition=i,a.className="sestorelocatorstore",a.id="seMarkerId-"+r.id;var s=a.appendChild(document.createElement("div"));s.className="seTitle",s.innerHTML=r.descriptor;var l=a.appendChild(document.createElement("div"));l.className="storePickUpDate inventory-status",l.id="storePickUpDate"+r.id;var u=a.appendChild(document.createElement("div"));
20u.className="collapse",u.id="storeDetailsCollapse"+r.id;var c=u.appendChild(document.createElement("ul"));if("undefined"!=typeof r.hours&&""!==r.hours.toString()){var h=c.appendChild(document.createElement("li"));h.className="sestorehours",h.innerHTML=r.hours}var p=c.appendChild(document.createElement("li"));if("undefined"!=typeof r.address_1&&""!==r.address_1.toString()&&(p.innerHTML=r.address_1),"undefined"!=typeof r.address_2&&""!==r.address_2.toString()){var f=c.appendChild(document.createElement("li"));f.innerHTML=r.address_2}var d=c.appendChild(document.createElement("li"));if("undefined"!=typeof r.city&&""!==r.city.toString()&&"undefined"!=typeof r.state&&""!==r.state.toString()&&"undefined"!=typeof r.zip&&""!==r.zip.toString()&&(d.innerHTML=r.city+", "+r.state+" "+r.zip),"undefined"!=typeof r.phone&&""!==r.phone.toString()){var m=c.appendChild(document.createElement("li"));m.className="sephoneline",m.innerHTML=r.phone;var y=c.appendChild(document.createElement("li"));y.className="sephonelinemobile",y.innerHTML+='<a href="tel:+1'+r.phone+'" onclick="'+phoneTracking+'" class="inline seClickCall">'+r.phone+"</a>"}directionsTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.directions+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');",emailTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.email+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');",phoneTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.phone+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');";var v=a.appendChild(document.createElement("div"));v.className="storedetailsDiv",$(".seShoppingCart").length?v.innerHTML='<a class="storedetailsAnchor" data-parent="#sestoreslist" data-toggle="collapse" href="#storeDetailsCollapse'+r.id+'">+ Store Details</a><button class="detailsButton btn btn-default pull-right" data-name="'+r.descriptor+'" data-id="'+r.id+'">Pick up Here</button>':v.innerHTML='<a class="storedetailsAnchor" data-parent="#sestoreslist" data-toggle="collapse" href="#storeDetailsCollapse'+r.id+'">+ Store Details</a><button class="detailsButton btn btn-default pull-right" data-name="'+r.descriptor+'" data-id="'+r.id+'">Add to Cart</button>',$(a).on("click",function(e){var r=t.features[this.dataPosition];n(r),$(".sestorelocatorstore.active").removeClass("active"),$(this).addClass("active"),e.preventDefault()})}}$(".seShoppingCart").length&&$.getAvailabilityDatesForModal(shipMethodId,locationIds),$(".seItemDetails").length&&$.addAvailabilityDates()}function r(t){for(i=0;i<t.features.length;i++){var e=t.features[i],r=e.properties,a=document.getElementById("sestoreslist");if(null!=a){var s=a.appendChild(document.createElement("li"));s.dataPosition=i,s.className="sestorelocatorstore",s.id="seMarkerId-"+r.id;var l=s.appendChild(document.createElement("div"));l.className="seTitle",l.innerHTML=r.descriptor;var u=s.appendChild(document.createElement("div"));u.innerHTML="<div>"+r.address_1+"</div>",u.className="seStoreAddress","undefined"!=typeof r.address_2&&""!==r.address_2.toString()&&(u.innerHTML+="<div>"+r.address_2+"</div>"),directionsTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.directions+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');",emailTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.email+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');",phoneTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.phone+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');";var c="http://maps.google.com/maps?daddr=";if(r.displayUsingGPS)r.directionsLink=c+escape(e.geometry.coordinates[1]+","+e.geometry.coordinates[0]);else{var h=r.address_1+" "+r.address_2+", "+r.city+", "+r.state+" "+r.zip;r.directionsLink=c+escape(h)}emailLink="","undefined"!=typeof r.emailformurl&&""!==r.emailformurl.toString()?emailLink=r.emailformurl:"undefined"!=typeof r.email&&""!==r.email.toString()&&(emailLink="mailto:"+r.email); 21var f='<div class="sestoreactions"><a href="'+r.directionsLink+'&z=10" onclick="'+directionsTracking+'" target="_blank" class="getDirections inline">Get Directions</a>',d="";"undefined"!=typeof emailLink&&""!==emailLink.toString()&&(d=' | <a href="'+emailLink+'" onclick="'+emailTracking+'">Email</a>'),u.innerHTML+=f+d,storeDetailsLink="undefined"!=typeof r.map_templateurl&&""!==r.map_templateurl.toString()?'<a href="'+r.map_templateurl+'">Store Details</a>':"",""!=storeDetailsLink&&(u.innerHTML+=storeDetailsLink),"undefined"!=typeof r.ph
21one&&""!==r.phone.toString()&&(u.innerHTML+='<div class="sephoneline">'+r.phone+"</div>",u.innerHTML+='<div class="sephonelinemobile"><a href="tel:+1'+r.phone+'" onclick="'+phoneTracking+'" class="inline seClickCall">'+r.phone+"</a></div>"),r.hours&&(u.innerHTML+='<div class="sestorehours">'+r.hours+"</div>"),$(s).find("a").on("click",function(t){t.stopPropagation()}),$(s).on("click",function(e){var r=t.features[this.dataPosition];n(r),o(r),$(".sestorelocatorstore.active").removeClass("active"),$(this).addClass("active"),e.preventDefault()})}else e=t.features[0],o(e),p.setZoom(15)}}function n(t){p.flyTo({center:t.geometry.coordinates,zoom:15})}function o(t){var e=document.getElementsByClassName("mapboxgl-popup"),r=t.properties;e[0]&&e[0].remove(),directionsTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.directions+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');",emailTracking="javascript:recordAnalyticsEvent('"+analyticsCategory.email+"', '"+analyticsEvent.click+"', '"+r.descriptor+"');";var i="http://maps.google.com/maps?daddr=";if(r.displayUsingGPS)r.directionsLink=i+escape(t.geometry.coordinates[1]+","+t.geometry.coordinates[0]);else{var n=r.address_1+" "+r.address_2+", "+r.city+", "+r.state+" "+r.zip;r.directionsLink=i+escape(n)}nameLink="undefined"!=typeof r.map_templateurl&&""!==r.map_templateurl.toString()?'<a href="'+r.map_templateurl+'">'+r.descriptor+"</a>":"<div>"+r.descriptor+"</div>",emailLink="","undefined"!=typeof r.emailformurl&&""!==r.emailformurl.toString()?emailLink=r.emailformurl:"undefined"!=typeof r.email&&""!==r.email.toString()&&(emailLink="mailto:"+r.email);var o=new mapboxgl.Popup({closeOnClick:!1}).setLngLat(t.geometry.coordinates);"undefined"!=typeof r.address_1&&""!==r.address_1.toString()?address1HTML='<div class="seaddressline">'+r.address_1+"</div>":address1HTML="","undefined"!=typeof r.address_2&&""!==r.address_2.toString()?address2HTML='<div class="seaddressline">'+r.address_2+"</div>":address2HTML="","undefined"!=typeof r.address_2&&""!==r.address_2.toString()?address2HTML='<div class="seaddressline">'+r.address_2+"</div>":address2HTML="","undefined"!=typeof r.city&&""!==r.city.toString()?cityHTML=r.city+", ":cityHTML="","undefined"!=typeof r.state&&""!==r.state.toString()?stateHTML=r.state+", ":stateHTML="","undefined"!=typeof r.zip?zipHTML=r.zip:zipHTML="";var a='<div class="seaddressline">'+cityHTML+stateHTML+zipHTML+"</div>";if("undefined"!=typeof r.directionsLink&&""!==r.directionsLink.toString()&&"undefined"!=typeof directionsTracking&&""!==directionsTracking.toString())var s='<a href="'+r.directionsLink+'&z=10" onclick="'+directionsTracking+'" target="_blank" class="getDirections inline">Get Directions</a>';else s="";if(emailLink="","undefined"!=typeof r.emailformurl&&""!==r.emailformurl.toString()?emailLink=r.emailformurl:"undefined"!=typeof r.email&&""!==r.email.toString()&&(emailLink="mailto:"+r.email),""!==emailLink?emailHTML=' | <a href="'+emailLink+'" onclick="'+emailTracking+'">Email</a>':emailHTML="",""!==s||""!==emailLink)var l='<div class="sestoreactions">'+s+emailHTML+"</div>";else l="";"undefined"!=typeof r.phone&&""!==r.phone.toString()?phoneHTML='<div class="sephoneline">'+r.phone+"</div>":phoneHTML="","undefined"!=typeof r.hours&&""!==r.hours.toString()?hoursHTML='<div class="sestorehours">'+r.hours+"</div>":hoursHTML="",o.setHTML('<div class="sestorename">'+nameLink+"</div>"+address1HTML+address2HTML+a+l+phoneHTML+hoursHTML).addTo(p)}var a=stores,s=document.getElementById("map").getBoundingClientRect(),l=geojsonExtent(a),u=new mapboxgl.LngLatBounds(l),c=[s.height,s.width],h=geoViewport.viewport(l,c);mapboxgl.accessToken=$("#map").data("key");var p=new mapboxgl.Map({container:"map",style:"mapbox://styles/smartetailing/cjkcpthxmce2f2sqklxdhmpod",center:h.center,zoom:h.zoom,attributionControl:!1});p.fitBounds(u,{padding:50,duration:0}),p.addControl(new mapboxgl.AttributionControl({compact:!0}));var f=new mapboxgl.NavigationControl;p.addControl(f,"top-left");var d=[];if(stores.features.forEach(function(t,e){if($(".seLocationPage").length||($(".seShoppingCart").length||$(".seItemDetails").length)&&1===t.properties.ipickup){var r=document.createElement("div");r.id="marker-"+stores.features[e].properties.id,r.className="marker",r.innerHTML='<span class="seIcon seLocationIcon"></span>',new mapboxgl.Marker(r,{offset:[0,-23]}).setLngLat(t.geometry.coordinates).addTo(p),r.addEventListener("click",function(r){n(t),$(".seLocationPage").length&&o(t);document.getElementsByClassName("active");r.stopPropagation(),$(".sestorelocatorstore.active").removeClass("active");
21var i=$("#seMarkerId-"+stores.features[e].properties.id);i.length&&$(i).addClass("active");var a=$("#sestorelocatorlocationlist").height(),s=$(".sestorelocatorstore.active").position().top,l=$(".sestorelocatorstore.active").height(),u=s-(a-l)/2;$("#sestorelocatorlocationlist").scrollTop(u)}),d.push(t)}}),d.length>1){var l=new mapboxgl.LngLatBounds;$(d).each(function(){var t=$(this);l.extend(t[0].geometry.coordinates)})}$(".seLocationPage").length&&navigator.geolocation&&stores.features.length>1?(t(stores),stores.features.sort(function(t,e){return t.properties.distance>e.properties.distance?1:t.properties.distance<e.properties.distance?-1:0}),r(stores)):$(".seLocationPage").length?r(stores):e(stores),p.on("load",function(t){p.addSource("places",{type:"geojson",data:stores})})}),$("#seLoader").fadeOut("slow",function(){$(this).remove()})};$(".seSingleStoreMap").length?widgetLocator():seStoreLocator();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.