| 1 | | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):t.Mark=e(t.jQuery)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;r(this,t),this.ctx=e,this.iframes=n,this.exclude=i,this.iframesTimeout=o}return n(t,[{key:"getContexts",value:function(){var t=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(e){var r=t.filter(function(t){return t.contains(e)}).length>0;-1!==t.indexOf(e)||r||t.push(e)}),t}},{key:"getIframeContents",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=void 0;try{var i=t.contentWindow;if(n=i.document,!i||!n)throw new Error("iframe inaccessible")}catch(t){r()}n&&e(n)}},{key:"isIframeBlank",value:function(t){var e="about:blank",r=t.getAttribute("src").trim();return t.contentWindow.location.href===e&&r!==e&&r}},{key:"observeIframeLoad",value:function(t,e,r){var n=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{n.isIframeBlank(t)||(t.removeEventListener("load",a),n.getIframeContents(t,e,r))}catch(t){r()}}};t.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(t,e,r){try{"complete"===t.contentWindow.document.readyState?this.isIframeBlank(t)?this.observeIframeLoad(t,e,r):this.getIframeContents(t,e,r):this.observeIframeLoad(t,e,r)}catch(t){r()}}},{key:"waitForIframes",value:function(t,e){var r=this,n=0;this.forEachIframe(t,function(){return!0},function(t){n++,r.waitForIframes(t.querySelector("html"),function(){--n||e()})},function(t){t||e()})}},{key:"forEachIframe",value:function(e,r,n){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=e.querySelectorAll("iframe"),s=a.length,l=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(l)};s||u(),a.forEach(function(e){t.matches(e,i.exclude)?u():i.onIframeReady(e,function(t){r(e)&&(l++,n(t)),u()},u)})}},{key:"createIterator",value:function(t,e,r){return document.createNodeIterator(t,e,r,!1)}},{key:"createInstanceOnIframe",value:function(e){return new t(e.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(t,e,r){if(t.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_PRECEDING){if(null===e)return!0;if(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(t){var e=t.previousNode();return{prevNode:e,node:null===e?t.nextNode():t.nextNode()&&t.nextNode()}}},{key:"checkIframeFilter",value:function(t,e,r,n){var i=!1,o=!1;return n.forEach(function(t,e){t.val===r&&(i=e,o=t.handled)}),this.compareNodeIframe(t,e,r)?(!1!==i||o?!1===i||o||(n[i].handled=!0):n.push({val:r,handled:!0}),!0):(!1===i&&n.push({val:r,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(t,e,r,n){var i=this;t.forEach(function(t){t.handled||i.getIframeContents(t.val,function(t){i.createInstanceOnIframe(t).forEachNode(e,r,n)})})}},{key:"iterateThroughNodes",value:function(t,e,r,n,i){for(var o,a=this,s=this.createIterator(e,t,n),l=[],u=[],c=void 0,h=void 0;o=void 0,o=a.getIteratorNode(s),h=o.prevNode,c=o.node;)this.iframes&&this.forEachIframe(e,function(t){return a.checkIframeFilter(c,h,t,l)},function(e){a.createInstanceOnIframe(e).forEachNode(t,function(t){return u.push(t)},n)}),u.push(c);u.forEach(function(t){r(t)}),this.iframes&&this.handleOpenIframes(l,t,r,n),i()}},{key:"forEachNode",value:function(t,e,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){n.iterateThroughNodes(t,o,e,r,function(){--a<=0&&i()})};n.iframes?n.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(t,e){var r="string"==typeof e?[e]:e,n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;if(n){var i=!1;return r.every(function(e){return!n.call(t,e)||(i=!0,!1)}),i}return!1}}]),t}(),a=function(){function t(e){r(this,t),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(t,[{key:"log",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",n=this.opt.log;this.opt.debug&&"object"===(void 0===n?"undefined":e(n))&&"function"==typeof n[r]&&n[r]("mark.js: "+t)}},{key:"escapeStr",value:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(t){return"disabled"!==this.opt.wildcards&&(t=this.setupWildcardsRegExp(t)),t=this.escapeStr(t),Object.keys(this.opt.synonyms).length&&(t=this.createSynonymsRegExp(t)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),this.opt.diacritics&&(t=this.createDiacriticsRegExp(t)),t=this.createMergedBlanksRegExp(t),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.createJoinersRegExp(t)),"disabled"!==this.opt.wildcards&&(t=this.createWildcardsRegExp(t)),t=this.createAccuracyRegExp(t)}},{key:"createSynonymsRegExp",value:function(t){var e=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",n=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(t=t.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+r),n+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+n))}return t}},{key:"processSynomyms",value:function(t){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),t}},{key:"setupWildcardsRegExp",value:function(t){return(t=t.replace(/(?:\\)*\?/g,function(t){return"\\"===t.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(t){return"\\"===t.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(t){var e="withSpaces"===this.opt.wildcards;return t.replace(/\u0001/g,e?"[\\S\\s]?":"\\S?").replace(/\u0002/g,e?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(t){return t.replace(/[^(|)\\]/g,function(t,e,r){var n=r.charAt(e+1);return/[(|)\\]/.test(n)||""===n?t:t+"\0"})}},{key:"createJoinersRegExp",value:function(t){var e=[],r=this.opt.ignorePunctuation;return Array.isArray(r)&&r.length&&e.push(this.escapeStr(r.join(""))),this.opt.ignoreJoiners&&e.push("\\u00ad\\u200b\\u200c\\u200d"),e.length?t.split(/\u0000+/).join("["+e.join("")+"]*"):t}},{key:"createDiacriticsRegExp",value:function(t){var e=this.opt.caseSensitive?"":"i",r=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],n=[];return t.split("").forEach(function(i){r.every(function(r){if(-1!==r.indexOf(i)){if(n.indexOf(r)>-1)return!1;t=t.replace(new RegExp("["+r+"]","gm"+e),"["+r+"]"),n.push(r)}return!0})}),t}},{key:"createMergedBlanksRegExp",value:function(t){return t.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(t){var e=this,r=this.opt.accuracy,n="string"==typeof r?r:r.value,i="string"==typeof r?[]:r.limiters,o="";switch(i.forEach(function(t){o+="|"+e.escapeStr(t)}),n){case"partially":default:return"()("+t+")";case"complementary":return"()([^"+(o="\\s"+(o||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+t+"[^"+o+"]*)";case"exactly":return"(^|\\s"+o+")("+t+")(?=$|\\s"+o+")"}}},{key:"getSeparatedKeywords",value:function(t){var e=this,r=[];return t.forEach(function(t){e.opt.separateWordSearch?t.split(" ").forEach(function(t){t.trim()&&-1===r.indexOf(t)&&r.push(t)}):t.trim()&&-1===r.indexOf(t)&&r.push(t)}),{keywords:r.sort(function(t,e){return e.length-t.length}),length:r.length}}},{key:"isNumeric",value:function(t){return Number(parseFloat(t))==t}},{key:"checkRanges",value:function(t){var e=this;if(!Array.isArray(t)||"[object Object]"!==Object.prototype.toString.call(t[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(t),[];var r=[],n=0;return t.sort(function(t,e){return t.start-e.start}).forEach(function(t){var i=e.callNoMatchOnInvalidRanges(t,n),o=i.start,a=i.end;i.valid&&(t.start=o,t.length=a-o,r.push(t),n=a)}),r}},{key:"callNoMatchOnInvalidRanges",value:function(t,e){var r=void 0,n=void 0,i=!1;return t&&void 0!==t.start?(n=(r=parseInt(t.start,10))+parseInt(t.length,10),this.isNumeric(t.start)&&this.isNumeric(t.length)&&n-e>0&&n-r>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(t)),this.opt.noMatch(t))):(this.log("Ignoring invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:r,end:n,valid:i}}},{key:"checkWhitespaceRanges",value:function(t,e,r){var n=void 0,i=!0,o=r.length,a=e-o,s=parseInt(t.start,10)-a;return(n=(s=s>o?o:s)+parseInt(t.length,10))>o&&(n=o,this.log("End range automatically set to the max value of "+o)),s<0||n-s<0||s>o||n>o?(i=!1,this.log("Invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)):""===r.substring(s,n).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:s,end:n,valid:i}}},{key:"getTextNodes",value:function(t){var e=this,r="",n=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(t){n.push({start:r.length,end:(r+=t.textContent).length,node:t})},function(t){return e.matchesExclude(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){t({value:r,nodes:n})})}},{key:"matchesExclude",value:function(t){return o.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(t,e,r){var n=this.opt.element?this.opt.element:"mark",i=t.splitText(e),o=i.splitText(r-e),a=document.createElement(n);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(t,e,r,n,i){var o=this;t.nodes.every(function(a,s){var l=t.nodes[s+1];if(void 0===l||l.start>e){if(!n(a.node))return!1;var u=e-a.start,c=(r>a.end?a.end:r)-a.start,h=t.value.substr(0,a.start),p=t.value.substr(c+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,c),t.value=h+p,t.nodes.forEach(function(e,r){r>=s&&(t.nodes[r].start>0&&r!==s&&(t.nodes[r].start-=c),t.nodes[r].end-=c)}),r-=c,i(a.node.previousSibling,a.start),!(r>a.end))return!1;e=a.end}return!0})}},{key:"wrapMatches",value:function(t,e,r,n,i){var o=this,a=0===e?0:e+1;this.getTextNodes(function(e){e.nodes.forEach(function(e){e=e.node;for(var i=void 0;null!==(i=t.exec(e.textContent))&&""!==i[a];)if(r(i[a],e)){var s=i.index;if(0!==a)for(var l=1;l<a;l++)s+=i[l].length;e=o.wrapRangeInTextNode(e,s,s+i[a].length),n(e.previousSibling),t.lastIndex=0}}),i()})}},{key:"wrapMatchesAcrossElements",value:function(t,e,r,n,i){var o=this,a=0===e?0:e+1;this.getTextNodes(function(e){for(var s=void 0;null!==(s=t.exec(e.value))&&""!==s[a];){var l=s.index;if(0!==a)for(var u=1;u<a;u++)l+=s[u].length;var c=l+s[a].length;o.wrapRangeInMappedTextNode(e,l,c,function(t){return r(s[a],t)},function(e,r){t.lastIndex=r,n(e)})}i()})}},{key:"wrapRangeFromIndex",value:function(t,e,r,n){var i=this;this.getTextNodes(function(o){var a=o.value.length;t.forEach(function(t,n){var s=i.checkWhitespaceRanges(t,a,o.value),l=s.start,u=s.end;s.valid&&i.wrapRangeInMappedTextNode(o,l,u,function(r){return e(r,t,o.value.substring(l,u),n)},function(e){r(e,t)})}),n()})}},{key:"unwrapMatches",value:function(t){for(var e=t.parentNode,r=document.createDocumentFragment();t.firstChild;)r.appendChild(t.removeChild(t.firstChild));e.replaceChild(r,t),this.ie?this.normalizeTextNode(e):e.normalize()}},{key:"normalizeTextNode",value:function(t){if(t){if(3===t.nodeType)for(;t.nextSibling&&3===t.nextSibling.nodeType;)t.nodeValue+=t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);else this.normalizeTextNode(t.firstChild);this.normalizeTextNode(t.nextSibling)}}},{key:"markRegExp",value:function(t,e){var r=this;this.opt=e,this.log('Searching with expression "'+t+'"');var n=0,i="wrapMatches";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),this[i](t,this.opt.ignoreGroups,function(t,e){return r.opt.filter(e,t,n)},function(t){n++,r.opt.each(t)},function(){0===n&&r.opt.noMatch(t),r.opt.done(n)})}},{key:"mark",value:function(t,e){var r=this;this.opt=e;var n=0,i="wrapMatches",o=this.getSeparatedKeywords("string"==typeof t?[t]:t),a=o.keywords,s=o.length,l=this.opt.caseSensitive?"":"i";this.opt.acrossElements&&(i="wrapMatchesAcrossElements"),0===s?this.opt.done(n):function t(e){var o=new RegExp(r.createRegExp(e),"gm"+l),u=0;r.log('Searching with expression "'+o+'"'),r[i](o,1,function(t,i){return r.opt.filter(i,e,n,u)},function(t){u++,n++,r.opt.each(t)},function(){0===u&&r.opt.noMatch(e),a[s-1]===e?r.opt.done(n):t(a[a.indexOf(e)+1])})}(a[0])}},{key:"markRanges",value:function(t,e){var r=this;this.opt=e;var n=0,i=this.checkRanges(t);i&&i.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(i)),this.wrapRangeFromIndex(i,function(t,e,n,i){return r.opt.filter(t,e,n,i)},function(t,e){n++,r.opt.each(t,e)},function(){r.opt.done(n)})):this.opt.done(n)}},{key:"unmark",value:function(t){var e=this;this.opt=t;var r=this.opt.element?this.opt.element:"*";r+="[data-markjs]",this.opt.className&&(r+="."+this.opt.className),this.log('Removal selector "'+r+'"'),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(t){e.unwrapMatches(t)},function(t){var n=o.matches(t,r),i=e.matchesExclude(t);return!n||i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}},{key:"opt",set:function(t){this._opt=i({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},t)},get:function(){return this._opt}},{key:"iterator",get:function(){return new o(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}}]),t}();return t.fn.mark=function(t,e){return new a(this.get()).mark(t,e),this},t.fn.markRegExp=function(t,e){return new a(this.get()).markRegExp(t,e),this},t.fn.markRanges=function(t,e){return new a(this.get()).markRanges(t,e),this},t.fn.unmark=function(t){return new a(this.get()).unmark(t),this},t}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.mapboxgl=e()}(this,function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),(r=i(a)).workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else e=i;else t=i}return n(0,function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var i=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),o=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,a=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,s={now:i,frame:function(t){return o(t)},cancelFrame:function(t){return a(t)},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){var e=self.document.createElement("a");return e.href=t,e.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},supportsWebp:!1};if(self.document){var l=self.document.createElement("img");l.onload=function(){s.supportsWebp=!0},l.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var u=c;function c(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}c.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},c.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},c.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},c.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},c.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var h=function(t,e,r){this.column=t,this.row=e,this.zoom=r};h.prototype.clone=function(){return new h(this.column,this.row,this.zoom)},h.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},h.prototype.sub=function(t){return this.clone()._sub(t)},h.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},h.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var p=f;function f(t,e){this.x=t,this.y=e}function d(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!d(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!d(t[n],e[n]))return!1;return!0}return t===e}function m(t,e,r,n){var i=new u(t,e,r,n);return function(t){return i.solve(t)}}f.prototype={clone:function(){return new f(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}},f.convert=function(t){return t instanceof f?t:Array.isArray(t)?new f(t[0],t[1]):t};var y=m(.25,.1,.25,1);function g(t,e,r){return Math.min(r,Math.max(e,t))}function v(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}var _=1;function x(){return _++}function b(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function w(t,e){return-1!==t.indexOf(e,t.length-e.length)}function E(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function S(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function T(t){return Array.isArray(t)?t.map(T):"object"==typeof t&&t?E(t,T):t}var k={};function A(t){k[t]||("undefined"!=typeof console&&console.warn(t),k[t]=!0)}function I(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function z(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}var C={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(C);var M=function(t){function e(e,r,n){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 P(t){var e=new self.XMLHttpRequest;for(var r in e.open("GET",t.url,!0),t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}var L=function(t,e){var r=P(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var n=r.response;if(0===n.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));r.status>=200&&r.status<300&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new M(r.statusText,r.status,t.url))},r.send(),r};function D(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function R(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var B=function(t,e){void 0===e&&(e={}),v(this,e),this.type=t},O=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",v({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(B),F=function(){};F.prototype.on=function(t,e){return this._listeners=this._listeners||{},D(t,e,this._listeners),this},F.prototype.off=function(t,e){return R(t,e,this._listeners),R(t,e,this._oneTimeListeners),this},F.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},D(t,e,this._oneTimeListeners),this},F.prototype.fire=function(t){"string"==typeof t&&(t=new B(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r<n.length;r+=1)n[r].call(this,t);for(var i=0,o=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[];i<o.length;i+=1){var a=o[i];R(e,a,this._oneTimeListeners),a.call(this,t)}var s=this._eventedParent;s&&(v(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof O&&console.error(t.error);return this},F.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)},F.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var V={$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.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"string",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},N=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function j(t){var e=t.key,r=t.value;return r?[new N(e,r,"constants have been deprecated as of v8")]:[]}function U(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 $(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function q(t){return Array.isArray(t)?t.map(q):$(t)}var Z=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),G=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}};G.prototype.concat=function(t){return new G(this,t)},G.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.")},G.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var W={kind:"null"},X={kind:"number"},H={kind:"string"},K={kind:"boolean"},J={kind:"color"},Y={kind:"object"},Q={kind:"value"},tt={kind:"collator"};function et(t,e){return{kind:"array",itemType:t,N:e}}function rt(t){if("array"===t.kind){var e=rt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var nt=[W,X,H,K,J,Y,et(Q)];function it(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!it(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=nt;r<n.length;r+=1)if(!it(n[r],e))return null}return"Expected "+rt(t)+" but found "+rt(e)+" instead."}var ot=n(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 l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),h=i.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),m=a(h[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),p];default:return null}}return null}}catch(t){}}).parseCSSColor,at=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};at.parse=function(t){if(t){if(t instanceof at)return t;if("string"==typeof t){var e=ot(t);if(e)return new at(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},at.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+")"},at.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]},at.black=new at(0,0,0,1),at.white=new at(1,1,1,1),at.transparent=new at(0,0,0,0);var st=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"})};st.prototype.compare=function(t,e){return this.collator.compare(t,e)},st.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var lt=function(t,e,r){this.type=tt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function ut(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 ct(t){if(null===t)return W;if("string"==typeof t)return H;if("boolean"==typeof t)return K;if("number"==typeof t)return X;if(t instanceof at)return J;if(t instanceof st)return tt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=ct(i[n]);if(e){if(e===o)continue;e=Q;break}e=o}return et(e||Q,r)}return Y}lt.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,K);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,K);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,H))?null:new lt(n,i,o)},lt.prototype.evaluate=function(t){return new st(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},lt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},lt.prototype.possibleOutputs=function(){return[void 0]},lt.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 ht=function(t,e){this.type=t,this.value=e};ht.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 at)return!0;if(e instanceof st)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=ct(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 ht(n,r)},ht.prototype.evaluate=function(){return this.value},ht.prototype.eachChild=function(){},ht.prototype.possibleOutputs=function(){return[this.value]},ht.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof at?["rgba"].concat(this.value.toArray()):this.value};var pt=function(t){this.name="ExpressionEvaluationError",this.message=t};pt.prototype.toJSON=function(){return this.message};var ft={string:H,number:X,boolean:K,object:Y},dt=function(t,e){this.type=t,this.args=e};dt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],n=ft[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Q);if(!a)return null;i.push(a)}return new dt(n,i)},dt.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!it(this.type,ct(r)))return r;if(e===this.args.length-1)throw new pt("Expected value to be of type "+rt(this.type)+", but found "+rt(ct(r))+" instead.")}return null},dt.prototype.eachChild=function(t){this.args.forEach(t)},dt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},dt.prototype.serialize=function(){return[this.type.kind].concat(this.args.map(function(t){return t.serialize()}))};var mt={string:H,number:X,boolean:K},yt=function(t,e){this.type=t,this.input=e};yt.parse=function(t,e){if(t.length<2||t.length>4)return e.error("Expected 1, 2, or 3 arguments, but found "+(t.length-1)+" instead.");var r,n;if(t.length>2){var i=t[1];if("string"!=typeof i||!(i in mt))return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=mt[i]}else r=Q;if(t.length>3){if("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2]))return e.error('The length argument to "array" must be a positive integer literal',2);n=t[2]}var o=et(r,n),a=e.parse(t[t.length-1],t.length-1,Q);return a?new yt(o,a):null},yt.prototype.evaluate=function(t){var e=this.input.evaluate(t);if(it(this.type,ct(e)))throw new pt("Expected value to be of type "+rt(this.type)+", but found "+rt(ct(e))+" instead.");return e},yt.prototype.eachChild=function(t){t(this.input)},yt.prototype.possibleOutputs=function(){return this.input.possibleOutputs()},yt.prototype.serialize=function(){var t=["array"],e=this.type.itemType;if("string"===e.kind||"number"===e.kind||"boolean"===e.kind){t.push(e.kind);var r=this.type.N;"number"==typeof r&&t.push(r)}return t.push(this.input.serialize()),t};var gt={"to-number":X,"to-color":J},vt=function(t,e){this.type=t,this.args=e};vt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");for(var r=t[0],n=gt[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Q);if(!a)return null;i.push(a)}return new vt(n,i)},vt.prototype.evaluate=function(t){if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1)if(r=null,"string"==typeof(e=i[n].evaluate(t))){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ut(e[0],e[1],e[2],e[3])))return new at(e[0]/255,e[1]/255,e[2]/255,e[3]);throw new pt(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var a=null,s=0,l=this.args;s<l.length;s+=1)if(null!==(a=l[s].evaluate(t))){var u=Number(a);if(!isNaN(u))return u}throw new pt("Could not convert "+JSON.stringify(a)+" to number.")},vt.prototype.eachChild=function(t){this.args.forEach(t)},vt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},vt.prototype.serialize=function(){var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize())}),t};var _t=["Unknown","Point","LineString","Polygon"],xt=function(){this._parseColorCache={}};xt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},xt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?_t[this.feature.type]:this.feature.type:null},xt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},xt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=at.parse(t)),e};var bt=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};function wt(t){if(t instanceof bt){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&&!wt(t)&&(e=!1)}),e}function Et(t){if(t instanceof bt&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!Et(t)&&(e=!1)}),e}function St(t,e){if(t instanceof bt&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!St(t,e)&&(r=!1)}),r}bt.prototype.evaluate=function(t){return this._evaluate(t,this.args)},bt.prototype.eachChild=function(t){this.args.forEach(t)},bt.prototype.possibleOutputs=function(){return[void 0]},bt.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},bt.parse=function(t,e){var r=t[0],n=bt.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=o.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),s=[],l=1;l<t.length;l++){var u=t[l],c=void 0;if(1===a.length){var h=a[0][0];c=Array.isArray(h)?h[l-1]:h.type}var p=e.parse(u,1+s.length,c);if(!p)return null;s.push(p)}for(var f=null,d=0,m=a;d<m.length;d+=1){var y=m[d],g=y[0],v=y[1];if(f=new kt(e.registry,e.path,null,e.scope),Array.isArray(g)&&g.length!==s.length)f.error("Expected "+g.length+" arguments, but found "+s.length+" instead.");else{for(var _=0;_<s.length;_++){var x=Array.isArray(g)?g[_]:g.type,b=s[_];f.concat(_+1).checkSubtype(x,b.type)}if(0===f.errors.length)return new bt(r,i,v,s)}}if(1===a.length)e.errors.push.apply(e.errors,f.errors);else{var w=(a.length?a:o).map(function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(rt).join(", ")+")":"("+rt(e.type)+"...)"}).join(" | "),E=s.map(function(t){return rt(t.type)}).join(", ");e.error("Expected arguments of type "+w+", but found ("+E+") instead.")}return null},bt.register=function(t,e){for(var r in bt.definitions=e,e)t[r]=bt};var Tt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Tt.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 Tt(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)},Tt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Tt.prototype.eachChild=function(){},Tt.prototype.possibleOutputs=function(){return[void 0]},Tt.prototype.serialize=function(){return["var",this.name]};var kt=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new G),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 At(t,e){for(var r,n,i=0,o=t.length-1,a=0;i<=o;){if(r=t[a=Math.floor((i+o)/2)],n=t[a+1],e===r||e>r&&e<n)return a;if(r<e)i=a+1;else{if(!(r>e))throw new pt("Input is not a number.");o=a-1}}return Math.max(a-1,0)}kt.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)},kt.prototype._parse=function(t,e){if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,a=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind||"value"!==a.kind)if("array"===o.kind&&"value"===a.kind)e.omitTypeAnnotations||(i=new yt(o,i));else if("color"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(this.expectedType,i.type))return null}else e.omitTypeAnnotations||(i=new vt(o,[i]));else e.omitTypeAnnotations||(i=new dt(o,[i]))}if(!(i instanceof ht)&&function t(e){if(e instanceof Tt)return t(e.boundExpression);if(e instanceof bt&&"error"===e.name)return!1;if(e instanceof lt)return!1;var r=e instanceof vt||e instanceof dt||e instanceof yt,n=!0;return e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof ht}),!!n&&(wt(e)&&St(e,["zoom","heatmap-density","line-progress","is-supported-script"]))}(i)){var s=new xt;try{i=new ht(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},kt.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 kt(this.registry,n,e||null,i,this.errors)},kt.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 Z(n,t))},kt.prototype.checkSubtype=function(t,e){var r=it(t,e);return r&&this.error(r),r};var It=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)}};It.parse=function(t,e){var r=t[1],n=t.slice(2);if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(r=e.parse(r,1,X)))return null;var i=[],o=null;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType),n.unshift(-1/0);for(var a=0;a<n.length;a+=2){var s=n[a],l=n[a+1],u=a+1,c=a+2;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var h=e.parse(l,c,o);if(!h)return null;o=o||h.type,i.push([s,h])}return new It(o,r,i)},It.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[At(e,n)].evaluate(t)},It.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},It.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},It.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 zt=Ct;function Ct(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 Mt(t,e,r){return t*(1-r)+e*r}Ct.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Ct.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Ct.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Ct.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},Ct.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Pt=Object.freeze({number:Mt,color:function(t,e,r){return new at(Mt(t.r,e.r,r),Mt(t.g,e.g,r),Mt(t.b,e.b,r),Mt(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return Mt(t,e[n],r)})}}),Lt=function(t,e,r,n){this.type=t,this.interpolation=e,this.input=r,this.labels=[],this.outputs=[];for(var i=0,o=n;i<o.length;i+=1){var a=o[i],s=a[0],l=a[1];this.labels.push(s),this.outputs.push(l)}};function Dt(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)}Lt.interpolationFactor=function(t,e,r,n){var i=0;if("exponential"===t.name)i=Dt(e,t.base,r,n);else if("linear"===t.name)i=Dt(e,1,r,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new zt(o[0],o[1],o[2],o[3]).solve(Dt(e,1,r,n))}return i},Lt.parse=function(t,e){var r=t[1],n=t[2],i=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var o=r[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:o}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var a=r.slice(1);if(4!==a.length||a.some(function(t){return"number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,X)))return null;var s=[],l=null;e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var u=0;u<i.length;u+=2){var c=i[u],h=i[u+1],p=u+3,f=u+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(s.length&&s[s.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var d=e.parse(h,f,l);if(!d)return null;l=l||d.type,s.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Lt(l,r,n,s):e.error("Type "+rt(l)+" is not interpolatable.")},Lt.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=At(e,n),a=e[o],s=e[o+1],l=Lt.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),c=r[o+1].evaluate(t);return Pt[this.type.kind.toLowerCase()](u,c,l)},Lt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Lt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},Lt.prototype.serialize=function(){for(var t=["interpolate","linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints),this.input.serialize()],e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t};var Rt=function(t,e){this.type=t,this.args=e};Rt.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],l=e.parse(s,1+i.length,r,void 0,{omitTypeAnnotations:!0});if(!l)return null;r=r||l.type,i.push(l)}var u=n&&i.some(function(t){return it(n,t.type)});return new Rt(u?Q:r,i)},Rt.prototype.evaluate=function(t){for(var e=null,r=0,n=this.args;r<n.length&&null===(e=n[r].evaluate(t));r+=1);return e},Rt.prototype.eachChild=function(t){this.args.forEach(t)},Rt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t},Rt.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Bt=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Bt.prototype.evaluate=function(t){return this.result.evaluate(t)},Bt.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Bt.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,void 0,r);return a?new Bt(r,a):null},Bt.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Bt.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 Ot=function(t,e,r){this.type=t,this.index=e,this.input=r};Ot.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,X),n=e.parse(t[2],2,et(e.expectedType||Q));if(!r||!n)return null;var i=n.type;return new Ot(i.itemType,r,n)},Ot.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new pt("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new pt("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new pt("Array index must be an integer, but found "+e+" instead.");return r[e]},Ot.prototype.eachChild=function(t){t(this.index),t(this.input)},Ot.prototype.possibleOutputs=function(){return[void 0]},Ot.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ft=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};Ft.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],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ct(p)))return null}else r=ct(p);if(void 0!==i[String(p)])return u.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(l,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,Q);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Ft(r,n,d,i,o,m):null},Ft.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ct(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ft.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ft.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Ft.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],s=n[t.cases[a]];void 0===s?(n[t.cases[a]]=r.length,r.push([t.cases[a],[a]])):r[s][1].push(a)}for(var l=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,c=r;u<c.length;u+=1){var h=c[u],p=h[0],f=h[1];1===f.length?e.push(l(f[0])):e.push(f.map(l)),e.push(t.outputs[p].serialize())}return e.push(this.otherwise.serialize()),e};var Vt=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Nt(t){return"string"===t.kind||"number"===t.kind||"boolean"===t.kind||"null"===t.kind}function jt(t,e){return function(){function r(t,e,r){this.type=K,this.lhs=t,this.rhs=e,this.collator=r}return r.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var n=e.parse(t[1],1,Q);if(!n)return null;var i=e.parse(t[2],2,Q);if(!i)return null;if(!Nt(n.type)&&!Nt(i.type))return e.error("Expected at least one argument to be a string, number, boolean, or null, but found ("+rt(n.type)+", "+rt(i.type)+") instead.");if(n.type.kind!==i.type.kind&&"value"!==n.type.kind&&"value"!==i.type.kind)return e.error("Cannot compare "+rt(n.type)+" and "+rt(i.type)+".");var o=null;if(4===t.length){if("string"!==n.type.kind&&"string"!==i.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(o=e.parse(t[3],3,tt)))return null}return new r(n,i,o)},r.prototype.evaluate=function(t){var r=this.collator?0===this.collator.evaluate(t).compare(this.lhs.evaluate(t),this.rhs.evaluate(t)):this.lhs.evaluate(t)===this.rhs.evaluate(t);return e?!r:r},r.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},r.prototype.possibleOutputs=function(){return[!0,!1]},r.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},r}()}Vt.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,K);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 Vt(r,n,s):null},Vt.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)},Vt.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)},Vt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.branches.map(function(t){return t[0],t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t},Vt.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ut=jt("==",!1),$t=jt("!=",!0),qt=function(t){this.type=X,this.input=t};qt.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 "+rt(r.type)+" instead."):new qt(r):null},qt.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 pt("Expected value to be of type string or array, but found "+rt(ct(e))+" instead.")},qt.prototype.eachChild=function(t){t(this.input)},qt.prototype.possibleOutputs=function(){return[void 0]},qt.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Zt={"==":Ut,"!=":$t,array:yt,at:Ot,boolean:dt,case:Vt,coalesce:Rt,collator:lt,interpolate:Lt,length:qt,let:Bt,literal:ht,match:Ft,number:dt,object:dt,step:It,string:dt,"to-color":vt,"to-number":vt,var:Tt};function Gt(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=ut(r,n,i,a);if(s)throw new pt(s);return new at(r/255*a,n/255*a,i/255*a,a)}function Wt(t,e){return t in e}function Xt(t,e){var r=e[t];return void 0===r?null:r}function Ht(t,e){var r=e[0],n=e[1];return r.evaluate(t)<n.evaluate(t)}function Kt(t,e){var r=e[0],n=e[1];return r.evaluate(t)>n.evaluate(t)}function Jt(t,e){var r=e[0],n=e[1];return r.evaluate(t)<=n.evaluate(t)}function Yt(t,e){var r=e[0],n=e[1];return r.evaluate(t)>=n.evaluate(t)}function Qt(t){return{type:t}}function te(t){return{result:"success",value:t}}function ee(t){return{result:"error",value:t}}function re(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ne(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ie(t){return!!t.expression&&t.expression.interpolated}bt.register(Zt,{error:[{kind:"error"},[H],function(t,e){var r=e[0];throw new pt(r.evaluate(t))}],typeof:[H,[Q],function(t,e){return rt(ct(e[0].evaluate(t)))}],"to-string":[H,[Q],function(t,e){var r=e[0],n=typeof(r=r.evaluate(t));return null===r?"":"string"===n||"number"===n||"boolean"===n?String(r):r instanceof at?r.toString():JSON.stringify(r)}],"to-boolean":[K,[Q],function(t,e){var r=e[0];return Boolean(r.evaluate(t))}],"to-rgba":[et(X,4),[J],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[J,[X,X,X],Gt],rgba:[J,[X,X,X,X],Gt],has:{type:K,overloads:[[[H],function(t,e){return Wt(e[0].evaluate(t),t.properties())}],[[H,Y],function(t,e){var r=e[0],n=e[1];return Wt(r.evaluate(t),n.evaluate(t))}]]},get:{type:Q,overloads:[[[H],function(t,e){return Xt(e[0].evaluate(t),t.properties())}],[[H,Y],function(t,e){var r=e[0],n=e[1];return Xt(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Q,[H],function(t,e){return Xt(e[0].evaluate(t),t.featureState||{})}],properties:[Y,[],function(t){return t.properties()}],"geometry-type":[H,[],function(t){return t.geometryType()}],id:[Q,[],function(t){return t.id()}],zoom:[X,[],function(t){return t.globals.zoom}],"heatmap-density":[X,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[X,[],function(t){return t.globals.lineProgress||0}],"+":[X,Qt(X),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[X,Qt(X),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:X,overloads:[[[X,X],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[X],function(t,e){return-e[0].evaluate(t)}]]},"/":[X,[X,X],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[X,[X,X],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[X,[],function(){return Math.LN2}],pi:[X,[],function(){return Math.PI}],e:[X,[],function(){return Math.E}],"^":[X,[X,X],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[X,[X],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[X,[X],function(t,e){var r=e[0];return Math.log10(r.evaluate(t))}],ln:[X,[X],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[X,[X],function(t,e){var r=e[0];return Math.log2(r.evaluate(t))}],sin:[X,[X],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[X,[X],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[X,[X],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[X,[X],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[X,[X],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[X,[X],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[X,Qt(X),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[X,Qt(X),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[X,[X],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[X,[X],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[X,[X],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[X,[X],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[K,[H,Q],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[K,[Q],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[K,[H],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[K,[H,Q],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-<":[K,[Q],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[K,[H,Q],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->":[K,[Q],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[K,[H,Q],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-<=":[K,[Q],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[K,[H,Q],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->=":[K,[Q],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[K,[Q],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[K,[],function(t){return null!==t.id()}],"filter-type-in":[K,[et(H)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[K,[et(Q)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[K,[H,et(Q)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[K,[H,et(Q)],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)}],">":{type:K,overloads:[[[X,X],Kt],[[H,H],Kt],[[H,H,tt],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>0}]]},"<":{type:K,overloads:[[[X,X],Ht],[[H,H],Ht],[[H,H,tt],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<0}]]},">=":{type:K,overloads:[[[X,X],Yt],[[H,H],Yt],[[H,H,tt],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))>=0}]]},"<=":{type:K,overloads:[[[X,X],Jt],[[H,H],Jt],[[H,H,tt],function(t,e){var r=e[0],n=e[1];return e[2].evaluate(t).compare(r.evaluate(t),n.evaluate(t))<=0}]]},all:{type:K,overloads:[[[K,K],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Qt(K),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:K,overloads:[[[K,K],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Qt(K),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[K,[K],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[K,[H],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[H,[H],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[H,[H],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[H,Qt(H),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}],"resolved-locale":[H,[tt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var oe=.95047,ae=1,se=1.08883,le=4/29,ue=6/29,ce=3*ue*ue,he=ue*ue*ue,pe=Math.PI/180,fe=180/Math.PI;function de(t){return t>he?Math.pow(t,1/3):t/ce+le}function me(t){return t>ue?t*t*t:ce*(t-le)}function ye(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ge(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ve(t){var e=ge(t.r),r=ge(t.g),n=ge(t.b),i=de((.4124564*e+.3575761*r+.1804375*n)/oe),o=de((.2126729*e+.7151522*r+.072175*n)/ae);return{l:116*o-16,a:500*(i-o),b:200*(o-de((.0193339*e+.119192*r+.9503041*n)/se)),alpha:t.a}}function _e(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=ae*me(e),r=oe*me(r),n=se*me(n),new at(ye(3.2404542*r-1.5371385*e-.4985314*n),ye(-.969266*r+1.8760108*e+.041556*n),ye(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var xe={forward:ve,reverse:_e,interpolate:function(t,e,r){return{l:Mt(t.l,e.l,r),a:Mt(t.a,e.a,r),b:Mt(t.b,e.b,r),alpha:Mt(t.alpha,e.alpha,r)}}},be={forward:function(t){var e=ve(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*fe;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*pe,r=t.c;return _e({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:Mt(t.c,e.c,r),l:Mt(t.l,e.l,r),alpha:Mt(t.alpha,e.alpha,r)}}},we=Object.freeze({lab:xe,hcl:be});function Ee(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Se(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Te(t){return t}function ke(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ae(t,e,r,n,i){return ke(typeof r===i?n[r]:void 0,t.default,e.default)}function Ie(t,e,r){if("number"!==Ee(r))return ke(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=Me(t.stops,r);return t.stops[i][1]}function ze(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Ee(r))return ke(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=Me(t.stops,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],l=t.stops[o+1][1],u=Pt[e.type]||Te;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=we[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,a)}}:u(s,l,a)}function Ce(t,e,r){return"color"===e.type?r=at.parse(r):Ee(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ke(r,t.default,e.default)}function Me(t,e){for(var r,n,i=0,o=t.length-1,a=0;i<=o;){if(r=t[a=Math.floor((i+o)/2)][0],n=t[a+1][0],e===r||e>r&&e<n)return a;r<e?i=a+1:r>e&&(o=a-1)}return Math.max(a-1,0)}var Pe=function(t,e){var r;this.expression=t,this._warningHistory={},this._defaultValue="color"===(r=e).type&&Se(r.default)?new at(0,0,0,0):"color"===r.type?at.parse(r.default)||null:void 0===r.default?null:r.default,"enum"===e.type&&(this._enumValues=e.values)};function Le(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Zt}function De(t,e){var r=new kt(Zt,[],function(t){var e={color:J,string:H,number:X,enum:H,boolean:K};return"array"===t.type?et(e[t.value]||Q,t.length):e[t.type]||null}(e)),n=r.parse(t);return n?te(new Pe(n,e)):ee(r.errors)}Pe.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._evaluator||(this._evaluator=new xt),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this.expression.evaluate(this._evaluator)},Pe.prototype.evaluate=function(t,e,r){this._evaluator||(this._evaluator=new xt),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r;try{var n=this.expression.evaluate(this._evaluator);if(null==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new pt("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Re=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Et(e.expression)};Re.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Re.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)};var Be=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Et(e.expression),r instanceof Lt&&(this._interpolationType=r.interpolation)};function Oe(t,e){if("error"===(t=De(t,e)).result)return t;var r=t.value.expression,n=wt(r);if(!n&&!re(e))return ee([new Z("","data expressions not supported")]);var i=St(r,["zoom"]);if(!i&&!ne(e))return ee([new Z("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof Bt)r=t(e.result);else if(e instanceof Rt)for(var n=0,i=e.args;n<i.length;n+=1){var o=i[n];if(r=t(o))break}else(e instanceof It||e instanceof Lt)&&e.input instanceof bt&&"zoom"===e.input.name&&(r=e);return r instanceof Z?r:(e.eachChild(function(e){var n=t(e);n instanceof Z?r=n:!r&&n?r=new Z("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Z("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r)}(r);return o||i?o instanceof Z?ee([o]):o instanceof Lt&&!ie(e)?ee([new Z("",'"interpolate" expressions cannot be used with this property')]):te(o?new Be(n?"camera":"composite",t.value,o):new Re(n?"constant":"source",t.value)):ee([new Z("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Be.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Be.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)},Be.prototype.interpolationFactor=function(t,e,r){return this._interpolationType?Lt.interpolationFactor(this._interpolationType,t,e,r):0};var Fe=function(t,e){this._parameters=t,this._specification=e,U(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||void 0!==e.property,u=s||!l,c=e.type||(ie(r)?"exponential":"interval");if(a&&((e=U({},e)).stops&&(e.stops=e.stops.map(function(t){return[t[0],at.parse(t[1])]})),e.default?e.default=at.parse(e.default):e.default=at.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!we[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=ze;else if("interval"===c)n=Ie;else if("categorical"===c){n=Ae,i=Object.create(null);for(var h=0,p=e.stops;h<p.length;h+=1){var f=p[h];i[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');n=Ce}if(s){for(var d={},m=[],y=0;y<e.stops.length;y++){var g=e.stops[y],v=g[0].zoom;void 0===d[v]&&(d[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},m.push(v)),d[v].stops.push([g[0].value,g[1]])}for(var _=[],x=0,b=m;x<b.length;x+=1){var w=b[x];_.push([d[w].zoom,t(d[w],r)])}return{kind:"composite",interpolationFactor:Lt.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:_.map(function(t){return t[0]}),evaluate:function(t,n){var i=t.zoom;return ze({stops:_,base:e.base},r,i).evaluate(i,n)}}}return u?{kind:"camera",interpolationFactor:"exponential"===c?Lt.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==e.base?e.base:1}):function(){return 0},zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){var a=t.zoom;return n(e,r,a,i,o)}}:{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?ke(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};function Ve(t,e){if(Se(t))return new Fe(t,e);if(Le(t)){var r=Oe(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=at.parse(t)),{kind:"constant",evaluate:function(){return n}}}function Ne(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],l=Ee(r);if("object"!==l)return[new N(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=n[c]||n["*"],p=void 0;if(i[c])p=i[c];else if(n[c])p=cr;else if(i["*"])p=i["*"];else{if(!n["*"]){s.push(new N(e,r[u],'unknown property "'+u+'"'));continue}p=cr}s=s.concat(p({key:(e?e+".":e)+u,value:r[u],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:u},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new N(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||cr;if("array"!==Ee(e))return[new N(o,e,"array expected, "+Ee(e)+" found")];if(r.length&&e.length!==r.length)return[new N(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new N(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value};i.$version<7&&(s.function=r.function),"object"===Ee(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:i,key:o+"["+u+"]"}));return l}function Ue(t){var e=t.key,r=t.value,n=t.valueSpec,i=Ee(r);return"number"!==i?[new N(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new N(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new N(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function $e(t){var e,r,n,i=t.valueSpec,o=$(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,l=!s,u="array"===Ee(t.value.stops)&&"array"===Ee(t.value.stops[0])&&"object"===Ee(t.value.stops[0][0]),c=Ne({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 N(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(je({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Ee(r)&&0===r.length&&e.push(new N(t.key,r,"array must have at least one stop")),e},default:function(t){return cr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new N(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new N(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ie(t.valueSpec)&&c.push(new N(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!re(t.valueSpec)?c.push(new N(t.key,t.value,"property functions not supported")):s&&!ne(t.valueSpec)&&c.push(new N(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||c.push(new N(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Ee(o))return[new N(s,o,"array expected, "+Ee(o)+" found")];if(2!==o.length)return[new N(s,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==Ee(o[0]))return[new N(s,o,"object expected, "+Ee(o[0])+" found")];if(void 0===o[0].zoom)return[new N(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new N(s,o,"object stop key must have value")];if(n&&n>$(o[0].zoom))return[new N(s,o[0].zoom,"stop zoom values must appear in ascending order")];$(o[0].zoom)!==n&&(n=$(o[0].zoom),r=void 0,a={}),e=e.concat(Ne({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ue,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return e.concat(cr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Ee(t.value),l=$(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new N(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new N(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return re(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new N(t.key,u,c)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==r&&l<r?[new N(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===o&&l in a?[new N(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new N(t.key,u,"integer expected, found "+l)]}}function qe(t){var e=("property"===t.expressionContext?Oe:De)(q(t.value),t.valueSpec);return"error"===e.result?e.value.map(function(e){return new N(""+t.key+e.key,t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new N(t.key,t.value,'Invalid data expression for "text-font". Output values must be contained as literals within the expression.')]:"property"!==t.expressionContext||"layout"!==t.propertyType||Et(e.value._styleExpression.expression)?[]:[new N(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]}function Ze(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf($(r))&&i.push(new N(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf($(r))&&i.push(new N(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function Ge(t){if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===t.length&&(Array.isArray(t[1])||Array.isArray(t[2]));case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Ge(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Fe.deserialize=function(t){return new Fe(t._parameters,t._specification)},Fe.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var We={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Xe(t){if(!t)return function(){return!0};Ge(t)||(t=Ke(t));var e=De(t,We);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 He(t,e){return t<e?-1:t>e?1:0}function Ke(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Je(t[1],t[2],"=="):"!="===r?tr(Je(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Je(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ke))):"all"===r?["all"].concat(t.slice(1).map(Ke)):"none"===r?["all"].concat(t.slice(1).map(Ke).map(tr)):"in"===r?Ye(t[1],t.slice(2)):"!in"===r?tr(Ye(t[1],t.slice(2))):"has"===r?Qe(t[1]):"!has"!==r||tr(Qe(t[1]))}function Je(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 Ye(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(He)]]:["filter-in-small",t,["literal",e]]}}function Qe(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function tr(t){return["!",t]}function er(t){return Ge(q(t.value))?qe(U({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Ee(r))return[new N(n,r,"array expected, "+Ee(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new N(n,r,"filter array must have at least 1 element")];switch(a=a.concat(Ze({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),$(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===$(r[1])&&a.push(new N(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new N(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Ee(r[1]))&&a.push(new N(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=Ee(r[s]),"$type"===$(r[1])?a=a.concat(Ze({key:n+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new N(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)a=a.concat(t({key:n+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Ee(r[1]),2!==r.length?a.push(new N(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new N(n+"[1]",r[1],"string expected, "+i+" found"))}return a}(t)}function rr(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 l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return cr({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var u,c=t.valueSpec||s[a];if(!c)return[new N(r,o,'unknown property "'+a+'"')];if("string"===Ee(o)&&re(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new N(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new N(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Se(q(o))&&"identity"===$(o.type)&&h.push(new N(r,o,'"text-font" does not support identity functions'))),h.concat(cr({key:t.key,value:o,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function nr(t){return rr(t,"paint")}function ir(t){return rr(t,"layout")}function or(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new N(n,r,'either "type" or "ref" is required'));var a,s=$(r.type),l=$(r.ref);if(r.id)for(var u=$(r.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];$(h.id)===u&&e.push(new N(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new N(n,r[t],'"'+t+'" is prohibited for ref layers'))}),i.layers.forEach(function(t){$(t.id)===l&&(a=t)}),a?a.ref?e.push(new N(n,r.ref,"ref cannot reference another ref layer")):s=$(a.type):e.push(new N(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=i.sources&&i.sources[r.source],f=p&&$(p.type);p?"vector"===f&&"raster"===s?e.push(new N(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new N(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new N(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new N(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new N(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new N(n,r.source,'source "'+r.source+'" not found'))}else e.push(new N(n,r,'missing required property "source"'));return e=e.concat(Ne({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return cr({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:er,layout:function(t){return Ne({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ir(U({layerType:s},t))}}})},paint:function(t){return Ne({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return nr(U({layerType:s},t))}}})}}}))}function ar(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new N(r,e,'"type" is required')];var o=$(e.type),a=[];switch(o){case"vector":case"raster":case"raster-dem":if(a=a.concat(Ne({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n})),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&a.push(new N(r+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return a;case"geojson":return Ne({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n});case"video":return Ne({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Ne({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return a.push(new N(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")),a;default:return Ze({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function sr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=Ee(e);if(void 0===e)return o;if("object"!==a)return o.concat([new N("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);o=l&&n[l[1]]&&n[l[1]].transition?o.concat(cr({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?o.concat(cr({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):o.concat([new N(s,e[s],'unknown property "'+s+'"')])}return o}function lr(t){var e=t.value,r=t.key,n=Ee(e);return"string"!==n?[new N(r,e,"string expected, "+n+" found")]:[]}var ur={"*":function(){return[]},array:je,boolean:function(t){var e=t.value,r=t.key,n=Ee(e);return"boolean"!==n?[new N(r,e,"boolean expected, "+n+" found")]:[]},number:Ue,color:function(t){var e=t.key,r=t.value,n=Ee(r);return"string"!==n?[new N(e,r,"color expected, "+n+" found")]:null===ot(r)?[new N(e,r,'color expected, "'+r+'" found')]:[]},constants:j,enum:Ze,filter:er,function:$e,layer:or,object:Ne,source:ar,light:sr,string:lr};function cr(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Se($(e))?$e(t):r.expression&&Le(q(e))?qe(t):r.type&&ur[r.type]?ur[r.type](t):Ne(U({},t,{valueSpec:r.type?n[r.type]:r}))}function hr(t){var e=t.value,r=t.key,n=lr(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new N(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new N(r,e,'"glyphs" url must include a "{range}" token')),n)}function pr(t,e){e=e||V;var r=[];return r=r.concat(cr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:hr,"*":function(){return[]}}})),t.constants&&(r=r.concat(j({key:"constants",value:t.constants,style:t,styleSpec:e}))),fr(r)}function fr(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function dr(t){return function(){return fr(t.apply(this,arguments))}}pr.source=dr(ar),pr.light=dr(sr),pr.layer=dr(or),pr.filter=dr(er),pr.paintProperty=dr(nr),pr.layoutProperty=dr(ir);var mr=pr,yr=pr.light,gr=pr.paintProperty,vr=pr.layoutProperty;function _r(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 O(new Error(o.message))),r=!0}return r}var xr=wr,br=3;function wr(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[br+o],s=i[br+o+1];n.push(a===s?null:i.subarray(a,s))}var l=i[br+n.length],u=i[br+n.length+1];this.keys=i.subarray(l,u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var h=r/e*t;this.min=-h,this.max=t+h}wr.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)},wr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},wr.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},wr.prototype.query=function(t,e,r,n){var i=this.min,o=this.max;if(t<=i&&e<=i&&o<=r&&o<=n)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,r,n,this._queryCell,a,{}),a},wr.prototype._queryCell=function(t,e,r,n,i,o,a){var s=this.cells[i];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===a[h]){var p=4*h;t<=u[p+2]&&e<=u[p+3]&&r>=u[p+0]&&n>=u[p+1]?(a[h]=!0,o.push(l[h])):a[h]=!1}}},wr.prototype._forEachCell=function(t,e,r,n,i,o,a){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var p=l;p<=c;p++){var f=this.d*p+h;if(i.call(this,t,e,r,n,f,o,a))return}},wr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},wr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=br+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[br+a]=o,i.set(s,o),o+=s.length}return i[br+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[br+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var Er=self.ImageData,Sr={};function Tr(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Sr[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var kr in Tr("Object",Object),xr.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),r},xr.deserialize=function(t){return new xr(t)},Tr("Grid",xr),Tr("Color",at),Tr("Error",Error),Tr("StylePropertyFunction",Fe),Tr("StyleExpression",Pe,{omit:["_evaluator"]}),Tr("ZoomDependentExpression",Be),Tr("ZoomConstantExpression",Re),Tr("CompoundExpression",bt,{omit:["_evaluate"]}),Zt)Zt[kr]._classRegistryKey||Tr("Expression_"+kr,Zt[kr]);function Ar(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Er)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(Ar(a,e))}return n}if("object"==typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u={};if(s.serialize)u._serialized=s.serialize(t,e);else{for(var c in t)if(t.hasOwnProperty(c)&&!(Sr[l].omit.indexOf(c)>=0)){var h=t[c];u[c]=Sr[l].shallow.indexOf(c)>=0?h:Ar(h,e)}t instanceof Error&&(u.message=t.message)}return{name:l,properties:u}}throw new Error("can't serialize object of type "+typeof t)}function Ir(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Er)return t;if(Array.isArray(t))return t.map(function(t){return Ir(t)});if("object"==typeof t){var e=t,r=e.name,n=e.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var i=Sr[r].klass;if(!i)throw new Error("can't deserialize unregistered class "+r);if(i.deserialize)return i.deserialize(n._serialized);for(var o=Object.create(i.prototype),a=0,s=Object.keys(n);a<s.length;a+=1){var l=s[a];o[l]=Sr[r].shallow.indexOf(l)>=0?n[l]:Ir(n[l])}return o}throw new Error("can't deserialize object of type "+typeof t)}var zr=function(){this.first=!0};zr.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 Cr={"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 Mr(t){for(var e=0,r=t;e<r.length;e+=1)if(Lr(r[e].charCodeAt(0)))return!0;return!1}function Pr(t){return!(Cr.Arabic(t)||Cr["Arabic Supplement"](t)||Cr["Arabic Extended-A"](t)||Cr["Arabic Presentation Forms-A"](t)||Cr["Arabic Presentation Forms-B"](t))}function Lr(t){return!!(746===t||747===t||!(t<4352)&&(Cr["Bopomofo Extended"](t)||Cr.Bopomofo(t)||Cr["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Cr["CJK Compatibility Ideographs"](t)||Cr["CJK Compatibility"](t)||Cr["CJK Radicals Supplement"](t)||Cr["CJK Strokes"](t)||!(!Cr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Cr["CJK Unified Ideographs Extension A"](t)||Cr["CJK Unified Ideographs"](t)||Cr["Enclosed CJK Letters and Months"](t)||Cr["Hangul Compatibility Jamo"](t)||Cr["Hangul Jamo Extended-A"](t)||Cr["Hangul Jamo Extended-B"](t)||Cr["Hangul Jamo"](t)||Cr["Hangul Syllables"](t)||Cr.Hiragana(t)||Cr["Ideographic Description Characters"](t)||Cr.Kanbun(t)||Cr["Kangxi Radicals"](t)||Cr["Katakana Phonetic Extensions"](t)||Cr.Katakana(t)&&12540!==t||!(!Cr["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)||!(!Cr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Cr["Unified Canadian Aboriginal Syllabics"](t)||Cr["Unified Canadian Aboriginal Syllabics Extended"](t)||Cr["Vertical Forms"](t)||Cr["Yijing Hexagram Symbols"](t)||Cr["Yi Syllables"](t)||Cr["Yi Radicals"](t)))}function Dr(t){return!(Lr(t)||function(t){return!!(Cr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Cr["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)||Cr["Letterlike Symbols"](t)||Cr["Number Forms"](t)||Cr["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)||Cr["Control Pictures"](t)&&9251!==t||Cr["Optical Character Recognition"](t)||Cr["Enclosed Alphanumerics"](t)||Cr["Geometric Shapes"](t)||Cr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Cr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Cr["CJK Symbols and Punctuation"](t)||Cr.Katakana(t)||Cr["Private Use Area"](t)||Cr["CJK Compatibility Forms"](t)||Cr["Small Form Variants"](t)||Cr["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 Rr(t,e){return!(!e&&(t>=1424&&t<=2303||Cr["Arabic Presentation Forms-A"](t)||Cr["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||Cr.Khmer(t))}var Br,Or=!1,Fr=null,Vr=!1,Nr=new F,jr={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Vr||null!=jr.applyArabicShaping}},Ur=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 zr,this.transition={})};Ur.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!Rr(n[r].charCodeAt(0),e))return!1;return!0}(t,jr.isLoaded())},Ur.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)};var $r=function(t,e){this.property=t,this.value=e,this.expression=Ve(void 0===e?t.specification.default:e,t.specification)};$r.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},$r.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var qr=function(t){this.property=t,this.value=new $r(t,void 0)};qr.prototype.transitioned=function(t,e){return new Gr(this.property,this.value,e,v({},t.transition,this.transition),t.now)},qr.prototype.untransitioned=function(){return new Gr(this.property,this.value,null,{},0)};var Zr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Zr.prototype.getValue=function(t){return T(this._values[t].value.value)},Zr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new qr(this._values[t].property)),this._values[t].value=new $r(this._values[t].property,null===e?void 0:T(e))},Zr.prototype.getTransition=function(t){return T(this._values[t].transition)},Zr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new qr(this._values[t].property)),this._values[t].transition=T(e)||void 0},Zr.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},Zr.prototype.transitioned=function(t,e){for(var r=new Wr(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},Zr.prototype.untransitioned=function(){for(var t=new Wr(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 Gr=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)};Gr.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return n.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),r,function(t){if(i<=0)return 0;if(i>=1)return 1;var e=i*i,r=e*i;return 4*(i<.5?r:3*(i-e)+r-.75)}())}return r};var Wr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Wr.prototype.possiblyEvaluate=function(t){for(var e=new Kr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e},Wr.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 Xr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Xr.prototype.getValue=function(t){return T(this._values[t].value)},Xr.prototype.setValue=function(t,e){this._values[t]=new $r(this._values[t].property,null===e?void 0:T(e))},Xr.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},Xr.prototype.possiblyEvaluate=function(t){for(var e=new Kr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e};var Hr=function(t,e,r){this.property=t,this.value=e,this.globals=r};Hr.prototype.isConstant=function(){return"constant"===this.value.kind},Hr.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Hr.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.globals,t,e)};var Kr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Kr.prototype.get=function(t){return this._values[t]};var Jr=function(t){this.specification=t};Jr.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Jr.prototype.interpolate=function(t,e,r){var n=Pt[this.specification.type];return n?n(t,e,r):t};var Yr=function(t){this.specification=t};Yr.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Hr(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Hr(this,t.expression,e)},Yr.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 Hr(this,{kind:"constant",value:void 0},t.globals);var n=Pt[this.specification.type];return n?new Hr(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.globals):t},Yr.prototype.evaluate=function(t,e,r,n){return"constant"===t.kind?t.value:t.evaluate(e,r,n)};var Qr=function(t){this.specification=t};Qr.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Ur(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ur(Math.floor(e.zoom),e)),t.expression.evaluate(new Ur(Math.floor(e.zoom+1),e)),e)}},Qr.prototype._calculate=function(t,e,r,n){var i=n.zoom,o=i-Math.floor(i),a=n.crossFadingFactor();return i>n.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:o+(1-o)*a}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-a)*o}},Qr.prototype.interpolate=function(t){return t};var tn=function(t){this.specification=t};tn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},tn.prototype.interpolate=function(){return!1};var en=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new $r(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new qr(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Tr("DataDrivenProperty",Yr),Tr("DataConstantProperty",Jr),Tr("CrossFadedProperty",Qr),Tr("ColorRampProperty",tn);var rn=function(t){function e(e,r){for(var n in t.call(this),this.id=e.id,this.metadata=e.metadata,this.type=e.type,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.visibility="visible","background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),this._featureFilter=function(){return!0},r.layout&&(this._unevaluatedLayout=new Xr(r.layout)),this._transitionablePaint=new Zr(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.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(vr,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"},e.prototype.getPaintProperty=function(t){return w(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(gr,n,t,e,r))return!1}if(w(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t].value.isDataDriven();this._transitionablePaint.setValue(t,e);var o=this._transitionablePaint._values[t].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(t),o||i},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),S(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(!i||!1!==i.validate)&&_r(this,t.call(mr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:V,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Hr&&re(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(F),nn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},on=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},an=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function sn(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,o=(i=t.type,nn[i].BYTES_PER_ELEMENT),a=r=ln(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:ln(r,Math.max(n,e)),alignment:e}}function ln(t,e){return Math.ceil(t/e)*e}an.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},an.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},an.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},an.prototype.clear=function(){this.length=0},an.prototype.resize=function(t){this.reserve(t),this.length=t},an.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)}},an.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};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){var r=this.length;this.resize(r+1);var n=2*r;return this.int16[n+0]=t,this.int16[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(an);un.prototype.bytesPerElement=4,Tr("StructArrayLayout2i4",un);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)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var o=4*i;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=r,this.int16[o+3]=n,i},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}(an);cn.prototype.bytesPerElement=8,Tr("StructArrayLayout4i8",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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=o,a},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}(an);hn.prototype.bytesPerElement=12,Tr("StructArrayLayout2i4i12",hn);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)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint8[c+8]=i,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,l},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l){var u=6*t,c=12*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.uint8[c+8]=o,this.uint8[c+9]=a,this.uint8[c+10]=s,this.uint8[c+11]=l,t},e}(an);pn.prototype.bytesPerElement=12,Tr("StructArrayLayout4i4ub12",pn);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),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[u+0]=t,this.int16[u+1]=e,this.int16[u+2]=r,this.int16[u+3]=n,this.uint16[u+4]=i,this.uint16[u+5]=o,this.uint16[u+6]=a,this.uint16[u+7]=s,l},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l){var u=8*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.uint16[u+4]=o,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(an);fn.prototype.bytesPerElement=16,Tr("StructArrayLayout4i4ui16",fn);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=r,n},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}(an);dn.prototype.bytesPerElement=12,Tr("StructArrayLayout3f12",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.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(an);mn.prototype.bytesPerElement=4,Tr("StructArrayLayout1ul4",mn);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.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,l,u,c){var h=this.length;this.resize(h+1);var p=12*h,f=6*h;return this.int16[p+0]=t,this.int16[p+1]=e,this.int16[p+2]=r,this.int16[p+3]=n,this.int16[p+4]=i,this.int16[p+5]=o,this.uint32[f+3]=a,this.uint16[p+8]=s,this.uint16[p+9]=l,this.int16[p+10]=u,this.int16[p+11]=c,h},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c,h){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[f+3]=s,this.uint16[p+8]=l,this.uint16[p+9]=u,this.int16[p+10]=c,this.int16[p+11]=h,t},e}(an);yn.prototype.bytesPerElement=24,Tr("StructArrayLayout6i1ul2ui2i24",yn);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.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=o,a},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}(an);gn.prototype.bytesPerElement=12,Tr("StructArrayLayout2i2i2i12",gn);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)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=4*r;return this.uint8[n+0]=t,this.uint8[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=4*t;return this.uint8[n+0]=e,this.uint8[n+1]=r,t},e}(an);vn.prototype.bytesPerElement=4,Tr("StructArrayLayout2ub4",vn);var _n=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,l,u,c,h,p,f){var d=this.length;this.resize(d+1);var m=20*d,y=10*d,g=40*d;return this.int16[m+0]=t,this.int16[m+1]=e,this.uint16[m+2]=r,this.uint16[m+3]=n,this.uint32[y+2]=i,this.uint32[y+3]=o,this.uint32[y+4]=a,this.uint16[m+10]=s,this.uint16[m+11]=l,this.uint16[m+12]=u,this.float32[y+7]=c,this.float32[y+8]=h,this.uint8[g+36]=p,this.uint8[g+37]=f,d},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d){var m=20*t,y=10*t,g=40*t;return this.int16[m+0]=e,this.int16[m+1]=r,this.uint16[m+2]=n,this.uint16[m+3]=i,this.uint32[y+2]=o,this.uint32[y+3]=a,this.uint32[y+4]=s,this.uint16[m+10]=l,this.uint16[m+11]=u,this.uint16[m+12]=c,this.float32[y+7]=h,this.float32[y+8]=p,this.uint8[g+36]=f,this.uint8[g+37]=d,t},e}(an);_n.prototype.bytesPerElement=40,Tr("StructArrayLayout2i2ui3ul3ui2f2ub40",_n);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){var e=this.length;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(an);xn.prototype.bytesPerElement=4,Tr("StructArrayLayout1f4",xn);var bn=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;this.resize(n+1);var i=3*n;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=r,n},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}(an);bn.prototype.bytesPerElement=6,Tr("StructArrayLayout3i6",bn);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._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;this.resize(n+1);var i=2*n,o=4*n;return this.uint32[i+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=r,n},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}(an);wn.prototype.bytesPerElement=8,Tr("StructArrayLayout1ul2ui8",wn);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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=r,n},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}(an);En.prototype.bytesPerElement=6,Tr("StructArrayLayout3ui6",En);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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.uint16[n+0]=t,this.uint16[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(an);Sn.prototype.bytesPerElement=4,Tr("StructArrayLayout2ui4",Sn);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.float32[n+0]=t,this.float32[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(an);Tn.prototype.bytesPerElement=8,Tr("StructArrayLayout2f8",Tn);var kn=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;this.resize(i+1);var o=4*i;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=r,this.float32[o+3]=n,i},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}(an);kn.prototype.bytesPerElement=16,Tr("StructArrayLayout4f16",kn);var An=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new p(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(on);An.prototype.size=24;var In=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 An(this,t)},e}(yn);Tr("CollisionBoxArray",In);var zn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,r),e}(on);zn.prototype.size=40;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 zn(this,t)},e}(_n);Tr("PlacedSymbolArray",Cn);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={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}(on);Mn.prototype.size=4;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.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Mn(this,t)},e}(xn);Tr("GlyphOffsetArray",Pn);var Ln=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}(on);Ln.prototype.size=6;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.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 Ln(this,t)},e}(bn);Tr("SymbolLineVertexArray",Dn);var Rn=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}(on);Rn.prototype.size=8;var Bn=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 Rn(this,t)},e}(wn);Tr("FeatureIndexArray",Bn);var On=sn([{name:"a_pos",components:2,type:"Int16"}],4).members,Fn=function(t){void 0===t&&(t=[]),this.segments=t};Fn.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>Fn.MAX_VERTEX_ARRAY_LENGTH&&A("Max vertices per segment is "+Fn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Fn.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},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.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Tr("SegmentVector",Fn);var Vn=function(t,e){return 256*(t=g(Math.floor(t),0,255))+g(Math.floor(e),0,255)};function Nn(t){return[Vn(255*t.r,255*t.g),Vn(255*t.b,255*t.a)]}var jn=function(t,e,r){this.value=t,this.name=e,this.type=r,this.statistics={max:-1/0}};jn.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},jn.prototype.populatePaintArray=function(){},jn.prototype.updatePaintArray=function(){},jn.prototype.upload=function(){},jn.prototype.destroy=function(){},jn.prototype.setUniforms=function(t,e,r,n){var i=n.constantOr(this.value),o=t.gl;"color"===this.type?o.uniform4f(e.uniforms["u_"+this.name],i.r,i.g,i.b,i.a):o.uniform1f(e.uniforms["u_"+this.name],i)};var Un=function(t,e,r){this.expression=t,this.name=e,this.type=r,this.statistics={max:-1/0};var n="color"===r?Tn:xn;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}],this.paintVertexArray=new n};Un.prototype.defines=function(){return[]},Un.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var i=this.expression.evaluate(new Ur(0),e,{});if("color"===this.type)for(var o=Nn(i),a=n;a<t;a++)r.emplaceBack(o[0],o[1]);else{for(var s=n;s<t;s++)r.emplaceBack(i);this.statistics.max=Math.max(this.statistics.max,i)}},Un.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=Nn(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var l=t;l<e;l++)i.emplace(l,o);this.statistics.max=Math.max(this.statistics.max,o)}},Un.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Un.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Un.prototype.setUniforms=function(t,e){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],0)};var $n=function(t,e,r,n,i){this.expression=t,this.name=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.statistics={max:-1/0};var o="color"===r?kn:Tn;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}],this.paintVertexArray=new o};$n.prototype.defines=function(){return[]},$n.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var i=this.expression.evaluate(new Ur(this.zoom),e,{}),o=this.expression.evaluate(new Ur(this.zoom+1),e,{});if("color"===this.type)for(var a=Nn(i),s=Nn(o),l=n;l<t;l++)r.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var u=n;u<t;u++)r.emplaceBack(i,o);this.statistics.max=Math.max(this.statistics.max,i,o)}},$n.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=Nn(o),l=Nn(a),u=t;u<e;u++)i.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=t;c<e;c++)i.emplace(c,o,a);this.statistics.max=Math.max(this.statistics.max,o,a)}},$n.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},$n.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},$n.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},$n.prototype.setUniforms=function(t,e,r){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],this.interpolationFactor(r.zoom))};var qn=function(){this.binders={},this.cacheKey="",this._buffers=[],this._idMap={},this._bufferOffset=0};qn.createDynamic=function(t,e,r){var n=new qn,i=[];for(var o in t.paint._values)if(r(o)){var a=t.paint.get(o);if(a instanceof Hr&&re(a.property.specification)){var s=Gn(o,t.type),l=a.property.specification.type,u=a.property.useIntegerZoom;"constant"===a.value.kind?(n.binders[o]=new jn(a.value,s,l),i.push("/u_"+s)):"source"===a.value.kind?(n.binders[o]=new Un(a.value,s,l),i.push("/a_"+s)):(n.binders[o]=new $n(a.value,s,l,u,e),i.push("/z_"+s))}}return n.cacheKey=i.sort().join(""),n},qn.prototype.populatePaintArrays=function(t,e,r){for(var n in this.binders)this.binders[n].populatePaintArray(t,e);if(e.id){var i=String(e.id);this._idMap[i]=this._idMap[i]||[],this._idMap[i].push({index:r,start:this._bufferOffset,end:t})}this._bufferOffset=t},qn.prototype.updatePaintArrays=function(t,e,r){var n=!1;for(var i in t){var o=this._idMap[i];if(o)for(var a=t[i],s=0,l=o;s<l.length;s+=1){var u=l[s],c=e.feature(u.index);for(var h in this.binders){var p=this.binders[h];if(!(p instanceof jn)&&!0===p.expression.isStateDependent){var f=r.paint.get(h);p.expression=f.value,p.updatePaintArray(u.start,u.end,c,a),n=!0}}}}return n},qn.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},qn.prototype.setUniforms=function(t,e,r,n){for(var i in this.binders)this.binders[i].setUniforms(t,e,n,r.get(i))},qn.prototype.getPaintVertexBuffers=function(){return this._buffers},qn.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 Un||i instanceof $n)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer)}this._buffers=r},qn.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var Zn=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]=qn.createDynamic(a,r,n),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1};function Gn(t,e){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[t]||t.replace(e+"-","").replace(/-/g,"_")}Zn.prototype.populatePaintArrays=function(t,e,r){for(var n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,r);this.needsUpload=!0},Zn.prototype.updatePaintArrays=function(t,e,r){for(var n=0,i=r;n<i.length;n+=1){var o=i[n];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,e,o)||this.needsUpload}},Zn.prototype.get=function(t){return this.programConfigurations[t]},Zn.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Zn.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Tr("ConstantBinder",jn),Tr("SourceExpressionBinder",Un),Tr("CompositeExpressionBinder",$n),Tr("ProgramConfiguration",qn,{omit:["_buffers"]}),Tr("ProgramConfigurationSet",Zn);var Wn=8192,Xn=(16,{min:-1*Math.pow(2,15),max:Math.pow(2,15)-1});function Hn(t){for(var e=Wn/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],o=0;o<i.length;o++){var a=i[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<Xn.min||a.x>Xn.max||a.y<Xn.min||a.y>Xn.max)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Kn(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Jn=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new un,this.indexArray=new En,this.segments=new Fn,this.programConfigurations=new Zn(On,t.layers,t.zoom)};function Yn(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if(si(i,e))return!0;if(ii(e,i,r))return!0}return!1}function Qn(t,e){if(1===t.length&&1===t[0].length)return ai(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(ai(t,n[i]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++)if(ai(e,a[s]))return!0;for(var l=0;l<e.length;l++)if(ri(a,e[l]))return!0}return!1}function ti(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],o=0;o<t.length;o++){var a=t[o];if(a.length>=3)for(var s=0;s<i.length;s++)if(si(a,i[s]))return!0;if(ei(a,i,r))return!0}return!1}function ei(t,e,r){if(t.length>1){if(ri(t,e))return!0;for(var n=0;n<e.length;n++)if(ii(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(ii(t[i],e,r))return!0;return!1}function ri(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(ni(n,i,e[o],e[o+1]))return!0;return!1}function ni(t,e,r,n){return I(t,r,n)!==I(e,r,n)&&I(t,e,r)!==I(t,e,n)}function ii(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(oi(t,e[i-1],e[i])<n)return!0;return!1}function oi(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 ai(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)n=r[s],i=r[l],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 si(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 li(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].statistics.max}function ui(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ci(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=p.convert(e);"viewport"===r&&o._rotate(-n);for(var a=[],s=0;s<t.length;s++){for(var l=t[s],u=[],c=0;c<l.length;c++)u.push(l[c].sub(o._mult(i)));a.push(u)}return a}Jn.prototype.populate=function(t,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 Ur(this.zoom),o)){var l=Hn(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},Jn.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},Jn.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Jn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Jn.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,On),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Jn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Jn.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],l=s.x,u=s.y;if(!(l<0||l>=Wn||u<0||u>=Wn)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;Kn(this.layoutVertexArray,l,u,-1,-1),Kn(this.layoutVertexArray,l,u,1,-1),Kn(this.layoutVertexArray,l,u,1,1),Kn(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r)},Tr("CircleBucket",Jn,{omit:["layers"]});var hi={paint:new en({"circle-radius":new Yr(V.paint_circle["circle-radius"]),"circle-color":new Yr(V.paint_circle["circle-color"]),"circle-blur":new Yr(V.paint_circle["circle-blur"]),"circle-opacity":new Yr(V.paint_circle["circle-opacity"]),"circle-translate":new Jr(V.paint_circle["circle-translate"]),"circle-translate-anchor":new Jr(V.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Jr(V.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Jr(V.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yr(V.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yr(V.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yr(V.paint_circle["circle-stroke-opacity"])})},pi="undefined"!=typeof Float32Array?Float32Array:Array;function fi(){var t=new pi(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function di(){var t=new pi(3);return t[0]=0,t[1]=0,t[2]=0,t}function mi(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function yi(t,e,r){var n=new pi(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.PI;var gi,vi=mi,_i=(gi=di(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a<s;a+=e)gi[0]=t[a],gi[1]=t[a+1],gi[2]=t[a+2],i(gi,gi,o),t[a]=gi[0],t[a+1]=gi[1],t[a+2]=gi[2];return t});function xi(){var t=new pi(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function bi(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a),t}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}var Ei=function(){var t=xi();return function(e,r,n,i,o,a){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();function Si(){var t=new pi(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}di(),yi(1,0,0),yi(0,1,0),Si(),Si(),fi(),function(){var t;(t=new pi(2))[0]=0,t[1]=0}();var Ti=function(t){function e(e){t.call(this,e,hi)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Jn(t)},e.prototype.queryRadius=function(t){var e=t;return li("circle-radius",this,e)+li("circle-stroke-width",this,e)+ui(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var l=ci(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e,r){return l.map(function(t){return t.map(function(t){return ki(t,e,r)})})}(0,s,o),p=c?u*a:u,f=0,d=n;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var g=y[m],v=c?g:ki(g,s,o),_=p,x=wi([],[g.x,g.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/x[3]),Yn(h,v,_))return!0}return!1},e}(rn);function ki(t,e,r){var n=wi([],[t.x,t.y,0,1],e);return new p((n[0]/n[3]+1)*r.width*.5,(n[1]/n[3]+1)*r.height*.5)}var Ai=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}(Jn);function Ii(t,e,r,n){var i=e.width,o=e.height;if(n){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 zi(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=Ii({},{width:n,height:i},r);Ci(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 Ci(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,l=0;l<i.height;l++)for(var u=((r.y+l)*t.width+r.x)*o,c=((n.y+l)*e.width+n.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[u+h];return e}Tr("HeatmapBucket",Ai,{omit:["layers"]});var Mi=function(t,e){Ii(this,t,1,e)};Mi.prototype.resize=function(t){zi(this,t,1)},Mi.prototype.clone=function(){return new Mi({width:this.width,height:this.height},new Uint8Array(this.data))},Mi.copy=function(t,e,r,n,i){Ci(t,e,r,n,i,1)};var Pi=function(t,e){Ii(this,t,4,e)};Pi.prototype.resize=function(t){zi(this,t,4)},Pi.prototype.clone=function(){return new Pi({width:this.width,height:this.height},new Uint8Array(this.data))},Pi.copy=function(t,e,r,n,i){Ci(t,e,r,n,i,4)},Tr("AlphaImage",Mi),Tr("RGBAImage",Pi);var Li={paint:new en({"heatmap-radius":new Yr(V.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yr(V.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Jr(V.paint_heatmap["heatmap-intensity"]),"heatmap-color":new tn(V.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Jr(V.paint_heatmap["heatmap-opacity"])})};function Di(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 Pi({width:256,height:1},r)}var Ri=function(t){function e(e){t.call(this,e,Li),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 Ai(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=Di(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}(rn),Bi={paint:new en({"hillshade-illumination-direction":new Jr(V.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Jr(V.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Jr(V.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Jr(V.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Jr(V.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Jr(V.paint_hillshade["hillshade-accent-color"])})},Oi=function(t){function e(e){t.call(this,e,Bi)}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}(rn),Fi=sn([{name:"a_pos",components:2,type:"Int16"}],4).members,Vi=ji,Ni=ji;function ji(t,e,r){r=r||2;var n,i,o,a,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,p=Ui(t,0,h,r,!0),f=[];if(!p)return f;if(c&&(p=function(t,e,r,n){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Ui(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(Yi(a));for(s.sort(Hi),i=0;i<s.length;i++)Ki(s[i],r),r=$i(r,r.next);return r}(t,e,p,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var d=r;d<h;d+=r)(s=t[d])<n&&(n=s),(l=t[d+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-n,a-i))?1/u:0}return qi(p,f,r,n,i,u),f}function Ui(t,e,r,n,i){var o,a;if(i===uo(t,e,r,n)>0)for(o=e;o<r;o+=n)a=ao(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=ao(o,t[o],t[o+1],a);return a&&ro(a,a.next)&&(so(a),a=a.next),a}function $i(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(so(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function qi(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=Ji(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,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1)}(i)}(t,n,i,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?Gi(t,n,i,o):Zi(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),so(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?qi(t=Wi(t,e,r),e,r,n,i,o,2):2===a&&Xi(t,e,r,n,i,o):qi($i(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 Gi(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,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Ji(s,l,e,r,n),p=Ji(u,c,e,r,n),f=t.prevZ,d=t.nextZ;f&&f.z>=h&&d&&d.z<=p;){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,d!==t.prev&&d!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&eo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.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;f=f.prevZ}for(;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&Qi(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&eo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Wi(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!ro(i,o)&&no(i,n,n.next,o)&&io(i,o)&&io(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),so(n),so(n.next),n=t=o),n=n.next}while(n!==t);return n}function Xi(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 l=oo(a,s);return a=$i(a,a.next),l=$i(l,l.next),qi(a,e,r,n,i,o),void qi(l,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Hi(t,e){return t.x-e.x}function Ki(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.prev;var l,u=r,c=r.x,h=r.y,p=1/0;for(n=r.next;n!==u;)i>=n.x&&n.x>=c&&i!==n.x&&Qi(o<h?i:a,o,c,h,o<h?a:i,o,n.x,n.y)&&((l=Math.abs(o-n.y)/(i-n.x))<p||l===p&&n.x>r.x)&&io(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=oo(e,t);$i(r,r.next)}}function Ji(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 Yi(t){var e=t,r=t;do{e.x<r.x&&(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)&&io(t,e)&&io(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)}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){return!!(ro(t,e)&&ro(r,n)||ro(t,n)&&ro(r,e))||eo(t,e,r)>0!=eo(t,e,n)>0&&eo(r,n,t)>0!=eo(r,n,e)>0}function io(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 oo(t,e){var r=new lo(t.i,t.x,t.y),n=new lo(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 ao(t,e,r,n){var i=new lo(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 so(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 lo(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 uo(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}ji.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(uo(t,0,o,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;a-=Math.abs(uo(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,f=n[s+1]*r,d=n[s+2]*r;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},ji.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},Vi.default=Ni;var co=po,ho=po;function po(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,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*u/a+c)),Math.min(i,Math.floor(r+(a-s)*u/a+c)),o)}var h=e[r],p=n,f=i;for(fo(e,n,r),o(e[i],h)>0&&fo(e,n,i);p<f;){for(fo(e,p,f),p++,f--;o(e[p],h)<0;)p++;for(;o(e[f],h)>0;)f--}0===o(e[n],h)?fo(e,n,f):fo(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||mo)}function fo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function mo(t,e){return t<e?-1:t>e?1:0}function yo(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=z(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 l=0;l<o.length;l++)o[l].length<=e||(co(o[l],e,1,o[l].length-1,go),o[l]=o[l].slice(0,e));return o}function go(t,e){return e.area-t.area}co.default=ho;var vo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new un,this.indexArray=new En,this.indexArray2=new Sn,this.programConfigurations=new Zn(Fi,t.layers,t.zoom),this.segments=new Fn,this.segments2=new Fn};vo.prototype.populate=function(t,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 Ur(this.zoom),o)){var l=Hn(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},vo.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},vo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},vo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fi),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},vo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},vo.prototype.addFeature=function(t,e,r){for(var n=0,i=yo(e,500);n<i.length;n+=1){for(var o=i[n],a=0,s=0,l=o;s<l.length;s+=1)a+=l[s].length;for(var u=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray),c=u.vertexLength,h=[],p=[],f=0,d=o;f<d.length;f+=1){var m=d[f];if(0!==m.length){m!==o[0]&&p.push(h.length/2);var y=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),g=y.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 v=1;v<m.length;v++)this.layoutVertexArray.emplaceBack(m[v].x,m[v].y),this.indexArray2.emplaceBack(g+v-1,g+v),h.push(m[v].x),h.push(m[v].y);y.vertexLength+=m.length,y.primitiveLength+=m.length}}for(var _=Vi(h,p),x=0;x<_.length;x+=3)this.indexArray.emplaceBack(c+_[x],c+_[x+1],c+_[x+2]);u.vertexLength+=a,u.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r)},Tr("FillBucket",vo,{omit:["layers"]});var _o={paint:new en({"fill-antialias":new Jr(V.paint_fill["fill-antialias"]),"fill-opacity":new Yr(V.paint_fill["fill-opacity"]),"fill-color":new Yr(V.paint_fill["fill-color"]),"fill-outline-color":new Yr(V.paint_fill["fill-outline-color"]),"fill-translate":new Jr(V.paint_fill["fill-translate"]),"fill-translate-anchor":new Jr(V.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qr(V.paint_fill["fill-pattern"])})},xo=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(t){this.paint=this._transitioningPaint.possiblyEvaluate(t);var e=this.paint._values["fill-outline-color"];"constant"===e.value.kind&&void 0===e.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new vo(t)},e.prototype.queryRadius=function(){return ui(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return Qn(ci(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e}(rn),bo=sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,wo=Math.pow(2,13);function Eo(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*wo)+a,i*wo*2,o*wo*2,Math.round(s))}var So=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new hn,this.indexArray=new En,this.programConfigurations=new Zn(bo,t.layers,t.zoom),this.segments=new Fn};function To(t,e){return t.x===e.x&&(t.x<0||t.x>Wn)||t.y===e.y&&(t.y<0||t.y>Wn)}function ko(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>Wn})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>Wn})}So.prototype.populate=function(t,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 Ur(this.zoom),o)){var l=Hn(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},So.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},So.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},So.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},So.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,bo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},So.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},So.prototype.addFeature=function(t,e,r){for(var n=0,i=yo(e,500);n<i.length;n+=1){for(var o=i[n],a=0,s=0,l=o;s<l.length;s+=1)a+=l[s].length;for(var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=o;c<h.length;c+=1){var p=h[c];if(0!==p.length&&!ko(p))for(var f=0,d=0;d<p.length;d++){var m=p[d];if(d>=1){var y=p[d-1];if(!To(m,y)){u.vertexLength+4>Fn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(y)._perp()._unit(),v=y.dist(m);f+v>32768&&(f=0),Eo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,f),Eo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,f),f+=v,Eo(this.layoutVertexArray,y.x,y.y,g.x,g.y,0,0,f),Eo(this.layoutVertexArray,y.x,y.y,g.x,g.y,0,1,f);var _=u.vertexLength;this.indexArray.emplaceBack(_,_+1,_+2),this.indexArray.emplaceBack(_+1,_+2,_+3),u.vertexLength+=4,u.primitiveLength+=2}}}}u.vertexLength+a>Fn.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(a,this.layoutVertexArray,this.indexArray));for(var x=[],b=[],w=u.vertexLength,E=0,S=o;E<S.length;E+=1){var T=S[E];if(0!==T.length){T!==o[0]&&b.push(x.length/2);for(var k=0;k<T.length;k++){var A=T[k];Eo(this.layoutVertexArray,A.x,A.y,0,0,1,1,0),x.push(A.x),x.push(A.y)}}}for(var I=Vi(x,b),z=0;z<I.length;z+=3)this.indexArray.emplaceBack(w+I[z],w+I[z+1],w+I[z+2]);u.primitiveLength+=I.length/3,u.vertexLength+=a}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r)},Tr("FillExtrusionBucket",So,{omit:["layers"]});var Ao={paint:new en({"fill-extrusion-opacity":new Jr(V["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yr(V["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Jr(V["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Jr(V["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qr(V["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yr(V["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yr(V["paint_fill-extrusion"]["fill-extrusion-base"])})},Io=function(t){function e(e){t.call(this,e,Ao)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new So(t)},e.prototype.queryRadius=function(){return ui(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return Qn(ci(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,a),n)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},e}(rn),zo=sn([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Co=Mo;function Mo(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(Po,this,e)}function Po(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Lo(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}Mo.types=["Unknown","Point","LineString","Polygon"],Mo.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,a=0,s=[];t.pos<r;){if(i<=0){var l=t.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new p(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},Mo.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,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},Mo.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=Mo.types[this.type];function c(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 h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=Lo(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Do=Ro;function Ro(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(Bo,this,e),this.length=this._features.length}function Bo(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Oo(t,e,r){if(3===t){var n=new Do(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ro.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 Co(this._pbf,e,this.extent,this._keys,this._values)};var Fo={VectorTile:function(t,e){this.layers=t.readFields(Oo,{},e)},VectorTileFeature:Co,VectorTileLayer:Do},Vo=Fo.VectorTileFeature.types,No=63,jo=Math.cos(Math.PI/180*37.5),Uo=.5,$o=Math.pow(2,14)/Uo;function qo(t,e,r,n,i,o,a){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(No*r.x)+128,Math.round(No*r.y)+128,1+(0===o?0:o<0?-1:1)|(a*Uo&63)<<2,a*Uo>>6)}var Zo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.layoutVertexArray=new pn,this.indexArray=new En,this.programConfigurations=new Zn(zo,t.layers,t.zoom),this.segments=new Fn};function Go(t,e){return(t/e.tileTotal*(e.end-e.start)+e.start)*($o-1)}Zo.prototype.populate=function(t,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 Ur(this.zoom),o)){var l=Hn(o);this.addFeature(o,l,a),e.featureIndex.insert(o,l,a,s,this.index)}}},Zo.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},Zo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Zo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Zo.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},Zo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Zo.prototype.addFeature=function(t,e,r){for(var n=this.layers[0].layout,i=n.get("line-join").evaluate(t,{}),o=n.get("line-cap"),a=n.get("line-miter-limit"),s=n.get("line-round-limit"),l=0,u=e;l<u.length;l+=1){var c=u[l];this.addLine(c,t,i,o,a,s,r)}},Zo.prototype.addLine=function(t,e,r,n,i,o,a){var s=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(s={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var l="Polygon"===Vo[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c<u-1&&t[c].equals(t[c+1]);)c++;if(!(u<(l?3:2))){s&&(s.tileTotal=function(t,e,r){for(var n,i,o=0,a=c;a<r-1;a++)n=t[a],i=t[a+1],o+=n.dist(i);return o}(t,0,u)),"bevel"===r&&(i=1.05);var h=Wn/(512*this.overscaling)*15,p=t[c],f=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray);this.distance=0;var d,m,y,g=n,v=l?"butt":n,_=!0,x=void 0,b=void 0,w=void 0,E=void 0;this.e1=this.e2=this.e3=-1,l&&(d=t[u-2],E=p.sub(d)._unit()._perp());for(var S=c;S<u;S++)if(!(b=l&&S===u-1?t[c+1]:t[S+1])||!t[S].equals(b)){E&&(w=E),d&&(x=d),d=t[S],E=b?b.sub(d)._unit()._perp():w;var T=(w=w||E).add(E);0===T.x&&0===T.y||T._unit();var k=T.x*E.x+T.y*E.y,A=0!==k?1/k:1/0,I=k<jo&&x&&b;if(I&&S>c){var z=d.dist(x);if(z>2*h){var C=d.sub(d.sub(x)._mult(h/z)._round());this.distance+=C.dist(x),this.addCurrentVertex(C,this.distance,w.mult(1),0,0,!1,f,s),x=C}}var M=x&&b,P=M?r:b?g:v;if(M&&"round"===P&&(A<o?P="miter":A<=2&&(P="fakeround")),"miter"===P&&A>i&&(P="bevel"),"bevel"===P&&(A>2&&(P="flipbevel"),A<i&&(P="miter")),x&&(this.distance+=d.dist(x)),"miter"===P)T._mult(A),this.addCurrentVertex(d,this.distance,T,0,0,!1,f,s);else if("flipbevel"===P){if(A>100)T=E.clone().mult(-1);else{var L=w.x*E.y-w.y*E.x>0?-1:1,D=A*w.add(E).mag()/w.sub(E).mag();T._perp()._mult(D*L)}this.addCurrentVertex(d,this.distance,T,0,0,!1,f,s),this.addCurrentVertex(d,this.distance,T.mult(-1),0,0,!1,f,s)}else if("bevel"===P||"fakeround"===P){var R=w.x*E.y-w.y*E.x>0,B=-Math.sqrt(A*A-1);if(R?(y=0,m=B):(m=0,y=B),_||this.addCurrentVertex(d,this.distance,w,m,y,!1,f,s),"fakeround"===P){for(var O=Math.floor(8*(.5-(k-.5))),F=void 0,V=0;V<O;V++)F=E.mult((V+1)/(O+1))._add(w)._unit(),this.addPieSliceVertex(d,this.distance,F,R,f,s);this.addPieSliceVertex(d,this.distance,T,R,f,s);for(var N=O-1;N>=0;N--)F=w.mult((N+1)/(O+1))._add(E)._unit(),this.addPieSliceVertex(d,this.distance,F,R,f,s)}b&&this.addCurrentVertex(d,this.distance,E,-m,-y,!1,f,s)}else"butt"===P?(_||this.addCurrentVertex(d,this.distance,w,0,0,!1,f,s),b&&this.addCurrentVertex(d,this.distance,E,0,0,!1,f,s)):"square"===P?(_||(this.addCurrentVertex(d,this.distance,w,1,1,!1,f,s),this.e1=this.e2=-1),b&&this.addCurrentVertex(d,this.distance,E,-1,-1,!1,f,s)):"round"===P&&(_||(this.addCurrentVertex(d,this.distance,w,0,0,!1,f,s),this.addCurrentVertex(d,this.distance,w,1,1,!0,f,s),this.e1=this.e2=-1),b&&(this.addCurrentVertex(d,this.distance,E,-1,-1,!0,f,s),this.addCurrentVertex(d,this.distance,E,0,0,!1,f,s)));if(I&&S<u-1){var j=d.dist(b);if(j>2*h){var U=d.add(b.sub(d)._mult(h/j)._round());this.distance+=U.dist(d),this.addCurrentVertex(U,this.distance,E.mult(1),0,0,!1,f,s),d=U}}_=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a)}},Zo.prototype.addCurrentVertex=function(t,e,r,n,i,o,a,s){var l,u=this.layoutVertexArray,c=this.indexArray;s&&(e=Go(e,s)),l=r.clone(),n&&l._sub(r.perp()._mult(n)),qo(u,t,l,o,!1,n,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=r.mult(-1),i&&l._sub(r.perp()._mult(i)),qo(u,t,l,o,!0,-i,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>$o/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,o,a))},Zo.prototype.addPieSliceVertex=function(t,e,r,n,i,o){r=r.mult(n?-1:1);var a=this.layoutVertexArray,s=this.indexArray;o&&(e=Go(e,o)),qo(a,t,r,!1,n,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3},Tr("LineBucket",Zo,{omit:["layers"]});var Wo=new en({"line-cap":new Jr(V.layout_line["line-cap"]),"line-join":new Yr(V.layout_line["line-join"]),"line-miter-limit":new Jr(V.layout_line["line-miter-limit"]),"line-round-limit":new Jr(V.layout_line["line-round-limit"])}),Xo={paint:new en({"line-opacity":new Yr(V.paint_line["line-opacity"]),"line-color":new Yr(V.paint_line["line-color"]),"line-translate":new Jr(V.paint_line["line-translate"]),"line-translate-anchor":new Jr(V.paint_line["line-translate-anchor"]),"line-width":new Yr(V.paint_line["line-width"]),"line-gap-width":new Yr(V.paint_line["line-gap-width"]),"line-offset":new Yr(V.paint_line["line-offset"]),"line-blur":new Yr(V.paint_line["line-blur"]),"line-dasharray":new Qr(V.paint_line["line-dasharray"]),"line-pattern":new Qr(V.paint_line["line-pattern"]),"line-gradient":new tn(V.paint_line["line-gradient"])}),layout:Wo},Ho=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 Ur(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=v({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Yr))(Xo.paint.properties["line-width"].specification);Ho.useIntegerZoom=!0;var Ko=function(t){function e(e){t.call(this,e,Xo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Di(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Ho.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Zo(t)},e.prototype.queryRadius=function(t){var e=t,r=Jo(li("line-width",this,e),li("line-gap-width",this,e)),n=li("line-offset",this,e);return r/2+Math.abs(n)+ui(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){var s=ci(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,a),l=a/2*Jo(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){for(var r=[],n=new p(0,0),i=0;i<t.length;i++){for(var o=t[i],a=[],s=0;s<o.length;s++){var l=o[s-1],u=o[s],c=o[s+1],h=0===s?n:u.sub(l)._unit()._perp(),f=s===o.length-1?n:c.sub(u)._unit()._perp(),d=h._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),a.push(d._mult(e)._add(u))}r.push(a)}return r}(n,u*a)),ti(s,n,l)},e}(rn);function Jo(t,e){return e>0?e+2*t:t}var Yo=sn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Qo=sn([{name:"a_projected_pos",components:3,type:"Float32"}],4),ta=(sn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),sn([{name:"a_placed",components:2,type:"Uint8"}],4)),ea=(sn([{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"}]),sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ra=sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function na(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),jr.applyArabicShaping&&(t=jr.applyArabicShaping(t)),t}sn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),sn([{type:"Float32",name:"offsetX"}]),sn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var ia={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},oa=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}(p);function aa(t,e){var r=e.expression;if("constant"===r.kind)return{functionType:"constant",layoutSize:r.evaluate(new Ur(t+1))};if("source"===r.kind)return{functionType:"source"};for(var n=r.zoomStops,i=0;i<n.length&&n[i]<=t;)i++;for(var o=i=Math.max(0,i-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var a={min:n[i],max:n[o]};return"composite"===r.kind?{functionType:"composite",zoomRange:a,propertyValue:e.value}:{functionType:"camera",layoutSize:r.evaluate(new Ur(t+1)),zoomRange:a,sizeRange:{min:r.evaluate(new Ur(a.min)),max:r.evaluate(new Ur(a.max))},propertyValue:e.value}}Tr("Anchor",oa);var sa=Fo.VectorTileFeature.types,la=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ua(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 ca(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 ha=function(t){this.layoutVertexArray=new fn,this.indexArray=new En,this.programConfigurations=t,this.segments=new Fn,this.dynamicLayoutVertexArray=new dn,this.opacityVertexArray=new mn,this.placedSymbolArray=new Cn};ha.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yo.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Qo.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,la,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},ha.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Tr("SymbolBuffers",ha);var pa=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Fn,this.collisionVertexArray=new vn};pa.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ta.members,!0)},pa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Tr("CollisionBuffers",pa);var fa=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=aa(this.zoom,e["text-size"]),this.iconSizeData=aa(this.zoom,e["icon-size"]);var r=this.layers[0].layout;this.sortFeaturesByY=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sourceID=t.sourceID};fa.prototype.createArrays=function(){this.text=new ha(new Zn(Yo.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new ha(new Zn(Yo.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.collisionBox=new pa(gn,ea.members,Sn),this.collisionCircle=new pa(gn,ra.members,En),this.glyphOffsetArray=new Pn,this.lineVertexArray=new Dn},fa.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.length>0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==a.value.kind||a.value.value&&a.value.value.length>0;if(this.features=[],s||l){for(var u=e.iconDependencies,c=e.glyphDependencies,h=new Ur(this.zoom),p=0,f=t;p<f.length;p+=1){var d=f[p],m=d.feature,y=d.index,g=d.sourceLayerIndex;if(r._featureFilter(h,m)){var v=void 0;s&&(v=na(v=r.getValueAndResolveTokens("text-field",m),r,m));var _=void 0;if(l&&(_=r.getValueAndResolveTokens("icon-image",m)),v||_){var x={text:v,icon:_,index:y,sourceLayerIndex:g,geometry:Hn(m),properties:m.properties,type:sa[m.type]};if(void 0!==m.id&&(x.id=m.id),this.features.push(x),_&&(u[_]=!0),v)for(var b=i.evaluate(m,{}).join(","),w=c[b]=c[b]||{},E="map"===n.get("text-rotation-alignment")&&"line"===n.get("symbol-placement"),S=Mr(v),T=0;T<v.length;T++)if(w[v.charCodeAt(T)]=!0,E&&S){var k=ia[v.charAt(T)];k&&(w[k.charCodeAt(0)]=!0)}}}}"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 l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.text;if(p){var f=l(p,h),d=l(p,h,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,h),y=a(f,d,n[m].geometry);delete e[f],delete r[d],r[l(p,n[y].geometry,!0)]=y,n[m].geometry=null}else f in r?a(f,d,h):d in e?s(f,d,h):(o(u),e[f]=i-1,r[d]=i-1)}else o(u)}return n.filter(function(t){return t.geometry})}(this.features))}},fa.prototype.update=function(t,e){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers))},fa.prototype.isEmpty=function(){return 0===this.symbolInstances.length},fa.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},fa.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},fa.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},fa.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 l=0;l<e.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},fa.prototype.addSymbols=function(t,e,r,n,i,o,a,s,l,u){for(var c=t.indexArray,h=t.layoutVertexArray,p=t.dynamicLayoutVertexArray,f=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),d=this.glyphOffsetArray.length,m=f.vertexLength,y=0,g=e;y<g.length;y+=1){var v=g[y],_=v.tl,x=v.tr,b=v.bl,w=v.br,E=v.tex,S=f.vertexLength,T=v.glyphOffset[1];ua(h,s.x,s.y,_.x,T+_.y,E.x,E.y,r),ua(h,s.x,s.y,x.x,T+x.y,E.x+E.w,E.y,r),ua(h,s.x,s.y,b.x,T+b.y,E.x,E.y+E.h,r),ua(h,s.x,s.y,w.x,T+w.y,E.x+E.w,E.y+E.h,r),ca(p,s,0),c.emplaceBack(S,S+1,S+2),c.emplaceBack(S+1,S+2,S+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(v.glyphOffset[0])}t.placedSymbolArray.emplaceBack(s |