Plugin Directory

Changeset 2382526


Ignore:
Timestamp:
09/16/2020 01:40:33 AM (6 years ago)
Author:
tech2serve
Message:

3.8.0 Adds additional online features; new program; multiple bug fixes

Location:
12-step-meeting-list/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • 12-step-meeting-list/trunk/12-step-meeting-list.php

    r2342593 r2382526  
    44Plugin URI: https://wordpress.org/plugins/12-step-meeting-list/
    55Description: Manage a list of recovery meetings
    6 Version: 3.7.2
     6Version: 3.8.0
    77Author: Code4Recovery
    88Author URI: https://github.com/code4recovery/12-step-meeting-list
     
    2424
    2525if (!defined('TSML_VERSION')) {
    26     define('TSML_VERSION', '3.7.2');
     26    define('TSML_VERSION', '3.8.0');
    2727}
    2828
  • 12-step-meeting-list/trunk/assets/js/admin.min.js

    r2337016 r2382526  
    1 !function(t){"object"==typeof exports&&exports&&"object"==typeof module&&module&&module.exports===exports?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){var e=t[0];return e.offsetWidth>0&&e.offsetHeight>0}function i(e){if(e.minTime&&(e.minTime=_(e.minTime)),e.maxTime&&(e.maxTime=_(e.maxTime)),e.durationTime&&"function"!=typeof e.durationTime&&(e.durationTime=_(e.durationTime)),"now"==e.scrollDefault)e.scrollDefault=function(){return e.roundingFunction(_(new Date),e)};else if(e.scrollDefault&&"function"!=typeof e.scrollDefault){var i=e.scrollDefault;e.scrollDefault=function(){return e.roundingFunction(_(i),e)}}else e.minTime&&(e.scrollDefault=function(){return e.roundingFunction(e.minTime,e)});if("string"===t.type(e.timeFormat)&&e.timeFormat.match(/[gh]/)&&(e._twelveHourTime=!0),!1===e.showOnFocus&&-1!=e.showOn.indexOf("focus")&&e.showOn.splice(e.showOn.indexOf("focus"),1),e.disableTimeRanges.length>0){for(var n in e.disableTimeRanges)e.disableTimeRanges[n]=[_(e.disableTimeRanges[n][0]),_(e.disableTimeRanges[n][1])];e.disableTimeRanges=e.disableTimeRanges.sort(function(t,e){return t[0]-e[0]});for(n=e.disableTimeRanges.length-1;n>0;n--)e.disableTimeRanges[n][0]<=e.disableTimeRanges[n-1][1]&&(e.disableTimeRanges[n-1]=[Math.min(e.disableTimeRanges[n][0],e.disableTimeRanges[n-1][0]),Math.max(e.disableTimeRanges[n][1],e.disableTimeRanges[n-1][1])],e.disableTimeRanges.splice(n,1))}return e}function n(e){var i=e.data("timepicker-settings"),n=e.data("timepicker-list");if(n&&n.length&&(n.remove(),e.data("timepicker-list",!1)),i.useSelect){n=t("<select />",{class:"ui-timepicker-select"}),e.attr("name")&&n.attr("name","ui-timepicker-"+e.attr("name"));var a=n}else{n=t("<ul />",{class:"ui-timepicker-list"}),(a=t("<div />",{class:"ui-timepicker-wrapper",tabindex:-1})).css({display:"none",position:"absolute"}).append(n)}if(i.noneOption)if(!0===i.noneOption&&(i.noneOption=i.useSelect?"Time...":"None"),t.isArray(i.noneOption)){for(var u in i.noneOption)if(parseInt(u,10)==u){var c=r(i.noneOption[u],i.useSelect);n.append(c)}}else{c=r(i.noneOption,i.useSelect);n.append(c)}i.className&&a.addClass(i.className),null===i.minTime&&null===i.durationTime||!i.showDuration||("function"==typeof i.step||i.step,a.addClass("ui-timepicker-with-duration"),a.addClass("ui-timepicker-step-"+i.step));var h=i.minTime;"function"==typeof i.durationTime?h=_(i.durationTime()):null!==i.durationTime&&(h=i.durationTime);var f=null!==i.minTime?i.minTime:0,d=null!==i.maxTime?i.maxTime:f+b-1;d<f&&(d+=b),d===b-1&&"string"===t.type(i.timeFormat)&&i.show2400&&(d=b);var m=i.disableTimeRanges,w=0,T=m.length,k=i.step;"function"!=typeof k&&(k=function(){return i.step});u=f;for(var E=0;u<=d;u+=60*k(++E)){var A,z=u,I=v(z,i);if(i.useSelect)(A=t("<option />",{value:I})).text(I);else(A=t("<li />")).addClass(z%b<b/2?"ui-timepicker-am":"ui-timepicker-pm"),A.data("time",x(z,i)),A.text(I);if((null!==i.minTime||null!==i.durationTime)&&i.showDuration){var C=g(u-h,i.step);if(i.useSelect)A.text(A.text()+" ("+C+")");else{var M=t("<span />",{class:"ui-timepicker-duration"});M.text(" ("+C+")"),A.append(M)}}w<T&&(z>=m[w][1]&&(w+=1),m[w]&&z>=m[w][0]&&z<m[w][1]&&(i.useSelect?A.prop("disabled",!0):A.addClass("ui-timepicker-disabled"))),n.append(A)}if(a.data("timepicker-input",e),e.data("timepicker-list",a),i.useSelect)e.val()&&n.val(o(_(e.val()),i)),n.on("focus",function(){t(this).data("timepicker-input").trigger("showTimepicker")}),n.on("blur",function(){t(this).data("timepicker-input").trigger("hideTimepicker")}),n.on("change",function(){p(e,t(this).val(),"select")}),p(e,n.val(),"initial"),e.hide().after(n);else{var P=i.appendTo;"string"==typeof P?P=t(P):"function"==typeof P&&(P=P(e)),P.append(a),l(e,n),n.on("mousedown click","li",function(i){e.off("focus.timepicker"),e.on("focus.timepicker-ie-hack",function(){e.off("focus.timepicker-ie-hack"),e.on("focus.timepicker",S.show)}),s(e)||e[0].focus(),n.find("li").removeClass("ui-timepicker-selected"),t(this).addClass("ui-timepicker-selected"),y(e)&&(e.trigger("hideTimepicker"),n.on("mouseup.timepicker click.timepicker","li",function(t){n.off("mouseup.timepicker click.timepicker"),a.hide()}))})}}function r(e,i){var n,r,o;return"object"==typeof e?(n=e.label,r=e.className,o=e.value):"string"==typeof e?(n=e,o=""):t.error("Invalid noneOption value"),i?t("<option />",{value:o,class:r,text:n}):t("<li />",{class:r,text:n}).data("time",String(o))}function o(t,e){if(null!==(t=e.roundingFunction(t,e)))return v(t,e)}function a(e){if(e.target!=window){var i=t(e.target);i.closest(".ui-timepicker-input").length||i.closest(".ui-timepicker-wrapper").length||(S.hide(),t(document).unbind(".ui-timepicker"),t(window).unbind(".ui-timepicker"))}}function s(t){var e=t.data("timepicker-settings");return(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&e.disableTouchKeyboard}function u(e,i,n){if(!n&&0!==n)return!1;var r=e.data("timepicker-settings"),o=!1;n=r.roundingFunction(n,r);return i.find("li").each(function(e,i){var r=t(i);if("number"==typeof r.data("time"))return r.data("time")==n?(o=r,!1):void 0}),o}function l(t,e){e.find("li").removeClass("ui-timepicker-selected");var i=t.data("timepicker-settings"),n=_(h(t),i);if(null!==n){var r=u(t,e,n);if(r){var o=r.offset().top-e.offset().top;(o+r.outerHeight()>e.outerHeight()||o<0)&&e.scrollTop(e.scrollTop()+r.position().top-r.outerHeight()),(i.forceRoundTime||r.data("time")===n)&&r.addClass("ui-timepicker-selected")}}}function c(e,i){if("timepicker"!=i){var n=t(this);if(""===this.value)return void p(n,null,i);if(!n.is(":focus")||e&&"change"==e.type){var r=n.data("timepicker-settings"),o=_(this.value,r);if(null===o)return void n.trigger("timeFormatError");var a=!1;if(null!==r.minTime&&null!==r.maxTime&&(o<r.minTime||o>r.maxTime)&&(a=!0),t.each(r.disableTimeRanges,function(){if(o>=this[0]&&o<this[1])return a=!0,!1}),r.forceRoundTime){var s=r.roundingFunction(o,r);s!=o&&(o=s,i=null)}var u=v(o,r);a?(p(n,u,"error")||e&&"change"==e.type)&&n.trigger("timeRangeError"):p(n,u,i)}}}function h(t){return t.is("input")?t.val():t.data("ui-timepicker-value")}function p(t,e,i){if(t.is("input")){null===e&&""==t.val()||t.val(e);var n=t.data("timepicker-settings");n.useSelect&&"select"!=i&&t.data("timepicker-list")&&t.data("timepicker-list").val(o(_(e),n))}return t.data("ui-timepicker-value")!=e?(t.data("ui-timepicker-value",e),"select"==i?t.trigger("selectTime").trigger("changeTime").trigger("change","timepicker"):-1==["error","initial"].indexOf(i)&&t.trigger("changeTime"),!0):(-1==["error","initial"].indexOf(i)&&t.trigger("selectTime"),!1)}function f(t){switch(t.keyCode){case 13:case 9:return;default:t.preventDefault()}}function d(i){var n=t(this),r=n.data("timepicker-list");if(!r||!e(r)){if(40!=i.keyCode)return!0;S.show.call(n.get(0)),r=n.data("timepicker-list"),s(n)||n.focus()}switch(i.keyCode){case 13:return y(n)&&(c.call(n.get(0),{type:"change"}),S.hide.apply(this)),i.preventDefault(),!1;case 38:var o=r.find(".ui-timepicker-selected");return o.length?o.is(":first-child")||(o.removeClass("ui-timepicker-selected"),o.prev().addClass("ui-timepicker-selected"),o.prev().position().top<o.outerHeight()&&r.scrollTop(r.scrollTop()-o.outerHeight())):(r.find("li").each(function(e,i){if(t(i).position().top>0)return o=t(i),!1}),o.addClass("ui-timepicker-selected")),!1;case 40:return 0===(o=r.find(".ui-timepicker-selected")).length?(r.find("li").each(function(e,i){if(t(i).position().top>0)return o=t(i),!1}),o.addClass("ui-timepicker-selected")):o.is(":last-child")||(o.removeClass("ui-timepicker-selected"),o.next().addClass("ui-timepicker-selected"),o.next().position().top+2*o.outerHeight()>r.outerHeight()&&r.scrollTop(r.scrollTop()+o.outerHeight())),!1;case 27:r.find("li").removeClass("ui-timepicker-selected"),S.hide();break;case 9:S.hide();break;default:return!0}}function m(i){var n=t(this),r=n.data("timepicker-list"),o=n.data("timepicker-settings");if(!r||!e(r)||o.disableTextInput)return!0;if("paste"!==i.type&&"cut"!==i.type)switch(i.keyCode){case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 65:case 77:case 80:case 186:case 8:case 46:o.typeaheadHighlight?l(n,r):r.hide()}else setTimeout(function(){o.typeaheadHighlight?l(n,r):r.hide()},0)}function y(t){var e=t.data("timepicker-settings"),i=null,n=t.data("timepicker-list").find(".ui-timepicker-selected");return!n.hasClass("ui-timepicker-disabled")&&(n.length&&(i=n.data("time")),null!==i&&("string"!=typeof i&&(i=v(i,e)),p(t,i,"select")),!0)}function g(t,e){t=Math.abs(t);var i,n,r=Math.round(t/60),o=[];return r<60?o=[r,w.mins]:(i=Math.floor(r/60),n=r%60,30==e&&30==n&&(i+=w.decimal+5),o.push(i),o.push(1==i?w.hr:w.hrs),30!=e&&n&&(o.push(n),o.push(w.mins))),o.join(" ")}function v(e,i){if("number"!=typeof e)return null;var n=parseInt(e%60),r=parseInt(e/60%60),o=parseInt(e/3600%24),a=new Date(1970,0,2,o,r,n,0);if(isNaN(a.getTime()))return null;if("function"===t.type(i.timeFormat))return i.timeFormat(a);for(var s,u,l="",c=0;c<i.timeFormat.length;c++)switch(u=i.timeFormat.charAt(c)){case"a":l+=a.getHours()>11?w.pm:w.am;break;case"A":l+=a.getHours()>11?w.PM:w.AM;break;case"g":l+=0===(s=a.getHours()%12)?"12":s;break;case"G":s=a.getHours(),e===b&&(s=i.show2400?24:0),l+=s;break;case"h":0!==(s=a.getHours()%12)&&s<10&&(s="0"+s),l+=0===s?"12":s;break;case"H":s=a.getHours(),e===b&&(s=i.show2400?24:0),l+=s>9?s:"0"+s;break;case"i":l+=(r=a.getMinutes())>9?r:"0"+r;break;case"s":l+=(n=a.getSeconds())>9?n:"0"+n;break;case"\\":c++,l+=i.timeFormat.charAt(c);break;default:l+=u}return l}function _(t,e){if(""===t||null===t)return null;if("object"==typeof t)return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds();if("string"!=typeof t)return t;"a"!=(t=t.toLowerCase().replace(/[\s\.]/g,"")).slice(-1)&&"p"!=t.slice(-1)||(t+="m");var i=(w.am.replace(".",""),w.pm.replace(".",""),w.AM.replace(".",""),w.PM.replace(".",""),new RegExp("^(([^0-9]*))?([0-9]?[0-9])(\\W?([0-5][0-9]))?(\\W+([0-5][0-9]))?(([^0-9]*))$","u")),n=t.match(i);if(!n)return null;var r=parseInt(1*n[3],10),o=n[2]||n[9],a=r,s=1*n[5]||0,u=1*n[7]||0;if(r<=12&&o){var l=(o=o.trim())==w.pm||o==w.PM;a=12==r?l?12:0:r+(l?12:0)}else if(e){if(3600*r+60*s+u>=b+(e.show2400?1:0)){if(!1===e.wrapHours)return null;a=r%24}}var c=3600*a+60*s+u;if(r<12&&!o&&e&&e._twelveHourTime&&e.scrollDefault){var h=c-e.scrollDefault();h<0&&h>=b/-2&&(c=(c+b/2)%b)}return c}function x(t,e){return t==b&&e.show2400?t:t%b}var b=86400,w={am:"am",pm:"pm",AM:"AM",PM:"PM",decimal:".",mins:"mins",hr:"hr",hrs:"hrs"},S={init:function(e){return this.each(function(){var r=t(this),o=[];for(var a in t.fn.timepicker.defaults)r.data(a)&&(o[a]=r.data(a));var s=t.extend({},t.fn.timepicker.defaults,e,o);if(s.lang&&(w=t.extend(w,s.lang)),s=i(s),r.data("timepicker-settings",s),r.addClass("ui-timepicker-input"),s.useSelect)n(r);else{if(r.prop("autocomplete","off"),s.showOn)for(var u in s.showOn)r.on(s.showOn[u]+".timepicker",S.show);r.on("change.timepicker",c),r.on("keydown.timepicker",d),r.on("keyup.timepicker",m),s.disableTextInput&&r.on("keydown.timepicker",f),r.on("cut.timepicker",m),r.on("paste.timepicker",m),c.call(r.get(0),null,"initial")}})},show:function(i){var r=t(this),o=r.data("timepicker-settings");if(i&&i.preventDefault(),o.useSelect)r.data("timepicker-list").focus();else{s(r)&&r.blur();var c=r.data("timepicker-list");if(!r.prop("readonly")&&(c&&0!==c.length&&"function"!=typeof o.durationTime||(n(r),c=r.data("timepicker-list")),!e(c))){r.data("ui-timepicker-value",r.val()),l(r,c),S.hide(),"number"==typeof o.listWidth&&(console.log(o.listWidth),c.width(r.outerWidth()*o.listWidth)),c.show();var p={};o.orientation.match(/r/)?p.left=r.offset().left+r.outerWidth()-c.outerWidth()+parseInt(c.css("marginLeft").replace("px",""),10):o.orientation.match(/l/)?p.left=r.offset().left+parseInt(c.css("marginLeft").replace("px",""),10):o.orientation.match(/c/)&&(p.left=r.offset().left+(r.outerWidth()-c.outerWidth())/2+parseInt(c.css("marginLeft").replace("px",""),10)),"t"==(o.orientation.match(/t/)?"t":o.orientation.match(/b/)?"b":r.offset().top+r.outerHeight(!0)+c.outerHeight()>t(window).height()+t(window).scrollTop()?"t":"b")?(c.addClass("ui-timepicker-positioned-top"),p.top=r.offset().top-c.outerHeight()+parseInt(c.css("marginTop").replace("px",""),10)):(c.removeClass("ui-timepicker-positioned-top"),p.top=r.offset().top+r.outerHeight()+parseInt(c.css("marginTop").replace("px",""),10)),c.offset(p);var f=c.find(".ui-timepicker-selected");if(!f.length){var d=_(h(r));null!==d?f=u(r,c,d):o.scrollDefault&&(f=u(r,c,o.scrollDefault()))}if(f.length&&!f.hasClass("ui-timepicker-disabled")||(f=c.find("li:not(.ui-timepicker-disabled):first")),f&&f.length){var m=c.scrollTop()+f.position().top-f.outerHeight();c.scrollTop(m)}else c.scrollTop(0);return o.stopScrollPropagation&&t(document).on("wheel.ui-timepicker",".ui-timepicker-wrapper",function(e){e.preventDefault();var i=t(this).scrollTop();t(this).scrollTop(i+e.originalEvent.deltaY)}),t(document).on("touchstart.ui-timepicker mousedown.ui-timepicker",a),t(window).on("resize.ui-timepicker",a),o.closeOnWindowScroll&&t(document).on("scroll.ui-timepicker",a),r.trigger("showTimepicker"),this}}},hide:function(i){var n=t(this),r=n.data("timepicker-settings");return r&&r.useSelect&&n.blur(),t(".ui-timepicker-wrapper").each(function(){var i=t(this);if(e(i)){var n=i.data("timepicker-input"),r=n.data("timepicker-settings");r&&r.selectOnBlur&&y(n),i.hide(),n.trigger("hideTimepicker")}}),this},option:function(e,r){return"string"==typeof e&&void 0===r?t(this).data("timepicker-settings")[e]:this.each(function(){var o=t(this),a=o.data("timepicker-settings"),s=o.data("timepicker-list");"object"==typeof e?a=t.extend(a,e):"string"==typeof e&&(a[e]=r),a=i(a),o.data("timepicker-settings",a),c.call(o.get(0),{type:"change"},"initial"),s&&(s.remove(),o.data("timepicker-list",!1)),a.useSelect&&n(o)})},getSecondsFromMidnight:function(){return _(h(this))},getTime:function(t){var e=h(this);if(!e)return null;var i=_(e);if(null===i)return null;t||(t=new Date);var n=new Date(t);return n.setHours(i/3600),n.setMinutes(i%3600/60),n.setSeconds(i%60),n.setMilliseconds(0),n},isVisible:function(){var t=this.data("timepicker-list");return!(!t||!e(t))},setTime:function(t){var e=this,i=e.data("timepicker-settings");if(i.forceRoundTime)var n=o(_(t),i);else n=v(_(t),i);return t&&null===n&&i.noneOption&&(n=t),p(e,n,"initial"),c.call(e.get(0),{type:"change"},"initial"),e.data("timepicker-list")&&l(e,e.data("timepicker-list")),this},remove:function(){var t=this;if(t.hasClass("ui-timepicker-input")){var e=t.data("timepicker-settings");return t.removeAttr("autocomplete","off"),t.removeClass("ui-timepicker-input"),t.removeData("timepicker-settings"),t.off(".timepicker"),t.data("timepicker-list")&&t.data("timepicker-list").remove(),e.useSelect&&t.show(),t.removeData("timepicker-list"),this}}};t.fn.timepicker=function(e){return this.length?S[e]?this.hasClass("ui-timepicker-input")?S[e].apply(this,Array.prototype.slice.call(arguments,1)):this:"object"!=typeof e&&e?void t.error("Method "+e+" does not exist on jQuery.timepicker"):S.init.apply(this,arguments):this},t.fn.timepicker.defaults={appendTo:"body",className:null,closeOnWindowScroll:!1,disableTextInput:!1,disableTimeRanges:[],disableTouchKeyboard:!1,durationTime:null,forceRoundTime:!1,listWidth:null,maxTime:null,minTime:null,noneOption:!1,orientation:"l",roundingFunction:function(t,e){if(null===t)return null;if("number"!=typeof e.step)return t;var i=t%(60*e.step);return(i-=(e.minTime||0)%(60*e.step))>=30*e.step?t+=60*e.step-i:t-=i,x(t,e)},scrollDefault:null,selectOnBlur:!1,show2400:!1,showDuration:!1,showOn:["click","focus"],showOnFocus:!0,step:30,stopScrollPropagation:!1,timeFormat:"g:ia",typeaheadHighlight:!0,useSelect:!1,wrapHours:!0}}),function(t,e){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(i){return t.Bloodhound=e(i)}):"object"==typeof exports?module.exports=e(require("jquery")):t.Bloodhound=e(jQuery)}(this,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,i){t.each(e,function(t,e){return i(e,t)})},map:t.map,filter:t.grep,every:function(e,i){var n=!0;return e?(t.each(e,function(t,r){if(!(n=i.call(null,r,t,e)))return!1}),!!n):n},some:function(e,i){var n=!1;return e?(t.each(e,function(t,r){if(n=i.call(null,r,t,e))return!1}),!!n):n},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){return t.isFunction(e)?e:function(){return String(e)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,i){var n,r;return function(){var o,a,s=this,u=arguments;return o=function(){n=null,i||(r=t.apply(s,u))},a=i&&!n,clearTimeout(n),n=setTimeout(o,e),a&&(r=t.apply(s,u)),r}},throttle:function(t,e){var i,n,r,o,a,s;return a=0,s=function(){a=new Date,r=null,o=t.apply(i,n)},function(){var u=new Date,l=e-(u-a);return i=this,n=arguments,l<=0?(clearTimeout(r),r=null,a=u,o=t.apply(i,n)):r||(r=setTimeout(s,l)),o}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),i="0.11.1",n=function(){"use strict";return{nonword:i,whitespace:t,obj:{nonword:n(i),whitespace:n(t)}};function t(t){return(t=e.toStr(t))?t.split(/\s+/):[]}function i(t){return(t=e.toStr(t))?t.split(/\W+/):[]}function n(t){return function(i){return i=e.isArray(i)?i:[].slice.call(arguments,0),function(n){var r=[];return e.each(i,function(i){r=r.concat(t(e.toStr(n[i])))}),r}}}}(),r=function(){"use strict";function i(i){this.maxSize=e.isNumber(i)?i:100,this.reset(),this.maxSize<=0&&(this.set=this.get=t.noop)}function n(){this.head=this.tail=null}function r(t,e){this.key=t,this.val=e,this.prev=this.next=null}return e.mixin(i.prototype,{set:function(t,e){var i,n=this.list.tail;this.size>=this.maxSize&&(this.list.remove(n),delete this.hash[n.key],this.size--),(i=this.hash[t])?(i.val=e,this.list.moveToFront(i)):(i=new r(t,e),this.list.add(i),this.hash[t]=i,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new n}}),e.mixin(n.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),i}(),o=function(){"use strict";var i;try{(i=window.localStorage).setItem("~~~","!"),i.removeItem("~~~")}catch(t){i=null}function n(t,n){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+e.escapeRegExChars(this.prefix)),this.ls=n||i,!this.ls&&this._noop()}return e.mixin(n.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=e.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),a(this.ls.getItem(this._prefix(t)))},set:function(t,i,n){return e.isNumber(n)?this._safeSet(this._ttlKey(t),o(r()+n)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),o(i))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=function(t){var e,n,r=[],o=i.length;for(e=0;e<o;e++)(n=i.key(e)).match(t)&&r.push(n.replace(t,""));return r}(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var i=a(this.ls.getItem(this._ttlKey(t)));return!!(e.isNumber(i)&&r()>i)}}),n;function r(){return(new Date).getTime()}function o(t){return JSON.stringify(e.isUndefined(t)?null:t)}function a(e){return t.parseJSON(e)}}(),a=function(){"use strict";var i=0,n={},o=6,a=new r(10);function s(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new r(0):a}return s.setMaxPendingRequests=function(t){o=t},s.resetCache=function(){a.reset()},e.mixin(s.prototype,{_fingerprint:function(e){return(e=e||{}).url+e.type+t.param(e.data||{})},_get:function(t,e){var r,a,s=this;function u(t){e(null,t),s._cache.set(r,t)}function l(){e(!0)}r=this._fingerprint(t),this.cancelled||r!==this.lastReq||((a=n[r])?a.done(u).fail(l):i<o?(i++,n[r]=this._send(t).done(u).fail(l).always(function(){i--,delete n[r],s.onDeckRequestArgs&&(s._get.apply(s,s.onDeckRequestArgs),s.onDeckRequestArgs=null)})):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(i,n){var r,o;n=n||t.noop,i=e.isString(i)?{url:i}:i||{},o=this._fingerprint(i),this.cancelled=!1,this.lastReq=o,(r=this._cache.get(o))?n(null,r):this._get(i,n)},cancel:function(){this.cancelled=!0}}),s}(),s=window.SearchIndex=function(){"use strict";var i="c",n="i";function r(i){(i=i||{}).datumTokenizer&&i.queryTokenizer||t.error("datumTokenizer and queryTokenizer are both required"),this.identify=i.identify||e.stringify,this.datumTokenizer=i.datumTokenizer,this.queryTokenizer=i.queryTokenizer,this.reset()}return e.mixin(r.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var r=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var s,u;r.datums[s=r.identify(t)]=t,u=o(r.datumTokenizer(t)),e.each(u,function(t){var e,o,u;for(e=r.trie,o=t.split("");u=o.shift();)(e=e[i][u]||(e[i][u]=a()))[n].push(s)})})},get:function(t){var i=this;return e.map(t,function(t){return i.datums[t]})},search:function(t){var r,a,s=this;return r=o(this.queryTokenizer(t)),e.each(r,function(t){var e,r,o,u;if(a&&0===a.length)return!1;for(e=s.trie,r=t.split("");e&&(o=r.shift());)e=e[i][o];if(!e||0!==r.length)return a=[],!1;u=e[n].slice(0),a=a?function(t,e){var i=0,n=0,r=[];t=t.sort(),e=e.sort();var o=t.length,a=e.length;for(;i<o&&n<a;)t[i]<e[n]?i++:t[i]>e[n]?n++:(r.push(t[i]),i++,n++);return r}(a,u):u}),a?e.map(function(t){for(var e={},i=[],n=0,r=t.length;n<r;n++)e[t[n]]||(e[t[n]]=!0,i.push(t[n]));return i}(a),function(t){return s.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=a()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),r;function o(t){return t=e.filter(t,function(t){return!!t}),t=e.map(t,function(t){return t.toLowerCase()})}function a(){var t={};return t[n]=[],t[i]={},t}}(),u=function(){"use strict";var t;function i(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new o(t.cacheKey)}return t={data:"data",protocol:"protocol",thumbprint:"thumbprint"},e.mixin(i.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(e){this.cache&&(this.storage.set(t.data,e,this.ttl),this.storage.set(t.protocol,location.protocol,this.ttl),this.storage.set(t.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var e,i={};return this.cache?(i.data=this.storage.get(t.data),i.protocol=this.storage.get(t.protocol),i.thumbprint=this.storage.get(t.thumbprint),e=i.thumbprint!==this.thumbprint||i.protocol!==location.protocol,i.data&&!e?i.data:null):null},fromNetwork:function(t){var e,i=this;t&&(e=this.prepare(this._settings()),this.transport(e).fail(function(){t(!0)}).done(function(e){t(null,i.transform(e))}))},clear:function(){return this.storage.clear(),this}}),i}(),l=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new a({cache:t.cache,limiter:t.limiter,transport:t.transport})}return e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){var i,n=this;if(e)return t=t||"",i=this.prepare(t,this._settings()),this.transport.get(i,function(t,i){e(t?[]:n.transform(i))})},cancelLastRequest:function(){this.transport.cancel()}}),t}(),c=function(){"use strict";return function(r){var o,a;return o={initialize:!0,identify:e.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(r=e.mixin(o,r||{})).datumTokenizer&&t.error("datumTokenizer is required"),!r.queryTokenizer&&t.error("queryTokenizer is required"),a=r.sorter,r.sorter=a?function(t){return t.sort(a)}:e.identity,r.local=e.isFunction(r.local)?r.local():r.local,r.prefetch=function(r){var o;if(!r)return null;return o={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:e.identity,transform:e.identity,transport:null},r=e.isString(r)?{url:r}:r,!(r=e.mixin(o,r)).url&&t.error("prefetch requires url to be set"),r.transform=r.filter||r.transform,r.cacheKey=r.cacheKey||r.url,r.thumbprint=i+r.thumbprint,r.transport=r.transport?n(r.transport):t.ajax,r}(r.prefetch),r.remote=function(i){var r;if(!i)return;return r={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:e.identity,transport:null},i=e.isString(i)?{url:i}:i,!(i=e.mixin(r,i)).url&&t.error("remote requires url to be set"),i.transform=i.filter||i.transform,i.prepare=function(t){var e,i,n;return e=t.prepare,i=t.replace,n=t.wildcard,e||(e=i?function(t,e){return e.url=i(e.url,t),e}:t.wildcard?function(t,e){return e.url=e.url.replace(n,encodeURIComponent(t)),e}:function(t,e){return e})}(i),i.limiter=function(t){var i,n,r;return i=t.limiter,n=t.rateLimitBy,r=t.rateLimitWait,i||(i=/^throttle$/i.test(n)?function(t){return function(i){return e.throttle(i,t)}}(r):function(t){return function(i){return e.debounce(i,t)}}(r)),i}(i),i.transport=i.transport?n(i.transport):t.ajax,delete i.replace,delete i.wildcard,delete i.rateLimitBy,delete i.rateLimitWait,i}(r.remote),r};function n(i){return function(n){var r=t.Deferred();return i(n,function(t){e.defer(function(){r.resolve(t)})},function(t){e.defer(function(){r.reject(t)})}),r}}}();return function(){"use strict";var i;function r(t){t=c(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new l(t.remote):null,this.prefetch=t.prefetch?new u(t.prefetch):null,this.index=new s({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}return i=window&&window.Bloodhound,r.noConflict=function(){return window&&(window.Bloodhound=i),r},r.tokenizers=n,e.mixin(r.prototype,{__ttAdapter:function(){var t=this;return this.remote?function(e,i,n){return t.search(e,i,n)}:function(e,i){return t.search(e,i)}},_loadPrefetch:function(){var e,i,n=this;return e=t.Deferred(),this.prefetch?(i=this.prefetch.fromCache())?(this.index.bootstrap(i),e.resolve()):this.prefetch.fromNetwork(function(t,i){if(t)return e.reject();n.add(i),n.prefetch.store(n.index.serialize()),e.resolve()}):e.resolve(),e.promise()},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(function(){t.add(t.local)}),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=e.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,i,n){var r,o=this;return r=this.sorter(this.index.search(t)),i(this.remote?r.slice():r),this.remote&&r.length<this.sufficient?this.remote.get(t,function(t){var i=[];e.each(t,function(t){!e.some(r,function(e){return o.identify(t)===o.identify(e)})&&i.push(t)}),n&&n(i)}):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return a.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),r}()}),function(t,e){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,i){t.each(e,function(t,e){return i(e,t)})},map:t.map,filter:t.grep,every:function(e,i){var n=!0;return e?(t.each(e,function(t,r){if(!(n=i.call(null,r,t,e)))return!1}),!!n):n},some:function(e,i){var n=!1;return e?(t.each(e,function(t,r){if(n=i.call(null,r,t,e))return!1}),!!n):n},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){return t.isFunction(e)?e:function(){return String(e)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,i){var n,r;return function(){var o,a,s=this,u=arguments;return o=function(){n=null,i||(r=t.apply(s,u))},a=i&&!n,clearTimeout(n),n=setTimeout(o,e),a&&(r=t.apply(s,u)),r}},throttle:function(t,e){var i,n,r,o,a,s;return a=0,s=function(){a=new Date,r=null,o=t.apply(i,n)},function(){var u=new Date,l=e-(u-a);return i=this,n=arguments,l<=0?(clearTimeout(r),r=null,a=u,o=t.apply(i,n)):r||(r=setTimeout(s,l)),o}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),i=function(){"use strict";var t={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return function(r){var o,a;return a=e.mixin({},t,r),{css:(o={css:n(),classes:a,html:(s=a,{wrapper:'<span class="'+s.wrapper+'"></span>',menu:'<div class="'+s.menu+'"></div>'}),selectors:i(a)}).css,html:o.html,classes:o.classes,selectors:o.selectors,mixin:function(t){e.mixin(t,o)}};var s};function i(t){var i={};return e.each(t,function(t,e){i[e]="."+t}),i}function n(){var t={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return e.isMsie()&&e.mixin(t.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t}}(),n=function(){"use strict";var i;function n(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}return"typeahead:",i={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},e.mixin(n.prototype,{_trigger:function(e,i){var n;return n=t.Event("typeahead:"+e),(i=i||[]).unshift(n),this.$el.trigger.apply(this.$el,i),n},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=i[t])&&this._trigger(e,[].slice.call(arguments,1))}}),n}(),r=function(){"use strict";var t=/\s+/,e=function(){var t;t=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)};return t}();return{onSync:function(t,e,n){return i.call(this,"sync",t,e,n)},onAsync:function(t,e,n){return i.call(this,"async",t,e,n)},off:function(e){var i;if(!this._callbacks)return this;e=e.split(t);for(;i=e.shift();)delete this._callbacks[i];return this},trigger:function(i){var r,o,a,s,u;if(!this._callbacks)return this;i=i.split(t),a=[].slice.call(arguments,1);for(;(r=i.shift())&&(o=this._callbacks[r]);)s=n(o.sync,this,[r].concat(a)),u=n(o.async,this,[r].concat(a)),s()&&e(u);return this}};function i(e,i,n,r){var o;if(!n)return this;for(i=i.split(t),n=r?function(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}(n,r):n,this._callbacks=this._callbacks||{};o=i.shift();)this._callbacks[o]=this._callbacks[o]||{sync:[],async:[]},this._callbacks[o][e].push(n);return this}function n(t,e,i){return function(){for(var n,r=0,o=t.length;!n&&r<o;r+=1)n=!1===t[r].apply(e,i);return!n}}}(),o=function(t){"use strict";var i={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(n){var r;(n=e.mixin({},i,n)).node&&n.pattern&&(n.pattern=e.isArray(n.pattern)?n.pattern:[n.pattern],r=function(t,i,n){for(var r,o=[],a=0,s=t.length;a<s;a++)o.push(e.escapeRegExChars(t[a]));return r=n?"\\b("+o.join("|")+")\\b":"("+o.join("|")+")",i?new RegExp(r):new RegExp(r,"i")}(n.pattern,n.caseSensitive,n.wordsOnly),function t(e,i){var n;for(var r=0;r<e.childNodes.length;r++)3===(n=e.childNodes[r]).nodeType?r+=i(n)?1:0:t(n,i)}(n.node,function(e){var i,o,a;(i=r.exec(e.data))&&(a=t.createElement(n.tagName),n.className&&(a.className=n.className),(o=e.splitText(i.index)).splitText(i[0].length),a.appendChild(o.cloneNode(!0)),e.parentNode.replaceChild(a,o));return!!i}))}}(window.document),a=function(){"use strict";var i;function n(i,n){var r;(i=i||{}).input||t.error("input is missing"),n.mixin(this),this.$hint=t(i.hint),this.$input=t(i.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=(r=this.$input,t('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:r.css("font-family"),fontSize:r.css("font-size"),fontStyle:r.css("font-style"),fontVariant:r.css("font-variant"),fontWeight:r.css("font-weight"),wordSpacing:r.css("word-spacing"),letterSpacing:r.css("letter-spacing"),textIndent:r.css("text-indent"),textRendering:r.css("text-rendering"),textTransform:r.css("text-transform")}).insertAfter(r)),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=e.noop)}return i={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(t){return e.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},e.mixin(n.prototype,r,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(t){var e=i[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var i;switch(t){case"up":case"down":i=!o(e);break;default:i=!1}i&&e.preventDefault()},_shouldTrigger:function(t,e){var i;switch(t){case"tab":i=!o(e);break;default:i=!0}return i},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var i,r,o,a;o=t,a=this.query,r=!!(i=n.normalizeQuery(o)===n.normalizeQuery(a))&&this.query.length!==t.length,this.query=t,e||i?!e&&r&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var t,n,r,o,a=this;return t=e.bind(this._onBlur,this),n=e.bind(this._onFocus,this),r=e.bind(this._onKeydown,this),o=e.bind(this._onInput,this),this.$input.on("blur.tt",t).on("focus.tt",n).on("keydown.tt",r),!e.isMsie()||e.isMsie()>9?this.$input.on("input.tt",o):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){i[t.which||t.keyCode]||e.defer(e.bind(a._onInput,a,t))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,i;i=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&i&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,i,n;return t=this.$input.val().length,i=this.$input[0].selectionStart,e.isNumber(i)?i===t:!document.selection||((n=document.selection.createRange()).moveStart("character",-t),t===n.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=t("<div>")}}),n;function o(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),s=function(){"use strict";var i,n;function a(i,r){var o;(i=i||{}).templates=i.templates||{},i.templates.notFound=i.templates.notFound||i.templates.empty,i.source||t.error("missing source"),i.node||t.error("missing node"),i.name&&(o=i.name,!/^[_a-zA-Z0-9-]+$/.test(o))&&t.error("invalid dataset name: "+i.name),r.mixin(this),this.highlight=!!i.highlight,this.name=i.name||n(),this.limit=i.limit||5,this.displayFn=function(t){return t=t||e.stringify,e.isFunction(t)?t:function(e){return e[t]}}(i.display||i.displayKey),this.templates=function(i,n){return{notFound:i.notFound&&e.templatify(i.notFound),pending:i.pending&&e.templatify(i.pending),header:i.header&&e.templatify(i.header),footer:i.footer&&e.templatify(i.footer),suggestion:i.suggestion||function(e){return t("<div>").text(n(e))}}}(i.templates,this.displayFn),this.source=i.source.__ttAdapter?i.source.__ttAdapter():i.source,this.async=e.isUndefined(i.async)?this.source.length>2:!!i.async,this._resetLastSuggestion(),this.$el=t(i.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return i={val:"tt-selectable-display",obj:"tt-selectable-object"},n=e.getIdGenerator(),a.extractData=function(e){var n=t(e);return n.data(i.obj)?{val:n.data(i.val)||"",obj:n.data(i.obj)||null}:null},e.mixin(a.prototype,r,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",this.name,e,!1)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",this.name,e,!0)},_renderSuggestions:function(t,e){var i;i=this._getSuggestionsFragment(t,e),this.$lastSuggestion=i.children().last(),this.$el.html(i).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var i,n;n=(i=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(i),this.$lastSuggestion=n},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(n,r){var a,s=this;return a=document.createDocumentFragment(),e.each(r,function(e){var r,o;o=s._injectQuery(n,e),r=t(s.templates.suggestion(o)).data(i.obj,e).data(i.val,s.displayFn(e)).addClass(s.classes.suggestion+" "+s.classes.selectable),a.appendChild(r[0])}),this.highlight&&o({className:this.classes.highlight,node:a,pattern:n}),t(a)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=t()},_injectQuery:function(t,i){return e.isObject(i)?e.mixin({_query:t},i):i},update:function(e){var i=this,n=!1,r=!1,o=0;function a(t){r||(r=!0,t=(t||[]).slice(0,i.limit),o=t.length,i._overwrite(e,t),o<i.limit&&i.async&&i.trigger("asyncRequested",e))}this.cancel(),this.cancel=function(){n=!0,i.cancel=t.noop,i.async&&i.trigger("asyncCanceled",e)},this.source(e,a,function(r){r=r||[],!n&&o<i.limit&&(i.cancel=t.noop,o+=r.length,i._append(e,r.slice(0,i.limit-o)),i.async&&i.trigger("asyncReceived",e))}),!r&&a([])},cancel:t.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=t("<div>")}}),a}(),u=function(){"use strict";function i(i,n){var r=this;(i=i||{}).node||t.error("node is required"),n.mixin(this),this.$node=t(i.node),this.query=null,this.datasets=e.map(i.datasets,function(e){var i=r.$node.find(e.node).first();return e.node=i.length?i:t("<div>").appendTo(r.$node),new s(e,n)})}return e.mixin(i.prototype,r,{_onSelectableClick:function(e){this.trigger("selectableClicked",t(e.currentTarget))},_onRendered:function(t,e,i,n){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,i,n)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return e.every(this.datasets,function(t){return t.isEmpty()})},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,i,n,r;i=(e=t.position().top)+t.outerHeight(!0),n=this.$node.scrollTop(),r=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(n+e):r<i&&this.$node.scrollTop(n+(i-r))},bind:function(){var t,i=this;return t=e.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),e.each(this.datasets,function(t){t.onSync("asyncRequested",i._propagate,i).onSync("asyncCanceled",i._propagate,i).onSync("asyncReceived",i._propagate,i).onSync("rendered",i._onRendered,i).onSync("cleared",i._onCleared,i)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,i,n;return i=this.getActiveSelectable(),e=this._getSelectables(),-1===(n=(n=((n=(i?e.index(i):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:n)?null:e.eq(n)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?s.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(t){var i=t!==this.query;return i&&(this.query=t,e.each(this.datasets,function(e){e.update(t)})),i},empty:function(){e.each(this.datasets,function(t){t.clear()}),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){this.$node.off(".tt"),this.$node=t("<div>"),e.each(this.datasets,function(t){t.destroy()})}}),i}(),l=function(){"use strict";var t=u.prototype;function i(){u.apply(this,[].slice.call(arguments,0))}return e.mixin(i.prototype,u.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),t.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),t.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(e){return this.$node.css("ltr"===e?this.css.ltr:this.css.rtl),t.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),i}(),c=function(){"use strict";function i(i,r){var o,a,s,u,l,c,h,p,f,d,m;(i=i||{}).input||t.error("missing input"),i.menu||t.error("missing menu"),i.eventBus||t.error("missing event bus"),r.mixin(this),this.eventBus=i.eventBus,this.minLength=e.isNumber(i.minLength)?i.minLength:1,this.input=i.input,this.menu=i.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),o=n(this,"activate","open","_onFocused"),a=n(this,"deactivate","_onBlurred"),s=n(this,"isActive","isOpen","_onEnterKeyed"),u=n(this,"isActive","isOpen","_onTabKeyed"),l=n(this,"isActive","_onEscKeyed"),c=n(this,"isActive","open","_onUpKeyed"),h=n(this,"isActive","open","_onDownKeyed"),p=n(this,"isActive","isOpen","_onLeftKeyed"),f=n(this,"isActive","isOpen","_onRightKeyed"),d=n(this,"_openIfActive","_onQueryChanged"),m=n(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",o,this).onSync("blurred",a,this).onSync("enterKeyed",s,this).onSync("tabKeyed",u,this).onSync("escKeyed",l,this).onSync("upKeyed",c,this).onSync("downKeyed",h,this).onSync("leftKeyed",p,this).onSync("rightKeyed",f,this).onSync("queryChanged",d,this).onSync("whitespaceChanged",m,this).onSync("langDirChanged",this._onLangDirChanged,this)}return e.mixin(i.prototype,{_hacks:function(){var i,n;i=this.input.$input||t("<div>"),n=this.menu.$node||t("<div>"),i.on("blur.tt",function(t){var r,o,a;r=document.activeElement,o=n.is(r),a=n.has(r).length>0,e.isMsie()&&(o||a)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){i.focus()}))}),n.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,i,n){this._updateHint(),this.eventBus.trigger("render",i,n,e)},_onAsyncRequested:function(t,e,i){this.eventBus.trigger("asyncrequest",i,e)},_onAsyncCanceled:function(t,e,i){this.eventBus.trigger("asynccancel",i,e)},_onAsyncReceived:function(t,e,i){this.eventBus.trigger("asyncreceive",i,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var i;(i=this.menu.getActiveSelectable())&&this.select(i)&&e.preventDefault()},_onTabKeyed:function(t,e){var i;(i=this.menu.getActiveSelectable())?this.select(i)&&e.preventDefault():(i=this.menu.getTopSelectable())&&this.autocomplete(i)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=e.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,i,n,r,o,s;t=this.menu.getTopSelectable(),i=this.menu.getSelectableData(t),n=this.input.getInputValue(),!i||e.isBlankString(n)||this.input.hasOverflow()?this.input.clearHint():(r=a.normalizeQuery(n),o=e.escapeRegExChars(r),(s=new RegExp("^(?:"+o+")(.+$)","i").exec(i.val))&&this.input.setHint(n+s[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(e.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),!0)},autocomplete:function(t){var e,i;return e=this.input.getQuery(),!(!((i=this.menu.getSelectableData(t))&&e!==i.val)||this.eventBus.before("autocomplete",i.obj))&&(this.input.setQuery(i.val),this.eventBus.trigger("autocomplete",i.obj),!0)},moveCursor:function(t){var e,i,n,r;return e=this.input.getQuery(),i=this.menu.selectableRelativeToCursor(t),r=(n=this.menu.getSelectableData(i))?n.obj:null,!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before("cursorchange",r)&&(this.menu.setCursor(i),n?this.input.setInputValue(n.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),i;function n(t){var i=[].slice.call(arguments,1);return function(){var n=[].slice.call(arguments);e.each(i,function(e){return t[e].apply(t,n)})}}}();!function(){"use strict";var r,o,s;function h(e,i){e.each(function(){var e,n=t(this);(e=n.data(o.typeahead))&&i(e,n)})}function p(i){var n;return(n=e.isJQuery(i)||e.isElement(i)?t(i).first():[]).length?n:null}r=t.fn.typeahead,o={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},s={initialize:function(r,s){var h;return s=e.isArray(s)?s:[].slice.call(arguments,1),h=i((r=r||{}).classNames),this.each(function(){var i,f,d,m,y,g,v,_,x,b,w;e.each(s,function(t){t.highlight=!!r.highlight}),i=t(this),f=t(h.html.wrapper),d=p(r.hint),m=p(r.menu),y=!1!==r.hint&&!d,g=!1!==r.menu&&!m,y&&(d=function(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css((i=t,{backgroundAttachment:i.css("background-attachment"),backgroundClip:i.css("background-clip"),backgroundColor:i.css("background-color"),backgroundImage:i.css("background-image"),backgroundOrigin:i.css("background-origin"),backgroundPosition:i.css("background-position"),backgroundRepeat:i.css("background-repeat"),backgroundSize:i.css("background-size")})).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1});var i}(i,h)),g&&(m=t(h.html.menu).css(h.css.menu)),d&&d.val(""),i=function(t,e){t.data(o.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}(i,h),(y||g)&&(f.css(h.css.wrapper),i.css(y?h.css.input:h.css.inputWithNoHint),i.wrap(f).parent().prepend(y?d:null).append(g?m:null));w=g?l:u,v=new n({el:i}),_=new a({hint:d,input:i},h),x=new w({node:m,datasets:s},h),b=new c({input:_,menu:x,eventBus:v,minLength:r.minLength},h),i.data(o.www,h),i.data(o.typeahead,b)})},isEnabled:function(){var t;return h(this.first(),function(e){t=e.isEnabled()}),t},enable:function(){return h(this,function(t){t.enable()}),this},disable:function(){return h(this,function(t){t.disable()}),this},isActive:function(){var t;return h(this.first(),function(e){t=e.isActive()}),t},activate:function(){return h(this,function(t){t.activate()}),this},deactivate:function(){return h(this,function(t){t.deactivate()}),this},isOpen:function(){var t;return h(this.first(),function(e){t=e.isOpen()}),t},open:function(){return h(this,function(t){t.open()}),this},close:function(){return h(this,function(t){t.close()}),this},select:function(e){var i=!1,n=t(e);return h(this.first(),function(t){i=t.select(n)}),i},autocomplete:function(e){var i=!1,n=t(e);return h(this.first(),function(t){i=t.autocomplete(n)}),i},moveCursor:function(t){var e=!1;return h(this.first(),function(i){e=i.moveCursor(t)}),e},val:function(t){var e;return arguments.length?(h(this,function(e){e.setVal(t)}),this):(h(this.first(),function(t){e=t.getVal()}),e)},destroy:function(){return h(this,function(t,i){!function(t){var i,n;i=t.data(o.www),n=t.parent().filter(i.selectors.wrapper),e.each(t.data(o.attrs),function(i,n){e.isUndefined(i)?t.removeAttr(n):t.attr(n,i)}),t.removeData(o.typeahead).removeData(o.www).removeData(o.attr).removeClass(i.classes.input),n.length&&(t.detach().insertAfter(n),n.remove())}(i),t.destroy()}),this}},t.fn.typeahead=function(t){return s[t]?s[t].apply(this,[].slice.call(arguments,1)):s.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=r,this}}()}),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,i;function n(n,r){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),(i=r(a)).workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else e=r;else t=r}return n(0,function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(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 r=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:r,frame:function(t){return o(t)},cancelFrame:function(t){return a(t)},getImageData:function(t){var e=self.document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.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 u=self.document.createElement("img");u.onload=function(){s.supportsWebp=!0},u.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="}var l=c;function c(t,e,i,n){this.cx=3*t,this.bx=3*(i-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=i,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 i,n,r,o,a;for(void 0===e&&(e=1e-6),r=t,a=0;a<8;a++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=o/s}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},c.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var h=function(t,e,i){this.column=t,this.row=e,this.zoom=i};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 i=0;i<t.length;i++)if(!d(t[i],e[i]))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,i,n){var r=new l(t,e,i,n);return function(t){return r.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,i=t.y-this.y;return e*e+i*i},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,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,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),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.x+i*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=r,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,i){return Math.min(i,Math.max(e,t))}function v(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var n=0,r=e;n<r.length;n+=1){var o=r[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 S(t,e,i){var n={};for(var r in t)n[r]=e.call(i||this,t[r],r,t);return n}function T(t,e,i){var n={};for(var r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function k(t){return Array.isArray(t)?t.map(k):"object"==typeof t&&t?S(t,k):t}var E={};function A(t){E[t]||("undefined"!=typeof console&&console.warn(t),E[t]=!0)}function z(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function I(t){for(var e=0,i=0,n=t.length,r=n-1,o=void 0,a=void 0;i<n;r=i++)o=t[i],e+=((a=t[r]).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,i,n){t.call(this,e),this.status=i,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 i in e.open("GET",t.url,!0),t.headers)e.setRequestHeader(i,t.headers[i]);return e.withCredentials="include"===t.credentials,e}var L=function(t,e){var i=P(t);return i.responseType="arraybuffer",i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){var n=i.response;if(0===n.byteLength&&200===i.status)return e(new Error("http status 200 returned without content."));i.status>=200&&i.status<300&&i.response?e(null,{data:n,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")}):e(new M(i.statusText,i.status,t.url))},i.send(),i};function D(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function R(t,e,i){if(i&&i[t]){var n=i[t].indexOf(e);-1!==n&&i[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,i){void 0===i&&(i={}),t.call(this,"error",v({error:e},i))}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 i=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];i<n.length;i+=1)n[i].call(this,t);for(var r=0,o=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[];r<o.length;r+=1){var a=o[r];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,i,n){this.message=(t?t+": ":"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function j(t){var e=t.key,i=t.value;return i?[new N(e,i,"constants have been deprecated as of v8")]:[]}function $(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var n=0,r=e;n<r.length;n+=1){var o=r[n];for(var a in o)t[a]=o[a]}return t}function U(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function q(t){return Array.isArray(t)?t.map(q):U(t)}var Z=function(t){function e(e,i){t.call(this,i),this.message=i,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 i=0,n=e;i<n.length;i+=1){var r=n[i],o=r[0],a=r[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"},H={kind:"number"},X={kind:"string"},K={kind:"boolean"},Y={kind:"color"},J={kind:"object"},Q={kind:"value"},tt={kind:"collator"};function et(t,e){return{kind:"array",itemType:t,N:e}}function it(t){if("array"===t.kind){var e=it(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var nt=[W,H,X,K,Y,J,et(Q)];function rt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&!rt(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 i=0,n=nt;i<n.length;i+=1)if(!rt(n[i],e))return null}return"Expected "+it(t)+" but found "+it(e)+" instead."}var ot=n(function(t,e){var i={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 r(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]?r(parseFloat(t)/100):r(parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=r.indexOf("("),l=r.indexOf(")");if(-1!==u&&l+1===r.length){var c=r.substr(0,u),h=r.substr(u+1,l-(u+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,i,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=i,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],i=t[1],n=t[2],r=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(n)+","+r+")"},at.prototype.toArray=function(){var t=this.r,e=this.g,i=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/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,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,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 ut=function(t,e,i){this.type=tt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};function lt(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,i,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ct(t){if(null===t)return W;if("string"==typeof t)return X;if("boolean"==typeof t)return K;if("number"==typeof t)return H;if(t instanceof at)return Y;if(t instanceof st)return tt;if(Array.isArray(t)){for(var e,i=t.length,n=0,r=t;n<r.length;n+=1){var o=ct(r[n]);if(e){if(e===o)continue;e=Q;break}e=o}return et(e||Q,i)}return J}ut.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,K);if(!n)return null;var r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,K);if(!r)return null;var o=null;return i.locale&&!(o=e.parse(i.locale,1,X))?null:new ut(n,r,o)},ut.prototype.evaluate=function(t){return new st(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ut.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ut.prototype.possibleOutputs=function(){return[void 0]},ut.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 i=0,n=e;i<n.length;i+=1)if(!t(n[i]))return!1;return!0}if("object"==typeof e){for(var r in e)if(!t(e[r]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var i=t[1],n=ct(i),r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new ht(n,i)},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:X,number:H,boolean:K,object:J},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 i=t[0],n=ft[i],r=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Q);if(!a)return null;r.push(a)}return new dt(n,r)},dt.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!rt(this.type,ct(i)))return i;if(e===this.args.length-1)throw new pt("Expected value to be of type "+it(this.type)+", but found "+it(ct(i))+" 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:X,number:H,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 i,n;if(t.length>2){var r=t[1];if("string"!=typeof r||!(r in mt))return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=mt[r]}else i=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(i,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(rt(this.type,ct(e)))throw new pt("Expected value to be of type "+it(this.type)+", but found "+it(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 i=this.type.N;"number"==typeof i&&t.push(i)}return t.push(this.input.serialize()),t};var gt={"to-number":H,"to-color":Y},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 i=t[0],n=gt[i],r=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Q);if(!a)return null;r.push(a)}return new vt(n,r)},vt.prototype.evaluate=function(t){if("color"===this.type.kind){for(var e,i,n=0,r=this.args;n<r.length;n+=1)if(i=null,"string"==typeof(e=r[n].evaluate(t))){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":lt(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(i||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}for(var a=null,s=0,u=this.args;s<u.length;s+=1)if(null!==(a=u[s].evaluate(t))){var l=Number(a);if(!isNaN(l))return l}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,i,n){this.name=t,this.type=e,this._evaluate=i,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 St(t){if(t instanceof bt&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!St(t)&&(e=!1)}),e}function Tt(t,e){if(t instanceof bt&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild(function(t){i&&!Tt(t,e)&&(i=!1)}),i}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 i=t[0],n=bt.definitions[i];if(!n)return e.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=o.filter(function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1}),s=[],u=1;u<t.length;u++){var l=t[u],c=void 0;if(1===a.length){var h=a[0][0];c=Array.isArray(h)?h[u-1]:h.type}var p=e.parse(l,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 Et(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(i,r,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(it).join(", ")+")":"("+it(e.type)+"...)"}).join(" | "),S=s.map(function(t){return it(t.type)}).join(", ");e.error("Expected arguments of type "+w+", but found ("+S+") instead.")}return null},bt.register=function(t,e){for(var i in bt.definitions=e,e)t[i]=bt};var kt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};kt.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new kt(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},kt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},kt.prototype.eachChild=function(){},kt.prototype.possibleOutputs=function(){return[void 0]},kt.prototype.serialize=function(){return["var",this.name]};var Et=function(t,e,i,n,r){void 0===e&&(e=[]),void 0===n&&(n=new G),void 0===r&&(r=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=n,this.errors=r,this.expectedType=i};function At(t,e){for(var i,n,r=0,o=t.length-1,a=0;r<=o;){if(i=t[a=Math.floor((r+o)/2)],n=t[a+1],e===i||e>i&&e<n)return a;if(i<e)r=a+1;else{if(!(i>e))throw new pt("Input is not a number.");o=a-1}}return Math.max(a-1,0)}Et.prototype.parse=function(t,e,i,n,r){return void 0===r&&(r={}),e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)},Et.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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var r=n.parse(t,this);if(!r)return null;if(this.expectedType){var o=this.expectedType,a=r.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||(r=new yt(o,r));else if("color"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(this.expectedType,r.type))return null}else e.omitTypeAnnotations||(r=new vt(o,[r]));else e.omitTypeAnnotations||(r=new dt(o,[r]))}if(!(r instanceof ht)&&function t(e){if(e instanceof kt)return t(e.boundExpression);if(e instanceof bt&&"error"===e.name)return!1;if(e instanceof ut)return!1;var i=e instanceof vt||e instanceof dt||e instanceof yt,n=!0;return e.eachChild(function(e){n=i?n&&t(e):n&&e instanceof ht}),!!n&&(wt(e)&&Tt(e,["zoom","heatmap-density","line-progress","is-supported-script"]))}(r)){var s=new xt;try{r=new ht(r.type,r.evaluate(s))}catch(t){return this.error(t.message),null}}return r}return this.error('Unknown expression "'+i+'". 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.")},Et.prototype.concat=function(t,e,i){var n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Et(this.registry,n,e||null,r,this.errors)},Et.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new Z(n,t))},Et.prototype.checkSubtype=function(t,e){var i=rt(t,e);return i&&this.error(i),i};var zt=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,r=i;n<r.length;n+=1){var o=r[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};zt.parse=function(t,e){var i=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(!(i=e.parse(i,1,H)))return null;var r=[],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],u=n[a+1],l=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.',l);if(r.length&&r[r.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(u,c,o);if(!h)return null;o=o||h.type,r.push([s,h])}return new zt(o,i,r)},zt.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[At(e,n)].evaluate(t)},zt.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},zt.prototype.possibleOutputs=function(){return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t},zt.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 It=Ct;function Ct(t,e,i,n){this.cx=3*t,this.bx=3*(i-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=i,this.p2y=n}function Mt(t,e,i){return t*(1-i)+e*i}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 i,n,r,o,a;for(void 0===e&&(e=1e-6),r=t,a=0;a<8;a++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=o/s}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},Ct.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Pt=Object.freeze({number:Mt,color:function(t,e,i){return new at(Mt(t.r,e.r,i),Mt(t.g,e.g,i),Mt(t.b,e.b,i),Mt(t.a,e.a,i))},array:function(t,e,i){return t.map(function(t,n){return Mt(t,e[n],i)})}}),Lt=function(t,e,i,n){this.type=t,this.interpolation=e,this.input=i,this.labels=[],this.outputs=[];for(var r=0,o=n;r<o.length;r+=1){var a=o[r],s=a[0],u=a[1];this.labels.push(s),this.outputs.push(u)}};function Dt(t,e,i,n){var r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}Lt.interpolationFactor=function(t,e,i,n){var r=0;if("exponential"===t.name)r=Dt(e,t.base,i,n);else if("linear"===t.name)r=Dt(e,1,i,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;r=new It(o[0],o[1],o[2],o[3]).solve(Dt(e,1,i,n))}return r},Lt.parse=function(t,e){var i=t[1],n=t[2],r=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var o=i[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:o}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);var a=i.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);i={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,H)))return null;var s=[],u=null;e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var l=0;l<r.length;l+=2){var c=r[l],h=r[l+1],p=l+3,f=l+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,u);if(!d)return null;u=u||d.type,s.push([c,d])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Lt(u,i,n,s):e.error("Type "+it(u)+" is not interpolatable.")},Lt.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);var o=At(e,n),a=e[o],s=e[o+1],u=Lt.interpolationFactor(this.interpolation,n,a,s),l=i[o].evaluate(t),c=i[o+1].evaluate(t);return Pt[this.type.kind.toLowerCase()](l,c,u)},Lt.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[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 i=null,n=e.expectedType;n&&"value"!==n.kind&&(i=n);for(var r=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],u=e.parse(s,1+r.length,i,void 0,{omitTypeAnnotations:!0});if(!u)return null;i=i||u.type,r.push(u)}var l=n&&r.some(function(t){return rt(n,t.type)});return new Rt(l?Q:i,r)},Rt.prototype.evaluate=function(t){for(var e=null,i=0,n=this.args;i<n.length&&null===(e=n[i].evaluate(t));i+=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,i=this.bindings;e<i.length;e+=1)t(i[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 i=[],n=1;n<t.length-1;n+=2){var r=t[n];if("string"!=typeof r)return e.error("Expected string, but found "+typeof r+" instead.",n);if(/[^a-zA-Z0-9_]/.test(r))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;i.push([r,o])}var a=e.parse(t[t.length-1],t.length-1,void 0,i);return a?new Bt(i,a):null},Bt.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Bt.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var n=i[e],r=n[0],o=n[1];t.push(r,o.serialize())}return t.push(this.result.serialize()),t};var Ot=function(t,e,i){this.type=t,this.index=e,this.input=i};Ot.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,H),n=e.parse(t[2],2,et(e.expectedType||Q));if(!i||!n)return null;var r=n.type;return new Ot(r.itemType,i,n)},Ot.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new pt("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new pt("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new pt("Array index must be an integer, but found "+e+" instead.");return i[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,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,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 i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return l.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return l.error("Numeric branch labels must be integer values.");if(i){if(l.checkSubtype(i,ct(p)))return null}else i=ct(p);if(void 0!==r[String(p)])return l.error("Branch labels must be unique.");r[String(p)]=o.length}var f=e.parse(u,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(i,d.type)?null:new Ft(i,n,d,r,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()],i=[],n={},r=0,o=Object.keys(this.cases).sort();r<o.length;r+=1){var a=o[r],s=n[t.cases[a]];void 0===s?(n[t.cases[a]]=i.length,i.push([t.cases[a],[a]])):i[s][1].push(a)}for(var u=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=i;l<c.length;l+=1){var h=c[l],p=h[0],f=h[1];1===f.length?e.push(u(f[0])):e.push(f.map(u)),e.push(t.outputs[p].serialize())}return e.push(this.otherwise.serialize()),e};var Vt=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};function Nt(t){return"string"===t.kind||"number"===t.kind||"boolean"===t.kind||"null"===t.kind}function jt(t,e){return function(){function i(t,e,i){this.type=K,this.lhs=t,this.rhs=e,this.collator=i}return i.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 r=e.parse(t[2],2,Q);if(!r)return null;if(!Nt(n.type)&&!Nt(r.type))return e.error("Expected at least one argument to be a string, number, boolean, or null, but found ("+it(n.type)+", "+it(r.type)+") instead.");if(n.type.kind!==r.type.kind&&"value"!==n.type.kind&&"value"!==r.type.kind)return e.error("Cannot compare "+it(n.type)+" and "+it(r.type)+".");var o=null;if(4===t.length){if("string"!==n.type.kind&&"string"!==r.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 i(n,r,o)},i.prototype.evaluate=function(t){var i=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?!i:i},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},i}()}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 i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n=[],r=1;r<t.length-1;r+=2){var o=e.parse(t[r],r,K);if(!o)return null;var a=e.parse(t[r+1],r+1,i);if(!a)return null;n.push([o,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new Vt(i,n,s):null},Vt.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],r=n[0],o=n[1];if(r.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},Vt.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],r=n[0],o=n[1];t(r),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 $t=jt("==",!1),Ut=jt("!=",!0),qt=function(t){this.type=H,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 i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+it(i.type)+" instead."):new qt(i):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 "+it(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={"==":$t,"!=":Ut,array:yt,at:Ot,boolean:dt,case:Vt,coalesce:Rt,collator:ut,interpolate:Lt,length:qt,let:Bt,literal:ht,match:Ft,number:dt,object:dt,step:zt,string:dt,"to-color":vt,"to-number":vt,var:kt};function Gt(t,e){var i=e[0],n=e[1],r=e[2],o=e[3];i=i.evaluate(t),n=n.evaluate(t),r=r.evaluate(t);var a=o?o.evaluate(t):1,s=lt(i,n,r,a);if(s)throw new pt(s);return new at(i/255*a,n/255*a,r/255*a,a)}function Wt(t,e){return t in e}function Ht(t,e){var i=e[t];return void 0===i?null:i}function Xt(t,e){var i=e[0],n=e[1];return i.evaluate(t)<n.evaluate(t)}function Kt(t,e){var i=e[0],n=e[1];return i.evaluate(t)>n.evaluate(t)}function Yt(t,e){var i=e[0],n=e[1];return i.evaluate(t)<=n.evaluate(t)}function Jt(t,e){var i=e[0],n=e[1];return i.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 ie(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 re(t){return!!t.expression&&t.expression.interpolated}bt.register(Zt,{error:[{kind:"error"},[X],function(t,e){var i=e[0];throw new pt(i.evaluate(t))}],typeof:[X,[Q],function(t,e){return it(ct(e[0].evaluate(t)))}],"to-string":[X,[Q],function(t,e){var i=e[0],n=typeof(i=i.evaluate(t));return null===i?"":"string"===n||"number"===n||"boolean"===n?String(i):i instanceof at?i.toString():JSON.stringify(i)}],"to-boolean":[K,[Q],function(t,e){var i=e[0];return Boolean(i.evaluate(t))}],"to-rgba":[et(H,4),[Y],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Y,[H,H,H],Gt],rgba:[Y,[H,H,H,H],Gt],has:{type:K,overloads:[[[X],function(t,e){return Wt(e[0].evaluate(t),t.properties())}],[[X,J],function(t,e){var i=e[0],n=e[1];return Wt(i.evaluate(t),n.evaluate(t))}]]},get:{type:Q,overloads:[[[X],function(t,e){return Ht(e[0].evaluate(t),t.properties())}],[[X,J],function(t,e){var i=e[0],n=e[1];return Ht(i.evaluate(t),n.evaluate(t))}]]},"feature-state":[Q,[X],function(t,e){return Ht(e[0].evaluate(t),t.featureState||{})}],properties:[J,[],function(t){return t.properties()}],"geometry-type":[X,[],function(t){return t.geometryType()}],id:[Q,[],function(t){return t.id()}],zoom:[H,[],function(t){return t.globals.zoom}],"heatmap-density":[H,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[H,[],function(t){return t.globals.lineProgress||0}],"+":[H,Qt(H),function(t,e){for(var i=0,n=0,r=e;n<r.length;n+=1)i+=r[n].evaluate(t);return i}],"*":[H,Qt(H),function(t,e){for(var i=1,n=0,r=e;n<r.length;n+=1)i*=r[n].evaluate(t);return i}],"-":{type:H,overloads:[[[H,H],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)-n.evaluate(t)}],[[H],function(t,e){return-e[0].evaluate(t)}]]},"/":[H,[H,H],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)/n.evaluate(t)}],"%":[H,[H,H],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)%n.evaluate(t)}],ln2:[H,[],function(){return Math.LN2}],pi:[H,[],function(){return Math.PI}],e:[H,[],function(){return Math.E}],"^":[H,[H,H],function(t,e){var i=e[0],n=e[1];return Math.pow(i.evaluate(t),n.evaluate(t))}],sqrt:[H,[H],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[H,[H],function(t,e){var i=e[0];return Math.log10(i.evaluate(t))}],ln:[H,[H],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[H,[H],function(t,e){var i=e[0];return Math.log2(i.evaluate(t))}],sin:[H,[H],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[H,[H],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[H,[H],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[H,[H],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[H,[H],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[H,[H],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[H,Qt(H),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[H,Qt(H),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[H,[H],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[H,[H],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[H,[H],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[H,[H],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[K,[X,Q],function(t,e){var i=e[0],n=e[1];return t.properties()[i.value]===n.value}],"filter-id-==":[K,[Q],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[K,[X],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[K,[X,Q],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r<o}],"filter-id-<":[K,[Q],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n<r}],"filter->":[K,[X,Q],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r>o}],"filter-id->":[K,[Q],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n>r}],"filter-<=":[K,[X,Q],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[K,[Q],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n<=r}],"filter->=":[K,[X,Q],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[K,[Q],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n>=r}],"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(X)],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,[X,et(Q)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[K,[X,et(Q)],function(t,e){var i=e[0],n=e[1];return function(t,e,i,n){for(;i<=n;){var r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[i.value],n.value,0,n.value.length-1)}],">":{type:K,overloads:[[[H,H],Kt],[[X,X],Kt],[[X,X,tt],function(t,e){var i=e[0],n=e[1];return e[2].evaluate(t).compare(i.evaluate(t),n.evaluate(t))>0}]]},"<":{type:K,overloads:[[[H,H],Xt],[[X,X],Xt],[[X,X,tt],function(t,e){var i=e[0],n=e[1];return e[2].evaluate(t).compare(i.evaluate(t),n.evaluate(t))<0}]]},">=":{type:K,overloads:[[[H,H],Jt],[[X,X],Jt],[[X,X,tt],function(t,e){var i=e[0],n=e[1];return e[2].evaluate(t).compare(i.evaluate(t),n.evaluate(t))>=0}]]},"<=":{type:K,overloads:[[[H,H],Yt],[[X,X],Yt],[[X,X,tt],function(t,e){var i=e[0],n=e[1];return e[2].evaluate(t).compare(i.evaluate(t),n.evaluate(t))<=0}]]},all:{type:K,overloads:[[[K,K],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)&&n.evaluate(t)}],[Qt(K),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(!n[i].evaluate(t))return!1;return!0}]]},any:{type:K,overloads:[[[K,K],function(t,e){var i=e[0],n=e[1];return i.evaluate(t)||n.evaluate(t)}],[Qt(K),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(n[i].evaluate(t))return!0;return!1}]]},"!":[K,[K],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[K,[X],function(t,e){var i=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(i.evaluate(t))}],upcase:[X,[X],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[X,[X],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[X,Qt(X),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}],"resolved-locale":[X,[tt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var oe=.95047,ae=1,se=1.08883,ue=4/29,le=6/29,ce=3*le*le,he=le*le*le,pe=Math.PI/180,fe=180/Math.PI;function de(t){return t>he?Math.pow(t,1/3):t/ce+ue}function me(t){return t>le?t*t*t:ce*(t-ue)}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),i=ge(t.g),n=ge(t.b),r=de((.4124564*e+.3575761*i+.1804375*n)/oe),o=de((.2126729*e+.7151522*i+.072175*n)/ae);return{l:116*o-16,a:500*(r-o),b:200*(o-de((.0193339*e+.119192*i+.9503041*n)/se)),alpha:t.a}}function _e(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=ae*me(e),i=oe*me(i),n=se*me(n),new at(ye(3.2404542*i-1.5371385*e-.4985314*n),ye(-.969266*i+1.8760108*e+.041556*n),ye(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}var xe={forward:ve,reverse:_e,interpolate:function(t,e,i){return{l:Mt(t.l,e.l,i),a:Mt(t.a,e.a,i),b:Mt(t.b,e.b,i),alpha:Mt(t.alpha,e.alpha,i)}}},be={forward:function(t){var e=ve(t),i=e.l,n=e.a,r=e.b,o=Math.atan2(r,n)*fe;return{h:o<0?o+360:o,c:Math.sqrt(n*n+r*r),l:i,alpha:t.a}},reverse:function(t){var e=t.h*pe,i=t.c;return _e({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:function(t,e,i){var n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,i),c:Mt(t.c,e.c,i),l:Mt(t.l,e.l,i),alpha:Mt(t.alpha,e.alpha,i)}}},we=Object.freeze({lab:xe,hcl:be});function Se(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Te(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ke(t){return t}function Ee(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Ae(t,e,i,n,r){return Ee(typeof i===r?n[i]:void 0,t.default,e.default)}function ze(t,e,i){if("number"!==Se(i))return Ee(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var r=Me(t.stops,i);return t.stops[r][1]}function Ie(t,e,i){var n=void 0!==t.base?t.base:1;if("number"!==Se(i))return Ee(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];var o=Me(t.stops,i),a=function(t,e,i,n){var r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Pt[e.type]||ke;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=we[t.colorSpace];l=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 i=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==n)return l(i,n,a)}}:l(s,u,a)}function Ce(t,e,i){return"color"===e.type?i=at.parse(i):Se(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Ee(i,t.default,e.default)}function Me(t,e){for(var i,n,r=0,o=t.length-1,a=0;r<=o;){if(i=t[a=Math.floor((r+o)/2)][0],n=t[a+1][0],e===i||e>i&&e<n)return a;i<e?r=a+1:i>e&&(o=a-1)}return Math.max(a-1,0)}var Pe=function(t,e){var i;this.expression=t,this._warningHistory={},this._defaultValue="color"===(i=e).type&&Te(i.default)?new at(0,0,0,0):"color"===i.type?at.parse(i.default)||null:void 0===i.default?null:i.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 i=new Et(Zt,[],function(t){var e={color:Y,string:X,number:H,enum:X,boolean:K};return"array"===t.type?et(e[t.value]||Q,t.length):e[t.type]||null}(e)),n=i.parse(t);return n?te(new Pe(n,e)):ee(i.errors)}Pe.prototype.evaluateWithoutErrorHandling=function(t,e,i){return this._evaluator||(this._evaluator=new xt),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this.expression.evaluate(this._evaluator)},Pe.prototype.evaluate=function(t,e,i){this._evaluator||(this._evaluator=new xt),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i;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&&!St(e.expression)};Re.prototype.evaluateWithoutErrorHandling=function(t,e,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i)},Re.prototype.evaluate=function(t,e,i){return this._styleExpression.evaluate(t,e,i)};var Be=function(t,e,i){this.kind=t,this.zoomStops=i.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!St(e.expression),i instanceof Lt&&(this._interpolationType=i.interpolation)};function Oe(t,e){if("error"===(t=De(t,e)).result)return t;var i=t.value.expression,n=wt(i);if(!n&&!ie(e))return ee([new Z("","data expressions not supported")]);var r=Tt(i,["zoom"]);if(!r&&!ne(e))return ee([new Z("","zoom expressions not supported")]);var o=function t(e){var i=null;if(e instanceof Bt)i=t(e.result);else if(e instanceof Rt)for(var n=0,r=e.args;n<r.length;n+=1){var o=r[n];if(i=t(o))break}else(e instanceof zt||e instanceof Lt)&&e.input instanceof bt&&"zoom"===e.input.name&&(i=e);return i instanceof Z?i:(e.eachChild(function(e){var n=t(e);n instanceof Z?i=n:!i&&n?i=new Z("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&n&&i!==n&&(i=new Z("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i)}(i);return o||r?o instanceof Z?ee([o]):o instanceof Lt&&!re(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,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i)},Be.prototype.evaluate=function(t,e,i){return this._styleExpression.evaluate(t,e,i)},Be.prototype.interpolationFactor=function(t,e,i){return this._interpolationType?Lt.interpolationFactor(this._interpolationType,t,e,i):0};var Fe=function(t,e){this._parameters=t,this._specification=e,$(this,function t(e,i){var n,r,o,a="color"===i.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,l=s||!u,c=e.type||(re(i)?"exponential":"interval");if(a&&((e=$({},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(i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!we[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=Ie;else if("interval"===c)n=ze;else if("categorical"===c){n=Ae,r=Object.create(null);for(var h=0,p=e.stops;h<p.length;h+=1){var f=p[h];r[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],i)])}return{kind:"composite",interpolationFactor:Lt.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:_.map(function(t){return t[0]}),evaluate:function(t,n){var r=t.zoom;return Ie({stops:_,base:e.base},i,r).evaluate(r,n)}}}return l?{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,i,a,r,o)}}:{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Ee(e.default,i.default):n(e,i,s,r,o)}}}(this._parameters,this._specification))};function Ve(t,e){if(Te(t))return new Fe(t,e);if(Le(t)){var i=Oe(t,e);if("error"===i.result)throw new Error(i.value.map(function(t){return t.key+": "+t.message}).join(", "));return i.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,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Se(i);if("object"!==u)return[new N(e,i,"object expected, "+u+" found")];for(var l in i){var c=l.split(".")[0],h=n[c]||n["*"],p=void 0;if(r[c])p=r[c];else if(n[c])p=ci;else if(r["*"])p=r["*"];else{if(!n["*"]){s.push(new N(e,i[l],'unknown property "'+l+'"'));continue}p=ci}s=s.concat(p({key:(e?e+".":e)+l,value:i[l],valueSpec:h,style:o,styleSpec:a,object:i,objectKey:l},i))}for(var f in n)r[f]||n[f].required&&void 0===n[f].default&&void 0===i[f]&&s.push(new N(e,i,'missing required property "'+f+'"'));return s}function je(t){var e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,o=t.key,a=t.arrayElementValidator||ci;if("array"!==Se(e))return[new N(o,e,"array expected, "+Se(e)+" found")];if(i.length&&e.length!==i.length)return[new N(o,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new N(o,e,"array length at least "+i["min-length"]+" expected, length "+e.length+" found")];var s={type:i.value};r.$version<7&&(s.function=i.function),"object"===Se(i.value)&&(s=i.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:n,styleSpec:r,key:o+"["+l+"]"}));return u}function $e(t){var e=t.key,i=t.value,n=t.valueSpec,r=Se(i);return"number"!==r?[new N(e,i,"number expected, "+r+" found")]:"minimum"in n&&i<n.minimum?[new N(e,i,i+" is less than the minimum value "+n.minimum)]:"maximum"in n&&i>n.maximum?[new N(e,i,i+" is greater than the maximum value "+n.maximum)]:[]}function Ue(t){var e,i,n,r=t.valueSpec,o=U(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Se(t.value.stops)&&"array"===Se(t.value.stops[0])&&"object"===Se(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=[],i=t.value;return e=e.concat(je({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Se(i)&&0===i.length&&e.push(new N(t.key,i,"array must have at least one stop")),e},default:function(t){return ci({key:t.key,value:t.value,valueSpec:r,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&&!re(t.valueSpec)&&c.push(new N(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!ie(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&&!l||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"!==Se(o))return[new N(s,o,"array expected, "+Se(o)+" found")];if(2!==o.length)return[new N(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Se(o[0]))return[new N(s,o,"object expected, "+Se(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>U(o[0].zoom))return[new N(s,o[0].zoom,"stop zoom values must appear in ascending order")];U(o[0].zoom)!==n&&(n=U(o[0].zoom),i=void 0,a={}),e=e.concat(Ne({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$e,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return e.concat(ci({key:s+"[1]",value:o[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Se(t.value),u=U(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new N(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new N(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return ie(r)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new N(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==i&&u<i?[new N(t.key,l,"stop domain values must appear in ascending order")]:(i=u,"categorical"===o&&u in a?[new N(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new N(t.key,l,"integer expected, found "+u)]}}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||St(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,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(U(i))&&r.push(new N(e,i,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(n.values).indexOf(U(i))&&r.push(new N(e,i,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(i)+" found")),r}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,i=t.slice(1);e<i.length;e+=1){var n=i[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 He(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,i){return e.value.evaluate(t,i)}}function Xe(t,e){return t<e?-1:t>e?1:0}function Ke(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?Ye(t[1],t[2],"=="):"!="===i?ti(Ye(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Ye(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(Ke))):"all"===i?["all"].concat(t.slice(1).map(Ke)):"none"===i?["all"].concat(t.slice(1).map(Ke).map(ti)):"in"===i?Je(t[1],t.slice(2)):"!in"===i?ti(Je(t[1],t.slice(2))):"has"===i?Qe(t[1]):"!has"!==i||ti(Qe(t[1]))}function Ye(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Je(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(Xe)]]:["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 ti(t){return["!",t]}function ei(t){return Ge(q(t.value))?qe($({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,n=e.key;if("array"!==Se(i))return[new N(n,i,"array expected, "+Se(i)+" found")];var r,o=e.styleSpec,a=[];if(i.length<1)return[new N(n,i,"filter array must have at least 1 element")];switch(a=a.concat(Ze({key:n+"[0]",value:i[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),U(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===U(i[1])&&a.push(new N(n,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&a.push(new N(n,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(r=Se(i[1]))&&a.push(new N(n+"[1]",i[1],"string expected, "+r+" found"));for(var s=2;s<i.length;s++)r=Se(i[s]),"$type"===U(i[1])?a=a.concat(Ze({key:n+"["+s+"]",value:i[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&a.push(new N(n+"["+s+"]",i[s],"string, number, or boolean expected, "+r+" found"));break;case"any":case"all":case"none":for(var u=1;u<i.length;u++)a=a.concat(t({key:n+"["+u+"]",value:i[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=Se(i[1]),2!==i.length?a.push(new N(n,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==r&&a.push(new N(n+"[1]",i[1],"string expected, "+r+" found"))}return a}(t)}function ii(t,e){var i=t.key,n=t.style,r=t.styleSpec,o=t.value,a=t.objectKey,s=r[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return ci({key:i,value:o,valueSpec:r.transition,style:n,styleSpec:r});var l,c=t.valueSpec||s[a];if(!c)return[new N(i,o,'unknown property "'+a+'"')];if("string"===Se(o)&&ie(c)&&!c.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new N(i,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new N(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Te(q(o))&&"identity"===U(o.type)&&h.push(new N(i,o,'"text-font" does not support identity functions'))),h.concat(ci({key:t.key,value:o,valueSpec:c,style:n,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:a}))}function ni(t){return ii(t,"paint")}function ri(t){return ii(t,"layout")}function oi(t){var e=[],i=t.value,n=t.key,r=t.style,o=t.styleSpec;i.type||i.ref||e.push(new N(n,i,'either "type" or "ref" is required'));var a,s=U(i.type),u=U(i.ref);if(i.id)for(var l=U(i.id),c=0;c<t.arrayIndex;c++){var h=r.layers[c];U(h.id)===l&&e.push(new N(n,i.id,'duplicate layer id "'+i.id+'", previously used at line '+h.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(t){t in i&&e.push(new N(n,i[t],'"'+t+'" is prohibited for ref layers'))}),r.layers.forEach(function(t){U(t.id)===u&&(a=t)}),a?a.ref?e.push(new N(n,i.ref,"ref cannot reference another ref layer")):s=U(a.type):e.push(new N(n,i.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(i.source){var p=r.sources&&r.sources[i.source],f=p&&U(p.type);p?"vector"===f&&"raster"===s?e.push(new N(n,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new N(n,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==f||i["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new N(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new N(n,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new N(n,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new N(n,i.source,'source "'+i.source+'" not found'))}else e.push(new N(n,i,'missing required property "source"'));return e=e.concat(Ne({key:n,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return ci({key:n+".type",value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:ei,layout:function(t){return Ne({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ri($({layerType:s},t))}}})},paint:function(t){return Ne({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ni($({layerType:s},t))}}})}}}))}function ai(t){var e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new N(i,e,'"type" is required')];var o=U(e.type),a=[];switch(o){case"vector":case"raster":case"raster-dem":if(a=a.concat(Ne({key:i,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(i+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return a;case"geojson":return Ne({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n});case"video":return Ne({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return Ne({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return a.push(new N(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")),a;default:return Ze({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:n})}}function si(t){var e=t.value,i=t.styleSpec,n=i.light,r=t.style,o=[],a=Se(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 u=s.match(/^(.*)-transition$/);o=u&&n[u[1]]&&n[u[1]].transition?o.concat(ci({key:s,value:e[s],valueSpec:i.transition,style:r,styleSpec:i})):n[s]?o.concat(ci({key:s,value:e[s],valueSpec:n[s],style:r,styleSpec:i})):o.concat([new N(s,e[s],'unknown property "'+s+'"')])}return o}function ui(t){var e=t.value,i=t.key,n=Se(e);return"string"!==n?[new N(i,e,"string expected, "+n+" found")]:[]}var li={"*":function(){return[]},array:je,boolean:function(t){var e=t.value,i=t.key,n=Se(e);return"boolean"!==n?[new N(i,e,"boolean expected, "+n+" found")]:[]},number:$e,color:function(t){var e=t.key,i=t.value,n=Se(i);return"string"!==n?[new N(e,i,"color expected, "+n+" found")]:null===ot(i)?[new N(e,i,'color expected, "'+i+'" found')]:[]},constants:j,enum:Ze,filter:ei,function:Ue,layer:oi,object:Ne,source:ai,light:si,string:ui};function ci(t){var e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Te(U(e))?Ue(t):i.expression&&Le(q(e))?qe(t):i.type&&li[i.type]?li[i.type](t):Ne($({},t,{valueSpec:i.type?n[i.type]:i}))}function hi(t){var e=t.value,i=t.key,n=ui(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new N(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new N(i,e,'"glyphs" url must include a "{range}" token')),n)}function pi(t,e){e=e||V;var i=[];return i=i.concat(ci({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:hi,"*":function(){return[]}}})),t.constants&&(i=i.concat(j({key:"constants",value:t.constants,style:t,styleSpec:e}))),fi(i)}function fi(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function di(t){return function(){return fi(t.apply(this,arguments))}}pi.source=di(ai),pi.light=di(si),pi.layer=di(oi),pi.filter=di(ei),pi.paintProperty=di(ni),pi.layoutProperty=di(ri);var mi=pi,yi=pi.light,gi=pi.paintProperty,vi=pi.layoutProperty;function _i(t,e){var i=!1;if(e&&e.length)for(var n=0,r=e;n<r.length;n+=1){var o=r[n];t.fire(new O(new Error(o.message))),i=!0}return i}var xi=wi,bi=3;function wi(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],e=r[1],i=r[2],this.d=e+2*i;for(var o=0;o<this.d*this.d;o++){var a=r[bi+o],s=r[bi+o+1];n.push(a===s?null:r.subarray(a,s))}var u=r[bi+n.length],l=r[bi+n.length+1];this.keys=r.subarray(u,l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var h=i/e*t;this.min=-h,this.max=t+h}wi.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},wi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},wi.prototype._insertCell=function(t,e,i,n,r,o){this.cells[r].push(o)},wi.prototype.query=function(t,e,i,n){var r=this.min,o=this.max;if(t<=r&&e<=r&&o<=i&&o<=n)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,i,n,this._queryCell,a,{}),a},wi.prototype._queryCell=function(t,e,i,n,r,o,a){var s=this.cells[r];if(null!==s)for(var u=this.keys,l=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===a[h]){var p=4*h;t<=l[p+2]&&e<=l[p+3]&&i>=l[p+0]&&n>=l[p+1]?(a[h]=!0,o.push(u[h])):a[h]=!1}}},wi.prototype._forEachCell=function(t,e,i,n,r,o,a){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),l=this._convertToCellCoord(i),c=this._convertToCellCoord(n),h=s;h<=l;h++)for(var p=u;p<=c;p++){var f=this.d*p+h;if(r.call(this,t,e,i,n,f,o,a))return}},wi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},wi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=bi+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];r[bi+a]=o,r.set(s,o),o+=s.length}return r[bi+t.length]=o,r.set(this.keys,o),o+=this.keys.length,r[bi+t.length+1]=o,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};var Si=self.ImageData,Ti={};function ki(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ti[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var Ei in ki("Object",Object),xi.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),i},xi.deserialize=function(t){return new xi(t)},ki("Grid",xi),ki("Color",at),ki("Error",Error),ki("StylePropertyFunction",Fe),ki("StyleExpression",Pe,{omit:["_evaluator"]}),ki("ZoomDependentExpression",Be),ki("ZoomConstantExpression",Re),ki("CompoundExpression",bt,{omit:["_evaluate"]}),Zt)Zt[Ei]._classRegistryKey||ki("Expression_"+Ei,Zt[Ei]);function Ai(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 i=t;return e&&e.push(i.buffer),i}if(t instanceof Si)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],r=0,o=t;r<o.length;r+=1){var a=o[r];n.push(Ai(a,e))}return n}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var l={};if(s.serialize)l._serialized=s.serialize(t,e);else{for(var c in t)if(t.hasOwnProperty(c)&&!(Ti[u].omit.indexOf(c)>=0)){var h=t[c];l[c]=Ti[u].shallow.indexOf(c)>=0?h:Ai(h,e)}t instanceof Error&&(l.message=t.message)}return{name:u,properties:l}}throw new Error("can't serialize object of type "+typeof t)}function zi(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 Si)return t;if(Array.isArray(t))return t.map(function(t){return zi(t)});if("object"==typeof t){var e=t,i=e.name,n=e.properties;if(!i)throw new Error("can't deserialize object of anonymous class");var r=Ti[i].klass;if(!r)throw new Error("can't deserialize unregistered class "+i);if(r.deserialize)return r.deserialize(n._serialized);for(var o=Object.create(r.prototype),a=0,s=Object.keys(n);a<s.length;a+=1){var u=s[a];o[u]=Ti[i].shallow.indexOf(u)>=0?n[u]:zi(n[u])}return o}throw new Error("can't deserialize object of type "+typeof t)}var Ii=function(){this.first=!0};Ii.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))};var Ci={"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 Mi(t){for(var e=0,i=t;e<i.length;e+=1)if(Li(i[e].charCodeAt(0)))return!0;return!1}function Pi(t){return!(Ci.Arabic(t)||Ci["Arabic Supplement"](t)||Ci["Arabic Extended-A"](t)||Ci["Arabic Presentation Forms-A"](t)||Ci["Arabic Presentation Forms-B"](t))}function Li(t){return!!(746===t||747===t||!(t<4352)&&(Ci["Bopomofo Extended"](t)||Ci.Bopomofo(t)||Ci["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Ci["CJK Compatibility Ideographs"](t)||Ci["CJK Compatibility"](t)||Ci["CJK Radicals Supplement"](t)||Ci["CJK Strokes"](t)||!(!Ci["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ci["CJK Unified Ideographs Extension A"](t)||Ci["CJK Unified Ideographs"](t)||Ci["Enclosed CJK Letters and Months"](t)||Ci["Hangul Compatibility Jamo"](t)||Ci["Hangul Jamo Extended-A"](t)||Ci["Hangul Jamo Extended-B"](t)||Ci["Hangul Jamo"](t)||Ci["Hangul Syllables"](t)||Ci.Hiragana(t)||Ci["Ideographic Description Characters"](t)||Ci.Kanbun(t)||Ci["Kangxi Radicals"](t)||Ci["Katakana Phonetic Extensions"](t)||Ci.Katakana(t)&&12540!==t||!(!Ci["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)||!(!Ci["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ci["Unified Canadian Aboriginal Syllabics"](t)||Ci["Unified Canadian Aboriginal Syllabics Extended"](t)||Ci["Vertical Forms"](t)||Ci["Yijing Hexagram Symbols"](t)||Ci["Yi Syllables"](t)||Ci["Yi Radicals"](t)))}function Di(t){return!(Li(t)||function(t){return!!(Ci["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Ci["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)||Ci["Letterlike Symbols"](t)||Ci["Number Forms"](t)||Ci["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)||Ci["Control Pictures"](t)&&9251!==t||Ci["Optical Character Recognition"](t)||Ci["Enclosed Alphanumerics"](t)||Ci["Geometric Shapes"](t)||Ci["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ci["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ci["CJK Symbols and Punctuation"](t)||Ci.Katakana(t)||Ci["Private Use Area"](t)||Ci["CJK Compatibility Forms"](t)||Ci["Small Form Variants"](t)||Ci["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 Ri(t,e){return!(!e&&(t>=1424&&t<=2303||Ci["Arabic Presentation Forms-A"](t)||Ci["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||Ci.Khmer(t))}var Bi,Oi=!1,Fi=null,Vi=!1,Ni=new F,ji={applyArabicShaping:null,processBidirectionalText:null,isLoaded:function(){return Vi||null!=ji.applyArabicShaping}},$i=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 Ii,this.transition={})};$i.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,n=t;i<n.length;i+=1)if(!Ri(n[i].charCodeAt(0),e))return!1;return!0}(t,ji.isLoaded())},$i.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)};var Ui=function(t,e){this.property=t,this.value=e,this.expression=Ve(void 0===e?t.specification.default:e,t.specification)};Ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Ui.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var qi=function(t){this.property=t,this.value=new Ui(t,void 0)};qi.prototype.transitioned=function(t,e){return new Gi(this.property,this.value,e,v({},t.transition,this.transition),t.now)},qi.prototype.untransitioned=function(){return new Gi(this.property,this.value,null,{},0)};var Zi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Zi.prototype.getValue=function(t){return k(this._values[t].value.value)},Zi.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new qi(this._values[t].property)),this._values[t].value=new Ui(this._values[t].property,null===e?void 0:k(e))},Zi.prototype.getTransition=function(t){return k(this._values[t].transition)},Zi.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new qi(this._values[t].property)),this._values[t].transition=k(e)||void 0},Zi.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],r=this.getValue(n);void 0!==r&&(t[n]=r);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},Zi.prototype.transitioned=function(t,e){for(var i=new Wi(this._properties),n=0,r=Object.keys(this._values);n<r.length;n+=1){var o=r[n];i._values[o]=this._values[o].transitioned(t,e._values[o])}return i},Zi.prototype.untransitioned=function(){for(var t=new Wi(this._properties),e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e];t._values[n]=this._values[n].untransitioned()}return t};var Gi=function(t,e,i,n,r){this.property=t,this.value=e,this.begin=r+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)};Gi.prototype.possiblyEvaluate=function(t){var e=t.now||0,i=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(e<this.begin)return n.possiblyEvaluate(t);var r=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),i,function(t){if(r<=0)return 0;if(r>=1)return 1;var e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}())}return i};var Wi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Wi.prototype.possiblyEvaluate=function(t){for(var e=new Ki(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var r=n[i];e._values[r]=this._values[r].possiblyEvaluate(t)}return e},Wi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var i=e[t];if(this._values[i].prior)return!0}return!1};var Hi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Hi.prototype.getValue=function(t){return k(this._values[t].value)},Hi.prototype.setValue=function(t,e){this._values[t]=new Ui(this._values[t].property,null===e?void 0:k(e))},Hi.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],r=this.getValue(n);void 0!==r&&(t[n]=r)}return t},Hi.prototype.possiblyEvaluate=function(t){for(var e=new Ki(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var r=n[i];e._values[r]=this._values[r].possiblyEvaluate(t)}return e};var Xi=function(t,e,i){this.property=t,this.value=e,this.globals=i};Xi.prototype.isConstant=function(){return"constant"===this.value.kind},Xi.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Xi.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.globals,t,e)};var Ki=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ki.prototype.get=function(t){return this._values[t]};var Yi=function(t){this.specification=t};Yi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Yi.prototype.interpolate=function(t,e,i){var n=Pt[this.specification.type];return n?n(t,e,i):t};var Ji=function(t){this.specification=t};Ji.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Xi(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Xi(this,t.expression,e)},Ji.prototype.interpolate=function(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Xi(this,{kind:"constant",value:void 0},t.globals);var n=Pt[this.specification.type];return n?new Xi(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.globals):t},Ji.prototype.evaluate=function(t,e,i,n){return"constant"===t.kind?t.value:t.evaluate(e,i,n)};var Qi=function(t){this.specification=t};Qi.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new $i(Math.floor(e.zoom-1),e)),t.expression.evaluate(new $i(Math.floor(e.zoom),e)),t.expression.evaluate(new $i(Math.floor(e.zoom+1),e)),e)}},Qi.prototype._calculate=function(t,e,i,n){var r=n.zoom,o=r-Math.floor(r),a=n.crossFadingFactor();return r>n.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:o+(1-o)*a}:{from:i,to:e,fromScale:.5,toScale:1,t:1-(1-a)*o}},Qi.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 i=t[e],n=this.defaultPropertyValues[e]=new Ui(i,void 0),r=this.defaultTransitionablePropertyValues[e]=new qi(i);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};ki("DataDrivenProperty",Ji),ki("DataConstantProperty",Yi),ki("CrossFadedProperty",Qi),ki("ColorRampProperty",tn);var nn=function(t){function e(e,i){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},i.layout&&(this._unevaluatedLayout=new Hi(i.layout)),this._transitionablePaint=new Zi(i.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{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,i){if(null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(vi,n,t,e,i))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,i){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(gi,n,t,e,i))return!1}if(w(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var r=this._transitionablePaint._values[t].value.isDataDriven();this._transitionablePaint.setValue(t,e);var o=this._transitionablePaint._values[t].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(t),o||r},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"),T(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,i,n,r){return(!r||!1!==r.validate)&&_i(this,t.call(mi,{key:e,layerType:this.type,objectKey:i,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 Xi&&ie(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(F),rn={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 i=0,n=0;return{members:t.map(function(t){var r,o=(r=t.type,rn[r].BYTES_PER_ELEMENT),a=i=un(i,Math.max(e,o)),s=t.components||1;return n=Math.max(n,o),i+=o*s,{name:t.name,type:t.type,components:s,offset:a}}),size:un(i,Math.max(n,e)),alignment:e}}function un(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 ln=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;this.resize(i+1);var n=2*i;return this.int16[n+0]=t,this.int16[n+1]=e,i},e.prototype.emplace=function(t,e,i){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t},e}(an);ln.prototype.bytesPerElement=4,ki("StructArrayLayout2i4",ln);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,i,n){var r=this.length;this.resize(r+1);var o=4*r;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=i,this.int16[o+3]=n,r},e.prototype.emplace=function(t,e,i,n,r){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,t},e}(an);cn.prototype.bytesPerElement=8,ki("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,i,n,r,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]=i,this.int16[s+3]=n,this.int16[s+4]=r,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,i,n,r,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(an);hn.prototype.bytesPerElement=12,ki("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,i,n,r,o,a,s){var u=this.length;this.resize(u+1);var l=6*u,c=12*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=i,this.int16[l+3]=n,this.uint8[c+8]=r,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,u},e.prototype.emplace=function(t,e,i,n,r,o,a,s,u){var l=6*t,c=12*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+3]=r,this.uint8[c+8]=o,this.uint8[c+9]=a,this.uint8[c+10]=s,this.uint8[c+11]=u,t},e}(an);pn.prototype.bytesPerElement=12,ki("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,i,n,r,o,a,s){var u=this.length;this.resize(u+1);var l=8*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=i,this.int16[l+3]=n,this.uint16[l+4]=r,this.uint16[l+5]=o,this.uint16[l+6]=a,this.uint16[l+7]=s,u},e.prototype.emplace=function(t,e,i,n,r,o,a,s,u){var l=8*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+3]=r,this.uint16[l+4]=o,this.uint16[l+5]=a,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(an);fn.prototype.bytesPerElement=16,ki("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,i){var n=this.length;this.resize(n+1);var r=3*n;return this.float32[r+0]=t,this.float32[r+1]=e,this.float32[r+2]=i,n},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t},e}(an);dn.prototype.bytesPerElement=12,ki("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 i=1*e;return this.uint32[i+0]=t,e},e.prototype.emplace=function(t,e){var i=1*t;return this.uint32[i+0]=e,t},e}(an);mn.prototype.bytesPerElement=4,ki("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,i,n,r,o,a,s,u,l,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]=i,this.int16[p+3]=n,this.int16[p+4]=r,this.int16[p+5]=o,this.uint32[f+3]=a,this.uint16[p+8]=s,this.uint16[p+9]=u,this.int16[p+10]=l,this.int16[p+11]=c,h},e.prototype.emplace=function(t,e,i,n,r,o,a,s,u,l,c,h){var p=12*t,f=6*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[f+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,this.int16[p+10]=c,this.int16[p+11]=h,t},e}(an);yn.prototype.bytesPerElement=24,ki("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,i,n,r,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]=i,this.int16[s+3]=n,this.int16[s+4]=r,this.int16[s+5]=o,a},e.prototype.emplace=function(t,e,i,n,r,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(an);gn.prototype.bytesPerElement=12,ki("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 i=this.length;this.resize(i+1);var n=4*i;return this.uint8[n+0]=t,this.uint8[n+1]=e,i},e.prototype.emplace=function(t,e,i){var n=4*t;return this.uint8[n+0]=e,this.uint8[n+1]=i,t},e}(an);vn.prototype.bytesPerElement=4,ki("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,i,n,r,o,a,s,u,l,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]=i,this.uint16[m+3]=n,this.uint32[y+2]=r,this.uint32[y+3]=o,this.uint32[y+4]=a,this.uint16[m+10]=s,this.uint16[m+11]=u,this.uint16[m+12]=l,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,i,n,r,o,a,s,u,l,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]=i,this.uint16[m+2]=n,this.uint16[m+3]=r,this.uint32[y+2]=o,this.uint32[y+3]=a,this.uint32[y+4]=s,this.uint16[m+10]=u,this.uint16[m+11]=l,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,ki("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 i=1*e;return this.float32[i+0]=t,e},e.prototype.emplace=function(t,e){var i=1*t;return this.float32[i+0]=e,t},e}(an);xn.prototype.bytesPerElement=4,ki("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,i){var n=this.length;this.resize(n+1);var r=3*n;return this.int16[r+0]=t,this.int16[r+1]=e,this.int16[r+2]=i,n},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t},e}(an);bn.prototype.bytesPerElement=6,ki("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,i){var n=this.length;this.resize(n+1);var r=2*n,o=4*n;return this.uint32[r+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=i,n},e.prototype.emplace=function(t,e,i,n){var r=2*t,o=4*t;return this.uint32[r+0]=e,this.uint16[o+2]=i,this.uint16[o+3]=n,t},e}(an);wn.prototype.bytesPerElement=8,ki("StructArrayLayout1ul2ui8",wn);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,i){var n=this.length;this.resize(n+1);var r=3*n;return this.uint16[r+0]=t,this.uint16[r+1]=e,this.uint16[r+2]=i,n},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t},e}(an);Sn.prototype.bytesPerElement=6,ki("StructArrayLayout3ui6",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.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;this.resize(i+1);var n=2*i;return this.uint16[n+0]=t,this.uint16[n+1]=e,i},e.prototype.emplace=function(t,e,i){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t},e}(an);Tn.prototype.bytesPerElement=4,ki("StructArrayLayout2ui4",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){var i=this.length;this.resize(i+1);var n=2*i;return this.float32[n+0]=t,this.float32[n+1]=e,i},e.prototype.emplace=function(t,e,i){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t},e}(an);kn.prototype.bytesPerElement=8,ki("StructArrayLayout2f8",kn);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.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n){var r=this.length;this.resize(r+1);var o=4*r;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=i,this.float32[o+3]=n,r},e.prototype.emplace=function(t,e,i,n,r){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,t},e}(an);En.prototype.bytesPerElement=16,ki("StructArrayLayout4f16",En);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 i={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 i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},i.radius.get=function(){return this._structArray.int16[this._pos2+10]},i.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},i.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},i.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},i.anchorPoint.get=function(){return new p(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(on);An.prototype.size=24;var zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new An(this,t)},e}(yn);ki("CollisionBoxArray",zn);var In=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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 i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t},Object.defineProperties(e.prototype,i),e}(on);In.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 In(this,t)},e}(_n);ki("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 i={offsetX:{configurable:!0}};return i.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},i.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,i),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);ki("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 i={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return i.x.get=function(){return this._structArray.int16[this._pos2+0]},i.x.set=function(t){this._structArray.int16[this._pos2+0]=t},i.y.get=function(){return this._structArray.int16[this._pos2+1]},i.y.set=function(t){this._structArray.int16[this._pos2+1]=t},i.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},i.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,i),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);ki("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 i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},i.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,i),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);ki("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,i){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:i.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 i=e[t];for(var n in i.vaos)i.vaos[n].destroy()}},Fn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ki("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,i){this.value=t,this.name=e,this.type=i,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,i,n){var r=n.constantOr(this.value),o=t.gl;"color"===this.type?o.uniform4f(e.uniforms["u_"+this.name],r.r,r.g,r.b,r.a):o.uniform1f(e.uniforms["u_"+this.name],r)};var $n=function(t,e,i){this.expression=t,this.name=e,this.type=i,this.statistics={max:-1/0};var n="color"===i?kn:xn;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===i?2:1,offset:0}],this.paintVertexArray=new n};$n.prototype.defines=function(){return[]},$n.prototype.populatePaintArray=function(t,e){var i=this.paintVertexArray,n=i.length;i.reserve(t);var r=this.expression.evaluate(new $i(0),e,{});if("color"===this.type)for(var o=Nn(r),a=n;a<t;a++)i.emplaceBack(o[0],o[1]);else{for(var s=n;s<t;s++)i.emplaceBack(r);this.statistics.max=Math.max(this.statistics.max,r)}},$n.prototype.updatePaintArray=function(t,e,i,n){var r=this.paintVertexArray,o=this.expression.evaluate({zoom:0},i,n);if("color"===this.type)for(var a=Nn(o),s=t;s<e;s++)r.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)r.emplace(u,o);this.statistics.max=Math.max(this.statistics.max,o)}},$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.setUniforms=function(t,e){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],0)};var Un=function(t,e,i,n,r){this.expression=t,this.name=e,this.type=i,this.useIntegerZoom=n,this.zoom=r,this.statistics={max:-1/0};var o="color"===i?En:kn;this.paintVertexAttributes=[{name:"a_"+e,type:"Float32",components:"color"===i?4:2,offset:0}],this.paintVertexArray=new o};Un.prototype.defines=function(){return[]},Un.prototype.populatePaintArray=function(t,e){var i=this.paintVertexArray,n=i.length;i.reserve(t);var r=this.expression.evaluate(new $i(this.zoom),e,{}),o=this.expression.evaluate(new $i(this.zoom+1),e,{});if("color"===this.type)for(var a=Nn(r),s=Nn(o),u=n;u<t;u++)i.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var l=n;l<t;l++)i.emplaceBack(r,o);this.statistics.max=Math.max(this.statistics.max,r,o)}},Un.prototype.updatePaintArray=function(t,e,i,n){var r=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},i,n),a=this.expression.evaluate({zoom:this.zoom+1},i,n);if("color"===this.type)for(var s=Nn(o),u=Nn(a),l=t;l<e;l++)r.emplace(l,s[0],s[1],u[0],u[1]);else{for(var c=t;c<e;c++)r.emplace(c,o,a);this.statistics.max=Math.max(this.statistics.max,o,a)}},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.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)},Un.prototype.setUniforms=function(t,e,i){t.gl.uniform1f(e.uniforms["a_"+this.name+"_t"],this.interpolationFactor(i.zoom))};var qn=function(){this.binders={},this.cacheKey="",this._buffers=[],this._idMap={},this._bufferOffset=0};qn.createDynamic=function(t,e,i){var n=new qn,r=[];for(var o in t.paint._values)if(i(o)){var a=t.paint.get(o);if(a instanceof Xi&&ie(a.property.specification)){var s=Gn(o,t.type),u=a.property.specification.type,l=a.property.useIntegerZoom;"constant"===a.value.kind?(n.binders[o]=new jn(a.value,s,u),r.push("/u_"+s)):"source"===a.value.kind?(n.binders[o]=new $n(a.value,s,u),r.push("/a_"+s)):(n.binders[o]=new Un(a.value,s,u,l,e),r.push("/z_"+s))}}return n.cacheKey=r.sort().join(""),n},qn.prototype.populatePaintArrays=function(t,e,i){for(var n in this.binders)this.binders[n].populatePaintArray(t,e);if(e.id){var r=String(e.id);this._idMap[r]=this._idMap[r]||[],this._idMap[r].push({index:i,start:this._bufferOffset,end:t})}this._bufferOffset=t},qn.prototype.updatePaintArrays=function(t,e,i){var n=!1;for(var r in t){var o=this._idMap[r];if(o)for(var a=t[r],s=0,u=o;s<u.length;s+=1){var l=u[s],c=e.feature(l.index);for(var h in this.binders){var p=this.binders[h];if(!(p instanceof jn)&&!0===p.expression.isStateDependent){var f=i.paint.get(h);p.expression=f.value,p.updatePaintArray(l.start,l.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,i,n){for(var r in this.binders)this.binders[r].setUniforms(t,e,n,i.get(r))},qn.prototype.getPaintVertexBuffers=function(){return this._buffers},qn.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var i=[];for(var n in this.binders){var r=this.binders[n];(r instanceof $n||r instanceof Un)&&r.paintVertexBuffer&&i.push(r.paintVertexBuffer)}this._buffers=i},qn.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var Zn=function(t,e,i,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var r=0,o=e;r<o.length;r+=1){var a=o[r];this.programConfigurations[a.id]=qn.createDynamic(a,i,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,i){for(var n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);this.needsUpload=!0},Zn.prototype.updatePaintArrays=function(t,e,i){for(var n=0,r=i;n<r.length;n+=1){var o=r[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()},ki("ConstantBinder",jn),ki("SourceExpressionBinder",$n),ki("CompositeExpressionBinder",Un),ki("ProgramConfiguration",qn,{omit:["_buffers"]}),ki("ProgramConfigurationSet",Zn);var Wn=8192,Hn=(16,{min:-1*Math.pow(2,15),max:Math.pow(2,15)-1});function Xn(t){for(var e=Wn/t.extent,i=t.loadGeometry(),n=0;n<i.length;n++)for(var r=i[n],o=0;o<r.length;o++){var a=r[o];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<Hn.min||a.x>Hn.max||a.y<Hn.min||a.y>Hn.max)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Kn(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}var Yn=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 ln,this.indexArray=new Sn,this.segments=new Fn,this.programConfigurations=new Zn(On,t.layers,t.zoom)};function Jn(t,e,i){for(var n=0;n<t.length;n++){var r=t[n];if(sr(r,e))return!0;if(rr(e,r,i))return!0}return!1}function Qn(t,e){if(1===t.length&&1===t[0].length)return ar(e,t[0][0]);for(var i=0;i<e.length;i++)for(var n=e[i],r=0;r<n.length;r++)if(ar(t,n[r]))return!0;for(var o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++)if(ar(e,a[s]))return!0;for(var u=0;u<e.length;u++)if(ir(a,e[u]))return!0}return!1}function tr(t,e,i){for(var n=0;n<e.length;n++)for(var r=e[n],o=0;o<t.length;o++){var a=t[o];if(a.length>=3)for(var s=0;s<r.length;s++)if(sr(a,r[s]))return!0;if(er(a,r,i))return!0}return!1}function er(t,e,i){if(t.length>1){if(ir(t,e))return!0;for(var n=0;n<e.length;n++)if(rr(e[n],t,i))return!0}for(var r=0;r<t.length;r++)if(rr(t[r],e,i))return!0;return!1}function ir(t,e){if(0===t.length||0===e.length)return!1;for(var i=0;i<t.length-1;i++)for(var n=t[i],r=t[i+1],o=0;o<e.length-1;o++)if(nr(n,r,e[o],e[o+1]))return!0;return!1}function nr(t,e,i,n){return z(t,i,n)!==z(e,i,n)&&z(t,e,i)!==z(t,e,n)}function rr(t,e,i){var n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(var r=1;r<e.length;r++)if(or(t,e[r-1],e[r])<n)return!0;return!1}function or(t,e,i){var n=e.distSqr(i);if(0===n)return t.distSqr(e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return r<0?t.distSqr(e):r>1?t.distSqr(i):t.distSqr(i.sub(e)._mult(r)._add(e))}function ar(t,e){for(var i,n,r,o=!1,a=0;a<t.length;a++)for(var s=0,u=(i=t[a]).length-1;s<i.length;u=s++)n=i[s],r=i[u],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(o=!o);return o}function sr(t,e){for(var i=!1,n=0,r=t.length-1;n<t.length;r=n++){var o=t[n],a=t[r];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function ur(t,e,i){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).binders[t].statistics.max}function lr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function cr(t,e,i,n,r){if(!e[0]&&!e[1])return t;var o=p.convert(e);"viewport"===i&&o._rotate(-n);for(var a=[],s=0;s<t.length;s++){for(var u=t[s],l=[],c=0;c<u.length;c++)l.push(u[c].sub(o._mult(r)));a.push(l)}return a}Yn.prototype.populate=function(t,e){for(var i=0,n=t;i<n.length;i+=1){var r=n[i],o=r.feature,a=r.index,s=r.sourceLayerIndex;if(this.layers[0]._featureFilter(new $i(this.zoom),o)){var u=Xn(o);this.addFeature(o,u,a),e.featureIndex.insert(o,u,a,s,this.index)}}},Yn.prototype.update=function(t,e){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers)},Yn.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Yn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Yn.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},Yn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Yn.prototype.addFeature=function(t,e,i){for(var n=0,r=e;n<r.length;n+=1)for(var o=0,a=r[n];o<a.length;o+=1){var s=a[o],u=s.x,l=s.y;if(!(u<0||u>=Wn||l<0||l>=Wn)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=c.vertexLength;Kn(this.layoutVertexArray,u,l,-1,-1),Kn(this.layoutVertexArray,u,l,1,-1),Kn(this.layoutVertexArray,u,l,1,1),Kn(this.layoutVertexArray,u,l,-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,i)},ki("CircleBucket",Yn,{omit:["layers"]});var hr={paint:new en({"circle-radius":new Ji(V.paint_circle["circle-radius"]),"circle-color":new Ji(V.paint_circle["circle-color"]),"circle-blur":new Ji(V.paint_circle["circle-blur"]),"circle-opacity":new Ji(V.paint_circle["circle-opacity"]),"circle-translate":new Yi(V.paint_circle["circle-translate"]),"circle-translate-anchor":new Yi(V.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Yi(V.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Yi(V.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ji(V.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ji(V.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ji(V.paint_circle["circle-stroke-opacity"])})},pr="undefined"!=typeof Float32Array?Float32Array:Array;function fr(){var t=new pr(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 dr(){var t=new pr(3);return t[0]=0,t[1]=0,t[2]=0,t}function mr(t){var e=t[0],i=t[1],n=t[2];return Math.sqrt(e*e+i*i+n*n)}function yr(t,e,i){var n=new pr(3);return n[0]=t,n[1]=e,n[2]=i,n}Math.PI;var gr,vr=mr,_r=(gr=dr(),function(t,e,i,n,r,o){var a,s;for(e||(e=3),i||(i=0),s=n?Math.min(n*e+i,t.length):t.length,a=i;a<s;a+=e)gr[0]=t[a],gr[1]=t[a+1],gr[2]=t[a+2],r(gr,gr,o),t[a]=gr[0],t[a+1]=gr[1],t[a+2]=gr[2];return t});function xr(){var t=new pr(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function br(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],a=i*i+n*n+r*r+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=i*a,t[1]=n*a,t[2]=r*a,t[3]=o*a),t}function wr(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*a,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*a,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*a,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*a,t}var Sr=function(){var t=xr();return function(e,i,n,r,o,a){var s,u;for(i||(i=4),n||(n=0),u=r?Math.min(r*i+n,e.length):e.length,s=n;s<u;s+=i)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 Tr(){var t=new pr(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}dr(),yr(1,0,0),yr(0,1,0),Tr(),Tr(),fr(),function(){var t;(t=new pr(2))[0]=0,t[1]=0}();var kr=function(t){function e(e){t.call(this,e,hr)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Yn(t)},e.prototype.queryRadius=function(t){var e=t;return ur("circle-radius",this,e)+ur("circle-stroke-width",this,e)+lr(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,n,r,o,a,s){for(var u=cr(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e,i){return u.map(function(t){return t.map(function(t){return Er(t,e,i)})})}(0,s,o),p=c?l*a:l,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:Er(g,s,o),_=p,x=wr([],[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]),Jn(h,v,_))return!0}return!1},e}(nn);function Er(t,e,i){var n=wr([],[t.x,t.y,0,1],e);return new p((n[0]/n[3]+1)*i.width*.5,(n[1]/n[3]+1)*i.height*.5)}var Ar=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}(Yn);function zr(t,e,i,n){var r=e.width,o=e.height;if(n){if(n.length!==r*o*i)throw new RangeError("mismatched image size")}else n=new Uint8Array(r*o*i);return t.width=r,t.height=o,t.data=n,t}function Ir(t,e,i){var n=e.width,r=e.height;if(n!==t.width||r!==t.height){var o=zr({},{width:n,height:r},i);Cr(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,r)},i),t.width=n,t.height=r,t.data=o.data}}function Cr(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<r.height;u++)for(var l=((i.y+u)*t.width+i.x)*o,c=((n.y+u)*e.width+n.x)*o,h=0;h<r.width*o;h++)s[c+h]=a[l+h];return e}ki("HeatmapBucket",Ar,{omit:["layers"]});var Mr=function(t,e){zr(this,t,1,e)};Mr.prototype.resize=function(t){Ir(this,t,1)},Mr.prototype.clone=function(){return new Mr({width:this.width,height:this.height},new Uint8Array(this.data))},Mr.copy=function(t,e,i,n,r){Cr(t,e,i,n,r,1)};var Pr=function(t,e){zr(this,t,4,e)};Pr.prototype.resize=function(t){Ir(this,t,4)},Pr.prototype.clone=function(){return new Pr({width:this.width,height:this.height},new Uint8Array(this.data))},Pr.copy=function(t,e,i,n,r){Cr(t,e,i,n,r,4)},ki("AlphaImage",Mr),ki("RGBAImage",Pr);var Lr={paint:new en({"heatmap-radius":new Ji(V.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ji(V.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Yi(V.paint_heatmap["heatmap-intensity"]),"heatmap-color":new tn(V.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Yi(V.paint_heatmap["heatmap-opacity"])})};function Dr(t,e){for(var i=new Uint8Array(1024),n={},r=0,o=0;r<256;r++,o+=4){n[e]=r/255;var a=t.evaluate(n);i[o+0]=Math.floor(255*a.r/a.a),i[o+1]=Math.floor(255*a.g/a.a),i[o+2]=Math.floor(255*a.b/a.a),i[o+3]=Math.floor(255*a.a)}return new Pr({width:256,height:1},i)}var Rr=function(t){function e(e){t.call(this,e,Lr),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 Ar(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=Dr(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}(nn),Br={paint:new en({"hillshade-illumination-direction":new Yi(V.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new