text: var mapboxgl=function(){"use strict";var t=e;function e(t,e){this.x=t,this.y=e}function r(t,e,r){return Math.min(r,Math.max(e,t))}function n(t){var e=[];for(var r in t)e.push(t[r]);return e}function i(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}function o(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function a(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function s(t,e){return-1!==t.indexOf(e,t.length-e.length)}function u(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function l(t){return Array.isArray(t)?t.map(l):"object"==typeof t&&t?u(t,l):t}e.prototype={clone:function(){return new e(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),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t};var p={};function c(t){p[t]||("undefined"!=typeof console&&console.warn(t),p[t]=!0)}function h(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function f(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r<n;i=r++)o=t[r],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}function y(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;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}function d(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var m=g,v=3;function g(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var a=i[v+o],s=i[v+o+1];n.push(a===s?null:i.subarray(a,s))}var u=i[v+n.length],l=i[v+n.length+1];this.keys=i.subarray(u,l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var p=0;p<this.d*this.d;p++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}function x(t,e){return t(e={exports:{}},e.exports),e.exports}g.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},g.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},g.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},g.prototype.query=function(t,e,r,n,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},g.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,p=this.bboxes,c=0;c<u.length;c++){var h=u[c];if(void 0===a[h]){var f=4*h;(s?s(p[f+0],p[f+1],p[f+2],p[f+3]):t<=p[f+2]&&e<=p[f+3]&&r>=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},g.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},g.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},g.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},g.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=v+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[v+a]=o,i.set(s,o),o+=s.length}return i[v+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[v+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var b=x((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[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 u=i.indexOf("("),l=i.indexOf(")");if(-1!==u&&l+1===i.length){var p=i.substr(0,u),c=i.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=a(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),h];case"hsla":if(4!==c.length)return null;h=a(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=a(c[1]),d=a(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*s(v,m,f+1/3)),n(255*s(v,m,f)),n(255*s(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,w=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function _(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}w.parse=function(t){if(t){if(t instanceof w)return t;if("string"==typeof t){var e=b(t);if(e)return new w(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},w.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},w.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},w.black=new w(0,0,0,1),w.white=new w(1,1,1,1),w.transparent=new w(0,0,0,0),w.red=new w(1,0,0,1);var S=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),k=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],o=i[0],a=i[1];this.bindings[o]=a}};k.prototype.concat=function(t){return new k(this,t)},k.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.")},k.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var A={kind:"null"},I={kind:"number"},z={kind:"string"},M={kind:"boolean"},P={kind:"color"},B={kind:"object"},C={kind:"value"},V={kind:"collator"},F={kind:"formatted"},T={kind:"resolvedImage"};function E(t,e){return{kind:"array",itemType:t,N:e}}function O(t){if("array"===t.kind){var e=O(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var D=[A,I,z,M,P,F,B,E(C),T];function L(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!L(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=D;r<n.length;r+=1){if(!L(n[r],e))return null}}return"Expected "+O(t)+" but found "+O(e)+" instead."}var j=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"})};j.prototype.compare=function(t,e){return this.collator.compare(t,e)},j.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var U=function(t,e,r,n){this.text=t,this.scale=e,this.fontStack=r,this.textColor=n},q=function(t){this.sections=t};q.fromString=function(t){return new q([new U(t,null,null,null)])},q.prototype.toString=function(){return this.sections.map((function(t){return t.text})).join("")},q.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}return t};var R=function(t){this.name=t.name,this.available=t.available};function N(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Z(t){if(null===t)return A;if("string"==typeof t)return z;if("boolean"==typeof t)return M;if("number"==typeof t)return I;if(t instanceof w)return P;if(t instanceof j)return V;if(t instanceof q)return F;if(t instanceof R)return T;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=Z(i[n]);if(e){if(e===o)continue;e=C;break}e=o}return E(e||C,r)}return B}function J(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof w||t instanceof q||t instanceof R?t.toString():JSON.stringify(t)}R.prototype.toString=function(){return this.name},R.fromString=function(t){return new R({name:t,available:!1})},R.prototype.serialize=function(){return["image",this.name]};var K=function(t,e){this.type=t,this.value=e};K.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 t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof w)return!0;if(e instanceof j)return!0;if(e instanceof q)return!0;if(e instanceof R)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1){if(!t(n[r]))return!1}return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],n=Z(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new K(n,r)},K.prototype.evaluate=function(){return this.value},K.prototype.eachChild=function(){},K.prototype.possibleOutputs=function(){return[this.value]},K.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof w?["rgba"].concat(this.value.toArray()):this.value instanceof q?this.value.serialize():this.value};var G=function(t){this.name="ExpressionEvaluationError",this.message=t};G.prototype.toJSON=function(){return this.message};var X={string:z,number:I,boolean:M,object:B},Y=function(t,e){this.type=t,this.args=e};Y.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in X)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=X[s],n++}else o=C;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=E(o,a)}else r=X[i];for(var u=[];n<t.length;n++){var l=e.parse(t[n],n,C);if(!l)return null;u.push(l)}return new Y(r,u)},Y.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!L(this.type,Z(r)))return r;if(e===this.args.length-1)throw new G("Expected value to be of type "+O(this.type)+", but found "+O(Z(r))+" instead.")}return null},Y.prototype.eachChild=function(t){this.args.forEach(t)},Y.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Y.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var H=function(t){this.type=F,this.sections=t};H.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n<t.length-1;n+=2){var i=e.parse(t[n],1,C);if(!i)return null;var o=i.type.kind;if("string"!==o&&"value"!==o&&"null"!==o)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var a=t[n+1];if("object"!=typeof a||Array.isArray(a))return e.error("Format options argument must be an object.");var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,I)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,E(z))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,P)))return null;r.push({text:i,scale:s,font:u,textColor:l})}return new H(r)},H.prototype.evaluate=function(t){return new q(this.sections.map((function(e){return new U(J(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},H.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},H.prototype.possibleOutputs=function(){return[void 0]},H.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var W=function(t){this.type=T,this.input=t};W.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,z);return r?new W(r):e.error("No image name provided.")},W.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=!1;return t.availableImages&&t.availableImages.indexOf(e)>-1&&(r=!0),new R({name:e,available:r})},W.prototype.eachChild=function(t){t(this.input)},W.prototype.possibleOutputs=function(){return[void 0]},W.prototype.serialize=function(){return["image",this.input.serialize()]};var $={"to-boolean":M,"to-color":P,"to-number":I,"to-string":z},Q=function(t,e){this.type=t,this.args=e};Q.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=$[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,C);if(!a)return null;i.push(a)}return new Q(n,i)},Q.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof w)return e;if("string"==typeof e){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.":N(e[0],e[1],e[2],e[3])))return new w(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new G(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new G("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?q.fromString(J(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?R.fromString(J(this.args[0].evaluate(t))):J(this.args[0].evaluate(t))},Q.prototype.eachChild=function(t){this.args.forEach(t)},Q.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Q.prototype.serialize=function(){if("formatted"===this.type.kind)return new H([{text:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new W(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var tt=["Unknown","Point","LineString","Polygon"],et=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null};et.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},et.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?tt[this.feature.type]:this.feature.type:null},et.prototype.properties=function(){return this.feature&&this.feature.properties||{}},et.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=w.parse(t)),e};var rt=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};rt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},rt.prototype.eachChild=function(t){this.args.forEach(t)},rt.prototype.possibleOutputs=function(){return[void 0]},rt.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},rt.parse=function(t,e){var r,n=t[0],i=rt.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),u=null,l=0,p=s;l<p.length;l+=1){var c=p[l],h=c[0],f=c[1];u=new ut(e.registry,e.path,null,e.scope);for(var y=[],d=!1,m=1;m<t.length;m++){var v=t[m],g=Array.isArray(h)?h[m-1]:h.type,x=u.parse(v,1+y.length,g);if(!x){d=!0;break}y.push(x)}if(!d)if(Array.isArray(h)&&h.length!==y.length)u.error("Expected "+h.length+" arguments, but found "+y.length+" instead.");else{for(var b=0;b<y.length;b++){var w=Array.isArray(h)?h[b]:h.type,_=y[b];u.concat(b+1).checkSubtype(w,_.type)}if(0===u.errors.length)return new rt(n,o,f,y)}}if(1===s.length)(r=e.errors).push.apply(r,u.errors);else{for(var S=(s.length?s:a).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(O).join(", ")+")":"("+O(e.type)+"...)"})).join(" | "),k=[],A=1;A<t.length;A++){var I=e.parse(t[A],1+k.length);if(!I)return null;k.push(O(I.type))}e.error("Expected arguments of type "+S+", but found ("+k.join(", ")+") instead.")}return null},rt.register=function(t,e){for(var r in rt.definitions=e,e)t[r]=rt};var nt=function(t,e,r){this.type=V,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function it(t){if(t instanceof rt){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&&!it(t)&&(e=!1)})),e}function ot(t){if(t instanceof rt&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!ot(t)&&(e=!1)})),e}function at(t,e){if(t instanceof rt&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!at(t,e)&&(r=!1)})),r}nt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,M);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,M);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,z))?null:new nt(n,i,o)},nt.prototype.evaluate=function(t){return new j(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},nt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},nt.prototype.possibleOutputs=function(){return[void 0]},nt.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 st=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};st.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new st(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)},st.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},st.prototype.eachChild=function(){},st.prototype.possibleOutputs=function(){return[void 0]},st.prototype.serialize=function(){return["var",this.name]};var ut=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new k),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function lt(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new G("Input is not a number.");a=s-1}return 0}ut.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},ut.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new Y(e,[t]):"coerce"===r?new Q(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof K)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof st)return t(e.boundExpression);if(e instanceof rt&&"error"===e.name)return!1;if(e instanceof nt)return!1;var r=e instanceof Q||e instanceof Y;var n=!0;e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof K}));if(!n)return!1;return it(e)&&at(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new et;try{o=new K(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". 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.")},ut.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new ut(this.registry,n,e||null,i,this.errors)},ut.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new S(n,t))},ut.prototype.checkSubtype=function(t,e){var r=L(t,e);return r&&this.error(r),r};var pt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};pt.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,I);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)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]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new pt(i,r,n)},pt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[lt(e,n)].evaluate(t)},pt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},pt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},pt.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 ct=ht;function ht(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}function ft(t,e,r){return t*(1-r)+e*r}ht.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ht.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ht.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ht.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},ht.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var yt=Object.freeze({__proto__:null,number:ft,color:function(t,e,r){return new w(ft(t.r,e.r,r),ft(t.g,e.g,r),ft(t.b,e.b,r),ft(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return ft(t,e[n],r)}))}}),dt=.95047,mt=1,vt=1.08883,gt=4/29,xt=6/29,bt=3*xt*xt,wt=xt*xt*xt,_t=Math.PI/180,St=180/Math.PI;function kt(t){return t>wt?Math.pow(t,1/3):t/bt+gt}function At(t){return t>xt?t*t*t:bt*(t-gt)}function It(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mt(t){var e=zt(t.r),r=zt(t.g),n=zt(t.b),i=kt((.4124564*e+.3575761*r+.1804375*n)/dt),o=kt((.2126729*e+.7151522*r+.072175*n)/mt);return{l:116*o-16,a:500*(i-o),b:200*(o-kt((.0193339*e+.119192*r+.9503041*n)/vt)),alpha:t.a}}function Pt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=mt*At(e),r=dt*At(r),n=vt*At(n),new w(It(3.2404542*r-1.5371385*e-.4985314*n),It(-.969266*r+1.8760108*e+.041556*n),It(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Bt(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Ct={forward:Mt,reverse:Pt,interpolate:function(t,e,r){return{l:ft(t.l,e.l,r),a:ft(t.a,e.a,r),b:ft(t.b,e.b,r),alpha:ft(t.alpha,e.alpha,r)}}},Vt={forward:function(t){var e=Mt(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*St;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*_t,r=t.c;return Pt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Bt(t.h,e.h,r),c:ft(t.c,e.c,r),l:ft(t.l,e.l,r),alpha:ft(t.alpha,e.alpha,r)}}},Ft=Object.freeze({__proto__:null,lab:Ct,hcl:Vt}),Tt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[0],l=s[1];this.labels.push(u),this.outputs.push(l)}};function Et(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}Tt.interpolationFactor=function(t,e,r,n){var i=0;if("exponential"===t.name)i=Et(e,t.base,r,n);else if("linear"===t.name)i=Et(e,1,r,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new ct(o[0],o[1],o[2],o[3]).solve(Et(e,1,r,n))}return i},Tt.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,I)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=P:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p<o.length;p+=2){var c=o[p],h=o[p+1],f=p+3,y=p+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Tt(l,r,n,i,u):e.error("Type "+O(l)+" is not interpolatable.")},Tt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=lt(e,n),a=e[o],s=e[o+1],u=Tt.interpolationFactor(this.interpolation,n,a,s),l=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?yt[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?Vt.reverse(Vt.interpolate(Vt.forward(l),Vt.forward(p),u)):Ct.reverse(Ct.interpolate(Ct.forward(l),Ct.forward(p),u))},Tt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},Tt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},Tt.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Ot=function(t,e){this.type=t,this.args=e};Ot.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!u)return null;r=r||u.type,i.push(u)}var l=n&&i.some((function(t){return L(n,t.type)}));return new Ot(l?C:r,i)},Ot.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length;i+=1){var a=o[i];if(n++,r=a.evaluate(t),"resolvedImage"!==a.type.kind||r.available||(e||(e=a.evaluate(t).name),r=null,n===this.args.length&&(r=e)),null!==r)break}return r},Ot.prototype.eachChild=function(t){this.args.forEach(t)},Ot.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Ot.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Dt=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Dt.prototype.evaluate=function(t){return this.result.evaluate(t)},Dt.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},Dt.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new Dt(r,a):null},Dt.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Dt.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Lt=function(t,e,r){this.type=t,this.index=e,this.input=r};Lt.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,I),n=e.parse(t[2],2,E(e.expectedType||C));if(!r||!n)return null;var i=n.type;return new Lt(i.itemType,r,n)},Lt.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new G("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new G("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new G("Array index must be an integer, but found "+e+" instead.");return r[e]},Lt.prototype.eachChild=function(t){t(this.index),t(this.input)},Lt.prototype.possibleOutputs=function(){return[void 0]},Lt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var jt=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};jt.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var h=c[p];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Z(h)))return null}else r=Z(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,C);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new jt(r,n,y,i,o,d):null},jt.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Z(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},jt.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},jt.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},jt.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(c=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var p=l[u],c=p[0],h=p[1];1===h.length?e.push(s(h[0])):e.push(h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var Ut=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function qt(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Rt(t,e,r,n){return 0===n.compare(e,r)}function Nt(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=M,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,C);if(!o)return null;if(!qt(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+O(o.type)+"'.");var a=e.parse(t[2],2,C);if(!a)return null;if(!qt(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+O(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+O(o.type)+"' and '"+O(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Y(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Y(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,V)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Z(o),u=Z(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new G('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var l=Z(o),p=Z(a);if("string"!==l.kind||"string"!==p.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}Ut.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,M);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new Ut(r,n,s):null},Ut.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},Ut.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t(i),t(o)}t(this.otherwise)},Ut.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){t[0];return t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Ut.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Zt=Nt("==",(function(t,e,r){return e===r}),Rt),Jt=Nt("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Rt(0,e,r,n)})),Kt=Nt("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Gt=Nt(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Xt=Nt("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Yt=Nt(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Ht=function(t,e,r,n,i){this.type=z,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Ht.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,I);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,z)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,z)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,I)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,I))?null:new Ht(r,i,o,a,s)},Ht.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Ht.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Ht.prototype.possibleOutputs=function(){return[void 0]},Ht.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Wt=function(t){this.type=I,this.input=t};Wt.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 "+O(r.type)+" instead."):new Wt(r):null},Wt.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 G("Expected value to be of type string or array, but found "+O(Z(e))+" instead.")},Wt.prototype.eachChild=function(t){t(this.input)},Wt.prototype.possibleOutputs=function(){return[void 0]},Wt.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var $t={"==":Zt,"!=":Jt,">":Gt,"<":Kt,">=":Yt,"<=":Xt,array:Y,at:Lt,boolean:Y,case:Ut,coalesce:Ot,collator:nt,format:H,image:W,interpolate:Tt,"interpolate-hcl":Tt,"interpolate-lab":Tt,length:Wt,let:Dt,literal:K,match:jt,number:Y,"number-format":Ht,object:Y,step:pt,string:Y,"to-boolean":Q,"to-color":Q,"to-number":Q,"to-string":Q,var:st};function Qt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=N(r,n,i,a);if(s)throw new G(s);return new w(r/255*a,n/255*a,i/255*a,a)}function te(t,e){return t in e}function ee(t,e){var r=e[t];return void 0===r?null:r}function re(t){return{type:t}}function ne(t){return{result:"success",value:t}}function ie(t){return{result:"error",value:t}}function oe(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function se(t){return!!t.expression&&t.expression.interpolated}function ue(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function le(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function pe(t){return t}function ce(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function he(t,e,r,n,i){return ce(typeof r===i?n[r]:void 0,t.default,e.default)}function fe(t,e,r){if("number"!==ue(r))return ce(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=lt(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function ye(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==ue(r))return ce(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=lt(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=yt[e.type]||pe;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ft[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function de(t,e,r){return"color"===e.type?r=w.parse(r):"formatted"===e.type?r=q.fromString(r.toString()):"resolvedImage"===e.type?r=R.fromString(r.toString()):ue(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ce(r,t.default,e.default)}rt.register($t,{error:[{kind:"error"},[z],function(t,e){var r=e[0];throw new G(r.evaluate(t))}],typeof:[z,[C],function(t,e){return O(Z(e[0].evaluate(t)))}],"to-rgba":[E(I,4),[P],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[P,[I,I,I],Qt],rgba:[P,[I,I,I,I],Qt],has:{type:M,overloads:[[[z],function(t,e){return te(e[0].evaluate(t),t.properties())}],[[z,B],function(t,e){var r=e[0],n=e[1];return te(r.evaluate(t),n.evaluate(t))}]]},get:{type:C,overloads:[[[z],function(t,e){return ee(e[0].evaluate(t),t.properties())}],[[z,B],function(t,e){var r=e[0],n=e[1];return ee(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[C,[z],function(t,e){return ee(e[0].evaluate(t),t.featureState||{})}],properties:[B,[],function(t){return t.properties()}],"geometry-type":[z,[],function(t){return t.geometryType()}],id:[C,[],function(t){return t.id()}],zoom:[I,[],function(t){return t.globals.zoom}],"heatmap-density":[I,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[I,[],function(t){return t.globals.lineProgress||0}],accumulated:[C,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[I,re(I),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1){r+=i[n].evaluate(t)}return r}],"*":[I,re(I),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1){r*=i[n].evaluate(t)}return r}],"-":{type:I,overloads:[[[I,I],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[I],function(t,e){return-e[0].evaluate(t)}]]},"/":[I,[I,I],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[I,[I,I],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[I,[],function(){return Math.LN2}],pi:[I,[],function(){return Math.PI}],e:[I,[],function(){return Math.E}],"^":[I,[I,I],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[I,[I],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[I,[I],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[I,[I],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[I,[I],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[I,[I],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[I,[I],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[I,[I],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[I,[I],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[I,[I],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[I,[I],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[I,re(I),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[I,re(I),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[I,[I],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[I,[I],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[I,[I],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[M,[z,C],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[M,[C],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[M,[z],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[M,[z,C],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<o}],"filter-id-<":[M,[C],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[M,[z,C],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[M,[C],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[M,[z,C],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[M,[C],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[M,[z,C],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[M,[C],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[M,[C],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[M,[],function(t){return null!==t.id()}],"filter-type-in":[M,[E(z)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[M,[E(C)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[M,[z,E(C)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[M,[z,E(C)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:M,overloads:[[[M,M],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[re(M),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(!n[r].evaluate(t))return!1}return!0}]]},any:{type:M,overloads:[[[M,M],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[re(M),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(n[r].evaluate(t))return!0}return!1}]]},"!":[M,[M],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[M,[z],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[z,[z],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[z,[z],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[z,re(C),function(t,e){return e.map((function(e){return J(e.evaluate(t))})).join("")}],"resolved-locale":[z,[V],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var me=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new et,this._defaultValue=e?function(t){return"color"===t.type&&le(t.default)?new w(0,0,0,0):"color"===t.type?w.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function ve(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in $t}function ge(t,e){var r=new ut($t,[],e?function(t){var e={color:P,string:z,number:I,enum:z,boolean:M,formatted:F,resolvedImage:T};if("array"===t.type)return E(e[t.value]||C,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?ne(new me(n,e)):ie(r.errors)}me.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},me.prototype.evaluate=function(t,e,r,n,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new G("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var xe=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ot(e.expression)};xe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i)},xe.prototype.evaluate=function(t,e,r,n,i){return this._styleExpression.evaluate(t,e,r,n,i)};var be=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ot(e.expression),this.interpolationType=n};function we(t,e){if("error"===(t=ge(t,e)).result)return t;var r=t.value.expression,n=it(r);if(!n&&!oe(e))return ie([new S("","data expressions not supported")]);var i=at(r,["zoom"]);if(!i&&!ae(e))return ie([new S("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Dt)r=t(e.result);else if(e instanceof Ot)for(var n=0,i=e.args;n<i.length;n+=1){var o=i[n];if(r=t(o))break}else(e instanceof pt||e instanceof Tt)&&e.input instanceof rt&&"zoom"===e.input.name&&(r=e);if(r instanceof S)return r;e.eachChild((function(e){var n=t(e);n instanceof S?r=n:!r&&n?r=new S("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new S("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}));return r}(r);if(!o&&!i)return ie([new S("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof S)return ie([o]);if(o instanceof Tt&&!se(e))return ie([new S("",'"interpolate" expressions cannot be used with this property')]);if(!o)return ne(new xe(n?"constant":"source",t.value));var a=o instanceof Tt?o.interpolation:void 0;return ne(new be(n?"camera":"composite",t.value,o.labels,a))}be.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i)},be.prototype.evaluate=function(t,e,r,n,i){return this._styleExpression.evaluate(t,e,r,n,i)},be.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Tt.interpolationFactor(this.interpolationType,t,e,r):0};var _e=function(t,e){this._parameters=t,this._specification=e,_(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,l=s||!u,p=e.type||(se(r)?"exponential":"interval");if(a&&((e=_({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],w.parse(t[1])]}))),e.default?e.default=w.parse(e.default):e.default=w.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Ft[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===p)n=ye;else if("interval"===p)n=fe;else if("categorical"===p){n=he,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var f=h[c];i[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==p)throw new Error('Unknown function type "'+p+'"');n=de}if(s){for(var y={},d=[],m=0;m<e.stops.length;m++){var v=e.stops[m],g=v[0].zoom;void 0===y[g]&&(y[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),y[g].stops.push([v[0].value,v[1]])}for(var x=[],b=0,S=d;b<S.length;b+=1){var k=S[b];x.push([y[k].zoom,t(y[k],r)])}var A={name:"linear"};return{kind:"composite",interpolationType:A,interpolationFactor:Tt.interpolationFactor.bind(void 0,A),zoomStops:x.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return ye({stops:x,base:e.base},r,i).evaluate(i,n)}}}if(l){var I="exponential"===p?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:I,interpolationFactor:Tt.interpolationFactor.bind(void 0,I),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return n(e,r,a,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?ce(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};_e.deserialize=function(t){return new _e(t._parameters,t._specification)},_e.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Se=self.ImageData,ke={};function Ae(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ke[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Ie in Ae("Object",Object),m.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},m.deserialize=function(t){return new m(t.buffer)},Ae("Grid",m),Ae("Color",w),Ae("Error",Error),Ae("ResolvedImage",R),Ae("StylePropertyFunction",_e),Ae("StyleExpression",me,{omit:["_evaluator"]}),Ae("ZoomDependentExpression",be),Ae("ZoomConstantExpression",xe),Ae("CompoundExpression",rt,{omit:["_evaluate"]}),$t)$t[Ie]._classRegistryKey||Ae("Expression_"+Ie,$t[Ie]);function ze(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Me(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(ze(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Se)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,o=t;i<o.length;i+=1){var a=o[i];n.push(Me(a,e))}return n}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var p in t)if(t.hasOwnProperty(p)&&!(ke[u].omit.indexOf(p)>=0)){var c=t[p];l[p]=ke[u].shallow.indexOf(p)>=0?c:Me(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)}function Pe(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||ze(t)||ArrayBuffer.isView(t)||t instanceof Se)return t;if(Array.isArray(t))return t.map(Pe);if("object"==typeof t){var e=t.$name||"Object",r=ke[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];n[a]=ke[e].shallow.indexOf(a)>=0?s:Pe(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Be=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Be.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Be.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Ce=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new Be(this.process),this.target.addEventListener("message",this.receive,!1)};Ce.prototype.send=function(t,e,r,n){var i=this,o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var a=[];return this.target.postMessage({id:o,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:Me(e,a)},a),{cancel:function(){r&&delete i.callbacks[o],i.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:i.mapId})}}},Ce.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},Ce.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if("<response>"===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(Pe(r.error)):n(null,Pe(r.data)))}else{var i=!1,o=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks[e];var o=[];t.target.postMessage({id:e,type:"<response>",sourceMapId:t.mapId,error:r?Me(r):null,data:Me(n,o)},o)}:function(t){i=!0},a=null,s=Pe(r.data);if(this.parent[r.type])a=this.parent[r.type](r.sourceMapId,s,o);else if(this.parent.getWorkerSource){var u=r.type.split(".");a=this.parent.getWorkerSource(r.sourceMapId,u[0],s.source)[u[1]](s,o)}else o(new Error("Could not find function "+r.type));!i&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}},Ce.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ve={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum: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"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Fe=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Te(t){var e=t.key,r=t.value;return r?[new Fe(e,r,"constants have been deprecated as of v8")]:[]}function Ee(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Oe(t){return Ee(t)?t.valueOf():t}function De(t){if(Array.isArray(t))return t.map(De);if(t instanceof Object&&!Ee(t)){var e={};for(var r in t)e[r]=De(t[r]);return e}return Oe(t)}function Le(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=ue(r);if("object"!==u)return[new Fe(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=ur;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new Fe(e,r[l],'unknown property "'+l+'"'));continue}h=ur}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new Fe(e,r,'missing required property "'+f+'"'));return s}function je(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||ur;if("array"!==ue(e))return[new Fe(o,e,"array expected, "+ue(e)+" found")];if(r.length&&e.length!==r.length)return[new Fe(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Fe(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===ue(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:i,key:o+"["+l+"]"}));return u}function Ue(t){var e=t.key,r=t.value,n=t.valueSpec,i=ue(r);return"number"!==i?[new Fe(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new Fe(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new Fe(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function qe(t){var e,r,n,i=t.valueSpec,o=Oe(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===ue(t.value.stops)&&"array"===ue(t.value.stops[0])&&"object"===ue(t.value.stops[0][0]),p=Le({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Fe(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(je({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===ue(r)&&0===r.length&&e.push(new Fe(t.key,r,"array must have at least one stop"));return e},default:function(t){return ur({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new Fe(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new Fe(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!se(t.valueSpec)&&p.push(new Fe(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!oe(t.valueSpec)?p.push(new Fe(t.key,t.value,"property functions not supported")):s&&!ae(t.valueSpec)&&p.push(new Fe(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new Fe(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==ue(o))return[new Fe(s,o,"array expected, "+ue(o)+" found")];if(2!==o.length)return[new Fe(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==ue(o[0]))return[new Fe(s,o,"object expected, "+ue(o[0])+" found")];if(void 0===o[0].zoom)return[new Fe(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Fe(s,o,"object stop key must have value")];if(n&&n>Oe(o[0].zoom))return[new Fe(s,o[0].zoom,"stop zoom values must appear in ascending order")];Oe(o[0].zoom)!==n&&(n=Oe(o[0].zoom),r=void 0,a={}),e=e.concat(Le({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ue,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return ve(De(o[1]))?e.concat([new Fe(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(ur({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=ue(t.value),u=Oe(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new Fe(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Fe(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return oe(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Fe(t.key,l,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Fe(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Fe(t.key,l,"integer expected, found "+u)]}}function Re(t){var e=("property"===t.expressionContext?we:ge)(De(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Fe(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new Fe(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ot(r))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ot(r))return[new Fe(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!at(r,["zoom","feature-state"]))return[new Fe(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!it(r))return[new Fe(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ne(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Oe(r))&&i.push(new Fe(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Oe(r))&&i.push(new Fe(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function Ze(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Ze(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}var Je={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ke(t){if(null==t)return function(){return!0};Ze(t)||(t=Xe(t));var e=ge(t,Je);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 Ge(t,e){return t<e?-1:t>e?1:0}function Xe(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ye(t[1],t[2],"=="):"!="===r?$e(Ye(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ye(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Xe))):"all"===r?["all"].concat(t.slice(1).map(Xe)):"none"===r?["all"].concat(t.slice(1).map(Xe).map($e)):"in"===r?He(t[1],t.slice(2)):"!in"===r?$e(He(t[1],t.slice(2))):"has"===r?We(t[1]):"!has"!==r||$e(We(t[1]))}function Ye(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 He(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(Ge)]]:["filter-in-small",t,["literal",e]]}}function We(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function $e(t){return["!",t]}function Qe(t){return Ze(De(t.value))?Re(_({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==ue(r))return[new Fe(n,r,"array expected, "+ue(r)+" found")];var i=e.styleSpec;var o;var a=[];if(r.length<1)return[new Fe(n,r,"filter array must have at least 1 element")];a=a.concat(Ne({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(Oe(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Oe(r[1])&&a.push(new Fe(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Fe(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(o=ue(r[1]))&&a.push(new Fe(n+"[1]",r[1],"string expected, "+o+" found"));for(var s=2;s<r.length;s++)o=ue(r[s]),"$type"===Oe(r[1])?a=a.concat(Ne({key:n+"["+s+"]",value:r[s],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new Fe(n+"["+s+"]",r[s],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=ue(r[1]),2!==r.length?a.push(new Fe(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==o&&a.push(new Fe(n+"[1]",r[1],"string expected, "+o+" found"))}return a}(t)}function tr(t,e){var r=t.key,n=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return ur({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var l,p=t.valueSpec||s[a];if(!p)return[new Fe(r,o,'unknown property "'+a+'"')];if("string"===ue(o)&&oe(p)&&!p.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Fe(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var c=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&c.push(new Fe(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&le(De(o))&&"identity"===Oe(o.type)&&c.push(new Fe(r,o,'"text-font" does not support identity functions'))),c.concat(ur({key:t.key,value:o,valueSpec:p,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function er(t){return tr(t,"paint")}function rr(t){return tr(t,"layout")}function nr(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Fe(n,r,'either "type" or "ref" is required'));var a,s=Oe(r.type),u=Oe(r.ref);if(r.id)for(var l=Oe(r.id),p=0;p<t.arrayIndex;p++){var c=i.layers[p];Oe(c.id)===l&&e.push(new Fe(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Fe(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){Oe(t.id)===u&&(a=t)})),a?a.ref?e.push(new Fe(n,r.ref,"ref cannot reference another ref layer")):s=Oe(a.type):e.push(new Fe(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Oe(h.type);h?"vector"===f&&"raster"===s?e.push(new Fe(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new Fe(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new Fe(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new Fe(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Fe(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Fe(n,r.source,'source "'+r.source+'" not found'))}else e.push(new Fe(n,r,'missing required property "source"'));return e=e.concat(Le({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return ur({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:Qe,layout:function(t){return Le({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return rr(_({layerType:s},t))}}})},paint:function(t){return Le({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return er(_({layerType:s},t))}}})}}}))}function ir(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new Fe(r,e,'"type" is required')];var o,a=Oe(e.type);switch(a){case"vector":case"raster":case"raster-dem":return o=Le({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n});case"geojson":if(o=Le({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],p=u[1],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,Re({key:r+"."+s+".map",value:p,expressionContext:"cluster-map"})),o.push.apply(o,Re({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Le({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Le({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new Fe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ne({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function or(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=ue(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new Fe("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&n[u[1]]&&n[u[1]].transition?o.concat(ur({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?o.concat(ur({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o.concat([new Fe(s,e[s],'unknown property "'+s+'"')])}return o}function ar(t){var e=t.value,r=t.key,n=ue(e);return"string"!==n?[new Fe(r,e,"string expected, "+n+" found")]:[]}var sr={"*":function(){return[]},array:je,boolean:function(t){var e=t.value,r=t.key,n=ue(e);return"boolean"!==n?[new Fe(r,e,"boolean expected, "+n+" found")]:[]},number:Ue,color:function(t){var e=t.key,r=t.value,n=ue(r);return"string"!==n?[new Fe(e,r,"color expected, "+n+" found")]:null===b(r)?[new Fe(e,r,'color expected, "'+r+'" found')]:[]},constants:Te,enum:Ne,filter:Qe,function:qe,layer:nr,object:Le,source:ir,light:or,string:ar,formatted:function(t){return 0===ar(t).length?[]:Re(t)},resolvedImage:function(t){return 0===ar(t).length?[]:Re(t)}};function ur(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&le(Oe(e))?qe(t):r.expression&&ve(De(e))?Re(t):r.type&&sr[r.type]?sr[r.type](t):Le(_({},t,{valueSpec:r.type?n[r.type]:r}))}function lr(t){var e=t.value,r=t.key,n=ar(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new Fe(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Fe(r,e,'"glyphs" url must include a "{range}" token')),n)}function pr(t,e){void 0===e&&(e=Ve);var r=[];return r=r.concat(ur({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:lr,"*":function(){return[]}}})),t.constants&&(r=r.concat(Te({key:"constants",value:t.constants,style:t,styleSpec:e}))),cr(r)}function cr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function hr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return cr(t.apply(this,e))}}function fr(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function yr(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}pr.source=hr(ir),pr.light=hr(or),pr.layer=hr(nr),pr.filter=hr(Qe),pr.paintProperty=hr(er),pr.layoutProperty=hr(rr);var dr=function(t,e){void 0===e&&(e={}),i(this,e),this.type=t},mr=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",i({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(dr),vr=function(){};vr.prototype.on=function(t,e){return this._listeners=this._listeners||{},fr(t,e,this._listeners),this},vr.prototype.off=function(t,e){return yr(t,e,this._listeners),yr(t,e,this._oneTimeListeners),this},vr.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},fr(t,e,this._oneTimeListeners),this},vr.prototype.fire=function(t,e){"string"==typeof t&&(t=new dr(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,o=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<o.length;n+=1){o[n].call(this,t)}for(var a=0,s=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<s.length;a+=1){var u=s[a];yr(r,u,this._oneTimeListeners),u.call(this,t)}var l=this._eventedParent;l&&(i(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof mr&&console.error(t.error);return this},vr.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)},vr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var gr=pr,xr=gr.paintProperty,br=gr.layoutProperty;var wr=function(){this.first=!0};wr.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 _r={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Sr(t){for(var e=0,r=t;e<r.length;e+=1){if(Ar(r[e].charCodeAt(0)))return!0}return!1}function kr(t){return!_r.Arabic(t)&&(!_r["Arabic Supplement"](t)&&(!_r["Arabic Extended-A"](t)&&(!_r["Arabic Presentation Forms-A"](t)&&!_r["Arabic Presentation Forms-B"](t))))}function Ar(t){return 746===t||747===t||!(t<4352)&&(!!_r["Bopomofo Extended"](t)||(!!_r.Bopomofo(t)||(!(!_r["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!_r["CJK Compatibility Ideographs"](t)||(!!_r["CJK Compatibility"](t)||(!!_r["CJK Radicals Supplement"](t)||(!!_r["CJK Strokes"](t)||(!(!_r["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!_r["CJK Unified Ideographs Extension A"](t)||(!!_r["CJK Unified Ideographs"](t)||(!!_r["Enclosed CJK Letters and Months"](t)||(!!_r["Hangul Compatibility Jamo"](t)||(!!_r["Hangul Jamo Extended-A"](t)||(!!_r["Hangul Jamo Extended-B"](t)||(!!_r["Hangul Jamo"](t)||(!!_r["Hangul Syllables"](t)||(!!_r.Hiragana(t)||(!!_r["Ideographic Description Characters"](t)||(!!_r.Kanbun(t)||(!!_r["Kangxi Radicals"](t)||(!!_r["Katakana Phonetic Extensions"](t)||(!(!_r.Katakana(t)||12540===t)||(!(!_r["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)||(!(!_r["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!_r["Unified Canadian Aboriginal Syllabics"](t)||(!!_r["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!_r["Vertical Forms"](t)||(!!_r["Yijing Hexagram Symbols"](t)||(!!_r["Yi Syllables"](t)||!!_r["Yi Radicals"](t))))))))))))))))))))))))))))))}function Ir(t){return!(Ar(t)||function(t){return!(!_r["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!_r["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)||(!!_r["Letterlike Symbols"](t)||(!!_r["Number Forms"](t)||(!(!_r["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))||(!(!_r["Control Pictures"](t)||9251===t)||(!!_r["Optical Character Recognition"](t)||(!!_r["Enclosed Alphanumerics"](t)||(!!_r["Geometric Shapes"](t)||(!(!_r["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!_r["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!_r["CJK Symbols and Punctuation"](t)||(!!_r.Katakana(t)||(!!_r["Private Use Area"](t)||(!!_r["CJK Compatibility Forms"](t)||(!!_r["Small Form Variants"](t)||(!!_r["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 zr(t,e){return!(!e&&(t>=1424&&t<=2303||_r["Arabic Presentation Forms-A"](t)||_r["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||_r.Khmer(t))}self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date);var Mr="loaded",Pr="unavailable",Br={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Pr===Mr||null!=Br.applyArabicShaping}},Cr=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 wr,this.transition={})};Cr.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1){if(!zr(n[r].charCodeAt(0),e))return!1}return!0}(t,Br.isLoaded())},Cr.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Cr.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Vr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(le(t))return new _e(t,e);if(ve(t)){var r=we(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=w.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Vr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Vr.prototype.possiblyEvaluate=function(t,e){return this.property.possiblyEvaluate(this,t,e)};var Fr=function(t){this.property=t,this.value=new Vr(t,void 0)};Fr.prototype.transitioned=function(t,e){return new Er(this.property,this.value,e,i({},t.transition,this.transition),t.now)},Fr.prototype.untransitioned=function(){return new Er(this.property,this.value,null,{},0)};var Tr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Tr.prototype.getValue=function(t){return l(this._values[t].value.value)},Tr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fr(this._values[t].property)),this._values[t].value=new Vr(this._values[t].property,null===e?void 0:l(e))},Tr.prototype.getTransition=function(t){return l(this._values[t].transition)},Tr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fr(this._values[t].property)),this._values[t].transition=l(e)||void 0},Tr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},Tr.prototype.transitioned=function(t,e){for(var r=new Or(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},Tr.prototype.untransitioned=function(){for(var t=new Or(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var Er=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};Er.prototype.possiblyEvaluate=function(t,e){var r=t.now||0,n=this.value.possiblyEvaluate(t,e),i=this.prior;if(i){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return i.possiblyEvaluate(t,e);var o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t,e),n,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(o))}return n};var Or=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Or.prototype.possiblyEvaluate=function(t,e){for(var r=new jr(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r},Or.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 Dr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Dr.prototype.getValue=function(t){return l(this._values[t].value)},Dr.prototype.setValue=function(t,e){this._values[t]=new Vr(this._values[t].property,null===e?void 0:l(e))},Dr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},Dr.prototype.possiblyEvaluate=function(t,e){for(var r=new jr(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].possiblyEvaluate(t,e)}return r};var Lr=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Lr.prototype.isConstant=function(){return"constant"===this.value.kind},Lr.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Lr.prototype.evaluate=function(t,e,r){return this.property.evaluate(this.value,this.parameters,t,e,r)};var jr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};jr.prototype.get=function(t){return this._values[t]};var Ur=function(t){this.specification=t};Ur.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Ur.prototype.interpolate=function(t,e,r){var n=yt[this.specification.type];return n?n(t,e,r):t};var qr=function(t,e){this.specification=t,this.overrides=e};qr.prototype.possiblyEvaluate=function(t,e,r){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Lr(this,{kind:"constant",value:t.expression.evaluate(e,null,{},r)},e):new Lr(this,t.expression,e)},qr.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 Lr(this,{kind:"constant",value:void 0},t.parameters);var n=yt[this.specification.type];return n?new Lr(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},qr.prototype.evaluate=function(t,e,r,n,i){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i)};var Rr=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(t,e,r){if(void 0===t.value)return new Lr(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r),i="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,o=this._calculate(i,i,i,e);return new Lr(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Lr(this,{kind:"constant",value:a},e)}return new Lr(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i){if("source"===t.kind){var o=t.evaluate(e,r,n,i);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(qr),Nr=function(t){this.specification=t};Nr.prototype.possiblyEvaluate=function(t,e,r){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Cr(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Cr(Math.floor(e.zoom),e)),t.expression.evaluate(new Cr(Math.floor(e.zoom+1),e)),e)}},Nr.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Nr.prototype.interpolate=function(t){return t};var Zr=function(t){this.specification=t};Zr.prototype.possiblyEvaluate=function(t,e,r){return!!t.expression.evaluate(e,null,{},r)},Zr.prototype.interpolate=function(){return!1};var Jr=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Vr(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Fr(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Ae("DataDrivenProperty",qr),Ae("DataConstantProperty",Ur),Ae("CrossFadedDataDrivenProperty",Rr),Ae("CrossFadedProperty",Nr),Ae("ColorRampProperty",Zr);var Kr=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Dr(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Tr(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(br,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return s(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(xr,n,t,e,r))return!1}if(s(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),u=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,u,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var o=i[n];t.fire(new mr(new Error(o.message))),r=!0}return r}(this,t.call(gr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Ve,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Lr&&oe(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return!0}return!1},e}(vr),Gr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xr=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},Yr=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Hr(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i,o=(i=t.type,Gr[i].BYTES_PER_ELEMENT),a=r=Wr(r,Math.max(e,o)),s=t.components||1;return n=Math.max(n,o),r+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:Wr(r,Math.max(n,e)),alignment:e}}function Wr(t,e){return Math.ceil(t/e)*e}Yr.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Yr.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},Yr.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Yr.prototype.clear=function(){this.length=0},Yr.prototype.resize=function(t){this.reserve(t),this.length=t},Yr.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)}},Yr.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $r=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;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Yr);$r.prototype.bytesPerElement=4,Ae("StructArrayLayout2i4",$r);var Qr=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,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Yr);Qr.prototype.bytesPerElement=8,Ae("StructArrayLayout4i8",Qr);var tn=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,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Yr);tn.prototype.bytesPerElement=12,Ae("StructArrayLayout2i4i12",tn);var en=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,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Yr);en.prototype.bytesPerElement=8,Ae("StructArrayLayout2i4ub8",en);var rn=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,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(Yr);rn.prototype.bytesPerElement=16,Ae("StructArrayLayout8ui16",rn);var nn=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,n,i,o,a,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(Yr);nn.prototype.bytesPerElement=16,Ae("StructArrayLayout4i4ui16",nn);var on=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 n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Yr);on.prototype.bytesPerElement=12,Ae("StructArrayLayout3f12",on);var an=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Yr);an.prototype.bytesPerElement=4,Ae("StructArrayLayout1ul4",an);var sn=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,n,i,o,a,s,u,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(Yr);sn.prototype.bytesPerElement=24,Ae("StructArrayLayout6i1ul2ui2i24",sn);var un=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,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Yr);un.prototype.bytesPerElement=12,Ae("StructArrayLayout2i2i2i12",un);var ln=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,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Yr);ln.prototype.bytesPerElement=12,Ae("StructArrayLayout2ub2f12",ln);var pn=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,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Yr);pn.prototype.bytesPerElement=48,Ae("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",pn);var cn=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,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,A){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,A)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,A,I){var z=30*t,M=15*t;return this.int16[z+0]=e,this.int16[z+1]=r,this.int16[z+2]=n,this.int16[z+3]=i,this.int16[z+4]=o,this.int16[z+5]=a,this.int16[z+6]=s,this.int16[z+7]=u,this.uint16[z+8]=l,this.uint16[z+9]=p,this.uint16[z+10]=c,this.uint16[z+11]=h,this.uint16[z+12]=f,this.uint16[z+13]=y,this.uint16[z+14]=d,this.uint16[z+15]=m,this.uint16[z+16]=v,this.uint16[z+17]=g,this.uint16[z+18]=x,this.uint16[z+19]=b,this.uint16[z+20]=w,this.uint16[z+21]=_,this.uint32[M+11]=S,this.float32[M+12]=k,this.float32[M+13]=A,this.float32[M+14]=I,t},e}(Yr);cn.prototype.bytesPerElement=60,Ae("StructArrayLayout8i14ui1ul3f60",cn);var hn=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Yr);hn.prototype.bytesPerElement=4,Ae("StructArrayLayout1f4",hn);var fn=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 n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Yr);fn.prototype.bytesPerElement=6,Ae("StructArrayLayout3i6",fn);var yn=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 n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=r,this.uint16[o+3]=n,t},e}(Yr);yn.prototype.bytesPerElement=8,Ae("StructArrayLayout1ul2ui8",yn);var dn=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 n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Yr);dn.prototype.bytesPerElement=6,Ae("StructArrayLayout3ui6",dn);var mn=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;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Yr);mn.prototype.bytesPerElement=4,Ae("StructArrayLayout2ui4",mn);var vn=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){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Yr);vn.prototype.bytesPerElement=2,Ae("StructArrayLayout1ui2",vn);var gn=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;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Yr);gn.prototype.bytesPerElement=8,Ae("StructArrayLayout2f8",gn);var xn=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,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Yr);xn.prototype.bytesPerElement=16,Ae("StructArrayLayout4f16",xn);var bn=function(e){function r(){e.apply(this,arguments)}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var n={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 n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},n.anchorPoint.get=function(){return new t(this.anchorPointX,this.anchorPointY)},Object.defineProperties(r.prototype,n),r}(Xr);bn.prototype.size=24;var wn=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 bn(this,t)},e}(sn);Ae("CollisionBoxArray",wn);var _n=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},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.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.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},r.associatedIconIndex.set=function(t){this._structArray.int16[this._pos2+22]=t},Object.defineProperties(e.prototype,r),e}(Xr);_n.prototype.size=48;var Sn=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 _n(this,t)},e}(pn);Ae("PlacedSymbolArray",Sn);var kn=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},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.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.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.placedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+6]=t},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.verticalPlacedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+7]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.key.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.verticalIconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+17]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+18]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+19]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+20]=t},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.numVerticalIconVertices.set=function(t){this._structArray.uint16[this._pos2+21]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+12]=t},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.set=function(t){this._structArray.float32[this._pos4+13]=t},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.set=function(t){this._structArray.float32[this._pos4+14]=t},Object.defineProperties(e.prototype,r),e}(Xr);kn.prototype.size=60;var An=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 kn(this,t)},e}(cn);Ae("SymbolInstanceArray",An);var In=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}(Xr);In.prototype.size=4;var zn=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 In(this,t)},e}(hn);Ae("GlyphOffsetArray",zn);var Mn=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]},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}(Xr);Mn.prototype.size=6;var Pn=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 Mn(this,t)},e}(fn);Ae("SymbolLineVertexArray",Pn);var Bn=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}(Xr);Bn.prototype.size=8;var Cn=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 Bn(this,t)},e}(yn);Ae("FeatureIndexArray",Cn);var Vn=Hr([{name:"a_pos",components:2,type:"Int16"}],4).members,Fn=function(t){void 0===t&&(t=[]),this.segments=t};function Tn(t,e){return 256*(t=r(Math.floor(t),0,255))+(e=r(Math.floor(e),0,255))}Fn.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Fn.MAX_VERTEX_ARRAY_LENGTH&&c("Max vertices per segment is "+Fn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Fn.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Fn.prototype.get=function(){return this.segments},Fn.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Fn.simpleSegment=function(t,e,r,n){return new Fn([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Fn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ae("SegmentVector",Fn);var En=function(){this.ids=[],this.positions=[],this.indexed=!1};function On(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}En.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},En.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},En.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(n>=i)return;var o=e[n+i>>1];var a=n-1;var s=i+1;for(;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;On(e,a,s),On(r,3*a,3*s),On(r,3*a+1,3*s+1),On(r,3*a+2,3*s+2)}t(e,r,n,s);t(e,r,s+1,i)}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},En.deserialize=function(t){var e=new En;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},Ae("FeaturePositionMap",En);var Dn=function(t,e){this.gl=t.gl,this.location=e},Ln=(function(t){function e(e,r){t.call(this,e,r),this.current=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}}(Dn),function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Dn)),jn=(function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}}(Dn),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}}(Dn),function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Dn)),Un=function(t){function e(e,r){t.call(this,e,r),this.current=w.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Dn),qn=new Float32Array(16);!function(t){function e(e,r){t.call(this,e,r),this.current=qn}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}}(Dn);function Rn(t){return[Tn(255*t.r,255*t.g),Tn(255*t.b,255*t.a)]}var Nn=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0};Nn.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Nn.prototype.setConstantPatternPositions=function(){},Nn.prototype.populatePaintArray=function(){},Nn.prototype.updatePaintArray=function(){},Nn.prototype.upload=function(){},Nn.prototype.destroy=function(){},Nn.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Nn.prototype.getBinding=function(t,e){return"color"===this.type?new Un(t,e):new Ln(t,e)},Nn.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:Me(e),names:r,type:n}},Nn.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Nn(Pe(e),r,n)};var Zn=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Zn.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},Zn.prototype.populatePaintArray=function(){},Zn.prototype.updatePaintArray=function(){},Zn.prototype.upload=function(){},Zn.prototype.destroy=function(){},Zn.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Zn.prototype.setUniforms=function(t,e,r,n,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},Zn.prototype.getBinding=function(t,e){return new jn(t,e)};var Jn=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Jn.prototype.defines=function(){return[]},Jn.prototype.setConstantPatternPositions=function(){},Jn.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Cr(0),e,{},[],n);if("color"===this.type)for(var s=Rn(a),u=o;u<t;u++)i.emplaceBack(s[0],s[1]);else{for(var l=o;l<t;l++)i.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},Jn.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var a=Rn(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)i.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},Jn.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Jn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Jn.prototype.setUniforms=function(t,e){e.set(0)},Jn.prototype.getBinding=function(t,e){return new Ln(t,e)};var Kn=function(t,e,r,n,i,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};Kn.prototype.defines=function(){return[]},Kn.prototype.setConstantPatternPositions=function(){},Kn.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Cr(this.zoom),e,{},[],n),s=this.expression.evaluate(new Cr(this.zoom+1),e,{},[],n);if("color"===this.type)for(var u=Rn(a),l=Rn(s),p=o;p<t;p++)i.emplaceBack(u[0],u[1],l[0],l[1]);else{for(var c=o;c<t;c++)i.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},Kn.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=Rn(o),u=Rn(a),l=t;l<e;l++)i.emplace(l,s[0],s[1],u[0],u[1]);else{for(var p=t;p<e;p++)i.emplace(p,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},Kn.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Kn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Kn.prototype.interpolationFactor=function(t){return this.useIntegerZoom&&(t=Math.floor(t)),r(this.expression.interpolationFactor(t,this.zoom,this.zoom+1),0,1)},Kn.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},Kn.prototype.getBinding=function(t,e){return new Ln(t,e)};var Gn=function(t,e,r,n,i,o,a){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};Gn.prototype.defines=function(){return[]},Gn.prototype.setConstantPatternPositions=function(){},Gn.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,o=this.layerId,a=n.length;if(n.reserve(t),i.reserve(t),r&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,l=s.mid,p=s.max,c=r[u],h=r[l],f=r[p];if(!c||!h||!f)return;for(var y=a;y<t;y++)n.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1]),i.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},Gn.prototype.updatePaintArray=function(t,e,r,n,i){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&r.patterns&&r.patterns[s]){var u=r.patterns[s],l=u.min,p=u.mid,c=u.max,h=i[l],f=i[p],y=i[c];if(!h||!f||!y)return;for(var d=t;d<e;d++)o.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),a.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],y.tl[0],y.tl[1],y.br[0],y.br[1])}},Gn.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Gn.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Gn.prototype.setUniforms=function(t,e){e.set(0)},Gn.prototype.getBinding=function(t,e){return new Ln(t,e)};var Xn=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new En,this._bufferOffset=0};Xn.createDynamic=function(t,e,r){var n=new Xn,i=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Lr&&oe(a.property.specification)){var s=Hn(o,t.type),u=a.property.specification.type,l=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)n.binders[o]=new Zn(a.value.value,s,u),i.push("/u_"+o);else{var p=Wn(o,u,"source");n.binders[o]=new Gn(a.value,s,u,l,e,p,t.id),i.push("/a_"+o)}else if("constant"===a.value.kind)n.binders[o]=new Nn(a.value.value,s,u),i.push("/u_"+o);else if("source"===a.value.kind){var c=Wn(o,u,"source");n.binders[o]=new Jn(a.value,s,u,c),i.push("/a_"+o)}else{var h=Wn(o,u,"composite");n.binders[o]=new Kn(a.value,s,u,l,e,h),i.push("/z_"+o)}}}return n.cacheKey=i.sort().join(""),n},Xn.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders){this.binders[o].populatePaintArray(t,e,n,i)}void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t},Xn.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){this.binders[r].setConstantPatternPositions(t,e)}},Xn.prototype.updatePaintArrays=function(t,e,r,n){var i=!1;for(var o in t)for(var a=0,s=this._featureMap.getPositions(+o);a<s.length;a+=1){var u=s[a],l=e.feature(u.index);for(var p in this.binders){var c=this.binders[p];if(!(c instanceof Nn||c instanceof Zn)&&!0===c.expression.isStateDependent){var h=r.paint.get(p);c.expression=h.value,c.updatePaintArray(u.start,u.end,l,t[o],n),i=!0}}}return i},Xn.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},Xn.prototype.getPaintVertexBuffers=function(){return this._buffers},Xn.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders)for(var i=this.binders[n],o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s]);r.push({name:s,property:n,binding:u})}}return r},Xn.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property,l=a.binding;this.binders[u].setUniforms(t,l,n,r.get(u),s)}},Xn.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Gn){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&e.push(i)}else(n instanceof Jn||n instanceof Kn)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},Xn.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var i=this.binders[n];(i instanceof Jn||i instanceof Kn)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer)}this._buffers=r},Xn.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var Yn=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=Xn.createDynamic(a,r,n),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};function Hn(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Wn(t,e,r){var n={color:{source:gn,composite:xn},number:{source:hn,composite:gn}},i=function(t){return{"line-pattern":{source:rn,composite:rn},"fill-pattern":{source:rn,composite:rn},"fill-extrusion-pattern":{source:rn,composite:rn}}[t]}(t);return i&&i[r]||n[e][r]}Yn.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,r,n,i);this.needsUpload=!0},Yn.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,o=r;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,e,a,n)||this.needsUpload}},Yn.prototype.get=function(t){return this.programConfigurations[t]},Yn.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Yn.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Ae("ConstantBinder",Nn),Ae("CrossFadedConstantBinder",Zn),Ae("SourceExpressionBinder",Jn),Ae("CrossFadedCompositeBinder",Gn),Ae("CompositeExpressionBinder",Kn),Ae("ProgramConfiguration",Xn,{omit:["_buffers"]}),Ae("ProgramConfigurationSet",Yn);var $n=8192;var Qn,ti=(Qn=15,{min:-1*Math.pow(2,Qn-1),max:Math.pow(2,Qn-1)-1});function ei(t){for(var e=$n/t.extent,n=t.loadGeometry(),i=0;i<n.length;i++)for(var o=n[i],a=0;a<o.length;a++){var s=o[a];s.x=Math.round(s.x*e),s.y=Math.round(s.y*e),(s.x<ti.min||s.x>ti.max||s.y<ti.min||s.y>ti.max)&&(c("Geometry exceeds allowed extent, reduce your vector tile buffer size"),s.x=r(s.x,ti.min,ti.max),s.y=r(s.y,ti.min,ti.max))}return n}function ri(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var ni=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new $r,this.indexArray=new dn,this.segments=new Fn,this.programConfigurations=new Yn(Vn,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ii(t,e){for(var r=0;r<t.length;r++)if(fi(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(fi(t,e[n]))return!0;return!!ui(t,e)}function oi(t,e,r){return!!fi(t,e)||!!pi(e,t,r)}function ai(t,e){if(1===t.length)return hi(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(fi(t,n[i]))return!0;for(var o=0;o<t.length;o++)if(hi(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(ui(t,e[a]))return!0;return!1}function si(t,e,r){if(t.length>1){if(ui(t,e))return!0;for(var n=0;n<e.length;n++)if(pi(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(pi(t[i],e,r))return!0;return!1}function ui(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++){if(li(n,i,e[o],e[o+1]))return!0}return!1}function li(t,e,r,n){return h(t,r,n)!==h(e,r,n)&&h(t,e,r)!==h(t,e,n)}function pi(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){if(ci(t,e[i-1],e[i])<n)return!0}return!1}function ci(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function hi(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)n=r[s],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function fi(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];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 yi(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var o=h(t,e,r[0]);return o!==h(t,e,r[1])||o!==h(t,e,r[2])||o!==h(t,e,r[3])}function di(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function mi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function vi(e,r,n,i,o){if(!r[0]&&!r[1])return e;var a=t.convert(r)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u<e.length;u++){var l=e[u];s.push(l.sub(a))}return s}ni.prototype.populate=function(t,e){var r=this.layers[0],n=[],i=null;"circle"===r.type&&(i=r.layout.get("circle-sort-key"));for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.index,p=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new Cr(this.zoom),u)){var c=ei(u),h=i?i.evaluate(u,{}):void 0,f={id:u.id,properties:u.properties,type:u.type,sourceLayerIndex:p,index:l,geometry:c,patterns:{},sortKey:h};n.push(f)}}i&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,d=n;y<d.length;y+=1){var m=d[y],v=m,g=v.geometry,x=v.index,b=v.sourceLayerIndex,w=t[x].feature;this.addFeature(m,g,x),e.featureIndex.insert(w,g,x,b,this.index)}},ni.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ni.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ni.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ni.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},ni.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ni.prototype.addFeature=function(t,e,r){for(var n=0,i=e;n<i.length;n+=1)for(var o=0,a=i[n];o<a.length;o+=1){var s=a[o],u=s.x,l=s.y;if(!(u<0||u>=$n||l<0||l>=$n)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;ri(this.layoutVertexArray,u,l,-1,-1),ri(this.layoutVertexArray,u,l,1,-1),ri(this.layoutVertexArray,u,l,1,1),ri(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},Ae("CircleBucket",ni,{omit:["layers"]});var gi=new Jr({"circle-sort-key":new qr(Ve.layout_circle["circle-sort-key"])}),xi={paint:new Jr({"circle-radius":new qr(Ve.paint_circle["circle-radius"]),"circle-color":new qr(Ve.paint_circle["circle-color"]),"circle-blur":new qr(Ve.paint_circle["circle-blur"]),"circle-opacity":new qr(Ve.paint_circle["circle-opacity"]),"circle-translate":new Ur(Ve.paint_circle["circle-translate"]),"circle-translate-anchor":new Ur(Ve.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ur(Ve.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ur(Ve.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qr(Ve.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qr(Ve.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qr(Ve.paint_circle["circle-stroke-opacity"])}),layout:gi},bi="undefined"!=typeof Float32Array?Float32Array:Array;function wi(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});_i=new bi(4),bi!=Float32Array&&(_i[0]=0,_i[1]=0,_i[2]=0,_i[3]=0),Si=_i;var _i,Si,ki=function(t){function e(e){t.call(this,e,xi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new ni(t)},e.prototype.queryRadius=function(t){var e=t;return di("circle-radius",this,e)+di("circle-stroke-width",this,e)+mi(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=vi(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return Ai(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=p?v:Ai(v,s),x=h,b=wi([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=o.cameraToCenterDistance/b[3]),oi(c,g,x))return!0}return!1},e}(Kr);function Ai(e,r){var n=wi([],[e.x,e.y,0,1],r);return new t(n[0]/n[3],n[1]/n[3])}var Ii=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}(ni);function zi(t,e,r,n){var i=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*o*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*o*r);return t.width=i,t.height=o,t.data=n,t}function Mi(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=zi({},{width:n,height:i},r);Pi(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}}function Pi(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,p=((n.y+u)*e.width+n.x)*o,c=0;c<i.width*o;c++)s[p+c]=a[l+c];return e}Ae("HeatmapBucket",Ii,{omit:["layers"]});var Bi=function(t,e){zi(this,t,1,e)};Bi.prototype.resize=function(t){Mi(this,t,1)},Bi.prototype.clone=function(){return new Bi({width:this.width,height:this.height},new Uint8Array(this.data))},Bi.copy=function(t,e,r,n,i){Pi(t,e,r,n,i,1)};var Ci=function(t,e){zi(this,t,4,e)};Ci.prototype.resize=function(t){Mi(this,t,4)},Ci.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Ci.prototype.clone=function(){return new Ci({width:this.width,height:this.height},new Uint8Array(this.data))},Ci.copy=function(t,e,r,n,i){Pi(t,e,r,n,i,4)},Ae("AlphaImage",Bi),Ae("RGBAImage",Ci);var Vi={paint:new Jr({"heatmap-radius":new qr(Ve.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qr(Ve.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ur(Ve.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Zr(Ve.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ur(Ve.paint_heatmap["heatmap-opacity"])})};function Fi(t,e){for(var r=new Uint8Array(1024),n={},i=0,o=0;i<256;i++,o+=4){n[e]=i/255;var a=t.evaluate(n);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 Ci({width:256,height:1},r)}var Ti=function(t){function e(e){t.call(this,e,Vi),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 Ii(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=Fi(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}(Kr),Ei={paint:new Jr({"hillshade-illumination-direction":new Ur(Ve.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ur(Ve.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ur(Ve.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ur(Ve.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ur(Ve.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ur(Ve.paint_hillshade["hillshade-accent-color"])})},Oi=function(t){function e(e){t.call(this,e,Ei)}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}(Kr),Di=Hr([{name:"a_pos",components:2,type:"Int16"}],4).members,Li=Ui,ji=Ui;function Ui(t,e,r){r=r||2;var n,i,o,a,s,u,l,p=e&&e.length,c=p?e[0]*r:t.length,h=qi(t,0,c,r,!0),f=[];if(!h||h.next===h.prev)return f;if(p&&(h=function(t,e,r,n){var i,o,a,s,u,l=[];for(i=0,o=e.length;i<o;i++)a=e[i]*n,s=i<o-1?e[i+1]*n:t.length,(u=qi(t,a,s,n,!1))===u.next&&(u.steiner=!0),l.push($i(u));for(l.sort(Xi),i=0;i<l.length;i++)Yi(l[i],r),r=Ri(r,r.next);return r}(t,e,h,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var y=r;y<c;y+=r)(s=t[y])<n&&(n=s),(u=t[y+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return Ni(h,f,r,n,i,l),f}function qi(t,e,r,n,i){var o,a;if(i===co(t,e,r,n)>0)for(o=e;o<r;o+=n)a=uo(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=uo(o,t[o],t[o+1],a);return a&&ro(a,a.next)&&(lo(a),a=a.next),a}function Ri(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!ro(n,n.next)&&0!==eo(n.prev,n,n.next))n=n.next;else{if(lo(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Ni(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Wi(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<l&&(s++,n=n.nextZ);e++);for(u=l;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Ji(t,n,i,o):Zi(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),lo(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Ni(t=Ki(Ri(t),e,r),e,r,n,i,o,2):2===a&&Gi(t,e,r,n,i,o):Ni(Ri(t),e,r,n,i,o,1);break}}}function Zi(t){var e=t.prev,r=t,n=t.next;if(eo(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Qi(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&eo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ji(t,e,r,n){var i=t.prev,o=t,a=t.next;if(eo(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,p=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=Wi(s,u,e,r,n),h=Wi(l,p,e,r,n),f=t.prevZ,y=t.nextZ;f&&f.z>=c&&y&&y.z<=h;){if(f!==t.prev&&f!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&eo(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&eo(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&eo(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&eo(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function Ki(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!ro(i,o)&&no(i,n,n.next,o)&&ao(i,o)&&ao(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),lo(n),lo(n.next),n=t=o),n=n.next}while(n!==t);return Ri(n)}function Gi(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&to(a,s)){var u=so(a,s);return a=Ri(a,a.next),u=Ri(u,u.next),Ni(a,e,r,n,i,o),void Ni(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Xi(t,e){return t.x-e.x}function Yi(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var u,l=r,p=r.x,c=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=p&&i!==n.x&&Qi(o<c?i:a,o,p,c,o<c?a:i,o,n.x,n.y)&&(u=Math.abs(o-n.y)/(i-n.x),ao(n,t)&&(u<h||u===h&&(n.x>r.x||n.x===r.x&&Hi(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=so(e,t);Ri(r,r.next)}}function Hi(t,e){return eo(t.prev,t,e.prev)<0&&eo(e.next,t,t.next)<0}function Wi(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function $i(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Qi(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function to(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&no(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ao(t,e)&&ao(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(eo(t.prev,t,e.prev)||eo(t,e.prev,e))||ro(t,e)&&eo(t.prev,t,t.next)>0&&eo(e.prev,e,e.next)>0)}function eo(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function ro(t,e){return t.x===e.x&&t.y===e.y}function no(t,e,r,n){var i=oo(eo(t,e,r)),o=oo(eo(t,e,n)),a=oo(eo(r,n,t)),s=oo(eo(r,n,e));return i!==o&&a!==s||(!(0!==i||!io(t,r,e))||(!(0!==o||!io(t,n,e))||(!(0!==a||!io(r,t,n))||!(0!==s||!io(r,e,n)))))}function io(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function oo(t){return t>0?1:t<0?-1:0}function ao(t,e){return eo(t.prev,t,t.next)<0?eo(t,e,t.next)>=0&&eo(t,t.prev,e)>=0:eo(t,e,t.prev)<0||eo(t,t.next,e)<0}function so(t,e){var r=new po(t.i,t.x,t.y),n=new po(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function uo(t,e,r,n){var i=new po(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function lo(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 po(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 co(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function ho(t,e,r,n,i){!function t(e,r,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1),c=Math.max(n,Math.floor(r-s*l/a+p)),h=Math.min(i,Math.floor(r+(a-s)*l/a+p));t(e,r,c,h,o)}var f=e[r],y=n,d=i;for(fo(e,n,r),o(e[i],f)>0&&fo(e,n,i);y<d;){for(fo(e,y,d),y++,d--;o(e[y],f)<0;)y++;for(;o(e[d],f)>0;)d--}0===o(e[n],f)?fo(e,n,d):fo(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}(t,e,r||0,n||t.length-1,i||yo)}function fo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function yo(t,e){return t<e?-1:t>e?1:0}function mo(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=f(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&o.push(n),n=[t[a]]):n.push(t[a]))}if(n&&o.push(n),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(ho(o[u],e,1,o[u].length-1,vo),o[u]=o[u].slice(0,e));return o}function vo(t,e){return e.area-t.area}function go(t,e,r){for(var n=r.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0)}return i}function xo(t,e,r,n,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var p=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),h=l.evaluate({zoom:n+1},r,{},i.availableImages);p=p&&p.name?p.name:p,c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,o[p]=!0,o[c]=!0,o[h]=!0,r.patterns[u.id]={min:p,mid:c,max:h}}}return r}Ui.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(co(t,0,o,r));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*r,p=s<u-1?e[s+1]*r:t.length;a-=Math.abs(co(t,l,p,r))}var c=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,f=n[s+1]*r,y=n[s+2]*r;c+=Math.abs((t[h]-t[y])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[y+1]-t[h+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},Ui.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},Li.default=ji;var bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new $r,this.indexArray=new dn,this.indexArray2=new mn,this.programConfigurations=new Yn(Di,t.layers,t.zoom),this.segments=new Fn,this.segments2=new Fn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};bo.prototype.populate=function(t,e){this.hasPattern=go("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Cr(this.zoom),s)){var p=ei(s),c=r?r.evaluate(s,{},e.availableImages):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};n.push(h)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,y=n;f<y.length;f+=1){var d=y[f],m=d,v=m.geometry,g=m.index,x=m.sourceLayerIndex;if(this.hasPattern){var b=xo("fill",this.layers,d,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(d,v,g,{});var w=t[g].feature;e.featureIndex.insert(w,v,g,x,this.index)}},bo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},bo.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},bo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Di),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},bo.prototype.addFeature=function(t,e,r,n){for(var i=0,o=mo(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=p.vertexLength,h=[],f=[],y=0,d=a;y<d.length;y+=1){var m=d[y];if(0!==m.length){m!==a[0]&&f.push(h.length/2);var v=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),g=v.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(g+m.length-1,g),h.push(m[0].x),h.push(m[0].y);for(var x=1;x<m.length;x++)this.layoutVertexArray.emplaceBack(m[x].x,m[x].y),this.indexArray2.emplaceBack(g+x-1,g+x),h.push(m[x].x),h.push(m[x].y);v.vertexLength+=m.length,v.primitiveLength+=m.length}}for(var b=Li(h,f),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(c+b[w],c+b[w+1],c+b[w+2]);p.vertexLength+=s,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},Ae("FillBucket",bo,{omit:["layers","patternFeatures"]});var wo=new Jr({"fill-sort-key":new qr(Ve.layout_fill["fill-sort-key"])}),_o={paint:new Jr({"fill-antialias":new Ur(Ve.paint_fill["fill-antialias"]),"fill-opacity":new qr(Ve.paint_fill["fill-opacity"]),"fill-color":new qr(Ve.paint_fill["fill-color"]),"fill-outline-color":new qr(Ve.paint_fill["fill-outline-color"]),"fill-translate":new Ur(Ve.paint_fill["fill-translate"]),"fill-translate-anchor":new Ur(Ve.paint_fill["fill-translate-anchor"]),"fill-pattern":new Rr(Ve.paint_fill["fill-pattern"])}),layout:wo},So=function(t){function e(e){t.call(this,e,_o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new bo(t)},e.prototype.queryRadius=function(){return mi(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return ai(vi(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(Kr),ko=Hr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Ao=Io;function Io(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(zo,this,e)}function zo(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Mo(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],n+=((r=t[a]).x-e.x)*(e.y+r.y);return n}Io.types=["Unknown","Point","LineString","Polygon"],Io.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var r,n=e.readVarint()+e.pos,i=1,o=0,a=0,s=0,u=[];e.pos<n;){if(o<=0){var l=e.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=e.readSVarint(),s+=e.readSVarint(),1===i&&(r&&u.push(r),r=[]),r.push(new t(a,s));else{if(7!==i)throw new Error("unknown command "+i);r&&r.push(r[0].clone())}}return r&&u.push(r),u},Io.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=7&p,n=p>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},Io.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Io.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/o;t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(n=0;n<u.length;n++)c[n]=u[n][0];p(u=c);break;case 2:for(n=0;n<u.length;n++)p(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=Mo(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}r&&i.push(r);return i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)p(u[n][i])}1===u.length?u=u[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Po=Bo;function Bo(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(Co,this,e),this.length=this._features.length}function Co(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){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Vo(t,e,r){if(3===t){var n=new Po(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Bo.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 Ao(this._pbf,e,this.extent,this._keys,this._values)};var Fo={VectorTile:function(t,e){this.layers=t.readFields(Vo,{},e)},VectorTileFeature:Ao,VectorTileLayer:Po},To=Fo.VectorTileFeature.types,Eo=Math.pow(2,13);function Oo(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*Eo)+a,i*Eo*2,o*Eo*2,Math.round(s))}var Do=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new tn,this.indexArray=new dn,this.programConfigurations=new Yn(ko,t.layers,t.zoom),this.segments=new Fn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Lo(t,e){return t.x===e.x&&(t.x<0||t.x>$n)||t.y===e.y&&(t.y<0||t.y>$n)}function jo(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>$n}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>$n}))}Do.prototype.populate=function(t,e){this.features=[],this.hasPattern=go("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Cr(this.zoom),o)){var u=ei(o),l={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(l.id=o.id),this.hasPattern?this.features.push(xo("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index,!0)}}},Do.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],o=i.geometry;this.addFeature(i,o,i.index,e)}},Do.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Do.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Do.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Do.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ko),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Do.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Do.prototype.addFeature=function(t,e,r,n){for(var i=0,o=mo(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,l=a;u<l.length;u+=1){s+=l[u].length}for(var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=a;c<h.length;c+=1){var f=h[c];if(0!==f.length&&!jo(f))for(var y=0,d=0;d<f.length;d++){var m=f[d];if(d>=1){var v=f[d-1];if(!Lo(m,v)){p.vertexLength+4>Fn.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(v)._perp()._unit(),x=v.dist(m);y+x>32768&&(y=0),Oo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),Oo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,Oo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),Oo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,y);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2}}}}if(p.vertexLength+s>Fn.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===To[t.type]){for(var w=[],_=[],S=p.vertexLength,k=0,A=a;k<A.length;k+=1){var I=A[k];if(0!==I.length){I!==a[0]&&_.push(w.length/2);for(var z=0;z<I.length;z++){var M=I[z];Oo(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),w.push(M.x),w.push(M.y)}}}for(var P=Li(w,_),B=0;B<P.length;B+=3)this.indexArray.emplaceBack(S+P[B],S+P[B+2],S+P[B+1]);p.primitiveLength+=P.length/3,p.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},Ae("FillExtrusionBucket",Do,{omit:["layers","features"]});var Uo={paint:new Jr({"fill-extrusion-opacity":new Ur(Ve["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qr(Ve["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ur(Ve["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ur(Ve["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Rr(Ve["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qr(Ve["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qr(Ve["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ur(Ve["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},qo=function(e){function r(t){e.call(this,t,Uo)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.createBucket=function(t){return new Do(t)},r.prototype.queryRadius=function(){return mi(this.paint.get("fill-extrusion-translate"))},r.prototype.is3D=function(){return!0},r.prototype.queryIntersectsFeature=function(e,r,n,i,o,a,s,u){var l=vi(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(r,n),c=this.paint.get("fill-extrusion-base").evaluate(r,n),h=function(e,r,n,i){for(var o=[],a=0,s=e;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,i,1];wi(l,l,r),o.push(new t(l[0]/l[3],l[1]/l[3]))}return o}(l,u,0,0),f=function(e,r,n,i){for(var o=[],a=[],s=i[8]*r,u=i[9]*r,l=i[10]*r,p=i[11]*r,c=i[8]*n,h=i[9]*n,f=i[10]*n,y=i[11]*n,d=0,m=e;d<m.length;d+=1){for(var v=m[d],g=[],x=[],b=0,w=v;b<w.length;b+=1){var _=w[b],S=_.x,k=_.y,A=i[0]*S+i[4]*k+i[12],I=i[1]*S+i[5]*k+i[13],z=i[2]*S+i[6]*k+i[14],M=i[3]*S+i[7]*k+i[15],P=z+l,B=M+p,C=A+c,V=I+h,F=z+f,T=M+y,E=new t((A+s)/B,(I+u)/B);E.z=P/B,g.push(E);var O=new t(C/T,V/T);O.z=F/T,x.push(O)}o.push(g),a.push(x)}return[o,a]}(i,c,p,u);return function(t,e,r){var n=1/0;ai(r,e)&&(n=No(r,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],l=o[s+1],p=a[s],c=a[s+1],h=[u,l,c,p,u];ii(r,h)&&(n=Math.min(n,No(r,h)))}return n!==1/0&&n}(f[0],f[1],h)},r}(Kr);function Ro(t,e){return t.x*e.x+t.y*e.y}function No(t,e){if(1===t.length){var r=e[0],n=e[1],i=e[3],o=t[0],a=n.sub(r),s=i.sub(r),u=o.sub(r),l=Ro(a,a),p=Ro(a,s),c=Ro(s,s),h=Ro(u,a),f=Ro(u,s),y=l*c-p*p,d=(c*h-p*f)/y,m=(l*f-p*h)/y,v=1-d-m;return r.z*v+n.z*d+i.z*m}for(var g=1/0,x=0,b=e;x<b.length;x+=1){var w=b[x];g=Math.min(g,w.z)}return g}var Zo=Hr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Jo=Fo.VectorTileFeature.types,Ko=Math.cos(Math.PI/180*37.5),Go=Math.pow(2,14)/.5,Xo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new en,this.indexArray=new dn,this.programConfigurations=new Yn(Zo,t.layers,t.zoom),this.segments=new Fn,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Xo.prototype.populate=function(t,e){this.hasPattern=go("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,l=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Cr(this.zoom),s)){var p=ei(s),c=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:l,index:u,geometry:p,patterns:{},sortKey:c};n.push(h)}}r&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var f=0,y=n;f<y.length;f+=1){var d=y[f],m=d,v=m.geometry,g=m.index,x=m.sourceLayerIndex;if(this.hasPattern){var b=xo("line",this.layers,d,this.zoom,e);this.patternFeatures.push(b)}else this.addFeature(d,v,g,{});var w=t[g].feature;e.featureIndex.insert(w,v,g,x,this.index)}},Xo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Xo.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},Xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Xo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Zo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Xo.prototype.addFeature=function(t,e,r,n){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(t,{}),a=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),l=0,p=e;l<p.length;l+=1){var c=p[l];this.addLine(c,t,o,a,s,u,r,n)}},Xo.prototype.addLine=function(t,e,r,n,i,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var u=0;u<t.length-1;u++)this.totalDistance+=t[u].dist(t[u+1])}for(var l="Polygon"===Jo[e.type],p=t.length;p>=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c<p-1&&t[c].equals(t[c+1]);)c++;if(!(p<(l?3:2))){"bevel"===r&&(i=1.05);var h,f=$n/(512*this.overscaling)*15,y=this.segments.prepareSegment(10*p,this.layoutVertexArray,this.indexArray),d=void 0,m=void 0,v=void 0,g=void 0;this.e1=this.e2=-1,l&&(h=t[p-2],g=t[c].sub(h)._unit()._perp());for(var x=c;x<p;x++)if(!(m=l&&x===p-1?t[c+1]:t[x+1])||!t[x].equals(m)){g&&(v=g),h&&(d=h),h=t[x],g=m?m.sub(h)._unit()._perp():v;var b=(v=v||g).add(g);0===b.x&&0===b.y||b._unit();var w=v.x*g.x+v.y*g.y,_=b.x*g.x+b.y*g.y,S=0!==_?1/_:1/0,k=2*Math.sqrt(2-2*_),A=_<Ko&&d&&m,I=v.x*g.y-v.y*g.x>0;if(A&&x>c){var z=h.dist(d);if(z>2*f){var M=h.sub(h.sub(d)._mult(f/z)._round());this.updateDistance(d,M),this.addCurrentVertex(M,v,0,0,y),d=M}}var P=d&&m,B=P?r:l?"butt":n;if(P&&"round"===B&&(S<o?B="miter":S<=2&&(B="fakeround")),"miter"===B&&S>i&&(B="bevel"),"bevel"===B&&(S>2&&(B="flipbevel"),S<i&&(B="miter")),d&&this.updateDistance(d,h),"miter"===B)b._mult(S),this.addCurrentVertex(h,b,0,0,y);else if("flipbevel"===B){if(S>100)b=g.mult(-1);else{var C=S*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(C*(I?-1:1))}this.addCurrentVertex(h,b,0,0,y),this.addCurrentVertex(h,b.mult(-1),0,0,y)}else if("bevel"===B||"fakeround"===B){var V=-Math.sqrt(S*S-1),F=I?V:0,T=I?0:V;if(d&&this.addCurrentVertex(h,v,F,T,y),"fakeround"===B)for(var E=Math.round(180*k/Math.PI/20),O=1;O<E;O++){var D=O/E;if(.5!==D){var L=D-.5;D+=D*L*(D-1)*((1.0904+w*(w*(3.55645-1.43519*w)-3.2452))*L*L+(.848013+w*(.215638*w-1.06021)))}var j=g.sub(v)._mult(D)._add(v)._unit()._mult(I?-1:1);this.addHalfVertex(h,j.x,j.y,!1,I,0,y)}m&&this.addCurrentVertex(h,g,-F,-T,y)}else if("butt"===B)this.addCurrentVertex(h,b,0,0,y);else if("square"===B){var U=d?1:-1;this.addCurrentVertex(h,b,U,U,y)}else"round"===B&&(d&&(this.addCurrentVertex(h,v,0,0,y),this.addCurrentVertex(h,v,1,1,y,!0)),m&&(this.addCurrentVertex(h,g,-1,-1,y,!0),this.addCurrentVertex(h,g,0,0,y)));if(A&&x<p-1){var q=h.dist(m);if(q>2*f){var R=h.add(m.sub(h)._mult(f/q)._round());this.updateDistance(h,R),this.addCurrentVertex(R,g,0,0,y),h=R}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},Xo.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,a,s,o,!1,r,i),this.addHalfVertex(t,u,l,o,!0,-n,i),this.distance>Go/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Xo.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6);var p=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),a.primitiveLength++),i?this.e2=p:this.e1=p},Xo.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Go-1):this.distance},Ae("LineBucket",Xo,{omit:["layers","patternFeatures"]});var Yo=new Jr({"line-cap":new Ur(Ve.layout_line["line-cap"]),"line-join":new qr(Ve.layout_line["line-join"]),"line-miter-limit":new Ur(Ve.layout_line["line-miter-limit"]),"line-round-limit":new Ur(Ve.layout_line["line-round-limit"]),"line-sort-key":new qr(Ve.layout_line["line-sort-key"])}),Ho={paint:new Jr({"line-opacity":new qr(Ve.paint_line["line-opacity"]),"line-color":new qr(Ve.paint_line["line-color"]),"line-translate":new Ur(Ve.paint_line["line-translate"]),"line-translate-anchor":new Ur(Ve.paint_line["line-translate-anchor"]),"line-width":new qr(Ve.paint_line["line-width"]),"line-gap-width":new qr(Ve.paint_line["line-gap-width"]),"line-offset":new qr(Ve.paint_line["line-offset"]),"line-blur":new qr(Ve.paint_line["line-blur"]),"line-dasharray":new Nr(Ve.paint_line["line-dasharray"]),"line-pattern":new Rr(Ve.paint_line["line-pattern"]),"line-gradient":new Zr(Ve.paint_line["line-gradient"])}),layout:Yo},Wo=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 Cr(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,o){return r=i({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,o)},e}(qr))(Ho.paint.properties["line-width"].specification);Wo.useIntegerZoom=!0;var $o=function(e){function r(t){e.call(this,t,Ho)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},r.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Fi(t,"lineProgress"),this.gradientTexture=null},r.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=Wo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},r.prototype.createBucket=function(t){return new Xo(t)},r.prototype.queryRadius=function(t){var e=t,r=Qo(di("line-width",this,e),di("line-gap-width",this,e)),n=di("line-offset",this,e);return r/2+Math.abs(n)+mi(this.paint.get("line-translate"))},r.prototype.queryIntersectsFeature=function(e,r,n,i,o,a,s){var u=vi(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Qo(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),p=this.paint.get("line-offset").evaluate(r,n);return p&&(i=function(e,r){for(var n=[],i=new t(0,0),o=0;o<e.length;o++){for(var a=e[o],s=[],u=0;u<a.length;u++){var l=a[u-1],p=a[u],c=a[u+1],h=0===u?i:p.sub(l)._unit()._perp(),f=u===a.length-1?i:c.sub(p)._unit()._perp(),y=h._add(f)._unit(),d=y.x*f.x+y.y*f.y;y._mult(1/d),s.push(y._mult(r)._add(p))}n.push(s)}return n}(i,p*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var o=0;o<i.length;o++)if(fi(t,i[o]))return!0;if(si(t,i,r))return!0}return!1}(u,i,l)},r.prototype.isTileClipped=function(){return!0},r}(Kr);function Qo(t,e){return e>0?e+2*t:t}var ta=Hr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),ea=Hr([{name:"a_projected_pos",components:3,type:"Float32"}],4),ra=(Hr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Hr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),na=(Hr([{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"}]),Hr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ia=Hr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Hr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Hr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),Hr([{type:"Float32",name:"offsetX"}]),Hr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function oa(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Br.applyArabicShaping&&(t=Br.applyArabicShaping(t)),t}(t.text,e,r)})),t}var aa={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂"};var sa=24,ua={horizontal:1,vertical:2,horizontalOnly:3},la=function(){this.text="",this.sectionIndex=[],this.sections=[]};function pa(t,e,r,n,i,o,a,s,u,l,p,c){var h,f=la.fromFeature(t,r);l===ua.vertical&&f.verticalizePunctuation();var y=Br.processBidirectionalText,d=Br.processStyledBidirectionalText;if(y&&1===f.sections.length){h=[];for(var m=0,v=y(f.toString(),ma(f,s,n,e,c));m<v.length;m+=1){var g=v[m],x=new la;x.text=g,x.sections=f.sections;for(var b=0;b<g.length;b++)x.sectionIndex.push(0);h.push(x)}}else if(d){h=[];for(var w=0,_=d(f.text,f.sectionIndex,ma(f,s,n,e,c));w<_.length;w+=1){var S=_[w],k=new la;k.text=S[0],k.sectionIndex=S[1],k.sections=f.sections,h.push(k)}}else h=function(t,e){for(var r=[],n=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(f,ma(f,s,n,e,c));var A=[],I={positionedGlyphs:A,text:f.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:l,lineCount:h.length,yOffset:-17};return function(t,e,r,n,i,o,a,s,u){for(var l=0,p=t.yOffset,c=0,h=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5,y=0,d=r;y<d.length;y+=1){var m=d[y];m.trim();var v=m.getMaxScale();if(m.length()){for(var g=h.length,x=0;x<m.length();x++){var b=m.getSection(x),w=m.getSectionIndex(x),_=m.getCharCode(x),S=24*(v-b.scale),k=e[b.fontStack],A=k&&k[_];A&&(a===ua.horizontal||!u&&!Ar(_)||u&&(ca[_]||(z=_,_r.Arabic(z)||_r["Arabic Supplement"](z)||_r["Arabic Extended-A"](z)||_r["Arabic Presentation Forms-A"](z)||_r["Arabic Presentation Forms-B"](z)))?(h.push({glyph:_,x:l,y:p+S,vertical:!1,scale:b.scale,fontStack:b.fontStack,sectionIndex:w}),l+=A.metrics.advance*b.scale+s):(h.push({glyph:_,x:l,y:p+S,vertical:!0,scale:b.scale,fontStack:b.fontStack,sectionIndex:w}),l+=sa*b.scale+s))}if(h.length!==g){var I=l-s;c=Math.max(I,c),ga(h,e,g,h.length-1,f)}l=0,p+=n*v}else p+=n}var z;var M=va(i),P=M.horizontalAlign,B=M.verticalAlign;!function(t,e,r,n,i,o,a){for(var s=(e-r)*i,u=(-n*a+.5)*o,l=0;l<t.length;l++)t[l].x+=s,t[l].y+=u}(h,f,P,B,c,n,r.length);var C=p-t.yOffset;t.top+=-B*C,t.bottom=t.top+C,t.left+=-P*c,t.right=t.left+c}(I,e,h,i,o,a,l,s,p),!!A.length&&I}la.fromFeature=function(t,e){for(var r=new la,n=0;n<t.sections.length;n++){var i=t.sections[n];r.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),r.text+=i.text;for(var o=0;o<i.text.length;o++)r.sectionIndex.push(n)}return r},la.prototype.length=function(){return this.text.length},la.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},la.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},la.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},la.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Ir(n)||aa[t[r+1]])&&(!i||!Ir(i)||aa[t[r-1]])&&aa[t[r]]?e+=aa[t[r]]:e+=t[r]}return e}(this.text)},la.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&ca[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&ca[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},la.prototype.substring=function(t,e){var r=new la;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},la.prototype.toString=function(){return this.text},la.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)};var ca={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ha={};function fa(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function ya(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function da(t,e,r,n,i,o){for(var a=null,s=fa(e,r,i,o),u=0,l=n;u<l.length;u+=1){var p=l[u],c=fa(e-p.x,r,i,o)+p.badness;c<=s&&(a=p,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function ma(t,e,r,n,i){if("point"!==i)return[];if(!t)return[];for(var o,a=[],s=function(t,e,r,n){for(var i=0,o=0;o<t.length();o++){var a=t.getSection(o),s=n[a.fontStack],u=s&&s[t.getCharCode(o)];u&&(i+=u.metrics.advance*a.scale+e)}return i/Math.max(1,Math.ceil(i/r))}(t,e,r,n),u=t.text.indexOf("​")>=0,l=0,p=0;p<t.length();p++){var c=t.getSection(p),h=t.getCharCode(p),f=n[c.fontStack],y=f&&f[h];if(y&&!ca[h]&&(l+=y.metrics.advance*c.scale+e),p<t.length()-1){var d=!!(!((o=h)<11904)&&(_r["Bopomofo Extended"](o)||_r.Bopomofo(o)||_r["CJK Compatibility Forms"](o)||_r["CJK Compatibility Ideographs"](o)||_r["CJK Compatibility"](o)||_r["CJK Radicals Supplement"](o)||_r["CJK Strokes"](o)||_r["CJK Symbols and Punctuation"](o)||_r["CJK Unified Ideographs Extension A"](o)||_r["CJK Unified Ideographs"](o)||_r["Enclosed CJK Letters and Months"](o)||_r["Halfwidth and Fullwidth Forms"](o)||_r.Hiragana(o)||_r["Ideographic Description Characters"](o)||_r["Kangxi Radicals"](o)||_r["Katakana Phonetic Extensions"](o)||_r.Katakana(o)||_r["Vertical Forms"](o)||_r["Yi Radicals"](o)||_r["Yi Syllables"](o)));(ha[h]||d)&&a.push(da(p+1,l,s,a,ya(h,t.getCharCode(p+1),d&&u),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(da(t.length(),l,s,a,0,!0))}function va(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 ga(t,e,r,n,i){if(i){var o=t[n],a=e[o.fontStack],s=a&&a[o.glyph];if(s)for(var u=s.metrics.advance*o.scale,l=(t[n].x+u)*i,p=r;p<=n;p++)t[p].x-=l}}function xa(t,e,r,n,i,o){var a,s,u,l,p=t.image,c=e.left*o,h=e.right*o;"width"===r||"both"===r?(l=i[0]+c-n[3],s=i[0]+h+n[1]):s=(l=i[0]+(c+h-p.displaySize[0])/2)+p.displaySize[0];var f=e.top*o,y=e.bottom*o;return"height"===r||"both"===r?(a=i[1]+f-n[0],u=i[1]+y+n[2]):u=(a=i[1]+(f+y-p.displaySize[1])/2)+p.displaySize[1],{image:p,top:a,right:s,bottom:u,left:l}}ha[10]=!0,ha[32]=!0,ha[38]=!0,ha[40]=!0,ha[41]=!0,ha[43]=!0,ha[45]=!0,ha[47]=!0,ha[173]=!0,ha[183]=!0,ha[8203]=!0,ha[8208]=!0,ha[8211]=!0,ha[8231]=!0;var ba=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(t);Ae("Anchor",ba);var wa=256;function _a(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Cr(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[o],u=n[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:r.evaluate(new Cr(s)),maxSize:r.evaluate(new Cr(u)),interpolationType:i}}var Sa=Fo.VectorTileFeature.types,ka=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Aa(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),o,a,s?s[0]:0,s?s[1]:0)}function Ia(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)}var za=function(t){this.layoutVertexArray=new nn,this.indexArray=new dn,this.programConfigurations=t,this.segments=new Fn,this.dynamicLayoutVertexArray=new on,this.opacityVertexArray=new an,this.placedSymbolArray=new Sn};za.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ta.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,ea.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,ka,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},za.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ae("SymbolBuffers",za);var Ma=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Fn,this.collisionVertexArray=new ln};Ma.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ra.members,!0)},Ma.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ae("CollisionBuffers",Ma);var Pa=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_a(this.zoom,e["text-size"]),this.iconSizeData=_a(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var o="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ua[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};Pa.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=Fa.hasPaintOverrides(t),this.text=new za(new Yn(ta.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new za(new Yn(ta.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.textCollisionBox=new Ma(un,na.members,mn),this.iconCollisionBox=new Ma(un,na.members,mn),this.textCollisionCircle=new Ma(un,ia.members,dn),this.iconCollisionCircle=new Ma(un,ia.members,dn),this.glyphOffsetArray=new zn,this.lineVertexArray=new Pn,this.symbolInstances=new An},Pa.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||n)&&i){var a=aa[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},Pa.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,i=n.get("text-font"),o=n.get("text-field"),a=n.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,l=n.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=e.availableImages,f=new Cr(this.zoom),y=0,d=t;y<d.length;y+=1){var m=d[y],v=m.feature,g=m.index,x=m.sourceLayerIndex;if(r._featureFilter(f,v)){var b=void 0;if(s){var w=r.getValueAndResolveTokens("text-field",v,h);b=oa(w instanceof q?w:q.fromString(w),r,v)}var _=void 0;if(u){var S=r.getValueAndResolveTokens("icon-image",v,h);_=S instanceof R?S:R.fromString(S)}if(b||_){var k=this.sortFeaturesByKey?l.evaluate(v,{}):void 0,A={text:b,icon:_,index:g,sourceLayerIndex:x,geometry:ei(v),properties:v.properties,type:Sa[v.type],sortKey:k};if(void 0!==v.id&&(A.id=v.id),this.features.push(A),_&&(p[_.name]=!0),b){var I=i.evaluate(v,{}).join(","),z="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ua.vertical)>=0;for(var M=0,P=b.sections;M<P.length;M+=1){var B=P[M],C=Sr(b.toString()),V=B.fontStack||I,F=c[V]=c[V]||{};this.calculateGlyphDependencies(B.text,F,z,this.allowVerticalPlacement,C)}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function o(e){n.push(t[e]),i++}function a(t,e,i){var o=r[t];return delete r[t],r[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(t,r,i){var o=e[r];return delete e[r],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.text?p.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=a(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null}else f in r?a(f,y,c):y in e?s(f,y,c):(o(l),e[f]=i-1,r[y]=i-1)}else o(l)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},Pa.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Pa.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Pa.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Pa.prototype.upload=function(t){this.uploaded||(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Pa.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},Pa.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=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:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Pa.prototype.addSymbols=function(t,e,r,n,i,o,a,s,u,l,p){var c=this,h=t.indexArray,f=t.layoutVertexArray,y=t.dynamicLayoutVertexArray,d=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,o.sortKey),m=this.glyphOffsetArray.length,v=d.vertexLength,g=this.allowVerticalPlacement&&a===ua.vertical?Math.PI/2:0,x=function(t){var e=t.tl,n=t.tr,i=t.bl,o=t.br,a=t.tex,u=d.vertexLength,l=t.glyphOffset[1];Aa(f,s.x,s.y,e.x,l+e.y,a.x,a.y,r),Aa(f,s.x,s.y,n.x,l+n.y,a.x+a.w,a.y,r),Aa(f,s.x,s.y,i.x,l+i.y,a.x,a.y+a.h,r),Aa(f,s.x,s.y,o.x,l+o.y,a.x+a.w,a.y+a.h,r),Ia(y,s,g),h.emplaceBack(u,u+1,u+2),h.emplaceBack(u+1,u+2,u+3),d.vertexLength+=4,d.primitiveLength+=2,c.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(o.text&&o.text.sections){var b=o.text.sections;if(this.hasPaintOverrides){for(var w,_=function(e,r){void 0===w||w===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},b[w]),w=e},S=0,k=e;S<k.length;S+=1){var A=k[S];_(A.sectionIndex,!1),x(A)}_(w,!0)}else{for(var I=0,z=e;I<z.length;I+=1){x(z[I])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},b[0])}}else{for(var M=0,P=e;M<P.length;M+=1){x(P[M])}t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,v,u,l,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,p)},Pa.prototype._addCollisionDebugVertex=function(t,e,r,n,i,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(o.x),Math.round(o.y))},Pa.prototype.addCollisionDebugVertices=function(e,r,n,i,o,a,s,u){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),p=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,a,f,y,new t(e,r)),this._addCollisionDebugVertex(c,h,a,f,y,new t(n,r)),this._addCollisionDebugVertex(c,h,a,f,y,new t(n,i)),this._addCollisionDebugVertex(c,h,a,f,y,new t(e,i)),l.vertexLength+=4,u){var d=o.indexArray;d.emplaceBack(p,p+1,p+2),d.emplaceBack(p,p+2,p+3),l.primitiveLength+=2}else{var m=o.indexArray;m.emplaceBack(p,p+1),m.emplaceBack(p+1,p+2),m.emplaceBack(p+2,p+3),m.emplaceBack(p+3,p),l.primitiveLength+=4}},Pa.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i),a=o.x1,s=o.y1,u=o.x2,l=o.y2,p=o.radius>0;this.addCollisionDebugVertices(a,s,u,l,p?n?this.textCollisionCircle:this.iconCollisionCircle:n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r,p)}},Pa.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},Pa.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,o,a,s,u){for(var l={},p=e;p<r;p++){var c=t.get(p);if(0===c.radius){l.textBox={x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,anchorPointX:c.anchorPointX,anchorPointY:c.anchorPointY},l.textFeatureIndex=c.featureIndex;break}l.textCircles||(l.textCircles=[],l.textFeatureIndex=c.featureIndex);l.textCircles.push(c.anchorPointX,c.anchorPointY,c.radius,c.signedDistanceFromAnchor,1)}for(var h=n;h<i;h++){var f=t.get(h);if(0===f.radius){l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}}for(var y=o;y<a;y++){var d=t.get(y);if(0===d.radius){l.iconBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},l.iconFeatureIndex=d.featureIndex;break}}for(var m=s;m<u;m++){var v=t.get(m);if(0===v.radius){l.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},l.verticalIconFeatureIndex=v.featureIndex;break}}return l},Pa.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Pa.prototype.hasTextData=function(){return this.text.segments.get().length>0},Pa.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Pa.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},Pa.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},Pa.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},Pa.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},Pa.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3)},Pa.prototype.addIndicesForPlacedIconSymbol=function(t){var e=this.icon.placedSymbolArray.get(t);if(e.numGlyphs){var r=e.vertexStartIndex;this.icon.indexArray.emplaceBack(r,r+1,r+2),this.icon.indexArray.emplaceBack(r+1,r+2,r+3)}},Pa.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),o},Pa.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedIconSymbol(o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedIconSymbol(o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ae("SymbolBucket",Pa,{omit:["layers","collisionBoxArray","features","compareText"]}),Pa.MAX_GLYPHS=65535,Pa.addDynamicAttributes=Ia;var Ba=new Jr({"symbol-placement":new Ur(Ve.layout_symbol["symbol-placement"]),"symbol-spacing":new Ur(Ve.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ur(Ve.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qr(Ve.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ur(Ve.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ur(Ve.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ur(Ve.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ur(Ve.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ur(Ve.layout_symbol["icon-rotation-alignment"]),"icon-size":new qr(Ve.layout_symbol["icon-size"]),"icon-text-fit":new Ur(Ve.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ur(Ve.layout_symbol["icon-text-fit-padding"]),"icon-image":new qr(Ve.layout_symbol["icon-image"]),"icon-rotate":new qr(Ve.layout_symbol["icon-rotate"]),"icon-padding":new Ur(Ve.layout_symbol["icon-padding"]),"icon-keep-upright":new Ur(Ve.layout_symbol["icon-keep-upright"]),"icon-offset":new qr(Ve.layout_symbol["icon-offset"]),"icon-anchor":new qr(Ve.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ur(Ve.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ur(Ve.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ur(Ve.layout_symbol["text-rotation-alignment"]),"text-field":new qr(Ve.layout_symbol["text-field"]),"text-font":new qr(Ve.layout_symbol["text-font"]),"text-size":new qr(Ve.layout_symbol["text-size"]),"text-max-width":new qr(Ve.layout_symbol["text-max-width"]),"text-line-height":new Ur(Ve.layout_symbol["text-line-height"]),"text-letter-spacing":new qr(Ve.layout_symbol["text-letter-spacing"]),"text-justify":new qr(Ve.layout_symbol["text-justify"]),"text-radial-offset":new qr(Ve.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ur(Ve.layout_symbol["text-variable-anchor"]),"text-anchor":new qr(Ve.layout_symbol["text-anchor"]),"text-max-angle":new Ur(Ve.layout_symbol["text-max-angle"]),"text-writing-mode":new Ur(Ve.layout_symbol["text-writing-mode"]),"text-rotate":new qr(Ve.layout_symbol["text-rotate"]),"text-padding":new Ur(Ve.layout_symbol["text-padding"]),"text-keep-upright":new Ur(Ve.layout_symbol["text-keep-upright"]),"text-transform":new qr(Ve.layout_symbol["text-transform"]),"text-offset":new qr(Ve.layout_symbol["text-offset"]),"text-allow-overlap":new Ur(Ve.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ur(Ve.layout_symbol["text-ignore-placement"]),"text-optional":new Ur(Ve.layout_symbol["text-optional"])}),Ca={paint:new Jr({"icon-opacity":new qr(Ve.paint_symbol["icon-opacity"]),"icon-color":new qr(Ve.paint_symbol["icon-color"]),"icon-halo-color":new qr(Ve.paint_symbol["icon-halo-color"]),"icon-halo-width":new qr(Ve.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qr(Ve.paint_symbol["icon-halo-blur"]),"icon-translate":new Ur(Ve.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ur(Ve.paint_symbol["icon-translate-anchor"]),"text-opacity":new qr(Ve.paint_symbol["text-opacity"]),"text-color":new qr(Ve.paint_symbol["text-color"],{runtimeType:P,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new qr(Ve.paint_symbol["text-halo-color"]),"text-halo-width":new qr(Ve.paint_symbol["text-halo-width"]),"text-halo-blur":new qr(Ve.paint_symbol["text-halo-blur"]),"text-translate":new Ur(Ve.paint_symbol["text-translate"]),"text-translate-anchor":new Ur(Ve.paint_symbol["text-translate-anchor"])}),layout:Ba},Va=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:A,this.defaultValue=t};Va.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Va.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Va.prototype.possibleOutputs=function(){return[void 0]},Va.prototype.serialize=function(){return null},Ae("FormatSectionOverride",Va,{omit:["defaultValue"]});var Fa=function(t){function e(e){t.call(this,e,Ca)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==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")&&("point"!==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")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o<a.length;o+=1){var s=a[o];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r){var n=this.layout.get(t).evaluate(e,{},r),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||ve(i.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,n)},e.prototype.createBucket=function(t){return new Pa(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Ca.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),o=new Va(i),a=new me(o,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new xe("source",a):new be("composite",a,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new Lr(i.property,s,i.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=Ca.paint.properties[e],i=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1){var o=r[e];if(n.overrides&&n.overrides.hasOverride(o))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof q)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){if(!i)if(t instanceof K&&Z(t.value)===F){var e=t.value;o(e.sections)}else t instanceof H?o(t.sections):t.eachChild(a)},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e.hasPaintOverrides=function(t){for(var r=0,n=Ca.paint.overridableProperties;r<n.length;r+=1){var i=n[r];if(e.hasPaintOverride(t,i))return!0}return!1},e}(Kr),Ta={paint:new Jr({"background-color":new Ur(Ve.paint_background["background-color"]),"background-pattern":new Nr(Ve.paint_background["background-pattern"]),"background-opacity":new Ur(Ve.paint_background["background-opacity"])})},Ea=function(t){function e(e){t.call(this,e,Ta)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Kr),Oa={paint:new Jr({"raster-opacity":new Ur(Ve.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ur(Ve.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ur(Ve.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ur(Ve.paint_raster["raster-brightness-max"]),"raster-saturation":new Ur(Ve.paint_raster["raster-saturation"]),"raster-contrast":new Ur(Ve.paint_raster["raster-contrast"]),"raster-resampling":new Ur(Ve.paint_raster["raster-resampling"]),"raster-fade-duration":new Ur(Ve.paint_raster["raster-fade-duration"])})},Da=function(t){function e(e){t.call(this,e,Oa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Kr),La=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Kr),ja={circle:ki,heatmap:Ti,hillshade:Oi,fill:So,"fill-extrusion":qo,line:$o,symbol:Fa,background:Ea,raster:Da};function Ua(t){return"custom"===t.type?new La(t):new ja[t.type](t)}var qa=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ra(t){var e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var r="[",n=0,i=t;n<i.length;n+=1){r+=Ra(i[n])+","}return r+"]"}for(var o=Object.keys(t).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+Ra(t[o[s]])+",";return a+"}"}function Na(t){for(var e="",r=0,n=qa;r<n.length;r+=1){e+="/"+Ra(t[n[r]])}return e}var Za=function(t){this.keyCache={},t&&this.replace(t)};Za.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},Za.prototype.update=function(t,e){for(var r=this,i=0,o=t;i<o.length;i+=1){var a=o[i];this._layerConfigs[a.id]=a;var s=this._layers[a.id]=Ua(a);s._featureFilter=Ke(s.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var u=0,l=e;u<l.length;u+=1){var p=l[u];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var c=0,h=function(t,e){for(var r={},n=0;n<t.length;n++){var i=e&&e[t[n].id]||Na(t[n]);e&&(e[t[n].id]=i);var o=r[i];o||(o=r[i]=[]),o.push(t[n])}var a=[];for(var s in r)a.push(r[s]);return a}(n(this._layerConfigs),this.keyCache);c<h.length;c+=1){var f=h[c].map((function(t){return r._layers[t.id]})),y=f[0];if("none"!==y.visibility){var d=y.source||"",m=this.familiesBySource[d];m||(m=this.familiesBySource[d]={});var v=y.sourceLayer||"_geojsonTileLayer",g=m[v];g||(g=m[v]=[]),g.push(f)}}};var Ja,Ka,Ga={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Xa={supported:!1,testSupport:function(t){if(Ya||!Ka)return;Ha?Wa(t):Ja=t}},Ya=!1,Ha=!1;function Wa(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Ka),t.isContextLost())return;Xa.supported=!0}catch(t){}t.deleteTexture(e),Ya=!0}self.document&&((Ka=self.document.createElement("img")).onload=function(){Ja&&Wa(Ja),Ja=null,Ha=!0},Ka.onerror=function(){Ya=!0,Ja=null},Ka.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function $a(t){return 0===t.indexOf("mapbox:")}var Qa=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ts(t){return Qa.test(t)}var es=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function rs(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var ns=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};ns.prototype.getStorageKey=function(t){var e,r=rs(Ga.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):n="",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},ns.prototype.fetchEventData=function(){var t=d("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){c("Unable to read from LocalStorage")}},ns.prototype.saveEventData=function(){var t=d("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){c("Unable to write to LocalStorage")}},ns.prototype.processRequests=function(t){},ns.prototype.postEvent=function(t,e,r,n){var o=this;if(Ga.EVENTS_URL){var a=function(t){var e=t.match(es);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("&"):[]}}(Ga.EVENTS_URL);a.params.push("access_token="+(n||Ga.ACCESS_TOKEN||""));var s,u,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.5.0",skuId:"01",userId:this.anonId},p=e?i(l,e):l,c={url:(s=a,u=s.params.length?"?"+s.params.join("&"):"",s.protocol+"://"+s.authority+s.path+u),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=xs(c,(function(t){o.pendingRequest=null,r(t),o.saveEventData(),o.processRequests(n)}))}},ns.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var is,os=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(Ga.EVENTS_URL&&n||Ga.ACCESS_TOKEN&&t.some((function(t){return $a(t)||ts(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),a(this.anonId)||(this.anonId=o()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(ns),as=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){Ga.EVENTS_URL&&Ga.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return $a(t)||ts(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=rs(Ga.ACCESS_TOKEN),n=r?r.u:Ga.ACCESS_TOKEN,i=n!==this.eventData.tokenU;a(this.anonId)||(this.anonId=o(),i=!0);var s=this.queue.shift();if(this.eventData.lastSuccess){var u=new Date(this.eventData.lastSuccess),l=new Date(s),p=(s-this.eventData.lastSuccess)/864e5;i=i||p>=1||p<-1||u.getDate()!==l.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(s,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=s,e.eventData.tokenU=n)}),t)}},e}(ns)),ss=(as.postTurnstileEvent.bind(as),new os),us=(ss.postMapLoadEvent.bind(ss),"mapbox-tiles"),ls=42e4;function ps(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=y(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<ls||function(t,e){if(void 0===is)try{new Response(new ReadableStream),is=!0}catch(t){is=!1}is?e(t.body):t.blob().then(e)}(e,(function(e){var r=new self.Response(e,n);self.caches.open(us).then((function(e){return e.put(cs(t.url),r)})).catch((function(t){return c(t.message)}))}))}}function cs(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function hs(t,e){if(!self.caches)return e(null);var r=cs(t.url);self.caches.open(us).then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),r=y(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var fs=function(t){function e(e,r,n){401===r&&ts(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function ys(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var ds=ys()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function ms(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:ds(),signal:n.signal}),o=!1,a=!1,s=(r=i.url).indexOf("sku=")>0&&ts(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&c(r),n&&o)return l(n);var u=Date.now();self.fetch(i).then((function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new fs(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&s&&ps(i,n,s),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){return e(new Error(t.message))}))};return s?hs(i,u):u(null,null),{cancel:function(){a=!0,o||n.abort()}}}var vs=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(ds())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return ms(t,e);if(ys()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new fs(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},gs=function(t,e){return vs(i(t,{type:"arrayBuffer"}),e)},xs=function(t,e){return vs(i(t,{method:"POST"}),e)},bs=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},ws=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<<l)-1,c=p>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},_s=Ss;function Ss(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ss.Varint=0,Ss.Fixed64=1,Ss.Bytes=2,Ss.Fixed32=5;var ks="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function As(t){return t.type===Ss.Bytes?t.readVarint()+t.pos:t.pos+1}function Is(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function zs(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Ms(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Ps(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Bs(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Cs(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Vs(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Fs(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Ts(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Es(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Os(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Ds(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ls(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function js(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Ss.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ds(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=js(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ds(this.buf,this.pos)+4294967296*Ds(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ds(this.buf,this.pos)+4294967296*js(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=bs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=bs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return Is(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return Is(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return Is(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return Is(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return Is(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return Is(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ks?function(t,e,r){return ks.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ss.Bytes)return t.push(this.readVarint(e));var r=As(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ss.Bytes)return t.push(this.readSVarint());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ss.Bytes)return t.push(this.readBoolean());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ss.Bytes)return t.push(this.readFloat());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ss.Bytes)return t.push(this.readDouble());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ss.Bytes)return t.push(this.readFixed32());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ss.Bytes)return t.push(this.readSFixed32());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ss.Bytes)return t.push(this.readFixed64());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ss.Bytes)return t.push(this.readSFixed64());var e=As(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ss.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ss.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ss.Fixed32)this.pos+=4;else{if(e!==Ss.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),Ls(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ls(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ls(this.buf,-1&t,this.pos),Ls(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ls(this.buf,-1&t,this.pos),Ls(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(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;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&zs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ws(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ws(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&zs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ss.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ps,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Vs,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Bs,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Cs,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Fs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ts,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Es,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Os,e)},writeBytesField:function(t,e){this.writeTag(t,Ss.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ss.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ss.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ss.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ss.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ss.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ss.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ss.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ss.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ss.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Us=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}};Us.prototype.encode=function(t){return this._stringToNumber[t]},Us.prototype.decode=function(t){return this._numberToString[t]};var qs=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Rs={geometry:{configurable:!0}};function Ns(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Rs.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},Rs.geometry.set=function(t){this._geometry=t},qs.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(qs.prototype,Rs);var Zs=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Zs.prototype.setNorthEast=function(t){return this._ne=t instanceof Js?new Js(t.lng,t.lat):Js.convert(t),this},Zs.prototype.setSouthWest=function(t){return this._sw=t instanceof Js?new Js(t.lng,t.lat):Js.convert(t),this},Zs.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Js)e=t,r=t;else{if(!(t instanceof Zs))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Zs.convert(t)):this.extend(Js.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Js(e.lng,e.lat),this._ne=new Js(r.lng,r.lat)),this},Zs.prototype.getCenter=function(){return new Js((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Zs.prototype.getSouthWest=function(){return this._sw},Zs.prototype.getNorthEast=function(){return this._ne},Zs.prototype.getNorthWest=function(){return new Js(this.getWest(),this.getNorth())},Zs.prototype.getSouthEast=function(){return new Js(this.getEast(),this.getSouth())},Zs.prototype.getWest=function(){return this._sw.lng},Zs.prototype.getSouth=function(){return this._sw.lat},Zs.prototype.getEast=function(){return this._ne.lng},Zs.prototype.getNorth=function(){return this._ne.lat},Zs.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Zs.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Zs.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Zs.convert=function(t){return!t||t instanceof Zs?t:new Zs(t)};var Js=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")};Js.prototype.wrap=function(){return new Js((t=this.lng,(i=((t-(e=-180))%(n=(r=180)-e)+n)%n+e)===e?r:i),this.lat);var t,e,r,n,i},Js.prototype.toArray=function(){return[this.lng,this.lat]},Js.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Js.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Zs(new Js(this.lng-r,this.lat-e),new Js(this.lng+r,this.lat+e))},Js.convert=function(t){if(t instanceof Js)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Js(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Js(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Ks=2*Math.PI*6378137;function Gs(t){return Ks*Math.cos(t*Math.PI/180)}function Xs(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Ys=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Ys.fromLngLat=function(t,e){void 0===e&&(e=0);var r,n=Js.convert(t);return new Ys((180+n.lng)/360,(r=n.lat,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),function(t,e){return t/Gs(e)}(e,n.lat))},Ys.prototype.toLngLat=function(){return new Js(360*this.x-180,Xs(this.y))},Ys.prototype.toAltitude=function(){return t=this.z,e=this.y,t*Gs(Xs(e));var t,e},Ys.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ks*(t=Xs(this.y),1/Math.cos(t*Math.PI/180));var t};var Hs=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Qs(0,t,e,r)};Hs.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Hs.prototype.url=function(t,e){var r,n,i,o,a,s=(r=this.x,n=this.y,i=this.z,o=Ns(256*r,256*(n=Math.pow(2,i)-n-1),i),a=Ns(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<<o-1)?1:0)+(r&n?2:0);return i}(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}",u).replace("{bbox-epsg-3857}",s)},Hs.prototype.getTilePoint=function(e){var r=Math.pow(2,this.z);return new t((e.x*r-this.x)*$n,(e.y*r-this.y)*$n)};var Ws=function(t,e){this.wrap=t,this.canonical=e,this.key=Qs(t,e.z,e.x,e.y)},$s=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Hs(r,+n,+i),this.key=Qs(e,t,n,i)};function Qs(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}$s.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},$s.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new $s(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new $s(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},$s.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},$s.prototype.children=function(t){if(this.overscaledZ>=t)return[new $s(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new $s(e,this.wrap,e,r,n),new $s(e,this.wrap,e,r+1,n),new $s(e,this.wrap,e,r,n+1),new $s(e,this.wrap,e,r+1,n+1)]},$s.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))},$s.prototype.wrapped=function(){return new $s(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},$s.prototype.unwrapTo=function(t){return new $s(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},$s.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},$s.prototype.toUnwrapped=function(){return new Ws(this.wrap,this.canonical)},$s.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},$s.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Ys(t.x-this.wrap,t.y))},Ae("CanonicalTileID",Hs),Ae("OverscaledTileID",$s,{omit:["posMatrix"]}),Hr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var tu=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 m($n,16,0),this.grid3D=new m($n,16,0),this.featureIndexArray=r||new Cn};function eu(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function ru(t,e){return e-t}function nu(t,e,r,n,i){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 u=[],l=0;s<r/2;){var p=t[a-1],c=t[a],h=t[a+1];if(!h)return!1;var f=p.angleTo(c)-c.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u[0].distance>n;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function iu(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function ou(t,e,r){return t?.6*e*r:0}function au(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function su(t,e,r,n,i,o){for(var a=ou(r,i,o),s=au(r,n)*o,u=0,l=iu(t)/2,p=0;p<t.length-1;p++){var c=t[p],h=t[p+1],f=c.dist(h);if(u+f>l){var y=(l-u)/f,d=ft(c.x,h.x,y),m=ft(c.y,h.y,y),v=new ba(d,m,h.angleTo(c),p);return v._round(),!a||nu(t,v,s,a,e)?v:void 0}u+=f}}function uu(t,e,r,n,i,o,a,s,u){var l=ou(n,o,a),p=au(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c<e/4&&(e=c+e/4),function t(e,r,n,i,o,a,s,u,l){var p=a/2;var c=iu(e);var h=0,f=r-n;var y=[];for(var d=0;d<e.length-1;d++){for(var m=e[d],v=e[d+1],g=m.dist(v),x=v.angleTo(m);f+n<h+g;){var b=((f+=n)-h)/g,w=ft(m.x,v.x,b),_=ft(m.y,v.y,b);if(w>=0&&w<l&&_>=0&&_<l&&f-p>=0&&f+p<=c){var S=new ba(w,_,x,d);S._round(),i&&!nu(e,S,a,i,o)||y.push(S)}}h+=g}u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l));return y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}tu.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],p=[1/0,1/0,-1/0,-1/0],c=0;c<l.length;c++){var h=l[c];p[0]=Math.min(p[0],h.x),p[1]=Math.min(p[1],h.y),p[2]=Math.max(p[2],h.x),p[3]=Math.max(p[3],h.y)}p[0]<$n&&p[1]<$n&&p[2]>=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},tu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Fo.VectorTile(new _s(this.rawTileData)).layers,this.sourceLayerCoder=new Us(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},tu.prototype.query=function(e,r,n){var i=this;this.loadVTLayers();for(var o=e.params||{},a=$n/e.tileSize/e.scale,s=Ke(o.filter),u=e.queryGeometry,l=e.queryPadding*a,p=eu(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=eu(e.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,(function(r,n,i,o){return function(e,r,n,i,o){for(var a=0,s=e;a<s.length;a+=1){var u=s[a];if(r<=u.x&&n<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new t(r,n),new t(r,o),new t(i,o),new t(i,n)];if(e.length>2)for(var p=0,c=l;p<c.length;p+=1){if(fi(e,c[p]))return!0}for(var h=0;h<e.length-1;h++){if(yi(e[h],e[h+1],l))return!0}return!1}(e.cameraQueryGeometry,r-l,n-l,i+l,o+l)})),y=0,d=f;y<d.length;y+=1){var m=d[y];c.push(m)}c.sort(ru);for(var v,g={},x=function(t){var l=c[t];if(l!==v){v=l;var p=i.featureIndexArray.get(l),h=null;i.loadMatchingFeature(g,p.bucketIndex,p.sourceLayerIndex,p.featureIndex,s,o.layers,r,(function(t,r){h||(h=ei(t));var o={};return t.id&&(o=n.getState(r.sourceLayer||"_geojsonTileLayer",t.id)),r.queryIntersectsFeature(u,t,o,h,i.z,e.transform,a,e.pixelPosMatrix)}))}},b=0;b<c.length;b++)x(b);return g},tu.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s){var u=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,u)){var l=this.sourceLayerCoder.decode(r),p=this.vtLayers[l].feature(n);if(i(new Cr(this.tileID.overscaledZ),p))for(var c=0;c<u.length;c++){var h=u[c];if(!(o&&o.indexOf(h)<0)){var f=a[h];if(f){var y=!s||s(p,f);if(y){var d=new qs(p,this.z,this.x,this.y);d.layer=f.serialize();var m=t[h];void 0===m&&(m=t[h]=[]),m.push({featureIndex:n,feature:d,intersectionZ:y})}}}}}},tu.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o){var a={};this.loadVTLayers();for(var s=Ke(n),u=0,l=t;u<l.length;u+=1){var p=l[u];this.loadMatchingFeature(a,e,r,p,s,i,o)}return a},tu.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1){if(t===i[n])return!0}return!1},Ae("FeatureIndex",tu,{omit:["rawTileData","sourceLayerCoder"]});var lu=3;function pu(e,r){var n=e.image,i=e.right-e.left,o=(i*n.paddedRect.w/(n.paddedRect.w-2)-i)/2,a=e.left-o,s=e.right+o,u=e.bottom-e.top,l=(u*n.paddedRect.h/(n.paddedRect.h-2)-u)/2,p=e.top-l,c=e.bottom+l,h=new t(a,p),f=new t(s,p),y=new t(s,c),d=new t(a,c),m=r*Math.PI/180;if(m){var v=Math.sin(m),g=Math.cos(m),x=[g,-v,v,g];h._matMult(x),f._matMult(x),d._matMult(x),y._matMult(x)}return[{tl:h,tr:f,bl:d,br:y,tex:n.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}var cu=function(e,r,n,i,o,a,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l;if(this.boxStartIndex=e.length,p){var v=y-f,g=m-d;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(e,r,n,n.segment,g,v,i,o,a,c))}else{if(h){var x=new t(d,f),b=new t(m,f),w=new t(d,y),_=new t(m,y),S=h*Math.PI/180;x._rotate(S),b._rotate(S),w._rotate(S),_._rotate(S),d=Math.min(x.x,b.x,w.x,_.x),m=Math.max(x.x,b.x,w.x,_.x),f=Math.min(x.y,b.y,w.y,_.y),y=Math.max(x.y,b.y,w.y,_.y)}e.emplaceBack(n.x,n.y,d,f,m,y,i,o,a,0,0)}this.boxEndIndex=e.length};cu.prototype._addLineCollisionCircles=function(t,e,r,n,i,o,a,s,u,l){var p=o/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-o/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m]}while(v>x);for(var b=e[m].dist(e[m+1]),w=-f;w<c+f;w++){var _=w*p,S=g+_;if(_<0&&(S+=_),_>i&&(S+=_-i),!(S<v)){for(;v+b<S;){if(v+=b,++m+1>=e.length)return;b=e[m].dist(e[m+1])}var k=S-v,A=e[m],I=e[m+1].sub(A)._unit()._mult(k)._add(A)._round(),z=Math.abs(S-y)<p?0:.8*(S-y);t.emplaceBack(I.x,I.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,z)}}};var hu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=fu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function fu(t,e){return t<e?-1:t>e?1:0}function yu(e,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=e[0],l=0;l<u.length;l++){var p=u[l];(!l||p.x<i)&&(i=p.x),(!l||p.y<o)&&(o=p.y),(!l||p.x>a)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=a-i,h=s-o,f=Math.min(c,h),y=f/2,d=new hu([],du);if(0===f)return new t(i,o);for(var m=i;m<a;m+=f)for(var v=o;v<s;v+=f)d.push(new mu(m+y,v+y,y,e));for(var g=function(t){for(var e=0,r=0,n=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],p=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*p,n+=(u.y+l.y)*p,e+=3*p}return new mu(r/e,n/e,0,t)}(e),x=d.length;d.length;){var b=d.pop();(b.d>g.d||!g.d)&&(g=b,n&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-g.d<=r||(y=b.h/2,d.push(new mu(b.p.x-y,b.p.y-y,y,e)),d.push(new mu(b.p.x+y,b.p.y-y,y,e)),d.push(new mu(b.p.x-y,b.p.y+y,y,e)),d.push(new mu(b.p.x+y,b.p.y+y,y,e)),x+=4)}return n&&(console.log("num probes: "+x),console.log("best distance: "+g.d)),g.p}function du(t,e){return e.max-t.max}function mu(e,r,n,i){this.p=new t(e,r),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],p=o[u];l.y>t.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,ci(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}hu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},hu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},hu.prototype.peek=function(){return this.data[0]},hu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},hu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var vu=x((function(t){t.exports=function(t,e){var r,n,i,o,a,s,u,l;for(r=3&t.length,n=t.length-r,i=e,a=3432918353,s=461845907,l=0;l<n;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),gu=x((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),xu=vu,bu=vu,wu=gu;xu.murmur3=bu,xu.murmur2=wu;var _u=7,Su=Number.POSITIVE_INFINITY;function ku(e,r,n,i,o,a){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=$n/s,e.compareText={},e.iconsNeedLinear=!1;var u=e.layers[0].layout,l=e.layers[0]._unevaluatedLayout._values,p={};if("composite"===e.textSizeData.kind){var h=e.textSizeData,f=h.minZoom,y=h.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Cr(f)),l["text-size"].possiblyEvaluate(new Cr(y))]}if("composite"===e.iconSizeData.kind){var d=e.iconSizeData,m=d.minZoom,v=d.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Cr(m)),l["icon-size"].possiblyEvaluate(new Cr(v))]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Cr(e.zoom+1)),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Cr(e.zoom+1)),p.textMaxSize=l["text-size"].possiblyEvaluate(new Cr(18));for(var g=u.get("text-line-height")*sa,x="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),b=u.get("text-keep-upright"),w=function(){var a,s,l=S[_],h=u.get("text-font").evaluate(l,{}).join(","),f=n,y={horizontal:{},vertical:void 0},d=l.text,m=[0,0];if(d){var v=d.toString(),w=u.get("text-letter-spacing").evaluate(l,{})*sa,k=function(t){for(var e=0,r=t;e<r.length;e+=1){if(!kr(r[e].charCodeAt(0)))return!1}return!0}(v)?w:0,A=u.get("text-anchor").evaluate(l,{}),I=u.get("text-variable-anchor");if(!I){var z=u.get("text-radial-offset").evaluate(l,{});z?(a=A,m=(s=[z*sa,Su])[1]!==Su?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-_u;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+_u}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(a,s[0],s[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-_u;break;case"bottom-right":case"bottom-left":n=-i+_u;break;case"bottom":n=-e+_u;break;case"top":n=e-_u}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(a,s[0])):m=u.get("text-offset").evaluate(l,{}).map((function(t){return t*sa}))}var M=x?"center":u.get("text-justify").evaluate(l,{}),P=u.get("symbol-placement"),B="point"===P?u.get("text-max-width").evaluate(l,{})*sa:0,C=function(){e.allowVerticalPlacement&&Sr(v)&&(y.vertical=pa(d,r,h,B,g,A,"left",k,m,ua.vertical,!0,P))};if(!x&&I){for(var V="auto"===M?I.map((function(t){return Au(t)})):[M],F=!1,T=0;T<V.length;T++){var E=V[T];if(!y.horizontal[E])if(F)y.horizontal[E]=y.horizontal[0];else{var O=pa(d,r,h,B,g,"center",E,k,m,ua.horizontal,!1,P);O&&(y.horizontal[E]=O,F=1===O.lineCount)}}C()}else{"auto"===M&&(M=Au(A));var D=pa(d,r,h,B,g,A,M,k,m,ua.horizontal,!1,P);D&&(y.horizontal[M]=D),C(),Sr(v)&&x&&b&&(y.vertical=pa(d,r,h,B,g,A,M,k,m,ua.vertical,!1,P))}}var L=void 0;if(l.icon&&l.icon.name){var j=i[l.icon.name];j&&(L=function(t,e,r){var n=va(r),i=n.horizontalAlign,o=n.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,l=u+t.displaySize[0],p=s-t.displaySize[1]*o;return{image:t,top:p,bottom:p+t.displaySize[1],left:u,right:l}}(o[l.icon.name],u.get("icon-offset").evaluate(l,{}),u.get("icon-anchor").evaluate(l,{})),void 0===e.sdfIcons?e.sdfIcons=j.sdf:e.sdfIcons!==j.sdf&&c("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),j.pixelRatio!==e.pixelRatio?e.iconsNeedLinear=!0:0!==u.get("icon-rotate").constantOr(1)&&(e.iconsNeedLinear=!0))}(Object.keys(y.horizontal).length||L)&&function(e,r,n,i,o,a,s){var u=a.layoutTextSize.evaluate(r,{}),l=a.layoutIconSize.evaluate(r,{}),p=a.textMaxSize.evaluate(r,{});void 0===p&&(p=u);var h,f=e.layers[0].layout,y=f.get("icon-offset").evaluate(r,{}),d=function(t){for(var e in t)return t[e];return null}(n.horizontal),m=u/24,v=e.tilePixelRatio*m,g=e.tilePixelRatio*p/24,x=e.tilePixelRatio*l,b=e.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*e.tilePixelRatio,_=f.get("icon-padding")*e.tilePixelRatio,S=f.get("text-max-angle")/180*Math.PI,k="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),A="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),I=f.get("symbol-placement"),z=b/2,M=f.get("icon-text-fit");i&&"none"!==M&&(e.allowVerticalPlacement&&n.vertical&&(h=xa(i,n.vertical,M,f.get("icon-text-fit-padding"),y,m)),d&&(i=xa(i,d,M,f.get("icon-text-fit-padding"),y,m)));var P=function(t,u){u.x<0||u.x>=$n||u.y<0||u.y>=$n||function(t,e,r,n,i,o,a,s,u,l,p,h,f,y,d,m,v,g,x,b,w,_){var S,k,A,I,z,M=t.addToLineVertexArray(e,r),P=0,B=0,C=0,V=0,F=-1,T=-1,E={},O=xu(""),D=0,L=0;void 0===a._unevaluatedLayout.getValue("text-radial-offset")?(S=a.layout.get("text-offset").evaluate(b,{}).map((function(t){return t*sa})),D=S[0],L=S[1]):(D=a.layout.get("text-radial-offset").evaluate(b,{})*sa,L=Su);if(t.allowVerticalPlacement&&n.vertical){var j=a.layout.get("text-rotate").evaluate(b,{})+90,U=n.vertical;I=new cu(s,r,e,u,l,p,U,h,f,y,t.overscaling,j),o&&(z=new cu(s,r,e,u,l,p,o,m,v,y,t.overscaling,j))}if(i){var q=a.layout.get("icon-rotate").evaluate(b,{}),R=pu(i,q),N=o?pu(o,q):void 0;A=new cu(s,r,e,u,l,p,i,m,v,!1,t.overscaling,q),P=4*R.length;var Z=t.iconSizeData,J=null;"source"===Z.kind?(J=[wa*a.layout.get("icon-size").evaluate(b,{})])[0]>Iu&&c(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===Z.kind&&((J=[wa*_.compositeIconSizes[0].evaluate(b,{}),wa*_.compositeIconSizes[1].evaluate(b,{})])[0]>Iu||J[1]>Iu)&&c(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,R,J,x,g,b,!1,e,M.lineStartIndex,M.lineLength,-1),F=t.icon.placedSymbolArray.length-1,N&&(B=4*N.length,t.addSymbols(t.icon,N,J,x,g,b,ua.vertical,e,M.lineStartIndex,M.lineLength,-1),T=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var G=n.horizontal[K];if(!k){O=xu(G.text);var X=a.layout.get("text-rotate").evaluate(b,{});k=new cu(s,r,e,u,l,p,G,h,f,y,t.overscaling,X)}var Y=1===G.lineCount;if(C+=zu(t,e,G,a,y,b,d,M,n.vertical?ua.horizontal:ua.horizontalOnly,Y?Object.keys(n.horizontal):[K],E,w,F,_),Y)break}n.vertical&&(V+=zu(t,e,n.vertical,a,y,b,d,M,ua.vertical,["vertical"],E,w,T,_));var H=k?k.boxStartIndex:t.collisionBoxArray.length,W=k?k.boxEndIndex:t.collisionBoxArray.length,$=I?I.boxStartIndex:t.collisionBoxArray.length,Q=I?I.boxEndIndex:t.collisionBoxArray.length,tt=A?A.boxStartIndex:t.collisionBoxArray.length,et=A?A.boxEndIndex:t.collisionBoxArray.length,rt=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=Pa.MAX_GLYPHS&&c("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");t.symbolInstances.emplaceBack(e.x,e.y,E.right>=0?E.right:-1,E.center>=0?E.center:-1,E.left>=0?E.left:-1,E.vertical||-1,F,T,O,H,W,$,Q,tt,et,rt,nt,u,C,V,P,B,0,h,D,L)}(e,u,t,n,i,h,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,v,w,k,s,x,_,A,y,r,o,a)};if("line"===I)for(var B=0,C=function(e,r,n,i,o){for(var a=[],s=0;s<e.length;s++)for(var u=e[s],l=void 0,p=0;p<u.length-1;p++){var c=u[p],h=u[p+1];c.x<r&&h.x<r||(c.x<r?c=new t(r,c.y+(h.y-c.y)*((r-c.x)/(h.x-c.x)))._round():h.x<r&&(h=new t(r,c.y+(h.y-c.y)*((r-c.x)/(h.x-c.x)))._round()),c.y<n&&h.y<n||(c.y<n?c=new t(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round():h.y<n&&(h=new t(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round()),c.x>=i&&h.x>=i||(c.x>=i?c=new t(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round():h.x>=i&&(h=new t(i,c.y+(h.y-c.y)*((i-c.x)/(h.x-c.x)))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new t(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round():h.y>=o&&(h=new t(c.x+(h.x-c.x)*((o-c.y)/(h.y-c.y)),o)._round()),l&&c.equals(l[l.length-1])||(l=[c],a.push(l)),l.push(h)))))}return a}(r.geometry,0,0,$n,$n);B<C.length;B+=1)for(var V=C[B],F=uu(V,b,S,n.vertical||d,i,24,g,e.overscaling,$n),T=0,E=F;T<E.length;T+=1){var O=E[T],D=d;D&&Mu(e,D.text,z,O)||P(V,O)}else if("line-center"===I)for(var L=0,j=r.geometry;L<j.length;L+=1){var U=j[L];if(U.length>1){var q=su(U,S,n.vertical||d,i,24,g);q&&P(U,q)}}else if("Polygon"===r.type)for(var R=0,N=mo(r.geometry,0);R<N.length;R+=1){var Z=N[R],J=yu(Z,16);P(Z[0],new ba(J.x,J.y,0))}else if("LineString"===r.type)for(var K=0,G=r.geometry;K<G.length;K+=1){var X=G[K];P(X,new ba(X[0].x,X[0].y,0))}else if("Point"===r.type)for(var Y=0,H=r.geometry;Y<H.length;Y+=1)for(var W=H[Y],$=0,Q=W;$<Q.length;$+=1){var tt=Q[$];P([tt],new ba(tt.x,tt.y,0))}}(e,l,y,L,f,p,m)},_=0,S=e.features;_<S.length;_+=1)w();a&&e.generateCollisionDebugBuffers()}function Au(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Iu=65535;function zu(e,r,n,i,o,a,s,u,l,p,h,f,y,d){var m=function(e,r,n,i,o,a,s,u){for(var l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,p=r.positionedGlyphs,c=[],h=0;h<p.length;h++){var f=p[h],y=s[f.fontStack],d=y&&y[f.glyph];if(d){var m=d.rect;if(m){var v=lu+1,g=d.metrics.advance*f.scale/2,x=o?[f.x+g,f.y]:[0,0],b=o?[0,0]:[f.x+g+n[0],f.y+n[1]],w=(o||u)&&f.vertical,_=[0,0];w&&(_=b,b=[0,0]);var S=(d.metrics.left-v)*f.scale-g+b[0],k=(-d.metrics.top-v)*f.scale+b[1],A=S+m.w*f.scale,I=k+m.h*f.scale,z=new t(S,k),M=new t(A,k),P=new t(S,I),B=new t(A,I);if(w){var C=new t(-g,g-r.yOffset),V=-Math.PI/2,F=sa/2-g,T=new t(5-r.yOffset-F,0),E=new(Function.prototype.bind.apply(t,[null].concat(_)));z._rotateAround(V,C)._add(T)._add(E),M._rotateAround(V,C)._add(T)._add(E),P._rotateAround(V,C)._add(T)._add(E),B._rotateAround(V,C)._add(T)._add(E)}if(l){var O=Math.sin(l),D=Math.cos(l),L=[D,-O,O,D];z._matMult(L),M._matMult(L),P._matMult(L),B._matMult(L)}c.push({tl:z,tr:M,bl:P,br:B,tex:m,writingMode:r.writingMode,glyphOffset:x,sectionIndex:f.sectionIndex})}}}return c}(0,n,s,i,o,a,f,e.allowVerticalPlacement),v=e.textSizeData,g=null;"source"===v.kind?(g=[wa*i.layout.get("text-size").evaluate(a,{})])[0]>Iu&&c(e.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===v.kind&&((g=[wa*d.compositeTextSizes[0].evaluate(a,{}),wa*d.compositeTextSizes[1].evaluate(a,{})])[0]>Iu||g[1]>Iu)&&c(e.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),e.addSymbols(e.text,m,g,s,o,a,l,r,u.lineStartIndex,u.lineLength,y);for(var x=0,b=p;x<b.length;x+=1){h[b[x]]=e.text.placedSymbolArray.length-1}return 4*m.length}function Mu(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}else i[e]=[];return i[e].push(n),!1}function Pu(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,p=t;l<p.length;l+=1)for(var c=p[l],h=a.length-1;h>=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h<a.length&&(a[h]=y)}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(a.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}var Bu=function(t,e){var r=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=n},Cu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Cu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Cu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Cu.tlbr.get=function(){return this.tl.concat(this.br)},Cu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Bu.prototype,Cu);var Vu=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Pu(i),a=o.w,s=o.h,u=new Ci({width:a||1,height:s||1});for(var l in t){var p=t[l],c=r[l].paddedRect;Ci.copy(p.data,u,{x:0,y:0},{x:c.x+1,y:c.y+1},p.data)}for(var h in e){var f=e[h],y=n[h].paddedRect,d=y.x+1,m=y.y+1,v=f.data.width,g=f.data.height;Ci.copy(f.data,u,{x:0,y:0},{x:d,y:m},f.data),Ci.copy(f.data,u,{x:0,y:g-1},{x:d,y:m-1},{width:v,height:1}),Ci.copy(f.data,u,{x:0,y:0},{x:d,y:m+g},{width:v,height:1}),Ci.copy(f.data,u,{x:v-1,y:0},{x:d-1,y:m},{width:1,height:g}),Ci.copy(f.data,u,{x:0,y:0},{x:d+v,y:m},{width:1,height:g})}this.image=u,this.iconPositions=r,this.patternPositions=n};Vu.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new Bu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Vu.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Vu.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],o=n[1];r.update(e.data,void 0,{x:i,y:o})}},Ae("ImagePosition",Bu),Ae("ImageAtlas",Vu);var Fu=function(t){var e={},r=[];for(var n in t){var i=t[n],o=e[n]={};for(var a in i){var s=i[+a];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var u={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2};r.push(u),o[a]={rect:u,metrics:s.metrics}}}}var l=Pu(r),p=l.w,c=l.h,h=new Bi({width:p||1,height:c||1});for(var f in t){var y=t[f];for(var d in y){var m=y[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var v=e[f][d].rect;Bi.copy(m.bitmap,h,{x:0,y:0},{x:v.x+1,y:v.y+1},m.bitmap)}}}this.image=h,this.positions=e};Ae("GlyphAtlas",Fu);var Tu=function(t){this.tileID=new $s(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies};function Eu(t,e,r){for(var n=new Cr(e),i=0,o=t;i<o.length;i+=1){o[i].recalculate(n,r)}}Tu.prototype.parse=function(t,e,r,i,o){var a=this;this.status="parsing",this.data=t,this.collisionBoxArray=new wn;var s=new Us(Object.keys(t.layers).sort()),l=new tu(this.tileID);l.bucketLayerIDs=[];var p,h,f,y,d={},m={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},v=e.familiesBySource[this.source];for(var g in v){var x=t.layers[g];if(x){1===x.version&&c('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=s.encode(g),w=[],_=0;_<x.length;_++){var S=x.feature(_);w.push({feature:S,index:_,sourceLayerIndex:b})}for(var k=0,A=v[g];k<A.length;k+=1){var I=A[k],z=I[0];if(!(z.minzoom&&this.zoom<Math.floor(z.minzoom)))if(!(z.maxzoom&&this.zoom>=z.maxzoom))if("none"!==z.visibility)Eu(I,this.zoom,r),(d[z.id]=z.createBucket({index:l.bucketLayerIDs.length,layers:I,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,m),l.bucketLayerIDs.push(I.map((function(t){return t.id})))}}}var M=u(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?i.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){p||(p=t,h=e,C.call(a))})):h={};var P=Object.keys(m.iconDependencies);P.length?i.send("getImages",{icons:P},(function(t,e){p||(p=t,f=e,C.call(a))})):f={};var B=Object.keys(m.patternDependencies);function C(){if(p)return o(p);if(h&&f&&y){var t=new Fu(h),e=new Vu(f,y);for(var i in d){var a=d[i];a instanceof Pa?(Eu(a.layers,this.zoom,r),ku(a,h,t.positions,f,e.iconPositions,this.showCollisionBoxes)):a.hasPattern&&(a instanceof Xo||a instanceof bo||a instanceof Do)&&(Eu(a.layers,this.zoom,r),a.addFeatures(m,e.patternPositions))}this.status="done",o(null,{buckets:n(d).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null})}}B.length?i.send("getImages",{icons:B},(function(t,e){p||(p=t,y=e,C.call(a))})):y={},C.call(this)};var Ou="undefined"!=typeof performance,Du={getEntriesByName:function(t){return!!(Ou&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(Ou&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(Ou&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(Ou&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(Ou&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},Lu=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Du.mark(this._marks.start)};function ju(t,e){var r=gs(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new Fo.VectorTile(new _s(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Lu.prototype.finish=function(){Du.mark(this._marks.end);var t=Du.getEntriesByName(this._marks.measure);return 0===t.length&&(Du.measure(this._marks.measure,this._marks.start,this._marks.end),t=Du.getEntriesByName(this._marks.measure),Du.clearMarks(this._marks.start),Du.clearMarks(this._marks.end),Du.clearMeasures(this._marks.measure)),t},Du.Performance=Lu;var Uu=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||ju,this.loading={},this.loaded={}};Uu.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new Du.Performance(t.request),a=this.loading[n]=new Tu(t);a.abort=this.loadVectorData(t,(function(t,s){if(delete r.loading[n],t||!s)return a.status="done",r.loaded[n]=a,e(t);var u=s.rawData,l={};s.expires&&(l.expires=s.expires),s.cacheControl&&(l.cacheControl=s.cacheControl);var p={};if(o){var c=o.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,i({rawTileData:u.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=a}))},Uu.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},Uu.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Uu.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var qu=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return c('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};qu.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},qu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},qu.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},qu.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},qu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},qu.prototype.getPixels=function(){return new Ci({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},qu.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var p=n;p<i;p++)this.data[this._idx(p,l)]=t.data[this._idx(p+s,l+u)]},Ae("DEMData",qu);var Ru=function(){this.loaded={}};Ru.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=new qu(r,i,n);this.loaded=this.loaded||{},this.loaded[r]=o,e(null,o)},Ru.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Nu={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function Zu(t){var e=0;if(t&&t.length>0){e+=Math.abs(Ju(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(Ju(t[r]))}return e}function Ju(t){var e,r,n,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(n=u-2,i=u-1,o=0):a===u-1?(n=u-1,i=0,o=1):(n=a,i=a+1,o=a+2),e=t[n],r=t[i],s+=(Ku(t[o][0])-Ku(e[0]))*Math.sin(Ku(r[1]));s=s*Nu.RADIUS*Nu.RADIUS/2}return s}function Ku(t){return t*Math.PI/180}var Gu={geometry:function t(e){var r,n=0;switch(e.type){case"Polygon":return Zu(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=Zu(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},ring:Ju},Xu=function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(Yu(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(Yu(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){"Polygon"===t.type?t.coordinates=Hu(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(Yu(Hu,e)));return t}(e,r);default:return e}};function Yu(t,e){return function(r){return t(r,e)}}function Hu(t,e){e=!!e,t[0]=Wu(t[0],e);for(var r=1;r<t.length;r++)t[r]=Wu(t[r],!e);return t}function Wu(t,e){return function(t){return Gu.ring(t)>=0}(t)===e?t:t.reverse()}var $u=Fo.VectorTileFeature.prototype.toGeoJSON,Qu=function(t){this._feature=t,this.extent=$n,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Qu.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,p=s[a];l<p.length;l+=1){var c=p[l];u.push(new t(c[0],c[1]))}o.push(u)}return o},Qu.prototype.toGeoJSON=function(t,e,r){return $u.call(this,t,e,r)};var tl=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=$n,this.length=t.length,this._features=t};tl.prototype.feature=function(t){return new Qu(this._features[t])};var el=rl;function rl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}rl.Varint=0,rl.Fixed64=1,rl.Bytes=2,rl.Fixed32=5;function nl(t){return t.type===rl.Bytes?t.readVarint()+t.pos:t.pos+1}function il(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ol(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function al(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function sl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function ul(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function ll(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function pl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function cl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function hl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function fl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function yl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function dl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ml(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function vl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}rl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=dl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=vl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*dl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*vl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=bs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=bs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return il(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return il(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return il(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return il(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return il(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return il(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,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){if(this.type!==rl.Bytes)return t.push(this.readVarint(e));var r=nl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==rl.Bytes)return t.push(this.readSVarint());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==rl.Bytes)return t.push(this.readBoolean());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==rl.Bytes)return t.push(this.readFloat());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==rl.Bytes)return t.push(this.readDouble());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==rl.Bytes)return t.push(this.readFixed32());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==rl.Bytes)return t.push(this.readSFixed32());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==rl.Bytes)return t.push(this.readFixed64());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==rl.Bytes)return t.push(this.readSFixed64());var e=nl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===rl.Varint)for(;this.buf[this.pos++]>127;);else if(e===rl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===rl.Fixed32)this.pos+=4;else{if(e!==rl.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),ml(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ml(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ml(this.buf,-1&t,this.pos),ml(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ml(this.buf,-1&t,this.pos),ml(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(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;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&ol(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ws(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ws(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&ol(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,rl.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,fl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,yl,e)},writeBytesField:function(t,e){this.writeTag(t,rl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,rl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,rl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,rl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,rl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,rl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,rl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,rl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,rl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,rl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var gl=Fo.VectorTileFeature,xl=bl;function bl(t,e){this.options=e||{},this.features=t,this.length=t.length}function wl(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}bl.prototype.feature=function(t){return new wl(this.features[t],this.options.extent)},wl.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],o=0;o<n.length;o++)i.push(new t(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},wl.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]},wl.prototype.toGeoJSON=gl.prototype.toGeoJSON;var _l=Il,Sl=Il,kl=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new xl(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return Il({layers:r})},Al=xl;function Il(t){var e=new el;return function(t,e){for(var r in t.layers)e.writeMessage(3,zl,t.layers[r])}(t,e),e.finish()}function zl(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,Ml,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,Fl,o[r])}function Ml(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,Pl,t),e.writeVarintField(3,r.type),e.writeMessage(4,Vl,r)}function Pl(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=o[s];void 0===u&&(n.push(s),u=n.length-1,o[s]=u),e.writeVarint(u);var l=r.properties[s],p=typeof l;"string"!==p&&"boolean"!==p&&"number"!==p&&(l=JSON.stringify(l));var c=p+":"+l,h=a[c];void 0===h&&(i.push(l),h=i.length-1,a[c]=h),e.writeVarint(h)}}function Bl(t,e){return(e<<3)+(7&t)}function Cl(t){return t<<1^t>>31}function Vl(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],l=1;1===n&&(l=u.length),e.writeVarint(Bl(1,l));for(var p=3===n?u.length-1:u.length,c=0;c<p;c++){1===c&&1!==n&&e.writeVarint(Bl(2,p-1));var h=u[c].x-i,f=u[c].y-o;e.writeVarint(Cl(h)),e.writeVarint(Cl(f)),i+=h,o+=f}3===n&&e.writeVarint(Bl(7,1))}}function Fl(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 Tl(t,e,r,n,i,o){if(!(i-n<=r)){var a=n+i>>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*p/s+c)),f=Math.min(o,Math.floor(n+(s-u)*p/s+c));t(e,r,n,h,f,a)}var y=r[2*n+a],d=i,m=o;for(El(e,r,i,n),r[2*o+a]>y&&El(e,r,i,o);d<m;){for(El(e,r,d,m),d++,m--;r[2*d+a]<y;)d++;for(;r[2*m+a]>y;)m--}r[2*i+a]===y?El(e,r,i,m):El(e,r,++m,o),m<=n&&(i=m+1),n<=m&&(o=m-1)}}(t,e,a,n,i,o%2),Tl(t,e,r,n,a-1,o+1),Tl(t,e,r,a+1,i,o+1)}}function El(t,e,r,n){Ol(t,r,n),Ol(e,2*r,2*n),Ol(e,2*r+1,2*n+1)}function Ol(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Dl(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}_l.fromVectorTileJs=Sl,_l.fromGeojsonVt=kl,_l.GeoJSONWrapper=Al;var Ll=function(t){return t[0]},jl=function(t){return t[1]},Ul=function(t,e,r,n,i){void 0===e&&(e=Ll),void 0===r&&(r=jl),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=r(t[u]);Tl(a,s,n,0,a.length-1,0)};Ul.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],p=[];l.length;){var c=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var y=f;y<=h;y++)s=e[2*y],u=e[2*y+1],s>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);s=e[2*d],u=e[2*d+1],s>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},Ul.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)Dl(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];Dl(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var ql={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},Rl=function(t){this.options=Yl(Object.create(ql),t),this.trees=new Array(this.options.maxZoom+1)};function Nl(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function Zl(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:Gl(n),y:Xl(i),zoom:1/0,index:e,parentId:-1}}function Jl(t){return{type:"Feature",id:t.id,properties:Kl(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function Kl(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Yl(Yl({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Gl(t){return t/360+.5}function Xl(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 Yl(t,e){for(var r in e)t[r]=e[r];return t}function Hl(t){return t.x}function Wl(t){return t.y}function $l(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function Ql(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,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)tp(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)tp(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)tp(t,e[n][i])}(i),i}function tp(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 ep(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),"Point"===o)rp(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)rp(i[l],s);else if("LineString"===o)np(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(l=0;l<i.length;l++)s=[],np(i[l],s,a,!1),t.push(Ql(u,"LineString",s,e.properties));return}ip(i,s,a,!1)}else if("Polygon"===o)ip(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)ep(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var p=[];ip(i[l],p,a,!0),s.push(p)}}t.push(Ql(u,o,s,e.properties))}}function rp(t,e){e.push(op(t[0])),e.push(ap(t[1])),e.push(0)}function np(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var u=op(t[s][0]),l=ap(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;f<n;f+=3){var y=$l(e[f],e[f+1],l,p,c,h);if(y>a)o=f,a=y;else if(y===a){var d=Math.abs(f-s);d<u&&(o=f,u=d)}}a>i&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function ip(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];np(t[i],o,r,n),e.push(o)}}function op(t){return t/360+.5}function ap(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 sp(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a<n)return t;if(a<r||o>=n)return null;for(var u=[],l=0;l<t.length;l++){var p=t[l],c=p.geometry,h=p.type,f=0===i?p.minX:p.minY,y=0===i?p.maxX:p.maxY;if(f>=r&&y<n)u.push(p);else if(!(y<r||f>=n)){var d=[];if("Point"===h||"MultiPoint"===h)up(c,d,r,n,i);else if("LineString"===h)lp(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)cp(c,d,r,n,i,!1);else if("Polygon"===h)cp(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m<c.length;m++){var v=[];cp(c[m],v,r,n,i,!0),v.length&&d.push(v)}if(d.length){if(s.lineMetrics&&"LineString"===h){for(m=0;m<d.length;m++)u.push(Ql(p.id,h,d[m],p.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===d.length?(h="LineString",d=d[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===d.length?"Point":"MultiPoint"),u.push(Ql(p.id,h,d,p.tags))}}}return u.length?u:null}function up(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function lp(t,e,r,n,i,o,a){for(var s,u,l=pp(t),p=0===i?fp:yp,c=t.start,h=0;h<t.length-3;h+=3){var f=t[h],y=t[h+1],d=t[h+2],m=t[h+3],v=t[h+4],g=0===i?f:y,x=0===i?m:v,b=!1;a&&(s=Math.sqrt(Math.pow(f-m,2)+Math.pow(y-v,2))),g<r?x>r&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x<n&&(u=p(l,f,y,m,v,n),a&&(l.start=c+s*u)):hp(l,f,y,d),x<r&&g>=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=pp(t)),a&&(c+=s)}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&hp(l,f,y,d),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&hp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function pp(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function cp(t,e,r,n,i,o){for(var a=0;a<t.length;a++)lp(t[a],e,r,n,i,o,!1)}function hp(t,e,r,n){t.push(e),t.push(r),t.push(n)}function fp(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function yp(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function dp(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=mp(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(mp(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(mp(o.geometry[s][l],e));i.push(u)}r.push(Ql(o.id,a,i,o.tags))}return r}function mp(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function vp(t,e){if(t.transformed)return t;var r,n,i,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],l=u.geometry,p=u.type;if(u.geometry=[],1===p)for(n=0;n<l.length;n+=2)u.geometry.push(gp(l[n],l[n+1],e,o,a,s));else for(n=0;n<l.length;n++){var c=[];for(i=0;i<l[n].length;i+=2)c.push(gp(l[n][i],l[n][i+1],e,o,a,s));u.geometry.push(c)}}return t.transformed=!0,t}function gp(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function xp(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,bp(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,p=t[s].maxX,c=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),p>a.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function bp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)wp(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)wp(a,i[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)wp(a,l[s],t,r,!0,0===s)}if(a.length){var p=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var c in p={},e.tags)p[c]=e.tags[c];p.mapbox_clip_start=i.start/i.size,p.mapbox_clip_end=i.end/i.size}var h={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:p};null!==e.id&&(h.id=e.id),t.features.push(h)}}function wp(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===n||e[u+2]>a)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}(s,o),t.push(s)}}function _p(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");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)ep(r,t.features[n],e,n);else"Feature"===t.type?ep(r,t,e):ep(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),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=sp(t,1,-1-r,r,0,-1,2,e),o=sp(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=sp(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=dp(i,1).concat(n)),o&&(n=n.concat(dp(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.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 Sp(t,e,r){return 32*((1<<t)*r+e)+t}function kp(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new tl(n.features),o=_l(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}Rl.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(Zl(t[u],u));this.trees[i+1]=new Ul(s,Hl,Wl,o,Float32Array),r&&console.timeEnd(a);for(var l=i;l>=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new Ul(s,Hl,Wl,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},Rl.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(Gl(r),Xl(o),Gl(i),Xl(n));p<c.length;p+=1){var h=c[p],f=u.points[h];l.push(f.numPoints?Jl(f):this.points[f.index])}return l},Rl.prototype.getChildren=function(t){var e=t>>5,r=t%32,n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var p=l[u],c=i.points[p];c.parentId===t&&s.push(c.numPoints?Jl(c):this.points[c.index])}if(0===s.length)throw new Error(n);return s},Rl.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},Rl.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(r-s)/i,l=(r+1+s)/i,p={features:[]};return this._addTileFeatures(n.range((e-s)/i,u,(e+1+s)/i,l),n.points,e,r,i,p),0===e&&this._addTileFeatures(n.range(1-s/i,u,1,l),n.points,i,r,i,p),e===i-1&&this._addTileFeatures(n.range(0,u,s/i,l),n.points,-1,r,i,p),p.features.length?p:null},Rl.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},Rl.prototype._appendLeaves=function(t,e,r,n,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=n?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},Rl.prototype._addTileFeatures=function(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-r)),Math.round(this.options.extent*(u.y*i-n))]],tags:u.numPoints?Kl(u):this.points[u.index].properties},p=u.numPoints?u.id:this.points[u.index].id;void 0!==p&&(l.id=p),o.features.push(l)}},Rl.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},Rl.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,o=n.extent,a=n.reduce,s=i/(o*Math.pow(2,e)),u=0;u<t.length;u++){var l=t[u];if(!(l.zoom<=e)){l.zoom=e;for(var p=this.trees[e+1],c=p.within(l.x,l.y,s),h=l.numPoints||1,f=l.x*h,y=l.y*h,d=a&&h>1?this._map(l,!0):null,m=(u<<5)+(e+1),v=0,g=c;v<g.length;v+=1){var x=g[v],b=p.points[x];if(!(b.zoom<=e)){b.zoom=e;var w=b.numPoints||1;f+=b.x*w,y+=b.y*w,h+=w,b.parentId=m,a&&(d||(d=this._map(l,!0)),a(d,this._map(b)))}}1===h?r.push(l):(l.parentId=m,r.push(Nl(f/h,y/h,m,h,d)))}}return r},Rl.prototype._map=function(t,e){if(t.numPoints)return e?Yl({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Yl({},n):n},_p.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_p.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<<e,c=Sp(e,r,n),h=this.tiles[c];if(!h&&(l>1&&console.time("creation"),h=this.tiles[c]=xp(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<<i-e;if(r!==Math.floor(o/y)||n!==Math.floor(a/y))continue}else if(e===u.indexMaxZoom||h.numPoints<=u.indexMaxPoints)continue;if(h.source=null,0!==t.length){l>1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,S=.5+w,k=1+w;d=m=v=g=null,x=sp(t,p,r-w,r+S,0,h.minX,h.maxX,u),b=sp(t,p,r+_,r+k,0,h.minX,h.maxX,u),t=null,x&&(d=sp(x,p,n-w,n+S,1,h.minY,h.maxY,u),m=sp(x,p,n+_,n+k,1,h.minY,h.maxY,u),x=null),b&&(v=sp(b,p,n-w,n+S,1,h.minY,h.maxY,u),g=sp(b,p,n+_,n+k,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},_p.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t,s=Sp(t,e=(e%a+a)%a,r);if(this.tiles[s])return vp(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Sp(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?vp(this.tiles[s],i):null):null};var Ap=function(t){function e(e,r,n,i){t.call(this,e,r,n,kp),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;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Du.Performance(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));Xu(o,!0);try{t._geoJSONIndex=r.cluster?new Rl(function(t){var e=t.superclusterOptions,r=t.clusterProperties;if(!r||!e)return e;for(var n={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r),u=0,l=s;u<l.length;u+=1){var p=l[u],c=r[p],h=c[0],f=ge(c[1]),y=ge("string"==typeof h?[h,["accumulated"],["get",p]]:h);n[p]=f.value,i[p]=y.value}return e.map=function(t){a.properties=t;for(var e={},r=0,i=s;r<i.length;r+=1){var u=i[r];e[u]=n[u].evaluate(o,a)}return e},e.reduce=function(t,e){a.properties=e;for(var r=0,n=s;r<n.length;r+=1){var u=n[r];o.accumulated=t[u],t[u]=i[u].evaluate(o,a)}},e}(r)).load(o.features):function(t,e){return new _p(t,e)}(o,r.geojsonVtOptions)}catch(i){return e(i)}t.loaded={};var a={};if(n){var s=n.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 n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},e.prototype.loadGeoJSON=function(t,e){if(t.request)!function(t,e){vs(i(t,{type:"json"}),e)}(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(r){return e(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},e.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},e.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},e.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},e.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},e}(Uu);var Ip=function(t){var e=this;this.self=t,this.actor=new Ce(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Uu,geojson:Ap},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,r){if(e.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');e.workerSourceTypes[t]=r},this.self.registerRTLTextPlugin=function(t){if(Br.isLoaded())throw new Error("RTL text plugin already registered.");Br.applyArabicShaping=t.applyArabicShaping,Br.processBidirectionalText=t.processBidirectionalText,Br.processStyledBidirectionalText=t.processStyledBidirectionalText}};return Ip.prototype.setReferrer=function(t,e){this.referrer=e},Ip.prototype.setImages=function(t,e,r){this.availableImages[t]=e,r()},Ip.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Ip.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Ip.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Ip.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Ip.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Ip.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Ip.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Ip.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Ip.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Ip.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Ip.prototype.loadRTLTextPlugin=function(t,e,r){try{Br.isLoaded()||(this.self.importScripts(e),r(Br.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+e)))}catch(t){r(t.toString())}},Ip.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Ip.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new Za),e},Ip.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][e][r]},Ip.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new Ru),this.demWorkerSources[t][e]},Ip.prototype.enforceCacheSizeLimit=function(t,e){!function(t){self.caches&&self.caches.open(us).then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))}(e)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Ip(self)),Ip}();
  //# sourceMappingURL=mapbox-gl-csp-worker.js.map
  