!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=76)}([function(e,t,n){"use strict";e.exports=n(77)},function(e,t,n){e.exports=n(82)()},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(78)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:H(e)}function r(e){return s(e)?e:W(e)}function i(e){return l(e)?e:Q(e)}function o(e){return a(e)&&!c(e)?e:K(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[d])}function l(e){return!(!e||!e[_])}function c(e){return s(e)||l(e)}function u(e){return!(!e||!e[f])}t(r,n),t(i,n),t(o,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=l,n.isAssociative=c,n.isOrdered=u,n.Keyed=r,n.Indexed=i,n.Set=o;var p="@@__IMMUTABLE_ITERABLE__@@",d="@@__IMMUTABLE_KEYED__@@",_="@@__IMMUTABLE_INDEXED__@@",f="@@__IMMUTABLE_ORDERED__@@",h=5,m=1<>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?w(e)+t:t}function C(){return!0}function O(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function N(e,t){return I(e,t,0)}function R(e,t){return I(e,t,t)}function I(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var M=0,D=1,P=2,L="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",U=L||k;function B(e){this.next=e}function F(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function z(){return{value:void 0,done:!0}}function j(e){return!!V(e)}function G(e){return e&&"function"==typeof e.next}function Y(e){var t=V(e);return t&&t.call(e)}function V(e){var t=e&&(L&&e[L]||e[k]);if("function"==typeof t)return t}function q(e){return e&&"number"==typeof e.length}function H(e){return null==e?oe():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function W(e){return null==e?oe().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Q(e){return null==e?oe():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function K(e){return(null==e?oe():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}B.prototype.toString=function(){return"[Iterator]"},B.KEYS=M,B.VALUES=D,B.ENTRIES=P,B.prototype.inspect=B.prototype.toSource=function(){return this.toString()},B.prototype[U]=function(){return this},t(H,n),H.of=function(){return H(arguments)},H.prototype.toSeq=function(){return this},H.prototype.toString=function(){return this.__toString("Seq {","}")},H.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},H.prototype.__iterate=function(e,t){return ce(this,e,t,!0)},H.prototype.__iterator=function(e,t){return ue(this,e,t,!0)},t(W,H),W.prototype.toKeyedSeq=function(){return this},t(Q,H),Q.of=function(){return Q(arguments)},Q.prototype.toIndexedSeq=function(){return this},Q.prototype.toString=function(){return this.__toString("Seq [","]")},Q.prototype.__iterate=function(e,t){return ce(this,e,t,!1)},Q.prototype.__iterator=function(e,t){return ue(this,e,t,!1)},t(K,H),K.of=function(){return K(arguments)},K.prototype.toSetSeq=function(){return this},H.isSeq=ie,H.Keyed=W,H.Set=K,H.Indexed=Q;var $,Z,X,J="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[J])}function oe(){return $||($=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():G(e)?new re(e).fromEntrySeq():j(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function se(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return q(e)?new ee(e):G(e)?new re(e):j(e)?new ne(e):void 0}function ce(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ue(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new B(function(){var e=i[n?o-a:a];return a++>o?{value:void 0,done:!0}:F(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function pe(e,t){return t?function e(t,n,r,i){return Array.isArray(n)?t.call(i,r,Q(n).map(function(r,i){return e(t,r,i,n)})):_e(n)?t.call(i,r,W(n).map(function(r,i){return e(t,r,i,n)})):n}(t,e,"",{"":e}):de(e)}function de(e){return Array.isArray(e)?Q(e).map(de).toList():_e(e)?W(e).map(de).toMap():e}function _e(e){return e&&(e.constructor===Object||void 0===e.constructor)}function fe(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function he(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||l(e)!==l(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(u(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&fe(i[1],e)&&(n||fe(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var p=!0,d=t.__iterate(function(t,r){if(n?!e.has(t):i?!fe(t,e.get(r,y)):!fe(e.get(r,y),t))return p=!1,!1});return p&&e.size===d}function me(e,t){if(!(this instanceof me))return new me(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ge(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?{value:void 0,done:!0}:F(e,i,n[t?r-i++:i++])})},t(te,W),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new B(function(){var a=r[t?i-o:o];return o++>i?{value:void 0,done:!0}:F(e,a,n[a])})},te.prototype[f]=!0,t(ne,Q),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=Y(n),i=0;if(G(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=Y(n);if(!G(r))return new B(z);var i=0;return new B(function(){var t=r.next();return t.done?t:F(e,i++,t.value)})},t(re,Q),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return F(e,i,r[i++])})},t(me,Q),me.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},me.prototype.get=function(e,t){return this.has(e)?this._value:t},me.prototype.includes=function(e){return fe(this._value,e)},me.prototype.slice=function(e,t){var n=this.size;return O(e,t,n)?this:new me(this._value,R(t,n)-N(e,n))},me.prototype.reverse=function(){return this},me.prototype.indexOf=function(e){return fe(this._value,e)?0:-1},me.prototype.lastIndexOf=function(e){return fe(this._value,e)?this.size:-1},me.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?{value:void 0,done:!0}:F(e,o++,a)})},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:he(this,e)},t(ve,n),t(be,ve),t(Ee,ve),t(Se,ve),ve.Keyed=be,ve.Indexed=Ee,ve.Set=Se;var Te="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Ae(e){return e>>>1&1073741824|3221225471&e}function we(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t,n,r=typeof e;if("number"===r){if(e!=e||e===1/0)return 0;var i=0|e;for(i!==e&&(i^=4294967295*e);e>4294967295;)i^=e/=4294967295;return Ae(i)}if("string"===r)return e.length>De?(void 0===(n=ke[t=e])&&(n=xe(t),Le===Pe&&(Le=0,ke={}),Le++,ke[t]=n),n):xe(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===r)return function(e){var t;if(Re&&void 0!==(t=Ce.get(e)))return t;if(void 0!==(t=e[Me]))return t;if(!Ne){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Me]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Ie,1073741824&Ie&&(Ie=0),Re)Ce.set(e,t);else{if(void 0!==Oe&&!1===Oe(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Ne)Object.defineProperty(e,Me,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Me]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Me]=t}}return t}(e);if("function"==typeof e.toString)return xe(e.toString());throw new Error("Value type "+r+" cannot be hashed.")}function xe(e){for(var t=0,n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Be.prototype.toString=function(){return this.__toString("Map {","}")},Be.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Be.prototype.set=function(e,t){return Je(this,e,t)},Be.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},Be.prototype.remove=function(e){return Je(this,e,y)},Be.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},Be.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Be.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,i){var o=t===y,a=n.next();if(a.done){var s=o?r:t,l=i(s);return l===s?t:l}ge(o||t&&t.set,"invalid keyPath");var c=a.value,u=o?y:t.get(c,y),p=e(u,n,r,i);return p===u?t:p===y?t.remove(c):(o?Xe():t).set(c,p)}(this,nn(e),t,n);return r===y?void 0:r},Be.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Be.prototype.merge=function(){return rt(this,void 0,arguments)},Be.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},Be.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Be.prototype.mergeDeep=function(){return rt(this,it,arguments)},Be.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,ot(t),n)},Be.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Be.prototype.sort=function(e){return Nt(qt(this,e))},Be.prototype.sortBy=function(e,t){return Nt(qt(this,t,e))},Be.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Be.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new T)},Be.prototype.asImmutable=function(){return this.__ensureOwner()},Be.prototype.wasAltered=function(){return this.__altered},Be.prototype.__iterator=function(e,t){return new Qe(this,e,t)},Be.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Be.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Be.isMap=Fe;var ze,je="@@__IMMUTABLE_MAP__@@",Ge=Be.prototype;function Ye(e,t){this.ownerID=e,this.entries=t}function Ve(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function qe(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function He(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function We(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Qe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$e(e._root)}function Ke(e,t){return F(e,t[0],t[1])}function $e(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var i=Object.create(Ge);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xe(){return ze||(ze=Ze(0))}function Je(e,t,n){var r,i;if(e._root){var o=E(v),a=E(b);if(r=et(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===y?-1:1:0)}else{if(n===y)return e;i=1,r=new Ye(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(i,r):Xe()}function et(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===y?e:(S(s),S(a),new We(t,r,[i,o]))}function tt(e){return e.constructor===We||e.constructor===He}function nt(e,t,n,r,i){if(e.keyHash===r)return new He(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&g,s=(0===n?r:r>>>n)&g,l=a===s?[nt(e,t,n+h,r,i)]:(o=new We(t,r,i),a>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function lt(e,t,n,r){var i=r?e:A(e);return i[t]=n,i}Ge[je]=!0,Ge.delete=Ge.remove,Ge.removeIn=Ge.deleteIn,Ye.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=ct)return function(e,t,n,r){e||(e=new T);for(var i=new We(e,we(n),[n,r]),o=0;o>>e)&g),o=this.bitmap;return 0==(o&i)?r:this.nodes[st(o&i-1)].get(e+h,t,n,r)},Ve.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=we(r));var s=(0===t?n:n>>>t)&g,l=1<=ut)return function(e,t,n,r,i){for(var o=0,a=new Array(m),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new qe(e,o+1,a)}(e,d,c,s,f);if(u&&!f&&2===d.length&&tt(d[1^p]))return d[1^p];if(u&&f&&1===d.length&&tt(f))return f;var v=e&&e===this.ownerID,b=u?f?c:c^l:c|l,E=u?f?lt(d,p,f,v):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a>>e)&g,o=this.nodes[i];return o?o.get(e+h,t,n,r):r},qe.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=we(r));var s=(0===t?n:n>>>t)&g,l=i===y,c=this.nodes,u=c[s];if(l&&!u)return this;var p=et(u,e,t+h,n,r,i,o,a);if(p===u)return this;var d=this.count;if(u){if(!p&&--d0&&r=0&&e=e.size||t<0)return e.withMutations(function(e){t<0?xt(e,t).set(0,n):xt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=E(b);return t>=Ot(e._capacity)?r=Tt(r,e.__ownerID,0,t,n,o):i=Tt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Et(e._origin,e._capacity,e._level,i,r):e}(this,e,t)},dt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},dt.prototype.insert=function(e,t){return this.splice(e,0,t)},dt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=h,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):St()},dt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){xt(n,0,t+e.length);for(var r=0;r>>t&g;if(r>=this.array.length)return new mt([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-h,n))===a&&o)return this}if(o&&!i)return this;var s=At(this,e);if(!o)for(var l=0;l>>t&g;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-h,n))===o&&i===this.array.length-1)return this}var a=At(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var gt,yt,vt={};function bt(e,t){var n=e._origin,r=e._capacity,i=Ot(r),o=e._tail;return a(e._root,e._level,0);function a(e,s,l){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,l=a>n?0:n-a,c=r-a;return c>m&&(c=m),function(){if(l===c)return vt;var e=t?--c:l++;return s&&s[e]}}(e,l):function(e,i,o){var s,l=e&&e.array,c=o>n?0:n-o>>i,u=1+(r-o>>i);return u>m&&(u=m),function(){for(;;){if(s){var e=s();if(e!==vt)return e;s=null}if(c===u)return vt;var n=t?--u:c++;s=a(l&&l[n],i-h,o+(n<>>n&g,l=e&&s0){var c=e&&e.array[s],u=Tt(c,t,n-h,r,i,o);return u===c?e:((a=At(e,t)).array[s]=u,a)}return l&&e.array[s]===i?e:(S(o),a=At(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function At(e,t){return t&&e&&t===e.ownerID?e:new mt(e?e.array.slice():[],t)}function wt(e,t){if(t>=Ot(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&g],r-=h;return n}}function xt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new T,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,c=e._root,u=0;a+u<0;)c=new mt(c&&c.array.length?[void 0,c]:[],r),u+=1<<(l+=h);u&&(a+=u,i+=u,s+=u,o+=u);for(var p=Ot(o),d=Ot(s);d>=1<p?new mt([],r):_;if(_&&d>p&&ah;y-=h){var v=p>>>y&g;m=m.array[v]=At(m.array[v],r)}m.array[p>>>h&g]=_}if(s=d)a-=d,s-=d,l=h,c=null,f=f&&f.removeBefore(r,0,a);else if(a>i||d>>l&g;if(b!==d>>>l&g)break;b&&(u+=(1<i&&(c=c.removeBefore(r,l,a-u)),c&&do&&(o=c.size),a(l)||(c=c.map(function(e){return pe(e)})),r.push(c)}return o>e.size&&(e=e.setSize(o)),at(e,t,r)}function Ot(e){return e>>h<=m&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(l){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):It(r,i)}function Pt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function kt(e){this._iter=e,this.size=e.size}function Ut(e){this._iter=e,this.size=e.size}function Bt(e){var t=Jt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=en,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===P){var r=e.__iterator(t,n);return new B(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===D?M:D,n)},t}function Ft(e,t,n){var r=Jt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,y);return o===y?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(P,i);return new B(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return F(r,s,t.call(n,a[1],s,e),i)})},r}function zt(e,t){var n=Jt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Bt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=en,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function jt(e,t,n,r){var i=Jt(e);return r&&(i.has=function(r){var i=e.get(r,y);return i!==y&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,y);return o!==y&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,l){if(t.call(n,e,o,l))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(P,o),s=0;return new B(function(){for(;;){var o=a.next();if(o.done)return o;var l=o.value,c=l[0],u=l[1];if(t.call(n,u,c,e))return F(i,r?c:s++,u,o)}})},i}function Gt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),O(t,n,i))return e;var o=N(t,i),a=R(n,i);if(o!=o||a!=a)return Gt(e.toSeq().cacheResult(),t,n,r);var s,l=a-o;l==l&&(s=l<0?0:l);var c=Jt(e);return c.size=0===s?s:e.size&&s||void 0,!r&&ie(e)&&s>=0&&(c.get=function(t,n){return(t=x(this,t))>=0&&ts)return{value:void 0,done:!0};var e=i.next();return r||t===D?e:F(t,l-1,t===M?void 0:e.value[1],e)})},c}function Yt(e,t,n,r){var i=Jt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,l=0;return e.__iterate(function(e,o,c){if(!s||!(s=t.call(n,e,o,c)))return l++,i(e,r?o:l-1,a)}),l},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(P,o),l=!0,c=0;return new B(function(){var e,o,u;do{if((e=s.next()).done)return r||i===D?e:F(i,c++,i===M?void 0:e.value[1],e);var p=e.value;o=p[0],u=p[1],l&&(l=t.call(n,u,o,a))}while(l);return i===P?e:F(i,o,u,e)})},i}function Vt(e,t,n){var r=Jt(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function e(l,c){var u=this;l.__iterate(function(i,l){return(!t||c0}function Qt(e,t,r){var i=Jt(e);return i.size=new ee(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(D,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=n(e),Y(i?e.reverse():e)}),a=0,s=!1;return new B(function(){var n;return s||(n=o.map(function(e){return e.next()}),s=n.some(function(e){return e.done})),s?{value:void 0,done:!0}:F(e,a++,t.apply(null,n.map(function(e){return e.value})))})},i}function Kt(e,t){return ie(e)?t:e.constructor(t)}function $t(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Zt(e){return Ue(e.size),w(e)}function Xt(e){return s(e)?r:l(e)?i:o}function Jt(e){return Object.create((s(e)?W:l(e)?Q:K).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function tn(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Cn(e,t)},Sn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Ue(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Cn(t,n)},Sn.prototype.pop=function(){return this.slice(1)},Sn.prototype.unshift=function(){return this.push.apply(this,arguments)},Sn.prototype.unshiftAll=function(e){return this.pushAll(e)},Sn.prototype.shift=function(){return this.pop.apply(this,arguments)},Sn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):On()},Sn.prototype.slice=function(e,t){if(O(e,t,this.size))return this;var n=N(e,this.size),r=R(t,this.size);if(r!==this.size)return Ee.prototype.slice.call(this,e,t);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Cn(i,o)},Sn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Cn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Sn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Sn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new B(function(){if(r){var t=r.value;return r=r.next,F(e,n++,t)}return{value:void 0,done:!0}})},Sn.isStack=Tn;var An,wn="@@__IMMUTABLE_STACK__@@",xn=Sn.prototype;function Cn(e,t,n,r){var i=Object.create(xn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function On(){return An||(An=Cn(0))}function Nn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}xn[wn]=!0,xn.withMutations=Ge.withMutations,xn.asMutable=Ge.asMutable,xn.asImmutable=Ge.asImmutable,xn.wasAltered=Ge.wasAltered,n.Iterator=B,Nn(n,{toArray:function(){Ue(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Lt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Pt(this,!0)},toMap:function(){return Be(this.toKeyedSeq())},toObject:function(){Ue(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Nt(this.toKeyedSeq())},toOrderedSet:function(){return mn(s(this)?this.valueSeq():this)},toSet:function(){return ln(s(this)?this.valueSeq():this)},toSetSeq:function(){return new kt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Sn(s(this)?this.valueSeq():this)},toList:function(){return dt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Kt(this,function(e,t){var n=s(e),i=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):se(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||l(e)&&l(o))return o}var c=new ee(i);return n?c=c.toKeyedSeq():l(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}(this,t))},includes:function(e){return this.some(function(t){return fe(t,e)})},entries:function(){return this.__iterator(P)},every:function(e,t){Ue(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Kt(this,jt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ue(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ue(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""}),t},keys:function(){return this.__iterator(M)},map:function(e,t){return Kt(this,Ft(this,e,t))},reduce:function(e,t,n){var r,i;return Ue(this.size),arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Kt(this,zt(this,!0))},slice:function(e,t){return Kt(this,Gt(this,e,t,!0))},some:function(e,t){return!this.every(Pn(e),t)},sort:function(e){return Kt(this,qt(this,e))},values:function(){return this.__iterator(D)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return w(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Be().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return he(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Dn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Pn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(C)},flatMap:function(e,t){return Kt(this,function(e,t,n){var r=Xt(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Kt(this,Vt(this,e,!0))},fromEntrySeq:function(){return new Ut(this)},get:function(e,t){return this.find(function(t,n){return fe(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=nn(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,y):y)===y)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),i=(u(e)?Nt():Be()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return(e=e||[]).push(r?[a,o]:o),e})});var o=Xt(e);return i.map(function(t){return Kt(e,o(t))})}(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return fe(t,e)})},keySeq:function(){return this.toSeq().map(Mn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Ht(this,e)},maxBy:function(e,t){return Ht(this,t,e)},min:function(e){return Ht(this,e?Ln(e):Bn)},minBy:function(e,t){return Ht(this,t?Ln(t):Bn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Kt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Kt(this,Yt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Pn(e),t)},sortBy:function(e,t){return Kt(this,qt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Kt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Kt(this,function(e,t,n){var r=Jt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(P,i),s=!0;return new B(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,l=i[0],c=i[1];return t.call(n,c,l,o)?r===P?e:F(r,l,c,e):(s=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Pn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=Te(t,3432918353),t=Te(t<<15|t>>>-15,461845907),t=Te(t<<13|t>>>-13,5),t=Te((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Ae((t=Te(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(we(e),we(t))|0}:function(e,t){r=r+Fn(we(e),we(t))|0}:t?function(e){r=31*r+we(e)|0}:function(e){r=r+we(e)|0}),r)}(this))}});var Rn=n.prototype;Rn[p]=!0,Rn[U]=Rn.values,Rn.__toJS=Rn.toArray,Rn.__toStringMapper=kn,Rn.inspect=Rn.toSource=function(){return this.toString()},Rn.chain=Rn.flatMap,Rn.contains=Rn.includes,Nn(r,{flip:function(){return Kt(this,Bt(this))},mapEntries:function(e,t){var n=this,r=0;return Kt(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Kt(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var In=r.prototype;function Mn(e,t){return t}function Dn(e,t){return[t,e]}function Pn(e){return function(){return!e.apply(this,arguments)}}function Ln(e){return function(){return-e.apply(this,arguments)}}function kn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Un(){return A(arguments)}function Bn(e,t){return et?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[d]=!0,In[U]=Rn.entries,In.__toJS=Rn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+kn(e)},Nn(i,{toKeyedSeq:function(){return new Pt(this,!1)},filter:function(e,t){return Kt(this,jt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Kt(this,zt(this,!1))},slice:function(e,t){return Kt(this,Gt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=N(e,e<0?this.count():this.size);var r=this.slice(0,e);return Kt(this,1===n?r:r.concat(A(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Kt(this,Vt(this,e,!1))},get:function(e,t){return(e=x(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=x(this,e))>=0&&(void 0!==this.size?this.size===1/0||e(r=1))return r;for(;no?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var i=o;function o(e,t){this.x=e,this.y=t}function a(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n0;)t[n]=arguments[n+1];for(var r=0,i=t;r>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function h(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function m(e,t){e.forEach(function(e){t[e]&&(t[e]=t[e].bind(t))})}function g(e,t){return-1!==e.indexOf(t,e.length-t.length)}function y(e,t,n){var r={};for(var i in e)r[i]=t.call(n||this,e[i],i,e);return r}function v(e,t,n){var r={};for(var i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function b(e){return Array.isArray(e)?e.map(b):"object"==typeof e&&e?y(e,b):e}var E={};function S(e){E[e]||("undefined"!=typeof console&&console.warn(e),E[e]=!0)}function T(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function A(e){for(var t=0,n=0,r=e.length,i=r-1,o=void 0,a=void 0;n=1||o<-1||r.getDate()!==i.getDate()}else t=!0;if(!t)return this.processRequests();this.postEvent(n,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=n,e.eventData.accessToken=M.ACCESS_TOKEN)})}},t}(W)),$=K.postTurnstileEvent.bind(K),Z=new Q,X=Z.postMapLoadEvent.bind(Z),J={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(J);var ee,te,ne=function(e){function t(t,n,r){401===n&&z(r)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens"),e.call(this,t),this.status=n,this.url=r,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),re="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope?function(){return self.worker&&self.worker.referrer}:function(){var e=self.location.origin;if(e&&"null"!==e&&"file://"!==e)return e+self.location.pathname},ie=self.fetch&&self.Request&&self.AbortController?function(e,t){var n=new self.AbortController,r=new self.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:re(),signal:n.signal});return"json"===e.type&&r.headers.set("Accept","application/json"),self.fetch(r).then(function(n){n.ok?n[e.type||"text"]().then(function(e){t(null,e,n.headers.get("Cache-Control"),n.headers.get("Expires"))}).catch(function(e){return t(new Error(e.message))}):t(new ne(n.statusText,n.status,e.url))}).catch(function(e){20!==e.code&&t(new Error(e.message))}),{cancel:function(){return n.abort()}}}:function(e,t){var n=new self.XMLHttpRequest;for(var r in n.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(n.responseType="arraybuffer"),e.headers)n.setRequestHeader(r,e.headers[r]);return"json"===e.type&&n.setRequestHeader("Accept","application/json"),n.withCredentials="include"===e.credentials,n.onerror=function(){t(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var r=n.response;if("json"===e.type)try{r=JSON.parse(n.response)}catch(e){return t(e)}t(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else t(new ne(n.statusText,n.status,e.url))},n.send(e.body),{cancel:function(){return n.abort()}}},oe=function(e,t){return ie(p(e,{type:"arrayBuffer"}),t)},ae=function(e,t){return ie(p(e,{method:"POST"}),t)};ee=[],te=0;var se=function(e,t){if(te>=M.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:t,cancelled:!1};return ee.push(n),{cancel:function(){n.cancelled=!0}}}te++;var r=!1,i=function(){if(!r)for(r=!0,te--;ee.length&&te0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},de.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var _e={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"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-z-order":{type:"enum",values:{"viewport-y":{},source:{}},default:"viewport-y",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","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:{left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","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"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},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:"string",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,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:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","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:"string",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"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},fe=function(e,t,n,r){this.message=(e?e+": ":"")+n,r&&(this.identifier=r),null!=t&&t.__line__&&(this.line=t.__line__)};function he(e){var t=e.key,n=e.value;return n?[new fe(t,n,"constants have been deprecated as of v8")]:[]}function me(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var r=0,i=t;r":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Me=[Ee,Se,Te,Ae,we,Ne,xe,Re(Ce)];function De(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!De(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var n=0,r=Me;n255?255:e}function i(e){return e<0?0:e>1?1:e}function o(e){return"%"===e[e.length-1]?r(parseFloat(e)/100*255):r(parseInt(e))}function a(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{t.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),p=i.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==p.length)return null;d=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),d];case"hsla":if(4!==p.length)return null;d=a(p.pop());case"hsl":if(3!==p.length)return null;var _=(parseFloat(p[0])%360+360)%360/360,f=a(p[1]),h=a(p[2]),m=h<=.5?h*(f+1):h+f-h*f,g=2*h-m;return[r(255*s(g,m,_+1/3)),r(255*s(g,m,_)),r(255*s(g,m,_-1/3)),d];default:return null}}return null}}catch(e){}}).parseCSSColor,Le=function(e,t,n,r){void 0===r&&(r=1),this.r=e,this.g=t,this.b=n,this.a=r};Le.parse=function(e){if(e){if(e instanceof Le)return e;if("string"==typeof e){var t=Pe(e);if(t)return new Le(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Le.prototype.toString=function(){var e=this.toArray(),t=e[0],n=e[1],r=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(n)+","+Math.round(r)+","+i+")"},Le.prototype.toArray=function(){var e=this.r,t=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*n/r,r]},Le.black=new Le(0,0,0,1),Le.white=new Le(1,1,1,1),Le.transparent=new Le(0,0,0,0),Le.red=new Le(1,0,0,1);var ke=function(e,t,n){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ke.prototype.compare=function(e,t){return this.collator.compare(e,t)},ke.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ue=function(e,t,n){this.text=e,this.scale=t,this.fontStack=n},Be=function(e){this.sections=e};function Fe(e,t,n,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[e,t,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ze(e){if(null===e)return Ee;if("string"==typeof e)return Te;if("boolean"==typeof e)return Ae;if("number"==typeof e)return Se;if(e instanceof Le)return we;if(e instanceof ke)return Oe;if(e instanceof Be)return Ne;if(Array.isArray(e)){for(var t,n=e.length,r=0,i=e;r2){var s=e[1];if("string"!=typeof s||!(s in Ve)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=Ve[s],r++}else o=Ce;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],r++}n=Re(o,a)}else n=Ve[i];for(var l=[];r1)&&t.push(r)}}return t.concat(this.args.map(function(e){return e.serialize()}))};var He=function(e){this.type=Ne,this.sections=e};He.parse=function(e,t){if(e.length<3)return t.error("Expected at least two arguments.");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");for(var n=[],r=1;r4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Fe(t[0],t[1],t[2],t[3])))return new Le(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ye(n||"Could not parse color from value '"+("string"==typeof t?t:JSON.stringify(t))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s=0)return!1;var n=!0;return e.eachChild(function(e){n&&!tt(e,t)&&(n=!1)}),n}Xe.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var n=e[1];if("object"!=typeof n||Array.isArray(n))return t.error("Collator options argument must be an object.");var r=t.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Ae);if(!r)return null;var i=t.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Ae);if(!i)return null;var o=null;return n.locale&&!(o=t.parse(n.locale,1,Te))?null:new Xe(r,i,o)},Xe.prototype.evaluate=function(e){return new ke(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Xe.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Xe.prototype.possibleOutputs=function(){return[void 0]},Xe.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var nt=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};nt.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var n=e[1];return t.scope.has(n)?new nt(n,t.scope.get(n)):t.error('Unknown variable "'+n+'". Make sure "'+n+'" has been bound in an enclosing "let" expression before using it.',1)},nt.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},nt.prototype.eachChild=function(){},nt.prototype.possibleOutputs=function(){return[void 0]},nt.prototype.serialize=function(){return["var",this.name]};var rt=function(e,t,n,r,i){void 0===t&&(t=[]),void 0===r&&(r=new be),void 0===i&&(i=[]),this.registry=e,this.path=t,this.key=t.map(function(e){return"["+e+"]"}).join(""),this.scope=r,this.errors=i,this.expectedType=n};function it(e,t){for(var n,r,i=0,o=e.length-1,a=0;i<=o;){if(n=e[a=Math.floor((i+o)/2)],r=e[a+1],t===n||t>n&&tt))throw new Ye("Input is not a number.");o=a-1}}return Math.max(a-1,0)}rt.prototype.parse=function(e,t,n,r,i){return void 0===i&&(i={}),t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)},rt.prototype._parse=function(e,t){function n(e,t,n){return"assert"===n?new qe(t,[e]):"coerce"===n?new Qe(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var o=i.parse(e,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||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=n(o,a,t.typeAnnotation||"coerce");else o=n(o,a,t.typeAnnotation||"assert")}if(!(o instanceof Ge)&&function e(t){if(t instanceof nt)return e(t.boundExpression);if(t instanceof Ze&&"error"===t.name)return!1;if(t instanceof Xe)return!1;var n=t instanceof Qe||t instanceof qe,r=!0;return t.eachChild(function(t){r=n?r&&e(t):r&&t instanceof Ge}),!!r&&(Je(t)&&tt(t,["zoom","heatmap-density","line-progress","is-supported-script"]))}(o)){var l=new $e;try{o=new Ge(o.type,o.evaluate(l))}catch(e){return this.error(e.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},rt.prototype.concat=function(e,t,n){var r="number"==typeof e?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new rt(this.registry,r,t||null,i,this.errors)},rt.prototype.error=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];var r=""+this.key+t.map(function(e){return"["+e+"]"}).join("");this.errors.push(new ve(r,e))},rt.prototype.checkSubtype=function(e,t){var n=De(e,t);return n&&this.error(n),n};var ot=function(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,i=n;r=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);var p=t.parse(l,u,o);if(!p)return null;o=o||p.type,i.push([s,p])}return new ot(o,n,i)},ot.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[it(t,r)].evaluate(e)},ot.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var st=Object.freeze({number:at,color:function(e,t,n){return new Le(at(e.r,t.r,n),at(e.g,t.g,n),at(e.b,t.b,n),at(e.a,t.a,n))},array:function(e,t,n){return e.map(function(e,r){return at(e,t[r],n)})}}),lt=.95047,ct=1,ut=1.08883,pt=4/29,dt=6/29,_t=3*dt*dt,ft=dt*dt*dt,ht=Math.PI/180,mt=180/Math.PI;function gt(e){return e>ft?Math.pow(e,1/3):e/_t+pt}function yt(e){return e>dt?e*e*e:_t*(e-pt)}function vt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Et(e){var t=bt(e.r),n=bt(e.g),r=bt(e.b),i=gt((.4124564*t+.3575761*n+.1804375*r)/lt),o=gt((.2126729*t+.7151522*n+.072175*r)/ct);return{l:116*o-16,a:500*(i-o),b:200*(o-gt((.0193339*t+.119192*n+.9503041*r)/ut)),alpha:e.a}}function St(e){var t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=ct*yt(t),n=lt*yt(n),r=ut*yt(r),new Le(vt(3.2404542*n-1.5371385*t-.4985314*r),vt(-.969266*n+1.8760108*t+.041556*r),vt(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}var Tt={forward:Et,reverse:St,interpolate:function(e,t,n){return{l:at(e.l,t.l,n),a:at(e.a,t.a,n),b:at(e.b,t.b,n),alpha:at(e.alpha,t.alpha,n)}}},At={forward:function(e){var t=Et(e),n=t.l,r=t.a,i=t.b,o=Math.atan2(i,r)*mt;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:n,alpha:e.a}},reverse:function(e){var t=e.h*ht,n=e.c;return St({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:function(e,t,n){var r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}(e.h,t.h,n),c:at(e.c,t.c,n),l:at(e.l,t.l,n),alpha:at(e.alpha,t.alpha,n)}}},wt=Object.freeze({lab:Tt,hcl:At}),xt=function(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,Se)))return null;var l=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=we:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u=p)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',_);var h=t.parse(d,f,c);if(!h)return null;c=c||h.type,l.push([p,h])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new xt(c,n,r,i,l):t.error("Type "+Ie(c)+" is not interpolatable.")},xt.prototype.evaluate=function(e){var t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);var i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);var o=it(t,r),a=t[o],s=t[o+1],l=xt.interpolationFactor(this.interpolation,r,a,s),c=n[o].evaluate(e),u=n[o+1].evaluate(e);return"interpolate"===this.operator?st[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?At.reverse(At.interpolate(At.forward(c),At.forward(u),l)):Tt.reverse(Tt.interpolate(Tt.forward(c),Tt.forward(u),l))},xt.prototype.eachChild=function(e){e(this.input);for(var t=0,n=this.outputs;t=n.length)throw new Ye("Array index out of bounds: "+t+" > "+(n.length-1)+".");if(t!==Math.floor(t))throw new Ye("Array index must be an integer, but found "+t+" instead.");return n[t]},Rt.prototype.eachChild=function(e){e(this.index),e(this.input)},Rt.prototype.possibleOutputs=function(){return[void 0]},Rt.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var It=function(e,t,n,r,i,o){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};It.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var n,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,ze(d)))return null}else n=ze(d);if(void 0!==i[String(d)])return c.error("Branch labels must be unique.");i[String(d)]=o.length}var _=t.parse(l,a,r);if(!_)return null;r=r||_.type,o.push(_)}var f=t.parse(e[1],1,Ce);if(!f)return null;var h=t.parse(e[e.length-1],e.length-1,r);return h?"value"!==f.type.kind&&t.concat(1).checkSubtype(n,f.type)?null:new It(n,r,f,i,o,h):null},It.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ze(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},It.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},It.prototype.possibleOutputs=function(){return(e=[]).concat.apply(e,this.outputs.map(function(e){return e.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var e},It.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i",function(e,t,n){return t>n},function(e,t,n,r){return r.compare(t,n)>0}),zt=Lt("<=",function(e,t,n){return t<=n},function(e,t,n,r){return r.compare(t,n)<=0}),jt=Lt(">=",function(e,t,n){return t>=n},function(e,t,n,r){return r.compare(t,n)>=0}),Gt=function(e){this.type=Se,this.input=e};Gt.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var n=t.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?t.error("Expected argument of type string or array, but found "+Ie(n.type)+" instead."):new Gt(n):null},Gt.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ye("Expected value to be of type string or array, but found "+Ie(ze(t))+" instead.")},Gt.prototype.eachChild=function(e){e(this.input)},Gt.prototype.possibleOutputs=function(){return[void 0]},Gt.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Yt={"==":kt,"!=":Ut,">":Ft,"<":Bt,">=":jt,"<=":zt,array:qe,at:Rt,boolean:qe,case:Mt,coalesce:Ot,collator:Xe,format:He,interpolate:xt,"interpolate-hcl":xt,"interpolate-lab":xt,length:Gt,let:Nt,literal:Ge,match:It,number:qe,object:qe,step:ot,string:qe,"to-boolean":Qe,"to-color":Qe,"to-number":Qe,"to-string":Qe,var:nt};function Vt(e,t){var n=t[0],r=t[1],i=t[2],o=t[3];n=n.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);var a=o?o.evaluate(e):1,s=Fe(n,r,i,a);if(s)throw new Ye(s);return new Le(n/255*a,r/255*a,i/255*a,a)}function qt(e,t){return e in t}function Ht(e,t){var n=t[e];return void 0===n?null:n}function Wt(e){return{type:e}}function Qt(e){return{result:"success",value:e}}function Kt(e){return{result:"error",value:e}}function $t(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Zt(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Xt(e){return!!e.expression&&e.expression.interpolated}function Jt(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function en(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function tn(e){return e}function nn(e,t,n){return void 0!==e?e:void 0!==t?t:void 0!==n?n:void 0}function rn(e,t,n,r,i){return nn(typeof n===i?r[n]:void 0,e.default,t.default)}function on(e,t,n){if("number"!==Jt(n))return nn(e.default,t.default);var r=e.stops.length;if(1===r)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];var i=ln(e.stops,n);return e.stops[i][1]}function an(e,t,n){var r=void 0!==e.base?e.base:1;if("number"!==Jt(n))return nn(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];var o=ln(e.stops,n),a=function(e,t,n,r){var i=r-n,o=e-n;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(n,r,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1],c=st[t.type]||tn;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=wt[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==n&&void 0!==r)return c(n,r,a)}}:c(s,l,a)}function sn(e,t,n){return"color"===t.type?n=Le.parse(n):"formatted"===t.type?n=Be.fromString(n.toString()):Jt(n)===t.type||"enum"===t.type&&t.values[n]||(n=void 0),nn(n,e.default,t.default)}function ln(e,t){for(var n,r,i=0,o=e.length-1,a=0;i<=o;){if(n=e[a=Math.floor((i+o)/2)][0],r=e[a+1][0],t===n||t>n&&tt&&(o=a-1)}return Math.max(a-1,0)}Ze.register(Yt,{error:[{kind:"error"},[Te],function(e,t){var n=t[0];throw new Ye(n.evaluate(e))}],typeof:[Te,[Ce],function(e,t){return Ie(ze(t[0].evaluate(e)))}],"to-rgba":[Re(Se,4),[we],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[we,[Se,Se,Se],Vt],rgba:[we,[Se,Se,Se,Se],Vt],has:{type:Ae,overloads:[[[Te],function(e,t){return qt(t[0].evaluate(e),e.properties())}],[[Te,xe],function(e,t){var n=t[0],r=t[1];return qt(n.evaluate(e),r.evaluate(e))}]]},get:{type:Ce,overloads:[[[Te],function(e,t){return Ht(t[0].evaluate(e),e.properties())}],[[Te,xe],function(e,t){var n=t[0],r=t[1];return Ht(n.evaluate(e),r.evaluate(e))}]]},"feature-state":[Ce,[Te],function(e,t){return Ht(t[0].evaluate(e),e.featureState||{})}],properties:[xe,[],function(e){return e.properties()}],"geometry-type":[Te,[],function(e){return e.geometryType()}],id:[Ce,[],function(e){return e.id()}],zoom:[Se,[],function(e){return e.globals.zoom}],"heatmap-density":[Se,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Se,[],function(e){return e.globals.lineProgress||0}],"+":[Se,Wt(Se),function(e,t){for(var n=0,r=0,i=t;r":[Ae,[Te,Ce],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ae,[Ce],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Ae,[Te,Ce],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ae,[Ce],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Ae,[Te,Ce],function(e,t){var n=t[0],r=t[1],i=e.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ae,[Ce],function(e,t){var n=t[0],r=e.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Ae,[Ce],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ae,[],function(e){return null!==e.id()}],"filter-type-in":[Ae,[Re(Te)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ae,[Re(Ce)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ae,[Te,Re(Ce)],function(e,t){var n=t[0];return t[1].value.indexOf(e.properties()[n.value])>=0}],"filter-in-large":[Ae,[Te,Re(Ce)],function(e,t){var n=t[0],r=t[1];return function(e,t,n,r){for(;n<=r;){var i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:Ae,overloads:[[[Ae,Ae],function(e,t){var n=t[0],r=t[1];return n.evaluate(e)&&r.evaluate(e)}],[Wt(Ae),function(e,t){for(var n=0,r=t;n0&&"string"==typeof e[0]&&e[0]in Yt}function pn(e,t){var n=new rt(Yt,[],function(e){var t={color:we,string:Te,number:Se,enum:Te,boolean:Ae,formatted:Ne};return"array"===e.type?Re(t[e.value]||Ce,e.length):t[e.type]}(t)),r=n.parse(e,void 0,void 0,void 0,"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?Qt(new cn(r,t)):Kt(n.errors)}cn.prototype.evaluateWithoutErrorHandling=function(e,t,n){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this.expression.evaluate(this._evaluator)},cn.prototype.evaluate=function(e,t,n){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null;try{var r=this.expression.evaluate(this._evaluator);if(null==r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new Ye("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}};var dn=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!et(t.expression)};dn.prototype.evaluateWithoutErrorHandling=function(e,t,n){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n)},dn.prototype.evaluate=function(e,t,n){return this._styleExpression.evaluate(e,t,n)};var _n=function(e,t,n){this.kind=e,this.zoomStops=n.labels,this._styleExpression=t,this.isStateDependent="camera"!==e&&!et(t.expression),n instanceof xt&&(this._interpolationType=n.interpolation)};function fn(e,t){if("error"===(e=pn(e,t)).result)return e;var n=e.value.expression,r=Je(n);if(!r&&!$t(t))return Kt([new ve("","data expressions not supported")]);var i=tt(n,["zoom"]);if(!i&&!Zt(t))return Kt([new ve("","zoom expressions not supported")]);var o=function e(t){var n=null;if(t instanceof Nt)n=e(t.result);else if(t instanceof Ot)for(var r=0,i=t.args;rr.maximum?[new fe(t,n,n+" is greater than the maximum value "+r.maximum)]:[]}function bn(e){var t,n,r,i=e.valueSpec,o=ge(e.value.type),a={},s="categorical"!==o&&void 0===e.value.property,l=!s,c="array"===Jt(e.value.stops)&&"array"===Jt(e.value.stops[0])&&"object"===Jt(e.value.stops[0][0]),u=gn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===o)return[new fe(e.key,e.value,'identity function may not have a "stops" property')];var t=[],n=e.value;return t=t.concat(yn({key:e.key,value:n,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===Jt(n)&&0===n.length&&t.push(new fe(e.key,n,"array must have at least one stop")),t},default:function(e){return jn({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===o&&s&&u.push(new fe(e.key,e.value,'missing required property "property"')),"identity"===o||e.value.stops||u.push(new fe(e.key,e.value,'missing required property "stops"')),"exponential"===o&&e.valueSpec.expression&&!Xt(e.valueSpec)&&u.push(new fe(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!$t(e.valueSpec)?u.push(new fe(e.key,e.value,"property functions not supported")):s&&!Zt(e.valueSpec)&&u.push(new fe(e.key,e.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==e.value.property||u.push(new fe(e.key,e.value,'"property" property is required')),u;function p(e){var t=[],o=e.value,s=e.key;if("array"!==Jt(o))return[new fe(s,o,"array expected, "+Jt(o)+" found")];if(2!==o.length)return[new fe(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Jt(o[0]))return[new fe(s,o,"object expected, "+Jt(o[0])+" found")];if(void 0===o[0].zoom)return[new fe(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new fe(s,o,"object stop key must have value")];if(r&&r>ge(o[0].zoom))return[new fe(s,o[0].zoom,"stop zoom values must appear in ascending order")];ge(o[0].zoom)!==r&&(r=ge(o[0].zoom),n=void 0,a={}),t=t.concat(gn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:vn,value:d}}))}else t=t.concat(d({key:s+"[0]",value:o[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},o));return un(ye(o[1]))?t.concat([new fe(s+"[1]",o[1],"expressions are not allowed in function stops.")]):t.concat(jn({key:s+"[1]",value:o[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function d(e,r){var s=Jt(e.value),l=ge(e.value),c=null!==e.value?e.value:r;if(t){if(s!==t)return[new fe(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new fe(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var u="number expected, "+s+" found";return $t(i)&&void 0===o&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new fe(e.key,c,u)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==n&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,n=e.slice(1);tt?1:0}function Cn(e){if(!e)return!0;var t,n=e[0];return e.length<=1?"any"!==n:"=="===n?On(e[1],e[2],"=="):"!="===n?In(On(e[1],e[2],"==")):"<"===n||">"===n||"<="===n||">="===n?On(e[1],e[2],n):"any"===n?(t=e.slice(1),["any"].concat(t.map(Cn))):"all"===n?["all"].concat(e.slice(1).map(Cn)):"none"===n?["all"].concat(e.slice(1).map(Cn).map(In)):"in"===n?Nn(e[1],e.slice(2)):"!in"===n?In(Nn(e[1],e.slice(2))):"has"===n?Rn(e[1]):"!has"!==n||In(Rn(e[1]))}function On(e,t,n){switch(e){case"$type":return["filter-type-"+n,t];case"$id":return["filter-id-"+n,t];default:return["filter-"+n,e,t]}}function Nn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(e){return typeof e!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(xn)]]:["filter-in-small",e,["literal",t]]}}function Rn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function In(e){return["!",e]}function Mn(e){return Tn(ye(e.value))?En(me({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var n=t.value,r=t.key;if("array"!==Jt(n))return[new fe(r,n,"array expected, "+Jt(n)+" found")];var i,o=t.styleSpec,a=[];if(n.length<1)return[new fe(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Sn({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:t.style,styleSpec:t.styleSpec})),ge(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===ge(n[1])&&a.push(new fe(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new fe(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=Jt(n[1]))&&a.push(new fe(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s=c[d+0]&&r>=c[d+1]?(a[p]=!0,o.push(l[p])):a[p]=!1}}},Jn.prototype._forEachCell=function(e,t,n,r,i,o,a){for(var s=this._convertToCellCoord(e),l=this._convertToCellCoord(t),c=this._convertToCellCoord(n),u=this._convertToCellCoord(r),p=s;p<=c;p++)for(var d=l;d<=u;d++){var _=this.d*d+p;if(i.call(this,e,t,n,r,_,o,a))return}},Jn.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Jn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Xn+this.cells.length+1+1,n=0,r=0;r=0)){var p=e[u];c[u]=tr[l].shallow.indexOf(u)>=0?p:ir(p,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function or(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof er)return e;if(Array.isArray(e))return e.map(or);if("object"==typeof e){var t=e.$name||"Object",n=tr[t].klass;if(!n)throw new Error("can't deserialize unregistered class "+t);if(n.deserialize)return n.deserialize(e);for(var r=Object.create(n.prototype),i=0,o=Object.keys(e);i=0?s:or(s)}}return r}throw new Error("can't deserialize object of type "+typeof e)}var ar=function(){this.first=!0};ar.prototype.update=function(e,t){var n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function lr(e){for(var t=0,n=e;t=65097&&e<=65103)||sr["CJK Compatibility Ideographs"](e)||sr["CJK Compatibility"](e)||sr["CJK Radicals Supplement"](e)||sr["CJK Strokes"](e)||!(!sr["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||sr["CJK Unified Ideographs Extension A"](e)||sr["CJK Unified Ideographs"](e)||sr["Enclosed CJK Letters and Months"](e)||sr["Hangul Compatibility Jamo"](e)||sr["Hangul Jamo Extended-A"](e)||sr["Hangul Jamo Extended-B"](e)||sr["Hangul Jamo"](e)||sr["Hangul Syllables"](e)||sr.Hiragana(e)||sr["Ideographic Description Characters"](e)||sr.Kanbun(e)||sr["Kangxi Radicals"](e)||sr["Katakana Phonetic Extensions"](e)||sr.Katakana(e)&&12540!==e||!(!sr["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!sr["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||sr["Unified Canadian Aboriginal Syllabics"](e)||sr["Unified Canadian Aboriginal Syllabics Extended"](e)||sr["Vertical Forms"](e)||sr["Yijing Hexagram Symbols"](e)||sr["Yi Syllables"](e)||sr["Yi Radicals"](e)))}function pr(e){return!(ur(e)||function(e){return!!(sr["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||sr["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||sr["Letterlike Symbols"](e)||sr["Number Forms"](e)||sr["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||sr["Control Pictures"](e)&&9251!==e||sr["Optical Character Recognition"](e)||sr["Enclosed Alphanumerics"](e)||sr["Geometric Shapes"](e)||sr["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||sr["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||sr["CJK Symbols and Punctuation"](e)||sr.Katakana(e)||sr["Private Use Area"](e)||sr["CJK Compatibility Forms"](e)||sr["Small Form Variants"](e)||sr["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function dr(e,t){return!(!t&&(e>=1424&&e<=2303||sr["Arabic Presentation Forms-A"](e)||sr["Arabic Presentation Forms-B"](e))||e>=2304&&e<=3583||e>=3840&&e<=4255||sr.Khmer(e))}var _r,fr=!1,hr=null,mr=!1,gr=new de,yr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return mr||null!=yr.applyArabicShaping}},vr=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ar,this.transition={})};vr.prototype.isSupportedScript=function(e){return function(e,t){for(var n=0,r=e;nthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}};var br=function(e,t){this.property=e,this.value=t,this.expression=mn(void 0===t?e.specification.default:t,e.specification)};br.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},br.prototype.possiblyEvaluate=function(e){return this.property.possiblyEvaluate(this,e)};var Er=function(e){this.property=e,this.value=new br(e,void 0)};Er.prototype.transitioned=function(e,t){return new Tr(this.property,this.value,t,p({},e.transition,this.transition),e.now)},Er.prototype.untransitioned=function(){return new Tr(this.property,this.value,null,{},0)};var Sr=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Sr.prototype.getValue=function(e){return b(this._values[e].value.value)},Sr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Er(this._values[e].property)),this._values[e].value=new br(this._values[e].property,null===t?void 0:b(t))},Sr.prototype.getTransition=function(e){return b(this._values[e].transition)},Sr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Er(this._values[e].property)),this._values[e].transition=b(t)||void 0},Sr.prototype.serialize=function(){for(var e={},t=0,n=Object.keys(this._values);tthis.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(t=1)return 1;var t=i*i,n=t*i;return 4*(i<.5?n:3*(i-t)+n-.75)}())}return n};var Ar=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Ar.prototype.possiblyEvaluate=function(e){for(var t=new Cr(this._properties),n=0,r=Object.keys(this._values);nr.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},t.prototype.interpolate=function(e){return e},t}(Nr),Ir=function(e){this.specification=e};Ir.prototype.possiblyEvaluate=function(e,t){if(void 0!==e.value){if("constant"===e.expression.kind){var n=e.expression.evaluate(t);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new vr(Math.floor(t.zoom-1),t)),e.expression.evaluate(new vr(Math.floor(t.zoom),t)),e.expression.evaluate(new vr(Math.floor(t.zoom+1),t)),t)}},Ir.prototype._calculate=function(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}},Ir.prototype.interpolate=function(e){return e};var Mr=function(e){this.specification=e};Mr.prototype.possiblyEvaluate=function(e,t){return!!e.expression.evaluate(t)},Mr.prototype.interpolate=function(){return!1};var Dr=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},e){var n=e[t],r=this.defaultPropertyValues[t]=new br(n,void 0),i=this.defaultTransitionablePropertyValues[t]=new Er(n);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}};nr("DataDrivenProperty",Nr),nr("DataConstantProperty",Or),nr("CrossFadedDataDrivenProperty",Rr),nr("CrossFadedProperty",Ir),nr("ColorRampProperty",Mr);var Pr=function(e){function t(t,n){if(e.call(this),this.id=t.id,this.type=t.type,this.visibility="visible",this._featureFilter=function(){return!0},"custom"!==t.type&&(t=t,this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),n.layout&&(this._unevaluatedLayout=new wr(n.layout)),n.paint)){for(var r in this._transitionablePaint=new Sr(n.paint),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,n){if(void 0===n&&(n={}),null!=t){var r="layers."+this.id+".layout."+e;if(this._validate(Kn,r,e,t,n))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility="none"===t?t:"visible"},t.prototype.getPaintProperty=function(e){return g(e,"-transition")?this._transitionablePaint.getTransition(e.slice(0,-"-transition".length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,n){if(void 0===n&&(n={}),null!=t){var r="layers."+this.id+".paint."+e;if(this._validate(Qn,r,e,t,n))return!1}if(g(e,"-transition"))return this._transitionablePaint.setTransition(e.slice(0,-"-transition".length),t||void 0),!1;var i=this._transitionablePaint._values[e],o="cross-faded-data-driven"===i.property.specification["property-type"]&&!i.value.value&&t,a=this._transitionablePaint._values[e].value.isDataDriven();this._transitionablePaint.setValue(e,t);var s=this._transitionablePaint._values[e].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(e),s||a||o},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e)),this.paint=this._transitioningPaint.possiblyEvaluate(e)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(e.layout=e.layout||{},e.layout.visibility="none"),v(e,function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)})},t.prototype._validate=function(e,t,n,r,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&$n(this,e.call(Hn,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:_e,style:{glyphs:!0,sprite:!0}}))},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof xr&&$t(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(de),Lr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},kr=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ur=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Br(e,t){void 0===t&&(t=1);var n=0,r=0;return{members:e.map(function(e){var i,o=(i=e.type,Lr[i].BYTES_PER_ELEMENT),a=n=Fr(n,Math.max(t,o)),s=e.components||1;return r=Math.max(r,o),n+=o*s,{name:e.name,type:e.type,components:s,offset:a}}),size:Fr(n,Math.max(r,t)),alignment:t}}function Fr(e,t){return Math.ceil(e/t)*t}Ur.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ur.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Ur.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ur.prototype.clear=function(){this.length=0},Ur.prototype.resize=function(e){this.reserve(e),this.length=e},Ur.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ur.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var zr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e},t}(Ur);zr.prototype.bytesPerElement=4,nr("StructArrayLayout2i4",zr);var jr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var o=4*e;return this.int16[o+0]=t,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,e},t}(Ur);jr.prototype.bytesPerElement=8,nr("StructArrayLayout4i8",jr);var Gr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)},t.prototype.emplace=function(e,t,n,r,i,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(Ur);Gr.prototype.bytesPerElement=12,nr("StructArrayLayout2i4i12",Gr);var Yr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,o,a,s)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l){var c=6*e,u=12*e;return this.int16[c+0]=t,this.int16[c+1]=n,this.int16[c+2]=r,this.int16[c+3]=i,this.uint8[u+8]=o,this.uint8[u+9]=a,this.uint8[u+10]=s,this.uint8[u+11]=l,e},t}(Ur);Yr.prototype.bytesPerElement=12,nr("StructArrayLayout4i4ub12",Yr);var Vr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,o,a,s)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l){var c=8*e;return this.uint16[c+0]=t,this.uint16[c+1]=n,this.uint16[c+2]=r,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=l,e},t}(Ur);Vr.prototype.bytesPerElement=16,nr("StructArrayLayout8ui16",Vr);var qr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,o,a,s)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l){var c=8*e;return this.int16[c+0]=t,this.int16[c+1]=n,this.int16[c+2]=r,this.int16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=l,e},t}(Ur);qr.prototype.bytesPerElement=16,nr("StructArrayLayout4i4ui16",qr);var Hr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e},t}(Ur);Hr.prototype.bytesPerElement=12,nr("StructArrayLayout3f12",Hr);var Wr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=1*e;return this.uint32[n+0]=t,e},t}(Ur);Wr.prototype.bytesPerElement=4,nr("StructArrayLayout1ul4",Wr);var Qr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s,l,c,u){var p=this.length;return this.resize(p+1),this.emplace(p,e,t,n,r,i,o,a,s,l,c,u)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l,c,u,p){var d=12*e,_=6*e;return this.int16[d+0]=t,this.int16[d+1]=n,this.int16[d+2]=r,this.int16[d+3]=i,this.int16[d+4]=o,this.int16[d+5]=a,this.uint32[_+3]=s,this.uint16[d+8]=l,this.uint16[d+9]=c,this.int16[d+10]=u,this.int16[d+11]=p,e},t}(Ur);Qr.prototype.bytesPerElement=24,nr("StructArrayLayout6i1ul2ui2i24",Qr);var Kr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)},t.prototype.emplace=function(e,t,n,r,i,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(Ur);Kr.prototype.bytesPerElement=12,nr("StructArrayLayout2i2i2i12",Kr);var $r=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=4*e;return this.uint8[r+0]=t,this.uint8[r+1]=n,e},t}(Ur);$r.prototype.bytesPerElement=4,nr("StructArrayLayout2ub4",$r);var Zr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s,l,c,u,p,d,_){var f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,o,a,s,l,c,u,p,d,_)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l,c,u,p,d,_,f){var h=20*e,m=10*e,g=40*e;return this.int16[h+0]=t,this.int16[h+1]=n,this.uint16[h+2]=r,this.uint16[h+3]=i,this.uint32[m+2]=o,this.uint32[m+3]=a,this.uint32[m+4]=s,this.uint16[h+10]=l,this.uint16[h+11]=c,this.uint16[h+12]=u,this.float32[m+7]=p,this.float32[m+8]=d,this.uint8[g+36]=_,this.uint8[g+37]=f,e},t}(Ur);Zr.prototype.bytesPerElement=40,nr("StructArrayLayout2i2ui3ul3ui2f2ub40",Zr);var Xr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.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)},t.prototype.emplaceBack=function(e,t,n,r,i,o,a,s,l,c,u,p,d,_){var f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,o,a,s,l,c,u,p,d,_)},t.prototype.emplace=function(e,t,n,r,i,o,a,s,l,c,u,p,d,_,f){var h=16*e,m=8*e;return this.int16[h+0]=t,this.int16[h+1]=n,this.int16[h+2]=r,this.int16[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]=c,this.uint16[h+9]=u,this.uint16[h+10]=p,this.uint16[h+11]=d,this.uint16[h+12]=_,this.uint32[m+7]=f,e},t}(Ur);Xr.prototype.bytesPerElement=32,nr("StructArrayLayout4i9ui1ul32",Xr);var Jr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=1*e;return this.float32[n+0]=t,e},t}(Ur);Jr.prototype.bytesPerElement=4,nr("StructArrayLayout1f4",Jr);var ei=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e},t}(Ur);ei.prototype.bytesPerElement=6,nr("StructArrayLayout3i6",ei);var ti=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=2*e,o=4*e;return this.uint32[i+0]=t,this.uint16[o+2]=n,this.uint16[o+3]=r,e},t}(Ur);ti.prototype.bytesPerElement=8,nr("StructArrayLayout1ul2ui8",ti);var ni=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)},t.prototype.emplace=function(e,t,n,r){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e},t}(Ur);ni.prototype.bytesPerElement=6,nr("StructArrayLayout3ui6",ni);var ri=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e},t}(Ur);ri.prototype.bytesPerElement=4,nr("StructArrayLayout2ui4",ri);var ii=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var n=1*e;return this.uint16[n+0]=t,e},t}(Ur);ii.prototype.bytesPerElement=2,nr("StructArrayLayout1ui2",ii);var oi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var n=this.length;return this.resize(n+1),this.emplace(n,e,t)},t.prototype.emplace=function(e,t,n){var r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e},t}(Ur);oi.prototype.bytesPerElement=8,nr("StructArrayLayout2f8",oi);var ai=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)},t.prototype.emplace=function(e,t,n,r,i){var o=4*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,e},t}(Ur);ai.prototype.bytesPerElement=16,nr("StructArrayLayout4f16",ai);var si=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(e){this._structArray.int16[this._pos2+0]=e},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(e){this._structArray.int16[this._pos2+1]=e},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(e){this._structArray.int16[this._pos2+2]=e},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(e){this._structArray.int16[this._pos2+3]=e},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(e){this._structArray.int16[this._pos2+4]=e},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(e){this._structArray.int16[this._pos2+5]=e},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+8]=e},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(e){this._structArray.int16[this._pos2+10]=e},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+11]=e},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,n),t}(kr);si.prototype.size=24;var li=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new si(this,e)},t}(Qr);nr("CollisionBoxArray",li);var ci=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.glyphStartIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.numGlyphs.set=function(e){this._structArray.uint16[this._pos2+3]=e},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.vertexStartIndex.set=function(e){this._structArray.uint32[this._pos4+2]=e},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineStartIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.lineLength.set=function(e){this._structArray.uint32[this._pos4+4]=e},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.segment.set=function(e){this._structArray.uint16[this._pos2+10]=e},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.lowerSize.set=function(e){this._structArray.uint16[this._pos2+11]=e},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.upperSize.set=function(e){this._structArray.uint16[this._pos2+12]=e},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetX.set=function(e){this._structArray.float32[this._pos4+7]=e},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.lineOffsetY.set=function(e){this._structArray.float32[this._pos4+8]=e},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.writingMode.set=function(e){this._structArray.uint8[this._pos1+36]=e},n.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},n.hidden.set=function(e){this._structArray.uint8[this._pos1+37]=e},Object.defineProperties(t.prototype,n),t}(kr);ci.prototype.size=40;var ui=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ci(this,e)},t}(Zr);nr("PlacedSymbolArray",ui);var pi=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},horizontalPlacedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},n.horizontalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.horizontalPlacedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+2]=e},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.verticalPlacedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+3]=e},n.key.get=function(){return this._structArray.uint16[this._pos2+4]},n.key.set=function(e){this._structArray.uint16[this._pos2+4]=e},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+5]},n.textBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+5]=e},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+6]},n.textBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+6]=e},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},n.iconBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+7]=e},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.iconBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+8]=e},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.featureIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},n.numGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+10]},n.numGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+10]=e},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+11]},n.numVerticalGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+11]=e},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+12]},n.numIconVertices.set=function(e){this._structArray.uint16[this._pos2+12]=e},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+7]},n.crossTileID.set=function(e){this._structArray.uint32[this._pos4+7]=e},Object.defineProperties(t.prototype,n),t}(kr);pi.prototype.size=32;var di=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new pi(this,e)},t}(Xr);nr("SymbolInstanceArray",di);var _i=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={offsetX:{configurable:!0}};return n.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},n.offsetX.set=function(e){this._structArray.float32[this._pos4+0]=e},Object.defineProperties(t.prototype,n),t}(kr);_i.prototype.size=4;var fi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t.prototype.get=function(e){return new _i(this,e)},t}(Jr);nr("GlyphOffsetArray",fi);var hi=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return n.x.get=function(){return this._structArray.int16[this._pos2+0]},n.x.set=function(e){this._structArray.int16[this._pos2+0]=e},n.y.get=function(){return this._structArray.int16[this._pos2+1]},n.y.set=function(e){this._structArray.int16[this._pos2+1]=e},n.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},n.tileUnitDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+2]=e},Object.defineProperties(t.prototype,n),t}(kr);hi.prototype.size=6;var mi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t.prototype.get=function(e){return new hi(this,e)},t}(ei);nr("SymbolLineVertexArray",mi);var gi=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.featureIndex.set=function(e){this._structArray.uint32[this._pos4+0]=e},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},n.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+3]=e},Object.defineProperties(t.prototype,n),t}(kr);gi.prototype.size=8;var yi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new gi(this,e)},t}(ti);nr("FeatureIndexArray",yi);var vi=Br([{name:"a_pos",components:2,type:"Int16"}],4),bi=vi.members,Ei=(vi.size,vi.alignment,function(e){void 0===e&&(e=[]),this.segments=e});function Si(e,t){return 256*(e=c(Math.floor(e),0,255))+c(Math.floor(t),0,255)}Ei.prototype.prepareSegment=function(e,t,n){var r=this.segments[this.segments.length-1];return e>Ei.MAX_VERTEX_ARRAY_LENGTH&&S("Max vertices per segment is "+Ei.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!r||r.vertexLength+e>Ei.MAX_VERTEX_ARRAY_LENGTH)&&(r={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},this.segments.push(r)),r},Ei.prototype.get=function(){return this.segments},Ei.prototype.destroy=function(){for(var e=0,t=this.segments;e>1;this.ids[r]>=e?n=r:t=r+1}for(var i=[];this.ids[t]===e;){var o=this.positions[3*t],a=this.positions[3*t+1],s=this.positions[3*t+2];i.push({index:o,start:a,end:s}),t++}return i},Ti.serialize=function(e,t){var n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return function e(t,n,r,i){if(!(r>=i)){for(var o=t[r+i>>1],a=r-1,s=i+1;;){do{a++}while(t[a]o);if(a>=s)break;Ai(t,a,s),Ai(n,3*a,3*s),Ai(n,3*a+1,3*s+1),Ai(n,3*a+2,3*s+2)}e(t,n,r,s),e(t,n,s+1,i)}}(n,r,0,n.length-1),t.push(n.buffer,r.buffer),{ids:n,positions:r}},Ti.deserialize=function(e){var t=new Ti;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t},nr("FeaturePositionMap",Ti);var wi=function(e,t){this.gl=e.gl,this.location=t},xi=function(e){function t(t,n){e.call(this,t,n),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}(wi),Ci=function(e){function t(t,n){e.call(this,t,n),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}(wi),Oi=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}(wi),Ni=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}(wi),Ri=function(e){function t(t,n){e.call(this,t,n),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}(wi),Ii=function(e){function t(t,n){e.call(this,t,n),this.current=Le.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}(wi),Mi=new Float32Array(16),Di=function(e){function t(t,n){e.call(this,t,n),this.current=Mi}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(var t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}},t}(wi);function Pi(e){return[Si(255*e.r,255*e.g),Si(255*e.b,255*e.a)]}var Li=function(e,t,n){this.value=e,this.names=t,this.uniformNames=this.names.map(function(e){return"u_"+e}),this.type=n,this.maxValue=-1/0};Li.prototype.defines=function(){return this.names.map(function(e){return"#define HAS_UNIFORM_u_"+e})},Li.prototype.setConstantPatternPositions=function(){},Li.prototype.populatePaintArray=function(){},Li.prototype.updatePaintArray=function(){},Li.prototype.upload=function(){},Li.prototype.destroy=function(){},Li.prototype.setUniforms=function(e,t,n,r){t.set(r.constantOr(this.value))},Li.prototype.getBinding=function(e,t){return"color"===this.type?new Ii(e,t):new Ci(e,t)},Li.serialize=function(e){var t=e.value,n=e.names,r=e.type;return{value:ir(t),names:n,type:r}},Li.deserialize=function(e){var t=e.value,n=e.names,r=e.type;return new Li(or(t),n,r)};var ki=function(e,t,n){this.value=e,this.names=t,this.uniformNames=this.names.map(function(e){return"u_"+e}),this.type=n,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};ki.prototype.defines=function(){return this.names.map(function(e){return"#define HAS_UNIFORM_u_"+e})},ki.prototype.populatePaintArray=function(){},ki.prototype.updatePaintArray=function(){},ki.prototype.upload=function(){},ki.prototype.destroy=function(){},ki.prototype.setConstantPatternPositions=function(e,t){this.patternPositions.patternTo=e.tlbr,this.patternPositions.patternFrom=t.tlbr},ki.prototype.setUniforms=function(e,t,n,r,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&t.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&t.set(o.patternFrom)},ki.prototype.getBinding=function(e,t){return new Ri(e,t)};var Ui=function(e,t,n,r){this.expression=e,this.names=t,this.type=n,this.uniformNames=this.names.map(function(e){return"a_"+e}),this.maxValue=-1/0,this.paintVertexAttributes=t.map(function(e){return{name:"a_"+e,type:"Float32",components:"color"===n?2:1,offset:0}}),this.paintVertexArray=new r};Ui.prototype.defines=function(){return[]},Ui.prototype.setConstantPatternPositions=function(){},Ui.prototype.populatePaintArray=function(e,t){var n=this.paintVertexArray,r=n.length;n.reserve(e);var i=this.expression.evaluate(new vr(0),t,{});if("color"===this.type)for(var o=Pi(i),a=r;aqi.max||a.yqi.max)&&S("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function Wi(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}var Qi=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new zr,this.indexArray=new ni,this.segments=new Ei,this.programConfigurations=new ji(bi,e.layers,e.zoom)};function Ki(e,t,n){for(var r=0;r=3)for(var s=0;s1){if(Ji(e,t))return!0;for(var r=0;r1?e.distSqr(n):e.distSqr(n.sub(t)._mult(i)._add(t))}function ro(e,t){for(var n,r,i,o=!1,a=0;at.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function io(e,t){for(var n=!1,r=0,i=e.length-1;rt.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function oo(e,t,n){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:n.programConfigurations.get(t.id).binders[e].maxValue}function ao(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function so(e,t,n,r,o){if(!t[0]&&!t[1])return e;var a=i.convert(t);"viewport"===n&&a._rotate(-r);for(var s=[],l=0;l=Vi||c<0||c>=Vi)){var u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=u.vertexLength;Wi(this.layoutVertexArray,l,c,-1,-1),Wi(this.layoutVertexArray,l,c,1,-1),Wi(this.layoutVertexArray,l,c,1,1),Wi(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),u.vertexLength+=4,u.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{})},nr("CircleBucket",Qi,{omit:["layers"]});var lo={paint:new Dr({"circle-radius":new Nr(_e.paint_circle["circle-radius"]),"circle-color":new Nr(_e.paint_circle["circle-color"]),"circle-blur":new Nr(_e.paint_circle["circle-blur"]),"circle-opacity":new Nr(_e.paint_circle["circle-opacity"]),"circle-translate":new Or(_e.paint_circle["circle-translate"]),"circle-translate-anchor":new Or(_e.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Or(_e.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Or(_e.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Nr(_e.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Nr(_e.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Nr(_e.paint_circle["circle-stroke-opacity"])})},co="undefined"!=typeof Float32Array?Float32Array:Array;function uo(){var e=new co(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function po(){var e=new co(3);return e[0]=0,e[1]=0,e[2]=0,e}function _o(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function fo(e,t,n){var r=new co(3);return r[0]=e,r[1]=t,r[2]=n,r}Math.PI;var ho,mo=_o,go=(ho=po(),function(e,t,n,r,i,o){var a,s;for(t||(t=3),n||(n=0),s=r?Math.min(r*t+n,e.length):e.length,a=n;a0&&(a=1/Math.sqrt(a),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a),e}function bo(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}var Eo=function(){var e=yo();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,t.length):t.length,s=r;se.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");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 destination coordinates for image copy");for(var a=e.data,s=t.data,l=0;l80*n){r=o=e[0],i=a=e[1];for(var f=n;fo&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return Yo(d,_,n,r,i,c),_}function jo(e,t,n,r,i){var o,a;if(i===la(e,t,n,r)>0)for(o=t;o=t;o-=r)a=oa(o,e[o],e[o+1],a);return a&&ta(a,a.next)&&(aa(a),a=a.next),a}function Go(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!ta(r,r.next)&&0!==ea(r.prev,r,r.next))r=r.next;else{if(aa(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Yo(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=$o(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?qo(e,r,i,o):Vo(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),aa(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Yo(e=Ho(e,t,n),t,n,r,i,o,2):2===a&&Wo(e,t,n,r,i,o):Yo(Go(e),t,n,r,i,o,1);break}}}function Vo(e){var t=e.prev,n=e,r=e.next;if(ea(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Xo(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&ea(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function qo(e,t,n,r){var i=e.prev,o=e,a=e.next;if(ea(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,p=$o(s,l,t,n,r),d=$o(c,u,t,n,r),_=e.prevZ,f=e.nextZ;_&&_.z>=p&&f&&f.z<=d;){if(_!==e.prev&&_!==e.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,_.x,_.y)&&ea(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,f!==e.prev&&f!==e.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ea(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;_&&_.z>=p;){if(_!==e.prev&&_!==e.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,_.x,_.y)&&ea(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ea(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ho(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!ta(i,o)&&na(i,r,r.next,o)&&ra(i,o)&&ra(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),aa(r),aa(r.next),r=e=o),r=r.next}while(r!==e);return r}function Wo(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Jo(a,s)){var l=ia(a,s);return a=Go(a,a.next),l=Go(l,l.next),Yo(a,t,n,r,i,o),void Yo(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function Qo(e,t){return e.x-t.x}function Ko(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=u&&i!==r.x&&Xo(on.x)&&ra(r,e)&&(n=r,d=l),r=r.next;return n}(e,t)){var n=ia(t,e);Go(n,n.next)}}function $o(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Zo(e){var t=e,n=e;do{t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Jo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&na(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&ra(e,t)&&ra(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function ea(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ta(e,t){return e.x===t.x&&e.y===t.y}function na(e,t,n,r){return!!(ta(e,t)&&ta(n,r)||ta(e,r)&&ta(n,t))||ea(e,t,n)>0!=ea(e,t,r)>0&&ea(n,r,e)>0!=ea(n,r,t)>0}function ra(e,t){return ea(e.prev,e,e.next)<0?ea(e,t,e.next)>=0&&ea(e,e.prev,t)>=0:ea(e,t,e.prev)<0||ea(e,e.next,t)<0}function ia(e,t){var n=new sa(e.i,e.x,e.y),r=new sa(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function oa(e,t,n,r){var i=new sa(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function aa(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function sa(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function la(e,t,n,r){for(var i=0,o=t,a=n-r;o0&&(r+=e[i-1].length,n.holes.push(r))}return n},Bo.default=Fo;var ca=pa,ua=pa;function pa(e,t,n,r,i){!function e(t,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,s=n-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);e(t,n,Math.max(r,Math.floor(n-s*c/a+u)),Math.min(i,Math.floor(n+(a-s)*c/a+u)),o)}var p=t[n],d=r,_=i;for(da(t,r,n),o(t[i],p)>0&&da(t,r,i);d<_;){for(da(t,d,_),d++,_--;o(t[d],p)<0;)d++;for(;o(t[_],p)>0;)_--}0===o(t[r],p)?da(t,r,_):da(t,++_,i),_<=n&&(r=_+1),n<=_&&(i=_-1)}}(e,t,n||0,r||e.length-1,i||_a)}function da(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _a(e,t){return et?1:0}function fa(e,t){var n=e.length;if(n<=1)return[e];for(var r,i,o=[],a=0;a1)for(var l=0;lVi)||e.y===t.y&&(e.y<0||e.y>Vi)}function Ca(e){return e.every(function(e){return e.x<0})||e.every(function(e){return e.x>Vi})||e.every(function(e){return e.y<0})||e.every(function(e){return e.y>Vi})}wa.prototype.populate=function(e,t){this.features=[],this.hasPattern=ma("fill-extrusion",this.layers,t);for(var n=0,r=e;n=1){var g=_[h-1];if(!xa(m,g)){u.vertexLength+4>Ei.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=m.sub(g)._perp()._unit(),v=g.dist(m);f+v>32768&&(f=0),Aa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,0,f),Aa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,1,f),f+=v,Aa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,0,f),Aa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,1,f);var b=u.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),u.vertexLength+=4,u.primitiveLength+=2}}}}u.vertexLength+s>Ei.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray));for(var E=[],S=[],T=u.vertexLength,A=0,w=a;A>3}if(o--,1===r||2===r)a+=e.readSVarint(),s+=e.readSVarint(),1===r&&(t&&l.push(t),t=[]),t.push(new i(a,s));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Da.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(r--,1===n||2===n)(i+=e.readSVarint())s&&(s=i),(o+=e.readSVarint())c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,c]},Da.prototype.toGeoJSON=function(e,t,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Da.types[this.type];function u(e){for(var t=0;t>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}function Fa(e,t,n){if(3===e){var r=new ka(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}Ua.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Ma(this._pbf,t,this.extent,this._keys,this._values)};var za={VectorTile:function(e,t){this.layers=e.readFields(Fa,{},t)},VectorTileFeature:Ma,VectorTileLayer:ka},ja=za.VectorTileFeature.types,Ga=63,Ya=Math.cos(Math.PI/180*37.5),Va=.5,qa=Math.pow(2,14)/Va;function Ha(e,t,n,r,i,o,a){e.emplaceBack(t.x,t.y,r?1:0,i?1:-1,Math.round(Ga*n.x)+128,Math.round(Ga*n.y)+128,1+(0===o?0:o<0?-1:1)|(a*Va&63)<<2,a*Va>>6)}var Wa=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.features=[],this.hasPattern=!1,this.layoutVertexArray=new Yr,this.indexArray=new ni,this.programConfigurations=new ji(Ia,e.layers,e.zoom),this.segments=new Ei};function Qa(e,t){return(e/t.tileTotal*(t.end-t.start)+t.start)*(qa-1)}Wa.prototype.populate=function(e,t){this.features=[],this.hasPattern=ma("line",this.layers,t);for(var n=0,r=e;n=2&&e[u-1].equals(e[u-2]);)u--;for(var p=0;pp){var R=h.dist(E);if(R>2*d){var I=h.sub(h.sub(E)._mult(d/R)._round());this.distance+=I.dist(E),this.addCurrentVertex(I,this.distance,T.mult(1),0,0,!1,f,l),E=I}}var M=E&&S,D=M?n:S?y:v;if(M&&"round"===D&&(Oi&&(D="bevel"),"bevel"===D&&(O>2&&(D="flipbevel"),O100)x=A.clone().mult(-1);else{var P=T.x*A.y-T.y*A.x>0?-1:1,L=O*T.add(A).mag()/T.sub(A).mag();x._perp()._mult(L*P)}this.addCurrentVertex(h,this.distance,x,0,0,!1,f,l),this.addCurrentVertex(h,this.distance,x.mult(-1),0,0,!1,f,l)}else if("bevel"===D||"fakeround"===D){var k=T.x*A.y-T.y*A.x>0,U=-Math.sqrt(O*O-1);if(k?(g=0,m=U):(m=0,g=U),b||this.addCurrentVertex(h,this.distance,T,m,g,!1,f,l),"fakeround"===D){for(var B=Math.floor(8*(.5-(C-.5))),F=void 0,z=0;z=0;j--)F=T.mult((j+1)/(B+1))._add(A)._unit(),this.addPieSliceVertex(h,this.distance,F,k,f,l)}S&&this.addCurrentVertex(h,this.distance,A,-m,-g,!1,f,l)}else"butt"===D?(b||this.addCurrentVertex(h,this.distance,T,0,0,!1,f,l),S&&this.addCurrentVertex(h,this.distance,A,0,0,!1,f,l)):"square"===D?(b||(this.addCurrentVertex(h,this.distance,T,1,1,!1,f,l),this.e1=this.e2=-1),S&&this.addCurrentVertex(h,this.distance,A,-1,-1,!1,f,l)):"round"===D&&(b||(this.addCurrentVertex(h,this.distance,T,0,0,!1,f,l),this.addCurrentVertex(h,this.distance,T,1,1,!0,f,l),this.e1=this.e2=-1),S&&(this.addCurrentVertex(h,this.distance,A,-1,-1,!0,f,l),this.addCurrentVertex(h,this.distance,A,0,0,!1,f,l)));if(N&&w2*d){var Y=h.add(S.sub(h)._mult(d/G)._round());this.distance+=Y.dist(h),this.addCurrentVertex(Y,this.distance,A.mult(1),0,0,!1,f,l),h=Y}}b=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,s)}},Wa.prototype.addCurrentVertex=function(e,t,n,r,i,o,a,s){var l,c=this.layoutVertexArray,u=this.indexArray;s&&(t=Qa(t,s)),l=n.clone(),r&&l._sub(n.perp()._mult(r)),Ha(c,e,l,o,!1,r,t),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(u.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,l=n.mult(-1),i&&l._sub(n.perp()._mult(i)),Ha(c,e,l,o,!0,-i,t),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(u.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,t>qa/2&&!s&&(this.distance=0,this.addCurrentVertex(e,this.distance,n,r,i,o,a))},Wa.prototype.addPieSliceVertex=function(e,t,n,r,i,o){n=n.mult(r?-1:1);var a=this.layoutVertexArray,s=this.indexArray;o&&(t=Qa(t,o)),Ha(a,e,n,!1,r,0,t),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),r?this.e2=this.e3:this.e1=this.e3},nr("LineBucket",Wa,{omit:["layers","features"]});var Ka=new Dr({"line-cap":new Or(_e.layout_line["line-cap"]),"line-join":new Nr(_e.layout_line["line-join"]),"line-miter-limit":new Or(_e.layout_line["line-miter-limit"]),"line-round-limit":new Or(_e.layout_line["line-round-limit"])}),$a={paint:new Dr({"line-opacity":new Nr(_e.paint_line["line-opacity"]),"line-color":new Nr(_e.paint_line["line-color"]),"line-translate":new Or(_e.paint_line["line-translate"]),"line-translate-anchor":new Or(_e.paint_line["line-translate-anchor"]),"line-width":new Nr(_e.paint_line["line-width"]),"line-gap-width":new Nr(_e.paint_line["line-gap-width"]),"line-offset":new Nr(_e.paint_line["line-offset"]),"line-blur":new Nr(_e.paint_line["line-blur"]),"line-dasharray":new Ir(_e.paint_line["line-dasharray"]),"line-pattern":new Rr(_e.paint_line["line-pattern"]),"line-gradient":new Mr(_e.paint_line["line-gradient"])}),layout:Ka},Za=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,n){return n=new vr(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),e.prototype.possiblyEvaluate.call(this,t,n)},t.prototype.evaluate=function(t,n,r,i){return n=p({},n,{zoom:Math.floor(n.zoom)}),e.prototype.evaluate.call(this,t,n,r,i)},t}(Nr))($a.paint.properties["line-width"].specification);Za.useIntegerZoom=!0;var Xa=function(e){function t(t){e.call(this,t,$a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Mo(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t){e.prototype.recalculate.call(this,t),this.paint._values["line-floorwidth"]=Za.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Wa(e)},t.prototype.queryRadius=function(e){var t=e,n=Ja(oo("line-width",this,t),oo("line-gap-width",this,t)),r=oo("line-offset",this,t);return n/2+Math.abs(r)+ao(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,n,r,o,a,s){var l=so(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Ja(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),u=this.paint.get("line-offset").evaluate(t,n);return u&&(r=function(e,t){for(var n=[],r=new i(0,0),o=0;o0?t+2*e:e}var es=Br([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),ts=Br([{name:"a_projected_pos",components:3,type:"Float32"}],4),ns=(Br([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Br([{name:"a_placed",components:2,type:"Uint8"}],4)),rs=(Br([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Br([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),is=Br([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function os(e,t,n){return e.sections.forEach(function(e){e.text=function(e,t,n){var r=t.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),yr.applyArabicShaping&&(e=yr.applyArabicShaping(e)),e}(e.text,t,n)}),e}Br([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),Br([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"horizontalPlacedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"}]),Br([{type:"Float32",name:"offsetX"}]),Br([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var as={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ss=function(e){function t(t,n,r,i){e.call(this,t,n),this.angle=r,void 0!==i&&(this.segment=i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(i);nr("Anchor",ss);function ls(e,t){var n=t.expression;if("constant"===n.kind)return{functionType:"constant",layoutSize:n.evaluate(new vr(e+1))};if("source"===n.kind)return{functionType:"source"};for(var r=n.zoomStops,i=0;i0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==a.value.kind||a.value.value&&a.value.value.length>0;if(this.features=[],s||l){for(var c=t.iconDependencies,u=t.glyphDependencies,p=new vr(this.zoom),d=0,_=e;d<_.length;d+=1){var f=_[d],h=f.feature,m=f.index,g=f.sourceLayerIndex;if(n._featureFilter(p,h)){var y=void 0;if(s){var v=n.getValueAndResolveTokens("text-field",h);y=os(v instanceof Be?v:Be.fromString(v),n,h)}var b=void 0;if(l&&(b=n.getValueAndResolveTokens("icon-image",h)),y||b){var E={text:y,icon:b,index:m,sourceLayerIndex:g,geometry:Hi(h),properties:h.properties,type:cs[h.type]};if(void 0!==h.id&&(E.id=h.id),this.features.push(E),b&&(c[b]=!0),y)for(var S=i.evaluate(h,{}).join(","),T="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),A=0,w=y.sections;A=0;s--)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0;this.addCollisionDebugVertices(o,a,s,l,c?this.collisionCircle:this.collisionBox,i.anchorPoint,n,c)}},hs.prototype.generateCollisionDebugBuffers=function(){for(var e=0;e0},hs.prototype.hasIconData=function(){return this.icon.segments.get().length>0},hs.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},hs.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},hs.prototype.addIndicesForPlacedTextSymbol=function(e){for(var t=this.text.placedSymbolArray.get(e),n=t.vertexStartIndex+4*t.numGlyphs,r=t.vertexStartIndex;r1||this.icon.segments.get().length>1))){for(var t=[],n=0;n=0&&this.addIndicesForPlacedTextSymbol(d.horizontalPlacedTextSymbolIndex),d.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(d.verticalPlacedTextSymbolIndex);var _=this.icon.placedSymbolArray.get(p);if(_.numGlyphs){var f=_.vertexStartIndex;this.icon.indexArray.emplaceBack(f,f+1,f+2),this.icon.indexArray.emplaceBack(f+1,f+2,f+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},nr("SymbolBucket",hs,{omit:["layers","collisionBoxArray","features","compareText"]}),hs.MAX_GLYPHS=65535,hs.addDynamicAttributes=ds;var ms=new Dr({"symbol-placement":new Or(_e.layout_symbol["symbol-placement"]),"symbol-spacing":new Or(_e.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Or(_e.layout_symbol["symbol-avoid-edges"]),"symbol-z-order":new Or(_e.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Or(_e.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Or(_e.layout_symbol["icon-ignore-placement"]),"icon-optional":new Or(_e.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Or(_e.layout_symbol["icon-rotation-alignment"]),"icon-size":new Nr(_e.layout_symbol["icon-size"]),"icon-text-fit":new Or(_e.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Or(_e.layout_symbol["icon-text-fit-padding"]),"icon-image":new Nr(_e.layout_symbol["icon-image"]),"icon-rotate":new Nr(_e.layout_symbol["icon-rotate"]),"icon-padding":new Or(_e.layout_symbol["icon-padding"]),"icon-keep-upright":new Or(_e.layout_symbol["icon-keep-upright"]),"icon-offset":new Nr(_e.layout_symbol["icon-offset"]),"icon-anchor":new Nr(_e.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Or(_e.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Or(_e.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Or(_e.layout_symbol["text-rotation-alignment"]),"text-field":new Nr(_e.layout_symbol["text-field"]),"text-font":new Nr(_e.layout_symbol["text-font"]),"text-size":new Nr(_e.layout_symbol["text-size"]),"text-max-width":new Nr(_e.layout_symbol["text-max-width"]),"text-line-height":new Or(_e.layout_symbol["text-line-height"]),"text-letter-spacing":new Nr(_e.layout_symbol["text-letter-spacing"]),"text-justify":new Nr(_e.layout_symbol["text-justify"]),"text-anchor":new Nr(_e.layout_symbol["text-anchor"]),"text-max-angle":new Or(_e.layout_symbol["text-max-angle"]),"text-rotate":new Nr(_e.layout_symbol["text-rotate"]),"text-padding":new Or(_e.layout_symbol["text-padding"]),"text-keep-upright":new Or(_e.layout_symbol["text-keep-upright"]),"text-transform":new Nr(_e.layout_symbol["text-transform"]),"text-offset":new Nr(_e.layout_symbol["text-offset"]),"text-allow-overlap":new Or(_e.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Or(_e.layout_symbol["text-ignore-placement"]),"text-optional":new Or(_e.layout_symbol["text-optional"])}),gs={paint:new Dr({"icon-opacity":new Nr(_e.paint_symbol["icon-opacity"]),"icon-color":new Nr(_e.paint_symbol["icon-color"]),"icon-halo-color":new Nr(_e.paint_symbol["icon-halo-color"]),"icon-halo-width":new Nr(_e.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Nr(_e.paint_symbol["icon-halo-blur"]),"icon-translate":new Or(_e.paint_symbol["icon-translate"]),"icon-translate-anchor":new Or(_e.paint_symbol["icon-translate-anchor"]),"text-opacity":new Nr(_e.paint_symbol["text-opacity"]),"text-color":new Nr(_e.paint_symbol["text-color"]),"text-halo-color":new Nr(_e.paint_symbol["text-halo-color"]),"text-halo-width":new Nr(_e.paint_symbol["text-halo-width"]),"text-halo-blur":new Nr(_e.paint_symbol["text-halo-blur"]),"text-translate":new Or(_e.paint_symbol["text-translate"]),"text-translate-anchor":new Or(_e.paint_symbol["text-translate-anchor"])}),layout:ms},ys=function(e){function t(t){e.call(this,t,gs)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t){e.prototype.recalculate.call(this,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))},t.prototype.getValueAndResolveTokens=function(e,t){var n,r=this.layout.get(e).evaluate(t,{}),i=this._unevaluatedLayout._values[e];return i.isDataDriven()||un(i.value)?r:(n=t.properties,r.replace(/{([^{}]+)}/g,function(e,t){return t in n?String(n[t]):""}))},t.prototype.createBucket=function(e){return new hs(e)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t}(Pr),vs={paint:new Dr({"background-color":new Or(_e.paint_background["background-color"]),"background-pattern":new Ir(_e.paint_background["background-pattern"]),"background-opacity":new Or(_e.paint_background["background-opacity"])})},bs=function(e){function t(t){e.call(this,t,vs)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Pr),Es={paint:new Dr({"raster-opacity":new Or(_e.paint_raster["raster-opacity"]),"raster-hue-rotate":new Or(_e.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Or(_e.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Or(_e.paint_raster["raster-brightness-max"]),"raster-saturation":new Or(_e.paint_raster["raster-saturation"]),"raster-contrast":new Or(_e.paint_raster["raster-contrast"]),"raster-resampling":new Or(_e.paint_raster["raster-resampling"]),"raster-fade-duration":new Or(_e.paint_raster["raster-fade-duration"])})},Ss=function(e){function t(t){e.call(this,t,Es)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Pr),Ts=function(e){function t(t){e.call(this,t,{}),this.implementation=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender||"3d"===this.implementation.renderingMode},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)},t.prototype.onAdd=function(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},t.prototype.onRemove=function(e){this.implementation.onRemove&&this.implementation.onRemove(e)},t}(Pr),As={circle:To,heatmap:Do,hillshade:Lo,fill:ba,"fill-extrusion":Na,line:Xa,symbol:ys,background:bs,raster:Ss};function ws(e){for(var t=0,n=0,r=0,i=e;r=0;d--){var _=a[d];if(!(p.w>_.w||p.h>_.h)){if(p.x=_.x,p.y=_.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===_.w&&p.h===_.h){var f=a.pop();d>1,u=-7,p=n?i-1:0,d=n?-1:1,_=e[t+p];for(p+=d,o=_&(1<<-u)-1,_>>=-u,u+=s;u>0;o=256*o+e[t+p],p+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(_?-1:1);a+=Math.pow(2,r),o-=c}return(_?-1:1)*a*Math.pow(2,o-r)},Ls=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,_=r?0:o-1,f=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?d/l:d*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[n+_]=255&s,_+=f,s/=256,i-=8);for(a=a<0;e[n+_]=255&a,_+=f,a/=256,c-=8);e[n+_-f]|=128*h},ks=Us;function Us(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}function Bs(e){return e.type===Us.Bytes?e.readVarint()+e.pos:e.pos+1}function Fs(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function zs(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function js(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function Xs(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Us.Varint=0,Us.Fixed64=1,Us.Bytes=2,Us.Fixed32=5,Us.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=$s(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Xs(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=$s(this.buf,this.pos)+4294967296*$s(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=$s(this.buf,this.pos)+4294967296*Xs(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Ps(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Ps(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return Fs(e,r,t);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return Fs(e,r,t);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return Fs(e,r,t);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return Fs(e,r,t);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return Fs(e,r,t);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return Fs(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,n){for(var r="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var n=Bs(this);for(e=e||[];this.pos127;);else if(t===Us.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Us.Fixed32)this.pos+=4;else{if(t!==Us.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&zs(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),Ls(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Ls(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&zs(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,Us.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){this.writeMessage(e,js,t)},writePackedSVarint:function(e,t){this.writeMessage(e,Gs,t)},writePackedBoolean:function(e,t){this.writeMessage(e,qs,t)},writePackedFloat:function(e,t){this.writeMessage(e,Ys,t)},writePackedDouble:function(e,t){this.writeMessage(e,Vs,t)},writePackedFixed32:function(e,t){this.writeMessage(e,Hs,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,Ws,t)},writePackedFixed64:function(e,t){this.writeMessage(e,Qs,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,Ks,t)},writeBytesField:function(e,t){this.writeTag(e,Us.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Us.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Us.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Us.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Us.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Us.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Us.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Us.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Us.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Us.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Js=3;function el(e,t,n){1===e&&n.readMessage(tl,t)}function tl(e,t,n){if(3===e){var r=n.readMessage(nl,{}),i=r.id,o=r.bitmap,a=r.width,s=r.height,l=r.left,c=r.top,u=r.advance;t.push({id:i,bitmap:new No({width:a+2*Js,height:s+2*Js},o),metrics:{width:a,height:s,left:l,top:c,advance:u}})}}function nl(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}var rl=Js,il=function(e,t,n){this.target=e,this.parent=t,this.mapId=n,this.callbacks={},this.callbackID=0,m(["receive"],this),this.target.addEventListener("message",this.receive,!1)};function ol(e,t,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}il.prototype.send=function(e,t,n,r){var i=n?this.mapId+":"+this.callbackID++:null;n&&(this.callbacks[i]=n);var o=[];this.target.postMessage({targetMapId:r,sourceMapId:this.mapId,type:e,id:String(i),data:ir(t,o)},o)},il.prototype.receive=function(e){var t,n=this,r=e.data,i=r.id;if(!r.targetMapId||this.mapId===r.targetMapId){var o=function(e,t){var r=[];n.target.postMessage({sourceMapId:n.mapId,type:"",id:String(i),error:e?ir(e):null,data:ir(t,r)},r)};if(""===r.type)t=this.callbacks[r.id],delete this.callbacks[r.id],t&&r.error?t(or(r.error)):t&&t(null,or(r.data));else if(void 0!==r.id&&this.parent[r.type])this.parent[r.type](r.sourceMapId,or(r.data),o);else if(void 0!==r.id&&this.parent.getWorkerSource){var a=r.type.split("."),s=or(r.data);this.parent.getWorkerSource(r.sourceMapId,a[0],s.source)[a[1]](s,o)}else this.parent[r.type](or(r.data))}},il.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var al=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};al.prototype.setNorthEast=function(e){return this._ne=e instanceof sl?new sl(e.lng,e.lat):sl.convert(e),this},al.prototype.setSouthWest=function(e){return this._sw=e instanceof sl?new sl(e.lng,e.lat):sl.convert(e),this},al.prototype.extend=function(e){var t,n,r=this._sw,i=this._ne;if(e instanceof sl)t=e,n=e;else{if(!(e instanceof al))return Array.isArray(e)?e.every(Array.isArray)?this.extend(al.convert(e)):this.extend(sl.convert(e)):this;if(t=e._sw,n=e._ne,!t||!n)return this}return r||i?(r.lng=Math.min(t.lng,r.lng),r.lat=Math.min(t.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new sl(t.lng,t.lat),this._ne=new sl(n.lng,n.lat)),this},al.prototype.getCenter=function(){return new sl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},al.prototype.getSouthWest=function(){return this._sw},al.prototype.getNorthEast=function(){return this._ne},al.prototype.getNorthWest=function(){return new sl(this.getWest(),this.getNorth())},al.prototype.getSouthEast=function(){return new sl(this.getEast(),this.getSouth())},al.prototype.getWest=function(){return this._sw.lng},al.prototype.getSouth=function(){return this._sw.lat},al.prototype.getEast=function(){return this._ne.lng},al.prototype.getNorth=function(){return this._ne.lat},al.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},al.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},al.prototype.isEmpty=function(){return!(this._sw&&this._ne)},al.convert=function(e){return!e||e instanceof al?e:new al(e)};var sl=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};function ll(e){return 2*Math.PI*6378137*Math.cos(e*Math.PI/180)}function cl(e){return(180+e)/360}function ul(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function pl(e,t){return e/ll(t)}function dl(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}sl.prototype.wrap=function(){return new sl(u(this.lng,-180,180),this.lat)},sl.prototype.toArray=function(){return[this.lng,this.lat]},sl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},sl.prototype.toBounds=function(e){var t=360*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new al(new sl(this.lng-n,this.lat-t),new sl(this.lng+n,this.lat+t))},sl.convert=function(e){if(e instanceof sl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new sl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new sl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var _l=function(e,t,n){void 0===n&&(n=0),this.x=+e,this.y=+t,this.z=+n};_l.fromLngLat=function(e,t){void 0===t&&(t=0);var n=sl.convert(e);return new _l(cl(n.lng),ul(n.lat),pl(t,n.lat))},_l.prototype.toLngLat=function(){return new sl(360*this.x-180,dl(this.y))},_l.prototype.toAltitude=function(){return this.z*ll(dl(this.y))};var fl=function(e,t,n){this.z=e,this.x=t,this.y=n,this.key=gl(0,e,t,n)};fl.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},fl.prototype.url=function(e,t){var n,r,i,o,a,s=(n=this.x,r=this.y,i=this.z,o=ol(256*n,256*(r=Math.pow(2,i)-r-1),i),a=ol(256*(n+1),256*(r+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),l=function(e,t,n){for(var r,i="",o=e;o>0;o--)i+=(t&(r=1<this.canonical.z?new ml(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ml(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},ml.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},ml.prototype.children=function(e){if(this.overscaledZ>=e)return[new ml(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new ml(t,this.wrap,t,n,r),new ml(t,this.wrap,t,n+1,r),new ml(t,this.wrap,t,n,r+1),new ml(t,this.wrap,t,n+1,r+1)]},ml.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+this.border||t<-this.border||t>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(t+this.border)*this.stride+(e+this.border)},yl.prototype._unpackMapbox=function(e,t,n){return(256*e*256+256*t+n)/10-1e4},yl.prototype._unpackTerrarium=function(e,t,n){return 256*e+t+n/256-32768},yl.prototype.getPixels=function(){return new Ro({width:this.dim+2*this.border,height:this.dim+2*this.border},new Uint8Array(this.data.buffer))},yl.prototype.backfillBorder=function(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var r=t*this.dim,i=t*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}for(var s=c(r,-this.border,this.dim+this.border),l=c(i,-this.border,this.dim+this.border),u=c(o,-this.border,this.dim+this.border),p=c(a,-this.border,this.dim+this.border),d=-t*this.dim,_=-n*this.dim,f=u;f=0&&l[3]>=0&&this.grid.insert(o,l[0],l[1],l[2],l[3])}},Al.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new za.VectorTile(new ks(this.rawTileData)).layers,this.sourceLayerCoder=new bl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Al.prototype.query=function(e,t,n){var r=this;this.loadVTLayers();for(var i=e.params||{},o=Vi/e.tileSize/e.scale,a=wn(i.filter),s=e.queryGeometry,l=e.queryPadding*o,c=1/0,u=1/0,p=-1/0,d=-1/0,_=0;_=0)return!0;return!1}(o,l)){var c=this.sourceLayerCoder.decode(n),u=this.vtLayers[c].feature(r);if(i(new vr(this.tileID.overscaledZ),u))for(var p=0;p>l.z,u=new i(l.x*c,l.y*c),p=new i(u.x+c,u.y+c),d=this.segments.prepareSegment(4,n,r);n.emplaceBack(u.x,u.y,u.x,u.y),n.emplaceBack(p.x,u.y,p.x,u.y),n.emplaceBack(u.x,p.y,u.x,p.y),n.emplaceBack(p.x,p.y,p.x,p.y);var _=d.vertexLength;r.emplaceBack(_,_+1,_+2),r.emplaceBack(_+1,_+2,_+3),d.vertexLength+=4,d.primitiveLength+=2}this.maskedBoundsBuffer=t.createVertexBuffer(n,vl.members),this.maskedIndexBuffer=t.createIndexBuffer(r)}},xl.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},xl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},xl.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var n=function(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(e,n,r,i){var o=r||i;return t[n]=!o||o.toLowerCase(),""}),t["max-age"]){var n=parseInt(t["max-age"],10);isNaN(n)?delete t["max-age"]:t["max-age"]=n}return t}(e.cacheControl);n["max-age"]&&(this.expirationTime=Date.now()+1e3*n["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(t)if(this.expirationTime=0&&r>=e&&Nl[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)},Ol.prototype.substring=function(e,t){var n=new Ol;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n},Ol.prototype.toString=function(){return this.text},Ol.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce(function(t,n){return Math.max(t,e.sections[n].scale)},0)};var Nl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Rl={};function Il(e,t,n,r){var i=Math.pow(e-t,2);return r?e=2||512===n?"@2x":"",o=D.supported?".webp":"$1";return r.path=r.path.replace(j,""+i+o),r.path="/v4"+r.path,U(r)},e.postTurnstileEvent=$,e.postMapLoadEvent=X,e.OverscaledTileID=ml,e.EXTENT=Vi,e.CanonicalTileID=fl,e.StructArrayLayout4i8=jr,e.rasterBoundsAttributes=vl,e.SegmentVector=Ei,e.MercatorCoordinate=_l,e.getVideo=function(e,t){var n,r,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){t(null,i)};for(var o=0;o0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o),e},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.cross=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e},e.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},e.len=mo,e.forEach$1=go,e.UniformColor=Ii,e.clamp=c,e.StructArrayLayout2i4=zr,e.StructArrayLayout2ui4=ri,e.StructArrayLayout3ui6=ni,e.StructArrayLayout1ui2=ii,e.LngLat=sl,e.mercatorZfromAltitude=pl,e.wrap=u,e.UnwrappedTileID=hl,e.create$4=function(){var e=new co(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},e.rotate=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l,e},e.ease=l,e.bezier=s,e.config=M,e.EvaluationParameters=vr,e.webpSupported=D,e.version="0.52.0",e.setRTLTextPlugin=function(e,t){if(fr)throw new Error("setRTLTextPlugin cannot be called multiple times.");fr=!0,hr=I.resolveURL(e),_r=function(e){e?(fr=!1,hr=null,t&&t(e)):mr=!0},gr.fire(new ue("pluginAvailable",{pluginURL:hr,completionCallback:_r}))},e.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},e.featureFilter=wn,e.Anchor=ss,e.GLYPH_PBF_BORDER=rl,e.shapeText=function(e,t,n,r,i,o,a,s,l,c,u){var p=Ol.fromFeature(e,n);u===Cl.vertical&&p.verticalizePunctuation();var d,_=[],f={positionedGlyphs:_,text:p,top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:u},h=yr.processBidirectionalText,m=yr.processStyledBidirectionalText;if(h&&1===p.sections.length){d=[];for(var g=0,y=h(p.toString(),Pl(p,s,r,t));g-n/2;){if(--a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;for(var l=[],c=0;sr;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=p.dist(d)}return!0}function o(e){for(var t=0,n=0;nf){var v=(f-_)/y,b=e.number(m.x,g.x,v),E=e.number(m.y,g.y,v),S=new e.Anchor(b,E,g.angleTo(m),h);return S._round(),!p||i(t,S,d,p,n)?S:void 0}_+=y}}function c(t,n,r,l,c,u,p,d,_){var f=a(l,u,p),h=s(l,c),m=h*p,g=0===t[0].x||t[0].x===_||0===t[0].y||t[0].y===_;return n-m=0&&A=0&&w=0&&m+_<=f){var x=new e.Anchor(A,w,S,y);x._round(),s&&!i(n,x,c,s,l)||g.push(x)}}h+=E}return p||g.length||u||(g=t(n,h/2,a,s,l,c,u,!0,d)),g}(t,g?n/2*d%n:(h/2+2*u)*p*d%n,n,f,r,m,g,!1,_)}r.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},r.prototype.update=function(t,r){for(var i=this,o=0,a=t;o0&&(g=Math.max(10*l,g),this._addLineCollisionCircles(t,n,r,r.segment,y,g,i,o,a,p))}else{if(d){var v=new e.Point(h,_),b=new e.Point(m,_),E=new e.Point(h,f),S=new e.Point(m,f),T=d*Math.PI/180;v._rotate(T),b._rotate(T),E._rotate(T),S._rotate(T),h=Math.min(v.x,b.x,E.x,S.x),m=Math.max(v.x,b.x,E.x,S.x),_=Math.min(v.y,b.y,E.y,S.y),f=Math.max(v.y,b.y,E.y,S.y)}t.emplaceBack(r.x,r.y,h,_,m,f,i,o,a,0,0)}this.boxEndIndex=t.length};u.prototype._addLineCollisionCircles=function(e,t,n,r,i,o,a,s,l,c){var u=o/2,p=Math.floor(i/u)||1,d=1+.4*Math.log(c)/Math.LN2,_=Math.floor(p*d/2),f=-o/2,h=n,m=r+1,g=f,y=-i/2,v=y-i/4;do{if(--m<0){if(g>y)return;m=0;break}g-=t[m].dist(h),h=t[m]}while(g>v);for(var b=t[m].dist(t[m+1]),E=-_;Ei&&(T+=S-i),!(T=t.length)return;b=t[m].dist(t[m+1])}var A=T-g,w=t[m],x=t[m+1].sub(w)._unit()._mult(A)._add(w)._round(),C=Math.abs(T-f)0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function f(e,t){return et?1:0}function h(t,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,l=t[0],c=0;ca)&&(a=u.x),(!c||u.y>s)&&(s=u.y)}var d=a-i,_=s-o,f=Math.min(d,_),h=f/2,y=new p(null,m);if(0===f)return new e.Point(i,o);for(var v=i;vE.d||!E.d)&&(E=T,r&&console.log("found best %d after %d probes",Math.round(1e4*T.d)/1e4,S)),T.max-E.d<=n||(h=T.h/2,y.push(new g(T.p.x-h,T.p.y-h,h,t)),y.push(new g(T.p.x+h,T.p.y-h,h,t)),y.push(new g(T.p.x-h,T.p.y+h,h,t)),y.push(new g(T.p.x+h,T.p.y+h,h,t)),S+=4)}return r&&(console.log("num probes: "+S),console.log("best distance: "+E.d)),E.p}function m(e,t){return t.max-e.max}function g(t,n,r,i){this.p=new e.Point(t,n),this.h=r,this.d=function(t,n){for(var r=!1,i=1/0,o=0;ot.y!=p.y>t.y&&t.x<(p.x-u.x)*(t.y-u.y)/(p.y-u.y)+u.x&&(r=!r),i=Math.min(i,e.distToSegmentSquared(t,u,p))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}_.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,o=t[i];if(n(r,o)>=0)break;t[e]=o,e=i}t[e]=r},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e=0)break;t[e]=s,e=o}t[e]=i}},p.default=d;var y=e.createCommonjsModule(function(e){e.exports=function(e,t){var n,r,i,o,a,s,l,c;for(n=3&e.length,r=e.length-n,i=t,a=3432918353,s=461845907,c=0;c>>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,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.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}}),v=e.createCommonjsModule(function(e){e.exports=function(e,t){for(var n,r=e.length,i=t^r,o=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}}),b=y,E=y,S=v;function T(t,n,r,i,o,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=e.EXTENT/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.functionType){var p=t.textSizeData.zoomRange,d=p.min,_=p.max;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new e.EvaluationParameters(d)),c["text-size"].possiblyEvaluate(new e.EvaluationParameters(_))]}if("composite"===t.iconSizeData.functionType){var f=t.iconSizeData.zoomRange,h=f.min,m=f.max;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new e.EvaluationParameters(h)),c["icon-size"].possiblyEvaluate(new e.EvaluationParameters(m))]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),u.textMaxSize=c["text-size"].possiblyEvaluate(new e.EvaluationParameters(18));for(var g=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),v=l.get("text-keep-upright"),b=0,E=t.features;b=e.EXTENT||l.y<0||l.y>=e.EXTENT||function(t,n,r,i,o,a,s,l,c,p,d,_,f,h,m,g,y,v,E,S,T){var A,C,O=t.addToLineVertexArray(n,r),N=0,R=0,I=0,M=b(i.horizontal?i.horizontal.text:""),D=[];if(i.horizontal){var P=a.layout.get("text-rotate").evaluate(E,{});A=new u(s,r,n,l,c,p,i.horizontal,d,_,f,t.overscaling,P),R+=x(t,n,i.horizontal,a,f,E,h,O,i.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,D,S,T),i.vertical&&(I+=x(t,n,i.vertical,a,f,E,h,O,e.WritingMode.vertical,D,S,T))}var L=A?A.boxStartIndex:t.collisionBoxArray.length,k=A?A.boxEndIndex:t.collisionBoxArray.length;if(o){var U=function(t,n,r,i,o,a){var s,l,c,u,p=n.image,d=r.layout,_=n.top-1/p.pixelRatio,f=n.left-1/p.pixelRatio,h=n.bottom+1/p.pixelRatio,m=n.right+1/p.pixelRatio;if("none"!==d.get("icon-text-fit")&&o){var g=m-f,y=h-_,v=d.get("text-size").evaluate(a,{})/24,b=o.left*v,E=o.right*v,S=o.top*v,T=E-b,A=o.bottom*v-S,w=d.get("icon-text-fit-padding")[0],x=d.get("icon-text-fit-padding")[1],C=d.get("icon-text-fit-padding")[2],O=d.get("icon-text-fit-padding")[3],N="width"===d.get("icon-text-fit")?.5*(A-y):0,R="height"===d.get("icon-text-fit")?.5*(T-g):0,I="width"===d.get("icon-text-fit")||"both"===d.get("icon-text-fit")?T:g,M="height"===d.get("icon-text-fit")||"both"===d.get("icon-text-fit")?A:y;s=new e.Point(b+R-O,S+N-w),l=new e.Point(b+R+x+I,S+N-w),c=new e.Point(b+R+x+I,S+N+C+M),u=new e.Point(b+R-O,S+N+C+M)}else s=new e.Point(f,_),l=new e.Point(m,_),c=new e.Point(m,h),u=new e.Point(f,h);var D=r.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(D){var P=Math.sin(D),L=Math.cos(D),k=[L,-P,P,L];s._matMult(k),l._matMult(k),u._matMult(k),c._matMult(k)}return[{tl:s,tr:l,bl:u,br:c,tex:p.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,o,a,0,i.horizontal,E),B=a.layout.get("icon-rotate").evaluate(E,{});C=new u(s,r,n,l,c,p,o,m,g,!1,t.overscaling,B),N=4*U.length;var F=t.iconSizeData,z=null;"source"===F.functionType?(z=[e.SIZE_PACK_FACTOR*a.layout.get("icon-size").evaluate(E,{})])[0]>w&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===F.functionType&&((z=[e.SIZE_PACK_FACTOR*T.compositeIconSizes[0].evaluate(E,{}),e.SIZE_PACK_FACTOR*T.compositeIconSizes[1].evaluate(E,{})])[0]>w||z[1]>w)&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,U,z,v,y,E,!1,n,O.lineStartIndex,O.lineLength)}var j=C?C.boxStartIndex:t.collisionBoxArray.length,G=C?C.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=e.SymbolBucket.MAX_GLYPHS&&e.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(n.x,n.y,D.length>0?D[0]:-1,D.length>1?D[1]:-1,M,L,k,j,G,l,R,I,N,0)}(t,l,s,r,i,t.layers[0],t.collisionBoxArray,n.index,n.sourceLayerIndex,t.index,y,T,N,f,E,A,R,m,n,o,a)};if("line"===I)for(var P=0,L=function(t,n,r,i,o){for(var a=[],s=0;s=i&&d.x>=i||(p.x>=i?p=new e.Point(i,p.y+(d.y-p.y)*((i-p.x)/(d.x-p.x)))._round():d.x>=i&&(d=new e.Point(i,p.y+(d.y-p.y)*((i-p.x)/(d.x-p.x)))._round()),p.y>=o&&d.y>=o||(p.y>=o?p=new e.Point(p.x+(d.x-p.x)*((o-p.y)/(d.y-p.y)),o)._round():d.y>=o&&(d=new e.Point(p.x+(d.x-p.x)*((o-p.y)/(d.y-p.y)),o)._round()),c&&p.equals(c[c.length-1])||(c=[p],a.push(c)),c.push(d)))))}return a}(n.geometry,0,0,e.EXTENT,e.EXTENT);P1){var V=l(Y,O,r.vertical||r.horizontal,i,24,v);V&&D(Y,V)}}else if("Polygon"===n.type)for(var q=0,H=e.classifyRings(n.geometry,0);qw&&e.warnOnce(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===f.functionType&&((h=[e.SIZE_PACK_FACTOR*d.compositeTextSizes[0].evaluate(a,{}),e.SIZE_PACK_FACTOR*d.compositeTextSizes[1].evaluate(a,{})])[0]>w||h[1]>w)&&e.warnOnce(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,_,h,s,o,a,c,n,l.lineStartIndex,l.lineLength),u.push(t.text.placedSymbolArray.length-1),4*_.length}function C(e,t,n,r){var i=e.compareText;if(t in i){for(var o=i[t],a=o.length-1;a>=0;a--)if(r.dist(o[a])=w.maxzoom||"none"!==w.visibility&&(R(A,o.zoom),(d[w.id]=w.createBucket({index:s.bucketLayerIDs.length,layers:A,zoom:o.zoom,pixelRatio:o.pixelRatio,overscaling:o.overscaling,collisionBoxArray:o.collisionBoxArray,sourceLayerIndex:g,sourceID:o.source})).populate(y,_),s.bucketLayerIDs.push(A.map(function(e){return e.id})))}}}var x=e.mapObject(_.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(x).length?r.send("getGlyphs",{uid:this.uid,stacks:x},function(e,t){l||(l=e,c=t,I.call(o))}):c={};var C=Object.keys(_.iconDependencies);C.length?r.send("getImages",{icons:C},function(e,t){l||(l=e,u=t,I.call(o))}):u={};var N=Object.keys(_.patternDependencies);function I(){if(l)return i(l);if(c&&u&&p){var t=new O(c),n=new e.ImageAtlas(u,p);for(var r in d){var o=d[r];o instanceof e.SymbolBucket?(R(o.layers,this.zoom),T(o,c,t.positions,u,n.iconPositions,this.showCollisionBoxes)):o.hasPattern&&(o instanceof e.LineBucket||o instanceof e.FillBucket||o instanceof e.FillExtrusionBucket)&&(R(o.layers,this.zoom),o.addFeatures(_,n.patternPositions))}this.status="done",i(null,{buckets:e.values(d).filter(function(e){return!e.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:n,glyphMap:this.returnDependencies?c:null,iconMap:this.returnDependencies?u:null,glyphPositions:this.returnDependencies?t.positions:null})}}N.length?r.send("getImages",{icons:N},function(e,t){l||(l=e,p=t,I.call(o))}):p={},I.call(this)};var I="undefined"!=typeof performance,M={getEntriesByName:function(e){return!!(I&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(e)},mark:function(e){return!!(I&&performance&&performance.mark)&&performance.mark(e)},measure:function(e,t,n){return!!(I&&performance&&performance.measure)&&performance.measure(e,t,n)},clearMarks:function(e){return!!(I&&performance&&performance.clearMarks)&&performance.clearMarks(e)},clearMeasures:function(e){return!!(I&&performance&&performance.clearMeasures)&&performance.clearMeasures(e)}},D=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},M.mark(this._marks.start)};function P(t,n){var r=e.getArrayBuffer(t.request,function(t,r,i,o){t?n(t):r&&n(null,{vectorTile:new e.mvt.VectorTile(new e.Protobuf(r)),rawData:r,cacheControl:i,expires:o})});return function(){r.cancel(),n()}}D.prototype.finish=function(){M.mark(this._marks.end);var e=M.getEntriesByName(this._marks.measure);return 0===e.length&&(M.measure(this._marks.measure,this._marks.start,this._marks.end),e=M.getEntriesByName(this._marks.measure),M.clearMarks(this._marks.start),M.clearMarks(this._marks.end),M.clearMeasures(this._marks.measure)),e},M.Performance=D;var L=function(e,t,n){this.actor=e,this.layerIndex=t,this.loadVectorData=n||P,this.loading={},this.loaded={}};L.prototype.loadTile=function(t,n){var r=this,i=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new M.Performance(t.request),a=this.loading[i]=new N(t);a.abort=this.loadVectorData(t,function(t,s){if(delete r.loading[i],t||!s)return a.status="done",r.loaded[i]=a,n(t);var l=s.rawData,c={};s.expires&&(c.expires=s.expires),s.cacheControl&&(c.cacheControl=s.cacheControl);var u={};if(o){var p=o.finish();p&&(u.resourceTiming=JSON.parse(JSON.stringify(p)))}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,r.layerIndex,r.actor,function(t,r){if(t||!r)return n(t);n(null,e.extend({rawTileData:l.slice(0)},r,c,u))}),r.loaded=r.loaded||{},r.loaded[i]=a})},L.prototype.reloadTile=function(e,t){var n=this.loaded,r=e.uid,i=this;if(n&&n[r]){var o=n[r];o.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,n){var r=o.reloadCallback;r&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,i.actor,r)),t(e,n)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.actor,a):a())}},L.prototype.abortTile=function(e,t){var n=this.loading,r=e.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),t()},L.prototype.removeTile=function(e,t){var n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()};var k=function(){this.loaded={}};k.prototype.loadTile=function(t,n){var r=t.uid,i=t.encoding,o=t.rawImageData,a=new e.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=a,n(null,a)},k.prototype.removeTile=function(e){var t=this.loaded,n=e.uid;t&&t[n]&&delete t[n]};var U={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function B(e){var t=0;if(e&&e.length>0){t+=Math.abs(F(e[0]));for(var n=1;n2){for(a=0;a=0}(e)===t?e:e.reverse()}var q=e.mvt.VectorTileFeature.prototype.toGeoJSON,H=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};H.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],n=0,r=this._feature.geometry;n>31}function se(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,o=0,a=n.length,s=0;s>1;!function e(t,n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),p=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,n,r,Math.max(i,Math.floor(r-l*u/s+p)),Math.min(o,Math.floor(r+(s-l)*u/s+p)),a)}var d=n[2*r+a],_=i,f=o;for(ce(t,n,i,r),n[2*o+a]>d&&ce(t,n,i,o);_d;)f--}n[2*i+a]===d?ce(t,n,i,f):ce(t,n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}(t,n,s,i,o,a%2),e(t,n,r,i,s-1,a+1),e(t,n,r,s+1,o,a+1)}}(a,s,r,0,a.length-1,0)};fe.prototype.range=function(e,t,n,r){return function(e,t,n,r,i,o,a){for(var s,l,c=[0,e.length-1,0],u=[];c.length;){var p=c.pop(),d=c.pop(),_=c.pop();if(d-_<=a)for(var f=_;f<=d;f++)s=t[2*f],l=t[2*f+1],s>=n&&s<=i&&l>=r&&l<=o&&u.push(e[f]);else{var h=Math.floor((_+d)/2);s=t[2*h],l=t[2*h+1],s>=n&&s<=i&&l>=r&&l<=o&&u.push(e[h]);var m=(p+1)%2;(0===p?n<=s:r<=l)&&(c.push(_),c.push(h-1),c.push(m)),(0===p?i>=s:o>=l)&&(c.push(h+1),c.push(d),c.push(m))}}return u}(this.ids,this.coords,e,t,n,r,this.nodeSize)},fe.prototype.within=function(e,t,n){return function(e,t,n,r,i,o){for(var a=[0,e.length-1,0],s=[],l=i*i;a.length;){var c=a.pop(),u=a.pop(),p=a.pop();if(u-p<=o)for(var d=p;d<=u;d++)pe(t[2*d],t[2*d+1],n,r)<=l&&s.push(e[d]);else{var _=Math.floor((p+u)/2),f=t[2*_],h=t[2*_+1];pe(f,h,n,r)<=l&&s.push(e[_]);var m=(c+1)%2;(0===c?n-i<=f:r-i<=h)&&(a.push(p),a.push(_-1),a.push(m)),(0===c?n+i>=f:r+i>=h)&&(a.push(_+1),a.push(u),a.push(m))}}return s}(this.ids,this.coords,e,t,n,this.nodeSize)};var he={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(e){return e}},me=function(e){this.options=Te(Object.create(he),e),this.trees=new Array(this.options.maxZoom+1)};function ge(e,t,n,r,i){return{x:e,y:t,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function ye(e,t){var n=e.geometry.coordinates,r=n[0],i=n[1];return{x:Ee(r),y:Se(i),zoom:1/0,index:t,parentId:-1}}function ve(e){return{type:"Feature",id:e.id,properties:be(e),geometry:{type:"Point",coordinates:[(r=e.x,360*(r-.5)),(t=e.y,n=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var t,n,r}function be(e){var t=e.numPoints,n=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return Te(Te({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function Ee(e){return e/360+.5}function Se(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function Te(e,t){for(var n in t)e[n]=t[n];return e}function Ae(e){return e.x}function we(e){return e.y}function xe(e,t,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var l=((e-n)*a+(t-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return(a=e-n)*a+(s=t-r)*s}function Ce(e,t,n,r){var i={id:void 0===e?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)Oe(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r0&&(a+=r?(i*c-l*o)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-o,2))),i=l,o=c}var u=t.length-3;t[2]=1,function e(t,n,r,i){for(var o,a=i,s=r-n>>1,l=r-n,c=t[n],u=t[n+1],p=t[r],d=t[r+1],_=n+3;_a)o=_,a=f;else if(f===a){var h=Math.abs(_-s);hi&&(o-n>3&&e(t,n,o,i),t[o+2]=a,r-o>3&&e(t,o,r,i))}(t,0,u,n),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function Me(e,t,n,r){for(var i=0;i1?1:n}function Le(e,t,n,r,i,o,a,s){if(r/=t,o>=(n/=t)&&a=r)return null;for(var l=[],c=0;c=n&&f=r)){var h=[];if("Point"===d||"MultiPoint"===d)ke(p,h,n,r,i);else if("LineString"===d)Ue(p,h,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===d)Fe(p,h,n,r,i,!1);else if("Polygon"===d)Fe(p,h,n,r,i,!0);else if("MultiPolygon"===d)for(var m=0;m=n&&a<=r&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function Ue(e,t,n,r,i,o,a){for(var s,l,c=Be(e),u=0===i?je:Ge,p=e.start,d=0;dn&&(l=u(c,_,f,m,g,n),a&&(c.start=p+s*l)):y>r?v=n&&(l=u(c,_,f,m,g,n),b=!0),v>r&&y<=r&&(l=u(c,_,f,m,g,r),b=!0),!o&&b&&(a&&(c.end=p+s*l),t.push(c),c=Be(e)),a&&(p+=s)}var E=e.length-3;_=e[E],f=e[E+1],h=e[E+2],(y=0===i?_:f)>=n&&y<=r&&ze(c,_,f,h),E=c.length-3,o&&E>=3&&(c[E]!==c[0]||c[E+1]!==c[1])&&ze(c,c[0],c[1],c[2]),c.length&&t.push(c)}function Be(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Fe(e,t,n,r,i,o){for(var a=0;aa.maxX&&(a.maxX=u),p>a.maxY&&(a.maxY=p)}return a}function Qe(e,t,n,r){var i=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&t.size<(i?a:r))n.numPoints+=t.length/3;else{for(var s=[],l=0;la)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,o=i-2;r0===t)for(r=0,i=e.length;r24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var r=0;r=r;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new fe(s,Ae,we,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this},me.prototype.getClusters=function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],t),s=this.getClusters([-180,r,i,o],t);return a.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,p=l.range(Ee(n),Se(o),Ee(i),Se(r));u>5,n=e%32,r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[t];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],l=0,c=i.within(o.x,o.y,a);l1&&console.time("creation"),d=this.tiles[p]=We(e,t,n,r,l),this.tileCoords.push({z:t,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var _="z"+t;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(d.source=e,i){if(t===l.maxZoom||t===i)continue;var f=1<1&&console.time("clipping");var h,m,g,y,v,b,E=.5*l.buffer/l.extent,S=.5-E,T=.5+E,A=1+E;h=m=g=y=null,v=Le(e,u,n-E,n+T,0,d.minX,d.maxX,l),b=Le(e,u,n+S,n+A,0,d.minX,d.maxX,l),e=null,v&&(h=Le(v,u,r-E,r+T,1,d.minY,d.maxY,l),m=Le(v,u,r+S,r+A,1,d.minY,d.maxY,l),v=null),b&&(g=Le(b,u,r-E,r+T,1,d.minY,d.maxY,l),y=Le(b,u,r+S,r+A,1,d.minY,d.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(h||[],t+1,2*n,2*r),s.push(m||[],t+1,2*n,2*r+1),s.push(g||[],t+1,2*n+1,2*r),s.push(y||[],t+1,2*n+1,2*r+1)}}},$e.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,o=r.debug;if(e<0||e>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var l,c=e,u=t,p=n;!l&&c>0;)c--,u=Math.floor(u/2),p=Math.floor(p/2),l=this.tiles[Ze(c,u,p)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,p),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,p,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?qe(this.tiles[s],i):null):null};var Je=function(t){function n(e,n,r){t.call(this,e,n,Xe),r&&(this.loadGeoJSON=r)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var t=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var r=!!(n&&n.request&&n.request.collectResourceTiming)&&new M.Performance(n.request);this.loadGeoJSON(n,function(i,o){if(i||!o)return t(i);if("object"!=typeof o)return t(new Error("Input data is not a valid GeoJSON object."));!function e(t,n){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(G(e,n)),t;case"Feature":return t.geometry=e(t.geometry,n),t;case"Polygon":case"MultiPolygon":return function(e,t){return"Polygon"===e.type?e.coordinates=Y(e.coordinates,t):"MultiPolygon"===e.type&&(e.coordinates=e.coordinates.map(G(Y,t))),e}(t,n);default:return t}}(o,!0);try{e._geoJSONIndex=n.cluster?new me(n.superclusterOptions).load(o.features):new $e(o,n.geojsonVtOptions)}catch(i){return t(i)}e.loaded={};var a={};if(r){var s=r.finish();s&&(a.resourceTiming={},a.resourceTiming[n.source]=JSON.parse(JSON.stringify(s)))}t(null,a)})}},n.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},n.prototype.reloadTile=function(e,n){var r=this.loaded,i=e.uid;return r&&r[i]?t.prototype.reloadTile.call(this,e,n):this.loadTile(e,n)},n.prototype.loadGeoJSON=function(t,n){if(t.request)e.getJSON(t.request,n);else{if("string"!=typeof t.data)return n(new Error("Input data is not a valid GeoJSON object."));try{return n(null,JSON.parse(t.data))}catch(e){return n(new Error("Input data is not a valid GeoJSON object."))}}},n.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},n.prototype.getClusterExpansionZoom=function(e,t){t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))},n.prototype.getClusterChildren=function(e,t){t(null,this._geoJSONIndex.getChildren(e.clusterId))},n.prototype.getClusterLeaves=function(e,t){t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))},n}(L),et=function(t){var n=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.workerSourceTypes={vector:L,geojson:Je},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(n.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');n.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isLoaded())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}};return et.prototype.setReferrer=function(e,t){this.referrer=t},et.prototype.setLayers=function(e,t,n){this.getLayerIndex(e).replace(t),n()},et.prototype.updateLayers=function(e,t,n){this.getLayerIndex(e).update(t.layers,t.removedIds),n()},et.prototype.loadTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).loadTile(t,n)},et.prototype.loadDEMTile=function(e,t,n){this.getDEMWorkerSource(e,t.source).loadTile(t,n)},et.prototype.reloadTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).reloadTile(t,n)},et.prototype.abortTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).abortTile(t,n)},et.prototype.removeTile=function(e,t,n){this.getWorkerSource(e,t.type,t.source).removeTile(t,n)},et.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)},et.prototype.removeSource=function(e,t,n){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var r=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,n):n()}},et.prototype.loadWorkerSource=function(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}},et.prototype.loadRTLTextPlugin=function(t,n,r){try{e.plugin.isLoaded()||(this.self.importScripts(n),r(e.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+n)))}catch(e){r(e.toString())}},et.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new r),t},et.prototype.getWorkerSource=function(e,t,n){var r=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){var i={send:function(t,n,i){r.actor.send(t,n,i,e)}};this.workerSources[e][t][n]=new this.workerSourceTypes[t](i,this.getLayerIndex(e))}return this.workerSources[e][t][n]},et.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new k),this.demWorkerSources[e][t]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new et(self)),et}),r(0,function(e){var t=e.createCommonjsModule(function(e){function t(e){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,n=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(n);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(e){return void 0===n[e]&&(n[e]=function(e){var n=document.createElement("canvas"),r=Object.create(t.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,n.probablySupportsContext?n.probablySupportsContext("webgl",r)||n.probablySupportsContext("experimental-webgl",r):n.supportsContext?n.supportsContext("webgl",r)||n.supportsContext("experimental-webgl",r):n.getContext("webgl",r)||n.getContext("experimental-webgl",r)}(e)),n[e]}(e&&e.failIfMajorPerformanceCaveat))}e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t);var n={};t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),n={create:function(t,n,r){var i=e.window.document.createElement(t);return n&&(i.className=n),r&&r.appendChild(i),i},createNS:function(t,n){return e.window.document.createElementNS(t,n)}},r=e.window.document?e.window.document.documentElement.style:null;function i(e){if(!r)return null;for(var t=0;t=0?0:t.button},n.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=function(){this.images={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0};p.prototype.isLoaded=function(){return this.loaded},p.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,n=this.requestors;t=0?1.2:1))}function h(e,t,n,r,i,o,a){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else{var l=o.requests[s];l||(l=o.requests[s]=[],g.loadGlyphRange(n,s,r.url,r.requestTransform,function(e,t){if(t)for(var n in t)o.glyphs[+n]=t[+n];for(var r=0,i=l;rthis.height)return e.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=r&&t.x=i&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+10&&(r.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",r))}})},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setData=function(t){var n=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(t){if(t)n.fire(new e.ErrorEvent(t));else{var r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new e.Event("data",r))}}),this},n.prototype.getClusterExpansionZoom=function(e,t){return this.dispatcher.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t,this.workerID),this},n.prototype.getClusterChildren=function(e,t){return this.dispatcher.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t,this.workerID),this},n.prototype.getClusterLeaves=function(e,t,n,r){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:n},r,this.workerID),this},n.prototype._updateWorkerData=function(t){var n=this,r=e.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.workerID=this.dispatcher.send(this.type+".loadData",r,function(e,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.dispatcher.send(n.type+".coalesce",{source:r.source},null,n.workerID),t(e))},this.workerID)},n.prototype.loadTile=function(t,n){var r=this,i=void 0===t.workerID?"loadTile":"reloadTile",o={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(i,o,function(e,o){return t.unloadVectorData(),t.aborted?n(null):e?n(e):(t.loadVectorData(o,r.map.painter,"reloadTile"===i),n(null))},this.workerID)},n.prototype.abortTile=function(e){e.aborted=!0},n.prototype.unloadTile=function(e){e.unloadVectorData(),this.dispatcher.send("removeTile",{uid:e.uid,type:this.type,source:this.id},null,e.workerID)},n.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID)},n.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(e.Evented),N=function(t){function n(e,n,r,i){t.call(this),this.id=e,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(i),this.options=n}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.load=function(t,n){var r=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._transformRequest(this.url,e.ResourceType.Image),function(i,o){i?r.fire(new e.ErrorEvent(i)):o&&(r.image=o,t&&(r.coordinates=t),n&&n(),r._finishLoading())})},n.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,function(){t.texture=null}),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(e){this.map=e,this.load()},n.prototype.setCoordinates=function(t){var n=this;this.coordinates=t;var r=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0,s=t;athis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},k.prototype.has=function(e){return e.wrapped().key in this.data},k.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},k.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},k.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},k.prototype.remove=function(e,t){if(!this.has(e))return this;var n=e.wrapped().key,r=void 0===t?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},k.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this};var U=function(e,t,n){this.context=e;var r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},U.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var B={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},F=function(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;var i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};F.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},F.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},F.prototype.enableAttributes=function(e,t){for(var n=0;n1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(e){return this.getTileByID(e.key)},n.prototype.getTileByID=function(e){return this._tiles[e]},n.prototype.getZoom=function(e){return e.zoom+e.scaleZoom(e.tileSize/this._source.tileSize)},n.prototype._retainLoadedChildren=function(e,t,n,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>t+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>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){r[a.key]=a;break}}}},n.prototype.findLoadedParent=function(e,t){for(var n=e.overscaledZ-1;n>=t;n--){var r=e.scaledTo(n);if(!r)return;var i=String(r.key),o=this._tiles[i];if(o&&o.hasData())return o;if(this._cache.has(r))return this._cache.get(r)}},n.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),n=Math.floor(5*t),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,n=Math.round(t);if(this._prevLng=e,n){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+n),r[o.tileID.key]=o}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},n.prototype.update=function(t){var r=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)}):(i=t.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(e){return r._source.hasTile(e)}))):i=[];var o=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(t)),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,o);if(Ne(this._source.type)){for(var c={},u={},p=0,d=Object.keys(l);pthis._source.maxzoom){var m=f.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){r[m.key]=m;continue}}else{var y=f.children(this._source.maxzoom);if(r[y[0].key]&&r[y[1].key]&&r[y[2].key]&&r[y[3].key])continue}for(var v=h.wasRequested(),b=f.overscaledZ-1;b>=o;--b){var E=f.scaledTo(b);if(i[E.key])break;if(i[E.key]=!0,!(h=this.getTile(E))&&v&&(h=this._addTile(E)),h&&(r[E.key]=E,v=h.wasRequested(),h.hasData()))break}}}return r},n.prototype._addTile=function(t){var n=this._tiles[t.key];if(n)return n;(n=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));var r=Boolean(n);return r||(n=new e.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n?(n.uses++,this._tiles[t.key]=n,r||this._source.fire(new e.Event("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n):null},n.prototype._setTileReloadTimer=function(e,t){var n=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout(function(){n._reloadTile(e,"expired"),delete n._timers[e]},r))},n.prototype._removeTile=function(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},n.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},n.prototype.tilesIn=function(t,n){for(var r=[],i=this.getIds(),o=1/0,a=1/0,s=-1/0,l=-1/0,c=0;c=0&&m[1].y+h>=0){for(var g=[],y=0;y=e.browser.now())return!0}return!1},n.prototype.setFeatureState=function(e,t,n){e=e||"_geojsonTileLayer",this._state.updateState(e,t,n)},n.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},n}(e.Evented);function Oe(e,t){return e%32-t%32||t-e}function Ne(e){return"raster"===e||"image"===e||"video"===e}function Re(){return new e.window.Worker(Kr.workerUrl)}Ce.maxOverzooming=10,Ce.maxUnderzooming=3;var Ie=function(){this.active={}};Ie.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.lengththis.width||r<0||t>this.height)return!i&&[];var a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s0:a},Ve.prototype._queryCircle=function(e,t,n,r,i){var o=e-n,a=e+n,s=t-n,l=t+n;if(a<0||o>this.width||l<0||s>this.height)return!r&&[];var c=[],u={hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,l,this._queryCellCircle,c,u,i),r?c.length>0:c},Ve.prototype.query=function(e,t,n,r,i){return this._query(e,t,n,r,!1,i)},Ve.prototype.hitTest=function(e,t,n,r,i){return this._query(e,t,n,r,!0,i)},Ve.prototype.hitTestCircle=function(e,t,n,r){return this._queryCircle(e,t,n,!0,r)},Ve.prototype._queryCell=function(e,t,n,r,i,o,a,s){var l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,p=0,d=c;p=u[f+0]&&r>=u[f+1]&&(!s||s(this.boxKeys[_]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[_],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]})}}}var h=this.circleCells[i];if(null!==h)for(var m=this.circles,g=0,y=h;ga*a+s*s},Ve.prototype._circleAndRectCollide=function(e,t,n,r,i,o,a){var s=(o-r)/2,l=Math.abs(e-(r+s));if(l>s+n)return!1;var c=(a-i)/2,u=Math.abs(t-(i+c));if(u>c+n)return!1;if(l<=s||u<=c)return!0;var p=l-s,d=u-c;return p*p+d*d<=n*n};var qe=e.properties.layout;function He(t,n,r,i,o){var a=e.identity(new Float32Array(16));return n?(e.identity(a),e.scale(a,a,[1/o,1/o,1]),r||e.rotateZ(a,a,i.angle)):(e.scale(a,a,[i.width/2,-i.height/2,1]),e.translate(a,a,[1,-1,0]),e.multiply(a,a,t)),a}function We(t,n,r,i,o){var a=e.identity(new Float32Array(16));return n?(e.multiply(a,a,t),e.scale(a,a,[o,o,1]),r||e.rotateZ(a,a,-i.angle)):(e.scale(a,a,[1,-1,1]),e.translate(a,a,[-1,-1,0]),e.scale(a,a,[2/i.width,2/i.height,1])),a}function Qe(t,n){var r=[t.x,t.y,0,1];it(r,r,n);var i=r[3];return{point:new e.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function Ke(e,t){var n=e[0]/e[3],r=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function $e(t,n,r,i,o,a,s,l){var c=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(c,r.transform.zoom,qe.properties[i?"text-size":"icon-size"]),p=[256/r.width*2+1,256/r.height*2+1],d=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;d.clear();for(var _=t.lineVertexArray,f=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,h=r.transform.width/r.transform.height,m=!1,g=0;gMath.abs(r.x-n.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?n.yr.x)?{needsFlipping:!0}:null}function Je(t,n,r,i,o,a,s,l,c,u,p,d,_,f){var h,m=n/24,g=t.lineOffsetX*n,y=t.lineOffsetY*n;if(t.numGlyphs>1){var v=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,E=t.lineStartIndex+t.lineLength,S=Ze(m,l,g,y,r,p,d,t,c,a,_,!1);if(!S)return{notEnoughRoom:!0};var T=Qe(S.first.point,s).point,A=Qe(S.last.point,s).point;if(i&&!r){var w=Xe(t.writingMode,T,A,f);if(w)return w}h=[S.first];for(var x=t.glyphStartIndex+1;x0?R.point:et(d,N,C,1,o),M=Xe(t.writingMode,C,I,f);if(M)return M}var D=tt(m*l.getoffsetX(t.glyphStartIndex),g,y,r,p,d,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,a,_,!1);if(!D)return{notEnoughRoom:!0};h=[D]}for(var P=0,L=h;P0?1:-1,m=0;i&&(h*=-1,m=Math.PI),h<0&&(m+=Math.PI);for(var g=h>0?l+s:l+s+1,y=g,v=o,b=o,E=0,S=0,T=Math.abs(f);E+S<=T;){if((g+=h)=c)return null;if(b=v,void 0===(v=d[g])){var A=new e.Point(u.getx(g),u.gety(g)),w=Qe(A,p);if(w.signedDistanceFromCamera>0)v=d[g]=w.point;else{var x=g-h;v=et(0===E?a:new e.Point(u.getx(x),u.gety(x)),A,b,T-E+1,p)}}E+=S,S=b.dist(v)}var C=(T-E)/S,O=v.sub(b),N=O.mult(C)._add(b);return N._add(O._unit()._perp()._mult(r*h)),{point:N,angle:m+Math.atan2(v.y-b.y,v.x-b.x),tileDistance:_?{prevTileDistance:g-h===y?0:u.gettileUnitDistanceFromAnchor(g-h),lastSegmentViewportDistance:T-E}:null}}var nt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function rt(e,t){for(var n=0;nC)at(t,O,!1);else{var D=this.projectPoint(c,N,R),P=I*A;if(f.length>0){var L=D.x-f[f.length-4],k=D.y-f[f.length-3];if(P*P*2>L*L+k*k&&O+8-x&&U=this.screenRightBoundary||r<100||t>this.screenBottomBoundary},ot.prototype.isInsideGrid=function(e,t,n,r){return n>=0&&e=0&&t0,A=A&&w.offscreen);var I=R.textCircles;if(I){var M=t.text.placedSymbolArray.get(E.horizontalPlacedTextSymbolIndex),D=e.evaluateSizeForFeature(t.textSizeData,d,M);x=this.collisionIndex.placeCollisionCircles(I,p.get("text-allow-overlap"),o,a,M,t.lineVertexArray,t.glyphOffsetArray,D,n,r,s,"map"===p.get("text-pitch-alignment"),v.predicate),S=p.get("text-allow-overlap")||x.circles.length>0,A=A&&x.offscreen}R.iconFeatureIndex&&(N=R.iconFeatureIndex),R.iconBox&&(T=(C=this.collisionIndex.placeCollisionBox(R.iconBox,p.get("icon-allow-overlap"),a,n,v.predicate)).box.length>0,A=A&&C.offscreen);var P=_||0===E.numGlyphVertices&&0===E.numVerticalGlyphVertices,L=f||0===E.numIconVertices;P||L?L?P||(T=T&&S):S=T&&S:T=S=T&&S,S&&w&&this.collisionIndex.insertCollisionBox(w.box,p.get("text-ignore-placement"),t.bucketInstanceId,O,v.ID),T&&C&&this.collisionIndex.insertCollisionBox(C.box,p.get("icon-ignore-placement"),t.bucketInstanceId,N,v.ID),S&&x&&this.collisionIndex.insertCollisionCircles(x.circles,p.get("text-ignore-placement"),t.bucketInstanceId,O,v.ID),this.placements[E.crossTileID]=new ut(S||g,T||y,A||t.justReloaded),c[E.crossTileID]=!0}}t.justReloaded=!1},_t.prototype.commit=function(e,t){this.commitTime=t;var n=!1,r=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,i=e?e.opacities:{};for(var o in this.placements){var a=this.placements[o],s=i[o];s?(this.opacities[o]=new ct(s,r,a.text,a.icon),n=n||a.text!==s.text.placed||a.icon!==s.icon.placed):(this.opacities[o]=new ct(null,r,a.text,a.icon,a.skipFade),n=n||a.text||a.icon)}for(var l in i){var c=i[l];if(!this.opacities[l]){var u=new ct(c,r,!1,!1);u.isHidden()||(this.opacities[l]=u,n=n||c.text.placed||c.icon.placed)}}n?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},_t.prototype.updateLayerOpacities=function(e,t){for(var n={},r=0,i=t;r0||c.numVerticalGlyphVertices>0,_=c.numIconVertices>0;if(d){for(var f=St(p.text),h=(c.numGlyphVertices+c.numVerticalGlyphVertices)/4,m=0;m=0&&(e.text.placedSymbolArray.get(c.verticalPlacedTextSymbolIndex).hidden=p.text.isHidden())}if(_){for(var g=St(p.icon),y=0;ye},_t.prototype.setStale=function(){this.stale=!0};var ht=Math.pow(2,25),mt=Math.pow(2,24),gt=Math.pow(2,17),yt=Math.pow(2,16),vt=Math.pow(2,9),bt=Math.pow(2,8),Et=Math.pow(2,1);function St(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*ht+t*mt+n*gt+t*yt+n*vt+t*bt+n*Et+t}var Tt=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Tt.prototype.continuePlacement=function(e,t,n,r,i){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=n[t[i._currentPlacementIndex]],l=i.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(i._inProgressLayer||(i._inProgressLayer=new Tt),i._inProgressLayer.continuePlacement(r[s.source],i.placement,i._showCollisionBoxes,s,a))return;delete i._inProgressLayer}i._currentPlacementIndex--}this._done=!0},At.prototype.commit=function(e,t){return this.placement.commit(e,t),this.placement};var wt=512/e.EXTENT/2,xt=function(e,t,n){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;re.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var c=a[e.scaledTo(Number(o)).key];c&&c.findMatches(t.symbolInstances,e,i)}}for(var u=0;u1?"@2x":"",l=e.getJSON(n(e.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),function(e,t){l=null,a||(a=e,i=t,u())}),c=e.getImage(n(e.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),function(e,t){c=null,a||(a=e,o=t,u())});function u(){if(a)r(a);else if(i&&o){var t=e.browser.getImageData(o),n={};for(var s in i){var l=i[s],c=l.width,u=l.height,p=l.x,d=l.y,_=l.sdf,f=l.pixelRatio,h=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,h,{x:p,y:d},{x:0,y:0},{width:c,height:u}),n[s]={data:h,pixelRatio:f,sdf:_}}r(null,n)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t.sprite,this.map._transformRequest,function(t,n){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r.fire(new e.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var o=Le(this.stylesheet.layers);this._order=o.map(function(e){return e.id}),this._layers={};for(var a=0,s=o;a0)throw new Error("Unimplemented: "+i.map(function(e){return e.command}).join(", ")+".");return r.forEach(function(e){"setTransition"!==e.command&&n[e.command].apply(n,e.args)}),this.stylesheet=t,!0},n.prototype.addImage=function(t,n){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,n),this.fire(new e.Event("data",{dataType:"style"}))},n.prototype.getImage=function(e){return this.imageManager.getImage(e)},n.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this.fire(new e.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(t,n,r){var i=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(e.validateStyle.source,"sources."+t,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[t]=new Ce(t,n,this.dispatcher);o.style=this,o.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:t}}),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+n+'" is using it.')));var r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},n.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},n.prototype.addLayer=function(t,n,r){void 0===r&&(r={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===t.type){if(Rt(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.clone(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},r))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}})}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new e.ErrorEvent(new Error('Layer with id "'+n+'" 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)}}},n.prototype.moveLayer=function(t,n){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==n){var r=this._order.indexOf(t);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},n.prototype.removeLayer=function(t){this._checkLoaded();var n=this._layers[t];if(n){n.setEventedParent(null);var r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(e){return this._layers[e]},n.prototype.setLayerZoomRange=function(t,n,r){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(t,n,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.isEqual(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",n,null,r)||(i.filter=e.clone(n),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(t){return e.clone(this.getLayer(t).filter)},n.prototype.setLayoutProperty=function(t,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(t);o?e.isEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),this._updateLayer(o)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(t,n){var r=this.getLayer(t);if(r)return r.getLayoutProperty(n);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(t,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(t);o?e.isEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},n.prototype.setFeatureState=function(t,n){this._checkLoaded();var r=t.source,i=t.sourceLayer,o=this.sourceCaches[r],a=parseInt(t.id,10);void 0!==o?"vector"!==o.getSource().type||i?isNaN(a)||a<0?this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(i,a,n):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(t){this._checkLoaded();var n=t.source,r=t.sourceLayer,i=this.sourceCaches[n],o=parseInt(t.id,10);if(void 0!==i)if("vector"!==i.getSource().type||r){if(!(isNaN(o)||o<0))return i.getFeatureState(r,o);this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return e.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:e.mapObject(this.sourceCaches,function(e){return e.serialize()}),layers:this._serializeLayers(this._order)},function(e){return void 0!==e})},n.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},n.prototype._flattenRenderedFeatures=function(e){for(var t=[],n=this._order.length-1;n>=0;n--)for(var r=this._order[n],i=0,o=e;i 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;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*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Yt=ln("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;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);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Vt=ln("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),qt=ln("#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);}"),Ht=ln("#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvarying vec2 v_pos;void 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;}"),Wt=ln("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 vec4 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\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;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),Qt=ln("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 vec4 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\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;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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);}"),Kt=ln("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;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);}"),$t=ln("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\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\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 vec4 u_scale;uniform float u_vertical_gradient;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\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\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 pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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));}"),Zt=ln("uniform sampler2D u_image;uniform float u_opacity;varying vec2 v_pos;void main() {gl_FragColor=texture2D(u_image,v_pos)*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;}"),Xt=ln("#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 float u_maxzoom;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/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 exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*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;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)/2.0+0.25;}"),Jt=ln("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;}"),en=ln("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvarying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;void 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/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 ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\n#define scale 0.015873016\nattribute vec4 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_gl_units_to_pixels;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\nvec2 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=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;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_gl_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),tn=ln("#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nuniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;void 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/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,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\n#define scale 0.015873016\nattribute vec4 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_gl_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\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\nvec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;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_gl_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),nn=ln("uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 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 pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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 dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/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,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));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\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\nattribute vec4 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_gl_units_to_pixels;uniform mediump float u_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\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 vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;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_gl_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),rn=ln("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/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\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\nattribute vec4 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_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_gl_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\nvec2 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=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;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_gl_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);}"),on=ln("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;}"),an=ln("uniform sampler2D u_texture;\n#pragma mapbox: define lowp float opacity\nvarying vec2 v_tex;varying float v_fade_opacity;void 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 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;\n#pragma mapbox: define lowp float opacity\nuniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_gl_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;void 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;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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_gl_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),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));}"),sn=ln("#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nuniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;void 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 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 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;\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\nuniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_gl_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;void 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;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[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} 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_gl_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 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;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function ln(e,t){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return{fragmentSource:e=e.replace(n,function(e,t,n,i,o){return r[o]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"}),vertexSource:t=t.replace(n,function(e,t,n,i,o){var a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return r[o]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", a_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float a_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = unpack_mix_"+s+"(a_"+o+", a_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"})}}var cn=Object.freeze({prelude:Lt,background:kt,backgroundPattern:Ut,circle:Bt,clippingMask:Ft,heatmap:zt,heatmapTexture:jt,collisionBox:Gt,collisionCircle:Yt,debug:Vt,fill:qt,fillOutline:Ht,fillOutlinePattern:Wt,fillPattern:Qt,fillExtrusion:Kt,fillExtrusionPattern:$t,extrusionTexture:Zt,hillshadePrepare:Xt,hillshade:Jt,line:en,lineGradient:tn,linePattern:nn,lineSDF:rn,raster:on,symbolIcon:an,symbolSDF:sn}),un=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};un.prototype.bind=function(e,t,n,r,i,o,a,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==r.length,c=0;!l&&c>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}pn.prototype.draw=function(e,t,n,r,i,o,a,s,l,c,u,p,d,_,f,h){var m,g=e.gl;for(var y in e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(a[y]);_&&_.setUniforms(e,this.binderUniforms,p,{zoom:d});for(var v=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[t],b=0,E=u.get();b0?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:function(e){e*=Math.PI/180;var t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}(i.paint.get("raster-hue-rotate"))};var o,a},Ln=function(e,t,n,r,i,o,a,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_gl_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},kn=function(t,n,r,i,o,a,s,l,c,u,p){var d=o.transform;return e.extend(Ln(t,n,r,i,o,a,s,l,c,u),{u_gamma_scale:i?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_is_halo:+p})},Un=function(e,t,n){return{u_matrix:e,u_opacity:t,u_color:n}},Bn=function(t,n,r,i,o,a){return e.extend(function(e,t,n,r){var i=n.imageManager.getPattern(e.from),o=n.imageManager.getPattern(e.to),a=n.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,r.tileID.overscaledZ),u=r.tileSize*Math.pow(2,n.transform.tileZoom)/c,p=u*(r.tileID.canonical.x+r.tileID.wrap*c),d=u*r.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:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/st(r,1,n.transform.tileZoom),u_pixel_coord_upper:[p>>16,d>>16],u_pixel_coord_lower:[65535&p,65535&d]}}(i,a,r,o),{u_matrix:t,u_opacity:n})},Fn={fillExtrusion:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient)}},fillExtrusionPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_lightpos:new e.Uniform3f(t,n.u_lightpos),u_lightintensity:new e.Uniform1f(t,n.u_lightintensity),u_lightcolor:new e.Uniform3f(t,n.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,n.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,n.u_height_factor),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform4f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},extrusionTexture:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_opacity:new e.Uniform1f(t,n.u_opacity)}},fill:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},fillPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform4f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},fillOutline:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world)}},fillOutlinePattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_texsize:new e.Uniform2f(t,n.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_scale:new e.Uniform4f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},circle:function(t,n){return{u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,n.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,n.u_extrude_scale),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},collisionBox:En,collisionCircle:En,debug:function(t,n){return{u_color:new e.UniformColor(t,n.u_color),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},clippingMask:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},heatmap:function(t,n){return{u_extrude_scale:new e.Uniform1f(t,n.u_extrude_scale),u_intensity:new e.Uniform1f(t,n.u_intensity),u_matrix:new e.UniformMatrix4f(t,n.u_matrix)}},heatmapTexture:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_world:new e.Uniform2f(t,n.u_world),u_image:new e.Uniform1i(t,n.u_image),u_color_ramp:new e.Uniform1i(t,n.u_color_ramp),u_opacity:new e.Uniform1f(t,n.u_opacity)}},hillshade:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_latrange:new e.Uniform2f(t,n.u_latrange),u_light:new e.Uniform2f(t,n.u_light),u_shadow:new e.UniformColor(t,n.u_shadow),u_highlight:new e.UniformColor(t,n.u_highlight),u_accent:new e.UniformColor(t,n.u_accent)}},hillshadePrepare:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_image:new e.Uniform1i(t,n.u_image),u_dimension:new e.Uniform2f(t,n.u_dimension),u_zoom:new e.Uniform1f(t,n.u_zoom),u_maxzoom:new e.Uniform1f(t,n.u_maxzoom)}},line:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_gl_units_to_pixels:new e.Uniform2f(t,n.u_gl_units_to_pixels)}},lineGradient:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_gl_units_to_pixels:new e.Uniform2f(t,n.u_gl_units_to_pixels),u_image:new e.Uniform1i(t,n.u_image)}},linePattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_texsize:new e.Uniform2f(t,n.u_texsize),u_ratio:new e.Uniform1f(t,n.u_ratio),u_image:new e.Uniform1i(t,n.u_image),u_gl_units_to_pixels:new e.Uniform2f(t,n.u_gl_units_to_pixels),u_scale:new e.Uniform4f(t,n.u_scale),u_fade:new e.Uniform1f(t,n.u_fade)}},lineSDF:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_ratio:new e.Uniform1f(t,n.u_ratio),u_gl_units_to_pixels:new e.Uniform2f(t,n.u_gl_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,n.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,n.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,n.u_sdfgamma),u_image:new e.Uniform1i(t,n.u_image),u_tex_y_a:new e.Uniform1f(t,n.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,n.u_tex_y_b),u_mix:new e.Uniform1f(t,n.u_mix)}},raster:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_tl_parent:new e.Uniform2f(t,n.u_tl_parent),u_scale_parent:new e.Uniform1f(t,n.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,n.u_buffer_scale),u_fade_t:new e.Uniform1f(t,n.u_fade_t),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image0:new e.Uniform1i(t,n.u_image0),u_image1:new e.Uniform1i(t,n.u_image1),u_brightness_low:new e.Uniform1f(t,n.u_brightness_low),u_brightness_high:new e.Uniform1f(t,n.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,n.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,n.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,n.u_spin_weights)}},symbolIcon:function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_gl_coord_matrix:new e.UniformMatrix4f(t,n.u_gl_coord_matrix),u_is_text:new e.Uniform1f(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture)}},symbolSDF:function(t,n){return{u_is_size_zoom_constant:new e.Uniform1i(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,n.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,n.u_size_t),u_size:new e.Uniform1f(t,n.u_size),u_camera_to_center_distance:new e.Uniform1f(t,n.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,n.u_pitch),u_rotate_symbol:new e.Uniform1i(t,n.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,n.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,n.u_fade_change),u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,n.u_label_plane_matrix),u_gl_coord_matrix:new e.UniformMatrix4f(t,n.u_gl_coord_matrix),u_is_text:new e.Uniform1f(t,n.u_is_text),u_pitch_with_map:new e.Uniform1i(t,n.u_pitch_with_map),u_texsize:new e.Uniform2f(t,n.u_texsize),u_texture:new e.Uniform1i(t,n.u_texture),u_gamma_scale:new e.Uniform1f(t,n.u_gamma_scale),u_is_halo:new e.Uniform1f(t,n.u_is_halo)}},background:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_color:new e.UniformColor(t,n.u_color)}},backgroundPattern:function(t,n){return{u_matrix:new e.UniformMatrix4f(t,n.u_matrix),u_opacity:new e.Uniform1f(t,n.u_opacity),u_image:new e.Uniform1i(t,n.u_image),u_pattern_tl_a:new e.Uniform2f(t,n.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,n.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,n.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,n.u_pattern_br_b),u_texsize:new e.Uniform2f(t,n.u_texsize),u_mix:new e.Uniform1f(t,n.u_mix),u_pattern_size_a:new e.Uniform2f(t,n.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,n.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,n.u_scale_a),u_scale_b:new e.Uniform1f(t,n.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,n.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,n.u_tile_units_to_pixels)}}};function zn(t,n){for(var r=t.sort(function(e,t){return e.tileID.isLessThan(t.tileID)?-1:t.tileID.isLessThan(e.tileID)?1:0}),i=0;i0){var s=e.browser.now(),l=(s-t.timeAdded)/a,c=n?(s-n.timeAdded)/a:-1,u=r.getSource(),p=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!n||Math.abs(n.tileID.overscaledZ-p)>Math.abs(t.tileID.overscaledZ-p),_=d&&t.refreshedUponExpiration?1:e.clamp(d?l:1-c,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-_}:{opacity:_,mix:0}}return{opacity:1,mix:0}}function Jn(t,n,r){var i=t.context,o=i.gl,a=r.posMatrix,s=t.useProgram("debug"),l=Se.disabled,c=Te.disabled,u=t.colorModeForRenderPass(),p="$debug";s.draw(i,o.LINE_STRIP,l,c,u,we.disabled,Tn(a,e.Color.red),p,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);for(var d=function(e,t,n,r){r=r||1;var i,o,a,s,l,c,u,p,d=[];for(i=0,o=e.length;i":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},tr={symbol:function(e,t,n,r){if("translucent"===e.renderPass){var i=Te.disabled,o=e.colorModeForRenderPass();0!==n.paint.get("icon-opacity").constantOr(1)&&qn(e,t,n,r,!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"),i,o),0!==n.paint.get("text-opacity").constantOr(1)&&qn(e,t,n,r,!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"),i,o),t.map.showCollisionBoxes&&function(e,t,n,r){Gn(e,t,n,r,!1),Gn(e,t,n,r,!0)}(e,t,n,r)}},circle:function(e,t,n,r){if("translucent"===e.renderPass){var i=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity");if(0!==i.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.context,l=s.gl,c=e.depthModeForSublayer(0,Se.ReadOnly),u=Te.disabled,p=e.colorModeForRenderPass(),d=0;dt.y){var n=e;e=t,t=n}return{x0:e.x,y0:e.y,x1:t.x,y1:t.y,dx:t.x-e.x,dy:t.y-e.y}}function ir(e,t,n,r,i){var o=Math.max(n,Math.floor(t.y0)),a=Math.min(r,Math.ceil(t.y1));if(e.x0===t.x0&&e.y0===t.y0?e.x0+t.dy/e.dy*e.dx0,p=t.dx<0,d=o;dl.dy&&(a=s,s=l,l=a),s.dy>c.dy&&(a=s,s=c,c=a),l.dy>c.dy&&(a=l,l=c,c=a),s.dy&&ir(c,s,r,i,o),l.dy&&ir(c,l,r,i,o)}nr.prototype.resize=function(t,n){var r=this.context.gl;if(this.width=t*e.browser.devicePixelRatio,this.height=n*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i=0;this.currentLayer--){var w=this.style._layers[r[this.currentLayer]],x=i[w.source],C=l[w.source];w.source!==s&&x&&(this.clearStencil(),x.getSource().isTileClipped&&this._renderTileClippingMasks(C)),this.renderLayer(this,x,w,C),s=w.source}for(this.renderPass="translucent",this.currentLayer=0,s=null;this.currentLayer0?t.pop():null},nr.prototype.isPatternMissing=function(e){if(!e)return!1;var t=this.imageManager.getPattern(e.from),n=this.imageManager.getPattern(e.to);return!t||!n},nr.prototype.useProgram=function(e,t){void 0===t&&(t=this.emptyProgramConfiguration),this.cache=this.cache||{};var n=""+e+(t.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new pn(this.context,cn[e],t,Fn[e],this._showOverdrawInspector)),this.cache[n]},nr.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()},nr.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)};var ar=function(t,n,r){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=n||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},sr={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};ar.prototype.clone=function(){var e=new ar(this._minZoom,this._maxZoom,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._calcMatrices(),e},sr.minZoom.get=function(){return this._minZoom},sr.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},sr.maxZoom.get=function(){return this._maxZoom},sr.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},sr.renderWorldCopies.get=function(){return this._renderWorldCopies},sr.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},sr.worldSize.get=function(){return this.tileSize*this.scale},sr.centerPoint.get=function(){return this.size._div(2)},sr.size.get=function(){return new e.Point(this.width,this.height)},sr.bearing.get=function(){return-this.angle/Math.PI*180},sr.bearing.set=function(t){var n=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=e.create$4(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},sr.pitch.get=function(){return this._pitch/Math.PI*180},sr.pitch.set=function(t){var n=e.clamp(t,0,60)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())},sr.fov.get=function(){return this._fov/Math.PI*180},sr.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},sr.zoom.get=function(){return this._zoom},sr.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},sr.center.get=function(){return this._center},sr.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},ar.prototype.coveringZoomLevel=function(e){return(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize))},ar.prototype.getVisibleUnwrappedCoordinates=function(t){var n=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),o=this.pointCoordinate(new e.Point(this.width,this.height)),a=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),l=Math.floor(Math.max(r.x,i.x,o.x,a.x)),c=s-1;c<=l+1;c++)0!==c&&n.push(new e.UnwrappedTileID(c,t));return n},ar.prototype.coveringTiles=function(t){var n=this.coveringZoomLevel(t),r=n;if(void 0!==t.minzoom&&nt.maxzoom&&(n=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),a=new e.Point(o*i.x-.5,o*i.y-.5);return function(t,n,r,i){void 0===i&&(i=!0);var o=1<=0&&l<=o)for(c=n;ca&&(i=a-m)}if(this.lngRange){var g=_.x,y=c.x/2;g-yl&&(r=l-y)}void 0===r&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==r?r:_.x,void 0!==i?i:_.y))),this._unmodified=u,this._constraining=!1}},ar.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,n=Math.PI/2+this._pitch,r=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-n-t),i=this.point,o=i.x,a=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),l=new Float64Array(16);e.perspective(l,this._fov,this.width/this.height,1,s),e.scale(l,l,[1,-1,1]),e.translate(l,l,[0,0,-this.cameraToCenterDistance]),e.rotateX(l,l,this._pitch),e.rotateZ(l,l,this.angle),e.translate(l,l,[-o,-a,0]),this.mercatorMatrix=e.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),e.scale(l,l,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l;var c=this.width%2/2,u=this.height%2/2,p=Math.cos(this.angle),d=Math.sin(this.angle),_=o-Math.round(o)+p*c+d*u,f=a-Math.round(a)+p*u+d*c,h=new Float64Array(l);if(e.translate(h,h,[_>.5?_-1:_,f>.5?f-1:f,0]),this.alignedProjMatrix=h,l=e.create(),e.scale(l,l,[this.width/2,-this.height/2,1]),e.translate(l,l,[1,-1,0]),this.pixelMatrix=e.multiply(new Float64Array(16),l,this.projMatrix),!(l=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ar.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(ar.prototype,sr);var lr=function(){var t,n,r,i;e.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(t=this._updateHashUnthrottled.bind(this),300,n=!1,r=0,i=function(){r=0,n&&(t(),r=setTimeout(i,300),n=!1)},function(){return n=!0,r||i(),r})};lr.prototype.addTo=function(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},lr.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},lr.prototype.getHashString=function(e){var t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,r),o=Math.round(t.lng*i)/i,a=Math.round(t.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),c="";return c+=e?"#/"+o+"/"+a+"/"+n:"#"+n+"/"+a+"/"+o,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+="/"+Math.round(l)),c},lr.prototype._onHashChange=function(){var t=e.window.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},lr.prototype._updateHashUnthrottled=function(){var t=this.getHashString();try{e.window.history.replaceState(e.window.history.state,"",t)}catch(e){}};var cr=function(t){function r(r,i,o,a){void 0===a&&(a={});var s=n.mousePos(i.getCanvasContainer(),o),l=i.unproject(s);t.call(this,r,e.extend({point:s,lngLat:l,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(e.Event),ur=function(t){function r(r,i,o){var a=n.touchPos(i.getCanvasContainer(),o),s=a.map(function(e){return i.unproject(e)}),l=a.reduce(function(e,t,n,r){return e.add(t.div(r.length))},new e.Point(0,0)),c=i.unproject(l);t.call(this,r,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(e.Event),pr=function(e){function t(t,n,r){e.call(this,t,{originalEvent:r}),this._defaultPrevented=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={defaultPrevented:{configurable:!0}};return t.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,n),t}(e.Event),dr=function(t){this._map=t,this._el=t.getCanvasContainer(),this._delta=0,e.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};dr.prototype.isEnabled=function(){return!!this._enabled},dr.prototype.isActive=function(){return!!this._active},dr.prototype.isZooming=function(){return!!this._zooming},dr.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},dr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},dr.prototype.onWheel=function(t){if(this.isEnabled()){var n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,r=e.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this.isActive()||this._start(t)),t.preventDefault()}},dr.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(e)},dr.prototype._start=function(t){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._zooming=!0,this._map.fire(new e.Event("movestart",{originalEvent:t})),this._map.fire(new e.Event("zoomstart",{originalEvent:t})),this._finishTimeout&&clearTimeout(this._finishTimeout);var r=n.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},dr.prototype._onScrollFrame=function(){var t=this;if(this._frameId=null,this.isActive()){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a="number"==typeof this._targetZoom?this._targetZoom:n.zoom,s=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&s&&l){var u=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),p=l(u);n.zoom=e.number(s,a,p),u<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0}else n.zoom=a,c=!0;n.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new e.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new e.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout(function(){t._zooming=!1,t._map.fire(new e.Event("zoomend",{originalEvent:t._lastWheelEvent})),t._map.fire(new e.Event("moveend",{originalEvent:t._lastWheelEvent})),delete t._targetZoom},200))}},dr.prototype._smoothOutEasing=function(t){var n=e.ease;if(this._prevEase){var r=this._prevEase,i=(e.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=e.bezier(a,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:n},n};var _r=function(t,n){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1,e.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};_r.prototype.isEnabled=function(){return!!this._enabled},_r.prototype.isActive=function(){return!!this._active},_r.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},_r.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},_r.prototype.onMouseDown=function(t){this.isEnabled()&&t.shiftKey&&0===t.button&&(e.window.document.addEventListener("mousemove",this._onMouseMove,!1),e.window.document.addEventListener("keydown",this._onKeyDown,!1),e.window.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=this._lastPos=n.mousePos(this._el,t),this._active=!0)},_r.prototype._onMouseMove=function(e){var t=n.mousePos(this._el,e);if(!(this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)180&&(_=180);var f=_/180;c+=p*_*(f/2),Math.abs(n._normalizeBearing(c,0))0&&n-t[0][0]>160;)t.shift()};var mr=e.bezier(0,0,.3,1),gr=function(t,n){this._map=t,this._el=t.getCanvasContainer(),this._state="disabled",this._clickTolerance=n.clickTolerance||1,e.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};gr.prototype.isEnabled=function(){return"disabled"!==this._state},gr.prototype.isActive=function(){return"active"===this._state},gr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},gr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},gr.prototype.onMouseDown=function(t){"enabled"===this._state&&(t.ctrlKey||0!==n.mouseButton(t)||(n.addEventListener(e.window.document,"mousemove",this._onMove,{capture:!0}),n.addEventListener(e.window.document,"mouseup",this._onMouseUp),this._start(t)))},gr.prototype.onTouchStart=function(t){"enabled"===this._state&&(t.touches.length>1||(n.addEventListener(e.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.addEventListener(e.window.document,"touchend",this._onTouchEnd),this._start(t)))},gr.prototype._start=function(t){e.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._lastPos=n.mousePos(this._el,t),this._inertia=[[e.browser.now(),this._startPos]]},gr.prototype._onMove=function(t){t.preventDefault();var r=n.mousePos(this._el,t);this._lastPos.equals(r)||"pending"===this._state&&r.dist(this._mouseDownPos)1400&&(s=1400,a._unit()._mult(s));var l=s/750,c=a.mult(-l/2);this._map.panBy(c,{duration:1e3*l,easing:mr,noMoveStart:!0},{originalEvent:e})}}},gr.prototype._fireEvent=function(t,n){return this._map.fire(new e.Event(t,n?{originalEvent:n}:{}))},gr.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,n=e.browser.now();t.length>0&&n-t[0][0]>160;)t.shift()};var yr=function(t){this._map=t,this._el=t.getCanvasContainer(),e.bindAll(["_onKeyDown"],this)};function vr(e){return e*(2-e)}yr.prototype.isEnabled=function(){return!!this._enabled},yr.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},yr.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},yr.prototype._onKeyDown=function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=0,n=0,r=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?r=-1:(o=1,e.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:vr,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+15*n,pitch:a.getPitch()+10*r,offset:[100*-i,100*-o],center:a.getCenter()};a.easeTo(l,{originalEvent:e})}};var br=function(t){this._map=t,e.bindAll(["_onDblClick","_onZoomEnd"],this)};br.prototype.isEnabled=function(){return!!this._enabled},br.prototype.isActive=function(){return!!this._active},br.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},br.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},br.prototype.onTouchStart=function(e){var t=this;this.isEnabled()&&(e.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(e)):this._tapped=setTimeout(function(){t._tapped=null},300)))},br.prototype.onDblClick=function(e){this.isEnabled()&&(e.originalEvent.preventDefault(),this._zoom(e))},br.prototype._zoom=function(e){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(e.originalEvent.shiftKey?-1:1),{around:e.lngLat},e)},br.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Er=e.bezier(0,0,.15,1),Sr=function(t){this._map=t,this._el=t.getCanvasContainer(),e.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Sr.prototype.isEnabled=function(){return!!this._enabled},Sr.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)},Sr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Sr.prototype.disableRotation=function(){this._rotationDisabled=!0},Sr.prototype.enableRotation=function(){this._rotationDisabled=!1},Sr.prototype.onStart=function(t){if(this.isEnabled()&&2===t.touches.length){var r=n.mousePos(this._el,t.touches[0]),i=n.mousePos(this._el,t.touches[1]),o=r.add(i).div(2);this._startVec=r.sub(i),this._startAround=this._map.transform.pointLocation(o),this._gestureIntent=void 0,this._inertia=[],n.addEventListener(e.window.document,"touchmove",this._onMove,{passive:!1}),n.addEventListener(e.window.document,"touchend",this._onEnd)}},Sr.prototype._getTouchEventData=function(e){var t=n.mousePos(this._el,e.touches[0]),r=n.mousePos(this._el,e.touches[1]),i=t.sub(r);return{vec:i,center:t.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Sr.prototype._onMove=function(t){if(2===t.touches.length){var n=this._getTouchEventData(t),r=n.vec,i=n.scale,o=n.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new e.Event(this._gestureIntent+"start",{originalEvent:t})),this._map.fire(new e.Event("movestart",{originalEvent:t})),this._startVec=r)}this._lastTouchEvent=t,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),t.preventDefault()}},Sr.prototype._onTouchFrame=function(){this._frameId=null;var t=this._gestureIntent;if(t){var n=this._map.transform;this._startScale||(this._startScale=n.scale,this._startBearing=n.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,o=r.bearing,a=r.scale,s=n.pointLocation(i),l=n.locationPoint(s);"rotate"===t&&(n.bearing=this._startBearing+o),n.zoom=n.scaleZoom(this._startScale*a),n.setLocationAtPoint(this._startAround,l),this._map.fire(new e.Event(t,{originalEvent:this._lastTouchEvent})),this._map.fire(new e.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([e.browser.now(),a,i])}},Sr.prototype._onEnd=function(t){n.removeEventListener(e.window.document,"touchmove",this._onMove,{passive:!1}),n.removeEventListener(e.window.document,"touchend",this._onEnd);var r=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new e.Event(r+"end",{originalEvent:t})),this._drainInertiaBuffer();var o=this._inertia,a=this._map;if(o.length<2)a.snapToNorth({},{originalEvent:t});else{var s=o[o.length-1],l=o[0],c=a.transform.scaleZoom(i*s[1]),u=a.transform.scaleZoom(i*l[1]),p=c-u,d=(s[0]-l[0])/1e3,_=s[2];if(0!==d&&c!==u){var f=.15*p/d;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),m=c+f*h/2e3;m<0&&(m=0),a.easeTo({zoom:m,duration:h,easing:Er,around:this._aroundCenter?a.getCenter():a.unproject(_),noMoveStart:!0},{originalEvent:t})}else a.snapToNorth({},{originalEvent:t})}}},Sr.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,n=e.browser.now();t.length>2&&n-t[0][0]>160;)t.shift()};var Tr={scrollZoom:dr,boxZoom:_r,dragRotate:hr,dragPan:gr,keyboard:yr,doubleClickZoom:br,touchZoomRotate:Sr},Ar=function(t){function n(n,r){t.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.getCenter=function(){return this.transform.center},n.prototype.setCenter=function(e,t){return this.jumpTo({center:e},t)},n.prototype.panBy=function(t,n,r){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},n),r)},n.prototype.panTo=function(t,n,r){return this.easeTo(e.extend({center:t},n),r)},n.prototype.getZoom=function(){return this.transform.zoom},n.prototype.setZoom=function(e,t){return this.jumpTo({zoom:e},t),this},n.prototype.zoomTo=function(t,n,r){return this.easeTo(e.extend({zoom:t},n),r)},n.prototype.zoomIn=function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this},n.prototype.zoomOut=function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this},n.prototype.getBearing=function(){return this.transform.bearing},n.prototype.setBearing=function(e,t){return this.jumpTo({bearing:e},t),this},n.prototype.rotateTo=function(t,n,r){return this.easeTo(e.extend({bearing:t},n),r)},n.prototype.resetNorth=function(t,n){return this.rotateTo(0,e.extend({duration:1e3},t),n),this},n.prototype.snapToNorth=function(e,t){return Math.abs(this.getBearing())t?1:0}),["bottom","left","right","top"])){var a=this.transform,s=a.project(e.LngLat.convert(t)),l=a.project(e.LngLat.convert(n)),c=s.rotate(-r*Math.PI/180),u=l.rotate(-r*Math.PI/180),p=new e.Point(Math.max(c.x,u.x),Math.max(c.y,u.y)),d=new e.Point(Math.min(c.x,u.x),Math.min(c.y,u.y)),_=p.sub(d),f=(a.width-i.padding.left-i.padding.right)/_.x,h=(a.height-i.padding.top-i.padding.bottom)/_.y;if(!(h<0||f<0)){var m=Math.min(a.scaleZoom(a.scale*Math.min(f,h)),i.maxZoom),g=e.Point.convert(i.offset),y=(i.padding.left-i.padding.right)/2,v=(i.padding.top-i.padding.bottom)/2,b=new e.Point(g.x+y,g.y+v).mult(a.scale/a.zoomScale(m));return{center:a.unproject(s.add(l).div(2).sub(b)),zoom:m,bearing:r}}e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else e.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},n.prototype.fitBounds=function(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)},n.prototype.fitScreenCoordinates=function(t,n,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(t)),this.transform.pointLocation(e.Point.convert(n)),r,i),i,o)},n.prototype._fitInternal=function(t,n,r){return t?(n=e.extend(t,n)).linear?this.easeTo(n,r):this.flyTo(n,r):this},n.prototype.jumpTo=function(t,n){this.stop();var r=this.transform,i=!1,o=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.LngLat.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),i&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),o&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),a&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n))},n.prototype.easeTo=function(t,n){var r=this;this.stop(),!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate&&(t.duration=0);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in t?+t.zoom:o,c="bearing"in t?this._normalizeBearing(t.bearing,a):a,u="pitch"in t?+t.pitch:s,p=i.centerPoint.add(e.Point.convert(t.offset)),d=i.pointLocation(p),_=e.LngLat.convert(t.center||d);this._normalizeCenter(_);var f,h,m=i.project(d),g=i.project(_).sub(m),y=i.zoomScale(l-o);return t.around&&(f=e.LngLat.convert(t.around),h=i.locationPoint(f)),this._zooming=l!==o,this._rotating=a!==c,this._pitching=u!==s,this._prepareEase(n,t.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(t){if(r._zooming&&(i.zoom=e.number(o,l,t)),r._rotating&&(i.bearing=e.number(a,c,t)),r._pitching&&(i.pitch=e.number(s,u,t)),f)i.setLocationAtPoint(f,h);else{var d=i.zoomScale(i.zoom-o),_=l>o?Math.min(2,y):Math.max(.5,y),v=Math.pow(_,1-t),b=i.unproject(m.add(g.mult(t*v)).mult(d));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,p)}r._fireMoveEvents(n)},function(){t.delayEndEvents?r._easeEndTimeoutID=setTimeout(function(){return r._afterEase(n)},t.delayEndEvents):r._afterEase(n)},t),this},n.prototype._prepareEase=function(t,n){this._moving=!0,n||this.fire(new e.Event("movestart",t)),this._zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&this.fire(new e.Event("pitchstart",t))},n.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},n.prototype._afterEase=function(t){var n=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,n&&this.fire(new e.Event("zoomend",t)),r&&this.fire(new e.Event("rotateend",t)),i&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))},n.prototype.flyTo=function(t,n){var r=this;this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in t?e.clamp(+t.zoom,i.minZoom,i.maxZoom):o,c="bearing"in t?this._normalizeBearing(t.bearing,a):a,u="pitch"in t?+t.pitch:s,p=i.zoomScale(l-o),d=i.centerPoint.add(e.Point.convert(t.offset)),_=i.pointLocation(d),f=e.LngLat.convert(t.center||_);this._normalizeCenter(f);var h=i.project(_),m=i.project(f).sub(h),g=t.curve,y=Math.max(i.width,i.height),v=y/p,b=m.mag();if("minZoom"in t){var E=e.clamp(Math.min(t.minZoom,o,l),i.minZoom,i.maxZoom),S=y/i.zoomScale(E-o);g=Math.sqrt(S/b*2)}var T=g*g;function A(e){var t=(v*v-y*y+(e?-1:1)*T*T*b*b)/(2*(e?v:y)*T*b);return Math.log(Math.sqrt(t*t+1)-t)}function w(e){return(Math.exp(e)-Math.exp(-e))/2}function x(e){return(Math.exp(e)+Math.exp(-e))/2}var C=A(0),O=function(e){return x(C)/x(C+g*e)},N=function(e){return y*((x(C)*(w(t=C+g*e)/x(t))-w(C))/T)/b;var t},R=(A(1)-C)/g;if(Math.abs(b)<1e-6||!isFinite(R)){if(Math.abs(y-v)<1e-6)return this.easeTo(t,n);var I=vt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=a!==c,this._pitching=u!==s,this._prepareEase(n,!1),this._ease(function(t){var p=t*R,_=1/O(p);i.zoom=1===t?l:o+i.scaleZoom(_),r._rotating&&(i.bearing=e.number(a,c,t)),r._pitching&&(i.pitch=e.number(s,u,t));var g=1===t?f:i.unproject(h.add(m.mult(N(p))).mult(_));i.setLocationAtPoint(i.renderWorldCopies?g.wrap():g,d),r._fireMoveEvents(n)},function(){return r._afterEase(n)},t),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var e=this._onEaseEnd;delete this._onEaseEnd,e.call(this)}return this},n.prototype._ease=function(t,n,r){!1===r.animate||0===r.duration?(t(1),n()):(this._easeStart=e.browser.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(t,n){t=e.wrap(t,-180,180);var r=Math.abs(t-n);return Math.abs(t-360-n)180?-360:n<-180?360:0}},n}(e.Evented),wr=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};wr.prototype.getDefaultPosition=function(){return"bottom-right"},wr.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),t&&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===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},wr.prototype.onRemove=function(){n.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},wr.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:e.config.ACCESS_TOKEN}];if(t){var r=n.reduce(function(e,t,r){return t.value&&(e+=t.key+"="+t.value+(r=0)return!1;return!0})).length?(this._innerContainer.innerHTML=e.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null}},wr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var xr=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};xr.prototype.onAdd=function(e){this._map=e,this._container=n.create("div","mapboxgl-ctrl");var t=n.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.href="https://www.mapbox.com/",t.setAttribute("aria-label","Mapbox logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xr.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xr.prototype.getDefaultPosition=function(){return"bottom-left"},xr.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xr.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},xr.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var Cr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Cr.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Cr.prototype.remove=function(e){for(var t=this._currentlyRunning,n=0,r=t?this._queue.concat(t):this._queue;nt.maxZoom)throw new Error("maxZoom must be greater than minZoom");var o=new ar(t.minZoom,t.maxZoom,t.renderWorldCopies);r.call(this,o,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Cr,this._controls=[],this._mapId=e.uniqueId();var a=t.transformRequest;if(this._transformRequest=a?function(e,t){return a(e,t)||{url:e}}:function(e){return{url:e}},"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Nr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return i._update(!1)}),this.on("moveend",function(){return i._update(!1)}),this.on("zoom",function(){return i._update(!0)}),void 0!==e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1)),function(e,t){var r=e.getCanvasContainer(),i=null,o=!1,a=null;for(var s in Tr)e[s]=new Tr[s](e,t),t.interactive&&t[s]&&e[s].enable(t[s]);n.addEventListener(r,"mouseout",function(t){e.fire(new cr("mouseout",e,t))}),n.addEventListener(r,"mousedown",function(i){o=!0,a=n.mousePos(r,i);var s=new cr("mousedown",e,i);e.fire(s),s.defaultPrevented||(t.interactive&&!e.doubleClickZoom.isActive()&&e.stop(),e.boxZoom.onMouseDown(i),e.boxZoom.isActive()||e.dragPan.isActive()||e.dragRotate.onMouseDown(i),e.boxZoom.isActive()||e.dragRotate.isActive()||e.dragPan.onMouseDown(i))}),n.addEventListener(r,"mouseup",function(t){var n=e.dragRotate.isActive();i&&!n&&e.fire(new cr("contextmenu",e,i)),i=null,o=!1,e.fire(new cr("mouseup",e,t))}),n.addEventListener(r,"mousemove",function(t){if(!e.dragPan.isActive()&&!e.dragRotate.isActive()){for(var n=t.target;n&&n!==r;)n=n.parentNode;n===r&&e.fire(new cr("mousemove",e,t))}}),n.addEventListener(r,"mouseover",function(t){for(var n=t.target;n&&n!==r;)n=n.parentNode;n===r&&e.fire(new cr("mouseover",e,t))}),n.addEventListener(r,"touchstart",function(n){var r=new ur("touchstart",e,n);e.fire(r),r.defaultPrevented||(t.interactive&&e.stop(),e.boxZoom.isActive()||e.dragRotate.isActive()||e.dragPan.onTouchStart(n),e.touchZoomRotate.onStart(n),e.doubleClickZoom.onTouchStart(r))},{passive:!1}),n.addEventListener(r,"touchmove",function(t){e.fire(new ur("touchmove",e,t))},{passive:!1}),n.addEventListener(r,"touchend",function(t){e.fire(new ur("touchend",e,t))}),n.addEventListener(r,"touchcancel",function(t){e.fire(new ur("touchcancel",e,t))}),n.addEventListener(r,"click",function(i){var o=n.mousePos(r,i);(o.equals(a)||o.dist(a)-1&&this._controls.splice(n,1),t.onRemove(this),this},i.prototype.resize=function(t){var n=this._containerDimensions(),r=n[0],i=n[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t)).fire(new e.Event("resize",t)).fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null==e?0:e)>=0&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(e,t,n){var i,o=this;if(void 0===n)return r.prototype.on.call(this,e,t);var a=function(){if("mouseenter"===e||"mouseover"===e){var r=!1;return{layer:t,listener:n,delegates:{mousemove:function(i){var a=o.getLayer(t)?o.queryRenderedFeatures(i.point,{layers:[t]}):[];a.length?r||(r=!0,n.call(o,new cr(e,o,i.originalEvent,{features:a}))):r=!1},mouseout:function(){r=!1}}}}if("mouseleave"===e||"mouseout"===e){var a=!1;return{layer:t,listener:n,delegates:{mousemove:function(r){(o.getLayer(t)?o.queryRenderedFeatures(r.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,n.call(o,new cr(e,o,r.originalEvent)))},mouseout:function(t){a&&(a=!1,n.call(o,new cr(e,o,t.originalEvent)))}}}}return{layer:t,listener:n,delegates:(i={},i[e]=function(e){var r=o.getLayer(t)?o.queryRenderedFeatures(e.point,{layers:[t]}):[];r.length&&(e.features=r,n.call(o,e),delete e.features)},i)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(a),a.delegates)o.on(s,a.delegates[s]);return this},i.prototype.off=function(e,t,n){if(void 0===n)return r.prototype.off.call(this,e,t);if(this._delegatedListeners&&this._delegatedListeners[e])for(var i=this._delegatedListeners[e],o=0;o180;){var s=r.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}Pr.prototype._rotateCompassArrow=function(){var e="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=e},Pr.prototype.onAdd=function(e){return this._map=e,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new hr(e,{button:"left",element:this._compass}),n.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},Pr.prototype.onRemove=function(){n.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),n.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map},Pr.prototype._createButton=function(e,t,r){var i=n.create("button",e,this._container);return i.type="button",i.title=t,i.setAttribute("aria-label",t),i.addEventListener("click",r),i};var kr={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 Ur(e,t,n){var r=e.classList;for(var i in kr)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+t)}var Br,Fr=function(t){function r(r,i){if(t.call(this),(r instanceof e.window.HTMLElement||i)&&(r=e.extend({element:r},i)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",r&&r.element)this._element=r.element,this._offset=e.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");var o=n.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var a=n.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=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=n.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{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"}];c5280?qr(t,c,d/5280,"mi"):qr(t,c,d,"ft")}else n&&"nautical"===n.unit?qr(t,c,p/1852,"nm"):qr(t,c,p,"m")}function qr(e,t,n,r){var i,o,a,s=(i=n,(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(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(a))),l=s/n;"m"===r&&s>=1e3&&(s/=1e3,r="km"),e.style.width=t*l+"px",e.innerHTML=s+r}Yr.prototype.getDefaultPosition=function(){return"bottom-left"},Yr.prototype._onMove=function(){Vr(this._map,this._container,this.options)},Yr.prototype.onAdd=function(e){return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Yr.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Yr.prototype.setUnit=function(e){this.options.unit=e,Vr(this._map,this._container,this.options)};var Hr=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Hr.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Hr.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Hr.prototype._setupUI=function(){var t=this._fullscreenButton=n.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer);t.setAttribute("aria-label","Toggle fullscreen"),t.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._isFullscreen=function(){return this._fullscreen},Hr.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},Hr.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.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 Wr={closeButton:!0,closeOnClick:!0,className:""},Qr=function(t){function r(n){t.call(this),this.options=e.extend(Object.create(Wr),n),e.bindAll(["_update","_onClickClose"],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.addTo=function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new e.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new e.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._update(),this},r.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},r.prototype.setHTML=function(t){var n,r=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.setDOMContent=function(e){return this._createContent(),this._content.appendChild(e),this._update(),this},r.prototype._createContent=function(){this._content&&n.remove(this._content),this._content=n.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},r.prototype._update=function(){var t=this;if(this._map&&this._lngLat&&this._content){this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(e){return t._container.classList.add(e)})),this._map.transform.renderWorldCopies&&(this._lngLat=Lr(this._lngLat,this._pos,this._map.transform));var r=this._pos=this._map.project(this._lngLat),i=this.options.anchor,o=function t(n){if(n){if("number"==typeof n){var r=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new e.Point(0,0),top:new e.Point(0,n),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-n),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(n,0),right:new e.Point(-n,0)}}if(n instanceof e.Point||Array.isArray(n)){var i=e.Point.convert(n);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:e.Point.convert(n.center||[0,0]),top:e.Point.convert(n.top||[0,0]),"top-left":e.Point.convert(n["top-left"]||[0,0]),"top-right":e.Point.convert(n["top-right"]||[0,0]),bottom:e.Point.convert(n.bottom||[0,0]),"bottom-left":e.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(n["bottom-right"]||[0,0]),left:e.Point.convert(n.left||[0,0]),right:e.Point.convert(n.right||[0,0])}}return t(new e.Point(0,0))}(this.options.offset);if(!i){var a,s=this._container.offsetWidth,l=this._container.offsetHeight;a=r.y+o.bottom.ythis._map.transform.height-l?["bottom"]:[],r.xthis._map.transform.width-s/2&&a.push("right"),i=0===a.length?"bottom":a.join("-")}var c=r.add(o[i]).round();n.setTransform(this._container,kr[i]+" translate("+c.x+"px,"+c.y+"px)"),Ur(this._container,i,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(e.Evented),Kr={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,Map:Ir,NavigationControl:Pr,GeolocateControl:jr,AttributionControl:wr,ScaleControl:Yr,FullscreenControl:Hr,Popup:Qr,Marker:Fr,Style:Dt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return Ie.workerCount},set workerCount(e){Ie.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},workerUrl:""};return Kr}),n},"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):n.mapboxgl=r()},function(e,t,n){var r=n(53),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";t.__esModule=!0,t.createPath=t.parsePath=t.getQueryStringValueFromPath=t.stripQueryStringValueFromPath=t.addQueryStringValueToPath=void 0;var r,i=n(11);(r=i)&&r.__esModule;t.addQueryStringValueToPath=function(e,t,n){var r=o(e),i=r.pathname,s=r.search,l=r.hash;return a({pathname:i,search:s+(-1===s.indexOf("?")?"?":"&")+t+"="+n,hash:l})},t.stripQueryStringValueFromPath=function(e,t){var n=o(e),r=n.pathname,i=n.search,s=n.hash;return a({pathname:r,search:i.replace(new RegExp("([?&])"+t+"=[a-zA-Z0-9]+(&?)"),function(e,t,n){return"?"===t?t:n}),hash:s})},t.getQueryStringValueFromPath=function(e,t){var n=o(e).search.match(new RegExp("[?&]"+t+"=([a-zA-Z0-9]+)"));return n&&n[1]};var o=t.parsePath=function(e){var t,n,r=null==(n=(t=e).match(/^(https?:)?\/\/[^\/]*/))?t:t.substring(n[0].length),i="",o="",a=r.indexOf("#");-1!==a&&(o=r.substring(a),r=r.substring(0,a));var s=r.indexOf("?");return-1!==s&&(i=r.substring(s),r=r.substring(0,s)),""===r&&(r="/"),{pathname:r,search:i,hash:o}},a=t.createPath=function(e){if(null==e||"string"==typeof e)return e;var t=e.basename,n=e.pathname,r=e.search,i=e.hash,o=(t||"")+n;return r&&"?"!==r&&(o+=r),i&&(o+=i),o}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(38),i=n(89),o=n(90),a="[object Null]",s="[object Undefined]",l=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:l&&l in Object(e)?i(e):o(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.locationsAreEqual=t.statesAreEqual=t.createLocation=t.createQuery=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.POP,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r="string"==typeof e?(0,a.parsePath)(e):e;return{pathname:r.pathname||"/",search:r.search||"",hash:r.hash||"",state:r.state,action:t,key:n}};var c=function(e){return"[object Date]"===Object.prototype.toString.call(e)},u=t.statesAreEqual=function e(t,n){if(t===n)return!0;var i=void 0===t?"undefined":r(t);if(i!==(void 0===n?"undefined":r(n)))return!1;if("function"===i&&(0,o.default)(!1),"object"===i){if(c(t)&&c(n)&&(0,o.default)(!1),!Array.isArray(t)){var a=Object.keys(t),s=Object.keys(n);return a.length===s.length&&a.every(function(r){return e(t[r],n[r])})}return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])})}return!1};t.locationsAreEqual=function(e,t){return e.key===t.key&&e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&u(e.state,t.state)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(17),i=n(19),o=n(23),a="[object String]";e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&r(e)==a}},function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return r}),n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o});var r="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:e,o=(void 0!==e||window,"undefined"!=typeof document&&document,!1);try{var a={get passive(){o=!0}};i.addEventListener("test",a,a),i.removeEventListener("test",a,a)}catch(e){}}).call(this,n(16))},,function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";t.__esModule=!0;t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t,n){var r=n(113),i=n(116);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";t.__esModule=!0;t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},t.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},t.supportsPopstateOnHashchange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},t.isExtraneousPopstateEvent=function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(e,t,n){var r=n(17),i=n(91),o=n(23),a="[object Object]",s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,p=c.call(Object);e.exports=function(e){if(!o(e)||r(e)!=a)return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=e(t),r=t.stringifyQuery,o=t.parseQueryString;"function"!=typeof r&&(r=u),"function"!=typeof o&&(o=p);var a=function(e){return e?(null==e.query&&(e.query=o(e.search.substring(1))),e):e},d=function(e,t){if(null==t)return e;var n="string"==typeof e?(0,c.parsePath)(e):e,o=r(t);return i({},n,{search:o?"?"+o:""})};return i({},n,{getCurrentLocation:function(){return a(n.getCurrentLocation())},listenBefore:function(e){return n.listenBefore(function(t,n){return(0,s.default)(e,a(t),n)})},listen:function(e){return n.listen(function(t){return e(a(t))})},push:function(e){return n.push(d(e,e.query))},replace:function(e){return n.replace(d(e,e.query))},createPath:function(e){return n.createPath(d(e,e.query))},createHref:function(e){return n.createHref(d(e,e.query))},createLocation:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{},n=e(t),r=t.basename,o=function(e){return e?(r&&null==e.basename&&(0===e.pathname.toLowerCase().indexOf(r.toLowerCase())?(e.pathname=e.pathname.substring(r.length),e.basename=r,""===e.pathname&&(e.pathname="/")):e.basename=""),e):e},l=function(e){if(!r)return e;var t="string"==typeof e?(0,s.parsePath)(e):e,n=t.pathname,o="/"===r.slice(-1)?r:r+"/",a="/"===n.charAt(0)?n.slice(1):n;return i({},t,{pathname:o+a})};return i({},n,{getCurrentLocation:function(){return o(n.getCurrentLocation())},listenBefore:function(e){return n.listenBefore(function(t,n){return(0,a.default)(e,o(t),n)})},listen:function(e){return n.listen(function(t){return e(o(t))})},push:function(e){return n.push(l(e))},replace:function(e){return n.replace(l(e))},createPath:function(e){return n.createPath(l(e))},createHref:function(e){return n.createHref(l(e))},createLocation:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,i={},s=0;s ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function r(e){this.tokens=[],this.tokens.links={},this.options=e||g.defaults,this.rules=n.normal,this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,n.def=p(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d+\.)/,n.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,n.item=p(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=p(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",n.html=p(n.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,n._tag).getRegex(),n.paragraph=p(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag","<"+n._tag).getRegex(),n.blockquote=p(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=m({},n),n.gfm=m({},n.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=p(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=m({},n.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),r.rules=n,r.lex=function(e,t){return new r(t).lex(e)},r.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},r.prototype.token=function(e,t){var r,i,o,a,s,l,c,u,p,d,_;for(e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(o,t),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),_=(a=o[2]).length>1,this.tokens.push({type:"list_start",ordered:_,start:_?+a:""}),r=!1,d=(o=o[0].match(this.rules.item)).length,u=0;u1&&s.length>1||(e=o.slice(u+1).join("\n")+e,u=d-1)),i=r||/\n\n(?!\s*$)/.test(l),u!==d-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(l,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),o[3]&&(o[3]=o[3].substring(1,o[3].length-1)),p=o[1].toLowerCase(),this.tokens.links[p]||(this.tokens.links[p]={href:o[2],title:o[3]});else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:h,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function d(e,t){return _[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?_[" "+e]=e+"/":_[" "+e]=e.replace(/[^\/]*$/,"")),e=_[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,i._email=/[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,i.autolink=p(i.autolink).replace("scheme",i._scheme).replace("email",i._email).getRegex(),i._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,i._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,i.link=p(i.link).replace("inside",i._inside).replace("href",i._href).getRegex(),i.reflink=p(i.reflink).replace("inside",i._inside).getRegex(),i.normal=m({},i),i.pedantic=m({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),i.gfm=m({},i.normal,{escape:p(i.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",i._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(i.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),i.breaks=m({},i.gfm,{br:p(i.br).replace("{2,}","*").getRegex(),text:p(i.gfm.text).replace("{2,}","*").getRegex()}),o.rules=i,o.output=function(e,t,n){return new o(t,n).output(e)},o.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?"mailto:"+(n=c(this.mangle(i[1]))):n=c(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):c(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(c(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(c(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else i[0]=this.rules._backpedal.exec(i[0])[0],e=e.substring(i[0].length),"@"===i[2]?r="mailto:"+(n=c(i[0])):(n=c(i[0]),r="www."===i[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},o.prototype.outputLink=function(e,t){var n=c(t.href),r=t.title?c(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,c(e[1]))},o.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},o.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},a.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:c(e,!0))+"\n
\n":"
"+(n?e:c(e,!0))+"\n
"},a.prototype.blockquote=function(e){return"
\n"+e+"
\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n){return"'+e+"\n"},a.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},a.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},a.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},a.prototype.paragraph=function(e){return"

    "+e+"

    \n"},a.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},a.prototype.tablerow=function(e){return"\n"+e+"\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},a.prototype.strong=function(e){return""+e+""},a.prototype.em=function(e){return""+e+""},a.prototype.codespan=function(e){return""+e+""},a.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},a.prototype.del=function(e){return""+e+""},a.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(u(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!f.test(e)&&(e=d(this.options.baseUrl,e));var i='
    "},a.prototype.image=function(e,t,n){this.options.baseUrl&&!f.test(e)&&(e=d(this.options.baseUrl,e));var r=''+n+'":">"},a.prototype.text=function(e){return e},s.prototype.strong=s.prototype.em=s.prototype.codespan=s.prototype.del=s.prototype.text=function(e){return e},s.prototype.link=s.prototype.image=function(e,t,n){return""+n},s.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new o(e.links,this.options),this.inlineText=new o(e.links,m({},this.options,{renderer:new s})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;eAn error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}}h.exec=h,g.options=g.setOptions=function(e){return m(g.defaults,e),g},g.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new a,xhtml:!1,baseUrl:null},g.Parser=l,g.parser=l.parse,g.Renderer=a,g.TextRenderer=s,g.Lexer=r,g.lexer=r.lex,g.InlineLexer=o,g.inlineLexer=o.output,g.parse=g,e.exports=g}(this||"undefined"!=typeof window&&window)}).call(this,n(16))},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return p});var r=n(1),i=n.n(r),o=n(8);function a(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"component";e.debug&&i.a.checkPropTypes(l,e,"prop",t)}var p=function(){function e(t){var n=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"mapboxgl",void 0),s(this,"props",c),s(this,"_map",null),s(this,"width",0),s(this,"height",0),s(this,"_fireLoadEvent",function(){n.props.onLoad({type:"load",target:n._map})}),!t.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=t.mapboxgl,e.initialized||(e.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(t)}var t,n,r;return t=e,(n=[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(e){return this._update(this.props,e),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var e=this._map;e.isStyleLoaded()&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(t){this._map=e.savedMap;var n=this._map.getContainer(),r=t.container;for(r.classList.add("mapboxgl-map");n.childNodes.length>0;)r.appendChild(n.childNodes[0]);this._map._container=r,e.savedMap=null,t.mapStyle&&this._map.setStyle(t.mapStyle,{diff:!0}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(t){if(t.reuseMaps&&e.savedMap)this._reuse(t);else{if(t.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,t.gl}}var r={container:t.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:t.mapStyle,interactive:!1,trackResize:!1,attributionControl:t.attributionControl,preserveDrawingBuffer:t.preserveDrawingBuffer};t.transformRequest&&(r.transformRequest=t.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,t.mapOptions)),this._map.once("load",t.onLoad),this._map.on("error",t.onError)}return this}},{key:"_destroy",value:function(){this._map&&(e.savedMap?this._map.remove():(e.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(e){var t=this;u(e=Object.assign({},c,e),"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||c.mapboxApiAccessToken,this._create(e);var n=e.container;Object.defineProperty(n,"offsetWidth",{get:function(){return t.width}}),Object.defineProperty(n,"clientWidth",{get:function(){return t.width}}),Object.defineProperty(n,"offsetHeight",{get:function(){return t.height}}),Object.defineProperty(n,"clientHeight",{get:function(){return t.height}});var r=this._map.getCanvas();r&&(r.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}},{key:"_update",value:function(e,t){if(this._map){u(t=Object.assign({},this.props,t),"Mapbox");var n=this._updateMapViewport(e,t),r=this._updateMapSize(e,t);(n||r)&&this.redraw(),this.props=t}}},{key:"_updateMapSize",value:function(e,t){var n=e.width!==t.width||e.height!==t.height;return n&&(this.width=t.width,this.height=t.height,this.resize()),n}},{key:"_updateMapViewport",value:function(e,t){var n=this._getViewState(e),r=this._getViewState(t),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._getMapboxViewStateProps(t)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i}},{key:"_getViewState",value:function(e){var t=e.viewState||e,n=t.longitude,r=t.latitude,i=t.zoom,o=t.pitch,a=void 0===o?0:o,s=t.bearing,l=void 0===s?0:s,c=t.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:l,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if(void 0!==o.a)try{var t=o.a.createElement("div");if(t.className="mapboxgl-map",t.style.display="none",o.a.body.append(t),!("static"!==window.getComputedStyle(t).position)){var n=o.a.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(e,"/mapbox-gl.css")),o.a.head.append(n)}}catch(e){}}},{key:"_getMapboxViewStateProps",value:function(e){var t=this._getViewState(e);return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}])&&a(t.prototype,n),r&&a(t,r),e}();s(p,"initialized",!1),s(p,"propTypes",l),s(p,"defaultProps",c),s(p,"savedMap",null)}).call(this,n(142))},function(e,t,n){var r=n(14).Symbol;e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(7),i=n(55);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(11);(r=i)&&r.__esModule;t.default=function(e,t,n){var r=e(t,n);e.length<2&&n(r)}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(128),o=n(15),a=n(41),s=(r=a)&&r.__esModule?r:{default:r},l=n(24),c=n(18);t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getCurrentLocation,n=e.getUserConfirmation,r=e.pushLocation,a=e.replaceLocation,u=e.go,p=e.keyLength,d=void 0,_=void 0,f=[],h=[],m=[],g=function(e){var t=_&&_.action===l.POP?m.indexOf(_.key):d?m.indexOf(d.key):-1;(d=e).action===l.PUSH?m=[].concat(m.slice(0,t+1),[d.key]):d.action===l.REPLACE&&(m[t]=d.key),h.forEach(function(e){return e(d)})},y=function(e){var t,p;d&&(0,c.locationsAreEqual)(d,e)||_&&(0,c.locationsAreEqual)(_,e)||(_=e,t=e,p=function(t){if(_===e)if(_=null,t){if(e.action===l.PUSH){var n=(0,o.createPath)(d);(0,o.createPath)(e)===n&&(0,c.statesAreEqual)(d.state,e.state)&&(e.action=l.REPLACE)}e.action===l.POP?g(e):e.action===l.PUSH?!1!==r(e)&&g(e):e.action===l.REPLACE&&!1!==a(e)&&g(e)}else if(d&&e.action===l.POP){var i=m.indexOf(d.key),s=m.indexOf(e.key);-1!==i&&-1!==s&&u(i-s)}},(0,i.loopAsync)(f.length,function(e,n,r){(0,s.default)(f[e],t,function(e){return null!=e?r(e):n()})},function(e){n&&"string"==typeof e?n(e,function(e){return p(!1!==e)}):p(!1!==e)}))},v=function(){return Math.random().toString(36).substr(2,p||6)},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v();return(0,c.createLocation)(e,t,n)};return{getCurrentLocation:t,listenBefore:function(e){return f.push(e),function(){return f=f.filter(function(t){return t!==e})}},listen:function(e){return h.push(e),function(){return h=h.filter(function(t){return t!==e})}},transitionTo:y,push:function(e){return y(b(e,l.PUSH))},replace:function(e){return y(b(e,l.REPLACE))},go:u,goBack:function(){return u(-1)},goForward:function(){return u(1)},createKey:v,createPath:o.createPath,createHref:function(e){return(0,o.createPath)(e)},createLocation:b}}},function(e,t,n){"use strict";t.__esModule=!0,t.go=t.replaceLocation=t.pushLocation=t.startListener=t.getUserConfirmation=t.getCurrentLocation=void 0;var r=n(18),i=n(26),o=n(64),a=n(15),s=n(32),l=s.canUseDOM&&!(0,i.supportsPopstateOnHashchange)(),c=function(e){var t=e&&e.key;return(0,r.createLocation)({pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:t?(0,o.readState)(t):void 0},void 0,t)},u=t.getCurrentLocation=function(){var e=void 0;try{e=window.history.state||{}}catch(t){e={}}return c(e)},p=(t.getUserConfirmation=function(e,t){return t(window.confirm(e))},t.startListener=function(e){var t=function(t){(0,i.isExtraneousPopstateEvent)(t)||e(c(t.state))};(0,i.addEventListener)(window,"popstate",t);var n=function(){return e(u())};return l&&(0,i.addEventListener)(window,"hashchange",n),function(){(0,i.removeEventListener)(window,"popstate",t),l&&(0,i.removeEventListener)(window,"hashchange",n)}},function(e,t){var n=e.state,r=e.key;void 0!==n&&(0,o.saveState)(r,n),t({key:r},(0,a.createPath)(e))});t.pushLocation=function(e){return p(e,function(e,t){return window.history.pushState(e,null,t)})},t.replaceLocation=function(e){return p(e,function(e,t){return window.history.replaceState(e,null,t)})},t.go=function(e){e&&window.history.go(e)}},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,c=Object.getPrototypeOf,u=c&&c(Object);e.exports=function e(t,n,p){if("string"!=typeof n){if(u){var d=c(n);d&&d!==u&&e(t,d,p)}var _=a(n);s&&(_=_.concat(s(n)));for(var f=0;f<_.length;++f){var h=_[f];if(!(r[h]||i[h]||p&&p[h])){var m=l(n,h);try{o(t,h,m)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e)?e={entries:e}:"string"==typeof e&&(e={entries:[e]});var t=function(){var e=p[d],t=(0,a.createPath)(e),n=void 0,i=void 0;e.key&&(n=e.key,i=h(n));var s=(0,a.parsePath)(t);return(0,o.createLocation)(r({},s,{state:i}),void 0,n)},n=function(e){var t=d+e;return t>=0&&t=0&&d0&&void 0!==arguments[0]?arguments[0]:{};o.canUseDOM||(0,i.default)(!1);var t=e.forceRefresh||!(0,l.supportsHistory)()?s:a,n=t.getUserConfirmation,u=t.getCurrentLocation,p=t.pushLocation,d=t.replaceLocation,_=t.go,f=(0,c.default)(r({getUserConfirmation:n},e,{getCurrentLocation:u,pushLocation:p,replaceLocation:d,go:_})),h=0,m=void 0,g=function(e,t){1==++h&&(m=a.startListener(f.transitionTo));var n=t?f.listenBefore(e):f.listen(e);return function(){n(),0==--h&&m()}};return r({},f,{listenBefore:function(e){return g(e,!0)},listen:function(e){return g(e,!1)}})}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};o.canUseDOM||(0,i.default)(!1);var t=e.queryKey,n=e.hashType;"string"!=typeof t&&(t="_k"),null==n&&(n="slash"),n in p||(n="slash");var c=p[n],u=s.getUserConfirmation,d=(0,l.default)(r({getUserConfirmation:u},e,{getCurrentLocation:function(){return s.getCurrentLocation(c,t)},pushLocation:function(e){return s.pushLocation(e,c,t)},replaceLocation:function(e){return s.replaceLocation(e,c,t)},go:s.go})),_=0,f=void 0,h=function(e,n){1==++_&&(f=s.startListener(d.transitionTo,c,t));var r=n?d.listenBefore(e):d.listen(e);return function(){r(),0==--_&&f()}};(0,a.supportsGoWithoutReloadUsingHash)();return r({},d,{listenBefore:function(e){return h(e,!0)},listen:function(e){return h(e,!1)},go:function(e){d.go(e)},createHref:function(e){return"#"+c.encodePath(d.createHref(e))}})}},function(e,t,n){e.exports=n(87)},function(e,t){e.exports=function(e){return null===e}},function(e){e.exports=[{coordinates:[[-122.3933557873733,37.794219992184324],[-122.39367189820892,37.79398165755795],[-122.39401838092769,37.79388241198406],[-122.3947071294908,37.794423228499795],[-122.39494688373745,37.79445423060049],[-122.39571409732676,37.793858299053696],[-122.39741853206209,37.79245284608079],[-122.39918399515115,37.79106459055073],[-122.40003607642596,37.79035713167143],[-122.40213357823212,37.790068858430104],[-122.40388909604812,37.78983463559349],[-122.4054166245374,37.78960041201444],[-122.40869967084274,37.78920403195862],[-122.41193711928267,37.788789632353996],[-122.41526576345333,37.788429282982534],[-122.41848041296066,37.78799686141706],[-122.42820266442968,37.78667030140305],[-122.43987587617389,37.785191419954316],[-122.43880657433475,37.78061374219536],[-122.43827192341516,37.777866999452826],[-122.44669267539851,37.776704885260315],[-122.44660356691189,37.7757540509692],[-122.45453422221897,37.77476798767644]]},{coordinates:[[-122.44080380201595,37.75251037780083],[-122.4425396821639,37.7523902843234],[-122.44225217701438,37.75281918870459],[-122.44200806886859,37.75321806754765],[-122.44180193310093,37.753471118602434],[-122.44130829218389,37.75388286084137],[-122.44084177439416,37.75459482638962],[-122.44071982406115,37.7546745592597],[-122.44044034714439,37.75508766756418],[-122.44012846710689,37.75567049861364],[-122.44005961047523,37.755907472562626],[-122.44015276944751,37.75640703677898],[-122.44018924596475,37.756528133045606],[-122.44033181327828,37.75666225134219],[-122.44070537573275,37.75680778368681],[-122.44023039641965,37.75725150991822],[-122.43988427866199,37.757200599225015],[-122.4395582840298,37.75708923196163],[-122.43904715664357,37.757098777733574],[-122.4390310581432,37.75743287897778],[-122.43797228289426,37.757496186354615],[-122.43690020835358,37.75758520091664],[-122.43582256860111,37.75763591465913],[-122.43356465673874,37.75773734204003],[-122.43248701698633,37.7578184838447],[-122.4326537945671,37.75940073124414],[-122.43275642692444,37.76103365621418],[-122.43285905928187,37.76182474975916],[-122.43293905683697,37.762663828581225],[-122.43313584578942,37.764194972084184],[-122.43195511207469,37.76511200542191],[-122.4310229538788,37.76584889897153],[-122.42984222016415,37.766757724237436],[-122.4285786279431,37.76783028743526],[-122.42690074319054,37.76905839413027],[-122.42561643634292,37.77008998799232],[-122.42458070501422,37.77093326434769],[-122.42341032861272,37.77189114912355],[-122.42198101937899,37.77302094598606],[-122.42074849909775,37.773970616950706],[-122.41969205314248,37.774813849048584],[-122.41863560718714,37.77560795203675],[-122.41794166719687,37.77623831637716]]}]},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(1),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default.shape({subscribe:o.default.func.isRequired,dispatch:o.default.func.isRequired,getState:o.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(16))},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n-1:!!u&&r(e,t,n)>-1}},function(e,t,n){var r=n(61),i=n(111),o=n(57),a=n(19),s=n(40),l=n(58),c=n(62),u=n(60),p="[object Map]",d="[object Set]",_=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||o(e)))return!e.length;var t=i(e);if(t==p||t==d)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(_.call(e,n))return!1;return!0}},function(e,t,n){var r=n(121);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=e.head||e.getElementsByTagName("head")[0],i=e.createElement("style");i.id="detectElementResize",i.type="text/css",null!=t&&i.setAttribute("nonce",t),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(e.createTextNode(n)),r.appendChild(i)}}(i),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=i.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='
    ',e.appendChild(e.__resizeTriggers__),l(e),e.addEventListener("scroll",c,!0),d&&(e.__resizeTriggers__.__animationListener__=function(t){t.animationName==g&&l(e)},e.__resizeTriggers__.addEventListener(d,e.__resizeTriggers__.__animationListener__))}e.__resizeListeners__.push(r)}},removeResizeListener:function(e,t){if(o)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",c,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(d,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}var o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=function(){function e(e,t){for(var n=0;ne[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]O.length&&O.push(e)}function I(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case a:l=!0}}if(l)return r(i,t,""===n?"."+M(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;cthis.eventPool.length&&this.eventPool.push(e)}function _e(e){e.eventPool=[],e.getPooled=pe,e.release=de}i(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=le)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=le)},persist:function(){this.isPersistent=le},isPersistent:ce,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ce,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,_e(n),n},_e(ue);var fe=ue.extend({data:null}),he=ue.extend({data:null}),me=[9,13,27,32],ge=W&&"CompositionEvent"in window,ye=null;W&&"documentMode"in document&&(ye=document.documentMode);var ve=W&&"TextEvent"in window&&!ye,be=W&&(!ge||ye&&8=ye),Ee=String.fromCharCode(32),Se={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Te=!1;function Ae(e,t){switch(e){case"keyup":return-1!==me.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function we(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var xe=!1;var Ce={eventTypes:Se,extractEvents:function(e,t,n,r){var i=void 0,o=void 0;if(ge)e:{switch(e){case"compositionstart":i=Se.compositionStart;break e;case"compositionend":i=Se.compositionEnd;break e;case"compositionupdate":i=Se.compositionUpdate;break e}i=void 0}else xe?Ae(e,n)&&(i=Se.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=Se.compositionStart);return i?(be&&"ko"!==n.locale&&(xe||i!==Se.compositionStart?i===Se.compositionEnd&&xe&&(o=se()):(oe="value"in(ie=r)?ie.value:ie.textContent,xe=!0)),i=fe.getPooled(i,t,n,r),o?i.data=o:null!==(o=we(n))&&(i.data=o),H(i),o=i):o=null,(e=ve?function(e,t){switch(e){case"compositionend":return we(t);case"keypress":return 32!==t.which?null:(Te=!0,Ee);case"textInput":return(e=t.data)===Ee&&Te?null:e;default:return null}}(e,n):function(e,t){if(xe)return"compositionend"===e||!ge&&Ae(e,t)?(e=se(),ae=oe=ie=null,xe=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1
    ").concat(n,""):"".concat(n,"")},Tg.image=function(e,t,n){return").concat(n,")};var wg=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=gg(this,yg(t).call(this,e))).state={html:Ag(e.content)},n._anchorPositions=null,n._currentSection=null,n._internalScroll=!1,n}var n,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vg(e,t)}(t,r["PureComponent"]),n=t,(o=[{key:"componentDidMount",value:function(){this._jumpTo(this.props.query.section)}},{key:"componentWillReceiveProps",value:function(e){e.content!==this.props.content&&(this.setState({html:Ag(e.content)}),this._anchorPositions=null,this._currentSection=null)}},{key:"componentDidUpdate",value:function(){this._jumpTo(this.props.query.section)}},{key:"_getScrollPosition",value:function(e){for(var t=this.refs.container,n=-28;e&&Number.isFinite(e.offsetTop)&&e!==t;)n+=e.offsetTop,e=e.parentNode;return n}},{key:"_jumpTo",value:function(e){if(e!==this._currentSection){var t=this.refs.container.querySelector("#".concat(e)),n=this._getScrollPosition(t);this.refs.container.scrollTop!==n&&(this._internalScroll=!0,this.refs.container.scrollTop=n)}}},{key:"_onScroll",value:function(e){if(this._internalScroll)this._internalScroll=!1;else{var t,n=this._anchorPositions,r=e.target.scrollTop;if(!n){n={};var i=this.refs.container.querySelectorAll("h2[id],h3[id]"),o=!0,a=!1,s=void 0;try{for(var l,c=i[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var u=l.value;n[u.id]=this._getScrollPosition(u)}}catch(e){a=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}this._anchorPositions=n}for(var p in n){if(!(n[p]<=r))break;t=p}t!==this._currentSection&&(this._currentSection=t,this.props.updateQueryString(t?"?section=".concat(t):""))}}},{key:"render",value:function(){var e=this.state.html;return i.a.createElement("div",{className:"markdown",ref:"container",onScroll:this._onScroll.bind(this)},e.split(Sg).map(function(e,t){return e?i.a.createElement("div",{key:t,className:"markdown-body",dangerouslySetInnerHTML:{__html:e}}):null}))}}])&&mg(n.prototype,o),a&&mg(n,a),t}();function xg(e){return(xg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cg(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:Dg,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=n.children,a=n.path,s=n.content,l=n.component;return o?i.a.createElement($e,{key:r,path:a},i.a.createElement(Qe,{to:Lg(o)}),o.map(e.bind(null,t))):i.a.createElement($e,{key:r,path:a,childComponent:l,component:t,content:s})}.bind(null,n)),i.a.createElement(We,{from:"*",to:r}))},Ug=document.createElement("div");document.body.appendChild(Ug),a.a.render(i.a.createElement(s.Provider,{store:G},i.a.createElement(function(){return i.a.createElement(ze,{history:Pg},i.a.createElement($e,{path:"/",component:Zt},i.a.createElement(Ke,{component:on}),fg.map(function(e){return kg(e.title,e.paths,e.pageComponent)}),i.a.createElement(We,{from:"*",to:"/"})))},null)),Ug)}]);