/*! For license information please see script.js.LICENSE.txt */
var lib;!function(){var t,e,r,n,i,o,a,s,l,u,c={82991:function(t,e,r){"use strict";r.d(e,{R:function(){return o}});var n=r(61422),i={};function o(){return(0,n.KV)()?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}},61422:function(t,e,r){"use strict";function n(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}r.d(e,{KV:function(){return n},l$:function(){return i}}),t=r.hmd(t)},21170:function(t,e,r){"use strict";r.d(e,{yW:function(){return l},ph:function(){return u}});var n=r(82991),i=r(61422);t=r.hmd(t);var o={nowSeconds:function(){return Date.now()/1e3}};var a=(0,i.KV)()?function(){try{return(0,i.l$)(t,"perf_hooks").performance}catch(t){return}}():function(){var t=(0,n.R)().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),u=s.nowSeconds.bind(s);!function(){var t=(0,n.R)().performance;if(t&&t.now){var e=36e5,r=t.now(),i=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+r-i):e,a=o<e,s=t.timing&&t.timing.navigationStart,l="number"==typeof s?Math.abs(s+r-i):e;return a||l<e?o<=l?("timeOrigin",t.timeOrigin):("navigationStart",s):("dateNow",i)}"none"}()},26512:function(t,e,r){"use strict";r.r(e);var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o,a,s=function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}!function(t){t.Ok="ok",t.Exited="exited",t.Crashed="crashed",t.Abnormal="abnormal"}(o||(o={})),function(t){t.Ok="ok",t.Errored="errored",t.Crashed="crashed"}(a||(a={}));var h=r(82991);function p(){var t=(0,h.R)(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var r=new Uint16Array(8);e.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function f(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+r+n}}function d(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function m(t,e,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||r||"Error"}function y(t,e){var r;if(t.exception&&t.exception.values){var n=t.exception.values[0],i=n.mechanism;if(n.mechanism=s(s(s({},{type:"generic",handled:!0}),i),e),e&&"data"in e){var o=s(s({},null===(r=i)||void 0===r?void 0:r.data),e.data);n.mechanism.data=o}}}function v(t){var e;if(null===(e=t)||void 0===e?void 0:e.__sentry_captured__)return!0;try{Object.defineProperty(t,"__sentry_captured__",{value:!0})}catch(t){}return!1}var g=r(21170),_=(0,h.R)(),x="Sentry Logger ";function b(t){var e=(0,h.R)();if(!("console"in e))return t();var r=e.console,n={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&r[t].__sentry_original__&&(n[t]=r[t],r[t]=r[t].__sentry_original__)}));var i=t();return Object.keys(n).forEach((function(t){r[t]=n[t]})),i}var w=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&b((function(){_.console.log(x+"[Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&b((function(){_.console.warn(x+"[Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&b((function(){_.console.error(x+"[Error]: "+t.join(" "))}))},t}();_.__SENTRY__=_.__SENTRY__||{};var S=_.__SENTRY__.logger||(_.__SENTRY__.logger=new w),E=r(61422);function T(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return O(t,Error)}}function k(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function C(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function I(t){return"[object String]"===Object.prototype.toString.call(t)}function P(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function A(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t){return"undefined"!=typeof Event&&O(t,Event)}function M(t){return"undefined"!=typeof Element&&O(t,Element)}function z(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function O(t,e){try{return t instanceof e}catch(t){return!1}}var L=function(){function t(t){var e=this;this._state="PENDING",this._handlers=[],this._resolve=function(t){e._setResult("RESOLVED",t)},this._reject=function(t){e._setResult("REJECTED",t)},this._setResult=function(t,r){"PENDING"===e._state&&(z(r)?r.then(e._resolve,e._reject):(e._state=t,e._value=r,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if("PENDING"!==e._state){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||("RESOLVED"===e._state&&t.onfulfilled&&t.onfulfilled(e._value),"REJECTED"===e._state&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,r){r(e)}))},t.all=function(e){return new t((function(r,n){if(Array.isArray(e))if(0!==e.length){var i=e.length,o=[];e.forEach((function(e,a){t.resolve(e).then((function(t){o[a]=t,0===(i-=1)&&r(o)})).then(null,n)}))}else r([]);else n(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,r){var n=this;return new t((function(t,i){n._attachHandler({done:!1,onfulfilled:function(r){if(e)try{return void t(e(r))}catch(t){return void i(t)}else t(r)},onrejected:function(e){if(r)try{return void t(r(e))}catch(t){return void i(t)}else i(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var r=this;return new t((function(t,n){var i,o;return r.then((function(t){o=!1,i=t,e&&e()}),(function(t){o=!0,i=t,e&&e()})).then((function(){o?n(i):t(i)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}(),j=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return t.clone=function(e){var r=new t;return e&&(r._breadcrumbs=c(e._breadcrumbs),r._tags=s({},e._tags),r._extra=s({},e._extra),r._contexts=s({},e._contexts),r._user=e._user,r._level=e._level,r._span=e._span,r._session=e._session,r._transactionName=e._transactionName,r._fingerprint=e._fingerprint,r._eventProcessors=c(e._eventProcessors),r._requestSession=e._requestSession),r},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.getRequestSession=function(){return this._requestSession},t.prototype.setRequestSession=function(t){return this._requestSession=t,this},t.prototype.setTags=function(t){return this._tags=s(s({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var r;return this._tags=s(s({},this._tags),((r={})[t]=e,r)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=s(s({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var r;return this._extra=s(s({},this._extra),((r={})[t]=e,r)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var r;return null===e?delete this._contexts[t]:this._contexts=s(s({},this._contexts),((r={})[t]=e,r)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t,e,r,n,i=this.getSpan();return(null===(t=i)||void 0===t?void 0:t.transaction)?null===(e=i)||void 0===e?void 0:e.transaction:(null===(n=null===(r=i)||void 0===r?void 0:r.spanRecorder)||void 0===n?void 0:n.spans[0])?i.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var r=e(this);return r instanceof t?r:this}return e instanceof t?(this._tags=s(s({},this._tags),e._tags),this._extra=s(s({},this._extra),e._extra),this._contexts=s(s({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):A(e)&&(e=e,this._tags=s(s({},this._tags),e.tags),this._extra=s(s({},this._extra),e.extra),this._contexts=s(s({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var r="number"==typeof e?Math.min(e,100):100;if(r<=0)return this;var n=s({timestamp:(0,g.yW)()},t);return this._breadcrumbs=c(this._breadcrumbs,[n]).slice(-r),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){var r;if(this._extra&&Object.keys(this._extra).length&&(t.extra=s(s({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=s(s({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=s(s({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=s(s({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=s({trace:this._span.getTraceContext()},t.contexts);var n=null===(r=this._span.transaction)||void 0===r?void 0:r.name;n&&(t.tags=s({transaction:n},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=c(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(c(R(),this._eventProcessors),t,e)},t.prototype._notifyEventProcessors=function(t,e,r,n){var i=this;return void 0===n&&(n=0),new L((function(o,a){var l=t[n];if(null===e||"function"!=typeof l)o(e);else{var u=l(s({},e),r);z(u)?u.then((function(e){return i._notifyEventProcessors(t,e,r,n+1).then(o)})).then(null,a):i._notifyEventProcessors(t,u,r,n+1).then(o).then(null,a)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function R(){var t=(0,h.R)();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function B(t){R().push(t)}function F(t,e){try{for(var r=t,n=[],i=0,o=0,a=" > ".length,s=void 0;r&&i++<5&&!("html"===(s=N(r,e))||i>1&&o+n.length*a+s.length>=80);)n.push(s),o+=s.length,r=r.parentNode;return n.reverse().join(" > ")}catch(t){return"<unknown>"}}function N(t,e){var r,n,i,o,a,s,l,u=t,c=[];if(!u||!u.tagName)return"";c.push(u.tagName.toLowerCase());var h=(null===(r=e)||void 0===r?void 0:r.length)?e.filter((function(t){return u.getAttribute(t)})).map((function(t){return[t,u.getAttribute(t)]})):null;if(null===(n=h)||void 0===n?void 0:n.length)h.forEach((function(t){c.push("["+t[0]+'="'+t[1]+'"]')}));else if(u.id&&c.push("#"+u.id),(i=u.className)&&I(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)c.push("."+o[l]);var p=["type","name","title","alt"];for(l=0;l<p.length;l++)a=p[l],(s=u.getAttribute(a))&&c.push("["+a+'="'+s+'"]');return c.join("")}var U=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e<this._inner.length;e++){if(this._inner[e]===t)return!0}return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t){this._inner.splice(e,1);break}},t}(),q="<anonymous>";function V(t){try{return t&&"function"==typeof t&&t.name||q}catch(t){return q}}function Z(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function W(t,e){if(!Array.isArray(t))return"";for(var r=[],n=0;n<t.length;n++){var i=t[n];try{r.push(String(i))}catch(t){r.push("[value cannot be serialized]")}}return r.join(e)}function H(t,e){return!!I(t)&&(r=e,"[object RegExp]"===Object.prototype.toString.call(r)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e));var r}function Y(t,e,r){if(e in t){var n=t[e],i=r(n);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:n}})}catch(t){}t[e]=i}}function G(t){if(T(t)){var e=t,r={message:e.message,name:e.name,stack:e.stack};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}if(D(t)){var i=t,o={};o.type=i.type;try{o.target=M(i.target)?F(i.target):Object.prototype.toString.call(i.target)}catch(t){o.target="<unknown>"}try{o.currentTarget=M(i.currentTarget)?F(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch(t){o.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&O(t,CustomEvent)&&(o.detail=i.detail),i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a]);return o}return t}function X(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function K(t,e,r){void 0===e&&(e=3),void 0===r&&(r=102400);var n=Q(t,e);return X(n)>r?K(t,e-1,r):n}function J(t,e){return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==r.g&&t===r.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":A(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+V(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var n}function $(t,e,r,n){if(void 0===r&&(r=1/0),void 0===n&&(n=new U),0===r)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var r=J(t);return P(r)?r:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var i=J(e,t);if(P(i))return i;var o=G(e),a=Array.isArray(e)?[]:{};if(n.memoize(e))return"[Circular ~]";for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=$(s,o[s],r-1,n));return n.unmemoize(e),a}function Q(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,r){return $(t,r,e)})))}catch(t){return"**non-serializable**"}}function tt(t,e){void 0===e&&(e=40);var r=Object.keys(G(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=e)return Z(r[0],e);for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>e))return n===r.length?i:Z(i,e)}return""}function et(t){var e,r;if(A(t)){var n=t,i={};try{for(var o=l(Object.keys(n)),a=o.next();!a.done;a=o.next()){var s=a.value;void 0!==n[s]&&(i[s]=et(n[s]))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return i}return Array.isArray(t)?t.map(et):t}var rt=function(){function t(t){this.errors=0,this.sid=p(),this.duration=0,this.status=o.Ok,this.init=!0,this.ignoreDuration=!1;var e=(0,g.ph)();this.timestamp=e,this.started=e,t&&this.update(t)}return t.prototype.update=function(t){if(void 0===t&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||(0,g.ph)(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:p()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{var e=this.timestamp-this.started;this.duration=e>=0?e:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===o.Ok?this.update({status:o.Exited}):this.update()},t.prototype.toJSON=function(){return et({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:et({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),nt=function(){function t(t,e,r){void 0===e&&(e=new j),void 0===r&&(r=4),this._version=r,this._stack=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=j.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var r=this._lastEventId=p(),n=e;if(!e){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(t){i=t}n={originalException:t,syntheticException:i}}return this._invokeClient("captureException",t,s(s({},n),{event_id:r})),r},t.prototype.captureMessage=function(t,e,r){var n=this._lastEventId=p(),i=r;if(!r){var o=void 0;try{throw new Error(t)}catch(t){o=t}i={originalException:t,syntheticException:o}}return this._invokeClient("captureMessage",t,e,s(s({},i),{event_id:n})),n},t.prototype.captureEvent=function(t,e){var r=p();return"transaction"!==t.type&&(this._lastEventId=r),this._invokeClient("captureEvent",t,s(s({},e),{event_id:r})),r},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var r=this.getStackTop(),n=r.scope,i=r.client;if(n&&i){var o=i.getOptions&&i.getOptions()||{},a=o.beforeBreadcrumb,l=void 0===a?null:a,u=o.maxBreadcrumbs,c=void 0===u?100:u;if(!(c<=0)){var h=(0,g.yW)(),p=s({timestamp:h},t),f=l?b((function(){return l(p,e)})):p;null!==f&&n.addBreadcrumb(f,c)}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var r=this.getScope();r&&r.setTag(t,e)},t.prototype.setExtra=function(t,e){var r=this.getScope();r&&r.setExtra(t,e)},t.prototype.setContext=function(t,e){var r=this.getScope();r&&r.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),r=e.scope,n=e.client;r&&n&&t(r)},t.prototype.run=function(t){var e=ot(this);try{t(this)}finally{ot(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return S.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},t.prototype.endSession=function(){var t,e,r,n,i;null===(r=null===(e=null===(t=this.getStackTop())||void 0===t?void 0:t.scope)||void 0===e?void 0:e.getSession())||void 0===r||r.close(),this._sendSessionUpdate(),null===(i=null===(n=this.getStackTop())||void 0===n?void 0:n.scope)||void 0===i||i.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),r=e.scope,n=e.client,i=n&&n.getOptions()||{},a=i.release,l=i.environment,u=((0,h.R)().navigator||{}).userAgent,c=new rt(s(s(s({release:a,environment:l},r&&{user:r.getUser()}),u&&{userAgent:u}),t));if(r){var p=r.getSession&&r.getSession();p&&p.status===o.Ok&&p.update({status:o.Exited}),this.endSession(),r.setSession(c)}return c},t.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),e=t.scope,r=t.client;if(e){var n=e.getSession&&e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}},t.prototype._invokeClient=function(t){for(var e,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this.getStackTop(),o=i.scope,a=i.client;a&&a[t]&&(e=a)[t].apply(e,c(r,[o]))},t.prototype._callExtensionMethod=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=it(),i=n.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[t])return i.extensions[t].apply(this,e);S.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function it(){var t=(0,h.R)();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function ot(t){var e=it(),r=lt(e);return ut(e,t),r}function at(){var t=it();return st(t)&&!lt(t).isOlderThan(4)||ut(t,new nt),(0,E.KV)()?function(t){var e,r,n;try{var i=null===(n=null===(r=null===(e=it().__SENTRY__)||void 0===e?void 0:e.extensions)||void 0===r?void 0:r.domain)||void 0===n?void 0:n.active;if(!i)return lt(t);if(!st(i)||lt(i).isOlderThan(4)){var o=lt(t).getStackTop();ut(i,new nt(o.client,j.clone(o.scope)))}return lt(i)}catch(e){return lt(t)}}(t):lt(t)}function st(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function lt(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new nt),t.__SENTRY__.hub}function ut(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}var ct,ht=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],pt=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(){B((function(e){var r=at();if(!r)return e;var n=r.getIntegration(t);if(n){var i=r.getClient(),o=i?i.getOptions():{},a="function"==typeof n._mergeOptions?n._mergeOptions(o):{};return"function"!=typeof n._shouldDropEvent?e:n._shouldDropEvent(e,a)?null:e}return e}))},t.prototype._shouldDropEvent=function(t,e){return this._isSentryError(t,e)?(S.warn("Event dropped due to being internal Sentry Error.\nEvent: "+d(t)),!0):this._isIgnoredError(t,e)?(S.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+d(t)),!0):this._isDeniedUrl(t,e)?(S.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+d(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0):!this._isAllowedUrl(t,e)&&(S.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+d(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0)},t.prototype._isSentryError=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype._isIgnoredError=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this._getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return H(t,e)}))}))},t.prototype._isDeniedUrl=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var r=this._getEventFilterUrl(t);return!!r&&e.denyUrls.some((function(t){return H(r,t)}))},t.prototype._isAllowedUrl=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var r=this._getEventFilterUrl(t);return!r||e.allowUrls.some((function(t){return H(r,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:c(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:c(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:c(this._options.ignoreErrors||[],t.ignoreErrors||[],ht),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},t.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},r=e.type,n=void 0===r?"":r,i=e.value,o=void 0===i?"":i;return[""+o,n+": "+o]}catch(e){return S.error("Cannot extract message for event "+d(t)),[]}return[]},t.prototype._getLastValidUrl=function(t){var e,r;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--){var i=t[n];if("<anonymous>"!==(null===(e=i)||void 0===e?void 0:e.filename)&&"[native code]"!==(null===(r=i)||void 0===r?void 0:r.filename))return i.filename||null}return null},t.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return this._getLastValidUrl(e)}if(t.exception){var r=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return this._getLastValidUrl(r)}return null}catch(e){return S.error("Cannot extract url for event "+d(t)),null}},t.id="InboundFilters",t}(),ft=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){ct=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=this.__sentry_original__||this;return ct.apply(r,t)}},t.id="FunctionToString",t}();function dt(){if(!("fetch"in(0,h.R)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function mt(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function yt(){if(!dt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}var vt,gt=(0,h.R)(),_t={},xt={};function bt(t){if(!xt[t])switch(xt[t]=!0,t){case"console":!function(){if(!("console"in gt))return;["debug","info","warn","error","log","assert"].forEach((function(t){t in gt.console&&Y(gt.console,t,(function(e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];St("console",{args:r,level:t}),e&&Function.prototype.apply.call(e,gt.console,r)}}))}))}();break;case"dom":!function(){if(!("document"in gt))return;var t=St.bind(null,"dom"),e=It(t,!0);gt.document.addEventListener("click",e,!1),gt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var r=gt[e]&&gt[e].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Y(r,"addEventListener",(function(e){return function(r,n,i){if("click"===r||"keypress"==r)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[r]=a[r]||{refCount:0};if(!s.handler){var l=It(t);s.handler=l,e.call(this,r,l,i)}s.refCount+=1}catch(t){}return e.call(this,r,n,i)}})),Y(r,"removeEventListener",(function(t){return function(e,r,n){if("click"===e||"keypress"==e)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[e];a&&(a.refCount-=1,a.refCount<=0&&(t.call(this,e,a.handler,n),a.handler=void 0,delete o[e]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,r,n)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in gt))return;var t=[],e=[],r=XMLHttpRequest.prototype;Y(r,"open",(function(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=this,a=n[1];o.__sentry_xhr__={method:I(n[0])?n[0].toUpperCase():n[0],url:n[1]},I(a)&&"POST"===o.__sentry_xhr__.method&&a.match(/sentry_key/)&&(o.__sentry_own_request__=!0);var s=function(){if(4===o.readyState){try{o.__sentry_xhr__&&(o.__sentry_xhr__.status_code=o.status)}catch(t){}try{var r=t.indexOf(o);if(-1!==r){t.splice(r);var i=e.splice(r)[0];o.__sentry_xhr__&&void 0!==i[0]&&(o.__sentry_xhr__.body=i[0])}}catch(t){}St("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:o})}};return"onreadystatechange"in o&&"function"==typeof o.onreadystatechange?Y(o,"onreadystatechange",(function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return s(),t.apply(o,e)}})):o.addEventListener("readystatechange",s),r.apply(o,n)}})),Y(r,"send",(function(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return t.push(this),e.push(n),St("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),r.apply(this,n)}}))}();break;case"fetch":!function(){if(!function(){if(!dt())return!1;var t=(0,h.R)();if(mt(t.fetch))return!0;var e=!1,r=t.document;if(r&&"function"==typeof r.createElement)try{var n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=mt(n.contentWindow.fetch)),r.head.removeChild(n)}catch(t){S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}())return;Y(gt,"fetch",(function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n={args:e,fetchData:{method:Et(e),url:Tt(e)},startTimestamp:Date.now()};return St("fetch",s({},n)),t.apply(gt,e).then((function(t){return St("fetch",s(s({},n),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw St("fetch",s(s({},n),{endTimestamp:Date.now(),error:t})),t}))}}))}();break;case"history":!function(){if(!function(){var t=(0,h.R)(),e=t.chrome,r=e&&e.app&&e.app.runtime,n="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!r&&n}())return;var t=gt.onpopstate;function e(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e.length>2?e[2]:void 0;if(n){var i=vt,o=String(n);vt=o,St("history",{from:i,to:o})}return t.apply(this,e)}}gt.onpopstate=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=gt.location.href,i=vt;if(vt=n,St("history",{from:i,to:n}),t)try{return t.apply(this,e)}catch(t){}},Y(gt.history,"pushState",e),Y(gt.history,"replaceState",e)}();break;case"error":Pt=gt.onerror,gt.onerror=function(t,e,r,n,i){return St("error",{column:n,error:i,line:r,msg:t,url:e}),!!Pt&&Pt.apply(this,arguments)};break;case"unhandledrejection":At=gt.onunhandledrejection,gt.onunhandledrejection=function(t){return St("unhandledrejection",t),!At||At.apply(this,arguments)};break;default:S.warn("unknown instrumentation type:",t)}}function wt(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(_t[t.type]=_t[t.type]||[],_t[t.type].push(t.callback),bt(t.type))}function St(t,e){var r,n;if(t&&_t[t])try{for(var i=l(_t[t]||[]),o=i.next();!o.done;o=i.next()){var a=o.value;try{a(e)}catch(e){S.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+V(a)+"\nError: "+e)}}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function Et(t){return void 0===t&&(t=[]),"Request"in gt&&O(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function Tt(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in gt&&O(t[0],Request)?t[0].url:String(t[0])}var kt,Ct;function It(t,e){return void 0===e&&(e=!1),function(r){if(r&&Ct!==r&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(r)){var n="keypress"===r.type?"input":r.type;(void 0===kt||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(Ct,r))&&(t({event:r,name:n,global:e}),Ct=r),clearTimeout(kt),kt=gt.setTimeout((function(){kt=void 0}),1e3)}}}var Pt=null;var At=null;var Dt,Mt="6.16.1";!function(t){t.BeforeSend="before_send",t.EventProcessor="event_processor",t.NetworkError="network_error",t.QueueOverflow="queue_overflow",t.RateLimitBackoff="ratelimit_backoff",t.SampleRate="sample_rate"}(Dt||(Dt={}));var zt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=e[r]);return t});var Ot=function(t){function e(e){var r=this.constructor,n=t.call(this,e)||this;return n.message=e,n.name=r.prototype.constructor.name,zt(n,r.prototype),n}return i(e,t),e}(Error),Lt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,jt="Invalid Dsn",Rt=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,r=e.host,n=e.path,i=e.pass,o=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&i?":"+i:"")+"@"+r+(o?":"+o:"")+"/"+(n?n+"/":n)+a},t.prototype._fromString=function(t){var e=Lt.exec(t);if(!e)throw new Ot(jt);var r=u(e.slice(1),6),n=r[0],i=r[1],o=r[2],a=void 0===o?"":o,s=r[3],l=r[4],c=void 0===l?"":l,h="",p=r[5],f=p.split("/");if(f.length>1&&(h=f.slice(0,-1).join("/"),p=f.pop()),p){var d=p.match(/^\d+/);d&&(p=d[0])}this._fromComponents({host:s,pass:a,path:h,projectId:p,port:c,protocol:n,publicKey:i})},t.prototype._fromComponents=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new Ot("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new Ot("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new Ot("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new Ot("Invalid Dsn: Invalid port "+this.port)},t}(),Bt=[];function Ft(t){return t.reduce((function(t,e){return t.every((function(t){return e.name!==t.name}))&&t.push(e),t}),[])}function Nt(t){var e={};return function(t){var e=t.defaultIntegrations&&c(t.defaultIntegrations)||[],r=t.integrations,n=c(Ft(e));Array.isArray(r)?n=c(n.filter((function(t){return r.every((function(e){return e.name!==t.name}))})),Ft(r)):"function"==typeof r&&(n=r(n),n=Array.isArray(n)?n:[n]);var i=n.map((function(t){return t.name})),o="Debug";return-1!==i.indexOf(o)&&n.push.apply(n,c(n.splice(i.indexOf(o),1))),n}(t).forEach((function(t){e[t.name]=t,function(t){-1===Bt.indexOf(t.name)&&(t.setupOnce(B,at),Bt.push(t.name),S.log("Integration installed: "+t.name))}(t)})),Object.defineProperty(e,"initialized",{value:!0}),e}var Ut,qt="Not capturing exception because it's already been captured.",Vt=function(){function t(t,e){this._integrations={},this._numProcessing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=new Rt(e.dsn))}return t.prototype.captureException=function(t,e,r){var n=this;if(!v(t)){var i=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return n._captureEvent(t,e,r)})).then((function(t){i=t}))),i}S.log(qt)},t.prototype.captureMessage=function(t,e,r,n){var i=this,o=r&&r.event_id,a=P(t)?this._getBackend().eventFromMessage(String(t),e,r):this._getBackend().eventFromException(t,r);return this._process(a.then((function(t){return i._captureEvent(t,r,n)})).then((function(t){o=t}))),o},t.prototype.captureEvent=function(t,e,r){var n;if(!(null===(n=e)||void 0===n?void 0:n.originalException)||!v(e.originalException)){var i=e&&e.event_id;return this._process(this._captureEvent(t,e,r).then((function(t){i=t}))),i}S.log(qt)},t.prototype.captureSession=function(t){this._isEnabled()?"string"!=typeof t.release?S.warn("Discarded session because of missing or non-string release"):(this._sendSession(t),t.update({init:!1})):S.warn("SDK not enabled, will not capture session.")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.getTransport=function(){return this._getBackend().getTransport()},t.prototype.flush=function(t){var e=this;return this._isClientDoneProcessing(t).then((function(r){return e.getTransport().close(t).then((function(t){return r&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=Nt(this._options))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return S.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var r,n,i=!1,a=!1,u=e.exception&&e.exception.values;if(u){a=!0;try{for(var c=l(u),h=c.next();!h.done;h=c.next()){var p=h.value.mechanism;if(p&&!1===p.handled){i=!0;break}}}catch(t){r={error:t}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}}var f=t.status===o.Ok;(f&&0===t.errors||f&&i)&&(t.update(s(s({},i&&{status:o.Crashed}),{errors:t.errors||Number(a||i)})),this.captureSession(t))},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientDoneProcessing=function(t){var e=this;return new L((function(r){var n=0,i=setInterval((function(){0==e._numProcessing?(clearInterval(i),r(!0)):(n+=1,t&&n>=t&&(clearInterval(i),r(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,r){var n=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,a=s(s({},t),{event_id:t.event_id||(r&&r.event_id?r.event_id:p()),timestamp:t.timestamp||(0,g.yW)()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var l=e;r&&r.captureContext&&(l=j.clone(l).update(r.captureContext));var u=L.resolve(a);return l&&(u=l.applyToEvent(a,r)),u.then((function(t){return"number"==typeof o&&o>0?n._normalizeEvent(t,o):t}))},t.prototype._normalizeEvent=function(t,e){if(!t)return null;var r=s(s(s(s(s({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return s(s({},t),t.data&&{data:Q(t.data,e)})}))}),t.user&&{user:Q(t.user,e)}),t.contexts&&{contexts:Q(t.contexts,e)}),t.extra&&{extra:Q(t.extra,e)});t.contexts&&t.contexts.trace&&(r.contexts.trace=t.contexts.trace);var n=this.getOptions()._experiments;return(void 0===n?{}:n).ensureNoCircularStructures?Q(r):r},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),r=e.environment,n=e.release,i=e.dist,o=e.maxValueLength,a=void 0===o?250:o;"environment"in t||(t.environment="environment"in e?r:"production"),void 0===t.release&&void 0!==n&&(t.release=n),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=Z(t.message,a));var s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=Z(s.value,a));var l=t.request;l&&l.url&&(l.url=Z(l.url,a))},t.prototype._applyIntegrationsMetadata=function(t){var e=Object.keys(this._integrations);e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=c(t.sdk.integrations||[],e))},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,r){return this._processEvent(t,e,r).then((function(t){return t.event_id}),(function(t){S.error(t)}))},t.prototype._processEvent=function(t,e,r){var n,i,o=this,a=this.getOptions(),s=a.beforeSend,l=a.sampleRate,u=this.getTransport();if(!this._isEnabled())return L.reject(new Ot("SDK not enabled, will not capture event."));var c="transaction"===t.type;return!c&&"number"==typeof l&&Math.random()>l?(null===(i=(n=u).recordLostEvent)||void 0===i||i.call(n,Dt.SampleRate,"event"),L.reject(new Ot("Discarding event because it's not included in the random sample (sampling rate = "+l+")"))):this._prepareEvent(t,r,e).then((function(r){var n,i;if(null===r)throw null===(i=(n=u).recordLostEvent)||void 0===i||i.call(n,Dt.EventProcessor,t.type||"event"),new Ot("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||c||!s)return r;var a=s(r,e);return o._ensureBeforeSendRv(a)})).then((function(e){var n,i;if(null===e)throw null===(i=(n=u).recordLostEvent)||void 0===i||i.call(n,Dt.BeforeSend,t.type||"event"),new Ot("`beforeSend` returned `null`, will not send event.");var a=r&&r.getSession&&r.getSession();return!c&&a&&o._updateSessionFromEvent(a,e),o._sendEvent(e),e})).then(null,(function(t){if(t instanceof Ot)throw t;throw o.captureException(t,{data:{__sentry__:!0},originalException:t}),new Ot("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._numProcessing+=1,t.then((function(t){return e._numProcessing-=1,t}),(function(t){return e._numProcessing-=1,t}))},t.prototype._ensureBeforeSendRv=function(t){var e="`beforeSend` method has to return `null` or a valid event.";if(z(t))return t.then((function(t){if(!A(t)&&null!==t)throw new Ot(e);return t}),(function(t){throw new Ot("beforeSend rejected with "+t)}));if(!A(t)&&null!==t)throw new Ot(e);return t},t}();!function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.Invalid="invalid",t.Failed="failed"}(Ut||(Ut={})),function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(Ut||(Ut={}));var Zt,Wt=function(){function t(){}return t.prototype.sendEvent=function(t){return L.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:Ut.Skipped})},t.prototype.close=function(t){return L.resolve(!0)},t}(),Ht=function(){function t(t){this._options=t,this._options.dsn||S.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new Ot("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,r){throw new Ot("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,(function(t){S.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this._transport.sendSession?this._transport.sendSession(t).then(null,(function(t){S.error("Error while sending session: "+t)})):S.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new Wt},t}();!function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(Zt||(Zt={})),function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;default:return t.Log}}}(Zt||(Zt={}));var Yt="?",Gt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Kt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Jt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$t=/\((\S*)(?::(\d+))(?::(\d+))\)/,Qt=/Minified React error #\d+;/i;function te(t){var e=null,r=0;t&&("number"==typeof t.framesToPop?r=t.framesToPop:Qt.test(t.message)&&(r=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,r=t.stacktrace,n=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=r.split("\n"),a=[],s=0;s<o.length;s+=2){var l=null;(e=n.exec(o[s]))?l={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=i.exec(o[s]))&&(l={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),l&&(!l.func&&l.line&&(l.func=Yt),a.push(l))}if(!a.length)return null;return{message:ne(t),name:t.name,stack:a}}(t),e)return re(e,r)}catch(t){}try{if(e=function(t){var e,r;if(!t||!t.stack)return null;for(var n,i,o,a=[],s=t.stack.split("\n"),l=0;l<s.length;++l){if(i=Gt.exec(s[l])){var c=i[2]&&0===i[2].indexOf("native");i[2]&&0===i[2].indexOf("eval")&&(n=$t.exec(i[2]))&&(i[2]=n[1],i[3]=n[2],i[4]=n[3]);var h=i[2]&&0===i[2].indexOf("address at ")?i[2].substr("address at ".length):i[2],p=i[1]||Yt;p=(e=u(ee(p,h),2))[0],o={url:h=e[1],func:p,args:c?[i[2]]:[],line:i[3]?+i[3]:null,column:i[4]?+i[4]:null}}else if(i=Kt.exec(s[l]))o={url:i[2],func:i[1]||Yt,args:[],line:+i[3],column:i[4]?+i[4]:null};else{if(!(i=Xt.exec(s[l])))continue;i[3]&&i[3].indexOf(" > eval")>-1&&(n=Jt.exec(i[3]))?(i[1]=i[1]||"eval",i[3]=n[1],i[4]=n[2],i[5]=""):0!==l||i[5]||void 0===t.columnNumber||(a[0].column=t.columnNumber+1);h=i[3],p=i[1]||Yt;p=(r=u(ee(p,h),2))[0],o={url:h=r[1],func:p,args:i[2]?i[2].split(","):[],line:i[4]?+i[4]:null,column:i[5]?+i[5]:null}}!o.func&&o.line&&(o.func=Yt),a.push(o)}if(!a.length)return null;return{message:ne(t),name:t.name,stack:a}}(t),e)return re(e,r)}catch(t){}return{message:ne(t),name:t&&t.name,stack:[],failed:!0}}var ee=function(t,e){var r=-1!==t.indexOf("safari-extension"),n=-1!==t.indexOf("safari-web-extension");return r||n?[-1!==t.indexOf("@")?t.split("@")[0]:Yt,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]};function re(t,e){try{return s(s({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function ne(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function ie(t){var e=ae(t.stack),r={type:t.name,value:t.message};return e&&e.length&&(r.stacktrace={frames:e}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function oe(t){return{exception:{values:[ie(t)]}}}function ae(t){if(!t||!t.length)return[];var e=t,r=e[0].func||"",n=e[e.length-1].func||"";return-1===r.indexOf("captureMessage")&&-1===r.indexOf("captureException")||(e=e.slice(1)),-1!==n.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function se(t,e,r){var n,i;if(void 0===r&&(r={}),k(t)&&t.error)return n=oe(te(t=t.error));if(C(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){var o=t;if("stack"in t)n=oe(te(t));else{var a=o.name||(C(o)?"DOMError":"DOMException"),l=o.message?a+": "+o.message:a;m(n=le(l,e,r),l)}return"code"in o&&(n.tags=s(s({},n.tags),{"DOMException.code":""+o.code})),n}return T(t)?n=oe(te(t)):A(t)||D(t)?(n=function(t,e,r){var n={exception:{values:[{type:D(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error "+(r?"promise rejection":"exception")+" captured with keys: "+tt(t)}]},extra:{__serialized__:K(t)}};if(e){var i=ae(te(e).stack);n.stacktrace={frames:i}}return n}(t,e,r.rejection),y(n,{synthetic:!0}),n):(m(n=le(t,e,r),""+t,void 0),y(n,{synthetic:!0}),n)}function le(t,e,r){void 0===r&&(r={});var n={message:t};if(r.attachStacktrace&&e){var i=ae(te(e).stack);n.stacktrace={frames:i}}return n}function ue(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function ce(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=c(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=c(t.sdk.packages||[],e.packages||[]),t):t}function he(t,e){var r=ue(e),n="aggregates"in t?"sessions":"session";return{body:JSON.stringify(s(s({sent_at:(new Date).toISOString()},r&&{sdk:r}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:n})+"\n"+JSON.stringify(t),type:n,url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function pe(t,e){var r=ue(e),n=t.type||"event",i="transaction"===n||e.forceEnvelope(),o=t.debug_meta||{},a=o.transactionSampling,l=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(o,["transactionSampling"]),u=a||{},c=u.method,h=u.rate;0===Object.keys(l).length?delete t.debug_meta:t.debug_meta=l;var p={body:JSON.stringify(r?ce(t,e.metadata.sdk):t),type:n,url:i?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(i){var f=JSON.stringify(s(s({event_id:t.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:n,sample_rates:[{id:c,rate:h}]})+"\n"+p.body;p.body=f}return p}var fe=function(){function t(t,e,r){void 0===e&&(e={}),this.dsn=t,this._dsnObject=new Rt(t),this.metadata=e,this._tunnel=r}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.forceEnvelope=function(){return!!this._tunnel},t.prototype.getBaseApiEndpoint=function(){var t=this.getDsn(),e=t.protocol?t.protocol+":":"",r=t.port?":"+t.port:"";return e+"//"+t.host+r+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},t.prototype.getStoreEndpointPath=function(){var t=this.getDsn();return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var r=this.getDsn(),n=["Sentry sentry_version=7"];return n.push("sentry_client="+t+"/"+e),n.push("sentry_key="+r.publicKey),r.pass&&n.push("sentry_secret="+r.pass),{"Content-Type":"application/json","X-Sentry-Auth":n.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this.getDsn(),r=this.getBaseApiEndpoint()+"embed/error-page/",n=[];for(var i in n.push("dsn="+e.toString()),t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&n.push("name="+encodeURIComponent(t.user.name)),t.user.email&&n.push("email="+encodeURIComponent(t.user.email))}else n.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return n.length?r+"?"+n.join("&"):r},t.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},t.prototype._getIngestEndpoint=function(t){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+t+"/"},t.prototype._encodedAuth=function(){var t,e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return t=e,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},t}(),de=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},t.prototype.add=function(t){var e=this;if(!this.isReady())return L.reject(new Ot("Not adding Promise due to buffer limit reached."));var r=t();return-1===this._buffer.indexOf(r)&&this._buffer.push(r),r.then((function(){return e.remove(r)})).then(null,(function(){return e.remove(r).then(null,(function(){}))})),r},t.prototype.remove=function(t){return this._buffer.splice(this._buffer.indexOf(t),1)[0]},t.prototype.length=function(){return this._buffer.length},t.prototype.drain=function(t){var e=this;return new L((function(r){var n=setTimeout((function(){t&&t>0&&r(!1)}),t);L.all(e._buffer).then((function(){clearTimeout(n),r(!0)})).then(null,(function(){r(!0)}))}))},t}();var me,ye=(0,h.R)();function ve(){var t,e;if(me)return me;if(mt(ye.fetch))return me=ye.fetch.bind(ye);var r=ye.document,n=ye.fetch;if("function"==typeof(null===(t=r)||void 0===t?void 0:t.createElement))try{var i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i),(null===(e=i.contentWindow)||void 0===e?void 0:e.fetch)&&(n=i.contentWindow.fetch),r.head.removeChild(i)}catch(t){S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return me=n.bind(ye)}function ge(t,e){if("[object Navigator]"===Object.prototype.toString.call(ye&&ye.navigator)&&"function"==typeof ye.navigator.sendBeacon)return ye.navigator.sendBeacon.bind(ye.navigator)(t,e);if(dt()){var r=ve();r(t,{body:e,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(t){console.error(t)}))}else;}var _e={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},xe=(0,h.R)(),be=function(){function t(t){var e=this;this.options=t,this._buffer=new de(30),this._rateLimits={},this._outcomes={},this._api=new fe(t.dsn,t._metadata,t.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth(),this.options.sendClientReports&&xe.document&&xe.document.addEventListener("visibilitychange",(function(){"hidden"===xe.document.visibilityState&&e._flushOutcomes()}))}return t.prototype.sendEvent=function(t){throw new Ot("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t.prototype.recordLostEvent=function(t,e){var r;if(this.options.sendClientReports){var n=_e[e]+":"+t;S.log("Adding outcome: "+n),this._outcomes[n]=(null!=(r=this._outcomes[n])?r:0)+1}},t.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var t=this._outcomes;if(this._outcomes={},Object.keys(t).length){S.log("Flushing outcomes:\n"+JSON.stringify(t,null,2));var e=this._api.getEnvelopeEndpointWithUrlEncodedAuth(),r=JSON.stringify(s({},this.options.tunnel&&{dsn:this._api.getDsn().toString()}))+"\n"+JSON.stringify({type:"client_report"})+"\n"+JSON.stringify({timestamp:(0,g.yW)(),discarded_events:Object.keys(t).map((function(e){var r=u(e.split(":"),2),n=r[0];return{reason:r[1],category:n,quantity:t[e]}}))});try{ge(e,r)}catch(t){S.error(t)}}else S.log("No outcomes to flush")}},t.prototype._handleResponse=function(t){var e=t.requestType,r=t.response,n=t.headers,i=t.resolve,o=t.reject,a=Ut.fromHttpCode(r.status);this._handleRateLimit(n)&&S.warn("Too many "+e+" requests, backing off until: "+this._disabledUntil(e)),a!==Ut.Success?o(r):i({status:a})},t.prototype._disabledUntil=function(t){var e=_e[t];return this._rateLimits[e]||this._rateLimits.all},t.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},t.prototype._handleRateLimit=function(t){var e,r,n,i,o=Date.now(),a=t["x-sentry-rate-limits"],s=t["retry-after"];if(a){try{for(var u=l(a.trim().split(",")),c=u.next();!c.done;c=u.next()){var h=c.value.split(":",2),p=parseInt(h[0],10),f=1e3*(isNaN(p)?60:p);try{for(var d=(n=void 0,l(h[1].split(";"))),m=d.next();!m.done;m=d.next()){var y=m.value;this._rateLimits[y||"all"]=new Date(o+f)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return!0}return!!s&&(this._rateLimits.all=new Date(o+function(t,e){if(!e)return 6e4;var r=parseInt(""+e,10);if(!isNaN(r))return 1e3*r;var n=Date.parse(""+e);return isNaN(n)?6e4:n-t}(o,s)),!0)},t}(),we=function(t){function e(e,r){void 0===r&&(r=ve());var n=t.call(this,e)||this;return n._fetch=r,n}return i(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(he(t,this._api),t)},e.prototype._sendRequest=function(t,e){var r=this;if(this._isRateLimited(t.type))return this.recordLostEvent(Dt.RateLimitBackoff,t.type),Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429});var n={body:t.body,method:"POST",referrerPolicy:yt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(n,this.options.fetchParameters),void 0!==this.options.headers&&(n.headers=this.options.headers),this._buffer.add((function(){return new L((function(e,i){r._fetch(t.url,n).then((function(n){var o={"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")};r._handleResponse({requestType:t.type,response:n,headers:o,resolve:e,reject:i})})).catch(i)}))})).then(void 0,(function(e){throw e instanceof Ot?r.recordLostEvent(Dt.QueueOverflow,t.type):r.recordLostEvent(Dt.NetworkError,t.type),e}))},e}(be),Se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(he(t,this._api),t)},e.prototype._sendRequest=function(t,e){var r=this;return this._isRateLimited(t.type)?(this.recordLostEvent(Dt.RateLimitBackoff,t.type),Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new L((function(e,n){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};r._handleResponse({requestType:t.type,response:i,headers:o,resolve:e,reject:n})}},i.open("POST",t.url),r.options.headers)Object.prototype.hasOwnProperty.call(r.options.headers,o)&&i.setRequestHeader(o,r.options.headers[o]);i.send(t.body)}))})).then(void 0,(function(e){throw e instanceof Ot?r.recordLostEvent(Dt.QueueOverflow,t.type):r.recordLostEvent(Dt.NetworkError,t.type),e}))},e}(be),Ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.eventFromException=function(t,e){return function(t,e,r){var n=se(e,r&&r.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return y(n),n.level=Zt.Error,r&&r.event_id&&(n.event_id=r.event_id),L.resolve(n)}(this._options,t,e)},e.prototype.eventFromMessage=function(t,e,r){return void 0===e&&(e=Zt.Info),function(t,e,r,n){void 0===r&&(r=Zt.Info);var i=le(e,n&&n.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return i.level=r,n&&n.event_id&&(i.event_id=n.event_id),L.resolve(i)}(this._options,t,e,r)},e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=s(s({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(e):dt()?new we(e):new Se(e)},e}(Ht);function Te(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=at();if(n&&n[t])return n[t].apply(n,c(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function ke(t,e){var r;try{throw new Error("Sentry syntheticException")}catch(t){r=t}return Te("captureException",t,{captureContext:e,originalException:t,syntheticException:r})}function Ce(t){Te("withScope",t)}var Ie=(0,h.R)(),Pe=0;function Ae(){return Pe>0}function De(){Pe+=1,setTimeout((function(){Pe-=1}))}function Me(t,e,r){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var n=function(){var n=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);var i=n.map((function(t){return Me(t,e)}));return t.handleEvent?t.handleEvent.apply(this,i):t.apply(this,i)}catch(t){throw De(),Ce((function(r){r.addEventProcessor((function(t){var r=s({},t);return e.mechanism&&(m(r,void 0,void 0),y(r,e.mechanism)),r.extra=s(s({},r.extra),{arguments:n}),r})),ke(t)})),t}};try{for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch(t){}t.prototype=t.prototype||{},n.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:n}),Object.defineProperties(n,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:function(){return t.name}})}catch(t){}return n}var ze=function(){function t(e){this.name=t.id,this._options=s({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return t.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&at().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:d(t)},{event:t})},t.prototype.setupOnce=function(){var t=this;this._options.console&&wt({callback:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t._consoleBreadcrumb.apply(t,c(e))},type:"console"}),this._options.dom&&wt({callback:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t._domBreadcrumb.apply(t,c(e))},type:"dom"}),this._options.xhr&&wt({callback:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t._xhrBreadcrumb.apply(t,c(e))},type:"xhr"}),this._options.fetch&&wt({callback:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t._fetchBreadcrumb.apply(t,c(e))},type:"fetch"}),this._options.history&&wt({callback:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t._historyBreadcrumb.apply(t,c(e))},type:"history"})},t.prototype._consoleBreadcrumb=function(t){var e={category:"console",data:{arguments:t.args,logger:"console"},level:Zt.fromString(t.level),message:W(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message="Assertion failed: "+(W(t.args.slice(1)," ")||"console.assert"),e.data.arguments=t.args.slice(1)}at().addBreadcrumb(e,{input:t.args,level:t.level})},t.prototype._domBreadcrumb=function(t){var e,r="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{e=t.event.target?F(t.event.target,r):F(t.event,r)}catch(t){e="<unknown>"}0!==e.length&&at().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name,global:t.global})},t.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},r=e.method,n=e.url,i=e.status_code,o=e.body;at().addBreadcrumb({category:"xhr",data:{method:r,url:n,status_code:i},type:"http"},{xhr:t.xhr,input:o})}else;},t.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method||(t.error?at().addBreadcrumb({category:"fetch",data:t.fetchData,level:Zt.Error,type:"http"},{data:t.error,input:t.args}):at().addBreadcrumb({category:"fetch",data:s(s({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},t.prototype._historyBreadcrumb=function(t){var e=(0,h.R)(),r=t.from,n=t.to,i=f(e.location.href),o=f(r),a=f(n);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),at().addBreadcrumb({category:"navigation",data:{from:r,to:n}})},t.id="Breadcrumbs",t}(),Oe=function(t){function e(e){void 0===e&&(e={});return e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Mt}],version:Mt},t.call(this,Ee,e)||this}return i(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),(0,h.R)().document&&(this._isEnabled()?function(t){if(void 0===t&&(t={}),Ie.document)if(t.eventId)if(t.dsn){var e=Ie.document.createElement("script");e.async=!0,e.src=new fe(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad);var r=Ie.document.head||Ie.document.body;r&&r.appendChild(e)}else S.error("Missing dsn option in showReportDialog call");else S.error("Missing eventId option in showReportDialog call")}(s(s({},t),{dsn:t.dsn||this.getDsn()})):S.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype._prepareEvent=function(e,r,n){return e.platform=e.platform||"javascript",t.prototype._prepareEvent.call(this,e,r,n)},e.prototype._sendEvent=function(e){var r=this.getIntegration(ze);r&&r.addSentryBreadcrumb(e),t.prototype._sendEvent.call(this,e)},e}(Vt),Le=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],je=function(){function t(e){this.name=t.id,this._options=s({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=(0,h.R)();(this._options.setTimeout&&Y(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&Y(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&Y(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&Y(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:Le).forEach(this._wrapEventTarget.bind(this))},t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0];return e[0]=Me(n,{mechanism:{data:{function:V(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t.call(this,Me(e,{mechanism:{data:{function:"requestAnimationFrame",handler:V(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=(0,h.R)(),r=e[t]&&e[t].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Y(r,"addEventListener",(function(e){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Me(n.handleEvent.bind(n),{mechanism:{data:{function:"handleEvent",handler:V(n),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,r,Me(n,{mechanism:{data:{function:"addEventListener",handler:V(n),target:t},handled:!0,type:"instrument"}}),i)}})),Y(r,"removeEventListener",(function(t){return function(e,r,n){var i,o=r;try{var a=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;a&&t.call(this,e,a,n)}catch(t){}return t.call(this,e,o,n)}})))},t.prototype._wrapXHR=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach((function(t){t in n&&"function"==typeof n[t]&&Y(n,t,(function(e){var r={mechanism:{data:{function:t,handler:V(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(r.mechanism.data.handler=V(e.__sentry_original__)),Me(e,r)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),Re=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=s({onerror:!0,onunhandledrejection:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(S.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(S.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},t.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(wt({callback:function(r){var n=r.error,i=at(),o=i.getIntegration(t),a=n&&!0===n.__sentry_own_request__;if(o&&!Ae()&&!a){var s=i.getClient(),l=void 0===n&&I(r.msg)?e._eventFromIncompleteOnError(r.msg,r.url,r.line,r.column):e._enhanceEventWithInitialFrame(se(n||r.msg,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),r.url,r.line,r.column);y(l,{handled:!1,type:"onerror"}),i.captureEvent(l,{originalException:n})}},type:"error"}),this._onErrorHandlerInstalled=!0)},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(wt({callback:function(r){var n=r;try{"reason"in r?n=r.reason:"detail"in r&&"reason"in r.detail&&(n=r.detail.reason)}catch(t){}var i=at(),o=i.getIntegration(t),a=n&&!0===n.__sentry_own_request__;if(!o||Ae()||a)return!0;var s=i.getClient(),l=P(n)?e._eventFromRejectionWithPrimitive(n):se(n,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!0});l.level=Zt.Error,y(l,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(l,{originalException:n})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},t.prototype._eventFromIncompleteOnError=function(t,e,r,n){var i,o=k(t)?t.message:t,a=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(i=a[1],o=a[2]);var s={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(s,e,r,n)},t.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},t.prototype._enhanceEventWithInitialFrame=function(t,e,r,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(n,10))?void 0:n,o=isNaN(parseInt(r,10))?void 0:r,a=I(e)&&e.length>0?e:function(){var t=(0,h.R)();try{return t.document.location.href}catch(t){return""}}();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),t},t.id="GlobalHandlers",t}(),Be=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){B((function(e,r){var n=at().getIntegration(t);if(n){var i=n._handler&&n._handler.bind(n);return"function"==typeof i?i(e,r):e}return e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&O(e.originalException,Error)))return t;var r=this._walkErrorTree(e.originalException,this._key);return t.exception.values=c(r,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,r){if(void 0===r&&(r=[]),!O(t[e],Error)||r.length+1>=this._limit)return r;var n=ie(te(t[e]));return this._walkErrorTree(t[e],e,c([n],r))},t.id="LinkedErrors",t}(),Fe=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(e,r){e((function(e){var n=r().getIntegration(t);if(n){try{if(n._shouldDropEvent(e,n._previousEvent))return S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e}))},t.prototype._shouldDropEvent=function(t,e){return!!e&&(!!this._isSameMessageEvent(t,e)||!!this._isSameExceptionEvent(t,e))},t.prototype._isSameMessageEvent=function(t,e){var r=t.message,n=e.message;return!(!r&&!n)&&(!(r&&!n||!r&&n)&&(r===n&&(!!this._isSameFingerprint(t,e)&&!!this._isSameStacktrace(t,e))))},t.prototype._getFramesFromEvent=function(t){var e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(t){return}else if(t.stacktrace)return t.stacktrace.frames},t.prototype._isSameStacktrace=function(t,e){var r=this._getFramesFromEvent(t),n=this._getFramesFromEvent(e);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(r=r,(n=n).length!==r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i],a=r[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0},t.prototype._getExceptionFromEvent=function(t){return t.exception&&t.exception.values&&t.exception.values[0]},t.prototype._isSameExceptionEvent=function(t,e){var r=this._getExceptionFromEvent(e),n=this._getExceptionFromEvent(t);return!(!r||!n)&&(r.type===n.type&&r.value===n.value&&(!!this._isSameFingerprint(t,e)&&!!this._isSameStacktrace(t,e)))},t.prototype._isSameFingerprint=function(t,e){var r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return!(r.join("")!==n.join(""))}catch(t){return!1}},t.id="Dedupe",t}(),Ne=(0,h.R)(),Ue=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){B((function(e){var r,n,i;if(at().getIntegration(t)){if(!Ne.navigator&&!Ne.location&&!Ne.document)return e;var o=(null===(r=e.request)||void 0===r?void 0:r.url)||(null===(n=Ne.location)||void 0===n?void 0:n.href),a=(Ne.document||{}).referrer,l=(Ne.navigator||{}).userAgent,u=s(s(s({},null===(i=e.request)||void 0===i?void 0:i.headers),a&&{Referer:a}),l&&{"User-Agent":l}),c=s(s({},o&&{url:o}),{headers:u});return s(s({},e),{request:c})}return e}))},t.id="UserAgent",t}(),qe=[new pt,new ft,new je,new ze,new Re,new Be,new Fe,new Ue];function Ve(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=qe),void 0===t.release){var e=(0,h.R)();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),void 0===t.sendClientReports&&(t.sendClientReports=!0),function(t,e){var r;!0===e.debug&&S.enable();var n=at();null===(r=n.getScope())||void 0===r||r.update(e.initialScope);var i=new t(e);n.bindClient(i)}(Oe,t),t.autoSessionTracking&&function(){if(void 0===(0,h.R)().document)return void S.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");var t=at();if("function"!=typeof t.startSession||"function"!=typeof t.captureSession)return;t.startSession({ignoreDuration:!0}),t.captureSession(),wt({callback:function(e){var r=e.from,n=e.to;void 0!==r&&r!==n&&(t.startSession({ignoreDuration:!0}),t.captureSession())},type:"history"})}()}function Ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function We(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(r),!0).forEach((function(e){He(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function He(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ye=r(85362);function Ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ge(Object(r),!0).forEach((function(e){Ke(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Je(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function $e(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Je(o,n,i,a,s,"next",t)}function s(t){Je(o,n,i,a,s,"throw",t)}a(void 0)}))}}function Qe(){return(Qe=$e((function*(t){var e=window.location.protocol+"//"+window.location.host+"/",r=yield fetch(e,{body:(0,Ye.Z)(t),method:"POST"});if(!r.ok)throw travel.log("Network error: ".concat(r.status," - ").concat(r.statusText)),new Error("Response ".concat(r.status," - ").concat(r.statusText))}))).apply(this,arguments)}var tr=(0,r(29555).Z)((function(t){return Qe.apply(this,arguments)}),10,500),er=t=>{var e=t||{tob:travel.options.tob,logId:travel.options.logId,wslogs:travel.options.track};if(!e.tob&&e.logId&&e.wslogs){var r=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,n={page:"time",id:e.logId,r:Math.floor(1e7*Math.random())};if(r&&r.timing){var i=r.timing.toJSON(),o=i.navigationStart;Object.keys(i).filter((t=>i[t])).forEach((t=>i[t]-=o)),n=Xe(Xe({},n),i)}else n.navigationStart=12345;tr(n)}};r(44108),r(94402),r(55803);class rr{constructor(){this.subscribers=[]}subscribe(t){this.subscribers.push(t)}broadcast(t){this.subscribers.forEach((e=>{e(t)}))}}var nr=r(67718),ir=r(74403);travel.events={};var or=new ir.Z({category:"first-screen-avail-form",linear:!1,events:[{name:"close-form",once:!0},{name:"check-avail-form",once:!0}]});travel.events.mobileFormInit=or;var ar=r(48680),sr=r(76405);function lr(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ur(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){lr(o,n,i,a,s,"next",t)}function s(t){lr(o,n,i,a,s,"throw",t)}a(void 0)}))}}var cr=document.querySelectorAll(".js-fixed-dates-btn");function hr(t,e){return pr.apply(this,arguments)}function pr(){return(pr=ur((function*(t,e){var r=document.createDocumentFragment(),n=document.createElement("span"),i=document.createElement("span"),o=document.createElement("span");return o.innerHTML=" - ",n.innerHTML=yield mr(t),i.innerHTML=yield mr(e),r.appendChild(n),r.appendChild(o),r.appendChild(i),r}))).apply(this,arguments)}function fr(){return dr.apply(this,arguments)}function dr(){return(dr=ur((function*(){var{dateFrom:t,dateTo:e}=sr.Z,r=yield hr(t,e);cr.forEach((t=>{t.innerHTML="",t.appendChild(r.cloneNode(!0))}))}))).apply(this,arguments)}function mr(t){return yr.apply(this,arguments)}function yr(){return(yr=ur((function*(t){return yield ar.Z.getDateInFormat(t,"ddd, DD MMM",!0)}))).apply(this,arguments)}sr.Z.on("update",fr),fr();var vr=r(63575),gr=r(69704),_r=r(29946);function xr(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function br(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){xr(o,n,i,a,s,"next",t)}function s(t){xr(o,n,i,a,s,"throw",t)}a(void 0)}))}}var wr=[...document.querySelectorAll(".js-new-calendar-onboard-wrapper .js-avail-form")].map((t=>{var e=new vr.Z(t);return new gr.Z(e)}));document.body.addEventListener("click",function(){var t=br((function*(t){if(t.target.matches(".js-avail-popup-show-btn")||t.target.closest(".js-avail-popup-show-btn")){if(travel.isMobile()){var e="".concat(travel.options.siteId,"||").concat(travel.options.objectId,"||").concat(window.location.origin),{sendClickStats:n}=yield Promise.resolve().then(r.bind(r,8378));n({category:"mobile-open-modal-form",action:"open",id:travel.options.logId,h:travel.options.hotelExtId,labelData:e})}_r.availPopup.openPopup()}}));return function(e){return t.apply(this,arguments)}}());var Sr=[travel.isMobile(),!travel.events.mobileFormInit.checkEventsDone()];function Er(){return(Er=br((function*(){var t=!!document.cookie.split(";").filter((t=>t.includes("use_date=1"))).length;if(!(travel.isMobile()||window.location.hash||t)){yield wr[0].view.initCalendar(),wr[0].view.calendar.open();var e=document.querySelector(".js-new-calendar-onboard-wrapper");e.classList.add("is-open-onboard"),wr[0].view.calendar.on("close",(()=>e.classList.remove("is-open-onboard")))}}))).apply(this,arguments)}travel.isFirstScreenAvailForm=Sr.every((t=>!!t)),travel.isFirstScreenAvailForm&&setTimeout((()=>{_r.availPopup.openPopup()}),3500),function(){Er.apply(this,arguments)}();var Tr=r(32699);function kr(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Cr(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){kr(o,n,i,a,s,"next",t)}function s(t){kr(o,n,i,a,s,"throw",t)}a(void 0)}))}}var Ir,Pr="#rooms";function Ar(){return Dr.apply(this,arguments)}function Dr(){return(Dr=Cr((function*(){if(!Ir){var{default:t}=yield Promise.all([r.e(2370),r.e(7776)]).then(r.bind(r,37776));(Ir=new t).init()}}))).apply(this,arguments)}Tr.default.store.hash===Pr&&Ar(),Tr.default.store.on("changeHash",(t=>{t===Pr&&Ar()}));r(2804);function Mr(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function zr(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Mr(o,n,i,a,s,"next",t)}function s(t){Mr(o,n,i,a,s,"throw",t)}a(void 0)}))}}var Or=function(t){var{galleryChangeObserver:e,galleryInitObserver:n}=t;window.addEventListener("load",(()=>{window.requestIdleCallback(zr((function*(){var{default:t}=yield Promise.all([r.e(2957),r.e(3472),r.e(8057)]).then(r.bind(r,38057)),i=new t,{default:o}=yield r.e(1263).then(r.bind(r,21263));o(e,n,i)})),{timeout:2e3})}))},Lr=r(9139),jr=r(13444),Rr=r(42152),Br=r.n(Rr);function Fr(t,e){Ur(t,e),e.add(t)}function Nr(t,e,r){Ur(t,e),e.set(t,r)}function Ur(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qr(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function Vr(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Wr(t,e,"get"))}function Zr(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,Wr(t,e,"set"),r),r}function Wr(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var Hr=new WeakMap,Yr=new WeakMap,Gr=new WeakMap,Xr=new WeakMap,Kr=new WeakMap,Jr=new WeakMap,$r=new WeakMap,Qr=new WeakMap,tn=new WeakSet,en=new WeakSet,rn=new WeakSet,nn=new WeakSet,on=new WeakSet;class an extends jr.Z{constructor(){super(),Fr(this,on),Fr(this,nn),Fr(this,rn),Fr(this,en),Fr(this,tn),Nr(this,Hr,{writable:!0,value:void 0}),Nr(this,Yr,{writable:!0,value:void 0}),Nr(this,Gr,{writable:!0,value:void 0}),Nr(this,Xr,{writable:!0,value:void 0}),Nr(this,Kr,{writable:!0,value:void 0}),Nr(this,Jr,{writable:!0,value:void 0}),Nr(this,$r,{writable:!0,value:void 0}),Nr(this,Qr,{writable:!0,value:void 0}),Zr(this,Hr,document.querySelector(".js-embed-an-image-content")),Zr(this,Yr,[...Vr(this,Hr).querySelectorAll(".js-embed-image-size-btn")]),Zr(this,Gr,Vr(this,Hr).querySelector(".js-embed-an-image-toggle-btn")),Zr(this,Xr,Vr(this,Hr).querySelector(".js-embed-an-image-preview")),Zr(this,Kr,Vr(this,Hr).querySelector(".js-embed-an-image-capture")),Zr(this,Jr,Vr(this,Hr).querySelector(".js-embed-image-link")),Zr(this,$r,document.querySelector(".js-embed-an-image-template").innerHTML),Zr(this,Qr,document.querySelector(".js-embed-an-image-template-caption").innerHTML),qr(this,tn,sn).call(this),qr(this,on,hn).call(this)}activateSizeBtn(t){var e=qr(this,rn,un).call(this,t);qr(this,en,ln).call(this),e.classList.add("active")}updateCaption(t){t?(Vr(this,Gr).classList.add("is-checked"),Vr(this,Kr).style.visibility="visible"):(Vr(this,Gr).classList.remove("is-checked"),Vr(this,Kr).style.visibility="hidden")}updatePreview(t){Vr(this,Xr).src!==t&&(Vr(this,Xr).src=t)}updateCodeLine(t){var e=qr(this,nn,cn).call(this,t);Vr(this,Jr).textContent=e}initModal(t){this.modal=new Lr.default(".js-embed-an-image-popup",{trigger:t,selectors:{content:".js-embed-an-image-content",close:".js-embed-an-image-close-btn"}}),this.modal.on("show",(()=>this.emit("action",{name:"open"})))}}function sn(){Vr(this,Yr).forEach((t=>{t.addEventListener("click",(()=>{this.emit("changeSize",t.dataset.size),this.emit("action",{name:"sizeChange"})}))})),Vr(this,Gr).addEventListener("click",(()=>{this.emit("toggleCaption"),this.emit("action",{name:"toggleCaption"})})),Vr(this,Jr).addEventListener("click",(()=>this.emit("action",{name:"clickOnCode"})))}function ln(){Vr(this,Yr).forEach((t=>t.classList.remove("active")))}function un(t){return Vr(this,Yr).find((e=>e.dataset.size===t))}function cn(t){var e=t.caption?Vr(this,Qr):Vr(this,$r);return t.domainName=window.location.origin,Object.entries(t).forEach((t=>{var[r,n]=t;return e=e.replace("$_".concat(r),n)})),e=e.replaceAll("> ",">")}function hn(){var t=new(Br())(".js-embed-copy-btn"),e=Vr(this,Hr).querySelector(".js-embed-an-image-copied-info");t.on("success",(()=>{e.classList.remove("is-hidden"),setTimeout((()=>e.classList.add("is-hidden")),5e3),this.emit("action",{name:"copyCode"})}))}var pn=r(8378);function fn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fn(Object(r),!0).forEach((function(e){mn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yn(t,e,r){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,r)}function vn(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,_n(t,e,"get"))}function gn(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_n(t,e,"set"),r),r}function _n(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var xn=new WeakMap;class bn extends jr.Z{constructor(){super(),yn(this,xn,{writable:!0,value:void 0}),gn(this,xn,{width:"604",height:"340",sizeString:"604x340",path:"",src:"",caption:!0,url:window.location.origin})}get data(){return vn(this,xn)}set data(t){gn(this,xn,dn(dn({},vn(this,xn)),t)),this.emit("update",vn(this,xn))}getDataByKey(t){return vn(this,xn)[t]}}function wn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Sn(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var En=new bn,Tn=new WeakSet,kn=new WeakSet,Cn=new WeakSet;class In{constructor(t){wn(this,Cn),wn(this,kn),wn(this,Tn),this.view=t,this.view.on("changeSize",Sn(this,kn,An).bind(this)),this.view.on("toggleCaption",Sn(this,Cn,Dn).bind(this)),this.view.on("action",(t=>class{constructor(){}static send(t){var{src:e,action:r}=t,n="".concat(travel.options.siteId,"||").concat(travel.options.objectId,"||").concat(window.location.origin+e);(0,pn.sendClickStats)({category:"embedImage",action:r,id:travel.options.logId,h:travel.options.hotelExtId,labelData:n})}}.send({action:t.name,src:En.data.src}))),En.on("update",Sn(this,Tn,Pn).bind(this))}updateActiveImage(t){En.data=t}}function Pn(t){this.view.updateCodeLine(t),this.view.updatePreview(t.src),this.view.updateCaption(t.caption),this.view.activateSizeBtn(t.sizeString)}function An(t){var e=t.split("x");En.data={sizeString:t,width:e[0],height:e[1]}}function Dn(){En.data={caption:!En.data.caption}}var Mn=()=>document.querySelector(".js-embed-an-image-open-btn").content.children[0].cloneNode(!0),zn=t=>{var{galleryChangeObserver:e,galleryInitObserver:r}=t,n=!1,i=new an,o=new In(i),a=Mn();r.subscribe((()=>{document.querySelector(".fancybox__thumbs").before(a),n||(i.initModal(a),n=!0)})),e.subscribe((t=>{var{imageinfo:e,imageLoadSuccess:r}=t;o.updateActiveImage(e),r?a.classList.remove("hidden-btn"):a.classList.add("hidden-btn")}))},On=r(4058);class Ln extends On.ZP{constructor(){super(...arguments)}toggle(){this.active||(super.toggle(),this.emiter.emit("open",this))}}class jn extends jr.Z{constructor(t){super(),this.container=t instanceof HTMLElement?t:document.querySelector(t);var e=[...this.container.querySelectorAll("[data-target]")];this.items=e.map((t=>new Ln(t))),this.items.forEach((t=>t.on("open",this._hideOtherToggle.bind(this))))}openIndex(t){var e=this.items[t];if(!e)throw new Error("Element with index ".concat(t," not found"));e.show(),this._hideOtherToggle(e)}getActiveTab(){return this.items.find((t=>t.active))}_hideOtherToggle(t){this.items.forEach((e=>{e!==t&&e.hide()})),this.emit("change",t)}}function Rn(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Bn(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Rn(o,n,i,a,s,"next",t)}function s(t){Rn(o,n,i,a,s,"throw",t)}a(void 0)}))}}var Fn=new jn(document.querySelector("#reviews")),Nn=document.querySelector(".js-reviews-outer-tab");Nn&&Nn.addEventListener("click",(()=>{Fn.openIndex(1)})),(0,nr.Z)(document.querySelector("#add-review"),Bn((function*(){var{default:t}=yield r.e(1001).then(r.bind(r,61001));new t(".js-add-review-form")})));var Un=r(19755),qn=r.n(Un),Vn=r(76233),Zn=JSON.parse('{"TZ":"sv-hl-landmark-type-museum","Fd":"sv-hl-landmark-type-airport","YO":"sv-hl-landmark-type-barrel","FB":"sv-hl-landmark-type-aquapark","ib":"sv-hl-landmark-type-beach","hH":"sv-hl-landmark-type-bobsleigh","mD":"sv-hl-landmark-type-bridge","Jj":"sv-hl-landmark-type-building","bn":"sv-hl-landmark-type-bus","w6":"sv-hl-landmark-type-camping","ZY":"sv-hl-landmark-type-canyon","uW":"sv-hl-landmark-type-cars","zg":"sv-hl-landmark-type-casino","LS":"sv-hl-landmark-type-cave","Fj":"sv-hl-landmark-type-cemetery","z3":"sv-hl-landmark-type-cinema","TW":"sv-hl-landmark-type-circuit-track","q9":"sv-hl-landmark-type-circus","qT":"sv-hl-landmark-type-cliff","PM":"sv-hl-landmark-type-concert-venue-stadium","q5":"sv-hl-landmark-type-golf-club","DQ":"sv-hl-landmark-type-greenhouse","lt":"sv-hl-landmark-type-gym","rf":"sv-hl-landmark-type-hills-mountains","Dl":"sv-hl-landmark-type-horse","qZ":"sv-hl-landmark-type-hospital","L_":"sv-hl-landmark-type-island","Yw":"sv-hl-landmark-type-kayak","Pi":"sv-hl-landmark-type-kindergarten","hn":"sv-hl-landmark-type-lakes-seas","SK":"sv-hl-landmark-type-marina","Ek":"sv-hl-landmark-type-military-base","Ct":"sv-hl-landmark-type-mosque","JV":"sv-hl-landmark-type-nature-parks-trails","Um":"sv-hl-landmark-type-night-club","Su":"sv-hl-landmark-type-observation-wheel","c$":"sv-hl-landmark-type-parking","NG":"sv-hl-landmark-type-peak","m6":"sv-hl-landmark-type-planetarium","bE":"sv-hl-landmark-type-square","l3":"sv-hl-landmark-type-pray","dr":"sv-hl-landmark-type-transports","eO":"sv-hl-landmark-type-reef","y$":"sv-hl-landmark-type-rink","r6":"sv-hl-landmark-type-school","aD":"sv-hl-landmark-type-shopping","sW":"sv-hl-landmark-type-sights-landmarks","wY":"sv-hl-landmark-type-ski","gW":"sv-hl-landmark-type-spa","Zd":"sv-hl-landmark-type-stadium","JM":"sv-hl-landmark-type-synagogue","WK":"sv-hl-landmark-type-theater","AE":"sv-hl-landmark-type-trails","_9":"sv-hl-landmark-type-train-station-train"}'),Wn={4:Zn.TZ,7:Zn.TZ,58:Zn.TZ,70:Zn.TZ,96:Zn.TZ,98:Zn.TZ,136:Zn.TZ,195:Zn.TZ,196:Zn.TZ,104:Zn.Fd,240:Zn.YO,257:Zn.YO,272:Zn.YO,45:Zn.FB,126:Zn.ib,204:Zn.hH,83:Zn.mD,128:Zn.mD,129:Zn.Jj,9:Zn.Jj,201:Zn.Jj,95:Zn.Jj,267:Zn.Jj,161:Zn.Jj,199:Zn.bn,149:Zn.bn,271:Zn.bn,268:Zn.w6,233:Zn.ZY,237:Zn.ZY,170:Zn.uW,147:Zn.uW,8:Zn.zg,238:Zn.LS,152:Zn.LS,131:Zn.Fj,223:Zn.z3,206:Zn.TW,207:Zn.TW,259:Zn.TW,202:Zn.TW,187:Zn.TW,234:Zn.TW,230:Zn.TW,222:Zn.q9,214:Zn.qT,217:Zn.qT,57:Zn.PM,140:Zn.q5,200:Zn.q5,166:Zn.DQ,112:Zn.DQ,231:Zn.lt,185:Zn.lt,154:Zn.rf,258:Zn.rf,168:Zn.Dl,68:Zn.qZ,142:Zn.L_,146:Zn.Yw,265:Zn.Pi,157:Zn.hn,244:Zn.hn,210:Zn.hn,216:Zn.hn,143:Zn.hn,159:Zn.hn,215:Zn.hn,255:Zn.hn,171:Zn.hn,137:Zn.hn,167:Zn.SK,158:Zn.SK,40:Zn.SK,192:Zn.SK,119:Zn.Ek,102:Zn.Ct,256:Zn.JV,111:Zn.JV,116:Zn.JV,135:Zn.JV,114:Zn.JV,156:Zn.JV,219:Zn.JV,5:Zn.JV,115:Zn.JV,198:Zn.JV,105:Zn.Um,108:Zn.Su,18:Zn.Su,225:Zn.Su,44:Zn.Su,208:Zn.c$,165:Zn.c$,153:Zn.NG,209:Zn.NG,239:Zn.m6,162:Zn.bE,100:Zn.l3,263:Zn.l3,269:Zn.l3,236:Zn.l3,274:Zn.l3,101:Zn.l3,278:Zn.dr,109:Zn.eO,212:Zn.eO,232:Zn.y$,97:Zn.r6,173:Zn.aD,177:Zn.aD,174:Zn.aD,176:Zn.aD,226:Zn.sW,81:Zn.sW,118:Zn.sW,266:Zn.sW,254:Zn.sW,277:Zn.sW,220:Zn.sW,87:Zn.sW,253:Zn.sW,260:Zn.sW,213:Zn.sW,227:Zn.sW,246:Zn.sW,243:Zn.sW,224:Zn.sW,228:Zn.sW,275:Zn.sW,30:Zn.sW,270:Zn.sW,245:Zn.sW,273:Zn.sW,261:Zn.sW,241:Zn.sW,164:Zn.sW,242:Zn.sW,262:Zn.sW,229:Zn.sW,190:Zn.sW,218:Zn.sW,221:Zn.sW,276:Zn.sW,264:Zn.sW,178:Zn.wY,180:Zn.wY,169:Zn.wY,179:Zn.wY,203:Zn.wY,181:Zn.gW,124:Zn.Zd,48:Zn.Zd,123:Zn.Zd,46:Zn.Zd,52:Zn.Zd,141:Zn.Zd,134:Zn.Zd,3:Zn.Zd,235:Zn.JM,188:Zn.WK,72:Zn.WK,251:Zn.AE,250:Zn.AE,249:Zn.AE,248:Zn.AE,247:Zn.AE,252:Zn.AE,211:Zn.AE,205:Zn.AE,145:Zn.AE,279:Zn._9,35:Zn._9,33:Zn._9};class Hn{constructor(t){this.attraction=t,this.template=document.getElementById("highlights-attraction-template").content}fillTemplate(){var t=this.template.cloneNode(!0);(t.querySelector(".highlights-attraction-title").innerHTML=this.attraction.title,t.querySelector(".highlights-landmarks__icon use").setAttribute("xlink:href","/new/designs/99/build/hotel-attractions.svg#icon-".concat(this.getIcon())),t.querySelector(".hl-tooltip__img").style.backgroundImage="url(".concat(this.attraction.photo,")"),t.querySelector(".hl-tooltip__tag-list").innerHTML=this.attraction.tags.map((t=>'<span class="hl-tooltip__tag">'.concat(t,"</span>"))).join(""),this.attraction.photoIsValid)||t.querySelector(".highlights-landmarks__info").remove();return t.querySelector(".highlights-landmarks__value").innerHTML=" — ".concat(this.attraction.distance),t}getIcon(){var t=(this.attraction.attraction.Types||"").split("|")[0];return Wn[t]||"sv-hl-location"}}function Yn(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Gn(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Yn(o,n,i,a,s,"next",t)}function s(t){Yn(o,n,i,a,s,"throw",t)}a(void 0)}))}}new class{constructor(){this.attractionsStorage=new Vn.Z,this.attractions=[],this.highlightsAttractionsList=document.querySelector(".js-highlights-landmarks-list"),this.init()}init(){var t=this;return Gn((function*(){if(t.attractions=yield t.getAttractions(),!t.attractions.length)return t.hideHighlightsBlock();t.generateTemplate()}))()}getAttractions(){var t=this;return Gn((function*(){try{return(yield t.attractionsStorage.getHighlightAttractions()).slice(0,5)}catch(t){console.error(t)}}))()}hideHighlightsBlock(){if(!!!document.querySelector(".js-highlights-reviews")){var t=document.querySelector(".js-highlights-container");qn()(t).fadeOut()}}generateTemplate(){var t=document.createDocumentFragment(),e=this.attractions.reduce(((e,r)=>{var n=new Hn(r),i=document.createElement("li");return i.classList.add("highlights-landmarks__item"),r.photoIsValid||i.classList.add("is-no-tooltip"),i.appendChild(n.fillTemplate()),t.appendChild(i),t}),t);this.highlightsAttractionsList.appendChild(e)}};function Xn(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function Kn(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Xn(o,n,i,a,s,"next",t)}function s(t){Xn(o,n,i,a,s,"throw",t)}a(void 0)}))}}(0,nr.Z)(document.querySelector(".js-faq-accordion"),Kn((function*(){var{default:t}=yield r.e(6685).then(r.bind(r,96685));new t(".js-faq-accordion .js-faq-accordion-btn")})));var Jn=r(6158),$n=r.n(Jn);class Qn{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mapbox",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.map=null,this.options=r,this.container=t,this.longitude=(null==e?void 0:e.long)||travel.options.mapParameters.hotelLongitude,this.latitude=(null==e?void 0:e.lat)||travel.options.mapParameters.hotelLatitude,this.init()}init(){this.map=new($n().Map)({container:this.container,zoom:this.options.zoom||17,minZoom:this.options.minZoom||5,maxZoom:this.options.maxZoom||20,center:[this.longitude,this.latitude],customAttribution:['<a href="https://daylightmap.org/" target="_blank">DaylightMap</a>','Building data - \t\t\t\t<a href="https://github.com/microsoft/AustraliaBuildingFootprints/" target="_blank">Australia</a>, \t\t\t\t<a href="https://github.com/microsoft/CanadianBuildingFootprints" target="_blank">Canada</a>, \t\t\t\t<a href="https://github.com/microsoft/Uganda-Tanzania-Building-Footprints" target="_blank">Uganda/Tanzania</a>, \t\t\t\t<a href="https://github.com/microsoft/USBuildingFootprints" target="_blank">US</a>'],style:this.options.style||"/map-styles/3/map-style.json",pitch:this.options.pitch||0,bearing:this.options.bearing||0,transformRequest:this.transformRequest}),this.options.control&&this.map.addControl(new($n().NavigationControl)({visualizePitch:!0}),this.options.control)}transformRequest(t,e){var r=t;return"Tile"===e&&-1!==t.indexOf("/tiles-data/map2/")?r=location.origin+t:"SpriteJSON"!==e&&"SpriteImage"!==e||-1===t.indexOf("/maps-data/mapboxgl/sprite")||(r=t.replace("https://",location.origin+"/")),{url:r}}addControl(t,e){this.map.addControl(t,e)}addMarker(t,e){return new($n().Marker)(t).setLngLat(e).addTo(this.map)}addHotelMarker(t,e){var r="function"==typeof t?t(e):t.cloneNode(!0);return r.dataset.id=e.properties.id,this.addMarker({element:r,anchor:"bottom"},e.geometry.coordinates)}addMarkers(t,e){var r=[];return t.features.forEach((t=>{var n=this.addHotelMarker(e,t);r.push(n)})),r}getCenterCoords(){return[this.longitude,this.latitude]}getMap(){return this.map}getContainer(){return this.container}on(){this.map.on(...arguments)}once(){this.map.once(...arguments)}off(){this.map.off(...arguments)}isStyleLoaded(){return this.map.isStyleLoaded(...arguments)}flyTo(){return this.map.flyTo(...arguments)}getZoom(){return this.map.getZoom(...arguments)}addSource(){return this.map.addSource(...arguments)}getSource(){return this.map.getSource(...arguments)}removeSource(){if(this.map.getSource(...arguments))return this.map.removeSource(...arguments)}addLayer(){return this.map.addLayer(...arguments)}getLayer(){return this.map.getLayer(...arguments)}setLayoutProperty(){return this.map.setLayoutProperty(...arguments)}removeLayer(){if(this.map.getLayer(...arguments))return this.map.removeLayer(...arguments)}createPopup(t){return new($n().Popup)(t)}generateBounds(t){var e=new($n().LngLatBounds);return t.forEach((t=>e.extend(t))),e}fitBounds(t){var{padding:e=50,animate:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.map.fitBounds(t,{padding:e,animate:r})}fitBoundsByCoordinates(t){this.fitBounds(this.generateBounds(t))}getBounds(){return this.map.getBounds()}resize(){return this.map.resize()}}function ti(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ei(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){ti(o,n,i,a,s,"next",t)}function s(t){ti(o,n,i,a,s,"throw",t)}a(void 0)}))}}function ri(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ni(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){ri(o,n,i,a,s,"next",t)}function s(t){ri(o,n,i,a,s,"throw",t)}a(void 0)}))}}(0,nr.Z)(document.querySelector("#small-mapbox"),ei((function*(){var{default:t}=yield r.e(4044).then(r.bind(r,34044)),e=document.querySelector("#small-mapbox"),n={long:travel.options.mapParameters.hotelLongitude,lat:travel.options.mapParameters.hotelLatitude};new t({provider:new Qn(e,n,{zoom:12,style:"/map-styles/99/map-style.json"})})}))),(0,nr.Z)(document.querySelector("#mapbox"),ei((function*(){var{default:t}=yield r.e(4044).then(r.bind(r,34044)),e=document.querySelector("#mapbox"),n={long:travel.options.mapParameters.hotelLongitude,lat:travel.options.mapParameters.hotelLatitude},i=new t({provider:new Qn(e,n,{zoom:17,control:"top-right",markerSize:{width:50,height:70},pitch:30,style:"/map-styles/99/map-style.json"})}),{default:o}=yield r.e(7405).then(r.bind(r,27405));i.on("load",(()=>{i.createHotelMarker();var t=new o(i),e=function(){var t=ei((function*(t){yield t.fetchData(),t.setMapZoom(),t.drawTransport(),t.initFiltersPanelIfNeed(),t.toggleMarkersVisibility("transport"),t.toggleMarkersVisibility("subway"),t.drawPins(t.landmarks,t.createLandmarkHtmlMarker),t.drawPins(t.restaurants,t.createRestaurantHtmlMarker)}));return function(e){return t.apply(this,arguments)}}();t.mapOnloadAction(e.bind(null,t))}))}))),(0,nr.Z)(document.querySelector(".js-keyfacilities-scroll-point"),ni((function*(){if(travel.isMobile()){var{default:t}=yield r.e(6685).then(r.bind(r,96685));new t(".js-keyfacilities-scroll-point .js-mobile-accordion-btn")}}))),(0,nr.Z)(document.querySelector(".h-description-main.facil-wrap"),ni((function*(){if(travel.isMobile()){var{default:t}=yield r.e(6685).then(r.bind(r,96685));new t(".h-description-main.facil-wrap .js-mobile-accordion-btn")}})));var ii=r(38601),oi=r(79866);function ai(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function si(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){ai(o,n,i,a,s,"next",t)}function s(t){ai(o,n,i,a,s,"throw",t)}a(void 0)}))}}function li(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function ui(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){li(o,n,i,a,s,"next",t)}function s(t){li(o,n,i,a,s,"throw",t)}a(void 0)}))}}function ci(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function hi(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){ci(o,n,i,a,s,"next",t)}function s(t){ci(o,n,i,a,s,"throw",t)}a(void 0)}))}}function pi(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function fi(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){pi(o,n,i,a,s,"next",t)}function s(t){pi(o,n,i,a,s,"throw",t)}a(void 0)}))}}travel.isMobile()||"0"!==travel.options.availableParams.use||"1"===(0,ii.ej)("exit-popup")||!travel.options.clickTrip||travel.options.tob||setTimeout(si((function*(){var{default:t}=yield r.e(3573).then(r.bind(r,53573));(new t).on("beforeRedirect",(t=>{(0,pn.sendClickStats)({category:"clickunder",action:"open",id:travel.options.logId,h:travel.options.hotelExtId,labelData:(0,oi.Z)({type:"popup-clicktrip"},t)})}))})),5e3),(0,nr.Z)(document.querySelector(".ftr-modals"),ui((function*(){var{default:t}=yield r.e(2980).then(r.bind(r,42980));new t(".js-feedback-form")}))),(0,nr.Z)(document.querySelector("footer.ftr"),hi((function*(){if(travel.isMobile()){var{default:t}=yield r.e(6685).then(r.bind(r,96685));new t(".ftr__accordion .js-mobile-accordion-btn")}}))),(0,nr.Z)(document.querySelector(".js-mobile-relinking-accordion"),hi((function*(){if(travel.isMobile()){var{default:t}=yield r.e(6685).then(r.bind(r,96685));new t(".js-mobile-relinking-accordion .js-mobile-accordion-relinking-section")}}))),setTimeout((()=>r.e(2440).then(r.bind(r,22440))),0),(0,nr.Z)(document.querySelector(".js-footer-subscribe"),fi((function*(){var{default:t}=yield r.e(5521).then(r.bind(r,35521));new t(document.querySelector(".js-footer-subscribe"))})));var di,mi,yi,vi,gi=r(7663);function _i(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function xi(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){_i(o,n,i,a,s,"next",t)}function s(t){_i(o,n,i,a,s,"throw",t)}a(void 0)}))}}vi=(null===(mi=travel.options)||void 0===mi?void 0:mi.nid)||(null===(yi=travel.opts)||void 0===yi?void 0:yi.nid),Ve({dsn:We({publicKey:"240c0ff5301d4c8fa78e9acc9b19e028",protocol:location.protocol.replace(":",""),host:location.host,path:"slog",projectId:"25"},di)}),vi&&Te("configureScope",(t=>t.setTag("networkID",vi))),er(),setTimeout(xi((function*(){var{initJsLinks:t}=yield r.e(8046).then(r.bind(r,58046));t();var{default:e}=yield r.e(5604).then(r.bind(r,5604));new e;var{showCookiePolicyIfNeed:n}=yield r.e(5934).then(r.bind(r,25934));n({autoClose:!0})})),0),setTimeout((()=>Promise.resolve().then(r.bind(r,32699))),0),(0,nr.Z)(document.querySelector(".h-description-right"),xi((function*(){var{default:t}=yield r.e(5859).then(r.bind(r,35859));new t}))),[...document.querySelectorAll(".js-keyfacilities-scroll-btn")].forEach((t=>t.addEventListener("click",(()=>{(0,gi.Z)(document.querySelector(".js-keyfacilities-scroll-point"),{top:80})})))),(0,nr.Z)(document.querySelector(".js-relinking-slider"),xi((function*(){var{default:t}=yield Promise.all([r.e(2957),r.e(3472),r.e(8825)]).then(r.bind(r,38825));t()}))),(0,nr.Z)(document.querySelector("#form-feedback"),xi((function*(){var{default:t}=yield r.e(4024).then(r.bind(r,74024));new t("#form-feedback")}))),window.addEventListener("load",(()=>{document.querySelectorAll(".antiCls").forEach((t=>t.classList.remove("antiCls")))}));var bi=new rr,wi=new rr;Or({galleryChangeObserver:bi,galleryInitObserver:wi}),zn({galleryChangeObserver:bi,galleryInitObserver:wi})},69704:function(t,e,r){"use strict";r.d(e,{Z:function(){return x}});var n=r(19755),i=r.n(n),o=r(8378),a=r(79866),s=r(38601);function l(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var u=function(){var t,e=(t=function*(){var t=new URLSearchParams("");t.append("page","stat"),t.append("fn","increment"),t.append("mn","clickunder.click-trip_counter");try{var e="/metric.php?".concat(t),r=yield fetch(e),n=yield r.text();console.log("".concat(r.statusText,": ").concat(n))}catch(t){console.error(t)}},function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){l(o,n,i,a,s,"next",t)}function s(t){l(o,n,i,a,s,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}(),c=t=>new Promise(((e,r)=>{if(n=!!document.cookie.split(";").filter((t=>t.includes("click-trip=1"))).length,"hotel"!==travel.options.typeObject||!travel.options.clickTrip||n)return e();var n;try{var l=(t=>{var e=travel.options.clickTrip,r=(new Date).setDate((new Date).getDate()+3);document.cookie="click-trip=1; expires=".concat(r,";"),u();var n=i()('input[name="from"]',t).val(),o=i()('input[name="to"]',t).val(),a=i()(".js-adults-select",t),s=i()(".js-child-age-select option:selected",t),l=0;a.each(((t,e)=>l+=parseInt(i()(e).val())));var c=s.length;if(travel.options.clickunderUrl&&!travel.isMobile())return h=travel.options.clickunderUrl,h+="?"+i()(t).serialize(),h+="&sid="+travel.options.sid,h+="&hid="+travel.options.obj_id,e.subAccount&&(h+="&subacc="+e.subAccount),h;var h="";"countryEmptyBcomID"==e.hotelBookingDestinationType?h="https://www.booking.com/country/"+e.hotelBookingCityId+".html?":(h="https://www.booking.com/searchresults.html?",h+="&dest_type="+e.hotelBookingDestinationType,h+="&dest_id="+e.hotelBookingCityId);var p="1549630";return 1!==travel.options.device&&2!==travel.options.device||(p="2370045"),h+="&aid=".concat(p),e.hotelBookingId&&(h+="&highlighted_hotels="+e.hotelBookingId),h+="&checkin="+n,h+="&checkout="+o,h+="&group_adults="+l,h+="&group_children="+c,s.each(((t,e)=>h+="&age="+i()(e).val())),h+="&no_rooms="+a.length,e.subAccount&&(h+="&label=",h+=e.subAccount,h+="-adults".concat(l,"-children").concat(c),travel.isMobile()&&(h+="-mob")),h})(i()(t)),c=(t=>{var e=location.pathname||"/",r=new URLSearchParams,n=t.getAttribute("action"),i=new FormData(t);for(var[o,a]of i)r.append(o,a);r.append("clirder",1);var s=(new Date).getTime();return"".concat(e,"?").concat(r,"&_").concat(s).concat(n)})(t);(0,o.sendClickStats)({category:"clickunder",action:"open",id:travel.options.logId,h:travel.options.hotelExtId,labelData:(0,a.Z)({},l)}),1===travel.options.device||2===travel.options.device?((0,s.d8)("hotelName",travel.options.hotelName,{domain:"."+travel.options.siteDomain}),(0,s.d8)("connectUrl",l,{domain:"."+travel.options.siteDomain}),(0,s.d8)("sourceUrl",document.location.origin+c,{domain:"."+travel.options.siteDomain}),window.open("".concat(window.location.protocol,"//").concat(travel.options.siteDomain,"/connect/")),location.href=c):setTimeout((()=>{window.open(c),location.href=l}),100)}catch(t){r(t)}})).catch((t=>{throw console.error(t),t})),h=r(13444),p=r(76405),f=t=>{var e={};for(var[r,n]of t)e[r]=n;return e};function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}class v extends h.Z{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.formStore=p.Z,this.config=e,this.view.on("submit",(()=>this.submit())),this.view.on("revalidate",(()=>this.validate()))}submit(){var t,e=this;return(t=function*(){if(e.validate())try{if(e._saveToStorage(),e.config.clickunderRedirect){var t=e._getFormParams(),r=e.config.clickunderOptionsGenerator?e.config.clickunderOptionsGenerator(t):{};yield e.config.clickunderRedirect(e.view.getForm(),r)}e.view.getForm().submit()}catch(t){console.log(t)}},function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){y(o,n,i,a,s,"next",t)}function s(t){y(o,n,i,a,s,"throw",t)}a(void 0)}))})()}validate(){var t={children:this.formStore.children.map((t=>""!==t.age))},e=t.children.some((t=>!t));return this.view.updateErrors(t),!e}_getData(){var t=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},this.formStore);return delete t._emiter,delete t.on,delete t.off,t}_getFormParams(){var t=new FormData(this.view.getForm());return f(t)}_saveToStorage(){var t=this._getData(),e=new Date;e.setDate(e.getDate()+1),document.cookie="store=".concat(JSON.stringify(t),"; expires=").concat(e)}}var g=v;function _(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}class x extends g{constructor(){super(...arguments)}submit(){var t,e=this;return(t=function*(){if(travel.isFirstScreenAvailForm&&travel.events.mobileFormInit.send("check-avail-form"),e.validate())try{e._saveToStorage(),yield c(e.view.getForm()),e.view.getForm().submit()}catch(t){console.log(t)}},function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){_(o,n,i,a,s,"next",t)}function s(t){_(o,n,i,a,s,"throw",t)}a(void 0)}))})()}}},63575:function(t,e,r){"use strict";r.d(e,{Z:function(){return b}});var n=r(13444),i=r(76405);function o(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var a=t=>new Intl.DateTimeFormat(travel.options.language,{year:"numeric",month:"short",day:"numeric",weekday:"short"}).format(t);class s extends n.Z{constructor(t){super(),this.container=t instanceof HTMLElement?t:document.querySelector(t),this.validTouch=!1,this._initListeners(),this.childsAgeWrap=this.container.querySelector(".js-age-container")}_initListeners(){var t=this.container.adults,e=this.container.children,r=this.container.cityID;r&&r.addEventListener("change",(t=>i.Z.cityId=parseInt(t.target.value))),t.addEventListener("change",(t=>i.Z.adultsCount=parseInt(t.target.value))),e.addEventListener("change",(t=>{i.Z.childrenCount=parseInt(t.target.value);for(var e=i.Z.children.slice(0,i.Z.childrenCount),r=i.Z.children.length;r<i.Z.childrenCount;r++)e.push({age:""});i.Z.children=e})),this.container.addEventListener("submit",(t=>{t.preventDefault(),this.emit("submit")}))}formUpdate(){var t,e=this;return(t=function*(){var t,r;e.container.adults.value=i.Z.adultsCount,e.container.children.value=i.Z.childrenCount,e.container.cityID&&(e.container.cityID.value=i.Z.cityId),e.container.querySelector(".js-calendar-from-text").textContent=a(i.Z.dateFrom),e.container.querySelector(".js-calendar-to-text").textContent=a(i.Z.dateTo);var n=t=>t.toISOString().split("T")[0];e.container.from.value=yield n(i.Z.dateFrom),e.container.to.value=yield n(i.Z.dateTo),null===(t=e.calendarFrom)||void 0===t||t.setDate(new Date(i.Z.dateFrom)),null===(r=e.calendarTo)||void 0===r||r.setDate(new Date(i.Z.dateTo));var o=!i.Z.children.length;e.childsAgeWrap.hidden=o;var s=[...e.childsAgeWrap.querySelectorAll("fieldset")];s.splice(i.Z.children.length).forEach((t=>{t.querySelector(".js-child-age-select").removeEventListener("change",e._inputChangeChildAge),t.remove()}));for(var u=s.length;u<i.Z.children.length;u++){var c=l("childAge".concat(u+1),i.Z.children[u].age),h=c.querySelector(".js-child-age-select");h.addEventListener("change",e._inputChangeChildAge),h.dataset.index=u,e.childsAgeWrap.appendChild(c)}e.container.querySelectorAll(".js-child-age-select").forEach(((t,e)=>t.value=i.Z.children[e].age)),e.validTouch&&e.emit("revalidate")},function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(t){o(a,n,i,s,l,"next",t)}function l(t){o(a,n,i,s,l,"throw",t)}s(void 0)}))})()}updateErrors(t){this.validTouch=!0;var e=[...this.childsAgeWrap.querySelectorAll(".js-child-age")];e.forEach((t=>t.classList.remove("error-age"))),t.children.forEach(((t,r)=>!t&&e[r].classList.add("error-age")));var r=this.container.querySelector(".js-ch-error-one"),n=this.container.querySelector(".js-ch-error-plural");r.classList.add("hidden"),n.classList.add("hidden");var i=t.children.filter((t=>!t)).length;i&&(1===i?r:n).classList.remove("hidden")}_inputChangeChildAge(t){var e=t.target.dataset.index;i.Z.children[e].age=t.target.value,i.Z._emiter.emit("update")}getForm(){return this.container}}function l(t,e){var r=document.querySelector("#child-age-template").content.cloneNode(!0),n=r.querySelector(".js-child-age-select");return n.setAttribute("name",t),n.value=e,r}var u=s,c=r(19755),h=r.n(c),p=r(48680);function f(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function d(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){f(o,n,i,a,s,"next",t)}function s(t){f(o,n,i,a,s,"throw",t)}a(void 0)}))}}function m(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class v extends n.Z{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".js-new-calendar-wrapper",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.calendarContainer=t instanceof HTMLElement?t:document.querySelector(t),!this.calendarContainer)throw new Error("Calendar: Not found element with selector ".concat(t));this.inited=!1,this._updateDates(e.dateFrom,e.dateTo),this.languageCode=this._transformLangCode(e.langCode||travel.options.language),this._options=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){y(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({showCustomHeader:!0,extraClass:"is-main-form-calendar"},e),this.CalendarService=p.Z}init(){var t=this;return d((function*(){t.inited=!0,yield p.Z.initCalendarLanguage(t.languageCode),h()(t.calendarContainer).dateRangePicker({autoClose:!0,language:t.languageCode,startDate:new Date,endDate:!1,stickyMonths:!0,minDays:2,maxDays:30,customArrowPrevSymbol:p.Z.getCustomArrow(!0),customArrowNextSymbol:p.Z.getCustomArrow(!1),customHeader:t._options.showCustomHeader?p.Z.getCustomHeader():null,customFooter:p.Z.getCustomFooter(),extraClass:t._options.extraClass,inline:!0,alwaysOpen:!1,container:t.calendarContainer,singleMonth:travel.isMobile(),hoveringTooltip:!1,startOfWeek:t._getStartDayOfWeek(),customOpenAnimation(t){h()(this).show(0,t)},customCloseAnimation(t){h()(this).hide(0,t)}}).on("datepicker-change",t._onDatePickerChange.bind(t)).on("datepicker-start-hovering",t._onDatePickerStartHovering.bind(t)).on("datepicker-close",t._onDatePickerClose.bind(t)),h()(t.calendarContainer).eq(0).data("dateRangePicker").setDateRange(t.dateFrom,t.dateTo,!1),t.calendarFooter=new g(h()(t.calendarContainer).find(".js-custom-footer")),t.calendarFooter.update(t.dateFrom,t.dateTo)}))()}_onDatePickerChange(t,e){this._updateDates(e.date1,e.date2),this.calendarFooter.update(e.date1,e.date2),this.emit("change",e)}_onDatePickerStartHovering(t,e){var{selectedBefore:r,hoverDate:n,selectedDate:i}=e,o={from:new Date(r?n:i),to:new Date(r?i:n)};this.calendarFooter.update(o.from,o.to),this.emit("change",{date1:o.from,date2:o.to}),this.hoveringDates(r)}hoveringDates(t){h()(".js-day:not(.checked)",this.calendarContainer).removeClass("first-date-selected").removeClass("last-date-selected"),h()(".js-day-wrapper:not(.is-checked)",this.calendarContainer).removeClass("is-first-date-selected").removeClass("is-last-date-selected"),t?(h()(".js-day.first-date-selected.checked",this.calendarContainer).removeClass("first-date-selected").addClass("last-date-selected"),h()(".js-day-wrapper.is-first-date-selected.is-checked",this.calendarContainer).removeClass("is-first-date-selected").addClass("is-last-date-selected"),h()(".js-day.hovering:not(.nextMonth)",this.calendarContainer).first().addClass("first-date-selected").closest(".js-day-wrapper").addClass("is-first-date-selected")):(h()(".js-day.last-date-selected.checked",this.calendarContainer).removeClass("last-date-selected").addClass("first-date-selected"),h()(".js-day-wrapper.is-last-date-selected.is-checked",this.calendarContainer).removeClass("is-last-date-selected").addClass("is-first-date-selected"),h()(".js-day.hovering:not(.lastMonth)",this.calendarContainer).last().addClass("last-date-selected").closest(".js-day-wrapper").addClass("is-last-date-selected"))}_onDatePickerClose(t,e){var r=this;return d((function*(){r.emit("close");var t=h()(r.calendarContainer).val().split(" to "),[e,n]=yield Promise.all(t.map(function(){var t=d((function*(t){return new Date(yield p.Z.getDateInFormat(t,"YYYY-MM-DD",!0))}));return function(e){return t.apply(this,arguments)}}()));r.emit("change",{date1:e,date2:n}),r._updateDates(e,n),r.calendarFooter.update(e,n)}))()}_updateDates(t,e){this.dateFrom=t,this.dateTo=e}_transformLangCode(t){return"ar"===t?"ar2":t}_getStartDayOfWeek(){return["ar","ar2","zh","pt","he"].includes(this.languageCode)?"sunday":"monday"}open(){h()(this.calendarContainer).data("dateRangePicker").open()}close(){var t;null===(t=h()(this.calendarContainer).data("dateRangePicker"))||void 0===t||t.close()}}class g{constructor(t){this.vocabs={pluralNight1:h()(".js-plural-night-1").html(),pluralNight2:h()(".js-plural-night-2").html(),pluralNight5:h()(".js-plural-night-5").html()},this.container=h()(t),this.phraseNights=h()("<div>").addClass("calendar-hover-nights"),this.rangeDiv=h()("<div>").addClass("calendar-hover-range"),this.container.empty().append(this.rangeDiv).append(this.phraseNights)}update(t,e){var r=this;return d((function*(){var n="",i="";switch(travel.options.language){case"ja":n=yield p.Z.getDateInFormat(t,"MMM DD日 (ddd)",!0),i=yield p.Z.getDateInFormat(e,"MMM DD日 (ddd)",!0);break;case"zh":n=yield p.Z.getDateInFormat(t,"MMM DD日 ddd",!0),i=yield p.Z.getDateInFormat(e,"MMM DD日 ddd",!0);break;case"ko":n=yield p.Z.getDateInFormat(t,"ddd DD일 MMM",!0),i=yield p.Z.getDateInFormat(e,"ddd DD일 MMM",!0);break;default:n=yield p.Z.getDateInFormat(t,"ddd DD MMM",!0),i=yield p.Z.getDateInFormat(e,"ddd DD MMM",!0)}r.rangeDiv.html("".concat(n,"-").concat(i)),r.phraseNights.find(".js-plural-night-phrase").empty();var o=p.Z.calculateNightCount(t,e);1===o?r.phraseNights.append(r.vocabs.pluralNight1):o>1&&o<5?r.phraseNights.append(r.vocabs.pluralNight2):r.phraseNights.append(r.vocabs.pluralNight5);var a=yield p.Z.getLocaleFormatNumbers(o);r.phraseNights.find(".js-night-count").html(a)}))()}}function _(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){_(o,n,i,a,s,"next",t)}function s(t){_(o,n,i,a,s,"throw",t)}a(void 0)}))}}var b=class extends u{constructor(t){var e;super(t),e=this;var r=this.container.querySelector(".js-new-calendar-wrapper"),n=function(){var t=x((function*(){yield e.initCalendar(),e.calendar.open()}));return function(){return t.apply(this,arguments)}}();this._createCalendar(),travel.isMobile()?n():r.addEventListener("click",n,{once:!0}),this.formUpdate(),i.Z.on("update",this.formUpdate.bind(this))}_createCalendar(){var t=this.container.querySelector(".js-new-calendar-from-input"),e=this.container.querySelector(".js-new-calendar-to-input"),r={dateFrom:new Date(t.value),dateTo:new Date(e.value)};i.Z.dateFrom=r.dateFrom,i.Z.dateTo=r.dateTo,this.calendar=new v(this.container.querySelector(".js-new-calendar-wrapper"),r),this.calendar.on("change",(t=>{i.Z.dateFrom=t.date1,i.Z.dateTo=t.date2}))}initCalendar(){var t=this;return x((function*(){t.calendar.inited||(yield t.calendar.init())}))()}formUpdate(){var t=this;return x((function*(){t.container.adults.value=i.Z.adultsCount,t.container.children.value=i.Z.childrenCount;var e=t.calendar.CalendarService.localFormater;t.container.querySelector(".js-new-calendar-from-text").textContent=yield e(i.Z.dateFrom),t.container.querySelector(".js-new-calendar-to-text").textContent=yield e(i.Z.dateTo);var r=function(){var e=x((function*(e){return yield t.calendar.CalendarService.getDateInFormat(e,"YYYY-MM-DD",!0)}));return function(t){return e.apply(this,arguments)}}();t.container.from.value=yield r(i.Z.dateFrom),t.container.to.value=yield r(i.Z.dateTo),t.calendar._updateDates(i.Z.dateFrom,i.Z.dateTo);var n=!i.Z.children.length;t.childsAgeWrap.hidden=n;var o=[...t.childsAgeWrap.querySelectorAll("fieldset")];o.splice(i.Z.children.length).forEach((e=>{e.querySelector(".js-child-age-select").removeEventListener("change",t._inputChangeChildAge),e.remove()}));for(var a=o.length;a<i.Z.children.length;a++){var s=l("childAge".concat(a+1),i.Z.children[a].age),u=s.querySelector(".js-child-age-select");u.addEventListener("change",t._inputChangeChildAge),u.dataset.index=a,t.childsAgeWrap.appendChild(s)}t.container.querySelectorAll(".js-child-age-select").forEach(((t,e)=>t.value=i.Z.children[e].age)),t.validTouch&&t.emit("revalidate")}))()}updateErrors(t){this.validTouch=!0;var e=[...this.childsAgeWrap.querySelectorAll(".js-child-age")];e.forEach((t=>t.classList.remove("error-age"))),t.children.forEach(((t,r)=>!t&&e[r].classList.add("error-age")));var r=this.container.querySelector(".js-ch-error-one"),n=this.container.querySelector(".js-ch-error-plural");r.classList.add("hidden"),n.classList.add("hidden");var i=t.children.filter((t=>!t)).length;i&&(1===i?r:n).classList.remove("hidden")}}},29946:function(t,e,r){"use strict";r.r(e),r.d(e,{availPopup:function(){return s}});var n=r(9139),i=r(63575),o=r(69704);class a{constructor(t){this._modal=new n.default(t,{selectors:{close:".js-avail-popup-close-btn",content:".js-popup-content"}});var e=new i.Z(this._modal.target.querySelector(".js-avail-form"));this.availForm=new o.Z(e),this._modal.on("hide",(()=>{this.availForm.view.calendar.close(),travel.isFirstScreenAvailForm&&travel.events.mobileFormInit.send("close-form")}))}closePopup(){this._modal.hide()}openPopup(){this._modal.show()}}var s=new a(".js-avail-popup");e.default=a},2804:function(t,e,r){function n(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,l,"next",t)}function l(t){n(a,i,o,s,l,"throw",t)}s(void 0)}))}}var o=null;[...document.querySelectorAll(".js-hotel-rating-button")].forEach((t=>t.addEventListener("click",i((function*(){if(!o){var{default:t}=yield r.e(1265).then(r.bind(r,61265));o=new t(".js-popup-reviews")}o.open()})))))},32699:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return _}});var n=r(13444);class i extends n.Z{constructor(){super(),this.hash=window.location.hash,window.addEventListener("hashchange",(()=>{this.hash=window.location.hash,this.emit("changeHash",this.hash)}))}setHash(t){this.hash=t,history.replaceState("","",t),window.dispatchEvent(new HashChangeEvent("hashchange")),this.emit("changeHash",this.hash)}}var o=new i;class a{constructor(t){this._anchors=[...document.querySelectorAll(t)],this._preventStandartHashChange(),this.store=o,this._updateTabBasedOnHash(),this.initListeners()}initListeners(){this.store.on("changeHash",this._updateTabBasedOnHash.bind(this))}_updateTabBasedOnHash(){var t=this.store.hash||"#main",e=this._anchors.find((e=>e.getAttribute("href")===t));this._anchors.forEach((t=>t.classList.remove("active"))),e&&e.classList.add("active")}_preventStandartHashChange(){this._anchors.forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),this.store.setHash(t.target.getAttribute("href"))}))))}}var s=r(19755),l=r.n(s);var u=class extends a{constructor(t,e){super("".concat(t," a"),e),this._container=document.querySelector(t),this._content=this._container.querySelector(".js-hotel-menu"),this.initToggleButton()}initToggleButton(){var t=this._container.querySelector(".js-mobile-menu-trigger");t||console.warn("Cannot find trigger for mobile menu"),t.addEventListener("click",(()=>l()(this._content).slideToggle("slow")))}_updateTabBasedOnHash(){super._updateTabBasedOnHash();var t=this._anchors.find((t=>t.matches(".active")));t&&(document.querySelector(".js-text-menu").textContent=t.textContent,l()(this._content).hide())}},c=r(7663);var h=r(71658);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class d extends n.Z{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.element=(0,h.sf)(t),this._options=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({top:0,toggleClass:"is-fixed",callOnInit:!1},e),this._options.callOnInit&&this._scrollListener(),window.addEventListener("scroll",this._scrollListener.bind(this),{passive:!0})}_scrollListener(){this._getFixed()?this._setSticky():this._unsetSticky()}_setSticky(){this.element.classList.add(this._options.toggleClass),this.emit("set-sticky")}_unsetSticky(){this.element.classList.remove(this._options.toggleClass),this.emit("unset-sticky")}_getFixed(){return document.documentElement.scrollTop>this._options.top}}var m=new class{constructor(t){this._pages=[...document.querySelectorAll(t)],this.store=o,this.current=this._pages[0],this.needInitScroll=!!this.store.hash,this.open(this._normalizeHash(this.store.hash)||"#main"),this.store.on("changeHash",(t=>this.open(this._normalizeHash(t)))),this.store.on("changeHash",(()=>(0,c.Z)(this.current,{top:100}))),this.needInitScroll&&(0,c.Z)(this.current,{top:100})}_normalizeHash(t){return t.replace("write-review","reviews")}open(t){var e=this._pages.find((e=>"#".concat(e.id)===t));e&&(this._pages.forEach((t=>{t!==e&&t.classList.remove("active")})),e.classList.add("active"),this.current=e)}}(".js-page"),y=new a(".js-main-desktop-menu .js-hotel-menu a"),v=new a(".js-fixed-menu .js-hotel-menu a"),g=new u(".mobile-menu"),_={desktopMenu:y,fixedMenu:v,sticky:new d(travel.isMobile()?".js-fixed-menu-mob":".js-fixed-menu",{top:150}),mobileMenu:g,pages:m,Menu:a,store:o}},48680:function(t,e,r){"use strict";r.d(e,{Z:function(){return d}});var n=r(30381),i=r.n(n),o=r(19755),a=r.n(o);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){c(o,n,i,a,s,"next",t)}function s(t){c(o,n,i,a,s,"throw",t)}a(void 0)}))}}var p={en:"en-gb",zh:"zh-cn",no:"nn"},f=function(){var t=h((function*(){var t=p[travel.options.language]||travel.options.language;yield r(36382)("./".concat(t)),i().locale(t)}));return function(){return t.apply(this,arguments)}}();class d{static getLocaleFormatNumbers(t){return h((function*(){return yield f(),i().localeData().postformat(String(t))}))()}static getCustomHeader(){var t;return'<div class="custom-header__text">'.concat(null===(t=travel.options.alertMessages)||void 0===t?void 0:t.messageCalendar,"</div>")}static getCustomFooter(){return'<div class="custom-footer__content"></div>'}static getCustomArrow(t){return'\n\t\t\t<svg width="14" height="7" class="calendar-arrow calendar-arrow--'.concat(t?"left":"rigth",' icon icon-new-arrow">\n\t\t\t\t<use xlink:href="/new/designs/99/build/hotel-sprite-1.svg#icon-arrow"></use>\n\t\t\t</svg>\n\t\t')}static calculateNightCount(t,e){return Math.abs(i()(t).diff(i()(e),"d"))}static getDateInFormat(t,e){var r=arguments;return h((function*(){var n=r.length>2&&void 0!==r[2]&&r[2];return yield f(),n?i().localeData().preparse(i()(t).format(e)):i()(t).format(e)}))()}static localFormater(t){return h((function*(){yield f();var e=travel.options.languageId,r=p[travel.options.language]||travel.options.language,n=t.getDate(),o=t.getMonth(),a=t.getFullYear(),s={16:"日",17:"白",24:"일"},l={16:"年",17:"年",24:"년"},u="";return"ja"===r||"zh-cn"===r||"zh"===r?u+=a+l[e]+" ":(u+=n,"ko"===r?u+=s[e]:"cs"===r&&(u+=".")),u+="zh-cn"===r||"zh"===r?" "+i().localeData(r).months()[o]+" ":" "+i().localeData(r).monthsShort()[o]+" ","ja"===r||"zh-cn"===r||"zh"===r?u+=n+s[e]:(u+=a,"ko"===r&&(u+=l[e])),u}))()}static incrementDay(t,e){return i()(t).add(e,"days")}static initCalendarLanguage(t){return h((function*(){yield r.e(6836).then(r.t.bind(r,56836,23)),yield f();var e=i().localeData(t),n=e.weekdaysMin();a().dateRangePickerLanguages.default=l(l({},a().dateRangePickerLanguages.default),{},{"month-name":e.months(),"day-name":e.weekdays(),"day-names-short":n,"week-1":n[1],"week-2":n[2],"week-3":n[3],"week-4":n[4],"week-5":n[5],"week-6":n[6],"week-7":n[0]}),a().dateRangePickerLanguages.zh=a().dateRangePickerLanguages.cn}))()}}},76405:function(t,e,r){"use strict";var n=r(13444),i=r(68457);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var l=new n.Z,u=document.cookie.split(";").find((t=>t.includes("store"))),c=u?u.split("store=")[1]:null,h=c?JSON.parse(c):{},p=travel.options?(0,i.M)(travel.options):(0,i.Y)(travel.opts);h.dateFrom&&h.dateTo&&(h.dateFrom=new Date(h.dateFrom),h.dateTo=new Date(h.dateTo));var f=a(a(a({},h),p),{},{cityId:"",_emiter:l,on:function(){return l.on(...arguments)},off:function(){return l.off(...arguments)}});e.Z=new Proxy(f,{set:function(t,e,r){return t[e]=r,t._emiter.emit("update"),!0}})},74403:function(t,e,r){"use strict";r.d(e,{Z:function(){return L}});var n=r(38601),i=r(8378);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){u(t,e),e.add(t)}function u(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,f(t,e,"get"))}function h(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function p(t,e,r){return function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,f(t,e,"set"),r),r}function f(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var d={linear:!1,log:!1,done:!1},m={name:null,done:!1,once:!1},y="Error in EventSender. Failed to create EventSender. Property 'category' is required.",v="Error in EventSender. Failed to create EventSender. Property 'events' is required in 'linear' mode.",g="Error in EventSender. Failed to parse config from cookies.",_="EventSender. Can't send event, event is not found.",x="EventSender. Can't send event, event with property 'once' was already sent.",b="EventSender. Can't send event, previous events were not sent in linear mode.",w="EventSender. Event has been sent.",S="EventSender. Event name in checkEventDone not found",E="EventSender. Argument for check should be 'all' or 'any'.",T=new WeakMap,k=new WeakSet,C=new WeakSet,I=new WeakSet,P=new WeakSet,A=new WeakSet,D=new WeakSet,M=new WeakSet,z=new WeakSet,O=new WeakSet;class L{constructor(t){var e,r,n;if(l(this,O),l(this,z),l(this,M),l(this,D),l(this,A),l(this,P),l(this,I),l(this,C),l(this,k),n={writable:!0,value:void 0},u(e=this,r=T),r.set(e,n),p(this,T,h(this,k,j).call(this,t.category)),!c(this,T)||!h(this,I,B).call(this,c(this,T))){if(p(this,T,a(a({},d),t)),c(this,T).events=h(this,A,N).call(this,c(this,T).events),!h(this,I,B).call(this,c(this,T)))return;h(this,C,R).call(this,c(this,T))}}send(t){if(h(this,I,B).call(this,c(this,T))){var e=h(this,D,U).call(this,t);e?e.once&&e.done?h(this,z,V).call(this,"".concat(x," Event name - '").concat(e.name)):!c(this,T).linear||h(this,M,q).call(this,e)?(h(this,O,Z).call(this,e.name),h(this,z,V).call(this,"".concat(w," Event - '").concat(e.name,"'")),h(this,P,F).call(this,e.name),h(this,C,R).call(this,c(this,T))):h(this,z,V).call(this,"".concat(b," Event name - '").concat(e.name)):h(this,z,V).call(this,"".concat(_," Event name - '").concat(t,"'"))}}checkDone(){return c(this,T).done}setDone(){c(this,T).done=!0}checkEventDone(t){var e=h(this,D,U).call(this,t);if(!e)throw new Error(S+"Event name - ".concat(t));return e.done}checkEventsDone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";if("all"===t)return c(this,T).events.every((t=>t.done));if("any"===t)return c(this,T).events.some((t=>t.done));throw new Error(E+"Event type - ".concat(t))}}function j(t){try{return!!(0,n.ej)("".concat(t,"-event"))&&JSON.parse((0,n.ej)("".concat(t,"-event")))}catch(t){throw new Error(g)}}function R(t){(0,n.d8)("".concat(t.category,"-event"),JSON.stringify(t))}function B(t){try{var e;if(null==t||!t.category)throw new Error(y);if(null!=t&&t.linear&&(null==t||null===(e=t.events)||void 0===e||!e.length))throw new Error(v)}catch(t){return h(this,z,V).call(this,t.message),!1}return!0}function F(t){h(this,D,U).call(this,t).done=!0}function N(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.map((t=>("string"==typeof t&&(t={name:t}),"object"!=typeof t?{}:a(a({},m),t))))}function U(t){return c(this,T).events.find((e=>e.name===t))}function q(t){var e=c(this,T).events;return e.slice(0,e.indexOf(t)).every((t=>t.done))}function V(t){c(this,T).log&&console.warn(t)}function Z(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=r||"".concat(travel.options.siteId,"||").concat(travel.options.objectId,"||").concat(window.location.origin,"||").concat((null===(e=travel.options.btest)||void 0===e?void 0:e.id)||!1);(0,i.sendClickStats)({category:c(this,T).category,action:t,id:travel.options.logId,h:travel.options.hotelExtId,labelData:n})}},36859:function(t,e,r){"use strict";var n,i;function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{Z:function(){return u}});var l=a(a({},null===(n=travel.options.endpointHotelAttractions)||void 0===n?void 0:n.data),null===(i=travel.options.endpointHotelRestaurants)||void 0===i?void 0:i.data);class u{constructor(t){var e;this.attraction=t,this.description=this._getDescription(),this.address=this._getAddress(),this.tags=this._getTags(),this.photo=this._getPhoto(),this.id=t.ID,this.distance=null===(e=l[this.attraction.ID])||void 0===e?void 0:e.minutes,this.title=t.Name||t.NameEng,this.reviewsCount=this._getReviewsCount(),this.coords=[t.GeoLong,t.GeoLat]}_getDescription(){var{CategoryDesc:t,Desc:e}=this.attraction;return(t||e||"").split("|")[0]}_getAddress(){var{Address:t,AddressEng:e}=this.attraction;return t||e||travel.options.city}_getTags(){var t=this.attraction.TagNames;return t?t.split("|").filter((t=>t.trim())).filter((t=>t.length>=2)):[]}_getPhoto(){var{PhotoUrl:t,GeoLat:e,GeoLong:r}=this.attraction;return t&&"NULL"!==t&&!t.toLocaleLowerCase().includes("ta_brand_logo")?t:e&&r?"/maps-data/styles/osm-bright/static/".concat(r,",").concat(e,",17/350x200.jpg"):""}_getReviewsCount(){var{ReviewsCount:t}=this.attraction;return t?parseInt(t):0}}},15963:function(t,e,r){"use strict";r.d(e,{Z:function(){return c}});var n,i,o=r(36859);function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=s(s({},null===(n=travel.options.endpointHotelAttractions)||void 0===n?void 0:n.data),null===(i=travel.options.endpointHotelRestaurants)||void 0===i?void 0:i.data);class c extends o.Z{constructor(t){var e;super(t),this.photoIsValid=this._getPhotoStatus(),this.distance=u[this.attraction.ID].distance,this.minutes=null===(e=u[this.attraction.ID])||void 0===e?void 0:e.minutes}_getPhotoStatus(){var{PhotoUrl:t}=this.attraction;return t&&"NULL"!==t&&!t.toLocaleLowerCase().includes("ta_brand_logo")}}},8378:function(t,e,r){"use strict";r.r(e),r.d(e,{sendClickStats:function(){return i}});var n=r(85362),i=t=>{var{id:e,h:r,category:i,action:o,labelData:a}=t,s="".concat(window.location.protocol,"//").concat(window.location.host,"/"),l={page:"stat",t:"ev",id:e,h:r,c:i,a:o,l:a,r:Math.floor(1e5*Math.random())};return fetch(s,{method:"POST",body:(0,n.Z)(l)})}},31351:function(t,e,r){"use strict";r.d(e,{Z:function(){return o}});var n=r(98480);function i(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}class o{constructor(){}static getMapData(t){return(e=function*(){var e=(0,n.Z)(t);try{var r=yield fetch("".concat("/geo-data/landmarks/","?").concat(e));if(!r.ok)throw new Error("Failed to get map data. Status: ".concat(r.status,". Response status text: ").concat(r.statusText));return{success:!0,data:yield r.json()}}catch(t){return travel.log(t),{success:!1}}},function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(t){i(a,n,o,s,l,"next",t)}function l(t){i(a,n,o,s,l,"throw",t)}s(void 0)}))})();var e}}},68457:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{M:function(){return o},Y:function(){return a}});var o=t=>{var e=t.availableParams;e.children=Array.from({length:parseInt(e.guestsChildren)},(()=>({age:""}))),e.children.forEach(((t,r)=>t.age=e["guestsChildAge".concat(r+1)]));var r=t.notAvailHotel?{notAvailHotel:t.notAvailHotel}:{};return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({childrenCount:parseInt(e.guestsChildren)||0,adultsCount:parseInt(e.guestsAdults)||0,children:e.children,dateFrom:new Date(e.dataFrom),dateTo:new Date(e.dataTo)},r)},a=t=>{var e=t.av_params;return e.childrenAge=Array.from({length:parseInt(e.children)},(()=>({age:""}))),e.childrenAge.forEach(((t,r)=>t.age=e["childAge".concat(r+1)])),{childrenCount:parseInt(e.children),adultsCount:parseInt(e.adults),children:e.childrenAge,dateFrom:new Date(e.from),dateTo:new Date(e.to)}}},76233:function(t,e,r){"use strict";r.d(e,{Z:function(){return l}});var n=r(31351),i=r(36859),o=r(15963);function a(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,l,"next",t)}function l(t){a(o,n,i,s,l,"throw",t)}s(void 0)}))}}class l{constructor(t){var e;if("object"==typeof l.instance)return l.instance;this.features=[],this.attractionsData=travel.options.endpointHotelAttractions,this.attractionsIds=t||((null===(e=this.attractionsData)||void 0===e?void 0:e.ids)||[]),this.requestData={page:"landmarkinfo",method:"get",lang_id:travel.options.languageId,top:travel.options.siteNetworkId,ids:this.attractionsIds.join(",")},l.instance=this}getFeatures(){var t=this;return s((function*(){if(t.features.length)return t.features;try{var e=yield n.Z.getMapData(t.requestData);t.features=e.data.features}catch(e){travel.log(e),t.features=[]}return t.features}))()}getAttractions(){var t=this;return s((function*(){if(t.attractions)return t.attractions;var e=(yield t.getFeatures()).map((t=>new i.Z(t.properties))),r=t.filterAttraction(e);return r.sort(((t,e)=>e.reviewsCount-t.reviewsCount)),t.attractions=r,r}))()}getCoordinates(){var t=this;return s((function*(){return(yield t.getAttractions()).map((t=>t.coords))}))()}filterAttraction(t){return t.filter((t=>t.photo&&t.address)).filter((t=>t.description||t.tags.length||t.reviewsCount>30))}getHighlightAttractions(){var t=this;return s((function*(){if(t.highlightAttractions)return t.highlightAttractions;var e=(yield t.getFeatures()).map((t=>new o.Z(t.properties))),r=t.filterAttraction(e);return r.sort(((t,e)=>e.reviewsCount-t.reviewsCount)),t.highlightAttractions=r,r}))()}}},9139:function(t,e,r){"use strict";r.d(e,{default:function(){return a}});var n=r(4058);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class a extends n.ZP{constructor(t){var{trigger:e="",toggleClass:r,selectors:n,hideOnBackdrop:a=!0,lockScroll:s=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,{target:t,toggleClass:r}),this.selectors=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({close:".js-popup-close",content:".js-popup-content"},n),this.callbacks={show:()=>this.show(),hide:()=>this.hide(),clickBackdropHandler:t=>this._clickBackdropHandler(t)},this.lockScroll=s,this.initCloseBtn(),a&&this.initHideOnClickOutSide()}initCloseBtn(){this._closeTriggers=[...this.target.querySelectorAll(this.selectors.close)],this._closeTriggers.forEach((t=>t.addEventListener("click",this.callbacks.hide)))}initHideOnClickOutSide(){this.target.addEventListener("click",this.callbacks.clickBackdropHandler)}_clickBackdropHandler(t){t.target.matches(this.selectors.content)||t.target.closest(this.selectors.content)||this.hide()}show(){this.lockScroll&&(document.body.style.overflow="hidden"),super.show()}hide(){this.lockScroll&&(document.body.style.overflow="auto"),super.hide()}destroy(){super.destroy(),this._closeTriggers.forEach((t=>t.removeEventListener("click",this.callbacks.hide))),this.target.removeEventListener("click",this.callbacks.clickBackdropHandler)}}},7663:function(t,e,r){"use strict";var n=r(71658);e.Z=function(t){var{top:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.sf)(t),i=e||0,o=document.body.getBoundingClientRect().top,a=r.getBoundingClientRect().top,s=a-o,l=s-i;window.scrollTo({top:l,behavior:"smooth"})}},4058:function(t,e,r){"use strict";var n=r(13444),i=r(71658);class o extends n.Z{constructor(t){var e,r,n,{target:o,toggleClass:a="active"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.toggleClass=a,t&&(this.trigger=(0,i.sf)(t));var s=(0,i.sf)(o);if(this.target=s||document.querySelector(null===(e=this.trigger)||void 0===e?void 0:e.dataset.target),!this.target)throw new Error("Error in Toggle. Cannot find target with selector ".concat(o," or data-attribute ").concat(null===(r=this.trigger)||void 0===r?void 0:r.dataset.target));this._clickListener=t=>{t.currentTarget.blur(),this.toggle()},null===(n=this.trigger)||void 0===n||n.addEventListener("click",this._clickListener)}get active(){return this.target.classList.contains(this.toggleClass)}toggle(){this.target.classList.contains(this.toggleClass)?this.hide():this.show()}hide(){var t;this.target.classList.remove(this.toggleClass),null===(t=this.trigger)||void 0===t||t.classList.remove("active"),this.emit("hide")}show(){var t;this.target.classList.add(this.toggleClass),null===(t=this.trigger)||void 0===t||t.classList.add("active"),this.emit("show")}destroy(){var t;null===(t=this.trigger)||void 0===t||t.removeEventListener("click",this._clickListener)}}e.ZP=o},13444:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});class n{constructor(){var t;this.emiter={all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map((function(t){t(r)})),(n=t.get("*"))&&n.slice().map((function(t){t(e,r)}))}}}emit(t,e){this.emiter.emit(t,e)}on(t,e){this.emiter.on(t,e)}off(t,e){this.emiter.off(t,e)}}},85362:function(t,e){"use strict";e.Z=t=>{var e=new FormData;return Object.keys(t).forEach((r=>e.append(r,t[r]))),e}},98480:function(t,e){"use strict";e.Z=t=>{var e=new URLSearchParams;return Object.keys(t).forEach((r=>e.append(r,t[r]))),e.toString()}},38601:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{ej:function(){return a},d8:function(){return s}});var a=t=>{var e=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0},s=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(r=i({path:"/"},r)).expires instanceof Date&&(r.expires=r.expires.toUTCString());var n=encodeURIComponent(t)+"="+encodeURIComponent(e);for(var o in r){n+="; "+o;var a=r[o];!0!==a&&(n+="="+a)}document.cookie=n}},29555:function(t,e,r){"use strict";function n(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,l,"next",t)}function l(t){n(a,i,o,s,l,"throw",t)}s(void 0)}))}}var o=100,a=t=>new Promise((e=>setTimeout(e,t)));function s(t){return l.apply(this,arguments)}function l(){return l=i((function*(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;try{var n=yield t();return n}catch(n){if(yield a(r),0===e)throw new Error(n);return yield s(t,e-1,r)}})),l.apply(this,arguments)}e.Z=(t,e,r)=>i((function*(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return yield s(i((function*(){return yield t(...o)})),e,r)}))},71658:function(t,e,r){"use strict";r.d(e,{sf:function(){return n},Nm:function(){return i}});var n=(t,e)=>{if(t&&(!e||e instanceof HTMLElement))return t instanceof HTMLElement?t:e?e.querySelector(t):document.querySelector(t)},i=(t,e)=>{var r=e&&e instanceof HTMLElement?e:document;return"string"==typeof t?[...r.querySelectorAll(t)]:t}},44108:function(){function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}window.travel=e(e({},window.travel),{},{log(){if("undefined"!=typeof console&&console.log&&travel.options.develop){var t=[].slice.call(arguments,0);console.log.apply(console,t)}},isRTL:[22,25].includes(window.travel.options.languageId),_windowWidth:window.innerWidth,isMobile(){return this._windowWidth<=767},isSmallMobile(){return this._windowWidth<=414},isTablet(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1120;return this._windowWidth<=t},isABTest(t,e){if(""==(t||"")||0==(e||0))return!1;var r=travel.options.btest||!1;return r&&r.step==t&&r.id==e}}),window.addEventListener("resize",(()=>{window.travel._windowWidth=window.innerWidth}))},79866:function(t,e,r){"use strict";var n=r(43060);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s="[type]||[device]||[btest]||[langid]||[city_id]||[hotel_id]||[wsl]||[affid]||[href]",l="[type]||[device]||[btest]||[langid]||[city_id]||[site_id]||[wsl]||[affid]||[href]";e.Z=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hotel",a="hotel"===i?s:l;try{var u,c,h,p,f,d,m,y,v,g;t={type:"clicktrip",device:null===(u=travel.options)||void 0===u?void 0:u.device,btest:null!==(c=travel.options)&&void 0!==c&&c.btest?null===(h=travel.options)||void 0===h?void 0:h.btest.id:!(null===(p=travel.options)||void 0===p||!p.btest),langid:null===(f=travel.options)||void 0===f?void 0:f.languageId,city_id:(null===(d=travel.options)||void 0===d?void 0:d.hotelDestinationId)||null,hotel_id:(null===(m=travel.options)||void 0===m?void 0:m.hotelExtId)||null,site_id:(null===(y=travel.options)||void 0===y?void 0:y.siteId)||null,wsl:null===(v=travel.options)||void 0===v?void 0:v.track,affid:null===(g=travel.options)||void 0===g?void 0:g.nid,href:encodeURIComponent(r)}}catch(t){throw new Error("Fail to create defaultOptions: wrong global object params",t)}var _=o(o({},t),e),x=(0,n.n)(_);if(!x.success)throw new Error("Fail to validate object. Invalid keys: ".concat(x.inValidKeys.join(", ")));return Object.entries(_).forEach((t=>{var[e,r]=t;return a=a.replace("[".concat(e,"]"),r)})),a}},67718:function(t,e,r){"use strict";var n=r(71658);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}e.Z=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,n.sf)(t);if(i){var a=o({root:null,rootMargin:"0px 0px 200px 0px",threshold:0},r),s=(t,r)=>{t.forEach((t=>{t.isIntersecting&&(e(),r.unobserve(t.target))}))},l=new IntersectionObserver(s,a);return l.observe(i),l}}},55803:function(t,e,r){function n(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var i;(i=function*(){if("loading"in HTMLImageElement.prototype)document.querySelectorAll("img.lazy").forEach((t=>{t.src=t.dataset.original}));else{var{default:t}=yield r.e(7090).then(r.t.bind(r,77090,23));t.cfg.lazyClass="lazy",t.cfg.srcAttr="data-src",t.init()}},function(){var t=this,e=arguments;return new Promise((function(r,o){var a=i.apply(t,e);function s(t){n(a,r,o,s,l,"next",t)}function l(t){n(a,r,o,s,l,"throw",t)}s(void 0)}))})()},94402:function(){window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)}},43060:function(t,e,r){"use strict";r.d(e,{n:function(){return n}});var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r={success:!0,inValidKeys:[]};for(var n in t)t[n]===e&&(r.success=!1,r.inValidKeys.push(n));return r}},42152:function(t){var e;e=function(){return function(){var t={686:function(t,e,r){"use strict";r.d(e,{default:function(){return S}});var n=r(279),i=r.n(n),o=r(370),a=r.n(o),s=r(817),l=r.n(s);function u(t){try{return document.execCommand(t)}catch(t){return!1}}var c=function(t){var e=l()(t);return u("cut"),e},h=function(t,e){var r=function(t){var e="rtl"===document.documentElement.getAttribute("dir"),r=document.createElement("textarea");r.style.fontSize="12pt",r.style.border="0",r.style.padding="0",r.style.margin="0",r.style.position="absolute",r.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return r.style.top="".concat(n,"px"),r.setAttribute("readonly",""),r.value=t,r}(t);e.container.appendChild(r);var n=l()(r);return u("copy"),r.remove(),n},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},r="";return"string"==typeof t?r=h(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?r=h(t.value,e):(r=l()(t),u("copy")),r};function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.action,r=void 0===e?"copy":e,n=t.container,i=t.target,o=t.text;if("copy"!==r&&"cut"!==r)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==i){if(!i||"object"!==f(i)||1!==i.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===r&&i.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===r&&(i.hasAttribute("readonly")||i.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return o?p(o,{container:n}):i?"cut"===r?c(i):p(i,{container:n}):void 0};function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=x(t);if(e){var i=x(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _(this,r)}}function _(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function b(t,e){var r="data-clipboard-".concat(t);if(e.hasAttribute(r))return e.getAttribute(r)}var w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(o,t);var e,r,n,i=g(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=i.call(this)).resolveOptions(e),r.listenClick(t),r}return e=o,r=[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===m(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=a()(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,r=this.action(e)||"copy",n=d({action:r,container:this.container,target:this.target(e),text:this.text(e)});this.emit(n?"success":"error",{action:r,text:n,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return b("action",t)}},{key:"defaultTarget",value:function(t){var e=b("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return b("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return p(t,e)}},{key:"cut",value:function(t){return c(t)}},{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,r=!!document.queryCommandSupported;return e.forEach((function(t){r=r&&!!document.queryCommandSupported(t)})),r}}],r&&y(e.prototype,r),n&&y(e,n),o}(i()),S=w},828:function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,r){var n=r(828);function i(t,e,r,n,i){var a=o.apply(this,arguments);return t.addEventListener(r,a,i),{destroy:function(){t.removeEventListener(r,a,i)}}}function o(t,e,r,i){return function(r){r.delegateTarget=n(r.target,e),r.delegateTarget&&i.call(t,r)}}t.exports=function(t,e,r,n,o){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof r?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return i(t,e,r,n,o)})))}},879:function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var r=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===r||"[object HTMLCollection]"===r)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,r){var n=r(879),i=r(438);t.exports=function(t,e,r){if(!t&&!e&&!r)throw new Error("Missing required arguments");if(!n.string(e))throw new TypeError("Second argument must be a String");if(!n.fn(r))throw new TypeError("Third argument must be a Function");if(n.node(t))return function(t,e,r){return t.addEventListener(e,r),{destroy:function(){t.removeEventListener(e,r)}}}(t,e,r);if(n.nodeList(t))return function(t,e,r){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,r)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,r)}))}}}(t,e,r);if(n.string(t))return function(t,e,r){return i(document.body,t,e,r)}(t,e,r);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(t){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var r=t.hasAttribute("readonly");r||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),r||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i),e=n.toString()}return e}},279:function(t){function e(){}e.prototype={on:function(t,e,r){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:r}),this},once:function(t,e,r){var n=this;function i(){n.off(t,i),e.apply(r,arguments)}return i._=e,this.on(t,i,r)},emit:function(t){for(var e=[].slice.call(arguments,1),r=((this.e||(this.e={}))[t]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,e);return this},off:function(t,e){var r=this.e||(this.e={}),n=r[t],i=[];if(n&&e)for(var o=0,a=n.length;o<a;o++)n[o].fn!==e&&n[o].fn._!==e&&i.push(n[o]);return i.length?r[t]=i:delete r[t],this}},t.exports=e,t.exports.TinyEmitter=e}},e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}return r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r(686)}().default},t.exports=e()},19755:function(t,e){var r;!function(e,r){"use strict";"object"==typeof t.exports?t.exports=e.document?r(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return r(t)}:r(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,c=o.indexOf,h={},p=h.toString,f=h.hasOwnProperty,d=f.toString,m=d.call(Object),y={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},g=function(t){return null!=t&&t===t.window},_=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,r){var n,i,o=(r=r||_).createElement("script");if(o.text=t,e)for(n in x)(i=e[n]||e.getAttribute&&e.getAttribute(n))&&o.setAttribute(n,i);r.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[p.call(t)]||"object":typeof t}var S="3.6.0",E=function(t,e){return new E.fn.init(t,e)};function T(t){var e=!!t&&"length"in t&&t.length,r=w(t);return!v(t)&&!g(t)&&("array"===r||0===e||"number"==typeof e&&e>0&&e-1 in t)}E.fn=E.prototype={jquery:S,constructor:E,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=E.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return E.each(this,t)},map:function(t){return this.pushStack(E.map(this,(function(e,r){return t.call(e,r,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(E.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,r=+t+(t<0?e:0);return this.pushStack(r>=0&&r<e?[this[r]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},E.extend=E.fn.extend=function(){var t,e,r,n,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(t=arguments[s]))for(e in t)n=t[e],"__proto__"!==e&&a!==n&&(u&&n&&(E.isPlainObject(n)||(i=Array.isArray(n)))?(r=a[e],o=i&&!Array.isArray(r)?[]:i||E.isPlainObject(r)?r:{},i=!1,a[e]=E.extend(u,o,n)):void 0!==n&&(a[e]=n));return a},E.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,r;return!(!t||"[object Object]"!==p.call(t))&&(!(e=a(t))||"function"==typeof(r=f.call(e,"constructor")&&e.constructor)&&d.call(r)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,r){b(t,{nonce:e&&e.nonce},r)},each:function(t,e){var r,n=0;if(T(t))for(r=t.length;n<r&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},makeArray:function(t,e){var r=e||[];return null!=t&&(T(Object(t))?E.merge(r,"string"==typeof t?[t]:t):u.call(r,t)),r},inArray:function(t,e,r){return null==e?-1:c.call(e,t,r)},merge:function(t,e){for(var r=+e.length,n=0,i=t.length;n<r;n++)t[i++]=e[n];return t.length=i,t},grep:function(t,e,r){for(var n=[],i=0,o=t.length,a=!r;i<o;i++)!e(t[i],i)!==a&&n.push(t[i]);return n},map:function(t,e,r){var n,i,o=0,a=[];if(T(t))for(n=t.length;o<n;o++)null!=(i=e(t[o],o,r))&&a.push(i);else for(o in t)null!=(i=e(t[o],o,r))&&a.push(i);return l(a)},guid:1,support:y}),"function"==typeof Symbol&&(E.fn[Symbol.iterator]=o[Symbol.iterator]),E.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){h["[object "+e+"]"]=e.toLowerCase()}));var k=function(t){var e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v,g,_,x="sizzle"+1*new Date,b=t.document,w=0,S=0,E=lt(),T=lt(),k=lt(),C=lt(),I=function(t,e){return t===e&&(h=!0),0},P={}.hasOwnProperty,A=[],D=A.pop,M=A.push,z=A.push,O=A.slice,L=function(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},j="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",F="\\[[\\x20\\t\\r\\n\\f]*("+B+")(?:"+R+"*([*^$|!~]?=)"+R+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+R+"*\\]",N=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+F+")*)|.*)\\)|)",U=new RegExp(R+"+","g"),q=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),V=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),Z=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(R+"|>"),H=new RegExp(N),Y=new RegExp("^"+B+"$"),G={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),rt=function(t,e){var r="0x"+t.slice(1)-65536;return e||(r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320))},nt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){p()},at=xt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{z.apply(A=O.call(b.childNodes),b.childNodes),A[b.childNodes.length].nodeType}catch(t){z={apply:A.length?function(t,e){M.apply(t,O.call(e))}:function(t,e){for(var r=t.length,n=0;t[r++]=e[n++];);t.length=r-1}}}function st(t,e,n,i){var o,s,u,c,h,d,v,g=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!i&&(p(e),e=e||f,m)){if(11!==b&&(h=Q.exec(t)))if(o=h[1]){if(9===b){if(!(u=e.getElementById(o)))return n;if(u.id===o)return n.push(u),n}else if(g&&(u=g.getElementById(o))&&_(e,u)&&u.id===o)return n.push(u),n}else{if(h[2])return z.apply(n,e.getElementsByTagName(t)),n;if((o=h[3])&&r.getElementsByClassName&&e.getElementsByClassName)return z.apply(n,e.getElementsByClassName(o)),n}if(r.qsa&&!C[t+" "]&&(!y||!y.test(t))&&(1!==b||"object"!==e.nodeName.toLowerCase())){if(v=t,g=e,1===b&&(W.test(t)||Z.test(t))){for((g=tt.test(t)&&vt(e.parentNode)||e)===e&&r.scope||((c=e.getAttribute("id"))?c=c.replace(nt,it):e.setAttribute("id",c=x)),s=(d=a(t)).length;s--;)d[s]=(c?"#"+c:":scope")+" "+_t(d[s]);v=d.join(",")}try{return z.apply(n,g.querySelectorAll(v)),n}catch(e){C(t,!0)}finally{c===x&&e.removeAttribute("id")}}}return l(t.replace(q,"$1"),e,n,i)}function lt(){var t=[];return function e(r,i){return t.push(r+" ")>n.cacheLength&&delete e[t.shift()],e[r+" "]=i}}function ut(t){return t[x]=!0,t}function ct(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var r=t.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=e}function pt(t,e){var r=e&&t,n=r&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function dt(t){return function(e){var r=e.nodeName.toLowerCase();return("input"===r||"button"===r)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function yt(t){return ut((function(e){return e=+e,ut((function(r,n){for(var i,o=t([],r.length,e),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in r=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,r=t&&(t.ownerDocument||t).documentElement;return!X.test(e||r&&r.nodeName||"HTML")},p=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:b;return a!=f&&9===a.nodeType&&a.documentElement?(d=(f=a).documentElement,m=!o(f),b!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),r.scope=ct((function(t){return d.appendChild(t).appendChild(f.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),r.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),r.getElementsByTagName=ct((function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length})),r.getElementsByClassName=$.test(f.getElementsByClassName),r.getById=ct((function(t){return d.appendChild(t).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),r.getById?(n.filter.ID=function(t){var e=t.replace(et,rt);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var r=e.getElementById(t);return r?[r]:[]}}):(n.filter.ID=function(t){var e=t.replace(et,rt);return function(t){var r=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return r&&r.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var r,n,i,o=e.getElementById(t);if(o){if((r=o.getAttributeNode("id"))&&r.value===t)return[o];for(i=e.getElementsByName(t),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===t)return[o]}return[]}}),n.find.TAG=r.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):r.qsa?e.querySelectorAll(t):void 0}:function(t,e){var r,n=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;r=o[i++];)1===r.nodeType&&n.push(r);return n}return o},n.find.CLASS=r.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],y=[],(r.qsa=$.test(f.querySelectorAll))&&(ct((function(t){var e;d.appendChild(t).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||y.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+j+")"),t.querySelectorAll("[id~="+x+"-]").length||y.push("~="),(e=f.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||y.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||y.push(":checked"),t.querySelectorAll("a#"+x+"+*").length||y.push(".#.+[+~]"),t.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&y.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),d.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),y.push(",.*:")}))),(r.matchesSelector=$.test(g=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ct((function(t){r.disconnectedMatch=g.call(t,"*"),g.call(t,"[s!='']:x"),v.push("!=",N)})),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),e=$.test(d.compareDocumentPosition),_=e||$.test(d.contains)?function(t,e){var r=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},I=e?function(t,e){if(t===e)return h=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!r.sortDetached&&e.compareDocumentPosition(t)===n?t==f||t.ownerDocument==b&&_(b,t)?-1:e==f||e.ownerDocument==b&&_(b,e)?1:c?L(c,t)-L(c,e):0:4&n?-1:1)}:function(t,e){if(t===e)return h=!0,0;var r,n=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==f?-1:e==f?1:i?-1:o?1:c?L(c,t)-L(c,e):0;if(i===o)return pt(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?pt(a[n],s[n]):a[n]==b?-1:s[n]==b?1:0},f):f},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(p(t),r.matchesSelector&&m&&!C[e+" "]&&(!v||!v.test(e))&&(!y||!y.test(e)))try{var n=g.call(t,e);if(n||r.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){C(e,!0)}return st(e,f,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=f&&p(t),_(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=f&&p(t);var i=n.attrHandle[e.toLowerCase()],o=i&&P.call(n.attrHandle,e.toLowerCase())?i(t,e,!m):void 0;return void 0!==o?o:r.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(nt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,n=[],i=0,o=0;if(h=!r.detectDuplicates,c=!r.sortStable&&t.slice(0),t.sort(I),h){for(;e=t[o++];)e===t[o]&&(i=n.push(o));for(;i--;)t.splice(n[i],1)}return c=null,t},i=st.getText=function(t){var e,r="",n=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)r+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[n++];)r+=i(e);return r},n=st.selectors={cacheLength:50,createPseudo:ut,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,rt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,rt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,r=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":r&&H.test(r)&&(e=a(r,!0))&&(e=r.indexOf(")",r.length-e)-r.length)&&(t[0]=t[0].slice(0,e),t[2]=r.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,rt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=E[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+R+"|$)"))&&E(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,r){return function(n){var i=st.attr(n,t);return null==i?"!="===e:!e||(i+="","="===e?i===r:"!="===e?i!==r:"^="===e?r&&0===i.indexOf(r):"*="===e?r&&i.indexOf(r)>-1:"$="===e?r&&i.slice(-r.length)===r:"~="===e?(" "+i.replace(U," ")+" ").indexOf(r)>-1:"|="===e&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(t,e,r,n,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===n&&0===i?function(t){return!!t.parentNode}:function(e,r,l){var u,c,h,p,f,d,m=o!==a?"nextSibling":"previousSibling",y=e.parentNode,v=s&&e.nodeName.toLowerCase(),g=!l&&!s,_=!1;if(y){if(o){for(;m;){for(p=e;p=p[m];)if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;d=m="only"===t&&!d&&"nextSibling"}return!0}if(d=[a?y.firstChild:y.lastChild],a&&g){for(_=(f=(u=(c=(h=(p=y)[x]||(p[x]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],p=f&&y.childNodes[f];p=++f&&p&&p[m]||(_=f=0)||d.pop();)if(1===p.nodeType&&++_&&p===e){c[t]=[w,f,_];break}}else if(g&&(_=f=(u=(c=(h=(p=e)[x]||(p[x]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===_)for(;(p=++f&&p&&p[m]||(_=f=0)||d.pop())&&((s?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++_||(g&&((c=(h=p[x]||(p[x]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]=[w,_]),p!==e)););return(_-=i)===n||_%n==0&&_/n>=0}}},PSEUDO:function(t,e){var r,i=n.pseudos[t]||n.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[x]?i(e):i.length>1?(r=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,r){for(var n,o=i(t,e),a=o.length;a--;)t[n=L(t,o[a])]=!(r[n]=o[a])})):function(t){return i(t,0,r)}):i}},pseudos:{not:ut((function(t){var e=[],r=[],n=s(t.replace(q,"$1"));return n[x]?ut((function(t,e,r,i){for(var o,a=n(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,n(e,null,o,r),e[0]=null,!r.pop()}})),has:ut((function(t){return function(e){return st(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,rt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ut((function(t){return Y.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,rt).toLowerCase(),function(e){var r;do{if(r=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(r=r.toLowerCase())===t||0===r.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var r=t.location&&t.location.hash;return r&&r.slice(1)===e.id},root:function(t){return t===d},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:yt((function(){return[0]})),last:yt((function(t,e){return[e-1]})),eq:yt((function(t,e,r){return[r<0?r+e:r]})),even:yt((function(t,e){for(var r=0;r<e;r+=2)t.push(r);return t})),odd:yt((function(t,e){for(var r=1;r<e;r+=2)t.push(r);return t})),lt:yt((function(t,e,r){for(var n=r<0?r+e:r>e?e:r;--n>=0;)t.push(n);return t})),gt:yt((function(t,e,r){for(var n=r<0?r+e:r;++n<e;)t.push(n);return t}))}},n.pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[e]=ft(e);for(e in{submit:!0,reset:!0})n.pseudos[e]=dt(e);function gt(){}function _t(t){for(var e=0,r=t.length,n="";e<r;e++)n+=t[e].value;return n}function xt(t,e,r){var n=e.dir,i=e.next,o=i||n,a=r&&"parentNode"===o,s=S++;return e.first?function(e,r,i){for(;e=e[n];)if(1===e.nodeType||a)return t(e,r,i);return!1}:function(e,r,l){var u,c,h,p=[w,s];if(l){for(;e=e[n];)if((1===e.nodeType||a)&&t(e,r,l))return!0}else for(;e=e[n];)if(1===e.nodeType||a)if(c=(h=e[x]||(e[x]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[n]||e;else{if((u=c[o])&&u[0]===w&&u[1]===s)return p[2]=u[2];if(c[o]=p,p[2]=t(e,r,l))return!0}return!1}}function bt(t){return t.length>1?function(e,r,n){for(var i=t.length;i--;)if(!t[i](e,r,n))return!1;return!0}:t[0]}function wt(t,e,r,n,i){for(var o,a=[],s=0,l=t.length,u=null!=e;s<l;s++)(o=t[s])&&(r&&!r(o,n,i)||(a.push(o),u&&e.push(s)));return a}function St(t,e,r,n,i,o){return n&&!n[x]&&(n=St(n)),i&&!i[x]&&(i=St(i,o)),ut((function(o,a,s,l){var u,c,h,p=[],f=[],d=a.length,m=o||function(t,e,r){for(var n=0,i=e.length;n<i;n++)st(t,e[n],r);return r}(e||"*",s.nodeType?[s]:s,[]),y=!t||!o&&e?m:wt(m,p,t,s,l),v=r?i||(o?t:d||n)?[]:a:y;if(r&&r(y,v,s,l),n)for(u=wt(v,f),n(u,[],s,l),c=u.length;c--;)(h=u[c])&&(v[f[c]]=!(y[f[c]]=h));if(o){if(i||t){if(i){for(u=[],c=v.length;c--;)(h=v[c])&&u.push(y[c]=h);i(null,v=[],u,l)}for(c=v.length;c--;)(h=v[c])&&(u=i?L(o,h):p[c])>-1&&(o[u]=!(a[u]=h))}}else v=wt(v===a?v.splice(d,v.length):v),i?i(null,a,v,l):z.apply(a,v)}))}function Et(t){for(var e,r,i,o=t.length,a=n.relative[t[0].type],s=a||n.relative[" "],l=a?1:0,c=xt((function(t){return t===e}),s,!0),h=xt((function(t){return L(e,t)>-1}),s,!0),p=[function(t,r,n){var i=!a&&(n||r!==u)||((e=r).nodeType?c(t,r,n):h(t,r,n));return e=null,i}];l<o;l++)if(r=n.relative[t[l].type])p=[xt(bt(p),r)];else{if((r=n.filter[t[l].type].apply(null,t[l].matches))[x]){for(i=++l;i<o&&!n.relative[t[i].type];i++);return St(l>1&&bt(p),l>1&&_t(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(q,"$1"),r,l<i&&Et(t.slice(l,i)),i<o&&Et(t=t.slice(i)),i<o&&_t(t))}p.push(r)}return bt(p)}return gt.prototype=n.filters=n.pseudos,n.setFilters=new gt,a=st.tokenize=function(t,e){var r,i,o,a,s,l,u,c=T[t+" "];if(c)return e?0:c.slice(0);for(s=t,l=[],u=n.preFilter;s;){for(a in r&&!(i=V.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=Z.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(q," ")}),s=s.slice(r.length)),n.filter)!(i=G[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return e?s.length:s?st.error(t):T(t,l).slice(0)},s=st.compile=function(t,e){var r,i=[],o=[],s=k[t+" "];if(!s){for(e||(e=a(t)),r=e.length;r--;)(s=Et(e[r]))[x]?i.push(s):o.push(s);s=k(t,function(t,e){var r=e.length>0,i=t.length>0,o=function(o,a,s,l,c){var h,d,y,v=0,g="0",_=o&&[],x=[],b=u,S=o||i&&n.find.TAG("*",c),E=w+=null==b?1:Math.random()||.1,T=S.length;for(c&&(u=a==f||a||c);g!==T&&null!=(h=S[g]);g++){if(i&&h){for(d=0,a||h.ownerDocument==f||(p(h),s=!m);y=t[d++];)if(y(h,a||f,s)){l.push(h);break}c&&(w=E)}r&&((h=!y&&h)&&v--,o&&_.push(h))}if(v+=g,r&&g!==v){for(d=0;y=e[d++];)y(_,x,a,s);if(o){if(v>0)for(;g--;)_[g]||x[g]||(x[g]=D.call(l));x=wt(x)}z.apply(l,x),c&&!o&&x.length>0&&v+e.length>1&&st.uniqueSort(l)}return c&&(w=E,u=b),_};return r?ut(o):o}(o,i)),s.selector=t}return s},l=st.select=function(t,e,r,i){var o,l,u,c,h,p="function"==typeof t&&t,f=!i&&a(t=p.selector||t);if(r=r||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&m&&n.relative[l[1].type]){if(!(e=(n.find.ID(u.matches[0].replace(et,rt),e)||[])[0]))return r;p&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=G.needsContext.test(t)?0:l.length;o--&&(u=l[o],!n.relative[c=u.type]);)if((h=n.find[c])&&(i=h(u.matches[0].replace(et,rt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&_t(l)))return z.apply(r,i),r;break}}return(p||s(t,f))(i,e,!m,r,!e||tt.test(t)&&vt(e.parentNode)||e),r},r.sortStable=x.split("").sort(I).join("")===x,r.detectDuplicates=!!h,p(),r.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))})),ct((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,r){if(!r)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),r.attributes&&ct((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,r){if(!r&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||ht(j,(function(t,e,r){var n;if(!r)return!0===t[e]?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null})),st}(n);E.find=k,E.expr=k.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=k.uniqueSort,E.text=k.getText,E.isXMLDoc=k.isXML,E.contains=k.contains,E.escapeSelector=k.escape;var C=function(t,e,r){for(var n=[],i=void 0!==r;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&E(t).is(r))break;n.push(t)}return n},I=function(t,e){for(var r=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&r.push(t);return r},P=E.expr.match.needsContext;function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function M(t,e,r){return v(e)?E.grep(t,(function(t,n){return!!e.call(t,n,t)!==r})):e.nodeType?E.grep(t,(function(t){return t===e!==r})):"string"!=typeof e?E.grep(t,(function(t){return c.call(e,t)>-1!==r})):E.filter(e,t,r)}E.filter=function(t,e,r){var n=e[0];return r&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?E.find.matchesSelector(n,t)?[n]:[]:E.find.matches(t,E.grep(e,(function(t){return 1===t.nodeType})))},E.fn.extend({find:function(t){var e,r,n=this.length,i=this;if("string"!=typeof t)return this.pushStack(E(t).filter((function(){for(e=0;e<n;e++)if(E.contains(i[e],this))return!0})));for(r=this.pushStack([]),e=0;e<n;e++)E.find(t,i[e],r);return n>1?E.uniqueSort(r):r},filter:function(t){return this.pushStack(M(this,t||[],!1))},not:function(t){return this.pushStack(M(this,t||[],!0))},is:function(t){return!!M(this,"string"==typeof t&&P.test(t)?E(t):t||[],!1).length}});var z,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(t,e,r){var n,i;if(!t)return this;if(r=r||z,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:O.exec(t))||!n[1]&&e)return!e||e.jquery?(e||r).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof E?e[0]:e,E.merge(this,E.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:_,!0)),D.test(n[1])&&E.isPlainObject(e))for(n in e)v(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(i=_.getElementById(n[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==r.ready?r.ready(t):t(E):E.makeArray(t,this)}).prototype=E.fn,z=E(_);var L=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function R(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}E.fn.extend({has:function(t){var e=E(t,this),r=e.length;return this.filter((function(){for(var t=0;t<r;t++)if(E.contains(this,e[t]))return!0}))},closest:function(t,e){var r,n=0,i=this.length,o=[],a="string"!=typeof t&&E(t);if(!P.test(t))for(;n<i;n++)for(r=this[n];r&&r!==e;r=r.parentNode)if(r.nodeType<11&&(a?a.index(r)>-1:1===r.nodeType&&E.find.matchesSelector(r,t))){o.push(r);break}return this.pushStack(o.length>1?E.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(E(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),E.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return C(t,"parentNode")},parentsUntil:function(t,e,r){return C(t,"parentNode",r)},next:function(t){return R(t,"nextSibling")},prev:function(t){return R(t,"previousSibling")},nextAll:function(t){return C(t,"nextSibling")},prevAll:function(t){return C(t,"previousSibling")},nextUntil:function(t,e,r){return C(t,"nextSibling",r)},prevUntil:function(t,e,r){return C(t,"previousSibling",r)},siblings:function(t){return I((t.parentNode||{}).firstChild,t)},children:function(t){return I(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),E.merge([],t.childNodes))}},(function(t,e){E.fn[t]=function(r,n){var i=E.map(this,e,r);return"Until"!==t.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=E.filter(n,i)),this.length>1&&(j[t]||E.uniqueSort(i),L.test(t)&&i.reverse()),this.pushStack(i)}}));var B=/[^\x20\t\r\n\f]+/g;function F(t){return t}function N(t){throw t}function U(t,e,r,n){var i;try{t&&v(i=t.promise)?i.call(t).done(e).fail(r):t&&v(i=t.then)?i.call(t,e,r):e.apply(void 0,[t].slice(n))}catch(t){r.apply(void 0,[t])}}E.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return E.each(t.match(B)||[],(function(t,r){e[r]=!0})),e}(t):E.extend({},t);var e,r,n,i,o=[],a=[],s=-1,l=function(){for(i=i||t.once,n=e=!0;a.length;s=-1)for(r=a.shift();++s<o.length;)!1===o[s].apply(r[0],r[1])&&t.stopOnFalse&&(s=o.length,r=!1);t.memory||(r=!1),e=!1,i&&(o=r?[]:"")},u={add:function(){return o&&(r&&!e&&(s=o.length-1,a.push(r)),function e(r){E.each(r,(function(r,n){v(n)?t.unique&&u.has(n)||o.push(n):n&&n.length&&"string"!==w(n)&&e(n)}))}(arguments),r&&!e&&l()),this},remove:function(){return E.each(arguments,(function(t,e){for(var r;(r=E.inArray(e,o,r))>-1;)o.splice(r,1),r<=s&&s--})),this},has:function(t){return t?E.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||e||(o=r=""),this},locked:function(){return!!i},fireWith:function(t,r){return i||(r=[t,(r=r||[]).slice?r.slice():r],a.push(r),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},E.extend({Deferred:function(t){var e=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return E.Deferred((function(r){E.each(e,(function(e,n){var i=v(t[n[4]])&&t[n[4]];o[n[1]]((function(){var t=i&&i.apply(this,arguments);t&&v(t.promise)?t.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,l=arguments,u=function(){var n,u;if(!(t<o)){if((n=r.apply(s,l))===e.promise())throw new TypeError("Thenable self-resolution");u=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(u)?i?u.call(n,a(o,e,F,i),a(o,e,N,i)):(o++,u.call(n,a(o,e,F,i),a(o,e,N,i),a(o,e,F,e.notifyWith))):(r!==F&&(s=void 0,l=[n]),(i||e.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(n){E.Deferred.exceptionHook&&E.Deferred.exceptionHook(n,c.stackTrace),t+1>=o&&(r!==N&&(s=void 0,l=[n]),e.rejectWith(s,l))}};t?c():(E.Deferred.getStackHook&&(c.stackTrace=E.Deferred.getStackHook()),n.setTimeout(c))}}return E.Deferred((function(n){e[0][3].add(a(0,n,v(i)?i:F,n.notifyWith)),e[1][3].add(a(0,n,v(t)?t:F)),e[2][3].add(a(0,n,v(r)?r:N))})).promise()},promise:function(t){return null!=t?E.extend(t,i):i}},o={};return E.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,r=e,n=Array(r),i=s.call(arguments),o=E.Deferred(),a=function(t){return function(r){n[t]=this,i[t]=arguments.length>1?s.call(arguments):r,--e||o.resolveWith(n,i)}};if(e<=1&&(U(t,o.done(a(r)).resolve,o.reject,!e),"pending"===o.state()||v(i[r]&&i[r].then)))return o.then();for(;r--;)U(i[r],a(r),o.reject);return o.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&q.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},E.readyException=function(t){n.setTimeout((function(){throw t}))};var V=E.Deferred();function Z(){_.removeEventListener("DOMContentLoaded",Z),n.removeEventListener("load",Z),E.ready()}E.fn.ready=function(t){return V.then(t).catch((function(t){E.readyException(t)})),this},E.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--E.readyWait:E.isReady)||(E.isReady=!0,!0!==t&&--E.readyWait>0||V.resolveWith(_,[E]))}}),E.ready.then=V.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?n.setTimeout(E.ready):(_.addEventListener("DOMContentLoaded",Z),n.addEventListener("load",Z));var W=function(t,e,r,n,i,o,a){var s=0,l=t.length,u=null==r;if("object"===w(r))for(s in i=!0,r)W(t,e,s,r[s],!0,o,a);else if(void 0!==n&&(i=!0,v(n)||(a=!0),u&&(a?(e.call(t,n),e=null):(u=e,e=function(t,e,r){return u.call(E(t),r)})),e))for(;s<l;s++)e(t[s],r,a?n:n.call(t[s],s,e(t[s],r)));return i?t:u?e.call(t):l?e(t[0],r):o},H=/^-ms-/,Y=/-([a-z])/g;function G(t,e){return e.toUpperCase()}function X(t){return t.replace(H,"ms-").replace(Y,G)}var K=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function J(){this.expando=E.expando+J.uid++}J.uid=1,J.prototype={cache:function(t){var e=t[this.expando];return e||(e={},K(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,r){var n,i=this.cache(t);if("string"==typeof e)i[X(e)]=r;else for(n in e)i[X(n)]=e[n];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][X(e)]},access:function(t,e,r){return void 0===e||e&&"string"==typeof e&&void 0===r?this.get(t,e):(this.set(t,e,r),void 0!==r?r:e)},remove:function(t,e){var r,n=t[this.expando];if(void 0!==n){if(void 0!==e){r=(e=Array.isArray(e)?e.map(X):(e=X(e))in n?[e]:e.match(B)||[]).length;for(;r--;)delete n[e[r]]}(void 0===e||E.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!E.isEmptyObject(e)}};var $=new J,Q=new J,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function rt(t,e,r){var n;if(void 0===r&&1===t.nodeType)if(n="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(r=t.getAttribute(n))){try{r=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(r)}catch(t){}Q.set(t,e,r)}else r=void 0;return r}E.extend({hasData:function(t){return Q.hasData(t)||$.hasData(t)},data:function(t,e,r){return Q.access(t,e,r)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,r){return $.access(t,e,r)},_removeData:function(t,e){$.remove(t,e)}}),E.fn.extend({data:function(t,e){var r,n,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(i=Q.get(o),1===o.nodeType&&!$.get(o,"hasDataAttrs"))){for(r=a.length;r--;)a[r]&&0===(n=a[r].name).indexOf("data-")&&(n=X(n.slice(5)),rt(o,n,i[n]));$.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each((function(){Q.set(this,t)})):W(this,(function(e){var r;if(o&&void 0===e)return void 0!==(r=Q.get(o,t))||void 0!==(r=rt(o,t))?r:void 0;this.each((function(){Q.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),E.extend({queue:function(t,e,r){var n;if(t)return e=(e||"fx")+"queue",n=$.get(t,e),r&&(!n||Array.isArray(r)?n=$.access(t,e,E.makeArray(r)):n.push(r)),n||[]},dequeue:function(t,e){e=e||"fx";var r=E.queue(t,e),n=r.length,i=r.shift(),o=E._queueHooks(t,e);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===e&&r.unshift("inprogress"),delete o.stop,i.call(t,(function(){E.dequeue(t,e)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var r=e+"queueHooks";return $.get(t,r)||$.access(t,r,{empty:E.Callbacks("once memory").add((function(){$.remove(t,[e+"queue",r])}))})}}),E.fn.extend({queue:function(t,e){var r=2;return"string"!=typeof t&&(e=t,t="fx",r--),arguments.length<r?E.queue(this[0],t):void 0===e?this:this.each((function(){var r=E.queue(this,t,e);E._queueHooks(this,t),"fx"===t&&"inprogress"!==r[0]&&E.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){E.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var r,n=1,i=E.Deferred(),o=this,a=this.length,s=function(){--n||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(r=$.get(o[a],t+"queueHooks"))&&r.empty&&(n++,r.empty.add(s));return s(),i.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,it=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),ot=["Top","Right","Bottom","Left"],at=_.documentElement,st=function(t){return E.contains(t.ownerDocument,t)},lt={composed:!0};at.getRootNode&&(st=function(t){return E.contains(t.ownerDocument,t)||t.getRootNode(lt)===t.ownerDocument});var ut=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&st(t)&&"none"===E.css(t,"display")};function ct(t,e,r,n){var i,o,a=20,s=n?function(){return n.cur()}:function(){return E.css(t,e,"")},l=s(),u=r&&r[3]||(E.cssNumber[e]?"":"px"),c=t.nodeType&&(E.cssNumber[e]||"px"!==u&&+l)&&it.exec(E.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)E.style(t,e,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,E.style(t,e,c+u),r=r||[]}return r&&(c=+c||+l||0,i=r[1]?c+(r[1]+1)*r[2]:+r[2],n&&(n.unit=u,n.start=c,n.end=i)),i}var ht={};function pt(t){var e,r=t.ownerDocument,n=t.nodeName,i=ht[n];return i||(e=r.body.appendChild(r.createElement(n)),i=E.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),ht[n]=i,i)}function ft(t,e){for(var r,n,i=[],o=0,a=t.length;o<a;o++)(n=t[o]).style&&(r=n.style.display,e?("none"===r&&(i[o]=$.get(n,"display")||null,i[o]||(n.style.display="")),""===n.style.display&&ut(n)&&(i[o]=pt(n))):"none"!==r&&(i[o]="none",$.set(n,"display",r)));for(o=0;o<a;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}E.fn.extend({show:function(){return ft(this,!0)},hide:function(){return ft(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){ut(this)?E(this).show():E(this).hide()}))}});var dt,mt,yt=/^(?:checkbox|radio)$/i,vt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i;dt=_.createDocumentFragment().appendChild(_.createElement("div")),(mt=_.createElement("input")).setAttribute("type","radio"),mt.setAttribute("checked","checked"),mt.setAttribute("name","t"),dt.appendChild(mt),y.checkClone=dt.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!dt.cloneNode(!0).lastChild.defaultValue,dt.innerHTML="<option></option>",y.option=!!dt.lastChild;var _t={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function xt(t,e){var r;return r=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?E.merge([t],r):r}function bt(t,e){for(var r=0,n=t.length;r<n;r++)$.set(t[r],"globalEval",!e||$.get(e[r],"globalEval"))}_t.tbody=_t.tfoot=_t.colgroup=_t.caption=_t.thead,_t.th=_t.td,y.option||(_t.optgroup=_t.option=[1,"<select multiple='multiple'>","</select>"]);var wt=/<|&#?\w+;/;function St(t,e,r,n,i){for(var o,a,s,l,u,c,h=e.createDocumentFragment(),p=[],f=0,d=t.length;f<d;f++)if((o=t[f])||0===o)if("object"===w(o))E.merge(p,o.nodeType?[o]:o);else if(wt.test(o)){for(a=a||h.appendChild(e.createElement("div")),s=(vt.exec(o)||["",""])[1].toLowerCase(),l=_t[s]||_t._default,a.innerHTML=l[1]+E.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;E.merge(p,a.childNodes),(a=h.firstChild).textContent=""}else p.push(e.createTextNode(o));for(h.textContent="",f=0;o=p[f++];)if(n&&E.inArray(o,n)>-1)i&&i.push(o);else if(u=st(o),a=xt(h.appendChild(o),"script"),u&&bt(a),r)for(c=0;o=a[c++];)gt.test(o.type||"")&&r.push(o);return h}var Et=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function kt(){return!1}function Ct(t,e){return t===function(){try{return _.activeElement}catch(t){}}()==("focus"===e)}function It(t,e,r,n,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof r&&(n=n||r,r=void 0),e)It(t,s,r,n,e[s],o);return t}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=kt;else if(!i)return t;return 1===o&&(a=i,i=function(t){return E().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=E.guid++)),t.each((function(){E.event.add(this,e,i,n,r)}))}function Pt(t,e,r){r?($.set(t,e,!1),E.event.add(t,e,{namespace:!1,handler:function(t){var n,i,o=$.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(E.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),$.set(this,e,o),n=r(this,e),this[e](),o!==(i=$.get(this,e))||n?$.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else o.length&&($.set(this,e,{value:E.event.trigger(E.extend(o[0],E.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===$.get(t,e)&&E.event.add(t,e,Tt)}E.event={global:{},add:function(t,e,r,n,i){var o,a,s,l,u,c,h,p,f,d,m,y=$.get(t);if(K(t))for(r.handler&&(r=(o=r).handler,i=o.selector),i&&E.find.matchesSelector(at,i),r.guid||(r.guid=E.guid++),(l=y.events)||(l=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return void 0!==E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(B)||[""]).length;u--;)f=m=(s=Et.exec(e[u])||[])[1],d=(s[2]||"").split(".").sort(),f&&(h=E.event.special[f]||{},f=(i?h.delegateType:h.bindType)||f,h=E.event.special[f]||{},c=E.extend({type:f,origType:m,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:d.join(".")},o),(p=l[f])||((p=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,n,d,a)||t.addEventListener&&t.addEventListener(f,a)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=r.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),E.event.global[f]=!0)},remove:function(t,e,r,n,i){var o,a,s,l,u,c,h,p,f,d,m,y=$.hasData(t)&&$.get(t);if(y&&(l=y.events)){for(u=(e=(e||"").match(B)||[""]).length;u--;)if(f=m=(s=Et.exec(e[u])||[])[1],d=(s[2]||"").split(".").sort(),f){for(h=E.event.special[f]||{},p=l[f=(n?h.delegateType:h.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&m!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,h.remove&&h.remove.call(t,c));a&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,d,y.handle)||E.removeEvent(t,f,y.handle),delete l[f])}else for(f in l)E.event.remove(t,f+e[u],r,n,!0);E.isEmptyObject(l)&&$.remove(t,"handle events")}},dispatch:function(t){var e,r,n,i,o,a,s=new Array(arguments.length),l=E.event.fix(t),u=($.get(this,"events")||Object.create(null))[l.type]||[],c=E.event.special[l.type]||{};for(s[0]=l,e=1;e<arguments.length;e++)s[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=E.event.handlers.call(this,l,u),e=0;(i=a[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,r=0;(o=i.handlers[r++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(n=((E.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var r,n,i,o,a,s=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},r=0;r<l;r++)void 0===a[i=(n=e[r]).selector+" "]&&(a[i]=n.needsContext?E(i,this).index(u)>-1:E.find(i,this,null,[u]).length),a[i]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l<e.length&&s.push({elem:u,handlers:e.slice(l)}),s},addProp:function(t,e){Object.defineProperty(E.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[E.expando]?t:new E.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return yt.test(e.type)&&e.click&&A(e,"input")&&Pt(e,"click",Tt),!1},trigger:function(t){var e=this||t;return yt.test(e.type)&&e.click&&A(e,"input")&&Pt(e,"click"),!0},_default:function(t){var e=t.target;return yt.test(e.type)&&e.click&&A(e,"input")&&$.get(e,"click")||A(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},E.removeEvent=function(t,e,r){t.removeEventListener&&t.removeEventListener(e,r)},E.Event=function(t,e){if(!(this instanceof E.Event))return new E.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:kt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&E.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[E.expando]=!0},E.Event.prototype={constructor:E.Event,isDefaultPrevented:kt,isPropagationStopped:kt,isImmediatePropagationStopped:kt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},E.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},E.event.addProp),E.each({focus:"focusin",blur:"focusout"},(function(t,e){E.event.special[t]={setup:function(){return Pt(this,t,Ct),!1},trigger:function(){return Pt(this,t),!0},_default:function(){return!0},delegateType:e}})),E.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){E.event.special[t]={delegateType:e,bindType:e,handle:function(t){var r,n=this,i=t.relatedTarget,o=t.handleObj;return i&&(i===n||E.contains(n,i))||(t.type=o.origType,r=o.handler.apply(this,arguments),t.type=e),r}}})),E.fn.extend({on:function(t,e,r,n){return It(this,t,e,r,n)},one:function(t,e,r,n){return It(this,t,e,r,n,1)},off:function(t,e,r){var n,i;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,E(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(r=e,e=void 0),!1===r&&(r=kt),this.each((function(){E.event.remove(this,t,r,e)}))}});var At=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,Mt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function zt(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&E(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Lt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function jt(t,e){var r,n,i,o,a,s;if(1===e.nodeType){if($.hasData(t)&&(s=$.get(t).events))for(i in $.remove(e,"handle events"),s)for(r=0,n=s[i].length;r<n;r++)E.event.add(e,i,s[i][r]);Q.hasData(t)&&(o=Q.access(t),a=E.extend({},o),Q.set(e,a))}}function Rt(t,e){var r=e.nodeName.toLowerCase();"input"===r&&yt.test(t.type)?e.checked=t.checked:"input"!==r&&"textarea"!==r||(e.defaultValue=t.defaultValue)}function Bt(t,e,r,n){e=l(e);var i,o,a,s,u,c,h=0,p=t.length,f=p-1,d=e[0],m=v(d);if(m||p>1&&"string"==typeof d&&!y.checkClone&&Dt.test(d))return t.each((function(i){var o=t.eq(i);m&&(e[0]=d.call(this,i,o.html())),Bt(o,e,r,n)}));if(p&&(o=(i=St(e,t[0].ownerDocument,!1,t,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(s=(a=E.map(xt(i,"script"),Ot)).length;h<p;h++)u=i,h!==f&&(u=E.clone(u,!0,!0),s&&E.merge(a,xt(u,"script"))),r.call(t[h],u,h);if(s)for(c=a[a.length-1].ownerDocument,E.map(a,Lt),h=0;h<s;h++)u=a[h],gt.test(u.type||"")&&!$.access(u,"globalEval")&&E.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?E._evalUrl&&!u.noModule&&E._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):b(u.textContent.replace(Mt,""),u,c))}return t}function Ft(t,e,r){for(var n,i=e?E.filter(e,t):t,o=0;null!=(n=i[o]);o++)r||1!==n.nodeType||E.cleanData(xt(n)),n.parentNode&&(r&&st(n)&&bt(xt(n,"script")),n.parentNode.removeChild(n));return t}E.extend({htmlPrefilter:function(t){return t},clone:function(t,e,r){var n,i,o,a,s=t.cloneNode(!0),l=st(t);if(!(y.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||E.isXMLDoc(t)))for(a=xt(s),n=0,i=(o=xt(t)).length;n<i;n++)Rt(o[n],a[n]);if(e)if(r)for(o=o||xt(t),a=a||xt(s),n=0,i=o.length;n<i;n++)jt(o[n],a[n]);else jt(t,s);return(a=xt(s,"script")).length>0&&bt(a,!l&&xt(t,"script")),s},cleanData:function(t){for(var e,r,n,i=E.event.special,o=0;void 0!==(r=t[o]);o++)if(K(r)){if(e=r[$.expando]){if(e.events)for(n in e.events)i[n]?E.event.remove(r,n):E.removeEvent(r,n,e.handle);r[$.expando]=void 0}r[Q.expando]&&(r[Q.expando]=void 0)}}}),E.fn.extend({detach:function(t){return Ft(this,t,!0)},remove:function(t){return Ft(this,t)},text:function(t){return W(this,(function(t){return void 0===t?E.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Bt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||zt(this,t).appendChild(t)}))},prepend:function(){return Bt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Bt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Bt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(E.cleanData(xt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return E.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},r=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!_t[(vt.exec(t)||["",""])[1].toLowerCase()]){t=E.htmlPrefilter(t);try{for(;r<n;r++)1===(e=this[r]||{}).nodeType&&(E.cleanData(xt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Bt(this,arguments,(function(e){var r=this.parentNode;E.inArray(this,t)<0&&(E.cleanData(xt(this)),r&&r.replaceChild(e,this))}),t)}}),E.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){E.fn[t]=function(t){for(var r,n=[],i=E(t),o=i.length-1,a=0;a<=o;a++)r=a===o?this:this.clone(!0),E(i[a])[e](r),u.apply(n,r.get());return this.pushStack(n)}}));var Nt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),Ut=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},qt=function(t,e,r){var n,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in n=r.call(t),e)t.style[i]=o[i];return n},Vt=new RegExp(ot.join("|"),"i");function Zt(t,e,r){var n,i,o,a,s=t.style;return(r=r||Ut(t))&&(""!==(a=r.getPropertyValue(e)||r[e])||st(t)||(a=E.style(t,e)),!y.pixelBoxStyles()&&Nt.test(a)&&Vt.test(e)&&(n=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=r.width,s.width=n,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Wt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",at.appendChild(u).appendChild(c);var t=n.getComputedStyle(c);r="1%"!==t.top,l=12===e(t.marginLeft),c.style.right="60%",a=36===e(t.right),i=36===e(t.width),c.style.position="absolute",o=12===e(c.offsetWidth/3),at.removeChild(u),c=null}}function e(t){return Math.round(parseFloat(t))}var r,i,o,a,s,l,u=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===c.style.backgroundClip,E.extend(y,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,r,i;return null==s&&(t=_.createElement("table"),e=_.createElement("tr"),r=_.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",r.style.height="9px",r.style.display="block",at.appendChild(t).appendChild(e).appendChild(r),i=n.getComputedStyle(e),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,at.removeChild(t)),s}}))}();var Ht=["Webkit","Moz","ms"],Yt=_.createElement("div").style,Gt={};function Xt(t){var e=E.cssProps[t]||Gt[t];return e||(t in Yt?t:Gt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),r=Ht.length;r--;)if((t=Ht[r]+e)in Yt)return t}(t)||t)}var Kt=/^(none|table(?!-c[ea]).+)/,Jt=/^--/,$t={position:"absolute",visibility:"hidden",display:"block"},Qt={letterSpacing:"0",fontWeight:"400"};function te(t,e,r){var n=it.exec(e);return n?Math.max(0,n[2]-(r||0))+(n[3]||"px"):e}function ee(t,e,r,n,i,o){var a="width"===e?1:0,s=0,l=0;if(r===(n?"border":"content"))return 0;for(;a<4;a+=2)"margin"===r&&(l+=E.css(t,r+ot[a],!0,i)),n?("content"===r&&(l-=E.css(t,"padding"+ot[a],!0,i)),"margin"!==r&&(l-=E.css(t,"border"+ot[a]+"Width",!0,i))):(l+=E.css(t,"padding"+ot[a],!0,i),"padding"!==r?l+=E.css(t,"border"+ot[a]+"Width",!0,i):s+=E.css(t,"border"+ot[a]+"Width",!0,i));return!n&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l}function re(t,e,r){var n=Ut(t),i=(!y.boxSizingReliable()||r)&&"border-box"===E.css(t,"boxSizing",!1,n),o=i,a=Zt(t,e,n),s="offset"+e[0].toUpperCase()+e.slice(1);if(Nt.test(a)){if(!r)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===E.css(t,"display",!1,n))&&t.getClientRects().length&&(i="border-box"===E.css(t,"boxSizing",!1,n),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+ee(t,e,r||(i?"border":"content"),o,n,a)+"px"}function ne(t,e,r,n,i){return new ne.prototype.init(t,e,r,n,i)}E.extend({cssHooks:{opacity:{get:function(t,e){if(e){var r=Zt(t,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,r,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=X(e),l=Jt.test(e),u=t.style;if(l||(e=Xt(s)),a=E.cssHooks[e]||E.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(i=a.get(t,!1,n))?i:u[e];"string"===(o=typeof r)&&(i=it.exec(r))&&i[1]&&(r=ct(t,e,i),o="number"),null!=r&&r==r&&("number"!==o||l||(r+=i&&i[3]||(E.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==r||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(r=a.set(t,r,n))||(l?u.setProperty(e,r):u[e]=r))}},css:function(t,e,r,n){var i,o,a,s=X(e);return Jt.test(e)||(e=Xt(s)),(a=E.cssHooks[e]||E.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,r)),void 0===i&&(i=Zt(t,e,n)),"normal"===i&&e in Qt&&(i=Qt[e]),""===r||r?(o=parseFloat(i),!0===r||isFinite(o)?o||0:i):i}}),E.each(["height","width"],(function(t,e){E.cssHooks[e]={get:function(t,r,n){if(r)return!Kt.test(E.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,n):qt(t,$t,(function(){return re(t,e,n)}))},set:function(t,r,n){var i,o=Ut(t),a=!y.scrollboxSize()&&"absolute"===o.position,s=(a||n)&&"border-box"===E.css(t,"boxSizing",!1,o),l=n?ee(t,e,n,s,o):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ee(t,e,"border",!1,o)-.5)),l&&(i=it.exec(r))&&"px"!==(i[3]||"px")&&(t.style[e]=r,r=E.css(t,e)),te(0,r,l)}}})),E.cssHooks.marginLeft=Wt(y.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-qt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),E.each({margin:"",padding:"",border:"Width"},(function(t,e){E.cssHooks[t+e]={expand:function(r){for(var n=0,i={},o="string"==typeof r?r.split(" "):[r];n<4;n++)i[t+ot[n]+e]=o[n]||o[n-2]||o[0];return i}},"margin"!==t&&(E.cssHooks[t+e].set=te)})),E.fn.extend({css:function(t,e){return W(this,(function(t,e,r){var n,i,o={},a=0;if(Array.isArray(e)){for(n=Ut(t),i=e.length;a<i;a++)o[e[a]]=E.css(t,e[a],!1,n);return o}return void 0!==r?E.style(t,e,r):E.css(t,e)}),t,e,arguments.length>1)}}),E.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,r,n,i,o){this.elem=t,this.prop=r,this.easing=i||E.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(E.cssNumber[r]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,r=ne.propHooks[this.prop];return this.options.duration?this.pos=e=E.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=E.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){E.fx.step[t.prop]?E.fx.step[t.prop](t):1!==t.elem.nodeType||!E.cssHooks[t.prop]&&null==t.elem.style[Xt(t.prop)]?t.elem[t.prop]=t.now:E.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},E.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},E.fx=ne.prototype.init,E.fx.step={};var ie,oe,ae=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function le(){oe&&(!1===_.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(le):n.setTimeout(le,E.fx.interval),E.fx.tick())}function ue(){return n.setTimeout((function(){ie=void 0})),ie=Date.now()}function ce(t,e){var r,n=0,i={height:t};for(e=e?1:0;n<4;n+=2-e)i["margin"+(r=ot[n])]=i["padding"+r]=t;return e&&(i.opacity=i.width=t),i}function he(t,e,r){for(var n,i=(pe.tweeners[e]||[]).concat(pe.tweeners["*"]),o=0,a=i.length;o<a;o++)if(n=i[o].call(r,e,t))return n}function pe(t,e,r){var n,i,o=0,a=pe.prefilters.length,s=E.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var e=ie||ue(),r=Math.max(0,u.startTime+u.duration-e),n=1-(r/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(n);return s.notifyWith(t,[u,n,r]),n<1&&a?r:(a||s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u]),!1)},u=s.promise({elem:t,props:E.extend({},e),opts:E.extend(!0,{specialEasing:{},easing:E.easing._default},r),originalProperties:e,originalOptions:r,startTime:ie||ue(),duration:r.duration,tweens:[],createTween:function(e,r){var n=E.Tween(t,u.opts,e,r,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var r=0,n=e?u.tweens.length:0;if(i)return this;for(i=!0;r<n;r++)u.tweens[r].run(1);return e?(s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u,e])):s.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var r,n,i,o,a;for(r in t)if(i=e[n=X(r)],o=t[r],Array.isArray(o)&&(i=o[1],o=t[r]=o[0]),r!==n&&(t[n]=o,delete t[r]),(a=E.cssHooks[n])&&"expand"in a)for(r in o=a.expand(o),delete t[n],o)r in t||(t[r]=o[r],e[r]=i);else e[n]=i}(c,u.opts.specialEasing);o<a;o++)if(n=pe.prefilters[o].call(u,t,c,u.opts))return v(n.stop)&&(E._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return E.map(c,he,u),v(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),E.fx.timer(E.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}E.Animation=E.extend(pe,{tweeners:{"*":[function(t,e){var r=this.createTween(t,e);return ct(r.elem,t,it.exec(e),r),r}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(B);for(var r,n=0,i=t.length;n<i;n++)r=t[n],pe.tweeners[r]=pe.tweeners[r]||[],pe.tweeners[r].unshift(e)},prefilters:[function(t,e,r){var n,i,o,a,s,l,u,c,h="width"in e||"height"in e,p=this,f={},d=t.style,m=t.nodeType&&ut(t),y=$.get(t,"fxshow");for(n in r.queue||(null==(a=E._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always((function(){p.always((function(){a.unqueued--,E.queue(t,"fx").length||a.empty.fire()}))}))),e)if(i=e[n],ae.test(i)){if(delete e[n],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!y||void 0===y[n])continue;m=!0}f[n]=y&&y[n]||E.style(t,n)}if((l=!E.isEmptyObject(e))||!E.isEmptyObject(f))for(n in h&&1===t.nodeType&&(r.overflow=[d.overflow,d.overflowX,d.overflowY],null==(u=y&&y.display)&&(u=$.get(t,"display")),"none"===(c=E.css(t,"display"))&&(u?c=u:(ft([t],!0),u=t.style.display||u,c=E.css(t,"display"),ft([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===E.css(t,"float")&&(l||(p.done((function(){d.display=u})),null==u&&(c=d.display,u="none"===c?"":c)),d.display="inline-block")),r.overflow&&(d.overflow="hidden",p.always((function(){d.overflow=r.overflow[0],d.overflowX=r.overflow[1],d.overflowY=r.overflow[2]}))),l=!1,f)l||(y?"hidden"in y&&(m=y.hidden):y=$.access(t,"fxshow",{display:u}),o&&(y.hidden=!m),m&&ft([t],!0),p.done((function(){for(n in m||ft([t]),$.remove(t,"fxshow"),f)E.style(t,n,f[n])}))),l=he(m?y[n]:0,n,p),n in y||(y[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?pe.prefilters.unshift(t):pe.prefilters.push(t)}}),E.speed=function(t,e,r){var n=t&&"object"==typeof t?E.extend({},t):{complete:r||!r&&e||v(t)&&t,duration:t,easing:r&&e||e&&!v(e)&&e};return E.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in E.fx.speeds?n.duration=E.fx.speeds[n.duration]:n.duration=E.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){v(n.old)&&n.old.call(this),n.queue&&E.dequeue(this,n.queue)},n},E.fn.extend({fadeTo:function(t,e,r,n){return this.filter(ut).css("opacity",0).show().end().animate({opacity:e},t,r,n)},animate:function(t,e,r,n){var i=E.isEmptyObject(t),o=E.speed(e,r,n),a=function(){var e=pe(this,E.extend({},t),o);(i||$.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,r){var n=function(t){var e=t.stop;delete t.stop,e(r)};return"string"!=typeof t&&(r=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,i=null!=t&&t+"queueHooks",o=E.timers,a=$.get(this);if(i)a[i]&&a[i].stop&&n(a[i]);else for(i in a)a[i]&&a[i].stop&&se.test(i)&&n(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(r),e=!1,o.splice(i,1));!e&&r||E.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,r=$.get(this),n=r[t+"queue"],i=r[t+"queueHooks"],o=E.timers,a=n?n.length:0;for(r.finish=!0,E.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<a;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete r.finish}))}}),E.each(["toggle","show","hide"],(function(t,e){var r=E.fn[e];E.fn[e]=function(t,n,i){return null==t||"boolean"==typeof t?r.apply(this,arguments):this.animate(ce(e,!0),t,n,i)}})),E.each({slideDown:ce("show"),slideUp:ce("hide"),slideToggle:ce("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){E.fn[t]=function(t,r,n){return this.animate(e,t,r,n)}})),E.timers=[],E.fx.tick=function(){var t,e=0,r=E.timers;for(ie=Date.now();e<r.length;e++)(t=r[e])()||r[e]!==t||r.splice(e--,1);r.length||E.fx.stop(),ie=void 0},E.fx.timer=function(t){E.timers.push(t),E.fx.start()},E.fx.interval=13,E.fx.start=function(){oe||(oe=!0,le())},E.fx.stop=function(){oe=null},E.fx.speeds={slow:600,fast:200,_default:400},E.fn.delay=function(t,e){return t=E.fx&&E.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,r){var i=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(i)}}))},function(){var t=_.createElement("input"),e=_.createElement("select").appendChild(_.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=e.selected,(t=_.createElement("input")).value="t",t.type="radio",y.radioValue="t"===t.value}();var fe,de=E.expr.attrHandle;E.fn.extend({attr:function(t,e){return W(this,E.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){E.removeAttr(this,t)}))}}),E.extend({attr:function(t,e,r){var n,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?E.prop(t,e,r):(1===o&&E.isXMLDoc(t)||(i=E.attrHooks[e.toLowerCase()]||(E.expr.match.bool.test(e)?fe:void 0)),void 0!==r?null===r?void E.removeAttr(t,e):i&&"set"in i&&void 0!==(n=i.set(t,r,e))?n:(t.setAttribute(e,r+""),r):i&&"get"in i&&null!==(n=i.get(t,e))?n:null==(n=E.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!y.radioValue&&"radio"===e&&A(t,"input")){var r=t.value;return t.setAttribute("type",e),r&&(t.value=r),e}}}},removeAttr:function(t,e){var r,n=0,i=e&&e.match(B);if(i&&1===t.nodeType)for(;r=i[n++];)t.removeAttribute(r)}}),fe={set:function(t,e,r){return!1===e?E.removeAttr(t,r):t.setAttribute(r,r),r}},E.each(E.expr.match.bool.source.match(/\w+/g),(function(t,e){var r=de[e]||E.find.attr;de[e]=function(t,e,n){var i,o,a=e.toLowerCase();return n||(o=de[a],de[a]=i,i=null!=r(t,e,n)?a:null,de[a]=o),i}}));var me=/^(?:input|select|textarea|button)$/i,ye=/^(?:a|area)$/i;function ve(t){return(t.match(B)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function _e(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(B)||[]}E.fn.extend({prop:function(t,e){return W(this,E.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[E.propFix[t]||t]}))}}),E.extend({prop:function(t,e,r){var n,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(t)||(e=E.propFix[e]||e,i=E.propHooks[e]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(t,r,e))?n:t[e]=r:i&&"get"in i&&null!==(n=i.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=E.find.attr(t,"tabindex");return e?parseInt(e,10):me.test(t.nodeName)||ye.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(E.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){E.propFix[this.toLowerCase()]=this})),E.fn.extend({addClass:function(t){var e,r,n,i,o,a,s,l=0;if(v(t))return this.each((function(e){E(this).addClass(t.call(this,e,ge(this)))}));if((e=_e(t)).length)for(;r=this[l++];)if(i=ge(r),n=1===r.nodeType&&" "+ve(i)+" "){for(a=0;o=e[a++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");i!==(s=ve(n))&&r.setAttribute("class",s)}return this},removeClass:function(t){var e,r,n,i,o,a,s,l=0;if(v(t))return this.each((function(e){E(this).removeClass(t.call(this,e,ge(this)))}));if(!arguments.length)return this.attr("class","");if((e=_e(t)).length)for(;r=this[l++];)if(i=ge(r),n=1===r.nodeType&&" "+ve(i)+" "){for(a=0;o=e[a++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");i!==(s=ve(n))&&r.setAttribute("class",s)}return this},toggleClass:function(t,e){var r=typeof t,n="string"===r||Array.isArray(t);return"boolean"==typeof e&&n?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(r){E(this).toggleClass(t.call(this,r,ge(this),e),e)})):this.each((function(){var e,i,o,a;if(n)for(i=0,o=E(this),a=_e(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==r||((e=ge(this))&&$.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":$.get(this,"__className__")||""))}))},hasClass:function(t){var e,r,n=0;for(e=" "+t+" ";r=this[n++];)if(1===r.nodeType&&(" "+ve(ge(r))+" ").indexOf(e)>-1)return!0;return!1}});var xe=/\r/g;E.fn.extend({val:function(t){var e,r,n,i=this[0];return arguments.length?(n=v(t),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?t.call(this,r,E(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=E.map(i,(function(t){return null==t?"":t+""}))),(e=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=E.valHooks[i.type]||E.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(r=e.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(xe,""):null==r?"":r:void 0}}),E.extend({valHooks:{option:{get:function(t){var e=E.find.attr(t,"value");return null!=e?e:ve(E.text(t))}},select:{get:function(t){var e,r,n,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:i.length;for(n=o<0?l:a?o:0;n<l;n++)if(((r=i[n]).selected||n===o)&&!r.disabled&&(!r.parentNode.disabled||!A(r.parentNode,"optgroup"))){if(e=E(r).val(),a)return e;s.push(e)}return s},set:function(t,e){for(var r,n,i=t.options,o=E.makeArray(e),a=i.length;a--;)((n=i[a]).selected=E.inArray(E.valHooks.option.get(n),o)>-1)&&(r=!0);return r||(t.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],(function(){E.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=E.inArray(E(t).val(),e)>-1}},y.checkOn||(E.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),y.focusin="onfocusin"in n;var be=/^(?:focusinfocus|focusoutblur)$/,we=function(t){t.stopPropagation()};E.extend(E.event,{trigger:function(t,e,r,i){var o,a,s,l,u,c,h,p,d=[r||_],m=f.call(t,"type")?t.type:t,y=f.call(t,"namespace")?t.namespace.split("."):[];if(a=p=s=r=r||_,3!==r.nodeType&&8!==r.nodeType&&!be.test(m+E.event.triggered)&&(m.indexOf(".")>-1&&(y=m.split("."),m=y.shift(),y.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[E.expando]?t:new E.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:E.makeArray(e,[t]),h=E.event.special[m]||{},i||!h.trigger||!1!==h.trigger.apply(r,e))){if(!i&&!h.noBubble&&!g(r)){for(l=h.delegateType||m,be.test(l+m)||(a=a.parentNode);a;a=a.parentNode)d.push(a),s=a;s===(r.ownerDocument||_)&&d.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=d[o++])&&!t.isPropagationStopped();)p=a,t.type=o>1?l:h.bindType||m,(c=($.get(a,"events")||Object.create(null))[t.type]&&$.get(a,"handle"))&&c.apply(a,e),(c=u&&a[u])&&c.apply&&K(a)&&(t.result=c.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),e)||!K(r)||u&&v(r[m])&&!g(r)&&((s=r[u])&&(r[u]=null),E.event.triggered=m,t.isPropagationStopped()&&p.addEventListener(m,we),r[m](),t.isPropagationStopped()&&p.removeEventListener(m,we),E.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(t,e,r){var n=E.extend(new E.Event,r,{type:t,isSimulated:!0});E.event.trigger(n,null,e)}}),E.fn.extend({trigger:function(t,e){return this.each((function(){E.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var r=this[0];if(r)return E.event.trigger(t,e,r,!0)}}),y.focusin||E.each({focus:"focusin",blur:"focusout"},(function(t,e){var r=function(t){E.event.simulate(e,t.target,E.event.fix(t))};E.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,i=$.access(n,e);i||n.addEventListener(t,r,!0),$.access(n,e,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,i=$.access(n,e)-1;i?$.access(n,e,i):(n.removeEventListener(t,r,!0),$.remove(n,e))}}}));var Se=n.location,Ee={guid:Date.now()},Te=/\?/;E.parseXML=function(t){var e,r;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return r=e&&e.getElementsByTagName("parsererror")[0],e&&!r||E.error("Invalid XML: "+(r?E.map(r.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var ke=/\[\]$/,Ce=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,r,n){var i;if(Array.isArray(e))E.each(e,(function(e,i){r||ke.test(t)?n(t,i):Ae(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,r,n)}));else if(r||"object"!==w(e))n(t,e);else for(i in e)Ae(t+"["+i+"]",e[i],r,n)}E.param=function(t,e){var r,n=[],i=function(t,e){var r=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==r?"":r)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!E.isPlainObject(t))E.each(t,(function(){i(this.name,this.value)}));else for(r in t)Ae(r,t[r],e,i);return n.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=E.prop(this,"elements");return t?E.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!E(this).is(":disabled")&&Pe.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!yt.test(t))})).map((function(t,e){var r=E(this).val();return null==r?null:Array.isArray(r)?E.map(r,(function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}})):{name:e.name,value:r.replace(Ce,"\r\n")}})).get()}});var De=/%20/g,Me=/#.*$/,ze=/([?&])_=[^&]*/,Oe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Le=/^(?:GET|HEAD)$/,je=/^\/\//,Re={},Be={},Fe="*/".concat("*"),Ne=_.createElement("a");function Ue(t){return function(e,r){"string"!=typeof e&&(r=e,e="*");var n,i=0,o=e.toLowerCase().match(B)||[];if(v(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(r)):(t[n]=t[n]||[]).push(r)}}function qe(t,e,r,n){var i={},o=t===Be;function a(s){var l;return i[s]=!0,E.each(t[s]||[],(function(t,s){var u=s(e,r,n);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)})),l}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Ve(t,e){var r,n,i=E.ajaxSettings.flatOptions||{};for(r in e)void 0!==e[r]&&((i[r]?t:n||(n={}))[r]=e[r]);return n&&E.extend(!0,t,n),t}Ne.href=Se.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Se.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Se.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ve(Ve(t,E.ajaxSettings),e):Ve(E.ajaxSettings,t)},ajaxPrefilter:Ue(Re),ajaxTransport:Ue(Be),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,s,l,u,c,h,p,f=E.ajaxSetup({},e),d=f.context||f,m=f.context&&(d.nodeType||d.jquery)?E(d):E.event,y=E.Deferred(),v=E.Callbacks("once memory"),g=f.statusCode||{},x={},b={},w="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=Oe.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==u&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)S.always(t[S.status]);else for(e in t)g[e]=[g[e],t[e]];return this},abort:function(t){var e=t||w;return r&&r.abort(e),T(0,e),this}};if(y.promise(S),f.url=((t||f.url||Se.href)+"").replace(je,Se.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(B)||[""],null==f.crossDomain){l=_.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ne.protocol+"//"+Ne.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=E.param(f.data,f.traditional)),qe(Re,f,e,S),u)return S;for(h in(c=E.event&&f.global)&&0==E.active++&&E.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Le.test(f.type),i=f.url.replace(Me,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(De,"+")):(p=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Te.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(ze,"$1"),p=(Te.test(i)?"&":"?")+"_="+Ee.guid+++p),f.url=i+p),f.ifModified&&(E.lastModified[i]&&S.setRequestHeader("If-Modified-Since",E.lastModified[i]),E.etag[i]&&S.setRequestHeader("If-None-Match",E.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&S.setRequestHeader("Content-Type",f.contentType),S.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Fe+"; q=0.01":""):f.accepts["*"]),f.headers)S.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(d,S,f)||u))return S.abort();if(w="abort",v.add(f.complete),S.done(f.success),S.fail(f.error),r=qe(Be,f,e,S)){if(S.readyState=1,c&&m.trigger("ajaxSend",[S,f]),u)return S;f.async&&f.timeout>0&&(s=n.setTimeout((function(){S.abort("timeout")}),f.timeout));try{u=!1,r.send(x,T)}catch(t){if(u)throw t;T(-1,t)}}else T(-1,"No Transport");function T(t,e,a,l){var h,p,_,x,b,w=e;u||(u=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",S.readyState=t>0?4:0,h=t>=200&&t<300||304===t,a&&(x=function(t,e,r){for(var n,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){l.unshift(i);break}if(l[0]in r)o=l[0];else{for(i in r){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),r[o]}(f,S,a)),!h&&E.inArray("script",f.dataTypes)>-1&&E.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(t,e,r,n){var i,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(r[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(f,x,S,h),h?(f.ifModified&&((b=S.getResponseHeader("Last-Modified"))&&(E.lastModified[i]=b),(b=S.getResponseHeader("etag"))&&(E.etag[i]=b)),204===t||"HEAD"===f.type?w="nocontent":304===t?w="notmodified":(w=x.state,p=x.data,h=!(_=x.error))):(_=w,!t&&w||(w="error",t<0&&(t=0))),S.status=t,S.statusText=(e||w)+"",h?y.resolveWith(d,[p,w,S]):y.rejectWith(d,[S,w,_]),S.statusCode(g),g=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[S,f,h?p:_]),v.fireWith(d,[S,w]),c&&(m.trigger("ajaxComplete",[S,f]),--E.active||E.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,r){return E.get(t,e,r,"json")},getScript:function(t,e){return E.get(t,void 0,e,"script")}}),E.each(["get","post"],(function(t,e){E[e]=function(t,r,n,i){return v(r)&&(i=i||n,n=r,r=void 0),E.ajax(E.extend({url:t,type:e,dataType:i,data:r,success:n},E.isPlainObject(t)&&t))}})),E.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),E._evalUrl=function(t,e,r){return E.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){E.globalEval(t,e,r)}})},E.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=E(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){E(this).wrapInner(t.call(this,e))})):this.each((function(){var e=E(this),r=e.contents();r.length?r.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(r){E(this).wrapAll(e?t.call(this,r):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){E(this).replaceWith(this.childNodes)})),this}}),E.expr.pseudos.hidden=function(t){return!E.expr.pseudos.visible(t)},E.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},We=E.ajaxSettings.xhr();y.cors=!!We&&"withCredentials"in We,y.ajax=We=!!We,E.ajaxTransport((function(t){var e,r;if(y.cors||We&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ze[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),E.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return E.globalEval(t),t}}}),E.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),E.ajaxTransport("script",(function(t){var e,r;if(t.crossDomain||t.scriptAttrs)return{send:function(n,i){e=E("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",r=function(t){e.remove(),r=null,t&&i("error"===t.type?404:200,t.type)}),_.head.appendChild(e[0])},abort:function(){r&&r()}}}));var He,Ye=[],Ge=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ye.pop()||E.expando+"_"+Ee.guid++;return this[t]=!0,t}}),E.ajaxPrefilter("json jsonp",(function(t,e,r){var i,o,a,s=!1!==t.jsonp&&(Ge.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Ge,"$1"+i):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||E.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always((function(){void 0===o?E(n).removeProp(i):n[i]=o,t[i]&&(t.jsonpCallback=e.jsonpCallback,Ye.push(i)),a&&v(o)&&o(a[0]),a=o=void 0})),"script"})),y.createHTMLDocument=((He=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===He.childNodes.length),E.parseHTML=function(t,e,r){return"string"!=typeof t?[]:("boolean"==typeof e&&(r=e,e=!1),e||(y.createHTMLDocument?((n=(e=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,e.head.appendChild(n)):e=_),o=!r&&[],(i=D.exec(t))?[e.createElement(i[1])]:(i=St([t],e,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var n,i,o},E.fn.load=function(t,e,r){var n,i,o,a=this,s=t.indexOf(" ");return s>-1&&(n=ve(t.slice(s)),t=t.slice(0,s)),v(e)?(r=e,e=void 0):e&&"object"==typeof e&&(i="POST"),a.length>0&&E.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done((function(t){o=arguments,a.html(n?E("<div>").append(E.parseHTML(t)).find(n):t)})).always(r&&function(t,e){a.each((function(){r.apply(this,o||[t.responseText,e,t])}))}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,(function(e){return t===e.elem})).length},E.offset={setOffset:function(t,e,r){var n,i,o,a,s,l,u=E.css(t,"position"),c=E(t),h={};"static"===u&&(t.style.position="relative"),s=c.offset(),o=E.css(t,"top"),l=E.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(n=c.position()).top,i=n.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v(e)&&(e=e.call(t,r,E.extend({},s))),null!=e.top&&(h.top=e.top-s.top+a),null!=e.left&&(h.left=e.left-s.left+i),"using"in e?e.using.call(t,h):c.css(h)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){E.offset.setOffset(this,t,e)}));var e,r,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),r=n.ownerDocument.defaultView,{top:e.top+r.pageYOffset,left:e.left+r.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,r,n=this[0],i={top:0,left:0};if("fixed"===E.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),r=n.ownerDocument,t=n.offsetParent||r.documentElement;t&&(t===r.body||t===r.documentElement)&&"static"===E.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((i=E(t).offset()).top+=E.css(t,"borderTopWidth",!0),i.left+=E.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-E.css(n,"marginTop",!0),left:e.left-i.left-E.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===E.css(t,"position");)t=t.offsetParent;return t||at}))}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var r="pageYOffset"===e;E.fn[t]=function(n){return W(this,(function(t,n,i){var o;if(g(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[n];o?o.scrollTo(r?o.pageXOffset:i,r?i:o.pageYOffset):t[n]=i}),t,n,arguments.length)}})),E.each(["top","left"],(function(t,e){E.cssHooks[e]=Wt(y.pixelPosition,(function(t,r){if(r)return r=Zt(t,e),Nt.test(r)?E(t).position()[e]+"px":r}))})),E.each({Height:"height",Width:"width"},(function(t,e){E.each({padding:"inner"+t,content:e,"":"outer"+t},(function(r,n){E.fn[n]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(!0===i||!0===o?"margin":"border");return W(this,(function(e,r,i){var o;return g(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?E.css(e,r,s):E.style(e,r,i,s)}),e,a?i:void 0,a)}}))})),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){E.fn[e]=function(t){return this.on(e,t)}})),E.fn.extend({bind:function(t,e,r){return this.on(t,null,e,r)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,r,n){return this.on(e,t,r,n)},undelegate:function(t,e,r){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",r)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){E.fn[e]=function(t,r){return arguments.length>0?this.on(e,null,t,r):this.trigger(e)}}));var Xe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;E.proxy=function(t,e){var r,n,i;if("string"==typeof e&&(r=t[e],e=t,t=r),v(t))return n=s.call(arguments,2),i=function(){return t.apply(e||this,n.concat(s.call(arguments)))},i.guid=t.guid=t.guid||E.guid++,i},E.holdReady=function(t){t?E.readyWait++:E.ready(!0)},E.isArray=Array.isArray,E.parseJSON=JSON.parse,E.nodeName=A,E.isFunction=v,E.isWindow=g,E.camelCase=X,E.type=w,E.now=Date.now,E.isNumeric=function(t){var e=E.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},E.trim=function(t){return null==t?"":(t+"").replace(Xe,"")},void 0===(r=function(){return E}.apply(e,[]))||(t.exports=r);var Ke=n.jQuery,Je=n.$;return E.noConflict=function(t){return n.$===E&&(n.$=Je),t&&n.jQuery===E&&(n.jQuery=Ke),E},void 0===i&&(n.jQuery=n.$=E),E}))},6158:function(t){t.exports=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=i(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=i;else t=i}return n(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function l(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var u=l(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}var f=1;function d(){return f++}function m(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?_(t,b):t}var w={};function S(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function E(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r<n;i=r++)e+=((a=t[i]).x-(o=t[r]).x)*(o.y+a.y);return e}function k(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function C(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var I=null;function P(t){if(null==I){var e=t.navigator?t.navigator.userAgent:null;I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return I}function A(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var D,M,z,O,L=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),j=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,R=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,B={now:L,frame:function(t){var e=j(t);return{cancel:function(){return R(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return D||(D=a.document.createElement("a")),D.href=t,D.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==M&&(M=a.matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}},F={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},N={supported:!1,testSupport:function(t){!U&&O&&(q?V(t):z=t)}},U=!1,q=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),U=!0}a.document&&((O=a.document.createElement("img")).onload=function(){z&&V(z),z=null,q=!0},O.onerror=function(){U=!0,z=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Z="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function H(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Z,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!H(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!H(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!H(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return H(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!H(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(B.devicePixelRatio>=2||512===e?"@2x":"")+(N.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||F.ACCESS_TOKEN;return F.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,n)},W.prototype.canonicalizeTileURL=function(t,e){var r=K(t);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return e&&(i=i.filter((function(t){return!t.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},W.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&H(e),n=[],i=0,o=t.tiles||[];i<o.length;i+=1){var a=o[i];G(a)?n.push(this.canonicalizeTileURL(a,r)):n.push(a)}return n},W.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(F.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){var i=t.params.indexOf("secure");i>=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||F.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function G(t){return Y.test(t)}var X=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(X);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function $(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var Q=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Q.prototype.getStorageKey=function(t){var e,r=$(F.ACCESS_TOKEN);return e=r&&r.u?a.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},Q.prototype.fetchEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=a.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=a.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){S("Unable to read from LocalStorage")}},Q.prototype.saveEventData=function(){var t=A("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){S("Unable to write to LocalStorage")}},Q.prototype.processRequests=function(t){},Q.prototype.postEvent=function(t,e,r,n){var i=this;if(F.EVENTS_URL){var o=K(F.EVENTS_URL);o.params.push("access_token="+(n||F.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.1",skuId:Z,userId:this.anonId},s=e?p(a,e):a,l={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(l,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},Q.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(F.EVENTS_URL&&n||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=m()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(Q),nt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return H(t)||G(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=$(F.ACCESS_TOKEN),n=r?r.u:F.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=m(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(Q)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,lt=50;function ut(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function ft(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var mt,yt,vt=function(t){function e(e,r,n){401===r&&G(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),gt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},_t=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(gt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:gt(),signal:n.signal}),o=!1,s=!1,l=(r=i.url).indexOf("sku=")>0&&G(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&S(r),n&&o)return c(n);var u=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return c(r,n,u)}return e(new vt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(r,n,l){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&l&&function(t,e,r){if(ut(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=C(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);ut(),tt&&tt.then((function(e){return e.put(ct(t.url),r)})).catch((function(t){return S(t.message)}))})))}}(i,n,l),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return l?function(t,e){if(ut(),!tt)return e(null);var r=ct(t.url);tt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=C(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new vt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},xt=function(t,e){return _t(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return _t(p(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";mt=[],yt=0;var St=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),yt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return mt.push(r),r}yt++;var n=!1,i=function(){if(!n)for(n=!0,yt--;mt.length&&yt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=mt.shift();t.cancelled||(t.cancel=St(t.requestParameters,t.callback).cancel)}},o=xt(t,(function(t,r,n,o){i(),t?e(t):r&&(ft()?function(t,e){var r=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.createImageBitmap(r).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,e):function(t,e,r,n){var i=new a.Image,o=a.URL;i.onload=function(){e(null,i),o.revokeObjectURL(i.src),i.onload=null,a.requestAnimationFrame((function(){i.src=wt}))},i.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var s=new a.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?o.createObjectURL(s):wt}(r,e,n,o))}));return{cancel:function(){o.cancel(),i()}}};function Et(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Tt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var kt=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},Ct=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(kt),It=function(){};It.prototype.on=function(t,e){return this._listeners=this._listeners||{},Et(t,e,this._listeners),this},It.prototype.off=function(t,e){return Tt(t,e,this._listeners),Tt(t,e,this._oneTimeListeners),this},It.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Et(t,e,this._oneTimeListeners),this},It.prototype.fire=function(t,e){"string"==typeof t&&(t=new kt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];Tt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof Ct&&console.error(t.error);return this},It.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)},It.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Dt(t){var e=t.value;return e?[new At(t.key,e,"constants have been deprecated as of v8")]:[]}function Mt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var o=i[n];for(var a in o)t[a]=o[a]}return t}function zt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ot(t){if(Array.isArray(t))return t.map(Ot);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=Ot(t[r]);return e}return zt(t)}var Lt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),jt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r];this.bindings[i[0]]=i[1]}};jt.prototype.concat=function(t){return new jt(this,t)},jt.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.")},jt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Rt={kind:"null"},Bt={kind:"number"},Ft={kind:"string"},Nt={kind:"boolean"},Ut={kind:"color"},qt={kind:"object"},Vt={kind:"value"},Zt={kind:"collator"},Wt={kind:"formatted"},Ht={kind:"resolvedImage"};function Yt(t,e){return{kind:"array",itemType:t,N:e}}function Gt(t){if("array"===t.kind){var e=Gt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Xt=[Rt,Bt,Ft,Nt,Ut,Wt,qt,Yt(Vt),Ht];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Xt;r<n.length;r+=1)if(!Kt(n[r],e))return null}return"Expected "+Gt(t)+" but found "+Gt(e)+" instead."}function Jt(t,e){return e.some((function(e){return e.kind===t.kind}))}function $t(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var Qt=e((function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=s.indexOf("("),u=s.indexOf(")");if(-1!==l&&u+1===s.length){var c=s.substr(0,l),h=s.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),m=o(h[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*a(v,y,f+1/3)),n(255*a(v,y,f)),n(255*a(v,y,f-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=Qt(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var ie=function(t){this.name=t.name,this.available=t.available};function oe(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ae(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!ae(r[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!ae(t[n]))return!1;return!0}return!1}function se(t){if(null===t)return Rt;if("string"==typeof t)return Ft;if("boolean"==typeof t)return Nt;if("number"==typeof t)return Bt;if(t instanceof te)return Ut;if(t instanceof ee)return Zt;if(t instanceof ne)return Wt;if(t instanceof ie)return Ht;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=se(i[n]);if(e){if(e===o)continue;e=Vt;break}e=o}return Yt(e||Vt,r)}return qt}function le(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof ne||t instanceof ie?t.toString():JSON.stringify(t)}ie.prototype.toString=function(){return this.name},ie.fromString=function(t){return t?new ie({name:t,available:!1}):null},ie.prototype.serialize=function(){return["image",this.name]};var ue=function(t,e){this.type=t,this.value=e};ue.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ae(t[1]))return e.error("invalid value");var r=t[1],n=se(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ue(n,r)},ue.prototype.evaluate=function(){return this.value},ue.prototype.eachChild=function(){},ue.prototype.outputDefined=function(){return!0},ue.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof te?["rgba"].concat(this.value.toArray()):this.value instanceof ne?this.value.serialize():this.value};var ce=function(t){this.name="ExpressionEvaluationError",this.message=t};ce.prototype.toJSON=function(){return this.message};var he={string:Ft,number:Bt,boolean:Nt,object:qt},pe=function(t,e){this.type=t,this.args=e};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=Vt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Yt(o,a)}else r=he[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,Vt);if(!u)return null;l.push(u)}return new pe(r,l)},pe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Kt(this.type,se(r)))return r;if(e===this.args.length-1)throw new ce("Expected value to be of type "+Gt(this.type)+", but found "+Gt(se(r))+" instead.")}return null},pe.prototype.eachChild=function(t){this.args.forEach(t)},pe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},pe.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var fe=function(t){this.type=Wt,this.sections=t};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Bt)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,Yt(Ft))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,Ut)))return null;var c=n[n.length-1];c.scale=s,c.font=l,c.textColor=u}else{var h=e.parse(t[o],1,Vt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new fe(n)},fe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===Ht?new re("",r,null,null,null):new re(le(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},fe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var de=function(t){this.type=Ht,this.input=t};de.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);return r?new de(r):e.error("No image name provided.")},de.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ie.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var me={"to-boolean":Nt,"to-color":Ut,"to-number":Bt,"to-string":Ft},ye=function(t,e){this.type=t,this.args=e};ye.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=me[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Vt);if(!a)return null;i.push(a)}return new ye(n,i)},ye.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof te)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new ce("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ne.fromString(le(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ie.fromString(le(this.args[0].evaluate(t))):le(this.args[0].evaluate(t))},ye.prototype.eachChild=function(t){this.args.forEach(t)},ye.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ye.prototype.serialize=function(){if("formatted"===this.type.kind)return new fe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new de(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var ve=["Unknown","Point","LineString","Polygon"],ge=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ge.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ge.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ve[this.feature.type]:this.feature.type:null},ge.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ge.prototype.canonicalID=function(){return this.canonical},ge.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ge.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var _e=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};_e.prototype.evaluate=function(t){return this._evaluate(t,this.args)},_e.prototype.eachChild=function(t){this.args.forEach(t)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},_e.parse=function(t,e){var r,n=t[0],i=_e.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],p=h[0],f=h[1];l=new Ue(e.registry,e.path,null,e.scope);for(var d=[],m=!1,y=1;y<t.length;y++){var v=t[y],g=Array.isArray(p)?p[y-1]:p.type,_=l.parse(v,1+d.length,g);if(!_){m=!0;break}d.push(_)}if(!m)if(Array.isArray(p)&&p.length!==d.length)l.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(p)?p[x]:p.type,w=d[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new _e(n,o,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var S=(s.length?s:a).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Gt).join(", ")+")":"("+Gt(e.type)+"...)"})).join(" | "),E=[],T=1;T<t.length;T++){var k=e.parse(t[T],1+E.length);if(!k)return null;E.push(Gt(k.type))}e.error("Expected arguments of type "+S+", but found ("+E.join(", ")+") instead.")}return null},_e.register=function(t,e){for(var r in _e.definitions=e,e)t[r]=_e};var xe=function(t,e,r){this.type=Zt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function be(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function we(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Se(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function Ee(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Te(t,e){for(var r,n,i,o,a,s,l,u=!1,c=0,h=e.length;c<h;c++)for(var p=e[c],f=0,d=p.length;f<d-1;f++){if((o=(r=t)[0]-(n=p[f])[0])*(l=r[1]-(i=p[f+1])[1])-(s=r[0]-i[0])*(a=r[1]-n[1])==0&&o*s<=0&&a*l<=0)return!1;Ee(t,p[f],p[f+1])&&(u=!u)}return u}function ke(t,e){for(var r=0;r<e.length;r++)if(Te(t,e[r]))return!0;return!1}function Ce(t,e,r,n){var i=n[0]-r[0],o=n[1]-r[1],a=(t[0]-r[0])*o-i*(t[1]-r[1]),s=(e[0]-r[0])*o-i*(e[1]-r[1]);return a>0&&s<0||a<0&&s>0}function Ie(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var o=i[n],a=0;a<o.length-1;++a)if(0!=(h=[(c=o[a+1])[0]-(u=o[a])[0],c[1]-u[1]])[0]*(p=[(l=e)[0]-(s=t)[0],l[1]-s[1]])[1]-h[1]*p[0]&&Ce(s,l,u,c)&&Ce(u,c,s,l))return!0;var s,l,u,c,h,p;return!1}function Pe(t,e){for(var r=0;r<t.length;++r)if(!Te(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Ie(t[n],t[n+1],e))return!1;return!0}function Ae(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return!0;return!1}function De(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=Se(t[i][a],r);be(e,s),o.push(s)}n.push(o)}return n}function Me(t,e,r){for(var n=[],i=0;i<t.length;i++){var o=De(t[i],e,r);n.push(o)}return n}function ze(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function Oe(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,l=t;s<l.length;s+=1)for(var u=0,c=l[s];u<c.length;u+=1){var h=c[u],p=[h.x+o[0],h.y+o[1]];ze(p,e,r,i),a.push(p)}return a}function Le(t,e,r,n){for(var i,o=8192*Math.pow(2,n.z),a=[8192*n.x,8192*n.y],s=[],l=0,u=t;l<u.length;l+=1){for(var c=[],h=0,p=u[l];h<p.length;h+=1){var f=p[h],d=[f.x+a[0],f.y+a[1]];be(e,d),c.push(d)}s.push(c)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var m=0,y=s;m<y.length;m+=1)for(var v=0,g=y[m];v<g.length;v+=1)ze(g[v],e,r,o)}return s}xe.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Nt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Nt);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Ft))?null:new xe(n,i,o)},xe.prototype.evaluate=function(t){return new ee(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},xe.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},xe.prototype.outputDefined=function(){return!1},xe.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 je=function(t,e){this.type=Nt,this.geojson=t,this.geometries=e};function Re(t){if(t instanceof _e){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}if(t instanceof je)return!1;var e=!0;return t.eachChild((function(t){e&&!Re(t)&&(e=!1)})),e}function Be(t){if(t instanceof _e&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Be(t)&&(e=!1)})),e}function Fe(t,e){if(t instanceof _e&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Fe(t,e)&&(r=!1)})),r}je.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new je(r,r.features[n].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new je(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new je(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},je.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=De(e.coordinates,n,i),a=Oe(t.geometry(),r,n,i);if(!we(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Te(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Me(e.coordinates,n,i),c=Oe(t.geometry(),r,n,i);if(!we(r,n))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!ke(p[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=De(e.coordinates,n,i),a=Le(t.geometry(),r,n,i);if(!we(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Pe(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Me(e.coordinates,n,i),c=Le(t.geometry(),r,n,i);if(!we(r,n))return!1;for(var h=0,p=c;h<p.length;h+=1)if(!Ae(p[h],u))return!1}return!0}(t,this.geometries)}return!1},je.prototype.eachChild=function(){},je.prototype.outputDefined=function(){return!0},je.prototype.serialize=function(){return["within",this.geojson]};var Ne=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ne.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new Ne(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Ne.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return!1},Ne.prototype.serialize=function(){return["var",this.name]};var Ue=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new jt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function qe(t,e){for(var r,n=t.length-1,i=0,o=n,a=0;i<=o;)if((r=t[a=Math.floor((i+o)/2)])<=e){if(a===n||e<t[a+1])return a;i=a+1}else{if(!(r>e))throw new ce("Input is not a number.");o=a-1}return 0}Ue.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new ye(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ue)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ne)return t(e.boundExpression);if(e instanceof _e&&"error"===e.name)return!1;if(e instanceof xe)return!1;if(e instanceof je)return!1;var r=e instanceof ye||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ue})),!!n&&Re(e)&&Fe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ge;try{o=new ue(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Lt(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Kt(t,e);return r&&this.error(r),r};var Ve=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function Ze(t,e,r){return t*(1-r)+e*r}Ve.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],l=o,u=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([a,c])}return new Ve(i,r,n)},Ve.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[qe(e,n)].evaluate(t)},Ve.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ve.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ve.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 We=Object.freeze({__proto__:null,number:Ze,color:function(t,e,r){return new te(Ze(t.r,e.r,r),Ze(t.g,e.g,r),Ze(t.b,e.b,r),Ze(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ze(t,e[n],r)}))}}),He=6/29*3*(6/29),Ye=Math.PI/180,Ge=180/Math.PI;function Xe(t){return t>.008856451679035631?Math.pow(t,1/3):t/He+4/29}function Ke(t){return t>6/29?t*t*t:He*(t-4/29)}function Je(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qe(t){var e=$e(t.r),r=$e(t.g),n=$e(t.b),i=Xe((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Xe((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Xe((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),r=.95047*Ke(r),n=1.08883*Ke(n),new te(Je(3.2404542*r-1.5371385*e-.4985314*n),Je(-.969266*r+1.8760108*e+.041556*n),Je(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:Qe,reverse:tr,interpolate:function(t,e,r){return{l:Ze(t.l,e.l,r),a:Ze(t.a,e.a,r),b:Ze(t.b,e.b,r),alpha:Ze(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=Qe(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Ge;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Ye,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ze(t.c,e.c,r),l:Ze(t.l,e.l,r),alpha:Ze(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],l=s[1];this.labels.push(s[0]),this.outputs.push(l)}};function ar(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}or.interpolationFactor=function(t,e,n,i){var o=0;if("exponential"===t.name)o=ar(e,t.base,n,i);else if("linear"===t.name)o=ar(e,1,n,i);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new r(a[0],a[1],a[2],a[3]).solve(ar(e,1,n,i))}return o},or.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Bt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],p=o[c+1],f=c+3,d=c+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(p,d,u);if(!m)return null;u=u||m.type,l.push([h,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new or(u,r,n,i,l):e.error("Type "+Gt(u)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=qe(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),l=r[o+1].evaluate(t);return"interpolate"===this.operator?We[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(l),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(l),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},or.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},or.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var sr=function(t,e){this.type=t,this.args=e};sr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+i.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,i.push(s)}var l=n&&i.some((function(t){return Kt(n,t.type)}));return new sr(l?Vt:r,i)},sr.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length&&(n++,(r=o[i].evaluate(t))&&r instanceof ie&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null===r);i+=1);return r},sr.prototype.eachChild=function(t){this.args.forEach(t)},sr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},sr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var lr=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};lr.prototype.evaluate=function(t){return this.result.evaluate(t)},lr.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},lr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new lr(r,a):null},lr.prototype.outputDefined=function(){return this.result.outputDefined()},lr.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e];t.push(n[0],n[1].serialize())}return t.push(this.result.serialize()),t};var ur=function(t,e,r){this.type=t,this.index=e,this.input=r};ur.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Bt),n=e.parse(t[2],2,Yt(e.expectedType||Vt));return r&&n?new ur(n.type.itemType,r,n):null},ur.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ce("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=Nt,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Vt);return r&&n?Jt(r.type,[Nt,Ft,Bt,Rt,Vt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!$t(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Gt(se(e))+" instead.");if(!$t(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Gt(se(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Bt,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Vt);if(!r||!n)return null;if(!Jt(r.type,[Nt,Ft,Bt,Rt,Vt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Gt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!$t(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Gt(se(e))+" instead.");if(!$t(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Gt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var p=h[c];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return u.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(l,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,Vt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new pr(r,n,d,i,o,m):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(h=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],h=c[0],p=c[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var fr=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};fr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,Nt);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new fr(r,n,s):null},fr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];if(n[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},fr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[1];t(n[0]),t(i)}t(this.otherwise)},fr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var dr=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function mr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function yr(t,e,r,n){return 0===n.compare(e,r)}function vr(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Nt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,Vt);if(!o)return null;if(!mr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Gt(o.type)+"'.");var a=e.parse(t[2],2,Vt);if(!a)return null;if(!mr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Gt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Gt(o.type)+"' and '"+Gt(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new pe(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new pe(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Zt)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=se(o),l=se(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ce('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=se(o),c=se(a);if("string"!==u.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}dr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Vt),n=e.parse(t[2],2,Bt);if(!r||!n)return null;if(!Jt(r.type,[Yt(Vt),Ft,Vt]))return e.error("Expected first argument to be of type array or string, but found "+Gt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Bt);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!$t(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Gt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var gr=vr("==",(function(t,e,r){return e===r}),yr),_r=vr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!yr(0,e,r,n)})),xr=vr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),br=vr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),wr=vr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Sr=vr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Er=function(t,e,r,n,i){this.type=Ft,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Bt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ft)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Ft)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Bt))?null:new Er(r,i,o,a,s)},Er.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Er.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Tr=function(t){this.type=Bt,this.input=t};Tr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Gt(r.type)+" instead."):new Tr(r):null},Tr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ce("Expected value to be of type string or array, but found "+Gt(se(e))+" instead.")},Tr.prototype.eachChild=function(t){t(this.input)},Tr.prototype.outputDefined=function(){return!1},Tr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var kr={"==":gr,"!=":_r,">":br,"<":xr,">=":Sr,"<=":wr,array:pe,at:ur,boolean:pe,case:fr,coalesce:sr,collator:xe,format:fe,image:de,in:cr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Tr,let:lr,literal:ue,match:pr,number:pe,"number-format":Er,object:pe,slice:dr,step:Ve,string:pe,"to-boolean":ye,"to-color":ye,"to-number":ye,"to-string":ye,var:Ne,within:je};function Cr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new ce(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Ir(t,e){return t in e}function Pr(t,e){var r=e[t];return void 0===r?null:r}function Ar(t){return{type:t}}function Dr(t){return{result:"success",value:t}}function Mr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Or(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Lr(t){return!!t.expression&&t.expression.interpolated}function jr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Rr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Br(t){return t}function Fr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Nr(t,e,r,n,i){return Fr(typeof r===i?n[r]:void 0,t.default,e.default)}function Ur(t,e,r){if("number"!==jr(r))return Fr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=qe(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function qr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==jr(r))return Fr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=qe(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=We[e.type]||Br;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=ir[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,a)}}:u(s,l,a)}function Vr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):jr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Fr(r,t.default,e.default)}_e.register(kr,{error:[{kind:"error"},[Ft],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Ft,[Vt],function(t,e){return Gt(se(e[0].evaluate(t)))}],"to-rgba":[Yt(Bt,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Bt,Bt,Bt],Cr],rgba:[Ut,[Bt,Bt,Bt,Bt],Cr],has:{type:Nt,overloads:[[[Ft],function(t,e){return Ir(e[0].evaluate(t),t.properties())}],[[Ft,qt],function(t,e){var r=e[1];return Ir(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Vt,overloads:[[[Ft],function(t,e){return Pr(e[0].evaluate(t),t.properties())}],[[Ft,qt],function(t,e){var r=e[1];return Pr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Vt,[Ft],function(t,e){return Pr(e[0].evaluate(t),t.featureState||{})}],properties:[qt,[],function(t){return t.properties()}],"geometry-type":[Ft,[],function(t){return t.geometryType()}],id:[Vt,[],function(t){return t.id()}],zoom:[Bt,[],function(t){return t.globals.zoom}],"heatmap-density":[Bt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Bt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Vt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Bt,Ar(Bt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Bt,Ar(Bt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Bt,overloads:[[[Bt,Bt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Bt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Bt,[Bt,Bt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Bt,[Bt,Bt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Bt,[],function(){return Math.LN2}],pi:[Bt,[],function(){return Math.PI}],e:[Bt,[],function(){return Math.E}],"^":[Bt,[Bt,Bt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Bt,[Bt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Bt,[Bt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Bt,[Bt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Bt,[Bt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Bt,[Bt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Bt,[Bt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Bt,[Bt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Bt,[Bt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Bt,[Bt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Bt,[Bt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Bt,Ar(Bt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Bt,Ar(Bt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Bt,[Bt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Bt,[Bt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Bt,[Bt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Bt,[Bt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Nt,[Ft,Vt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Nt,[Vt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Nt,[Ft],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Nt,[Ft,Vt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<o}],"filter-id-<":[Nt,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Nt,[Ft,Vt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Nt,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Nt,[Ft,Vt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Nt,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Nt,[Ft,Vt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Nt,[Vt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Nt,[Vt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Nt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Nt,[Yt(Ft)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Nt,[Yt(Vt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Nt,[Ft,Yt(Vt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Nt,[Ft,Yt(Vt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Nt,overloads:[[[Nt,Nt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Ar(Nt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Ar(Nt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Nt,[Nt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Nt,[Ft],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Ft,[Ft],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ft,[Ft],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ft,Ar(Vt),function(t,e){return e.map((function(e){return le(e.evaluate(t))})).join("")}],"resolved-locale":[Ft,[Zt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Zr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ge,this._defaultValue=e?function(t){return"color"===t.type&&Rr(t.default)?new te(0,0,0,0):"color"===t.type?te.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in kr}function Hr(t,e){var r=new Ue(kr,[],e?function(t){var e={color:Ut,string:Ft,number:Bt,enum:Ft,boolean:Nt,formatted:Wt,resolvedImage:Ht};return"array"===t.type?Yt(e[t.value]||Vt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Dr(new Zr(n,e)):Mr(r.errors)}Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Zr.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Yr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Be(e.expression)};Yr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Yr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Gr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Be(e.expression),this.interpolationType=n};function Xr(t,e){if("error"===(t=Hr(t,e)).result)return t;var r=t.value.expression,n=Re(r);if(!n&&!zr(e))return Mr([new Lt("","data expressions not supported")]);var i=Fe(r,["zoom"]);if(!i&&!Or(e))return Mr([new Lt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof lr)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;n<i.length&&!(r=t(i[n]));n+=1);else(e instanceof Ve||e instanceof or)&&e.input instanceof _e&&"zoom"===e.input.name&&(r=e);return r instanceof Lt||e.eachChild((function(e){var n=t(e);n instanceof Lt?r=n:!r&&n?r=new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new Lt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r);return o||i?o instanceof Lt?Mr([o]):o instanceof or&&!Lr(e)?Mr([new Lt("",'"interpolate" expressions cannot be used with this property')]):Dr(o?new Gr(n?"camera":"composite",t.value,o.labels,o instanceof or?o.interpolation:void 0):new Yr(n?"constant":"source",t.value)):Mr([new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Gr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Gr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)},Gr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?or.interpolationFactor(this.interpolationType,t,e,r):0};var Kr=function(t,e){this._parameters=t,this._specification=e,Mt(this,function t(e,r){var n,i,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||!(s||void 0!==e.property),u=e.type||(Lr(r)?"exponential":"interval");if(a&&((e=Mt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],te.parse(t[1])]}))),e.default=te.parse(e.default?e.default:r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!ir[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)n=qr;else if("interval"===u)n=Ur;else if("categorical"===u){n=Nr,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var p=h[c];i[p[0]]=p[1]}o=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');n=Vr}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var y=e.stops[m],v=y[0].zoom;void 0===f[v]&&(f[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},d.push(v)),f[v].stops.push([y[0].value,y[1]])}for(var g=[],_=0,x=d;_<x.length;_+=1){var b=x[_];g.push([f[b].zoom,t(f[b],r)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:or.interpolationFactor.bind(void 0,w),zoomStops:g.map((function(t){return t[0]})),evaluate:function(t,n){var i=t.zoom;return qr({stops:g,base:e.base},r,i).evaluate(i,n)}}}if(l){var S="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:S,interpolationFactor:or.interpolationFactor.bind(void 0,S),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,r,t.zoom,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Fr(e.default,r.default):n(e,r,s,i,o)}}}(this._parameters,this._specification))};function Jr(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],l=jr(r);if("object"!==l)return[new At(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],h=n[c]||n["*"],p=void 0;if(i[c])p=i[c];else if(n[c])p=Sn;else if(i["*"])p=i["*"];else{if(!n["*"]){s.push(new At(e,r[u],'unknown property "'+u+'"'));continue}p=Sn}s=s.concat(p({key:(e?e+".":e)+u,value:r[u],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:u},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new At(e,r,'missing required property "'+f+'"'));return s}function $r(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Sn;if("array"!==jr(e))return[new At(o,e,"array expected, "+jr(e)+" found")];if(r.length&&e.length!==r.length)return[new At(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new At(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===jr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(a({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:i,key:o+"["+u+"]"}));return l}function Qr(t){var e=t.key,r=t.value,n=t.valueSpec,i=jr(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new At(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new At(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=zt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,l=!s,u="array"===jr(t.value.stops)&&"array"===jr(t.value.stops[0])&&"object"===jr(t.value.stops[0][0]),c=Jr({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 At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat($r({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===jr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return Sn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Lr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!zr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!Or(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==jr(o))return[new At(s,o,"array expected, "+jr(o)+" found")];if(2!==o.length)return[new At(s,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==jr(o[0]))return[new At(s,o,"object expected, "+jr(o[0])+" found")];if(void 0===o[0].zoom)return[new At(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new At(s,o,"object stop key must have value")];if(n&&n>zt(o[0].zoom))return[new At(s,o[0].zoom,"stop zoom values must appear in ascending order")];zt(o[0].zoom)!==n&&(n=zt(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Qr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Wr(Ot(o[1]))?e.concat([new At(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Sn({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=jr(t.value),l=zt(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new At(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return zr(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,u,c)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==r&&l<r?[new At(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===o&&l in a?[new At(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new At(t.key,u,"integer expected, found "+l)]}}function en(t){var e=("property"===t.expressionContext?Xr:Hr)(Ot(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new At(""+t.key+e.key,t.value,e.message)}));var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new At(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Be(r))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Be(r))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Fe(r,["zoom","feature-state"]))return[new At(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Re(r))return[new At(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rn(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(zt(r))&&i.push(new At(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(zt(r))&&i.push(new At(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function nn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!nn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Kr.deserialize=function(t){return new Kr(t._parameters,t._specification)},Kr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var on={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function an(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};nn(t)||(t=ln(t));var e=Hr(t,on);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,n){return e.value.evaluate(t,r,{},n)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function sn(t,e){return t<e?-1:t>e?1:0}function ln(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?pn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(ln))):"all"===r?["all"].concat(t.slice(1).map(ln)):"none"===r?["all"].concat(t.slice(1).map(ln).map(pn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?pn(cn(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function cn(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(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function fn(t){return nn(Ot(t.value))?en(Mt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==jr(r))return[new At(n,r,"array expected, "+jr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),zt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===zt(r[1])&&a.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=jr(r[1]))&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=jr(r[s]),"$type"===zt(r[1])?a=a.concat(rn({key:n+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new At(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)a=a.concat(t({key:n+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=jr(r[1]),2!==r.length?a.push(new At(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));break;case"within":i=jr(r[1]),2!==r.length?a.push(new At(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==i&&a.push(new At(n+"[1]",r[1],"object expected, "+i+" found"))}return a}(t)}function dn(t,e){var r=t.key,n=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Sn({key:r,value:o,valueSpec:i.transition,style:n,styleSpec:i});var u,c=t.valueSpec||s[a];if(!c)return[new At(r,o,'unknown property "'+a+'"')];if("string"===jr(o)&&zr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new At(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new At(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Rr(Ot(o))&&"identity"===zt(o.type)&&h.push(new At(r,o,'"text-font" does not support identity functions'))),h.concat(Sn({key:t.key,value:o,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function mn(t){return dn(t,"paint")}function yn(t){return dn(t,"layout")}function vn(t){var e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;r.type||r.ref||e.push(new At(n,r,'either "type" or "ref" is required'));var a,s=zt(r.type),l=zt(r.ref);if(r.id)for(var u=zt(r.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];zt(h.id)===u&&e.push(new At(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new At(n,r[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){zt(t.id)===l&&(a=t)})),a?a.ref?e.push(new At(n,r.ref,"ref cannot reference another ref layer")):s=zt(a.type):e.push(new At(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=i.sources&&i.sources[r.source],f=p&&zt(p.type);p?"vector"===f&&"raster"===s?e.push(new At(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new At(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new At(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&p.lineMetrics||e.push(new At(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new At(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new At(n,r.source,'source "'+r.source+'" not found'))}else e.push(new At(n,r,'missing required property "source"'));return e=e.concat(Jr({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Sn({key:n+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:fn,layout:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return yn(Mt({layerType:s},t))}}})},paint:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return mn(Mt({layerType:s},t))}}})}}}))}function gn(t){var e=t.value,r=t.key,n=jr(e);return"string"!==n?[new At(r,e,"string expected, "+n+" found")]:[]}var _n={promoteId:function(t){var e=t.key,r=t.value;if("string"===jr(r))return gn({key:e,value:r});var n=[];for(var i in r)n.push.apply(n,gn({key:e+"."+i,value:r[i]}));return n}};function xn(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new At(r,e,'"type" is required')];var o,a=zt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Jr({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:_n});case"geojson":if(o=Jr({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:_n}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c="string"==typeof u?[u,["accumulated"],["get",s]]:u;o.push.apply(o,en({key:r+"."+s+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,en({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Jr({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Jr({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new At(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rn({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function bn(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=jr(e);if(void 0===e)return o;if("object"!==a)return o.concat([new At("light",e,"object expected, "+a+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);o=o.concat(l&&n[l[1]]&&n[l[1]].transition?Sn({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r}):n[s]?Sn({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r}):[new At(s,e[s],'unknown property "'+s+'"')])}return o}var wn={"*":function(){return[]},array:$r,boolean:function(t){var e=t.value,r=t.key,n=jr(e);return"boolean"!==n?[new At(r,e,"boolean expected, "+n+" found")]:[]},number:Qr,color:function(t){var e=t.key,r=t.value,n=jr(r);return"string"!==n?[new At(e,r,"color expected, "+n+" found")]:null===Qt(r)?[new At(e,r,'color expected, "'+r+'" found')]:[]},constants:Dt,enum:rn,filter:fn,function:tn,layer:vn,object:Jr,source:xn,light:bn,string:gn,formatted:function(t){return 0===gn(t).length?[]:en(t)},resolvedImage:function(t){return 0===gn(t).length?[]:en(t)}};function Sn(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&Rr(zt(e))?tn(t):r.expression&&Wr(Ot(e))?en(t):r.type&&wn[r.type]?wn[r.type](t):Jr(Mt({},t,{valueSpec:r.type?n[r.type]:r}))}function En(t){var e=t.value,r=t.key,n=gn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new At(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new At(r,e,'"glyphs" url must include a "{range}" token'))),n}function Tn(t,e){void 0===e&&(e=Pt);var r=[];return r=r.concat(Sn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:En,"*":function(){return[]}}})),t.constants&&(r=r.concat(Dt({key:"constants",value:t.constants,style:t,styleSpec:e}))),kn(r)}function kn(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Cn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return kn(t.apply(this,e))}}Tn.source=Cn(xn),Tn.light=Cn(bn),Tn.layer=Cn(vn),Tn.filter=Cn(fn),Tn.paintProperty=Cn(mn),Tn.layoutProperty=Cn(yn);var In=Tn,Pn=In.light,An=In.paintProperty,Dn=In.layoutProperty;function Mn(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1)t.fire(new Ct(new Error(i[n].message))),r=!0;return r}var zn=On;function On(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];n.push(a===s?null:i.subarray(a,s))}var l=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c}On.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},On.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},On.prototype._insertCell=function(t,e,r,n,i,o){this.cells[i].push(o)},On.prototype.query=function(t,e,r,n,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},On.prototype._queryCell=function(t,e,r,n,i,o,a,s){var l=this.cells[i];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===a[p]){var f=4*p;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&n>=c[f+1])?(a[p]=!0,o.push(u[p])):a[p]=!1}}},On.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=l;p<=c;p++)for(var f=u;f<=h;f++){var d=this.d*f+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,o,a,s))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),i[3+t.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var Ln=a.ImageData,jn=a.ImageBitmap,Rn={};function Bn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Rn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var Fn in Bn("Object",Object),zn.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},zn.deserialize=function(t){return new zn(t.buffer)},Bn("Grid",zn),Bn("Color",te),Bn("Error",Error),Bn("ResolvedImage",ie),Bn("StylePropertyFunction",Kr),Bn("StyleExpression",Zr,{omit:["_evaluator"]}),Bn("ZoomDependentExpression",Gr),Bn("ZoomConstantExpression",Yr),Bn("CompoundExpression",_e,{omit:["_evaluate"]}),kr)kr[Fn]._classRegistryKey||Bn("Expression_"+Fn,kr[Fn]);function Nn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Un(t){return jn&&t instanceof jn}function qn(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(Nn(t)||Un(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Ln)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,o=t;i<o.length;i+=1)n.push(qn(o[i],e));return n}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var l=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var u in t)if(t.hasOwnProperty(u)&&!(Rn[s].omit.indexOf(u)>=0)){var c=t[u];l[u]=Rn[s].shallow.indexOf(u)>=0?c:qn(c,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(l.$name=s),l}throw new Error("can't serialize object of type "+typeof t)}function Vn(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||Nn(t)||Un(t)||ArrayBuffer.isView(t)||t instanceof Ln)return t;if(Array.isArray(t))return t.map(Vn);if("object"==typeof t){var e=t.$name||"Object",r=Rn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];n[a]=Rn[e].shallow.indexOf(a)>=0?s:Vn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Zn=function(){this.first=!0};Zn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Wn={"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 Hn(t){for(var e=0,r=t;e<r.length;e+=1)if(Yn(r[e].charCodeAt(0)))return!0;return!1}function Yn(t){return!(746!==t&&747!==t&&(t<4352||!(Wn["Bopomofo Extended"](t)||Wn.Bopomofo(t)||Wn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Wn["CJK Compatibility Ideographs"](t)||Wn["CJK Compatibility"](t)||Wn["CJK Radicals Supplement"](t)||Wn["CJK Strokes"](t)||!(!Wn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Wn["CJK Unified Ideographs Extension A"](t)||Wn["CJK Unified Ideographs"](t)||Wn["Enclosed CJK Letters and Months"](t)||Wn["Hangul Compatibility Jamo"](t)||Wn["Hangul Jamo Extended-A"](t)||Wn["Hangul Jamo Extended-B"](t)||Wn["Hangul Jamo"](t)||Wn["Hangul Syllables"](t)||Wn.Hiragana(t)||Wn["Ideographic Description Characters"](t)||Wn.Kanbun(t)||Wn["Kangxi Radicals"](t)||Wn["Katakana Phonetic Extensions"](t)||Wn.Katakana(t)&&12540!==t||!(!Wn["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)||!(!Wn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Wn["Unified Canadian Aboriginal Syllabics"](t)||Wn["Unified Canadian Aboriginal Syllabics Extended"](t)||Wn["Vertical Forms"](t)||Wn["Yijing Hexagram Symbols"](t)||Wn["Yi Syllables"](t)||Wn["Yi Radicals"](t))))}function Gn(t){return!(Yn(t)||function(t){return!!(Wn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Wn["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)||Wn["Letterlike Symbols"](t)||Wn["Number Forms"](t)||Wn["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)||Wn["Control Pictures"](t)&&9251!==t||Wn["Optical Character Recognition"](t)||Wn["Enclosed Alphanumerics"](t)||Wn["Geometric Shapes"](t)||Wn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Wn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Wn["CJK Symbols and Punctuation"](t)||Wn.Katakana(t)||Wn["Private Use Area"](t)||Wn["CJK Compatibility Forms"](t)||Wn["Small Form Variants"](t)||Wn["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 Xn(t){return t>=1424&&t<=2303||Wn["Arabic Presentation Forms-A"](t)||Wn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&Xn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Wn.Khmer(t))}function Jn(t){for(var e=0,r=t;e<r.length;e+=1)if(Xn(r[e].charCodeAt(0)))return!0;return!1}var $n=null,Qn="unavailable",ti=null,ei=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Qn="error"),$n&&$n(t)};function ri(){ni.fire(new kt("pluginStateChange",{pluginStatus:Qn,pluginURL:ti}))}var ni=new It,ii=function(){return Qn},oi=function(){if("deferred"!==Qn||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Qn="loading",ri(),ti&&xt({url:ti},(function(t){t?ei(t):(Qn="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Qn||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===Qn},setState:function(t){Qn=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Zn,this.transition={})};si.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!Kn(n[r].charCodeAt(0),e))return!1;return!0}(t,ai.isLoaded())},si.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},si.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var li=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Rr(t))return new Kr(t,e);if(Wr(t)){var r=Xr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};li.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},li.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ui=function(t){this.property=t,this.value=new li(t,void 0)};ui.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,p({},t.transition,this.transition),t.now)},ui.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].value=new li(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},ci.prototype.transitioned=function(t,e){for(var r=new pi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var o=i[n];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},ci.prototype.untransitioned=function(){for(var t=new pi(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var hi=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};hi.prototype.possiblyEvaluate=function(t,e,r){var n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return o.possiblyEvaluate(t,e,r);var a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new mi(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];n._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return n},pi.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var fi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};fi.prototype.getValue=function(t){return b(this._values[t].value)},fi.prototype.setValue=function(t,e){this._values[t]=new li(this._values[t].property,null===e?void 0:b(e))},fi.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},fi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new mi(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];n._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return n};var di=function(t,e,r){this.property=t,this.value=e,this.parameters=r};di.prototype.isConstant=function(){return"constant"===this.value.kind},di.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},di.prototype.evaluate=function(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)};var mi=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};mi.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,r){var n=We[this.specification.type];return n?n(t,e,r):t};var vi=function(t,e){this.specification=t,this.overrides=e};vi.prototype.possiblyEvaluate=function(t,e,r,n){return new di(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)},vi.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new di(this,{kind:"constant",value:void 0},t.parameters);var n=We[this.specification.type];return n?new di(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},vi.prototype.evaluate=function(t,e,r,n,i,o){return"constant"===t.kind?t.value:t.evaluate(e,r,n,i,o)};var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0===t.value)return new di(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n),o="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,a=this._calculate(o,o,o,e);return new di(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new di(this,{kind:"constant",value:s},e)}return new di(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n,i,o){if("source"===t.kind){var a=t.evaluate(e,r,n,i,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(vi),_i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},_i.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},_i.prototype.interpolate=function(t){return t};var xi=function(t){this.specification=t};xi.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},xi.prototype.interpolate=function(){return!1};var bi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new li(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ui(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Bn("DataDrivenProperty",vi),Bn("DataConstantProperty",yi),Bn("CrossFadedDataDrivenProperty",gi),Bn("CrossFadedProperty",_i),Bn("ColorRampProperty",xi);var wi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new fi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new mi(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Dn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(An,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),x(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Mn(this,t.call(In,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Pt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof di&&zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(It),Si={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=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},Ti=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ki(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=Si[t.type].BYTES_PER_ELEMENT,o=r=Ci(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ci(r,Math.max(n,e)),alignment:e}}function Ci(t,e){return Math.ceil(t/e)*e}Ti.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ti.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},Ti.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ti.prototype.clear=function(){this.length=0},Ti.prototype.resize=function(t){this.reserve(t),this.length=t},Ti.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)}},Ti.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ti);Ii.prototype.bytesPerElement=4,Bn("StructArrayLayout2i4",Ii);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Ti);Pi.prototype.bytesPerElement=8,Bn("StructArrayLayout4i8",Pi);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ti);Ai.prototype.bytesPerElement=12,Bn("StructArrayLayout2i4i12",Ai);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=o,this.uint8[l+7]=a,t},e}(Ti);Di.prototype.bytesPerElement=8,Bn("StructArrayLayout2i4ub8",Di);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ti);Mi.prototype.bytesPerElement=8,Bn("StructArrayLayout2f8",Mi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,l,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,l,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t},e}(Ti);zi.prototype.bytesPerElement=20,Bn("StructArrayLayout10ui20",zi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,l,u,c,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,l,u,c,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c,h,p){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t},e}(Ti);Oi.prototype.bytesPerElement=24,Bn("StructArrayLayout4i4ui4i24",Oi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ti);Li.prototype.bytesPerElement=12,Bn("StructArrayLayout3f12",Li);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Ti);ji.prototype.bytesPerElement=4,Bn("StructArrayLayout1ul4",ji);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,l){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,o,a,s,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,t},e}(Ti);Ri.prototype.bytesPerElement=20,Bn("StructArrayLayout6i1ul2ui20",Ri);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ti);Bi.prototype.bytesPerElement=12,Bn("StructArrayLayout2i2i2i12",Bi);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Ti);Fi.prototype.bytesPerElement=16,Bn("StructArrayLayout2f1f2i16",Fi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Ti);Ni.prototype.bytesPerElement=12,Bn("StructArrayLayout2ub2f12",Ni);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ti);Ui.prototype.bytesPerElement=6,Bn("StructArrayLayout3ui6",Ui);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v){var g=24*t,_=12*t,x=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[_+2]=o,this.uint32[_+3]=a,this.uint32[_+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=f,this.uint8[x+37]=d,this.uint8[x+38]=m,this.uint32[_+10]=y,this.int16[g+22]=v,t},e}(Ti);qi.prototype.bytesPerElement=48,Bn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v,g,_,x,b,w,S,E,T,k,C){var I=this.length;return this.resize(I+1),this.emplace(I,t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v,g,_,x,b,w,S,E,T,k,C)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v,g,_,x,b,w,S,E,T,k,C,I){var P=34*t,A=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=l,this.uint16[P+8]=u,this.uint16[P+9]=c,this.uint16[P+10]=h,this.uint16[P+11]=p,this.uint16[P+12]=f,this.uint16[P+13]=d,this.uint16[P+14]=m,this.uint16[P+15]=y,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=_,this.uint16[P+19]=x,this.uint16[P+20]=b,this.uint16[P+21]=w,this.uint16[P+22]=S,this.uint32[A+12]=E,this.float32[A+13]=T,this.float32[A+14]=k,this.float32[A+15]=C,this.float32[A+16]=I,t},e}(Ti);Vi.prototype.bytesPerElement=68,Bn("StructArrayLayout8i15ui1ul4f68",Vi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Ti);Zi.prototype.bytesPerElement=4,Bn("StructArrayLayout1f4",Zi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ti);Wi.prototype.bytesPerElement=6,Bn("StructArrayLayout3i6",Wi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ti);Hi.prototype.bytesPerElement=8,Bn("StructArrayLayout1ul2ui8",Hi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ti);Yi.prototype.bytesPerElement=4,Bn("StructArrayLayout2ui4",Yi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Ti);Gi.prototype.bytesPerElement=2,Bn("StructArrayLayout1ui2",Gi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Ti);Xi.prototype.bytesPerElement=16,Bn("StructArrayLayout4f16",Xi);var Ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ei);Ki.prototype.size=20;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(Ri);Bn("CollisionBoxArray",Ji);var $i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ei);$i.prototype.size=48;var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new $i(this,t)},e}(qi);Bn("PlacedSymbolArray",Qi);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ei);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(Vi);Bn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Zi);Bn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.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}(Wi);Bn("SymbolLineVertexArray",no);var io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ei);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(Hi);Bn("FeatureIndexArray",oo);var ao=ki([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function lo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&S("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},so.simpleSegment=function(t,e,r,n){return new so([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},so.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Bn("SegmentVector",so);var uo=ki([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),co=e((function(t){t.exports=function(t,e){var r,n,i,o,a,s,l,u;for(n=t.length-(r=3&t.length),i=e,a=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=co,fo=ho;po.murmur3=co,po.murmur2=fo;var mo=function(){this.ids=[],this.positions=[],this.indexed=!1};mo.prototype.add=function(t,e,r,n){this.ids.push(vo(t)),this.positions.push(e,r,n)},mo.prototype.getPositions=function(t){for(var e=vo(t),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},mo.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n<i;){for(var o=e[n+i>>1],a=n-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;go(e,a,s),go(r,3*a,3*s),go(r,3*a+1,3*s+1),go(r,3*a+2,3*s+2)}s-n<i-s?(t(e,r,n,s),n=s+1):(t(e,r,s+1,i),i=s)}}(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}},mo.deserialize=function(t){var e=new mo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var yo=Math.pow(2,53)-1;function vo(t){var e=+t;return!isNaN(e)&&e<=yo?e:po(String(t))}function go(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Bn("FeaturePositionMap",mo);var _o=function(t,e){this.gl=t.gl,this.location=e},xo=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(_o),bo=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(_o),wo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(_o),So=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(_o),Eo=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(_o),To=function(t){function e(e,r){t.call(this,e,r),this.current=te.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(_o),ko=new Float32Array(16),Co=function(t){function e(e,r){t.call(this,e,r),this.current=ko}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(_o);function Io(t){return[lo(255*t.r,255*t.g),lo(255*t.b,255*t.a)]}var Po=function(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r};Po.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},Po.prototype.getBinding=function(t,e,r){return"color"===this.type?new To(t,e):new bo(t,e)};var Ao=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Ao.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Ao.prototype.setUniform=function(t,e,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i)},Ao.prototype.getBinding=function(t,e,r){return"u_pattern"===r.substr(0,9)?new Eo(t,e):new bo(t,e)};var Do=function(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};Do.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.paintVertexArray.length,a=this.expression.evaluate(new si(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},Do.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i)},Do.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var n=Io(r),i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Do.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Do.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Mo=function(t,e,r,n,i,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o};Mo.prototype.populatePaintArray=function(t,e,r,n,i){var o=this.expression.evaluate(new si(this.zoom),e,{},n,[],i),a=this.expression.evaluate(new si(this.zoom+1),e,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},Mo.prototype.updatePaintArray=function(t,e,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),o=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,o)},Mo.prototype._setPaintValue=function(t,e,r,n){if("color"===this.type)for(var i=Io(r),o=Io(n),a=t;a<e;a++)this.paintVertexArray.emplace(a,i[0],i[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},Mo.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Mo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Mo.prototype.setUniform=function(t,e){var r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=c(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n)},Mo.prototype.getBinding=function(t,e,r){return new bo(t,e)};var zo=function(t,e,r,n,i,o){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=o,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};zo.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r)},zo.prototype.updatePaintArray=function(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i)},zo.prototype._setPaintValues=function(t,e,r,n){if(n&&r){var i=n[r.min],o=n[r.mid],a=n[r.max];if(i&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],o.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},zo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,uo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,uo.members,this.expression.isStateDependent))},zo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Oo=function(t,e,r){this.binders={},this._buffers=[];var n=[];for(var i in t.paint._values)if(r(i)){var o=t.paint.get(i);if(o instanceof di&&zr(o.property.specification)){var a=jo(i,t.type),s=o.value,l=o.property.specification.type,u=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[i]=h?new Ao(s.value,a):new Po(s.value,a,l),n.push("/u_"+i);else if("source"===s.kind||h){var p=Ro(i,l,"source");this.binders[i]=h?new zo(s,l,u,e,p,t.id):new Do(s,a,l,p),n.push("/a_"+i)}else{var f=Ro(i,l,"composite");this.binders[i]=new Mo(s,a,l,u,e,f),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};Oo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Do||e instanceof Mo?e.maxValue:0},Oo.prototype.populatePaintArrays=function(t,e,r,n,i){for(var o in this.binders){var a=this.binders[o];(a instanceof Do||a instanceof Mo||a instanceof zo)&&a.populatePaintArray(t,e,r,n,i)}},Oo.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var n=this.binders[r];n instanceof Ao&&n.setConstantPatternPositions(t,e)}},Oo.prototype.updatePaintArrays=function(t,e,r,n,i){var o=!1;for(var a in t)for(var s=0,l=e.getPositions(a);s<l.length;s+=1){var u=l[s],c=r.feature(u.index);for(var h in this.binders){var p=this.binders[h];if((p instanceof Do||p instanceof Mo||p instanceof zo)&&!0===p.expression.isStateDependent){var f=n.paint.get(h);p.expression=f.value,p.updatePaintArray(u.start,u.end,c,t[a],i),o=!0}}}return o},Oo.prototype.defines=function(){var t=[];for(var e in this.binders){var r=this.binders[e];(r instanceof Po||r instanceof Ao)&&t.push.apply(t,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Oo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof Do||r instanceof Mo)for(var n=0;n<r.paintVertexAttributes.length;n++)t.push(r.paintVertexAttributes[n].name);else if(r instanceof zo)for(var i=0;i<uo.members.length;i++)t.push(uo.members[i].name)}return t},Oo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var r=this.binders[e];if(r instanceof Po||r instanceof Ao||r instanceof Mo)for(var n=0,i=r.uniformNames;n<i.length;n+=1)t.push(i[n])}return t},Oo.prototype.getPaintVertexBuffers=function(){return this._buffers},Oo.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof Po||i instanceof Ao||i instanceof Mo)for(var o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var l=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:l})}}}return r},Oo.prototype.setUniforms=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,l=a.property;this.binders[l].setUniform(a.binding,n,r.get(l),s)}},Oo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r=this.binders[e];if(t&&r instanceof zo){var n=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof Do||r instanceof Mo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Oo.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Do||r instanceof Mo||r instanceof zo)&&r.upload(t)}this.updatePaintBuffers()},Oo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Do||e instanceof Mo||e instanceof zo)&&e.destroy()}};var Lo=function(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=t;n<i.length;n+=1){var o=i[n];this.programConfigurations[o.id]=new Oo(o,e,r)}this.needsUpload=!1,this._featureMap=new mo,this._bufferOffset=0};function jo(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function Ro(t,e,r){var n={color:{source:Mi,composite:Xi},number:{source:Zi,composite:Mi}},i=function(t){return{"line-pattern":{source:zi,composite:zi},"fill-pattern":{source:zi,composite:zi},"fill-extrusion-pattern":{source:zi,composite:zi}}[t]}(t);return i&&i[r]||n[e][r]}Lo.prototype.populatePaintArrays=function(t,e,r,n,i,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,n,i,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Lo.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,o=r;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,n)||this.needsUpload}},Lo.prototype.get=function(t){return this.programConfigurations[t]},Lo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Lo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Bn("ConstantBinder",Po),Bn("CrossFadedConstantBinder",Ao),Bn("SourceExpressionBinder",Do),Bn("CrossFadedCompositeBinder",zo),Bn("CompositeExpressionBinder",Mo),Bn("ProgramConfiguration",Oo,{omit:["_buffers"]}),Bn("ProgramConfigurationSet",Lo);var Bo=Math.pow(2,14)-1,Fo=-Bo-1;function No(t){for(var e=8192/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],o=0;o<i.length;o++){var a=i[o],s=Math.round(a.x*e),l=Math.round(a.y*e);a.x=c(s,Fo,Bo),a.y=c(l,Fo,Bo),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&S("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Uo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?No(t):[]}}function qo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Vo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ii,this.indexArray=new Ui,this.segments=new so,this.programConfigurations=new Lo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Zo(t,e){for(var r=0;r<t.length;r++)if(Qo(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(Qo(t,e[n]))return!0;return!!Go(t,e)}function Wo(t,e,r){return!!Qo(t,e)||!!Ko(e,t,r)}function Ho(t,e){if(1===t.length)return $o(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Qo(t,n[i]))return!0;for(var o=0;o<t.length;o++)if($o(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Go(t,e[a]))return!0;return!1}function Yo(t,e,r){if(t.length>1){if(Go(t,e))return!0;for(var n=0;n<e.length;n++)if(Ko(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(Ko(t[i],e,r))return!0;return!1}function Go(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],o=0;o<e.length-1;o++)if(Xo(n,i,e[o],e[o+1]))return!0;return!1}function Xo(t,e,r,n){return E(t,r,n)!==E(e,r,n)&&E(t,e,r)!==E(t,e,n)}function Ko(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(Jo(t,e[i-1],e[i])<n)return!0;return!1}function Jo(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function $o(t,e){for(var r,n,i,o=!1,a=0;a<t.length;a++)for(var s=0,l=(r=t[a]).length-1;s<r.length;l=s++)(n=r[s]).y>e.y!=(i=r[l]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Qo(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var o=E(t,e,r[0]);return o!==E(t,e,r[1])||o!==E(t,e,r[2])||o!==E(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],l=0;l<t.length;l++)s.push(t[l].sub(a));return s}Vo.prototype.populate=function(t,e,r){var n=this.layers[0],i=[],o=null;"circle"===n.type&&(o=n.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var l=s[a],u=l.feature,c=l.id,h=l.index,p=l.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=Uo(u,f);if(this.layers[0]._featureFilter.filter(new si(this.zoom),d,r)){var m=o?o.evaluate(d,{},r):void 0,y={id:c,properties:u.properties,type:u.type,sourceLayerIndex:p,index:h,geometry:f?d.geometry:No(u),patterns:{},sortKey:m};i.push(y)}}o&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var v=0,g=i;v<g.length;v+=1){var _=g[v],x=_.geometry,b=_.index,w=_.sourceLayerIndex,S=t[b].feature;this.addFeature(_,x,b,r),e.featureIndex.insert(S,x,b,w,this.index)}},Vo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Vo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Vo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Vo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ao),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Vo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Vo.prototype.addFeature=function(t,e,r,n){for(var i=0,o=e;i<o.length;i+=1)for(var a=0,s=o[i];a<s.length;a+=1){var l=s[a],u=l.x,c=l.y;if(!(u<0||u>=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;qo(this.layoutVertexArray,u,c,-1,-1),qo(this.layoutVertexArray,u,c,1,-1),qo(this.layoutVertexArray,u,c,1,1),qo(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Bn("CircleBucket",Vo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new vi(Pt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new vi(Pt.paint_circle["circle-radius"]),"circle-color":new vi(Pt.paint_circle["circle-color"]),"circle-blur":new vi(Pt.paint_circle["circle-blur"]),"circle-opacity":new vi(Pt.paint_circle["circle-opacity"]),"circle-translate":new yi(Pt.paint_circle["circle-translate"]),"circle-translate-anchor":new yi(Pt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new yi(Pt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new yi(Pt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new vi(Pt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new vi(Pt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new vi(Pt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function la(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],v=e[14],g=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*h+w*m,t[1]=_*i+x*l+b*p+w*y,t[2]=_*o+x*u+b*f+w*v,t[3]=_*a+x*c+b*d+w*g,t[4]=(_=r[4])*n+(x=r[5])*s+(b=r[6])*h+(w=r[7])*m,t[5]=_*i+x*l+b*p+w*y,t[6]=_*o+x*u+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,t[8]=(_=r[8])*n+(x=r[9])*s+(b=r[10])*h+(w=r[11])*m,t[9]=_*i+x*l+b*p+w*y,t[10]=_*o+x*u+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,t[12]=(_=r[12])*n+(x=r[13])*s+(b=r[14])*h+(w=r[15])*m,t[13]=_*i+x*l+b*p+w*y,t[14]=_*o+x*u+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var ua,ca=la;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}ua=new aa(3),aa!=Float32Array&&(ua[0]=0,ua[1]=0,ua[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Vo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var l=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return t.map((function(t){return fa(t,e)}))}(l,s),p=c?u*a:u,f=0,d=n;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var v=y[m],g=c?v:fa(v,s),_=p,x=ha([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/x[3]),Wo(h,g,_))return!0}return!1},e}(wi));function fa(t,e){var r=ha([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var da=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Vo);function ma(t,e,r,n){var i=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*o*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*o*r);return t.width=i,t.height=o,t.data=n,t}function ya(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var o=ma({},{width:n,height:i},r);va(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=o.data}}function va(t,e,r,n,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,l=0;l<i.height;l++)for(var u=((r.y+l)*t.width+r.x)*o,c=((n.y+l)*e.width+n.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[u+h];return e}Bn("HeatmapBucket",da,{omit:["layers"]});var ga=function(t,e){ma(this,t,1,e)};ga.prototype.resize=function(t){ya(this,t,1)},ga.prototype.clone=function(){return new ga({width:this.width,height:this.height},new Uint8Array(this.data))},ga.copy=function(t,e,r,n,i){va(t,e,r,n,i,1)};var _a=function(t,e){ma(this,t,4,e)};_a.prototype.resize=function(t){ya(this,t,4)},_a.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},_a.prototype.clone=function(){return new _a({width:this.width,height:this.height},new Uint8Array(this.data))},_a.copy=function(t,e,r,n,i){va(t,e,r,n,i,4)},Bn("AlphaImage",ga),Bn("RGBAImage",_a);var xa={paint:new bi({"heatmap-radius":new vi(Pt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new vi(Pt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new yi(Pt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new xi(Pt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new yi(Pt.paint_heatmap["heatmap-opacity"])})};function ba(t){var e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new _a({width:r,height:n}),o=function(r,n,o){e[t.evaluationKey]=o;var a=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*a.r/a.a),i.data[r+n+1]=Math.floor(255*a.g/a.a),i.data[r+n+2]=Math.floor(255*a.b/a.a),i.data[r+n+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<n;++a,s+=4*r)for(var l=0,u=0;l<r;l++,u+=4){var c=l/(r-1),h=t.clips[a];o(s,u,h.start*(1-c)+h.end*c)}else for(var p=0,f=0;p<r;p++,f+=4)o(0,f,p/(r-1));return i}var wa=function(t){function e(e){t.call(this,e,xa),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new da(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=ba({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),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}(wi),Sa={paint:new bi({"hillshade-illumination-direction":new yi(Pt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new yi(Pt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new yi(Pt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new yi(Pt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new yi(Pt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new yi(Pt.paint_hillshade["hillshade-accent-color"])})},Ea=function(t){function e(e){t.call(this,e,Sa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(wi),Ta=ki([{name:"a_pos",components:2,type:"Int16"}],4).members,ka=Ia,Ca=Ia;function Ia(t,e,r){r=r||2;var n,i,o,a,s,l,u,c=e&&e.length,h=c?e[0]*r:t.length,p=Pa(t,0,h,r,!0),f=[];if(!p||p.next===p.prev)return f;if(c&&(p=function(t,e,r,n){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Pa(t,e[i]*n,i<o-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),s.push(Na(a));for(s.sort(ja),i=0;i<s.length;i++)Ra(s[i],r),r=Aa(r,r.next);return r}(t,e,p,r)),t.length>80*r){n=o=t[0],i=a=t[1];for(var d=r;d<h;d+=r)(s=t[d])<n&&(n=s),(l=t[d+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-n,a-i))?1/u:0}return Da(p,f,r,n,i,u),f}function Pa(t,e,r,n,i){var o,a;if(i===Qa(t,e,r,n)>0)for(o=e;o<r;o+=n)a=Ka(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=Ka(o,t[o],t[o+1],a);return a&&Za(a,a.next)&&(Ja(a),a=a.next),a}function Aa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Za(n,n.next)&&0!==Va(n.prev,n,n.next))n=n.next;else{if(Ja(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Da(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Fa(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,l,u=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1)}(i)}(t,n,i,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?za(t,n,i,o):Ma(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),Ja(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?Da(t=Oa(Aa(t),e,r),e,r,n,i,o,2):2===a&&La(t,e,r,n,i,o):Da(Aa(t),e,r,n,i,o,1);break}}}function Ma(t){var e=t.prev,r=t,n=t.next;if(Va(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ua(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Va(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function za(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Va(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,u=Fa(i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,e,r,n),c=Fa(s,l,e,r,n),h=t.prevZ,p=t.nextZ;h&&h.z>=u&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=u;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Va(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Oa(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Za(i,o)&&Wa(i,n,n.next,o)&&Ga(i,o)&&Ga(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ja(n),Ja(n.next),n=t=o),n=n.next}while(n!==t);return Aa(n)}function La(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&qa(a,s)){var l=Xa(a,s);return a=Aa(a,a.next),l=Aa(l,l.next),Da(a,e,r,n,i,o),void Da(l,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function ja(t,e){return t.x-e.x}function Ra(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===a)return r;var l,u=r,c=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&Ua(o<h?i:a,o,c,h,o<h?a:i,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(i-n.x),Ga(n,t)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&Ba(r,n)))&&(r=n,p=l)),n=n.next}while(n!==u);return r}(t,e)){var r=Xa(e,t);Aa(e,e.next),Aa(r,r.next)}}function Ba(t,e){return Va(t.prev,t,e.prev)<0&&Va(e.next,t,t.next)<0}function Fa(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Na(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function Ua(t,e,r,n,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Wa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ga(t,e)&&Ga(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Va(t.prev,t,e.prev)||Va(t,e.prev,e))||Za(t,e)&&Va(t.prev,t,t.next)>0&&Va(e.prev,e,e.next)>0)}function Va(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Za(t,e){return t.x===e.x&&t.y===e.y}function Wa(t,e,r,n){var i=Ya(Va(t,e,r)),o=Ya(Va(t,e,n)),a=Ya(Va(r,n,t)),s=Ya(Va(r,n,e));return i!==o&&a!==s||!(0!==i||!Ha(t,r,e))||!(0!==o||!Ha(t,n,e))||!(0!==a||!Ha(r,t,n))||!(0!==s||!Ha(r,e,n))}function Ha(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ya(t){return t>0?1:t<0?-1:0}function Ga(t,e){return Va(t.prev,t,t.next)<0?Va(t,e,t.next)>=0&&Va(t,t.prev,e)>=0:Va(t,e,t.prev)<0||Va(t,t.next,e)<0}function Xa(t,e){var r=new $a(t.i,t.x,t.y),n=new $a(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ka(t,e,r,n){var i=new $a(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ja(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function $a(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Qa(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function ts(t,e,r,n,i){!function t(e,r,n,i,o){for(;i>n;){if(i-n>600){var a=i-n+1,s=r-n+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*u/a+c)),Math.min(i,Math.floor(r+(a-s)*u/a+c)),o)}var h=e[r],p=n,f=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p<f;){for(es(e,p,f),p++,f--;o(e[p],h)<0;)p++;for(;o(e[f],h)>0;)f--}0===o(e[n],h)?es(e,n,f):es(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return t<e?-1:t>e?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a<r;a++){var s=T(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&o.push(n),n=[t[a]]):n.push(t[a]))}if(n&&o.push(n),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(ts(o[l],e,1,o[l].length-1,is),o[l]=o[l].slice(0,e));return o}function is(t,e){return e.area-t.area}function os(t,e,r){for(var n=r.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function as(t,e,r,n,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},r,{},i.availableImages),h=u.evaluate({zoom:n},r,{},i.availableImages),p=u.evaluate({zoom:n+1},r,{},i.availableImages);h=h&&h.name?h.name:h,p=p&&p.name?p.name:p,o[c=c&&c.name?c.name:c]=!0,o[h]=!0,o[p]=!0,r.patterns[l.id]={min:c,mid:h,max:p}}}return r}Ia.deviation=function(t,e,r,n){var i=e&&e.length,o=Math.abs(Qa(t,0,i?e[0]*r:t.length,r));if(i)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(Qa(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var l=0;for(a=0;a<n.length;a+=3){var u=n[a]*r,c=n[a+1]*r,h=n[a+2]*r;l+=Math.abs((t[u]-t[h])*(t[c+1]-t[u+1])-(t[u]-t[c])*(t[h+1]-t[u+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ia.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&r.holes.push(n+=t[i-1].length)}return r},ka.default=Ca;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ii,this.indexArray=new Ui,this.indexArray2=new Yi,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=Uo(l,p);if(this.layers[0]._featureFilter.filter(new si(this.zoom),f,r)){var d=n?n.evaluate(f,{},r,e.availableImages):void 0,m={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:p?f.geometry:No(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var g=v[y],_=g.geometry,x=g.index,b=g.sourceLayerIndex;if(this.hasPattern){var w=as("fill",this.layers,g,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(g,_,x,r,{});e.featureIndex.insert(t[x].feature,_,x,b,this.index)}},ss.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},ss.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},ss.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ss.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ss.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ta),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ss.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ss.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=ns(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=h.vertexLength,f=[],d=[],m=0,y=s;m<y.length;m+=1){var v=y[m];if(0!==v.length){v!==s[0]&&d.push(f.length/2);var g=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),_=g.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(_+v.length-1,_),f.push(v[0].x),f.push(v[0].y);for(var x=1;x<v.length;x++)this.layoutVertexArray.emplaceBack(v[x].x,v[x].y),this.indexArray2.emplaceBack(_+x-1,_+x),f.push(v[x].x),f.push(v[x].y);g.vertexLength+=v.length,g.primitiveLength+=v.length}}for(var b=ka(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(p+b[w],p+b[w+1],p+b[w+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Bn("FillBucket",ss,{omit:["layers","patternFeatures"]});var ls=new bi({"fill-sort-key":new vi(Pt.layout_fill["fill-sort-key"])}),us={paint:new bi({"fill-antialias":new yi(Pt.paint_fill["fill-antialias"]),"fill-opacity":new vi(Pt.paint_fill["fill-opacity"]),"fill-color":new vi(Pt.paint_fill["fill-color"]),"fill-outline-color":new vi(Pt.paint_fill["fill-outline-color"]),"fill-translate":new yi(Pt.paint_fill["fill-translate"]),"fill-translate-anchor":new yi(Pt.paint_fill["fill-translate-anchor"]),"fill-pattern":new gi(Pt.paint_fill["fill-pattern"])}),layout:ls},cs=function(t){function e(e){t.call(this,e,us)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new ss(t)},e.prototype.queryRadius=function(){return ra(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a){return Ho(na(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),n)},e.prototype.isTileClipped=function(){return!0},e}(wi),hs=ki([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,ps=fs;function fs(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(ds,this,e)}function ds(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function ms(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;i<o;a=i++)n+=((r=t[a]).x-(e=t[i]).x)*(e.y+r.y);return n}fs.types=["Unknown","Point","LineString","Polygon"],fs.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,o=0,a=0,s=0,l=[];t.pos<r;){if(o<=0){var u=t.readVarint();n=7&u,o=u>>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},fs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,u]},fs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=fs.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],o=0;o<e;o++){var a=ms(t[o]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[o]]):r.push(t[o]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var ys=vs;function vs(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(gs,this,e),this.length=this._features.length}function gs(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function _s(t,e,r){if(3===t){var n=new ys(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}vs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ps(this._pbf,e,this.extent,this._keys,this._values)};var xs={VectorTile:function(t,e){this.layers=t.readFields(_s,{},e)},VectorTileFeature:ps,VectorTileLayer:ys},bs=xs.VectorTileFeature.types,ws=Math.pow(2,13);function Ss(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ws)+a,i*ws*2,o*ws*2,Math.round(s))}var Es=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ai,this.indexArray=new Ui,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ts(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Es.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n<i.length;n+=1){var o=i[n],a=o.feature,s=o.id,l=o.index,u=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h=Uo(a,c);if(this.layers[0]._featureFilter.filter(new si(this.zoom),h,r)){var p={id:s,sourceLayerIndex:u,index:l,geometry:c?h.geometry:No(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(as("fill-extrusion",this.layers,p,this.zoom,e)):this.addFeature(p,p.geometry,l,r,{}),e.featureIndex.insert(a,p.geometry,l,u,this.index,!0)}}},Es.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.features;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},Es.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Es.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Es.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Es.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Es.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Es.prototype.addFeature=function(t,e,r,n,i){for(var o=0,a=ns(e,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1)l+=c[u].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,f=s;p<f.length;p+=1){var d=f[p];if(0!==d.length&&!((M=d).every((function(t){return t.x<0}))||M.every((function(t){return t.x>8192}))||M.every((function(t){return t.y<0}))||M.every((function(t){return t.y>8192}))))for(var m=0,y=0;y<d.length;y++){var v=d[y];if(y>=1){var g=d[y-1];if(!Ts(v,g)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _=v.sub(g)._perp()._unit(),x=g.dist(v);m+x>32768&&(m=0),Ss(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,0,m),Ss(this.layoutVertexArray,v.x,v.y,_.x,_.y,0,1,m),Ss(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,0,m+=x),Ss(this.layoutVertexArray,g.x,g.y,_.x,_.y,0,1,m);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var w=[],S=[],E=h.vertexLength,T=0,k=s;T<k.length;T+=1){var C=k[T];if(0!==C.length){C!==s[0]&&S.push(w.length/2);for(var I=0;I<C.length;I++){var P=C[I];Ss(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),w.push(P.x),w.push(P.y)}}}for(var A=ka(w,S),D=0;D<A.length;D+=3)this.indexArray.emplaceBack(E+A[D],E+A[D+2],E+A[D+1]);h.primitiveLength+=A.length/3,h.vertexLength+=l}}var M;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Bn("FillExtrusionBucket",Es,{omit:["layers","features"]});var ks={paint:new bi({"fill-extrusion-opacity":new yi(Pt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new vi(Pt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new yi(Pt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new yi(Pt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new gi(Pt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new vi(Pt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new vi(Pt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new yi(Pt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Cs=function(t){function e(e){t.call(this,e,ks)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Es(t)},e.prototype.queryRadius=function(){return ra(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s,l){var u=na(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),p=function(t,e,r,n){for(var o=[],a=0,s=t;a<s.length;a+=1){var l=s[a],u=[l.x,l.y,0,1];ha(u,u,e),o.push(new i(u[0]/u[3],u[1]/u[3]))}return o}(u,l),f=function(t,e,r,n){for(var o=[],a=[],s=n[8]*e,l=n[9]*e,u=n[10]*e,c=n[11]*e,h=n[8]*r,p=n[9]*r,f=n[10]*r,d=n[11]*r,m=0,y=t;m<y.length;m+=1){for(var v=[],g=[],_=0,x=y[m];_<x.length;_+=1){var b=x[_],w=b.x,S=b.y,E=n[0]*w+n[4]*S+n[12],T=n[1]*w+n[5]*S+n[13],k=n[2]*w+n[6]*S+n[14],C=n[3]*w+n[7]*S+n[15],I=k+u,P=C+c,A=E+h,D=T+p,M=k+f,z=C+d,O=new i((E+s)/P,(T+l)/P);O.z=I/P,v.push(O);var L=new i(A/z,D/z);L.z=M/z,g.push(L)}o.push(v),a.push(g)}return[o,a]}(n,h,c,l);return function(t,e,r){var n=1/0;Ho(r,e)&&(n=Ps(r,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var l=o[s],u=[l,o[s+1],a[s+1],a[s],l];Zo(r,u)&&(n=Math.min(n,Ps(r,u)))}return n!==1/0&&n}(f[0],f[1],p)},e}(wi);function Is(t,e){return t.x*e.x+t.y*e.y}function Ps(t,e){if(1===t.length){for(var r,n=0,i=e[n++];!r||i.equals(r);)if(!(r=e[n++]))return 1/0;for(;n<e.length;n++){var o=e[n],a=t[0],s=r.sub(i),l=o.sub(i),u=a.sub(i),c=Is(s,s),h=Is(s,l),p=Is(l,l),f=Is(u,s),d=Is(u,l),m=c*p-h*h,y=(p*f-h*d)/m,v=(c*d-h*f)/m,g=i.z*(1-y-v)+r.z*y+o.z*v;if(isFinite(g))return g}return 1/0}for(var _=1/0,x=0,b=e;x<b.length;x+=1)_=Math.min(_,b[x].z);return _}var As=ki([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Ds=ki([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Ms=xs.VectorTileFeature.types,zs=Math.cos(Math.PI/180*37.5),Os=Math.pow(2,14)/.5,Ls=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Di,this.layoutVertexArray2=new Mi,this.indexArray=new Ui,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ls.prototype.populate=function(t,e,r){this.hasPattern=os("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.id,c=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,f=Uo(l,p);if(this.layers[0]._featureFilter.filter(new si(this.zoom),f,r)){var d=n?n.evaluate(f,{},r):void 0,m={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:p?f.geometry:No(l),patterns:{},sortKey:d};i.push(m)}}n&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var g=v[y],_=g.geometry,x=g.index,b=g.sourceLayerIndex;if(this.hasPattern){var w=as("line",this.layers,g,this.zoom,e);this.patternFeatures.push(w)}else this.addFeature(g,_,x,r,{});e.featureIndex.insert(t[x].feature,_,x,b,this.index)}},Ls.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ls.prototype.addFeatures=function(t,e,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var o=i[n];this.addFeature(o,o.geometry,o.index,e,r)}},Ls.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ls.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ls.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ds)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,As),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ls.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ls.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},Ls.prototype.addFeature=function(t,e,r,n,i){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),u=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,h=e;c<h.length;c+=1)this.addLine(h[c],t,a,s,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n)},Ls.prototype.addLine=function(t,e,r,n,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===Ms[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var u=0;u<l-1&&t[u].equals(t[u+1]);)u++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var c,h=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=t[u].sub(c=t[l-2])._unit()._perp());for(var v=u;v<l;v++)if(!(d=v===l-1?s?t[u+1]:void 0:t[v+1])||!t[v].equals(d)){y&&(m=y),c&&(f=c),c=t[v],y=d?d.sub(c)._unit()._perp():m;var g=(m=m||y).add(y);0===g.x&&0===g.y||g._unit();var _=m.x*y.x+m.y*y.y,x=g.x*y.x+g.y*y.y,b=0!==x?1/x:1/0,w=2*Math.sqrt(2-2*x),S=x<zs&&f&&d,E=m.x*y.y-m.y*y.x>0;if(S&&v>u){var T=c.dist(f);if(T>2*h){var k=c.sub(c.sub(f)._mult(h/T)._round());this.updateDistance(f,k),this.addCurrentVertex(k,m,0,0,p),f=k}}var C=f&&d,I=C?r:s?"butt":n;if(C&&"round"===I&&(b<o?I="miter":b<=2&&(I="fakeround")),"miter"===I&&b>i&&(I="bevel"),"bevel"===I&&(b>2&&(I="flipbevel"),b<i&&(I="miter")),f&&this.updateDistance(f,c),"miter"===I)g._mult(b),this.addCurrentVertex(c,g,0,0,p);else if("flipbevel"===I){if(b>100)g=y.mult(-1);else{var P=b*m.add(y).mag()/m.sub(y).mag();g._perp()._mult(P*(E?-1:1))}this.addCurrentVertex(c,g,0,0,p),this.addCurrentVertex(c,g.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var A=-Math.sqrt(b*b-1),D=E?A:0,M=E?0:A;if(f&&this.addCurrentVertex(c,m,D,M,p),"fakeround"===I)for(var z=Math.round(180*w/Math.PI/20),O=1;O<z;O++){var L=O/z;if(.5!==L){var j=L-.5;L+=L*j*(L-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*j*j+(.848013+_*(.215638*_-1.06021)))}var R=y.sub(m)._mult(L)._add(m)._unit()._mult(E?-1:1);this.addHalfVertex(c,R.x,R.y,!1,E,0,p)}d&&this.addCurrentVertex(c,y,-D,-M,p)}else if("butt"===I)this.addCurrentVertex(c,g,0,0,p);else if("square"===I){var B=f?1:-1;this.addCurrentVertex(c,g,B,B,p)}else"round"===I&&(f&&(this.addCurrentVertex(c,m,0,0,p),this.addCurrentVertex(c,m,1,1,p,!0)),d&&(this.addCurrentVertex(c,y,-1,-1,p,!0),this.addCurrentVertex(c,y,0,0,p)));if(S&&v<l-1){var F=c.dist(d);if(F>2*h){var N=c.add(d.sub(c)._mult(h/F)._round());this.updateDistance(c,N),this.addCurrentVertex(N,y,0,0,p),c=N}}}}},Ls.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Os/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ls.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Os-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),i?this.e2=l:this.e1=l},Ls.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ls.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Bn("LineBucket",Ls,{omit:["layers","patternFeatures"]});var js=new bi({"line-cap":new yi(Pt.layout_line["line-cap"]),"line-join":new vi(Pt.layout_line["line-join"]),"line-miter-limit":new yi(Pt.layout_line["line-miter-limit"]),"line-round-limit":new yi(Pt.layout_line["line-round-limit"]),"line-sort-key":new vi(Pt.layout_line["line-sort-key"])}),Rs={paint:new bi({"line-opacity":new vi(Pt.paint_line["line-opacity"]),"line-color":new vi(Pt.paint_line["line-color"]),"line-translate":new yi(Pt.paint_line["line-translate"]),"line-translate-anchor":new yi(Pt.paint_line["line-translate-anchor"]),"line-width":new vi(Pt.paint_line["line-width"]),"line-gap-width":new vi(Pt.paint_line["line-gap-width"]),"line-offset":new vi(Pt.paint_line["line-offset"]),"line-blur":new vi(Pt.paint_line["line-blur"]),"line-dasharray":new _i(Pt.paint_line["line-dasharray"]),"line-pattern":new gi(Pt.paint_line["line-pattern"]),"line-gradient":new xi(Pt.paint_line["line-gradient"])}),layout:js},Bs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new si(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(vi))(Rs.paint.properties["line-width"].specification);Bs.useIntegerZoom=!0;var Fs=function(t){function e(e){t.call(this,e,Rs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ve,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Bs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ls(t)},e.prototype.queryRadius=function(t){var e=t,r=Ns(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var l=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),u=s/2*Ns(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],l=0;l<a.length;l++){var u=a[l],c=a[l+1],h=0===l?n:u.sub(a[l-1])._unit()._perp(),p=l===a.length-1?n:c.sub(u)._unit()._perp(),f=h._add(p)._unit();f._mult(1/(f.x*p.x+f.y*p.y)),s.push(f._mult(e)._add(u))}r.push(s)}return r}(n,c*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var o=0;o<i.length;o++)if(Qo(t,i[o]))return!0;if(Yo(t,i,r))return!0}return!1}(l,n,u)},e.prototype.isTileClipped=function(){return!0},e}(wi);function Ns(t,e){return e>0?e+2*t:t}var Us=ki([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qs=ki([{name:"a_projected_pos",components:3,type:"Float32"}],4),Vs=(ki([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ki([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Zs=(ki([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),ki([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ws=ki([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Hs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}ki([{name:"triangle",components:3,type:"Uint16"}]),ki([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),ki([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ki([{type:"Float32",name:"offsetX"}]),ki([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ys={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂"},Gs=function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},Xs=function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m},Ks=Js;function Js(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Js.Varint=0,Js.Fixed64=1,Js.Bytes=2,Js.Fixed32=5;var $s="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Qs(t){return t.type===Js.Bytes?t.readVarint()+t.pos:t.pos+1}function tl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function el(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function rl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function nl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function il(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function ol(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function al(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function sl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function ll(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ul(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function cl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function hl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function pl(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function fl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function dl(t,e,r){1===t&&r.readMessage(ml,e)}function ml(t,e,r){if(3===t){var n=r.readMessage(yl,{}),i=n.width,o=n.height,a=n.left,s=n.top,l=n.advance;e.push({id:n.id,bitmap:new ga({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:l}})}}function yl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function vl(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var h=c[u],p=a.length-1;p>=0;p--){var f=a[p];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var d=a.pop();p<a.length&&(a[p]=d)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(a.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}Js.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=fl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*fl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Gs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Gs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tl(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tl(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tl(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tl(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tl(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&$s?function(t,e,r){return $s.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var o,a,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Js.Bytes)return t.push(this.readVarint(e));var r=Qs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Js.Bytes)return t.push(this.readSVarint());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Js.Bytes)return t.push(this.readBoolean());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Js.Bytes)return t.push(this.readFloat());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Js.Bytes)return t.push(this.readDouble());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed32());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed32());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readFixed64());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Js.Bytes)return t.push(this.readSFixed64());var e=Qs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Js.Varint)for(;this.buf[this.pos++]>127;);else if(e===Js.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Js.Fixed32)this.pos+=4;else{if(e!==Js.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),pl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),pl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),pl(this.buf,-1&t,this.pos),pl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),pl(this.buf,-1&t,this.pos),pl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&el(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Xs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Xs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&el(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Js.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writeBytesField:function(t,e){this.writeTag(t,Js.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Js.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Js.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Js.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Js.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Js.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Js.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var gl=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},_l={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_l.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},_l.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},_l.tlbr.get=function(){return this.tl.concat(this.br)},_l.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(gl.prototype,_l);var xl=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=vl(i),a=new _a({width:o.w||1,height:o.h||1});for(var s in t){var l=t[s],u=r[s].paddedRect;_a.copy(l.data,a,{x:0,y:0},{x:u.x+1,y:u.y+1},l.data)}for(var c in e){var h=e[c],p=n[c].paddedRect,f=p.x+1,d=p.y+1,m=h.data.width,y=h.data.height;_a.copy(h.data,a,{x:0,y:0},{x:f,y:d},h.data),_a.copy(h.data,a,{x:0,y:y-1},{x:f,y:d-1},{width:m,height:1}),_a.copy(h.data,a,{x:0,y:0},{x:f,y:d+y},{width:m,height:1}),_a.copy(h.data,a,{x:m-1,y:0},{x:f-1,y:d},{width:1,height:y}),_a.copy(h.data,a,{x:0,y:0},{x:f+m,y:d},{width:1,height:y})}this.image=a,this.iconPositions=r,this.patternPositions=n};xl.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new gl(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},xl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},xl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Bn("ImagePosition",gl),Bn("ImageAtlas",xl);var bl={horizontal:1,vertical:2,horizontalOnly:3},wl=function(){this.scale=1,this.fontStack="",this.imageName=null};wl.forText=function(t,e){var r=new wl;return r.scale=t||1,r.fontStack=e,r},wl.forImage=function(t){var e=new wl;return e.imageName=t,e};var Sl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function El(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m){var y,v=Sl.fromFeature(t,i);h===bl.vertical&&v.verticalizePunctuation();var g=ai.processBidirectionalText,_=ai.processStyledBidirectionalText;if(g&&1===v.sections.length){y=[];for(var x=0,b=g(v.toString(),Dl(v,u,o,e,n,f,d));x<b.length;x+=1){var w=b[x],S=new Sl;S.text=w,S.sections=v.sections;for(var E=0;E<w.length;E++)S.sectionIndex.push(0);y.push(S)}}else if(_){y=[];for(var T=0,k=_(v.text,v.sectionIndex,Dl(v,u,o,e,n,f,d));T<k.length;T+=1){var C=k[T],I=new Sl;I.text=C[0],I.sectionIndex=C[1],I.sections=v.sections,y.push(I)}}else y=function(t,e){for(var r=[],n=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(v,Dl(v,u,o,e,n,f,d));var P=[],A={positionedLines:P,text:v.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,r,n,i,o,a,s,l,u,c,h){for(var p=0,f=-17,d=0,m=0,y="right"===s?1:"left"===s?0:.5,v=0,g=0,_=i;g<_.length;g+=1){var x=_[g];x.trim();var b=x.getMaxScale(),w=24*(b-1),S={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=S;var E=S.positionedGlyphs,T=0;if(x.length()){for(var k=0;k<x.length();k++){var C=x.getSection(k),I=x.getSectionIndex(k),P=x.getCharCode(k),A=0,D=null,M=null,z=null,O=24,L=!(l===bl.horizontal||!c&&!Yn(P)||c&&(Tl[P]||(Z=P,Wn.Arabic(Z)||Wn["Arabic Supplement"](Z)||Wn["Arabic Extended-A"](Z)||Wn["Arabic Presentation Forms-A"](Z)||Wn["Arabic Presentation Forms-B"](Z))));if(C.imageName){var j=n[C.imageName];if(!j)continue;z=C.imageName,t.iconsInText=t.iconsInText||!0,M=j.paddedRect;var R=j.displaySize;C.scale=24*C.scale/h,A=w+(24-R[1]*C.scale),O=(D={width:R[0],height:R[1],left:1,top:-3,advance:L?R[1]:R[0]}).advance;var B=L?R[0]*C.scale-24*b:R[1]*C.scale-24*b;B>0&&B>T&&(T=B)}else{var F=r[C.fontStack],N=F&&F[P];if(N&&N.rect)M=N.rect,D=N.metrics;else{var U=e[C.fontStack],q=U&&U[P];if(!q)continue;D=q.metrics}A=24*(b-C.scale)}L?(t.verticalizable=!0,E.push({glyph:P,imageName:z,x:p,y:f+A,vertical:L,scale:C.scale,fontStack:C.fontStack,sectionIndex:I,metrics:D,rect:M}),p+=O*C.scale+u):(E.push({glyph:P,imageName:z,x:p,y:f+A,vertical:L,scale:C.scale,fontStack:C.fontStack,sectionIndex:I,metrics:D,rect:M}),p+=D.advance*C.scale+u)}0!==E.length&&(d=Math.max(p-u,d),zl(E,0,E.length-1,y,T)),p=0;var V=o*b+T;S.lineOffset=Math.max(T,w),f+=V,m=Math.max(V,m),++v}else f+=o,++v}var Z,W=f- -17,H=Ml(a),Y=H.horizontalAlign,G=H.verticalAlign;(function(t,e,r,n,i,o,a,s,l){var u,c=(e-r)*i;u=o!==a?-s*n- -17:(-n*l+.5)*a;for(var h=0,p=t;h<p.length;h+=1)for(var f=0,d=p[h].positionedGlyphs;f<d.length;f+=1){var m=d[f];m.x+=c,m.y+=u}})(t.positionedLines,y,Y,G,d,m,o,W,i.length),t.top+=-G*W,t.bottom=t.top+W,t.left+=-Y*d,t.right=t.left+d}(A,e,r,n,y,a,s,l,h,u,p,m),!function(t){for(var e=0,r=t;e<r.length;e+=1)if(0!==r[e].positionedGlyphs.length)return!1;return!0}(P)&&A}Sl.fromFeature=function(t,e){for(var r=new Sl,n=0;n<t.sections.length;n++){var i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e)}return r},Sl.prototype.length=function(){return this.text.length},Sl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},Sl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},Sl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},Sl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Gn(n)&&!Ys[t[r+1]]||i&&Gn(i)&&!Ys[t[r-1]]||!Ys[t[r]]?t[r]:Ys[t[r]]}return e}(this.text)},Sl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Tl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&Tl[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Sl.prototype.substring=function(t,e){var r=new Sl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Sl.prototype.toString=function(){return this.text},Sl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Sl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(wl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(r)},Sl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(wl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):S("Reached maximum number of images 6401")}else S("Can't add FormattedSection with an empty image.")},Sl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Tl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},kl={};function Cl(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],l=s&&s[t];return l?l.metrics.advance*e.scale+i:0}function Il(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Pl(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Al(t,e,r,n,i,o){for(var a=null,s=Il(e,r,i,o),l=0,u=n;l<u.length;l+=1){var c=u[l],h=Il(e-c.x,r,i,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function Dl(t,e,r,n,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,l=[],u=function(t,e,r,n,i,o){for(var a=0,s=0;s<t.length();s++){var l=t.getSection(s);a+=Cl(t.getCharCode(s),l,n,i,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n,i,a),c=t.text.indexOf("​")>=0,h=0,p=0;p<t.length();p++){var f=t.getSection(p),d=t.getCharCode(p);if(Tl[d]||(h+=Cl(d,f,n,i,e,a)),p<t.length()-1){var m=!((s=d)<11904||!(Wn["Bopomofo Extended"](s)||Wn.Bopomofo(s)||Wn["CJK Compatibility Forms"](s)||Wn["CJK Compatibility Ideographs"](s)||Wn["CJK Compatibility"](s)||Wn["CJK Radicals Supplement"](s)||Wn["CJK Strokes"](s)||Wn["CJK Symbols and Punctuation"](s)||Wn["CJK Unified Ideographs Extension A"](s)||Wn["CJK Unified Ideographs"](s)||Wn["Enclosed CJK Letters and Months"](s)||Wn["Halfwidth and Fullwidth Forms"](s)||Wn.Hiragana(s)||Wn["Ideographic Description Characters"](s)||Wn["Kangxi Radicals"](s)||Wn["Katakana Phonetic Extensions"](s)||Wn.Katakana(s)||Wn["Vertical Forms"](s)||Wn["Yi Radicals"](s)||Wn["Yi Syllables"](s)));(kl[d]||m||f.imageName)&&l.push(Al(p+1,h,u,l,Pl(d,t.getCharCode(p+1),m&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Al(t.length(),h,u,l,0,!0))}function Ml(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function zl(t,e,r,n,i){if(n||i)for(var o=t[r],a=(t[r].x+o.metrics.advance*o.scale)*n,s=e;s<=r;s++)t[s].x-=a,t[s].y+=i}function Ol(t,e,r,n,i,o){var a,s=t.image;if(s.content){var l=s.content,u=s.pixelRatio||1;a=[l[0]/u,l[1]/u,s.displaySize[0]-l[2]/u,s.displaySize[1]-l[3]/u]}var c,h,p,f,d=e.left*o,m=e.right*o;"width"===r||"both"===r?(f=i[0]+d-n[3],h=i[0]+m+n[1]):h=(f=i[0]+(d+m-s.displaySize[0])/2)+s.displaySize[0];var y=e.top*o,v=e.bottom*o;return"height"===r||"both"===r?(c=i[1]+y-n[0],p=i[1]+v+n[2]):p=(c=i[1]+(y+v-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:p,left:f,collisionPadding:a}}kl[10]=!0,kl[32]=!0,kl[38]=!0,kl[40]=!0,kl[41]=!0,kl[43]=!0,kl[45]=!0,kl[47]=!0,kl[173]=!0,kl[183]=!0,kl[8203]=!0,kl[8208]=!0,kl[8211]=!0,kl[8231]=!0;var Ll=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);function jl(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new si(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var s=n[o],l=n[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new si(s)),maxSize:r.evaluate(new si(l)),interpolationType:i}}function Rl(t,e,r){var n=e.uSize,i=r.lowerSize;return"source"===t.kind?i/128:"composite"===t.kind?Ze(i/128,r.upperSize/128,e.uSizeT):n}function Bl(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,o=i?c(or.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=Ze(t.minSize,t.maxSize,o):r=o}return{uSizeT:r,uSize:n}}Bn("Anchor",Ll);var Fl=Object.freeze({__proto__:null,getSizeData:jl,evaluateSizeForFeature:Rl,evaluateSizeForZoom:Bl,SIZE_PACK_FACTOR:128});function Nl(t,e,r,n,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var l=[],u=0;s<r/2;){var c=t[a],h=t[a+1];if(!h)return!1;var p=t[a-1].angleTo(c)-c.angleTo(h);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),u+=p;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=c.dist(h)}return!0}function Ul(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function ql(t,e,r){return t?.6*e*r:0}function Vl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Zl(t,e,r,n,i,o){for(var a=ql(r,i,o),s=Vl(r,n)*o,l=0,u=Ul(t)/2,c=0;c<t.length-1;c++){var h=t[c],p=t[c+1],f=h.dist(p);if(l+f>u){var d=(u-l)/f,m=Ze(h.x,p.x,d),y=Ze(h.y,p.y,d),v=new Ll(m,y,p.angleTo(h),c);return v._round(),!a||Nl(t,v,s,a,e)?v:void 0}l+=f}}function Wl(t,e,r,n,i,o,a,s,l){var u=ql(n,o,a),c=Vl(n,i),h=c*a,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,r,n,i,o,a,s,l,u){for(var c=a/2,h=Ul(e),p=0,f=r-n,d=[],m=0;m<e.length-1;m++){for(var y=e[m],v=e[m+1],g=y.dist(v),_=v.angleTo(y);f+n<p+g;){var x=((f+=n)-p)/g,b=Ze(y.x,v.x,x),w=Ze(y.y,v.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-c>=0&&f+c<=h){var S=new Ll(b,w,_,m);S._round(),i&&!Nl(e,S,a,i,o)||d.push(S)}}p+=g}return l||d.length||s||(d=t(e,p/2,n,i,o,a,s,!0,u)),d}(t,p?e/2*s%e:(c/2+2*o)*a*s%e,e,u,r,h,p,!1,l)}function Hl(t,e,r,n,o){for(var a=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var h=l[c],p=l[c+1];h.x<e&&p.x<e||(h.x<e?h=new i(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x<e&&(p=new i(e,h.y+(e-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y<r&&p.y<r||(h.y<r?h=new i(h.x+(r-h.y)/(p.y-h.y)*(p.x-h.x),r)._round():p.y<r&&(p=new i(h.x+(r-h.y)/(p.y-h.y)*(p.x-h.x),r)._round()),h.x>=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),u&&h.equals(u[u.length-1])||a.push(u=[h]),u.push(p)))))}return a}function Yl(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,u=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,l]],f=a.stretchY||[[0,u]],d=function(t,e){return t+e[1]-e[0]},m=p.reduce(d,0),y=f.reduce(d,0),v=l-m,g=u-y,_=0,x=m,b=0,w=y,S=0,E=v,T=0,k=g;if(a.content&&n){var C=a.content;_=Gl(p,0,C[0]),b=Gl(f,0,C[1]),x=Gl(p,C[0],C[2]),w=Gl(f,C[1],C[3]),S=C[0]-_,T=C[1]-b,E=C[2]-C[0]-x,k=C[3]-C[1]-w}var I=function(n,o,l,u){var p=Kl(n.stretch-_,x,c,t.left),f=Jl(n.fixed-S,E,n.stretch,m),d=Kl(o.stretch-b,w,h,t.top),v=Jl(o.fixed-T,k,o.stretch,y),g=Kl(l.stretch-_,x,c,t.left),C=Jl(l.fixed-S,E,l.stretch,m),I=Kl(u.stretch-b,w,h,t.top),P=Jl(u.fixed-T,k,u.stretch,y),A=new i(p,d),D=new i(g,d),M=new i(g,I),z=new i(p,I),O=new i(f/s,v/s),L=new i(C/s,P/s),j=e*Math.PI/180;if(j){var R=Math.sin(j),B=Math.cos(j),F=[B,-R,R,B];A._matMult(F),D._matMult(F),z._matMult(F),M._matMult(F)}var N=n.stretch+n.fixed,U=o.stretch+o.fixed;return{tl:A,tr:D,bl:z,br:M,tex:{x:a.paddedRect.x+1+N,y:a.paddedRect.y+1+U,w:l.stretch+l.fixed-N,h:u.stretch+u.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:L,minFontScaleX:E/s/c,minFontScaleY:k/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var P=Xl(p,v,m),A=Xl(f,g,y),D=0;D<P.length-1;D++)for(var M=P[D],z=P[D+1],O=0;O<A.length-1;O++)o.push(I(M,A[O],z,A[O+1]));else o.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return o}function Gl(t,e,r){for(var n=0,i=0,o=t;i<o.length;i+=1){var a=o[i];n+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return n}function Xl(t,e,r){for(var n=[{fixed:-1,stretch:0}],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a[0],l=a[1],u=n[n.length-1];n.push({fixed:s-u.stretch,stretch:u.stretch}),n.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return n.push({fixed:e+1,stretch:r}),n}function Kl(t,e,r,n){return t/e*r+n}function Jl(t,e,r,n){return t-e*r/n}var $l=function(t,e,r,n,o,a,s,l,u,c){if(this.boxStartIndex=t.length,u){var h=a.top,p=a.bottom,f=a.collisionPadding;f&&(h-=f[1],p+=f[3]);var d=p-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var m=a.top*s-l,y=a.bottom*s+l,v=a.left*s-l,g=a.right*s+l,_=a.collisionPadding;if(_&&(v-=_[0]*s,m-=_[1]*s,g+=_[2]*s,y+=_[3]*s),c){var x=new i(v,m),b=new i(g,m),w=new i(v,y),S=new i(g,y),E=c*Math.PI/180;x._rotate(E),b._rotate(E),w._rotate(E),S._rotate(E),v=Math.min(x.x,b.x,w.x,S.x),g=Math.max(x.x,b.x,w.x,S.x),m=Math.min(x.y,b.y,w.y,S.y),y=Math.max(x.y,b.y,w.y,S.y)}t.emplaceBack(e.x,e.y,v,m,g,y,r,n,o)}this.boxEndIndex=t.length},Ql=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function tu(t,e){return t<e?-1:t>e?1:0}function eu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<n)&&(n=c.x),(!u||c.y<o)&&(o=c.y),(!u||c.x>a)&&(a=c.x),(!u||c.y>s)&&(s=c.y)}var h=Math.min(a-n,s-o),p=h/2,f=new Ql([],ru);if(0===h)return new i(n,o);for(var d=n;d<a;d+=h)for(var m=o;m<s;m+=h)f.push(new nu(d+p,m+p,p,t));for(var y=function(t){for(var e=0,r=0,n=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var l=i[o],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new nu(r/e,n/e,0,t)}(t),v=f.length;f.length;){var g=f.pop();(g.d>y.d||!y.d)&&(y=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-y.d<=e||(f.push(new nu(g.p.x-(p=g.h/2),g.p.y-p,p,t)),f.push(new nu(g.p.x+p,g.p.y-p,p,t)),f.push(new nu(g.p.x-p,g.p.y+p,p,t)),f.push(new nu(g.p.x+p,g.p.y+p,p,t)),v+=4)}return r&&(console.log("num probes: "+v),console.log("best distance: "+y.d)),y.p}function ru(t,e){return e.max-t.max}function nu(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,l=s-1;a<s;l=a++){var u=o[a],c=o[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,Jo(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Ql.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Ql.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Ql.prototype.peek=function(){return this.data[0]},Ql.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},Ql.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(o=s,a=e[s]),r(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var iu=Number.POSITIVE_INFINITY;function ou(t,e){return e[1]!==iu?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function au(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function su(t,e,r,n,o,a,s,l,u,c,h,p,f,d,m){var y=function(t,e,r,n,o,a,s,l){for(var u=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,p=e.positionedLines;h<p.length;h+=1)for(var f=p[h],d=0,m=f.positionedGlyphs;d<m.length;d+=1){var y=m[d];if(y.rect){var v=y.rect||{},g=4,_=!0,x=1,b=0,w=(o||l)&&y.vertical,S=y.metrics.advance*y.scale/2;if(l&&e.verticalizable&&(b=f.lineOffset/2-(y.imageName?-(24-y.metrics.width*y.scale)/2:24*(y.scale-1))),y.imageName){var E=s[y.imageName];_=E.sdf,g=1/(x=E.pixelRatio)}var T=o?[y.x+S,y.y]:[0,0],k=o?[0,0]:[y.x+S+r[0],y.y+r[1]-b],C=[0,0];w&&(C=k,k=[0,0]);var I=(y.metrics.left-g)*y.scale-S+k[0],P=(-y.metrics.top-g)*y.scale+k[1],A=I+v.w*y.scale/x,D=P+v.h*y.scale/x,M=new i(I,P),z=new i(A,P),O=new i(I,D),L=new i(A,D);if(w){var j=new i(-S,S- -17),R=-Math.PI/2,B=12-S,F=new i(22-B,-(y.imageName?B:0)),N=new(Function.prototype.bind.apply(i,[null].concat(C)));M._rotateAround(R,j)._add(F)._add(N),z._rotateAround(R,j)._add(F)._add(N),O._rotateAround(R,j)._add(F)._add(N),L._rotateAround(R,j)._add(F)._add(N)}if(u){var U=Math.sin(u),q=Math.cos(u),V=[q,-U,U,q];M._matMult(V),z._matMult(V),O._matMult(V),L._matMult(V)}var Z=new i(0,0),W=new i(0,0);c.push({tl:M,tr:z,bl:O,br:L,tex:v,writingMode:e.writingMode,glyphOffset:T,sectionIndex:y.sectionIndex,isSDF:_,pixelOffsetTL:Z,pixelOffsetBR:W,minFontScaleX:0,minFontScaleY:0})}}return c}(0,r,l,o,a,s,n,t.allowVerticalPlacement),v=t.textSizeData,g=null;"source"===v.kind?(g=[128*o.layout.get("text-size").evaluate(s,{})])[0]>32640&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||g[1]>32640)&&S(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,g,l,a,s,c,e,u.lineStartIndex,u.lineLength,f,m);for(var _=0,x=h;_<x.length;_+=1)p[x[_]]=t.text.placedSymbolArray.length-1;return 4*y.length}function lu(t){for(var e in t)return t[e];return null}function uu(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}else i[e]=[];return i[e].push(n),!1}var cu=xs.VectorTileFeature.types,hu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pu(t,e,r,n,i,o,a,s,l,u,c,h,p){var f=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),o,a,(f<<1)+(l?1:0),d,16*u,16*c,256*h,256*p)}function fu(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function du(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(Jn(r[e].text))return!0;return!1}var mu=function(t){this.layoutVertexArray=new Oi,this.indexArray=new Ui,this.programConfigurations=t,this.segments=new so,this.dynamicLayoutVertexArray=new Li,this.opacityVertexArray=new ji,this.placedSymbolArray=new Qi};mu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},mu.prototype.upload=function(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Us.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,qs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t))},mu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Bn("SymbolBuffers",mu);var yu=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new so,this.collisionVertexArray=new Ni};yu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Vs.members,!0)},yu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Bn("CollisionBuffers",yu);var vu=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=sa([]),this.placementViewportMatrix=sa([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=jl(this.zoom,e["text-size"]),this.iconSizeData=jl(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return bl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};vu.prototype.createArrays=function(){this.text=new mu(new Lo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new mu(new Lo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new ro,this.lineVertexArray=new no,this.symbolInstances=new eo},vu.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(r||n)&&i){var a=Ys[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},vu.prototype.populate=function(t,e,r){var n=this.layers[0],i=n.layout,o=i.get("text-font"),a=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==a.value.kind||a.value.value instanceof ne&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],l||u){for(var h=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new si(this.zoom),m=0,y=t;m<y.length;m+=1){var v=y[m],g=v.feature,_=v.id,x=v.index,b=v.sourceLayerIndex,w=n._featureFilter.needGeometry,S=Uo(g,w);if(n._featureFilter.filter(d,S,r)){w||(S.geometry=No(g));var E=void 0;if(l){var T=n.getValueAndResolveTokens("text-field",S,r,f),k=ne.factory(T);du(k)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ii()||this.hasRTLText&&ai.isParsed())&&(E=Hs(k,n,S))}var C=void 0;if(u){var I=n.getValueAndResolveTokens("icon-image",S,r,f);C=I instanceof ie?I:ie.fromString(I)}if(E||C){var P=this.sortFeaturesByKey?c.evaluate(S,{},r):void 0;if(this.features.push({id:_,text:E,icon:C,index:x,sourceLayerIndex:b,geometry:S.geometry,properties:g.properties,type:cu[g.type],sortKey:P}),C&&(h[C.name]=!0),E){var A=o.evaluate(S,{},r).join(","),D="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bl.vertical)>=0;for(var M=0,z=E.sections;M<z.length;M+=1){var O=z[M];if(O.image)h[O.image.name]=!0;else{var L=Hn(E.toString()),j=O.fontStack||A,R=p[j]=p[j]||{};this.calculateGlyphDependencies(O.text,R,D,this.allowVerticalPlacement,L)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function o(e){n.push(t[e]),i++}function a(t,e,i){var o=r[t];return delete r[t],r[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(i[0]),o}function s(t,r,i){var o=e[r];return delete e[r],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=i[0].concat(n[o].geometry[0]),o}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.text?c.text.toString():null;if(p){var f=l(p,h),d=l(p,h,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,h),y=a(f,d,n[m].geometry);delete e[f],delete r[d],r[l(p,n[y].geometry,!0)]=y,n[m].geometry=null}else f in r?a(f,d,h):d in e?s(f,d,h):(o(u),e[f]=i-1,r[d]=i-1)}else o(u)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},vu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},vu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},vu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},vu.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},vu.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},vu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},vu.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:n},a<e.length-1&&(n+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},vu.prototype.addSymbols=function(t,e,r,n,i,o,a,s,l,u,c,h){for(var p=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,p,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,y=d.vertexLength,v=this.allowVerticalPlacement&&a===bl.vertical?Math.PI/2:0,g=o.text&&o.text.sections,_=0;_<e.length;_++){var x=e[_],b=x.tl,w=x.tr,S=x.bl,E=x.br,T=x.tex,k=x.pixelOffsetTL,C=x.pixelOffsetBR,I=x.minFontScaleX,P=x.minFontScaleY,A=x.glyphOffset,D=x.isSDF,M=x.sectionIndex,z=d.vertexLength,O=A[1];pu(f,s.x,s.y,b.x,O+b.y,T.x,T.y,r,D,k.x,k.y,I,P),pu(f,s.x,s.y,w.x,O+w.y,T.x+T.w,T.y,r,D,C.x,k.y,I,P),pu(f,s.x,s.y,S.x,O+S.y,T.x,T.y+T.h,r,D,k.x,C.y,I,P),pu(f,s.x,s.y,E.x,O+E.y,T.x+T.w,T.y+T.h,r,D,C.x,C.y,I,P),fu(t.dynamicLayoutVertexArray,s,v),p.emplaceBack(z,z+1,z+2),p.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(A[0]),_!==e.length-1&&M===e[_+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},h,g&&g[M])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,l,u,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,c)},vu.prototype._addCollisionDebugVertex=function(t,e,r,n,i,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(o.x),Math.round(o.y))},vu.prototype.addCollisionDebugVertices=function(t,e,r,n,o,a,s){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,p=s.anchorX,f=s.anchorY;this._addCollisionDebugVertex(c,h,a,p,f,new i(t,e)),this._addCollisionDebugVertex(c,h,a,p,f,new i(r,e)),this._addCollisionDebugVertex(c,h,a,p,f,new i(r,n)),this._addCollisionDebugVertex(c,h,a,p,f,new i(t,n)),l.vertexLength+=4;var d=o.indexArray;d.emplaceBack(u,u+1),d.emplaceBack(u+1,u+2),d.emplaceBack(u+2,u+3),d.emplaceBack(u+3,u),l.primitiveLength+=4},vu.prototype.addDebugCollisionBoxes=function(t,e,r,n){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r)}},vu.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yu(Bi,Zs.members,Yi),this.iconCollisionBox=new yu(Bi,Zs.members,Yi);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},vu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,o,a,s,l){for(var u={},c=e;c<r;c++){var h=t.get(c);u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}for(var p=n;p<i;p++){var f=t.get(p);u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}for(var d=o;d<a;d++){var m=t.get(d);u.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},u.iconFeatureIndex=m.featureIndex;break}for(var y=s;y<l;y++){var v=t.get(y);u.verticalIconBox={x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,anchorPointX:v.anchorPointX,anchorPointY:v.anchorPointY},u.verticalIconFeatureIndex=v.featureIndex;break}return u},vu.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},vu.prototype.hasTextData=function(){return this.text.segments.get().length>0},vu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},vu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},vu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},vu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},vu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},vu.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||i[e]-i[t]})),o},vu.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},vu.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=this.symbolInstances.get(n[r]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Bn("SymbolBucket",vu,{omit:["layers","collisionBoxArray","features","compareText"]}),vu.MAX_GLYPHS=65535,vu.addDynamicAttributes=fu;var gu=new bi({"symbol-placement":new yi(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new yi(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new yi(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new vi(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new yi(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new yi(Pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new yi(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new yi(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new yi(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new vi(Pt.layout_symbol["icon-size"]),"icon-text-fit":new yi(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new yi(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new vi(Pt.layout_symbol["icon-image"]),"icon-rotate":new vi(Pt.layout_symbol["icon-rotate"]),"icon-padding":new yi(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new yi(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new vi(Pt.layout_symbol["icon-offset"]),"icon-anchor":new vi(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new yi(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new yi(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new yi(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new vi(Pt.layout_symbol["text-field"]),"text-font":new vi(Pt.layout_symbol["text-font"]),"text-size":new vi(Pt.layout_symbol["text-size"]),"text-max-width":new vi(Pt.layout_symbol["text-max-width"]),"text-line-height":new yi(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new vi(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new vi(Pt.layout_symbol["text-justify"]),"text-radial-offset":new vi(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new yi(Pt.layout_symbol["text-variable-anchor"]),"text-anchor":new vi(Pt.layout_symbol["text-anchor"]),"text-max-angle":new yi(Pt.layout_symbol["text-max-angle"]),"text-writing-mode":new yi(Pt.layout_symbol["text-writing-mode"]),"text-rotate":new vi(Pt.layout_symbol["text-rotate"]),"text-padding":new yi(Pt.layout_symbol["text-padding"]),"text-keep-upright":new yi(Pt.layout_symbol["text-keep-upright"]),"text-transform":new vi(Pt.layout_symbol["text-transform"]),"text-offset":new vi(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new yi(Pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new yi(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new yi(Pt.layout_symbol["text-optional"])}),_u={paint:new bi({"icon-opacity":new vi(Pt.paint_symbol["icon-opacity"]),"icon-color":new vi(Pt.paint_symbol["icon-color"]),"icon-halo-color":new vi(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new vi(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new vi(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new yi(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new yi(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new vi(Pt.paint_symbol["text-opacity"]),"text-color":new vi(Pt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new vi(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new vi(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new vi(Pt.paint_symbol["text-halo-blur"]),"text-translate":new yi(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new yi(Pt.paint_symbol["text-translate-anchor"])}),layout:gu},xu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Rt,this.defaultValue=t};xu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},xu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},xu.prototype.outputDefined=function(){return!1},xu.prototype.serialize=function(){return null},Bn("FormatSectionOverride",xu,{omit:["defaultValue"]});var bu=function(t){function e(e){t.call(this,e,_u)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o<a.length;o+=1){var s=a[o];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,r,n){var i=this.layout.get(t).evaluate(e,{},r,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Wr(o.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,r){return r in t?String(t[r]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new vu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=_u.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,o=this.paint.get(n),a=new xu(o),s=new Zr(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new Yr("source",s):new Gr("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[n]=new di(o.property,i,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=_u.paint.properties[e],i=!1,o=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof ne)o(r.value.value.sections);else if("source"===r.value.kind){var a=function(t){i||(t instanceof ue&&se(t.value)===Wt?o(t.value.sections):t instanceof fe?o(t.sections):t.eachChild(a))},s=r.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e}(wi),wu={paint:new bi({"background-color":new yi(Pt.paint_background["background-color"]),"background-pattern":new _i(Pt.paint_background["background-pattern"]),"background-opacity":new yi(Pt.paint_background["background-opacity"])})},Su=function(t){function e(e){t.call(this,e,wu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(wi),Eu={paint:new bi({"raster-opacity":new yi(Pt.paint_raster["raster-opacity"]),"raster-hue-rotate":new yi(Pt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new yi(Pt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new yi(Pt.paint_raster["raster-brightness-max"]),"raster-saturation":new yi(Pt.paint_raster["raster-saturation"]),"raster-contrast":new yi(Pt.paint_raster["raster-contrast"]),"raster-resampling":new yi(Pt.paint_raster["raster-resampling"]),"raster-fade-duration":new yi(Pt.paint_raster["raster-fade-duration"])})},Tu=function(t){function e(e){t.call(this,e,Eu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(wi),ku=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(wi),Cu={circle:pa,heatmap:wa,hillshade:Ea,fill:cs,"fill-extrusion":Cs,line:Fs,symbol:bu,background:Su,raster:Tu},Iu=a.HTMLImageElement,Pu=a.HTMLCanvasElement,Au=a.HTMLVideoElement,Du=a.ImageData,Mu=a.ImageBitmap,zu=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};zu.prototype.update=function(t,e,r){var n=t.width,i=t.height,o=!(this.size&&this.size[0]===n&&this.size[1]===i||r),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[n,i],t instanceof Iu||t instanceof Pu||t instanceof Au||t instanceof Du||Mu&&t instanceof Mu?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof Iu||t instanceof Pu||t instanceof Au||t instanceof Du||Mu&&t instanceof Mu?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},zu.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},zu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},zu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Ou=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Ou.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Ou.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Lu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new Ou(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:a};function ju(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Lu.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=P(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:qn(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId})}}},Lu.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Lu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Lu.prototype.processTask=function(t,e){var r=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Vn(e.error)):n(null,Vn(e.data)))}else{var i=!1,o=P(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"<response>",sourceMapId:r.mapId,error:e?qn(e):null,data:qn(n,o)},o)}:function(t){i=!0},s=null,l=Vn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,l,a);else if(this.parent.getWorkerSource){var u=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,u[0],l.source)[u[1]](l,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Lu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Ru=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Ru.prototype.setNorthEast=function(t){return this._ne=t instanceof Bu?new Bu(t.lng,t.lat):Bu.convert(t),this},Ru.prototype.setSouthWest=function(t){return this._sw=t instanceof Bu?new Bu(t.lng,t.lat):Bu.convert(t),this},Ru.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Bu)e=t,r=t;else{if(!(t instanceof Ru))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ru.convert(t)):this.extend(Bu.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Bu(e.lng,e.lat),this._ne=new Bu(r.lng,r.lat)),this},Ru.prototype.getCenter=function(){return new Bu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Ru.prototype.getSouthWest=function(){return this._sw},Ru.prototype.getNorthEast=function(){return this._ne},Ru.prototype.getNorthWest=function(){return new Bu(this.getWest(),this.getNorth())},Ru.prototype.getSouthEast=function(){return new Bu(this.getEast(),this.getSouth())},Ru.prototype.getWest=function(){return this._sw.lng},Ru.prototype.getSouth=function(){return this._sw.lat},Ru.prototype.getEast=function(){return this._ne.lng},Ru.prototype.getNorth=function(){return this._ne.lat},Ru.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Ru.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Ru.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Ru.prototype.contains=function(t){var e=Bu.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},Ru.convert=function(t){return!t||t instanceof Ru?t:new Ru(t)};var Bu=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Bu.prototype.wrap=function(){return new Bu(h(this.lng,-180,180),this.lat)},Bu.prototype.toArray=function(){return[this.lng,this.lat]},Bu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Bu.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Bu.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Ru(new Bu(this.lng-r,this.lat-e),new Bu(this.lng+r,this.lat+e))},Bu.convert=function(t){if(t instanceof Bu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Bu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Bu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Fu=2*Math.PI*6371008.8;function Nu(t){return Fu*Math.cos(t*Math.PI/180)}function Uu(t){return(180+t)/360}function qu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Vu(t,e){return t/Nu(e)}function Zu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Wu=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Wu.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Bu.convert(t);return new Wu(Uu(r.lng),qu(r.lat),Vu(e,r.lat))},Wu.prototype.toLngLat=function(){return new Bu(360*this.x-180,Zu(this.y))},Wu.prototype.toAltitude=function(){return this.z*Nu(Zu(this.y))},Wu.prototype.meterInMercatorCoordinateUnits=function(){return 1/Fu*(t=Zu(this.y),1/Math.cos(t*Math.PI/180));var t};var Hu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Xu(0,t,t,e,r)};Hu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Hu.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=ju(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=ju(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),l=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<<o-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Hu.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Hu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Yu=function(t,e){this.wrap=t,this.canonical=e,this.key=Xu(t,e.z,e.z,e.x,e.y)},Gu=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Hu(r,+n,+i),this.key=Xu(e,t,r,n,i)};function Xu(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}Gu.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Gu.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Gu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Gu.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Xu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Xu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Gu.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Gu.prototype.children=function(t){if(this.overscaledZ>=t)return[new Gu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Gu(e,this.wrap,e,r,n),new Gu(e,this.wrap,e,r+1,n),new Gu(e,this.wrap,e,r,n+1),new Gu(e,this.wrap,e,r+1,n+1)]},Gu.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Gu.prototype.wrapped=function(){return new Gu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Gu.prototype.unwrapTo=function(t){return new Gu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Gu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Gu.prototype.toUnwrapped=function(){return new Yu(this.wrap,this.canonical)},Gu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Gu.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Wu(t.x-this.wrap,t.y))},Bn("CanonicalTileID",Hu),Bn("OverscaledTileID",Gu,{omit:["posMatrix"]});var Ku=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return S('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Ku.prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Ku.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ku.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Ku.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Ku.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Ku.prototype.getPixels=function(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ku.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,l=-r*this.dim,u=o;u<a;u++)for(var c=n;c<i;c++)this.data[this._idx(c,u)]=t.data[this._idx(c+s,u+l)]},Bn("DEMData",Ku);var Ju=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Ju.prototype.encode=function(t){return this._stringToNumber[t]},Ju.prototype.decode=function(t){return this._numberToString[t]};var $u=function(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i},Qu={geometry:{configurable:!0}};Qu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Qu.geometry.set=function(t){this._geometry=t},$u.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties($u.prototype,Qu);var tc=function(){this.state={},this.stateChanges={},this.deletedStates={}};tc.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var o in this.deletedStates[t][n]={},this.state[t][n])r[o]||(this.deletedStates[t][n][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][a]&&delete this.deletedStates[t][n][a]},tc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},tc.prototype.getState=function(t,e){var r=String(e),n=p({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return{};for(var o in i)delete n[o]}return n},tc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tc.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var o in this.stateChanges[n])this.state[n][o]||(this.state[n][o]={}),p(this.state[n][o],this.stateChanges[n][o]),i[o]=this.state[n][o];r[n]=i}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var l in this.state[a])s[l]={},this.state[a][l]={};else for(var u in this.deletedStates[a]){if(null===this.deletedStates[a][u])this.state[a][u]={};else for(var c=0,h=Object.keys(this.deletedStates[a][u]);c<h.length;c+=1)delete this.state[a][u][h[c]];s[u]=this.state[a][u]}r[a]=r[a]||{},p(r[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in t)t[f].setFeatureState(r,e)};var ec=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new zn(8192,16,0),this.grid3D=new zn(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function rc(t,e,r,n,i){return _(t,(function(t,o){var a=e instanceof mi?e.get(o):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function nc(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function ic(t,e){return e-t}ec.prototype.insert=function(t,e,r,n,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],h=0;h<u.length;h++){var p=u[h];c[0]=Math.min(c[0],p.x),c[1]=Math.min(c[1],p.y),c[2]=Math.max(c[2],p.x),c[3]=Math.max(c[3],p.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xs.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Ju(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,l=an(a.filter),u=t.queryGeometry,c=t.queryPadding*s,h=nc(u),p=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),f=nc(t.cameraQueryGeometry),d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a<s.length;a+=1){var l=s[a];if(e<=l.x&&r<=l.y&&n>=l.x&&o>=l.y)return!0}var u=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var c=0,h=u;c<h.length;c+=1)if(Qo(t,h[c]))return!0;for(var p=0;p<t.length-1;p++)if(ta(t[p],t[p+1],u))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,o+c)})),m=0,y=d;m<y.length;m+=1)p.push(y[m]);p.sort(ic);for(var v,g={},_=function(i){var c=p[i];if(c!==v){v=c;var h=o.featureIndexArray.get(c),f=null;o.loadMatchingFeature(g,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,a.layers,a.availableImages,e,r,n,(function(e,r,n){return f||(f=No(e)),r.queryIntersectsFeature(u,e,n,f,o.z,t.transform,s,t.pixelPosMatrix)}))}},x=0;x<p.length;x++)_(x);return g},ec.prototype.loadMatchingFeature=function(t,e,r,n,i,o,a,s,l,u,c){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){var m=Uo(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var y=this.getId(d,f),v=0;v<h.length;v++){var g=h[v];if(!(o&&o.indexOf(g)<0)){var _=s[g];if(_){var x={};void 0!==y&&u&&(x=u.getState(_.sourceLayer||"_geojsonTileLayer",y));var b=p({},l[g]);b.paint=rc(b.paint,_.paint,d,x,a),b.layout=rc(b.layout,_.layout,d,x,a);var w=!c||c(d,_,x);if(w){var S=new $u(d,this.z,this.x,this.y,y);S.layer=b;var E=t[g];void 0===E&&(E=t[g]=[]),E.push({featureIndex:n,feature:S,intersectionZ:w})}}}}}},ec.prototype.lookupSymbolFeatures=function(t,e,r,n,i,o,a,s){var l={};this.loadVTLayers();for(var u=an(i),c=0,h=t;c<h.length;c+=1)this.loadMatchingFeature(l,r,n,h[c],u,o,a,s,e);return l},ec.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},ec.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Bn("FeatureIndex",ec,{omit:["rawTileData","sourceLayerCoder"]});var oc=function(t,e){this.tileID=t,this.uid=d(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};oc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<B.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},oc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},oc.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=o[i],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=n;a<s.length;a+=1)r[s[a].id]=t}},i=0,o=t;i<o.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof vu){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof vu&&a.hasRTLText){this.hasRTLText=!0,ai.isLoading()||ai.isLoaded()||"deferred"!==ii()||oi();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ji},oc.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},oc.prototype.getBucket=function(t){return this.buckets[t.id]},oc.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new zu(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new zu(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},oc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},oc.prototype.queryRenderedFeatures=function(t,e,r,n,i,o,a,s,l,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:o,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:a,queryPadding:this.queryPadding*l},t,e,r):{}},oc.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=e?e.sourceLayer:"",o=n._geojsonTileLayer||n[i];if(o)for(var a=an(e&&e.filter),s=this.tileID.canonical,l=s.z,u=s.x,c=s.y,h={z:l,x:u,y:c},p=0;p<o.length;p++){var f=o.feature(p);if(a.needGeometry){var d=Uo(f,!0);if(!a.filter(new si(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!a.filter(new si(this.tileID.overscaledZ),f))continue;var m=r.getId(f,i),y=new $u(f,l,u,c,m);y.tile=h,t.push(y)}}},oc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},oc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},oc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=C(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var o=this.expirationTime-e;o?this.expirationTime=n+Math.max(o,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},oc.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},oc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var i=this.buckets[n],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},oc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},oc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},oc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},oc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=B.now()+t},oc.prototype.setDependencies=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[t]=r},oc.prototype.hasDependency=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=this.dependencies[n[r]];if(i)for(var o=0,a=e;o<a.length;o+=1)if(i[a[o]])return!0}return!1};var ac=a.performance,sc=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},ac.mark(this._marks.start)};sc.prototype.finish=function(){ac.mark(this._marks.end);var t=ac.getEntriesByName(this._marks.measure);return 0===t.length&&(ac.measure(this._marks.measure,this._marks.start,this._marks.end),t=ac.getEntriesByName(this._marks.measure),ac.clearMarks(this._marks.start),ac.clearMarks(this._marks.end),ac.clearMeasures(this._marks.measure)),t},t.Actor=Lu,t.AlphaImage=ga,t.CanonicalTileID=Hu,t.CollisionBoxArray=Ji,t.Color=te,t.DEMData=Ku,t.DataConstantProperty=yi,t.DictionaryCoder=Ju,t.EXTENT=8192,t.ErrorEvent=Ct,t.EvaluationParameters=si,t.Event=kt,t.Evented=It,t.FeatureIndex=ec,t.FillBucket=ss,t.FillExtrusionBucket=Es,t.ImageAtlas=xl,t.ImagePosition=gl,t.LineBucket=Ls,t.LngLat=Bu,t.LngLatBounds=Ru,t.MercatorCoordinate=Wu,t.ONE_EM=24,t.OverscaledTileID=Gu,t.Point=i,t.Point$1=i,t.Properties=bi,t.Protobuf=Ks,t.RGBAImage=_a,t.RequestManager=W,t.RequestPerformance=sc,t.ResourceType=dt,t.SegmentVector=so,t.SourceFeatureState=tc,t.StructArrayLayout1ui2=Gi,t.StructArrayLayout2f1f2i16=Fi,t.StructArrayLayout2i4=Ii,t.StructArrayLayout3ui6=Ui,t.StructArrayLayout4i8=Pi,t.SymbolBucket=vu,t.Texture=zu,t.Tile=oc,t.Transitionable=ci,t.Uniform1f=bo,t.Uniform1i=xo,t.Uniform2f=wo,t.Uniform3f=So,t.Uniform4f=Eo,t.UniformColor=To,t.UniformMatrix4f=Co,t.UnwrappedTileID=Yu,t.ValidationError=At,t.WritingMode=bl,t.ZoomHistory=Zn,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=fu,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),i[a]=e,0==--n&&r(o,i)}))}))},t.bezier=l,t.bindAll=v,t.browser=B,t.cacheEntryPossiblyAdded=function(t){++pt>lt&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Hl,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ws,t.config=F,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Hr,t.createLayout=ki,t.createStyleLayer=function(t){return"custom"===t.type?new ku(t):new Cu[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=i*l-o*s,t[1]=o*a-n*l,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))return!1;return!0}return e===r},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=u,t.emitValidationErrors=Mn,t.endsWith=g,t.enforceCacheSizeLimit=function(t){ut(),tt&&tt.then((function(e){e.keys().then((function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])}))}))},t.evaluateSizeForFeature=Rl,t.evaluateSizeForZoom=Bl,t.evaluateVariableOffset=ou,t.evented=ni,t.extend=p,t.featureFilter=an,t.filterObject=x,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Ml,t.getAnchorJustification=au,t.getArrayBuffer=xt,t.getImage=St,t.getJSON=function(t,e){return _t(p(t,{type:"json"}),e)},t.getRTLTextPluginStatus=ii,t.getReferrer=gt,t.getVideo=function(t,e){var r,n,i=a.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var s=a.document.createElement("source");r=t[o],n=void 0,(n=a.document.createElement("a")).href=r,(n.protocol!==a.document.location.protocol||n.host!==a.document.location.host)&&(i.crossOrigin="Anonymous"),s.src=t[o],i.appendChild(s)}return{cancel:function(){}}},t.identity=sa,t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],v=e[15],g=r*s-n*a,_=r*l-i*a,x=r*u-o*a,b=n*l-i*s,w=n*u-o*s,S=i*u-o*l,E=c*m-h*d,T=c*y-p*d,k=c*v-f*d,C=h*y-p*m,I=h*v-f*m,P=p*v-f*y,A=g*P-_*I+x*C+b*k-w*T+S*E;return A?(t[0]=(s*P-l*I+u*C)*(A=1/A),t[1]=(i*I-n*P-o*C)*A,t[2]=(m*S-y*w+v*b)*A,t[3]=(p*w-h*S-f*b)*A,t[4]=(l*k-a*P-u*T)*A,t[5]=(r*P-i*k+o*T)*A,t[6]=(y*x-d*S-v*_)*A,t[7]=(c*S-p*x+f*_)*A,t[8]=(a*I-s*k+u*E)*A,t[9]=(n*k-r*I-o*E)*A,t[10]=(d*w-m*x+v*g)*A,t[11]=(h*x-c*w-f*g)*A,t[12]=(s*T-a*C-l*E)*A,t[13]=(r*C-n*T+i*E)*A,t[14]=(m*_-d*b-y*g)*A,t[15]=(c*b-h*_+p*g)*A,t):null},t.isChar=Wn,t.isMapboxURL=H,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=_t,t.mapObject=_,t.mercatorXfromLng=Uu,t.mercatorYfromLat=qu,t.mercatorZfromAltitude=Vu,t.mul=ca,t.multiply=la,t.mvt=xs,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ze,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(a+o)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(dl,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,r,n,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new si(c.minZoom),a),l["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,f=p.maxZoom;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new si(p.minZoom),a),l["icon-size"].possiblyEvaluate(new si(f),a)]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new si(t.zoom+1),a),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),u.textMaxSize=l["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),m="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),y=s.get("text-keep-upright"),v=s.get("text-size"),g=function(){var o=x[_],l=s.get("text-font").evaluate(o,{},a).join(","),c=v.evaluate(o,{},a),h=u.layoutTextSize.evaluate(o,{},a),p=u.layoutIconSize.evaluate(o,{},a),f={horizontal:{},vertical:void 0},g=o.text,b=[0,0];if(g){var w=g.toString(),E=24*s.get("text-letter-spacing").evaluate(o,{},a),T=function(t){for(var e=0,r=t;e<r.length;e+=1)if(n=r[e].charCodeAt(0),Wn.Arabic(n)||Wn["Arabic Supplement"](n)||Wn["Arabic Extended-A"](n)||Wn["Arabic Presentation Forms-A"](n)||Wn["Arabic Presentation Forms-B"](n))return!1;var n;return!0}(w)?E:0,k=s.get("text-anchor").evaluate(o,{},a),C=s.get("text-variable-anchor");if(!C){var I=s.get("text-radial-offset").evaluate(o,{},a);b=I?ou(k,[24*I,iu]):s.get("text-offset").evaluate(o,{},a).map((function(t){return 24*t}))}var P=m?"center":s.get("text-justify").evaluate(o,{},a),A=s.get("symbol-placement"),D="point"===A?24*s.get("text-max-width").evaluate(o,{},a):0,M=function(){t.allowVerticalPlacement&&Hn(w)&&(f.vertical=El(g,e,r,i,l,D,d,k,"left",T,b,bl.vertical,!0,A,h,c))};if(!m&&C){for(var z="auto"===P?C.map((function(t){return au(t)})):[P],O=!1,L=0;L<z.length;L++){var j=z[L];if(!f.horizontal[j])if(O)f.horizontal[j]=f.horizontal[0];else{var R=El(g,e,r,i,l,D,d,"center",j,T,b,bl.horizontal,!1,A,h,c);R&&(f.horizontal[j]=R,O=1===R.positionedLines.length)}}M()}else{"auto"===P&&(P=au(k));var B=El(g,e,r,i,l,D,d,k,P,T,b,bl.horizontal,!1,A,h,c);B&&(f.horizontal[P]=B),M(),Hn(w)&&m&&y&&(f.vertical=El(g,e,r,i,l,D,d,k,P,T,b,bl.vertical,!1,A,h,c))}}var F=void 0,N=!1;if(o.icon&&o.icon.name){var U=n[o.icon.name];U&&(F=function(t,e,r){var n=Ml(r),i=e[0]-t.displaySize[0]*n.horizontalAlign,o=e[1]-t.displaySize[1]*n.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(i[o.icon.name],s.get("icon-offset").evaluate(o,{},a),s.get("icon-anchor").evaluate(o,{},a)),N=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&S("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==t.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var q=lu(f.horizontal)||f.vertical;t.iconsInText=!!q&&q.iconsInText,(q||F)&&function(t,e,r,n,i,o,a,s,l,u,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=a);var p,f=t.layers[0].layout,d=f.get("icon-offset").evaluate(e,{},c),m=lu(r.horizontal),y=a/24,v=t.tilePixelRatio*y,g=t.tilePixelRatio*h/24,_=t.tilePixelRatio*s,x=t.tilePixelRatio*f.get("symbol-spacing"),b=f.get("text-padding")*t.tilePixelRatio,w=f.get("icon-padding")*t.tilePixelRatio,E=f.get("text-max-angle")/180*Math.PI,T="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),k="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),C=f.get("symbol-placement"),I=x/2,P=f.get("icon-text-fit");n&&"none"!==P&&(t.allowVerticalPlacement&&r.vertical&&(p=Ol(n,r.vertical,P,f.get("icon-text-fit-padding"),d,y)),m&&(n=Ol(n,m,P,f.get("icon-text-fit-padding"),d,y)));var A=function(s,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m,y,v,g,_,x,b,w,E,T){var k,C,I,P,A,D=t.addToLineVertexArray(e,r),M=0,z=0,O=0,L=0,j=-1,R=-1,B={},F=po(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(k=s.layout.get("text-offset").evaluate(x,{},E).map((function(t){return 24*t})))[0],U=k[1]):(N=24*s.layout.get("text-radial-offset").evaluate(x,{},E),U=iu),t.allowVerticalPlacement&&n.vertical){var q=s.layout.get("text-rotate").evaluate(x,{},E)+90;P=new $l(l,e,u,c,h,n.vertical,p,f,d,q),a&&(A=new $l(l,e,u,c,h,a,y,v,d,q))}if(i){var V=s.layout.get("icon-rotate").evaluate(x,{}),Z="none"!==s.layout.get("icon-text-fit"),W=Yl(i,V,w,Z),H=a?Yl(a,V,w,Z):void 0;I=new $l(l,e,u,c,h,i,y,v,!1,V),M=4*W.length;var Y=t.iconSizeData,G=null;"source"===Y.kind?(G=[128*s.layout.get("icon-size").evaluate(x,{})])[0]>32640&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((G=[128*b.compositeIconSizes[0].evaluate(x,{},E),128*b.compositeIconSizes[1].evaluate(x,{},E)])[0]>32640||G[1]>32640)&&S(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,G,_,g,x,!1,e,D.lineStartIndex,D.lineLength,-1,E),j=t.icon.placedSymbolArray.length-1,H&&(z=4*H.length,t.addSymbols(t.icon,H,G,_,g,x,bl.vertical,e,D.lineStartIndex,D.lineLength,-1,E),R=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var K=n.horizontal[X];if(!C){F=po(K.text);var J=s.layout.get("text-rotate").evaluate(x,{},E);C=new $l(l,e,u,c,h,K,p,f,d,J)}var $=1===K.positionedLines.length;if(O+=su(t,e,K,o,s,d,x,m,D,n.vertical?bl.horizontal:bl.horizontalOnly,$?Object.keys(n.horizontal):[X],B,j,b,E),$)break}n.vertical&&(L+=su(t,e,n.vertical,o,s,d,x,m,D,bl.vertical,["vertical"],B,R,b,E));var Q=C?C.boxStartIndex:t.collisionBoxArray.length,tt=C?C.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=I?I.boxStartIndex:t.collisionBoxArray.length,it=I?I.boxEndIndex:t.collisionBoxArray.length,ot=A?A.boxStartIndex:t.collisionBoxArray.length,at=A?A.boxEndIndex:t.collisionBoxArray.length,st=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=lt(C,st),st=lt(P,st),st=lt(I,st);var ut=(st=lt(A,st))>-1?1:0;ut&&(st*=T/24),t.glyphOffsetArray.length>=vu.MAX_GLYPHS&&S("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,j,R,F,Q,tt,et,rt,nt,it,ot,at,u,O,L,M,z,ut,0,p,N,U,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,b,T,l,_,w,k,d,e,o,u,c,a)};if("line"===C)for(var D=0,M=Hl(e.geometry,0,0,8192,8192);D<M.length;D+=1)for(var z=M[D],O=0,L=Wl(z,x,E,r.vertical||m,n,24,g,t.overscaling,8192);O<L.length;O+=1){var j=L[O];m&&uu(t,m.text,I,j)||A(z,j)}else if("line-center"===C)for(var R=0,B=e.geometry;R<B.length;R+=1){var F=B[R];if(F.length>1){var N=Zl(F,E,r.vertical||m,n,24,g);N&&A(F,N)}}else if("Polygon"===e.type)for(var U=0,q=ns(e.geometry,0);U<q.length;U+=1){var V=q[U],Z=eu(V,16);A(V[0],new Ll(Z.x,Z.y,0))}else if("LineString"===e.type)for(var W=0,H=e.geometry;W<H.length;W+=1){var Y=H[W];A(Y,new Ll(Y[0].x,Y[0].y,0))}else if("Point"===e.type)for(var G=0,X=e.geometry;G<X.length;G+=1)for(var K=0,J=X[G];K<J.length;K+=1){var $=J[K];A([$],new Ll($.x,$.y,0))}}(t,o,f,F,n,u,h,p,b,N,a)},_=0,x=t.features;_<x.length;_+=1)g();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(o=1/(n-i)),t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=ai,t.polygonIntersectsPolygon=Zo,t.postMapLoadEvent=at,t.postTurnstileEvent=it,t.potpack=vl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Bn,t.registerForPluginStateChange=function(t){return t({pluginStatus:Qn,pluginURL:ti}),ni.on("pluginStateChange",t),t},t.renderColorRamp=ba,t.rotate=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=n*-s+o*l,t[3]=i*-s+a*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*n,t[5]=a*i+c*n,t[6]=s*i+h*n,t[7]=l*i+p*n,t[8]=u*i-o*n,t[9]=c*i-a*n,t[10]=h*i-s*n,t[11]=p*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*n,t[1]=a*i+c*n,t[2]=s*i+h*n,t[3]=l*i+p*n,t[4]=u*i-o*n,t[5]=c*i-a*n,t[6]=h*i-s*n,t[7]=p*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){st=t,lt=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Qn||"loading"===Qn||"loaded"===Qn)throw new Error("setRTLTextPlugin cannot be called multiple times.");ti=B.resolveURL(t),Qn="deferred",$n=e,ri(),r||oi()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=function(t){var e=t[0],r=t[1];return e*e+r*r},t.styleSpec=Pt,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=Fl,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t},t.transformMat4=ha,t.translate=function(t,e,r){var n,i,o,a,s,l,u,c,h,p,f,d,m=r[0],y=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=n*m+s*y+h*v+e[12],t[13]=i*m+l*y+p*v+e[13],t[14]=o*m+u*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]),t},t.triggerPluginCompletionEvent=ei,t.uniqueId=d,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Pn,t.validateStyle=In,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=xs,t.version="1.13.1",t.warnOnce=S,t.webpSupported=N,t.window=a,t.wrap=h})),n(["./shared"],(function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,o=t;i<o.length;i+=1)n+=e(o[i])+",";return n+"]"}for(var a=Object.keys(t).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+e(t[a[l]])+",";return s+"}"}function r(r){for(var n="",i=0,o=t.refProperties;i<o.length;i+=1)n+="/"+e(r[o[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,o=0,a=e;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=n;u<c.length;u+=1){var h=c[u];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var p=0,f=function(t,e){for(var n={},i=0;i<t.length;i++){var o=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=o);var a=n[o];a||(a=n[o]=[]),a.push(t[i])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache);p<f.length;p+=1){var d=f[p].map((function(t){return i._layers[t.id]})),m=d[0];if("none"!==m.visibility){var y=m.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var g=m.sourceLayer||"_geojsonTileLayer",_=v[g];_||(_=v[g]=[]),_.push(d)}}};var i=function(e){var r={},n=[];for(var i in e){var o=e[i],a=r[i]={};for(var s in o){var l=o[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),a[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(n),h=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var p in e){var f=e[p];for(var d in f){var m=f[+d];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var y=r[p][d].rect;t.AlphaImage.copy(m.bitmap,h,{x:0,y:0},{x:y.x+1,y:y.y+1},m.bitmap)}}}this.image=h,this.positions=r};t.register("GlyphAtlas",i);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function a(e,r,n){for(var i=new t.EvaluationParameters(r),o=0,a=e;o<a.length;o+=1)a[o].recalculate(i,n)}function s(e,r){var n=t.getArrayBuffer(e.request,(function(e,n,i,o){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:o})}));return function(){n.cancel(),r()}}o.prototype.parse=function(e,r,n,o,s){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var u=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h,p,f,d,m={},y={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},v=r.familiesBySource[this.source];for(var g in v){var _=e.layers[g];if(_){1===_.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=u.encode(g),b=[],w=0;w<_.length;w++){var S=_.feature(w),E=c.getId(S,g);b.push({feature:S,id:E,index:w,sourceLayerIndex:x})}for(var T=0,k=v[g];T<k.length;T+=1){var C=k[T],I=C[0];I.minzoom&&this.zoom<Math.floor(I.minzoom)||I.maxzoom&&this.zoom>=I.maxzoom||"none"!==I.visibility&&(a(C,this.zoom,n),(m[I.id]=I.createBucket({index:c.bucketLayerIDs.length,layers:C,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,y,this.tileID.canonical),c.bucketLayerIDs.push(C.map((function(t){return t.id}))))}}}var P=t.mapObject(y.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?o.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){h||(h=t,p=e,M.call(l))})):p={};var A=Object.keys(y.iconDependencies);A.length?o.send("getImages",{icons:A,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,f=e,M.call(l))})):f={};var D=Object.keys(y.patternDependencies);function M(){if(h)return s(h);if(p&&f&&d){var e=new i(p),r=new t.ImageAtlas(f,d);for(var o in m){var l=m[o];l instanceof t.SymbolBucket?(a(l.layers,this.zoom,n),t.performSymbolLayout(l,p,e.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(a(l.layers,this.zoom,n),l.addFeatures(y,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(m).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}D.length?o.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,M.call(l))})):d={},M.call(this)};var l=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var l=o.rawData,u={};o.expires&&(u.expires=o.expires),o.cacheControl&&(u.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},l.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var u=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,n=0,i=t.length,o=i-1;n<i;o=n++)r+=(t[n][0]-t[o][0])*(t[o][1]+t[n][1]);r>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=u&&o instanceof u?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},c.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},c.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],u=0,c=s[a];u<c.length;u+=1){var h=c[u];l.push(new t.Point$1(h[0],h[1]))}o.push(l)}return o},d.prototype.toGeoJSON=function(t,e,r){return f.call(this,t,e,r)};var m=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};m.prototype.feature=function(t){return new d(this._features[t])};var y=t.vectorTile.VectorTileFeature,v=g;function g(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}g.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],o=0;o<n.length;o++)i.push(new t.Point$1(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},_.prototype.toGeoJSON=y.prototype.toGeoJSON;var x=w,b=v;function w(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,S,t.layers[r])}(e,r),r.finish()}function S(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,E,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,P,o[r])}function E(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,T,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function T(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var l=o[s];void 0===l&&(n.push(s),o[s]=l=n.length-1),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var h=c+":"+u,p=a[h];void 0===p&&(i.push(u),a[h]=p=i.length-1),e.writeVarint(p)}}function k(t,e){return(e<<3)+(7&t)}function C(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(k(1,u));for(var c=3===n?l.length-1:l.length,h=0;h<c;h++){1===h&&1!==n&&e.writeVarint(k(2,c-1));var p=l[h].x-i,f=l[h].y-o;e.writeVarint(C(p)),e.writeVarint(C(f)),i+=p,o+=f}3===n&&e.writeVarint(k(7,1))}}function P(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function A(t,e,r,n){D(t,r,n),D(e,2*r,2*n),D(e,2*r+1,2*n+1)}function D(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function M(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}x.fromVectorTileJs=w,x.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new v(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return w({layers:r})},x.GeoJSONWrapper=b;var z=function(t){return t[0]},O=function(t){return t[1]},L=function(t,e,r,n,i){void 0===e&&(e=z),void 0===r&&(r=O),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),l=0;l<t.length;l++)a[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,n,i,o,a){if(!(o-i<=n)){var s=i+o>>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=n-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-l*c/s+h)),Math.min(o,Math.floor(n+(s-l)*c/s+h)),a)}var p=r[2*n+a],f=i,d=o;for(A(e,r,i,n),r[2*o+a]>p&&A(e,r,i,o);f<d;){for(A(e,r,f,d),f++,d--;r[2*f+a]<p;)f++;for(;r[2*d+a]>p;)d--}r[2*i+a]===p?A(e,r,i,d):A(e,r,++d,o),d<=n&&(i=d+1),n<=d&&(o=d-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};L.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),p=u.pop(),f=u.pop();if(p-f<=a)for(var d=f;d<=p;d++)l=e[2*d+1],(s=e[2*d])>=r&&s<=i&&l>=n&&l<=o&&c.push(t[d]);else{var m=Math.floor((f+p)/2);l=e[2*m+1],(s=e[2*m])>=r&&s<=i&&l>=n&&l<=o&&c.push(t[m]);var y=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===h?i>=s:o>=l)&&(u.push(m+1),u.push(p),u.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},L.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],l=i*i;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var p=h;p<=c;p++)M(e[2*p],e[2*p+1],r,n)<=l&&s.push(t[p]);else{var f=Math.floor((h+c)/2),d=e[2*f],m=e[2*f+1];M(d,m,r,n)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?r-i<=d:n-i<=m)&&(a.push(h),a.push(f-1),a.push(y)),(0===u?r+i>=d:n+i>=m)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var j={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},R=function(t){this.options=Z(Object.create(j),t),this.trees=new Array(this.options.maxZoom+1)};function B(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function F(t,e){var r=t.geometry.coordinates,n=r[1];return{x:q(r[0]),y:V(n),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function U(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Z(Z({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function q(t){return t/360+.5}function V(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Z(t,e){for(var r in e)t[r]=e[r];return t}function W(t){return t.x}function H(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return(a=t-r)*a+(s=e-n)*s}function G(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)X(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)X(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)X(t,e[n][i])}(i),i}function X(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function K(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===o)J(i,s);else if("MultiPoint"===o)for(var u=0;u<i.length;u++)J(i[u],s);else if("LineString"===o)$(i,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(u=0;u<i.length;u++)$(i[u],s=[],a,!1),t.push(G(l,"LineString",s,e.properties));return}Q(i,s,a,!1)}else if("Polygon"===o)Q(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(u=0;u<e.geometry.geometries.length;u++)K(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<i.length;u++){var c=[];Q(i[u],c,a,!0),s.push(c)}}t.push(G(l,o,s,e.properties))}}function J(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function $(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var l=tt(t[s][0]),u=et(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(a+=n?(i*u-l*o)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-o,2))),i=l,o=u}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],h=e[n],p=e[n+1],f=r+3;f<n;f+=3){var d=Y(e[f],e[f+1],u,c,h,p);if(d>a)o=f,a=d;else if(d===a){var m=Math.abs(f-s);m<l&&(o=f,l=m)}}a>i&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Q(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];$(t[i],o,r,n),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function rt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a<n)return t;if(a<r||o>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],h=c.geometry,p=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=r&&d<n)l.push(c);else if(!(d<r||f>=n)){var m=[];if("Point"===p||"MultiPoint"===p)nt(h,m,r,n,i);else if("LineString"===p)it(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)at(h,m,r,n,i,!1);else if("Polygon"===p)at(h,m,r,n,i,!0);else if("MultiPolygon"===p)for(var y=0;y<h.length;y++){var v=[];at(h[y],v,r,n,i,!0),v.length&&m.push(v)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(y=0;y<m.length;y++)l.push(G(c.id,p,m[y],c.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(G(c.id,p,m,c.tags))}}}return l.length?l:null}function nt(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,r,n,i,o,a){for(var s,l,u=ot(t),c=0===i?lt:ut,h=t.start,p=0;p<t.length-3;p+=3){var f=t[p],d=t[p+1],m=t[p+2],y=t[p+3],v=t[p+4],g=0===i?f:d,_=0===i?y:v,x=!1;a&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-v,2))),g<r?_>r&&(l=c(u,f,d,y,v,r),a&&(u.start=h+s*l)):g>n?_<n&&(l=c(u,f,d,y,v,n),a&&(u.start=h+s*l)):st(u,f,d,m),_<r&&g>=r&&(l=c(u,f,d,y,v,r),x=!0),_>n&&g<=n&&(l=c(u,f,d,y,v,n),x=!0),!o&&x&&(a&&(u.end=h+s*l),e.push(u),u=ot(t)),a&&(h+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(g=0===i?f:d)>=r&&g<=n&&st(u,f,d,m),b=u.length-3,o&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&st(u,u[0],u[1],u[2]),u.length&&e.push(u)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,r,n,i,o){for(var a=0;a<t.length;a++)it(t[a],e,r,n,i,o,!1)}function st(t,e,r,n){t.push(e),t.push(r),t.push(n)}function lt(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}function ut(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}function ct(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=ht(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(ht(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var l=[],u=0;u<o.geometry[s].length;u++)l.push(ht(o.geometry[s][u],e));i.push(l)}r.push(G(o.id,a,i,o.tags))}return r}function ht(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function pt(t,e){if(t.transformed)return t;var r,n,i,o=1<<t.z,a=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(ft(u[n],u[n+1],e,o,a,s));else for(n=0;n<u.length;n++){var h=[];for(i=0;i<u[n].length;i+=2)h.push(ft(u[n][i],u[n][i+1],e,o,a,s));l.geometry.push(h)}}return t.transformed=!0,t}function ft(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function dt(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,mt(a,t[s],o,i);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,h=t[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function mt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)yt(a,i,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)yt(a,i[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)yt(a,u[s],t,r,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(p.id=e.id),t.features.push(p)}}function yt(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}(s,o),t.push(s)}}function vt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)K(r,t.features[n],e,n);else K(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=rt(t,1,-1-r,r,0,-1,2,e),o=rt(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=rt(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=ct(i,1).concat(n)),o&&(n=n.concat(ct(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function gt(t,e,r){return 32*((1<<t)*r+e)+t}function _t(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new m(n.features),o=x(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}R.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var a="prepare "+t.length+" points";r&&console.time(a),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(F(t[l],l));this.trees[i+1]=new L(s,W,H,o,Float32Array),r&&console.timeEnd(a);for(var u=i;u>=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new L(s,W,H,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},R.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,h=l.range(q(r),V(o),q(i),V(n));c<h.length;c+=1){var p=l.points[h[c]];u.push(p.numPoints?N(p):this.points[p.index])}return u},R.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=i.within(o.x,o.y,a);l<u.length;l+=1){var c=i.points[u[l]];c.parentId===t&&s.push(c.numPoints?N(c):this.points[c.index])}if(0===s.length)throw new Error(n);return s},R.prototype.getLeaves=function(t,e,r){var n=[];return this._appendLeaves(n,t,e=e||10,r=r||0,0),n},R.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.radius/o.extent,s=(r-a)/i,l=(r+1+a)/i,u={features:[]};return this._addTileFeatures(n.range((e-a)/i,s,(e+1+a)/i,l),n.points,e,r,i,u),0===e&&this._addTileFeatures(n.range(1-a/i,s,1,l),n.points,i,r,i,u),e===i-1&&this._addTileFeatures(n.range(0,s,a/i,l),n.points,-1,r,i,u),u.features.length?u:null},R.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},R.prototype._appendLeaves=function(t,e,r,n,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},R.prototype._addTileFeatures=function(t,e,r,n,i,o){for(var a=0,s=t;a<s.length;a+=1){var l=e[s[a]],u=l.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:u?U(l):this.points[l.index].properties},h=void 0;u?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(c.id=h),o.features.push(c)}},R.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},R.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.reduce,o=n.minPoints,a=n.radius/(n.extent*Math.pow(2,e)),s=0;s<t.length;s++){var l=t[s];if(!(l.zoom<=e)){l.zoom=e;for(var u=this.trees[e+1],c=u.within(l.x,l.y,a),h=l.numPoints||1,p=h,f=0,d=c;f<d.length;f+=1){var m=u.points[d[f]];m.zoom>e&&(p+=m.numPoints||1)}if(p>=o){for(var y=l.x*h,v=l.y*h,g=i&&h>1?this._map(l,!0):null,_=(s<<5)+(e+1)+this.points.length,x=0,b=c;x<b.length;x+=1){var w=u.points[b[x]];if(!(w.zoom<=e)){w.zoom=e;var S=w.numPoints||1;y+=w.x*S,v+=w.y*S,w.parentId=_,i&&(g||(g=this._map(l,!0)),i(g,this._map(w)))}}l.parentId=_,r.push(B(y/p,v/p,_,p,g))}else if(r.push(l),p>1)for(var E=0,T=c;E<T.length;E+=1){var k=u.points[T[E]];k.zoom<=e||(k.zoom=e,r.push(k))}}}return r},R.prototype._getOriginId=function(t){return t-this.points.length>>5},R.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},R.prototype._map=function(t,e){if(t.numPoints)return e?Z({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Z({},n):n},vt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},vt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=gt(e,r,n),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=dt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(p.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<<i-e;if(r!==Math.floor(o/d)||n!==Math.floor(a/d))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){u>1&&console.time("clipping");var m,y,v,g,_,x,b=.5*l.buffer/l.extent,w=.5-b,S=.5+b,E=1+b;m=y=v=g=null,_=rt(t,c,r-b,r+S,0,p.minX,p.maxX,l),x=rt(t,c,r+w,r+E,0,p.minX,p.maxX,l),t=null,_&&(m=rt(_,c,n-b,n+S,1,p.minY,p.maxY,l),y=rt(_,c,n+w,n+E,1,p.minY,p.maxY,l),_=null),x&&(v=rt(x,c,n-b,n+S,1,p.minY,p.maxY,l),g=rt(x,c,n+w,n+E,1,p.minY,p.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},vt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t,s=gt(t,e=(e%a+a)%a,r);if(this.tiles[s])return pt(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[gt(u,c,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",u,c,h),o>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?pt(this.tiles[s],i):null):null};var xt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n<e.features.length;n++)t(e.features[n],r);else if("GeometryCollection"===i)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],r);else if("Feature"===i)t(e.geometry,r);else if("Polygon"===i)h(e.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<e.coordinates.length;n++)h(e.coordinates[n],r);return e}(a,!0);try{if(n.filter){var s=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));a={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new R(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u<c.length;u+=1){var h=c[u],p=n[h],f=p[0],d=t.createExpression(p[1]),m=t.createExpression("string"==typeof f?[f,["accumulated"],["get",h]]:f);i[h]=d.value,o[h]=m.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var o=n[r];e[o]=i[o].evaluate(a,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];a.accumulated=t[i],t[i]=o[i].evaluate(a,s)}},r}(n)).load(a.features):function(t,e){return new vt(t,e)}(a,n.geojsonVtOptions)}catch(o){return r(o)}e.loaded={};var u={};if(i){var c=i.finish();c&&(u.resourceTiming={},u.resourceTiming[n.source]=JSON.parse(JSON.stringify(c)))}r(null,u)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded;return n&&n[t.uid]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},r.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},r}(l),bt=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:xt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,r){for(var n in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][n];for(var o in i)i[o].availableImages=e}r()},bt.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},bt.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},bt.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},bt.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},bt.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},bt.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},bt.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},bt.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},bt.prototype.syncRTLPluginState=function(e,r,n){try{t.plugin.setState(r);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var o=t.plugin.isParsed();n(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),o)}}catch(t){n(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},bt.prototype.getWorkerSource=function(t,e,r){var n=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,i){n.actor.send(e,r,i,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new c),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new bt(self)),bt})),n(["./shared"],(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var r=e.getImageData(0,0,1,1);return r&&r.width===t.width}()?(void 0===n[r=t&&t.failIfMajorPerformanceCaveat]&&(n[r]=function(t){var r=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(r)),n[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document&&t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var o,a=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&a&&(o=n[a],n[a]="none")},r.enableDrag=function(){n&&a&&(n[a]=o)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),t.addEventListener(e,r,"passive"in n&&l?n:n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),t.removeEventListener(e,r,"passive"in n&&l?n:n.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect();return new t.Point(r.clientX-n.left-e.clientLeft,r.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],o=0;o<r.length;o++)i.push(new t.Point(r[o].clientX-n.left-e.clientLeft,r[o].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e];this._notify(n.ids,n.callback)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},r.prototype._validate=function(e,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,n=0,i=t;n<i.length;n+=1){var o=i[n];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=o[1]}return!0},r.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},r.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1)this.images[i[n]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,o=e;i<o.length;i+=1){var a=o[i];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?n[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},o=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,o=n.h,a=this.atlasImage;for(var s in a.resize({width:i||1,height:o||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,h=this.images[s].data,p=h.width,f=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:u,y:c},{width:p,height:f}),t.RGBAImage.copy(h,a,{x:0,y:f-1},{x:u,y:c-1},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:u,y:c+f},{width:p,height:1}),t.RGBAImage.copy(h,a,{x:p-1,y:0},{x:u-1,y:c},{width:1,height:f}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:u+p,y:c},{width:1,height:f})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(t.Evented),f=y,d=y,m=1e20;function y(t,e,r,n,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function v(t,e,r,n,i,o,a){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(g(n,i,o,a,r),l=0;l<r;l++)t[l*e+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(g(n,i,o,a,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(i[s])}}function g(t,e,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=n[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,n[a]=s,n[a+1]=+m}for(o=0,a=0;o<i;o++){for(;n[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}y.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(v(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),v(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++)r[n]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[n]-this.gridInner[n])/this.radius+this.cutoff))));return r},f.default=d;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1)i.push({stack:o,id:s[a]});t.asyncAll(i,(function(t,e){var r=t.stack,i=t.id,o=n.entries[r];o||(o=n.entries[r]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[i];if(void 0===a){if(a=n._tinySDF(o,r,i))return o.glyphs[i]=a,void e(null,{stack:r,id:i,glyph:a});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var l=o.requests[s];l||(l=o.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=l;i<a.length;i+=1)(0,a[i])(t,e);delete o.requests[s]}))),l.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})}))}}else e(null,{stack:r,id:i,glyph:a})}),(function(t,e){if(t)r(t);else if(e){for(var n={},i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.stack,l=a.id,u=a.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,n)}}))},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(r)?a="900":/medium/i.test(r)?a="500":/light/i.test(r)&&(a="200"),o=e.tinySDF=new _.TinySDF(24,3,8,.25,i,a)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,r,n,i,o){var a=256*r,s=a+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,r){if(e)o(e);else if(r){for(var n={},i=0,a=t.parseGlyphPBF(r);i<a.length;i+=1){var s=a[i];n[s.id]=s}o(null,n)}}))},_.TinySDF=f;var x=function(){this.specification=t.styleSpec.light.position};x.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},x.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),S=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};S.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},S.prototype.getDashRanges=function(t,e,r){var n=[],i=t.length%2==1?-t[t.length-1]*r:0,o=t[0]*r,a=!0;n.push({left:i,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],l=1;l<t.length;l++){var u=t[l];n.push({left:i=s*r,right:o=(s+=u)*r,isDash:a=!a,zeroLength:0===u})}return n},S.prototype.addRoundDash=function(t,e,r){for(var n=e/2,i=-r;i<=r;i++)for(var o=this.width*(this.nextRow+r+i),a=0,s=t[a],l=0;l<this.width;l++){l/s.right>1&&(s=t[++a]);var u=Math.abs(l-s.left),c=Math.abs(l-s.right),h=Math.min(u,c),p=void 0,f=i/r*(n+1);if(s.isDash){var d=n-Math.abs(f);p=Math.sqrt(h*h+d*d)}else p=n-Math.sqrt(h*h+f*f);this.data[o+l]=Math.max(0,Math.min(255,p+128))}},S.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,l=t[s],u=0;u<this.width;u++){u/l.right>1&&(l=t[++s]);var c=Math.abs(u-l.left),h=Math.abs(u-l.right),p=Math.min(c,h);this.data[a+u]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128))}},S.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];if(0!==o){var s=this.width/o,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var u={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:o};return this.nextRow+=i,this.dirty=!0,u},S.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var E=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),o=0;o<i.length;o++){var a=new e.Actor(i[o],n,this.id);a.name="Worker "+o,this.actors.push(a)}};function T(e,r,n){var i=function(i,o){if(i)return n(i);if(o){var a=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(a.vectorLayers=o.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=r.canonicalizeTileset(a,e.url),n(null,a)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}E.prototype.broadcast=function(e,r,n){t.asyncAll(this.actors,(function(t,n){t.send(e,r,n)}),n=n||function(){})},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var k=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};k.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},k.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<o&&e.y>=i&&e.y<a};var C=function(e){function r(r,n,i,o){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new k(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},r.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,o.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),I=function(e){function r(r,n,i,o){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=T(this._options,this.map._requestManager,(function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new k(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),(function(i,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(o){n.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=n.map.painter.context,s=a.gl;e.texture=n.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(I),A=function(e){function r(r,n,i,o){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(o),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*a,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.EXTENT,radius:(n.clusterRadius||50)*a,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),D=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),M=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;a<s.length;a+=1){var l=s[a];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),o=Math.max(o,l.y)}var u=Math.max(i-r,o-n),c=Math.max(0,Math.floor(-Math.log(u)/Math.LN2)),h=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((r+i)/2*h),Math.floor((n+o)/2*h))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(t){return r.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),z=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1)this.urls.push(this.map._requestManager.transformRequest(i[n],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(M),O=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,D.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(M),L={vector:C,raster:I,"raster-dem":P,geojson:A,video:z,image:M,canvas:O};function j(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function R(t,e,r,n,i,o){var a=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var o=e[i[n]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=o.maxPitchScaleFactor(),l=t.tilesIn(n,s,a);l.sort(B);for(var u=[],c=0,h=l;c<h.length;c+=1){var p=h[c];u.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,r,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,i,o,s,j(t.transform,p.tileID))})}var f=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var o=i[n],a=o.queryResults,s=o.wrappedTileID,l=r[s]=r[s]||{};for(var u in a)for(var c=a[u],h=l[u]=l[u]||{},p=e[u]=e[u]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m))}}return e}(u);for(var d in f)f[d].forEach((function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return f}function B(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var F=function(t,e){this.max=t,this.onRemove=e,this.reset()};F.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},F.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var o={value:e,timeout:void 0};if(void 0!==r&&(o.timeout=setTimeout((function(){n.remove(t,o)}),r)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},F.prototype.has=function(t){return t.wrapped().key in this.data},F.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},F.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},F.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},F.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},F.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},F.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},F.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var o=i[n];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var l=s[a];this.remove(l.value.tileID,l)}};var N=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},q=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};q.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},q.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},q.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=e.attributes[this.attributes[r].name];void 0!==n&&t.enableVertexAttribArray(n)}},q.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],o=e.attributes[i.name];void 0!==o&&t.vertexAttribPointer(o,i.components,t[U[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},q.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var V=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};V.prototype.get=function(){return this.current},V.prototype.set=function(t){},V.prototype.getDefault=function(){return this.default},V.prototype.setDefault=function(){this.set(this.default)};var Z=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(V),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(V),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(V),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(V),G=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(V),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(V),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(V),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(V),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(V),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(V),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(V),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(V),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(V),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(V),it=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(V),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(V),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(V),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(V),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(V),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(V),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(V),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(V),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(V),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(V),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(V),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(V),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(V),vt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(V),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(V),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(V),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(V),bt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(V),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),St=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),Et=function(t,e,r,n){this.context=t,this.width=e,this.height=r;var i=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new wt(t,i),n&&(this.depthAttachment=new St(t,i))};Et.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)};var Tt=function(t,e,r){this.func=t,this.mask=e,this.range=r};Tt.ReadOnly=!1,Tt.ReadWrite=!0,Tt.disabled=new Tt(519,Tt.ReadOnly,[0,1]);var kt=function(t,e,r,n,i,o){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=o};kt.disabled=new kt({func:519,mask:0},0,0,7680,7680,7680);var Ct=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};Ct.disabled=new Ct(Ct.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Ct.unblended=new Ct(Ct.Replace,t.Color.transparent,[!0,!0,!0,!0]),Ct.alphaBlended=new Ct([1,771],t.Color.transparent,[!0,!0,!0,!0]);var It=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};It.disabled=new It(!1,1029,2305),It.backCCW=new It(!0,1029,2305);var Pt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Z(this),this.clearDepth=new W(this),this.clearStencil=new H(this),this.colorMask=new Y(this),this.depthMask=new G(this),this.stencilMask=new X(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new $(this),this.depthRange=new Q(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new nt(this),this.blendColor=new it(this),this.blendEquation=new ot(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new ht(this),this.bindFramebuffer=new pt(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new yt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new vt(this),this.pixelStoreUnpack=new gt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new xt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Pt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Pt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Pt.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},Pt.prototype.createVertexBuffer=function(t,e,r){return new q(this,t,e,r)},Pt.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Pt.prototype.createFramebuffer=function(t,e,r){return new Et(this,t,e,r)},Pt.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Pt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Pt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Pt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Pt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Ct.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Pt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var At=function(e){function r(r,n,i){var o=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,r,n,i){var o=new L[r.type](e,r,n,i);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(r,n,i,this),this._tiles={},this._cache=new F(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&n.push(this._tiles[i]);return e?n.sort((function(e,n){var i=e.tileID,o=n.tileID,a=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(Dt).map((function(t){return t.key}))},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);o(t,i),o(i,t)}}function o(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,o);if(Mt(this._source.type)){for(var u={},c={},h=0,p=Object.keys(l);h<p.length;h+=1){var f=p[h],d=l[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var y=this.findLoadedParent(d,a);y&&(this._addTile(y.tileID),u[y.tileID.key]=y.tileID),c[f]=d}}for(var v in this._retainLoadedChildren(c,o,s,l),u)l[v]||(this._coveredTiles[v]=!0,l[v]=u[v])}for(var g in l)this._tiles[g].clearFadeHold();for(var _=0,x=t.keysDifference(this._tiles,l);_<x.length;_+=1){var b=x[_],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},o=Math.max(e-r.maxOverzooming,this._source.minzoom),a=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],h=this._addTile(c);n[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,n);for(var p=0,f=t;p<f.length;p+=1){var d=f[p],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],v=this.getTile(y);if(v&&v.hasData()){n[y.key]=y;continue}}else{var g=d.children(this._source.maxzoom);if(n[g[0].key]&&n[g[1].key]&&n[g[2].key]&&n[g[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=o;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=r}},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,l=e.map((function(t){return a.pointCoordinate(t)})),u=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,p=1/0,f=-1/0,d=-1/0,m=0,y=u;m<y.length;m+=1){var v=y[m];h=Math.min(h,v.x),p=Math.min(p,v.y),f=Math.max(f,v.x),d=Math.max(d,v.y)}for(var g=function(e){var n=i._tiles[c[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,a.zoom-n.tileID.overscaledZ),y=r*n.queryPadding*t.EXTENT/n.tileSize/m,v=[s.getTilePoint(new t.MercatorCoordinate(h,p)),s.getTilePoint(new t.MercatorCoordinate(f,d))];if(v[0].x-y<t.EXTENT&&v[0].y-y<t.EXTENT&&v[1].x+y>=0&&v[1].y+y>=0){var g=l.map((function(t){return s.getTilePoint(t)})),_=u.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:g,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)g(_);return o},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,i=r;n<i.length;n+=1){var o=i[n];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Mt(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Dt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Mt(t){return"raster"===t||"image"===t||"video"===t}function zt(){return new t.window.Worker(Xi.workerUrl)}At.maxOverzooming=10,At.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",Lt=function(){this.active={}};Lt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Lt.workerCount;)this.workers.push(new zt);return this.active[t]=!0,this.workers.slice()},Lt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Lt.prototype.isPreloaded=function(){return!!this.active[Ot]},Lt.prototype.numActive=function(){return Object.keys(this.active).length};var jt,Rt=Math.floor(t.browser.hardwareConcurrency/2);function Bt(){return jt||(jt=new Lt),jt}function Ft(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}function Nt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Ft(t[n],e[t[n].ref]));return t}Lt.workerCount=Math.max(Math.min(Rt,6),1);var Ut={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function qt(t,e,r){r.push({command:Ut.addSource,args:[t,e[t]]})}function Vt(t,e,r){e.push({command:Ut.removeSource,args:[t]}),r[t]=!0}function Zt(t,e,r,n){Vt(t,r,n),qt(t,e,r)}function Wt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Ht(e,r,n,i,o,a){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:a,args:[i,s,r[s],o]}))}function Yt(t){return t.id}function Gt(t,e){return t[e.id]=e,t}var Xt=function(t,e){this.reset(t,e)};Xt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Xt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,n=this._distances[r],i=e*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var o=r-1,a=this._distances[o],s=n-a,l=s>0?(i-a)/s:0;return this.points[o].mult(1-l).add(this.points[r].mult(l))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Jt(e,r,n,i,o){var a=t.create();return r?(t.scale(a,a,[1/o,1/o,1]),n||t.rotateZ(a,a,i.angle)):t.multiply(a,i.labelPlaneMatrix,e),a}function $t(e,r,n,i,o){if(r){var a=t.clone(e);return t.scale(a,a,[o,o,1]),n||t.rotateZ(a,a,-i.angle),a}return i.glCoordMatrix}function Qt(e,r){var n=[e.x,e.y,0,1];ce(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function te(t,e){return.5+t/e*.5}function ee(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,v=0;v<d.length;v++){var g=d.get(v);if(g.hidden||g.writingMode===t.WritingMode.vertical&&!y)ue(g.numGlyphs,p);else{y=!1;var _=[g.anchorX,g.anchorY,0,1];if(t.transformMat4(_,_,r),ee(_,h)){var x=te(n.transform.cameraToCenterDistance,_[3]),b=t.evaluateSizeForFeature(u,c,g),w=s?b/x:b*x,S=new t.Point(g.anchorX,g.anchorY),E=Qt(S,o).point,T={},k=oe(g,w,!1,l,r,o,a,e.glyphOffsetArray,f,p,E,S,T,m);y=k.useVertical,(k.notEnoughRoom||y||k.needsFlipping&&oe(g,w,!0,l,r,o,a,e.glyphOffsetArray,f,p,E,S,T,m).notEnoughRoom)&&ue(g.numGlyphs,p)}else ue(g.numGlyphs,p)}}i?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p)}function ne(t,e,r,n,i,o,a,s,l,u,c){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(h-1),y=se(t*d,r,n,i,o,a,s.segment,p,f,l,u,c);if(!y)return null;var v=se(t*m,r,n,i,o,a,s.segment,p,f,l,u,c);return v?{first:y,last:v}:null}function ie(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,l,u,c,h,p,f,d){var m,y=r/24,v=e.lineOffsetX*y,g=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=ne(y,l,v,g,n,h,p,e,u,a,f);if(!w)return{notEnoughRoom:!0};var S=Qt(w.first.point,s).point,E=Qt(w.last.point,s).point;if(i&&!n){var T=ie(e.writingMode,S,E,d);if(T)return T}m=[w.first];for(var k=e.glyphStartIndex+1;k<_-1;k++)m.push(se(y*l.getoffsetX(k),v,g,n,h,p,e.segment,x,b,u,a,f));m.push(w.last)}else{if(i&&!n){var C=Qt(p,o).point,I=e.lineStartIndex+e.segment+1,P=new t.Point(u.getx(I),u.gety(I)),A=Qt(P,o),D=A.signedDistanceFromCamera>0?A.point:ae(p,P,C,1,o),M=ie(e.writingMode,C,D,d);if(M)return M}var z=se(y*l.getoffsetX(e.glyphStartIndex),v,g,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,a,f);if(!z)return{notEnoughRoom:!0};m=[z]}for(var O=0,L=m;O<L.length;O+=1){var j=L[O];t.addDynamicAttributes(c,j.point,j.angle)}return{}}function ae(t,e,r,n,i){var o=Qt(t.add(t.sub(e)._unit()),i).point,a=r.sub(o);return r.add(a._mult(n/a.mag()))}function se(e,r,n,i,o,a,s,l,u,c,h,p){var f=i?e-r:e+r,d=f>0?1:-1,m=0;i&&(d*=-1,m=Math.PI),d<0&&(m+=Math.PI);for(var y=d>0?l+s:l+s+1,v=o,g=o,_=0,x=0,b=Math.abs(f),w=[];_+x<=b;){if((y+=d)<l||y>=u)return null;if(g=v,w.push(v),void 0===(v=p[y])){var S=new t.Point(c.getx(y),c.gety(y)),E=Qt(S,h);if(E.signedDistanceFromCamera>0)v=p[y]=E.point;else{var T=y-d;v=ae(0===_?a:new t.Point(c.getx(T),c.gety(T)),S,g,b-_+1,h)}}_+=x,x=g.dist(v)}var k=(b-_)/x,C=v.sub(g),I=C.mult(k)._add(g);I._add(C._unit()._perp()._mult(n*d));var P=m+Math.atan2(v.y-g.y,v.x-g.x);return w.push(I),{point:I,angle:P,path:w}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],h=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:u-h,y1:c-h,x2:u+h,y2:c+h})}return o?a.filter(o):a}return this._forEachCell(t,e,r,n,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,l=e+r;if(a<0||o>this.width||l<0||s>this.height)return!n&&[];var u=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,u,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?u.length>0:u},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var l=a.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,h=0,p=u;h<p.length;h+=1){var f=p[h];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var y=this.circles,v=0,g=m;v<g.length;v+=1){var _=g[v];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,n)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var b=y[x],w=y[x+1],S=y[x+2];o.push({key:this.circleKeys[_],x1:b-S,y1:w-S,x2:b+S,y2:w+S})}}}},Kt.prototype._queryCellCircle=function(t,e,r,n,i,o,a,s){var l=a.circle,u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,p=0,f=c;p<f.length;p+=1){var d=f[p];if(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var y=this.circleCells[i];if(null!==y)for(var v=this.circles,g=0,_=y;g<_.length;g+=1){var x=_[g];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(v[b],v[b+1],v[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return o.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),p=l;p<=c;p++)for(var f=u;f<=h;f++)if(i.call(this,t,e,r,n,this.xCellCount*f+p,o,a,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,r,n,i,o){var a=n-t,s=i-e,l=r+o;return l*l>a*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(a-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var h=l-s,p=c-u;return h*h+p*p<=r*r};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ue(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(le,3*n)}}function ce(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var he=function(t,e,r){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===r&&(r=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function pe(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,r,n,i){var o=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),a=r*o.perspectiveRatio,s=t.x1*a+o.point.x,l=t.y1*a+o.point.y,u=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,i)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},he.prototype.placeCollisionCircles=function(e,r,n,i,o,a,s,l,u,c,h,p,f){var d=[],m=new t.Point(r.anchorX,r.anchorY),y=Qt(m,a),v=te(this.transform.cameraToCenterDistance,y.signedDistanceFromCamera),g=(c?o/v:o*v)/t.ONE_EM,_=Qt(m,s).point,x=ne(g,i,r.lineOffsetX*g,r.lineOffsetY*g,!1,_,m,r,n,s,{}),b=!1,w=!1,S=!0;if(x){for(var E=.5*p*v+f,T=new t.Point(-100,-100),k=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),C=new Xt,I=x.first,P=x.last,A=[],D=I.path.length-1;D>=1;D--)A.push(I.path[D]);for(var M=1;M<P.path.length;M++)A.push(P.path[M]);var z=2.5*E;if(l){var O=A.map((function(t){return Qt(t,l)}));A=O.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:O.map((function(t){return t.point}))}var L=[];if(A.length>0){for(var j=A[0].clone(),R=A[0].clone(),B=1;B<A.length;B++)j.x=Math.min(j.x,A[B].x),j.y=Math.min(j.y,A[B].y),R.x=Math.max(R.x,A[B].x),R.y=Math.max(R.y,A[B].y);L=j.x>=T.x&&R.x<=k.x&&j.y>=T.y&&R.y<=k.y?[A]:R.x<T.x||j.x>k.x||R.y<T.y||j.y>k.y?[]:t.clipLine([A],T.x,T.y,k.x,k.y)}for(var F=0,N=L;F<N.length;F+=1){var U;C.reset(N[F],.25*E),U=C.length<=.5*E?1:Math.ceil(C.paddedLength/z)+1;for(var q=0;q<U;q++){var V=q/Math.max(U-1,1),Z=C.lerp(V),W=Z.x+100,H=Z.y+100;d.push(W,H,E,0);var Y=W-E,G=H-E,X=W+E,K=H+E;if(S=S&&this.isOffscreen(Y,G,X,K),w=w||this.isInsideGrid(Y,G,X,K),!e&&this.grid.hitTestCircle(W,H,E,h)&&(b=!0,!u))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!u&&b||!w?[]:d,offscreen:S,collisionDetected:b}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,o=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+100,u.y+100);n=Math.min(n,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),r.push(c)}for(var h={},p={},f=0,d=this.grid.query(n,i,o,a).concat(this.ignoredGrid.query(n,i,o,a));f<d.length;f+=1){var m=d[f],y=m.key;if(void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]={}),!h[y.bucketInstanceId][y.featureIndex]){var v=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,v)&&(h[y.bucketInstanceId][y.featureIndex]=!0,void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]=[]),p[y.bucketInstanceId].push(y.featureIndex))}}return p},he.prototype.insertCollisionBox=function(t,e,r,n,i){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:i},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return ce(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},he.prototype.isOffscreen=function(t,e,r,n){return r<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var fe=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};fe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,r,n,i){this.text=new fe(t?t.text:null,e,r,i),this.icon=new fe(t?t.icon:null,e,n,i)};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var me=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},ye=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ve=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},ge=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function _e(e,r,n,i,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*r,l=-(a.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,i);return new t.Point(s+u[0]*o,l+u[1]*o)}function xe(e,r,n,i,o,a){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,h=e.anchorPointX,p=e.anchorPointY,f=new t.Point(r,n);return i&&f._rotate(o?a:-a),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:h,anchorPointY:p}}ge.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ge(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function we(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}be.prototype.getBucketParts=function(e,r,n,i){var o=n.getBucket(r),a=n.latestFeatureIndex;if(o&&a&&r.id===o.layerIds[0]){var s=n.collisionBoxArray,l=o.layers[0].layout,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),c=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),f="map"===l.get("text-rotation-alignment"),d=pe(n,1,this.transform.zoom),m=Jt(h,p,f,this.transform,d),y=null;if(p){var v=$t(h,p,f,this.transform,d);y=t.multiply([],this.transform.labelPlaneMatrix,v)}this.retainedQueryData[o.bucketInstanceId]=new ve(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID);var g={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:y,scale:u,textPixelRatio:c,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(var _=0,x=o.sortKeyRanges;_<x.length;_+=1){var b=x[_];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:g})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:g})}},be.prototype.attemptAnchorPlacement=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d){var m,y=[h.textOffset0,h.textOffset1],v=_e(t,r,n,y,i),g=this.collisionIndex.placeCollisionBox(xe(e,v.x,v.y,o,a,this.transform.angle),c,s,l,u.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(xe(d,v.x,v.y,o,a,this.transform.angle),c,s,l,u.predicate).box.length)return g.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:y,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,t,h,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,h),this.placedOrientations[h.crossTileID]=f),{shift:v,placedGlyphBoxes:g}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,l=o.posMatrix,u=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,f=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,m=o.collisionGroup,y=s.get("text-optional"),v=s.get("icon-optional"),g=s.get("text-allow-overlap"),_=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),S="viewport-y"===s.get("symbol-z-order"),E=g&&(_||!a.hasIconData()||v),T=_&&(g||!a.hasTextData()||y);!a.collisionArrays&&f&&a.deserializeCollisionBoxes(f);var k=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var f,S=!1,k=!1,C=!0,I=null,P={box:null,offscreen:null},A={box:null,offscreen:null},D=null,M=null,z=0,O=0,L=0;o.textFeatureIndex?z=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),o.verticalTextFeatureIndex&&(O=o.verticalTextFeatureIndex);var j=o.textBox;if(j){var R=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},B=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(P=n(),A=P):P=r(),!(P&&P.box&&P.box.length));i+=1);else P=r()};if(s.get("text-variable-anchor")){var F=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var N=i.prevPlacement.variableOffsets[e.crossTileID];F.indexOf(N.anchor)>0&&(F=F.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var U=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,u=e.textBoxScale,c=w&&!_?r:null,p={box:[],offscreen:!1},f=g?2*F.length:F.length,d=0;d<f;++d){var y=i.attemptAnchorPlacement(F[d%F.length],t,o,s,u,x,b,h,l,m,d>=F.length,e,a,n,c);if(y&&(p=y.placedGlyphBoxes)&&p.box&&p.box.length){S=!0,I=y.shift;break}}return p};B((function(){return U(j,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(P&&P.box&&P.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),P&&(S=P.box,C=P.offscreen);var q=R(P&&P.box);if(!S&&i.prevPlacement){var V=i.prevPlacement.variableOffsets[e.crossTileID];V&&(i.variableOffsets[e.crossTileID]=V,i.markUsedJustification(a,V.anchor,e,q))}}else{var Z=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,g,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};B((function(){return Z(j,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?Z(r,t.WritingMode.vertical):{box:null,offscreen:null}})),R(P&&P.box&&P.box.length)}}if(S=(f=P)&&f.box&&f.box.length>0,C=f&&f.offscreen,e.useRuntimeCollisionCircles){var W=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),H=t.evaluateSizeForFeature(a.textSizeData,d,W),Y=s.get("text-padding");D=i.collisionIndex.placeCollisionCircles(g,W,a.lineVertexArray,a.glyphOffsetArray,H,l,u,c,n,b,m.predicate,e.collisionCircleDiameter,Y),S=g||D.circles.length>0&&!D.collisionDetected,C=C&&D.offscreen}if(o.iconFeatureIndex&&(L=o.iconFeatureIndex),o.iconBox){var G=function(t){var e=w&&I?xe(t,I.x,I.y,x,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,_,h,l,m.predicate)};k=A&&A.box&&A.box.length&&o.verticalIconBox?(M=G(o.verticalIconBox)).box.length>0:(M=G(o.iconBox)).box.length>0,C=C&&M.offscreen}var X=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=v||0===e.numIconVertices;if(X||K?K?X||(k=k&&S):S=k&&S:k=S=k&&S,S&&f&&f.box&&i.collisionIndex.insertCollisionBox(f.box,s.get("text-ignore-placement"),a.bucketInstanceId,A&&A.box&&O?O:z,m.ID),k&&M&&i.collisionIndex.insertCollisionBox(M.box,s.get("icon-ignore-placement"),a.bucketInstanceId,L,m.ID),D&&(S&&i.collisionIndex.insertCollisionCircles(D.circles,s.get("text-ignore-placement"),a.bucketInstanceId,z,m.ID),n)){var J=a.bucketInstanceId,$=i.collisionCircleArrays[J];void 0===$&&($=i.collisionCircleArrays[J]=new ye);for(var Q=0;Q<D.circles.length;Q+=4)$.circles.push(D.circles[Q+0]),$.circles.push(D.circles[Q+1]),$.circles.push(D.circles[Q+2]),$.circles.push(D.collisionDetected?1:0)}i.placements[e.crossTileID]=new me(S||E,k||T,C||a.justReloaded),r[e.crossTileID]=!0}};if(S)for(var C=a.getSortedSymbolIndexes(this.transform.angle),I=C.length-1;I>=0;--I){var P=C[I];k(a.symbolInstances.get(P),a.collisionArrays[P])}else for(var A=e.symbolInstanceStart;A<e.symbolInstanceEnd;A++)k(a.symbolInstances.get(A),a.collisionArrays[A]);if(n&&a.bucketInstanceId in this.collisionCircleArrays){var D=this.collisionCircleArrays[a.bucketInstanceId];t.invert(D.invProjMatrix,l),D.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1},be.prototype.markUsedJustification=function(e,r,n,i){var o;o=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)];for(var a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var l=s[a];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=o>=0&&l!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=o)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=i[s];u?(this.opacities[s]=new de(u,n,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new de(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in i){var h=i[c];if(!this.opacities[c]){var p=new de(h,n,!1,!1);p.isHidden()||(this.opacities[c]=p,r=r||h.text.placed||h.icon.placed)}}for(var f in o)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=o[f]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var o=i[n],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,r,n){var i=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,a=new de(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),u=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),f=new de(null,0,s&&(l||!e.hasIconData()||o.get("icon-optional")),l&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);for(var d=function(t,e,r){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(r)},m=function(n){var o=e.symbolInstances.get(n),s=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,m=o.crossTileID,y=i.opacities[m];r[m]?y=a:y||(i.opacities[m]=y=f),r[m]=!0;var v=o.numIconVertices>0,g=i.placedOrientations[o.crossTileID],_=g===t.WritingMode.vertical,x=g===t.WritingMode.horizontal||g===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Ae(y.text);d(e.text,s,_?De:b),d(e.text,l,x?De:b);var w=y.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||_?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var S=i.variableOffsets[o.crossTileID];S&&i.markUsedJustification(e,S.anchor,o,g);var E=i.placedOrientations[o.crossTileID];E&&(i.markUsedJustification(e,"left",o,E),i.markUsedOrientation(e,E,o))}if(v){var T=Ae(y.icon),k=!(p&&o.verticalPlacedIconSymbolIndex&&_);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,k?T:De),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,k?De:T),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var C=e.collisionArrays[n];if(C){var I=new t.Point(0,0);if(C.textBox||C.verticalTextBox){var P=!0;if(u){var A=i.variableOffsets[m];A?(I=_e(A.anchor,A.width,A.height,A.textOffset,A.textBoxScale),c&&I._rotate(h?i.transform.angle:-i.transform.angle)):P=!1}C.textBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!P||_,I.x,I.y),C.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,y.text.placed,!P||x,I.x,I.y)}var D=Boolean(!x&&C.verticalIconBox);C.iconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,D,p?I.x:0,p?I.y:0),C.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!D,p?I.x:0,p?I.y:0)}}},y=0;y<e.symbolInstances.length;y++)m(y);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var v=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=v.invProjMatrix,e.placementViewportMatrix=v.viewportMatrix,e.collisionCircleArray=v.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},be.prototype.setStale=function(){this.stale=!0};var Se=Math.pow(2,25),Ee=Math.pow(2,24),Te=Math.pow(2,17),ke=Math.pow(2,16),Ce=Math.pow(2,9),Ie=Math.pow(2,8),Pe=Math.pow(2,1);function Ae(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Se+e*Ee+r*Te+e*ke+r*Ce+e*Ie+r*Pe+e}var De=0,Me=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Me.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1};var ze=function(t,e,r,n,i,o,a){this.placement=new be(t,i,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};ze.prototype.isDone=function(){return this._done},ze.prototype.continuePlacement=function(e,r,n){for(var i=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Me(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Le=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),o=i.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Le.prototype.getScaledCoordinates=function(e,r){var n=Oe/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*n),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*n)}},Le.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var o=t.get(i);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),l=0,u=a;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!r[c.crossTileID]){r[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var je=function(){this.maxCrossTileID=0};je.prototype.generate=function(){return++this.maxCrossTileID};var Re=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Re.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var o in n){var a=n[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),i[a.tileID.key]=a}this.indexes[r]=i}this.lng=t},Re.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var u=a[t.scaledTo(Number(o)).key];u&&u.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Le(t,e.symbolInstances,e.bucketInstanceId),!0},Re.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1)delete this.usedCrossTileIDs[t][i[n].crossTileID]},Re.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Be=function(){this.layerIndexes={},this.crossTileIDs=new je,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Be.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Re);var i=!1,o={};n.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(i=!0),o[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(o)&&(i=!0),i},Be.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var Fe=function(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))},Ne=t.pick(Ut,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ue=t.pick(Ut,["setCenter","setZoom","setBearing","setPitch"]),qe=function(){var e={},r=t.styleSpec.$version;for(var n in t.styleSpec.$root){var i,o=t.styleSpec.$root[n];o.required&&null!=(i="version"===n?r:"array"===o.type?[]:{})&&(e[n]=i)}return e}(),Ve=function(e){function r(n,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new E(Bt(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new _(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new S(256,512),this.crossTileSymbolIndex=new Be,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(e){a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var n in a.sourceCaches)a.sourceCaches[n].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in o._layers){var i=o._layers[n];i.source===r.id&&o._validateLayer(i)}}}}))}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(qe,!1)},r.prototype._load=function(e,r){if(!r||!Fe(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(n,e.sources[n],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Nt(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,a=i;o<a.length;o+=1){var s=a[o];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._loadSprite=function(e){var r=this;this._spriteRequest=function(e,r,n){var i,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,a||(a=t,i=e,c())})),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){u=null,a||(a=t,o=e,c())}));function c(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,h=l.x,p=l.y,f=l.sdf,d=l.pixelRatio,m=l.stretchX,y=l.stretchY,v=l.content,g=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,g,{x:h,y:p},{x:0,y:0},{width:u,height:c}),r[s]={data:g,pixelRatio:d,sdf:f,stretchX:m,stretchY:y,content:v}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=this._layers[n[r]];"custom"!==i.type&&e.push(i.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var o in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var a=this._updatedSources[o];"reload"===a?this._reloadSource(o):"clear"===a&&this._clearSource(o)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var u in this.sourceCaches){var c=this.sourceCaches[u];l[u]=c.used,c.used=!1}for(var h=0,p=this._order;h<p.length;h+=1){var f=this._layers[p[h]];f.recalculate(e,this._availableImages),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(var d in l){var m=this.sourceCaches[d];l[d]!==m.used&&m.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:d}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),Fe(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Nt(e.layers);var n=function(e,r){if(!e)return[{command:Ut.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Ut.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:Ut.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:Ut.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:Ut.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:Ut.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:Ut.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:Ut.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:Ut.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:Ut.setLight,args:[r.light]});var i={},o=[];!function(e,r,n,i){var o;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||Vt(o,n,i));for(o in r)r.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],r[o])||("geojson"===e[o].type&&"geojson"===r[o].type&&Wt(e,r,o)?n.push({command:Ut.setGeoJSONSourceData,args:[o,r[o].data]}):Zt(o,r,n,i)):qt(o,r,n))}(e.sources,r.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?n.push({command:Ut.removeLayer,args:[t.id]}):a.push(t)})),n=n.concat(o),function(e,r,n){r=r||[];var i,o,a,s,l,u,c,h=(e=e||[]).map(Yt),p=r.map(Yt),f=e.reduce(Gt,{}),d=r.reduce(Gt,{}),m=h.slice(),y=Object.create(null);for(i=0,o=0;i<h.length;i++)d.hasOwnProperty(a=h[i])?o++:(n.push({command:Ut.removeLayer,args:[a]}),m.splice(m.indexOf(a,o),1));for(i=0,o=0;i<p.length;i++)m[m.length-1-i]!==(a=p[p.length-1-i])&&(f.hasOwnProperty(a)?(n.push({command:Ut.removeLayer,args:[a]}),m.splice(m.lastIndexOf(a,m.length-o),1)):o++,n.push({command:Ut.addLayer,args:[d[a],u=m[m.length-i]]}),m.splice(m.length-i,0,a),y[a]=!0);for(i=0;i<p.length;i++)if(s=f[a=p[i]],l=d[a],!y[a]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Ht(s.layout,l.layout,n,a,null,Ut.setLayoutProperty),Ht(s.paint,l.paint,n,a,null,Ut.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:Ut.setFilter,args:[a,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:Ut.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Ht(s[c],l[c],n,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Ht(s[c],l[c],n,a,c.slice(6),Ut.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Ut.setLayerProperty,args:[a,c,l[c]]}))}else n.push({command:Ut.removeLayer,args:[a]}),u=m[m.lastIndexOf(a)+1],n.push({command:Ut.addLayer,args:[l,u]})}(a,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Ut.setStyle,args:[r]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in Ue)}));if(0===n.length)return!1;var i=n.filter((function(t){return!(t.command in Ne)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new At(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(Fe(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][a];if(u)for(var c=0,h=u;c<h.length;c+=1)i.push(h[c])}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],f=this._order.length-1;f>=0;f--){var d=this._order[f];if(r(d))for(var m=i.length-1;m>=0;m--){var y=i[m].feature;if(n[y.layer.id]<f)break;p.push(y),i.pop()}else for(var v=0,g=t;v<g.length;v+=1){var _=g[v][d];if(_)for(var x=0,b=_;x<b.length;x+=1)p.push(b[x].feature)}}return p},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var u=[];for(var c in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[c]||u.push(R(this.sourceCaches[c],this._layers,this._serializedLayers,e,r,n));return this.placement&&u.push(function(t,e,r,n,i,o,a){for(var s={},l=o.queryRenderedSymbols(n),u=[],c=0,h=Object.keys(l).map(Number);c<h.length;c+=1)u.push(a[h[c]]);u.sort(B);for(var p=function(){var r=d[f],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],e,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var o in n){var a=s[o]=s[o]||[],u=n[o];u.sort((function(t,e){var n=r.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(var c=0,h=u;c<h.length;c+=1)a.push(h[c])}},f=0,d=u;f<d.length;f+=1)p();var m=function(e){s[e].forEach((function(n){var i=n.feature,o=r[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o}))};for(var y in s)m(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],i={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;i[s]||(i[s]=!0,a.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var o in e)if(!t.deepEqual(e[o],n[o])){i=!0;break}if(i){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}},r.prototype._validate=function(e,r,n,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Fe(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i,o){void 0===o&&(o=!1);for(var a=!1,s=!1,l={},u=0,c=this._order;u<c.length;u+=1){var h=this._layers[c[u]];if("symbol"===h.type){if(!l[h.source]){var p=this.sourceCaches[h.source];l[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(h,l[h.source],e.center.lng);a=a||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new ze(e,this._order,o,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var d=0,m=this._order;d<m.length;d+=1){var y=this._layers[m[d]];"symbol"===y.type&&this.placement.updateLayerOpacities(y,l[y.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);Ve.getSourceType=function(t){return L[t]},Ve.setSourceType=function(t,e){L[t]=e},Ve.registerForPluginStateChange=t.registerForPluginStateChange;var Ze=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),We=vr("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),He=vr("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ye=vr("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Ge=vr("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Xe=vr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ke=vr("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Je=vr("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),$e=vr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Qe=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tr=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),er=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),rr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),nr=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),or=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ar=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),sr=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),lr=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ur=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),cr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),dr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n    "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = a_"+i+";\n#else\n    "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n    "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+r+" "+n+" "+i+" = a_"+i+";\n#else\n    "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n    "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var gr=Object.freeze({__proto__:null,prelude:We,background:He,backgroundPattern:Ye,circle:Ge,clippingMask:Xe,heatmap:Ke,heatmapTexture:Je,collisionBox:$e,collisionCircle:Qe,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:lr,line:ur,lineGradient:cr,linePattern:hr,lineSDF:pr,raster:fr,symbolIcon:dr,symbolSDF:mr,symbolTextAndIcon:yr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function xr(t){for(var e=[],r=0;r<t.length;r++)if(null!==t[r]){var n=t[r].split(" ");e.push(n.pop())}return e}_r.prototype.bind=function(t,e,r,n,i,o,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!l&&this.boundIndexBuffer===i&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind()):this.freshBind(e,r,n,i,o,a,s)},_r.prototype.freshBind=function(t,e,r,n,i,o,a){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=u.currentNumAttributes||0;for(var h=l;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var p=0,f=r;p<f.length;p+=1)f[p].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,i)}o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),n&&n.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),u.currentNumAttributes=l},_r.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var br=function(t,e,r,n,i,o){var a=t.gl;this.program=a.createProgram();for(var s=xr(r.staticAttributes),l=n?n.getBinderAttributes():[],u=s.concat(l),c=r.staticUniforms?xr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],p=[],f=0,d=c.concat(h);f<d.length;f+=1){var m=d[f];p.indexOf(m)<0&&p.push(m)}var y=n?n.defines():[];o&&y.push("#define OVERDRAW_INSPECTOR;");var v=y.concat(We.fragmentSource,r.fragmentSource).join("\n"),g=y.concat(We.vertexSource,r.vertexSource).join("\n"),_=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(_,v),a.compileShader(_),a.attachShader(this.program,_);var x=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(x,g),a.compileShader(x),a.attachShader(this.program,x),this.attributes={};var b={};this.numAttributes=u.length;for(var w=0;w<this.numAttributes;w++)u[w]&&(a.bindAttribLocation(this.program,w,u[w]),this.attributes[u[w]]=w);a.linkProgram(this.program),a.deleteShader(x),a.deleteShader(_);for(var S=0;S<p.length;S++){var E=p[S];if(E&&!b[E]){var T=a.getUniformLocation(this.program,E);T&&(b[E]=T)}}this.fixedUniforms=i(t,b),this.binderUniforms=n?n.getUniforms(t,b):[]}}};function wr(t,e,r){var n=1/pe(r,1,e.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,e.transform.tileZoom)/i,a=o*(r.tileID.canonical.x+r.tileID.wrap*i),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,l,u,c,h,p,f,d,m){var y,v=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var _=(y={},y[v.LINES]=2,y[v.TRIANGLES]=3,y[v.LINE_STRIP]=1,y)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],S=w.vaos||(w.vaos={});(S[s]||(S[s]=new _r)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),v.drawElements(e,w.primitiveLength*_,v.UNSIGNED_SHORT,w.primitiveOffset*_*2)}}};var Sr=function(e,r,n,i){var o=r.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},Er=function(e,r,n,i,o,a,s){return t.extend(Sr(e,r,n,i),wr(a,r,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},Tr=function(t){return{u_matrix:t}},kr=function(e,r,n,i){return t.extend(Tr(e),wr(n,r,i))},Cr=function(t,e){return{u_matrix:t,u_world:e}},Ir=function(e,r,n,i,o){return t.extend(kr(e,r,n,i),{u_world:o})},Pr=function(e,r,n,i){var o,a,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=pe(n,1,s.zoom);o=!0,a=[l,l]}else o=!1,a=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},Ar=function(t,e,r){var n=pe(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:o}},Dr=function(t,e,r){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Mr=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}},zr=function(t){return{u_matrix:t}},Or=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:pe(e,1,r),u_intensity:n}},Lr=function(e,r,n){var i=e.transform;return{u_matrix:Nr(e,r,n),u_ratio:1/pe(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},jr=function(e,r,n,i){return t.extend(Lr(e,r,n),{u_image:0,u_image_height:i})},Rr=function(e,r,n,i){var o=e.transform,a=Fr(r,o);return{u_matrix:Nr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/pe(r,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Br=function(e,r,n,i,o){var a=e.lineAtlas,s=Fr(r,e.transform),l="round"===n.layout.get("line-cap"),u=a.getDash(i.from,l),c=a.getDash(i.to,l),h=u.width*o.fromScale,p=c.width*o.toScale;return t.extend(Lr(e,r,n),{u_patternscale_a:[s/h,-u.height/2],u_patternscale_b:[s/p,-c.height/2],u_sdfgamma:a.width/(256*Math.min(h,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:c.y,u_mix:o.t})};function Fr(t,e){return 1/pe(t,1,e.tileZoom)}function Nr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Ur=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(a=i.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:qr(i.paint.get("raster-hue-rotate"))};var o,a};function qr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Vr,Zr=function(t,e,r,n,i,o,a,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Wr=function(e,r,n,i,o,a,s,l,u,c,h){var p=o.transform;return t.extend(Zr(e,r,n,i,o,a,s,l,u,c),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Hr=function(e,r,n,i,o,a,s,l,u,c){return t.extend(Wr(e,r,n,i,o,a,s,l,!0,u,!0),{u_texsize_icon:c,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Gr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Xr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var l=e.context,u=l.gl,c=e.useProgram("collisionBox"),h=[],p=0,f=0,d=0;d<i.length;d++){var m=i[d],y=r.getTile(m),v=y.getBucket(n);if(v){var g=m.posMatrix;0===o[0]&&0===o[1]||(g=e.translatePosMatrix(m.posMatrix,y,o,a));var _=s?v.textCollisionBox:v.iconCollisionBox,x=v.collisionCircleArray;if(x.length>0){var b=t.create(),w=g;t.mul(b,v.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,v.placementViewportMatrix),h.push({circleArray:x,circleOffset:f,transform:w,invTransform:b}),f=p+=x.length/4}_&&c.draw(l,u.LINES,Tt.disabled,kt.disabled,e.colorModeForRenderPass(),It.disabled,Ar(g,e.transform,y),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,null,_.collisionVertexBuffer)}}if(s&&h.length){var S=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*p),E._trim();for(var T=0,k=0,C=h;k<C.length;k+=1)for(var I=C[k],P=0;P<I.circleArray.length/4;P++){var A=4*P,D=I.circleArray[A+0],M=I.circleArray[A+1],z=I.circleArray[A+2],O=I.circleArray[A+3];E.emplace(T++,D,M,z,O,0),E.emplace(T++,D,M,z,O,1),E.emplace(T++,D,M,z,O,2),E.emplace(T++,D,M,z,O,3)}(!Vr||Vr.length<2*p)&&(Vr=function(e){var r=2*e,n=new t.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var o=6*i;n.uint16[o+0]=4*i+0,n.uint16[o+1]=4*i+1,n.uint16[o+2]=4*i+2,n.uint16[o+3]=4*i+2,n.uint16[o+4]=4*i+3,n.uint16[o+5]=4*i+0}return n}(p));for(var L=l.createIndexBuffer(Vr,!0),j=l.createVertexBuffer(E,t.collisionCircleLayout.members,!0),R=0,B=h;R<B.length;R+=1){var F=B[R],N=Dr(F.transform,F.invTransform,e.transform);S.draw(l,u.TRIANGLES,Tt.disabled,kt.disabled,e.colorModeForRenderPass(),It.disabled,N,n.id,j,L,t.SegmentVector.simpleSegment(0,2*F.circleOffset,F.circleArray.length,F.circleArray.length/2),null,e.transform.zoom,null,null,null)}j.destroy(),L.destroy()}}var Jr=t.identity(new Float32Array(16));function $r(e,r,n,i,o,a){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,i);return new t.Point((l/o+c[0])*a,(u/o+c[1])*a)}function Qr(e,r,n,i,o,a,s,l,u,c,h){var p=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};f.clear();for(var y=0;y<p.length;y++){var v=p.get(y),g=v.hidden||!v.crossTileID||e.allowVerticalPlacement&&!v.placedOrientation?null:i[v.crossTileID];if(g){var _=new t.Point(v.anchorX,v.anchorY),x=Qt(_,n?l:s),b=te(a.cameraToCenterDistance,x.signedDistanceFromCamera),w=o.evaluateSizeForFeature(e.textSizeData,c,v)*b/t.ONE_EM;n&&(w*=e.tilePixelRatio/u);for(var S=$r(g.anchor,g.width,g.height,g.textOffset,g.textBoxScale,w),E=n?Qt(_.add(S),s).point:x.point.add(r?S.rotate(-a.angle):S),T=e.allowVerticalPlacement&&v.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,k=0;k<v.numGlyphs;k++)t.addDynamicAttributes(f,E,T);h&&v.associatedIconIndex>=0&&(m[v.associatedIconIndex]={shiftedAnchor:E,angle:T})}else ue(v.numGlyphs,f)}if(h){d.clear();for(var C=e.icon.placedSymbolArray,I=0;I<C.length;I++){var P=C.get(I);if(P.hidden)ue(P.numGlyphs,d);else{var A=m[I];if(A)for(var D=0;D<P.numGlyphs;D++)t.addDynamicAttributes(d,A.shiftedAnchor,A.angle);else ue(P.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function tn(t,e,r){return r.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function en(e,r,n,i,o,a,s,l,u,c,h,p){for(var f=e.context,d=f.gl,m=e.transform,y="map"===l,v="map"===u,g=y&&"point"!==n.layout.get("symbol-placement"),_=y&&!v&&!g,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1),b=!1,w=e.depthModeForSublayer(0,Tt.ReadOnly),S=n.layout.get("text-variable-anchor"),E=[],T=0,k=i;T<k.length;T+=1){var C=k[T],I=r.getTile(C),P=I.getBucket(n);if(P){var A=o?P.text:P.icon;if(A&&A.segments.get().length){var D=A.programConfigurations.get(n.id),M=o||P.sdfIcons,z=o?P.textSizeData:P.iconSizeData,O=v||0!==m.pitch,L=e.useProgram(tn(M,o,P),D),j=t.evaluateSizeForZoom(z,m.zoom),R=void 0,B=[0,0],F=void 0,N=void 0,U=null,q=void 0;if(o)F=I.glyphAtlasTexture,N=d.LINEAR,R=I.glyphAtlasTexture.size,P.iconsInText&&(B=I.imageAtlasTexture.size,U=I.imageAtlasTexture,q=O||e.options.rotating||e.options.zooming||"composite"===z.kind||"camera"===z.kind?d.LINEAR:d.NEAREST);else{var V=1!==n.layout.get("icon-size").constantOr(0)||P.iconsNeedLinear;F=I.imageAtlasTexture,N=M||e.options.rotating||e.options.zooming||V||O?d.LINEAR:d.NEAREST,R=I.imageAtlasTexture.size}var Z=pe(I,1,e.transform.zoom),W=Jt(C.posMatrix,v,y,e.transform,Z),H=$t(C.posMatrix,v,y,e.transform,Z),Y=S&&P.hasTextData(),G="none"!==n.layout.get("icon-text-fit")&&Y&&P.hasIconData();g&&re(P,C.posMatrix,e,o,W,H,v,c);var X=e.translatePosMatrix(C.posMatrix,I,a,s),K=g||o&&S||G?Jr:W,J=e.translatePosMatrix(H,I,a,s,!0),$=M&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),Q={program:L,buffers:A,uniformValues:M?P.iconsInText?Hr(z.kind,j,_,v,e,X,K,J,R,B):Wr(z.kind,j,_,v,e,X,K,J,o,R,!0):Zr(z.kind,j,_,v,e,X,K,J,o,R),atlasTexture:F,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:q,isSDF:M,hasHalo:$};if(x&&P.canOverlap){b=!0;for(var tt=0,et=A.segments.get();tt<et.length;tt+=1){var rt=et[tt];E.push({segments:new t.SegmentVector([rt]),sortKey:rt.sortKey,state:Q})}}else E.push({segments:A.segments,sortKey:0,state:Q})}}}b&&E.sort((function(t,e){return t.sortKey-e.sortKey}));for(var nt=0,it=E;nt<it.length;nt+=1){var ot=it[nt],at=ot.state;if(f.activeTexture.set(d.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,d.CLAMP_TO_EDGE),at.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,rn(at.buffers,ot.segments,n,e,at.program,w,h,p,st)),st.u_is_halo=0}rn(at.buffers,ot.segments,n,e,at.program,w,h,p,at.uniformValues)}}function rn(t,e,r,n,i,o,a,s,l){var u=n.context;i.draw(u,u.gl.TRIANGLES,o,a,s,It.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function nn(t,e,r,n,i,o,a){var s,l,u,c,h,p=t.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();a?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=d?"fillPattern":"fill",s=p.TRIANGLES);for(var y=0,v=n;y<v.length;y+=1){var g=v[y],_=e.getTile(g);if(!d||_.patternsLoaded()){var x=_.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(p.TEXTURE0),_.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePaintBuffers(m));var S=f.constantOr(null);if(S&&_.imageAtlas){var E=_.imageAtlas,T=E.patternPositions[S.to.toString()],k=E.patternPositions[S.from.toString()];T&&k&&b.setConstantPatternPositions(T,k)}var C=t.translatePosMatrix(g.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){c=x.indexBuffer2,h=x.segments2;var I=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===l&&d?Ir(C,t,m,_,I):Cr(C,I)}else c=x.indexBuffer,h=x.segments,u=d?kr(C,t,m,_):Tr(C);w.draw(t.context,s,i,t.stencilModeForClipping(g),o,It.disabled,u,r.id,x.layoutVertexBuffer,c,h,r.paint,t.transform.zoom,b)}}}}function on(t,e,r,n,i,o,a){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),h=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),f=0,d=n;f<d.length;f+=1){var m=d[f],y=e.getTile(m),v=y.getBucket(r);if(v){var g=v.programConfigurations.get(r.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",g);c&&(t.context.activeTexture.set(l.TEXTURE0),y.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePaintBuffers(h));var x=u.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas,w=b.patternPositions[x.to.toString()],S=b.patternPositions[x.from.toString()];w&&S&&g.setConstantPatternPositions(w,S)}var E=t.translatePosMatrix(m.posMatrix,y,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),T=r.paint.get("fill-extrusion-vertical-gradient"),k=c?Er(E,t,T,p,m,h,y):Sr(E,t,T,p);_.draw(s,s.gl.TRIANGLES,i,o,a,It.backCCW,k,r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,r.paint,t.transform.zoom,g)}}}function an(e,r,n,i,o,a){var s=e.context,l=s.gl,u=r.fbo;if(u){var c=e.useProgram("hillshade");s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get());var h=function(e,r,n){var i=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),a=n.paint.get("hillshade-accent-color"),s=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var l,u,c,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),h),u_image:0,u_latrange:(l=r.tileID,u=Math.pow(2,l.canonical.z),c=l.canonical.y,[new t.MercatorCoordinate(0,c/u).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/u).toLngLat().lat]),u_light:[n.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}}(e,r,n);c.draw(s,l.TRIANGLES,i,o,a,It.disabled,h,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function sn(e,r,n,i,o,a){var s=e.context,l=s.gl,u=r.dem;if(u&&u.data){var c=u.dim,h=u.stride,p=u.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){var f=r.demTexture;f.update(p,{premultiply:!1}),f.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(s,p,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var d=r.fbo;if(!d){var m=new t.Texture(s,{width:c,height:c,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(d=r.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,o,a,It.disabled,function(e,r){var n=r.stride,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,u),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function ln(e,r,n,i,o){var a=i.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,u=r?(s-r.timeAdded)/a:-1,c=n.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),f=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}var un=new t.Color(1,0,0,1),cn=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),pn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function dn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function vn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),l=Tt.disabled,u=kt.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,l,u,c,It.disabled,Mr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),f=r.getTile(n).tileSize,d=512/Math.min(f,512)*(n.overscaledZ/e.transform.zoom)*.5,m=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(m+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,m+" "+p+"kb"),s.draw(i,o.TRIANGLES,l,u,Ct.alphaBlended,It.disabled,Mr(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var gn={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=kt.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var l=r.transform,u="map"===o,c="map"===a,h=0,p=e;h<p.length;h+=1){var f=p[h],d=i.getTile(f),m=d.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var y=t.evaluateSizeForZoom(m.textSizeData,l.zoom),v=pe(d,1,r.transform.zoom),g=Jt(f.posMatrix,c,u,r.transform,v),_="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var x=Math.pow(2,l.zoom-d.tileID.overscaledZ);Qr(m,u,c,s,t.symbolSize,l,g,f.posMatrix,x,y,_)}}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&en(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),a,s),0!==n.paint.get("text-opacity").constantOr(1)&&en(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&(Kr(e,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Kr(e,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var o=n.paint.get("circle-opacity"),a=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,c=u.gl,h=e.depthModeForSublayer(0,Tt.ReadOnly),p=kt.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var y=i[m],v=r.getTile(y),g=v.getBucket(n);if(g){var _=g.programConfigurations.get(n.id),x={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:g.layoutVertexBuffer,indexBuffer:g.indexBuffer,uniformValues:Pr(e,y,v,n)};if(l)for(var b=0,w=g.segments.get();b<w.length;b+=1){var S=w[b];d.push({segments:new t.SegmentVector([S]),sortKey:S.sortKey,state:x})}else d.push({segments:g.segments,sortKey:0,state:x})}}l&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,T=d;E<T.length;E+=1){var k=T[E],C=k.state;C.program.draw(u,c.TRIANGLES,h,p,f,It.disabled,C.uniformValues,n.id,C.layoutVertexBuffer,C.indexBuffer,k.segments,n.paint,e.transform.zoom,C.programConfiguration)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=kt.disabled,l=new Ct([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,r,n){var i=t.gl;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE,null),n.colorAttachment.set(r)}(t,e,o,i)}}(o,e,n),o.clear({color:t.Color.transparent});for(var u=0;u<i.length;u++){var c=i[u];if(!r.hasRenderableParent(c)){var h=r.getTile(c),p=h.getBucket(n);if(p){var f=p.programConfigurations.get(n.id);e.useProgram("heatmap",f).draw(o,a.TRIANGLES,Tt.disabled,s,l,It.disabled,Or(c.posMatrix,h,e.transform.zoom,n.paint.get("heatmap-intensity")),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,e.transform.zoom,f)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,o=r.heatmapFbo;if(o){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var a=r.colorRampTexture;a||(a=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Tt.disabled,kt.disabled,e.colorModeForRenderPass(),It.disabled,function(e,r,n,i){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(e,r),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var o=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,Tt.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),h=c.constantOr(1),p=n.paint.get("line-gradient"),f=n.getCrossfadeParameters(),d=h?"linePattern":u?"lineSDF":p?"lineGradient":"line",m=e.context,y=m.gl,v=!0,g=0,_=i;g<_.length;g+=1){var x=_[g],b=r.getTile(x);if(!h||b.patternsLoaded()){var w=b.getBucket(n);if(w){var S=w.programConfigurations.get(n.id),E=e.context.program.get(),T=e.useProgram(d,S),k=v||T.program!==E,C=c.constantOr(null);if(C&&b.imageAtlas){var I=b.imageAtlas,P=I.patternPositions[C.to.toString()],A=I.patternPositions[C.from.toString()];P&&A&&S.setConstantPatternPositions(P,A)}var D=h?Rr(e,b,n,f):u?Br(e,b,n,u,f):p?jr(e,b,n,w.lineClipsArray.length):Lr(e,b,n);if(h)m.activeTexture.set(y.TEXTURE0),b.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),S.updatePaintBuffers(f);else if(u&&(k||e.lineAtlas.dirty))m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m);else if(p){var M=w.gradients[n.id],z=M.texture;if(n.gradientVersion!==M.version){var O=256;if(n.stepInterpolant){var L=r.getSource().maxzoom,j=x.canonical.z===L?Math.ceil(1<<e.transform.maxZoom-x.canonical.z):1;O=t.clamp(t.nextPowerOfTwo(w.maxLineLength/t.EXTENT*1024*j),256,m.maxTextureSize)}M.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:M.gradient||void 0,clips:w.lineClipsArray}),M.texture?M.texture.update(M.gradient):M.texture=new t.Texture(m,M.gradient,y.RGBA),M.version=n.gradientVersion,z=M.texture}m.activeTexture.set(y.TEXTURE0),z.bind(n.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)}T.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(x),l,It.disabled,D,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,e.transform.zoom,S,w.layoutVertexBuffer2),v=!1}}}}},fill:function(e,r,n,i){var o=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Tt.ReadWrite:Tt.ReadOnly);nn(e,r,n,i,c,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Tt.ReadOnly);nn(e,r,n,i,h,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var o=new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))on(t,e,r,n,o,kt.disabled,Ct.disabled),on(t,e,r,n,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();on(t,e,r,n,o,kt.disabled,a)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=t.depthModeForSublayer(0,Tt.ReadOnly),a=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],l=s[0],u=0,c=s[1];u<c.length;u+=1){var h=c[u],p=e.getTile(h);p.needsHillshadePrepare&&"offscreen"===t.renderPass?sn(t,p,r,o,kt.disabled,a):"translucent"===t.renderPass&&an(t,p,r,o,l[h.overscaledZ],a)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),u=a instanceof M?[{},n]:t.stencilConfigForOverlap(n),c=u[0],h=u[1],p=h[h.length-1].overscaledZ,f=!t.options.moving,d=0,m=h;d<m.length;d+=1){var y=m[d],v=t.depthModeForSublayer(y.overscaledZ-p,1===r.paint.get("raster-opacity")?Tt.ReadWrite:Tt.ReadOnly,o.LESS),g=e.getTile(y),_=t.transform.calculatePosMatrix(y.toUnwrapped(),f);g.registerFadeDuration(r.paint.get("raster-fade-duration"));var x=e.findLoadedParent(y,0),b=ln(g,x,e,r,t.transform),w=void 0,S=void 0,E="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),g.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),x?(x.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,x.tileID.overscaledZ-g.tileID.overscaledZ),S=[g.tileID.canonical.x*w%1,g.tileID.canonical.y*w%1]):g.texture.bind(E,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var T=Ur(_,S||[0,0],w||1,b,r);a instanceof M?s.draw(i,o.TRIANGLES,v,kt.disabled,l,It.disabled,T,r.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(i,o.TRIANGLES,v,c[y.overscaledZ],l,It.disabled,T,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var o=t.context,a=o.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var h=kt.disabled,p=t.depthModeForSublayer(0,"opaque"===c?Tt.ReadWrite:Tt.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var y=r.getCrossfadeParameters(),v=0,g=m;v<g.length;v+=1){var _=g[v],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=u?Gr(x,i,t,u,{tileID:_,tileSize:l},y):Yr(x,i,n);d.draw(o,a.TRIANGLES,p,h,f,It.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)vn(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var o=i.prerender;o&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),o.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(kt.disabled);var a="3d"===i.renderingMode?new Tt(t.context.gl.LEQUAL,Tt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Tt.ReadOnly);n.setDepthMode(a),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},_n=function(t,e){this.context=new Pt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=At.maxUnderzooming+At.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Be,this.gpuTimers={}};_n.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1)this.style._layers[i[n]].resize()},_n.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Ze.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ze.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,D.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Ze.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new kt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},_n.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Tt.disabled,this.stencilClearMode,Ct.disabled,It.disabled,zr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},_n.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(Ct.disabled),r.setDepthMode(Tt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,Tt.disabled,new kt({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Ct.disabled,It.disabled,zr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},_n.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new kt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new kt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s<o;s++)a[s+i]=new kt({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=o,[a,n]}return[(e={},e[i]=kt.disabled,e),n]},_n.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Ct([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Ct.unblended:Ct.alphaBlended},_n.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return Tt.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Tt(r||this.context.gl.LEQUAL,e,[n,n])},_n.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},_n.prototype.render=function(e,r){var n=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var i=this.style._order,o=this.style.sourceCaches;for(var a in o){var s=o[a];s.used&&s.prepare(this.context)}var l,u,c={},h={},p={};for(var f in o){var d=o[f];c[f]=d.getVisibleCoordinates(),h[f]=c[f].slice().reverse(),p[f]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++)if(this.style._layers[i[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,v=i;y<v.length;y+=1){var g=this.style._layers[v[y]];if(g.hasOffscreenPass()&&!g.isHidden(this.transform.zoom)){var _=h[g.source];("custom"===g.type||_.length)&&this.renderLayer(this,o[g.source],g,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var x=this.style._layers[i[this.currentLayer]],b=o[x.source],w=c[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var S=this.style._layers[i[this.currentLayer]],E=o[S.source],T=("symbol"===S.type?p:h)[S.source];this._renderTileClippingMasks(S,c[S.source]),this.renderLayer(this,E,S,T)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(u&&u.id)&&(u=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<u.getSource().maxzoom)&&(l=u))})),l&&gn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;dn(t,t.transform.height-(e.top||0),3,un),dn(t,e.bottom||0,3,cn),mn(t,e.left||0,3,hn),mn(t,t.transform.width-(e.right||0),3,pn);var r=t.transform.centerPoint;!function(t,e,r,n){yn(t,e-1,r-10,2,20,n),yn(t,e-10,r-1,20,2,n)}(t,r.x,t.transform.height-r.y,fn)}(this),this.context.setDefault()},_n.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),gn[r.type](t,e,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},_n.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,r=this.gpuTimers[t.id];r||(r=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),r.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query)}},_n.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},_n.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},_n.prototype.queryGpuTimers=function(t){var e={};for(var r in t){var n=t[r],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),e[r]=o}return e},_n.prototype.translatePosMatrix=function(e,r,n,i,o){if(!n[0]&&!n[1])return e;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var u=[o?n[0]:pe(r,n[0],this.transform.zoom),o?n[1]:pe(r,n[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},_n.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},_n.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,gr[t],e,Xr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xn=function(t,e){this.points=t,this.planes=e};xn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new xn(o,a)};var bn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o<r.length;o++)n[o]=r[o]?this.min[o]:this.center[o],i[o]=r[o]?this.center[o]:this.max[o];return i[2]=this.max[2],new bn(n,i)},bn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},bn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},bn.prototype.intersects=function(e){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,i=0;i<e.planes.length;i++){for(var o=e.planes[i],a=0,s=0;s<r.length;s++)a+=t.dot$1(o,r[s])>=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var p=e.points[h][l]-this.min[l];u=Math.min(u,p),c=Math.max(c,p)}if(c<0||u>this.max[l]-this.min[l])return 0}return 1};var wn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Sn=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},En={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Sn.prototype.clone=function(){var t=new Sn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},En.minZoom.get=function(){return this._minZoom},En.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},En.maxZoom.get=function(){return this._maxZoom},En.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},En.minPitch.get=function(){return this._minPitch},En.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},En.maxPitch.get=function(){return this._maxPitch},En.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},En.renderWorldCopies.get=function(){return this._renderWorldCopies},En.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},En.worldSize.get=function(){return this.tileSize*this.scale},En.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},En.size.get=function(){return new t.Point(this.width,this.height)},En.bearing.get=function(){return-this.angle/Math.PI*180},En.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},En.pitch.get=function(){return this._pitch/Math.PI*180},En.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},En.fov.get=function(){return this._fov/Math.PI*180},En.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},En.zoom.get=function(){return this._zoom},En.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},En.center.get=function(){return this._center},En.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},En.padding.get=function(){return this._edgeInsets.toJSON()},En.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},En.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Sn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Sn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Sn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Sn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),l=Math.floor(Math.max(n.x,i.x,o.x,a.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},Sn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=xn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var u=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],p=r,f=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(u(-d)),c.push(u(d));for(c.push(u(0));c.length>0;){var m=c.pop(),y=m.x,v=m.y,g=m.fullyVisible;if(!g){var _=m.aabb.intersects(s);if(0===_)continue;g=2===_}var x=m.aabb.distanceX(a),b=m.aabb.distanceY(a),w=Math.max(Math.abs(x),Math.abs(b));if(m.zoom===p||w>3+(1<<p-m.zoom)-2&&m.zoom>=l)h.push({tileID:new t.OverscaledTileID(m.zoom===p?f:m.zoom,m.wrap,m.zoom,y,v),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-v])});else for(var S=0;S<4;S++){var E=(y<<1)+S%2,T=(v<<1)+(S>>1);c.push({aabb:m.aabb.quadrant(S),zoom:m.zoom+1,x:E,y:T,wrap:m.wrap,fullyVisible:g})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Sn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},En.unmodified.get=function(){return this._unmodified},Sn.prototype.zoomScale=function(t){return Math.pow(2,t)},Sn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Sn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Sn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},En.point.get=function(){return this.project(this.center)},Sn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},Sn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Sn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Sn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Sn.prototype.coordinateLocation=function(t){return t.toLngLat()},Sn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,l=r[2]/i,u=n[2]/o,c=l===u?0:(0-l)/(u-l);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},Sn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Sn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Sn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Sn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Sn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,o.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Sn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Sn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<u.y?u.y/(a-o):0}if(this.lngRange){var p=this.lngRange;s=t.mercatorXfromLng(p[0])*this.worldSize,r=(l=t.mercatorXfromLng(p[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var f=this.point,d=Math.max(r||0,e||0);if(d)return this.center=this.unproject(new t.Point(r?(l+s)/2:f.x,e?(a+o)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,y=u.y/2;m-y<o&&(i=o+y),m+y>a&&(i=a-y)}if(this.lngRange){var v=f.x,g=u.x/2;v-g<s&&(n=s+g),v+g>l&&(n=l-g)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},Sn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,l),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,f=Math.cos(this.angle),d=Math.sin(this.angle),m=a-Math.round(a)+f*h+d*p,y=s-Math.round(s)+f*p+d*h,v=new Float64Array(c);if(t.translate(v,v,[m>.5?m-1:m,y>.5?y-1:y,0]),this.alignedProjMatrix=v,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Sn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Sn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Sn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];n=Math.min(n,u.x),i=Math.min(i,u.y),o=Math.max(o,u.x),a=Math.max(a,u.y)}return[new t.Point(n,i),new t.Point(o,i),new t.Point(o,a),new t.Point(n,a),new t.Point(n,i)]},Object.defineProperties(Sn.prototype,En);var Tn=function(e){var r,n,i,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),n=!1,i=null,o=function(){i=null,n&&(r(),i=setTimeout(o,300),n=!1)},function(){return n=!0,i||o(),i})};Tn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Tn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Tn.prototype.getHashString=function(e){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(r.lng*o)/o,s=Math.round(r.lat*o)/o,l=this._map.getBearing(),u=this._map.getPitch(),c="";if(c+=e?"/"+a+"/"+s+"/"+n:n+"/"+s+"/"+a,(l||u)&&(c+="/"+Math.round(10*l)/10),u&&(c+="/"+Math.round(u)),this._hashName){var h=this._hashName,p=!1,f=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(p=!0,e+"="+c):t})).filter((function(t){return t}));return p||f.push(h+"="+c),"#"+f.join("&")}return"#"+c},Tn.prototype._getCurrentHash=function(){var e,r=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):n.split("/")},Tn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Tn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var kn={linearity:.3,easing:t.bezier(0,0,.3,1)},Cn=t.extend({deceleration:2500,maxSpeed:1400},kn),In=t.extend({deceleration:20,maxSpeed:1400},kn),Pn=t.extend({deceleration:1e3,maxSpeed:360},kn),An=t.extend({deceleration:1e3,maxSpeed:90},kn),Dn=function(t){this._map=t,this.clear()};function Mn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function zn(e,r,n){var i=n.maxSpeed,o=n.linearity,a=n.deceleration,s=t.clamp(e*o/(r/1e3),-i,i),l=Math.abs(s)/(a*o);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}Dn.prototype.clear=function(){this._inertiaBuffer=[]},Dn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Dn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();e.length>0&&r-e[0].time>160;)e.shift()},Dn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var o=i[n].settings;r.zoom+=o.zoomDelta||0,r.bearing+=o.bearingDelta||0,r.pitch+=o.pitchDelta||0,o.panDelta&&r.pan._add(o.panDelta),o.around&&(r.around=o.around),o.pinchAround&&(r.pinchAround=o.pinchAround)}var a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=zn(r.pan.mag(),a,t.extend({},Cn,e||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Mn(s,l)}if(r.zoom){var u=zn(r.zoom,a,In);s.zoom=this._map.transform.zoom+u.amount,Mn(s,u)}if(r.bearing){var c=zn(r.bearing,a,Pn);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),Mn(s,c)}if(r.pitch){var h=zn(r.pitch,a,An);s.pitch=this._map.transform.pitch+h.amount,Mn(s,h)}if(s.zoom||s.bearing){var p=void 0===r.pinchAround?r.around:r.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var On=function(e){function n(n,i,o,a){void 0===a&&(a={});var s=r.mousePos(i.getCanvasContainer(),o),l=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),Ln=function(e){function n(n,i,o){var a="touchend"===n?o.changedTouches:o.touches,s=r.touchPos(i.getCanvasContainer(),a),l=s.map((function(t){return i.unproject(t)})),u=s.reduce((function(t,e,r,n){return t.add(e.div(n.length))}),new t.Point(0,0)),c=i.unproject(u);e.call(this,n,{points:s,point:u,lngLats:l,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),jn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),Rn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Rn.prototype.reset=function(){delete this._mousedownPos},Rn.prototype.wheel=function(t){return this._firePreventable(new jn(t.type,this._map,t))},Rn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new On(t.type,this._map,t))},Rn.prototype.mouseup=function(t){this._map.fire(new On(t.type,this._map,t))},Rn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new On(t.type,this._map,t))},Rn.prototype.dblclick=function(t){return this._firePreventable(new On(t.type,this._map,t))},Rn.prototype.mouseover=function(t){this._map.fire(new On(t.type,this._map,t))},Rn.prototype.mouseout=function(t){this._map.fire(new On(t.type,this._map,t))},Rn.prototype.touchstart=function(t){return this._firePreventable(new Ln(t.type,this._map,t))},Rn.prototype.touchmove=function(t){this._map.fire(new Ln(t.type,this._map,t))},Rn.prototype.touchend=function(t){this._map.fire(new Ln(t.type,this._map,t))},Rn.prototype.touchcancel=function(t){this._map.fire(new Ln(t.type,this._map,t))},Rn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Rn.prototype.isEnabled=function(){return!0},Rn.prototype.isActive=function(){return!1},Rn.prototype.enable=function(){},Rn.prototype.disable=function(){};var Bn=function(t){this._map=t};Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(t){this._map.fire(new On(t.type,this._map,t))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new On("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new On(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var Fn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Nn(t,e){for(var r={},n=0;n<t.length;n++)r[t[n].identifier]=e[n];return r}Fn.prototype.isEnabled=function(){return!!this._enabled},Fn.prototype.isActive=function(){return!!this._active},Fn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Fn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Fn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Fn.prototype.mousemoveWindow=function(t,e){if(this._active){var n=e;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(i.x,n.x),a=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+o+"px,"+s+"px)"),this._box.style.width=a-o+"px",this._box.style.height=l-s+"px"}}},Fn.prototype.mouseupWindow=function(e,n){var i=this;if(this._active&&0===e.button){var o=this._startPos,a=n;if(this.reset(),r.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Fn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Fn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Fn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var Un=function(t){this.reset(),this.numTouches=t.numTouches};Un.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Un.prototype.touchstart=function(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n<i.length;n+=1)r._add(i[n]);return r.div(e.length)}(r),this.touches=Nn(n,r)))},Un.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var n=Nn(r,e);for(var i in this.touches){var o=n[i];(!o||o.dist(this.touches[i])>30)&&(this.aborted=!0)}}},Un.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var qn=function(t){this.singleTap=new Un(t),this.numTaps=t.numTaps,this.reset()};qn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},qn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},qn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Vn=function(){this._zoomIn=new qn({numTouches:1,numTaps:2}),this._zoomOut=new qn({numTouches:2,numTaps:1}),this.reset()};Vn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vn.prototype.touchcancel=function(){this.reset()},Vn.prototype.enable=function(){this._enabled=!0},Vn.prototype.disable=function(){this._enabled=!1,this.reset()},Vn.prototype.isEnabled=function(){return this._enabled},Vn.prototype.isActive=function(){return this._active};var Zn={0:1,2:2},Wn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Wn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Wn.prototype._correctButton=function(t,e){return!1},Wn.prototype._move=function(t,e){return{}},Wn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Wn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Zn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},Wn.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},Wn.prototype.enable=function(){this._enabled=!0},Wn.prototype.disable=function(){this._enabled=!1,this.reset()},Wn.prototype.isEnabled=function(){return this._enabled},Wn.prototype.isActive=function(){return this._active};var Hn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,r){t.prototype.mousedown.call(this,e,r),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Wn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=.8*(e.x-t.x);if(r)return this._active=!0,{bearingDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Wn),Gn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var r=-.5*(e.y-t.y);if(r)return this._active=!0,{pitchDelta:r}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Wn),Xn=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};Xn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Xn.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Xn.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},Xn.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype._calculateTransform=function(e,r,n){n.length>0&&(this._active=!0);var i=Nn(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var l in i){var u=i[l],c=this._touches[l];c&&(o._add(u),a._add(u.sub(c)),s++,i[l]=u)}if(this._touches=i,!(s<this._minTouches)&&a.mag()){var h=a.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:h}}},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var Kn=function(){this.reset()};function Jn(t,e,r){for(var n=0;n<t.length;n++)if(t[n].identifier===r)return e[n]}function $n(t,e){return Math.log(t/e)/Math.LN2}Kn.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Kn.prototype._start=function(t){},Kn.prototype._move=function(t,e,r){return{}},Kn.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Kn.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,i=n[1],o=Jn(r,e,n[0]),a=Jn(r,e,i);if(o&&a){var s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}}},Kn.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,o=i[1],a=Jn(n,e,i[0]),s=Jn(n,e,o);a&&s||(this._active&&r.suppressClick(),this.reset())}},Kn.prototype.touchcancel=function(){this.reset()},Kn.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Kn.prototype.disable=function(){this._enabled=!1,this.reset()},Kn.prototype.isEnabled=function(){return this._enabled},Kn.prototype.isActive=function(){return this._active};var Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs($n(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:$n(this._distance,r),pinchAround:e}},e}(Kn);function ti(t,e){return 180*t.angleWith(e)/Math.PI}var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ti(this._vector,r),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,r=ti(t,this._startVector);return Math.abs(r)<e},e}(Kn);function ri(t){return Math.abs(t.y)>Math.abs(t.x)}var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ri(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ri(t)&&ri(e)&&o}},e}(Kn),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:r?Math.round(l)+r*(t.shiftKey?2:1):l,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&l&&u){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=u(h);a=t.number(l,s,p),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},si.prototype.reset=function(){this._active=!1};var li=function(t,e){this._clickZoom=t,this._tapZoom=e};li.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},li.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},li.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},li.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ui=function(){this.reset()};ui.prototype.reset=function(){this._active=!1},ui.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},ui.prototype.enable=function(){this._enabled=!0},ui.prototype.disable=function(){this._enabled=!1,this.reset()},ui.prototype.isEnabled=function(){return this._enabled},ui.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new qn({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},ci.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},ci.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var pi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};pi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},pi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},pi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},pi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var vi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Dn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;o<a.length;o+=1){var s=a[o],l=s[0];r.addEventListener(l,s[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};vi.prototype.destroy=function(){for(var e=0,n=this._listeners;e<n.length;e+=1){var i=n[e],o=i[0];r.removeEventListener(o,i[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,i[2])}},vi.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Rn(e,t));var n=e.boxZoom=new Fn(e,t);this._add("boxZoom",n);var i=new Vn,o=new ui;e.doubleClickZoom=new li(o,i),this._add("tapZoom",i),this._add("clickZoom",o);var a=new ci;this._add("tapDragZoom",a);var s=e.touchPitch=new ni;this._add("touchPitch",s);var l=new Yn(t),u=new Gn(t);e.dragRotate=new pi(t,l,u),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]);var c=new Hn(t),h=new Xn(t);e.dragPan=new hi(r,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new ei,f=new Qn;e.touchZoomRotate=new fi(r,f,p,a),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]);var d=e.scrollZoom=new si(e,this);this._add("scrollZoom",d,["mousePan"]);var m=e.keyboard=new oi;this._add("keyboard",m),this._add("blockableMapEvent",new Bn(e));for(var y=0,v=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];y<v.length;y+=1){var g=v[y];t.interactive&&t[g]&&e[g].enable(t[g])}},vi.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},vi.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},vi.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},vi.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},vi.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},vi.prototype.isMoving=function(){return Boolean(di(this._eventsInProgress))||this.isZooming()},vi.prototype._blockedByActive=function(t,e,r){for(var n in t)if(n!==r&&(!e||e.indexOf(n)<0))return!0;return!1},vi.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},vi.prototype._getMapTouches=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r];this._el.contains(i.target)&&e.push(i)}return e},vi.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var n="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,t),u=0,c=this._handlers;u<c.length;u+=1){var h=c[u],p=h.handlerName,f=h.handler,d=h.allowed;if(f.isEnabled()){var m=void 0;this._blockedByActive(a,d,p)?f.reset():f[e||t.type]&&(m=f[e||t.type](t,l,s),this.mergeHandlerResult(i,o,m,p,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||f.isActive())&&(a[p]=f)}}var y={};for(var v in this._previousActiveHandlers)a[v]||(y[v]=n);this._previousActiveHandlers=a,(Object.keys(y).length||yi(i))&&(this._changes.push([i,o,y]),this._triggerRenderFrame()),(Object.keys(a).length||yi(i))&&this._map._stop(!0),this._updatingCamera=!1;var g=i.cameraAnimation;g&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],g(this._map))}else this.stop(!0)},vi.prototype.mergeHandlerResult=function(e,r,n,i,o){if(n){t.extend(e,n);var a={handlerName:i,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(r.zoom=a),void 0!==n.panDelta&&(r.drag=a),void 0!==n.pitchDelta&&(r.pitch=a),void 0!==n.bearingDelta&&(r.rotate=a)}},vi.prototype._applyChanges=function(){for(var e={},r={},n={},i=0,o=this._changes;i<o.length;i+=1){var a=o[i],s=a[0],l=a[1],u=a[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(r,l),t.extend(n,u)}this._updateMapTransform(e,r,n),this._changes=[]},vi.prototype._updateMapTransform=function(t,e,r){var n=this._map,i=n.transform;if(!yi(t))return this._fireEvents(e,r,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,l=t.pitchDelta,u=t.around,c=t.pinchAround;void 0!==c&&(u=c),n._stop(!0),u=u||n.transform.centerPoint;var h=i.pointLocation(o?u.sub(o):u);s&&(i.bearing+=s),l&&(i.pitch+=l),a&&(i.zoom+=a),i.setLocationAtPoint(h,u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},vi.prototype._fireEvents=function(e,r,n){var i=this,o=di(this._eventsInProgress),a=di(e),s={};for(var l in e)this._eventsInProgress[l]||(s[l+"start"]=e[l].originalEvent),this._eventsInProgress[l]=e[l];for(var u in!o&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(u,s[u]);for(var c in a&&this._fireEvent("move",a.originalEvent),e)this._fireEvent(c,e[c].originalEvent);var h,p={};for(var f in this._eventsInProgress){var d=this._eventsInProgress[f],m=d.handlerName,y=d.originalEvent;this._handlersById[m].isActive()||(delete this._eventsInProgress[f],p[f+"end"]=h=r[m]||y)}for(var v in p)this._fireEvent(v,p[v]);var g=di(this._eventsInProgress);if(n&&(o||a)&&!g){this._updatingCamera=!0;var _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),x=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};_?(x(_.bearing||this._map.getBearing())&&(_.bearing=0),this._map.easeTo(_,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),x(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},vi.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},vi.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new mi("renderFrame",{timeStamp:e})),t._applyChanges()}))},vi.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var gi=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var n=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var a=i.padding;i.padding={top:a,bottom:a,right:a,left:a}}i.padding=t.extend(o,i.padding);var s=this.transform,l=s.padding,u=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(r)),h=u.rotate(-n*Math.PI/180),p=c.rotate(-n*Math.PI/180),f=new t.Point(Math.max(h.x,p.x),Math.max(h.y,p.y)),d=new t.Point(Math.min(h.x,p.x),Math.min(h.y,p.y)),m=f.sub(d),y=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,v=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(v<0||y<0)){var g=Math.min(s.scaleZoom(s.scale*Math.min(y,v)),i.maxZoom),_="number"==typeof i.offset.x?new t.Point(i.offset.x,i.offset.y):t.Point.convert(i.offset),x=new t.Point((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(n*Math.PI/180),b=_.add(x).mult(s.scale/s.zoomScale(g));return{center:s.unproject(u.add(c).div(2).sub(b)),zoom:g,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,o)},r.prototype._fitInternal=function(e,r,n){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(o=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(a=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l=this.getPadding(),u="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,p="padding"in e?e.padding:i.padding,f=t.Point.convert(e.offset),d=i.centerPoint.add(f),m=i.pointLocation(d),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var v,g,_=i.project(m),x=i.project(y).sub(_),b=i.zoomScale(u-o);e.around&&(v=t.LngLat.convert(e.around),g=i.locationPoint(v));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||u!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,w),this._ease((function(e){if(n._zooming&&(i.zoom=t.number(o,u,e)),n._rotating&&(i.bearing=t.number(a,c,e)),n._pitching&&(i.pitch=t.number(s,h,e)),n._padding&&(i.interpolatePadding(l,p,e),d=i.centerPoint.add(f)),v)i.setLocationAtPoint(v,g);else{var m=i.zoomScale(i.zoom-o),y=u>o?Math.min(2,b):Math.max(.5,b),w=Math.pow(y,1-e),S=i.unproject(_.add(x.mult(e*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?S.wrap():S,d)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,f="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),m=t.Point.convert(e.offset),y=o.centerPoint.add(m),v=o.pointLocation(y),g=t.LngLat.convert(e.center||v);this._normalizeCenter(g);var _=o.project(v),x=o.project(g).sub(_),b=e.curve,w=Math.max(o.width,o.height),S=w/d,E=x.mag();if("minZoom"in e){var T=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),k=w/o.zoomScale(T-a);b=Math.sqrt(k/E*2)}var C=b*b;function I(t){var e=(S*S-w*w+(t?-1:1)*C*C*E*E)/(2*(t?S:w)*C*E);return Math.log(Math.sqrt(e*e+1)-e)}function P(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var D=I(0),M=function(t){return A(D)/A(D+b*t)},z=function(t){return w*((A(D)*(P(e=D+b*t)/A(e))-P(D))/C)/E;var e},O=(I(1)-D)/b;if(Math.abs(E)<1e-6||!isFinite(O)){if(Math.abs(w-S)<1e-6)return this.easeTo(e,r);var L=S<w?-1:1;O=Math.abs(Math.log(S/w))/b,z=function(){return 0},M=function(t){return Math.exp(L*b*t)}}return e.duration="duration"in e?+e.duration:1e3*O/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var i=e*O,d=1/M(i);o.zoom=1===e?c:a+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(l,p,e)),n._padding&&(o.interpolatePadding(u,f,e),y=o.centerPoint.add(m));var v=1===e?g:o.unproject(_.add(x.mult(z(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?v.wrap():v,y),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},_i.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},_i.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},_i.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},_i.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var o=i.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},bi.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=e;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},bi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var wi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Si=t.window.HTMLImageElement,Ei=t.window.HTMLElement,Ti=t.window.ImageBitmap,ki={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ci=function(n){function i(e){var r=this;if(null!=(e=t.extend({},ki,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new Sn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ei))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new vi(this,e),this._hash=e.hash&&new Tn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _i({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new On(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new On(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new On(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return o.splice(a,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),o=t.Point.convert(e[1]);n=[i,new t.Point(o.x,i.y),o,new t.Point(i.x,o.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Ve(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Ve(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(o,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))}else"object"==typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+".  Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var o=n.sdf;void 0===o&&(o=!1);var a=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof Si||Ti&&r instanceof Ti){var u=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:i,stretchX:a,stretchY:s,content:l,sdf:o,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r;this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:i,stretchX:a,stretchY:s,content:l,sdf:o,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof Si||Ti&&r instanceof Ti?t.browser.getImageData(r):r,o=i.width,a=i.height,s=i.data;return void 0===o||void 0===a?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==n.data.width||a!==n.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(n.data.replace(s,!(r instanceof Si||Ti&&r instanceof Ti)),void this.style.updateImage(e,n))},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=r.create("div","mapboxgl-ctrl-"+t,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(e,r){var n=t.browser.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new _n(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(e){var r,n=this,i=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(s,l);var u=new t.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(a=!0,this._crossFadingFactor=c),this.style.update(u)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-i;o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),n.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var e=n.painter.queryGpuTimers(p);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var f=this._sourcesDirty||this._styleDirty||this._placementDirty;return f||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||f||(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Ii(this._canvasContainer),Ii(this._controlContainer),Ii(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},o.version.get=function(){return t.version},Object.defineProperties(i.prototype,o),i}(gi);function Ii(t){t.parentNode&&t.parentNode.removeChild(t)}var Pi={showCompass:!0,showZoom:!0,visualizePitch:!1},Ai=function(e){var n=this;this.options=t.extend({},Pi,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return n._map.zoomIn({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return n._map.zoomOut({},{originalEvent:t})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ai.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),r=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},Ai.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ai.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Di(this._map,this._compass,this.options.visualizePitch)),this._container},Ai.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ai.prototype._createButton=function(t,e){var n=r.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Ai.prototype._setButtonTitle=function(t,e){var r=this._map._getUIString("NavigationControl."+e);t.title=r,t.setAttribute("aria-label",r)};var Di=function(e,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Yn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new Gn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function Mi(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<a?e=i:n.locationPoint(o).distSqr(r)<a&&(e=o)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Di.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Di.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Di.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Di.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Di.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Di.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Di.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Di.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Di.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Di.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Di.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var zi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Oi(t,e,r){var n=t.classList;for(var i in zi)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Li,ji=function(e){function n(n,i){if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var o=r.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var a=r.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<c.length;u+=1){var h=c[u],p=r.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",h.rx),p.setAttributeNS(null,"ry",h.ry),l.appendChild(p)}var f=r.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var d=r.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(d);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var y=r.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(y);var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(6.0, 7.0)"),v.setAttributeNS(null,"fill","#FFFFFF");var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#FFFFFF"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962"),g.appendChild(_),g.appendChild(x),s.appendChild(l),s.appendChild(f),s.appendChild(m),s.appendChild(v),s.appendChild(g),o.appendChild(s),o.setAttributeNS(null,"height",41*this._scale+"px"),o.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(o),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Oi(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,r=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Mi(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,zi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Ri={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Bi=0,Fi=!1,Ni=function(e){function n(r){e.call(this),this.options=t.extend({},Ri,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Li?n(Li):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Li="denied"!==t.state)})):n(Li=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Bi=0,Fi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Fi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new ji(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ji({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Bi--,Fi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Bi>1?(e={maximumAge:6e5,timeout:0},Fi=!0):(e=this.options.positionOptions,Fi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Ui={maxWidth:100,unit:"metric"},qi=function(e){this.options=t.extend({},Ui,e),t.bindAll(["_onMove","setUnit"],this)};function Vi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Zi(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Zi(e,n,l,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Zi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Zi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Zi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Zi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+"&nbsp;"+n}qi.prototype.getDefaultPosition=function(){return"bottom-left"},qi.prototype._onMove=function(){Vi(this._map,this._container,this.options)},qi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},qi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},qi.prototype.setUnit=function(t){this.options.unit=t,Vi(this._map,this._container,this.options)};var Wi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Wi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Wi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Wi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Wi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Wi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Wi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Wi.prototype._isFullscreen=function(){return this._fullscreen},Wi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Wi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Hi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Gi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Hi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Mi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,l=this._container.offsetWidth,u=this._container.offsetHeight;s=i.y+a.bottom.y<u?["top"]:i.y>this._map.transform.height-u?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();r.setTransform(this._container,zi[o]+" translate("+c.x+"px,"+c.y+"px)"),Oi(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Xi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ci,NavigationControl:Ai,GeolocateControl:Ni,AttributionControl:_i,ScaleControl:qi,FullscreenControl:Wi,Popup:Gi,Marker:ji,Style:Ve,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Bt().acquire(Ot)},clearPrewarmedResources:function(){var t=jt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Ot),jt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Lt.workerCount},set workerCount(t){Lt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Xi})),r}()},36382:function(t,e,r){var n={"./af":[42786,2282],"./af.js":[42786,2282],"./ar":[30867,5143],"./ar-dz":[14130,5415],"./ar-dz.js":[14130,5415],"./ar-kw":[96135,8419],"./ar-kw.js":[96135,8419],"./ar-ly":[56440,2756],"./ar-ly.js":[56440,2756],"./ar-ma":[47702,8681],"./ar-ma.js":[47702,8681],"./ar-sa":[16040,9859],"./ar-sa.js":[16040,9859],"./ar-tn":[37100,8671],"./ar-tn.js":[37100,8671],"./ar.js":[30867,5143],"./az":[31083,2281],"./az.js":[31083,2281],"./be":[9808,4430],"./be.js":[9808,4430],"./bg":[68338,3483],"./bg.js":[68338,3483],"./bm":[67438,1221],"./bm.js":[67438,1221],"./bn":[8905,4528],"./bn-bd":[76225,9688],"./bn-bd.js":[76225,9688],"./bn.js":[8905,4528],"./bo":[11560,1578],"./bo.js":[11560,1578],"./br":[1278,5434],"./br.js":[1278,5434],"./bs":[80622,1607],"./bs.js":[80622,1607],"./ca":[2468,4980],"./ca.js":[2468,4980],"./cs":[5822,9989],"./cs.js":[5822,9989],"./cv":[50877,5123],"./cv.js":[50877,5123],"./cy":[47373,2682],"./cy.js":[47373,2682],"./da":[24780,9061],"./da.js":[24780,9061],"./de":[59740,9635],"./de-at":[60217,200],"./de-at.js":[60217,200],"./de-ch":[60894,8560],"./de-ch.js":[60894,8560],"./de.js":[59740,9635],"./dv":[5300,732],"./dv.js":[5300,732],"./el":[50837,4429],"./el.js":[50837,4429],"./en-au":[78348,4318],"./en-au.js":[78348,4318],"./en-ca":[77925,6769],"./en-ca.js":[77925,6769],"./en-gb":[22243,8835],"./en-gb.js":[22243,8835],"./en-ie":[46436,8471],"./en-ie.js":[46436,8471],"./en-il":[47207,7763],"./en-il.js":[47207,7763],"./en-in":[32127,7578],"./en-in.js":[32127,7578],"./en-nz":[76319,8030],"./en-nz.js":[76319,8030],"./en-sg":[31662,4462],"./en-sg.js":[31662,4462],"./eo":[92915,654],"./eo.js":[92915,654],"./es":[55655,5145],"./es-do":[55251,8627],"./es-do.js":[55251,8627],"./es-mx":[96112,9808],"./es-mx.js":[96112,9808],"./es-us":[71146,5482],"./es-us.js":[71146,5482],"./es.js":[55655,5145],"./et":[5603,4135],"./et.js":[5603,4135],"./eu":[77763,3239],"./eu.js":[77763,3239],"./fa":[76959,1147],"./fa.js":[76959,1147],"./fi":[11897,8993],"./fi.js":[11897,8993],"./fil":[42549,970],"./fil.js":[42549,970],"./fo":[94694,1932],"./fo.js":[94694,1932],"./fr":[15596,6194],"./fr-ca":[63049,228],"./fr-ca.js":[63049,228],"./fr-ch":[52330,1525],"./fr-ch.js":[52330,1525],"./fr.js":[15596,6194],"./fy":[5044,6333],"./fy.js":[5044,6333],"./ga":[29295,3601],"./ga.js":[29295,3601],"./gd":[2101,5595],"./gd.js":[2101,5595],"./gl":[38794,982],"./gl.js":[38794,982],"./gom-deva":[27884,4524],"./gom-deva.js":[27884,4524],"./gom-latn":[23168,8697],"./gom-latn.js":[23168,8697],"./gu":[95349,9775],"./gu.js":[95349,9775],"./he":[24206,2825],"./he.js":[24206,2825],"./hi":[30094,3394],"./hi.js":[30094,3394],"./hr":[30316,4995],"./hr.js":[30316,4995],"./hu":[22138,4633],"./hu.js":[22138,4633],"./hy-am":[11423,5485],"./hy-am.js":[11423,5485],"./id":[29218,3054],"./id.js":[29218,3054],"./is":[90135,1898],"./is.js":[90135,1898],"./it":[90626,98],"./it-ch":[10150,220],"./it-ch.js":[10150,220],"./it.js":[90626,98],"./ja":[39183,7509],"./ja.js":[39183,7509],"./jv":[24286,2295],"./jv.js":[24286,2295],"./ka":[12105,407],"./ka.js":[12105,407],"./kk":[47772,5766],"./kk.js":[47772,5766],"./km":[18758,5321],"./km.js":[18758,5321],"./kn":[79282,6205],"./kn.js":[79282,6205],"./ko":[33730,7732],"./ko.js":[33730,7732],"./ku":[1408,5905],"./ku.js":[1408,5905],"./ky":[33291,9391],"./ky.js":[33291,9391],"./lb":[36841,6459],"./lb.js":[36841,6459],"./lo":[55466,7617],"./lo.js":[55466,7617],"./lt":[57010,9522],"./lt.js":[57010,9522],"./lv":[37595,7456],"./lv.js":[37595,7456],"./me":[39861,9068],"./me.js":[39861,9068],"./mi":[35493,8692],"./mi.js":[35493,8692],"./mk":[95966,2475],"./mk.js":[95966,2475],"./ml":[87341,52],"./ml.js":[87341,52],"./mn":[5115,4655],"./mn.js":[5115,4655],"./mr":[10370,4437],"./mr.js":[10370,4437],"./ms":[9847,2644],"./ms-my":[41237,2451],"./ms-my.js":[41237,2451],"./ms.js":[9847,2644],"./mt":[72126,6625],"./mt.js":[72126,6625],"./my":[56165,5530],"./my.js":[56165,5530],"./nb":[64924,640],"./nb.js":[64924,640],"./ne":[16744,96],"./ne.js":[16744,96],"./nl":[68455,8187],"./nl-be":[59814,4558],"./nl-be.js":[59814,4558],"./nl.js":[68455,8187],"./nn":[83877,3706],"./nn.js":[83877,3706],"./oc-lnc":[92135,7958],"./oc-lnc.js":[92135,7958],"./pa-in":[15858,7374],"./pa-in.js":[15858,7374],"./pl":[64495,4177],"./pl.js":[64495,4177],"./pt":[89520,8719],"./pt-br":[57971,648],"./pt-br.js":[57971,648],"./pt.js":[89520,8719],"./ro":[96459,4590],"./ro.js":[96459,4590],"./ru":[21793,6112],"./ru.js":[21793,6112],"./sd":[40950,2343],"./sd.js":[40950,2343],"./se":[10490,9799],"./se.js":[10490,9799],"./si":[90124,5369],"./si.js":[90124,5369],"./sk":[64249,25],"./sk.js":[64249,25],"./sl":[14985,972],"./sl.js":[14985,972],"./sq":[51104,3441],"./sq.js":[51104,3441],"./sr":[49131,9713],"./sr-cyrl":[79915,3612],"./sr-cyrl.js":[79915,3612],"./sr.js":[49131,9713],"./ss":[85893,4221],"./ss.js":[85893,4221],"./sv":[98760,3284],"./sv.js":[98760,3284],"./sw":[91172,7619],"./sw.js":[91172,7619],"./ta":[27333,1303],"./ta.js":[27333,1303],"./te":[23110,9360],"./te.js":[23110,9360],"./tet":[52095,6867],"./tet.js":[52095,6867],"./tg":[27321,446],"./tg.js":[27321,446],"./th":[9041,7274],"./th.js":[9041,7274],"./tk":[19005,442],"./tk.js":[19005,442],"./tl-ph":[75768,8181],"./tl-ph.js":[75768,8181],"./tlh":[89444,5622],"./tlh.js":[89444,5622],"./tr":[72397,4314],"./tr.js":[72397,4314],"./tzl":[28254,663],"./tzl.js":[28254,663],"./tzm":[51106,9542],"./tzm-latn":[30699,1986],"./tzm-latn.js":[30699,1986],"./tzm.js":[51106,9542],"./ug-cn":[9288,1538],"./ug-cn.js":[9288,1538],"./uk":[67691,3448],"./uk.js":[67691,3448],"./ur":[13795,2634],"./ur.js":[13795,2634],"./uz":[6791,7851],"./uz-latn":[60588,5049],"./uz-latn.js":[60588,5049],"./uz.js":[6791,7851],"./vi":[65666,5001],"./vi.js":[65666,5001],"./x-pseudo":[14378,4445],"./x-pseudo.js":[14378,4445],"./yo":[75805,9439],"./yo.js":[75805,9439],"./zh-cn":[83839,9133],"./zh-cn.js":[83839,9133],"./zh-hk":[55726,1654],"./zh-hk.js":[55726,1654],"./zh-mo":[99807,8908],"./zh-mo.js":[99807,8908],"./zh-tw":[74152,7636],"./zh-tw.js":[74152,7636]};function i(t){if(!r.o(n,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=n[t],i=e[0];return r.e(e[1]).then((function(){return r.t(i,23)}))}i.keys=function(){return Object.keys(n)},i.id=36382,t.exports=i},30381:function(t,e,r){(t=r.nmd(t)).exports=function(){"use strict";var e,r;function n(){return e.apply(null,arguments)}function i(t){e=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function p(t,e){var r,n=[];for(r=0;r<t.length;++r)n.push(e(t[r],r));return n}function f(t,e){for(var r in e)s(e,r)&&(t[r]=e[r]);return s(e,"toString")&&(t.toString=e.toString),s(e,"valueOf")&&(t.valueOf=e.valueOf),t}function d(t,e,r,n){return Hr(t,e,r,n,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function y(t){return null==t._pf&&(t._pf=m()),t._pf}function v(t){if(null==t._isValid){var e=y(t),n=r.call(e.parsedDateParts,(function(t){return null!=t})),i=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(i=i&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return i;t._isValid=i}return t._isValid}function g(t){var e=d(NaN);return null!=t?f(y(e),t):y(e).userInvalidated=!0,e}r=Array.prototype.some?Array.prototype.some:function(t){var e,r=Object(this),n=r.length>>>0;for(e=0;e<n;e++)if(e in r&&t.call(this,r[e],e,r))return!0;return!1};var _=n.momentProperties=[],x=!1;function b(t,e){var r,n,i;if(u(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),u(e._i)||(t._i=e._i),u(e._f)||(t._f=e._f),u(e._l)||(t._l=e._l),u(e._strict)||(t._strict=e._strict),u(e._tzm)||(t._tzm=e._tzm),u(e._isUTC)||(t._isUTC=e._isUTC),u(e._offset)||(t._offset=e._offset),u(e._pf)||(t._pf=y(e)),u(e._locale)||(t._locale=e._locale),_.length>0)for(r=0;r<_.length;r++)u(i=e[n=_[r]])||(t[n]=i);return t}function w(t){b(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===x&&(x=!0,n.updateOffset(this),x=!1)}function S(t){return t instanceof w||null!=t&&null!=t._isAMomentObject}function E(t){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function T(t,e){var r=!0;return f((function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,t),r){var i,o,a,l=[];for(o=0;o<arguments.length;o++){if(i="","object"==typeof arguments[o]){for(a in i+="\n["+o+"] ",arguments[0])s(arguments[0],a)&&(i+=a+": "+arguments[0][a]+", ");i=i.slice(0,-2)}else i=arguments[o];l.push(i)}E(t+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),r=!1}return e.apply(this,arguments)}),e)}var k,C={};function I(t,e){null!=n.deprecationHandler&&n.deprecationHandler(t,e),C[t]||(E(e),C[t]=!0)}function P(t){return"undefined"!=typeof Function&&t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function A(t){var e,r;for(r in t)s(t,r)&&(P(e=t[r])?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function D(t,e){var r,n=f({},t);for(r in e)s(e,r)&&(a(t[r])&&a(e[r])?(n[r]={},f(n[r],t[r]),f(n[r],e[r])):null!=e[r]?n[r]=e[r]:delete n[r]);for(r in t)s(t,r)&&!s(e,r)&&a(t[r])&&(n[r]=f({},n[r]));return n}function M(t){null!=t&&this.set(t)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,k=Object.keys?Object.keys:function(t){var e,r=[];for(e in t)s(t,e)&&r.push(e);return r};var z={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function O(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return P(n)?n.call(e,r):n}function L(t,e,r){var n=""+Math.abs(t),i=e-n.length;return(t>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var j=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},F={};function N(t,e,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),t&&(F[t]=i),e&&(F[e[0]]=function(){return L(i.apply(this,arguments),e[1],e[2])}),r&&(F[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function U(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function q(t){var e,r,n=t.match(j);for(e=0,r=n.length;e<r;e++)F[n[e]]?n[e]=F[n[e]]:n[e]=U(n[e]);return function(e){var i,o="";for(i=0;i<r;i++)o+=P(n[i])?n[i].call(e,t):n[i];return o}}function V(t,e){return t.isValid()?(e=Z(e,t.localeData()),B[e]=B[e]||q(e),B[e](t)):t.localeData().invalidDate()}function Z(t,e){var r=5;function n(t){return e.longDateFormat(t)||t}for(R.lastIndex=0;r>=0&&R.test(t);)t=t.replace(R,n),R.lastIndex=0,r-=1;return t}var W={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function H(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(j).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var Y="Invalid date";function G(){return this._invalidDate}var X="%d",K=/\d{1,2}/;function J(t){return this._ordinal.replace("%d",t)}var $={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,r,n){var i=this._relativeTime[r];return P(i)?i(t,e,r,n):i.replace(/%d/i,t)}function tt(t,e){var r=this._relativeTime[t>0?"future":"past"];return P(r)?r(e):r.replace(/%s/i,e)}var et={};function rt(t,e){var r=t.toLowerCase();et[r]=et[r+"s"]=et[e]=t}function nt(t){return"string"==typeof t?et[t]||et[t.toLowerCase()]:void 0}function it(t){var e,r,n={};for(r in t)s(t,r)&&(e=nt(r))&&(n[e]=t[r]);return n}var ot={};function at(t,e){ot[t]=e}function st(t){var e,r=[];for(e in t)s(t,e)&&r.push({unit:e,priority:ot[e]});return r.sort((function(t,e){return t.priority-e.priority})),r}function lt(t){return t%4==0&&t%100!=0||t%400==0}function ut(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ct(t){var e=+t,r=0;return 0!==e&&isFinite(e)&&(r=ut(e)),r}function ht(t,e){return function(r){return null!=r?(ft(this,t,r),n.updateOffset(this,e),this):pt(this,t)}}function pt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function ft(t,e,r){t.isValid()&&!isNaN(r)&&("FullYear"===e&&lt(t.year())&&1===t.month()&&29===t.date()?(r=ct(r),t._d["set"+(t._isUTC?"UTC":"")+e](r,t.month(),Qt(r,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](r))}function dt(t){return P(this[t=nt(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var r,n=st(t=it(t));for(r=0;r<n.length;r++)this[n[r].unit](t[n[r].unit])}else if(P(this[t=nt(t)]))return this[t](e);return this}var yt,vt=/\d/,gt=/\d\d/,_t=/\d{3}/,xt=/\d{4}/,bt=/[+-]?\d{6}/,wt=/\d\d?/,St=/\d\d\d\d?/,Et=/\d\d\d\d\d\d?/,Tt=/\d{1,3}/,kt=/\d{1,4}/,Ct=/[+-]?\d{1,6}/,It=/\d+/,Pt=/[+-]?\d+/,At=/Z|[+-]\d\d:?\d\d/gi,Dt=/Z|[+-]\d\d(?::?\d\d)?/gi,Mt=/[+-]?\d+(\.\d{1,3})?/,zt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Ot(t,e,r){yt[t]=P(e)?e:function(t,n){return t&&r?r:e}}function Lt(t,e){return s(yt,t)?yt[t](e._strict,e._locale):new RegExp(jt(t))}function jt(t){return Rt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,r,n,i){return e||r||n||i})))}function Rt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}yt={};var Bt={};function Ft(t,e){var r,n=e;for("string"==typeof t&&(t=[t]),c(e)&&(n=function(t,r){r[e]=ct(t)}),r=0;r<t.length;r++)Bt[t[r]]=n}function Nt(t,e){Ft(t,(function(t,r,n,i){n._w=n._w||{},e(t,n._w,n,i)}))}function Ut(t,e,r){null!=e&&s(Bt,t)&&Bt[t](e,r._a,r,t)}var qt,Vt=0,Zt=1,Wt=2,Ht=3,Yt=4,Gt=5,Xt=6,Kt=7,Jt=8;function $t(t,e){return(t%e+e)%e}function Qt(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=$t(e,12);return t+=(e-r)/12,1===r?lt(t)?29:28:31-r%7%2}qt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},N("M",["MM",2],"Mo",(function(){return this.month()+1})),N("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),N("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),rt("month","M"),at("month",8),Ot("M",wt),Ot("MM",wt,gt),Ot("MMM",(function(t,e){return e.monthsShortRegex(t)})),Ot("MMMM",(function(t,e){return e.monthsRegex(t)})),Ft(["M","MM"],(function(t,e){e[Zt]=ct(t)-1})),Ft(["MMM","MMMM"],(function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);null!=i?e[Zt]=i:y(r).invalidMonth=t}));var te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ee="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),re=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ne=zt,ie=zt;function oe(t,e){return t?o(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||re).test(e)?"format":"standalone"][t.month()]:o(this._months)?this._months:this._months.standalone}function ae(t,e){return t?o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[re.test(e)?"format":"standalone"][t.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function se(t,e,r){var n,i,o,a=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)o=d([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase();return r?"MMM"===e?-1!==(i=qt.call(this._shortMonthsParse,a))?i:null:-1!==(i=qt.call(this._longMonthsParse,a))?i:null:"MMM"===e?-1!==(i=qt.call(this._shortMonthsParse,a))||-1!==(i=qt.call(this._longMonthsParse,a))?i:null:-1!==(i=qt.call(this._longMonthsParse,a))||-1!==(i=qt.call(this._shortMonthsParse,a))?i:null}function le(t,e,r){var n,i,o;if(this._monthsParseExact)return se.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=d([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),r&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(r&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function ue(t,e){var r;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=ct(e);else if(!c(e=t.localeData().monthsParse(e)))return t;return r=Math.min(t.date(),Qt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,r),t}function ce(t){return null!=t?(ue(this,t),n.updateOffset(this,!0),this):pt(this,"Month")}function he(){return Qt(this.year(),this.month())}function pe(t){return this._monthsParseExact?(s(this,"_monthsRegex")||de.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=ne),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function fe(t){return this._monthsParseExact?(s(this,"_monthsRegex")||de.call(this),t?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=ie),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function de(){function t(t,e){return e.length-t.length}var e,r,n=[],i=[],o=[];for(e=0;e<12;e++)r=d([2e3,e]),n.push(this.monthsShort(r,"")),i.push(this.months(r,"")),o.push(this.months(r,"")),o.push(this.monthsShort(r,""));for(n.sort(t),i.sort(t),o.sort(t),e=0;e<12;e++)n[e]=Rt(n[e]),i[e]=Rt(i[e]);for(e=0;e<24;e++)o[e]=Rt(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function me(t){return lt(t)?366:365}N("Y",0,0,(function(){var t=this.year();return t<=9999?L(t,4):"+"+t})),N(0,["YY",2],0,(function(){return this.year()%100})),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),rt("year","y"),at("year",1),Ot("Y",Pt),Ot("YY",wt,gt),Ot("YYYY",kt,xt),Ot("YYYYY",Ct,bt),Ot("YYYYYY",Ct,bt),Ft(["YYYYY","YYYYYY"],Vt),Ft("YYYY",(function(t,e){e[Vt]=2===t.length?n.parseTwoDigitYear(t):ct(t)})),Ft("YY",(function(t,e){e[Vt]=n.parseTwoDigitYear(t)})),Ft("Y",(function(t,e){e[Vt]=parseInt(t,10)})),n.parseTwoDigitYear=function(t){return ct(t)+(ct(t)>68?1900:2e3)};var ye=ht("FullYear",!0);function ve(){return lt(this.year())}function ge(t,e,r,n,i,o,a){var s;return t<100&&t>=0?(s=new Date(t+400,e,r,n,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,r,n,i,o,a),s}function _e(t){var e,r;return t<100&&t>=0?((r=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function xe(t,e,r){var n=7+e-r;return-(7+_e(t,0,n).getUTCDay()-e)%7+n-1}function be(t,e,r,n,i){var o,a,s=1+7*(e-1)+(7+r-n)%7+xe(t,n,i);return s<=0?a=me(o=t-1)+s:s>me(t)?(o=t+1,a=s-me(t)):(o=t,a=s),{year:o,dayOfYear:a}}function we(t,e,r){var n,i,o=xe(t.year(),e,r),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return a<1?n=a+Se(i=t.year()-1,e,r):a>Se(t.year(),e,r)?(n=a-Se(t.year(),e,r),i=t.year()+1):(i=t.year(),n=a),{week:n,year:i}}function Se(t,e,r){var n=xe(t,e,r),i=xe(t+1,e,r);return(me(t)-n+i)/7}function Ee(t){return we(t,this._week.dow,this._week.doy).week}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),rt("week","w"),rt("isoWeek","W"),at("week",5),at("isoWeek",5),Ot("w",wt),Ot("ww",wt,gt),Ot("W",wt),Ot("WW",wt,gt),Nt(["w","ww","W","WW"],(function(t,e,r,n){e[n.substr(0,1)]=ct(t)}));var Te={dow:0,doy:6};function ke(){return this._week.dow}function Ce(){return this._week.doy}function Ie(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Pe(t){var e=we(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ae(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function De(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Me(t,e){return t.slice(e,7).concat(t.slice(0,e))}N("d",0,"do","day"),N("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),N("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),N("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),rt("day","d"),rt("weekday","e"),rt("isoWeekday","E"),at("day",11),at("weekday",11),at("isoWeekday",11),Ot("d",wt),Ot("e",wt),Ot("E",wt),Ot("dd",(function(t,e){return e.weekdaysMinRegex(t)})),Ot("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),Ot("dddd",(function(t,e){return e.weekdaysRegex(t)})),Nt(["dd","ddd","dddd"],(function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);null!=i?e.d=i:y(r).invalidWeekday=t})),Nt(["d","e","E"],(function(t,e,r,n){e[n]=ct(t)}));var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Oe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Le="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),je=zt,Re=zt,Be=zt;function Fe(t,e){var r=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Me(r,this._week.dow):t?r[t.day()]:r}function Ne(t){return!0===t?Me(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Ue(t){return!0===t?Me(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function qe(t,e,r){var n,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=d([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?"dddd"===e?-1!==(i=qt.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=qt.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=qt.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=qt.call(this._weekdaysParse,a))||-1!==(i=qt.call(this._shortWeekdaysParse,a))||-1!==(i=qt.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=qt.call(this._shortWeekdaysParse,a))||-1!==(i=qt.call(this._weekdaysParse,a))||-1!==(i=qt.call(this._minWeekdaysParse,a))?i:null:-1!==(i=qt.call(this._minWeekdaysParse,a))||-1!==(i=qt.call(this._weekdaysParse,a))||-1!==(i=qt.call(this._shortWeekdaysParse,a))?i:null}function Ve(t,e,r){var n,i,o;if(this._weekdaysParseExact)return qe.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=d([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(r&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(r&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function Ze(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ae(t,this.localeData()),this.add(t-e,"d")):e}function We(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function He(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=De(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ye(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ke.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=je),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ge(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ke.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Re),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Xe(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ke.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ke(){function t(t,e){return e.length-t.length}var e,r,n,i,o,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)r=d([2e3,1]).day(e),n=Rt(this.weekdaysMin(r,"")),i=Rt(this.weekdaysShort(r,"")),o=Rt(this.weekdays(r,"")),a.push(n),s.push(i),l.push(o),u.push(n),u.push(i),u.push(o);a.sort(t),s.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Je(){return this.hours()%12||12}function $e(){return this.hours()||24}function Qe(t,e){N(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function tr(t,e){return e._meridiemParse}function er(t){return"p"===(t+"").toLowerCase().charAt(0)}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Je),N("k",["kk",2],0,$e),N("hmm",0,0,(function(){return""+Je.apply(this)+L(this.minutes(),2)})),N("hmmss",0,0,(function(){return""+Je.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),N("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),N("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),Qe("a",!0),Qe("A",!1),rt("hour","h"),at("hour",13),Ot("a",tr),Ot("A",tr),Ot("H",wt),Ot("h",wt),Ot("k",wt),Ot("HH",wt,gt),Ot("hh",wt,gt),Ot("kk",wt,gt),Ot("hmm",St),Ot("hmmss",Et),Ot("Hmm",St),Ot("Hmmss",Et),Ft(["H","HH"],Ht),Ft(["k","kk"],(function(t,e,r){var n=ct(t);e[Ht]=24===n?0:n})),Ft(["a","A"],(function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t})),Ft(["h","hh"],(function(t,e,r){e[Ht]=ct(t),y(r).bigHour=!0})),Ft("hmm",(function(t,e,r){var n=t.length-2;e[Ht]=ct(t.substr(0,n)),e[Yt]=ct(t.substr(n)),y(r).bigHour=!0})),Ft("hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[Ht]=ct(t.substr(0,n)),e[Yt]=ct(t.substr(n,2)),e[Gt]=ct(t.substr(i)),y(r).bigHour=!0})),Ft("Hmm",(function(t,e,r){var n=t.length-2;e[Ht]=ct(t.substr(0,n)),e[Yt]=ct(t.substr(n))})),Ft("Hmmss",(function(t,e,r){var n=t.length-4,i=t.length-2;e[Ht]=ct(t.substr(0,n)),e[Yt]=ct(t.substr(n,2)),e[Gt]=ct(t.substr(i))}));var rr=/[ap]\.?m?\.?/i,nr=ht("Hours",!0);function ir(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var or,ar={calendar:z,longDateFormat:W,invalidDate:Y,ordinal:X,dayOfMonthOrdinalParse:K,relativeTime:$,months:te,monthsShort:ee,week:Te,weekdays:ze,weekdaysMin:Le,weekdaysShort:Oe,meridiemParse:rr},sr={},lr={};function ur(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function cr(t){return t?t.toLowerCase().replace("_","-"):t}function hr(t){for(var e,r,n,i,o=0;o<t.length;){for(e=(i=cr(t[o]).split("-")).length,r=(r=cr(t[o+1]))?r.split("-"):null;e>0;){if(n=pr(i.slice(0,e).join("-")))return n;if(r&&r.length>=e&&ur(i,r)>=e-1)break;e--}o++}return or}function pr(e){var r=null;if(void 0===sr[e]&&t&&t.exports)try{r=or._abbr,Object(function(){var t=new Error("Cannot find module 'undefined'");throw t.code="MODULE_NOT_FOUND",t}()),fr(r)}catch(t){sr[e]=null}return sr[e]}function fr(t,e){var r;return t&&((r=u(e)?yr(t):dr(t,e))?or=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),or._abbr}function dr(t,e){if(null!==e){var r,n=ar;if(e.abbr=t,null!=sr[t])I("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=sr[t]._config;else if(null!=e.parentLocale)if(null!=sr[e.parentLocale])n=sr[e.parentLocale]._config;else{if(null==(r=pr(e.parentLocale)))return lr[e.parentLocale]||(lr[e.parentLocale]=[]),lr[e.parentLocale].push({name:t,config:e}),null;n=r._config}return sr[t]=new M(D(n,e)),lr[t]&&lr[t].forEach((function(t){dr(t.name,t.config)})),fr(t),sr[t]}return delete sr[t],null}function mr(t,e){if(null!=e){var r,n,i=ar;null!=sr[t]&&null!=sr[t].parentLocale?sr[t].set(D(sr[t]._config,e)):(null!=(n=pr(t))&&(i=n._config),e=D(i,e),null==n&&(e.abbr=t),(r=new M(e)).parentLocale=sr[t],sr[t]=r),fr(t)}else null!=sr[t]&&(null!=sr[t].parentLocale?(sr[t]=sr[t].parentLocale,t===fr()&&fr(t)):null!=sr[t]&&delete sr[t]);return sr[t]}function yr(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return or;if(!o(t)){if(e=pr(t))return e;t=[t]}return hr(t)}function vr(){return k(sr)}function gr(t){var e,r=t._a;return r&&-2===y(t).overflow&&(e=r[Zt]<0||r[Zt]>11?Zt:r[Wt]<1||r[Wt]>Qt(r[Vt],r[Zt])?Wt:r[Ht]<0||r[Ht]>24||24===r[Ht]&&(0!==r[Yt]||0!==r[Gt]||0!==r[Xt])?Ht:r[Yt]<0||r[Yt]>59?Yt:r[Gt]<0||r[Gt]>59?Gt:r[Xt]<0||r[Xt]>999?Xt:-1,y(t)._overflowDayOfYear&&(e<Vt||e>Wt)&&(e=Wt),y(t)._overflowWeeks&&-1===e&&(e=Kt),y(t)._overflowWeekday&&-1===e&&(e=Jt),y(t).overflow=e),t}var _r=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,br=/Z|[+-]\d\d(?::?\d\d)?/,wr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Sr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Er=/^\/?Date\((-?\d+)/i,Tr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,kr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Cr(t){var e,r,n,i,o,a,s=t._i,l=_r.exec(s)||xr.exec(s);if(l){for(y(t).iso=!0,e=0,r=wr.length;e<r;e++)if(wr[e][1].exec(l[1])){i=wr[e][0],n=!1!==wr[e][2];break}if(null==i)return void(t._isValid=!1);if(l[3]){for(e=0,r=Sr.length;e<r;e++)if(Sr[e][1].exec(l[3])){o=(l[2]||" ")+Sr[e][0];break}if(null==o)return void(t._isValid=!1)}if(!n&&null!=o)return void(t._isValid=!1);if(l[4]){if(!br.exec(l[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),Fr(t)}else t._isValid=!1}function Ir(t,e,r,n,i,o){var a=[Pr(t),ee.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return o&&a.push(parseInt(o,10)),a}function Pr(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Ar(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dr(t,e,r){return!t||Oe.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(y(r).weekdayMismatch=!0,r._isValid=!1,!1)}function Mr(t,e,r){if(t)return kr[t];if(e)return 0;var n=parseInt(r,10),i=n%100;return(n-i)/100*60+i}function zr(t){var e,r=Tr.exec(Ar(t._i));if(r){if(e=Ir(r[4],r[3],r[2],r[5],r[6],r[7]),!Dr(r[1],e,t))return;t._a=e,t._tzm=Mr(r[8],r[9],r[10]),t._d=_e.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),y(t).rfc2822=!0}else t._isValid=!1}function Or(t){var e=Er.exec(t._i);null===e?(Cr(t),!1===t._isValid&&(delete t._isValid,zr(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:n.createFromInputFallback(t)))):t._d=new Date(+e[1])}function Lr(t,e,r){return null!=t?t:null!=e?e:r}function jr(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Rr(t){var e,r,n,i,o,a=[];if(!t._d){for(n=jr(t),t._w&&null==t._a[Wt]&&null==t._a[Zt]&&Br(t),null!=t._dayOfYear&&(o=Lr(t._a[Vt],n[Vt]),(t._dayOfYear>me(o)||0===t._dayOfYear)&&(y(t)._overflowDayOfYear=!0),r=_e(o,0,t._dayOfYear),t._a[Zt]=r.getUTCMonth(),t._a[Wt]=r.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=n[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Ht]&&0===t._a[Yt]&&0===t._a[Gt]&&0===t._a[Xt]&&(t._nextDay=!0,t._a[Ht]=0),t._d=(t._useUTC?_e:ge).apply(null,a),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ht]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(y(t).weekdayMismatch=!0)}}function Br(t){var e,r,n,i,o,a,s,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(o=1,a=4,r=Lr(e.GG,t._a[Vt],we(Yr(),1,4).year),n=Lr(e.W,1),((i=Lr(e.E,1))<1||i>7)&&(l=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,u=we(Yr(),o,a),r=Lr(e.gg,t._a[Vt],u.year),n=Lr(e.w,u.week),null!=e.d?((i=e.d)<0||i>6)&&(l=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),n<1||n>Se(r,o,a)?y(t)._overflowWeeks=!0:null!=l?y(t)._overflowWeekday=!0:(s=be(r,n,i,o,a),t._a[Vt]=s.year,t._dayOfYear=s.dayOfYear)}function Fr(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],y(t).empty=!0;var e,r,i,o,a,s,l=""+t._i,u=l.length,c=0;for(i=Z(t._f,t._locale).match(j)||[],e=0;e<i.length;e++)o=i[e],(r=(l.match(Lt(o,t))||[])[0])&&((a=l.substr(0,l.indexOf(r))).length>0&&y(t).unusedInput.push(a),l=l.slice(l.indexOf(r)+r.length),c+=r.length),F[o]?(r?y(t).empty=!1:y(t).unusedTokens.push(o),Ut(o,r,t)):t._strict&&!r&&y(t).unusedTokens.push(o);y(t).charsLeftOver=u-c,l.length>0&&y(t).unusedInput.push(l),t._a[Ht]<=12&&!0===y(t).bigHour&&t._a[Ht]>0&&(y(t).bigHour=void 0),y(t).parsedDateParts=t._a.slice(0),y(t).meridiem=t._meridiem,t._a[Ht]=Nr(t._locale,t._a[Ht],t._meridiem),null!==(s=y(t).era)&&(t._a[Vt]=t._locale.erasConvertYear(s,t._a[Vt])),Rr(t),gr(t)}else zr(t);else Cr(t)}function Nr(t,e,r){var n;return null==r?e:null!=t.meridiemHour?t.meridiemHour(e,r):null!=t.isPM?((n=t.isPM(r))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function Ur(t){var e,r,n,i,o,a,s=!1;if(0===t._f.length)return y(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;i<t._f.length;i++)o=0,a=!1,e=b({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[i],Fr(e),v(e)&&(a=!0),o+=y(e).charsLeftOver,o+=10*y(e).unusedTokens.length,y(e).score=o,s?o<n&&(n=o,r=e):(null==n||o<n||a)&&(n=o,r=e,a&&(s=!0));f(t,r||e)}function qr(t){if(!t._d){var e=it(t._i),r=void 0===e.day?e.date:e.day;t._a=p([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),Rr(t)}}function Vr(t){var e=new w(gr(Zr(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Zr(t){var e=t._i,r=t._f;return t._locale=t._locale||yr(t._l),null===e||void 0===r&&""===e?g({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),S(e)?new w(gr(e)):(h(e)?t._d=e:o(r)?Ur(t):r?Fr(t):Wr(t),v(t)||(t._d=null),t))}function Wr(t){var e=t._i;u(e)?t._d=new Date(n.now()):h(e)?t._d=new Date(e.valueOf()):"string"==typeof e?Or(t):o(e)?(t._a=p(e.slice(0),(function(t){return parseInt(t,10)})),Rr(t)):a(e)?qr(t):c(e)?t._d=new Date(e):n.createFromInputFallback(t)}function Hr(t,e,r,n,i){var s={};return!0!==e&&!1!==e||(n=e,e=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(a(t)&&l(t)||o(t)&&0===t.length)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=r,s._i=t,s._f=e,s._strict=n,Vr(s)}function Yr(t,e,r,n){return Hr(t,e,r,n,!1)}n.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),n.ISO_8601=function(){},n.RFC_2822=function(){};var Gr=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Yr.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:g()})),Xr=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Yr.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:g()}));function Kr(t,e){var r,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Yr();for(r=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](r)||(r=e[n]);return r}function Jr(){return Kr("isBefore",[].slice.call(arguments,0))}function $r(){return Kr("isAfter",[].slice.call(arguments,0))}var Qr=function(){return Date.now?Date.now():+new Date},tn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function en(t){var e,r,n=!1;for(e in t)if(s(t,e)&&(-1===qt.call(tn,e)||null!=t[e]&&isNaN(t[e])))return!1;for(r=0;r<tn.length;++r)if(t[tn[r]]){if(n)return!1;parseFloat(t[tn[r]])!==ct(t[tn[r]])&&(n=!0)}return!0}function rn(){return this._isValid}function nn(){return Cn(NaN)}function on(t){var e=it(t),r=e.year||0,n=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,a=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=en(e),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+a+7*o,this._months=+i+3*n+12*r,this._data={},this._locale=yr(),this._bubble()}function an(t){return t instanceof on}function sn(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function ln(t,e,r){var n,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(n=0;n<i;n++)(r&&t[n]!==e[n]||!r&&ct(t[n])!==ct(e[n]))&&a++;return a+o}function un(t,e){N(t,0,0,(function(){var t=this.utcOffset(),r="+";return t<0&&(t=-t,r="-"),r+L(~~(t/60),2)+e+L(~~t%60,2)}))}un("Z",":"),un("ZZ",""),Ot("Z",Dt),Ot("ZZ",Dt),Ft(["Z","ZZ"],(function(t,e,r){r._useUTC=!0,r._tzm=hn(Dt,t)}));var cn=/([\+\-]|\d\d)/gi;function hn(t,e){var r,n,i=(e||"").match(t);return null===i?null:0===(n=60*(r=((i[i.length-1]||[])+"").match(cn)||["-",0,0])[1]+ct(r[2]))?0:"+"===r[0]?n:-n}function pn(t,e){var r,i;return e._isUTC?(r=e.clone(),i=(S(t)||h(t)?t.valueOf():Yr(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):Yr(t).local()}function fn(t){return-Math.round(t._d.getTimezoneOffset())}function dn(t,e,r){var i,o=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=hn(Dt,t)))return this}else Math.abs(t)<16&&!r&&(t*=60);return!this._isUTC&&e&&(i=fn(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),o!==t&&(!e||this._changeInProgress?Mn(this,Cn(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:fn(this)}function mn(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function yn(t){return this.utcOffset(0,t)}function vn(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(fn(this),"m")),this}function gn(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=hn(At,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function _n(t){return!!this.isValid()&&(t=t?Yr(t).utcOffset():0,(this.utcOffset()-t)%60==0)}function xn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function bn(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return b(e,this),(e=Zr(e))._a?(t=e._isUTC?d(e._a):Yr(e._a),this._isDSTShifted=this.isValid()&&ln(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function wn(){return!!this.isValid()&&!this._isUTC}function Sn(){return!!this.isValid()&&this._isUTC}function En(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var Tn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,kn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Cn(t,e){var r,n,i,o=t,a=null;return an(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(o={},e?o[e]=+t:o.milliseconds=+t):(a=Tn.exec(t))?(r="-"===a[1]?-1:1,o={y:0,d:ct(a[Wt])*r,h:ct(a[Ht])*r,m:ct(a[Yt])*r,s:ct(a[Gt])*r,ms:ct(sn(1e3*a[Xt]))*r}):(a=kn.exec(t))?(r="-"===a[1]?-1:1,o={y:In(a[2],r),M:In(a[3],r),w:In(a[4],r),d:In(a[5],r),h:In(a[6],r),m:In(a[7],r),s:In(a[8],r)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=An(Yr(o.from),Yr(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),n=new on(o),an(t)&&s(t,"_locale")&&(n._locale=t._locale),an(t)&&s(t,"_isValid")&&(n._isValid=t._isValid),n}function In(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function Pn(t,e){var r={};return r.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function An(t,e){var r;return t.isValid()&&e.isValid()?(e=pn(e,t),t.isBefore(e)?r=Pn(t,e):((r=Pn(e,t)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Dn(t,e){return function(r,n){var i;return null===n||isNaN(+n)||(I(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),Mn(this,Cn(r,n),t),this}}function Mn(t,e,r,i){var o=e._milliseconds,a=sn(e._days),s=sn(e._months);t.isValid()&&(i=null==i||i,s&&ue(t,pt(t,"Month")+s*r),a&&ft(t,"Date",pt(t,"Date")+a*r),o&&t._d.setTime(t._d.valueOf()+o*r),i&&n.updateOffset(t,a||s))}Cn.fn=on.prototype,Cn.invalid=nn;var zn=Dn(1,"add"),On=Dn(-1,"subtract");function Ln(t){return"string"==typeof t||t instanceof String}function jn(t){return S(t)||h(t)||Ln(t)||c(t)||Bn(t)||Rn(t)||null==t}function Rn(t){var e,r,n=a(t)&&!l(t),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(e=0;e<o.length;e+=1)r=o[e],i=i||s(t,r);return n&&i}function Bn(t){var e=o(t),r=!1;return e&&(r=0===t.filter((function(e){return!c(e)&&Ln(t)})).length),e&&r}function Fn(t){var e,r,n=a(t)&&!l(t),i=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(e=0;e<o.length;e+=1)r=o[e],i=i||s(t,r);return n&&i}function Nn(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function Un(t,e){1===arguments.length&&(arguments[0]?jn(arguments[0])?(t=arguments[0],e=void 0):Fn(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||Yr(),i=pn(r,this).startOf("day"),o=n.calendarFormat(this,i)||"sameElse",a=e&&(P(e[o])?e[o].call(this,r):e[o]);return this.format(a||this.localeData().calendar(o,this,Yr(r)))}function qn(){return new w(this)}function Vn(t,e){var r=S(t)?t:Yr(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=nt(e)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf())}function Zn(t,e){var r=S(t)?t:Yr(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=nt(e)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf())}function Wn(t,e,r,n){var i=S(t)?t:Yr(t),o=S(e)?e:Yr(e);return!!(this.isValid()&&i.isValid()&&o.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,r):!this.isBefore(i,r))&&(")"===n[1]?this.isBefore(o,r):!this.isAfter(o,r))}function Hn(t,e){var r,n=S(t)?t:Yr(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=nt(e)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf()))}function Yn(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function Gn(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function Xn(t,e,r){var n,i,o;if(!this.isValid())return NaN;if(!(n=pn(t,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),e=nt(e)){case"year":o=Kn(this,n)/12;break;case"month":o=Kn(this,n);break;case"quarter":o=Kn(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-i)/864e5;break;case"week":o=(this-n-i)/6048e5;break;default:o=this-n}return r?o:ut(o)}function Kn(t,e){if(t.date()<e.date())return-Kn(e,t);var r=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(r,"months");return-(r+(e-n<0?(e-n)/(n-t.clone().add(r-1,"months")):(e-n)/(t.clone().add(r+1,"months")-n)))||0}function Jn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function $n(t){if(!this.isValid())return null;var e=!0!==t,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?V(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(r,"Z")):V(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Qn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,r,n,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),t="["+i+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=o+'[")]',this.format(t+e+r+n)}function ti(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)}function ei(t,e){return this.isValid()&&(S(t)&&t.isValid()||Yr(t).isValid())?Cn({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ri(t){return this.from(Yr(),t)}function ni(t,e){return this.isValid()&&(S(t)&&t.isValid()||Yr(t).isValid())?Cn({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ii(t){return this.to(Yr(),t)}function oi(t){var e;return void 0===t?this._locale._abbr:(null!=(e=yr(t))&&(this._locale=e),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ai=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function si(){return this._locale}var li=1e3,ui=60*li,ci=60*ui,hi=3506328*ci;function pi(t,e){return(t%e+e)%e}function fi(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-hi:new Date(t,e,r).valueOf()}function di(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-hi:Date.UTC(t,e,r)}function mi(t){var e,r;if(void 0===(t=nt(t))||"millisecond"===t||!this.isValid())return this;switch(r=this._isUTC?di:fi,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=pi(e+(this._isUTC?0:this.utcOffset()*ui),ci);break;case"minute":e=this._d.valueOf(),e-=pi(e,ui);break;case"second":e=this._d.valueOf(),e-=pi(e,li)}return this._d.setTime(e),n.updateOffset(this,!0),this}function yi(t){var e,r;if(void 0===(t=nt(t))||"millisecond"===t||!this.isValid())return this;switch(r=this._isUTC?di:fi,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ci-pi(e+(this._isUTC?0:this.utcOffset()*ui),ci)-1;break;case"minute":e=this._d.valueOf(),e+=ui-pi(e,ui)-1;break;case"second":e=this._d.valueOf(),e+=li-pi(e,li)-1}return this._d.setTime(e),n.updateOffset(this,!0),this}function vi(){return this._d.valueOf()-6e4*(this._offset||0)}function gi(){return Math.floor(this.valueOf()/1e3)}function _i(){return new Date(this.valueOf())}function xi(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function bi(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function wi(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Ei(){return f({},y(this))}function Ti(){return y(this).overflow}function ki(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ci(t,e){var r,i,o,a=this._eras||yr("en")._eras;for(r=0,i=a.length;r<i;++r)switch("string"==typeof a[r].since&&(o=n(a[r].since).startOf("day"),a[r].since=o.valueOf()),typeof a[r].until){case"undefined":a[r].until=1/0;break;case"string":o=n(a[r].until).startOf("day").valueOf(),a[r].until=o.valueOf()}return a}function Ii(t,e,r){var n,i,o,a,s,l=this.eras();for(t=t.toUpperCase(),n=0,i=l.length;n<i;++n)if(o=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(a===t)return l[n];break;case"NNNN":if(o===t)return l[n];break;case"NNNNN":if(s===t)return l[n]}else if([o,a,s].indexOf(t)>=0)return l[n]}function Pi(t,e){var r=t.since<=t.until?1:-1;return void 0===e?n(t.since).year():n(t.since).year()+(e-t.offset)*r}function Ai(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].name;if(n[t].until<=r&&r<=n[t].since)return n[t].name}return""}function Di(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].narrow;if(n[t].until<=r&&r<=n[t].since)return n[t].narrow}return""}function Mi(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until)return n[t].abbr;if(n[t].until<=r&&r<=n[t].since)return n[t].abbr}return""}function zi(){var t,e,r,i,o=this.localeData().eras();for(t=0,e=o.length;t<e;++t)if(r=o[t].since<=o[t].until?1:-1,i=this.clone().startOf("day").valueOf(),o[t].since<=i&&i<=o[t].until||o[t].until<=i&&i<=o[t].since)return(this.year()-n(o[t].since).year())*r+o[t].offset;return this.year()}function Oi(t){return s(this,"_erasNameRegex")||Ui.call(this),t?this._erasNameRegex:this._erasRegex}function Li(t){return s(this,"_erasAbbrRegex")||Ui.call(this),t?this._erasAbbrRegex:this._erasRegex}function ji(t){return s(this,"_erasNarrowRegex")||Ui.call(this),t?this._erasNarrowRegex:this._erasRegex}function Ri(t,e){return e.erasAbbrRegex(t)}function Bi(t,e){return e.erasNameRegex(t)}function Fi(t,e){return e.erasNarrowRegex(t)}function Ni(t,e){return e._eraYearOrdinalRegex||It}function Ui(){var t,e,r=[],n=[],i=[],o=[],a=this.eras();for(t=0,e=a.length;t<e;++t)n.push(Rt(a[t].name)),r.push(Rt(a[t].abbr)),i.push(Rt(a[t].narrow)),o.push(Rt(a[t].name)),o.push(Rt(a[t].abbr)),o.push(Rt(a[t].narrow));this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}function qi(t,e){N(0,[t,t.length],0,e)}function Vi(t){return Xi.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Zi(t){return Xi.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Wi(){return Se(this.year(),1,4)}function Hi(){return Se(this.isoWeekYear(),1,4)}function Yi(){var t=this.localeData()._week;return Se(this.year(),t.dow,t.doy)}function Gi(){var t=this.localeData()._week;return Se(this.weekYear(),t.dow,t.doy)}function Xi(t,e,r,n,i){var o;return null==t?we(this,n,i).year:(e>(o=Se(t,n,i))&&(e=o),Ki.call(this,t,e,r,n,i))}function Ki(t,e,r,n,i){var o=be(t,e,r,n,i),a=_e(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),Ot("N",Ri),Ot("NN",Ri),Ot("NNN",Ri),Ot("NNNN",Bi),Ot("NNNNN",Fi),Ft(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?y(r).era=i:y(r).invalidEra=t})),Ot("y",It),Ot("yy",It),Ot("yyy",It),Ot("yyyy",It),Ot("yo",Ni),Ft(["y","yy","yyy","yyyy"],Vt),Ft(["yo"],(function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[Vt]=r._locale.eraYearOrdinalParse(t,i):e[Vt]=parseInt(t,10)})),N(0,["gg",2],0,(function(){return this.weekYear()%100})),N(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),qi("gggg","weekYear"),qi("ggggg","weekYear"),qi("GGGG","isoWeekYear"),qi("GGGGG","isoWeekYear"),rt("weekYear","gg"),rt("isoWeekYear","GG"),at("weekYear",1),at("isoWeekYear",1),Ot("G",Pt),Ot("g",Pt),Ot("GG",wt,gt),Ot("gg",wt,gt),Ot("GGGG",kt,xt),Ot("gggg",kt,xt),Ot("GGGGG",Ct,bt),Ot("ggggg",Ct,bt),Nt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,r,n){e[n.substr(0,2)]=ct(t)})),Nt(["gg","GG"],(function(t,e,r,i){e[i]=n.parseTwoDigitYear(t)})),N("Q",0,"Qo","quarter"),rt("quarter","Q"),at("quarter",7),Ot("Q",vt),Ft("Q",(function(t,e){e[Zt]=3*(ct(t)-1)})),N("D",["DD",2],"Do","date"),rt("date","D"),at("date",9),Ot("D",wt),Ot("DD",wt,gt),Ot("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),Ft(["D","DD"],Wt),Ft("Do",(function(t,e){e[Wt]=ct(t.match(wt)[0])}));var $i=ht("Date",!0);function Qi(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}N("DDD",["DDDD",3],"DDDo","dayOfYear"),rt("dayOfYear","DDD"),at("dayOfYear",4),Ot("DDD",Tt),Ot("DDDD",_t),Ft(["DDD","DDDD"],(function(t,e,r){r._dayOfYear=ct(t)})),N("m",["mm",2],0,"minute"),rt("minute","m"),at("minute",14),Ot("m",wt),Ot("mm",wt,gt),Ft(["m","mm"],Yt);var to=ht("Minutes",!1);N("s",["ss",2],0,"second"),rt("second","s"),at("second",15),Ot("s",wt),Ot("ss",wt,gt),Ft(["s","ss"],Gt);var eo,ro,no=ht("Seconds",!1);for(N("S",0,0,(function(){return~~(this.millisecond()/100)})),N(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),N(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),N(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),N(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),N(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),N(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),rt("millisecond","ms"),at("millisecond",16),Ot("S",Tt,vt),Ot("SS",Tt,gt),Ot("SSS",Tt,_t),eo="SSSS";eo.length<=9;eo+="S")Ot(eo,It);function io(t,e){e[Xt]=ct(1e3*("0."+t))}for(eo="S";eo.length<=9;eo+="S")Ft(eo,io);function oo(){return this._isUTC?"UTC":""}function ao(){return this._isUTC?"Coordinated Universal Time":""}ro=ht("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var so=w.prototype;function lo(t){return Yr(1e3*t)}function uo(){return Yr.apply(null,arguments).parseZone()}function co(t){return t}so.add=zn,so.calendar=Un,so.clone=qn,so.diff=Xn,so.endOf=yi,so.format=ti,so.from=ei,so.fromNow=ri,so.to=ni,so.toNow=ii,so.get=dt,so.invalidAt=Ti,so.isAfter=Vn,so.isBefore=Zn,so.isBetween=Wn,so.isSame=Hn,so.isSameOrAfter=Yn,so.isSameOrBefore=Gn,so.isValid=Si,so.lang=ai,so.locale=oi,so.localeData=si,so.max=Xr,so.min=Gr,so.parsingFlags=Ei,so.set=mt,so.startOf=mi,so.subtract=On,so.toArray=xi,so.toObject=bi,so.toDate=_i,so.toISOString=$n,so.inspect=Qn,"undefined"!=typeof Symbol&&null!=Symbol.for&&(so[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),so.toJSON=wi,so.toString=Jn,so.unix=gi,so.valueOf=vi,so.creationData=ki,so.eraName=Ai,so.eraNarrow=Di,so.eraAbbr=Mi,so.eraYear=zi,so.year=ye,so.isLeapYear=ve,so.weekYear=Vi,so.isoWeekYear=Zi,so.quarter=so.quarters=Ji,so.month=ce,so.daysInMonth=he,so.week=so.weeks=Ie,so.isoWeek=so.isoWeeks=Pe,so.weeksInYear=Yi,so.weeksInWeekYear=Gi,so.isoWeeksInYear=Wi,so.isoWeeksInISOWeekYear=Hi,so.date=$i,so.day=so.days=Ze,so.weekday=We,so.isoWeekday=He,so.dayOfYear=Qi,so.hour=so.hours=nr,so.minute=so.minutes=to,so.second=so.seconds=no,so.millisecond=so.milliseconds=ro,so.utcOffset=dn,so.utc=yn,so.local=vn,so.parseZone=gn,so.hasAlignedHourOffset=_n,so.isDST=xn,so.isLocal=wn,so.isUtcOffset=Sn,so.isUtc=En,so.isUTC=En,so.zoneAbbr=oo,so.zoneName=ao,so.dates=T("dates accessor is deprecated. Use date instead.",$i),so.months=T("months accessor is deprecated. Use month instead",ce),so.years=T("years accessor is deprecated. Use year instead",ye),so.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mn),so.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",bn);var ho=M.prototype;function po(t,e,r,n){var i=yr(),o=d().set(n,e);return i[r](o,t)}function fo(t,e,r){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return po(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=po(t,n,r,"month");return i}function mo(t,e,r,n){"boolean"==typeof t?(c(e)&&(r=e,e=void 0),e=e||""):(r=e=t,t=!1,c(e)&&(r=e,e=void 0),e=e||"");var i,o=yr(),a=t?o._week.dow:0,s=[];if(null!=r)return po(e,(r+a)%7,n,"day");for(i=0;i<7;i++)s[i]=po(e,(i+a)%7,n,"day");return s}function yo(t,e){return fo(t,e,"months")}function vo(t,e){return fo(t,e,"monthsShort")}function go(t,e,r){return mo(t,e,r,"weekdays")}function _o(t,e,r){return mo(t,e,r,"weekdaysShort")}function xo(t,e,r){return mo(t,e,r,"weekdaysMin")}ho.calendar=O,ho.longDateFormat=H,ho.invalidDate=G,ho.ordinal=J,ho.preparse=co,ho.postformat=co,ho.relativeTime=Q,ho.pastFuture=tt,ho.set=A,ho.eras=Ci,ho.erasParse=Ii,ho.erasConvertYear=Pi,ho.erasAbbrRegex=Li,ho.erasNameRegex=Oi,ho.erasNarrowRegex=ji,ho.months=oe,ho.monthsShort=ae,ho.monthsParse=le,ho.monthsRegex=fe,ho.monthsShortRegex=pe,ho.week=Ee,ho.firstDayOfYear=Ce,ho.firstDayOfWeek=ke,ho.weekdays=Fe,ho.weekdaysMin=Ue,ho.weekdaysShort=Ne,ho.weekdaysParse=Ve,ho.weekdaysRegex=Ye,ho.weekdaysShortRegex=Ge,ho.weekdaysMinRegex=Xe,ho.isPM=er,ho.meridiem=ir,fr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ct(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=T("moment.lang is deprecated. Use moment.locale instead.",fr),n.langData=T("moment.langData is deprecated. Use moment.localeData instead.",yr);var bo=Math.abs;function wo(){var t=this._data;return this._milliseconds=bo(this._milliseconds),this._days=bo(this._days),this._months=bo(this._months),t.milliseconds=bo(t.milliseconds),t.seconds=bo(t.seconds),t.minutes=bo(t.minutes),t.hours=bo(t.hours),t.months=bo(t.months),t.years=bo(t.years),this}function So(t,e,r,n){var i=Cn(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function Eo(t,e){return So(this,t,e,1)}function To(t,e){return So(this,t,e,-1)}function ko(t){return t<0?Math.floor(t):Math.ceil(t)}function Co(){var t,e,r,n,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*ko(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=ut(o/1e3),l.seconds=t%60,e=ut(t/60),l.minutes=e%60,r=ut(e/60),l.hours=r%24,a+=ut(r/24),s+=i=ut(Io(a)),a-=ko(Po(i)),n=ut(s/12),s%=12,l.days=a,l.months=s,l.years=n,this}function Io(t){return 4800*t/146097}function Po(t){return 146097*t/4800}function Ao(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if("month"===(t=nt(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,r=this._months+Io(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(Po(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function Do(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ct(this._months/12):NaN}function Mo(t){return function(){return this.as(t)}}var zo=Mo("ms"),Oo=Mo("s"),Lo=Mo("m"),jo=Mo("h"),Ro=Mo("d"),Bo=Mo("w"),Fo=Mo("M"),No=Mo("Q"),Uo=Mo("y");function qo(){return Cn(this)}function Vo(t){return t=nt(t),this.isValid()?this[t+"s"]():NaN}function Zo(t){return function(){return this.isValid()?this._data[t]:NaN}}var Wo=Zo("milliseconds"),Ho=Zo("seconds"),Yo=Zo("minutes"),Go=Zo("hours"),Xo=Zo("days"),Ko=Zo("months"),Jo=Zo("years");function $o(){return ut(this.days()/7)}var Qo=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ea(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function ra(t,e,r,n){var i=Cn(t).abs(),o=Qo(i.as("s")),a=Qo(i.as("m")),s=Qo(i.as("h")),l=Qo(i.as("d")),u=Qo(i.as("M")),c=Qo(i.as("w")),h=Qo(i.as("y")),p=o<=r.ss&&["s",o]||o<r.s&&["ss",o]||a<=1&&["m"]||a<r.m&&["mm",a]||s<=1&&["h"]||s<r.h&&["hh",s]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(p=p||c<=1&&["w"]||c<r.w&&["ww",c]),(p=p||u<=1&&["M"]||u<r.M&&["MM",u]||h<=1&&["y"]||["yy",h])[2]=e,p[3]=+t>0,p[4]=n,ea.apply(null,p)}function na(t){return void 0===t?Qo:"function"==typeof t&&(Qo=t,!0)}function ia(t,e){return void 0!==ta[t]&&(void 0===e?ta[t]:(ta[t]=e,"s"===t&&(ta.ss=e-1),!0))}function oa(t,e){if(!this.isValid())return this.localeData().invalidDate();var r,n,i=!1,o=ta;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(i=t),"object"==typeof e&&(o=Object.assign({},ta,e),null!=e.s&&null==e.ss&&(o.ss=e.s-1)),n=ra(this,!i,o,r=this.localeData()),i&&(n=r.pastFuture(+this,n)),r.postformat(n)}var aa=Math.abs;function sa(t){return(t>0)-(t<0)||+t}function la(){if(!this.isValid())return this.localeData().invalidDate();var t,e,r,n,i,o,a,s,l=aa(this._milliseconds)/1e3,u=aa(this._days),c=aa(this._months),h=this.asSeconds();return h?(t=ut(l/60),e=ut(t/60),l%=60,t%=60,r=ut(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=h<0?"-":"",o=sa(this._months)!==sa(h)?"-":"",a=sa(this._days)!==sa(h)?"-":"",s=sa(this._milliseconds)!==sa(h)?"-":"",i+"P"+(r?o+r+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+n+"S":"")):"P0D"}var ua=on.prototype;return ua.isValid=rn,ua.abs=wo,ua.add=Eo,ua.subtract=To,ua.as=Ao,ua.asMilliseconds=zo,ua.asSeconds=Oo,ua.asMinutes=Lo,ua.asHours=jo,ua.asDays=Ro,ua.asWeeks=Bo,ua.asMonths=Fo,ua.asQuarters=No,ua.asYears=Uo,ua.valueOf=Do,ua._bubble=Co,ua.clone=qo,ua.get=Vo,ua.milliseconds=Wo,ua.seconds=Ho,ua.minutes=Yo,ua.hours=Go,ua.days=Xo,ua.weeks=$o,ua.months=Ko,ua.years=Jo,ua.humanize=oa,ua.toISOString=la,ua.toString=la,ua.toJSON=la,ua.locale=oi,ua.localeData=si,ua.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",la),ua.lang=ai,N("X",0,0,"unix"),N("x",0,0,"valueOf"),Ot("x",Pt),Ot("X",Mt),Ft("X",(function(t,e,r){r._d=new Date(1e3*parseFloat(t))})),Ft("x",(function(t,e,r){r._d=new Date(ct(t))})),n.version="2.29.1",i(Yr),n.fn=so,n.min=Jr,n.max=$r,n.now=Qr,n.utc=d,n.unix=lo,n.months=yo,n.isDate=h,n.locale=fr,n.invalid=g,n.duration=Cn,n.isMoment=S,n.weekdays=go,n.parseZone=uo,n.localeData=yr,n.isDuration=an,n.monthsShort=vo,n.weekdaysMin=xo,n.defineLocale=dr,n.updateLocale=mr,n.locales=vr,n.weekdaysShort=_o,n.normalizeUnits=nt,n.relativeTimeRounding=na,n.relativeTimeThreshold=ia,n.calendarFormat=Nn,n.prototype=so,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()}},h={};function p(t){var e=h[t];if(void 0!==e)return e.exports;var r=h[t]={id:t,loaded:!1,exports:{}};return c[t].call(r.exports,r,r.exports,p),r.loaded=!0,r.exports}p.m=c,p.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return p.d(e,{a:e}),e},e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},p.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);p.r(i);var o={};t=t||[null,e({}),e([]),e(e)];for(var a=2&n&&r;"object"==typeof a&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach((function(t){o[t]=function(){return r[t]}}));return o.default=function(){return r},p.d(i,o),i},p.d=function(t,e){for(var r in e)p.o(e,r)&&!p.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},p.f={},p.e=function(t){return Promise.all(Object.keys(p.f).reduce((function(e,r){return p.f[r](t,e),e}),[]))},p.u=function(t){return({25:"moment-locales/moment-sk.js",52:"moment-locales/moment-ml.js",96:"moment-locales/moment-ne.js",98:"moment-locales/moment-it.js",200:"moment-locales/moment-de-at.js",220:"moment-locales/moment-it-ch.js",228:"moment-locales/moment-fr-ca.js",407:"moment-locales/moment-ka.js",442:"moment-locales/moment-tk.js",446:"moment-locales/moment-tg.js",640:"moment-locales/moment-nb.js",648:"moment-locales/moment-pt-br.js",654:"moment-locales/moment-eo.js",663:"moment-locales/moment-tzl.js",732:"moment-locales/moment-dv.js",970:"moment-locales/moment-fil.js",972:"moment-locales/moment-sl.js",982:"moment-locales/moment-gl.js",1147:"moment-locales/moment-fa.js",1221:"moment-locales/moment-bm.js",1303:"moment-locales/moment-ta.js",1525:"moment-locales/moment-fr-ch.js",1538:"moment-locales/moment-ug-cn.js",1578:"moment-locales/moment-bo.js",1607:"moment-locales/moment-bs.js",1654:"moment-locales/moment-zh-hk.js",1898:"moment-locales/moment-is.js",1932:"moment-locales/moment-fo.js",1986:"moment-locales/moment-tzm-latn.js",2281:"moment-locales/moment-az.js",2282:"moment-locales/moment-af.js",2295:"moment-locales/moment-jv.js",2343:"moment-locales/moment-sd.js",2451:"moment-locales/moment-ms-my.js",2475:"moment-locales/moment-mk.js",2634:"moment-locales/moment-ur.js",2644:"moment-locales/moment-ms.js",2682:"moment-locales/moment-cy.js",2756:"moment-locales/moment-ar-ly.js",2825:"moment-locales/moment-he.js",3054:"moment-locales/moment-id.js",3239:"moment-locales/moment-eu.js",3284:"moment-locales/moment-sv.js",3394:"moment-locales/moment-hi.js",3441:"moment-locales/moment-sq.js",3448:"moment-locales/moment-uk.js",3483:"moment-locales/moment-bg.js",3601:"moment-locales/moment-ga.js",3612:"moment-locales/moment-sr-cyrl.js",3706:"moment-locales/moment-nn.js",4135:"moment-locales/moment-et.js",4177:"moment-locales/moment-pl.js",4221:"moment-locales/moment-ss.js",4314:"moment-locales/moment-tr.js",4318:"moment-locales/moment-en-au.js",4429:"moment-locales/moment-el.js",4430:"moment-locales/moment-be.js",4437:"moment-locales/moment-mr.js",4445:"moment-locales/moment-x-pseudo.js",4462:"moment-locales/moment-en-sg.js",4524:"moment-locales/moment-gom-deva.js",4528:"moment-locales/moment-bn.js",4558:"moment-locales/moment-nl-be.js",4590:"moment-locales/moment-ro.js",4633:"moment-locales/moment-hu.js",4655:"moment-locales/moment-mn.js",4980:"moment-locales/moment-ca.js",4995:"moment-locales/moment-hr.js",5001:"moment-locales/moment-vi.js",5049:"moment-locales/moment-uz-latn.js",5123:"moment-locales/moment-cv.js",5143:"moment-locales/moment-ar.js",5145:"moment-locales/moment-es.js",5321:"moment-locales/moment-km.js",5369:"moment-locales/moment-si.js",5415:"moment-locales/moment-ar-dz.js",5434:"moment-locales/moment-br.js",5482:"moment-locales/moment-es-us.js",5485:"moment-locales/moment-hy-am.js",5530:"moment-locales/moment-my.js",5595:"moment-locales/moment-gd.js",5622:"moment-locales/moment-tlh.js",5766:"moment-locales/moment-kk.js",5905:"moment-locales/moment-ku.js",6112:"moment-locales/moment-ru.js",6194:"moment-locales/moment-fr.js",6205:"moment-locales/moment-kn.js",6333:"moment-locales/moment-fy.js",6459:"moment-locales/moment-lb.js",6625:"moment-locales/moment-mt.js",6769:"moment-locales/moment-en-ca.js",6867:"moment-locales/moment-tet.js",7274:"moment-locales/moment-th.js",7374:"moment-locales/moment-pa-in.js",7456:"moment-locales/moment-lv.js",7509:"moment-locales/moment-ja.js",7578:"moment-locales/moment-en-in.js",7617:"moment-locales/moment-lo.js",7619:"moment-locales/moment-sw.js",7636:"moment-locales/moment-zh-tw.js",7732:"moment-locales/moment-ko.js",7763:"moment-locales/moment-en-il.js",7851:"moment-locales/moment-uz.js",7958:"moment-locales/moment-oc-lnc.js",8030:"moment-locales/moment-en-nz.js",8181:"moment-locales/moment-tl-ph.js",8187:"moment-locales/moment-nl.js",8419:"moment-locales/moment-ar-kw.js",8471:"moment-locales/moment-en-ie.js",8560:"moment-locales/moment-de-ch.js",8627:"moment-locales/moment-es-do.js",8671:"moment-locales/moment-ar-tn.js",8681:"moment-locales/moment-ar-ma.js",8692:"moment-locales/moment-mi.js",8697:"moment-locales/moment-gom-latn.js",8719:"moment-locales/moment-pt.js",8835:"moment-locales/moment-en-gb.js",8908:"moment-locales/moment-zh-mo.js",8993:"moment-locales/moment-fi.js",9061:"moment-locales/moment-da.js",9068:"moment-locales/moment-me.js",9133:"moment-locales/moment-zh-cn.js",9360:"moment-locales/moment-te.js",9391:"moment-locales/moment-ky.js",9439:"moment-locales/moment-yo.js",9522:"moment-locales/moment-lt.js",9542:"moment-locales/moment-tzm.js",9635:"moment-locales/moment-de.js",9688:"moment-locales/moment-bn-bd.js",9713:"moment-locales/moment-sr.js",9775:"moment-locales/moment-gu.js",9799:"moment-locales/moment-se.js",9808:"moment-locales/moment-es-mx.js",9859:"moment-locales/moment-ar-sa.js",9989:"moment-locales/moment-cs.js"}[t]||t)+"."+{25:"54b13486bcf7a0f2f448",52:"26d3cbfdfc8feda72f35",96:"21046542233652319b27",98:"c67b70da4080d9f48b59",200:"52d4581144eaf6fc1c1a",220:"0f86791a0ff7c925f9ab",228:"368f20920fb4ae2a6790",407:"bf0ef0e308953065c521",442:"934b22c917f70868a7ed",446:"c0eb4ecc9637ca6a5117",640:"1ce856c43dc12efaeabb",648:"4aa83f4b827633d21f82",654:"2b5448c7c55fe47f4a41",663:"24678f24e87b81718abd",732:"5c94c01795f49a9f6845",970:"2f5a84ce88754e122cb5",972:"60b501b4597932c54ded",982:"6fdb93166cbe688e3f47",1001:"c82028e64dde23aca1ec",1147:"0efda950d3bddc7f4b7e",1221:"0c2bdaedbc46276c1e8f",1231:"6ac4d6707687391a25e7",1263:"3f204e3cbd018584f25b",1265:"ec20aba6e3044f0e689b",1303:"c6de8ae1851c3427aa7a",1525:"a52b90935361cb1d9a5d",1538:"8322f7efdc317c667d79",1578:"d3421248af2a968c1685",1607:"388b67face7eb9fbe09c",1654:"2af987d63d9a8c530d42",1898:"8ce4b3dddd4cccf15c59",1932:"fd9649296d05750cb66e",1986:"9faa1c079e5d34b595a9",2281:"0849c0332edb22ee06d4",2282:"587c55ed308c672d0460",2295:"b103f049f02c6511b6f0",2343:"ddd5da1f74a879939cff",2370:"0d1aa78072589461ac9e",2440:"976e0aaf22c09dab3952",2451:"51d42ece053b63243365",2475:"eddea7e8abc4024b12f8",2634:"fcef20328812bf8c1dc1",2644:"d5a7cb74d6697d7d8bc6",2682:"12407e8b9b6e6cd6d384",2756:"177d1bc6fa4d01a9bdcb",2825:"e85ad56fd0d7ba63edde",2927:"ea4e4e4f010a1332658f",2957:"30111f69f2522211b17b",2980:"6c7eb82c4ae371f3bdfd",3054:"be723d28c200c32f5b9a",3239:"ec119e05320683e2abe1",3284:"63ba0319f12e8d2d8c96",3394:"100abb322651bad634cd",3441:"f7236fcbf52eadc98d62",3448:"43a3cafe04667ed64b28",3472:"419c2e6a1d00b6994232",3483:"dab1d2841d2cc68df6ff",3573:"5bde98d9ac44b736f766",3601:"61504d5ae866b7344ba4",3612:"d2024130d76a4b2dd564",3706:"73f90a549224be35191e",4024:"bf91fc34a8c79c7dcf55",4034:"999f7099ddfde2aaa811",4044:"14a3c63054ccc96d65ca",4135:"fe36ce2373accd43ff73",4175:"6962c13940eee01051da",4177:"50573834bbefc371cea9",4221:"f98d0d1a1be5809fdf88",4314:"5aebd33d017a76fbb85f",4318:"71d9e6bbd828367615b7",4429:"a7cdc2d45337e2f5f6b6",4430:"eb89048ccf1de0515469",4437:"efce29f8e9f4c305f04b",4445:"10c9208e10f25dccc6d5",4462:"047ecd38a9100e479c9e",4524:"a690b1ab1cf3227ee61f",4528:"7bc186d5d0cb5c73b960",4558:"6254dddf8e33f7f1c212",4590:"cbfc0d240c9d20a53c84",4633:"6e776cfb1ef834ee8046",4655:"fb89f98d3d03c5a733b6",4980:"36a756e65fd89601c039",4995:"25b3c63670d687e029d6",5001:"8a09a1191aeb06233501",5049:"aeb087271287fc5ebba4",5123:"f45c2862a41bc8447df0",5143:"66934e8f3c8793e86b53",5145:"9b8ac8b8201bd9738f33",5321:"759dc2b10e7e5dc1acb8",5369:"4add07ba2c69d6d74db9",5415:"f3dd49491c5806ff8961",5434:"a7cd4a44bb18b550f317",5482:"8ece0435bc38de5407a7",5485:"3e02a3417ac286d77dd8",5521:"017c3d7d1f96ad5a3c7d",5530:"ae10b9b5fc32a81b44e1",5595:"daf5ac39e9e0641c96ce",5604:"234ee428b253c201fd6c",5622:"a05f9ca133387ffa745a",5766:"c2d11d0611842f9285a8",5859:"c8210d63f10348da1cfa",5905:"17688d7f9209a4b64223",5934:"a854750dab95de3ece1c",6112:"fb545b1b0c18234c0ce4",6194:"1a5a8515c0dec9f35878",6205:"bbac76346d0c5af64cc6",6333:"c7c02f91615569c22c10",6459:"04bc5a960eb29ec8bb15",6625:"36133ecbc6c04aff3e28",6685:"b8a2f5751f84eb0f9d07",6769:"a9d5033a2f5d0647afe7",6836:"3f08525331cba791e171",6867:"95e478f39836ab5dc385",7090:"83536ccd7093d54c3230",7274:"5684b47e0c77691937db",7374:"18dc09dfb0dc7ff53440",7405:"c6bb93c6b3ef008086d0",7456:"1da56d383b87e6aa3b22",7509:"3ee2f412b8883822f025",7578:"b367b7bd532d8a2256d5",7617:"d8215569294e72e740de",7619:"24a90c63d3ffb8b7aa4f",7636:"8cb46891dee2efa866dc",7732:"4a1bfcdb9e547c493aee",7763:"df44e584b761bc41e3b4",7776:"130cff82d043707a0fa8",7851:"8da6f74906ab2f690e95",7958:"9b96bebc790c6a856ffd",8030:"62cbc9b9cda5e0103507",8046:"b6dc5ffa87dcb7feb443",8057:"e7c948d8a84671a5956d",8181:"da49a289eaedc8ec46ad",8187:"8471c296da89b2797e04",8419:"f5be8c1e2352bd1fe1db",8471:"ed76d08879d608d93d16",8560:"c0eb8ac6a28949d18932",8581:"2b667631aa149a225e76",8627:"f81493c4a980c01b3151",8671:"d11ebbbe2ba6fac858cb",8681:"9327f295f44880160cd8",8692:"50a060e41f3783644f0d",8697:"6e3d03428440a7bb4d8c",8719:"7e4ceb249640bc0a1ec9",8825:"9f97c0b8a86cebc9b3f7",8835:"e71e919da69e7015fb10",8908:"13684123953b492a9c0f",8993:"5a801ec3dac0e227b6b1",9061:"3ca0b29d9dc2f78b8649",9068:"b082810a0de29147f6d7",9133:"3506ae515bc894cae391",9360:"dba94dcd2a2bdb315048",9391:"ba83f44efb69f0761fbb",9439:"d1d79a479c25f39545e5",9522:"894bd86679b9f3ce7015",9542:"1aafb1261d75652b2737",9635:"ef366cf2e1b03e6f8909",9688:"2ee4989f0ae1373df1fa",9713:"2cfb9701e63fcbd53fa0",9775:"9d344de990975c6ad84e",9799:"03a40e82e3e9243701e4",9808:"597b8a11201b154253b9",9859:"52cedf812c9c614d04ba",9989:"a9af448ff28480e298aa"}[t]+".js"},p.miniCssF=function(t){return 8335===t?"hotel/style.css":t+".style"+{1001:"62be34b852312624e85d",2927:"cedf86c5b831fcfc6d6f",7776:"cedf86c5b831fcfc6d6f",8057:"f9c13ea73e8dc02ead3a",8825:"ca0f7685c0ce19153cc9"}[t]+".css"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),p.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t},p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},n="lib:",p.l=function(t,e,i,o){if(r[t])r[t].push(e);else{var a,s;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==n+i){a=c;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,p.nc&&a.setAttribute("nonce",p.nc),a.setAttribute("data-webpack",n+i),a.src=t),r[t]=[e];var h=function(e,n){a.onerror=a.onload=null,clearTimeout(f);var i=r[t];if(delete r[t],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((function(t){return t(n)})),e)return e(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},p.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},p.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},p.p="/new/designs/99/build/",i=p.u,o=p.e,a={},s={},p.u=function(t){return i(t)+(a.hasOwnProperty(t)?"?"+a[t]:"")},p.e=function(t){return o(t).catch((function(e){var r=s.hasOwnProperty(t)?s[t]:5;if(r<1){var n=i(t);throw e.message="Loading chunk "+t+" failed after 5 retries.\n("+n+")",e.request=n,e}return new Promise((function(e){var n=5-r+1;setTimeout((function(){var i="cache-bust=true&retry-attempt="+n;a[t]=i,s[t]=r-1,e(p.e(t))}),3e3)}))}))},l=function(t){return new Promise((function(e,r){var n=p.miniCssF(t),i=p.p+n;if(function(t,e){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var i=(a=r[n]).getAttribute("data-href")||a.getAttribute("href");if("stylesheet"===a.rel&&(i===t||i===e))return a}var o=document.getElementsByTagName("style");for(n=0;n<o.length;n++){var a;if((i=(a=o[n]).getAttribute("data-href"))===t||i===e)return a}}(n,i))return e();!function(t,e,r,n){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.onerror=i.onload=function(o){if(i.onerror=i.onload=null,"load"===o.type)r();else{var a=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.href||e,l=new Error("Loading CSS chunk "+t+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode.removeChild(i),n(l)}},i.href=e,document.head.appendChild(i)}(t,i,e,r)}))},u={8335:0,9755:0},p.f.miniCss=function(t,e){u[t]?e.push(u[t]):0!==u[t]&&{1001:1,2927:1,7776:1,8057:1,8825:1}[t]&&e.push(u[t]=l(t).then((function(){u[t]=0}),(function(e){throw delete u[t],e})))},function(){var t={8335:0,9755:0};p.f.j=function(e,r){var n=p.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((function(r,i){n=t[e]=[r,i]}));r.push(n[2]=i);var o=p.p+p.u(e),a=new Error;p.l(o,(function(r){if(p.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=function(e,r){var n,i,o=r[0],a=r[1],s=r[2],l=0;if(o.some((function(e){return 0!==t[e]}))){for(n in a)p.o(a,n)&&(p.m[n]=a[n]);if(s)s(p)}for(e&&e(r);l<o.length;l++)i=o[l],p.o(t,i)&&t[i]&&t[i][0](),t[o[l]]=0},r=self.webpackChunklib=self.webpackChunklib||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var f=p(26512);lib=f}();