searchsmartly-ui 0.0.112 → 0.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ object-assign
|
|
|
30
30
|
* Released under MIT license <https://lodash.com/license>
|
|
31
31
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
32
32
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
33
|
-
*/!function(e,t){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",u]],g="[object Arguments]",A="[object Array]",_="[object Boolean]",y="[object Date]",x="[object Error]",v="[object Function]",b="[object GeneratorFunction]",w="[object Map]",C="[object Number]",T="[object Object]",E="[object Promise]",M="[object RegExp]",S="[object Set]",I="[object String]",D="[object Symbol]",k="[object WeakMap]",L="[object ArrayBuffer]",O="[object DataView]",z="[object Float32Array]",B="[object Float64Array]",R="[object Int8Array]",F="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",N="[object Uint8ClampedArray]",U="[object Uint16Array]",H="[object Uint32Array]",G=/\b__p \+= '';/g,Z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Q.source),Y=RegExp(q.source),$=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(ie.source),oe=/^\s+/,se=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['’]",De="["+we+"]",ke="["+Ie+"]",Le="["+Ce+"]",Oe="\\d+",ze="["+Te+"]",Be="["+Ee+"]",Re="[^"+we+Ie+Oe+Te+Ee+Me+"]",Fe="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Me+"]",He="\\u200d",Ge="(?:"+Be+"|"+Re+")",Ze="(?:"+Ue+"|"+Re+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Le+"|"+Fe+")"+"?",Xe="["+Se+"]?",Ye=Xe+qe+("(?:"+He+"(?:"+[je,Ve,Ne].join("|")+")"+Xe+qe+")*"),$e="(?:"+[ze,Ve,Ne].join("|")+")"+Ye,Ke="(?:"+[je+Le+"?",Le,Ve,Ne,De].join("|")+")",Je=RegExp(Pe,"g"),et=RegExp(Le,"g"),tt=RegExp(Fe+"(?="+Fe+")|"+Ke+Ye,"g"),rt=RegExp([Ue+"?"+Be+"+"+We+"(?="+[ke,Ue,"$"].join("|")+")",Ze+"+"+Qe+"(?="+[ke,Ue+Ge,"$"].join("|")+")",Ue+"?"+Ge+"+"+We,Ue+"+"+Qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,$e].join("|"),"g"),it=RegExp("["+He+we+Ce+Se+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[z]=at[B]=at[R]=at[F]=at[j]=at[V]=at[N]=at[U]=at[H]=!0,at[g]=at[A]=at[L]=at[_]=at[O]=at[y]=at[x]=at[v]=at[w]=at[C]=at[T]=at[M]=at[S]=at[I]=at[k]=!1;var lt={};lt[g]=lt[A]=lt[L]=lt[O]=lt[_]=lt[y]=lt[z]=lt[B]=lt[R]=lt[F]=lt[j]=lt[w]=lt[C]=lt[T]=lt[M]=lt[S]=lt[I]=lt[D]=lt[V]=lt[N]=lt[U]=lt[H]=!0,lt[x]=lt[v]=lt[k]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ht=parseInt,dt="object"==typeof P&&P&&P.Object===Object&&P,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,At=gt&>.exports===mt,_t=At&&dt.process,yt=function(){try{var e=gt&>.require&>.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),xt=yt&&yt.isArrayBuffer,vt=yt&&yt.isDate,bt=yt&&yt.isMap,wt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,Tt=yt&&yt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Mt(e,t,r,i){for(var n=-1,o=null==e?0:e.length;++n<o;){var s=e[n];t(i,s,r(s),e)}return i}function St(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}function Dt(e,t){for(var r=-1,i=null==e?0:e.length,n=0,o=[];++r<i;){var s=e[r];t(s,r,e)&&(o[n++]=s)}return o}function kt(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Lt(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function Ot(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function zt(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function Bt(e,t,r,i){var n=-1,o=null==e?0:e.length;for(i&&o&&(r=e[++n]);++n<o;)r=t(r,e[n],n,e);return r}function Rt(e,t,r,i){var n=null==e?0:e.length;for(i&&n&&(r=e[--n]);n--;)r=t(r,e[n],n,e);return r}function Ft(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var jt=Wt("length");function Vt(e,t,r){var i;return r(e,(function(e,r,n){if(t(e,r,n))return i=r,!1})),i}function Nt(e,t,r,i){for(var n=e.length,o=r+(i?1:-1);i?o--:++o<n;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var i=r-1,n=e.length;for(;++i<n;)if(e[i]===t)return i;return-1}(e,t,r):Nt(e,Gt,r)}function Ht(e,t,r,i){for(var n=r-1,o=e.length;++n<o;)if(i(e[n],t))return n;return-1}function Gt(e){return e!=e}function Zt(e,t){var r=null==e?0:e.length;return r?Xt(e,t)/r:p}function Wt(e){return function(t){return null==t?r:t[e]}}function Qt(e){return function(t){return null==e?r:e[t]}}function qt(e,t,r,i,n){return n(e,(function(e,n,o){r=i?(i=!1,e):t(r,e,n,o)})),r}function Xt(e,t){for(var i,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==r&&(i=i===r?s:i+s)}return i}function Yt(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function $t(e){return e?e.slice(0,fr(e)+1).replace(oe,""):e}function Kt(e){return function(t){return e(t)}}function Jt(e,t){return Ot(t,(function(t){return e[t]}))}function er(e,t){return e.has(t)}function tr(e,t){for(var r=-1,i=e.length;++r<i&&Ut(t,e[r],0)>-1;);return r}function rr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var ir=Qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ct[e]}function sr(e){return it.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var a=e[r];a!==t&&a!==o||(e[r]=o,s[n++]=r)}return s}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):jt(e)}function pr(e){return sr(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mr=Qt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gr=function e(t){var P,se=(t=null==t?ft:gr.defaults(ft.Object(),t,gr.pick(ft,ot))).Array,we=t.Date,Ce=t.Error,Te=t.Function,Ee=t.Math,Me=t.Object,Se=t.RegExp,Ie=t.String,Pe=t.TypeError,De=se.prototype,ke=Te.prototype,Le=Me.prototype,Oe=t["__core-js_shared__"],ze=ke.toString,Be=Le.hasOwnProperty,Re=0,Fe=(P=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",je=Le.toString,Ve=ze.call(Me),Ne=ft._,Ue=Se("^"+ze.call(Be).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=At?t.Buffer:r,Ge=t.Symbol,Ze=t.Uint8Array,We=He?He.allocUnsafe:r,Qe=lr(Me.getPrototypeOf,Me),qe=Me.create,Xe=Le.propertyIsEnumerable,Ye=De.splice,$e=Ge?Ge.isConcatSpreadable:r,Ke=Ge?Ge.iterator:r,tt=Ge?Ge.toStringTag:r,it=function(){try{var e=po(Me,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ft.Date.now&&we.now,pt=t.setTimeout!==ft.setTimeout&&t.setTimeout,mt=Ee.ceil,gt=Ee.floor,_t=Me.getOwnPropertySymbols,yt=He?He.isBuffer:r,jt=t.isFinite,Qt=De.join,Ar=lr(Me.keys,Me),_r=Ee.max,yr=Ee.min,xr=we.now,vr=t.parseInt,br=Ee.random,wr=De.reverse,Cr=po(t,"DataView"),Tr=po(t,"Map"),Er=po(t,"Promise"),Mr=po(t,"Set"),Sr=po(t,"WeakMap"),Ir=po(Me,"create"),Pr=Sr&&new Sr,Dr={},kr=jo(Cr),Lr=jo(Tr),Or=jo(Er),zr=jo(Mr),Br=jo(Sr),Rr=Ge?Ge.prototype:r,Fr=Rr?Rr.valueOf:r,jr=Rr?Rr.toString:r;function Vr(e){if(ra(e)&&!Zs(e)&&!(e instanceof Gr)){if(e instanceof Hr)return e;if(Be.call(e,"__wrapped__"))return Vo(e)}return new Hr(e)}var Nr=function(){function e(){}return function(t){if(!ta(t))return{};if(qe)return qe(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function Ur(){}function Hr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Qr;++t<r;)this.add(e[t])}function Xr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Zs(e),i=!r&&Gs(e),n=!r&&!i&&Xs(e),o=!r&&!i&&!n&&ua(e),s=r||i||n||o,a=s?Yt(e.length,Ie):[],l=a.length;for(var c in e)!t&&!Be.call(e,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xo(c,l))||a.push(c);return a}function $r(e){var t=e.length;return t?e[qi(0,t-1)]:r}function Kr(e,t){return Bo(Pn(e),ai(t,0,e.length))}function Jr(e){return Bo(Pn(e))}function ei(e,t,i){(i!==r&&!Ns(e[t],i)||i===r&&!(t in e))&&oi(e,t,i)}function ti(e,t,i){var n=e[t];Be.call(e,t)&&Ns(n,i)&&(i!==r||t in e)||oi(e,t,i)}function ri(e,t){for(var r=e.length;r--;)if(Ns(e[r][0],t))return r;return-1}function ii(e,t,r,i){return di(e,(function(e,n,o){t(i,e,r(e),o)})),i}function ni(e,t){return e&&Dn(t,ka(t),e)}function oi(e,t,r){"__proto__"==t&&it?it(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function si(e,t){for(var i=-1,n=t.length,o=se(n),s=null==e;++i<n;)o[i]=s?r:Ma(e,t[i]);return o}function ai(e,t,i){return e==e&&(i!==r&&(e=e<=i?e:i),t!==r&&(e=e>=t?e:t)),e}function li(e,t,i,n,o,s){var a,l=1&t,c=2&t,u=4&t;if(i&&(a=o?i(e,n,o,s):i(e)),a!==r)return a;if(!ta(e))return e;var h=Zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Pn(e,a)}else{var d=go(e),p=d==v||d==b;if(Xs(e))return Cn(e,l);if(d==T||d==g||p&&!o){if(a=c||p?{}:_o(e),!l)return c?function(e,t){return Dn(e,mo(e),t)}(e,function(e,t){return e&&Dn(t,La(t),e)}(a,e)):function(e,t){return Dn(e,fo(e),t)}(e,ni(a,e))}else{if(!lt[d])return o?e:{};a=function(e,t,r){var i=e.constructor;switch(t){case L:return Tn(e);case _:case y:return new i(+e);case O:return function(e,t){var r=t?Tn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case z:case B:case R:case F:case j:case V:case N:case U:case H:return En(e,r);case w:return new i;case C:case I:return new i(e);case M:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case S:return new i;case D:return n=e,Fr?Me(Fr.call(n)):{}}var n}(e,d,l)}}s||(s=new Xr);var f=s.get(e);if(f)return f;s.set(e,a),aa(e)?e.forEach((function(r){a.add(li(r,t,i,r,e,s))})):ia(e)&&e.forEach((function(r,n){a.set(n,li(r,t,i,n,e,s))}));var m=h?r:(u?c?oo:no:c?La:ka)(e);return St(m||e,(function(r,n){m&&(r=e[n=r]),ti(a,n,li(r,t,i,n,e,s))})),a}function ci(e,t,i){var n=i.length;if(null==e)return!n;for(e=Me(e);n--;){var o=i[n],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function ui(e,t,n){if("function"!=typeof e)throw new Pe(i);return ko((function(){e.apply(r,n)}),t)}function hi(e,t,r,i){var n=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=Ot(t,Kt(r))),i?(o=Lt,s=!1):t.length>=200&&(o=er,s=!1,t=new qr(t));e:for(;++n<a;){var u=e[n],h=null==r?u:r(u);if(u=i||0!==u?u:0,s&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,i)||l.push(u)}return l}Vr.templateSettings={escape:$,evaluate:K,interpolate:J,variable:"",imports:{_:Vr}},Vr.prototype=Ur.prototype,Vr.prototype.constructor=Vr,Hr.prototype=Nr(Ur.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Nr(Ur.prototype),Gr.prototype.constructor=Gr,Zr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Zr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zr.prototype.get=function(e){var t=this.__data__;if(Ir){var i=t[e];return i===n?r:i}return Be.call(t,e)?t[e]:r},Zr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Be.call(t,e)},Zr.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ir&&t===r?n:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=ri(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Wr.prototype.get=function(e){var t=this.__data__,i=ri(t,e);return i<0?r:t[i][1]},Wr.prototype.has=function(e){return ri(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,i=ri(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Tr||Wr),string:new Zr}},Qr.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Qr.prototype.get=function(e){return uo(this,e).get(e)},Qr.prototype.has=function(e){return uo(this,e).has(e)},Qr.prototype.set=function(e,t){var r=uo(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,n),this},qr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Xr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Xr.prototype.get=function(e){return this.__data__.get(e)},Xr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!Tr||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qr(i)}return r.set(e,t),this.size=r.size,this};var di=On(xi),pi=On(vi,!0);function fi(e,t){var r=!0;return di(e,(function(e,i,n){return r=!!t(e,i,n)})),r}function mi(e,t,i){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(l===r?a==a&&!ca(a):i(a,l)))var l=a,c=s}return c}function gi(e,t){var r=[];return di(e,(function(e,i,n){t(e,i,n)&&r.push(e)})),r}function Ai(e,t,r,i,n){var o=-1,s=e.length;for(r||(r=yo),n||(n=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?Ai(a,t-1,r,i,n):zt(n,a):i||(n[n.length]=a)}return n}var _i=zn(),yi=zn(!0);function xi(e,t){return e&&_i(e,t,ka)}function vi(e,t){return e&&yi(e,t,ka)}function bi(e,t){return Dt(t,(function(t){return Ks(e[t])}))}function wi(e,t){for(var i=0,n=(t=xn(t,e)).length;null!=e&&i<n;)e=e[Fo(t[i++])];return i&&i==n?e:r}function Ci(e,t,r){var i=t(e);return Zs(e)?i:zt(i,r(e))}function Ti(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Me(e)?function(e){var t=Be.call(e,tt),i=e[tt];try{e[tt]=r;var n=!0}catch(e){}var o=je.call(e);n&&(t?e[tt]=i:delete e[tt]);return o}(e):function(e){return je.call(e)}(e)}function Ei(e,t){return e>t}function Mi(e,t){return null!=e&&Be.call(e,t)}function Si(e,t){return null!=e&&t in Me(e)}function Ii(e,t,i){for(var n=i?Lt:kt,o=e[0].length,s=e.length,a=s,l=se(s),c=1/0,u=[];a--;){var h=e[a];a&&t&&(h=Ot(h,Kt(t))),c=yr(h.length,c),l[a]=!i&&(t||o>=120&&h.length>=120)?new qr(a&&h):r}h=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<c;){var f=h[d],m=t?t(f):f;if(f=i||0!==f?f:0,!(p?er(p,m):n(u,m,i))){for(a=s;--a;){var g=l[a];if(!(g?er(g,m):n(e[a],m,i)))continue e}p&&p.push(m),u.push(f)}}return u}function Pi(e,t,i){var n=null==(e=Io(e,t=xn(t,e)))?e:e[Fo($o(t))];return null==n?r:Et(n,e,i)}function Di(e){return ra(e)&&Ti(e)==g}function ki(e,t,i,n,o){return e===t||(null==e||null==t||!ra(e)&&!ra(t)?e!=e&&t!=t:function(e,t,i,n,o,s){var a=Zs(e),l=Zs(t),c=a?A:go(e),u=l?A:go(t),h=(c=c==g?T:c)==T,d=(u=u==g?T:u)==T,p=c==u;if(p&&Xs(e)){if(!Xs(t))return!1;a=!0,h=!1}if(p&&!h)return s||(s=new Xr),a||ua(e)?ro(e,t,i,n,o,s):function(e,t,r,i,n,o,s){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!o(new Ze(e),new Ze(t)));case _:case y:case C:return Ns(+e,+t);case x:return e.name==t.name&&e.message==t.message;case M:case I:return e==t+"";case w:var a=ar;case S:var l=1&i;if(a||(a=ur),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;i|=2,s.set(e,t);var u=ro(a(e),a(t),i,n,o,s);return s.delete(e),u;case D:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,i,n,o,s);if(!(1&i)){var f=h&&Be.call(e,"__wrapped__"),m=d&&Be.call(t,"__wrapped__");if(f||m){var v=f?e.value():e,b=m?t.value():t;return s||(s=new Xr),o(v,b,i,n,s)}}if(!p)return!1;return s||(s=new Xr),function(e,t,i,n,o,s){var a=1&i,l=no(e),c=l.length,u=no(t),h=u.length;if(c!=h&&!a)return!1;var d=c;for(;d--;){var p=l[d];if(!(a?p in t:Be.call(t,p)))return!1}var f=s.get(e),m=s.get(t);if(f&&m)return f==t&&m==e;var g=!0;s.set(e,t),s.set(t,e);var A=a;for(;++d<c;){var _=e[p=l[d]],y=t[p];if(n)var x=a?n(y,_,p,t,e,s):n(_,y,p,e,t,s);if(!(x===r?_===y||o(_,y,i,n,s):x)){g=!1;break}A||(A="constructor"==p)}if(g&&!A){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(g=!1)}return s.delete(e),s.delete(t),g}(e,t,i,n,o,s)}(e,t,i,n,ki,o))}function Li(e,t,i,n){var o=i.length,s=o,a=!n;if(null==e)return!s;for(e=Me(e);o--;){var l=i[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=i[o])[0],u=e[c],h=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var d=new Xr;if(n)var p=n(u,h,c,e,t,d);if(!(p===r?ki(h,u,3,n,d):p))return!1}}return!0}function Oi(e){return!(!ta(e)||(t=e,Fe&&Fe in t))&&(Ks(e)?Ue:Ae).test(jo(e));var t}function zi(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Zs(e)?Ni(e[0],e[1]):Vi(e):pl(e)}function Bi(e){if(!To(e))return Ar(e);var t=[];for(var r in Me(e))Be.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Ri(e){if(!ta(e))return function(e){var t=[];if(null!=e)for(var r in Me(e))t.push(r);return t}(e);var t=To(e),r=[];for(var i in e)("constructor"!=i||!t&&Be.call(e,i))&&r.push(i);return r}function Fi(e,t){return e<t}function ji(e,t){var r=-1,i=Qs(e)?se(e.length):[];return di(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Vi(e){var t=ho(e);return 1==t.length&&t[0][2]?Mo(t[0][0],t[0][1]):function(r){return r===e||Li(r,e,t)}}function Ni(e,t){return bo(e)&&Eo(t)?Mo(Fo(e),t):function(i){var n=Ma(i,e);return n===r&&n===t?Sa(i,e):ki(t,n,3)}}function Ui(e,t,i,n,o){e!==t&&_i(t,(function(s,a){if(o||(o=new Xr),ta(s))!function(e,t,i,n,o,s,a){var l=Po(e,i),c=Po(t,i),u=a.get(c);if(u)return void ei(e,i,u);var h=s?s(l,c,i+"",e,t,a):r,d=h===r;if(d){var p=Zs(c),f=!p&&Xs(c),m=!p&&!f&&ua(c);h=c,p||f||m?Zs(l)?h=l:qs(l)?h=Pn(l):f?(d=!1,h=Cn(c,!0)):m?(d=!1,h=En(c,!0)):h=[]:oa(c)||Gs(c)?(h=l,Gs(l)?h=_a(l):ta(l)&&!Ks(l)||(h=_o(c))):d=!1}d&&(a.set(c,h),o(h,c,n,s,a),a.delete(c));ei(e,i,h)}(e,t,a,i,Ui,n,o);else{var l=n?n(Po(e,a),s,a+"",e,t,o):r;l===r&&(l=s),ei(e,a,l)}}),La)}function Hi(e,t){var i=e.length;if(i)return xo(t+=t<0?i:0,i)?e[t]:r}function Gi(e,t,r){t=t.length?Ot(t,(function(e){return Zs(e)?function(t){return wi(t,1===e.length?e[0]:e)}:e})):[nl];var i=-1;t=Ot(t,Kt(co()));var n=ji(e,(function(e,r,n){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++i,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(n,(function(e,t){return function(e,t,r){var i=-1,n=e.criteria,o=t.criteria,s=n.length,a=r.length;for(;++i<s;){var l=Mn(n[i],o[i]);if(l)return i>=a?l:l*("desc"==r[i]?-1:1)}return e.index-t.index}(e,t,r)}))}function Zi(e,t,r){for(var i=-1,n=t.length,o={};++i<n;){var s=t[i],a=wi(e,s);r(a,s)&&Ji(o,xn(s,e),a)}return o}function Wi(e,t,r,i){var n=i?Ht:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Pn(t)),r&&(a=Ot(e,Kt(r)));++o<s;)for(var l=0,c=t[o],u=r?r(c):c;(l=n(a,u,l,i))>-1;)a!==e&&Ye.call(a,l,1),Ye.call(e,l,1);return e}function Qi(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==o){var o=n;xo(n)?Ye.call(e,n,1):dn(e,n)}}return e}function qi(e,t){return e+gt(br()*(t-e+1))}function Xi(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Yi(e,t){return Lo(So(e,t,nl),e+"")}function $i(e){return $r(Na(e))}function Ki(e,t){var r=Na(e);return Bo(r,ai(t,0,r.length))}function Ji(e,t,i,n){if(!ta(e))return e;for(var o=-1,s=(t=xn(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Fo(t[o]),u=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var h=l[c];(u=n?n(h,c,l):r)===r&&(u=ta(h)?h:xo(t[o+1])?[]:{})}ti(l,c,u),l=l[c]}return e}var en=Pr?function(e,t){return Pr.set(e,t),e}:nl,tn=it?function(e,t){return it(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:nl;function rn(e){return Bo(Na(e))}function nn(e,t,r){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var o=se(n);++i<n;)o[i]=e[i+t];return o}function on(e,t){var r;return di(e,(function(e,i,n){return!(r=t(e,i,n))})),!!r}function sn(e,t,r){var i=0,n=null==e?i:e.length;if("number"==typeof t&&t==t&&n<=2147483647){for(;i<n;){var o=i+n>>>1,s=e[o];null!==s&&!ca(s)&&(r?s<=t:s<t)?i=o+1:n=o}return n}return an(e,t,nl,r)}function an(e,t,i,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=i(t))!=t,l=null===t,c=ca(t),u=t===r;o<s;){var h=gt((o+s)/2),d=i(e[h]),p=d!==r,f=null===d,m=d==d,g=ca(d);if(a)var A=n||m;else A=u?m&&(n||p):l?m&&p&&(n||!f):c?m&&p&&!f&&(n||!g):!f&&!g&&(n?d<=t:d<t);A?o=h+1:s=h}return yr(s,4294967294)}function ln(e,t){for(var r=-1,i=e.length,n=0,o=[];++r<i;){var s=e[r],a=t?t(s):s;if(!r||!Ns(a,l)){var l=a;o[n++]=0===s?0:s}}return o}function cn(e){return"number"==typeof e?e:ca(e)?p:+e}function un(e){if("string"==typeof e)return e;if(Zs(e))return Ot(e,un)+"";if(ca(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hn(e,t,r){var i=-1,n=kt,o=e.length,s=!0,a=[],l=a;if(r)s=!1,n=Lt;else if(o>=200){var c=t?null:Yn(e);if(c)return ur(c);s=!1,n=er,l=new qr}else l=t?[]:a;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=r||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(u)}else n(l,h,r)||(l!==a&&l.push(h),a.push(u))}return a}function dn(e,t){return null==(e=Io(e,t=xn(t,e)))||delete e[Fo($o(t))]}function pn(e,t,r,i){return Ji(e,t,r(wi(e,t)),i)}function fn(e,t,r,i){for(var n=e.length,o=i?n:-1;(i?o--:++o<n)&&t(e[o],o,e););return r?nn(e,i?0:o,i?o+1:n):nn(e,i?o+1:0,i?n:o)}function mn(e,t){var r=e;return r instanceof Gr&&(r=r.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,zt([e],t.args))}),r)}function gn(e,t,r){var i=e.length;if(i<2)return i?hn(e[0]):[];for(var n=-1,o=se(i);++n<i;)for(var s=e[n],a=-1;++a<i;)a!=n&&(o[n]=hi(o[n]||s,e[a],t,r));return hn(Ai(o,1),t,r)}function An(e,t,i){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var l=n<s?t[n]:r;i(a,e[n],l)}return a}function _n(e){return qs(e)?e:[]}function yn(e){return"function"==typeof e?e:nl}function xn(e,t){return Zs(e)?e:bo(e,t)?[e]:Ro(ya(e))}var vn=Yi;function bn(e,t,i){var n=e.length;return i=i===r?n:i,!t&&i>=n?e:nn(e,t,i)}var wn=ct||function(e){return ft.clearTimeout(e)};function Cn(e,t){if(t)return e.slice();var r=e.length,i=We?We(r):new e.constructor(r);return e.copy(i),i}function Tn(e){var t=new e.constructor(e.byteLength);return new Ze(t).set(new Ze(e)),t}function En(e,t){var r=t?Tn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Mn(e,t){if(e!==t){var i=e!==r,n=null===e,o=e==e,s=ca(e),a=t!==r,l=null===t,c=t==t,u=ca(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||n&&a&&c||!i&&c||!o)return 1;if(!n&&!s&&!u&&e<t||u&&i&&o&&!n&&!s||l&&i&&o||!a&&o||!c)return-1}return 0}function Sn(e,t,r,i){for(var n=-1,o=e.length,s=r.length,a=-1,l=t.length,c=_r(o-s,0),u=se(l+c),h=!i;++a<l;)u[a]=t[a];for(;++n<s;)(h||n<o)&&(u[r[n]]=e[n]);for(;c--;)u[a++]=e[n++];return u}function In(e,t,r,i){for(var n=-1,o=e.length,s=-1,a=r.length,l=-1,c=t.length,u=_r(o-a,0),h=se(u+c),d=!i;++n<u;)h[n]=e[n];for(var p=n;++l<c;)h[p+l]=t[l];for(;++s<a;)(d||n<o)&&(h[p+r[s]]=e[n++]);return h}function Pn(e,t){var r=-1,i=e.length;for(t||(t=se(i));++r<i;)t[r]=e[r];return t}function Dn(e,t,i,n){var o=!i;i||(i={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=n?n(i[l],e[l],l,i,e):r;c===r&&(c=e[l]),o?oi(i,l,c):ti(i,l,c)}return i}function kn(e,t){return function(r,i){var n=Zs(r)?Mt:ii,o=t?t():{};return n(r,e,co(i,2),o)}}function Ln(e){return Yi((function(t,i){var n=-1,o=i.length,s=o>1?i[o-1]:r,a=o>2?i[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&vo(i[0],i[1],a)&&(s=o<3?r:s,o=1),t=Me(t);++n<o;){var l=i[n];l&&e(t,l,n,s)}return t}))}function On(e,t){return function(r,i){if(null==r)return r;if(!Qs(r))return e(r,i);for(var n=r.length,o=t?n:-1,s=Me(r);(t?o--:++o<n)&&!1!==i(s[o],o,s););return r}}function zn(e){return function(t,r,i){for(var n=-1,o=Me(t),s=i(t),a=s.length;a--;){var l=s[e?a:++n];if(!1===r(o[l],l,o))break}return t}}function Bn(e){return function(t){var i=sr(t=ya(t))?pr(t):r,n=i?i[0]:t.charAt(0),o=i?bn(i,1).join(""):t.slice(1);return n[e]()+o}}function Rn(e){return function(t){return Bt(Ka(Ga(t).replace(Je,"")),e,"")}}function Fn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Nr(e.prototype),i=e.apply(r,t);return ta(i)?i:r}}function jn(e){return function(t,i,n){var o=Me(t);if(!Qs(t)){var s=co(i,3);t=ka(t),i=function(e){return s(o[e],e,o)}}var a=e(t,i,n);return a>-1?o[s?t[a]:a]:r}}function Vn(e){return io((function(t){var n=t.length,o=n,s=Hr.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Pe(i);if(s&&!l&&"wrapper"==ao(a))var l=new Hr([],!0)}for(o=l?o:n;++o<n;){var c=ao(a=t[o]),u="wrapper"==c?so(a):r;l=u&&wo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ao(u[0])].apply(l,u[3]):1==a.length&&wo(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Zs(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Nn(e,t,i,n,o,s,a,l,u,h){var d=t&c,p=1&t,f=2&t,m=24&t,g=512&t,A=f?r:Fn(e);return function c(){for(var _=arguments.length,y=se(_),x=_;x--;)y[x]=arguments[x];if(m)var v=lo(c),b=function(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}(y,v);if(n&&(y=Sn(y,n,o,m)),s&&(y=In(y,s,a,m)),_-=b,m&&_<h){var w=cr(y,v);return qn(e,t,Nn,c.placeholder,i,y,w,l,u,h-_)}var C=p?i:this,T=f?C[e]:e;return _=y.length,l?y=function(e,t){var i=e.length,n=yr(t.length,i),o=Pn(e);for(;n--;){var s=t[n];e[n]=xo(s,i)?o[s]:r}return e}(y,l):g&&_>1&&y.reverse(),d&&u<_&&(y.length=u),this&&this!==ft&&this instanceof c&&(T=A||Fn(T)),T.apply(C,y)}}function Un(e,t){return function(r,i){return function(e,t,r,i){return xi(e,(function(e,n,o){t(i,r(e),n,o)})),i}(r,e,t(i),{})}}function Hn(e,t){return function(i,n){var o;if(i===r&&n===r)return t;if(i!==r&&(o=i),n!==r){if(o===r)return n;"string"==typeof i||"string"==typeof n?(i=un(i),n=un(n)):(i=cn(i),n=cn(n)),o=e(i,n)}return o}}function Gn(e){return io((function(t){return t=Ot(t,Kt(co())),Yi((function(r){var i=this;return e(t,(function(e){return Et(e,i,r)}))}))}))}function Zn(e,t){var i=(t=t===r?" ":un(t)).length;if(i<2)return i?Xi(t,e):t;var n=Xi(t,mt(e/dr(t)));return sr(t)?bn(pr(n),0,e).join(""):n.slice(0,e)}function Wn(e){return function(t,i,n){return n&&"number"!=typeof n&&vo(t,i,n)&&(i=n=r),t=fa(t),i===r?(i=t,t=0):i=fa(i),function(e,t,r,i){for(var n=-1,o=_r(mt((t-e)/(r||1)),0),s=se(o);o--;)s[i?o:++n]=e,e+=r;return s}(t,i,n=n===r?t<i?1:-1:fa(n),e)}}function Qn(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Aa(t),r=Aa(r)),e(t,r)}}function qn(e,t,i,n,o,s,c,u,h,d){var p=8&t;t|=p?a:l,4&(t&=~(p?l:a))||(t&=-4);var f=[e,t,o,p?s:r,p?c:r,p?r:s,p?r:c,u,h,d],m=i.apply(r,f);return wo(e)&&Do(m,f),m.placeholder=n,Oo(m,e,t)}function Xn(e){var t=Ee[e];return function(e,r){if(e=Aa(e),(r=null==r?0:yr(ma(r),292))&&jt(e)){var i=(ya(e)+"e").split("e");return+((i=(ya(t(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return t(e)}}var Yn=Mr&&1/ur(new Mr([,-0]))[1]==h?function(e){return new Mr(e)}:cl;function $n(e){return function(t){var r=go(t);return r==w?ar(t):r==S?hr(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Kn(e,t,n,h,d,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new Pe(i);var A=h?h.length:0;if(A||(t&=-97,h=d=r),f=f===r?f:_r(ma(f),0),m=m===r?m:ma(m),A-=d?d.length:0,t&l){var _=h,y=d;h=d=r}var x=g?r:so(e),v=[e,t,n,h,d,_,y,p,f,m];if(x&&function(e,t){var r=e[1],i=t[1],n=r|i,s=n<131,a=i==c&&8==r||i==c&&r==u&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(!s&&!a)return e;1&i&&(e[2]=t[2],n|=1&r?0:4);var l=t[3];if(l){var h=e[3];e[3]=h?Sn(h,l,t[4]):l,e[4]=h?cr(e[3],o):t[4]}(l=t[5])&&(h=e[5],e[5]=h?In(h,l,t[6]):l,e[6]=h?cr(e[5],o):t[6]);(l=t[7])&&(e[7]=l);i&c&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=n}(v,x),e=v[0],t=v[1],n=v[2],h=v[3],d=v[4],!(m=v[9]=v[9]===r?g?0:e.length:_r(v[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==s?function(e,t,i){var n=Fn(e);return function o(){for(var s=arguments.length,a=se(s),l=s,c=lo(o);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cr(a,c);return(s-=u.length)<i?qn(e,t,Nn,o.placeholder,r,a,u,r,r,i-s):Et(this&&this!==ft&&this instanceof o?n:e,this,a)}}(e,t,m):t!=a&&33!=t||d.length?Nn.apply(r,v):function(e,t,r,i){var n=1&t,o=Fn(e);return function t(){for(var s=-1,a=arguments.length,l=-1,c=i.length,u=se(c+a),h=this&&this!==ft&&this instanceof t?o:e;++l<c;)u[l]=i[l];for(;a--;)u[l++]=arguments[++s];return Et(h,n?r:this,u)}}(e,t,n,h);else var b=function(e,t,r){var i=1&t,n=Fn(e);return function t(){return(this&&this!==ft&&this instanceof t?n:e).apply(i?r:this,arguments)}}(e,t,n);return Oo((x?en:Do)(b,v),e,t)}function Jn(e,t,i,n){return e===r||Ns(e,Le[i])&&!Be.call(n,i)?t:e}function eo(e,t,i,n,o,s){return ta(e)&&ta(t)&&(s.set(t,e),Ui(e,t,r,eo,s),s.delete(t)),e}function to(e){return oa(e)?r:e}function ro(e,t,i,n,o,s){var a=1&i,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&i?new qr:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],g=t[d];if(n)var A=a?n(g,m,d,t,e,s):n(m,g,d,e,t,s);if(A!==r){if(A)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!er(f,t)&&(m===e||o(m,e,i,n,s)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,i,n,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function io(e){return Lo(So(e,r,Wo),e+"")}function no(e){return Ci(e,ka,fo)}function oo(e){return Ci(e,La,mo)}var so=Pr?function(e){return Pr.get(e)}:cl;function ao(e){for(var t=e.name+"",r=Dr[t],i=Be.call(Dr,t)?r.length:0;i--;){var n=r[i],o=n.func;if(null==o||o==e)return n.name}return t}function lo(e){return(Be.call(Vr,"placeholder")?Vr:e).placeholder}function co(){var e=Vr.iteratee||ol;return e=e===ol?zi:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var r,i,n=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof t?"string":"hash"]:n.map}function ho(e){for(var t=ka(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,Eo(n)]}return t}function po(e,t){var i=function(e,t){return null==e?r:e[t]}(e,t);return Oi(i)?i:r}var fo=_t?function(e){return null==e?[]:(e=Me(e),Dt(_t(e),(function(t){return Xe.call(e,t)})))}:gl,mo=_t?function(e){for(var t=[];e;)zt(t,fo(e)),e=Qe(e);return t}:gl,go=Ti;function Ao(e,t,r){for(var i=-1,n=(t=xn(t,e)).length,o=!1;++i<n;){var s=Fo(t[i]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++i!=n?o:!!(n=null==e?0:e.length)&&ea(n)&&xo(s,n)&&(Zs(e)||Gs(e))}function _o(e){return"function"!=typeof e.constructor||To(e)?{}:Nr(Qe(e))}function yo(e){return Zs(e)||Gs(e)||!!($e&&e&&e[$e])}function xo(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function vo(e,t,r){if(!ta(r))return!1;var i=typeof t;return!!("number"==i?Qs(r)&&xo(t,r.length):"string"==i&&t in r)&&Ns(r[t],e)}function bo(e,t){if(Zs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ca(e))||(te.test(e)||!ee.test(e)||null!=t&&e in Me(t))}function wo(e){var t=ao(e),r=Vr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var i=so(r);return!!i&&e===i[0]}(Cr&&go(new Cr(new ArrayBuffer(1)))!=O||Tr&&go(new Tr)!=w||Er&&go(Er.resolve())!=E||Mr&&go(new Mr)!=S||Sr&&go(new Sr)!=k)&&(go=function(e){var t=Ti(e),i=t==T?e.constructor:r,n=i?jo(i):"";if(n)switch(n){case kr:return O;case Lr:return w;case Or:return E;case zr:return S;case Br:return k}return t});var Co=Oe?Ks:Al;function To(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Eo(e){return e==e&&!ta(e)}function Mo(e,t){return function(i){return null!=i&&(i[e]===t&&(t!==r||e in Me(i)))}}function So(e,t,i){return t=_r(t===r?e.length-1:t,0),function(){for(var r=arguments,n=-1,o=_r(r.length-t,0),s=se(o);++n<o;)s[n]=r[t+n];n=-1;for(var a=se(t+1);++n<t;)a[n]=r[n];return a[t]=i(s),Et(e,this,a)}}function Io(e,t){return t.length<2?e:wi(e,nn(t,0,-1))}function Po(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=zo(en),ko=pt||function(e,t){return ft.setTimeout(e,t)},Lo=zo(tn);function Oo(e,t,r){var i=t+"";return Lo(e,function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return St(m,(function(r){var i="_."+r[0];t&r[1]&&!kt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(i),r)))}function zo(e){var t=0,i=0;return function(){var n=xr(),o=16-(n-i);if(i=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Bo(e,t){var i=-1,n=e.length,o=n-1;for(t=t===r?n:t;++i<t;){var s=qi(i,o),a=e[s];e[s]=e[i],e[i]=a}return e.length=t,e}var Ro=function(e){var t=zs(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,r,i,n){t.push(i?n.replace(de,"$1"):r||e)})),t}));function Fo(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return ze.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Vo(e){if(e instanceof Gr)return e.clone();var t=new Hr(e.__wrapped__,e.__chain__);return t.__actions__=Pn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var No=Yi((function(e,t){return qs(e)?hi(e,Ai(t,1,qs,!0)):[]})),Uo=Yi((function(e,t){var i=$o(t);return qs(i)&&(i=r),qs(e)?hi(e,Ai(t,1,qs,!0),co(i,2)):[]})),Ho=Yi((function(e,t){var i=$o(t);return qs(i)&&(i=r),qs(e)?hi(e,Ai(t,1,qs,!0),r,i):[]}));function Go(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ma(r);return n<0&&(n=_r(i+n,0)),Nt(e,co(t,3),n)}function Zo(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return i!==r&&(o=ma(i),o=i<0?_r(n+o,0):yr(o,n-1)),Nt(e,co(t,3),o,!0)}function Wo(e){return(null==e?0:e.length)?Ai(e,1):[]}function Qo(e){return e&&e.length?e[0]:r}var qo=Yi((function(e){var t=Ot(e,_n);return t.length&&t[0]===e[0]?Ii(t):[]})),Xo=Yi((function(e){var t=$o(e),i=Ot(e,_n);return t===$o(i)?t=r:i.pop(),i.length&&i[0]===e[0]?Ii(i,co(t,2)):[]})),Yo=Yi((function(e){var t=$o(e),i=Ot(e,_n);return(t="function"==typeof t?t:r)&&i.pop(),i.length&&i[0]===e[0]?Ii(i,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Yi(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Wi(e,t):e}var es=io((function(e,t){var r=null==e?0:e.length,i=si(e,t);return Qi(e,Ot(t,(function(e){return xo(e,r)?+e:e})).sort(Mn)),i}));function ts(e){return null==e?e:wr.call(e)}var rs=Yi((function(e){return hn(Ai(e,1,qs,!0))})),is=Yi((function(e){var t=$o(e);return qs(t)&&(t=r),hn(Ai(e,1,qs,!0),co(t,2))})),ns=Yi((function(e){var t=$o(e);return t="function"==typeof t?t:r,hn(Ai(e,1,qs,!0),r,t)}));function os(e){if(!e||!e.length)return[];var t=0;return e=Dt(e,(function(e){if(qs(e))return t=_r(e.length,t),!0})),Yt(t,(function(t){return Ot(e,Wt(t))}))}function ss(e,t){if(!e||!e.length)return[];var i=os(e);return null==t?i:Ot(i,(function(e){return Et(t,r,e)}))}var as=Yi((function(e,t){return qs(e)?hi(e,t):[]})),ls=Yi((function(e){return gn(Dt(e,qs))})),cs=Yi((function(e){var t=$o(e);return qs(t)&&(t=r),gn(Dt(e,qs),co(t,2))})),us=Yi((function(e){var t=$o(e);return t="function"==typeof t?t:r,gn(Dt(e,qs),r,t)})),hs=Yi(os);var ds=Yi((function(e){var t=e.length,i=t>1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,ss(e,i)}));function ps(e){var t=Vr(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ms=io((function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,o=function(t){return si(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&xo(i)?((n=n.slice(i,+i+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:r}),new Hr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var gs=kn((function(e,t,r){Be.call(e,r)?++e[r]:oi(e,r,1)}));var As=jn(Go),_s=jn(Zo);function ys(e,t){return(Zs(e)?St:di)(e,co(t,3))}function xs(e,t){return(Zs(e)?It:pi)(e,co(t,3))}var vs=kn((function(e,t,r){Be.call(e,r)?e[r].push(t):oi(e,r,[t])}));var bs=Yi((function(e,t,r){var i=-1,n="function"==typeof t,o=Qs(e)?se(e.length):[];return di(e,(function(e){o[++i]=n?Et(t,e,r):Pi(e,t,r)})),o})),ws=kn((function(e,t,r){oi(e,r,t)}));function Cs(e,t){return(Zs(e)?Ot:ji)(e,co(t,3))}var Ts=kn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Es=Yi((function(e,t){if(null==e)return[];var r=t.length;return r>1&&vo(e,t[0],t[1])?t=[]:r>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Gi(e,Ai(t,1),[])})),Ms=dt||function(){return ft.Date.now()};function Ss(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,Kn(e,c,r,r,r,r,t)}function Is(e,t){var n;if("function"!=typeof t)throw new Pe(i);return e=ma(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Ps=Yi((function(e,t,r){var i=1;if(r.length){var n=cr(r,lo(Ps));i|=a}return Kn(e,i,t,r,n)})),Ds=Yi((function(e,t,r){var i=3;if(r.length){var n=cr(r,lo(Ds));i|=a}return Kn(t,i,e,r,n)}));function ks(e,t,n){var o,s,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Pe(i);function m(t){var i=o,n=s;return o=s=r,h=t,l=e.apply(n,i)}function g(e){var i=e-u;return u===r||i>=t||i<0||p&&e-h>=a}function A(){var e=Ms();if(g(e))return _(e);c=ko(A,function(e){var r=t-(e-u);return p?yr(r,a-(e-h)):r}(e))}function _(e){return c=r,f&&o?m(e):(o=s=r,l)}function y(){var e=Ms(),i=g(e);if(o=arguments,s=this,u=e,i){if(c===r)return function(e){return h=e,c=ko(A,t),d?m(e):l}(u);if(p)return wn(c),c=ko(A,t),m(u)}return c===r&&(c=ko(A,t)),l}return t=Aa(t)||0,ta(n)&&(d=!!n.leading,a=(p="maxWait"in n)?_r(Aa(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),y.cancel=function(){c!==r&&wn(c),h=0,o=u=s=c=r},y.flush=function(){return c===r?l:_(Ms())},y}var Ls=Yi((function(e,t){return ui(e,1,t)})),Os=Yi((function(e,t,r){return ui(e,Aa(t)||0,r)}));function zs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(i);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(zs.Cache||Qr),r}function Bs(e){if("function"!=typeof e)throw new Pe(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}zs.Cache=Qr;var Rs=vn((function(e,t){var r=(t=1==t.length&&Zs(t[0])?Ot(t[0],Kt(co())):Ot(Ai(t,1),Kt(co()))).length;return Yi((function(i){for(var n=-1,o=yr(i.length,r);++n<o;)i[n]=t[n].call(this,i[n]);return Et(e,this,i)}))})),Fs=Yi((function(e,t){var i=cr(t,lo(Fs));return Kn(e,a,r,t,i)})),js=Yi((function(e,t){var i=cr(t,lo(js));return Kn(e,l,r,t,i)})),Vs=io((function(e,t){return Kn(e,u,r,r,r,t)}));function Ns(e,t){return e===t||e!=e&&t!=t}var Us=Qn(Ei),Hs=Qn((function(e,t){return e>=t})),Gs=Di(function(){return arguments}())?Di:function(e){return ra(e)&&Be.call(e,"callee")&&!Xe.call(e,"callee")},Zs=se.isArray,Ws=xt?Kt(xt):function(e){return ra(e)&&Ti(e)==L};function Qs(e){return null!=e&&ea(e.length)&&!Ks(e)}function qs(e){return ra(e)&&Qs(e)}var Xs=yt||Al,Ys=vt?Kt(vt):function(e){return ra(e)&&Ti(e)==y};function $s(e){if(!ra(e))return!1;var t=Ti(e);return t==x||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oa(e)}function Ks(e){if(!ta(e))return!1;var t=Ti(e);return t==v||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==ma(e)}function ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ta(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=bt?Kt(bt):function(e){return ra(e)&&go(e)==w};function na(e){return"number"==typeof e||ra(e)&&Ti(e)==C}function oa(e){if(!ra(e)||Ti(e)!=T)return!1;var t=Qe(e);if(null===t)return!0;var r=Be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ze.call(r)==Ve}var sa=wt?Kt(wt):function(e){return ra(e)&&Ti(e)==M};var aa=Ct?Kt(Ct):function(e){return ra(e)&&go(e)==S};function la(e){return"string"==typeof e||!Zs(e)&&ra(e)&&Ti(e)==I}function ca(e){return"symbol"==typeof e||ra(e)&&Ti(e)==D}var ua=Tt?Kt(Tt):function(e){return ra(e)&&ea(e.length)&&!!at[Ti(e)]};var ha=Qn(Fi),da=Qn((function(e,t){return e<=t}));function pa(e){if(!e)return[];if(Qs(e))return la(e)?pr(e):Pn(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=go(e);return(t==w?ar:t==S?ur:Na)(e)}function fa(e){return e?(e=Aa(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ma(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ga(e){return e?ai(ma(e),0,f):0}function Aa(e){if("number"==typeof e)return e;if(ca(e))return p;if(ta(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ta(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var r=ge.test(e);return r||_e.test(e)?ht(e.slice(2),r?2:8):me.test(e)?p:+e}function _a(e){return Dn(e,La(e))}function ya(e){return null==e?"":un(e)}var xa=Ln((function(e,t){if(To(t)||Qs(t))Dn(t,ka(t),e);else for(var r in t)Be.call(t,r)&&ti(e,r,t[r])})),va=Ln((function(e,t){Dn(t,La(t),e)})),ba=Ln((function(e,t,r,i){Dn(t,La(t),e,i)})),wa=Ln((function(e,t,r,i){Dn(t,ka(t),e,i)})),Ca=io(si);var Ta=Yi((function(e,t){e=Me(e);var i=-1,n=t.length,o=n>2?t[2]:r;for(o&&vo(t[0],t[1],o)&&(n=1);++i<n;)for(var s=t[i],a=La(s),l=-1,c=a.length;++l<c;){var u=a[l],h=e[u];(h===r||Ns(h,Le[u])&&!Be.call(e,u))&&(e[u]=s[u])}return e})),Ea=Yi((function(e){return e.push(r,eo),Et(za,r,e)}));function Ma(e,t,i){var n=null==e?r:wi(e,t);return n===r?i:n}function Sa(e,t){return null!=e&&Ao(e,t,Si)}var Ia=Un((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),tl(nl)),Pa=Un((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(r):e[t]=[r]}),co),Da=Yi(Pi);function ka(e){return Qs(e)?Yr(e):Bi(e)}function La(e){return Qs(e)?Yr(e,!0):Ri(e)}var Oa=Ln((function(e,t,r){Ui(e,t,r)})),za=Ln((function(e,t,r,i){Ui(e,t,r,i)})),Ba=io((function(e,t){var r={};if(null==e)return r;var i=!1;t=Ot(t,(function(t){return t=xn(t,e),i||(i=t.length>1),t})),Dn(e,oo(e),r),i&&(r=li(r,7,to));for(var n=t.length;n--;)dn(r,t[n]);return r}));var Ra=io((function(e,t){return null==e?{}:function(e,t){return Zi(e,t,(function(t,r){return Sa(e,r)}))}(e,t)}));function Fa(e,t){if(null==e)return{};var r=Ot(oo(e),(function(e){return[e]}));return t=co(t),Zi(e,r,(function(e,r){return t(e,r[0])}))}var ja=$n(ka),Va=$n(La);function Na(e){return null==e?[]:Jt(e,ka(e))}var Ua=Rn((function(e,t,r){return t=t.toLowerCase(),e+(r?Ha(t):t)}));function Ha(e){return $a(ya(e).toLowerCase())}function Ga(e){return(e=ya(e))&&e.replace(xe,ir).replace(et,"")}var Za=Rn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Rn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Qa=Bn("toLowerCase");var qa=Rn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Xa=Rn((function(e,t,r){return e+(r?" ":"")+$a(t)}));var Ya=Rn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$a=Bn("toUpperCase");function Ka(e,t,i){return e=ya(e),(t=i?r:t)===r?function(e){return nt.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=Yi((function(e,t){try{return Et(e,r,t)}catch(e){return $s(e)?e:new Ce(e)}})),el=io((function(e,t){return St(t,(function(t){t=Fo(t),oi(e,t,Ps(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Vn(),il=Vn(!0);function nl(e){return e}function ol(e){return zi("function"==typeof e?e:li(e,1))}var sl=Yi((function(e,t){return function(r){return Pi(r,e,t)}})),al=Yi((function(e,t){return function(r){return Pi(e,r,t)}}));function ll(e,t,r){var i=ka(t),n=bi(t,i);null!=r||ta(t)&&(n.length||!i.length)||(r=t,t=e,e=this,n=bi(t,ka(t)));var o=!(ta(r)&&"chain"in r&&!r.chain),s=Ks(e);return St(n,(function(r){var i=t[r];e[r]=i,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Pn(this.__actions__)).push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,zt([this.value()],arguments))})})),e}function cl(){}var ul=Gn(Ot),hl=Gn(Pt),dl=Gn(Ft);function pl(e){return bo(e)?Wt(Fo(e)):function(e){return function(t){return wi(t,e)}}(e)}var fl=Wn(),ml=Wn(!0);function gl(){return[]}function Al(){return!1}var _l=Hn((function(e,t){return e+t}),0),yl=Xn("ceil"),xl=Hn((function(e,t){return e/t}),1),vl=Xn("floor");var bl,wl=Hn((function(e,t){return e*t}),1),Cl=Xn("round"),Tl=Hn((function(e,t){return e-t}),0);return Vr.after=function(e,t){if("function"!=typeof t)throw new Pe(i);return e=ma(e),function(){if(--e<1)return t.apply(this,arguments)}},Vr.ary=Ss,Vr.assign=xa,Vr.assignIn=va,Vr.assignInWith=ba,Vr.assignWith=wa,Vr.at=Ca,Vr.before=Is,Vr.bind=Ps,Vr.bindAll=el,Vr.bindKey=Ds,Vr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Zs(e)?e:[e]},Vr.chain=ps,Vr.chunk=function(e,t,i){t=(i?vo(e,t,i):t===r)?1:_r(ma(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var o=0,s=0,a=se(mt(n/t));o<n;)a[s++]=nn(e,o,o+=t);return a},Vr.compact=function(e){for(var t=-1,r=null==e?0:e.length,i=0,n=[];++t<r;){var o=e[t];o&&(n[i++]=o)}return n},Vr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=se(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return zt(Zs(r)?Pn(r):[r],Ai(t,1))},Vr.cond=function(e){var t=null==e?0:e.length,r=co();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new Pe(i);return[r(e[0]),e[1]]})):[],Yi((function(r){for(var i=-1;++i<t;){var n=e[i];if(Et(n[0],this,r))return Et(n[1],this,r)}}))},Vr.conforms=function(e){return function(e){var t=ka(e);return function(r){return ci(r,e,t)}}(li(e,1))},Vr.constant=tl,Vr.countBy=gs,Vr.create=function(e,t){var r=Nr(e);return null==t?r:ni(r,t)},Vr.curry=function e(t,i,n){var o=Kn(t,8,r,r,r,r,r,i=n?r:i);return o.placeholder=e.placeholder,o},Vr.curryRight=function e(t,i,n){var o=Kn(t,s,r,r,r,r,r,i=n?r:i);return o.placeholder=e.placeholder,o},Vr.debounce=ks,Vr.defaults=Ta,Vr.defaultsDeep=Ea,Vr.defer=Ls,Vr.delay=Os,Vr.difference=No,Vr.differenceBy=Uo,Vr.differenceWith=Ho,Vr.drop=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,(t=i||t===r?1:ma(t))<0?0:t,n):[]},Vr.dropRight=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,0,(t=n-(t=i||t===r?1:ma(t)))<0?0:t):[]},Vr.dropRightWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!0,!0):[]},Vr.dropWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!0):[]},Vr.fill=function(e,t,i,n){var o=null==e?0:e.length;return o?(i&&"number"!=typeof i&&vo(e,t,i)&&(i=0,n=o),function(e,t,i,n){var o=e.length;for((i=ma(i))<0&&(i=-i>o?0:o+i),(n=n===r||n>o?o:ma(n))<0&&(n+=o),n=i>n?0:ga(n);i<n;)e[i++]=t;return e}(e,t,i,n)):[]},Vr.filter=function(e,t){return(Zs(e)?Dt:gi)(e,co(t,3))},Vr.flatMap=function(e,t){return Ai(Cs(e,t),1)},Vr.flatMapDeep=function(e,t){return Ai(Cs(e,t),h)},Vr.flatMapDepth=function(e,t,i){return i=i===r?1:ma(i),Ai(Cs(e,t),i)},Vr.flatten=Wo,Vr.flattenDeep=function(e){return(null==e?0:e.length)?Ai(e,h):[]},Vr.flattenDepth=function(e,t){return(null==e?0:e.length)?Ai(e,t=t===r?1:ma(t)):[]},Vr.flip=function(e){return Kn(e,512)},Vr.flow=rl,Vr.flowRight=il,Vr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,i={};++t<r;){var n=e[t];i[n[0]]=n[1]}return i},Vr.functions=function(e){return null==e?[]:bi(e,ka(e))},Vr.functionsIn=function(e){return null==e?[]:bi(e,La(e))},Vr.groupBy=vs,Vr.initial=function(e){return(null==e?0:e.length)?nn(e,0,-1):[]},Vr.intersection=qo,Vr.intersectionBy=Xo,Vr.intersectionWith=Yo,Vr.invert=Ia,Vr.invertBy=Pa,Vr.invokeMap=bs,Vr.iteratee=ol,Vr.keyBy=ws,Vr.keys=ka,Vr.keysIn=La,Vr.map=Cs,Vr.mapKeys=function(e,t){var r={};return t=co(t,3),xi(e,(function(e,i,n){oi(r,t(e,i,n),e)})),r},Vr.mapValues=function(e,t){var r={};return t=co(t,3),xi(e,(function(e,i,n){oi(r,i,t(e,i,n))})),r},Vr.matches=function(e){return Vi(li(e,1))},Vr.matchesProperty=function(e,t){return Ni(e,li(t,1))},Vr.memoize=zs,Vr.merge=Oa,Vr.mergeWith=za,Vr.method=sl,Vr.methodOf=al,Vr.mixin=ll,Vr.negate=Bs,Vr.nthArg=function(e){return e=ma(e),Yi((function(t){return Hi(t,e)}))},Vr.omit=Ba,Vr.omitBy=function(e,t){return Fa(e,Bs(co(t)))},Vr.once=function(e){return Is(2,e)},Vr.orderBy=function(e,t,i,n){return null==e?[]:(Zs(t)||(t=null==t?[]:[t]),Zs(i=n?r:i)||(i=null==i?[]:[i]),Gi(e,t,i))},Vr.over=ul,Vr.overArgs=Rs,Vr.overEvery=hl,Vr.overSome=dl,Vr.partial=Fs,Vr.partialRight=js,Vr.partition=Ts,Vr.pick=Ra,Vr.pickBy=Fa,Vr.property=pl,Vr.propertyOf=function(e){return function(t){return null==e?r:wi(e,t)}},Vr.pull=Ko,Vr.pullAll=Jo,Vr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wi(e,t,co(r,2)):e},Vr.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?Wi(e,t,r,i):e},Vr.pullAt=es,Vr.range=fl,Vr.rangeRight=ml,Vr.rearg=Vs,Vr.reject=function(e,t){return(Zs(e)?Dt:gi)(e,Bs(co(t,3)))},Vr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var i=-1,n=[],o=e.length;for(t=co(t,3);++i<o;){var s=e[i];t(s,i,e)&&(r.push(s),n.push(i))}return Qi(e,n),r},Vr.rest=function(e,t){if("function"!=typeof e)throw new Pe(i);return Yi(e,t=t===r?t:ma(t))},Vr.reverse=ts,Vr.sampleSize=function(e,t,i){return t=(i?vo(e,t,i):t===r)?1:ma(t),(Zs(e)?Kr:Ki)(e,t)},Vr.set=function(e,t,r){return null==e?e:Ji(e,t,r)},Vr.setWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:Ji(e,t,i,n)},Vr.shuffle=function(e){return(Zs(e)?Jr:rn)(e)},Vr.slice=function(e,t,i){var n=null==e?0:e.length;return n?(i&&"number"!=typeof i&&vo(e,t,i)?(t=0,i=n):(t=null==t?0:ma(t),i=i===r?n:ma(i)),nn(e,t,i)):[]},Vr.sortBy=Es,Vr.sortedUniq=function(e){return e&&e.length?ln(e):[]},Vr.sortedUniqBy=function(e,t){return e&&e.length?ln(e,co(t,2)):[]},Vr.split=function(e,t,i){return i&&"number"!=typeof i&&vo(e,t,i)&&(t=i=r),(i=i===r?f:i>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=un(t))&&sr(e)?bn(pr(e),0,i):e.split(t,i):[]},Vr.spread=function(e,t){if("function"!=typeof e)throw new Pe(i);return t=null==t?0:_r(ma(t),0),Yi((function(r){var i=r[t],n=bn(r,0,t);return i&&zt(n,i),Et(e,this,n)}))},Vr.tail=function(e){var t=null==e?0:e.length;return t?nn(e,1,t):[]},Vr.take=function(e,t,i){return e&&e.length?nn(e,0,(t=i||t===r?1:ma(t))<0?0:t):[]},Vr.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,(t=n-(t=i||t===r?1:ma(t)))<0?0:t,n):[]},Vr.takeRightWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!1,!0):[]},Vr.takeWhile=function(e,t){return e&&e.length?fn(e,co(t,3)):[]},Vr.tap=function(e,t){return t(e),e},Vr.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new Pe(i);return ta(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),ks(e,t,{leading:n,maxWait:t,trailing:o})},Vr.thru=fs,Vr.toArray=pa,Vr.toPairs=ja,Vr.toPairsIn=Va,Vr.toPath=function(e){return Zs(e)?Ot(e,Fo):ca(e)?[e]:Pn(Ro(ya(e)))},Vr.toPlainObject=_a,Vr.transform=function(e,t,r){var i=Zs(e),n=i||Xs(e)||ua(e);if(t=co(t,4),null==r){var o=e&&e.constructor;r=n?i?new o:[]:ta(e)&&Ks(o)?Nr(Qe(e)):{}}return(n?St:xi)(e,(function(e,i,n){return t(r,e,i,n)})),r},Vr.unary=function(e){return Ss(e,1)},Vr.union=rs,Vr.unionBy=is,Vr.unionWith=ns,Vr.uniq=function(e){return e&&e.length?hn(e):[]},Vr.uniqBy=function(e,t){return e&&e.length?hn(e,co(t,2)):[]},Vr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hn(e,r,t):[]},Vr.unset=function(e,t){return null==e||dn(e,t)},Vr.unzip=os,Vr.unzipWith=ss,Vr.update=function(e,t,r){return null==e?e:pn(e,t,yn(r))},Vr.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:pn(e,t,yn(i),n)},Vr.values=Na,Vr.valuesIn=function(e){return null==e?[]:Jt(e,La(e))},Vr.without=as,Vr.words=Ka,Vr.wrap=function(e,t){return Fs(yn(t),e)},Vr.xor=ls,Vr.xorBy=cs,Vr.xorWith=us,Vr.zip=hs,Vr.zipObject=function(e,t){return An(e||[],t||[],ti)},Vr.zipObjectDeep=function(e,t){return An(e||[],t||[],Ji)},Vr.zipWith=ds,Vr.entries=ja,Vr.entriesIn=Va,Vr.extend=va,Vr.extendWith=ba,ll(Vr,Vr),Vr.add=_l,Vr.attempt=Ja,Vr.camelCase=Ua,Vr.capitalize=Ha,Vr.ceil=yl,Vr.clamp=function(e,t,i){return i===r&&(i=t,t=r),i!==r&&(i=(i=Aa(i))==i?i:0),t!==r&&(t=(t=Aa(t))==t?t:0),ai(Aa(e),t,i)},Vr.clone=function(e){return li(e,4)},Vr.cloneDeep=function(e){return li(e,5)},Vr.cloneDeepWith=function(e,t){return li(e,5,t="function"==typeof t?t:r)},Vr.cloneWith=function(e,t){return li(e,4,t="function"==typeof t?t:r)},Vr.conformsTo=function(e,t){return null==t||ci(e,t,ka(t))},Vr.deburr=Ga,Vr.defaultTo=function(e,t){return null==e||e!=e?t:e},Vr.divide=xl,Vr.endsWith=function(e,t,i){e=ya(e),t=un(t);var n=e.length,o=i=i===r?n:ai(ma(i),0,n);return(i-=t.length)>=0&&e.slice(i,o)==t},Vr.eq=Ns,Vr.escape=function(e){return(e=ya(e))&&Y.test(e)?e.replace(q,nr):e},Vr.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(ie,"\\$&"):e},Vr.every=function(e,t,i){var n=Zs(e)?Pt:fi;return i&&vo(e,t,i)&&(t=r),n(e,co(t,3))},Vr.find=As,Vr.findIndex=Go,Vr.findKey=function(e,t){return Vt(e,co(t,3),xi)},Vr.findLast=_s,Vr.findLastIndex=Zo,Vr.findLastKey=function(e,t){return Vt(e,co(t,3),vi)},Vr.floor=vl,Vr.forEach=ys,Vr.forEachRight=xs,Vr.forIn=function(e,t){return null==e?e:_i(e,co(t,3),La)},Vr.forInRight=function(e,t){return null==e?e:yi(e,co(t,3),La)},Vr.forOwn=function(e,t){return e&&xi(e,co(t,3))},Vr.forOwnRight=function(e,t){return e&&vi(e,co(t,3))},Vr.get=Ma,Vr.gt=Us,Vr.gte=Hs,Vr.has=function(e,t){return null!=e&&Ao(e,t,Mi)},Vr.hasIn=Sa,Vr.head=Qo,Vr.identity=nl,Vr.includes=function(e,t,r,i){e=Qs(e)?e:Na(e),r=r&&!i?ma(r):0;var n=e.length;return r<0&&(r=_r(n+r,0)),la(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&Ut(e,t,r)>-1},Vr.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ma(r);return n<0&&(n=_r(i+n,0)),Ut(e,t,n)},Vr.inRange=function(e,t,i){return t=fa(t),i===r?(i=t,t=0):i=fa(i),function(e,t,r){return e>=yr(t,r)&&e<_r(t,r)}(e=Aa(e),t,i)},Vr.invoke=Da,Vr.isArguments=Gs,Vr.isArray=Zs,Vr.isArrayBuffer=Ws,Vr.isArrayLike=Qs,Vr.isArrayLikeObject=qs,Vr.isBoolean=function(e){return!0===e||!1===e||ra(e)&&Ti(e)==_},Vr.isBuffer=Xs,Vr.isDate=Ys,Vr.isElement=function(e){return ra(e)&&1===e.nodeType&&!oa(e)},Vr.isEmpty=function(e){if(null==e)return!0;if(Qs(e)&&(Zs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||ua(e)||Gs(e)))return!e.length;var t=go(e);if(t==w||t==S)return!e.size;if(To(e))return!Bi(e).length;for(var r in e)if(Be.call(e,r))return!1;return!0},Vr.isEqual=function(e,t){return ki(e,t)},Vr.isEqualWith=function(e,t,i){var n=(i="function"==typeof i?i:r)?i(e,t):r;return n===r?ki(e,t,r,i):!!n},Vr.isError=$s,Vr.isFinite=function(e){return"number"==typeof e&&jt(e)},Vr.isFunction=Ks,Vr.isInteger=Js,Vr.isLength=ea,Vr.isMap=ia,Vr.isMatch=function(e,t){return e===t||Li(e,t,ho(t))},Vr.isMatchWith=function(e,t,i){return i="function"==typeof i?i:r,Li(e,t,ho(t),i)},Vr.isNaN=function(e){return na(e)&&e!=+e},Vr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Oi(e)},Vr.isNil=function(e){return null==e},Vr.isNull=function(e){return null===e},Vr.isNumber=na,Vr.isObject=ta,Vr.isObjectLike=ra,Vr.isPlainObject=oa,Vr.isRegExp=sa,Vr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Vr.isSet=aa,Vr.isString=la,Vr.isSymbol=ca,Vr.isTypedArray=ua,Vr.isUndefined=function(e){return e===r},Vr.isWeakMap=function(e){return ra(e)&&go(e)==k},Vr.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Ti(e)},Vr.join=function(e,t){return null==e?"":Qt.call(e,t)},Vr.kebabCase=Za,Vr.last=$o,Vr.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var o=n;return i!==r&&(o=(o=ma(i))<0?_r(n+o,0):yr(o,n-1)),t==t?function(e,t,r){for(var i=r+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Nt(e,Gt,o,!0)},Vr.lowerCase=Wa,Vr.lowerFirst=Qa,Vr.lt=ha,Vr.lte=da,Vr.max=function(e){return e&&e.length?mi(e,nl,Ei):r},Vr.maxBy=function(e,t){return e&&e.length?mi(e,co(t,2),Ei):r},Vr.mean=function(e){return Zt(e,nl)},Vr.meanBy=function(e,t){return Zt(e,co(t,2))},Vr.min=function(e){return e&&e.length?mi(e,nl,Fi):r},Vr.minBy=function(e,t){return e&&e.length?mi(e,co(t,2),Fi):r},Vr.stubArray=gl,Vr.stubFalse=Al,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=wl,Vr.nth=function(e,t){return e&&e.length?Hi(e,ma(t)):r},Vr.noConflict=function(){return ft._===this&&(ft._=Ne),this},Vr.noop=cl,Vr.now=Ms,Vr.pad=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return Zn(gt(n),r)+e+Zn(mt(n),r)},Vr.padEnd=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;return t&&i<t?e+Zn(t-i,r):e},Vr.padStart=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;return t&&i<t?Zn(t-i,r)+e:e},Vr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ya(e).replace(oe,""),t||0)},Vr.random=function(e,t,i){if(i&&"boolean"!=typeof i&&vo(e,t,i)&&(t=i=r),i===r&&("boolean"==typeof t?(i=t,t=r):"boolean"==typeof e&&(i=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var n=e;e=t,t=n}if(i||e%1||t%1){var o=br();return yr(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return qi(e,t)},Vr.reduce=function(e,t,r){var i=Zs(e)?Bt:qt,n=arguments.length<3;return i(e,co(t,4),r,n,di)},Vr.reduceRight=function(e,t,r){var i=Zs(e)?Rt:qt,n=arguments.length<3;return i(e,co(t,4),r,n,pi)},Vr.repeat=function(e,t,i){return t=(i?vo(e,t,i):t===r)?1:ma(t),Xi(ya(e),t)},Vr.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vr.result=function(e,t,i){var n=-1,o=(t=xn(t,e)).length;for(o||(o=1,e=r);++n<o;){var s=null==e?r:e[Fo(t[n])];s===r&&(n=o,s=i),e=Ks(s)?s.call(e):s}return e},Vr.round=Cl,Vr.runInContext=e,Vr.sample=function(e){return(Zs(e)?$r:$i)(e)},Vr.size=function(e){if(null==e)return 0;if(Qs(e))return la(e)?dr(e):e.length;var t=go(e);return t==w||t==S?e.size:Bi(e).length},Vr.snakeCase=qa,Vr.some=function(e,t,i){var n=Zs(e)?Ft:on;return i&&vo(e,t,i)&&(t=r),n(e,co(t,3))},Vr.sortedIndex=function(e,t){return sn(e,t)},Vr.sortedIndexBy=function(e,t,r){return an(e,t,co(r,2))},Vr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var i=sn(e,t);if(i<r&&Ns(e[i],t))return i}return-1},Vr.sortedLastIndex=function(e,t){return sn(e,t,!0)},Vr.sortedLastIndexBy=function(e,t,r){return an(e,t,co(r,2),!0)},Vr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=sn(e,t,!0)-1;if(Ns(e[r],t))return r}return-1},Vr.startCase=Xa,Vr.startsWith=function(e,t,r){return e=ya(e),r=null==r?0:ai(ma(r),0,e.length),t=un(t),e.slice(r,r+t.length)==t},Vr.subtract=Tl,Vr.sum=function(e){return e&&e.length?Xt(e,nl):0},Vr.sumBy=function(e,t){return e&&e.length?Xt(e,co(t,2)):0},Vr.template=function(e,t,i){var n=Vr.templateSettings;i&&vo(e,t,i)&&(t=r),e=ya(e),t=ba({},t,n,Jn);var o,s,a=ba({},t.imports,n.imports,Jn),l=ka(a),c=Jt(a,l),u=0,h=t.interpolate||ve,d="__p += '",p=Se((t.escape||ve).source+"|"+h.source+"|"+(h===J?pe:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),f="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,i,n,a,l){return i||(i=n),d+=e.slice(u,l).replace(be,or),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Be.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(G,""):d).replace(Z,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Te(l,f+"return "+d).apply(r,c)}));if(g.source=d,$s(g))throw g;return g},Vr.times=function(e,t){if((e=ma(e))<1||e>d)return[];var r=f,i=yr(e,f);t=co(t),e-=f;for(var n=Yt(i,t);++r<e;)t(r);return n},Vr.toFinite=fa,Vr.toInteger=ma,Vr.toLength=ga,Vr.toLower=function(e){return ya(e).toLowerCase()},Vr.toNumber=Aa,Vr.toSafeInteger=function(e){return e?ai(ma(e),-9007199254740991,d):0===e?e:0},Vr.toString=ya,Vr.toUpper=function(e){return ya(e).toUpperCase()},Vr.trim=function(e,t,i){if((e=ya(e))&&(i||t===r))return $t(e);if(!e||!(t=un(t)))return e;var n=pr(e),o=pr(t);return bn(n,tr(n,o),rr(n,o)+1).join("")},Vr.trimEnd=function(e,t,i){if((e=ya(e))&&(i||t===r))return e.slice(0,fr(e)+1);if(!e||!(t=un(t)))return e;var n=pr(e);return bn(n,0,rr(n,pr(t))+1).join("")},Vr.trimStart=function(e,t,i){if((e=ya(e))&&(i||t===r))return e.replace(oe,"");if(!e||!(t=un(t)))return e;var n=pr(e);return bn(n,tr(n,pr(t))).join("")},Vr.truncate=function(e,t){var i=30,n="...";if(ta(t)){var o="separator"in t?t.separator:o;i="length"in t?ma(t.length):i,n="omission"in t?un(t.omission):n}var s=(e=ya(e)).length;if(sr(e)){var a=pr(e);s=a.length}if(i>=s)return e;var l=i-dr(n);if(l<1)return n;var c=a?bn(a,0,l).join(""):e.slice(0,l);if(o===r)return c+n;if(a&&(l+=c.length-l),sa(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Se(o.source,ya(fe.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(e.indexOf(un(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+n},Vr.unescape=function(e){return(e=ya(e))&&X.test(e)?e.replace(Q,mr):e},Vr.uniqueId=function(e){var t=++Re;return ya(e)+t},Vr.upperCase=Ya,Vr.upperFirst=$a,Vr.each=ys,Vr.eachRight=xs,Vr.first=Qo,ll(Vr,(bl={},xi(Vr,(function(e,t){Be.call(Vr.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),Vr.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vr[e].placeholder=Vr})),St(["drop","take"],(function(e,t){Gr.prototype[e]=function(i){i=i===r?1:_r(ma(i),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(i,n.__takeCount__):n.__views__.push({size:yr(i,f),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var r=t+1,i=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}})),St(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),St(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(nl)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yi((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Pi(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Bs(co(e)))},Gr.prototype.slice=function(e,t){e=ma(e);var i=this;return i.__filtered__&&(e>0||t<0)?new Gr(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(i=(t=ma(t))<0?i.dropRight(-t):i.take(t-e)),i)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(f)},xi(Gr.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Vr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Vr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,l=t instanceof Gr,c=a[0],u=l||Zs(t),h=function(e){var t=o.apply(Vr,zt([e],a));return n&&d?t[0]:t};u&&i&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=l&&!p;if(!s&&u){t=m?t:new Gr(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[h],thisArg:r}),new Hr(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?n?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=De[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Vr.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(Zs(n)?n:[],e)}return this[r]((function(r){return t.apply(Zs(r)?r:[],e)}))}})),xi(Gr.prototype,(function(e,t){var r=Vr[t];if(r){var i=r.name+"";Be.call(Dr,i)||(Dr[i]=[]),Dr[i].push({name:t,func:r})}})),Dr[Nn(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Pn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pn(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Zs(e),i=t<0,n=r?e.length:0,o=function(e,t,r){var i=-1,n=r.length;for(;++i<n;){var o=r[i],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=_r(e,t-s)}}return{start:e,end:t}}(0,n,this.__views__),s=o.start,a=o.end,l=a-s,c=i?a:s-1,u=this.__iteratees__,h=u.length,d=0,p=yr(l,this.__takeCount__);if(!r||!i&&n==l&&p==l)return mn(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var m=-1,g=e[c+=t];++m<h;){var A=u[m],_=A.iteratee,y=A.type,x=_(g);if(2==y)g=x;else if(!x){if(1==y)continue e;break e}}f[d++]=g}return f},Vr.prototype.at=ms,Vr.prototype.chain=function(){return ps(this)},Vr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},Vr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var t,i=this;i instanceof Ur;){var n=Vo(i);n.__index__=0,n.__values__=r,t?o.__wrapped__=n:t=n;var o=n;i=i.__wrapped__}return o.__wrapped__=e,t},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fs,args:[ts],thisArg:r}),new Hr(t,this.__chain__)}return this.thru(ts)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return mn(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,Ke&&(Vr.prototype[Ke]=function(){return this}),Vr}();gt?((gt.exports=gr)._=gr,mt._=gr):ft._=gr}).call(P)}(zn,zn.exports);var Bn=zn.exports;const Rn={current:null},Fn=e=>{let{location:t,noOptionsText:n="No locations",disableComponentRestrictions:s=!1,showLocationIcon:a=!1,reset:l=!1,city:c,helperText:u="Please select commute destination from the list",restrictionOptions:h,isInvalid:p,apiKey:m,onChange:g,sx:A,onPlaceClick:_,...y}=e;const x=I.useRef(null),[v,T]=I.useState(null),[E,M]=I.useState(t?.name??""),[S,P]=I.useState([]),D=I.useRef(!1),k=I.useRef(null),L=I.useRef(!1),O=I.useMemo((()=>C.debounce(((e,t)=>{Rn.current?.getPlacePredictions({input:c&&c?.length>0&&e?.length>0?`${e} ${c}`:e,...s?{}:{componentRestrictions:{country:"ae"}},...h||{}},t)}),400)),[c,h]);I.useEffect((()=>{let e=!0;if(!Rn.current&&window.google&&(Rn.current=new window.google.maps.places.AutocompleteService),!k.current&&window.google&&(k.current=new window.google.maps.places.PlacesService(document.createElement("div"))),Rn.current){if(""!==E)return O(E,(r=>{if(e){let e=[];v&&(e=[v]),r&&(e=[...e,...r]),P(e),!L.current&&r&&t?.name&&!v&&(L.current=!0,T(r[0]))}})),()=>{e=!1};P(v?[v]:[])}}),[v,E,O]),I.useEffect((()=>{"undefined"==typeof window||D.current||(document.querySelector("#google-maps")||function(e,t,r){if(!t)return;const i=document.createElement("script");i.setAttribute("async",""),i.setAttribute("id",r),i.src=e,t.appendChild(i)}(`https://maps.googleapis.com/maps/api/js?key=${m}&libraries=places&callback=onScriptLoaded`,document.querySelector("head"),"google-maps"),D.current=!0)}),[window,D.current]);return I.useEffect((()=>{if(l&&x?.current){const e=x.current?.getElementsByClassName?.("MuiAutocomplete-clearIndicator")?.[0];e&&(M(""),T(null),P([]),O("",(()=>{})),e?.click?.())}}),[l,x?.current]),r.jsx(b,{ref:x,getOptionLabel:e=>"string"==typeof e?e:e.description,filterOptions:e=>e,options:S,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:v,isOptionEqualToValue:(e,t)=>e?.place_id===t?.place_id,noOptionsText:n,onChange:(e,t)=>{P(t?[t,...S]:S),(e=>{if(T(e),!e)return g(void 0);e&&k.current&&k.current.getDetails({placeId:e.place_id},(t=>{t?.geometry?.location&&g({lat:t.geometry.location.lat(),lng:t.geometry.location.lng(),name:e.description})}))})(t)},onInputChange:(e,t)=>{M(t)},renderInput:e=>r.jsx(f,{...e,placeholder:"Enter your workplace, school, or station",error:p,helperText:p?u:" ",FormHelperTextProps:{sx:{textAlign:"center"}}}),renderOption:(e,t)=>o.createElement("li",{...e,key:t.place_id,onClick:r=>{e?.onClick?.(r),_?.(t.description)}},r.jsxs(i.Box,{children:[a&&r.jsx(w,{sx:{color:"text.secondary"}}),r.jsxs(d,{component:"span",color:"text.secondary",fontWeight:"bold",children:[t.structured_formatting.main_text,","]}),r.jsx(d,{component:"span",variant:"body2",ml:.5,color:"#767676",children:t.structured_formatting.secondary_text})]})),sx:A||{},...y},t?.name)},jn=(e,t)=>{const r=e??0,i=r%60,n=i>0?` ${i} ${t?"mins":"minutes"}`:"";if(r<60)return t?`${n}`:`Under ${n}`;const o=Math.floor(r/60);return 1===o&&60===r?t?"1 h":`Under 1 hour${n}`:t?`${o} h ${n}`:`Under ${o} hours${n}`},Vn=e=>{let t=Math.floor(e/60),r=e%60;return r=r<10?`0${r}`:r,0!==t&&"00"!==r?t>1?`${t} hrs ${r} mins`:`${t} hr ${r} mins`:"00"!==r&&0===t?`${r} mins`:"00"===r&&0!==t?t>1?`${t} hours`:`${t} hour`:"-"},Nn=(e,t)=>{const r=e?.[t]?.split("|");return r?.reduce(((e,t)=>{const r=t?.split(":");return r&&2===r.length&&(e[r[0]]=r[1]),e}),{})};var Un;exports.CommuteMethod=void 0,(Un=exports.CommuteMethod||(exports.CommuteMethod={})).public_transport="public_transport",Un.driving="driving",Un.walking="walking",Un.cycling="cycling";const Hn={public_transport:e=>{let{sx:t={},...n}=e;return r.jsx(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:r.jsxs("g",{id:"icon",children:[r.jsx("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsxs("g",{id:"icon_2",children:[r.jsx("path",{id:"Vector",d:"M7.91908 6.30424C8.28053 6.30424 8.64842 6.30424 9.00987 6.30424C9.37132 6.30424 9.8167 6.30424 10.2169 6.30424C10.4363 6.30424 10.3782 6.1687 10.3847 6.05252C10.3911 5.93634 10.3847 5.85242 10.2169 5.85242C9.45525 5.85242 8.68717 5.85242 7.91908 5.85242C7.69963 5.85242 7.75772 5.98797 7.75126 6.10415C7.74481 6.22033 7.75127 6.31069 7.91908 6.30424Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_2",d:"M6.69917 11.4097C6.7238 11.5121 6.7844 11.6022 6.86992 11.6636C6.95544 11.725 7.06017 11.7536 7.16503 11.7442C7.26989 11.7348 7.36788 11.688 7.44113 11.6124C7.51438 11.5368 7.55801 11.4374 7.56406 11.3323C7.56769 11.2693 7.55771 11.2063 7.53479 11.1476C7.51188 11.0888 7.47656 11.0357 7.43126 10.9918C7.38597 10.9479 7.33176 10.9143 7.2723 10.8933C7.21285 10.8722 7.14955 10.8643 7.08673 10.8699C7.02392 10.8755 6.96306 10.8946 6.9083 10.9259C6.85353 10.9571 6.80613 10.9998 6.76935 11.0511C6.73257 11.1023 6.70726 11.1608 6.69515 11.2227C6.68304 11.2846 6.68441 11.3484 6.69917 11.4097Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_3",d:"M10.6171 11.4032C10.6265 11.5179 10.681 11.6242 10.7688 11.6986C10.8566 11.7731 10.9703 11.8096 11.085 11.8002C11.1997 11.7908 11.3059 11.7362 11.3804 11.6484C11.4548 11.5607 11.4914 11.4469 11.482 11.3323C11.4773 11.2755 11.4615 11.2201 11.4354 11.1695C11.4094 11.1188 11.3736 11.0737 11.3302 11.0369C11.2867 11 11.2364 10.9721 11.1822 10.9546C11.1279 10.9372 11.0708 10.9306 11.014 10.9353C10.9572 10.94 10.9019 10.9558 10.8512 10.9818C10.8005 11.0078 10.7555 11.0436 10.7186 11.0871C10.6818 11.1305 10.6538 11.1808 10.6364 11.235C10.619 11.2893 10.6124 11.3465 10.6171 11.4032Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_4",d:"M10.2491 4.54216C10.5202 4.54216 10.6106 4.45827 10.6041 4.19363C10.5977 3.929 10.5009 3.88381 10.2685 3.88381C10.0361 3.88381 9.95224 3.98063 9.94579 4.20654C9.93933 4.43244 10.0297 4.53571 10.2491 4.54216Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_5",d:"M7.89967 4.54215C8.11266 4.54215 8.20303 4.41953 8.19012 4.18717C8.17722 3.95481 8.0804 3.87735 7.84804 3.88381C7.61568 3.89026 7.50596 4.00644 7.53178 4.26462C7.55759 4.5228 7.6673 4.55506 7.89967 4.54215Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_6",d:"M12.3597 5.54905C12.3662 5.34535 12.307 5.14499 12.1907 4.97759C12.0745 4.81019 11.9074 4.68468 11.7143 4.61963C11.5595 4.53254 11.3801 4.49982 11.2046 4.52673C11.0291 4.55364 10.8676 4.63862 10.7461 4.76807C10.6414 4.88671 10.4968 4.96278 10.3398 4.98182C10.1827 5.00086 10.0241 4.96154 9.89413 4.87134C9.83354 4.83215 9.78095 4.78176 9.73921 4.72288C9.61658 4.54861 9.26159 4.54216 9.26159 4.54216H8.99049C8.8672 4.52453 8.7415 4.53641 8.62369 4.5768C8.50587 4.6172 8.39932 4.68496 8.31278 4.77453C8.25775 4.84317 8.188 4.89859 8.10868 4.93666C8.02936 4.97473 7.9425 4.99449 7.85452 4.99449C7.76654 4.99449 7.67966 4.97473 7.60034 4.93666C7.52102 4.89859 7.45127 4.84317 7.39624 4.77453C7.31435 4.6873 7.21368 4.61987 7.10184 4.57738C6.99 4.53488 6.86994 4.51842 6.75079 4.52925C6.48589 4.53256 6.23267 4.63884 6.04474 4.82556C5.8568 5.01229 5.74891 5.26481 5.7439 5.52969V11.8873C5.74474 12.0184 5.77151 12.148 5.82265 12.2687C5.87379 12.3894 5.94829 12.4988 6.04188 12.5906C6.13547 12.6824 6.24628 12.7548 6.36795 12.8036C6.48962 12.8524 6.61972 12.8766 6.75079 12.8749H11.3012C11.4369 12.8784 11.572 12.8543 11.6981 12.804C11.8242 12.7537 11.9388 12.6782 12.0348 12.5822C12.1308 12.4862 12.2063 12.3716 12.2566 12.2455C12.3069 12.1194 12.331 11.9844 12.3275 11.8486L12.3597 5.54905ZM6.22154 11.3064C6.26027 10.1898 8.04169 10.306 7.9707 11.3516C7.94702 11.5707 7.84179 11.7729 7.6759 11.918C7.51002 12.0631 7.29563 12.1405 7.07531 12.1348C6.85499 12.1291 6.64486 12.0408 6.48669 11.8873C6.32852 11.7338 6.23387 11.5265 6.22154 11.3064ZM10.1717 11.3064C10.2104 10.1834 12.0112 10.3189 11.9208 11.3516C11.8972 11.5707 11.7919 11.7729 11.626 11.918C11.4601 12.0631 11.2458 12.1405 11.0254 12.1348C10.8051 12.1291 10.595 12.0408 10.4368 11.8873C10.2786 11.7338 10.184 11.5265 10.1717 11.3064ZM11.9208 8.64721C11.9331 8.74394 11.9233 8.84219 11.8921 8.93459C11.861 9.02699 11.8093 9.11113 11.741 9.18069C11.6727 9.25026 11.5895 9.30344 11.4977 9.33624C11.4058 9.36905 11.3078 9.38063 11.2108 9.3701C10.5008 9.3701 9.78439 9.3701 9.0744 9.3701H6.98962C6.46036 9.3701 6.22153 9.12484 6.21508 8.60848C6.20863 8.09212 6.21508 7.54995 6.21508 7.02069C6.20281 6.92396 6.21261 6.82568 6.24376 6.73328C6.2749 6.64088 6.32657 6.55675 6.3949 6.48718C6.46322 6.41762 6.54642 6.36444 6.63824 6.33163C6.73006 6.29883 6.82814 6.28725 6.92507 6.29777H7.14452C7.2478 6.29777 7.32526 6.29778 7.31235 6.16223C7.30913 6.10634 7.30913 6.0503 7.31235 5.99441C7.30833 5.91165 7.32289 5.82905 7.35497 5.75264C7.38705 5.67624 7.43584 5.60798 7.49774 5.55289C7.55964 5.4978 7.63309 5.45728 7.7127 5.43427C7.7923 5.41127 7.87605 5.40639 7.95779 5.41997C8.68715 5.41997 9.42295 5.41997 10.1523 5.41997C10.2455 5.40336 10.3414 5.40928 10.4319 5.43725C10.5223 5.46522 10.6048 5.51442 10.6724 5.58074C10.74 5.64707 10.7907 5.72861 10.8204 5.81853C10.8501 5.90846 10.8578 6.00416 10.8429 6.09769C10.8429 6.27196 10.8946 6.33005 11.0559 6.30423H11.2173C11.6691 6.35587 11.9144 6.50433 11.9337 7.01423C11.9531 7.52413 11.9273 8.10503 11.9208 8.64721Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_7",d:"M11.1786 6.73669H8.55161H6.69272L6.65399 8.6343C6.65399 8.90539 6.65399 8.91184 6.95735 8.91184H9.58432H11.4432L11.4819 7.01422C11.4819 6.74314 11.4755 6.73669 11.1786 6.73669Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_8",d:"M12.9923 14.0109C12.7664 13.8172 12.534 13.6301 12.3081 13.43C12.0822 13.2299 12.0176 13.1718 12.2564 12.933C12.3048 12.8782 12.3566 12.8264 12.4114 12.7781C12.5345 12.6557 12.6317 12.5097 12.6971 12.3489C12.7626 12.1881 12.7949 12.0158 12.7922 11.8422C12.7922 9.75737 12.7922 7.67904 12.7922 5.59424C12.7866 5.22734 12.6412 4.87641 12.3855 4.61317C12.0935 4.3087 11.6967 4.12645 11.2754 4.10326C11.1657 4.10326 11.0366 4.10327 10.9978 3.99355C10.9597 3.87059 10.8947 3.75761 10.8077 3.66275C10.7206 3.56789 10.6136 3.49349 10.4944 3.44491C10.3532 3.39014 10.1967 3.39014 10.0555 3.44491C9.93615 3.49033 9.82906 3.563 9.74278 3.65714C9.65649 3.75127 9.59337 3.86425 9.55849 3.98709C9.55849 4.04518 9.41649 4.08389 9.33904 4.0968C9.23156 4.10326 9.12379 4.10326 9.01631 4.0968C8.7775 4.0968 8.57742 4.09681 8.4806 3.80636C8.44258 3.72095 8.38744 3.64424 8.31861 3.58096C8.24978 3.51769 8.16873 3.46918 8.08043 3.43845C7.93862 3.38718 7.78332 3.38718 7.64151 3.43845C7.52227 3.48703 7.41529 3.56143 7.32824 3.65629C7.24119 3.75115 7.17623 3.86412 7.13806 3.98709C7.09933 4.10972 6.97025 4.09035 6.86052 4.0968C6.65085 4.10165 6.4443 4.14869 6.25319 4.23508C6.06208 4.32147 5.89032 4.44546 5.74817 4.59966C5.60601 4.75386 5.49638 4.93512 5.42578 5.13261C5.35518 5.3301 5.32509 5.53979 5.33728 5.74916C5.33728 7.63387 5.33728 9.51857 5.33728 11.3968C5.30208 11.703 5.3425 12.0132 5.45503 12.3001C5.56756 12.5871 5.74876 12.8421 5.98273 13.0427C5.98273 13.0427 6.04727 13.0879 6.06018 13.1202C6.07309 13.1524 6.0989 13.2492 5.99563 13.3202C5.67936 13.5461 5.38891 13.7979 5.08555 14.0431C4.99518 14.1206 4.95 14.198 5.08555 14.3078C5.22109 14.4175 5.27273 14.4433 5.39537 14.3078C5.518 14.1722 5.80199 13.9721 6.00853 13.8043C6.21507 13.6365 6.3829 13.4881 6.58299 13.3396C6.6454 13.3102 6.71419 13.2969 6.78307 13.3009H11.3916C11.4438 13.2994 11.4958 13.3083 11.5446 13.3272C11.5934 13.346 11.6379 13.3744 11.6756 13.4106C12.037 13.7204 12.4178 14.0044 12.7793 14.3142C12.9084 14.424 12.9794 14.411 13.0891 14.3142C13.1988 14.2174 13.0826 14.0883 12.9923 14.0109ZM10.2685 3.88381C10.5008 3.88381 10.5977 3.96773 10.6041 4.19363C10.6106 4.41954 10.5202 4.55507 10.2491 4.54216C9.97803 4.52925 9.9393 4.43244 9.94576 4.20654C9.95221 3.98063 10.0426 3.88381 10.2685 3.88381ZM7.84806 3.88381C8.08042 3.88381 8.17723 3.96772 8.19014 4.18717C8.20305 4.40663 8.11268 4.52925 7.89968 4.54216C7.68669 4.55507 7.55116 4.47117 7.53179 4.26462C7.51243 4.05808 7.60924 3.89027 7.84806 3.88381ZM11.3335 12.8813H6.78307C6.652 12.883 6.52188 12.8588 6.40021 12.81C6.27855 12.7612 6.16773 12.6889 6.07414 12.5971C5.98056 12.5053 5.90605 12.3959 5.85491 12.2752C5.80377 12.1545 5.77702 12.0249 5.77618 11.8938V5.53616C5.78119 5.27128 5.88907 5.01874 6.077 4.83201C6.26493 4.64528 6.51817 4.53903 6.78307 4.53572C6.90222 4.52488 7.02226 4.54134 7.1341 4.58384C7.24594 4.62634 7.34664 4.69376 7.42852 4.78099C7.48355 4.84964 7.55331 4.90503 7.63263 4.9431C7.71194 4.98118 7.7988 5.00096 7.88678 5.00096C7.97477 5.00096 8.06162 4.98118 8.14094 4.9431C8.22026 4.90503 8.29001 4.84964 8.34504 4.78099C8.43158 4.69143 8.53814 4.62366 8.65595 4.58327C8.77376 4.54288 8.89948 4.531 9.02277 4.54862H9.28095C9.28095 4.54862 9.63594 4.54862 9.75857 4.72935C9.80031 4.78822 9.8529 4.83861 9.91349 4.87781C10.0435 4.96801 10.2021 5.00733 10.3591 4.98829C10.5162 4.96925 10.6608 4.89318 10.7655 4.77453C10.887 4.64508 11.0484 4.56011 11.2239 4.5332C11.3995 4.50629 11.5789 4.53899 11.7336 4.62607C11.9268 4.69113 12.0939 4.81666 12.2101 4.98405C12.3263 5.15145 12.3856 5.35182 12.3791 5.55552V11.8615C12.3819 11.9984 12.3565 12.1344 12.3046 12.2611C12.2528 12.3878 12.1754 12.5025 12.0774 12.5981C11.9794 12.6937 11.8628 12.7682 11.7348 12.8169C11.6068 12.8656 11.4702 12.8876 11.3335 12.8813Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_9",d:"M11.2173 6.29777H11.0559C10.8946 6.29777 10.83 6.29778 10.843 6.09124C10.8578 5.99772 10.8501 5.90199 10.8204 5.81207C10.7907 5.72214 10.74 5.6406 10.6724 5.57428C10.6048 5.50795 10.5223 5.45877 10.4319 5.4308C10.3414 5.40283 10.2455 5.3969 10.1523 5.41351C9.42297 5.41351 8.68716 5.41351 7.95781 5.41351C7.87606 5.39992 7.79232 5.40481 7.71271 5.42781C7.6331 5.45081 7.55965 5.49136 7.49775 5.54645C7.43585 5.60154 7.38707 5.66978 7.35498 5.74618C7.3229 5.82258 7.30835 5.9052 7.31236 5.98797C7.30914 6.04386 7.30914 6.09988 7.31236 6.15577C7.31236 6.28486 7.24781 6.29778 7.14454 6.29133H6.92509C6.82815 6.2808 6.73008 6.29236 6.63825 6.32517C6.54643 6.35797 6.46323 6.41115 6.39491 6.48072C6.32659 6.55028 6.27492 6.63444 6.24377 6.72684C6.21263 6.81924 6.20282 6.91749 6.21509 7.01422C6.21509 7.54349 6.21509 8.07275 6.21509 8.60202C6.21509 9.11837 6.46037 9.35718 6.98964 9.36364H9.07442C9.78441 9.36364 10.5009 9.36364 11.2108 9.36364C11.3078 9.37416 11.4059 9.3626 11.4977 9.3298C11.5895 9.29699 11.6727 9.24381 11.741 9.17425C11.8093 9.10468 11.861 9.02053 11.8922 8.92813C11.9233 8.83573 11.9331 8.73747 11.9208 8.64074C11.9208 8.09857 11.9208 7.54993 11.9208 7.0013C11.9208 6.45267 11.6498 6.3494 11.2173 6.29777ZM7.93844 5.85241C8.70652 5.85241 9.4746 5.85241 10.2362 5.85241C10.404 5.85241 10.4105 5.92988 10.404 6.05251C10.3976 6.17515 10.4557 6.31068 10.2362 6.30423C9.83605 6.30423 9.42941 6.30423 9.02923 6.30423C8.62905 6.30423 8.29989 6.30423 7.93844 6.30423C7.77063 6.30423 7.76417 6.22678 7.77062 6.10414C7.77708 5.98151 7.69963 5.85241 7.91908 5.85241H7.93844ZM11.4626 8.91184H9.60369H6.95735C6.66045 8.91184 6.65399 8.91184 6.65399 8.6343L6.69272 6.73669H8.55161H11.1786C11.4755 6.73669 11.4819 6.73668 11.4819 7.01422L11.4626 8.91184Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_10",d:"M6.22153 11.3065C6.23386 11.5265 6.3285 11.7339 6.48667 11.8873C6.64485 12.0408 6.85498 12.1292 7.07529 12.1348C7.29561 12.1405 7.51 12.0631 7.67589 11.918C7.84177 11.7729 7.94701 11.5708 7.97068 11.3516C8.04168 10.306 6.26025 10.1898 6.22153 11.3065ZM6.66689 11.4097C6.6618 11.3529 6.66794 11.2957 6.68497 11.2413C6.702 11.1869 6.7296 11.1363 6.76616 11.0926C6.80272 11.0488 6.84754 11.0127 6.89806 10.9863C6.94858 10.9599 7.00381 10.9436 7.0606 10.9385C7.11739 10.9335 7.17462 10.9396 7.22903 10.9566C7.28345 10.9737 7.33398 11.0013 7.37773 11.0378C7.42148 11.0744 7.45761 11.1192 7.48404 11.1697C7.51047 11.2203 7.5267 11.2755 7.53178 11.3323C7.51606 11.4264 7.46962 11.5127 7.39971 11.5777C7.3298 11.6427 7.24035 11.6828 7.1453 11.6916C7.05025 11.7005 6.95494 11.6776 6.87424 11.6266C6.79354 11.5756 6.73197 11.4994 6.69915 11.4097H6.66689Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_11",d:"M10.1717 11.3064C10.184 11.5265 10.2786 11.7338 10.4368 11.8873C10.595 12.0408 10.8051 12.1291 11.0254 12.1348C11.2457 12.1405 11.4601 12.0631 11.626 11.918C11.7919 11.7729 11.8971 11.5707 11.9208 11.3516C12.0112 10.3189 10.2104 10.1834 10.1717 11.3064ZM10.617 11.4032C10.6124 11.3465 10.6189 11.2893 10.6363 11.2351C10.6538 11.1808 10.6817 11.1305 10.7186 11.0871C10.7554 11.0436 10.8005 11.0078 10.8512 10.9818C10.9019 10.9558 10.9572 10.94 11.014 10.9353C11.0708 10.9306 11.1279 10.9372 11.1822 10.9546C11.2364 10.9721 11.2867 11 11.3301 11.0369C11.3736 11.0737 11.4094 11.1188 11.4354 11.1695C11.4615 11.2201 11.4773 11.2755 11.4819 11.3323C11.4913 11.447 11.4548 11.5607 11.3804 11.6484C11.3059 11.7362 11.1997 11.7908 11.085 11.8002C10.9703 11.8096 10.8565 11.7731 10.7688 11.6987C10.681 11.6242 10.6264 11.5179 10.617 11.4032Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"})]})]})})},driving:e=>{let{sx:t={},...n}=e;return r.jsxs(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:[r.jsx("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.40724 5.08476L4.8924 7.14411H13.2078L12.693 5.08476C12.6467 5.0708 12.5909 5.05428 12.5262 5.03582C12.3181 4.97634 12.0198 4.89678 11.6615 4.81718C10.9429 4.65748 9.99314 4.4999 9.05011 4.4999C8.10708 4.4999 7.15736 4.65748 6.43868 4.81718C6.08047 4.89678 5.78217 4.97634 5.57399 5.03582C5.50937 5.05428 5.45349 5.0708 5.40724 5.08476ZM12.9432 4.84874L13.0381 4.56414C13.1354 4.59657 13.2094 4.67647 13.2343 4.77598L13.8606 7.28141L14.664 7.9952C15.1083 8.38992 15.2968 9.00008 15.1523 9.57692M15.1523 9.57692L14.5409 12.0229V12.9593C14.5409 13.304 14.2612 13.5837 13.9165 13.5837H12.6188C12.274 13.5837 11.9944 13.304 11.9944 12.9593V12.286H6.10586V12.9593C6.10586 13.304 5.8262 13.5837 5.48144 13.5837H4.18374C3.83897 13.5837 3.55931 13.304 3.55931 12.9593V12.0229L2.94802 9.57713C2.80349 9.00029 2.99194 8.38992 3.4362 7.9952L4.2396 7.28141L4.86597 4.77598C4.89085 4.67647 4.96484 4.59657 5.06214 4.56414L5.15701 4.84874C5.06214 4.56414 5.06209 4.56416 5.06214 4.56414L5.06424 4.56344L5.06915 4.56183L5.08725 4.55594C5.10294 4.55088 5.12579 4.5436 5.15534 4.53441C5.21442 4.51603 5.3003 4.49001 5.40916 4.4589C5.62679 4.39673 5.93678 4.31407 6.30853 4.23147C7.04977 4.06675 8.04659 3.8999 9.05011 3.8999C10.0536 3.8999 11.0505 4.06675 11.7917 4.23147C12.1634 4.31407 12.4734 4.39673 12.6911 4.4589C12.7999 4.49001 12.8858 4.51603 12.9449 4.53441C12.9744 4.5436 12.9973 4.55088 13.013 4.55594L13.0311 4.56183L13.036 4.56344L13.0381 4.56414C13.0381 4.56416 13.0381 4.56414 12.9432 4.84874M4.62218 7.74411L3.83471 8.44374C3.55751 8.69003 3.43975 9.0712 3.53001 9.43122L4.09356 11.686H14.0067L14.5702 9.43143C14.6604 9.07141 14.5427 8.69003 14.2655 8.44374L13.478 7.74411H4.62218ZM4.15931 12.286V12.9593C4.15931 12.9726 4.17034 12.9837 4.18374 12.9837H5.48144C5.49484 12.9837 5.50586 12.9726 5.50586 12.9593V12.286H4.15931ZM12.5944 12.286V12.9593C12.5944 12.9726 12.6054 12.9837 12.6188 12.9837H13.9165C13.9299 12.9837 13.9409 12.9726 13.9409 12.9593V12.286H12.5944ZM5.00786 9.71462C5.00771 9.71708 5.0079 9.72058 5.01072 9.72622C5.21424 10.1322 5.62943 10.3883 6.08292 10.3883H6.45471C6.64784 10.3883 6.80356 10.2326 6.80356 10.0395C6.80356 9.84635 6.64784 9.69063 6.45471 9.69063H5.03308C5.02655 9.69063 5.02322 9.69208 5.02104 9.69334C5.01818 9.695 5.01479 9.69799 5.012 9.70249C5.00921 9.707 5.00806 9.71136 5.00786 9.71462ZM4.47407 9.99455C4.26656 9.57954 4.56884 9.09063 5.03308 9.09063H6.45471C6.97921 9.09063 7.40356 9.51497 7.40356 10.0395C7.40356 10.564 6.97921 10.9883 6.45471 10.9883H6.08292C5.40222 10.9883 4.77925 10.6034 4.47407 9.99455ZM11.6456 9.69063C11.4525 9.69063 11.2968 9.84635 11.2968 10.0395C11.2968 10.2326 11.4525 10.3883 11.6456 10.3883H12.0174C12.471 10.3883 12.8861 10.1319 13.089 9.72622C13.0918 9.72058 13.092 9.71706 13.0918 9.71456C13.0916 9.71126 13.0905 9.70687 13.0877 9.70233C13.0849 9.69779 13.0815 9.69483 13.0787 9.69321C13.0766 9.692 13.0735 9.69063 13.0673 9.69063H11.6456ZM10.6968 10.0395C10.6968 9.51497 11.1211 9.09063 11.6456 9.09063H13.0673C13.5314 9.09063 13.8329 9.57998 13.6256 9.99455C13.3211 10.6037 12.6981 10.9883 12.0174 10.9883H11.6456C11.1211 10.9883 10.6968 10.564 10.6968 10.0395Z",fill:"#2E3841"})]})},walking:e=>{let{sx:t={},...n}=e;return r.jsxs(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:[r.jsx("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{d:"M6.5 14L7.99995 12.5L8.49993 10.5M8.49993 10.5L8.99991 7M8.49993 10.5L9.99988 12L10.4999 14M8.99991 7L9.99988 9.5L11.4998 10M8.99991 7L7.49996 8.5L6.99998 10.5M10.4999 5C10.4999 5.552 10.0519 6 9.4999 6C8.94791 6 8.49993 5.552 8.49993 5C8.49993 4.448 8.94791 4 9.4999 4C10.0519 4 10.4999 4.448 10.4999 5Z",stroke:"#2E3841",strokeWidth:"0.65",strokeLinecap:"round",strokeLinejoin:"round"})]})},cycling:e=>{let{sx:t={},...n}=e;return r.jsx(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:r.jsxs("g",{id:"Method/Cycling",children:[r.jsx("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{id:"bike_icon (Stroke)",fillRule:"evenodd",clipRule:"evenodd",d:"M9.85001 5C9.85001 4.83432 9.98433 4.7 10.15 4.7H11.45C11.6157 4.7 11.75 4.83432 11.75 5V6.90132L12.3293 8.63925C12.4656 8.61348 12.6062 8.6 12.75 8.6C13.9927 8.6 15 9.60727 15 10.85C15 12.0927 13.9927 13.1 12.75 13.1C11.5073 13.1 10.5 12.0927 10.5 10.85C10.5 9.96249 11.0137 9.19508 11.7601 8.82887L11.3398 7.56801L9.08427 10.3874C9.0381 10.4451 8.97224 10.4838 8.89933 10.4959L7.19892 10.7793C7.19965 10.8028 7.20001 10.8264 7.20001 10.85C7.20001 12.0927 6.19275 13.1 4.95001 13.1C3.70728 13.1 2.70001 12.0927 2.70001 10.85C2.70001 9.60727 3.70728 8.6 4.95001 8.6C4.97366 8.6 4.99722 8.60037 5.02069 8.60109L5.30409 6.90068C5.3282 6.75602 5.45336 6.65 5.60001 6.65H11.15V5.3H10.15C9.98433 5.3 9.85001 5.16569 9.85001 5ZM10.8258 7.25H6.32428L8.82514 9.75086L10.8258 7.25ZM8.22567 9.99992L5.80009 7.57435L5.61263 8.69914C6.32244 8.91752 6.8825 9.47758 7.10088 10.1874L8.22567 9.99992ZM6.50159 10.2873C6.33525 9.82864 5.97137 9.46477 5.51275 9.29842L5.31498 10.485L6.50159 10.2873ZM4.92083 9.20025C4.02293 9.21582 3.30001 9.94838 3.30001 10.85C3.30001 11.7614 4.03865 12.5 4.95001 12.5C5.85163 12.5 6.58419 11.7771 6.59976 10.8792L4.99933 11.1459C4.90376 11.1618 4.80639 11.1306 4.73788 11.0621C4.66937 10.9936 4.63817 10.8962 4.65409 10.8007L4.92083 9.20025ZM11.9522 9.4053C11.444 9.68649 11.1 10.228 11.1 10.85C11.1 11.7614 11.8386 12.5 12.75 12.5C13.6614 12.5 14.4 11.7614 14.4 10.85C14.4 9.93864 13.6614 9.2 12.75 9.2C12.6725 9.2 12.5962 9.20535 12.5215 9.2157L13.0346 10.7551C13.087 10.9123 13.0021 11.0822 12.8449 11.1346C12.6877 11.187 12.5178 11.1021 12.4654 10.9449L11.9522 9.4053Z",fill:"#2E3841"})]})})}},Gn=[{icon:fe,id:exports.CommuteMethod.driving},{icon:de,id:exports.CommuteMethod.public_transport},{icon:me,id:exports.CommuteMethod.walking},{icon:pe,id:exports.CommuteMethod.cycling}],Zn=(e,t)=>{switch(e){case exports.CommuteMethod.cycling:case exports.CommuteMethod.driving:return{width:"35px",height:"auto",...t&&{path:{fill:"white"}}};case exports.CommuteMethod.public_transport:return{width:"auto",height:"36px",...t&&{"#Vector_8, #Vector_9, #Vector_10, #Vector_11":{fill:"white"},path:{stroke:"white"}}};case exports.CommuteMethod.walking:return{width:"auto",height:"31px",...t&&{path:{stroke:"white"}}};default:return}},Wn=e=>{let{disableCheck:t=!1,multiple:i=!1,commute:n,variant:s,isInvalid:a,googleAutocompleteApiKey:l,onChange:u}=e;const p=o.useMemo((()=>jn(n.time)),[n.time]),f=e=>()=>{if(!i)return u({...n,methods:[e.id]});const t=n.methods.includes(e.id);t&&1===n.methods.length||u({...n,methods:t?n.methods.filter((t=>t!==e.id)):n.methods.concat(e.id)})};return r.jsxs(h,{children:[r.jsx(Fn,{location:n.location,isInvalid:a,apiKey:l,onChange:e=>{u({...n,location:e})}}),r.jsxs(h,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsx(d,{variant:"h4",mb:1,mt:2,children:"Commute Time"}),p]}),r.jsx(c,{sx:{px:2},children:r.jsx(y,{value:n.time,onChange:(e,t)=>{u({...n,time:t})},min:10,max:120,step:10,color:"secondary"})}),r.jsx(d,{variant:"h4",mb:1,mt:2,children:"Commute Method(s)"}),r.jsx(h,{direction:"row",justifyContent:"space-between",gap:.5,children:Gn.map((e=>r.jsxs(c,{sx:{position:"relative"},children:[!t&&n.methods.includes(e.id)&&r.jsx(_,{fontSize:"small",color:"primary",sx:{position:"absolute",right:"-8px",top:"-8px",backgroundColor:"white",zIndex:1}}),r.jsx(ee,{shape:"square",variant:s&&n.methods.includes(e.id)?s:"outlined",color:s?"primary":n.methods.includes(e.id)?"success":"inherit",onClick:f(e),sx:n.methods.includes(e.id)?[e=>({"&&":{borderColor:e.palette.primary.main,"&:hover":{borderColor:e.palette.primary.main}}}),n.methods.includes(e.id)&&1===n.methods.length&&{cursor:"default"}]:void 0,children:r.jsx(e.icon,{sx:Zn(e.id,n.methods.includes(e.id))})})]},e.id)))})]})},Qn=e=>{let{areas:t,area:i,isInvalid:n,errorText:s="Please select an area from the list",onChange:a}=e;const[l,c]=o.useState("");return r.jsx(b,{value:i,disableClearable:0===i.length||0===l.length,onChange:(e,t)=>{a(t??"")},inputValue:l,onInputChange:(e,t)=>{c(t)},options:t,renderInput:e=>r.jsx(f,{...e,placeholder:"Location, borough, neighborhood, etc.",error:n,helperText:n?s:" ",FormHelperTextProps:{sx:{textAlign:"center"}}})})},qn=e=>{let{title:t="See My Matches",isValid:n=!0,isSubmitting:o=!1,onSubmit:s}=e;return r.jsxs(i.Stack,{position:"sticky",sx:e=>({bottom:0,background:e.palette.background.paper,borderTop:`1px solid ${e.palette.grey[300]}`,py:2,px:1,zIndex:2}),children:[r.jsx(ee,{fullWidth:!0,disabled:!n||o,onClick:s,children:o?r.jsx(i.CircularProgress,{}):t}),r.jsx(i.Stack,{direction:"row",justifyContent:"center",pt:.5,children:r.jsx(ye,{})})]})},Xn=e=>{let{loading:t=!1,render:n,color:o="#fff",sx:s={}}=e;return t?r.jsx(i.Backdrop,{sx:{color:o,backgroundColor:"transparent",zIndex:e=>e.zIndex.drawer+1,...s},open:t,children:r.jsx(i.CircularProgress,{color:"primary"})}):r.jsx(r.Fragment,{children:n()})};class Yn extends o.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?r.jsxs(i.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",width:"100%",p:3,children:[r.jsx(i.Box,{pb:1,children:r.jsx(Xn,{color:"error",render:()=>r.jsx(i.SvgIcon,{color:"warning",fontSize:"large",children:r.jsx(T,{})})})}),r.jsx(i.Typography,{gutterBottom:!0,variant:"h3",color:"error",children:"Something went wrong."}),r.jsx(i.Typography,{variant:"subtitle1",color:"error",children:"We know about the error, and are already actively working on its solution."})]}):this.props.children}}const $n=o.forwardRef((function(e,t){return r.jsx(i.Slide,{direction:"up",ref:t,...e})})),Kn=e=>{let{modalID:t,open:n,payload:s={},ModalComponent:a,DialogProps:l,onModalResolved:c=(()=>{}),onModalRejected:u=(()=>{}),onModalExited:h=(()=>{}),fullHeight:d}=e;const p=i.useTheme(),f=i.useMediaQuery(p.breakpoints.down("sm")),[m,g]=o.useState(n),[A,_]=o.useState(!1),y=e=>{g(!1),_(!1),u(e),h(t)};return o.useEffect((()=>{g(n)}),[n]),r.jsx(Yn,{children:r.jsx(a,{isModalEntered:A,payload:s,DialogProps:{disableEscapeKeyDown:!0,TransitionComponent:f?$n:void 0,sx:{[p.breakpoints.up("sm")]:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column","& > .MuiDialog-container":{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},[p.breakpoints.down("sm")]:{"& > .MuiDialog-container > .MuiPaper-root":{position:"absolute",left:0,right:0,bottom:0,m:0,[p.breakpoints.down("sm")]:{height:"100%",maxHeight:d?"auto":400},"@media (max-width: 320px)":{minHeight:436}}}},PaperProps:{elevation:0,sx:{overflow:"hidden",[p.breakpoints.up("sm")]:{borderRadius:"20px",width:483,maxWidth:483}}},...l,open:m,onClose:y,onExited:()=>{h(t),_(!1)},onEntered:()=>{_(!0)}},handleModalResolve:e=>{g(!1),_(!1),c(e),h(t)},handleModalReject:y})})},Jn=o.createContext({globalValues:null,modals:[],setGlobalValues:e=>{},deleteModal:e=>{},addModal:e=>{},openModal:e=>{}}),eo=e=>{let{pathname:t,children:i}=e;const n=o.useRef(0),[s,a]=o.useState({}),[l,c]=o.useState([]),u=o.useCallback((e=>{c((t=>t.filter((t=>t?.modalID!==e)))),n.current--}),[]),h=e=>{c((t=>t.concat({...e,modalID:n.current++,onModalExited:u})))},d=e=>{c([{...e,modalID:n.current++,onModalExited:u}])};o.useEffect((()=>{c([])}),[t]);const p=o.useMemo((()=>({modals:l,deleteModal:u,globalValues:s,setGlobalValues:a,addModal:h,openModal:d})),[]);return r.jsxs(Jn.Provider,{value:p,children:[i,l?.map((e=>r.jsx(Kn,{open:!0,...e},e?.modalID)))]})};var to={exports:{}},ro=to.exports=function(){var e,t,r;function i(i,n){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),r=n(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=n;else e=n}return i(["exports"],(function(e){var t="3.4.0";let r;const i={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){r=e}}return r},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!i.API_URL)return null;try{const e=new URL(i.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"};function n(e){return i.API_URL_REGEX.test(e)}function o(e){return 0===e.indexOf("mapbox:")}function s(e){return i.API_CDN_URL_REGEX.test(e)}function a(e){return i.API_SPRITE_REGEX.test(e)}function l(e){return i.API_STYLE_REGEX.test(e)&&!a(e)}const c={create:"create",load:"load",fullLoad:"fullLoad"};function u(e){const t=e.name.split("?")[0];return s(t)&&t.includes("mapbox-gl.js")?"javascript":s(t)&&t.includes("mapbox-gl.css")?"css":function(e){return i.API_FONTS_REGEX.test(e)}(t)?"fontRange":a(t)?"sprite":l(t)?"style":function(e){return i.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={},p={};Object.defineProperty(p,"__esModule",{value:!0}),p.setMatrixArrayType=function(e){p.ARRAY_TYPE=m=e},p.toRadian=function(e){return e*A},p.equals=function(e,t){return Math.abs(e-t)<=f*Math.max(1,Math.abs(e),Math.abs(t))},p.RANDOM=p.ARRAY_TYPE=p.EPSILON=void 0;var f=1e-6;p.EPSILON=f;var m="undefined"!=typeof Float32Array?Float32Array:Array;p.ARRAY_TYPE=m;var g=Math.random;p.RANDOM=g;var A=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var _={};function y(e){return y="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},y(e)}Object.defineProperty(_,"__esModule",{value:!0}),_.create=function(){var e=new x.ARRAY_TYPE(4);return x.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},_.clone=function(e){var t=new x.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},_.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},_.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},_.fromValues=function(e,t,r,i){var n=new x.ARRAY_TYPE(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},_.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},_.transpose=function(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},_.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*o-n*i;return s?(e[0]=o*(s=1/s),e[1]=-i*s,e[2]=-n*s,e[3]=r*s,e):null},_.adjoint=function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},_.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},_.multiply=b,_.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*a,e[1]=n*l+s*a,e[2]=i*-a+o*l,e[3]=n*-a+s*l,e},_.scale=function(e,t,r){var i=t[1],n=t[2],o=t[3],s=r[0],a=r[1];return e[0]=t[0]*s,e[1]=i*s,e[2]=n*a,e[3]=o*a,e},_.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e},_.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},_.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},_.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},_.LDU=function(e,t,r,i){return e[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-e[2]*r[1],[e,t,r]},_.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},_.subtract=w,_.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},_.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=x.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=x.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-l)<=x.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=x.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},_.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},_.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},_.sub=_.mul=void 0;var x=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==y(e)&&"function"!=typeof e)return{default:e};var r=v(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function b(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*a+o*l,e[1]=n*a+s*l,e[2]=i*c+o*u,e[3]=n*c+s*u,e}function w(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}_.mul=b,_.sub=w;var C={};function T(e){return T="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},T(e)}Object.defineProperty(C,"__esModule",{value:!0}),C.create=function(){var e=new E.ARRAY_TYPE(6);return E.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},C.clone=function(e){var t=new E.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},C.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},C.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},C.fromValues=function(e,t,r,i,n,o){var s=new E.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=r,s[3]=i,s[4]=n,s[5]=o,s},C.set=function(e,t,r,i,n,o,s){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e},C.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=r*o-i*n;return l?(e[0]=o*(l=1/l),e[1]=-i*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*a-o*s)*l,e[5]=(i*s-r*a)*l,e):null},C.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},C.multiply=S,C.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=Math.sin(r),u=Math.cos(r);return e[0]=i*u+o*c,e[1]=n*u+s*c,e[2]=i*-c+o*u,e[3]=n*-c+s*u,e[4]=a,e[5]=l,e},C.scale=function(e,t,r){var i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=r[0],c=r[1];return e[0]=t[0]*l,e[1]=i*l,e[2]=n*c,e[3]=o*c,e[4]=s,e[5]=a,e},C.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=i*c+o*u+a,e[5]=n*c+s*u+l,e},C.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e[4]=0,e[5]=0,e},C.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},C.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},C.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},C.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},C.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e},C.subtract=I,C.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e},C.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e},C.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},C.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=t[0],c=t[1],u=t[2],h=t[3],d=t[4],p=t[5];return Math.abs(r-l)<=E.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-c)<=E.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(n-u)<=E.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-h)<=E.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=E.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=E.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},C.sub=C.mul=void 0;var E=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==T(e)&&"function"!=typeof e)return{default:e};var r=M(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(M=function(e){return e?r:t})(e)}function S(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1],h=r[2],d=r[3],p=r[4],f=r[5];return e[0]=i*c+o*u,e[1]=n*c+s*u,e[2]=i*h+o*d,e[3]=n*h+s*d,e[4]=i*p+o*f+a,e[5]=n*p+s*f+l,e}function I(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}C.mul=S,C.sub=I;var P={};function D(e){return D="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},D(e)}Object.defineProperty(P,"__esModule",{value:!0}),P.create=function(){var e=new k.ARRAY_TYPE(9);return k.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},P.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},P.clone=function(e){var t=new k.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},P.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromValues=function(e,t,r,i,n,o,s,a,l){var c=new k.ARRAY_TYPE(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=n,c[5]=o,c[6]=s,c[7]=a,c[8]=l,c},P.set=function(e,t,r,i,n,o,s,a,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e},P.identity=function(e){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},P.transpose=function(e,t){if(e===t){var r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},P.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l,f=r*h+i*d+n*p;return f?(e[0]=h*(f=1/f),e[1]=(-u*i+n*c)*f,e[2]=(a*i-n*s)*f,e[3]=d*f,e[4]=(u*r-n*l)*f,e[5]=(-a*r+n*o)*f,e[6]=p*f,e[7]=(-c*r+i*l)*f,e[8]=(s*r-i*o)*f,e):null},P.adjoint=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=n*c-i*u,e[2]=i*a-n*s,e[3]=a*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*a,e[6]=o*c-s*l,e[7]=i*l-r*c,e[8]=r*s-i*o,e},P.determinant=function(e){var t=e[3],r=e[4],i=e[5],n=e[6],o=e[7],s=e[8];return e[0]*(s*r-i*o)+e[1]*(-s*t+i*n)+e[2]*(o*t-r*n)},P.multiply=O,P.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=d*i+p*s+c,e[7]=d*n+p*a+u,e[8]=d*o+p*l+h,e},P.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*i+d*s,e[1]=p*n+d*a,e[2]=p*o+d*l,e[3]=p*s-d*i,e[4]=p*a-d*n,e[5]=p*l-d*o,e[6]=c,e[7]=u,e[8]=h,e},P.scale=function(e,t,r){var i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},P.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},P.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,l=n+n,c=r*s,u=i*s,h=i*a,d=n*s,p=n*a,f=n*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[3]=u-A,e[6]=d+g,e[1]=u+A,e[4]=1-c-f,e[7]=p-m,e[2]=d-g,e[5]=p+m,e[8]=1-c-h,e},P.normalFromMat4=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-i*s,y=r*l-n*s,x=r*c-o*s,v=i*l-n*a,b=i*c-o*a,w=n*c-o*l,C=u*m-h*f,T=u*g-d*f,E=u*A-p*f,M=h*g-d*m,S=h*A-p*m,I=d*A-p*g,P=_*I-y*S+x*M+v*E-b*T+w*C;return P?(e[0]=(a*I-l*S+c*M)*(P=1/P),e[1]=(l*E-s*I-c*T)*P,e[2]=(s*S-a*E+c*C)*P,e[3]=(n*S-i*I-o*M)*P,e[4]=(r*I-n*E+o*T)*P,e[5]=(i*E-r*S-o*C)*P,e[6]=(m*w-g*b+A*v)*P,e[7]=(g*x-f*w-A*y)*P,e[8]=(f*b-m*x+A*_)*P,e):null},P.projection=function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},P.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},P.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},P.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},P.subtract=z,P.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},P.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},P.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},P.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],A=t[6],_=t[7],y=t[8];return Math.abs(r-h)<=k.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=k.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(n-p)<=k.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(o-f)<=k.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=k.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-g)<=k.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-A)<=k.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(c-_)<=k.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-y)<=k.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))},P.sub=P.mul=void 0;var k=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==D(e)&&"function"!=typeof e)return{default:e};var r=L(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(L=function(e){return e?r:t})(e)}function O(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1],f=r[2],m=r[3],g=r[4],A=r[5],_=r[6],y=r[7],x=r[8];return e[0]=d*i+p*s+f*c,e[1]=d*n+p*a+f*u,e[2]=d*o+p*l+f*h,e[3]=m*i+g*s+A*c,e[4]=m*n+g*a+A*u,e[5]=m*o+g*l+A*h,e[6]=_*i+y*s+x*c,e[7]=_*n+y*a+x*u,e[8]=_*o+y*l+x*h,e}function z(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}P.mul=O,P.sub=z;var B={};function R(e){return 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},R(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},B.clone=function(e){var t=new F.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},B.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.fromValues=function(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m){var g=new F.ARRAY_TYPE(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=i,g[4]=n,g[5]=o,g[6]=s,g[7]=a,g[8]=l,g[9]=c,g[10]=u,g[11]=h,g[12]=d,g[13]=p,g[14]=f,g[15]=m,g},B.set=function(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=h,e[11]=d,e[12]=p,e[13]=f,e[14]=m,e[15]=g,e},B.identity=V,B.transpose=function(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=o,e[11]=t[14],e[12]=n,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},B.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-i*s,y=r*l-n*s,x=r*c-o*s,v=i*l-n*a,b=i*c-o*a,w=n*c-o*l,C=u*m-h*f,T=u*g-d*f,E=u*A-p*f,M=h*g-d*m,S=h*A-p*m,I=d*A-p*g,P=_*I-y*S+x*M+v*E-b*T+w*C;return P?(e[0]=(a*I-l*S+c*M)*(P=1/P),e[1]=(n*S-i*I-o*M)*P,e[2]=(m*w-g*b+A*v)*P,e[3]=(d*b-h*w-p*v)*P,e[4]=(l*E-s*I-c*T)*P,e[5]=(r*I-n*E+o*T)*P,e[6]=(g*x-f*w-A*y)*P,e[7]=(u*w-d*x+p*y)*P,e[8]=(s*S-a*E+c*C)*P,e[9]=(i*E-r*S-o*C)*P,e[10]=(f*b-m*x+A*_)*P,e[11]=(h*x-u*b-p*_)*P,e[12]=(a*T-s*M-l*C)*P,e[13]=(r*M-i*T+n*C)*P,e[14]=(m*y-f*v-g*_)*P,e[15]=(u*v-h*y+d*_)*P,e):null},B.adjoint=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15];return e[0]=a*(d*A-p*g)-h*(l*A-c*g)+m*(l*p-c*d),e[1]=-(i*(d*A-p*g)-h*(n*A-o*g)+m*(n*p-o*d)),e[2]=i*(l*A-c*g)-a*(n*A-o*g)+m*(n*c-o*l),e[3]=-(i*(l*p-c*d)-a*(n*p-o*d)+h*(n*c-o*l)),e[4]=-(s*(d*A-p*g)-u*(l*A-c*g)+f*(l*p-c*d)),e[5]=r*(d*A-p*g)-u*(n*A-o*g)+f*(n*p-o*d),e[6]=-(r*(l*A-c*g)-s*(n*A-o*g)+f*(n*c-o*l)),e[7]=r*(l*p-c*d)-s*(n*p-o*d)+u*(n*c-o*l),e[8]=s*(h*A-p*m)-u*(a*A-c*m)+f*(a*p-c*h),e[9]=-(r*(h*A-p*m)-u*(i*A-o*m)+f*(i*p-o*h)),e[10]=r*(a*A-c*m)-s*(i*A-o*m)+f*(i*c-o*a),e[11]=-(r*(a*p-c*h)-s*(i*p-o*h)+u*(i*c-o*a)),e[12]=-(s*(h*g-d*m)-u*(a*g-l*m)+f*(a*d-l*h)),e[13]=r*(h*g-d*m)-u*(i*g-n*m)+f*(i*d-n*h),e[14]=-(r*(a*g-l*m)-s*(i*g-n*m)+f*(i*l-n*a)),e[15]=r*(a*d-l*h)-s*(i*d-n*h)+u*(i*l-n*a),e},B.determinant=function(e){var t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-r*o)*(h*g-d*m)-(t*a-i*o)*(u*g-d*f)+(t*l-n*o)*(u*m-h*f)+(r*a-i*s)*(c*g-d*p)-(r*l-n*s)*(c*m-h*p)+(i*l-n*a)*(c*f-u*p)},B.multiply=N,B.translate=function(e,t,r){var i,n,o,s,a,l,c,u,h,d,p,f,m=r[0],g=r[1],A=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=i=t[0],e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=i*m+a*g+h*A+t[12],e[13]=n*m+l*g+d*A+t[13],e[14]=o*m+c*g+p*A+t[14],e[15]=s*m+u*g+f*A+t[15]),e},B.scale=function(e,t,r){var i=r[0],n=r[1],o=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.rotate=function(e,t,r,i){var n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S=i[0],I=i[1],P=i[2],D=Math.hypot(S,I,P);return D<F.EPSILON?null:(S*=D=1/D,I*=D,P*=D,n=Math.sin(r),o=Math.cos(r),l=t[1],c=t[2],u=t[3],d=t[5],p=t[6],f=t[7],g=t[9],A=t[10],_=t[11],y=S*S*(s=1-o)+o,b=S*I*s-P*n,w=I*I*s+o,C=P*I*s+S*n,T=S*P*s+I*n,E=I*P*s-S*n,M=P*P*s+o,e[0]=(a=t[0])*y+(h=t[4])*(x=I*S*s+P*n)+(m=t[8])*(v=P*S*s-I*n),e[1]=l*y+d*x+g*v,e[2]=c*y+p*x+A*v,e[3]=u*y+f*x+_*v,e[4]=a*b+h*w+m*C,e[5]=l*b+d*w+g*C,e[6]=c*b+p*w+A*C,e[7]=u*b+f*w+_*C,e[8]=a*T+h*E+m*M,e[9]=l*T+d*E+g*M,e[10]=c*T+p*E+A*M,e[11]=u*T+f*E+_*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},B.rotateX=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*n+c*i,e[5]=s*n+u*i,e[6]=a*n+h*i,e[7]=l*n+d*i,e[8]=c*n-o*i,e[9]=u*n-s*i,e[10]=h*n-a*i,e[11]=d*n-l*i,e},B.rotateY=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n-c*i,e[1]=s*n-u*i,e[2]=a*n-h*i,e[3]=l*n-d*i,e[8]=o*i+c*n,e[9]=s*i+u*n,e[10]=a*i+h*n,e[11]=l*i+d*n,e},B.rotateZ=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n+c*i,e[1]=s*n+u*i,e[2]=a*n+h*i,e[3]=l*n+d*i,e[4]=c*n-o*i,e[5]=u*n-s*i,e[6]=h*n-a*i,e[7]=d*n-l*i,e},B.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},B.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotation=function(e,t,r){var i,n,o,s=r[0],a=r[1],l=r[2],c=Math.hypot(s,a,l);return c<F.EPSILON?null:(s*=c=1/c,a*=c,l*=c,i=Math.sin(t),n=Math.cos(t),e[0]=s*s*(o=1-n)+n,e[1]=a*s*o+l*i,e[2]=l*s*o-a*i,e[3]=0,e[4]=s*a*o-l*i,e[5]=a*a*o+n,e[6]=l*a*o+s*i,e[7]=0,e[8]=s*l*o+a*i,e[9]=a*l*o-s*i,e[10]=l*l*o+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)},B.fromXRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromYRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromZRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotationTranslation=U,B.fromQuat2=function(e,t){var r=new F.ARRAY_TYPE(3),i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=i*i+n*n+o*o+s*s;return h>0?(r[0]=2*(a*s+u*i+l*o-c*n)/h,r[1]=2*(l*s+u*n+c*i-a*o)/h,r[2]=2*(c*s+u*o+a*n-l*i)/h):(r[0]=2*(a*s+u*i+l*o-c*n),r[1]=2*(l*s+u*n+c*i-a*o),r[2]=2*(c*s+u*o+a*n-l*i)),U(e,t,r),e},B.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},B.getScaling=H,B.getRotation=function(e,t){var r=new F.ARRAY_TYPE(3);H(r,t);var i=1/r[0],n=1/r[1],o=1/r[2],s=t[0]*i,a=t[1]*n,l=t[2]*o,c=t[4]*i,u=t[5]*n,h=t[6]*o,d=t[8]*i,p=t[9]*n,f=t[10]*o,m=s+u+f,g=0;return m>0?(g=2*Math.sqrt(m+1),e[3]=.25*g,e[0]=(h-p)/g,e[1]=(d-l)/g,e[2]=(a-c)/g):s>u&&s>f?(g=2*Math.sqrt(1+s-u-f),e[3]=(h-p)/g,e[0]=.25*g,e[1]=(a+c)/g,e[2]=(d+l)/g):u>f?(g=2*Math.sqrt(1+u-s-f),e[3]=(d-l)/g,e[0]=(a+c)/g,e[1]=.25*g,e[2]=(h+p)/g):(g=2*Math.sqrt(1+f-s-u),e[3]=(a-c)/g,e[0]=(d+l)/g,e[1]=(h+p)/g,e[2]=.25*g),e},B.fromRotationTranslationScale=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3],l=n+n,c=o+o,u=s+s,h=n*l,d=n*c,p=n*u,f=o*c,m=o*u,g=s*u,A=a*l,_=a*c,y=a*u,x=i[0],v=i[1],b=i[2];return e[0]=(1-(f+g))*x,e[1]=(d+y)*x,e[2]=(p-_)*x,e[3]=0,e[4]=(d-y)*v,e[5]=(1-(h+g))*v,e[6]=(m+A)*v,e[7]=0,e[8]=(p+_)*b,e[9]=(m-A)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},B.fromRotationTranslationScaleOrigin=function(e,t,r,i,n){var o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,h=a+a,d=o*c,p=o*u,f=o*h,m=s*u,g=s*h,A=a*h,_=l*c,y=l*u,x=l*h,v=i[0],b=i[1],w=i[2],C=n[0],T=n[1],E=n[2],M=(1-(m+A))*v,S=(p+x)*v,I=(f-y)*v,P=(p-x)*b,D=(1-(d+A))*b,k=(g+_)*b,L=(f+y)*w,O=(g-_)*w,z=(1-(d+m))*w;return e[0]=M,e[1]=S,e[2]=I,e[3]=0,e[4]=P,e[5]=D,e[6]=k,e[7]=0,e[8]=L,e[9]=O,e[10]=z,e[11]=0,e[12]=r[0]+C-(M*C+P*T+L*E),e[13]=r[1]+T-(S*C+D*T+O*E),e[14]=r[2]+E-(I*C+k*T+z*E),e[15]=1,e},B.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,l=n+n,c=r*s,u=i*s,h=i*a,d=n*s,p=n*a,f=n*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[1]=u+A,e[2]=d-g,e[3]=0,e[4]=u-A,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.frustum=function(e,t,r,i,n,o,s){var a=1/(r-t),l=1/(n-i),c=1/(o-s);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(n+i)*l,e[10]=(s+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*c,e[15]=0,e},B.perspectiveNO=G,B.perspectiveZO=function(e,t,r,i,n){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=n*(o=1/(i-n)),e[14]=n*i*o):(e[10]=-1,e[14]=-i),e},B.perspectiveFromFieldOfView=function(e,t,r,i){var n=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+a),c=2/(n+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-a)*l*.5,e[9]=(n-o)*c*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e},B.orthoNO=Z,B.orthoZO=function(e,t,r,i,n,o,s){var a=1/(t-r),l=1/(i-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*l,e[14]=o*c,e[15]=1,e},B.lookAt=function(e,t,r,i){var n,o,s,a,l,c,u,h,d,p,f=t[0],m=t[1],g=t[2],A=i[0],_=i[1],y=i[2],x=r[0],v=r[1],b=r[2];return Math.abs(f-x)<F.EPSILON&&Math.abs(m-v)<F.EPSILON&&Math.abs(g-b)<F.EPSILON?V(e):(u=f-x,h=m-v,d=g-b,n=_*(d*=p=1/Math.hypot(u,h,d))-y*(h*=p),o=y*(u*=p)-A*d,s=A*h-_*u,(p=Math.hypot(n,o,s))?(n*=p=1/p,o*=p,s*=p):(n=0,o=0,s=0),a=h*s-d*o,l=d*n-u*s,c=u*o-h*n,(p=Math.hypot(a,l,c))?(a*=p=1/p,l*=p,c*=p):(a=0,l=0,c=0),e[0]=n,e[1]=a,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(n*f+o*m+s*g),e[13]=-(a*f+l*m+c*g),e[14]=-(u*f+h*m+d*g),e[15]=1,e)},B.targetTo=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=i[0],l=i[1],c=i[2],u=n-r[0],h=o-r[1],d=s-r[2],p=u*u+h*h+d*d;p>0&&(u*=p=1/Math.sqrt(p),h*=p,d*=p);var f=l*d-c*h,m=c*u-a*d,g=a*h-l*u;return(p=f*f+m*m+g*g)>0&&(f*=p=1/Math.sqrt(p),m*=p,g*=p),e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=h*g-d*m,e[5]=d*f-u*g,e[6]=u*m-h*f,e[7]=0,e[8]=u,e[9]=h,e[10]=d,e[11]=0,e[12]=n,e[13]=o,e[14]=s,e[15]=1,e},B.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},B.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},B.subtract=W,B.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},B.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e[9]=t[9]+r[9]*i,e[10]=t[10]+r[10]*i,e[11]=t[11]+r[11]*i,e[12]=t[12]+r[12]*i,e[13]=t[13]+r[13]*i,e[14]=t[14]+r[14]*i,e[15]=t[15]+r[15]*i,e},B.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},B.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],A=e[15],_=t[0],y=t[1],x=t[2],v=t[3],b=t[4],w=t[5],C=t[6],T=t[7],E=t[8],M=t[9],S=t[10],I=t[11],P=t[12],D=t[13],k=t[14],L=t[15];return Math.abs(r-_)<=F.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-y)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(n-x)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(o-v)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-b)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-w)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-T)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(u-E)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-M)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-S)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(p-I)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-P)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-D)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-k)<=F.EPSILON*Math.max(1,Math.abs(g),Math.abs(k))&&Math.abs(A-L)<=F.EPSILON*Math.max(1,Math.abs(A),Math.abs(L))},B.sub=B.mul=B.ortho=B.perspective=void 0;var F=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var r=j(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(j=function(e){return e?r:t})(e)}function V(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],m=t[12],g=t[13],A=t[14],_=t[15],y=r[0],x=r[1],v=r[2],b=r[3];return e[0]=y*i+x*a+v*h+b*m,e[1]=y*n+x*l+v*d+b*g,e[2]=y*o+x*c+v*p+b*A,e[3]=y*s+x*u+v*f+b*_,e[4]=(y=r[4])*i+(x=r[5])*a+(v=r[6])*h+(b=r[7])*m,e[5]=y*n+x*l+v*d+b*g,e[6]=y*o+x*c+v*p+b*A,e[7]=y*s+x*u+v*f+b*_,e[8]=(y=r[8])*i+(x=r[9])*a+(v=r[10])*h+(b=r[11])*m,e[9]=y*n+x*l+v*d+b*g,e[10]=y*o+x*c+v*p+b*A,e[11]=y*s+x*u+v*f+b*_,e[12]=(y=r[12])*i+(x=r[13])*a+(v=r[14])*h+(b=r[15])*m,e[13]=y*n+x*l+v*d+b*g,e[14]=y*o+x*c+v*p+b*A,e[15]=y*s+x*u+v*f+b*_,e}function U(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=i+i,l=n+n,c=o+o,u=i*a,h=i*l,d=i*c,p=n*l,f=n*c,m=o*c,g=s*a,A=s*l,_=s*c;return e[0]=1-(p+m),e[1]=h+_,e[2]=d-A,e[3]=0,e[4]=h-_,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=d+A,e[9]=f-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function H(e,t){var r=t[4],i=t[5],n=t[6],o=t[8],s=t[9],a=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(r,i,n),e[2]=Math.hypot(o,s,a),e}function G(e,t,r,i,n){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=(n+i)*(o=1/(i-n)),e[14]=2*n*i*o):(e[10]=-1,e[14]=-2*i),e}function Z(e,t,r,i,n,o,s){var a=1/(t-r),l=1/(i-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*l,e[14]=(s+o)*c,e[15]=1,e}function W(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}B.perspective=G,B.ortho=Z,B.mul=N,B.sub=W;var Q={},q={};function X(e){return X="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},X(e)}Object.defineProperty(q,"__esModule",{value:!0}),q.create=K,q.clone=function(e){var t=new Y.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},q.length=J,q.fromValues=function(e,t,r){var i=new Y.ARRAY_TYPE(3);return i[0]=e,i[1]=t,i[2]=r,i},q.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},q.set=function(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e},q.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},q.subtract=ee,q.multiply=te,q.divide=re,q.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},q.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},q.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},q.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},q.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},q.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},q.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e},q.distance=ie,q.squaredDistance=ne,q.squaredLength=oe,q.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},q.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},q.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},q.dot=se,q.cross=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],l=r[2];return e[0]=n*l-o*a,e[1]=o*s-i*l,e[2]=i*a-n*s,e},q.lerp=function(e,t,r,i){var n=t[0],o=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e},q.hermite=function(e,t,r,i,n,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,c=s*(o-1),u=s*(3-2*o);return e[0]=t[0]*a+r[0]*l+i[0]*c+n[0]*u,e[1]=t[1]*a+r[1]*l+i[1]*c+n[1]*u,e[2]=t[2]*a+r[2]*l+i[2]*c+n[2]*u,e},q.bezier=function(e,t,r,i,n,o){var s=1-o,a=s*s,l=o*o,c=a*s,u=3*o*a,h=3*l*s,d=l*o;return e[0]=t[0]*c+r[0]*u+i[0]*h+n[0]*d,e[1]=t[1]*c+r[1]*u+i[1]*h+n[1]*d,e[2]=t[2]*c+r[2]*u+i[2]*h+n[2]*d,e},q.random=function(e,t){t=t||1;var r=2*Y.RANDOM()*Math.PI,i=2*Y.RANDOM()-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e},q.transformMat4=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[3]*i+r[7]*n+r[11]*o+r[15];return e[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/(s=s||1),e[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/s,e},q.transformMat3=function(e,t,r){var i=t[0],n=t[1],o=t[2];return e[0]=i*r[0]+n*r[3]+o*r[6],e[1]=i*r[1]+n*r[4]+o*r[7],e[2]=i*r[2]+n*r[5]+o*r[8],e},q.transformQuat=function(e,t,r){var i=r[0],n=r[1],o=r[2],s=t[0],a=t[1],l=t[2],c=n*l-o*a,u=o*s-i*l,h=i*a-n*s,d=n*h-o*u,p=o*c-i*h,f=i*u-n*c,m=2*r[3];return u*=m,h*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+u+p,e[2]=l+h+f,e},q.rotateX=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.rotateY=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.rotateZ=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.angle=function(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2],l=Math.sqrt(r*r+i*i+n*n)*Math.sqrt(o*o+s*s+a*a),c=l&&se(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},q.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},q.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},q.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},q.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=Y.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=Y.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-a)<=Y.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))},q.forEach=q.sqrLen=q.len=q.sqrDist=q.dist=q.div=q.mul=q.sub=void 0;var Y=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==X(e)&&"function"!=typeof e)return{default:e};var r=$(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function $(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return($=function(e){return e?r:t})(e)}function K(){var e=new Y.ARRAY_TYPE(3);return Y.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function J(e){return Math.hypot(e[0],e[1],e[2])}function ee(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function te(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function re(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ie(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function ne(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}function oe(e){var t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}function se(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}q.sub=ee,q.mul=te,q.div=re,q.dist=ie,q.sqrDist=ne,q.len=J,q.sqrLen=oe;var ae,le=(ae=K(),function(e,t,r,i,n,o){var s,a;for(t||(t=3),r||(r=0),a=i?Math.min(i*t+r,e.length):e.length,s=r;s<a;s+=t)ae[0]=e[s],ae[1]=e[s+1],ae[2]=e[s+2],n(ae,ae,o),e[s]=ae[0],e[s+1]=ae[1],e[s+2]=ae[2];return e});q.forEach=le;var ce={};function ue(e){return ue="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},ue(e)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.create=pe,ce.clone=function(e){var t=new he.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ce.fromValues=function(e,t,r,i){var n=new he.ARRAY_TYPE(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},ce.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},ce.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},ce.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ce.subtract=fe,ce.multiply=me,ce.divide=ge,ce.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},ce.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},ce.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},ce.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},ce.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},ce.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},ce.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},ce.distance=Ae,ce.squaredDistance=_e,ce.length=ye,ce.squaredLength=xe,ce.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},ce.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},ce.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=o*s,e},ce.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ce.cross=function(e,t,r,i){var n=r[0]*i[1]-r[1]*i[0],o=r[0]*i[2]-r[2]*i[0],s=r[0]*i[3]-r[3]*i[0],a=r[1]*i[2]-r[2]*i[1],l=r[1]*i[3]-r[3]*i[1],c=r[2]*i[3]-r[3]*i[2],u=t[0],h=t[1],d=t[2],p=t[3];return e[0]=h*c-d*l+p*a,e[1]=-u*c+d*s-p*o,e[2]=u*l-h*s+p*n,e[3]=-u*a+h*o-d*n,e},ce.lerp=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e[3]=a+i*(r[3]-a),e},ce.random=function(e,t){var r,i,n,o,s,a;t=t||1;do{s=(r=2*he.RANDOM()-1)*r+(i=2*he.RANDOM()-1)*i}while(s>=1);do{a=(n=2*he.RANDOM()-1)*n+(o=2*he.RANDOM()-1)*o}while(a>=1);var l=Math.sqrt((1-s)/a);return e[0]=t*r,e[1]=t*i,e[2]=t*n*l,e[3]=t*o*l,e},ce.transformMat4=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*s,e},ce.transformQuat=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],l=r[2],c=r[3],u=c*i+a*o-l*n,h=c*n+l*i-s*o,d=c*o+s*n-a*i,p=-s*i-a*n-l*o;return e[0]=u*c+p*-s+h*-l-d*-a,e[1]=h*c+p*-a+d*-s-u*-l,e[2]=d*c+p*-l+u*-a-h*-s,e[3]=t[3],e},ce.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},ce.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},ce.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ce.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=he.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=he.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-l)<=he.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=he.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},ce.forEach=ce.sqrLen=ce.len=ce.sqrDist=ce.dist=ce.div=ce.mul=ce.sub=void 0;var he=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ue(e)&&"function"!=typeof e)return{default:e};var r=de(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function de(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(de=function(e){return e?r:t})(e)}function pe(){var e=new he.ARRAY_TYPE(4);return he.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function fe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function me(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function ge(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Ae(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function _e(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return r*r+i*i+n*n+o*o}function ye(e){return Math.hypot(e[0],e[1],e[2],e[3])}function xe(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}ce.sub=fe,ce.mul=me,ce.div=ge,ce.dist=Ae,ce.sqrDist=_e,ce.len=ye,ce.sqrLen=xe;var ve=function(){var e=pe();return function(t,r,i,n,o,s){var a,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,a=i;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();function be(e){return be="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},be(e)}ce.forEach=ve,Object.defineProperty(Q,"__esModule",{value:!0}),Q.create=Ie,Q.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},Q.setAxisAngle=Pe,Q.getAxisAngle=function(e,t){var r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>we.EPSILON?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r},Q.getAngle=function(e,t){var r=Re(e,t);return Math.acos(2*r*r-1)},Q.multiply=De,Q.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*a,e[1]=n*l+o*a,e[2]=o*l-n*a,e[3]=s*l-i*a,e},Q.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*a,e[1]=n*l+s*a,e[2]=o*l+i*a,e[3]=s*l-n*a,e},Q.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*a,e[1]=n*l-i*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},Q.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},Q.exp=ke,Q.ln=Le,Q.pow=function(e,t,r){return Le(e,t),Be(e,e,r),ke(e,e),e},Q.slerp=Oe,Q.random=function(e){var t=we.RANDOM(),r=we.RANDOM(),i=we.RANDOM(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},Q.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-n*a,e[3]=o*a,e},Q.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},Q.fromMat3=ze,Q.fromEuler=function(e,t,r,i){var n=.5*Math.PI/180;t*=n,r*=n,i*=n;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=o*l*u-s*a*c,e[1]=s*a*u+o*l*c,e[2]=s*l*c-o*a*u,e[3]=s*l*u+o*a*c,e},Q.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},Q.setAxes=Q.sqlerp=Q.rotationTo=Q.equals=Q.exactEquals=Q.normalize=Q.sqrLen=Q.squaredLength=Q.len=Q.length=Q.lerp=Q.dot=Q.scale=Q.mul=Q.add=Q.set=Q.copy=Q.fromValues=Q.clone=void 0;var we=Se(p),Ce=Se(P),Te=Se(q),Ee=Se(ce);function Me(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Me=function(e){return e?r:t})(e)}function Se(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==be(e)&&"function"!=typeof e)return{default:e};var r=Me(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function Ie(){var e=new we.ARRAY_TYPE(4);return we.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Pe(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function De(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+s*a+n*c-o*l,e[1]=n*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-n*a,e[3]=s*u-i*a-n*l-o*c,e}function ke(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=Math.exp(o),l=s>0?a*Math.sin(s)/s:0;return e[0]=r*l,e[1]=i*l,e[2]=n*l,e[3]=a*Math.cos(s),e}function Le(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=s>0?Math.atan2(s,o)/s:0;return e[0]=r*a,e[1]=i*a,e[2]=n*a,e[3]=.5*Math.log(r*r+i*i+n*n+o*o),e}function Oe(e,t,r,i){var n,o,s,a,l,c=t[0],u=t[1],h=t[2],d=t[3],p=r[0],f=r[1],m=r[2],g=r[3];return(o=c*p+u*f+h*m+d*g)<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>we.EPSILON?(n=Math.acos(o),s=Math.sin(n),a=Math.sin((1-i)*n)/s,l=Math.sin(i*n)/s):(a=1-i,l=i),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*h+l*m,e[3]=a*d+l*g,e}function ze(e,t){var r,i=t[0]+t[4]+t[8];if(i>0)r=Math.sqrt(i+1),e[3]=.5*r,e[0]=(t[5]-t[7])*(r=.5/r),e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var o=(n+1)%3,s=(n+2)%3;r=Math.sqrt(t[3*n+n]-t[3*o+o]-t[3*s+s]+1),e[n]=.5*r,e[3]=(t[3*o+s]-t[3*s+o])*(r=.5/r),e[o]=(t[3*o+n]+t[3*n+o])*r,e[s]=(t[3*s+n]+t[3*n+s])*r}return e}Q.clone=Ee.clone,Q.fromValues=Ee.fromValues,Q.copy=Ee.copy,Q.set=Ee.set,Q.add=Ee.add,Q.mul=De;var Be=Ee.scale;Q.scale=Be;var Re=Ee.dot;Q.dot=Re,Q.lerp=Ee.lerp;var Fe=Ee.length;Q.length=Fe,Q.len=Fe;var je=Ee.squaredLength;Q.squaredLength=je,Q.sqrLen=je;var Ve=Ee.normalize;Q.normalize=Ve,Q.exactEquals=Ee.exactEquals,Q.equals=Ee.equals;var Ne,Ue,He,Ge=(Ne=Te.create(),Ue=Te.fromValues(1,0,0),He=Te.fromValues(0,1,0),function(e,t,r){var i=Te.dot(t,r);return i<-.999999?(Te.cross(Ne,Ue,t),Te.len(Ne)<1e-6&&Te.cross(Ne,He,t),Te.normalize(Ne,Ne),Pe(e,Ne,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Te.cross(Ne,t,r),e[0]=Ne[0],e[1]=Ne[1],e[2]=Ne[2],e[3]=1+i,Ve(e,e))});Q.rotationTo=Ge;var Ze,We,Qe=(Ze=Ie(),We=Ie(),function(e,t,r,i,n,o){return Oe(Ze,t,n,o),Oe(We,r,i,o),Oe(e,Ze,We,2*o*(1-o)),e});Q.sqlerp=Qe;var qe,Xe=(qe=Ce.create(),function(e,t,r,i){return qe[0]=r[0],qe[3]=r[1],qe[6]=r[2],qe[1]=i[0],qe[4]=i[1],qe[7]=i[2],qe[2]=-t[0],qe[5]=-t[1],qe[8]=-t[2],Ve(e,ze(e,qe))});Q.setAxes=Xe;var Ye={};function $e(e){return $e="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(e)}Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.create=function(){var e=new Ke.ARRAY_TYPE(8);return Ke.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},Ye.clone=function(e){var t=new Ke.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t},Ye.fromValues=function(e,t,r,i,n,o,s,a){var l=new Ke.ARRAY_TYPE(8);return l[0]=e,l[1]=t,l[2]=r,l[3]=i,l[4]=n,l[5]=o,l[6]=s,l[7]=a,l},Ye.fromRotationTranslationValues=function(e,t,r,i,n,o,s){var a=new Ke.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=r,a[3]=i;var l=.5*n,c=.5*o,u=.5*s;return a[4]=l*i+c*r-u*t,a[5]=c*i+u*e-l*r,a[6]=u*i+l*t-c*e,a[7]=-l*e-c*t-u*r,a},Ye.fromRotationTranslation=it,Ye.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},Ye.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.fromMat4=function(e,t){var r=Je.create();et.getRotation(r,t);var i=new Ke.ARRAY_TYPE(3);return et.getTranslation(i,t),it(e,r,i),e},Ye.copy=nt,Ye.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.set=function(e,t,r,i,n,o,s,a,l){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e},Ye.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},Ye.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},Ye.getTranslation=function(e,t){var r=t[4],i=t[5],n=t[6],o=t[7],s=-t[0],a=-t[1],l=-t[2],c=t[3];return e[0]=2*(r*c+o*s+i*l-n*a),e[1]=2*(i*c+o*a+n*s-r*l),e[2]=2*(n*c+o*l+r*a-i*s),e},Ye.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=.5*r[0],l=.5*r[1],c=.5*r[2],u=t[4],h=t[5],d=t[6],p=t[7];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=s*a+n*c-o*l+u,e[5]=s*l+o*a-i*c+h,e[6]=s*c+i*l-n*a+d,e[7]=-i*a-n*l-o*c+p,e},Ye.rotateX=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateX(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateY=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateY(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateZ=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateZ(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateByQuatAppend=function(e,t,r){var i=r[0],n=r[1],o=r[2],s=r[3],a=t[0],l=t[1],c=t[2],u=t[3];return e[0]=a*s+u*i+l*o-c*n,e[1]=l*s+u*n+c*i-a*o,e[2]=c*s+u*o+a*n-l*i,e[3]=u*s-a*i-l*n-c*o,e[4]=(a=t[4])*s+(u=t[7])*i+(l=t[5])*o-(c=t[6])*n,e[5]=l*s+u*n+c*i-a*o,e[6]=c*s+u*o+a*n-l*i,e[7]=u*s-a*i-l*n-c*o,e},Ye.rotateByQuatPrepend=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+s*a+n*c-o*l,e[1]=n*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-n*a,e[3]=s*u-i*a-n*l-o*c,e[4]=i*(u=r[7])+s*(a=r[4])+n*(c=r[6])-o*(l=r[5]),e[5]=n*u+s*l+o*a-i*c,e[6]=o*u+s*c+i*l-n*a,e[7]=s*u-i*a-n*l-o*c,e},Ye.rotateAroundAxis=function(e,t,r,i){if(Math.abs(i)<Ke.EPSILON)return nt(e,t);var n=Math.hypot(r[0],r[1],r[2]);i*=.5;var o=Math.sin(i),s=o*r[0]/n,a=o*r[1]/n,l=o*r[2]/n,c=Math.cos(i),u=t[0],h=t[1],d=t[2],p=t[3];e[0]=u*c+p*s+h*l-d*a,e[1]=h*c+p*a+d*s-u*l,e[2]=d*c+p*l+u*a-h*s,e[3]=p*c-u*s-h*a-d*l;var f=t[4],m=t[5],g=t[6],A=t[7];return e[4]=f*c+A*s+m*l-g*a,e[5]=m*c+A*a+g*s-f*l,e[6]=g*c+A*l+f*a-m*s,e[7]=A*c-f*s-m*a-g*l,e},Ye.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e},Ye.multiply=ot,Ye.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e},Ye.lerp=function(e,t,r,i){var n=1-i;return st(t,r)<0&&(i=-i),e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i,e[3]=t[3]*n+r[3]*i,e[4]=t[4]*n+r[4]*i,e[5]=t[5]*n+r[5]*i,e[6]=t[6]*n+r[6]*i,e[7]=t[7]*n+r[7]*i,e},Ye.invert=function(e,t){var r=lt(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e},Ye.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e},Ye.normalize=function(e,t){var r=lt(t);if(r>0){r=Math.sqrt(r);var i=t[0]/r,n=t[1]/r,o=t[2]/r,s=t[3]/r,a=t[4],l=t[5],c=t[6],u=t[7],h=i*a+n*l+o*c+s*u;e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=(a-i*h)/r,e[5]=(l-n*h)/r,e[6]=(c-o*h)/r,e[7]=(u-s*h)/r}return e},Ye.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},Ye.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},Ye.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=t[0],h=t[1],d=t[2],p=t[3],f=t[4],m=t[5],g=t[6],A=t[7];return Math.abs(r-u)<=Ke.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-h)<=Ke.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(n-d)<=Ke.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-p)<=Ke.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-f)<=Ke.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-m)<=Ke.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-g)<=Ke.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-A)<=Ke.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))},Ye.sqrLen=Ye.squaredLength=Ye.len=Ye.length=Ye.dot=Ye.mul=Ye.setReal=Ye.getReal=void 0;var Ke=rt(p),Je=rt(Q),et=rt(B);function tt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(tt=function(e){return e?r:t})(e)}function rt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==$e(e)&&"function"!=typeof e)return{default:e};var r=tt(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function it(e,t,r){var i=.5*r[0],n=.5*r[1],o=.5*r[2],s=t[0],a=t[1],l=t[2],c=t[3];return e[0]=s,e[1]=a,e[2]=l,e[3]=c,e[4]=i*c+n*l-o*a,e[5]=n*c+o*s-i*l,e[6]=o*c+i*a-n*s,e[7]=-i*s-n*a-o*l,e}function nt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function ot(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[4],l=r[5],c=r[6],u=r[7],h=t[4],d=t[5],p=t[6],f=t[7],m=r[0],g=r[1],A=r[2],_=r[3];return e[0]=i*_+s*m+n*A-o*g,e[1]=n*_+s*g+o*m-i*A,e[2]=o*_+s*A+i*g-n*m,e[3]=s*_-i*m-n*g-o*A,e[4]=i*u+s*a+n*c-o*l+h*_+f*m+d*A-p*g,e[5]=n*u+s*l+o*a-i*c+d*_+f*g+p*m-h*A,e[6]=o*u+s*c+i*l-n*a+p*_+f*A+h*g-d*m,e[7]=s*u-i*a-n*l-o*c+f*_-h*m-d*g-p*A,e}Ye.getReal=Je.copy,Ye.setReal=Je.copy,Ye.mul=ot;var st=Je.dot;Ye.dot=st;var at=Je.length;Ye.length=at,Ye.len=at;var lt=Je.squaredLength;Ye.squaredLength=lt,Ye.sqrLen=lt;var ct={};function ut(e){return ut="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},ut(e)}Object.defineProperty(ct,"__esModule",{value:!0}),ct.create=pt,ct.clone=function(e){var t=new ht.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t},ct.fromValues=function(e,t){var r=new ht.ARRAY_TYPE(2);return r[0]=e,r[1]=t,r},ct.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ct.set=function(e,t,r){return e[0]=t,e[1]=r,e},ct.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},ct.subtract=ft,ct.multiply=mt,ct.divide=gt,ct.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},ct.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},ct.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},ct.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},ct.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},ct.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},ct.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e},ct.distance=At,ct.squaredDistance=_t,ct.length=yt,ct.squaredLength=xt,ct.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ct.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ct.normalize=function(e,t){var r=t[0],i=t[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e},ct.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ct.cross=function(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e},ct.lerp=function(e,t,r,i){var n=t[0],o=t[1];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e},ct.random=function(e,t){t=t||1;var r=2*ht.RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},ct.transformMat2=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e},ct.transformMat2d=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e},ct.transformMat3=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e},ct.transformMat4=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},ct.rotate=function(e,t,r,i){var n=t[0]-r[0],o=t[1]-r[1],s=Math.sin(i),a=Math.cos(i);return e[0]=n*a-o*s+r[0],e[1]=n*s+o*a+r[1],e},ct.angle=function(e,t){var r=e[0],i=e[1],n=t[0],o=t[1],s=Math.sqrt(r*r+i*i)*Math.sqrt(n*n+o*o);return Math.acos(Math.min(Math.max(s&&(r*n+i*o)/s,-1),1))},ct.zero=function(e){return e[0]=0,e[1]=0,e},ct.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},ct.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct.equals=function(e,t){var r=e[0],i=e[1],n=t[0],o=t[1];return Math.abs(r-n)<=ht.EPSILON*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-o)<=ht.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},ct.forEach=ct.sqrLen=ct.sqrDist=ct.dist=ct.div=ct.mul=ct.sub=ct.len=void 0;var ht=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ut(e)&&"function"!=typeof e)return{default:e};var r=dt(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(dt=function(e){return e?r:t})(e)}function pt(){var e=new ht.ARRAY_TYPE(2);return ht.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function ft(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function gt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function At(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function _t(e,t){var r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function yt(e){return Math.hypot(e[0],e[1])}function xt(e){var t=e[0],r=e[1];return t*t+r*r}ct.len=yt,ct.sub=ft,ct.mul=mt,ct.div=gt,ct.dist=At,ct.sqrDist=_t,ct.sqrLen=xt;var vt=function(){var e=pt();return function(t,r,i,n,o,s){var a,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,a=i;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}();function bt(e){return bt="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},bt(e)}ct.forEach=vt,Object.defineProperty(d,"__esModule",{value:!0}),e.aa=d.vec4=e.Q=d.vec3=d.vec2=d.quat2=e.bl=d.quat=e.a9=d.mat4=e.ct=d.mat3=d.mat2d=e.b7=d.mat2=d.glMatrix=void 0;var wt=Ot(p);d.glMatrix=wt;var Ct=Ot(_);e.b7=d.mat2=Ct;var Tt=Ot(C);d.mat2d=Tt;var Et=Ot(P);e.ct=d.mat3=Et;var Mt=Ot(B);e.a9=d.mat4=Mt;var St=Ot(Q);e.bl=d.quat=St;var It=Ot(Ye);d.quat2=It;var Pt=Ot(ct);d.vec2=Pt;var Dt=Ot(q);e.Q=d.vec3=Dt;var kt=Ot(ce);function Lt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Lt=function(e){return e?r:t})(e)}function Ot(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==bt(e)&&"function"!=typeof e)return{default:e};var r=Lt(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}e.aa=d.vec4=kt;var zt=Bt;function Bt(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}Bt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=n/o}var s=0,a=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:a=r,r=.5*(a-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Rt=h(zt),Ft=jt;function jt(e,t){this.x=e,this.y=t}jt.prototype={clone:function(){return new jt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),i=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-i*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jt.convert=function(e){return e instanceof jt?e:Array.isArray(e)?new jt(e[0],e[1]):e};var Vt=h(Ft);const Nt=Math.PI/180,Ut=180/Math.PI;function Ht(e){return e*Nt}function Gt(e){return e*Ut}const Zt=[[0,0],[1,0],[1,1],[0,1]];function Wt(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Qt(e,t,r,i){const n=new Rt(e,t,r,i);return function(e){return n.solve(e)}}const qt=Qt(.25,.1,.25,1);function Xt(e,t,r){return Math.min(r,Math.max(t,e))}function Yt(e,t,r){return(r=Xt((r-e)/(t-e),0,1))*r*(3-2*r)}function $t(e,t,r){const i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function Kt(e,t,r){if(!e.length)return r(null,[]);let i=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),n[s]=t,0==--i&&r(o,n)}))}))}function Jt(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let er=1;function tr(){return er++}function rr(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function ir(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function nr(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 or(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function sr(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ar(e,t,r){const i={};for(const r in e)i[r]=t.call(this,e[r],r,e);return i}function lr(e,t,r){const i={};for(const r in e)t.call(this,e[r],r,e)&&(i[r]=e[r]);return i}function cr(e){return Array.isArray(e)?e.map(cr):"object"==typeof e&&e?ar(e,cr):e}const ur={};function hr(e){ur[e]||("undefined"!=typeof console&&console.warn(e),ur[e]=!0)}function dr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function pr(e){let t=0;for(let r,i,n=0,o=e.length,s=o-1;n<o;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function fr([e,t,r]){const i=Ht(t+90),n=Ht(r);return{x:e*Math.cos(i)*Math.sin(n),y:e*Math.sin(i)*Math.sin(n),z:e*Math.cos(n),azimuthal:t,polar:r}}function mr(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function gr(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,i,n)=>{const o=i||n;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Ar,_r,yr,xr,vr,br,wr=null;function Cr(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Tr(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Er(e,t,r,i){for(;t<r;){const n=t+r>>1;e[n]<i?t=n+1:r=n}return t}function Mr(e,t,r,i){for(;t<r;){const n=t+r>>1;e[n]<=i?t=n+1:r=n}return t}function Sr(e){return e>0?1/(1.001-e):1+e}function Ir(e){return e>0?1-1/(1.001-e):-e}function Pr(){return null==Ar&&(Ar=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Ar}const Dr={now:()=>void 0!==xr?xr:performance.now(),setNow(e){xr=e},restoreNow(){xr=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:i}=e;vr||(vr=document.createElement("canvas"));const n=vr.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return(r>vr.width||i>vr.height)&&(vr.width=r,vr.height=i),n.clearRect(-t,-t,r+2*t,i+2*t),n.drawImage(e,0,0,r,i),n.getImageData(-t,-t,r+2*t,i+2*t)},resolveURL:e=>(_r||(_r=document.createElement("a")),_r.href=e,_r.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==yr&&(yr=window.matchMedia("(prefers-reduced-motion: reduce)")),yr.matches)},hasCanvasFingerprintNoise(){if(void 0!==br)return br;if(!Pr())return br=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let i=0;i<e.width;++i)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(i,0,1,1);const i=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<i.data.length;++e)if(e%4!=3&&r++!==i.data[e])return br=!0,!0;return br=!1,!1}};function kr(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const i=new URLSearchParams(e.slice(r));for(const e in t)i.set(e,t[e]);return`${e.slice(0,r)}?${i.toString()}`}function Lr(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const i=new URLSearchParams,n=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=n.get(e);t&&i.set(e,t)}const o=i.toString();return`${e.slice(0,r)}${o.length>0?`?${o}`:""}`}const Or="mapbox-tiles";let zr,Br,Rr=500,Fr=50;function jr(){try{return caches}catch(e){}}function Vr(){const e=jr();e&&!zr&&(zr=e.open(Or))}let Nr=1/0;const Ur={supported:!1,testSupport:function(e){!Zr&&Gr&&(Wr?qr(e):Hr=e)}};let Hr,Gr,Zr=!1,Wr=!1;const Qr="undefined"!=typeof self?self:{};function qr(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Gr),e.isContextLost())return;Ur.supported=!0}catch(e){}e.deleteTexture(t),Zr=!0}Qr.document&&(Gr=Qr.document.createElement("img"),Gr.onload=function(){Hr&&qr(Hr),Hr=null,Wr=!0},Gr.onerror=function(){Zr=!0,Hr=null},Gr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Xr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Xr);class Yr extends Error{constructor(e,t,r){401===t&&n(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const $r=mr()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Kr=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test($r())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:$r(),referrerPolicy:e.referrerPolicy,signal:r.signal});let o=!1,s=!1;const a=(l=i.url).indexOf("sku=")>0&&n(l);var l;"json"===e.type&&i.headers.set("Accept","application/json");const c=(r,n,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&hr(r.toString()),n&&o)return u(n);const l=Date.now();fetch(i).then((r=>{if(r.ok){const e=a?r.clone():null;return u(r,e,l)}return t(new Yr(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},u=(r,n,a)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{s||(n&&a&&function(e,t,r){if(Vr(),!zr)return;const i=gr(t.headers.get("Cache-Control")||"");if(i["no-store"])return;const n={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>n.headers.set(t,e))),i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString());const o=n.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-r<42e4)return;let s=Lr(e.url,{persistentParams:["language","worldview"]});if(206===t.status){const t=e.headers.get("Range");if(!t)return;n.status=200,s=kr(s,{range:t})}!function(e,t){if(void 0===Br)try{new Response(new ReadableStream),Br=!0}catch(e){Br=!1}Br?t(e.body):e.blob().then(t)}(t,(e=>{const t=new Response(e,n);Vr(),zr&&zr.then((e=>e.put(s,t))).catch((e=>hr(e.message)))}))}(i,n,a),o=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{s||t(new Error(e.message))}))};return a?function(e,t){if(Vr(),!zr)return t(null);zr.then((r=>{let i=Lr(e.url,{persistentParams:["language","worldview"]});const n=e.headers.get("Range");n&&(i=kr(i,{range:n})),r.match(i).then((e=>{const n=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=gr(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(e);r.delete(i),n&&r.put(i,e.clone()),t(null,e,n)})).catch(t)})).catch(t)}(i,c):c(null,null),{cancel:()=>{s=!0,o||r.abort()}}}(e,t);if(mr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Yr(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},Jr=function(e,t){return Kr(Jt(e,{type:"arrayBuffer"}),t)};function ei(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const ti="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ri,ii;ri=[],ii=0;const ni=function(e,t){if(Ur.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ii>=i.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return ri.push(r),r}ii++;let r=!1;const n=()=>{if(!r)for(r=!0,ii--;ri.length&&ii<i.MAX_PARALLEL_IMAGE_REQUESTS;){const e=ri.shift(),{requestParameters:t,callback:r,cancelled:i}=e;i||(e.cancel=ni(t,r).cancel)}},o=Jr(e,((e,r,i,o)=>{n(),e?t(e):r&&(self.createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,r)=>t(e,r,i,o))):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=ti}))},r.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(i):ti}(r,((e,r)=>t(e,r,i,o))))}));return{cancel:()=>{o.cancel(),n()}}},oi="01",si="NO_ACCESS_TOKEN",ai=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function li(e){const t=e.match(ai);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function ci(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const ui="mapbox.eventData";function hi(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class di{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=hi(i.ACCESS_TOKEN);let r="";return r=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):i.ACCESS_TOKEN||"",e?`${ui}.${e}:${r}`:`${ui}:${r}`}fetchEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const i=localStorage.getItem(r);i&&(this.anonId=i)}catch(e){hr("Unable to read from LocalStorage")}}saveEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid"),i=this.anonId;if(e&&i)try{localStorage.setItem(r,i),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){hr("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,r,n){if(!i.EVENTS_URL)return;const o=li(i.EVENTS_URL);o.params.push(`access_token=${n||i.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(e).toISOString()},a=t?Jt(s,t):s,l={url:ci(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const pi=new class extends di{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){i.EVENTS_URL&&i.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>o(e)||n(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=hi(i.ACCESS_TOKEN),n=r?r.u:i.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;nr(this.anonId)||(this.anonId=rr(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),r=(s-this.eventData.lastSuccess)/864e5;o=o||r>=1||r<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:oi,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)}),e):this.processRequests()}},fi=pi.postTurnstileEvent.bind(pi),mi=new class extends di{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,r,n){this.skuToken=t,this.errorCb=n,i.EVENTS_URL&&(r||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(si)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:i}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),nr(this.anonId)||(this.anonId=rr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:oi,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):r&&(this.success[r]=!0)}),e))}remove(){this.errorCb=null}},gi=mi.postMapLoadEvent.bind(mi),Ai=new class extends di{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=rr(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:r,style:n,importedStyles:o}=t;if(!i.EVENTS_URL||!e&&!i.ACCESS_TOKEN)return;const s=this.getMapInstanceId(r),a={mapInstanceId:s,eventId:this.getEventId(s),style:n};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}},_i=Ai.postStyleLoadEvent.bind(Ai),yi=new class extends di{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){i.EVENTS_URL&&(e||i.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:i}=this.queue.shift(),n=function(e){const r=performance.getEntriesByType("resource"),i=performance.getEntriesByType("mark"),n=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const i of e[r]){const e=`${r}ResolveRangeMin`,n=`${r}ResolveRangeMax`,o=`${r}RequestCount`,s=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,i.startTime),t[n]=Math.max(t[n]||-1/0,i.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==i.transferSize&&0===i.transferSize&&a(s),a(o)}return t}(function(e,t){const r={};if(e)for(const i of e){const e=t(i);void 0===r[e]&&(r[e]=[]),r[e].push(i)}return r}(r,u)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in n)d(h.counters,e,n[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",e.interactionRange[0]),d(h.counters,"interactionRangeMax",e.interactionRange[1])),i)for(const e of Object.keys(c)){const t=c[e],r=i.find((e=>e.name===t));r&&d(h.counters,t,r.startTime)}return d(h.counters,"visibilityHidden",e.visibilityHidden),d(h.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(l(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(r)),d(h.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",e.fogEnabled?"true":"false"),d(h.attributes,"projection",e.projection),d(h.attributes,"zoom",e.zoom),d(h.metadata,"devicePixelRatio",o),d(h.metadata,"connectionEffectiveType",a),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",e.width/o),d(h.metadata,"mapHeight",e.height/o),d(h.metadata,"webglRenderer",e.renderer),d(h.metadata,"webglVendor",e.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(i);for(const e of n.metadata);for(const e of n.counters);for(const e of n.attributes);this.postEvent(r,n,(()=>{}),e)}},xi=yi.postPerformanceEvent.bind(yi),vi=new class extends di{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,r,n){if(!i.API_URL||!i.SESSION_PATH)return;const o=li(i.API_URL+i.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${n||i.ACCESS_TOKEN||""}`);const s={url:ci(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"GET"}),t)}(s,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(e,t,r,n){this.skuToken=t,this.errorCb=n,i.SESSION_PATH&&i.API_URL&&(r||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(si)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},bi=vi.getSessionAPI.bind(vi),wi=new Set;var Ci={exports:{}},Ti={exports:{}};Ti.exports=function(e,t){var r,i,n,o,s,a,l,c;for(i=e.length-(r=3&e.length),n=t,s=3432918353,a=461845907,c=0;c<i;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};var Ei=Ti.exports,Mi={exports:{}};Mi.exports=function(e,t){for(var r,i=e.length,n=t^i,o=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var Si=Ei,Ii=Mi.exports;Ci.exports=Si,Ci.exports.murmur3=Si,Ci.exports.murmur2=Ii;var Pi=h(Ci.exports);function Di(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function ki(e,t,r){if(r&&r[e]){const i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}class Li{constructor(e,t={}){Jt(this,t),this.type=e}}class Oi extends Li{constructor(e,t={}){super("error",Jt({error:e},t))}}class zi{on(e,t){return this._listeners=this._listeners||{},Di(e,t,this._listeners),this}off(e,t){return ki(e,t,this._listeners),ki(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Di(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new Li(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of i)ki(r,t,this._oneTimeListeners),t.call(this,e);const n=this._eventedParent;n&&(Jt(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof Oi&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}e.z=void 0;var Bi={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ri(e){return(e=Math.round(e))<0?0:e>255?255:e}function Fi(e){return Ri("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function ji(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Vi(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{e.z={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Bi)return Bi[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.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===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var o=r.substr(0,i),s=r.substr(i+1,n-(i+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=ji(s.pop());case"rgb":return 3!==s.length?null:[Fi(s[0]),Fi(s[1]),Fi(s[2]),a];case"hsla":if(4!==s.length)return null;a=ji(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=ji(s[1]),u=ji(s[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[Ri(255*Vi(d,h,l+1/3)),Ri(255*Vi(d,h,l)),Ri(255*Vi(d,h,l-1/3)),a];default:return null}}return null}}catch(e){}class Ni{constructor(e,t,r,i=1){this.r=e,this.g=t,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof Ni)return t;if("string"!=typeof t)return;const r=e.z(t);return r?new Ni(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,t,r,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${i})`}toArray(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*r/i,i]}toArray01(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[e/i,t/i,r/i,i]}toArray01Scaled(e){const{r:t,g:r,b:i,a:n}=this;return 0===n?[0,0,0]:[t/n*e,r/n*e,i/n*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:i}=this;return[e,t,r,i]}toArray01Linear(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[Math.pow(e/i,2.2),Math.pow(t/i,2.2),Math.pow(r/i,2.2),i]}}function Ui(e,t,r){return e*(1-r)+t*r}function Hi(e,t,r){return e.map(((e,i)=>Ui(e,t[i],r)))}Ni.black=new Ni(0,0,0,1),Ni.white=new Ni(1,1,1,1),Ni.transparent=new Ni(0,0,0,0),Ni.red=new Ni(1,0,0,1),Ni.blue=new Ni(0,0,1,1);var Gi=Object.freeze({__proto__:null,array:Hi,color:function(e,t,r){return new Ni(Ui(e.r,t.r,r),Ui(e.g,t.g,r),Ui(e.b,t.b,r),Ui(e.a,t.a,r))},number:Ui});function Zi(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class Wi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Qi{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new Qi(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const qi={kind:"null"},Xi={kind:"number"},Yi={kind:"string"},$i={kind:"boolean"},Ki={kind:"color"},Ji={kind:"object"},en={kind:"value"},tn={kind:"collator"},rn={kind:"formatted"},nn={kind:"resolvedImage"};function on(e,t){return{kind:"array",itemType:e,N:t}}function sn(e){if("array"===e.kind){const t=sn(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const an=[qi,Xi,Yi,$i,Ki,rn,Ji,on(en),nn];function ln(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ln(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(const e of an)if(!ln(e,t))return null}return`Expected ${sn(e)} but found ${sn(t)} instead.`}function cn(e,t){return t.some((t=>t.kind===e.kind))}function un(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class hn{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class dn{constructor(e,t,r,i,n){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}}class pn{constructor(e){this.sections=e}static fromString(e){return new pn([new dn(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof pn?e:pn.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class fn{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new fn({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function mn(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function gn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Ni)return!0;if(e instanceof hn)return!0;if(e instanceof pn)return!0;if(e instanceof fn)return!0;if(Array.isArray(e)){for(const t of e)if(!gn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!gn(e[t]))return!1;return!0}return!1}function An(e){if(null===e)return qi;if("string"==typeof e)return Yi;if("boolean"==typeof e)return $i;if("number"==typeof e)return Xi;if(e instanceof Ni)return Ki;if(e instanceof hn)return tn;if(e instanceof pn)return rn;if(e instanceof fn)return nn;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=An(t);if(r){if(r===e)continue;r=en;break}r=e}return on(r||en,t)}return Ji}function _n(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ni||e instanceof pn||e instanceof fn?e.toString():JSON.stringify(e)}class yn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!gn(e[1]))return t.error("invalid value");const r=e[1];let i=An(r);const n=t.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new yn(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Ni?["rgba"].concat(this.value.toArray()):this.value instanceof pn?this.value.serialize():this.value}}class xn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const vn={string:Yi,number:Xi,boolean:$i,object:Ji};class bn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,i=1;const n=e[0];if("array"===n){let n,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in vn)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=vn[r],i++}else n=en;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);o=e[2],i++}r=on(n,o)}else r=vn[n];const o=[];for(;i<e.length;i++){const r=t.parse(e[i],i,en);if(!r)return null;o.push(r)}return new bn(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!ln(this.type,An(r)))return r;if(t===this.args.length-1)throw new xn(`Expected value to be of type ${sn(this.type)}, but found ${sn(An(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const i=e.N;("number"==typeof i||this.args.length>1)&&t.push(i)}}return t.concat(this.args.map((e=>e.serialize())))}}class wn{constructor(e){this.type=rn,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,Xi),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,on(Yi)),!r))return null;let s=null;if(o["text-color"]&&(s=t.parse(o["text-color"],1,Ki),!s))return null;const a=i[i.length-1];a.scale=e,a.font=r,a.textColor=s}else{const o=t.parse(e[r],1,en);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:o,scale:null,font:null,textColor:null})}}return new wn(i)}evaluate(e){return new pn(this.sections.map((t=>{const r=t.content.evaluate(e);return An(r)===nn?new dn("",r,null,null,null):new dn(_n(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Cn{constructor(e,t){this.type=nn,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const r=t.parse(e[1],1,Yi);if(!r)return t.error("No image name provided.");if(2===e.length)return new Cn(r);const i=t.parse(e[2],1,Yi);return i?new Cn(r,i):t.error("Secondary image variant is not a string.")}evaluate(e){const t=fn.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function Tn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const En={"to-boolean":$i,"to-color":Ki,"to-number":Xi,"to-string":Yi};class Mn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0],i=[];let n=qi;if("to-array"===r){if(!Array.isArray(e[1]))return null;const r=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);n=on(t.expectedType.itemType,r)}else{if(!(r>0&&gn(e[1][0])))return null;n=on(An(e[1][0]),r)}for(let o=0;o<r;o++){const r=e[1][o];let s;if("array"===Tn(r))s=t.parse(r,void 0,n.itemType);else{const e=Tn(r);if(e!==n.itemType.kind)return t.error(`Expected ${n.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===r?null:r],t)}if(!s)return null;i.push(s)}}else{if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");n=En[r];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,en);if(!n)return null;i.push(n)}}return new Mn(n,i)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const i of this.args){if(t=i.evaluate(e),r=null,t instanceof Ni)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:mn(t[0],t[1],t[2],t[3]),!r))return new Ni(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new xn(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const i=Number(t);if(!isNaN(i))return i}throw new xn(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?pn.fromString(_n(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?fn.fromString(_n(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):_n(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Cn(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Sn=["Unknown","Point","LineString","Polygon"];class In{constructor(e,t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Sn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(i*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ni.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Pn{constructor(e,t,r,i,n){this.name=e,this.type=t,this._evaluate=r,this.args=i,this._overloadIndex=n}evaluate(e){if(!this._evaluate){const e=Pn.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],i=Pn.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=[];let a=null,l=-1;for(const[i,c]of o){if(Array.isArray(i)&&i.length!==e.length-1)continue;s.push(i),l++,a=new Go(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const o=[];let u=!1;for(let t=1;t<e.length;t++){const r=e[t],n=Array.isArray(i)?i[t-1]:i.type,s=a.parse(r,1+o.length,n);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(i)&&i.length!==o.length)a.error(`Expected ${i.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(i)?i[e]:i.type,r=o[e];a.concat(e+1).checkSubtype(t,r.type)}if(0===a.errors.length)return new Pn(r,n,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const r=(s.length?s:o.map((([e])=>e))).map(Dn).join(" | "),i=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],1+i.length);if(!n)return null;i.push(sn(n.type))}t.error(`Expected arguments of type ${r}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){Pn.definitions=t;for(const r in t)e[r]=Pn}}function Dn(e){return Array.isArray(e)?`(${e.map(sn).join(", ")})`:`(${sn(e.type)}...)`}class kn{constructor(e,t,r){this.type=tn,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const i=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,$i);if(!i)return null;const n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,$i);if(!n)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,Yi),!o)?null:new kn(i,n,o)}evaluate(e){return new hn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}var Ln={exports:{}};Ln.exports=function(){function e(r,i,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,l=i-n+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(r,i,Math.max(n,Math.floor(i-l*u/a+h)),Math.min(o,Math.floor(i+(a-l)*u/a+h)),s)}var d=r[i],p=n,f=o;for(t(r,n,i),s(r[o],d)>0&&t(r,n,o);p<f;){for(t(r,p,f),p++,f--;s(r[p],d)<0;)p++;for(;s(r[f],d)>0;)f--}0===s(r[n],d)?t(r,n,f):t(r,++f,o),f<=i&&(n=f+1),i<=f&&(o=f-1)}}function t(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function r(e,t){return e<t?-1:e>t?1:0}return function(t,i,n,o,s){e(t,i,n||0,o||t.length-1,s||r)}}();var On=h(Ln.exports);function zn(e){let t=0;for(let r,i,n=0,o=e.length,s=o-1;n<o;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function Bn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Rn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Fn(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[0]-r[0],s=e[1]-r[1];return i*s-o*n==0&&i*o<=0&&n*s<=0}function jn(e,t,r=!1){let i=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],u=l[t];if(Fn(e,a,u))return r;(o=a)[1]>(n=e)[1]!=(s=u)[1]>n[1]&&n[0]<(s[0]-o[0])*(n[1]-o[1])/(s[1]-o[1])+o[0]&&(i=!i)}}var n,o,s;return i}function Vn(e,t,r,i){const n=i[0]-r[0],o=i[1]-r[1],s=(e[0]-r[0])*o-n*(e[1]-r[1]),a=(t[0]-r[0])*o-n*(t[1]-r[1]);return s>0&&a<0||s<0&&a>0}function Nn(e,t,r,i){return 0!=(n=[i[0]-r[0],i[1]-r[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-n[1]*o[0]&&!(!Vn(e,t,r,i)||!Vn(r,i,e,t));var n,o}const Un=8192;function Hn(e,t){const r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*Un),Math.round(i*n*Un)]}function Gn(e,t){for(let r=0;r<t.length;r++)if(jn(e,t[r]))return!0;return!1}function Zn(e,t,r){for(const i of r)for(let r=0,n=i.length,o=n-1;r<n;o=r++)if(Nn(e,t,i[o],i[r]))return!0;return!1}function Wn(e,t){for(let r=0;r<e.length;++r)if(!jn(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(Zn(e[r],e[r+1],t))return!1;return!0}function Qn(e,t){for(let r=0;r<t.length;r++)if(Wn(e,t[r]))return!0;return!1}function qn(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const s=Hn(e[n][i],r);Bn(t,s),o.push(s)}i.push(o)}return i}function Xn(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=qn(e[n],t,r);i.push(o)}return i}function Yn(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){const t=.5*i;let n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}Bn(t,e)}function $n(e,t,r,i){const n=Math.pow(2,i.z)*Un,o=[i.x*Un,i.y*Un],s=[];if(!e)return s;for(const i of e)for(const e of i){const i=[e.x+o[0],e.y+o[1]];Yn(i,t,r,n),s.push(i)}return s}function Kn(e,t,r,i){const n=Math.pow(2,i.z)*Un,o=[i.x*Un,i.y*Un],s=[];if(!e)return s;for(const r of e){const e=[];for(const i of r){const r=[i.x+o[0],i.y+o[1]];Bn(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const i of e)Yn(i,t,r,n)}var a;return s}class Jn{constructor(e,t){this.type=$i,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(gn(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Jn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Jn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Jn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(!n)return!1;if("Polygon"===t.type){const o=qn(t.coordinates,i,n),s=$n(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!jn(e,o))return!1}if("MultiPolygon"===t.type){const o=Xn(t.coordinates,i,n),s=$n(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Gn(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(!n)return!1;if("Polygon"===t.type){const o=qn(t.coordinates,i,n),s=Kn(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Wn(e,o))return!1}if("MultiPolygon"===t.type){const o=Xn(t.coordinates,i,n),s=Kn(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Qn(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var eo={exports:{}};!function(e,t){e.exports=function(){var e={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},t=1/298.257223563,r=t*(2-t),i=Math.PI/180,n=function(t,n){if(void 0===t)throw new Error("No latitude given.");if(n&&!e[n])throw new Error("Unknown unit "+n+". Use one of: "+Object.keys(e).join(", "));var o=6378.137*i*(n?e[n]:1),s=Math.cos(t*i),a=1/(1-r*(1-s*s)),l=Math.sqrt(a);this.kx=o*l*s,this.ky=o*l*a*(1-r)},o={units:{configurable:!0}};function s(e,t){return e[0]===t[0]&&e[1]===t[1]}function a(e,t,r){var i=l(t[0]-e[0]);return[e[0]+i*r,e[1]+(t[1]-e[1])*r]}function l(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}return n.fromTile=function(e,t,r){var o=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),s=Math.atan(.5*(Math.exp(o)-Math.exp(-o)))/i;return new n(s,r)},o.units.get=function(){return e},n.prototype.distance=function(e,t){var r=l(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)},n.prototype.bearing=function(e,t){var r=l(t[0]-e[0])*this.kx;return Math.atan2(r,(t[1]-e[1])*this.ky)/i},n.prototype.destination=function(e,t,r){var n=r*i;return this.offset(e,Math.sin(n)*t,Math.cos(n)*t)},n.prototype.offset=function(e,t,r){return[e[0]+t/this.kx,e[1]+r/this.ky]},n.prototype.lineDistance=function(e){for(var t=0,r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t},n.prototype.area=function(e){for(var t=0,r=0;r<e.length;r++)for(var i=e[r],n=0,o=i.length,s=o-1;n<o;s=n++)t+=l(i[n][0]-i[s][0])*(i[n][1]+i[s][1])*(r?-1:1);return Math.abs(t)/2*this.kx*this.ky},n.prototype.along=function(e,t){var r=0;if(t<=0)return e[0];for(var i=0;i<e.length-1;i++){var n=e[i],o=e[i+1],s=this.distance(n,o);if((r+=s)>t)return a(n,o,(t-(r-s))/s)}return e[e.length-1]},n.prototype.pointToSegmentDistance=function(e,t,r){var i=t[0],n=t[1],o=l(r[0]-i)*this.kx,s=(r[1]-n)*this.ky,a=0;return 0===o&&0===s||((a=(l(e[0]-i)*this.kx*o+(e[1]-n)*this.ky*s)/(o*o+s*s))>1?(i=r[0],n=r[1]):a>0&&(i+=o/this.kx*a,n+=s/this.ky*a)),o=l(e[0]-i)*this.kx,s=(e[1]-n)*this.ky,Math.sqrt(o*o+s*s)},n.prototype.pointOnLine=function(e,t){for(var r,i,n,o,s=1/0,a=0;a<e.length-1;a++){var c=e[a][0],u=e[a][1],h=l(e[a+1][0]-c)*this.kx,d=(e[a+1][1]-u)*this.ky,p=0;0===h&&0===d||((p=(l(t[0]-c)*this.kx*h+(t[1]-u)*this.ky*d)/(h*h+d*d))>1?(c=e[a+1][0],u=e[a+1][1]):p>0&&(c+=h/this.kx*p,u+=d/this.ky*p));var f=(h=l(t[0]-c)*this.kx)*h+(d=(t[1]-u)*this.ky)*d;f<s&&(s=f,r=c,i=u,n=a,o=p)}return{point:[r,i],index:n,t:Math.max(0,Math.min(1,o))}},n.prototype.lineSlice=function(e,t,r){var i=this.pointOnLine(r,e),n=this.pointOnLine(r,t);if(i.index>n.index||i.index===n.index&&i.t>n.t){var o=i;i=n,n=o}var a=[i.point],l=i.index+1,c=n.index;!s(r[l],a[0])&&l<=c&&a.push(r[l]);for(var u=l+1;u<=c;u++)a.push(r[u]);return s(r[c],n.point)||a.push(n.point),a},n.prototype.lineSliceAlong=function(e,t,r){for(var i=0,n=[],o=0;o<r.length-1;o++){var s=r[o],l=r[o+1],c=this.distance(s,l);if((i+=c)>e&&0===n.length&&n.push(a(s,l,(e-(i-c))/c)),i>=t)return n.push(a(s,l,(t-(i-c))/c)),n;i>e&&n.push(l)}return n},n.prototype.bufferPoint=function(e,t){var r=t/this.ky,i=t/this.kx;return[e[0]-i,e[1]-r,e[0]+i,e[1]+r]},n.prototype.bufferBBox=function(e,t){var r=t/this.ky,i=t/this.kx;return[e[0]-i,e[1]-r,e[2]+i,e[3]+r]},n.prototype.insideBBox=function(e,t){return l(e[0]-t[0])>=0&&l(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]},Object.defineProperties(n,o),n}()}(eo);var to=h(eo.exports),ro={exports:{}};!function(e,t){e.exports=function(){var e=function(e,r){if(void 0===e&&(e=[]),void 0===r&&(r=t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,r=this.compare,i=t[e];e>0;){var n=e-1>>1,o=t[n];if(r(i,o)>=0)break;t[e]=o,e=n}t[e]=i},e.prototype._down=function(e){for(var t=this.data,r=this.compare,i=this.length>>1,n=t[e];e<i;){var o=1+(e<<1),s=t[o],a=o+1;if(a<this.length&&r(t[a],s)<0&&(o=a,s=t[a]),r(s,n)>=0)break;t[e]=s,e=o}t[e]=n},e}()}(ro);var io=h(ro.exports),no=8192;function oo(e,t){return t.dist-e.dist}const so=100,ao=50;function lo(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function co(e){return e[1]-e[0]+1}function uo(e,t){const r=e[1]>=e[0]&&e[1]<t;return r||console.warn("Distance Expression: Index is out of range"),r}function ho(e,t){if(e[0]>e[1])return[null,null];const r=co(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===r)return[e,null];const t=Math.floor(r/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function po(e,t){const r=[1/0,1/0,-1/0,-1/0];if(!uo(t,e.length))return r;for(let i=t[0];i<=t[1];++i)Bn(r,e[i]);return r}function fo(e){const t=[1/0,1/0,-1/0,-1/0];for(let r=0;r<e.length;++r)for(let i=0;i<e[r].length;++i)Bn(t,e[r][i]);return t}function mo(e,t,r){if(lo(e)||lo(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function go(e){return 360*e-180}function Ao(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function _o(e,t){const r=Math.pow(2,t.z),i=(e.y/no+t.y)/r;return[go((e.x/no+t.x)/r),Ao(i)]}function yo(e,t){const r=[];for(let i=0;i<e.length;++i)r.push(_o(e[i],t));return r}function xo(e,t,r){const i=r.pointOnLine(t,e).point;return r.distance(e,i)}function vo(e,t,r,i,n){const o=r.slice(i[0],i[1]+1);let s=1/0;for(let r=t[0];r<=t[1];++r)if(0===(s=Math.min(s,xo(e[r],o,n))))return 0;return s}function bo(e,t,r,i,n){const o=Math.min(n.pointToSegmentDistance(e,r,i),n.pointToSegmentDistance(t,r,i)),s=Math.min(n.pointToSegmentDistance(r,e,t),n.pointToSegmentDistance(i,e,t));return Math.min(o,s)}function wo(e,t,r,i,n){if(!uo(t,e.length)||!uo(i,r.length))return NaN;let o=1/0;for(let s=t[0];s<t[1];++s)for(let t=i[0];t<i[1];++t){if(Nn(e[s],e[s+1],r[t],r[t+1]))return 0;o=Math.min(o,bo(e[s],e[s+1],r[t],r[t+1],n))}return o}function Co(e,t,r,i,n){if(!uo(t,e.length)||!uo(i,r.length))return NaN;let o=1/0;for(let s=t[0];s<=t[1];++s)for(let t=i[0];t<=i[1];++t)if(0===(o=Math.min(o,n.distance(e[s],r[t]))))return o;return o}function To(e,t,r){if(jn(e,t,!0))return 0;let i=1/0;for(const n of t){const t=n.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(n[0]!==n[t-1]&&0===(i=Math.min(i,r.pointToSegmentDistance(e,n[t-1],n[0]))))return i;if(0===(i=Math.min(i,xo(e,n,r))))return i}return i}function Eo(e,t,r,i){if(!uo(t,e.length))return NaN;for(let i=t[0];i<=t[1];++i)if(jn(e[i],r,!0))return 0;let n=1/0;for(let o=t[0];o<t[1];++o)for(const t of r)for(let r=0,s=t.length,a=s-1;r<s;a=r++){if(Nn(e[o],e[o+1],t[a],t[r]))return 0;n=Math.min(n,bo(e[o],e[o+1],t[a],t[r],i))}return n}function Mo(e,t){for(const r of e)for(let e=0;e<=r.length-1;++e)if(jn(r[e],t,!0))return!0;return!1}function So(e,t,r,i=1/0){const n=fo(e),o=fo(t);if(i!==1/0&&mo(n,o,r)>=i)return i;if(Rn(n,o)){if(Mo(e,t))return 0}else if(Mo(t,e))return 0;let s=i;for(const i of e)for(let e=0,n=i.length,o=n-1;e<n;o=e++)for(const n of t)for(let t=0,a=n.length,l=a-1;t<a;l=t++){if(Nn(i[o],i[e],n[l],n[t]))return 0;s=Math.min(s,bo(i[o],i[e],n[l],n[t],r))}return s}function Io(e,t,r,i,n,o,s){if(null===o||null===s)return;const a=mo(po(i,o),po(n,s),r);a<t&&e.push({dist:a,range1:o,range2:s})}function Po(e,t,r,i,n=1/0){let o=Math.min(i.distance(e[0],r[0][0]),n);if(0===o)return o;const s=new io([{dist:0,range1:[0,e.length-1],range2:[0,0]}],oo),a=t?ao:so,l=fo(r);for(;s.length;){const n=s.pop();if(n.dist>=o)continue;const c=n.range1;if(co(c)<=a){if(!uo(c,e.length))return NaN;if(t){const t=Eo(e,c,r,i);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const n=To(e[t],r,i);if(0===(o=Math.min(o,n)))return o}}else{const r=ho(c,t);if(null!==r[0]){const t=mo(po(e,r[0]),l,i);t<o&&s.push({dist:t,range1:r[0],range2:[0,0]})}if(null!==r[1]){const t=mo(po(e,r[1]),l,i);t<o&&s.push({dist:t,range1:r[1],range2:[0,0]})}}}return o}function Do(e,t,r,i,n,o=1/0){let s=Math.min(o,n.distance(e[0],r[0]));if(0===s)return s;const a=new io([{dist:0,range1:[0,e.length-1],range2:[0,r.length-1]}],oo),l=t?ao:so,c=i?ao:so;for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1,h=o.range2;if(co(u)<=l&&co(h)<=c){if(!uo(u,e.length)||!uo(h,r.length))return NaN;if(t&&i?s=Math.min(s,wo(e,u,r,h,n)):t||i?t&&!i?s=Math.min(s,vo(r,h,e,u,n)):!t&&i&&(s=Math.min(s,vo(e,u,r,h,n))):s=Math.min(s,Co(e,u,r,h,n)),0===s)return s}else{const o=ho(u,t),l=ho(h,i);Io(a,s,n,e,r,o[0],l[0]),Io(a,s,n,e,r,o[0],l[1]),Io(a,s,n,e,r,o[1],l[0]),Io(a,s,n,e,r,o[1],l[1])}}return s}function ko(e,t,r,i,n=1/0){let o=n;const s=po(e,[0,e.length-1]);for(const n of r)if(!(o!==1/0&&mo(s,po(n,[0,n.length-1]),i)>=o)&&(o=Math.min(o,Do(e,t,n,!0,i,o)),0===o))return o;return o}function Lo(e,t,r,i,n=1/0){let o=n;const s=po(e,[0,e.length-1]);for(const n of r){if(o!==1/0&&mo(s,fo(n),i)>=o)continue;const r=Po(e,t,n,i,o);if(isNaN(r))return r;if(0===(o=Math.min(o,r)))return o}return o}function Oo(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class zo{constructor(e,t){this.type=Xi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(gn(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(Oo(t.features[e].geometry.type))return new zo(t,t.features[e].geometry)}else if("Feature"===t.type){if(Oo(t.geometry.type))return new zo(t,t.geometry)}else if(Oo(t.type))return new zo(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),r=e.canonicalID();if(null!=t&&null!=r){if("Point"===e.geometryType())return function(e,t,r){const i=[];for(const r of e)for(const e of r)i.push(_o(e,t));const n=new to(i[0][1],"meters");return"Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?Do(i,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n):"MultiLineString"===r.type?ko(i,!1,r.coordinates,n):"Polygon"===r.type||"MultiPolygon"===r.type?Lo(i,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,n):null}(t,r,this.geometries);if("LineString"===e.geometryType())return function(e,t,r){const i=[];for(const r of e){const e=[];for(const i of r)e.push(_o(i,t));i.push(e)}const n=new to(i[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return ko("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i,n);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=ko(r.coordinates[t],!0,i,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===r.type||"MultiPolygon"===r.type){let e=1/0;for(let t=0;t<i.length;t++){const o=Lo(i[t],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,r,this.geometries);if("Polygon"===e.geometryType())return function(e,t,r){const i=[];for(const r of function(e,t){const r=e.length;if(r<=1)return[e];const i=[];let n,o;for(let t=0;t<r;t++){const r=zn(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(n&&i.push(n),n=[e[t]]):n.push(e[t]))}return n&&i.push(n),i}(e)){const e=[];for(let i=0;i<r.length;++i)e.push(yo(r[i],t));i.push(e)}const n=new to(i[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Lo("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i,n);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Lo(r.coordinates[t],!0,i,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===r.type||"MultiPolygon"===r.type?function(e,t,r){let i=1/0;for(const n of e)for(const e of t){const t=So(n,e,r,i);if(isNaN(t))return t;if(0===(i=Math.min(i,t)))return i}return i}("Polygon"===r.type?[r.coordinates]:r.coordinates,i,n):null}(t,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Bo(e,t){switch(e){case"string":return _n(t);case"number":return+t;case"boolean":return!!t;case"color":return Ni.parse(t);case"formatted":return pn.fromString(_n(t));case"resolvedImage":return fn.fromString(_n(t))}return t}function Ro(e,t,r,i){return void 0!==i&&(e=i*Math.round(e/i)),void 0!==t&&e<t&&(e=t),void 0!==r&&e>r&&(e=r),e}class Fo{constructor(e,t,r){this.type=e,this.key=t,this.scope=r}static parse(e,t){let r=t.expectedType;if(null==r&&(r=en),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const i=t.parse(e[1],1);if(!(i instanceof yn))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const n=t.parse(e[2],2);return n instanceof yn?new Fo(r,_n(i.value),_n(n.value)):t.error("Scope of 'config' expression must be a string literal.")}return new Fo(r,_n(i.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join(""),r=e.getConfig(t);if(!r)return null;const{type:i,value:n,values:o,minValue:s,maxValue:a,stepValue:l}=r,c=r.default.evaluate(e);let u=c;if(n){const t=e.scope;e.scope=(t||"").split("").slice(1).join(""),u=n.evaluate(e),e.scope=t}return i&&(u=Bo(i,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=Ro(u,s,a,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?Ro(e,s,a,l):e)))),void 0!==n&&void 0!==u&&o&&!o.includes(u)&&(u=c,i&&(u=Bo(i,u))),(i&&i!==this.type||void 0!==u&&An(u)!==this.type)&&(u=Bo(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function jo(e){if(e instanceof Pn){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Jn)return!1;if(e instanceof zo)return!1;let t=!0;return e.eachChild((e=>{t&&!jo(e)&&(t=!1)})),t}function Vo(e){if(e instanceof Pn&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Vo(e)&&(t=!1)})),t}function No(e){if(e instanceof Fo)return!1;let t=!0;return e.eachChild((e=>{t&&!No(e)&&(t=!1)})),t}function Uo(e,t){if(e instanceof Pn&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Uo(e,t)&&(r=!1)})),r}class Ho{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Ho(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Go{constructor(e,t=[],r,i=new Qi,n=[],o,s){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r,this._scope=o,this.options=s}parse(e,t,r,i,n={}){return t||r?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new bn(t,[e]):"coerce"===r?new Mn(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", []].');const i="string"==typeof e[0]?this.registry[e[0]]:void 0;if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof yn)&&"resolvedImage"!==n.type.kind&&Zo(n)){const t=new In(this._scope,this.options);try{n=new yn(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return Mn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const i="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new Go(this.registry,i,t||null,n,this.errors,this._scope,this.options)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new Wi(r,e))}checkSubtype(e,t){const r=ln(e,t);return r&&this.error(r),r}}function Zo(e){if(e instanceof Ho)return Zo(e.boundExpression);if(e instanceof Pn&&"error"===e.name)return!1;if(e instanceof kn)return!1;if(e instanceof Jn)return!1;if(e instanceof zo)return!1;if(e instanceof Fo)return!1;const t=e instanceof Mn||e instanceof bn;let r=!0;return e.eachChild((e=>{r=t?r&&Zo(e):r&&e instanceof yn})),!!r&&jo(e)&&Uo(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Wo(e,t){const r=e.length-1;let i,n,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),i=e[a],n=e[a+1],i<=t){if(a===r||t<n)return a;o=a+1}else{if(!(i>t))throw new xn("Input is not a number.");s=a-1}return 0}class Qo{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){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.");const r=t.parse(e[1],1,Xi);if(!r)return null;const i=[];let n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],s=e[r+1],a=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(i.length&&i[i.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,n);if(!c)return null;n=n||c.type,i.push([o,c])}return new Qo(n,r,i)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[Wo(t,i)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const qo=.95047,Xo=1.08883,Yo=4/29,$o=6/29,Ko=3*$o*$o,Jo=$o*$o*$o,es=Math.PI/180,ts=180/Math.PI;function rs(e){return e>Jo?Math.pow(e,1/3):e/Ko+Yo}function is(e){return e>$o?e*e*e:Ko*(e-Yo)}function ns(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ss(e){const t=os(e.r),r=os(e.g),i=os(e.b),n=rs((.4124564*t+.3575761*r+.1804375*i)/qo),o=rs((.2126729*t+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-rs((.0193339*t+.119192*r+.9503041*i)/Xo)),alpha:e.a}}function as(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*is(t),r=qo*is(r),i=Xo*is(i),new Ni(ns(3.2404542*r-1.5371385*t-.4985314*i),ns(-.969266*r+1.8760108*t+.041556*i),ns(.0556434*r-.2040259*t+1.0572252*i),e.alpha)}function ls(e,t,r){const i=t-e;return e+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const cs={forward:ss,reverse:as,interpolate:function(e,t,r){return{l:Ui(e.l,t.l,r),a:Ui(e.a,t.a,r),b:Ui(e.b,t.b,r),alpha:Ui(e.alpha,t.alpha,r)}}},us={forward:function(e){const{l:t,a:r,b:i}=ss(e),n=Math.atan2(i,r)*ts;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:t,alpha:e.a}},reverse:function(e){const t=e.h*es,r=e.c;return as({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:ls(e.h,t.h,r),c:Ui(e.c,t.c,r),l:Ui(e.l,t.l,r),alpha:Ui(e.alpha,t.alpha,r)}}};var hs=Object.freeze({__proto__:null,hcl:us,lab:cs});class ds{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=ps(t,e.base,r,i);else if("linear"===e.name)n=ps(t,1,r,i);else if("cubic-bezier"===e.name){const o=e.controlPoints;n=new Rt(o[0],o[1],o[2],o[3]).solve(ps(t,1,r,i))}return n}static parse(e,t){let[r,i,n,...o]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}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(n=t.parse(n,2,Xi),!n)return null;const s=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=Ki:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],i=o[e+1],n=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(i,l,a);if(!c)return null;a=a||c.type,s.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ds(a,r,i,n,s):t.error(`Type ${sn(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);const o=Wo(t,i),s=ds.interpolationFactor(this.interpolation,i,t[o],t[o+1]),a=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?Gi[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?us.reverse(us.interpolate(us.forward(a),us.forward(l),s)):cs.reverse(cs.interpolate(cs.forward(a),cs.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function ps(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}class fs{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const i=t.expectedType;i&&"value"!==i.kind&&(r=i);const n=[];for(const i of e.slice(1)){const e=t.parse(i,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,n.push(e)}const o=i&&n.some((e=>ln(i,e.type)));return new fs(o?en:r,n)}evaluate(e){let t,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(e),r&&r instanceof fn&&!r.available&&(t||(t=r),r=null,i===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class ms{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const o=t.parse(e[i+1],i+1);if(!o)return null;r.push([n,o])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new ms(r,i):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}class gs{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Xi),i=t.parse(e[2],2,on(t.expectedType||en));return r&&i?new gs(i.type.itemType,r,i):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new xn(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new xn(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new xn(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class As{constructor(e,t){this.type=$i,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,en);return r&&i?cn(r.type,[$i,Yi,Xi,qi,en])?new As(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!un(t,["boolean","string","number","null"]))throw new xn(`Expected first argument to be of type boolean, string, number or null, but found ${sn(An(t))} instead.`);if(!un(r,["string","array"]))throw new xn(`Expected second argument to be of type array or string, but found ${sn(An(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class _s{constructor(e,t,r){this.type=Xi,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,en);if(!r||!i)return null;if(!cn(r.type,[$i,Yi,Xi,qi,en]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Xi);return n?new _s(r,i,n):null}return new _s(r,i)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!un(t,["boolean","string","number","null"]))throw new xn(`Expected first argument to be of type boolean, string, number or null, but found ${sn(An(t))} instead.`);if(!un(r,["string","array"]))throw new xn(`Expected second argument to be of type array or string, but found ${sn(An(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ys{constructor(e,t,r,i,n,o){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}static parse(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.");let r,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];Array.isArray(a)||(a=[a]);const c=t.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,An(e)))return null}else r=An(e);if(void 0!==n[String(e)])return c.error("Branch labels must be unique.");n[String(e)]=o.length}const u=t.parse(l,s,i);if(!u)return null;i=i||u.type,o.push(u)}const s=t.parse(e[1],1,en);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,i);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new ys(r,i,s,n,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(An(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],i={};for(const e of t){const t=i[this.cases[e]];void 0===t?(i[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const n=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,i]of r)e.push(1===i.length?n(i[0]):i.map(n)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class xs{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i=[];for(let n=1;n<e.length-1;n+=2){const o=t.parse(e[n],n,$i);if(!o)return null;const s=t.parse(e[n+1],n+1,r);if(!s)return null;i.push([o,s]),r=r||s.type}const n=t.parse(e[e.length-1],e.length-1,r);return n?new xs(r,i,n):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class vs{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,Xi);if(!r||!i)return null;if(!cn(r.type,[on(en),Yi,en]))return t.error(`Expected first argument to be of type array or string, but found ${sn(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Xi);return n?new vs(r.type,r,i,n):null}return new vs(r.type,r,i)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!un(t,["string","array"]))throw new xn(`Expected first argument to be of type array or string, but found ${sn(An(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function bs(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ws(e,t,r,i){return 0===i.compare(t,r)}function Cs(e,t,r){const i="=="!==e&&"!="!==e;return class n{constructor(e,t,r){this.type=$i,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,en);if(!o)return null;if(!bs(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${sn(o.type)}'.`);let s=t.parse(e[2],2,en);if(!s)return null;if(!bs(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${sn(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${sn(o.type)}' and '${sn(s.type)}'.`);i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new bn(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new bn(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,tn),!a)return null}return new n(o,s,a)}evaluate(n){const o=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const t=An(o),r=An(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new xn(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const e=An(o),r=An(s);if("string"!==e.kind||"string"!==r.kind)return t(n,o,s)}return this.collator?r(n,o,s,this.collator.evaluate(n)):t(n,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Ts=Cs("==",(function(e,t,r){return t===r}),ws),Es=Cs("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!ws(0,t,r,i)})),Ms=Cs("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),Ss=Cs(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),Is=Cs("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),Ps=Cs(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0}));class Ds{constructor(e,t,r,i,n,o){this.type=Yi,this.number=e,this.locale=t,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Xi);if(!r)return null;const i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=t.parse(i.locale,1,Yi),!n))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,Yi),!o))return null;let s=null;if(i.unit&&(s=t.parse(i.unit,1,Yi),!s))return null;let a=null;if(i["min-fraction-digits"]&&(a=t.parse(i["min-fraction-digits"],1,Xi),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=t.parse(i["max-fraction-digits"],1,Xi),!l)?null:new Ds(r,n,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class ks{constructor(e){this.type=Xi,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${sn(r.type)} instead.`):new ks(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new xn(`Expected value to be of type string or array, but found ${sn(An(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Ls(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const Os={"==":Ts,"!=":Es,">":Ss,"<":Ms,">=":Ps,"<=":Is,array:bn,at:gs,boolean:bn,case:xs,coalesce:fs,collator:kn,format:wn,image:Cn,in:As,"index-of":_s,interpolate:ds,"interpolate-hcl":ds,"interpolate-lab":ds,length:ks,let:ms,literal:yn,match:ys,number:bn,"number-format":Ds,object:bn,slice:vs,step:Qo,string:bn,"to-boolean":Mn,"to-color":Mn,"to-number":Mn,"to-string":Mn,var:Ho,within:Jn,distance:zo,config:Fo};function zs(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,s=mn(t,r,i,o);if(s)throw new xn(s);return new Ni(t/255*o,r/255*o,i/255*o,o)}function Bs(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,s=function(e,t,r,i){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid hsla value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'h' must be between 0 and 360.`}(t,r,i,o);if(s)throw new xn(s);const a=`hsla(${t}, ${r}%, ${i}%, ${o})`,l=Ni.parse(a);if(!l)throw new xn(`Failed to parse HSLA color: ${a}`);return l}function Rs(e,t){return e in t}function Fs(e,t){const r=t[e];return void 0===r?null:r}function js(e){return{type:e}}function Vs(e){return{result:"success",value:e}}function Ns(e){return{result:"error",value:e}}function Us(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Hs(e){return"data-driven"===e["property-type"]}function Gs(e){return Us(e.expression,"measure-light")}function Zs(e){return Us(e.expression,"zoom")}function Ws(e){return!!e.expression&&e.expression.interpolated}function Qs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function qs(e){return e}function Xs(e,t){const r="color"===t.type,i=e.stops&&"object"==typeof e.stops[0][0],n=i||!(i||void 0!==e.property),o=e.type||(Ws(t)?"exponential":"interval");if(r&&((e=Zi({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Ni.parse(e[1])]))),e.default=Ni.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!hs[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=Js;else if("interval"===o)s=Ks;else if("categorical"===o){s=$s,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=ea}if(i){const r={},i=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},i.push(o)),r[o].stops.push([n[0].value,n[1]])}const n=[];for(const e of i)n.push([r[e].zoom,Xs(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:ds.interpolationFactor.bind(void 0,o),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>Js({stops:n,base:e.base},t,r).evaluate(r,i)}}if(n){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:ds.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,a,l)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[e.property]:void 0;return void 0===n?Ys(e.default,t.default):s(e,t,n,a,l)}}}function Ys(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function $s(e,t,r,i,n){return Ys(typeof r===n?i[r]:void 0,e.default,t.default)}function Ks(e,t,r){if("number"!==Tn(r))return Ys(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const n=Wo(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function Js(e,t,r){const i=void 0!==e.base?e.base:1;if("number"!==Tn(r))return Ys(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const o=Wo(e.stops.map((e=>e[0])),r),s=function(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=Gi[t.type]||qs;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=hs[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,s)}}:c(a,l,s)}function ea(e,t,r){return"color"===t.type?r=Ni.parse(r):"formatted"===t.type?r=pn.fromString(r.toString()):"resolvedImage"===t.type?r=fn.fromString(r.toString()):Tn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Ys(r,e.default,t.default)}Pn.register(Os,{error:[{kind:"error"},[Yi],(e,[t])=>{throw new xn(t.evaluate(e))}],typeof:[Yi,[en],(e,[t])=>sn(An(t.evaluate(e)))],"to-rgba":[on(Xi,4),[Ki],(e,[t])=>t.evaluate(e).toArray()],rgb:[Ki,[Xi,Xi,Xi],zs],rgba:[Ki,[Xi,Xi,Xi,Xi],zs],hsl:[Ki,[Xi,Xi,Xi],Bs],hsla:[Ki,[Xi,Xi,Xi,Xi],Bs],has:{type:$i,overloads:[[[Yi],(e,[t])=>Rs(t.evaluate(e),e.properties())],[[Yi,Ji],(e,[t,r])=>Rs(t.evaluate(e),r.evaluate(e))]]},get:{type:en,overloads:[[[Yi],(e,[t])=>Fs(t.evaluate(e),e.properties())],[[Yi,Ji],(e,[t,r])=>Fs(t.evaluate(e),r.evaluate(e))]]},"feature-state":[en,[Yi],(e,[t])=>Fs(t.evaluate(e),e.featureState||{})],properties:[Ji,[],e=>e.properties()],"geometry-type":[Yi,[],e=>e.geometryType()],id:[en,[],e=>e.id()],zoom:[Xi,[],e=>e.globals.zoom],pitch:[Xi,[],e=>e.globals.pitch||0],"distance-from-center":[Xi,[],e=>e.distanceFromCenter()],"measure-light":[Xi,[Yi],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[Xi,[],e=>e.globals.heatmapDensity||0],"line-progress":[Xi,[],e=>e.globals.lineProgress||0],"raster-value":[Xi,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Xi,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Xi,[],e=>e.globals.skyRadialProgress||0],accumulated:[en,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Xi,js(Xi),(e,t)=>{let r=0;for(const i of t)r+=i.evaluate(e);return r}],"*":[Xi,js(Xi),(e,t)=>{let r=1;for(const i of t)r*=i.evaluate(e);return r}],"-":{type:Xi,overloads:[[[Xi,Xi],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Xi],(e,[t])=>-t.evaluate(e)]]},"/":[Xi,[Xi,Xi],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Xi,[Xi,Xi],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Xi,[],()=>Math.LN2],pi:[Xi,[],()=>Math.PI],e:[Xi,[],()=>Math.E],"^":[Xi,[Xi,Xi],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Xi,[Xi],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))],log2:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Xi,[Xi],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Xi,[Xi],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Xi,[Xi],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Xi,[Xi],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Xi,[Xi],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Xi,[Xi],(e,[t])=>Math.atan(t.evaluate(e))],min:[Xi,js(Xi),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Xi,js(Xi),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Xi,[Xi],(e,[t])=>Math.abs(t.evaluate(e))],round:[Xi,[Xi],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Xi,[Xi],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Xi,[Xi],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[$i,[Yi,en],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[$i,[en],(e,[t])=>e.id()===t.value],"filter-type-==":[$i,[Yi],(e,[t])=>e.geometryType()===t.value],"filter-<":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[$i,[en],(e,[t])=>t.value in e.properties()],"filter-has-id":[$i,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[$i,[on(Yi)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[$i,[on(en)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[$i,[Yi,on(en)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[$i,[Yi,on(en)],(e,[t,r])=>function(e,t,r,i){for(;r<=i;){const n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:$i,overloads:[[[$i,$i],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[js($i),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:$i,overloads:[[[$i,$i],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[js($i),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[$i,[$i],(e,[t])=>!t.evaluate(e)],"is-supported-script":[$i,[Yi],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Yi,[Yi],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Yi,[Yi],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Yi,js(en),(e,t)=>t.map((t=>_n(t.evaluate(e)))).join("")],"resolved-locale":[Yi,[tn],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[Xi,[Xi,Xi,en],(e,t)=>{const[r,i,n]=t.map((t=>t.evaluate(e)));if(r>i)return r;if(r===i)return r;let o;if("string"==typeof n)o=function(e){let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}(n);else{if("number"!=typeof n)throw new xn(`Invalid seed input: ${n}`);o=n}return r+Ls(o)()*(i-r)}]});class ta{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new In(r,i),this._defaultValue=t?function(e){return"color"===e.type&&(Qs(e.default)||Array.isArray(e.default))?new Ni(0,0,0,0):"color"===e.type?Ni.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,o,s,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,o,s,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new xn(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function ra(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Os}function ia(e,t,r,i){const n=new Go(Os,[],t?function(e){const t={color:Ki,string:Yi,number:Xi,enum:Yi,boolean:$i,formatted:rn,resolvedImage:nn};return"array"===e.type?on(t[e.value]||en,e.length):t[e.type]}(t):void 0,void 0,void 0,r,i),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Vs(new ta(o,t,r,i)):Ns(n.errors)}class na{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isLightConstant=r,this.isStateDependent="constant"!==e&&!Vo(t.expression),this.isConfigDependent=!No(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}}class oa{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Vo(t.expression),this.isLightConstant=n,this.isConfigDependent=!No(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}interpolationFactor(e,t,r){return this.interpolationType?ds.interpolationFactor(this.interpolationType,e,t,r):0}}function sa(e,t,r,i){if("error"===(e=ia(e,t,r,i)).result)return e;const n=e.value.expression,o=jo(n);if(!o&&!Hs(t))return Ns([new Wi("","data expressions not supported")]);const s=Uo(n,["zoom","pitch","distance-from-center"]);if(!s&&!Zs(t))return Ns([new Wi("","zoom expressions not supported")]);const a=Uo(n,["measure-light"]);if(!a&&!Gs(t))return Ns([new Wi("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=la(n);return c||s||l?c instanceof Wi?Ns([c]):c instanceof ds&&!Ws(t)?Ns([new Wi("",'"interpolate" expressions cannot be used with this property')]):Vs(c?new oa(o?"camera":"composite",e.value,c.labels,c instanceof ds?c.interpolation:void 0,a):new na(o?"constant":"source",e.value,a)):Ns([new Wi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class aa{constructor(e,t){this._parameters=e,this._specification=t,Zi(this,Xs(this._parameters,this._specification))}static deserialize(e){return new aa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function la(e){let t=null;if(e instanceof ms)t=la(e.result);else if(e instanceof fs){for(const r of e.args)if(t=la(r),t)break}else(e instanceof Qo||e instanceof ds)&&e.input instanceof Pn&&"zoom"===e.input.name&&(t=e);return t instanceof Wi||e.eachChild((e=>{const r=la(e);r instanceof Wi?t=r:t&&r&&t!==r&&(t=new Wi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var ca=ha,ua=3;function ha(e,t,r){var i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],this.d=(t=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var s=n[ua+o],a=n[ua+o+1];i.push(s===a?null:n.subarray(s,a))}var l=n[ua+i.length+1];this.keys=n.subarray(n[ua+i.length],l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var u=r/t*e;this.min=-u,this.max=e+u}ha.prototype.insert=function(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},ha.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ha.prototype._insertCell=function(e,t,r,i,n,o){this.cells[n].push(o)},ha.prototype.query=function(e,t,r,i,n){var o=this.min,s=this.max;if(e<=o&&t<=o&&s<=r&&s<=i&&!n)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,r,i,this._queryCell,a,{},n),a},ha.prototype._queryCell=function(e,t,r,i,n,o,s,a){var l=this.cells[n];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&r>=u[p+0]&&i>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},ha.prototype._forEachCell=function(e,t,r,i,n,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(i),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&n.call(this,e,t,r,i,f,o,s,a))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ua+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=t,s=0;s<e.length;s++){var a=e[s];n[ua+s]=o,n.set(a,o),o+=a.length}return n[ua+e.length]=o,n.set(this.keys,o),n[ua+e.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var da=h(ca);const pa={};function fa(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pa[t]={klass:e,omit:r.omit||[]}}fa(Object,"Object"),da.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.add(r),{buffer:r}},da.deserialize=function(e){return new da(e.buffer)},Object.defineProperty(da,"name",{value:"Grid"}),fa(da,"Grid"),fa(Ni,"Color"),fa(Error,"Error"),fa(pn,"Formatted"),fa(dn,"FormattedSection"),fa(Yr,"AJAXError"),fa(fn,"ResolvedImage"),fa(aa,"StylePropertyFunction"),fa(ta,"StyleExpression",{omit:["_evaluator"]}),fa(oa,"ZoomDependentExpression"),fa(na,"ZoomConstantExpression"),fa(Pn,"CompoundExpression",{omit:["_evaluate"]});for(const e in Os)pa[Os[e]._classRegistryKey]||fa(Os[e],`Expression${e}`);function ma(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ga(e){return self.ImageBitmap&&e instanceof ImageBitmap}function Aa(e,t){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)return e;if(ma(e)||ga(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.add(r.buffer),r}if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const i of e)r.push(Aa(i,t));return r}if(e instanceof Map){const t={$name:"Map"};for(const[r,i]of e.entries())t[r]=Aa(i);return t}if("object"==typeof e){const r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error(`can't serialize object of unregistered class ${i}`);const n=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(pa[i].omit.indexOf(r)>=0||(n[r]=Aa(e[r],t)));e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}throw new Error("can't serialize object of type "+typeof e)}function _a(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||ma(e)||ga(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(_a);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const r of Object.keys(e))"$name"!==r&&t.set(r,_a(e[r]));return t}const{klass:r}=pa[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const i=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(i[t]=_a(e[t]));return i}throw new Error("can't deserialize object of type "+typeof e)}const ya={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function xa(e){for(const t of e)if(wa(t.charCodeAt(0)))return!0;return!1}function va(e){for(const t of e)if(!ba(t.charCodeAt(0)))return!1;return!0}function ba(e){return!(ya.Arabic(e)||ya["Arabic Supplement"](e)||ya["Arabic Extended-A"](e)||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e))}function wa(e){return!(746!==e&&747!==e&&(e<4352||!(ya["Bopomofo Extended"](e)||ya.Bopomofo(e)||ya["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ya["CJK Compatibility Ideographs"](e)||ya["CJK Compatibility"](e)||ya["CJK Radicals Supplement"](e)||ya["CJK Strokes"](e)||!(!ya["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs"](e)||ya["Enclosed CJK Letters and Months"](e)||ya["Hangul Compatibility Jamo"](e)||ya["Hangul Jamo Extended-A"](e)||ya["Hangul Jamo Extended-B"](e)||ya["Hangul Jamo"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya["Ideographic Description Characters"](e)||ya.Kanbun(e)||ya["Kangxi Radicals"](e)||ya["Katakana Phonetic Extensions"](e)||ya.Katakana(e)&&12540!==e||!(!ya["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)||!(!ya["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ya["Unified Canadian Aboriginal Syllabics"](e)||ya["Unified Canadian Aboriginal Syllabics Extended"](e)||ya["Vertical Forms"](e)||ya["Yijing Hexagram Symbols"](e)||ya["Yi Syllables"](e)||ya["Yi Radicals"](e))))}function Ca(e){return!(wa(e)||function(e){return!!(ya["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ya["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)||ya["Letterlike Symbols"](e)||ya["Number Forms"](e)||ya["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)||ya["Control Pictures"](e)&&9251!==e||ya["Optical Character Recognition"](e)||ya["Enclosed Alphanumerics"](e)||ya["Geometric Shapes"](e)||ya["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ya["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ya["CJK Symbols and Punctuation"](e)||ya.Katakana(e)||ya["Private Use Area"](e)||ya["CJK Compatibility Forms"](e)||ya["Small Form Variants"](e)||ya["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 Ta(e){return e>=1424&&e<=2303||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e)}function Ea(e,t){return!(!t&&Ta(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ya.Khmer(e))}function Ma(e){for(const t of e)if(Ta(t.charCodeAt(0)))return!0;return!1}const Sa="deferred",Ia="loading",Pa="loaded";let Da=null,ka="unavailable",La=null;const Oa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(ka="error"),Da&&Da(e)};function za(){Ba.fire(new Li("pluginStateChange",{pluginStatus:ka,pluginURL:La}))}const Ba=new zi,Ra=function(){return ka},Fa=function(){if(ka!==Sa||!La)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ka=Ia,za(),La&&Jr({url:La},(e=>{e?Oa(e):(ka=Pa,za())}))},ja={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ka===Pa||null!=ja.applyArabicShaping,isLoading:()=>ka===Ia,setState(e){ka=e.pluginStatus,La=e.pluginURL},isParsed:()=>null!=ja.applyArabicShaping&&null!=ja.processBidirectionalText&&null!=ja.processStyledBidirectionalText,getPluginURL:()=>La};class Va{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!Ea(r.charCodeAt(0),t))return!1;return!0}(e,ja.isLoaded())}}class Na{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=function(e,t,r,i){if(Qs(e))return new aa(e,t);if(ra(e)||Array.isArray(e)&&e.length>0){const n=sa(e,t,r,i);if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return n.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=Ni.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Ua{constructor(e,t,r){this.property=e,this.value=new Na(e,void 0,t,r)}transitioned(e,t){return new Ga(this.property,this.value,t,Jt({},e.transition,this.transition),e.now)}untransitioned(){return new Ga(this.property,this.value,null,{},0)}}class Ha{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property,this._scope,this._options)),this._values[e].value=new Na(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].value.expression.isConfigDependent}setTransitionOrValue(e,t){t&&(this._options=t);const r=this._properties.properties;if(e)for(const t in e){const i=e[t];if(sr(t,"-transition")){const e=t.slice(0,-11);r[e]&&this.setTransition(e,i)}else r[t]&&this.setValue(t,i)}}getTransition(e){return cr(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property)),this._values[e].transition=cr(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){const r=new Za(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){const e=new Za(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ga{constructor(e,t,r,i,n){const o=i.delay||0,s=i.duration||0;n=n||0,this.property=e,this.value=t,this.begin=n+o,this.end=this.begin+s,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(e,t,r);{const s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),n,Wt(s))}}return n}}class Za{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const i=new qa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Wa{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value)}setValue(e,t){this._values[e]=new Na(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].expression.isConfigDependent}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const i=new qa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}}class Qa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}}class qa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Xa{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const i=Gi[this.specification.type];return i?i(e,t,r):e}}class Ya{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return new Qa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Qa(this,{kind:"constant",value:void 0},e.parameters);const i=Gi[this.specification.type];return i?new Qa(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,i,n,o){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,o)}}class $a{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}}class Ka{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Va(0,{});for(const r in e){const i=e[r];i.specification.overridable&&this.overridableProperties.push(r);const n=this.defaultPropertyValues[r]=new Na(i,void 0),o=this.defaultTransitionablePropertyValues[r]=new Ua(i);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate(t)}}}function Ja(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function el(e){if(Array.isArray(e))return e.map(el);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=el(e[r]);return t}return Ja(e)}fa(Ya,"DataDrivenProperty"),fa(Xa,"DataConstantProperty"),fa($a,"ColorRampProperty");var tl=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"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":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":1}},"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},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"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},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"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},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function rl(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));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(const t of e.slice(1))if(!rl(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function il(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};rl(e)||(e=ul(e));const r=e;let i=!0;try{i=function(e){if(!sl(e))return e;let t=el(e);return ol(t),t=nl(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const n=tl[`filter_${t}`],o=ia(i,n);let s=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(e,t,r)=>o.value.evaluate(e,t,{},r);let a=null,l=null;if(i!==r){const e=ia(r,n);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,r,i,n,o)=>e.value.evaluate(t,r,{},i,void 0,void 0,n,o),l=!jo(e.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:cl(i),needFeature:!!l}}function nl(e){if(!Array.isArray(e))return e;const t=function(e){if(al.has(e[0]))for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>nl(e)))}function ol(e){let t=!1;const r=[];if("case"===e[0]){for(let i=1;i<e.length-1;i+=2)t=t||sl(e[i]),r.push(e[i+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||sl(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||sl(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)ol(e[t])}function sl(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return!1}const al=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ll(e,t){return e<t?-1:e>t?1:0}function cl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(cl(e[t]))return!0;return!1}function ul(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?hl(e[1],e[2],"=="):"!="===t?fl(hl(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?hl(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(ul))):"all"===t?["all"].concat(e.slice(1).map(ul)):"none"===t?["all"].concat(e.slice(1).map(ul).map(fl)):"in"===t?dl(e[1],e.slice(2)):"!in"===t?fl(dl(e[1],e.slice(2))):"has"===t?pl(e[1]):"!has"!==t||fl(pl(e[1]));var r}function hl(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function dl(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((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(ll)]]:["filter-in-small",e,["literal",t]]}}function pl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function fl(e){return["!",e]}const ml="";function gl(e,t){return t?`${e}${ml}${t}`:e}const Al="-transition",_l=new Set(["fill","line","background","hillshade","raster"]);class yl extends zi{constructor(e,t,r,i){if(super(),this.id=e.id,this.fqid=gl(this.id,r),this.type=e.type,this.scope=r,this.options=i,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new Wa(t.layout,this.scope,i),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),t.paint)){this._transitionablePaint=new Ha(t.paint,this.scope,i);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new qa(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return _l.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const r=this._unevaluatedLayout;r._properties.properties[e]&&(r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return sr(e,Al)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const r=this._transitionablePaint,i=r._properties.properties;if(sr(e,Al)){const n=e.slice(0,-11);return i[n]&&r.setTransition(n,t||void 0),!1}if(!i[e])return!1;const n=r._values[e],o=n.value.isDataDriven(),s=n.value;r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,this._handleSpecialPaintPropertyUpdate(e);const a=r._values[e].value,l=a.isDataDriven(),c=sr(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return lr({id:this.id,type:this.type,slot:this.slot,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()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Qa&&Hs(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=il(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,r,i,n,o,s,a,l){}queryIntersectsMatchingFeature(e,t,r,i){}}const xl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class vl{constructor(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}}class bl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function wl(e,t=1){let r=0,i=0;return{members:e.map((e=>{const n=xl[e.type].BYTES_PER_ELEMENT,o=r=Cl(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Cl(r,Math.max(i,t)),alignment:t}}function Cl(e,t){return Math.ceil(e/t)*t}class Tl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}}Tl.prototype.bytesPerElement=4,fa(Tl,"StructArrayLayout2i4");class El extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}}El.prototype.bytesPerElement=6,fa(El,"StructArrayLayout3i6");class Ml extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,e}}Ml.prototype.bytesPerElement=8,fa(Ml,"StructArrayLayout4i8");class Sl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,e}}Sl.prototype.bytesPerElement=10,fa(Sl,"StructArrayLayout5i10");class Il extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}Il.prototype.bytesPerElement=12,fa(Il,"StructArrayLayout2i4ub1f12");class Pl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,e}}Pl.prototype.bytesPerElement=16,fa(Pl,"StructArrayLayout4f16");class Dl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}}Dl.prototype.bytesPerElement=8,fa(Dl,"StructArrayLayout2f8");class kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=r,this.uint16[s+2]=i,this.uint16[s+3]=n,this.float32[a+2]=o,e}}kl.prototype.bytesPerElement=12,fa(kl,"StructArrayLayout4ui1f12");class Ll extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=i,this.uint16[o+3]=n,e}}Ll.prototype.bytesPerElement=8,fa(Ll,"StructArrayLayout4ui8");class Ol extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,this.int16[a+4]=o,this.int16[a+5]=s,e}}Ol.prototype.bytesPerElement=12,fa(Ol,"StructArrayLayout6i12");class zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,i,n,o,s,a,l,c,u,h)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=i,this.int16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,e}}zl.prototype.bytesPerElement=24,fa(zl,"StructArrayLayout4i4ui4i24");class Bl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.float32[l+2]=n,this.float32[l+3]=o,this.float32[l+4]=s,e}}Bl.prototype.bytesPerElement=20,fa(Bl,"StructArrayLayout3i3f20");class Rl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Rl.prototype.bytesPerElement=4,fa(Rl,"StructArrayLayout1ul4");class Fl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}}Fl.prototype.bytesPerElement=4,fa(Fl,"StructArrayLayout2ui4");class jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,o,s,a,l,c,u,h,d)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=h,this.uint16[f+18]=d,this.uint16[f+19]=p,e}}jl.prototype.bytesPerElement=40,fa(jl,"StructArrayLayout5i4f1i1ul2ui40");class Vl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=i,this.int16[l+4]=n,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Vl.prototype.bytesPerElement=16,fa(Vl,"StructArrayLayout3i2i2i16");class Nl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[a+6]=n,this.int16[a+7]=o,e}}Nl.prototype.bytesPerElement=16,fa(Nl,"StructArrayLayout2f1f2i16");class Ul extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=12*e,s=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,e}}Ul.prototype.bytesPerElement=12,fa(Ul,"StructArrayLayout2ub2f12");class Hl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}}Hl.prototype.bytesPerElement=6,fa(Hl,"StructArrayLayout3ui6");class Gl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v){const b=30*e,w=15*e,C=60*e;return this.int16[b+0]=t,this.int16[b+1]=r,this.int16[b+2]=i,this.float32[w+2]=n,this.float32[w+3]=o,this.uint16[b+8]=s,this.uint16[b+9]=a,this.uint32[w+5]=l,this.uint32[w+6]=c,this.uint32[w+7]=u,this.uint16[b+16]=h,this.uint16[b+17]=d,this.uint16[b+18]=p,this.float32[w+10]=f,this.float32[w+11]=m,this.uint8[C+48]=g,this.uint8[C+49]=A,this.uint8[C+50]=_,this.uint32[w+13]=y,this.int16[b+28]=x,this.uint8[C+58]=v,e}}Gl.prototype.bytesPerElement=60,fa(Gl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D){const k=this.length;return this.resize(k+1),this.emplace(k,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D,k){const L=20*e,O=40*e,z=80*e;return this.float32[L+0]=t,this.float32[L+1]=r,this.int16[O+4]=i,this.int16[O+5]=n,this.int16[O+6]=o,this.int16[O+7]=s,this.int16[O+8]=a,this.int16[O+9]=l,this.int16[O+10]=c,this.int16[O+11]=u,this.int16[O+12]=h,this.uint16[O+13]=d,this.uint16[O+14]=p,this.uint16[O+15]=f,this.uint16[O+16]=m,this.uint16[O+17]=g,this.uint16[O+18]=A,this.uint16[O+19]=_,this.uint16[O+20]=y,this.uint16[O+21]=x,this.uint16[O+22]=v,this.uint16[O+23]=b,this.uint16[O+24]=w,this.uint16[O+25]=C,this.uint16[O+26]=T,this.uint16[O+27]=E,this.uint32[L+14]=M,this.float32[L+15]=S,this.float32[L+16]=I,this.float32[L+17]=P,this.float32[L+18]=D,this.uint8[z+76]=k,e}}Zl.prototype.bytesPerElement=80,fa(Zl,"StructArrayLayout2f9i15ui1ul4f1ub80");class Wl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Wl.prototype.bytesPerElement=4,fa(Wl,"StructArrayLayout1f4");class Ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.float32[s+3]=n,this.float32[s+4]=o,e}}Ql.prototype.bytesPerElement=20,fa(Ql,"StructArrayLayout5f20");class ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=r,this.float32[l+2]=i,this.float32[l+3]=n,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}ql.prototype.bytesPerElement=28,fa(ql,"StructArrayLayout7f28");class Xl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=i,this.uint16[o+4]=n,e}}Xl.prototype.bytesPerElement=12,fa(Xl,"StructArrayLayout1ul3ui12");class Yl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Yl.prototype.bytesPerElement=2,fa(Yl,"StructArrayLayout1ui2");class $l extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}$l.prototype.bytesPerElement=12,fa($l,"StructArrayLayout3f12");class Kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g){const A=16*e;return this.float32[A+0]=t,this.float32[A+1]=r,this.float32[A+2]=i,this.float32[A+3]=n,this.float32[A+4]=o,this.float32[A+5]=s,this.float32[A+6]=a,this.float32[A+7]=l,this.float32[A+8]=c,this.float32[A+9]=u,this.float32[A+10]=h,this.float32[A+11]=d,this.float32[A+12]=p,this.float32[A+13]=f,this.float32[A+14]=m,this.float32[A+15]=g,e}}Kl.prototype.bytesPerElement=64,fa(Kl,"StructArrayLayout16f64");class Jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=r,this.uint16[l+2]=i,this.uint16[l+3]=n,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}Jl.prototype.bytesPerElement=20,fa(Jl,"StructArrayLayout4ui3f20");class ec extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}ec.prototype.bytesPerElement=2,fa(ec,"StructArrayLayout1i2");class tc extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}tc.prototype.bytesPerElement=1,fa(tc,"StructArrayLayout1ub1");class rc extends vl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}rc.prototype.size=40;class ic extends jl{get(e){return new rc(this,e)}}fa(ic,"CollisionBoxArray");class nc extends vl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}nc.prototype.size=60;class oc extends Gl{get(e){return new nc(this,e)}}fa(oc,"PlacedSymbolArray");class sc extends vl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}sc.prototype.size=80;class ac extends Zl{get(e){return new sc(this,e)}}fa(ac,"SymbolInstanceArray");class lc extends Wl{getoffsetX(e){return this.float32[1*e+0]}}fa(lc,"GlyphOffsetArray");class cc extends Tl{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}fa(cc,"SymbolLineVertexArray");class uc extends vl{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}uc.prototype.size=12;class hc extends Xl{get(e){return new uc(this,e)}}fa(hc,"FeatureIndexArray");class dc extends Fl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}fa(dc,"FillExtrusionCentroidArray");const pc=wl([{name:"a_pos",components:2,type:"Int16"}],4),fc=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class mc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,r,i){let n=this.segments[this.segments.length-1];return e>mc.MAX_VERTEX_ARRAY_LENGTH&&hr(`Max vertices per segment is ${mc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!n||n.vertexLength+e>mc.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:t,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n}prepareSegment(e,t,r,i){return this._prepareSegment(e,t.length,r.length,i)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,i){return new mc([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}}function gc(e,t){return 256*(e=Xt(Math.floor(e),0,255))+Xt(Math.floor(t),0,255)}mc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa(mc,"SegmentVector");const Ac=wl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),_c=wl([{name:"a_dash",components:4,type:"Uint16"}]);class yc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(xc(e)),this.positions.push(t,r,i)}eachPosition(e,t){const r=xc(e);let i=0,n=this.ids.length-1;for(;i<n;){const e=i+n>>1;this.ids[e]>=r?n=e:i=e+1}for(;this.ids[i]===r;)t(this.positions[3*i],this.positions[3*i+1],this.positions[3*i+2]),i++}static serialize(e,t){const r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return vc(r,i,0,r.length-1),t&&(t.add(r.buffer),t.add(i.buffer)),{ids:r,positions:i}}static deserialize(e){const t=new yc;let r;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==r&&t.uniqueIds.push(e),r=e;return t.indexed=!0,t}}function xc(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Pi(String(e))}function vc(e,t,r,i){for(;r<i;){const n=e[r+i>>1];let o=r-1,s=i+1;for(;;){do{o++}while(e[o]<n);do{s--}while(e[s]>n);if(o>=s)break;bc(e,o,s),bc(t,3*o,3*s),bc(t,3*o+1,3*s+1),bc(t,3*o+2,3*s+2)}s-r<i-s?(vc(e,t,r,s),r=s+1):(vc(e,t,s+1,i),i=s)}}function bc(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}fa(yc,"FeaturePositionMap");class wc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Cc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}}class Tc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class Ec extends wc{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}}class Mc extends wc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}}class Sc extends wc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class Ic extends wc{constructor(e){super(e),this.current=Ni.transparent}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Pc=new Float32Array(16);class Dc extends wc{constructor(e){super(e),this.current=Pc}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const kc=new Float32Array(9),Lc=new Float32Array(4);class Oc extends wc{constructor(e){super(e),this.current=Lc}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function zc(e){return[gc(255*e.r,255*e.g),gc(255*e.b,255*e.a)]}class Bc{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r,i,n){t.set(e,n,i.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new Ic(e):new Tc(e)}}class Rc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,r,i,n){const o="u_pattern"===n||"u_dash"===n?this.pattern:"u_pixel_ratio"===n?this.pixelRatio:null;o&&t.set(e,n,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Sc(e):new Tc(e)}}class Fc{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r,i,n,o,s){const a=this.paintVertexArray.length,l=this.expression.evaluate(new Va(0,{brightness:o}),t,{},n,i,s);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l)}updatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate({zoom:0,brightness:s},r,i,void 0,n);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){const i=zc(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jc{constructor(e,t,r,i,n,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate(new Va(this.zoom,{brightness:o}),t,{},n,i,s),l=this.expression.evaluate(new Va(this.zoom+1,{brightness:o}),t,{},n,i,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l)}updatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate({zoom:this.zoom,brightness:s},r,i,void 0,n),l=this.expression.evaluate({zoom:this.zoom+1,brightness:s},r,i,void 0,n);this._setPaintValue(e,t,a,l)}_setPaintValue(e,t,r,i){if("color"===this.type){const n=zc(r),o=zc(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],o[0],o[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,i,n){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,s=Xt(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,n,s)}getBinding(e,t){return new Tc(e)}}class Vc{constructor(e,t,r,i,n){this.expression=e,this.layerId=n,this.paintVertexAttributes=("array"===r?_c:Ac).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new i}populatePaintArray(e,t,r){const i=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,i,n,o,s){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,i){if(!i||!r)return;const n=i[r];if(!n)return;const{tl:o,br:s,pixelRatio:a}=n;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],s[0],s[1],a)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Nc{constructor(e,t,r=(()=>!0)){this.binders={},this._buffers=[];const i=[];for(const n in e.paint._values){const o=e.paint.get(n);if(!r(n))continue;if(!(o instanceof Qa&&Hs(o.property.specification)))continue;const s=Gc(n,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===n||n.endsWith("pattern"),h="line-dasharray"===n&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==a.kind||h)if("source"===a.kind||h||u){const t=Qc(n,l,"source");this.binders[n]=u?new Vc(a,s,l,t,e.id):new Fc(a,s,l,t),i.push(`/a_${n}`)}else{const e=Qc(n,l,"composite");this.binders[n]=new jc(a,s,l,c,t,e),i.push(`/z_${n}`)}else this.binders[n]=u?new Rc(a.value,s):new Bc(a.value,s,l),i.push(`/u_${n}`)}this.cacheKey=i.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Fc||t instanceof jc?t.maxValue:0}populatePaintArrays(e,t,r,i,n,o,s){for(const a in this.binders){const l=this.binders[a];(l instanceof Fc||l instanceof jc||l instanceof Vc)&&l.populatePaintArray(e,t,r,i,n,o,s)}}setConstantPatternPositions(e){for(const t in this.binders){const r=this.binders[t];r instanceof Rc&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,t,r,i,n,o,s,a){let l=!1;const c=Object.keys(e),u=0!==c.length,h=u?c:t.uniqueIds;for(const c in this.binders){const d=this.binders[c];if((d instanceof Fc||d instanceof jc||d instanceof Vc)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=n.paint.get(c);d.expression=p.value;for(const r of h){const n=e[r.toString()];t.eachPosition(r,((e,t,r)=>{const l=i.feature(e);d.updatePaintArray(t,r,l,n,o,s,a)}))}if(!u)for(const t of r.uniqueIds){const n=e[t.toString()];r.eachPosition(t,((e,t,r)=>{const l=i.feature(e);d.updatePaintArray(t,r,l,n,o,s,a)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Bc||r instanceof Rc)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Fc||r instanceof jc||r instanceof Vc)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Bc||r instanceof Rc||r instanceof jc)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const i=this.binders[r];if(i instanceof Bc||i instanceof Rc||i instanceof jc)for(const n of i.uniformNames)t.push({name:n,property:r,binding:i.getBinding(e,n)})}return t}setUniforms(e,t,r,i,n){for(const{name:t,property:o,binding:s}of r)this.binders[o].setUniform(e,s,n,i.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Vc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Fc||r instanceof jc||r instanceof Vc)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Vc)&&t.destroy()}}}class Uc{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const i of e)this.programConfigurations[i.id]=new Nc(i,t,r);this.needsUpload=!1,this._featureMap=new yc,this._featureMapWithoutIds=new yc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,r,i,n,o,s,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i,n,o,s,a);void 0!==t.id?this._featureMap.add(t.id,r,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i,n,o){for(const s of r)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,s,i,n,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Hc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Gc(e,t){return Hc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Zc={"line-pattern":{source:kl,composite:kl},"fill-pattern":{source:kl,composite:kl},"fill-extrusion-pattern":{source:kl,composite:kl},"line-dasharray":{source:Ll,composite:Ll}},Wc={color:{source:Dl,composite:Pl},number:{source:Wl,composite:Dl}};function Qc(e,t,r){const i=Zc[e];return i&&i[r]||Wc[t][r]}fa(Bc,"ConstantBinder"),fa(Rc,"PatternConstantBinder"),fa(Fc,"SourceExpressionBinder"),fa(Vc,"PatternCompositeBinder"),fa(jc,"CompositeExpressionBinder"),fa(Nc,"ProgramConfiguration",{omit:["_buffers"]}),fa(Uc,"ProgramConfigurationSet");const qc=no/Math.PI/2,Xc=5,Yc=6,$c=16383,Kc=64,Jc=[Kc,32,16],eu=-qc,tu=qc;function ru(e,t,r,i=qc){return r=Ht(r),[e*Math.sin(r)*i,-t*i,e*Math.cos(r)*i]}function iu(e,t,r){return ru(Math.cos(Ht(e)),Math.sin(Ht(e)),t,r)}const nu=6371008.8,ou=2*Math.PI*nu;class su{constructor(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")}wrap(){return new su($t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return nu*Math.acos(Math.min(n,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new au({lng:this.lng-r,lat:this.lat-t},{lng:this.lng+r,lat:this.lat+t})}toEcef(e){return iu(this.lat,this.lng,qc+e*qc/nu)}static convert(e){if(e instanceof su)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new su(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new su(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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class au{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}setSouthWest(e){return this._sw=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}extend(e){const t=this._sw,r=this._ne;let i,n;if(e instanceof su)i=e,n=e;else{if(!(e instanceof au))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(au.convert(e)):this.extend(su.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(su.convert(e)):this;if(i=e._sw,n=e._ne,!i||!n)return this}return t||r?(t.lng=Math.min(i.lng,t.lng),t.lat=Math.min(i.lat,t.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)):(this._sw=new su(i.lng,i.lat),this._ne=new su(n.lng,n.lat)),this}getCenter(){return new su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new su(this.getWest(),this.getNorth())}getSouthEast(){return new su(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:r}=su.convert(e);let i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}static convert(e){return!e||e instanceof au?e:new au(e)}}var lu={};!function(e,t){!function(e){function t(e,t,i){var n=r(256*e,256*(t=Math.pow(2,i)-t-1),i),o=r(256*(e+1),256*(t+1),i);return n[0]+","+n[1]+","+o[0]+","+o[1]}function r(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}e.getURL=function(e,r,i,n,o,s){return s=s||{},e+"?"+["bbox="+t(i,n,o),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+r].join("&")},e.getTileBBox=t,e.getMercCoords=r,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,lu);var cu=lu;class uu{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=pu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const r=cu.getTileBBox(this.x,this.y,this.z),i=function(e,t,r){let i,n="";for(let o=e;o>0;o--)i=1<<o-1,n+=(t&i?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",i).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=pu(e,t.z,t.z,t.x,t.y)}}class du{constructor(e,t,r,i,n){this.overscaledZ=e,this.wrap=t,this.canonical=new uu(r,+i,+n),this.key=0===t&&e===r?this.canonical.key:pu(t,e,r,i,n)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new du(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new du(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return pu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return pu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new du(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new du(t,this.wrap,t,r,i),new du(t,this.wrap,t,r+1,i),new du(t,this.wrap,t,r,i+1),new du(t,this.wrap,t,r+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new du(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new du(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function pu(e,t,r,i,n){const o=1<<Math.min(r,22);let s=o*(n%o)+i%o;return e&&r<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*s+r)+(t-r)}const fu=[e=>{let t=e.canonical.x-1,r=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,r--),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,r=e.wrap;return t===1<<e.canonical.z&&(t=0,r++),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];fa(uu,"CanonicalTileID"),fa(du,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const mu=0,gu=25.5;function Au(e){return ou*Math.cos(e*Math.PI/180)}function _u(e){return(180+e)/360}function yu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function xu(e,t){return e/Au(t)}function vu(e){return 360*e-180}function bu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function wu(e,t){return e*Au(bu(t))}const Cu=85.051129;function Tu(e){return Math.cos(Ht(Xt(e,-Cu,Cu)))}function Eu(e,t){const r=Xt(t,mu,gu),i=Math.pow(2,r);return Tu(e)*ou/(512*i)}function Mu(e){return 1/Math.cos(e*Math.PI/180)}function Su(e,t=0){const r=Math.exp(Math.PI*(1-(e.y+t/no)/(1<<e.z)*2));return 80150034*r/(r*r+1)/no/(1<<e.z)}class Iu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=su.convert(e);return new Iu(_u(r.lng),yu(r.lat),xu(t,r.lat))}toLngLat(){return new su(vu(this.x),bu(this.y))}toAltitude(){return wu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ou*Mu(bu(this.y))}}function Pu(e,t,r,i,n,o,s,a,l){const c=(t+i)/2,u=(r+n)/2,h=new Vt(c,u);a(h),function(e,t,r,i,n,o){const s=r-n,a=i-o;return Math.abs((i-t)*s-(r-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(Pu(e,t,r,c,u,o,h,a,l),Pu(e,c,u,i,n,h,s,a,l)):e.push(s)}function Du(e,t,r){let i=e[0],n=i.x,o=i.y;t(i);const s=[i];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),Pu(s,n,o,c,u,i,l,t,r),n=c,o=u,i=l}return s}function ku(e,t,r,i){if(i(t,r)){const n=t.add(r)._mult(.5);ku(e,t,n,i),ku(e,n,r,i)}else e.push(r)}function Lu(e,t){let r=e[0];const i=[r];for(let n=1;n<e.length;n++){const o=e[n];ku(i,r,o,t),r=o}return i}const Ou=Math.pow(2,14)-1,zu=-Ou-1;function Bu(e,t){const r=Math.round(e.x*t),i=Math.round(e.y*t);return e.x=Xt(r,zu,Ou),e.y=Xt(i,zu,Ou),(r<e.x||r>e.x+1||i<e.y||i>e.y+1)&&hr("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Ru(e,t,r){const i=e.loadGeometry(),n=e.extent,o=no/n;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=r,u=e=>{const r=vu((t.x+e.x/n)/o),i=bu((t.y+e.y/n)/o),u=c.project(r,i);e.x=(u.x*s-a)*n,e.y=(u.y*s-l)*n};for(let t=0;t<i.length;t++)if(1!==e.type)i[t]=Du(i[t],u,1);else{const e=[];for(const r of i[t])r.x<0||r.x>=n||r.y<0||r.y>=n||(u(r),e.push(r));i[t]=e}}for(const e of i)for(const t of e)Bu(t,o);return i}function Fu(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ru(e):[]}}function ju(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}function Vu(e,t,r){const i=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*i,r[1]*i,r[2]*i)}class Nu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Tl,this.indexArray=new Hl,this.segments=new mc,this.programConfigurations=new Uc(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,i){const n=this.layers[0],o=[];let s=null;"circle"===n.type&&(s=n.layout.get("circle-sort-key"));for(const{feature:t,id:n,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),c,r))continue;const u=s?s.evaluate(c,{},r):void 0,h={id:n,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,i),patterns:{},sortKey:u};o.push(h)}s&&o.sort(((e,t)=>e.sortKey-t.sortKey));let a=null;"globe"===i.projection.name&&(this.globeExtVertexArray=new Ol,a=i.projection);for(const i of o){const{geometry:n,index:o,sourceLayerIndex:s}=i,l=e[o].feature;this.addFeature(i,n,o,t.availableImages,r,a,t.brightness),t.featureIndex.insert(l,n,o,s,this.index)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,fc.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,r,i,n,o,s){for(const r of t)for(const t of r){const r=t.x,i=t.y;if(r<0||r>=no||i<0||i>=no)continue;if(o){const e=o.projectTilePoint(r,i,n),t=o.upVector(n,r,i),s=this.globeExtVertexArray;Vu(s,e,t),Vu(s,e,t),Vu(s,e,t),Vu(s,e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;ju(this.layoutVertexArray,r,i,-1,-1),ju(this.layoutVertexArray,r,i,1,-1),ju(this.layoutVertexArray,r,i,1,1),ju(this.layoutVertexArray,r,i,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i,n,s)}}function Uu(e,t){for(let r=0;r<e.length;r++)if($u(t,e[r]))return!0;for(let r=0;r<t.length;r++)if($u(e,t[r]))return!0;return!!Wu(e,t)}function Hu(e,t,r){return!!$u(e,t)||!!qu(t,e,r)}function Gu(e,t){if(1===e.length)return Yu(t,e[0]);for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<i.length;t++)if($u(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(Yu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Wu(e,t[r]))return!0;return!1}function Zu(e,t,r){if(e.length>1){if(Wu(e,t))return!0;for(let i=0;i<t.length;i++)if(qu(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(qu(e[i],t,r))return!0;return!1}function Wu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++)if(Qu(i,n,t[e],t[e+1]))return!0}return!1}function Qu(e,t,r,i){return dr(e,r,i)!==dr(t,r,i)&&dr(e,t,r)!==dr(e,t,i)}function qu(e,t,r){const i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++)if(Xu(e,t[r-1],t[r])<i)return!0;return!1}function Xu(e,t,r){const i=t.distSqr(r);if(0===i)return e.distSqr(t);const n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return e.distSqr(n<0?t:n>1?r:r.sub(t)._mult(n)._add(t))}function Yu(e,t){let r,i,n,o=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)i=r[e],n=r[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(o=!o)}return o}function $u(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){const o=e[i],s=e[n];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(r=!r)}return r}function Ku(e,t,r,i,n){for(const o of e)if(t<=o.x&&r<=o.y&&i>=o.x&&n>=o.y)return!0;const o=[new Vt(t,r),new Vt(t,n),new Vt(i,n),new Vt(i,r)];if(e.length>2)for(const t of o)if($u(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Ju(e[t],e[t+1],o))return!0;return!1}function Ju(e,t,r){const i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;const o=dr(e,t,r[0]);return o!==dr(e,t,r[1])||o!==dr(e,t,r[2])||o!==dr(e,t,r[3])}function eh(e,t,r,i,n,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((r.x-e.x)*s+(r.y-e.y)*a-o<0||(i.x-e.x)*s+(i.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0)}function th(e,t,r,i,n,o,s){return!(eh(e,t,i,n,o,s)||eh(t,r,i,n,o,s)||eh(r,e,i,n,o,s)||eh(i,n,e,t,r,s)||eh(n,o,e,t,r,s)||eh(o,i,e,t,r,s))}function rh(e,t,r){const i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function ih(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function nh(e,t,r,i,n){if(!t[0]&&!t[1])return e;const o=Vt.convert(t)._mult(n);"viewport"===r&&o._rotate(-i);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function oh(e,t,r,i){const n=Vt.convert(e)._mult(i);return"viewport"===t&&n._rotate(-r),n}fa(Nu,"CircleBucket",{omit:["layers"]});const sh=new Ka({"circle-sort-key":new Ya(tl.layout_circle["circle-sort-key"]),visibility:new Xa(tl.layout_circle.visibility)});var ah={paint:new Ka({"circle-radius":new Ya(tl.paint_circle["circle-radius"]),"circle-color":new Ya(tl.paint_circle["circle-color"]),"circle-blur":new Ya(tl.paint_circle["circle-blur"]),"circle-opacity":new Ya(tl.paint_circle["circle-opacity"]),"circle-translate":new Xa(tl.paint_circle["circle-translate"]),"circle-translate-anchor":new Xa(tl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xa(tl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xa(tl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ya(tl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ya(tl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ya(tl.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Xa(tl.paint_circle["circle-emissive-strength"])}),layout:sh};class lh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(t,r,i){const n=e.Q.dot(r,this.dir);if(Math.abs(n)<1e-6)return!1;const o=((t[0]-this.pos[0])*r[0]+(t[1]-this.pos[1])*r[1]+(t[2]-this.pos[2])*r[2])/n;return i[0]=this.pos[0]+this.dir[0]*o,i[1]=this.pos[1]+this.dir[1]*o,i[2]=this.pos[2]+this.dir[2]*o,!0}closestPointOnSphere(t,r,i){if(e.Q.equals(this.pos,t)||0===r)return i[0]=i[1]=i[2]=0,!1;const[n,o,s]=this.dir,a=this.pos[0]-t[0],l=this.pos[1]-t[1],c=this.pos[2]-t[2],u=n*n+o*o+s*s,h=2*(a*n+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-r*r);if(d<0){const e=Math.max(-h/2,0),t=a+n*e,u=l+o*e,d=c+s*e,p=Math.hypot(t,u,d);return i[0]=t*r/p,i[1]=u*r/p,i[2]=d*r/p,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return i[0]=a*r/e,i[1]=l*r/e,i[2]=c*r/e,!1}return i[0]=a+n*e,i[1]=l+o*e,i[2]=c+s*e,!0}}}class ch{constructor(e,t,r,i,n){this.TL=e,this.TR=t,this.BR=r,this.BL=i,this.horizon=n}static fromInvProjectionMatrix(t,r,i){const n=[-1,1,1],o=[1,1,1],s=[1,-1,1],a=[-1,-1,1],l=e.Q.transformMat4(n,n,t),c=e.Q.transformMat4(o,o,t),u=e.Q.transformMat4(s,s,t),h=e.Q.transformMat4(a,a,t);return new ch(l,c,u,h,r/i)}}function uh(t,r,i){let n=1/0,o=-1/0;const s=[];for(const a of t){e.Q.sub(s,a,r);const t=e.Q.dot(s,i);n=Math.min(n,t),o=Math.max(o,t)}return[n,o]}function hh(t,r){let i=!0;for(let n=0;n<t.planes.length;n++){const o=t.planes[n];let s=0;for(let t=0;t<r.length;t++)s+=e.Q.dot(o,r[t])+o[3]>=0;if(0===s)return 0;s!==r.length&&(i=!1)}return i?2:1}function dh(e,t){for(const r of e.projections){const i=uh(t,e.points[0],r.axis);if(r.projection[1]<i[0]||r.projection[0]>i[1])return 0}return 1}function ph(t,r){let i=0;const n=[0,0,0,0];for(let o=0;o<t.length;o++)n[0]=t[o][0],n[1]=t[o][1],n[2]=t[o][2],n[3]=1,e.aa.dot(n,r)>=0&&i++;return i}class fh{constructor(t,r){this.points=t||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=mh.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.Q.sub([],this.points[2],this.points[3]),e.Q.sub([],this.points[0],this.points[3]),e.Q.sub([],this.points[4],this.points[0]),e.Q.sub([],this.points[5],this.points[1]),e.Q.sub([],this.points[6],this.points[2]),e.Q.sub([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],r=[e[2],0,-e[0]];this.projections.push({axis:t,projection:uh(this.points,this.points[0],t)}),this.projections.push({axis:r,projection:uh(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(t,r,i,n){const o=Math.pow(2,i),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((i=>{const s=e.aa.transformMat4([],i,t),a=1/s[3]/r*o;return e.aa.mul(s,s,[a,a,n?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const r=e.Q.sub([],s[t[0]],s[t[1]]),i=e.Q.sub([],s[t[2]],s[t[1]]),n=e.Q.normalize([],e.Q.cross([],r,i)),o=-e.Q.dot(n,s[t[1]]);return n.concat(o)})),l=[];for(let e=0;e<s.length;e++)l.push([s[e][0],s[e][1],s[e][2]]);return new fh(l,a)}intersectsPrecise(t,r,i){for(let e=0;e<r.length;e++)if(!ph(t,r[e]))return 0;for(let e=0;e<this.planes.length;e++)if(!ph(t,this.planes[e]))return 0;for(const r of i)for(const i of this.frustumEdges){const n=e.Q.cross([],r,i),o=e.Q.length(n);if(0===o)continue;e.Q.scale(n,n,1/o);const s=uh(this.points,this.points[0],n),a=uh(t,this.points[0],n);if(s[0]>a[1]||a[0]>s[1])return 0}return 1}}class mh{static fromPoints(t){const r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of t)e.Q.min(r,r,n),e.Q.max(i,i,n);return new mh(r,i)}static fromTileIdAndHeight(e,t,r){const i=1<<e.canonical.z,n=e.canonical.x,o=e.canonical.y;return new mh([n/i,o/i,t],[(n+1)/i,(o+1)/i,r])}static applyTransform(t,r){const i=t.getCorners();for(let t=0;t<i.length;++t)e.Q.transformMat4(i[t],i[t],r);return mh.fromPoints(i)}static projectAabbCorners(t,r){const i=t.getCorners();for(let t=0;t<i.length;++t)e.Q.transformMat4(i[t],i[t],r);return i}constructor(t,r){this.min=t,this.max=r,this.center=e.Q.scale([],e.Q.add([],this.min,this.max),.5)}quadrant(t){const r=[t%2==0,t<2],i=e.Q.clone(this.min),n=e.Q.clone(this.max);for(let e=0;e<r.length;e++)i[e]=r[e]?this.min[e]:this.center[e],n[e]=r[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new mh(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?hh(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?hh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?dh(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?dh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}fa(mh,"Aabb");const gh=wl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ah}=gh,_h=wl([{name:"a_pos_3",components:3,type:"Int16"}]);var yh=wl([{name:"a_pos",type:"Int16",components:2}]);function xh(e){return e*qc/nu}const vh=[new mh([eu,eu,eu],[tu,tu,tu]),new mh([eu,eu,eu],[0,0,tu]),new mh([0,eu,eu],[tu,0,tu]),new mh([eu,0,eu],[0,tu,tu]),new mh([0,0,eu],[tu,tu,tu])];function bh(t,r,i,n=!0){const o=e.Q.scale([],t._camera.position,t.worldSize),s=[r,i,1,1];e.aa.transformMat4(s,s,t.pixelMatrixInverse),e.aa.scale(s,s,1/s[3]);const a=e.Q.sub([],s,o),l=e.Q.normalize([],a),c=t.globeMatrix,u=[c[12],c[13],c[14]],h=e.Q.sub([],u,o),d=e.Q.length(h),p=e.Q.normalize([],h),f=t.worldSize/(2*Math.PI),m=e.Q.dot(p,l),g=Math.asin(f/d);if(g<Math.acos(m)){if(!n)return null;const t=[],r=[];e.Q.scale(t,l,d/m),e.Q.normalize(r,e.Q.sub(r,t,h)),e.Q.normalize(l,e.Q.add(l,h,e.Q.scale(l,r,Math.tan(g)*d)))}const A=[];new lh(o,l).closestPointOnSphere(u,f,A);const _=e.Q.normalize([],Tr(c,0)),y=e.Q.normalize([],Tr(c,1)),x=e.Q.normalize([],Tr(c,2)),v=e.Q.dot(_,A),b=e.Q.dot(y,A),w=e.Q.dot(x,A),C=Gt(Math.asin(-b/f));let T=Gt(Math.atan2(v,w));T=t.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(t.center.lng,T);const E=_u(T),M=Xt(yu(C),0,1);return new Iu(E,M)}class wh{constructor(t,r,i){this.a=e.Q.sub([],t,i),this.b=e.Q.sub([],r,i),this.center=i;const n=e.Q.normalize([],this.a),o=e.Q.normalize([],this.b);this.angle=Math.acos(e.Q.dot(n,o))}}function Ch(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,i){const n=Math.sin(r);return e*(Math.sin((1-i)*r)/n)+t*(Math.sin(i*r)/n)}(e.a[t],e.b[t],e.angle,Xt(r,0,1))+e.center[t]}function Th(e){if(e.z<=1)return vh[e.z+2*e.y+e.x];const t=Ph(Ih(e));return mh.fromPoints(t)}function Eh(t,r,i){return e.Q.scale(t,t,1-i),e.Q.scaleAndAdd(t,t,r,i)}function Mh(t,r,i){for(const n of t)e.Q.transformMat4(n,n,r),e.Q.scale(n,n,i)}function Sh(t,r,i,n){const o=r/t.worldSize,s=t.globeMatrix;if(i.z<=1){const e=Th(i).getCorners();return Mh(e,s,o),mh.fromPoints(e)}const a=Ih(i,n),l=Ph(a,qc+xh(t._tileCoverLift));Mh(l,s,o);const c=Number.MAX_VALUE,u=[-c,-c,-c],h=[c,c,c];if(a.contains(t.center)){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);u[2]=0;const r=t.point,i=[r.x*o,r.y*o,0];return e.Q.min(h,h,i),e.Q.max(u,u,i),new mh(h,u)}if(t._tileCoverLift>0){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return new mh(h,u)}const d=[s[12]*o,s[13]*o,s[14]*o],p=a.getCenter(),f=Xt(t.center.lat,-Cu,Cu),m=Xt(p.lat,-Cu,Cu),g=_u(t.center.lng),A=yu(f);let _=g-_u(p.lng);const y=A-yu(m);_>.5?_-=1:_<-.5&&(_+=1);let x=0;if(Math.abs(_)>Math.abs(y))x=_>=0?1:3;else{x=y>=0?0:2;const t=[s[4]*o,s[5]*o,s[6]*o],r=-Math.sin(Ht(y>=0?a.getSouth():a.getNorth()))*qc;e.Q.scaleAndAdd(d,d,t,r)}const v=l[x],b=l[(x+1)%4],w=new wh(v,b,d),C=[Ch(w,0)||v[0],Ch(w,1)||v[1],Ch(w,2)||v[2]],T=jh(t.zoom);if(T>0){const n=function({x:e,y:t,z:r},i,n,o,s){const a=1/(1<<r);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const p=(l+c)/2-o;return p>.5?d=-1:p<-.5&&(d=1),l=((l+d)*i-(o*=i))*n+o,c=((c+d)*i-o)*n+o,u=(u*i-(s*=i))*n+s,h=(h*i-s)*n+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(i,r,t._pixelsPerMercatorPixel,g,A);for(let e=0;e<l.length;e++)Eh(l[e],n[e],T);const o=e.Q.add([],n[x],n[(x+1)%4]);e.Q.scale(o,o,.5),Eh(C,o,T)}for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return h[2]=Math.min(v[2],b[2]),e.Q.min(h,h,C),e.Q.max(u,u,C),new mh(h,u)}function Ih({x:e,y:t,z:r},i=!1){const n=1/(1<<r),o=new su(vu(e*n),t===(1<<r)-1&&i?-90:bu((t+1)*n)),s=new su(vu((e+1)*n),0===t&&i?90:bu(t*n));return new au(o,s)}function Ph(e,t=qc){const r=Ht(e.getNorth()),i=Ht(e.getSouth()),n=Math.cos(r),o=Math.cos(i),s=Math.sin(r),a=Math.sin(i),l=e.getWest(),c=e.getEast();return[ru(o,a,l,t),ru(o,a,c,t),ru(n,s,c,t),ru(n,s,l,t)]}function Dh(e,t,r,i){const n=1<<r.z,o=(e/no+r.x)/n;return iu(bu((t/no+r.y)/n),vu(o),i)}function kh({min:e,max:t}){return $c/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Lh=new Float64Array(16);function Oh(t){const r=kh(t),i=e.a9.fromScaling(Lh,[r,r,r]);return e.a9.translate(i,i,e.Q.negate([],t.min))}function zh(t){const r=e.a9.fromTranslation(Lh,t.min),i=1/kh(t);return e.a9.scale(r,r,[i,i,i])}function Bh(e){const t=no/(2*Math.PI);return e/(2*Math.PI)/t}function Rh(e,t){return no/(512*Math.pow(2,e))*kh(Th(t))}function Fh(t,r,i,n,o){const s=Bh(i),a=[t,r,-i/(2*Math.PI)],l=e.a9.identity(new Float64Array(16));return e.a9.translate(l,l,a),e.a9.scale(l,l,[s,s,s]),e.a9.rotateX(l,l,Ht(-o)),e.a9.rotateY(l,l,Ht(-n)),l}function jh(e){return Yt(Xc,Yc,e)}function Vh(t,r){const i=iu(r.lat,r.lng),n=function(t){const r=iu(t._center.lat,t._center.lng),i=e.Q.fromValues(0,1,0);let n=e.Q.cross([],i,r);const o=e.a9.fromRotation([],-t.angle,r);n=e.Q.transformMat4(n,n,o),e.a9.fromRotation(o,-t._pitch,n);const s=e.Q.normalize([],r);return e.Q.scale(s,s,xh(t.cameraToCenterDistance/t.pixelsPerMeter)),e.Q.transformMat4(s,s,o),e.Q.add([],r,s)}(t),o=e.Q.subtract([],n,i);return e.Q.angle(o,i)}function Nh(e,t){return Vh(e,t)>Math.PI/2*1.01}const Uh=Ht(85),Hh=Math.cos(Uh),Gh=Math.sin(Uh),Zh=e.a9.create(),Wh=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Qh(t,r,i,n,o,s,a,l,c){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(c*=t.pixelToTileUnitsFactor);const u=t.tileID.canonical,h=i.projection.upVectorScale(u,i.center.lat,i.worldSize).metersToTile;for(const d of r)for(const r of d){const d=r.add(l),p=o&&i.elevation?i.elevation.exaggeration()*o.getElevationAt(d.x,d.y,!0):0,f=i.projection.projectTilePoint(d.x,d.y,u);if(p>0){const e=i.projection.upVector(u,d.x,d.y);f.x+=e[0]*h*p,f.y+=e[1]*h*p,f.z+=e[2]*h*p}const m=s?d:qh(f.x,f.y,f.z,n),g=s?t.tilespaceRays.map((e=>$h(e,p))):t.queryGeometry.screenGeometry,A=e.aa.transformMat4([],[f.x,f.y,f.z,1],n);if(!a&&s?c*=A[3]/i.cameraToCenterDistance:a&&!s&&(c*=i.cameraToCenterDistance/A[3]),s){const e=bu((r.y/no+u.y)/(1<<u.z));c/=i.projection.pixelsPerMeter(e,1)/xu(1,e)}if(Hu(g,m,c))return!0}return!1}function qh(t,r,i,n){const o=e.aa.transformMat4([],[t,r,i,1],n);return new Vt(o[0]/o[3],o[1]/o[3])}const Xh=e.Q.fromValues(0,0,0),Yh=e.Q.fromValues(0,0,1);function $h(t,r){const i=e.Q.create();return Xh[2]=r,t.intersectsPlane(Xh,Yh,i),new Vt(i[0],i[1])}class Kh extends Nu{}function Jh(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError("mismatched image size")}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function ed(e,t,r){const{width:i,height:n}=t;i===e.width&&n===e.height||(td(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,i),height:Math.min(e.height,n)},r),e.width=i,e.height=n,e.data=t.data)}function td(e,t,r,i,n,o,s){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,l=t.data,c=4===o&&s;for(let s=0;s<n.height;s++){const u=((r.y+s)*e.width+r.x)*o,h=((i.y+s)*t.width+i.x)*o;if(c)for(let e=0;e<n.width;e++){const t=u+e*o+3,r=h+e*o;l[r+0]=255,l[r+1]=255,l[r+2]=255,l[r+3]=a[t]}else for(let e=0;e<n.width*o;e++)l[h+e]=a[u+e]}return t}fa(Kh,"HeatmapBucket",{omit:["layers"]});class rd{constructor(e,t){Jh(this,e,1,t)}resize(e){ed(this,new rd(e),1)}clone(){return new rd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){td(e,t,r,i,n,1)}}class id{constructor(e,t){Jh(this,e,4,t)}resize(e){ed(this,new id(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new id({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n,o){td(e,t,r,i,n,4,o)}}class nd{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}fa(rd,"AlphaImage"),fa(id,"RGBAImage");const od=new Ka({visibility:new Xa(tl.layout_heatmap.visibility)});var sd={paint:new Ka({"heatmap-radius":new Ya(tl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ya(tl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xa(tl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $a(tl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xa(tl.paint_heatmap["heatmap-opacity"])}),layout:od};function ad(e){const t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new id({width:r,height:i}),o=(r,i,o)=>{t[e.evaluationKey]=o;const s=e.expression.evaluate(t);s&&(n.data[r+i+0]=Math.floor(255*s.r/s.a),n.data[r+i+1]=Math.floor(255*s.g/s.a),n.data[r+i+2]=Math.floor(255*s.b/s.a),n.data[r+i+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){const a=i/(r-1),{start:l,end:c}=e.clips[t];o(n,s,l*(1-a)+c*a)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return n}const ld=new Ka({visibility:new Xa(tl.layout_hillshade.visibility)});var cd={paint:new Ka({"hillshade-illumination-direction":new Xa(tl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Xa(tl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xa(tl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xa(tl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xa(tl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xa(tl.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Xa(tl.paint_hillshade["hillshade-emissive-strength"])}),layout:ld};const ud=wl([{name:"a_pos",components:2,type:"Int16"}],4),{members:hd}=ud;var dd={exports:{}};function pd(e,t,r){r=r||2;var i,n,o,s,a,l,c,u=t&&t.length,h=u?t[0]*r:e.length,d=fd(e,0,h,r,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,r,i){var n,o,s,a=[];for(n=0,o=t.length;n<o;n++)(s=fd(e,t[n]*i,n<o-1?t[n+1]*i:e.length,i,!1))===s.next&&(s.steiner=!0),a.push(Td(s));for(a.sort(vd),n=0;n<a.length;n++)r=bd(a[n],r);return r}(e,t,d,r)),e.length>80*r){i=o=e[0],n=s=e[1];for(var f=r;f<h;f+=r)(a=e[f])<i&&(i=a),(l=e[f+1])<n&&(n=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-i,s-n))?32767/c:0}return gd(d,p,r,i,n,c,0),p}function fd(e,t,r,i,n){var o,s;if(n===Fd(e,t,r,i)>0)for(o=t;o<r;o+=i)s=zd(o,e[o],e[o+1],s);else for(o=r-i;o>=t;o-=i)s=zd(o,e[o],e[o+1],s);return s&&Id(s,s.next)&&(Bd(s),s=s.next),s}function md(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!Id(i,i.next)&&0!==Sd(i.prev,i,i.next))i=i.next;else{if(Bd(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function gd(e,t,r,i,n,o,s){if(e){!s&&o&&function(e,t,r,i){var n=e;do{0===n.z&&(n.z=Cd(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,o,s,a,l,c=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,i=r,a=0,t=0;t<c&&(a++,i=i.nextZ);t++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,c*=2}while(s>1)}(n)}(e,i,n,o);for(var a,l,c=e;e.prev!==e.next;)if(a=e.prev,l=e.next,o?_d(e,i,n,o):Ad(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Bd(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?gd(e=yd(md(e),t,r),t,r,i,n,o,2):2===s&&xd(e,t,r,i,n,o):gd(md(e),t,r,i,n,o,1);break}}}function Ad(e){var t=e.prev,r=e,i=e.next;if(Sd(t,r,i)>=0)return!1;for(var n=t.x,o=r.x,s=i.x,a=t.y,l=r.y,c=i.y,u=n<o?n<s?n:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=n>o?n>s?n:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,f=i.next;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Ed(n,a,o,l,s,c,f.x,f.y)&&Sd(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _d(e,t,r,i){var n=e.prev,o=e,s=e.next;if(Sd(n,o,s)>=0)return!1;for(var a=n.x,l=o.x,c=s.x,u=n.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Cd(p,f,t,r,i),_=Cd(m,g,t,r,i),y=e.prevZ,x=e.nextZ;y&&y.z>=A&&x&&x.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==n&&y!==s&&Ed(a,u,l,h,c,d,y.x,y.y)&&Sd(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==s&&Ed(a,u,l,h,c,d,x.x,x.y)&&Sd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==n&&y!==s&&Ed(a,u,l,h,c,d,y.x,y.y)&&Sd(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==s&&Ed(a,u,l,h,c,d,x.x,x.y)&&Sd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function yd(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!Id(n,o)&&Pd(n,i,i.next,o)&&Ld(n,o)&&Ld(o,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),Bd(i),Bd(i.next),i=e=o),i=i.next}while(i!==e);return md(i)}function xd(e,t,r,i,n,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Md(s,a)){var l=Od(s,a);return s=md(s,s.next),l=md(l,l.next),gd(s,t,r,i,n,o,0),void gd(l,t,r,i,n,o,0)}a=a.next}s=s.next}while(s!==e)}function vd(e,t){return e.x-t.x}function bd(e,t){var r=function(e,t){var r,i=t,n=e.x,o=e.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s&&(s=a,r=i.x<i.next.x?i:i.next,a===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,d=1/0;i=r;do{n>=i.x&&i.x>=u&&n!==i.x&&Ed(o<h?n:s,o,u,h,o<h?s:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),Ld(i,e)&&(l<d||l===d&&(i.x>r.x||i.x===r.x&&wd(r,i)))&&(r=i,d=l)),i=i.next}while(i!==c);return r}(e,t);if(!r)return t;var i=Od(r,e);return md(i,i.next),md(r,r.next)}function wd(e,t){return Sd(e.prev,e,t.prev)<0&&Sd(t.next,e,e.next)<0}function Cd(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Td(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Ed(e,t,r,i,n,o,s,a){return(n-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function Md(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Pd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Ld(e,t)&&Ld(t,e)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}(e,t)&&(Sd(e.prev,e,t.prev)||Sd(e,t.prev,t))||Id(e,t)&&Sd(e.prev,e,e.next)>0&&Sd(t.prev,t,t.next)>0)}function Sd(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Id(e,t){return e.x===t.x&&e.y===t.y}function Pd(e,t,r,i){var n=kd(Sd(e,t,r)),o=kd(Sd(e,t,i)),s=kd(Sd(r,i,e)),a=kd(Sd(r,i,t));return n!==o&&s!==a||!(0!==n||!Dd(e,r,t))||!(0!==o||!Dd(e,i,t))||!(0!==s||!Dd(r,e,i))||!(0!==a||!Dd(r,t,i))}function Dd(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function kd(e){return e>0?1:e<0?-1:0}function Ld(e,t){return Sd(e.prev,e,e.next)<0?Sd(e,t,e.next)>=0&&Sd(e,e.prev,t)>=0:Sd(e,t,e.prev)<0||Sd(e,e.next,t)<0}function Od(e,t){var r=new Rd(e.i,e.x,e.y),i=new Rd(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function zd(e,t,r,i){var n=new Rd(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Bd(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 Rd(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fd(e,t,r,i){for(var n=0,o=t,s=r-i;o<r;o+=i)n+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return n}dd.exports=pd,dd.exports.default=pd,pd.deviation=function(e,t,r,i){var n=t&&t.length,o=Math.abs(Fd(e,0,n?t[0]*r:e.length,r));if(n)for(var s=0,a=t.length;s<a;s++)o-=Math.abs(Fd(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r));var l=0;for(s=0;s<i.length;s+=3){var c=i[s]*r,u=i[s+1]*r,h=i[s+2]*r;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},pd.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var s=0;s<t;s++)r.vertices.push(e[n][o][s]);n>0&&r.holes.push(i+=e[n-1].length)}return r};var jd=h(dd.exports);function Vd(e,t){const r=e.length;if(r<=1)return[e];const i=[];let n,o;for(let t=0;t<r;t++){const r=pr(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(n&&i.push(n),n=[e[t]]):n.push(e[t]))}if(n&&i.push(n),t>1)for(let e=0;e<i.length;e++)i[e].length<=t||(On(i[e],t,1,i[e].length-1,Nd),i[e]=i[e].slice(0,t));return i}function Nd(e,t){return t.area-e.area}function Ud(e,t,r){const i=r.patternDependencies;let n=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(n=!0);const o=t.constantOr(null);o&&(n=!0,i[o]=!0)}return n}function Hd(e,t,r,i,n){const o=n.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i},r,{},n.availableImages);e=e&&e.name?e.name:e,o[e]=!0,r.patterns[s.id]=e}}return r}class Gd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Tl,this.indexArray=new Hl,this.indexArray2=new Fl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.segments2=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,r,i){this.hasPattern=Ud("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Fu(s,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),u,r))continue;const h=n?n.evaluate(u,{},r,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Ru(s,r,i),patterns:{},sortKey:h};o.push(d)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of o){const{geometry:n,index:o,sourceLayerIndex:s}=i;if(this.hasPattern){const e=Hd("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,{},t.availableImages,t.brightness);t.featureIndex.insert(e[o].feature,n,o,s,this.index)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}addFeatures(e,t,r,i,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,i,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n,o=[],s){for(const e of Vd(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=r.vertexLength,n=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(n.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),n.push(t[0].x),n.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),n.push(t[e].x),n.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const s=jd(n,o);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(i+s[e],i+s[e+1],i+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,s)}}fa(Gd,"FillBucket",{omit:["layers","patternFeatures"]});const Zd=new Ka({"fill-sort-key":new Ya(tl.layout_fill["fill-sort-key"]),visibility:new Xa(tl.layout_fill.visibility)});var Wd={paint:new Ka({"fill-antialias":new Xa(tl.paint_fill["fill-antialias"]),"fill-opacity":new Ya(tl.paint_fill["fill-opacity"]),"fill-color":new Ya(tl.paint_fill["fill-color"]),"fill-outline-color":new Ya(tl.paint_fill["fill-outline-color"]),"fill-translate":new Xa(tl.paint_fill["fill-translate"]),"fill-translate-anchor":new Xa(tl.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ya(tl.paint_fill["fill-pattern"]),"fill-emissive-strength":new Xa(tl.paint_fill["fill-emissive-strength"])}),layout:Zd};const Qd=wl([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),qd=wl([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Xd=wl([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yd=wl([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),$d=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Kd}=Qd;var Jd={},ep=Ft,tp=rp;function rp(e,t,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n,e.readFields(ip,this,t)}function ip(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function np(e){for(var t,r,i=0,n=0,o=e.length,s=o-1;n<o;s=n++)i+=((r=e[s]).x-(t=e[n]).x)*(t.y+r.y);return i}rp.types=["Unknown","Point","LineString","Polygon"],rp.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,a=[];e.pos<r;){if(n<=0){var l=e.readVarint();i=7&l,n=l>>3}if(n--,1===i||2===i)o+=e.readSVarint(),s+=e.readSVarint(),1===i&&(t&&a.push(t),t=[]),t.push(new ep(o,s));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&a.push(t),a},rp.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;e.pos<t;){if(i<=0){var u=e.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<s&&(s=n),n>a&&(a=n),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,a,c]},rp.prototype.toGeoJSON=function(e,t,r){var i,n,o=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),c=rp.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],o=0;o<t;o++){var s=np(e[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(r&&n.push(r),r=[e[o]]):r.push(e[o]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)u(l[i][n])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var op=tp,sp=ap;function ap(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(lp,this,t),this.length=this._features.length}function lp(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(r))}ap.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 op(this._pbf,t,this.extent,this._keys,this._values)};var cp=sp;function up(e,t,r){if(3===e){var i=new cp(r,r.readVarint()+r.pos);i.length&&(t[i.name]=i)}}var hp=Jd.VectorTile=function(e,t){this.layers=e.readFields(up,{},t)},dp=Jd.VectorTileFeature=tp;function pp(e,t,r,i){const n=[],o=0===i?(e,t,r,i,n,o)=>{e.push(new Vt(o,r+(o-t)/(i-t)*(n-r)))}:(e,t,r,i,n,o)=>{e.push(new Vt(t+(o-r)/(n-r)*(i-t),o))};for(const s of e){const e=[];for(const n of s){if(n.length<=2)continue;const s=[];for(let e=0;e<n.length-1;e++){const a=n[e].x,l=n[e].y,c=n[e+1].x,u=n[e+1].y,h=0===i?a:l,d=0===i?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>r?d<r&&o(s,a,l,c,u,r):s.push(n[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>r&&h<=r&&o(s,a,l,c,u,r)}let a=n[n.length-1];const l=0===i?a.x:a.y;l>=t&&l<=r&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&n.push(e)}return n}function fp(e,t){return e.x-t.x||e.y-t.y}function mp(e,t){return 0===fp(e.min,t.min)&&0===fp(e.max,t.max)}function gp(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Ap(e,t,r){const i=1/no,n=1/(1<<r.canonical.z),o=(t.x*i+r.canonical.x)*n+r.wrap,s=(t.y*i+r.canonical.y)*n;return{min:new Vt((e.x*i+r.canonical.x)*n+r.wrap,(e.y*i+r.canonical.y)*n),max:new Vt(o,s)}}function _p(e,t,r){const i=1<<r.canonical.z,n=((t.x-r.wrap)*i-r.canonical.x)*no,o=(t.y*i-r.canonical.y)*no;return{min:new Vt(((e.x-r.wrap)*i-r.canonical.x)*no,(e.y*i-r.canonical.y)*no),max:new Vt(n,o)}}function yp(e,t,r,i,n,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=i;u<i+n;u+=3){const i=t[r[u+0]+o],n=t[r[u+1]+o],h=t[r[u+2]+o],d=Math.min(i.x,n.x,h.x),p=Math.max(i.x,n.x,h.x),f=Math.min(i.y,n.y,h.y),m=Math.max(i.y,n.y,h.y);c.length=0,e.grid.query(new Vt(d,f),new Vt(p,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(th(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],i,n,h,s))return!0}}return!1}function xp(e,t,r,i){if(!e||!r)return!1;let n=e.vertices;if(!t.canonical.equals(i.canonical)||t.wrap!==i.wrap){if(r.vertices.length<e.vertices.length)return xp(r,i,e,t);const o=t.canonical,s=i.canonical,a=Math.pow(2,s.z-o.z);n=e.vertices.map((e=>new Vt((e.x+o.x*no)*a-s.x*no,(e.y+o.y*no)*a-s.y*no)))}return yp(r,n,e.indices,0,e.indices.length,0,0)}Jd.VectorTileLayer=sp;class vp{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function bp(e,t,r,i){let n=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(i[s])<1e-15){if(r[s]<e[s]||r[s]>t[s])return null}else{const a=1/i[s];let l=(e[s]-r[s])*a,c=(t[s]-r[s])*a;if(l>c){const e=l;l=c,c=e}if(l>n&&(n=l),c<o&&(o=c),n>o)return null}return n}function wp(e,t,r,i,n,o,s,a,l,c,u){const h=i-e,d=n-t,p=o-r,f=s-e,m=a-t,g=l-r,A=u[1]*g-u[2]*m,_=u[2]*f-u[0]*g,y=u[0]*m-u[1]*f,x=h*A+d*_+p*y;if(Math.abs(x)<1e-15)return null;const v=1/x,b=c[0]-e,w=c[1]-t,C=c[2]-r,T=(b*A+w*_+C*y)*v;if(T<0||T>1)return null;const E=w*p-C*d,M=C*h-b*p,S=b*d-w*h,I=(u[0]*E+u[1]*M+u[2]*S)*v;return I<0||T+I>1?null:(f*E+m*M+g*S)*v}function Cp(e,t,r){return(e-t)/(r-t)}function Tp(e,t,r,i,n,o,s,a,l){const c=1<<r,u=o-i,h=s-n,d=(e+1)/c*u+i,p=(t+0)/c*h+n,f=(t+1)/c*h+n;a[0]=(e+0)/c*u+i,a[1]=p,l[0]=d,l[1]=f}class Ep{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let i=Math.ceil(Math.pow(2,t));const n=1/i,o=(e,t,r,i,n)=>{const o=i?1:0,s=(e+1)*r-o,a=t*r,l=(t+1)*r-o;n[0]=e*r,n[1]=a,n[2]=s,n[3]=l};let s=new vp(i);const a=[];for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),n,!1,a);const r=Sp(a[0],a[1],e),l=Sp(a[2],a[1],e),c=Sp(a[2],a[3],e),u=Sp(a[0],a[3],e);s.minimums.push(Math.min(r,l,c,u)),s.maximums.push(Math.max(r,l,c,u)),s.leaves.push(1)}for(r.push(s),i/=2;i>=1;i/=2){const e=r[r.length-1];s=new vp(i);for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),2,!0,a);const r=e.getElevation(a[0],a[1]),n=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),u=e.isLeaf(a[0],a[1]),h=e.isLeaf(a[2],a[1]),d=e.isLeaf(a[2],a[3]),p=e.isLeaf(a[0],a[3]),f=Math.min(r.min,n.min,l.min,c.min),m=Math.max(r.max,n.max,l.max,c.max),g=u&&h&&d&&p;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}r.push(s)}return r}(this.dem),r=t.length-1,i=t[r];this._addNode(i.minimums[0],i.maximums[0],i.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,i,n,o,s=1){return bp([e,t,-100],[r,i,this.maximums[0]*s],n,o)}raycast(t,r,i,n,o,s,a=1){if(!this.nodeCount)return null;const l=this.raycastRoot(t,r,i,n,o,s,a);if(null==l)return null;const c=[],u=[],h=[],d=[],p=[{idx:0,t:l,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:l,t:f,nodex:m,nodey:g,depth:A}=p.pop();if(this.leaves[l]){Tp(m,g,A,t,r,i,n,h,d);const l=1<<A,c=(m+0)/l,u=(m+1)/l,p=(g+0)/l,_=(g+1)/l,y=Sp(c,p,this.dem)*a,x=Sp(u,p,this.dem)*a,v=Sp(u,_,this.dem)*a,b=Sp(c,_,this.dem)*a,w=wp(h[0],h[1],y,d[0],h[1],x,d[0],d[1],v,o,s),C=wp(d[0],d[1],v,h[0],d[1],b,h[0],h[1],y,o,s),T=Math.min(null!==w?w:Number.MAX_VALUE,null!==C?C:Number.MAX_VALUE);if(T!==Number.MAX_VALUE)return T;{const t=e.Q.scaleAndAdd([],o,s,f);if(Mp(y,x,b,v,Cp(t[0],h[0],d[0]),Cp(t[1],h[1],d[1]))>=t[2])return f}continue}let _=0;for(let e=0;e<this._siblingOffset.length;e++){Tp((m<<1)+this._siblingOffset[e][0],(g<<1)+this._siblingOffset[e][1],A+1,t,r,i,n,h,d),h[2]=-100,d[2]=this.maximums[this.childOffsets[l]+e]*a;const p=bp(h,d,o,s);if(null!=p){const t=p;c[e]=t;let r=!1;for(let i=0;i<_&&!r;i++)t>=c[u[i]]&&(u.splice(i,0,e),r=!0);r||(u[_]=e),_++}}for(let e=0;e<_;e++){const t=u[e];p.push({idx:this.childOffsets[l]+t,t:c[t],nodex:(m<<1)+this._siblingOffset[t][0],nodey:(g<<1)+this._siblingOffset[t][1],depth:A+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,i,n){if(1===e[i].isLeaf(t,r))return;this.childOffsets[n]||(this.childOffsets[n]=this.nodeCount);const o=i-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const i=2*t+this._siblingOffset[e][0],n=2*r+this._siblingOffset[e][1],o=s.getElevation(i,n),c=s.isLeaf(i,n),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let i=0;i<this._siblingOffset.length;i++)a&1<<i||this._construct(e,2*t+this._siblingOffset[i][0],2*r+this._siblingOffset[i][1],o,l+i)}}function Mp(e,t,r,i,n,o){return Ui(Ui(e,r,o),Ui(t,i,o),n)}function Sp(e,t,r){const i=r.dim,n=Xt(e*i-.5,0,i-1),o=Xt(t*i-.5,0,i-1),s=Math.floor(n),a=Math.floor(o),l=Math.min(s+1,i-1),c=Math.min(a+1,i-1);return Mp(r.get(s,a),r.get(l,a),r.get(s,c),r.get(l,c),n-s,o-a)}const Ip={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Pp(e,t,r){return(256*e*256+256*t+r)/10-1e4}function Dp(e,t,r){return 256*e+t+r/256-32768}class kp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,i=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return hr(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const n=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=i,this._modifiedForSources={},!i){for(let e=0;e<n;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(n,e)]=o[this._idx(n-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,n)]=o[this._idx(e,n-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(n,-1)]=o[this._idx(n-1,0)],o[this._idx(-1,n)]=o[this._idx(0,n-1)],o[this._idx(n,n)]=o[this._idx(n-1,n-1)]}const s="terrarium"===r?Dp:Pp;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=Dr.now()}_buildQuadTree(){this._tree=new Ep(this)}get(e,t,r=!1){r&&(e=Xt(e,-1,this.dim),t=Xt(t,-1,this.dim));const i=this._idx(e,t);return this.floatView[i]}set(e,t,r){const i=this._idx(e,t),n=this.floatView[i];return this.floatView[i]=r,r-n}static getUnpackVector(e){return Ip[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],i=kp.getUnpackVector(t);let n=Math.floor((e+i[3])/i[2]);return r[2]=n%256,n=Math.floor(n/256),r[1]=n%256,n=Math.floor(n/256),r[0]=n,r}getPixels(){return new nd({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,o=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-r*this.dim;for(let t=o;t<s;t++)for(let r=i;r<n;r++){const i=4*this._idx(r,t),n=4*this._idx(r+a,t+l);this.pixels[i+0]=e.pixels[n+0],this.pixels[i+1]=e.pixels[n+1],this.pixels[i+2]=e.pixels[n+2],this.pixels[i+3]=e.pixels[n+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}fa(kp,"DEMData"),fa(Ep,"DemMinMaxQuadTree",{omit:["dem"]});class Lp{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const i=r||e.findDEMTileFor(t);if(!i||!i.dem)return;const n=i.dem,o=i.tileID,s=1<<t.canonical.z-o.canonical.z;return new Lp(i,n.dim/no/s,[(t.canonical.x/s-o.canonical.x)*n.dim,(t.canonical.y/s-o.canonical.y)*n.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1],i=Math.floor(e*this._scale+this._offset[0]),n=Math.floor(r);return new Vt(i,n)}getElevationAt(e,t,r,i){const n=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(n),a=Math.floor(o),l=this._dem;return i=!!i,r?Ui(Ui(l.get(s,a,i),l.get(s,a+1,i),o-a),Ui(l.get(s+1,a,i),l.get(s+1,a+1,i),o-a),n-s):l.get(s,a,i)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*xu(1,e)*this._dem.stride}}const Op=dp.types,zp=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],Bp=["fill-extrusion-flood-light-ground-radius"],Rp=Math.pow(2,13),Fp=Math.pow(2,15)-1,jp=new Vt(0,1),Vp=2147483648;function Np(e,t,r,i,n,o,s,a){e.emplaceBack((t<<1)+s,(r<<1)+o,(Math.floor(i*Rp)<<1)+n,Math.round(a))}function Up(e,t,r,i,n,o){e.emplaceBack(t.x,t.y,(r.x<<1)+i,(r.y<<1)+n,o)}function Hp(e,t,r){const i=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*i,r[1]*i,r[2]*i)}class Gp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Zp{constructor(){this.centroidXY=new Vt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Vt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Vt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Vt(this.max.x-this.min.x,this.max.y-this.min.y)}}class Wp{constructor(){this.acc=new Vt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,r){this.accCount++,this.acc._add(t);let i=!!this.borders;t.x<e.min.x?(e.min.x=t.x,i=!0):t.x>e.max.x&&(e.max.x=t.x,i=!0),t.y<e.min.y?(e.min.y=t.y,i=!0):t.y>e.max.y&&(e.max.y=t.y,i=!0),((0===t.x||t.x===no)&&t.x===r.x)!=((0===t.y||t.y===no)&&t.y===r.y)&&this.processBorderOverlap(t,r),i&&this.checkBorderIntersection(t,r)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,Ui(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>no!=e.x>no&&this.addBorderIntersection(1,Ui(t.y,e.y,(no-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Ui(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>no!=e.y>no&&this.addBorderIntersection(3,Ui(t.x,e.x,(no-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){return 0===this.accCount?new Vt(0,0):new Vt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function Qp(e,t){const r=e.add(t)._unit(),i=Xt(e.x*r.x+e.y*r.y,-1,1);var n,o,s;return n=Math.acos(i),Math.min(4,Math.max(-4,Math.tan(n)))/4*Fp*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const qp=[e=>e.x<0,e=>e.x>no,e=>e.y<0,e=>e.y>no];function Xp(e,t,r,i){const n=[4];if(0===i)return n;r._mult(i);const o=e.sub(r),s=t.sub(r),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(qp[e](t)){n.push(e);break}return n}class Yp{constructor(e){this.vertexArray=new Sl,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>Bp.includes(e))),this._segments=new mc,this.hiddenByLandmarkVertexArray=new tc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new mc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,r,i=!1){const n=e.length;if(n>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*n,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],r=e[1];a=Qp(t.sub(e[n-1])._perp()._unit(),r.sub(t)._perp()._unit())}for(let l=0;l<n;l++){const c=l===n-1?0:l+1,u=e[l],h=e[c],d=e[c===n-1?0:c+1],p=h.sub(u)._perp()._unit(),f=Qp(p,d.sub(h)._perp()._unit()),m=a,g=f;if(tf(u,h,t)||i&&rf(u,t)&&rf(h,t)){a=f;continue}const A=s.vertexLength;Up(this.vertexArray,u,h,1,1,m),Up(this.vertexArray,u,h,1,0,m),Up(this.vertexArray,u,h,0,1,g),Up(this.vertexArray,u,h,0,0,g),s.vertexLength+=4;const _=Xp(u,h,p,r);for(const e of _)this._segmentToGroundQuads[o].push({id:A,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=f}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort(((e,t)=>e.region-t.region));for(let r=0;r<t;r++){const t=this._segmentToGroundQuads[r],i=e[r],n=this._segmentToRegionTriCounts[r];n.reduce(((e,t)=>e+t),0);let o=0;for(let e=0;e<=4;e++){const t=n[e];if(0!==t){let r=this.regionSegments[e];r||(r=this.regionSegments[e]=new mc);const n={vertexOffset:i.vertexOffset,primitiveOffset:i.primitiveOffset+o,vertexLength:i.vertexLength,primitiveLength:t};r.get().push(n)}o+=t}for(let e=0;e<t.length;e++){const r=t[e].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,r,i,n,o){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,r,i,n,o)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,qd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,r,i,n,o){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,r,i,n,o)}updateHiddenByLandmark(e){if(!this.hasData())return;const t=e.groundVertexCount+e.groundVertexArrayOffset;if(0===e.groundVertexCount)return;const r=e.flags&Vp?1:0;for(let i=e.groundVertexArrayOffset;i<t;++i)this.hiddenByLandmarkVertexArray.emplace(i,r);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Yd.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class $p{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Hl,this.footprintVertices=new Tl,this.footprintSegments=[],this.layoutVertexArray=new Ml,this.centroidVertexArray=new dc,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>zp.includes(e))),this.segments=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new Yp(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(e,t,r,i){this.features=[],this.hasPattern=Ud("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=Su(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:n,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Fu(n,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),l,r))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Ru(n,r,i),properties:n.properties,type:n.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Hd("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,s,r,{},t.availableImages,i,t.brightness),t.featureIndex.insert(n,c.geometry,s,a,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,r,i,n,o){for(const e of this.features){const{geometry:s}=e;this.addFeature(e,s,e.index,t,r,i,n,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,r,i,n){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,s,r,i,n),this.groundEffect.update(e,t,s,r,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,$d.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Xd.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n,o,s,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new Vt(0,0),new Vt(no,no)],u=s.projection,h="globe"===u.name,d="Polygon"===Op[e.type],p=new Wp;p.centroidDataIndex=this.centroidData.length;const f=new Zp,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},i)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},i);f.height=g,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Ol);const A=Vd(t,500);for(let e=A.length-1;e>=0;e--){const t=A[e];(0===t.length||(_=t[0]).every((e=>e.x<=0))||_.every((e=>e.x>=no))||_.every((e=>e.y<=0))||_.every((e=>e.y>=no)))&&A.splice(e,1)}var _;let y;if(h)y=af(A,c,i);else{y=[];for(const e of A)y.push({polygon:e,bounds:c})}const x=d?this.edgeRadius:0,v=x>0&&this.zoom<17,b=(e,t)=>{if(0===e.length)return!1;const r=e[e.length-1];return t.x===r.x&&t.y===r.y};for(const{polygon:e,bounds:t}of y){let r=0,n=0;for(const t of e)d&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=d?t.length-1:t.length;const o=this.segments.prepareSegment((d?5:4)*n,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Gp;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const n=[],s=[];r=o.vertexLength;for(let r=0;r<e.length;r++){const c=e[r];c.length&&0!==r&&s.push(n.length/2);const d=[];let p,f;p=c[1].sub(c[0])._perp()._unit(),a.ringIndices.push(c.length-1);for(let e=1;e<c.length;e++){const t=c[e],r=c[e===c.length-1?1:e+1],s=t.clone();if(x){f=r.sub(t)._perp()._unit();const e=p.add(f)._unit(),i=x*Math.min(4,1/(p.x*e.x+p.y*e.y));s.x+=i*e.x,s.y+=i*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),p=f}!m||0!==x&&!v||b(d,s)||d.push(s),Np(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),h&&Hp(this.layoutVertexExtArray,u.projectTilePoint(s.x,s.y,i),u.upVector(i,s.x,s.y))}m&&(0===x||v)&&(0!==d.length&&b(d,d[0])&&d.pop(),this.groundEffect.addData(d,t,l))}const c=jd(n,s);for(let e=0;e<c.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+c[e+0],a.vertexOffset+c[e+1],a.vertexOffset+c[e+2]),this.indexArray.emplaceBack(r+c[e],r+c[e+2],r+c[e+1]),o.primitiveLength++;a.indexCount+=c.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let n=0;n<e.length;n++){const s=e[n];p.startRing(f,s[0]);let a=s.length>4&&nf(s[s.length-2],s[0],s[1]),c=x?Jp(s[s.length-2],s[0],s[1],x):0;const g=[];let A,_,y;_=s[1].sub(s[0])._perp()._unit();let v=!0;for(let e=1,n=0;e<s.length;e++){let l=s[e-1],d=s[e];const w=s[e===s.length-1?1:e+1];if(p.appendEdge(f,d,l),tf(d,l,t)){x&&(_=w.sub(d)._perp()._unit(),v=!v);continue}const C=d.sub(l)._perp(),T=C.x/(Math.abs(C.x)+Math.abs(C.y)),E=C.y>0?1:0,M=l.dist(d);if(n+M>32768&&(n=0),x){y=w.sub(d)._perp()._unit();let e=ef(l,d,w,Kp(_,y),x);isNaN(e)&&(e=0);const t=d.sub(l)._unit();l=l.add(t.mult(c))._round(),d=d.add(t.mult(-e))._round(),c=e,_=y,m&&this.zoom>=17&&(b(g,l)||g.push(l),b(g,d)||g.push(d))}const S=o.vertexLength,I=s.length>4&&nf(l,d,w);let P=of(n,a,v);if(Np(this.layoutVertexArray,l.x,l.y,T,E,0,0,P),Np(this.layoutVertexArray,l.x,l.y,T,E,0,1,P),n+=M,P=of(n,I,!v),a=I,Np(this.layoutVertexArray,d.x,d.y,T,E,0,0,P),Np(this.layoutVertexArray,d.x,d.y,T,E,0,1,P),o.vertexLength+=4,this.indexArray.emplaceBack(S+0,S+1,S+2),this.indexArray.emplaceBack(S+1,S+3,S+2),o.primitiveLength+=2,x){const i=r+(1===e?s.length-2:e-2),n=1===e?r:i+1;if(this.indexArray.emplaceBack(S+1,i,S+3),this.indexArray.emplaceBack(i,n,S+3),o.primitiveLength+=2,void 0===A&&(A=S),!tf(w,s[e],t)){const t=e===s.length-1?A:o.vertexLength;this.indexArray.emplaceBack(S+2,S+3,t),this.indexArray.emplaceBack(S+3,t+1,t),this.indexArray.emplaceBack(S+3,n,t+1),o.primitiveLength+=3}v=!v}if(h){const e=this.layoutVertexExtArray,t=u.projectTilePoint(l.x,l.y,i),r=u.projectTilePoint(d.x,d.y,i),n=u.upVector(i,l.x,l.y),o=u.upVector(i,d.x,d.y);Hp(e,t,n),Hp(e,t,n),Hp(e,r,o),Hp(e,r,o)}}d&&(r+=s.length-1),m&&x&&this.zoom>=17&&(0!==g.length&&b(g,g[0])&&g.pop(),this.groundEffect.addData(g,t,l,x>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?jp:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,a),this.groundEffect.addPaintPropertiesData(e,r,n,o,i,a),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const r=this.centroidData[t],i=+(r.min.y+r.max.y>no),n=2*i+(+(r.min.x+r.max.x>no)^i);for(let i=0;i<r.polygonSegLen;i++){const o=r.polygonSegIdx+i;e.push({centroidIdx:t,subtile:n,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new Hl;e.sort(((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let r=0,i=0,n=0;for(const t of e){if(t.triangleSegmentIdx!==r)break;n++}const o=e.length;for(;i!==e.length;){r=e[i].triangleSegmentIdx;let s=0,a=i,l=i;for(let t=a;t<n&&e[t].subtile===s;t++)l++;for(;a!==n;){const i=e[a];s=i.subtile;const o=this.centroidData[i.centroidIdx].min.clone(),c=this.centroidData[i.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=a;r<l;r++){const i=e[r],n=this.polygonSegments[i.polygonSegmentIdx],s=this.centroidData[i.centroidIdx].min,a=this.centroidData[i.centroidIdx].max,l=this.indexArray.uint16;for(let e=n.triangleArrayOffset;e<n.triangleArrayOffset+n.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=n.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<n&&e[t].subtile===e[a].subtile;t++)l++}i=n;for(let t=i;t<o&&e[t].triangleSegmentIdx===e[i].triangleSegmentIdx;t++)n++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,r){let i=0,n=0;const o=1<<e.canonical.z;if(t){const r=t.getMinMaxForTile(e);r&&(i=r.min,n=r.max)}n+=this.maxHeight;const s=e.toUnwrapped();let a;const l=[s.canonical.x/o+s.wrap,s.canonical.y/o],c=[(s.canonical.x+1)/o+s.wrap,(s.canonical.y+1)/o],u=new mc,h=(e,t,r)=>[e[0]*(1-r[0])+t[0]*r[0],e[1]*(1-r[1])+t[1]*r[1]],d=[],p=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/no,d[1]=e.min.y/no,p[0]=e.max.x/no,p[1]=e.max.y/no;const t=h(l,c,d),o=h(l,c,p);if(0===new mh([t[0],t[1],i],[o[0],o[1],n]).intersectsPrecise(r)){a&&(u.segments.push(a),a=void 0);continue}const s=e.segment;a&&a.vertexOffset!==s.vertexOffset&&(u.segments.push(a),a=void 0),a?(a.vertexLength+=s.vertexLength,a.primitiveLength+=s.primitiveLength):a={vertexOffset:s.vertexOffset,primitiveLength:s.primitiveLength,vertexLength:s.vertexLength,primitiveOffset:s.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&u.segments.push(a),u}encodeCentroid(e,t){const r=e.centroid(),i=t.span(),n=Math.min(7,Math.round(i.x*this.tileToMeter/10)),o=Math.min(7,Math.round(i.y*this.tileToMeter/10));return new Vt(Xt(r.x,1,no-1)<<3|n,Xt(r.y,1,no-1)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Vt(0,0);const t=e.borders,r=Number.MAX_VALUE;if(t[0][0]!==r||t[1][0]!==r){const e=t[0][0]!==r?0:1;return new Vt(6|(t[0][0]!==r?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==r?2:3;return new Vt((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==r?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=Vp,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,r=e.vertexCount+e.vertexArrayOffset,i=e.flags&Vp?jp:e.centroidXY,n=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==i.y||n!==i.x){for(let e=t;e<r;++e)this.centroidVertexArray.emplace(e,i.x,i.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped());if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].sourceId!==t[r].sourceId||!mp(e[r],t[r]))return!1;return!0}(this.activeReplacements,r))return;if(this.activeReplacements=r,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const i=[];for(const t of this.activeReplacements){const r=Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z);for(const n of this.centroidData)if(!(n.flags&Vp||t.min.x>n.max.x||n.min.x>t.max.x||t.min.y>n.max.y||n.min.y>t.max.y))for(let o=0;o<n.footprintSegLen;o++){const s=this.footprintSegments[n.footprintSegIdx+o];if(i.length=0,lf(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,i),yp(t.footprint,i,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-r)){n.flags|=Vp;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,r){let i=!1;for(let n=0;n<r.footprintSegLen;n++){const o=this.footprintSegments[r.footprintSegIdx+n];let s=0;for(const r of o.ringIndices){for(let n=s,a=r+s-1;n<r+s;a=n++){const r=this.footprintVertices.int16[2*(n+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(n+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-r)*(t-s)/(l-s)+r&&(i=!i)}s=r}}return i}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,i=!0;const n=4*(e+no)*no+(t+no);if(this.partLookup.hasOwnProperty(n)){const e=this.partLookup[n];return e?{height:e.height,hidden:!!(e.flags&Vp)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>r&&(r=o.height,this.partLookup[n]=o,i=!!(o.flags&Vp));if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:i};this.partLookup[n]=void 0}}function Kp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function Jp(e,t,r,i){const n=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return ef(e,t,r,Kp(n,o),i)}function ef(e,t,r,i,n){const o=Math.sqrt(1-i*i);return Math.min(e.dist(t)/3,t.dist(r)/3,n*o/i)}function tf(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function rf(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function nf(e,t,r){if(e.x<0||e.x>=no||t.x<0||t.x>=no||r.x<0||r.x>=no)return!1;const i=r.sub(t),n=i.perp(),o=e.sub(t);return(i.x*o.x+i.y*o.y)/Math.sqrt((i.x*i.x+i.y*i.y)*(o.x*o.x+o.y*o.y))>-.866&&n.x*o.x+n.y*o.y<0}function of(e,t,r){const i=t?2|e:-3&e;return r?1|i:-2&i}function sf(){const e=Math.PI/32,t=Math.tan(e),r=nu;return r*Math.sqrt(1+2*t*t)-r}function af(e,t,r){const i=1<<r.z,n=vu(r.x/i),o=vu((r.x+1)/i),s=bu(r.y/i),a=bu((r.y+1)/i);return function(e,t,r,i,n=0,o){const s=[];if(!e.length||!r||!i)return s;const a=(e,t)=>{for(const r of e)s.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(i)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=pp(d,t[0].y-n,t[1].y+n,1),d=pp(d,t[0].x-n,t[1].x+n,0),!d.length)return s;const p=[];for(h.length?p.push({polygons:d,bounds:t,depth:0}):a(d,t);p.length;){const e=p.pop(),t=e.depth,r=h[t],i=e.bounds[0],s=e.bounds[1],l=0===r?i.x:i.y,c=0===r?s.x:s.y,u=o?o(r,l,c):.5*(l+c),d=pp(e.polygons,l-n,u+n,r),f=pp(e.polygons,u-n,c+n,r);if(d.length){const e=[i,new Vt(0===r?u:s.x,1===r?u:s.y)];h.length>t+1?p.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(f.length){const e=[new Vt(0===r?u:i.x,1===r?u:i.y),s];h.length>t+1?p.push({polygons:f,bounds:e,depth:t+1}):a(f,e)}}return s}(e,t,Math.ceil((o-n)/11.25),Math.ceil((s-a)/11.25),1,((e,t,n)=>{if(0===e)return.5*(t+n);{const e=bu((r.y+t/no)/i);return(yu(.5*(bu((r.y+n/no)/i)+e))*i-r.y)*no}}))}function lf(e,t,r,i,n,o){const s=Math.pow(2,i.z-n.z);for(let a=0;a<r;a++){let r=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];r=(r+n.x*no)*s-i.x*no,l=(l+n.y*no)*s-i.y*no,o.push(new Vt(r,l))}}fa($p,"FillExtrusionBucket",{omit:["layers","features"]}),fa(Zp,"PartData"),fa(Gp,"FootprintSegment"),fa(Wp,"BorderCentroidData"),fa(Yp,"GroundEffect");const cf=new Ka({visibility:new Xa(tl["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Xa(tl["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uf={paint:new Ka({"fill-extrusion-opacity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:cf};class hf extends Vt{constructor(e,t,r){super(e,t),this.z=r}}function df(e,t){return e.x*t.x+e.y*t.y}function pf(e,t){if(1===e.length){let r=0;const i=t[r++];let n;for(;!n||i.equals(n);)if(n=t[r++],!n)return 1/0;for(;r<t.length;r++){const o=t[r],s=e[0],a=n.sub(i),l=o.sub(i),c=s.sub(i),u=df(a,a),h=df(a,l),d=df(l,l),p=df(c,a),f=df(c,l),m=u*d-h*h,g=(d*p-h*f)/m,A=(u*f-h*p)/m,_=i.z*(1-g-A)+n.z*g+o.z*A;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function ff(e,t,r,i,n,o,s,a){const l=s*n.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,r){const i=Math.floor(t[0]/8),n=Math.floor(t[1]/8),o=10*(t[0]-8*i),s=10*(t[1]-8*n),a=e.getElevationAt(i,n,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(i,n),d=2*c+1,p=2*u+1,f=function(e,t,r,i,n){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+n,r,!0),e.getElevationAtPixel(t,r+n,!0),e.getElevationAtPixel(t+i,r+n,!0)]}(e,h.x-c,h.y-u,d,p),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),A=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),_=Math.min(.25,.5*l*(m+g)/d),y=Math.min(.25,.5*l*A/p);return a+Math.max(_*o,y*s)}(n,o,a):l;return{base:l+(0===r)?-1:r,top:c?Math.max(u+i,l+r+2):l+i}}const mf=wl([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:gf}=mf,Af=wl([{name:"a_packed",components:4,type:"Float32"}]),{members:_f}=Af,yf=wl([{name:"a_pattern_data",components:2,type:"Float32"}]),{members:xf}=yf;class vf{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new rd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=ir(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const i=[];let n=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,s=!0;i.push({left:n,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];n=a*r,a+=l,o=a*r,i.push({left:n,right:o,isDash:s,zeroLength:0===l})}return i}addRoundDash(e,t,r){const i=t/2;for(let t=-r;t<=r;t++){const n=this.width*(this.nextRow+r+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/r*(i+1);if(s.isDash){const e=i-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=i-Math.sqrt(u*u+d*d);this.image.data[n+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}const r=e[0],i=e[e.length-1];r.isDash===i.isDash&&(r.left=i.left-this.width,i.right=r.right+this.width);const n=this.width*this.nextRow;let o=0,s=e[o];for(let r=0;r<this.width;r++){r/s.right>1&&(s=e[++o]);const i=Math.abs(r-s.left),a=Math.abs(r-s.right),l=Math.min(i,a);this.image.data[n+r]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const i="round"===t,n=i?7:0,o=2*n+1;if(this.nextRow+o>this.height)return hr("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(hr("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const r=this.width/s,o=this.getDashRanges(e,this.width,r);i?this.addRoundDash(o,r,n):this.addRegularDash(o,"square"===t?.5*r:0)}const a=this.nextRow+n;this.nextRow+=o;const l={tl:[a,n],br:[s,0]};return this.positions[r]=l,l}}fa(vf,"LineAtlas");const bf=dp.types,wf=Math.cos(Math.PI/180*37.5),Cf=Math.cos(Math.PI/180*5);class Tf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Il,this.layoutVertexArray2=new Pl,this.patternVertexArray=new Dl,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,i){this.hasPattern=Ud("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),c,r))continue;const u=n?n.evaluate(c,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,i),patterns:{},sortKey:u};o.push(h)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:s,featureIndex:a}=t,l=this.addConstantDashes(s);for(const i of o){const{geometry:n,index:o,sourceLayerIndex:c}=i;if(l&&this.addFeatureDashes(i,s),this.hasPattern){const e=Hd("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,s.positions,t.availableImages,t.brightness);a.insert(e[o].feature,n,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const i=r.paint.get("line-dasharray").value,n=r.layout.get("line-cap").value;if("constant"!==i.kind||"constant"!==n.kind)t=!0;else{const t=n.value,r=i.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,o=i.layout.get("line-cap").value;if("constant"===n.kind&&"constant"===o.kind)continue;let s,a;if("constant"===n.kind){if(s=n.value,!s)continue}else s=n.evaluate({zoom:r},e);a="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(s,a),e.patterns[i.id]=t.getKey(s,a)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}addFeatures(e,t,r,i,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,i,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,_f)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,xf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,i,n,o,s){const a=this.layers[0].layout,l=a.get("line-join").evaluate(e,{}),c=a.get("line-cap").evaluate(e,{}),u=a.get("line-miter-limit"),h=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,l,c,u,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,s)}addLine(e,t,r,i,n,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0;const s="none"===r;if(this.patternJoinNone=this.hasPattern&&s,this.segmentStart=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===bf[t.type];let l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(a?3:2))return;"bevel"===r&&(n=1.05);const u=this.overscaling<=16?15*no/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);let d,p,f,m,g;this.e1=this.e2=-1,a&&(d=e[l-2],g=e[c].sub(d)._unit()._perp());for(let t=c;t<l;t++){if(f=t===l-1?a?e[c+1]:void 0:e[t+1],f&&e[t].equals(f))continue;g&&(m=g),d&&(p=d),d=e[t],g=f?f.sub(d)._unit()._perp():m,m=m||g;const A=p&&f;let _=A?r:a||s?"butt":i;const y=m.x*g.x+m.y*g.y;if(s){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,r=e.lineSoFar-e.segmentStart;for(let i=0;i<t;++i){const t=e.segmentPoints[2*i+1],n=Math.round(e.segmentPoints[2*i])+.5+.25*t;e.patternVertexArray.emplaceBack(n,r),e.patternVertexArray.emplaceBack(n,r)}e.segmentPoints=[],e.segmentStart=e.lineSoFar}e.e1=e.e2=-1};if(A&&y<Cf){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this),this.addCurrentVertex(d,g,-1,-1,h);continue}if(p){if(!f){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this);continue}_="miter"}}let x=m.add(g);0===x.x&&0===x.y||x._unit();const v=x.x*g.x+x.y*g.y,b=0!==v?1/v:1/0,w=2*Math.sqrt(2-2*v),C=v<wf&&p&&f,T=m.x*g.y-m.y*g.x>0;if(C&&t>c){const e=d.dist(p);if(e>2*u){const t=d.sub(d.sub(p)._mult(u/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,m,0,0,h),p=t}}if(A&&"round"===_&&(b<o?_="miter":b<=2&&(_="fakeround")),"miter"===_&&b>n&&(_="bevel"),"bevel"===_&&(b>2&&(_="flipbevel"),b<n&&(_="miter")),p&&this.updateDistance(p,d),"miter"===_)x._mult(b),this.addCurrentVertex(d,x,0,0,h);else if("flipbevel"===_){if(b>100)x=g.mult(-1);else{const e=b*m.add(g).mag()/m.sub(g).mag();x._perp()._mult(e*(T?-1:1))}this.addCurrentVertex(d,x,0,0,h),this.addCurrentVertex(d,x.mult(-1),0,0,h)}else if("bevel"===_||"fakeround"===_){const e=-Math.sqrt(b*b-1),t=T?e:0,r=T?0:e;if(p&&this.addCurrentVertex(d,m,t,r,h),"fakeround"===_){const e=Math.round(180*w/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}const i=g.sub(m)._mult(r)._add(m)._unit()._mult(T?-1:1);this.addHalfVertex(d,i.x,i.y,!1,T,0,h)}}f&&this.addCurrentVertex(d,g,-t,-r,h)}else"butt"===_?this.addCurrentVertex(d,x,0,0,h):"square"===_?(p||this.addCurrentVertex(d,x,-1,-1,h),this.addCurrentVertex(d,x,0,0,h),p&&this.addCurrentVertex(d,x,1,1,h)):"round"===_&&(p&&(this.addCurrentVertex(d,m,0,0,h),this.addCurrentVertex(d,m,1,1,h,!0)),f&&(this.addCurrentVertex(d,g,-1,-1,h,!0),this.addCurrentVertex(d,g,0,0,h)));if(C&&t<l-1){const e=d.dist(f);if(e>2*u){const t=d.add(f.sub(d)._mult(u/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,g,0,0,h),d=t}}}}addCurrentVertex(e,t,r,i,n,o=!1){const s=t.y*i-t.x,a=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,n),this.addHalfVertex(e,s,a,o,!0,-i,n),this.patternJoinNone&&this.segmentPoints.push(this.lineSoFar-this.segmentStart,r)}addHalfVertex({x:e,y:t},r,i,n,o,s,a){this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}fa(Tf,"LineBucket",{omit:["layers","patternFeatures"]});const Ef=new Ka({"line-cap":new Ya(tl.layout_line["line-cap"]),"line-join":new Ya(tl.layout_line["line-join"]),"line-miter-limit":new Xa(tl.layout_line["line-miter-limit"]),"line-round-limit":new Xa(tl.layout_line["line-round-limit"]),"line-sort-key":new Ya(tl.layout_line["line-sort-key"]),visibility:new Xa(tl.layout_line.visibility)});var Mf={paint:new Ka({"line-opacity":new Ya(tl.paint_line["line-opacity"]),"line-color":new Ya(tl.paint_line["line-color"]),"line-translate":new Xa(tl.paint_line["line-translate"]),"line-translate-anchor":new Xa(tl.paint_line["line-translate-anchor"]),"line-width":new Ya(tl.paint_line["line-width"]),"line-gap-width":new Ya(tl.paint_line["line-gap-width"]),"line-offset":new Ya(tl.paint_line["line-offset"]),"line-blur":new Ya(tl.paint_line["line-blur"]),"line-dasharray":new Ya(tl.paint_line["line-dasharray"]),"line-pattern":new Ya(tl.paint_line["line-pattern"]),"line-gradient":new $a(tl.paint_line["line-gradient"]),"line-trim-offset":new Xa(tl.paint_line["line-trim-offset"]),"line-emissive-strength":new Xa(tl.paint_line["line-emissive-strength"]),"line-border-width":new Ya(tl.paint_line["line-border-width"]),"line-border-color":new Ya(tl.paint_line["line-border-color"])}),layout:Ef};function Sf(e,t,r){return t*(no/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}function If(e,t){return 1/Sf(e,1,t.tileZoom)}function Pf(e,t,r,i){return e.translatePosMatrix(i||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Df=e=>{const t=[];kf(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const i="none"===e.layout.get("line-join").constantOr("miter"),n=!!e.paint.get("line-pattern").constantOr(1);return i&&n&&t.push("LINE_JOIN_NONE"),t};function kf(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Lf=new class extends Ya{possiblyEvaluate(e,t){return t=new Va(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=Jt({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}}(Mf.paint.properties["line-width"].specification);function Of(e,t){return t>0?t+2*e:e}Lf.useIntegerZoom=!0;const zf=wl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bf=wl([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Rf=wl([{name:"a_projected_pos",components:4,type:"Float32"}],4);wl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ff=wl([{name:"a_z_offset",components:1,type:"Float32"}],4),jf=wl([{name:"a_texb",components:2,type:"Uint16"}]),Vf=wl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Nf=wl([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);wl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Uf=wl([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hf=wl([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);wl([{name:"triangle",components:3,type:"Uint16"}]),wl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),wl([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),wl([{type:"Float32",name:"offsetX"}]),wl([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Gf=24;const Zf=128;function Wf(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Va(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:i}=r;let n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let o=n;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const s=t[n],a=t[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:a,minSize:r.evaluate(new Va(s)),maxSize:r.evaluate(new Va(a)),interpolationType:i}}}function Qf(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return"source"===e.kind?i/Zf:"composite"===e.kind?Ui(i/Zf,n/Zf,r):t}function qf(e,t){let r=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){const{interpolationType:n,minZoom:o,maxZoom:s}=e,a=n?Xt(ds.interpolationFactor(n,t,o,s),0,1):0;"camera"===e.kind?i=Ui(e.minSize,e.maxSize,a):r=a}return{uSizeT:r,uSize:i}}var Xf=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Zf,evaluateSizeForFeature:Qf,evaluateSizeForZoom:qf,getSizeData:Wf});function Yf(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),ja.applyArabicShaping&&(e=ja.applyArabicShaping(e)),e}(e.text,t,r)})),e}const $f={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function Kf(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Jf(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var em={
|
|
33
|
+
*/!function(e,t){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,a=32,l=64,c=128,u=256,h=1/0,d=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",a],["partialRight",l],["rearg",u]],g="[object Arguments]",A="[object Array]",_="[object Boolean]",y="[object Date]",x="[object Error]",v="[object Function]",b="[object GeneratorFunction]",w="[object Map]",C="[object Number]",T="[object Object]",E="[object Promise]",M="[object RegExp]",S="[object Set]",I="[object String]",D="[object Symbol]",k="[object WeakMap]",L="[object ArrayBuffer]",O="[object DataView]",z="[object Float32Array]",B="[object Float64Array]",R="[object Int8Array]",F="[object Int16Array]",j="[object Int32Array]",V="[object Uint8Array]",N="[object Uint8ClampedArray]",U="[object Uint16Array]",H="[object Uint32Array]",G=/\b__p \+= '';/g,Z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Q.source),Y=RegExp(q.source),$=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(ie.source),oe=/^\s+/,se=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['’]",De="["+we+"]",ke="["+Ie+"]",Le="["+Ce+"]",Oe="\\d+",ze="["+Te+"]",Be="["+Ee+"]",Re="[^"+we+Ie+Oe+Te+Ee+Me+"]",Fe="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",Ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Me+"]",He="\\u200d",Ge="(?:"+Be+"|"+Re+")",Ze="(?:"+Ue+"|"+Re+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Le+"|"+Fe+")"+"?",Xe="["+Se+"]?",Ye=Xe+qe+("(?:"+He+"(?:"+[je,Ve,Ne].join("|")+")"+Xe+qe+")*"),$e="(?:"+[ze,Ve,Ne].join("|")+")"+Ye,Ke="(?:"+[je+Le+"?",Le,Ve,Ne,De].join("|")+")",Je=RegExp(Pe,"g"),et=RegExp(Le,"g"),tt=RegExp(Fe+"(?="+Fe+")|"+Ke+Ye,"g"),rt=RegExp([Ue+"?"+Be+"+"+We+"(?="+[ke,Ue,"$"].join("|")+")",Ze+"+"+Qe+"(?="+[ke,Ue+Ge,"$"].join("|")+")",Ue+"?"+Ge+"+"+We,Ue+"+"+Qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,$e].join("|"),"g"),it=RegExp("["+He+we+Ce+Se+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[z]=at[B]=at[R]=at[F]=at[j]=at[V]=at[N]=at[U]=at[H]=!0,at[g]=at[A]=at[L]=at[_]=at[O]=at[y]=at[x]=at[v]=at[w]=at[C]=at[T]=at[M]=at[S]=at[I]=at[k]=!1;var lt={};lt[g]=lt[A]=lt[L]=lt[O]=lt[_]=lt[y]=lt[z]=lt[B]=lt[R]=lt[F]=lt[j]=lt[w]=lt[C]=lt[T]=lt[M]=lt[S]=lt[I]=lt[D]=lt[V]=lt[N]=lt[U]=lt[H]=!0,lt[x]=lt[v]=lt[k]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ht=parseInt,dt="object"==typeof P&&P&&P.Object===Object&&P,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,At=gt&>.exports===mt,_t=At&&dt.process,yt=function(){try{var e=gt&>.require&>.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),xt=yt&&yt.isArrayBuffer,vt=yt&&yt.isDate,bt=yt&&yt.isMap,wt=yt&&yt.isRegExp,Ct=yt&&yt.isSet,Tt=yt&&yt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Mt(e,t,r,i){for(var n=-1,o=null==e?0:e.length;++n<o;){var s=e[n];t(i,s,r(s),e)}return i}function St(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}function Dt(e,t){for(var r=-1,i=null==e?0:e.length,n=0,o=[];++r<i;){var s=e[r];t(s,r,e)&&(o[n++]=s)}return o}function kt(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Lt(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function Ot(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function zt(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function Bt(e,t,r,i){var n=-1,o=null==e?0:e.length;for(i&&o&&(r=e[++n]);++n<o;)r=t(r,e[n],n,e);return r}function Rt(e,t,r,i){var n=null==e?0:e.length;for(i&&n&&(r=e[--n]);n--;)r=t(r,e[n],n,e);return r}function Ft(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var jt=Wt("length");function Vt(e,t,r){var i;return r(e,(function(e,r,n){if(t(e,r,n))return i=r,!1})),i}function Nt(e,t,r,i){for(var n=e.length,o=r+(i?1:-1);i?o--:++o<n;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var i=r-1,n=e.length;for(;++i<n;)if(e[i]===t)return i;return-1}(e,t,r):Nt(e,Gt,r)}function Ht(e,t,r,i){for(var n=r-1,o=e.length;++n<o;)if(i(e[n],t))return n;return-1}function Gt(e){return e!=e}function Zt(e,t){var r=null==e?0:e.length;return r?Xt(e,t)/r:p}function Wt(e){return function(t){return null==t?r:t[e]}}function Qt(e){return function(t){return null==e?r:e[t]}}function qt(e,t,r,i,n){return n(e,(function(e,n,o){r=i?(i=!1,e):t(r,e,n,o)})),r}function Xt(e,t){for(var i,n=-1,o=e.length;++n<o;){var s=t(e[n]);s!==r&&(i=i===r?s:i+s)}return i}function Yt(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function $t(e){return e?e.slice(0,fr(e)+1).replace(oe,""):e}function Kt(e){return function(t){return e(t)}}function Jt(e,t){return Ot(t,(function(t){return e[t]}))}function er(e,t){return e.has(t)}function tr(e,t){for(var r=-1,i=e.length;++r<i&&Ut(t,e[r],0)>-1;);return r}function rr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var ir=Qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ct[e]}function sr(e){return it.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function cr(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var a=e[r];a!==t&&a!==o||(e[r]=o,s[n++]=r)}return s}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):jt(e)}function pr(e){return sr(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function fr(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mr=Qt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gr=function e(t){var P,se=(t=null==t?ft:gr.defaults(ft.Object(),t,gr.pick(ft,ot))).Array,we=t.Date,Ce=t.Error,Te=t.Function,Ee=t.Math,Me=t.Object,Se=t.RegExp,Ie=t.String,Pe=t.TypeError,De=se.prototype,ke=Te.prototype,Le=Me.prototype,Oe=t["__core-js_shared__"],ze=ke.toString,Be=Le.hasOwnProperty,Re=0,Fe=(P=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",je=Le.toString,Ve=ze.call(Me),Ne=ft._,Ue=Se("^"+ze.call(Be).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=At?t.Buffer:r,Ge=t.Symbol,Ze=t.Uint8Array,We=He?He.allocUnsafe:r,Qe=lr(Me.getPrototypeOf,Me),qe=Me.create,Xe=Le.propertyIsEnumerable,Ye=De.splice,$e=Ge?Ge.isConcatSpreadable:r,Ke=Ge?Ge.iterator:r,tt=Ge?Ge.toStringTag:r,it=function(){try{var e=po(Me,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,dt=we&&we.now!==ft.Date.now&&we.now,pt=t.setTimeout!==ft.setTimeout&&t.setTimeout,mt=Ee.ceil,gt=Ee.floor,_t=Me.getOwnPropertySymbols,yt=He?He.isBuffer:r,jt=t.isFinite,Qt=De.join,Ar=lr(Me.keys,Me),_r=Ee.max,yr=Ee.min,xr=we.now,vr=t.parseInt,br=Ee.random,wr=De.reverse,Cr=po(t,"DataView"),Tr=po(t,"Map"),Er=po(t,"Promise"),Mr=po(t,"Set"),Sr=po(t,"WeakMap"),Ir=po(Me,"create"),Pr=Sr&&new Sr,Dr={},kr=jo(Cr),Lr=jo(Tr),Or=jo(Er),zr=jo(Mr),Br=jo(Sr),Rr=Ge?Ge.prototype:r,Fr=Rr?Rr.valueOf:r,jr=Rr?Rr.toString:r;function Vr(e){if(ra(e)&&!Zs(e)&&!(e instanceof Gr)){if(e instanceof Hr)return e;if(Be.call(e,"__wrapped__"))return Vo(e)}return new Hr(e)}var Nr=function(){function e(){}return function(t){if(!ta(t))return{};if(qe)return qe(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function Ur(){}function Hr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Qr;++t<r;)this.add(e[t])}function Xr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Zs(e),i=!r&&Gs(e),n=!r&&!i&&Xs(e),o=!r&&!i&&!n&&ua(e),s=r||i||n||o,a=s?Yt(e.length,Ie):[],l=a.length;for(var c in e)!t&&!Be.call(e,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xo(c,l))||a.push(c);return a}function $r(e){var t=e.length;return t?e[qi(0,t-1)]:r}function Kr(e,t){return Bo(Pn(e),ai(t,0,e.length))}function Jr(e){return Bo(Pn(e))}function ei(e,t,i){(i!==r&&!Ns(e[t],i)||i===r&&!(t in e))&&oi(e,t,i)}function ti(e,t,i){var n=e[t];Be.call(e,t)&&Ns(n,i)&&(i!==r||t in e)||oi(e,t,i)}function ri(e,t){for(var r=e.length;r--;)if(Ns(e[r][0],t))return r;return-1}function ii(e,t,r,i){return di(e,(function(e,n,o){t(i,e,r(e),o)})),i}function ni(e,t){return e&&Dn(t,ka(t),e)}function oi(e,t,r){"__proto__"==t&&it?it(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function si(e,t){for(var i=-1,n=t.length,o=se(n),s=null==e;++i<n;)o[i]=s?r:Ma(e,t[i]);return o}function ai(e,t,i){return e==e&&(i!==r&&(e=e<=i?e:i),t!==r&&(e=e>=t?e:t)),e}function li(e,t,i,n,o,s){var a,l=1&t,c=2&t,u=4&t;if(i&&(a=o?i(e,n,o,s):i(e)),a!==r)return a;if(!ta(e))return e;var h=Zs(e);if(h){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return Pn(e,a)}else{var d=go(e),p=d==v||d==b;if(Xs(e))return Cn(e,l);if(d==T||d==g||p&&!o){if(a=c||p?{}:_o(e),!l)return c?function(e,t){return Dn(e,mo(e),t)}(e,function(e,t){return e&&Dn(t,La(t),e)}(a,e)):function(e,t){return Dn(e,fo(e),t)}(e,ni(a,e))}else{if(!lt[d])return o?e:{};a=function(e,t,r){var i=e.constructor;switch(t){case L:return Tn(e);case _:case y:return new i(+e);case O:return function(e,t){var r=t?Tn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case z:case B:case R:case F:case j:case V:case N:case U:case H:return En(e,r);case w:return new i;case C:case I:return new i(e);case M:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case S:return new i;case D:return n=e,Fr?Me(Fr.call(n)):{}}var n}(e,d,l)}}s||(s=new Xr);var f=s.get(e);if(f)return f;s.set(e,a),aa(e)?e.forEach((function(r){a.add(li(r,t,i,r,e,s))})):ia(e)&&e.forEach((function(r,n){a.set(n,li(r,t,i,n,e,s))}));var m=h?r:(u?c?oo:no:c?La:ka)(e);return St(m||e,(function(r,n){m&&(r=e[n=r]),ti(a,n,li(r,t,i,n,e,s))})),a}function ci(e,t,i){var n=i.length;if(null==e)return!n;for(e=Me(e);n--;){var o=i[n],s=t[o],a=e[o];if(a===r&&!(o in e)||!s(a))return!1}return!0}function ui(e,t,n){if("function"!=typeof e)throw new Pe(i);return ko((function(){e.apply(r,n)}),t)}function hi(e,t,r,i){var n=-1,o=kt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=Ot(t,Kt(r))),i?(o=Lt,s=!1):t.length>=200&&(o=er,s=!1,t=new qr(t));e:for(;++n<a;){var u=e[n],h=null==r?u:r(u);if(u=i||0!==u?u:0,s&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,i)||l.push(u)}return l}Vr.templateSettings={escape:$,evaluate:K,interpolate:J,variable:"",imports:{_:Vr}},Vr.prototype=Ur.prototype,Vr.prototype.constructor=Vr,Hr.prototype=Nr(Ur.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Nr(Ur.prototype),Gr.prototype.constructor=Gr,Zr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Zr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zr.prototype.get=function(e){var t=this.__data__;if(Ir){var i=t[e];return i===n?r:i}return Be.call(t,e)?t[e]:r},Zr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:Be.call(t,e)},Zr.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ir&&t===r?n:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=ri(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Wr.prototype.get=function(e){var t=this.__data__,i=ri(t,e);return i<0?r:t[i][1]},Wr.prototype.has=function(e){return ri(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,i=ri(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Tr||Wr),string:new Zr}},Qr.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Qr.prototype.get=function(e){return uo(this,e).get(e)},Qr.prototype.has=function(e){return uo(this,e).has(e)},Qr.prototype.set=function(e,t){var r=uo(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,n),this},qr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Xr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Xr.prototype.get=function(e){return this.__data__.get(e)},Xr.prototype.has=function(e){return this.__data__.has(e)},Xr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!Tr||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qr(i)}return r.set(e,t),this.size=r.size,this};var di=On(xi),pi=On(vi,!0);function fi(e,t){var r=!0;return di(e,(function(e,i,n){return r=!!t(e,i,n)})),r}function mi(e,t,i){for(var n=-1,o=e.length;++n<o;){var s=e[n],a=t(s);if(null!=a&&(l===r?a==a&&!ca(a):i(a,l)))var l=a,c=s}return c}function gi(e,t){var r=[];return di(e,(function(e,i,n){t(e,i,n)&&r.push(e)})),r}function Ai(e,t,r,i,n){var o=-1,s=e.length;for(r||(r=yo),n||(n=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?Ai(a,t-1,r,i,n):zt(n,a):i||(n[n.length]=a)}return n}var _i=zn(),yi=zn(!0);function xi(e,t){return e&&_i(e,t,ka)}function vi(e,t){return e&&yi(e,t,ka)}function bi(e,t){return Dt(t,(function(t){return Ks(e[t])}))}function wi(e,t){for(var i=0,n=(t=xn(t,e)).length;null!=e&&i<n;)e=e[Fo(t[i++])];return i&&i==n?e:r}function Ci(e,t,r){var i=t(e);return Zs(e)?i:zt(i,r(e))}function Ti(e){return null==e?e===r?"[object Undefined]":"[object Null]":tt&&tt in Me(e)?function(e){var t=Be.call(e,tt),i=e[tt];try{e[tt]=r;var n=!0}catch(e){}var o=je.call(e);n&&(t?e[tt]=i:delete e[tt]);return o}(e):function(e){return je.call(e)}(e)}function Ei(e,t){return e>t}function Mi(e,t){return null!=e&&Be.call(e,t)}function Si(e,t){return null!=e&&t in Me(e)}function Ii(e,t,i){for(var n=i?Lt:kt,o=e[0].length,s=e.length,a=s,l=se(s),c=1/0,u=[];a--;){var h=e[a];a&&t&&(h=Ot(h,Kt(t))),c=yr(h.length,c),l[a]=!i&&(t||o>=120&&h.length>=120)?new qr(a&&h):r}h=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<c;){var f=h[d],m=t?t(f):f;if(f=i||0!==f?f:0,!(p?er(p,m):n(u,m,i))){for(a=s;--a;){var g=l[a];if(!(g?er(g,m):n(e[a],m,i)))continue e}p&&p.push(m),u.push(f)}}return u}function Pi(e,t,i){var n=null==(e=Io(e,t=xn(t,e)))?e:e[Fo($o(t))];return null==n?r:Et(n,e,i)}function Di(e){return ra(e)&&Ti(e)==g}function ki(e,t,i,n,o){return e===t||(null==e||null==t||!ra(e)&&!ra(t)?e!=e&&t!=t:function(e,t,i,n,o,s){var a=Zs(e),l=Zs(t),c=a?A:go(e),u=l?A:go(t),h=(c=c==g?T:c)==T,d=(u=u==g?T:u)==T,p=c==u;if(p&&Xs(e)){if(!Xs(t))return!1;a=!0,h=!1}if(p&&!h)return s||(s=new Xr),a||ua(e)?ro(e,t,i,n,o,s):function(e,t,r,i,n,o,s){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!o(new Ze(e),new Ze(t)));case _:case y:case C:return Ns(+e,+t);case x:return e.name==t.name&&e.message==t.message;case M:case I:return e==t+"";case w:var a=ar;case S:var l=1&i;if(a||(a=ur),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;i|=2,s.set(e,t);var u=ro(a(e),a(t),i,n,o,s);return s.delete(e),u;case D:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,i,n,o,s);if(!(1&i)){var f=h&&Be.call(e,"__wrapped__"),m=d&&Be.call(t,"__wrapped__");if(f||m){var v=f?e.value():e,b=m?t.value():t;return s||(s=new Xr),o(v,b,i,n,s)}}if(!p)return!1;return s||(s=new Xr),function(e,t,i,n,o,s){var a=1&i,l=no(e),c=l.length,u=no(t),h=u.length;if(c!=h&&!a)return!1;var d=c;for(;d--;){var p=l[d];if(!(a?p in t:Be.call(t,p)))return!1}var f=s.get(e),m=s.get(t);if(f&&m)return f==t&&m==e;var g=!0;s.set(e,t),s.set(t,e);var A=a;for(;++d<c;){var _=e[p=l[d]],y=t[p];if(n)var x=a?n(y,_,p,t,e,s):n(_,y,p,e,t,s);if(!(x===r?_===y||o(_,y,i,n,s):x)){g=!1;break}A||(A="constructor"==p)}if(g&&!A){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(g=!1)}return s.delete(e),s.delete(t),g}(e,t,i,n,o,s)}(e,t,i,n,ki,o))}function Li(e,t,i,n){var o=i.length,s=o,a=!n;if(null==e)return!s;for(e=Me(e);o--;){var l=i[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var c=(l=i[o])[0],u=e[c],h=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var d=new Xr;if(n)var p=n(u,h,c,e,t,d);if(!(p===r?ki(h,u,3,n,d):p))return!1}}return!0}function Oi(e){return!(!ta(e)||(t=e,Fe&&Fe in t))&&(Ks(e)?Ue:Ae).test(jo(e));var t}function zi(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?Zs(e)?Ni(e[0],e[1]):Vi(e):pl(e)}function Bi(e){if(!To(e))return Ar(e);var t=[];for(var r in Me(e))Be.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Ri(e){if(!ta(e))return function(e){var t=[];if(null!=e)for(var r in Me(e))t.push(r);return t}(e);var t=To(e),r=[];for(var i in e)("constructor"!=i||!t&&Be.call(e,i))&&r.push(i);return r}function Fi(e,t){return e<t}function ji(e,t){var r=-1,i=Qs(e)?se(e.length):[];return di(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Vi(e){var t=ho(e);return 1==t.length&&t[0][2]?Mo(t[0][0],t[0][1]):function(r){return r===e||Li(r,e,t)}}function Ni(e,t){return bo(e)&&Eo(t)?Mo(Fo(e),t):function(i){var n=Ma(i,e);return n===r&&n===t?Sa(i,e):ki(t,n,3)}}function Ui(e,t,i,n,o){e!==t&&_i(t,(function(s,a){if(o||(o=new Xr),ta(s))!function(e,t,i,n,o,s,a){var l=Po(e,i),c=Po(t,i),u=a.get(c);if(u)return void ei(e,i,u);var h=s?s(l,c,i+"",e,t,a):r,d=h===r;if(d){var p=Zs(c),f=!p&&Xs(c),m=!p&&!f&&ua(c);h=c,p||f||m?Zs(l)?h=l:qs(l)?h=Pn(l):f?(d=!1,h=Cn(c,!0)):m?(d=!1,h=En(c,!0)):h=[]:oa(c)||Gs(c)?(h=l,Gs(l)?h=_a(l):ta(l)&&!Ks(l)||(h=_o(c))):d=!1}d&&(a.set(c,h),o(h,c,n,s,a),a.delete(c));ei(e,i,h)}(e,t,a,i,Ui,n,o);else{var l=n?n(Po(e,a),s,a+"",e,t,o):r;l===r&&(l=s),ei(e,a,l)}}),La)}function Hi(e,t){var i=e.length;if(i)return xo(t+=t<0?i:0,i)?e[t]:r}function Gi(e,t,r){t=t.length?Ot(t,(function(e){return Zs(e)?function(t){return wi(t,1===e.length?e[0]:e)}:e})):[nl];var i=-1;t=Ot(t,Kt(co()));var n=ji(e,(function(e,r,n){var o=Ot(t,(function(t){return t(e)}));return{criteria:o,index:++i,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(n,(function(e,t){return function(e,t,r){var i=-1,n=e.criteria,o=t.criteria,s=n.length,a=r.length;for(;++i<s;){var l=Mn(n[i],o[i]);if(l)return i>=a?l:l*("desc"==r[i]?-1:1)}return e.index-t.index}(e,t,r)}))}function Zi(e,t,r){for(var i=-1,n=t.length,o={};++i<n;){var s=t[i],a=wi(e,s);r(a,s)&&Ji(o,xn(s,e),a)}return o}function Wi(e,t,r,i){var n=i?Ht:Ut,o=-1,s=t.length,a=e;for(e===t&&(t=Pn(t)),r&&(a=Ot(e,Kt(r)));++o<s;)for(var l=0,c=t[o],u=r?r(c):c;(l=n(a,u,l,i))>-1;)a!==e&&Ye.call(a,l,1),Ye.call(e,l,1);return e}function Qi(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==o){var o=n;xo(n)?Ye.call(e,n,1):dn(e,n)}}return e}function qi(e,t){return e+gt(br()*(t-e+1))}function Xi(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Yi(e,t){return Lo(So(e,t,nl),e+"")}function $i(e){return $r(Na(e))}function Ki(e,t){var r=Na(e);return Bo(r,ai(t,0,r.length))}function Ji(e,t,i,n){if(!ta(e))return e;for(var o=-1,s=(t=xn(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var c=Fo(t[o]),u=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var h=l[c];(u=n?n(h,c,l):r)===r&&(u=ta(h)?h:xo(t[o+1])?[]:{})}ti(l,c,u),l=l[c]}return e}var en=Pr?function(e,t){return Pr.set(e,t),e}:nl,tn=it?function(e,t){return it(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:nl;function rn(e){return Bo(Na(e))}function nn(e,t,r){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var o=se(n);++i<n;)o[i]=e[i+t];return o}function on(e,t){var r;return di(e,(function(e,i,n){return!(r=t(e,i,n))})),!!r}function sn(e,t,r){var i=0,n=null==e?i:e.length;if("number"==typeof t&&t==t&&n<=2147483647){for(;i<n;){var o=i+n>>>1,s=e[o];null!==s&&!ca(s)&&(r?s<=t:s<t)?i=o+1:n=o}return n}return an(e,t,nl,r)}function an(e,t,i,n){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=i(t))!=t,l=null===t,c=ca(t),u=t===r;o<s;){var h=gt((o+s)/2),d=i(e[h]),p=d!==r,f=null===d,m=d==d,g=ca(d);if(a)var A=n||m;else A=u?m&&(n||p):l?m&&p&&(n||!f):c?m&&p&&!f&&(n||!g):!f&&!g&&(n?d<=t:d<t);A?o=h+1:s=h}return yr(s,4294967294)}function ln(e,t){for(var r=-1,i=e.length,n=0,o=[];++r<i;){var s=e[r],a=t?t(s):s;if(!r||!Ns(a,l)){var l=a;o[n++]=0===s?0:s}}return o}function cn(e){return"number"==typeof e?e:ca(e)?p:+e}function un(e){if("string"==typeof e)return e;if(Zs(e))return Ot(e,un)+"";if(ca(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hn(e,t,r){var i=-1,n=kt,o=e.length,s=!0,a=[],l=a;if(r)s=!1,n=Lt;else if(o>=200){var c=t?null:Yn(e);if(c)return ur(c);s=!1,n=er,l=new qr}else l=t?[]:a;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=r||0!==u?u:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(u)}else n(l,h,r)||(l!==a&&l.push(h),a.push(u))}return a}function dn(e,t){return null==(e=Io(e,t=xn(t,e)))||delete e[Fo($o(t))]}function pn(e,t,r,i){return Ji(e,t,r(wi(e,t)),i)}function fn(e,t,r,i){for(var n=e.length,o=i?n:-1;(i?o--:++o<n)&&t(e[o],o,e););return r?nn(e,i?0:o,i?o+1:n):nn(e,i?o+1:0,i?n:o)}function mn(e,t){var r=e;return r instanceof Gr&&(r=r.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,zt([e],t.args))}),r)}function gn(e,t,r){var i=e.length;if(i<2)return i?hn(e[0]):[];for(var n=-1,o=se(i);++n<i;)for(var s=e[n],a=-1;++a<i;)a!=n&&(o[n]=hi(o[n]||s,e[a],t,r));return hn(Ai(o,1),t,r)}function An(e,t,i){for(var n=-1,o=e.length,s=t.length,a={};++n<o;){var l=n<s?t[n]:r;i(a,e[n],l)}return a}function _n(e){return qs(e)?e:[]}function yn(e){return"function"==typeof e?e:nl}function xn(e,t){return Zs(e)?e:bo(e,t)?[e]:Ro(ya(e))}var vn=Yi;function bn(e,t,i){var n=e.length;return i=i===r?n:i,!t&&i>=n?e:nn(e,t,i)}var wn=ct||function(e){return ft.clearTimeout(e)};function Cn(e,t){if(t)return e.slice();var r=e.length,i=We?We(r):new e.constructor(r);return e.copy(i),i}function Tn(e){var t=new e.constructor(e.byteLength);return new Ze(t).set(new Ze(e)),t}function En(e,t){var r=t?Tn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Mn(e,t){if(e!==t){var i=e!==r,n=null===e,o=e==e,s=ca(e),a=t!==r,l=null===t,c=t==t,u=ca(t);if(!l&&!u&&!s&&e>t||s&&a&&c&&!l&&!u||n&&a&&c||!i&&c||!o)return 1;if(!n&&!s&&!u&&e<t||u&&i&&o&&!n&&!s||l&&i&&o||!a&&o||!c)return-1}return 0}function Sn(e,t,r,i){for(var n=-1,o=e.length,s=r.length,a=-1,l=t.length,c=_r(o-s,0),u=se(l+c),h=!i;++a<l;)u[a]=t[a];for(;++n<s;)(h||n<o)&&(u[r[n]]=e[n]);for(;c--;)u[a++]=e[n++];return u}function In(e,t,r,i){for(var n=-1,o=e.length,s=-1,a=r.length,l=-1,c=t.length,u=_r(o-a,0),h=se(u+c),d=!i;++n<u;)h[n]=e[n];for(var p=n;++l<c;)h[p+l]=t[l];for(;++s<a;)(d||n<o)&&(h[p+r[s]]=e[n++]);return h}function Pn(e,t){var r=-1,i=e.length;for(t||(t=se(i));++r<i;)t[r]=e[r];return t}function Dn(e,t,i,n){var o=!i;i||(i={});for(var s=-1,a=t.length;++s<a;){var l=t[s],c=n?n(i[l],e[l],l,i,e):r;c===r&&(c=e[l]),o?oi(i,l,c):ti(i,l,c)}return i}function kn(e,t){return function(r,i){var n=Zs(r)?Mt:ii,o=t?t():{};return n(r,e,co(i,2),o)}}function Ln(e){return Yi((function(t,i){var n=-1,o=i.length,s=o>1?i[o-1]:r,a=o>2?i[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&vo(i[0],i[1],a)&&(s=o<3?r:s,o=1),t=Me(t);++n<o;){var l=i[n];l&&e(t,l,n,s)}return t}))}function On(e,t){return function(r,i){if(null==r)return r;if(!Qs(r))return e(r,i);for(var n=r.length,o=t?n:-1,s=Me(r);(t?o--:++o<n)&&!1!==i(s[o],o,s););return r}}function zn(e){return function(t,r,i){for(var n=-1,o=Me(t),s=i(t),a=s.length;a--;){var l=s[e?a:++n];if(!1===r(o[l],l,o))break}return t}}function Bn(e){return function(t){var i=sr(t=ya(t))?pr(t):r,n=i?i[0]:t.charAt(0),o=i?bn(i,1).join(""):t.slice(1);return n[e]()+o}}function Rn(e){return function(t){return Bt(Ka(Ga(t).replace(Je,"")),e,"")}}function Fn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Nr(e.prototype),i=e.apply(r,t);return ta(i)?i:r}}function jn(e){return function(t,i,n){var o=Me(t);if(!Qs(t)){var s=co(i,3);t=ka(t),i=function(e){return s(o[e],e,o)}}var a=e(t,i,n);return a>-1?o[s?t[a]:a]:r}}function Vn(e){return io((function(t){var n=t.length,o=n,s=Hr.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Pe(i);if(s&&!l&&"wrapper"==ao(a))var l=new Hr([],!0)}for(o=l?o:n;++o<n;){var c=ao(a=t[o]),u="wrapper"==c?so(a):r;l=u&&wo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ao(u[0])].apply(l,u[3]):1==a.length&&wo(a)?l[c]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Zs(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Nn(e,t,i,n,o,s,a,l,u,h){var d=t&c,p=1&t,f=2&t,m=24&t,g=512&t,A=f?r:Fn(e);return function c(){for(var _=arguments.length,y=se(_),x=_;x--;)y[x]=arguments[x];if(m)var v=lo(c),b=function(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}(y,v);if(n&&(y=Sn(y,n,o,m)),s&&(y=In(y,s,a,m)),_-=b,m&&_<h){var w=cr(y,v);return qn(e,t,Nn,c.placeholder,i,y,w,l,u,h-_)}var C=p?i:this,T=f?C[e]:e;return _=y.length,l?y=function(e,t){var i=e.length,n=yr(t.length,i),o=Pn(e);for(;n--;){var s=t[n];e[n]=xo(s,i)?o[s]:r}return e}(y,l):g&&_>1&&y.reverse(),d&&u<_&&(y.length=u),this&&this!==ft&&this instanceof c&&(T=A||Fn(T)),T.apply(C,y)}}function Un(e,t){return function(r,i){return function(e,t,r,i){return xi(e,(function(e,n,o){t(i,r(e),n,o)})),i}(r,e,t(i),{})}}function Hn(e,t){return function(i,n){var o;if(i===r&&n===r)return t;if(i!==r&&(o=i),n!==r){if(o===r)return n;"string"==typeof i||"string"==typeof n?(i=un(i),n=un(n)):(i=cn(i),n=cn(n)),o=e(i,n)}return o}}function Gn(e){return io((function(t){return t=Ot(t,Kt(co())),Yi((function(r){var i=this;return e(t,(function(e){return Et(e,i,r)}))}))}))}function Zn(e,t){var i=(t=t===r?" ":un(t)).length;if(i<2)return i?Xi(t,e):t;var n=Xi(t,mt(e/dr(t)));return sr(t)?bn(pr(n),0,e).join(""):n.slice(0,e)}function Wn(e){return function(t,i,n){return n&&"number"!=typeof n&&vo(t,i,n)&&(i=n=r),t=fa(t),i===r?(i=t,t=0):i=fa(i),function(e,t,r,i){for(var n=-1,o=_r(mt((t-e)/(r||1)),0),s=se(o);o--;)s[i?o:++n]=e,e+=r;return s}(t,i,n=n===r?t<i?1:-1:fa(n),e)}}function Qn(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Aa(t),r=Aa(r)),e(t,r)}}function qn(e,t,i,n,o,s,c,u,h,d){var p=8&t;t|=p?a:l,4&(t&=~(p?l:a))||(t&=-4);var f=[e,t,o,p?s:r,p?c:r,p?r:s,p?r:c,u,h,d],m=i.apply(r,f);return wo(e)&&Do(m,f),m.placeholder=n,Oo(m,e,t)}function Xn(e){var t=Ee[e];return function(e,r){if(e=Aa(e),(r=null==r?0:yr(ma(r),292))&&jt(e)){var i=(ya(e)+"e").split("e");return+((i=(ya(t(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return t(e)}}var Yn=Mr&&1/ur(new Mr([,-0]))[1]==h?function(e){return new Mr(e)}:cl;function $n(e){return function(t){var r=go(t);return r==w?ar(t):r==S?hr(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Kn(e,t,n,h,d,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new Pe(i);var A=h?h.length:0;if(A||(t&=-97,h=d=r),f=f===r?f:_r(ma(f),0),m=m===r?m:ma(m),A-=d?d.length:0,t&l){var _=h,y=d;h=d=r}var x=g?r:so(e),v=[e,t,n,h,d,_,y,p,f,m];if(x&&function(e,t){var r=e[1],i=t[1],n=r|i,s=n<131,a=i==c&&8==r||i==c&&r==u&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(!s&&!a)return e;1&i&&(e[2]=t[2],n|=1&r?0:4);var l=t[3];if(l){var h=e[3];e[3]=h?Sn(h,l,t[4]):l,e[4]=h?cr(e[3],o):t[4]}(l=t[5])&&(h=e[5],e[5]=h?In(h,l,t[6]):l,e[6]=h?cr(e[5],o):t[6]);(l=t[7])&&(e[7]=l);i&c&&(e[8]=null==e[8]?t[8]:yr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=n}(v,x),e=v[0],t=v[1],n=v[2],h=v[3],d=v[4],!(m=v[9]=v[9]===r?g?0:e.length:_r(v[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==s?function(e,t,i){var n=Fn(e);return function o(){for(var s=arguments.length,a=se(s),l=s,c=lo(o);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cr(a,c);return(s-=u.length)<i?qn(e,t,Nn,o.placeholder,r,a,u,r,r,i-s):Et(this&&this!==ft&&this instanceof o?n:e,this,a)}}(e,t,m):t!=a&&33!=t||d.length?Nn.apply(r,v):function(e,t,r,i){var n=1&t,o=Fn(e);return function t(){for(var s=-1,a=arguments.length,l=-1,c=i.length,u=se(c+a),h=this&&this!==ft&&this instanceof t?o:e;++l<c;)u[l]=i[l];for(;a--;)u[l++]=arguments[++s];return Et(h,n?r:this,u)}}(e,t,n,h);else var b=function(e,t,r){var i=1&t,n=Fn(e);return function t(){return(this&&this!==ft&&this instanceof t?n:e).apply(i?r:this,arguments)}}(e,t,n);return Oo((x?en:Do)(b,v),e,t)}function Jn(e,t,i,n){return e===r||Ns(e,Le[i])&&!Be.call(n,i)?t:e}function eo(e,t,i,n,o,s){return ta(e)&&ta(t)&&(s.set(t,e),Ui(e,t,r,eo,s),s.delete(t)),e}function to(e){return oa(e)?r:e}function ro(e,t,i,n,o,s){var a=1&i,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),h=s.get(t);if(u&&h)return u==t&&h==e;var d=-1,p=!0,f=2&i?new qr:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],g=t[d];if(n)var A=a?n(g,m,d,t,e,s):n(m,g,d,e,t,s);if(A!==r){if(A)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!er(f,t)&&(m===e||o(m,e,i,n,s)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,i,n,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function io(e){return Lo(So(e,r,Wo),e+"")}function no(e){return Ci(e,ka,fo)}function oo(e){return Ci(e,La,mo)}var so=Pr?function(e){return Pr.get(e)}:cl;function ao(e){for(var t=e.name+"",r=Dr[t],i=Be.call(Dr,t)?r.length:0;i--;){var n=r[i],o=n.func;if(null==o||o==e)return n.name}return t}function lo(e){return(Be.call(Vr,"placeholder")?Vr:e).placeholder}function co(){var e=Vr.iteratee||ol;return e=e===ol?zi:e,arguments.length?e(arguments[0],arguments[1]):e}function uo(e,t){var r,i,n=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof t?"string":"hash"]:n.map}function ho(e){for(var t=ka(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,Eo(n)]}return t}function po(e,t){var i=function(e,t){return null==e?r:e[t]}(e,t);return Oi(i)?i:r}var fo=_t?function(e){return null==e?[]:(e=Me(e),Dt(_t(e),(function(t){return Xe.call(e,t)})))}:gl,mo=_t?function(e){for(var t=[];e;)zt(t,fo(e)),e=Qe(e);return t}:gl,go=Ti;function Ao(e,t,r){for(var i=-1,n=(t=xn(t,e)).length,o=!1;++i<n;){var s=Fo(t[i]);if(!(o=null!=e&&r(e,s)))break;e=e[s]}return o||++i!=n?o:!!(n=null==e?0:e.length)&&ea(n)&&xo(s,n)&&(Zs(e)||Gs(e))}function _o(e){return"function"!=typeof e.constructor||To(e)?{}:Nr(Qe(e))}function yo(e){return Zs(e)||Gs(e)||!!($e&&e&&e[$e])}function xo(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function vo(e,t,r){if(!ta(r))return!1;var i=typeof t;return!!("number"==i?Qs(r)&&xo(t,r.length):"string"==i&&t in r)&&Ns(r[t],e)}function bo(e,t){if(Zs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ca(e))||(te.test(e)||!ee.test(e)||null!=t&&e in Me(t))}function wo(e){var t=ao(e),r=Vr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var i=so(r);return!!i&&e===i[0]}(Cr&&go(new Cr(new ArrayBuffer(1)))!=O||Tr&&go(new Tr)!=w||Er&&go(Er.resolve())!=E||Mr&&go(new Mr)!=S||Sr&&go(new Sr)!=k)&&(go=function(e){var t=Ti(e),i=t==T?e.constructor:r,n=i?jo(i):"";if(n)switch(n){case kr:return O;case Lr:return w;case Or:return E;case zr:return S;case Br:return k}return t});var Co=Oe?Ks:Al;function To(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Eo(e){return e==e&&!ta(e)}function Mo(e,t){return function(i){return null!=i&&(i[e]===t&&(t!==r||e in Me(i)))}}function So(e,t,i){return t=_r(t===r?e.length-1:t,0),function(){for(var r=arguments,n=-1,o=_r(r.length-t,0),s=se(o);++n<o;)s[n]=r[t+n];n=-1;for(var a=se(t+1);++n<t;)a[n]=r[n];return a[t]=i(s),Et(e,this,a)}}function Io(e,t){return t.length<2?e:wi(e,nn(t,0,-1))}function Po(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Do=zo(en),ko=pt||function(e,t){return ft.setTimeout(e,t)},Lo=zo(tn);function Oo(e,t,r){var i=t+"";return Lo(e,function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return St(m,(function(r){var i="_."+r[0];t&r[1]&&!kt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ce):[]}(i),r)))}function zo(e){var t=0,i=0;return function(){var n=xr(),o=16-(n-i);if(i=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Bo(e,t){var i=-1,n=e.length,o=n-1;for(t=t===r?n:t;++i<t;){var s=qi(i,o),a=e[s];e[s]=e[i],e[i]=a}return e.length=t,e}var Ro=function(e){var t=zs(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,r,i,n){t.push(i?n.replace(de,"$1"):r||e)})),t}));function Fo(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return ze.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Vo(e){if(e instanceof Gr)return e.clone();var t=new Hr(e.__wrapped__,e.__chain__);return t.__actions__=Pn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var No=Yi((function(e,t){return qs(e)?hi(e,Ai(t,1,qs,!0)):[]})),Uo=Yi((function(e,t){var i=$o(t);return qs(i)&&(i=r),qs(e)?hi(e,Ai(t,1,qs,!0),co(i,2)):[]})),Ho=Yi((function(e,t){var i=$o(t);return qs(i)&&(i=r),qs(e)?hi(e,Ai(t,1,qs,!0),r,i):[]}));function Go(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ma(r);return n<0&&(n=_r(i+n,0)),Nt(e,co(t,3),n)}function Zo(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return i!==r&&(o=ma(i),o=i<0?_r(n+o,0):yr(o,n-1)),Nt(e,co(t,3),o,!0)}function Wo(e){return(null==e?0:e.length)?Ai(e,1):[]}function Qo(e){return e&&e.length?e[0]:r}var qo=Yi((function(e){var t=Ot(e,_n);return t.length&&t[0]===e[0]?Ii(t):[]})),Xo=Yi((function(e){var t=$o(e),i=Ot(e,_n);return t===$o(i)?t=r:i.pop(),i.length&&i[0]===e[0]?Ii(i,co(t,2)):[]})),Yo=Yi((function(e){var t=$o(e),i=Ot(e,_n);return(t="function"==typeof t?t:r)&&i.pop(),i.length&&i[0]===e[0]?Ii(i,r,t):[]}));function $o(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Yi(Jo);function Jo(e,t){return e&&e.length&&t&&t.length?Wi(e,t):e}var es=io((function(e,t){var r=null==e?0:e.length,i=si(e,t);return Qi(e,Ot(t,(function(e){return xo(e,r)?+e:e})).sort(Mn)),i}));function ts(e){return null==e?e:wr.call(e)}var rs=Yi((function(e){return hn(Ai(e,1,qs,!0))})),is=Yi((function(e){var t=$o(e);return qs(t)&&(t=r),hn(Ai(e,1,qs,!0),co(t,2))})),ns=Yi((function(e){var t=$o(e);return t="function"==typeof t?t:r,hn(Ai(e,1,qs,!0),r,t)}));function os(e){if(!e||!e.length)return[];var t=0;return e=Dt(e,(function(e){if(qs(e))return t=_r(e.length,t),!0})),Yt(t,(function(t){return Ot(e,Wt(t))}))}function ss(e,t){if(!e||!e.length)return[];var i=os(e);return null==t?i:Ot(i,(function(e){return Et(t,r,e)}))}var as=Yi((function(e,t){return qs(e)?hi(e,t):[]})),ls=Yi((function(e){return gn(Dt(e,qs))})),cs=Yi((function(e){var t=$o(e);return qs(t)&&(t=r),gn(Dt(e,qs),co(t,2))})),us=Yi((function(e){var t=$o(e);return t="function"==typeof t?t:r,gn(Dt(e,qs),r,t)})),hs=Yi(os);var ds=Yi((function(e){var t=e.length,i=t>1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,ss(e,i)}));function ps(e){var t=Vr(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ms=io((function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,o=function(t){return si(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&xo(i)?((n=n.slice(i,+i+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:r}),new Hr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var gs=kn((function(e,t,r){Be.call(e,r)?++e[r]:oi(e,r,1)}));var As=jn(Go),_s=jn(Zo);function ys(e,t){return(Zs(e)?St:di)(e,co(t,3))}function xs(e,t){return(Zs(e)?It:pi)(e,co(t,3))}var vs=kn((function(e,t,r){Be.call(e,r)?e[r].push(t):oi(e,r,[t])}));var bs=Yi((function(e,t,r){var i=-1,n="function"==typeof t,o=Qs(e)?se(e.length):[];return di(e,(function(e){o[++i]=n?Et(t,e,r):Pi(e,t,r)})),o})),ws=kn((function(e,t,r){oi(e,r,t)}));function Cs(e,t){return(Zs(e)?Ot:ji)(e,co(t,3))}var Ts=kn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Es=Yi((function(e,t){if(null==e)return[];var r=t.length;return r>1&&vo(e,t[0],t[1])?t=[]:r>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Gi(e,Ai(t,1),[])})),Ms=dt||function(){return ft.Date.now()};function Ss(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,Kn(e,c,r,r,r,r,t)}function Is(e,t){var n;if("function"!=typeof t)throw new Pe(i);return e=ma(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Ps=Yi((function(e,t,r){var i=1;if(r.length){var n=cr(r,lo(Ps));i|=a}return Kn(e,i,t,r,n)})),Ds=Yi((function(e,t,r){var i=3;if(r.length){var n=cr(r,lo(Ds));i|=a}return Kn(t,i,e,r,n)}));function ks(e,t,n){var o,s,a,l,c,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new Pe(i);function m(t){var i=o,n=s;return o=s=r,h=t,l=e.apply(n,i)}function g(e){var i=e-u;return u===r||i>=t||i<0||p&&e-h>=a}function A(){var e=Ms();if(g(e))return _(e);c=ko(A,function(e){var r=t-(e-u);return p?yr(r,a-(e-h)):r}(e))}function _(e){return c=r,f&&o?m(e):(o=s=r,l)}function y(){var e=Ms(),i=g(e);if(o=arguments,s=this,u=e,i){if(c===r)return function(e){return h=e,c=ko(A,t),d?m(e):l}(u);if(p)return wn(c),c=ko(A,t),m(u)}return c===r&&(c=ko(A,t)),l}return t=Aa(t)||0,ta(n)&&(d=!!n.leading,a=(p="maxWait"in n)?_r(Aa(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),y.cancel=function(){c!==r&&wn(c),h=0,o=u=s=c=r},y.flush=function(){return c===r?l:_(Ms())},y}var Ls=Yi((function(e,t){return ui(e,1,t)})),Os=Yi((function(e,t,r){return ui(e,Aa(t)||0,r)}));function zs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(i);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(zs.Cache||Qr),r}function Bs(e){if("function"!=typeof e)throw new Pe(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}zs.Cache=Qr;var Rs=vn((function(e,t){var r=(t=1==t.length&&Zs(t[0])?Ot(t[0],Kt(co())):Ot(Ai(t,1),Kt(co()))).length;return Yi((function(i){for(var n=-1,o=yr(i.length,r);++n<o;)i[n]=t[n].call(this,i[n]);return Et(e,this,i)}))})),Fs=Yi((function(e,t){var i=cr(t,lo(Fs));return Kn(e,a,r,t,i)})),js=Yi((function(e,t){var i=cr(t,lo(js));return Kn(e,l,r,t,i)})),Vs=io((function(e,t){return Kn(e,u,r,r,r,t)}));function Ns(e,t){return e===t||e!=e&&t!=t}var Us=Qn(Ei),Hs=Qn((function(e,t){return e>=t})),Gs=Di(function(){return arguments}())?Di:function(e){return ra(e)&&Be.call(e,"callee")&&!Xe.call(e,"callee")},Zs=se.isArray,Ws=xt?Kt(xt):function(e){return ra(e)&&Ti(e)==L};function Qs(e){return null!=e&&ea(e.length)&&!Ks(e)}function qs(e){return ra(e)&&Qs(e)}var Xs=yt||Al,Ys=vt?Kt(vt):function(e){return ra(e)&&Ti(e)==y};function $s(e){if(!ra(e))return!1;var t=Ti(e);return t==x||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oa(e)}function Ks(e){if(!ta(e))return!1;var t=Ti(e);return t==v||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==ma(e)}function ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ta(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=bt?Kt(bt):function(e){return ra(e)&&go(e)==w};function na(e){return"number"==typeof e||ra(e)&&Ti(e)==C}function oa(e){if(!ra(e)||Ti(e)!=T)return!1;var t=Qe(e);if(null===t)return!0;var r=Be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ze.call(r)==Ve}var sa=wt?Kt(wt):function(e){return ra(e)&&Ti(e)==M};var aa=Ct?Kt(Ct):function(e){return ra(e)&&go(e)==S};function la(e){return"string"==typeof e||!Zs(e)&&ra(e)&&Ti(e)==I}function ca(e){return"symbol"==typeof e||ra(e)&&Ti(e)==D}var ua=Tt?Kt(Tt):function(e){return ra(e)&&ea(e.length)&&!!at[Ti(e)]};var ha=Qn(Fi),da=Qn((function(e,t){return e<=t}));function pa(e){if(!e)return[];if(Qs(e))return la(e)?pr(e):Pn(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=go(e);return(t==w?ar:t==S?ur:Na)(e)}function fa(e){return e?(e=Aa(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ma(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ga(e){return e?ai(ma(e),0,f):0}function Aa(e){if("number"==typeof e)return e;if(ca(e))return p;if(ta(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ta(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var r=ge.test(e);return r||_e.test(e)?ht(e.slice(2),r?2:8):me.test(e)?p:+e}function _a(e){return Dn(e,La(e))}function ya(e){return null==e?"":un(e)}var xa=Ln((function(e,t){if(To(t)||Qs(t))Dn(t,ka(t),e);else for(var r in t)Be.call(t,r)&&ti(e,r,t[r])})),va=Ln((function(e,t){Dn(t,La(t),e)})),ba=Ln((function(e,t,r,i){Dn(t,La(t),e,i)})),wa=Ln((function(e,t,r,i){Dn(t,ka(t),e,i)})),Ca=io(si);var Ta=Yi((function(e,t){e=Me(e);var i=-1,n=t.length,o=n>2?t[2]:r;for(o&&vo(t[0],t[1],o)&&(n=1);++i<n;)for(var s=t[i],a=La(s),l=-1,c=a.length;++l<c;){var u=a[l],h=e[u];(h===r||Ns(h,Le[u])&&!Be.call(e,u))&&(e[u]=s[u])}return e})),Ea=Yi((function(e){return e.push(r,eo),Et(za,r,e)}));function Ma(e,t,i){var n=null==e?r:wi(e,t);return n===r?i:n}function Sa(e,t){return null!=e&&Ao(e,t,Si)}var Ia=Un((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),tl(nl)),Pa=Un((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(r):e[t]=[r]}),co),Da=Yi(Pi);function ka(e){return Qs(e)?Yr(e):Bi(e)}function La(e){return Qs(e)?Yr(e,!0):Ri(e)}var Oa=Ln((function(e,t,r){Ui(e,t,r)})),za=Ln((function(e,t,r,i){Ui(e,t,r,i)})),Ba=io((function(e,t){var r={};if(null==e)return r;var i=!1;t=Ot(t,(function(t){return t=xn(t,e),i||(i=t.length>1),t})),Dn(e,oo(e),r),i&&(r=li(r,7,to));for(var n=t.length;n--;)dn(r,t[n]);return r}));var Ra=io((function(e,t){return null==e?{}:function(e,t){return Zi(e,t,(function(t,r){return Sa(e,r)}))}(e,t)}));function Fa(e,t){if(null==e)return{};var r=Ot(oo(e),(function(e){return[e]}));return t=co(t),Zi(e,r,(function(e,r){return t(e,r[0])}))}var ja=$n(ka),Va=$n(La);function Na(e){return null==e?[]:Jt(e,ka(e))}var Ua=Rn((function(e,t,r){return t=t.toLowerCase(),e+(r?Ha(t):t)}));function Ha(e){return $a(ya(e).toLowerCase())}function Ga(e){return(e=ya(e))&&e.replace(xe,ir).replace(et,"")}var Za=Rn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=Rn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Qa=Bn("toLowerCase");var qa=Rn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Xa=Rn((function(e,t,r){return e+(r?" ":"")+$a(t)}));var Ya=Rn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),$a=Bn("toUpperCase");function Ka(e,t,i){return e=ya(e),(t=i?r:t)===r?function(e){return nt.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Ja=Yi((function(e,t){try{return Et(e,r,t)}catch(e){return $s(e)?e:new Ce(e)}})),el=io((function(e,t){return St(t,(function(t){t=Fo(t),oi(e,t,Ps(e[t],e))})),e}));function tl(e){return function(){return e}}var rl=Vn(),il=Vn(!0);function nl(e){return e}function ol(e){return zi("function"==typeof e?e:li(e,1))}var sl=Yi((function(e,t){return function(r){return Pi(r,e,t)}})),al=Yi((function(e,t){return function(r){return Pi(e,r,t)}}));function ll(e,t,r){var i=ka(t),n=bi(t,i);null!=r||ta(t)&&(n.length||!i.length)||(r=t,t=e,e=this,n=bi(t,ka(t)));var o=!(ta(r)&&"chain"in r&&!r.chain),s=Ks(e);return St(n,(function(r){var i=t[r];e[r]=i,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Pn(this.__actions__)).push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,zt([this.value()],arguments))})})),e}function cl(){}var ul=Gn(Ot),hl=Gn(Pt),dl=Gn(Ft);function pl(e){return bo(e)?Wt(Fo(e)):function(e){return function(t){return wi(t,e)}}(e)}var fl=Wn(),ml=Wn(!0);function gl(){return[]}function Al(){return!1}var _l=Hn((function(e,t){return e+t}),0),yl=Xn("ceil"),xl=Hn((function(e,t){return e/t}),1),vl=Xn("floor");var bl,wl=Hn((function(e,t){return e*t}),1),Cl=Xn("round"),Tl=Hn((function(e,t){return e-t}),0);return Vr.after=function(e,t){if("function"!=typeof t)throw new Pe(i);return e=ma(e),function(){if(--e<1)return t.apply(this,arguments)}},Vr.ary=Ss,Vr.assign=xa,Vr.assignIn=va,Vr.assignInWith=ba,Vr.assignWith=wa,Vr.at=Ca,Vr.before=Is,Vr.bind=Ps,Vr.bindAll=el,Vr.bindKey=Ds,Vr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Zs(e)?e:[e]},Vr.chain=ps,Vr.chunk=function(e,t,i){t=(i?vo(e,t,i):t===r)?1:_r(ma(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var o=0,s=0,a=se(mt(n/t));o<n;)a[s++]=nn(e,o,o+=t);return a},Vr.compact=function(e){for(var t=-1,r=null==e?0:e.length,i=0,n=[];++t<r;){var o=e[t];o&&(n[i++]=o)}return n},Vr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=se(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return zt(Zs(r)?Pn(r):[r],Ai(t,1))},Vr.cond=function(e){var t=null==e?0:e.length,r=co();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new Pe(i);return[r(e[0]),e[1]]})):[],Yi((function(r){for(var i=-1;++i<t;){var n=e[i];if(Et(n[0],this,r))return Et(n[1],this,r)}}))},Vr.conforms=function(e){return function(e){var t=ka(e);return function(r){return ci(r,e,t)}}(li(e,1))},Vr.constant=tl,Vr.countBy=gs,Vr.create=function(e,t){var r=Nr(e);return null==t?r:ni(r,t)},Vr.curry=function e(t,i,n){var o=Kn(t,8,r,r,r,r,r,i=n?r:i);return o.placeholder=e.placeholder,o},Vr.curryRight=function e(t,i,n){var o=Kn(t,s,r,r,r,r,r,i=n?r:i);return o.placeholder=e.placeholder,o},Vr.debounce=ks,Vr.defaults=Ta,Vr.defaultsDeep=Ea,Vr.defer=Ls,Vr.delay=Os,Vr.difference=No,Vr.differenceBy=Uo,Vr.differenceWith=Ho,Vr.drop=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,(t=i||t===r?1:ma(t))<0?0:t,n):[]},Vr.dropRight=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,0,(t=n-(t=i||t===r?1:ma(t)))<0?0:t):[]},Vr.dropRightWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!0,!0):[]},Vr.dropWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!0):[]},Vr.fill=function(e,t,i,n){var o=null==e?0:e.length;return o?(i&&"number"!=typeof i&&vo(e,t,i)&&(i=0,n=o),function(e,t,i,n){var o=e.length;for((i=ma(i))<0&&(i=-i>o?0:o+i),(n=n===r||n>o?o:ma(n))<0&&(n+=o),n=i>n?0:ga(n);i<n;)e[i++]=t;return e}(e,t,i,n)):[]},Vr.filter=function(e,t){return(Zs(e)?Dt:gi)(e,co(t,3))},Vr.flatMap=function(e,t){return Ai(Cs(e,t),1)},Vr.flatMapDeep=function(e,t){return Ai(Cs(e,t),h)},Vr.flatMapDepth=function(e,t,i){return i=i===r?1:ma(i),Ai(Cs(e,t),i)},Vr.flatten=Wo,Vr.flattenDeep=function(e){return(null==e?0:e.length)?Ai(e,h):[]},Vr.flattenDepth=function(e,t){return(null==e?0:e.length)?Ai(e,t=t===r?1:ma(t)):[]},Vr.flip=function(e){return Kn(e,512)},Vr.flow=rl,Vr.flowRight=il,Vr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,i={};++t<r;){var n=e[t];i[n[0]]=n[1]}return i},Vr.functions=function(e){return null==e?[]:bi(e,ka(e))},Vr.functionsIn=function(e){return null==e?[]:bi(e,La(e))},Vr.groupBy=vs,Vr.initial=function(e){return(null==e?0:e.length)?nn(e,0,-1):[]},Vr.intersection=qo,Vr.intersectionBy=Xo,Vr.intersectionWith=Yo,Vr.invert=Ia,Vr.invertBy=Pa,Vr.invokeMap=bs,Vr.iteratee=ol,Vr.keyBy=ws,Vr.keys=ka,Vr.keysIn=La,Vr.map=Cs,Vr.mapKeys=function(e,t){var r={};return t=co(t,3),xi(e,(function(e,i,n){oi(r,t(e,i,n),e)})),r},Vr.mapValues=function(e,t){var r={};return t=co(t,3),xi(e,(function(e,i,n){oi(r,i,t(e,i,n))})),r},Vr.matches=function(e){return Vi(li(e,1))},Vr.matchesProperty=function(e,t){return Ni(e,li(t,1))},Vr.memoize=zs,Vr.merge=Oa,Vr.mergeWith=za,Vr.method=sl,Vr.methodOf=al,Vr.mixin=ll,Vr.negate=Bs,Vr.nthArg=function(e){return e=ma(e),Yi((function(t){return Hi(t,e)}))},Vr.omit=Ba,Vr.omitBy=function(e,t){return Fa(e,Bs(co(t)))},Vr.once=function(e){return Is(2,e)},Vr.orderBy=function(e,t,i,n){return null==e?[]:(Zs(t)||(t=null==t?[]:[t]),Zs(i=n?r:i)||(i=null==i?[]:[i]),Gi(e,t,i))},Vr.over=ul,Vr.overArgs=Rs,Vr.overEvery=hl,Vr.overSome=dl,Vr.partial=Fs,Vr.partialRight=js,Vr.partition=Ts,Vr.pick=Ra,Vr.pickBy=Fa,Vr.property=pl,Vr.propertyOf=function(e){return function(t){return null==e?r:wi(e,t)}},Vr.pull=Ko,Vr.pullAll=Jo,Vr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wi(e,t,co(r,2)):e},Vr.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?Wi(e,t,r,i):e},Vr.pullAt=es,Vr.range=fl,Vr.rangeRight=ml,Vr.rearg=Vs,Vr.reject=function(e,t){return(Zs(e)?Dt:gi)(e,Bs(co(t,3)))},Vr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var i=-1,n=[],o=e.length;for(t=co(t,3);++i<o;){var s=e[i];t(s,i,e)&&(r.push(s),n.push(i))}return Qi(e,n),r},Vr.rest=function(e,t){if("function"!=typeof e)throw new Pe(i);return Yi(e,t=t===r?t:ma(t))},Vr.reverse=ts,Vr.sampleSize=function(e,t,i){return t=(i?vo(e,t,i):t===r)?1:ma(t),(Zs(e)?Kr:Ki)(e,t)},Vr.set=function(e,t,r){return null==e?e:Ji(e,t,r)},Vr.setWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:Ji(e,t,i,n)},Vr.shuffle=function(e){return(Zs(e)?Jr:rn)(e)},Vr.slice=function(e,t,i){var n=null==e?0:e.length;return n?(i&&"number"!=typeof i&&vo(e,t,i)?(t=0,i=n):(t=null==t?0:ma(t),i=i===r?n:ma(i)),nn(e,t,i)):[]},Vr.sortBy=Es,Vr.sortedUniq=function(e){return e&&e.length?ln(e):[]},Vr.sortedUniqBy=function(e,t){return e&&e.length?ln(e,co(t,2)):[]},Vr.split=function(e,t,i){return i&&"number"!=typeof i&&vo(e,t,i)&&(t=i=r),(i=i===r?f:i>>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=un(t))&&sr(e)?bn(pr(e),0,i):e.split(t,i):[]},Vr.spread=function(e,t){if("function"!=typeof e)throw new Pe(i);return t=null==t?0:_r(ma(t),0),Yi((function(r){var i=r[t],n=bn(r,0,t);return i&&zt(n,i),Et(e,this,n)}))},Vr.tail=function(e){var t=null==e?0:e.length;return t?nn(e,1,t):[]},Vr.take=function(e,t,i){return e&&e.length?nn(e,0,(t=i||t===r?1:ma(t))<0?0:t):[]},Vr.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?nn(e,(t=n-(t=i||t===r?1:ma(t)))<0?0:t,n):[]},Vr.takeRightWhile=function(e,t){return e&&e.length?fn(e,co(t,3),!1,!0):[]},Vr.takeWhile=function(e,t){return e&&e.length?fn(e,co(t,3)):[]},Vr.tap=function(e,t){return t(e),e},Vr.throttle=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new Pe(i);return ta(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),ks(e,t,{leading:n,maxWait:t,trailing:o})},Vr.thru=fs,Vr.toArray=pa,Vr.toPairs=ja,Vr.toPairsIn=Va,Vr.toPath=function(e){return Zs(e)?Ot(e,Fo):ca(e)?[e]:Pn(Ro(ya(e)))},Vr.toPlainObject=_a,Vr.transform=function(e,t,r){var i=Zs(e),n=i||Xs(e)||ua(e);if(t=co(t,4),null==r){var o=e&&e.constructor;r=n?i?new o:[]:ta(e)&&Ks(o)?Nr(Qe(e)):{}}return(n?St:xi)(e,(function(e,i,n){return t(r,e,i,n)})),r},Vr.unary=function(e){return Ss(e,1)},Vr.union=rs,Vr.unionBy=is,Vr.unionWith=ns,Vr.uniq=function(e){return e&&e.length?hn(e):[]},Vr.uniqBy=function(e,t){return e&&e.length?hn(e,co(t,2)):[]},Vr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hn(e,r,t):[]},Vr.unset=function(e,t){return null==e||dn(e,t)},Vr.unzip=os,Vr.unzipWith=ss,Vr.update=function(e,t,r){return null==e?e:pn(e,t,yn(r))},Vr.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:pn(e,t,yn(i),n)},Vr.values=Na,Vr.valuesIn=function(e){return null==e?[]:Jt(e,La(e))},Vr.without=as,Vr.words=Ka,Vr.wrap=function(e,t){return Fs(yn(t),e)},Vr.xor=ls,Vr.xorBy=cs,Vr.xorWith=us,Vr.zip=hs,Vr.zipObject=function(e,t){return An(e||[],t||[],ti)},Vr.zipObjectDeep=function(e,t){return An(e||[],t||[],Ji)},Vr.zipWith=ds,Vr.entries=ja,Vr.entriesIn=Va,Vr.extend=va,Vr.extendWith=ba,ll(Vr,Vr),Vr.add=_l,Vr.attempt=Ja,Vr.camelCase=Ua,Vr.capitalize=Ha,Vr.ceil=yl,Vr.clamp=function(e,t,i){return i===r&&(i=t,t=r),i!==r&&(i=(i=Aa(i))==i?i:0),t!==r&&(t=(t=Aa(t))==t?t:0),ai(Aa(e),t,i)},Vr.clone=function(e){return li(e,4)},Vr.cloneDeep=function(e){return li(e,5)},Vr.cloneDeepWith=function(e,t){return li(e,5,t="function"==typeof t?t:r)},Vr.cloneWith=function(e,t){return li(e,4,t="function"==typeof t?t:r)},Vr.conformsTo=function(e,t){return null==t||ci(e,t,ka(t))},Vr.deburr=Ga,Vr.defaultTo=function(e,t){return null==e||e!=e?t:e},Vr.divide=xl,Vr.endsWith=function(e,t,i){e=ya(e),t=un(t);var n=e.length,o=i=i===r?n:ai(ma(i),0,n);return(i-=t.length)>=0&&e.slice(i,o)==t},Vr.eq=Ns,Vr.escape=function(e){return(e=ya(e))&&Y.test(e)?e.replace(q,nr):e},Vr.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(ie,"\\$&"):e},Vr.every=function(e,t,i){var n=Zs(e)?Pt:fi;return i&&vo(e,t,i)&&(t=r),n(e,co(t,3))},Vr.find=As,Vr.findIndex=Go,Vr.findKey=function(e,t){return Vt(e,co(t,3),xi)},Vr.findLast=_s,Vr.findLastIndex=Zo,Vr.findLastKey=function(e,t){return Vt(e,co(t,3),vi)},Vr.floor=vl,Vr.forEach=ys,Vr.forEachRight=xs,Vr.forIn=function(e,t){return null==e?e:_i(e,co(t,3),La)},Vr.forInRight=function(e,t){return null==e?e:yi(e,co(t,3),La)},Vr.forOwn=function(e,t){return e&&xi(e,co(t,3))},Vr.forOwnRight=function(e,t){return e&&vi(e,co(t,3))},Vr.get=Ma,Vr.gt=Us,Vr.gte=Hs,Vr.has=function(e,t){return null!=e&&Ao(e,t,Mi)},Vr.hasIn=Sa,Vr.head=Qo,Vr.identity=nl,Vr.includes=function(e,t,r,i){e=Qs(e)?e:Na(e),r=r&&!i?ma(r):0;var n=e.length;return r<0&&(r=_r(n+r,0)),la(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&Ut(e,t,r)>-1},Vr.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ma(r);return n<0&&(n=_r(i+n,0)),Ut(e,t,n)},Vr.inRange=function(e,t,i){return t=fa(t),i===r?(i=t,t=0):i=fa(i),function(e,t,r){return e>=yr(t,r)&&e<_r(t,r)}(e=Aa(e),t,i)},Vr.invoke=Da,Vr.isArguments=Gs,Vr.isArray=Zs,Vr.isArrayBuffer=Ws,Vr.isArrayLike=Qs,Vr.isArrayLikeObject=qs,Vr.isBoolean=function(e){return!0===e||!1===e||ra(e)&&Ti(e)==_},Vr.isBuffer=Xs,Vr.isDate=Ys,Vr.isElement=function(e){return ra(e)&&1===e.nodeType&&!oa(e)},Vr.isEmpty=function(e){if(null==e)return!0;if(Qs(e)&&(Zs(e)||"string"==typeof e||"function"==typeof e.splice||Xs(e)||ua(e)||Gs(e)))return!e.length;var t=go(e);if(t==w||t==S)return!e.size;if(To(e))return!Bi(e).length;for(var r in e)if(Be.call(e,r))return!1;return!0},Vr.isEqual=function(e,t){return ki(e,t)},Vr.isEqualWith=function(e,t,i){var n=(i="function"==typeof i?i:r)?i(e,t):r;return n===r?ki(e,t,r,i):!!n},Vr.isError=$s,Vr.isFinite=function(e){return"number"==typeof e&&jt(e)},Vr.isFunction=Ks,Vr.isInteger=Js,Vr.isLength=ea,Vr.isMap=ia,Vr.isMatch=function(e,t){return e===t||Li(e,t,ho(t))},Vr.isMatchWith=function(e,t,i){return i="function"==typeof i?i:r,Li(e,t,ho(t),i)},Vr.isNaN=function(e){return na(e)&&e!=+e},Vr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Oi(e)},Vr.isNil=function(e){return null==e},Vr.isNull=function(e){return null===e},Vr.isNumber=na,Vr.isObject=ta,Vr.isObjectLike=ra,Vr.isPlainObject=oa,Vr.isRegExp=sa,Vr.isSafeInteger=function(e){return Js(e)&&e>=-9007199254740991&&e<=d},Vr.isSet=aa,Vr.isString=la,Vr.isSymbol=ca,Vr.isTypedArray=ua,Vr.isUndefined=function(e){return e===r},Vr.isWeakMap=function(e){return ra(e)&&go(e)==k},Vr.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Ti(e)},Vr.join=function(e,t){return null==e?"":Qt.call(e,t)},Vr.kebabCase=Za,Vr.last=$o,Vr.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var o=n;return i!==r&&(o=(o=ma(i))<0?_r(n+o,0):yr(o,n-1)),t==t?function(e,t,r){for(var i=r+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Nt(e,Gt,o,!0)},Vr.lowerCase=Wa,Vr.lowerFirst=Qa,Vr.lt=ha,Vr.lte=da,Vr.max=function(e){return e&&e.length?mi(e,nl,Ei):r},Vr.maxBy=function(e,t){return e&&e.length?mi(e,co(t,2),Ei):r},Vr.mean=function(e){return Zt(e,nl)},Vr.meanBy=function(e,t){return Zt(e,co(t,2))},Vr.min=function(e){return e&&e.length?mi(e,nl,Fi):r},Vr.minBy=function(e,t){return e&&e.length?mi(e,co(t,2),Fi):r},Vr.stubArray=gl,Vr.stubFalse=Al,Vr.stubObject=function(){return{}},Vr.stubString=function(){return""},Vr.stubTrue=function(){return!0},Vr.multiply=wl,Vr.nth=function(e,t){return e&&e.length?Hi(e,ma(t)):r},Vr.noConflict=function(){return ft._===this&&(ft._=Ne),this},Vr.noop=cl,Vr.now=Ms,Vr.pad=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return Zn(gt(n),r)+e+Zn(mt(n),r)},Vr.padEnd=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;return t&&i<t?e+Zn(t-i,r):e},Vr.padStart=function(e,t,r){e=ya(e);var i=(t=ma(t))?dr(e):0;return t&&i<t?Zn(t-i,r)+e:e},Vr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ya(e).replace(oe,""),t||0)},Vr.random=function(e,t,i){if(i&&"boolean"!=typeof i&&vo(e,t,i)&&(t=i=r),i===r&&("boolean"==typeof t?(i=t,t=r):"boolean"==typeof e&&(i=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var n=e;e=t,t=n}if(i||e%1||t%1){var o=br();return yr(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return qi(e,t)},Vr.reduce=function(e,t,r){var i=Zs(e)?Bt:qt,n=arguments.length<3;return i(e,co(t,4),r,n,di)},Vr.reduceRight=function(e,t,r){var i=Zs(e)?Rt:qt,n=arguments.length<3;return i(e,co(t,4),r,n,pi)},Vr.repeat=function(e,t,i){return t=(i?vo(e,t,i):t===r)?1:ma(t),Xi(ya(e),t)},Vr.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Vr.result=function(e,t,i){var n=-1,o=(t=xn(t,e)).length;for(o||(o=1,e=r);++n<o;){var s=null==e?r:e[Fo(t[n])];s===r&&(n=o,s=i),e=Ks(s)?s.call(e):s}return e},Vr.round=Cl,Vr.runInContext=e,Vr.sample=function(e){return(Zs(e)?$r:$i)(e)},Vr.size=function(e){if(null==e)return 0;if(Qs(e))return la(e)?dr(e):e.length;var t=go(e);return t==w||t==S?e.size:Bi(e).length},Vr.snakeCase=qa,Vr.some=function(e,t,i){var n=Zs(e)?Ft:on;return i&&vo(e,t,i)&&(t=r),n(e,co(t,3))},Vr.sortedIndex=function(e,t){return sn(e,t)},Vr.sortedIndexBy=function(e,t,r){return an(e,t,co(r,2))},Vr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var i=sn(e,t);if(i<r&&Ns(e[i],t))return i}return-1},Vr.sortedLastIndex=function(e,t){return sn(e,t,!0)},Vr.sortedLastIndexBy=function(e,t,r){return an(e,t,co(r,2),!0)},Vr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=sn(e,t,!0)-1;if(Ns(e[r],t))return r}return-1},Vr.startCase=Xa,Vr.startsWith=function(e,t,r){return e=ya(e),r=null==r?0:ai(ma(r),0,e.length),t=un(t),e.slice(r,r+t.length)==t},Vr.subtract=Tl,Vr.sum=function(e){return e&&e.length?Xt(e,nl):0},Vr.sumBy=function(e,t){return e&&e.length?Xt(e,co(t,2)):0},Vr.template=function(e,t,i){var n=Vr.templateSettings;i&&vo(e,t,i)&&(t=r),e=ya(e),t=ba({},t,n,Jn);var o,s,a=ba({},t.imports,n.imports,Jn),l=ka(a),c=Jt(a,l),u=0,h=t.interpolate||ve,d="__p += '",p=Se((t.escape||ve).source+"|"+h.source+"|"+(h===J?pe:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),f="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,i,n,a,l){return i||(i=n),d+=e.slice(u,l).replace(be,or),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Be.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(G,""):d).replace(Z,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Te(l,f+"return "+d).apply(r,c)}));if(g.source=d,$s(g))throw g;return g},Vr.times=function(e,t){if((e=ma(e))<1||e>d)return[];var r=f,i=yr(e,f);t=co(t),e-=f;for(var n=Yt(i,t);++r<e;)t(r);return n},Vr.toFinite=fa,Vr.toInteger=ma,Vr.toLength=ga,Vr.toLower=function(e){return ya(e).toLowerCase()},Vr.toNumber=Aa,Vr.toSafeInteger=function(e){return e?ai(ma(e),-9007199254740991,d):0===e?e:0},Vr.toString=ya,Vr.toUpper=function(e){return ya(e).toUpperCase()},Vr.trim=function(e,t,i){if((e=ya(e))&&(i||t===r))return $t(e);if(!e||!(t=un(t)))return e;var n=pr(e),o=pr(t);return bn(n,tr(n,o),rr(n,o)+1).join("")},Vr.trimEnd=function(e,t,i){if((e=ya(e))&&(i||t===r))return e.slice(0,fr(e)+1);if(!e||!(t=un(t)))return e;var n=pr(e);return bn(n,0,rr(n,pr(t))+1).join("")},Vr.trimStart=function(e,t,i){if((e=ya(e))&&(i||t===r))return e.replace(oe,"");if(!e||!(t=un(t)))return e;var n=pr(e);return bn(n,tr(n,pr(t))).join("")},Vr.truncate=function(e,t){var i=30,n="...";if(ta(t)){var o="separator"in t?t.separator:o;i="length"in t?ma(t.length):i,n="omission"in t?un(t.omission):n}var s=(e=ya(e)).length;if(sr(e)){var a=pr(e);s=a.length}if(i>=s)return e;var l=i-dr(n);if(l<1)return n;var c=a?bn(a,0,l).join(""):e.slice(0,l);if(o===r)return c+n;if(a&&(l+=c.length-l),sa(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Se(o.source,ya(fe.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(e.indexOf(un(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+n},Vr.unescape=function(e){return(e=ya(e))&&X.test(e)?e.replace(Q,mr):e},Vr.uniqueId=function(e){var t=++Re;return ya(e)+t},Vr.upperCase=Ya,Vr.upperFirst=$a,Vr.each=ys,Vr.eachRight=xs,Vr.first=Qo,ll(Vr,(bl={},xi(Vr,(function(e,t){Be.call(Vr.prototype,t)||(bl[t]=e)})),bl),{chain:!1}),Vr.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Vr[e].placeholder=Vr})),St(["drop","take"],(function(e,t){Gr.prototype[e]=function(i){i=i===r?1:_r(ma(i),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(i,n.__takeCount__):n.__views__.push({size:yr(i,f),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var r=t+1,i=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}})),St(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),St(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(nl)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yi((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Pi(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Bs(co(e)))},Gr.prototype.slice=function(e,t){e=ma(e);var i=this;return i.__filtered__&&(e>0||t<0)?new Gr(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(i=(t=ma(t))<0?i.dropRight(-t):i.take(t-e)),i)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(f)},xi(Gr.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Vr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Vr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,l=t instanceof Gr,c=a[0],u=l||Zs(t),h=function(e){var t=o.apply(Vr,zt([e],a));return n&&d?t[0]:t};u&&i&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,m=l&&!p;if(!s&&u){t=m?t:new Gr(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[h],thisArg:r}),new Hr(g,d)}return f&&m?e.apply(this,a):(g=this.thru(h),f?n?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=De[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Vr.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(Zs(n)?n:[],e)}return this[r]((function(r){return t.apply(Zs(r)?r:[],e)}))}})),xi(Gr.prototype,(function(e,t){var r=Vr[t];if(r){var i=r.name+"";Be.call(Dr,i)||(Dr[i]=[]),Dr[i].push({name:t,func:r})}})),Dr[Nn(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Pn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pn(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Zs(e),i=t<0,n=r?e.length:0,o=function(e,t,r){var i=-1,n=r.length;for(;++i<n;){var o=r[i],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=yr(t,e+s);break;case"takeRight":e=_r(e,t-s)}}return{start:e,end:t}}(0,n,this.__views__),s=o.start,a=o.end,l=a-s,c=i?a:s-1,u=this.__iteratees__,h=u.length,d=0,p=yr(l,this.__takeCount__);if(!r||!i&&n==l&&p==l)return mn(e,this.__actions__);var f=[];e:for(;l--&&d<p;){for(var m=-1,g=e[c+=t];++m<h;){var A=u[m],_=A.iteratee,y=A.type,x=_(g);if(2==y)g=x;else if(!x){if(1==y)continue e;break e}}f[d++]=g}return f},Vr.prototype.at=ms,Vr.prototype.chain=function(){return ps(this)},Vr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},Vr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Vr.prototype.plant=function(e){for(var t,i=this;i instanceof Ur;){var n=Vo(i);n.__index__=0,n.__values__=r,t?o.__wrapped__=n:t=n;var o=n;i=i.__wrapped__}return o.__wrapped__=e,t},Vr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fs,args:[ts],thisArg:r}),new Hr(t,this.__chain__)}return this.thru(ts)},Vr.prototype.toJSON=Vr.prototype.valueOf=Vr.prototype.value=function(){return mn(this.__wrapped__,this.__actions__)},Vr.prototype.first=Vr.prototype.head,Ke&&(Vr.prototype[Ke]=function(){return this}),Vr}();gt?((gt.exports=gr)._=gr,mt._=gr):ft._=gr}).call(P)}(zn,zn.exports);var Bn=zn.exports;const Rn={current:null},Fn=e=>{let{location:t,noOptionsText:n="No locations",disableComponentRestrictions:s=!1,showLocationIcon:a=!1,isDefault:l=!1,reset:c=!1,city:u,helperText:h="Please select commute destination from the list",restrictionOptions:p,isInvalid:m,apiKey:g,onChange:A,sx:_,onPlaceClick:y,...x}=e;const v=I.useRef(null),[T,E]=I.useState(null),[M,S]=I.useState(t?.name??""),[P,D]=I.useState([]),[k,L]=I.useState(!1),O=I.useRef(!1),z=I.useRef(null),B=I.useRef(!1),R=I.useMemo((()=>C.debounce(((e,t)=>{Rn.current?.getPlacePredictions({input:u&&u?.length>0&&e?.length>0?`${e} ${u}`:e,...s?{}:{componentRestrictions:{country:"ae"}},...p||{}},t)}),400)),[u,p]),F=()=>{!Rn.current&&window.google&&(Rn.current=new window.google.maps.places.AutocompleteService),!z.current&&window.google&&(z.current=new window.google.maps.places.PlacesService(document.createElement("div")))};I.useEffect((()=>{"undefined"==typeof window||O.current||(document.querySelector("#google-maps")?(L(!0),F()):function(e,t,r,i){if(!t)return;const n=document.createElement("script");n.setAttribute("async",""),n.setAttribute("id",r),n.src=e,n.onload=i,t.appendChild(n)}(`https://maps.googleapis.com/maps/api/js?key=${g}&libraries=places`,document.querySelector("head"),"google-maps",(()=>{L(!0),F()})),O.current=!0)}),[g]),I.useEffect((()=>{let e=!0;if(""!==M)return k&&R(M,(r=>{if(e){let e=[];T&&(e=[T]),r&&(e=[...e,...r]),D(e),!B.current&&r&&t?.name&&!T&&(B.current=!0,l?j(r[0]):E(r[0]))}})),()=>{e=!1};D(T?[T]:[])}),[T,M,R]);const j=e=>{if(E(e),!e)return A(void 0);e&&z.current&&z.current.getDetails({placeId:e.place_id},(t=>{t?.geometry?.location&&A({lat:t.geometry.location.lat(),lng:t.geometry.location.lng(),name:e.description})}))};return I.useEffect((()=>{if(c&&v?.current){const e=v.current?.getElementsByClassName?.("MuiAutocomplete-clearIndicator")?.[0];e&&(S(""),j(null),D([]),R("",(()=>e?.click?.())))}}),[c,v?.current]),r.jsx(b,{ref:v,getOptionLabel:e=>"string"==typeof e?e:e.description,filterOptions:e=>e,options:P,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:T,isOptionEqualToValue:(e,t)=>e?.place_id===t?.place_id,noOptionsText:n,onChange:(e,t)=>{D(t?[t,...P]:P),j(t)},onInputChange:(e,t)=>{S(t)},renderInput:e=>r.jsx(f,{...e,placeholder:"Enter your workplace, school, or station",error:m,helperText:m?h:" ",FormHelperTextProps:{sx:{textAlign:"center"}}}),renderOption:(e,t)=>o.createElement("li",{...e,key:t.place_id,onClick:r=>{e?.onClick?.(r),y?.(t.description)}},r.jsxs(i.Box,{children:[a&&r.jsx(w,{sx:{color:"text.secondary"}}),r.jsxs(d,{component:"span",color:"text.secondary",fontWeight:"bold",children:[t.structured_formatting.main_text,","]}),r.jsx(d,{component:"span",variant:"body2",ml:.5,color:"#767676",children:t.structured_formatting.secondary_text})]})),sx:_||{},...x},t?.name)},jn=(e,t)=>{const r=e??0,i=r%60,n=i>0?` ${i} ${t?"mins":"minutes"}`:"";if(r<60)return t?`${n}`:`Under ${n}`;const o=Math.floor(r/60);return 1===o&&60===r?t?"1 h":`Under 1 hour${n}`:t?`${o} h ${n}`:`Under ${o} hours${n}`},Vn=e=>{let t=Math.floor(e/60),r=e%60;return r=r<10?`0${r}`:r,0!==t&&"00"!==r?t>1?`${t} hrs ${r} mins`:`${t} hr ${r} mins`:"00"!==r&&0===t?`${r} mins`:"00"===r&&0!==t?t>1?`${t} hours`:`${t} hour`:"-"},Nn=(e,t)=>{const r=e?.[t]?.split("|");return r?.reduce(((e,t)=>{const r=t?.split(":");return r&&2===r.length&&(e[r[0]]=r[1]),e}),{})};var Un;exports.CommuteMethod=void 0,(Un=exports.CommuteMethod||(exports.CommuteMethod={})).public_transport="public_transport",Un.driving="driving",Un.walking="walking",Un.cycling="cycling";const Hn={public_transport:e=>{let{sx:t={},...n}=e;return r.jsx(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:r.jsxs("g",{id:"icon",children:[r.jsx("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsxs("g",{id:"icon_2",children:[r.jsx("path",{id:"Vector",d:"M7.91908 6.30424C8.28053 6.30424 8.64842 6.30424 9.00987 6.30424C9.37132 6.30424 9.8167 6.30424 10.2169 6.30424C10.4363 6.30424 10.3782 6.1687 10.3847 6.05252C10.3911 5.93634 10.3847 5.85242 10.2169 5.85242C9.45525 5.85242 8.68717 5.85242 7.91908 5.85242C7.69963 5.85242 7.75772 5.98797 7.75126 6.10415C7.74481 6.22033 7.75127 6.31069 7.91908 6.30424Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_2",d:"M6.69917 11.4097C6.7238 11.5121 6.7844 11.6022 6.86992 11.6636C6.95544 11.725 7.06017 11.7536 7.16503 11.7442C7.26989 11.7348 7.36788 11.688 7.44113 11.6124C7.51438 11.5368 7.55801 11.4374 7.56406 11.3323C7.56769 11.2693 7.55771 11.2063 7.53479 11.1476C7.51188 11.0888 7.47656 11.0357 7.43126 10.9918C7.38597 10.9479 7.33176 10.9143 7.2723 10.8933C7.21285 10.8722 7.14955 10.8643 7.08673 10.8699C7.02392 10.8755 6.96306 10.8946 6.9083 10.9259C6.85353 10.9571 6.80613 10.9998 6.76935 11.0511C6.73257 11.1023 6.70726 11.1608 6.69515 11.2227C6.68304 11.2846 6.68441 11.3484 6.69917 11.4097Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_3",d:"M10.6171 11.4032C10.6265 11.5179 10.681 11.6242 10.7688 11.6986C10.8566 11.7731 10.9703 11.8096 11.085 11.8002C11.1997 11.7908 11.3059 11.7362 11.3804 11.6484C11.4548 11.5607 11.4914 11.4469 11.482 11.3323C11.4773 11.2755 11.4615 11.2201 11.4354 11.1695C11.4094 11.1188 11.3736 11.0737 11.3302 11.0369C11.2867 11 11.2364 10.9721 11.1822 10.9546C11.1279 10.9372 11.0708 10.9306 11.014 10.9353C10.9572 10.94 10.9019 10.9558 10.8512 10.9818C10.8005 11.0078 10.7555 11.0436 10.7186 11.0871C10.6818 11.1305 10.6538 11.1808 10.6364 11.235C10.619 11.2893 10.6124 11.3465 10.6171 11.4032Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_4",d:"M10.2491 4.54216C10.5202 4.54216 10.6106 4.45827 10.6041 4.19363C10.5977 3.929 10.5009 3.88381 10.2685 3.88381C10.0361 3.88381 9.95224 3.98063 9.94579 4.20654C9.93933 4.43244 10.0297 4.53571 10.2491 4.54216Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_5",d:"M7.89967 4.54215C8.11266 4.54215 8.20303 4.41953 8.19012 4.18717C8.17722 3.95481 8.0804 3.87735 7.84804 3.88381C7.61568 3.89026 7.50596 4.00644 7.53178 4.26462C7.55759 4.5228 7.6673 4.55506 7.89967 4.54215Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_6",d:"M12.3597 5.54905C12.3662 5.34535 12.307 5.14499 12.1907 4.97759C12.0745 4.81019 11.9074 4.68468 11.7143 4.61963C11.5595 4.53254 11.3801 4.49982 11.2046 4.52673C11.0291 4.55364 10.8676 4.63862 10.7461 4.76807C10.6414 4.88671 10.4968 4.96278 10.3398 4.98182C10.1827 5.00086 10.0241 4.96154 9.89413 4.87134C9.83354 4.83215 9.78095 4.78176 9.73921 4.72288C9.61658 4.54861 9.26159 4.54216 9.26159 4.54216H8.99049C8.8672 4.52453 8.7415 4.53641 8.62369 4.5768C8.50587 4.6172 8.39932 4.68496 8.31278 4.77453C8.25775 4.84317 8.188 4.89859 8.10868 4.93666C8.02936 4.97473 7.9425 4.99449 7.85452 4.99449C7.76654 4.99449 7.67966 4.97473 7.60034 4.93666C7.52102 4.89859 7.45127 4.84317 7.39624 4.77453C7.31435 4.6873 7.21368 4.61987 7.10184 4.57738C6.99 4.53488 6.86994 4.51842 6.75079 4.52925C6.48589 4.53256 6.23267 4.63884 6.04474 4.82556C5.8568 5.01229 5.74891 5.26481 5.7439 5.52969V11.8873C5.74474 12.0184 5.77151 12.148 5.82265 12.2687C5.87379 12.3894 5.94829 12.4988 6.04188 12.5906C6.13547 12.6824 6.24628 12.7548 6.36795 12.8036C6.48962 12.8524 6.61972 12.8766 6.75079 12.8749H11.3012C11.4369 12.8784 11.572 12.8543 11.6981 12.804C11.8242 12.7537 11.9388 12.6782 12.0348 12.5822C12.1308 12.4862 12.2063 12.3716 12.2566 12.2455C12.3069 12.1194 12.331 11.9844 12.3275 11.8486L12.3597 5.54905ZM6.22154 11.3064C6.26027 10.1898 8.04169 10.306 7.9707 11.3516C7.94702 11.5707 7.84179 11.7729 7.6759 11.918C7.51002 12.0631 7.29563 12.1405 7.07531 12.1348C6.85499 12.1291 6.64486 12.0408 6.48669 11.8873C6.32852 11.7338 6.23387 11.5265 6.22154 11.3064ZM10.1717 11.3064C10.2104 10.1834 12.0112 10.3189 11.9208 11.3516C11.8972 11.5707 11.7919 11.7729 11.626 11.918C11.4601 12.0631 11.2458 12.1405 11.0254 12.1348C10.8051 12.1291 10.595 12.0408 10.4368 11.8873C10.2786 11.7338 10.184 11.5265 10.1717 11.3064ZM11.9208 8.64721C11.9331 8.74394 11.9233 8.84219 11.8921 8.93459C11.861 9.02699 11.8093 9.11113 11.741 9.18069C11.6727 9.25026 11.5895 9.30344 11.4977 9.33624C11.4058 9.36905 11.3078 9.38063 11.2108 9.3701C10.5008 9.3701 9.78439 9.3701 9.0744 9.3701H6.98962C6.46036 9.3701 6.22153 9.12484 6.21508 8.60848C6.20863 8.09212 6.21508 7.54995 6.21508 7.02069C6.20281 6.92396 6.21261 6.82568 6.24376 6.73328C6.2749 6.64088 6.32657 6.55675 6.3949 6.48718C6.46322 6.41762 6.54642 6.36444 6.63824 6.33163C6.73006 6.29883 6.82814 6.28725 6.92507 6.29777H7.14452C7.2478 6.29777 7.32526 6.29778 7.31235 6.16223C7.30913 6.10634 7.30913 6.0503 7.31235 5.99441C7.30833 5.91165 7.32289 5.82905 7.35497 5.75264C7.38705 5.67624 7.43584 5.60798 7.49774 5.55289C7.55964 5.4978 7.63309 5.45728 7.7127 5.43427C7.7923 5.41127 7.87605 5.40639 7.95779 5.41997C8.68715 5.41997 9.42295 5.41997 10.1523 5.41997C10.2455 5.40336 10.3414 5.40928 10.4319 5.43725C10.5223 5.46522 10.6048 5.51442 10.6724 5.58074C10.74 5.64707 10.7907 5.72861 10.8204 5.81853C10.8501 5.90846 10.8578 6.00416 10.8429 6.09769C10.8429 6.27196 10.8946 6.33005 11.0559 6.30423H11.2173C11.6691 6.35587 11.9144 6.50433 11.9337 7.01423C11.9531 7.52413 11.9273 8.10503 11.9208 8.64721Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_7",d:"M11.1786 6.73669H8.55161H6.69272L6.65399 8.6343C6.65399 8.90539 6.65399 8.91184 6.95735 8.91184H9.58432H11.4432L11.4819 7.01422C11.4819 6.74314 11.4755 6.73669 11.1786 6.73669Z",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_8",d:"M12.9923 14.0109C12.7664 13.8172 12.534 13.6301 12.3081 13.43C12.0822 13.2299 12.0176 13.1718 12.2564 12.933C12.3048 12.8782 12.3566 12.8264 12.4114 12.7781C12.5345 12.6557 12.6317 12.5097 12.6971 12.3489C12.7626 12.1881 12.7949 12.0158 12.7922 11.8422C12.7922 9.75737 12.7922 7.67904 12.7922 5.59424C12.7866 5.22734 12.6412 4.87641 12.3855 4.61317C12.0935 4.3087 11.6967 4.12645 11.2754 4.10326C11.1657 4.10326 11.0366 4.10327 10.9978 3.99355C10.9597 3.87059 10.8947 3.75761 10.8077 3.66275C10.7206 3.56789 10.6136 3.49349 10.4944 3.44491C10.3532 3.39014 10.1967 3.39014 10.0555 3.44491C9.93615 3.49033 9.82906 3.563 9.74278 3.65714C9.65649 3.75127 9.59337 3.86425 9.55849 3.98709C9.55849 4.04518 9.41649 4.08389 9.33904 4.0968C9.23156 4.10326 9.12379 4.10326 9.01631 4.0968C8.7775 4.0968 8.57742 4.09681 8.4806 3.80636C8.44258 3.72095 8.38744 3.64424 8.31861 3.58096C8.24978 3.51769 8.16873 3.46918 8.08043 3.43845C7.93862 3.38718 7.78332 3.38718 7.64151 3.43845C7.52227 3.48703 7.41529 3.56143 7.32824 3.65629C7.24119 3.75115 7.17623 3.86412 7.13806 3.98709C7.09933 4.10972 6.97025 4.09035 6.86052 4.0968C6.65085 4.10165 6.4443 4.14869 6.25319 4.23508C6.06208 4.32147 5.89032 4.44546 5.74817 4.59966C5.60601 4.75386 5.49638 4.93512 5.42578 5.13261C5.35518 5.3301 5.32509 5.53979 5.33728 5.74916C5.33728 7.63387 5.33728 9.51857 5.33728 11.3968C5.30208 11.703 5.3425 12.0132 5.45503 12.3001C5.56756 12.5871 5.74876 12.8421 5.98273 13.0427C5.98273 13.0427 6.04727 13.0879 6.06018 13.1202C6.07309 13.1524 6.0989 13.2492 5.99563 13.3202C5.67936 13.5461 5.38891 13.7979 5.08555 14.0431C4.99518 14.1206 4.95 14.198 5.08555 14.3078C5.22109 14.4175 5.27273 14.4433 5.39537 14.3078C5.518 14.1722 5.80199 13.9721 6.00853 13.8043C6.21507 13.6365 6.3829 13.4881 6.58299 13.3396C6.6454 13.3102 6.71419 13.2969 6.78307 13.3009H11.3916C11.4438 13.2994 11.4958 13.3083 11.5446 13.3272C11.5934 13.346 11.6379 13.3744 11.6756 13.4106C12.037 13.7204 12.4178 14.0044 12.7793 14.3142C12.9084 14.424 12.9794 14.411 13.0891 14.3142C13.1988 14.2174 13.0826 14.0883 12.9923 14.0109ZM10.2685 3.88381C10.5008 3.88381 10.5977 3.96773 10.6041 4.19363C10.6106 4.41954 10.5202 4.55507 10.2491 4.54216C9.97803 4.52925 9.9393 4.43244 9.94576 4.20654C9.95221 3.98063 10.0426 3.88381 10.2685 3.88381ZM7.84806 3.88381C8.08042 3.88381 8.17723 3.96772 8.19014 4.18717C8.20305 4.40663 8.11268 4.52925 7.89968 4.54216C7.68669 4.55507 7.55116 4.47117 7.53179 4.26462C7.51243 4.05808 7.60924 3.89027 7.84806 3.88381ZM11.3335 12.8813H6.78307C6.652 12.883 6.52188 12.8588 6.40021 12.81C6.27855 12.7612 6.16773 12.6889 6.07414 12.5971C5.98056 12.5053 5.90605 12.3959 5.85491 12.2752C5.80377 12.1545 5.77702 12.0249 5.77618 11.8938V5.53616C5.78119 5.27128 5.88907 5.01874 6.077 4.83201C6.26493 4.64528 6.51817 4.53903 6.78307 4.53572C6.90222 4.52488 7.02226 4.54134 7.1341 4.58384C7.24594 4.62634 7.34664 4.69376 7.42852 4.78099C7.48355 4.84964 7.55331 4.90503 7.63263 4.9431C7.71194 4.98118 7.7988 5.00096 7.88678 5.00096C7.97477 5.00096 8.06162 4.98118 8.14094 4.9431C8.22026 4.90503 8.29001 4.84964 8.34504 4.78099C8.43158 4.69143 8.53814 4.62366 8.65595 4.58327C8.77376 4.54288 8.89948 4.531 9.02277 4.54862H9.28095C9.28095 4.54862 9.63594 4.54862 9.75857 4.72935C9.80031 4.78822 9.8529 4.83861 9.91349 4.87781C10.0435 4.96801 10.2021 5.00733 10.3591 4.98829C10.5162 4.96925 10.6608 4.89318 10.7655 4.77453C10.887 4.64508 11.0484 4.56011 11.2239 4.5332C11.3995 4.50629 11.5789 4.53899 11.7336 4.62607C11.9268 4.69113 12.0939 4.81666 12.2101 4.98405C12.3263 5.15145 12.3856 5.35182 12.3791 5.55552V11.8615C12.3819 11.9984 12.3565 12.1344 12.3046 12.2611C12.2528 12.3878 12.1754 12.5025 12.0774 12.5981C11.9794 12.6937 11.8628 12.7682 11.7348 12.8169C11.6068 12.8656 11.4702 12.8876 11.3335 12.8813Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_9",d:"M11.2173 6.29777H11.0559C10.8946 6.29777 10.83 6.29778 10.843 6.09124C10.8578 5.99772 10.8501 5.90199 10.8204 5.81207C10.7907 5.72214 10.74 5.6406 10.6724 5.57428C10.6048 5.50795 10.5223 5.45877 10.4319 5.4308C10.3414 5.40283 10.2455 5.3969 10.1523 5.41351C9.42297 5.41351 8.68716 5.41351 7.95781 5.41351C7.87606 5.39992 7.79232 5.40481 7.71271 5.42781C7.6331 5.45081 7.55965 5.49136 7.49775 5.54645C7.43585 5.60154 7.38707 5.66978 7.35498 5.74618C7.3229 5.82258 7.30835 5.9052 7.31236 5.98797C7.30914 6.04386 7.30914 6.09988 7.31236 6.15577C7.31236 6.28486 7.24781 6.29778 7.14454 6.29133H6.92509C6.82815 6.2808 6.73008 6.29236 6.63825 6.32517C6.54643 6.35797 6.46323 6.41115 6.39491 6.48072C6.32659 6.55028 6.27492 6.63444 6.24377 6.72684C6.21263 6.81924 6.20282 6.91749 6.21509 7.01422C6.21509 7.54349 6.21509 8.07275 6.21509 8.60202C6.21509 9.11837 6.46037 9.35718 6.98964 9.36364H9.07442C9.78441 9.36364 10.5009 9.36364 11.2108 9.36364C11.3078 9.37416 11.4059 9.3626 11.4977 9.3298C11.5895 9.29699 11.6727 9.24381 11.741 9.17425C11.8093 9.10468 11.861 9.02053 11.8922 8.92813C11.9233 8.83573 11.9331 8.73747 11.9208 8.64074C11.9208 8.09857 11.9208 7.54993 11.9208 7.0013C11.9208 6.45267 11.6498 6.3494 11.2173 6.29777ZM7.93844 5.85241C8.70652 5.85241 9.4746 5.85241 10.2362 5.85241C10.404 5.85241 10.4105 5.92988 10.404 6.05251C10.3976 6.17515 10.4557 6.31068 10.2362 6.30423C9.83605 6.30423 9.42941 6.30423 9.02923 6.30423C8.62905 6.30423 8.29989 6.30423 7.93844 6.30423C7.77063 6.30423 7.76417 6.22678 7.77062 6.10414C7.77708 5.98151 7.69963 5.85241 7.91908 5.85241H7.93844ZM11.4626 8.91184H9.60369H6.95735C6.66045 8.91184 6.65399 8.91184 6.65399 8.6343L6.69272 6.73669H8.55161H11.1786C11.4755 6.73669 11.4819 6.73668 11.4819 7.01422L11.4626 8.91184Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_10",d:"M6.22153 11.3065C6.23386 11.5265 6.3285 11.7339 6.48667 11.8873C6.64485 12.0408 6.85498 12.1292 7.07529 12.1348C7.29561 12.1405 7.51 12.0631 7.67589 11.918C7.84177 11.7729 7.94701 11.5708 7.97068 11.3516C8.04168 10.306 6.26025 10.1898 6.22153 11.3065ZM6.66689 11.4097C6.6618 11.3529 6.66794 11.2957 6.68497 11.2413C6.702 11.1869 6.7296 11.1363 6.76616 11.0926C6.80272 11.0488 6.84754 11.0127 6.89806 10.9863C6.94858 10.9599 7.00381 10.9436 7.0606 10.9385C7.11739 10.9335 7.17462 10.9396 7.22903 10.9566C7.28345 10.9737 7.33398 11.0013 7.37773 11.0378C7.42148 11.0744 7.45761 11.1192 7.48404 11.1697C7.51047 11.2203 7.5267 11.2755 7.53178 11.3323C7.51606 11.4264 7.46962 11.5127 7.39971 11.5777C7.3298 11.6427 7.24035 11.6828 7.1453 11.6916C7.05025 11.7005 6.95494 11.6776 6.87424 11.6266C6.79354 11.5756 6.73197 11.4994 6.69915 11.4097H6.66689Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"}),r.jsx("path",{id:"Vector_11",d:"M10.1717 11.3064C10.184 11.5265 10.2786 11.7338 10.4368 11.8873C10.595 12.0408 10.8051 12.1291 11.0254 12.1348C11.2457 12.1405 11.4601 12.0631 11.626 11.918C11.7919 11.7729 11.8971 11.5707 11.9208 11.3516C12.0112 10.3189 10.2104 10.1834 10.1717 11.3064ZM10.617 11.4032C10.6124 11.3465 10.6189 11.2893 10.6363 11.2351C10.6538 11.1808 10.6817 11.1305 10.7186 11.0871C10.7554 11.0436 10.8005 11.0078 10.8512 10.9818C10.9019 10.9558 10.9572 10.94 11.014 10.9353C11.0708 10.9306 11.1279 10.9372 11.1822 10.9546C11.2364 10.9721 11.2867 11 11.3301 11.0369C11.3736 11.0737 11.4094 11.1188 11.4354 11.1695C11.4615 11.2201 11.4773 11.2755 11.4819 11.3323C11.4913 11.447 11.4548 11.5607 11.3804 11.6484C11.3059 11.7362 11.1997 11.7908 11.085 11.8002C10.9703 11.8096 10.8565 11.7731 10.7688 11.6987C10.681 11.6242 10.6264 11.5179 10.617 11.4032Z",fill:"#2E3841",stroke:"#2E3841",strokeWidth:"0.15"})]})]})})},driving:e=>{let{sx:t={},...n}=e;return r.jsxs(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:[r.jsx("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.40724 5.08476L4.8924 7.14411H13.2078L12.693 5.08476C12.6467 5.0708 12.5909 5.05428 12.5262 5.03582C12.3181 4.97634 12.0198 4.89678 11.6615 4.81718C10.9429 4.65748 9.99314 4.4999 9.05011 4.4999C8.10708 4.4999 7.15736 4.65748 6.43868 4.81718C6.08047 4.89678 5.78217 4.97634 5.57399 5.03582C5.50937 5.05428 5.45349 5.0708 5.40724 5.08476ZM12.9432 4.84874L13.0381 4.56414C13.1354 4.59657 13.2094 4.67647 13.2343 4.77598L13.8606 7.28141L14.664 7.9952C15.1083 8.38992 15.2968 9.00008 15.1523 9.57692M15.1523 9.57692L14.5409 12.0229V12.9593C14.5409 13.304 14.2612 13.5837 13.9165 13.5837H12.6188C12.274 13.5837 11.9944 13.304 11.9944 12.9593V12.286H6.10586V12.9593C6.10586 13.304 5.8262 13.5837 5.48144 13.5837H4.18374C3.83897 13.5837 3.55931 13.304 3.55931 12.9593V12.0229L2.94802 9.57713C2.80349 9.00029 2.99194 8.38992 3.4362 7.9952L4.2396 7.28141L4.86597 4.77598C4.89085 4.67647 4.96484 4.59657 5.06214 4.56414L5.15701 4.84874C5.06214 4.56414 5.06209 4.56416 5.06214 4.56414L5.06424 4.56344L5.06915 4.56183L5.08725 4.55594C5.10294 4.55088 5.12579 4.5436 5.15534 4.53441C5.21442 4.51603 5.3003 4.49001 5.40916 4.4589C5.62679 4.39673 5.93678 4.31407 6.30853 4.23147C7.04977 4.06675 8.04659 3.8999 9.05011 3.8999C10.0536 3.8999 11.0505 4.06675 11.7917 4.23147C12.1634 4.31407 12.4734 4.39673 12.6911 4.4589C12.7999 4.49001 12.8858 4.51603 12.9449 4.53441C12.9744 4.5436 12.9973 4.55088 13.013 4.55594L13.0311 4.56183L13.036 4.56344L13.0381 4.56414C13.0381 4.56416 13.0381 4.56414 12.9432 4.84874M4.62218 7.74411L3.83471 8.44374C3.55751 8.69003 3.43975 9.0712 3.53001 9.43122L4.09356 11.686H14.0067L14.5702 9.43143C14.6604 9.07141 14.5427 8.69003 14.2655 8.44374L13.478 7.74411H4.62218ZM4.15931 12.286V12.9593C4.15931 12.9726 4.17034 12.9837 4.18374 12.9837H5.48144C5.49484 12.9837 5.50586 12.9726 5.50586 12.9593V12.286H4.15931ZM12.5944 12.286V12.9593C12.5944 12.9726 12.6054 12.9837 12.6188 12.9837H13.9165C13.9299 12.9837 13.9409 12.9726 13.9409 12.9593V12.286H12.5944ZM5.00786 9.71462C5.00771 9.71708 5.0079 9.72058 5.01072 9.72622C5.21424 10.1322 5.62943 10.3883 6.08292 10.3883H6.45471C6.64784 10.3883 6.80356 10.2326 6.80356 10.0395C6.80356 9.84635 6.64784 9.69063 6.45471 9.69063H5.03308C5.02655 9.69063 5.02322 9.69208 5.02104 9.69334C5.01818 9.695 5.01479 9.69799 5.012 9.70249C5.00921 9.707 5.00806 9.71136 5.00786 9.71462ZM4.47407 9.99455C4.26656 9.57954 4.56884 9.09063 5.03308 9.09063H6.45471C6.97921 9.09063 7.40356 9.51497 7.40356 10.0395C7.40356 10.564 6.97921 10.9883 6.45471 10.9883H6.08292C5.40222 10.9883 4.77925 10.6034 4.47407 9.99455ZM11.6456 9.69063C11.4525 9.69063 11.2968 9.84635 11.2968 10.0395C11.2968 10.2326 11.4525 10.3883 11.6456 10.3883H12.0174C12.471 10.3883 12.8861 10.1319 13.089 9.72622C13.0918 9.72058 13.092 9.71706 13.0918 9.71456C13.0916 9.71126 13.0905 9.70687 13.0877 9.70233C13.0849 9.69779 13.0815 9.69483 13.0787 9.69321C13.0766 9.692 13.0735 9.69063 13.0673 9.69063H11.6456ZM10.6968 10.0395C10.6968 9.51497 11.1211 9.09063 11.6456 9.09063H13.0673C13.5314 9.09063 13.8329 9.57998 13.6256 9.99455C13.3211 10.6037 12.6981 10.9883 12.0174 10.9883H11.6456C11.1211 10.9883 10.6968 10.564 10.6968 10.0395Z",fill:"#2E3841"})]})},walking:e=>{let{sx:t={},...n}=e;return r.jsxs(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:[r.jsx("path",{d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{d:"M6.5 14L7.99995 12.5L8.49993 10.5M8.49993 10.5L8.99991 7M8.49993 10.5L9.99988 12L10.4999 14M8.99991 7L9.99988 9.5L11.4998 10M8.99991 7L7.49996 8.5L6.99998 10.5M10.4999 5C10.4999 5.552 10.0519 6 9.4999 6C8.94791 6 8.49993 5.552 8.49993 5C8.49993 4.448 8.94791 4 9.4999 4C10.0519 4 10.4999 4.448 10.4999 5Z",stroke:"#2E3841",strokeWidth:"0.65",strokeLinecap:"round",strokeLinejoin:"round"})]})},cycling:e=>{let{sx:t={},...n}=e;return r.jsx(i.SvgIcon,{width:"18",height:"18",viewBox:"0 0 18 18",sx:{fill:"none",...t},...n,children:r.jsxs("g",{id:"Method/Cycling",children:[r.jsx("path",{id:"Ellipse 287",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18Z",fill:"white"}),r.jsx("path",{id:"bike_icon (Stroke)",fillRule:"evenodd",clipRule:"evenodd",d:"M9.85001 5C9.85001 4.83432 9.98433 4.7 10.15 4.7H11.45C11.6157 4.7 11.75 4.83432 11.75 5V6.90132L12.3293 8.63925C12.4656 8.61348 12.6062 8.6 12.75 8.6C13.9927 8.6 15 9.60727 15 10.85C15 12.0927 13.9927 13.1 12.75 13.1C11.5073 13.1 10.5 12.0927 10.5 10.85C10.5 9.96249 11.0137 9.19508 11.7601 8.82887L11.3398 7.56801L9.08427 10.3874C9.0381 10.4451 8.97224 10.4838 8.89933 10.4959L7.19892 10.7793C7.19965 10.8028 7.20001 10.8264 7.20001 10.85C7.20001 12.0927 6.19275 13.1 4.95001 13.1C3.70728 13.1 2.70001 12.0927 2.70001 10.85C2.70001 9.60727 3.70728 8.6 4.95001 8.6C4.97366 8.6 4.99722 8.60037 5.02069 8.60109L5.30409 6.90068C5.3282 6.75602 5.45336 6.65 5.60001 6.65H11.15V5.3H10.15C9.98433 5.3 9.85001 5.16569 9.85001 5ZM10.8258 7.25H6.32428L8.82514 9.75086L10.8258 7.25ZM8.22567 9.99992L5.80009 7.57435L5.61263 8.69914C6.32244 8.91752 6.8825 9.47758 7.10088 10.1874L8.22567 9.99992ZM6.50159 10.2873C6.33525 9.82864 5.97137 9.46477 5.51275 9.29842L5.31498 10.485L6.50159 10.2873ZM4.92083 9.20025C4.02293 9.21582 3.30001 9.94838 3.30001 10.85C3.30001 11.7614 4.03865 12.5 4.95001 12.5C5.85163 12.5 6.58419 11.7771 6.59976 10.8792L4.99933 11.1459C4.90376 11.1618 4.80639 11.1306 4.73788 11.0621C4.66937 10.9936 4.63817 10.8962 4.65409 10.8007L4.92083 9.20025ZM11.9522 9.4053C11.444 9.68649 11.1 10.228 11.1 10.85C11.1 11.7614 11.8386 12.5 12.75 12.5C13.6614 12.5 14.4 11.7614 14.4 10.85C14.4 9.93864 13.6614 9.2 12.75 9.2C12.6725 9.2 12.5962 9.20535 12.5215 9.2157L13.0346 10.7551C13.087 10.9123 13.0021 11.0822 12.8449 11.1346C12.6877 11.187 12.5178 11.1021 12.4654 10.9449L11.9522 9.4053Z",fill:"#2E3841"})]})})}},Gn=[{icon:fe,id:exports.CommuteMethod.driving},{icon:de,id:exports.CommuteMethod.public_transport},{icon:me,id:exports.CommuteMethod.walking},{icon:pe,id:exports.CommuteMethod.cycling}],Zn=(e,t)=>{switch(e){case exports.CommuteMethod.cycling:case exports.CommuteMethod.driving:return{width:"35px",height:"auto",...t&&{path:{fill:"white"}}};case exports.CommuteMethod.public_transport:return{width:"auto",height:"36px",...t&&{"#Vector_8, #Vector_9, #Vector_10, #Vector_11":{fill:"white"},path:{stroke:"white"}}};case exports.CommuteMethod.walking:return{width:"auto",height:"31px",...t&&{path:{stroke:"white"}}};default:return}},Wn=e=>{let{disableCheck:t=!1,multiple:i=!1,commute:n,variant:s,isInvalid:a,googleAutocompleteApiKey:l,onChange:u}=e;const p=o.useMemo((()=>jn(n.time)),[n.time]),f=e=>()=>{if(!i)return u({...n,methods:[e.id]});const t=n.methods.includes(e.id);t&&1===n.methods.length||u({...n,methods:t?n.methods.filter((t=>t!==e.id)):n.methods.concat(e.id)})};return r.jsxs(h,{children:[r.jsx(Fn,{location:n.location,isInvalid:a,apiKey:l,onChange:e=>{u({...n,location:e})}}),r.jsxs(h,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[r.jsx(d,{variant:"h4",mb:1,mt:2,children:"Commute Time"}),p]}),r.jsx(c,{sx:{px:2},children:r.jsx(y,{value:n.time,onChange:(e,t)=>{u({...n,time:t})},min:10,max:120,step:10,color:"secondary"})}),r.jsx(d,{variant:"h4",mb:1,mt:2,children:"Commute Method(s)"}),r.jsx(h,{direction:"row",justifyContent:"space-between",gap:.5,children:Gn.map((e=>r.jsxs(c,{sx:{position:"relative"},children:[!t&&n.methods.includes(e.id)&&r.jsx(_,{fontSize:"small",color:"primary",sx:{position:"absolute",right:"-8px",top:"-8px",backgroundColor:"white",zIndex:1}}),r.jsx(ee,{shape:"square",variant:s&&n.methods.includes(e.id)?s:"outlined",color:s?"primary":n.methods.includes(e.id)?"success":"inherit",onClick:f(e),sx:n.methods.includes(e.id)?[e=>({"&&":{borderColor:e.palette.primary.main,"&:hover":{borderColor:e.palette.primary.main}}}),n.methods.includes(e.id)&&1===n.methods.length&&{cursor:"default"}]:void 0,children:r.jsx(e.icon,{sx:Zn(e.id,n.methods.includes(e.id))})})]},e.id)))})]})},Qn=e=>{let{areas:t,area:i,isInvalid:n,errorText:s="Please select an area from the list",onChange:a}=e;const[l,c]=o.useState("");return r.jsx(b,{value:i,disableClearable:0===i.length||0===l.length,onChange:(e,t)=>{a(t??"")},inputValue:l,onInputChange:(e,t)=>{c(t)},options:t,renderInput:e=>r.jsx(f,{...e,placeholder:"Location, borough, neighborhood, etc.",error:n,helperText:n?s:" ",FormHelperTextProps:{sx:{textAlign:"center"}}})})},qn=e=>{let{title:t="See My Matches",isValid:n=!0,isSubmitting:o=!1,onSubmit:s}=e;return r.jsxs(i.Stack,{position:"sticky",sx:e=>({bottom:0,background:e.palette.background.paper,borderTop:`1px solid ${e.palette.grey[300]}`,py:2,px:1,zIndex:2}),children:[r.jsx(ee,{fullWidth:!0,disabled:!n||o,onClick:s,children:o?r.jsx(i.CircularProgress,{}):t}),r.jsx(i.Stack,{direction:"row",justifyContent:"center",pt:.5,children:r.jsx(ye,{})})]})},Xn=e=>{let{loading:t=!1,render:n,color:o="#fff",sx:s={}}=e;return t?r.jsx(i.Backdrop,{sx:{color:o,backgroundColor:"transparent",zIndex:e=>e.zIndex.drawer+1,...s},open:t,children:r.jsx(i.CircularProgress,{color:"primary"})}):r.jsx(r.Fragment,{children:n()})};class Yn extends o.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?r.jsxs(i.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",width:"100%",p:3,children:[r.jsx(i.Box,{pb:1,children:r.jsx(Xn,{color:"error",render:()=>r.jsx(i.SvgIcon,{color:"warning",fontSize:"large",children:r.jsx(T,{})})})}),r.jsx(i.Typography,{gutterBottom:!0,variant:"h3",color:"error",children:"Something went wrong."}),r.jsx(i.Typography,{variant:"subtitle1",color:"error",children:"We know about the error, and are already actively working on its solution."})]}):this.props.children}}const $n=o.forwardRef((function(e,t){return r.jsx(i.Slide,{direction:"up",ref:t,...e})})),Kn=e=>{let{modalID:t,open:n,payload:s={},ModalComponent:a,DialogProps:l,onModalResolved:c=(()=>{}),onModalRejected:u=(()=>{}),onModalExited:h=(()=>{}),fullHeight:d}=e;const p=i.useTheme(),f=i.useMediaQuery(p.breakpoints.down("sm")),[m,g]=o.useState(n),[A,_]=o.useState(!1),y=e=>{g(!1),_(!1),u(e),h(t)};return o.useEffect((()=>{g(n)}),[n]),r.jsx(Yn,{children:r.jsx(a,{isModalEntered:A,payload:s,DialogProps:{disableEscapeKeyDown:!0,TransitionComponent:f?$n:void 0,sx:{[p.breakpoints.up("sm")]:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column","& > .MuiDialog-container":{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},[p.breakpoints.down("sm")]:{"& > .MuiDialog-container > .MuiPaper-root":{position:"absolute",left:0,right:0,bottom:0,m:0,[p.breakpoints.down("sm")]:{height:"100%",maxHeight:d?"auto":400},"@media (max-width: 320px)":{minHeight:436}}}},PaperProps:{elevation:0,sx:{overflow:"hidden",[p.breakpoints.up("sm")]:{borderRadius:"20px",width:483,maxWidth:483}}},...l,open:m,onClose:y,onExited:()=>{h(t),_(!1)},onEntered:()=>{_(!0)}},handleModalResolve:e=>{g(!1),_(!1),c(e),h(t)},handleModalReject:y})})},Jn=o.createContext({globalValues:null,modals:[],setGlobalValues:e=>{},deleteModal:e=>{},addModal:e=>{},openModal:e=>{}}),eo=e=>{let{pathname:t,children:i}=e;const n=o.useRef(0),[s,a]=o.useState({}),[l,c]=o.useState([]),u=o.useCallback((e=>{c((t=>t.filter((t=>t?.modalID!==e)))),n.current--}),[]),h=e=>{c((t=>t.concat({...e,modalID:n.current++,onModalExited:u})))},d=e=>{c([{...e,modalID:n.current++,onModalExited:u}])};o.useEffect((()=>{c([])}),[t]);const p=o.useMemo((()=>({modals:l,deleteModal:u,globalValues:s,setGlobalValues:a,addModal:h,openModal:d})),[]);return r.jsxs(Jn.Provider,{value:p,children:[i,l?.map((e=>r.jsx(Kn,{open:!0,...e},e?.modalID)))]})};var to={exports:{}},ro=to.exports=function(){var e,t,r;function i(i,n){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),r=n(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=n;else e=n}return i(["exports"],(function(e){var t="3.4.0";let r;const i={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){r=e}}return r},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!i.API_URL)return null;try{const e=new URL(i.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"};function n(e){return i.API_URL_REGEX.test(e)}function o(e){return 0===e.indexOf("mapbox:")}function s(e){return i.API_CDN_URL_REGEX.test(e)}function a(e){return i.API_SPRITE_REGEX.test(e)}function l(e){return i.API_STYLE_REGEX.test(e)&&!a(e)}const c={create:"create",load:"load",fullLoad:"fullLoad"};function u(e){const t=e.name.split("?")[0];return s(t)&&t.includes("mapbox-gl.js")?"javascript":s(t)&&t.includes("mapbox-gl.css")?"css":function(e){return i.API_FONTS_REGEX.test(e)}(t)?"fontRange":a(t)?"sprite":l(t)?"style":function(e){return i.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={},p={};Object.defineProperty(p,"__esModule",{value:!0}),p.setMatrixArrayType=function(e){p.ARRAY_TYPE=m=e},p.toRadian=function(e){return e*A},p.equals=function(e,t){return Math.abs(e-t)<=f*Math.max(1,Math.abs(e),Math.abs(t))},p.RANDOM=p.ARRAY_TYPE=p.EPSILON=void 0;var f=1e-6;p.EPSILON=f;var m="undefined"!=typeof Float32Array?Float32Array:Array;p.ARRAY_TYPE=m;var g=Math.random;p.RANDOM=g;var A=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var _={};function y(e){return y="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},y(e)}Object.defineProperty(_,"__esModule",{value:!0}),_.create=function(){var e=new x.ARRAY_TYPE(4);return x.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},_.clone=function(e){var t=new x.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},_.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},_.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},_.fromValues=function(e,t,r,i){var n=new x.ARRAY_TYPE(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},_.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},_.transpose=function(e,t){if(e===t){var r=t[1];e[1]=t[2],e[2]=r}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},_.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*o-n*i;return s?(e[0]=o*(s=1/s),e[1]=-i*s,e[2]=-n*s,e[3]=r*s,e):null},_.adjoint=function(e,t){var r=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=r,e},_.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},_.multiply=b,_.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*a,e[1]=n*l+s*a,e[2]=i*-a+o*l,e[3]=n*-a+s*l,e},_.scale=function(e,t,r){var i=t[1],n=t[2],o=t[3],s=r[0],a=r[1];return e[0]=t[0]*s,e[1]=i*s,e[2]=n*a,e[3]=o*a,e},_.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e},_.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},_.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},_.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},_.LDU=function(e,t,r,i){return e[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-e[2]*r[1],[e,t,r]},_.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},_.subtract=w,_.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},_.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=x.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=x.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-l)<=x.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=x.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},_.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},_.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},_.sub=_.mul=void 0;var x=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==y(e)&&"function"!=typeof e)return{default:e};var r=v(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(v=function(e){return e?r:t})(e)}function b(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*a+o*l,e[1]=n*a+s*l,e[2]=i*c+o*u,e[3]=n*c+s*u,e}function w(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}_.mul=b,_.sub=w;var C={};function T(e){return T="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},T(e)}Object.defineProperty(C,"__esModule",{value:!0}),C.create=function(){var e=new E.ARRAY_TYPE(6);return E.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},C.clone=function(e){var t=new E.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},C.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},C.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},C.fromValues=function(e,t,r,i,n,o){var s=new E.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=r,s[3]=i,s[4]=n,s[5]=o,s},C.set=function(e,t,r,i,n,o,s){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e},C.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=r*o-i*n;return l?(e[0]=o*(l=1/l),e[1]=-i*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*a-o*s)*l,e[5]=(i*s-r*a)*l,e):null},C.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},C.multiply=S,C.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=Math.sin(r),u=Math.cos(r);return e[0]=i*u+o*c,e[1]=n*u+s*c,e[2]=i*-c+o*u,e[3]=n*-c+s*u,e[4]=a,e[5]=l,e},C.scale=function(e,t,r){var i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=r[0],c=r[1];return e[0]=t[0]*l,e[1]=i*l,e[2]=n*c,e[3]=o*c,e[4]=s,e[5]=a,e},C.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=i*c+o*u+a,e[5]=n*c+s*u+l,e},C.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=-r,e[3]=i,e[4]=0,e[5]=0,e},C.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},C.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},C.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},C.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},C.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e},C.subtract=I,C.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e},C.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e},C.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},C.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=t[0],c=t[1],u=t[2],h=t[3],d=t[4],p=t[5];return Math.abs(r-l)<=E.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-c)<=E.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(n-u)<=E.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-h)<=E.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=E.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=E.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},C.sub=C.mul=void 0;var E=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==T(e)&&"function"!=typeof e)return{default:e};var r=M(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(M=function(e){return e?r:t})(e)}function S(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=r[0],u=r[1],h=r[2],d=r[3],p=r[4],f=r[5];return e[0]=i*c+o*u,e[1]=n*c+s*u,e[2]=i*h+o*d,e[3]=n*h+s*d,e[4]=i*p+o*f+a,e[5]=n*p+s*f+l,e}function I(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e}C.mul=S,C.sub=I;var P={};function D(e){return D="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},D(e)}Object.defineProperty(P,"__esModule",{value:!0}),P.create=function(){var e=new k.ARRAY_TYPE(9);return k.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},P.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},P.clone=function(e){var t=new k.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},P.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromValues=function(e,t,r,i,n,o,s,a,l){var c=new k.ARRAY_TYPE(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=n,c[5]=o,c[6]=s,c[7]=a,c[8]=l,c},P.set=function(e,t,r,i,n,o,s,a,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e},P.identity=function(e){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},P.transpose=function(e,t){if(e===t){var r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},P.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l,f=r*h+i*d+n*p;return f?(e[0]=h*(f=1/f),e[1]=(-u*i+n*c)*f,e[2]=(a*i-n*s)*f,e[3]=d*f,e[4]=(u*r-n*l)*f,e[5]=(-a*r+n*o)*f,e[6]=p*f,e[7]=(-c*r+i*l)*f,e[8]=(s*r-i*o)*f,e):null},P.adjoint=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=n*c-i*u,e[2]=i*a-n*s,e[3]=a*l-o*u,e[4]=r*u-n*l,e[5]=n*o-r*a,e[6]=o*c-s*l,e[7]=i*l-r*c,e[8]=r*s-i*o,e},P.determinant=function(e){var t=e[3],r=e[4],i=e[5],n=e[6],o=e[7],s=e[8];return e[0]*(s*r-i*o)+e[1]*(-s*t+i*n)+e[2]*(o*t-r*n)},P.multiply=O,P.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=d*i+p*s+c,e[7]=d*n+p*a+u,e[8]=d*o+p*l+h,e},P.rotate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*i+d*s,e[1]=p*n+d*a,e[2]=p*o+d*l,e[3]=p*s-d*i,e[4]=p*a-d*n,e[5]=p*l-d*o,e[6]=c,e[7]=u,e[8]=h,e},P.scale=function(e,t,r){var i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},P.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},P.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},P.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},P.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,l=n+n,c=r*s,u=i*s,h=i*a,d=n*s,p=n*a,f=n*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[3]=u-A,e[6]=d+g,e[1]=u+A,e[4]=1-c-f,e[7]=p-m,e[2]=d-g,e[5]=p+m,e[8]=1-c-h,e},P.normalFromMat4=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-i*s,y=r*l-n*s,x=r*c-o*s,v=i*l-n*a,b=i*c-o*a,w=n*c-o*l,C=u*m-h*f,T=u*g-d*f,E=u*A-p*f,M=h*g-d*m,S=h*A-p*m,I=d*A-p*g,P=_*I-y*S+x*M+v*E-b*T+w*C;return P?(e[0]=(a*I-l*S+c*M)*(P=1/P),e[1]=(l*E-s*I-c*T)*P,e[2]=(s*S-a*E+c*C)*P,e[3]=(n*S-i*I-o*M)*P,e[4]=(r*I-n*E+o*T)*P,e[5]=(i*E-r*S-o*C)*P,e[6]=(m*w-g*b+A*v)*P,e[7]=(g*x-f*w-A*y)*P,e[8]=(f*b-m*x+A*_)*P,e):null},P.projection=function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},P.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},P.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},P.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},P.subtract=z,P.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},P.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},P.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},P.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],A=t[6],_=t[7],y=t[8];return Math.abs(r-h)<=k.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-d)<=k.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(n-p)<=k.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(o-f)<=k.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=k.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-g)<=k.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-A)<=k.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(c-_)<=k.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-y)<=k.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))},P.sub=P.mul=void 0;var k=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==D(e)&&"function"!=typeof e)return{default:e};var r=L(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(L=function(e){return e?r:t})(e)}function O(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=r[0],p=r[1],f=r[2],m=r[3],g=r[4],A=r[5],_=r[6],y=r[7],x=r[8];return e[0]=d*i+p*s+f*c,e[1]=d*n+p*a+f*u,e[2]=d*o+p*l+f*h,e[3]=m*i+g*s+A*c,e[4]=m*n+g*a+A*u,e[5]=m*o+g*l+A*h,e[6]=_*i+y*s+x*c,e[7]=_*n+y*a+x*u,e[8]=_*o+y*l+x*h,e}function z(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}P.mul=O,P.sub=z;var B={};function R(e){return 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},R(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new F.ARRAY_TYPE(16);return F.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},B.clone=function(e){var t=new F.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},B.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.fromValues=function(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m){var g=new F.ARRAY_TYPE(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=i,g[4]=n,g[5]=o,g[6]=s,g[7]=a,g[8]=l,g[9]=c,g[10]=u,g[11]=h,g[12]=d,g[13]=p,g[14]=f,g[15]=m,g},B.set=function(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=u,e[10]=h,e[11]=d,e[12]=p,e[13]=f,e[14]=m,e[15]=g,e},B.identity=V,B.transpose=function(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=o,e[11]=t[14],e[12]=n,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},B.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15],_=r*a-i*s,y=r*l-n*s,x=r*c-o*s,v=i*l-n*a,b=i*c-o*a,w=n*c-o*l,C=u*m-h*f,T=u*g-d*f,E=u*A-p*f,M=h*g-d*m,S=h*A-p*m,I=d*A-p*g,P=_*I-y*S+x*M+v*E-b*T+w*C;return P?(e[0]=(a*I-l*S+c*M)*(P=1/P),e[1]=(n*S-i*I-o*M)*P,e[2]=(m*w-g*b+A*v)*P,e[3]=(d*b-h*w-p*v)*P,e[4]=(l*E-s*I-c*T)*P,e[5]=(r*I-n*E+o*T)*P,e[6]=(g*x-f*w-A*y)*P,e[7]=(u*w-d*x+p*y)*P,e[8]=(s*S-a*E+c*C)*P,e[9]=(i*E-r*S-o*C)*P,e[10]=(f*b-m*x+A*_)*P,e[11]=(h*x-u*b-p*_)*P,e[12]=(a*T-s*M-l*C)*P,e[13]=(r*M-i*T+n*C)*P,e[14]=(m*y-f*v-g*_)*P,e[15]=(u*v-h*y+d*_)*P,e):null},B.adjoint=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],A=t[15];return e[0]=a*(d*A-p*g)-h*(l*A-c*g)+m*(l*p-c*d),e[1]=-(i*(d*A-p*g)-h*(n*A-o*g)+m*(n*p-o*d)),e[2]=i*(l*A-c*g)-a*(n*A-o*g)+m*(n*c-o*l),e[3]=-(i*(l*p-c*d)-a*(n*p-o*d)+h*(n*c-o*l)),e[4]=-(s*(d*A-p*g)-u*(l*A-c*g)+f*(l*p-c*d)),e[5]=r*(d*A-p*g)-u*(n*A-o*g)+f*(n*p-o*d),e[6]=-(r*(l*A-c*g)-s*(n*A-o*g)+f*(n*c-o*l)),e[7]=r*(l*p-c*d)-s*(n*p-o*d)+u*(n*c-o*l),e[8]=s*(h*A-p*m)-u*(a*A-c*m)+f*(a*p-c*h),e[9]=-(r*(h*A-p*m)-u*(i*A-o*m)+f*(i*p-o*h)),e[10]=r*(a*A-c*m)-s*(i*A-o*m)+f*(i*c-o*a),e[11]=-(r*(a*p-c*h)-s*(i*p-o*h)+u*(i*c-o*a)),e[12]=-(s*(h*g-d*m)-u*(a*g-l*m)+f*(a*d-l*h)),e[13]=r*(h*g-d*m)-u*(i*g-n*m)+f*(i*d-n*h),e[14]=-(r*(a*g-l*m)-s*(i*g-n*m)+f*(i*l-n*a)),e[15]=r*(a*d-l*h)-s*(i*d-n*h)+u*(i*l-n*a),e},B.determinant=function(e){var t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15];return(t*s-r*o)*(h*g-d*m)-(t*a-i*o)*(u*g-d*f)+(t*l-n*o)*(u*m-h*f)+(r*a-i*s)*(c*g-d*p)-(r*l-n*s)*(c*m-h*p)+(i*l-n*a)*(c*f-u*p)},B.multiply=N,B.translate=function(e,t,r){var i,n,o,s,a,l,c,u,h,d,p,f,m=r[0],g=r[1],A=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*A+t[12],e[13]=t[1]*m+t[5]*g+t[9]*A+t[13],e[14]=t[2]*m+t[6]*g+t[10]*A+t[14],e[15]=t[3]*m+t[7]*g+t[11]*A+t[15]):(n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=i=t[0],e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=i*m+a*g+h*A+t[12],e[13]=n*m+l*g+d*A+t[13],e[14]=o*m+c*g+p*A+t[14],e[15]=s*m+u*g+f*A+t[15]),e},B.scale=function(e,t,r){var i=r[0],n=r[1],o=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.rotate=function(e,t,r,i){var n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S=i[0],I=i[1],P=i[2],D=Math.hypot(S,I,P);return D<F.EPSILON?null:(S*=D=1/D,I*=D,P*=D,n=Math.sin(r),o=Math.cos(r),l=t[1],c=t[2],u=t[3],d=t[5],p=t[6],f=t[7],g=t[9],A=t[10],_=t[11],y=S*S*(s=1-o)+o,b=S*I*s-P*n,w=I*I*s+o,C=P*I*s+S*n,T=S*P*s+I*n,E=I*P*s-S*n,M=P*P*s+o,e[0]=(a=t[0])*y+(h=t[4])*(x=I*S*s+P*n)+(m=t[8])*(v=P*S*s-I*n),e[1]=l*y+d*x+g*v,e[2]=c*y+p*x+A*v,e[3]=u*y+f*x+_*v,e[4]=a*b+h*w+m*C,e[5]=l*b+d*w+g*C,e[6]=c*b+p*w+A*C,e[7]=u*b+f*w+_*C,e[8]=a*T+h*E+m*M,e[9]=l*T+d*E+g*M,e[10]=c*T+p*E+A*M,e[11]=u*T+f*E+_*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},B.rotateX=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*n+c*i,e[5]=s*n+u*i,e[6]=a*n+h*i,e[7]=l*n+d*i,e[8]=c*n-o*i,e[9]=u*n-s*i,e[10]=h*n-a*i,e[11]=d*n-l*i,e},B.rotateY=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n-c*i,e[1]=s*n-u*i,e[2]=a*n-h*i,e[3]=l*n-d*i,e[8]=o*i+c*n,e[9]=s*i+u*n,e[10]=a*i+h*n,e[11]=l*i+d*n,e},B.rotateZ=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n+c*i,e[1]=s*n+u*i,e[2]=a*n+h*i,e[3]=l*n+d*i,e[4]=c*n-o*i,e[5]=u*n-s*i,e[6]=h*n-a*i,e[7]=d*n-l*i,e},B.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},B.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotation=function(e,t,r){var i,n,o,s=r[0],a=r[1],l=r[2],c=Math.hypot(s,a,l);return c<F.EPSILON?null:(s*=c=1/c,a*=c,l*=c,i=Math.sin(t),n=Math.cos(t),e[0]=s*s*(o=1-n)+n,e[1]=a*s*o+l*i,e[2]=l*s*o-a*i,e[3]=0,e[4]=s*a*o-l*i,e[5]=a*a*o+n,e[6]=l*a*o+s*i,e[7]=0,e[8]=s*l*o+a*i,e[9]=a*l*o-s*i,e[10]=l*l*o+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)},B.fromXRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromYRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromZRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.fromRotationTranslation=U,B.fromQuat2=function(e,t){var r=new F.ARRAY_TYPE(3),i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=i*i+n*n+o*o+s*s;return h>0?(r[0]=2*(a*s+u*i+l*o-c*n)/h,r[1]=2*(l*s+u*n+c*i-a*o)/h,r[2]=2*(c*s+u*o+a*n-l*i)/h):(r[0]=2*(a*s+u*i+l*o-c*n),r[1]=2*(l*s+u*n+c*i-a*o),r[2]=2*(c*s+u*o+a*n-l*i)),U(e,t,r),e},B.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},B.getScaling=H,B.getRotation=function(e,t){var r=new F.ARRAY_TYPE(3);H(r,t);var i=1/r[0],n=1/r[1],o=1/r[2],s=t[0]*i,a=t[1]*n,l=t[2]*o,c=t[4]*i,u=t[5]*n,h=t[6]*o,d=t[8]*i,p=t[9]*n,f=t[10]*o,m=s+u+f,g=0;return m>0?(g=2*Math.sqrt(m+1),e[3]=.25*g,e[0]=(h-p)/g,e[1]=(d-l)/g,e[2]=(a-c)/g):s>u&&s>f?(g=2*Math.sqrt(1+s-u-f),e[3]=(h-p)/g,e[0]=.25*g,e[1]=(a+c)/g,e[2]=(d+l)/g):u>f?(g=2*Math.sqrt(1+u-s-f),e[3]=(d-l)/g,e[0]=(a+c)/g,e[1]=.25*g,e[2]=(h+p)/g):(g=2*Math.sqrt(1+f-s-u),e[3]=(a-c)/g,e[0]=(d+l)/g,e[1]=(h+p)/g,e[2]=.25*g),e},B.fromRotationTranslationScale=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3],l=n+n,c=o+o,u=s+s,h=n*l,d=n*c,p=n*u,f=o*c,m=o*u,g=s*u,A=a*l,_=a*c,y=a*u,x=i[0],v=i[1],b=i[2];return e[0]=(1-(f+g))*x,e[1]=(d+y)*x,e[2]=(p-_)*x,e[3]=0,e[4]=(d-y)*v,e[5]=(1-(h+g))*v,e[6]=(m+A)*v,e[7]=0,e[8]=(p+_)*b,e[9]=(m-A)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},B.fromRotationTranslationScaleOrigin=function(e,t,r,i,n){var o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,u=s+s,h=a+a,d=o*c,p=o*u,f=o*h,m=s*u,g=s*h,A=a*h,_=l*c,y=l*u,x=l*h,v=i[0],b=i[1],w=i[2],C=n[0],T=n[1],E=n[2],M=(1-(m+A))*v,S=(p+x)*v,I=(f-y)*v,P=(p-x)*b,D=(1-(d+A))*b,k=(g+_)*b,L=(f+y)*w,O=(g-_)*w,z=(1-(d+m))*w;return e[0]=M,e[1]=S,e[2]=I,e[3]=0,e[4]=P,e[5]=D,e[6]=k,e[7]=0,e[8]=L,e[9]=O,e[10]=z,e[11]=0,e[12]=r[0]+C-(M*C+P*T+L*E),e[13]=r[1]+T-(S*C+D*T+O*E),e[14]=r[2]+E-(I*C+k*T+z*E),e[15]=1,e},B.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r+r,a=i+i,l=n+n,c=r*s,u=i*s,h=i*a,d=n*s,p=n*a,f=n*l,m=o*s,g=o*a,A=o*l;return e[0]=1-h-f,e[1]=u+A,e[2]=d-g,e[3]=0,e[4]=u-A,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+g,e[9]=p-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.frustum=function(e,t,r,i,n,o,s){var a=1/(r-t),l=1/(n-i),c=1/(o-s);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(n+i)*l,e[10]=(s+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*c,e[15]=0,e},B.perspectiveNO=G,B.perspectiveZO=function(e,t,r,i,n){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=n*(o=1/(i-n)),e[14]=n*i*o):(e[10]=-1,e[14]=-i),e},B.perspectiveFromFieldOfView=function(e,t,r,i){var n=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+a),c=2/(n+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-a)*l*.5,e[9]=(n-o)*c*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e},B.orthoNO=Z,B.orthoZO=function(e,t,r,i,n,o,s){var a=1/(t-r),l=1/(i-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*l,e[14]=o*c,e[15]=1,e},B.lookAt=function(e,t,r,i){var n,o,s,a,l,c,u,h,d,p,f=t[0],m=t[1],g=t[2],A=i[0],_=i[1],y=i[2],x=r[0],v=r[1],b=r[2];return Math.abs(f-x)<F.EPSILON&&Math.abs(m-v)<F.EPSILON&&Math.abs(g-b)<F.EPSILON?V(e):(u=f-x,h=m-v,d=g-b,n=_*(d*=p=1/Math.hypot(u,h,d))-y*(h*=p),o=y*(u*=p)-A*d,s=A*h-_*u,(p=Math.hypot(n,o,s))?(n*=p=1/p,o*=p,s*=p):(n=0,o=0,s=0),a=h*s-d*o,l=d*n-u*s,c=u*o-h*n,(p=Math.hypot(a,l,c))?(a*=p=1/p,l*=p,c*=p):(a=0,l=0,c=0),e[0]=n,e[1]=a,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=c,e[10]=d,e[11]=0,e[12]=-(n*f+o*m+s*g),e[13]=-(a*f+l*m+c*g),e[14]=-(u*f+h*m+d*g),e[15]=1,e)},B.targetTo=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=i[0],l=i[1],c=i[2],u=n-r[0],h=o-r[1],d=s-r[2],p=u*u+h*h+d*d;p>0&&(u*=p=1/Math.sqrt(p),h*=p,d*=p);var f=l*d-c*h,m=c*u-a*d,g=a*h-l*u;return(p=f*f+m*m+g*g)>0&&(f*=p=1/Math.sqrt(p),m*=p,g*=p),e[0]=f,e[1]=m,e[2]=g,e[3]=0,e[4]=h*g-d*m,e[5]=d*f-u*g,e[6]=u*m-h*f,e[7]=0,e[8]=u,e[9]=h,e[10]=d,e[11]=0,e[12]=n,e[13]=o,e[14]=s,e[15]=1,e},B.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},B.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},B.subtract=W,B.multiplyScalar=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},B.multiplyScalarAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e[9]=t[9]+r[9]*i,e[10]=t[10]+r[10]*i,e[11]=t[11]+r[11]*i,e[12]=t[12]+r[12]*i,e[13]=t[13]+r[13]*i,e[14]=t[14]+r[14]*i,e[15]=t[15]+r[15]*i,e},B.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},B.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],A=e[15],_=t[0],y=t[1],x=t[2],v=t[3],b=t[4],w=t[5],C=t[6],T=t[7],E=t[8],M=t[9],S=t[10],I=t[11],P=t[12],D=t[13],k=t[14],L=t[15];return Math.abs(r-_)<=F.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-y)<=F.EPSILON*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(n-x)<=F.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(o-v)<=F.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-b)<=F.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-w)<=F.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=F.EPSILON*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-T)<=F.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(u-E)<=F.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-M)<=F.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-S)<=F.EPSILON*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(p-I)<=F.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(f-P)<=F.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-D)<=F.EPSILON*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-k)<=F.EPSILON*Math.max(1,Math.abs(g),Math.abs(k))&&Math.abs(A-L)<=F.EPSILON*Math.max(1,Math.abs(A),Math.abs(L))},B.sub=B.mul=B.ortho=B.perspective=void 0;var F=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var r=j(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(j=function(e){return e?r:t})(e)}function V(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],f=t[11],m=t[12],g=t[13],A=t[14],_=t[15],y=r[0],x=r[1],v=r[2],b=r[3];return e[0]=y*i+x*a+v*h+b*m,e[1]=y*n+x*l+v*d+b*g,e[2]=y*o+x*c+v*p+b*A,e[3]=y*s+x*u+v*f+b*_,e[4]=(y=r[4])*i+(x=r[5])*a+(v=r[6])*h+(b=r[7])*m,e[5]=y*n+x*l+v*d+b*g,e[6]=y*o+x*c+v*p+b*A,e[7]=y*s+x*u+v*f+b*_,e[8]=(y=r[8])*i+(x=r[9])*a+(v=r[10])*h+(b=r[11])*m,e[9]=y*n+x*l+v*d+b*g,e[10]=y*o+x*c+v*p+b*A,e[11]=y*s+x*u+v*f+b*_,e[12]=(y=r[12])*i+(x=r[13])*a+(v=r[14])*h+(b=r[15])*m,e[13]=y*n+x*l+v*d+b*g,e[14]=y*o+x*c+v*p+b*A,e[15]=y*s+x*u+v*f+b*_,e}function U(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=i+i,l=n+n,c=o+o,u=i*a,h=i*l,d=i*c,p=n*l,f=n*c,m=o*c,g=s*a,A=s*l,_=s*c;return e[0]=1-(p+m),e[1]=h+_,e[2]=d-A,e[3]=0,e[4]=h-_,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=d+A,e[9]=f-g,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function H(e,t){var r=t[4],i=t[5],n=t[6],o=t[8],s=t[9],a=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(r,i,n),e[2]=Math.hypot(o,s,a),e}function G(e,t,r,i,n){var o,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=(n+i)*(o=1/(i-n)),e[14]=2*n*i*o):(e[10]=-1,e[14]=-2*i),e}function Z(e,t,r,i,n,o,s){var a=1/(t-r),l=1/(i-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(n+i)*l,e[14]=(s+o)*c,e[15]=1,e}function W(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}B.perspective=G,B.ortho=Z,B.mul=N,B.sub=W;var Q={},q={};function X(e){return X="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},X(e)}Object.defineProperty(q,"__esModule",{value:!0}),q.create=K,q.clone=function(e){var t=new Y.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},q.length=J,q.fromValues=function(e,t,r){var i=new Y.ARRAY_TYPE(3);return i[0]=e,i[1]=t,i[2]=r,i},q.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},q.set=function(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e},q.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},q.subtract=ee,q.multiply=te,q.divide=re,q.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},q.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},q.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},q.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},q.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},q.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},q.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e},q.distance=ie,q.squaredDistance=ne,q.squaredLength=oe,q.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},q.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},q.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},q.dot=se,q.cross=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],l=r[2];return e[0]=n*l-o*a,e[1]=o*s-i*l,e[2]=i*a-n*s,e},q.lerp=function(e,t,r,i){var n=t[0],o=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e},q.hermite=function(e,t,r,i,n,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,c=s*(o-1),u=s*(3-2*o);return e[0]=t[0]*a+r[0]*l+i[0]*c+n[0]*u,e[1]=t[1]*a+r[1]*l+i[1]*c+n[1]*u,e[2]=t[2]*a+r[2]*l+i[2]*c+n[2]*u,e},q.bezier=function(e,t,r,i,n,o){var s=1-o,a=s*s,l=o*o,c=a*s,u=3*o*a,h=3*l*s,d=l*o;return e[0]=t[0]*c+r[0]*u+i[0]*h+n[0]*d,e[1]=t[1]*c+r[1]*u+i[1]*h+n[1]*d,e[2]=t[2]*c+r[2]*u+i[2]*h+n[2]*d,e},q.random=function(e,t){t=t||1;var r=2*Y.RANDOM()*Math.PI,i=2*Y.RANDOM()-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e},q.transformMat4=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[3]*i+r[7]*n+r[11]*o+r[15];return e[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/(s=s||1),e[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/s,e},q.transformMat3=function(e,t,r){var i=t[0],n=t[1],o=t[2];return e[0]=i*r[0]+n*r[3]+o*r[6],e[1]=i*r[1]+n*r[4]+o*r[7],e[2]=i*r[2]+n*r[5]+o*r[8],e},q.transformQuat=function(e,t,r){var i=r[0],n=r[1],o=r[2],s=t[0],a=t[1],l=t[2],c=n*l-o*a,u=o*s-i*l,h=i*a-n*s,d=n*h-o*u,p=o*c-i*h,f=i*u-n*c,m=2*r[3];return u*=m,h*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+u+p,e[2]=l+h+f,e},q.rotateX=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.rotateY=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.rotateZ=function(e,t,r,i){var n=[],o=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},q.angle=function(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2],l=Math.sqrt(r*r+i*i+n*n)*Math.sqrt(o*o+s*s+a*a),c=l&&se(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},q.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},q.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},q.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},q.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(r-o)<=Y.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=Y.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-a)<=Y.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))},q.forEach=q.sqrLen=q.len=q.sqrDist=q.dist=q.div=q.mul=q.sub=void 0;var Y=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==X(e)&&"function"!=typeof e)return{default:e};var r=$(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function $(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return($=function(e){return e?r:t})(e)}function K(){var e=new Y.ARRAY_TYPE(3);return Y.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function J(e){return Math.hypot(e[0],e[1],e[2])}function ee(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function te(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function re(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function ie(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function ne(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}function oe(e){var t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}function se(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}q.sub=ee,q.mul=te,q.div=re,q.dist=ie,q.sqrDist=ne,q.len=J,q.sqrLen=oe;var ae,le=(ae=K(),function(e,t,r,i,n,o){var s,a;for(t||(t=3),r||(r=0),a=i?Math.min(i*t+r,e.length):e.length,s=r;s<a;s+=t)ae[0]=e[s],ae[1]=e[s+1],ae[2]=e[s+2],n(ae,ae,o),e[s]=ae[0],e[s+1]=ae[1],e[s+2]=ae[2];return e});q.forEach=le;var ce={};function ue(e){return ue="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},ue(e)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.create=pe,ce.clone=function(e){var t=new he.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ce.fromValues=function(e,t,r,i){var n=new he.ARRAY_TYPE(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},ce.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},ce.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},ce.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},ce.subtract=fe,ce.multiply=me,ce.divide=ge,ce.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},ce.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},ce.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},ce.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},ce.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e},ce.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},ce.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},ce.distance=Ae,ce.squaredDistance=_e,ce.length=ye,ce.squaredLength=xe,ce.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},ce.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},ce.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=o*s,e},ce.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},ce.cross=function(e,t,r,i){var n=r[0]*i[1]-r[1]*i[0],o=r[0]*i[2]-r[2]*i[0],s=r[0]*i[3]-r[3]*i[0],a=r[1]*i[2]-r[2]*i[1],l=r[1]*i[3]-r[3]*i[1],c=r[2]*i[3]-r[3]*i[2],u=t[0],h=t[1],d=t[2],p=t[3];return e[0]=h*c-d*l+p*a,e[1]=-u*c+d*s-p*o,e[2]=u*l-h*s+p*n,e[3]=-u*a+h*o-d*n,e},ce.lerp=function(e,t,r,i){var n=t[0],o=t[1],s=t[2],a=t[3];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e[2]=s+i*(r[2]-s),e[3]=a+i*(r[3]-a),e},ce.random=function(e,t){var r,i,n,o,s,a;t=t||1;do{s=(r=2*he.RANDOM()-1)*r+(i=2*he.RANDOM()-1)*i}while(s>=1);do{a=(n=2*he.RANDOM()-1)*n+(o=2*he.RANDOM()-1)*o}while(a>=1);var l=Math.sqrt((1-s)/a);return e[0]=t*r,e[1]=t*i,e[2]=t*n*l,e[3]=t*o*l,e},ce.transformMat4=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*s,e},ce.transformQuat=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=r[0],a=r[1],l=r[2],c=r[3],u=c*i+a*o-l*n,h=c*n+l*i-s*o,d=c*o+s*n-a*i,p=-s*i-a*n-l*o;return e[0]=u*c+p*-s+h*-l-d*-a,e[1]=h*c+p*-a+d*-s-u*-l,e[2]=d*c+p*-l+u*-a-h*-s,e[3]=t[3],e},ce.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},ce.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},ce.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ce.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(r-s)<=he.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-a)<=he.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-l)<=he.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=he.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},ce.forEach=ce.sqrLen=ce.len=ce.sqrDist=ce.dist=ce.div=ce.mul=ce.sub=void 0;var he=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ue(e)&&"function"!=typeof e)return{default:e};var r=de(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function de(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(de=function(e){return e?r:t})(e)}function pe(){var e=new he.ARRAY_TYPE(4);return he.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function fe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function me(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function ge(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Ae(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function _e(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return r*r+i*i+n*n+o*o}function ye(e){return Math.hypot(e[0],e[1],e[2],e[3])}function xe(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}ce.sub=fe,ce.mul=me,ce.div=ge,ce.dist=Ae,ce.sqrDist=_e,ce.len=ye,ce.sqrLen=xe;var ve=function(){var e=pe();return function(t,r,i,n,o,s){var a,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,a=i;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,s),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();function be(e){return be="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},be(e)}ce.forEach=ve,Object.defineProperty(Q,"__esModule",{value:!0}),Q.create=Ie,Q.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},Q.setAxisAngle=Pe,Q.getAxisAngle=function(e,t){var r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>we.EPSILON?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r},Q.getAngle=function(e,t){var r=Re(e,t);return Math.acos(2*r*r-1)},Q.multiply=De,Q.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*a,e[1]=n*l+o*a,e[2]=o*l-n*a,e[3]=s*l-i*a,e},Q.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l-o*a,e[1]=n*l+s*a,e[2]=o*l+i*a,e[3]=s*l-n*a,e},Q.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*a,e[1]=n*l-i*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},Q.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},Q.exp=ke,Q.ln=Le,Q.pow=function(e,t,r){return Le(e,t),Be(e,e,r),ke(e,e),e},Q.slerp=Oe,Q.random=function(e){var t=we.RANDOM(),r=we.RANDOM(),i=we.RANDOM(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*r),e[1]=n*Math.cos(2*Math.PI*r),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},Q.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=r*r+i*i+n*n+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-i*a,e[2]=-n*a,e[3]=o*a,e},Q.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},Q.fromMat3=ze,Q.fromEuler=function(e,t,r,i){var n=.5*Math.PI/180;t*=n,r*=n,i*=n;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=o*l*u-s*a*c,e[1]=s*a*u+o*l*c,e[2]=s*l*c-o*a*u,e[3]=s*l*u+o*a*c,e},Q.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},Q.setAxes=Q.sqlerp=Q.rotationTo=Q.equals=Q.exactEquals=Q.normalize=Q.sqrLen=Q.squaredLength=Q.len=Q.length=Q.lerp=Q.dot=Q.scale=Q.mul=Q.add=Q.set=Q.copy=Q.fromValues=Q.clone=void 0;var we=Se(p),Ce=Se(P),Te=Se(q),Ee=Se(ce);function Me(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Me=function(e){return e?r:t})(e)}function Se(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==be(e)&&"function"!=typeof e)return{default:e};var r=Me(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function Ie(){var e=new we.ARRAY_TYPE(4);return we.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Pe(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function De(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+s*a+n*c-o*l,e[1]=n*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-n*a,e[3]=s*u-i*a-n*l-o*c,e}function ke(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=Math.exp(o),l=s>0?a*Math.sin(s)/s:0;return e[0]=r*l,e[1]=i*l,e[2]=n*l,e[3]=a*Math.cos(s),e}function Le(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],s=Math.sqrt(r*r+i*i+n*n),a=s>0?Math.atan2(s,o)/s:0;return e[0]=r*a,e[1]=i*a,e[2]=n*a,e[3]=.5*Math.log(r*r+i*i+n*n+o*o),e}function Oe(e,t,r,i){var n,o,s,a,l,c=t[0],u=t[1],h=t[2],d=t[3],p=r[0],f=r[1],m=r[2],g=r[3];return(o=c*p+u*f+h*m+d*g)<0&&(o=-o,p=-p,f=-f,m=-m,g=-g),1-o>we.EPSILON?(n=Math.acos(o),s=Math.sin(n),a=Math.sin((1-i)*n)/s,l=Math.sin(i*n)/s):(a=1-i,l=i),e[0]=a*c+l*p,e[1]=a*u+l*f,e[2]=a*h+l*m,e[3]=a*d+l*g,e}function ze(e,t){var r,i=t[0]+t[4]+t[8];if(i>0)r=Math.sqrt(i+1),e[3]=.5*r,e[0]=(t[5]-t[7])*(r=.5/r),e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var o=(n+1)%3,s=(n+2)%3;r=Math.sqrt(t[3*n+n]-t[3*o+o]-t[3*s+s]+1),e[n]=.5*r,e[3]=(t[3*o+s]-t[3*s+o])*(r=.5/r),e[o]=(t[3*o+n]+t[3*n+o])*r,e[s]=(t[3*s+n]+t[3*n+s])*r}return e}Q.clone=Ee.clone,Q.fromValues=Ee.fromValues,Q.copy=Ee.copy,Q.set=Ee.set,Q.add=Ee.add,Q.mul=De;var Be=Ee.scale;Q.scale=Be;var Re=Ee.dot;Q.dot=Re,Q.lerp=Ee.lerp;var Fe=Ee.length;Q.length=Fe,Q.len=Fe;var je=Ee.squaredLength;Q.squaredLength=je,Q.sqrLen=je;var Ve=Ee.normalize;Q.normalize=Ve,Q.exactEquals=Ee.exactEquals,Q.equals=Ee.equals;var Ne,Ue,He,Ge=(Ne=Te.create(),Ue=Te.fromValues(1,0,0),He=Te.fromValues(0,1,0),function(e,t,r){var i=Te.dot(t,r);return i<-.999999?(Te.cross(Ne,Ue,t),Te.len(Ne)<1e-6&&Te.cross(Ne,He,t),Te.normalize(Ne,Ne),Pe(e,Ne,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Te.cross(Ne,t,r),e[0]=Ne[0],e[1]=Ne[1],e[2]=Ne[2],e[3]=1+i,Ve(e,e))});Q.rotationTo=Ge;var Ze,We,Qe=(Ze=Ie(),We=Ie(),function(e,t,r,i,n,o){return Oe(Ze,t,n,o),Oe(We,r,i,o),Oe(e,Ze,We,2*o*(1-o)),e});Q.sqlerp=Qe;var qe,Xe=(qe=Ce.create(),function(e,t,r,i){return qe[0]=r[0],qe[3]=r[1],qe[6]=r[2],qe[1]=i[0],qe[4]=i[1],qe[7]=i[2],qe[2]=-t[0],qe[5]=-t[1],qe[8]=-t[2],Ve(e,ze(e,qe))});Q.setAxes=Xe;var Ye={};function $e(e){return $e="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(e)}Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.create=function(){var e=new Ke.ARRAY_TYPE(8);return Ke.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},Ye.clone=function(e){var t=new Ke.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t},Ye.fromValues=function(e,t,r,i,n,o,s,a){var l=new Ke.ARRAY_TYPE(8);return l[0]=e,l[1]=t,l[2]=r,l[3]=i,l[4]=n,l[5]=o,l[6]=s,l[7]=a,l},Ye.fromRotationTranslationValues=function(e,t,r,i,n,o,s){var a=new Ke.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=r,a[3]=i;var l=.5*n,c=.5*o,u=.5*s;return a[4]=l*i+c*r-u*t,a[5]=c*i+u*e-l*r,a[6]=u*i+l*t-c*e,a[7]=-l*e-c*t-u*r,a},Ye.fromRotationTranslation=it,Ye.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},Ye.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.fromMat4=function(e,t){var r=Je.create();et.getRotation(r,t);var i=new Ke.ARRAY_TYPE(3);return et.getTranslation(i,t),it(e,r,i),e},Ye.copy=nt,Ye.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Ye.set=function(e,t,r,i,n,o,s,a,l){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e},Ye.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},Ye.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},Ye.getTranslation=function(e,t){var r=t[4],i=t[5],n=t[6],o=t[7],s=-t[0],a=-t[1],l=-t[2],c=t[3];return e[0]=2*(r*c+o*s+i*l-n*a),e[1]=2*(i*c+o*a+n*s-r*l),e[2]=2*(n*c+o*l+r*a-i*s),e},Ye.translate=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=.5*r[0],l=.5*r[1],c=.5*r[2],u=t[4],h=t[5],d=t[6],p=t[7];return e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=s*a+n*c-o*l+u,e[5]=s*l+o*a-i*c+h,e[6]=s*c+i*l-n*a+d,e[7]=-i*a-n*l-o*c+p,e},Ye.rotateX=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateX(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateY=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateY(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateZ=function(e,t,r){var i=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=a*s+u*i+l*o-c*n,d=l*s+u*n+c*i-a*o,p=c*s+u*o+a*n-l*i,f=u*s-a*i-l*n-c*o;return Je.rotateZ(e,t,r),e[4]=h*(s=e[3])+f*(i=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*i-h*o,e[6]=p*s+f*o+h*n-d*i,e[7]=f*s-h*i-d*n-p*o,e},Ye.rotateByQuatAppend=function(e,t,r){var i=r[0],n=r[1],o=r[2],s=r[3],a=t[0],l=t[1],c=t[2],u=t[3];return e[0]=a*s+u*i+l*o-c*n,e[1]=l*s+u*n+c*i-a*o,e[2]=c*s+u*o+a*n-l*i,e[3]=u*s-a*i-l*n-c*o,e[4]=(a=t[4])*s+(u=t[7])*i+(l=t[5])*o-(c=t[6])*n,e[5]=l*s+u*n+c*i-a*o,e[6]=c*s+u*o+a*n-l*i,e[7]=u*s-a*i-l*n-c*o,e},Ye.rotateByQuatPrepend=function(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+s*a+n*c-o*l,e[1]=n*u+s*l+o*a-i*c,e[2]=o*u+s*c+i*l-n*a,e[3]=s*u-i*a-n*l-o*c,e[4]=i*(u=r[7])+s*(a=r[4])+n*(c=r[6])-o*(l=r[5]),e[5]=n*u+s*l+o*a-i*c,e[6]=o*u+s*c+i*l-n*a,e[7]=s*u-i*a-n*l-o*c,e},Ye.rotateAroundAxis=function(e,t,r,i){if(Math.abs(i)<Ke.EPSILON)return nt(e,t);var n=Math.hypot(r[0],r[1],r[2]);i*=.5;var o=Math.sin(i),s=o*r[0]/n,a=o*r[1]/n,l=o*r[2]/n,c=Math.cos(i),u=t[0],h=t[1],d=t[2],p=t[3];e[0]=u*c+p*s+h*l-d*a,e[1]=h*c+p*a+d*s-u*l,e[2]=d*c+p*l+u*a-h*s,e[3]=p*c-u*s-h*a-d*l;var f=t[4],m=t[5],g=t[6],A=t[7];return e[4]=f*c+A*s+m*l-g*a,e[5]=m*c+A*a+g*s-f*l,e[6]=g*c+A*l+f*a-m*s,e[7]=A*c-f*s-m*a-g*l,e},Ye.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e},Ye.multiply=ot,Ye.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e},Ye.lerp=function(e,t,r,i){var n=1-i;return st(t,r)<0&&(i=-i),e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i,e[3]=t[3]*n+r[3]*i,e[4]=t[4]*n+r[4]*i,e[5]=t[5]*n+r[5]*i,e[6]=t[6]*n+r[6]*i,e[7]=t[7]*n+r[7]*i,e},Ye.invert=function(e,t){var r=lt(t);return e[0]=-t[0]/r,e[1]=-t[1]/r,e[2]=-t[2]/r,e[3]=t[3]/r,e[4]=-t[4]/r,e[5]=-t[5]/r,e[6]=-t[6]/r,e[7]=t[7]/r,e},Ye.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e[4]=-t[4],e[5]=-t[5],e[6]=-t[6],e[7]=t[7],e},Ye.normalize=function(e,t){var r=lt(t);if(r>0){r=Math.sqrt(r);var i=t[0]/r,n=t[1]/r,o=t[2]/r,s=t[3]/r,a=t[4],l=t[5],c=t[6],u=t[7],h=i*a+n*l+o*c+s*u;e[0]=i,e[1]=n,e[2]=o,e[3]=s,e[4]=(a-i*h)/r,e[5]=(l-n*h)/r,e[6]=(c-o*h)/r,e[7]=(u-s*h)/r}return e},Ye.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},Ye.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},Ye.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=t[0],h=t[1],d=t[2],p=t[3],f=t[4],m=t[5],g=t[6],A=t[7];return Math.abs(r-u)<=Ke.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-h)<=Ke.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(n-d)<=Ke.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-p)<=Ke.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-f)<=Ke.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-m)<=Ke.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-g)<=Ke.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-A)<=Ke.EPSILON*Math.max(1,Math.abs(c),Math.abs(A))},Ye.sqrLen=Ye.squaredLength=Ye.len=Ye.length=Ye.dot=Ye.mul=Ye.setReal=Ye.getReal=void 0;var Ke=rt(p),Je=rt(Q),et=rt(B);function tt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(tt=function(e){return e?r:t})(e)}function rt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==$e(e)&&"function"!=typeof e)return{default:e};var r=tt(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}function it(e,t,r){var i=.5*r[0],n=.5*r[1],o=.5*r[2],s=t[0],a=t[1],l=t[2],c=t[3];return e[0]=s,e[1]=a,e[2]=l,e[3]=c,e[4]=i*c+n*l-o*a,e[5]=n*c+o*s-i*l,e[6]=o*c+i*a-n*s,e[7]=-i*s-n*a-o*l,e}function nt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function ot(e,t,r){var i=t[0],n=t[1],o=t[2],s=t[3],a=r[4],l=r[5],c=r[6],u=r[7],h=t[4],d=t[5],p=t[6],f=t[7],m=r[0],g=r[1],A=r[2],_=r[3];return e[0]=i*_+s*m+n*A-o*g,e[1]=n*_+s*g+o*m-i*A,e[2]=o*_+s*A+i*g-n*m,e[3]=s*_-i*m-n*g-o*A,e[4]=i*u+s*a+n*c-o*l+h*_+f*m+d*A-p*g,e[5]=n*u+s*l+o*a-i*c+d*_+f*g+p*m-h*A,e[6]=o*u+s*c+i*l-n*a+p*_+f*A+h*g-d*m,e[7]=s*u-i*a-n*l-o*c+f*_-h*m-d*g-p*A,e}Ye.getReal=Je.copy,Ye.setReal=Je.copy,Ye.mul=ot;var st=Je.dot;Ye.dot=st;var at=Je.length;Ye.length=at,Ye.len=at;var lt=Je.squaredLength;Ye.squaredLength=lt,Ye.sqrLen=lt;var ct={};function ut(e){return ut="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},ut(e)}Object.defineProperty(ct,"__esModule",{value:!0}),ct.create=pt,ct.clone=function(e){var t=new ht.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t},ct.fromValues=function(e,t){var r=new ht.ARRAY_TYPE(2);return r[0]=e,r[1]=t,r},ct.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ct.set=function(e,t,r){return e[0]=t,e[1]=r,e},ct.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e},ct.subtract=ft,ct.multiply=mt,ct.divide=gt,ct.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},ct.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},ct.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e},ct.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e},ct.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},ct.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},ct.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e},ct.distance=At,ct.squaredDistance=_t,ct.length=yt,ct.squaredLength=xt,ct.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ct.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ct.normalize=function(e,t){var r=t[0],i=t[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e},ct.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ct.cross=function(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e},ct.lerp=function(e,t,r,i){var n=t[0],o=t[1];return e[0]=n+i*(r[0]-n),e[1]=o+i*(r[1]-o),e},ct.random=function(e,t){t=t||1;var r=2*ht.RANDOM()*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e},ct.transformMat2=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e},ct.transformMat2d=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e},ct.transformMat3=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e},ct.transformMat4=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},ct.rotate=function(e,t,r,i){var n=t[0]-r[0],o=t[1]-r[1],s=Math.sin(i),a=Math.cos(i);return e[0]=n*a-o*s+r[0],e[1]=n*s+o*a+r[1],e},ct.angle=function(e,t){var r=e[0],i=e[1],n=t[0],o=t[1],s=Math.sqrt(r*r+i*i)*Math.sqrt(n*n+o*o);return Math.acos(Math.min(Math.max(s&&(r*n+i*o)/s,-1),1))},ct.zero=function(e){return e[0]=0,e[1]=0,e},ct.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},ct.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ct.equals=function(e,t){var r=e[0],i=e[1],n=t[0],o=t[1];return Math.abs(r-n)<=ht.EPSILON*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-o)<=ht.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},ct.forEach=ct.sqrLen=ct.sqrDist=ct.dist=ct.div=ct.mul=ct.sub=ct.len=void 0;var ht=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==ut(e)&&"function"!=typeof e)return{default:e};var r=dt(void 0);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}(p);function dt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(dt=function(e){return e?r:t})(e)}function pt(){var e=new ht.ARRAY_TYPE(2);return ht.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function ft(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mt(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function gt(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function At(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function _t(e,t){var r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function yt(e){return Math.hypot(e[0],e[1])}function xt(e){var t=e[0],r=e[1];return t*t+r*r}ct.len=yt,ct.sub=ft,ct.mul=mt,ct.div=gt,ct.dist=At,ct.sqrDist=_t,ct.sqrLen=xt;var vt=function(){var e=pt();return function(t,r,i,n,o,s){var a,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,a=i;a<l;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,s),t[a]=e[0],t[a+1]=e[1];return t}}();function bt(e){return bt="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},bt(e)}ct.forEach=vt,Object.defineProperty(d,"__esModule",{value:!0}),e.aa=d.vec4=e.Q=d.vec3=d.vec2=d.quat2=e.bl=d.quat=e.a9=d.mat4=e.ct=d.mat3=d.mat2d=e.b7=d.mat2=d.glMatrix=void 0;var wt=Ot(p);d.glMatrix=wt;var Ct=Ot(_);e.b7=d.mat2=Ct;var Tt=Ot(C);d.mat2d=Tt;var Et=Ot(P);e.ct=d.mat3=Et;var Mt=Ot(B);e.a9=d.mat4=Mt;var St=Ot(Q);e.bl=d.quat=St;var It=Ot(Ye);d.quat2=It;var Pt=Ot(ct);d.vec2=Pt;var Dt=Ot(q);e.Q=d.vec3=Dt;var kt=Ot(ce);function Lt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(Lt=function(e){return e?r:t})(e)}function Ot(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==bt(e)&&"function"!=typeof e)return{default:e};var r=Lt(t);if(r&&r.has(e))return r.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}return i.default=e,r&&r.set(e,i),i}e.aa=d.vec4=kt;var zt=Bt;function Bt(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}Bt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=n/o}var s=0,a=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:a=r,r=.5*(a-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Rt=h(zt),Ft=jt;function jt(e,t){this.x=e,this.y=t}jt.prototype={clone:function(){return new jt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),i=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-i*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jt.convert=function(e){return e instanceof jt?e:Array.isArray(e)?new jt(e[0],e[1]):e};var Vt=h(Ft);const Nt=Math.PI/180,Ut=180/Math.PI;function Ht(e){return e*Nt}function Gt(e){return e*Ut}const Zt=[[0,0],[1,0],[1,1],[0,1]];function Wt(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Qt(e,t,r,i){const n=new Rt(e,t,r,i);return function(e){return n.solve(e)}}const qt=Qt(.25,.1,.25,1);function Xt(e,t,r){return Math.min(r,Math.max(t,e))}function Yt(e,t,r){return(r=Xt((r-e)/(t-e),0,1))*r*(3-2*r)}function $t(e,t,r){const i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function Kt(e,t,r){if(!e.length)return r(null,[]);let i=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),n[s]=t,0==--i&&r(o,n)}))}))}function Jt(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let er=1;function tr(){return er++}function rr(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function ir(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function nr(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 or(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function sr(e,t){return-1!==e.indexOf(t,e.length-t.length)}function ar(e,t,r){const i={};for(const r in e)i[r]=t.call(this,e[r],r,e);return i}function lr(e,t,r){const i={};for(const r in e)t.call(this,e[r],r,e)&&(i[r]=e[r]);return i}function cr(e){return Array.isArray(e)?e.map(cr):"object"==typeof e&&e?ar(e,cr):e}const ur={};function hr(e){ur[e]||("undefined"!=typeof console&&console.warn(e),ur[e]=!0)}function dr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function pr(e){let t=0;for(let r,i,n=0,o=e.length,s=o-1;n<o;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function fr([e,t,r]){const i=Ht(t+90),n=Ht(r);return{x:e*Math.cos(i)*Math.sin(n),y:e*Math.sin(i)*Math.sin(n),z:e*Math.cos(n),azimuthal:t,polar:r}}function mr(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function gr(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,i,n)=>{const o=i||n;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let Ar,_r,yr,xr,vr,br,wr=null;function Cr(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Tr(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Er(e,t,r,i){for(;t<r;){const n=t+r>>1;e[n]<i?t=n+1:r=n}return t}function Mr(e,t,r,i){for(;t<r;){const n=t+r>>1;e[n]<=i?t=n+1:r=n}return t}function Sr(e){return e>0?1/(1.001-e):1+e}function Ir(e){return e>0?1-1/(1.001-e):-e}function Pr(){return null==Ar&&(Ar=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Ar}const Dr={now:()=>void 0!==xr?xr:performance.now(),setNow(e){xr=e},restoreNow(){xr=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:r,height:i}=e;vr||(vr=document.createElement("canvas"));const n=vr.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return(r>vr.width||i>vr.height)&&(vr.width=r,vr.height=i),n.clearRect(-t,-t,r+2*t,i+2*t),n.drawImage(e,0,0,r,i),n.getImageData(-t,-t,r+2*t,i+2*t)},resolveURL:e=>(_r||(_r=document.createElement("a")),_r.href=e,_r.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==yr&&(yr=window.matchMedia("(prefers-reduced-motion: reduce)")),yr.matches)},hasCanvasFingerprintNoise(){if(void 0!==br)return br;if(!Pr())return br=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let r=0;for(let i=0;i<e.width;++i)t.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,t.fillRect(i,0,1,1);const i=t.getImageData(0,0,e.width,e.height);r=0;for(let e=0;e<i.data.length;++e)if(e%4!=3&&r++!==i.data[e])return br=!0,!0;return br=!1,!1}};function kr(e,t){const r=e.indexOf("?");if(r<0)return`${e}?${new URLSearchParams(t).toString()}`;const i=new URLSearchParams(e.slice(r));for(const e in t)i.set(e,t[e]);return`${e.slice(0,r)}?${i.toString()}`}function Lr(e,t={persistentParams:[]}){const r=e.indexOf("?");if(r<0)return e;const i=new URLSearchParams,n=new URLSearchParams(e.slice(r));for(const e of t.persistentParams){const t=n.get(e);t&&i.set(e,t)}const o=i.toString();return`${e.slice(0,r)}${o.length>0?`?${o}`:""}`}const Or="mapbox-tiles";let zr,Br,Rr=500,Fr=50;function jr(){try{return caches}catch(e){}}function Vr(){const e=jr();e&&!zr&&(zr=e.open(Or))}let Nr=1/0;const Ur={supported:!1,testSupport:function(e){!Zr&&Gr&&(Wr?qr(e):Hr=e)}};let Hr,Gr,Zr=!1,Wr=!1;const Qr="undefined"!=typeof self?self:{};function qr(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Gr),e.isContextLost())return;Ur.supported=!0}catch(e){}e.deleteTexture(t),Zr=!0}Qr.document&&(Gr=Qr.document.createElement("img"),Gr.onload=function(){Hr&&qr(Hr),Hr=null,Wr=!0},Gr.onerror=function(){Zr=!0,Hr=null},Gr.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Xr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Xr);class Yr extends Error{constructor(e,t,r){401===t&&n(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=r}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const $r=mr()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Kr=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test($r())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:$r(),referrerPolicy:e.referrerPolicy,signal:r.signal});let o=!1,s=!1;const a=(l=i.url).indexOf("sku=")>0&&n(l);var l;"json"===e.type&&i.headers.set("Accept","application/json");const c=(r,n,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&hr(r.toString()),n&&o)return u(n);const l=Date.now();fetch(i).then((r=>{if(r.ok){const e=a?r.clone():null;return u(r,e,l)}return t(new Yr(r.statusText,r.status,e.url))})).catch((r=>{"AbortError"!==r.name&&t(new Error(`${r.message} ${e.url}`))}))},u=(r,n,a)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{s||(n&&a&&function(e,t,r){if(Vr(),!zr)return;const i=gr(t.headers.get("Cache-Control")||"");if(i["no-store"])return;const n={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>n.headers.set(t,e))),i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString());const o=n.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-r<42e4)return;let s=Lr(e.url,{persistentParams:["language","worldview"]});if(206===t.status){const t=e.headers.get("Range");if(!t)return;n.status=200,s=kr(s,{range:t})}!function(e,t){if(void 0===Br)try{new Response(new ReadableStream),Br=!0}catch(e){Br=!1}Br?t(e.body):e.blob().then(t)}(t,(e=>{const t=new Response(e,n);Vr(),zr&&zr.then((e=>e.put(s,t))).catch((e=>hr(e.message)))}))}(i,n,a),o=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{s||t(new Error(e.message))}))};return a?function(e,t){if(Vr(),!zr)return t(null);zr.then((r=>{let i=Lr(e.url,{persistentParams:["language","worldview"]});const n=e.headers.get("Range");n&&(i=kr(i,{range:n})),r.match(i).then((e=>{const n=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),r=gr(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(e);r.delete(i),n&&r.put(i,e.clone()),t(null,e,n)})).catch(t)})).catch(t)}(i,c):c(null,null),{cancel:()=>{s=!0,o||r.abort()}}}(e,t);if(mr()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new Yr(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},Jr=function(e,t){return Kr(Jt(e,{type:"arrayBuffer"}),t)};function ei(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const ti="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ri,ii;ri=[],ii=0;const ni=function(e,t){if(Ur.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ii>=i.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return ri.push(r),r}ii++;let r=!1;const n=()=>{if(!r)for(r=!0,ii--;ri.length&&ii<i.MAX_PARALLEL_IMAGE_REQUESTS;){const e=ri.shift(),{requestParameters:t,callback:r,cancelled:i}=e;i||(e.cancel=ni(t,r).cancel)}},o=Jr(e,((e,r,i,o)=>{n(),e?t(e):r&&(self.createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,r)=>t(e,r,i,o))):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=ti}))},r.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(i):ti}(r,((e,r)=>t(e,r,i,o))))}));return{cancel:()=>{o.cancel(),n()}}},oi="01",si="NO_ACCESS_TOKEN",ai=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function li(e){const t=e.match(ai);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function ci(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const ui="mapbox.eventData";function hi(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class di{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=hi(i.ACCESS_TOKEN);let r="";return r=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):i.ACCESS_TOKEN||"",e?`${ui}.${e}:${r}`:`${ui}:${r}`}fetchEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const i=localStorage.getItem(r);i&&(this.anonId=i)}catch(e){hr("Unable to read from LocalStorage")}}saveEventData(){const e=Cr("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid"),i=this.anonId;if(e&&i)try{localStorage.setItem(r,i),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){hr("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,r,n){if(!i.EVENTS_URL)return;const o=li(i.EVENTS_URL);o.params.push(`access_token=${n||i.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(e).toISOString()},a=t?Jt(s,t):s,l={url:ci(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const pi=new class extends di{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){i.EVENTS_URL&&i.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>o(e)||n(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=hi(i.ACCESS_TOKEN),n=r?r.u:i.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;nr(this.anonId)||(this.anonId=rr(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),r=(s-this.eventData.lastSuccess)/864e5;o=o||r>=1||r<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:oi,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)}),e):this.processRequests()}},fi=pi.postTurnstileEvent.bind(pi),mi=new class extends di{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,r,n){this.skuToken=t,this.errorCb=n,i.EVENTS_URL&&(r||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(si)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:i}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),nr(this.anonId)||(this.anonId=rr()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:oi,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):r&&(this.success[r]=!0)}),e))}remove(){this.errorCb=null}},gi=mi.postMapLoadEvent.bind(mi),Ai=new class extends di{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=rr(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:r,style:n,importedStyles:o}=t;if(!i.EVENTS_URL||!e&&!i.ACCESS_TOKEN)return;const s=this.getMapInstanceId(r),a={mapInstanceId:s,eventId:this.getEventId(s),style:n};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:r}=this.queue.shift();this.postEvent(t,r,(()=>{}),e)}},_i=Ai.postStyleLoadEvent.bind(Ai),yi=new class extends di{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){i.EVENTS_URL&&(e||i.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:i}=this.queue.shift(),n=function(e){const r=performance.getEntriesByType("resource"),i=performance.getEntriesByType("mark"),n=function(e){const t={};if(e)for(const r in e)if("other"!==r)for(const i of e[r]){const e=`${r}ResolveRangeMin`,n=`${r}ResolveRangeMax`,o=`${r}RequestCount`,s=`${r}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,i.startTime),t[n]=Math.max(t[n]||-1/0,i.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==i.transferSize&&0===i.transferSize&&a(s),a(o)}return t}(function(e,t){const r={};if(e)for(const i of e){const e=t(i);void 0===r[e]&&(r[e]=[]),r[e].push(i)}return r}(r,u)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,r)=>{null!=r&&e.push({name:t,value:r.toString()})};for(const e in n)d(h.counters,e,n[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",e.interactionRange[0]),d(h.counters,"interactionRangeMax",e.interactionRange[1])),i)for(const e of Object.keys(c)){const t=c[e],r=i.find((e=>e.name===t));r&&d(h.counters,t,r.startTime)}return d(h.counters,"visibilityHidden",e.visibilityHidden),d(h.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(l(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(r)),d(h.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",e.fogEnabled?"true":"false"),d(h.attributes,"projection",e.projection),d(h.attributes,"zoom",e.zoom),d(h.metadata,"devicePixelRatio",o),d(h.metadata,"connectionEffectiveType",a),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",e.width/o),d(h.metadata,"mapHeight",e.height/o),d(h.metadata,"webglRenderer",e.renderer),d(h.metadata,"webglVendor",e.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h}(i);for(const e of n.metadata);for(const e of n.counters);for(const e of n.attributes);this.postEvent(r,n,(()=>{}),e)}},xi=yi.postPerformanceEvent.bind(yi),vi=new class extends di{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,r,n){if(!i.API_URL||!i.SESSION_PATH)return;const o=li(i.API_URL+i.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${n||i.ACCESS_TOKEN||""}`);const s={url:ci(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return Kr(Jt(e,{method:"GET"}),t)}(s,(e=>{this.pendingRequest=null,r(e),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(e,t,r,n){this.skuToken=t,this.errorCb=n,i.SESSION_PATH&&i.API_URL&&(r||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},r):this.errorCb(new Error(si)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||this.getSession(r,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},bi=vi.getSessionAPI.bind(vi),wi=new Set;var Ci={exports:{}},Ti={exports:{}};Ti.exports=function(e,t){var r,i,n,o,s,a,l,c;for(i=e.length-(r=3&e.length),n=t,s=3432918353,a=461845907,c=0;c<i;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};var Ei=Ti.exports,Mi={exports:{}};Mi.exports=function(e,t){for(var r,i=e.length,n=t^i,o=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var Si=Ei,Ii=Mi.exports;Ci.exports=Si,Ci.exports.murmur3=Si,Ci.exports.murmur2=Ii;var Pi=h(Ci.exports);function Di(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function ki(e,t,r){if(r&&r[e]){const i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}class Li{constructor(e,t={}){Jt(this,t),this.type=e}}class Oi extends Li{constructor(e,t={}){super("error",Jt({error:e},t))}}class zi{on(e,t){return this._listeners=this._listeners||{},Di(e,t,this._listeners),this}off(e,t){return ki(e,t,this._listeners),ki(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Di(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new Li(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of i)ki(r,t,this._oneTimeListeners),t.call(this,e);const n=this._eventedParent;n&&(Jt(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof Oi&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}e.z=void 0;var Bi={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ri(e){return(e=Math.round(e))<0?0:e>255?255:e}function Fi(e){return Ri("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function ji(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Vi(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{e.z={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Bi)return Bi[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.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===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var o=r.substr(0,i),s=r.substr(i+1,n-(i+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=ji(s.pop());case"rgb":return 3!==s.length?null:[Fi(s[0]),Fi(s[1]),Fi(s[2]),a];case"hsla":if(4!==s.length)return null;a=ji(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=ji(s[1]),u=ji(s[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[Ri(255*Vi(d,h,l+1/3)),Ri(255*Vi(d,h,l)),Ri(255*Vi(d,h,l-1/3)),a];default:return null}}return null}}catch(e){}class Ni{constructor(e,t,r,i=1){this.r=e,this.g=t,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof Ni)return t;if("string"!=typeof t)return;const r=e.z(t);return r?new Ni(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[e,t,r,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${i})`}toArray(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*r/i,i]}toArray01(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[e/i,t/i,r/i,i]}toArray01Scaled(e){const{r:t,g:r,b:i,a:n}=this;return 0===n?[0,0,0]:[t/n*e,r/n*e,i/n*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:i}=this;return[e,t,r,i]}toArray01Linear(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[Math.pow(e/i,2.2),Math.pow(t/i,2.2),Math.pow(r/i,2.2),i]}}function Ui(e,t,r){return e*(1-r)+t*r}function Hi(e,t,r){return e.map(((e,i)=>Ui(e,t[i],r)))}Ni.black=new Ni(0,0,0,1),Ni.white=new Ni(1,1,1,1),Ni.transparent=new Ni(0,0,0,0),Ni.red=new Ni(1,0,0,1),Ni.blue=new Ni(0,0,1,1);var Gi=Object.freeze({__proto__:null,array:Hi,color:function(e,t,r){return new Ni(Ui(e.r,t.r,r),Ui(e.g,t.g,r),Ui(e.b,t.b,r),Ui(e.a,t.a,r))},number:Ui});function Zi(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class Wi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Qi{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new Qi(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const qi={kind:"null"},Xi={kind:"number"},Yi={kind:"string"},$i={kind:"boolean"},Ki={kind:"color"},Ji={kind:"object"},en={kind:"value"},tn={kind:"collator"},rn={kind:"formatted"},nn={kind:"resolvedImage"};function on(e,t){return{kind:"array",itemType:e,N:t}}function sn(e){if("array"===e.kind){const t=sn(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const an=[qi,Xi,Yi,$i,Ki,rn,Ji,on(en),nn];function ln(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ln(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(const e of an)if(!ln(e,t))return null}return`Expected ${sn(e)} but found ${sn(t)} instead.`}function cn(e,t){return t.some((t=>t.kind===e.kind))}function un(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class hn{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class dn{constructor(e,t,r,i,n){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}}class pn{constructor(e){this.sections=e}static fromString(e){return new pn([new dn(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof pn?e:pn.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class fn{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new fn({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function mn(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function gn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Ni)return!0;if(e instanceof hn)return!0;if(e instanceof pn)return!0;if(e instanceof fn)return!0;if(Array.isArray(e)){for(const t of e)if(!gn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!gn(e[t]))return!1;return!0}return!1}function An(e){if(null===e)return qi;if("string"==typeof e)return Yi;if("boolean"==typeof e)return $i;if("number"==typeof e)return Xi;if(e instanceof Ni)return Ki;if(e instanceof hn)return tn;if(e instanceof pn)return rn;if(e instanceof fn)return nn;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=An(t);if(r){if(r===e)continue;r=en;break}r=e}return on(r||en,t)}return Ji}function _n(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ni||e instanceof pn||e instanceof fn?e.toString():JSON.stringify(e)}class yn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!gn(e[1]))return t.error("invalid value");const r=e[1];let i=An(r);const n=t.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new yn(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Ni?["rgba"].concat(this.value.toArray()):this.value instanceof pn?this.value.serialize():this.value}}class xn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const vn={string:Yi,number:Xi,boolean:$i,object:Ji};class bn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,i=1;const n=e[0];if("array"===n){let n,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in vn)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=vn[r],i++}else n=en;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);o=e[2],i++}r=on(n,o)}else r=vn[n];const o=[];for(;i<e.length;i++){const r=t.parse(e[i],i,en);if(!r)return null;o.push(r)}return new bn(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!ln(this.type,An(r)))return r;if(t===this.args.length-1)throw new xn(`Expected value to be of type ${sn(this.type)}, but found ${sn(An(r))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const i=e.N;("number"==typeof i||this.args.length>1)&&t.push(i)}}return t.concat(this.args.map((e=>e.serialize())))}}class wn{constructor(e){this.type=rn,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,Xi),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,on(Yi)),!r))return null;let s=null;if(o["text-color"]&&(s=t.parse(o["text-color"],1,Ki),!s))return null;const a=i[i.length-1];a.scale=e,a.font=r,a.textColor=s}else{const o=t.parse(e[r],1,en);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:o,scale:null,font:null,textColor:null})}}return new wn(i)}evaluate(e){return new pn(this.sections.map((t=>{const r=t.content.evaluate(e);return An(r)===nn?new dn("",r,null,null,null):new dn(_n(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class Cn{constructor(e,t){this.type=nn,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const r=t.parse(e[1],1,Yi);if(!r)return t.error("No image name provided.");if(2===e.length)return new Cn(r);const i=t.parse(e[2],1,Yi);return i?new Cn(r,i):t.error("Secondary image variant is not a string.")}evaluate(e){const t=fn.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function Tn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const En={"to-boolean":$i,"to-color":Ki,"to-number":Xi,"to-string":Yi};class Mn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0],i=[];let n=qi;if("to-array"===r){if(!Array.isArray(e[1]))return null;const r=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);n=on(t.expectedType.itemType,r)}else{if(!(r>0&&gn(e[1][0])))return null;n=on(An(e[1][0]),r)}for(let o=0;o<r;o++){const r=e[1][o];let s;if("array"===Tn(r))s=t.parse(r,void 0,n.itemType);else{const e=Tn(r);if(e!==n.itemType.kind)return t.error(`Expected ${n.itemType.kind} but found ${e}.`);s=t.registry.literal.parse(["literal",void 0===r?null:r],t)}if(!s)return null;i.push(s)}}else{if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");n=En[r];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,en);if(!n)return null;i.push(n)}}return new Mn(n,i)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const i of this.args){if(t=i.evaluate(e),r=null,t instanceof Ni)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:mn(t[0],t[1],t[2],t[3]),!r))return new Ni(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new xn(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const i=Number(t);if(!isNaN(i))return i}throw new xn(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?pn.fromString(_n(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?fn.fromString(_n(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):_n(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Cn(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Sn=["Unknown","Point","LineString","Polygon"];class In{constructor(e,t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Sn[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*t-e[0])+this.featureDistanceData.bearing[1]*(i*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ni.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Pn{constructor(e,t,r,i,n){this.name=e,this.type=t,this._evaluate=r,this.args=i,this._overloadIndex=n}evaluate(e){if(!this._evaluate){const e=Pn.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],i=Pn.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=[];let a=null,l=-1;for(const[i,c]of o){if(Array.isArray(i)&&i.length!==e.length-1)continue;s.push(i),l++,a=new Go(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const o=[];let u=!1;for(let t=1;t<e.length;t++){const r=e[t],n=Array.isArray(i)?i[t-1]:i.type,s=a.parse(r,1+o.length,n);if(!s){u=!0;break}o.push(s)}if(!u)if(Array.isArray(i)&&i.length!==o.length)a.error(`Expected ${i.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){const t=Array.isArray(i)?i[e]:i.type,r=o[e];a.concat(e+1).checkSubtype(t,r.type)}if(0===a.errors.length)return new Pn(r,n,c,o,l)}}if(1===s.length)t.errors.push(...a.errors);else{const r=(s.length?s:o.map((([e])=>e))).map(Dn).join(" | "),i=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],1+i.length);if(!n)return null;i.push(sn(n.type))}t.error(`Expected arguments of type ${r}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){Pn.definitions=t;for(const r in t)e[r]=Pn}}function Dn(e){return Array.isArray(e)?`(${e.map(sn).join(", ")})`:`(${sn(e.type)}...)`}class kn{constructor(e,t,r){this.type=tn,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const i=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,$i);if(!i)return null;const n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,$i);if(!n)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,Yi),!o)?null:new kn(i,n,o)}evaluate(e){return new hn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}var Ln={exports:{}};Ln.exports=function(){function e(r,i,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,l=i-n+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(r,i,Math.max(n,Math.floor(i-l*u/a+h)),Math.min(o,Math.floor(i+(a-l)*u/a+h)),s)}var d=r[i],p=n,f=o;for(t(r,n,i),s(r[o],d)>0&&t(r,n,o);p<f;){for(t(r,p,f),p++,f--;s(r[p],d)<0;)p++;for(;s(r[f],d)>0;)f--}0===s(r[n],d)?t(r,n,f):t(r,++f,o),f<=i&&(n=f+1),i<=f&&(o=f-1)}}function t(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function r(e,t){return e<t?-1:e>t?1:0}return function(t,i,n,o,s){e(t,i,n||0,o||t.length-1,s||r)}}();var On=h(Ln.exports);function zn(e){let t=0;for(let r,i,n=0,o=e.length,s=o-1;n<o;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function Bn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Rn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Fn(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[0]-r[0],s=e[1]-r[1];return i*s-o*n==0&&i*o<=0&&n*s<=0}function jn(e,t,r=!1){let i=!1;for(let a=0,l=t.length;a<l;a++){const l=t[a];for(let t=0,a=l.length,c=a-1;t<a;c=t++){const a=l[c],u=l[t];if(Fn(e,a,u))return r;(o=a)[1]>(n=e)[1]!=(s=u)[1]>n[1]&&n[0]<(s[0]-o[0])*(n[1]-o[1])/(s[1]-o[1])+o[0]&&(i=!i)}}var n,o,s;return i}function Vn(e,t,r,i){const n=i[0]-r[0],o=i[1]-r[1],s=(e[0]-r[0])*o-n*(e[1]-r[1]),a=(t[0]-r[0])*o-n*(t[1]-r[1]);return s>0&&a<0||s<0&&a>0}function Nn(e,t,r,i){return 0!=(n=[i[0]-r[0],i[1]-r[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-n[1]*o[0]&&!(!Vn(e,t,r,i)||!Vn(r,i,e,t));var n,o}const Un=8192;function Hn(e,t){const r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*Un),Math.round(i*n*Un)]}function Gn(e,t){for(let r=0;r<t.length;r++)if(jn(e,t[r]))return!0;return!1}function Zn(e,t,r){for(const i of r)for(let r=0,n=i.length,o=n-1;r<n;o=r++)if(Nn(e,t,i[o],i[r]))return!0;return!1}function Wn(e,t){for(let r=0;r<e.length;++r)if(!jn(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(Zn(e[r],e[r+1],t))return!1;return!0}function Qn(e,t){for(let r=0;r<t.length;r++)if(Wn(e,t[r]))return!0;return!1}function qn(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const s=Hn(e[n][i],r);Bn(t,s),o.push(s)}i.push(o)}return i}function Xn(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=qn(e[n],t,r);i.push(o)}return i}function Yn(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){const t=.5*i;let n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}Bn(t,e)}function $n(e,t,r,i){const n=Math.pow(2,i.z)*Un,o=[i.x*Un,i.y*Un],s=[];if(!e)return s;for(const i of e)for(const e of i){const i=[e.x+o[0],e.y+o[1]];Yn(i,t,r,n),s.push(i)}return s}function Kn(e,t,r,i){const n=Math.pow(2,i.z)*Un,o=[i.x*Un,i.y*Un],s=[];if(!e)return s;for(const r of e){const e=[];for(const i of r){const r=[i.x+o[0],i.y+o[1]];Bn(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const i of e)Yn(i,t,r,n)}var a;return s}class Jn{constructor(e,t){this.type=$i,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(gn(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Jn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Jn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Jn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(!n)return!1;if("Polygon"===t.type){const o=qn(t.coordinates,i,n),s=$n(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!jn(e,o))return!1}if("MultiPolygon"===t.type){const o=Xn(t.coordinates,i,n),s=$n(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Gn(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if(!n)return!1;if("Polygon"===t.type){const o=qn(t.coordinates,i,n),s=Kn(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Wn(e,o))return!1}if("MultiPolygon"===t.type){const o=Xn(t.coordinates,i,n),s=Kn(e.geometry(),r,i,n);if(!Rn(r,i))return!1;for(const e of s)if(!Qn(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var eo={exports:{}};!function(e,t){e.exports=function(){var e={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},t=1/298.257223563,r=t*(2-t),i=Math.PI/180,n=function(t,n){if(void 0===t)throw new Error("No latitude given.");if(n&&!e[n])throw new Error("Unknown unit "+n+". Use one of: "+Object.keys(e).join(", "));var o=6378.137*i*(n?e[n]:1),s=Math.cos(t*i),a=1/(1-r*(1-s*s)),l=Math.sqrt(a);this.kx=o*l*s,this.ky=o*l*a*(1-r)},o={units:{configurable:!0}};function s(e,t){return e[0]===t[0]&&e[1]===t[1]}function a(e,t,r){var i=l(t[0]-e[0]);return[e[0]+i*r,e[1]+(t[1]-e[1])*r]}function l(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}return n.fromTile=function(e,t,r){var o=Math.PI*(1-2*(e+.5)/Math.pow(2,t)),s=Math.atan(.5*(Math.exp(o)-Math.exp(-o)))/i;return new n(s,r)},o.units.get=function(){return e},n.prototype.distance=function(e,t){var r=l(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)},n.prototype.bearing=function(e,t){var r=l(t[0]-e[0])*this.kx;return Math.atan2(r,(t[1]-e[1])*this.ky)/i},n.prototype.destination=function(e,t,r){var n=r*i;return this.offset(e,Math.sin(n)*t,Math.cos(n)*t)},n.prototype.offset=function(e,t,r){return[e[0]+t/this.kx,e[1]+r/this.ky]},n.prototype.lineDistance=function(e){for(var t=0,r=0;r<e.length-1;r++)t+=this.distance(e[r],e[r+1]);return t},n.prototype.area=function(e){for(var t=0,r=0;r<e.length;r++)for(var i=e[r],n=0,o=i.length,s=o-1;n<o;s=n++)t+=l(i[n][0]-i[s][0])*(i[n][1]+i[s][1])*(r?-1:1);return Math.abs(t)/2*this.kx*this.ky},n.prototype.along=function(e,t){var r=0;if(t<=0)return e[0];for(var i=0;i<e.length-1;i++){var n=e[i],o=e[i+1],s=this.distance(n,o);if((r+=s)>t)return a(n,o,(t-(r-s))/s)}return e[e.length-1]},n.prototype.pointToSegmentDistance=function(e,t,r){var i=t[0],n=t[1],o=l(r[0]-i)*this.kx,s=(r[1]-n)*this.ky,a=0;return 0===o&&0===s||((a=(l(e[0]-i)*this.kx*o+(e[1]-n)*this.ky*s)/(o*o+s*s))>1?(i=r[0],n=r[1]):a>0&&(i+=o/this.kx*a,n+=s/this.ky*a)),o=l(e[0]-i)*this.kx,s=(e[1]-n)*this.ky,Math.sqrt(o*o+s*s)},n.prototype.pointOnLine=function(e,t){for(var r,i,n,o,s=1/0,a=0;a<e.length-1;a++){var c=e[a][0],u=e[a][1],h=l(e[a+1][0]-c)*this.kx,d=(e[a+1][1]-u)*this.ky,p=0;0===h&&0===d||((p=(l(t[0]-c)*this.kx*h+(t[1]-u)*this.ky*d)/(h*h+d*d))>1?(c=e[a+1][0],u=e[a+1][1]):p>0&&(c+=h/this.kx*p,u+=d/this.ky*p));var f=(h=l(t[0]-c)*this.kx)*h+(d=(t[1]-u)*this.ky)*d;f<s&&(s=f,r=c,i=u,n=a,o=p)}return{point:[r,i],index:n,t:Math.max(0,Math.min(1,o))}},n.prototype.lineSlice=function(e,t,r){var i=this.pointOnLine(r,e),n=this.pointOnLine(r,t);if(i.index>n.index||i.index===n.index&&i.t>n.t){var o=i;i=n,n=o}var a=[i.point],l=i.index+1,c=n.index;!s(r[l],a[0])&&l<=c&&a.push(r[l]);for(var u=l+1;u<=c;u++)a.push(r[u]);return s(r[c],n.point)||a.push(n.point),a},n.prototype.lineSliceAlong=function(e,t,r){for(var i=0,n=[],o=0;o<r.length-1;o++){var s=r[o],l=r[o+1],c=this.distance(s,l);if((i+=c)>e&&0===n.length&&n.push(a(s,l,(e-(i-c))/c)),i>=t)return n.push(a(s,l,(t-(i-c))/c)),n;i>e&&n.push(l)}return n},n.prototype.bufferPoint=function(e,t){var r=t/this.ky,i=t/this.kx;return[e[0]-i,e[1]-r,e[0]+i,e[1]+r]},n.prototype.bufferBBox=function(e,t){var r=t/this.ky,i=t/this.kx;return[e[0]-i,e[1]-r,e[2]+i,e[3]+r]},n.prototype.insideBBox=function(e,t){return l(e[0]-t[0])>=0&&l(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]},Object.defineProperties(n,o),n}()}(eo);var to=h(eo.exports),ro={exports:{}};!function(e,t){e.exports=function(){var e=function(e,r){if(void 0===e&&(e=[]),void 0===r&&(r=t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};function t(e,t){return e<t?-1:e>t?1:0}return e.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},e.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},e.prototype.peek=function(){return this.data[0]},e.prototype._up=function(e){for(var t=this.data,r=this.compare,i=t[e];e>0;){var n=e-1>>1,o=t[n];if(r(i,o)>=0)break;t[e]=o,e=n}t[e]=i},e.prototype._down=function(e){for(var t=this.data,r=this.compare,i=this.length>>1,n=t[e];e<i;){var o=1+(e<<1),s=t[o],a=o+1;if(a<this.length&&r(t[a],s)<0&&(o=a,s=t[a]),r(s,n)>=0)break;t[e]=s,e=o}t[e]=n},e}()}(ro);var io=h(ro.exports),no=8192;function oo(e,t){return t.dist-e.dist}const so=100,ao=50;function lo(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function co(e){return e[1]-e[0]+1}function uo(e,t){const r=e[1]>=e[0]&&e[1]<t;return r||console.warn("Distance Expression: Index is out of range"),r}function ho(e,t){if(e[0]>e[1])return[null,null];const r=co(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===r)return[e,null];const t=Math.floor(r/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function po(e,t){const r=[1/0,1/0,-1/0,-1/0];if(!uo(t,e.length))return r;for(let i=t[0];i<=t[1];++i)Bn(r,e[i]);return r}function fo(e){const t=[1/0,1/0,-1/0,-1/0];for(let r=0;r<e.length;++r)for(let i=0;i<e[r].length;++i)Bn(t,e[r][i]);return t}function mo(e,t,r){if(lo(e)||lo(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function go(e){return 360*e-180}function Ao(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function _o(e,t){const r=Math.pow(2,t.z),i=(e.y/no+t.y)/r;return[go((e.x/no+t.x)/r),Ao(i)]}function yo(e,t){const r=[];for(let i=0;i<e.length;++i)r.push(_o(e[i],t));return r}function xo(e,t,r){const i=r.pointOnLine(t,e).point;return r.distance(e,i)}function vo(e,t,r,i,n){const o=r.slice(i[0],i[1]+1);let s=1/0;for(let r=t[0];r<=t[1];++r)if(0===(s=Math.min(s,xo(e[r],o,n))))return 0;return s}function bo(e,t,r,i,n){const o=Math.min(n.pointToSegmentDistance(e,r,i),n.pointToSegmentDistance(t,r,i)),s=Math.min(n.pointToSegmentDistance(r,e,t),n.pointToSegmentDistance(i,e,t));return Math.min(o,s)}function wo(e,t,r,i,n){if(!uo(t,e.length)||!uo(i,r.length))return NaN;let o=1/0;for(let s=t[0];s<t[1];++s)for(let t=i[0];t<i[1];++t){if(Nn(e[s],e[s+1],r[t],r[t+1]))return 0;o=Math.min(o,bo(e[s],e[s+1],r[t],r[t+1],n))}return o}function Co(e,t,r,i,n){if(!uo(t,e.length)||!uo(i,r.length))return NaN;let o=1/0;for(let s=t[0];s<=t[1];++s)for(let t=i[0];t<=i[1];++t)if(0===(o=Math.min(o,n.distance(e[s],r[t]))))return o;return o}function To(e,t,r){if(jn(e,t,!0))return 0;let i=1/0;for(const n of t){const t=n.length;if(t<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(n[0]!==n[t-1]&&0===(i=Math.min(i,r.pointToSegmentDistance(e,n[t-1],n[0]))))return i;if(0===(i=Math.min(i,xo(e,n,r))))return i}return i}function Eo(e,t,r,i){if(!uo(t,e.length))return NaN;for(let i=t[0];i<=t[1];++i)if(jn(e[i],r,!0))return 0;let n=1/0;for(let o=t[0];o<t[1];++o)for(const t of r)for(let r=0,s=t.length,a=s-1;r<s;a=r++){if(Nn(e[o],e[o+1],t[a],t[r]))return 0;n=Math.min(n,bo(e[o],e[o+1],t[a],t[r],i))}return n}function Mo(e,t){for(const r of e)for(let e=0;e<=r.length-1;++e)if(jn(r[e],t,!0))return!0;return!1}function So(e,t,r,i=1/0){const n=fo(e),o=fo(t);if(i!==1/0&&mo(n,o,r)>=i)return i;if(Rn(n,o)){if(Mo(e,t))return 0}else if(Mo(t,e))return 0;let s=i;for(const i of e)for(let e=0,n=i.length,o=n-1;e<n;o=e++)for(const n of t)for(let t=0,a=n.length,l=a-1;t<a;l=t++){if(Nn(i[o],i[e],n[l],n[t]))return 0;s=Math.min(s,bo(i[o],i[e],n[l],n[t],r))}return s}function Io(e,t,r,i,n,o,s){if(null===o||null===s)return;const a=mo(po(i,o),po(n,s),r);a<t&&e.push({dist:a,range1:o,range2:s})}function Po(e,t,r,i,n=1/0){let o=Math.min(i.distance(e[0],r[0][0]),n);if(0===o)return o;const s=new io([{dist:0,range1:[0,e.length-1],range2:[0,0]}],oo),a=t?ao:so,l=fo(r);for(;s.length;){const n=s.pop();if(n.dist>=o)continue;const c=n.range1;if(co(c)<=a){if(!uo(c,e.length))return NaN;if(t){const t=Eo(e,c,r,i);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const n=To(e[t],r,i);if(0===(o=Math.min(o,n)))return o}}else{const r=ho(c,t);if(null!==r[0]){const t=mo(po(e,r[0]),l,i);t<o&&s.push({dist:t,range1:r[0],range2:[0,0]})}if(null!==r[1]){const t=mo(po(e,r[1]),l,i);t<o&&s.push({dist:t,range1:r[1],range2:[0,0]})}}}return o}function Do(e,t,r,i,n,o=1/0){let s=Math.min(o,n.distance(e[0],r[0]));if(0===s)return s;const a=new io([{dist:0,range1:[0,e.length-1],range2:[0,r.length-1]}],oo),l=t?ao:so,c=i?ao:so;for(;a.length;){const o=a.pop();if(o.dist>=s)continue;const u=o.range1,h=o.range2;if(co(u)<=l&&co(h)<=c){if(!uo(u,e.length)||!uo(h,r.length))return NaN;if(t&&i?s=Math.min(s,wo(e,u,r,h,n)):t||i?t&&!i?s=Math.min(s,vo(r,h,e,u,n)):!t&&i&&(s=Math.min(s,vo(e,u,r,h,n))):s=Math.min(s,Co(e,u,r,h,n)),0===s)return s}else{const o=ho(u,t),l=ho(h,i);Io(a,s,n,e,r,o[0],l[0]),Io(a,s,n,e,r,o[0],l[1]),Io(a,s,n,e,r,o[1],l[0]),Io(a,s,n,e,r,o[1],l[1])}}return s}function ko(e,t,r,i,n=1/0){let o=n;const s=po(e,[0,e.length-1]);for(const n of r)if(!(o!==1/0&&mo(s,po(n,[0,n.length-1]),i)>=o)&&(o=Math.min(o,Do(e,t,n,!0,i,o)),0===o))return o;return o}function Lo(e,t,r,i,n=1/0){let o=n;const s=po(e,[0,e.length-1]);for(const n of r){if(o!==1/0&&mo(s,fo(n),i)>=o)continue;const r=Po(e,t,n,i,o);if(isNaN(r))return r;if(0===(o=Math.min(o,r)))return o}return o}function Oo(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class zo{constructor(e,t){this.type=Xi,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(gn(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;e<t.features.length;++e)if(Oo(t.features[e].geometry.type))return new zo(t,t.features[e].geometry)}else if("Feature"===t.type){if(Oo(t.geometry.type))return new zo(t,t.geometry)}else if(Oo(t.type))return new zo(t,t)}return t.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(e){const t=e.geometry(),r=e.canonicalID();if(null!=t&&null!=r){if("Point"===e.geometryType())return function(e,t,r){const i=[];for(const r of e)for(const e of r)i.push(_o(e,t));const n=new to(i[0][1],"meters");return"Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?Do(i,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n):"MultiLineString"===r.type?ko(i,!1,r.coordinates,n):"Polygon"===r.type||"MultiPolygon"===r.type?Lo(i,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,n):null}(t,r,this.geometries);if("LineString"===e.geometryType())return function(e,t,r){const i=[];for(const r of e){const e=[];for(const i of r)e.push(_o(i,t));i.push(e)}const n=new to(i[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return ko("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i,n);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=ko(r.coordinates[t],!0,i,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}if("Polygon"===r.type||"MultiPolygon"===r.type){let e=1/0;for(let t=0;t<i.length;t++){const o=Lo(i[t],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return null}(t,r,this.geometries);if("Polygon"===e.geometryType())return function(e,t,r){const i=[];for(const r of function(e,t){const r=e.length;if(r<=1)return[e];const i=[];let n,o;for(let t=0;t<r;t++){const r=zn(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(n&&i.push(n),n=[e[t]]):n.push(e[t]))}return n&&i.push(n),i}(e)){const e=[];for(let i=0;i<r.length;++i)e.push(yo(r[i],t));i.push(e)}const n=new to(i[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Lo("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i,n);if("MultiLineString"===r.type){let e=1/0;for(let t=0;t<r.coordinates.length;t++){const o=Lo(r.coordinates[t],!0,i,n,e);if(isNaN(o))return o;if(0===(e=Math.min(e,o)))return e}return e}return"Polygon"===r.type||"MultiPolygon"===r.type?function(e,t,r){let i=1/0;for(const n of e)for(const e of t){const t=So(n,e,r,i);if(isNaN(t))return t;if(0===(i=Math.min(i,t)))return i}return i}("Polygon"===r.type?[r.coordinates]:r.coordinates,i,n):null}(t,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.")}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return!0}serialize(){return["distance",this.geojson]}}function Bo(e,t){switch(e){case"string":return _n(t);case"number":return+t;case"boolean":return!!t;case"color":return Ni.parse(t);case"formatted":return pn.fromString(_n(t));case"resolvedImage":return fn.fromString(_n(t))}return t}function Ro(e,t,r,i){return void 0!==i&&(e=i*Math.round(e/i)),void 0!==t&&e<t&&(e=t),void 0!==r&&e>r&&(e=r),e}class Fo{constructor(e,t,r){this.type=e,this.key=t,this.scope=r}static parse(e,t){let r=t.expectedType;if(null==r&&(r=en),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const i=t.parse(e[1],1);if(!(i instanceof yn))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const n=t.parse(e[2],2);return n instanceof yn?new Fo(r,_n(i.value),_n(n.value)):t.error("Scope of 'config' expression must be a string literal.")}return new Fo(r,_n(i.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join(""),r=e.getConfig(t);if(!r)return null;const{type:i,value:n,values:o,minValue:s,maxValue:a,stepValue:l}=r,c=r.default.evaluate(e);let u=c;if(n){const t=e.scope;e.scope=(t||"").split("").slice(1).join(""),u=n.evaluate(e),e.scope=t}return i&&(u=Bo(i,u)),void 0===u||void 0===s&&void 0===a&&void 0===l||("number"==typeof u?u=Ro(u,s,a,l):Array.isArray(u)&&(u=u.map((e=>"number"==typeof e?Ro(e,s,a,l):e)))),void 0!==n&&void 0!==u&&o&&!o.includes(u)&&(u=c,i&&(u=Bo(i,u))),(i&&i!==this.type||void 0!==u&&An(u)!==this.type)&&(u=Bo(this.type.kind,u)),u}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function jo(e){if(e instanceof Pn){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Jn)return!1;if(e instanceof zo)return!1;let t=!0;return e.eachChild((e=>{t&&!jo(e)&&(t=!1)})),t}function Vo(e){if(e instanceof Pn&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Vo(e)&&(t=!1)})),t}function No(e){if(e instanceof Fo)return!1;let t=!0;return e.eachChild((e=>{t&&!No(e)&&(t=!1)})),t}function Uo(e,t){if(e instanceof Pn&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Uo(e,t)&&(r=!1)})),r}class Ho{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new Ho(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Go{constructor(e,t=[],r,i=new Qi,n=[],o,s){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r,this._scope=o,this.options=s}parse(e,t,r,i,n={}){return t||r?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new bn(t,[e]):"coerce"===r?new Mn(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", []].');const i="string"==typeof e[0]?this.registry[e[0]]:void 0;if(i){let n=i.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,i=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(e,i))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof yn)&&"resolvedImage"!==n.type.kind&&Zo(n)){const t=new In(this._scope,this.options);try{n=new yn(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return Mn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const i="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new Go(this.registry,i,t||null,n,this.errors,this._scope,this.options)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new Wi(r,e))}checkSubtype(e,t){const r=ln(e,t);return r&&this.error(r),r}}function Zo(e){if(e instanceof Ho)return Zo(e.boundExpression);if(e instanceof Pn&&"error"===e.name)return!1;if(e instanceof kn)return!1;if(e instanceof Jn)return!1;if(e instanceof zo)return!1;if(e instanceof Fo)return!1;const t=e instanceof Mn||e instanceof bn;let r=!0;return e.eachChild((e=>{r=t?r&&Zo(e):r&&e instanceof yn})),!!r&&jo(e)&&Uo(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Wo(e,t){const r=e.length-1;let i,n,o=0,s=r,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),i=e[a],n=e[a+1],i<=t){if(a===r||t<n)return a;o=a+1}else{if(!(i>t))throw new xn("Input is not a number.");s=a-1}return 0}class Qo{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){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.");const r=t.parse(e[1],1,Xi);if(!r)return null;const i=[];let n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],s=e[r+1],a=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(i.length&&i[i.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,n);if(!c)return null;n=n||c.type,i.push([o,c])}return new Qo(n,r,i)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[Wo(t,i)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const qo=.95047,Xo=1.08883,Yo=4/29,$o=6/29,Ko=3*$o*$o,Jo=$o*$o*$o,es=Math.PI/180,ts=180/Math.PI;function rs(e){return e>Jo?Math.pow(e,1/3):e/Ko+Yo}function is(e){return e>$o?e*e*e:Ko*(e-Yo)}function ns(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ss(e){const t=os(e.r),r=os(e.g),i=os(e.b),n=rs((.4124564*t+.3575761*r+.1804375*i)/qo),o=rs((.2126729*t+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-rs((.0193339*t+.119192*r+.9503041*i)/Xo)),alpha:e.a}}function as(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*is(t),r=qo*is(r),i=Xo*is(i),new Ni(ns(3.2404542*r-1.5371385*t-.4985314*i),ns(-.969266*r+1.8760108*t+.041556*i),ns(.0556434*r-.2040259*t+1.0572252*i),e.alpha)}function ls(e,t,r){const i=t-e;return e+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const cs={forward:ss,reverse:as,interpolate:function(e,t,r){return{l:Ui(e.l,t.l,r),a:Ui(e.a,t.a,r),b:Ui(e.b,t.b,r),alpha:Ui(e.alpha,t.alpha,r)}}},us={forward:function(e){const{l:t,a:r,b:i}=ss(e),n=Math.atan2(i,r)*ts;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:t,alpha:e.a}},reverse:function(e){const t=e.h*es,r=e.c;return as({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:ls(e.h,t.h,r),c:Ui(e.c,t.c,r),l:Ui(e.l,t.l,r),alpha:Ui(e.alpha,t.alpha,r)}}};var hs=Object.freeze({__proto__:null,hcl:us,lab:cs});class ds{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=ps(t,e.base,r,i);else if("linear"===e.name)n=ps(t,1,r,i);else if("cubic-bezier"===e.name){const o=e.controlPoints;n=new Rt(o[0],o[1],o[2],o[3]).solve(ps(t,1,r,i))}return n}static parse(e,t){let[r,i,n,...o]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}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(n=t.parse(n,2,Xi),!n)return null;const s=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=Ki:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],i=o[e+1],n=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(i,l,a);if(!c)return null;a=a||c.type,s.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ds(a,r,i,n,s):t.error(`Type ${sn(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);const o=Wo(t,i),s=ds.interpolationFactor(this.interpolation,i,t[o],t[o+1]),a=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?Gi[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?us.reverse(us.interpolate(us.forward(a),us.forward(l),s)):cs.reverse(cs.interpolate(cs.forward(a),cs.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function ps(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}class fs{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const i=t.expectedType;i&&"value"!==i.kind&&(r=i);const n=[];for(const i of e.slice(1)){const e=t.parse(i,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,n.push(e)}const o=i&&n.some((e=>ln(i,e.type)));return new fs(o?en:r,n)}evaluate(e){let t,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(e),r&&r instanceof fn&&!r.available&&(t||(t=r),r=null,i===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class ms{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const o=t.parse(e[i+1],i+1);if(!o)return null;r.push([n,o])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new ms(r,i):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,r]of this.bindings)e.push(t,r.serialize());return e.push(this.result.serialize()),e}}class gs{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,Xi),i=t.parse(e[2],2,on(t.expectedType||en));return r&&i?new gs(i.type.itemType,r,i):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new xn(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new xn(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new xn(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class As{constructor(e,t){this.type=$i,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,en);return r&&i?cn(r.type,[$i,Yi,Xi,qi,en])?new As(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!un(t,["boolean","string","number","null"]))throw new xn(`Expected first argument to be of type boolean, string, number or null, but found ${sn(An(t))} instead.`);if(!un(r,["string","array"]))throw new xn(`Expected second argument to be of type array or string, but found ${sn(An(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class _s{constructor(e,t,r){this.type=Xi,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,en);if(!r||!i)return null;if(!cn(r.type,[$i,Yi,Xi,qi,en]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${sn(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Xi);return n?new _s(r,i,n):null}return new _s(r,i)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!un(t,["boolean","string","number","null"]))throw new xn(`Expected first argument to be of type boolean, string, number or null, but found ${sn(An(t))} instead.`);if(!un(r,["string","array"]))throw new xn(`Expected second argument to be of type array or string, but found ${sn(An(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ys{constructor(e,t,r,i,n,o){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}static parse(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.");let r,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n={},o=[];for(let s=2;s<e.length-1;s+=2){let a=e[s];const l=e[s+1];Array.isArray(a)||(a=[a]);const c=t.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const e of a){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,An(e)))return null}else r=An(e);if(void 0!==n[String(e)])return c.error("Branch labels must be unique.");n[String(e)]=o.length}const u=t.parse(l,s,i);if(!u)return null;i=i||u.type,o.push(u)}const s=t.parse(e[1],1,en);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,i);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new ys(r,i,s,n,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(An(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],i={};for(const e of t){const t=i[this.cases[e]];void 0===t?(i[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const n=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,i]of r)e.push(1===i.length?n(i[0]):i.map(n)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class xs{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i=[];for(let n=1;n<e.length-1;n+=2){const o=t.parse(e[n],n,$i);if(!o)return null;const s=t.parse(e[n+1],n+1,r);if(!s)return null;i.push([o,s]),r=r||s.type}const n=t.parse(e[e.length-1],e.length-1,r);return n?new xs(r,i,n):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class vs{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,en),i=t.parse(e[2],2,Xi);if(!r||!i)return null;if(!cn(r.type,[on(en),Yi,en]))return t.error(`Expected first argument to be of type array or string, but found ${sn(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Xi);return n?new vs(r.type,r,i,n):null}return new vs(r.type,r,i)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!un(t,["string","array"]))throw new xn(`Expected first argument to be of type array or string, but found ${sn(An(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function bs(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ws(e,t,r,i){return 0===i.compare(t,r)}function Cs(e,t,r){const i="=="!==e&&"!="!==e;return class n{constructor(e,t,r){this.type=$i,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,en);if(!o)return null;if(!bs(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${sn(o.type)}'.`);let s=t.parse(e[2],2,en);if(!s)return null;if(!bs(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${sn(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${sn(o.type)}' and '${sn(s.type)}'.`);i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new bn(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new bn(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,tn),!a)return null}return new n(o,s,a)}evaluate(n){const o=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const t=An(o),r=An(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new xn(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const e=An(o),r=An(s);if("string"!==e.kind||"string"!==r.kind)return t(n,o,s)}return this.collator?r(n,o,s,this.collator.evaluate(n)):t(n,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Ts=Cs("==",(function(e,t,r){return t===r}),ws),Es=Cs("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!ws(0,t,r,i)})),Ms=Cs("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),Ss=Cs(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),Is=Cs("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),Ps=Cs(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0}));class Ds{constructor(e,t,r,i,n,o){this.type=Yi,this.number=e,this.locale=t,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Xi);if(!r)return null;const i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=t.parse(i.locale,1,Yi),!n))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,Yi),!o))return null;let s=null;if(i.unit&&(s=t.parse(i.unit,1,Yi),!s))return null;let a=null;if(i["min-fraction-digits"]&&(a=t.parse(i["min-fraction-digits"],1,Xi),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=t.parse(i["max-fraction-digits"],1,Xi),!l)?null:new Ds(r,n,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class ks{constructor(e){this.type=Xi,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${sn(r.type)} instead.`):new ks(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new xn(`Expected value to be of type string or array, but found ${sn(An(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Ls(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const Os={"==":Ts,"!=":Es,">":Ss,"<":Ms,">=":Ps,"<=":Is,array:bn,at:gs,boolean:bn,case:xs,coalesce:fs,collator:kn,format:wn,image:Cn,in:As,"index-of":_s,interpolate:ds,"interpolate-hcl":ds,"interpolate-lab":ds,length:ks,let:ms,literal:yn,match:ys,number:bn,"number-format":Ds,object:bn,slice:vs,step:Qo,string:bn,"to-boolean":Mn,"to-color":Mn,"to-number":Mn,"to-string":Mn,var:Ho,within:Jn,distance:zo,config:Fo};function zs(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,s=mn(t,r,i,o);if(s)throw new xn(s);return new Ni(t/255*o,r/255*o,i/255*o,o)}function Bs(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,s=function(e,t,r,i){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid hsla value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'h' must be between 0 and 360.`}(t,r,i,o);if(s)throw new xn(s);const a=`hsla(${t}, ${r}%, ${i}%, ${o})`,l=Ni.parse(a);if(!l)throw new xn(`Failed to parse HSLA color: ${a}`);return l}function Rs(e,t){return e in t}function Fs(e,t){const r=t[e];return void 0===r?null:r}function js(e){return{type:e}}function Vs(e){return{result:"success",value:e}}function Ns(e){return{result:"error",value:e}}function Us(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Hs(e){return"data-driven"===e["property-type"]}function Gs(e){return Us(e.expression,"measure-light")}function Zs(e){return Us(e.expression,"zoom")}function Ws(e){return!!e.expression&&e.expression.interpolated}function Qs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function qs(e){return e}function Xs(e,t){const r="color"===t.type,i=e.stops&&"object"==typeof e.stops[0][0],n=i||!(i||void 0!==e.property),o=e.type||(Ws(t)?"exponential":"interval");if(r&&((e=Zi({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Ni.parse(e[1])]))),e.default=Ni.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!hs[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=Js;else if("interval"===o)s=Ks;else if("categorical"===o){s=$s,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=ea}if(i){const r={},i=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},i.push(o)),r[o].stops.push([n[0].value,n[1]])}const n=[];for(const e of i)n.push([r[e].zoom,Xs(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:ds.interpolationFactor.bind(void 0,o),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>Js({stops:n,base:e.base},t,r).evaluate(r,i)}}if(n){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:ds.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,a,l)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[e.property]:void 0;return void 0===n?Ys(e.default,t.default):s(e,t,n,a,l)}}}function Ys(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function $s(e,t,r,i,n){return Ys(typeof r===n?i[r]:void 0,e.default,t.default)}function Ks(e,t,r){if("number"!==Tn(r))return Ys(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const n=Wo(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function Js(e,t,r){const i=void 0!==e.base?e.base:1;if("number"!==Tn(r))return Ys(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const o=Wo(e.stops.map((e=>e[0])),r),s=function(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=Gi[t.type]||qs;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=hs[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,s)}}:c(a,l,s)}function ea(e,t,r){return"color"===t.type?r=Ni.parse(r):"formatted"===t.type?r=pn.fromString(r.toString()):"resolvedImage"===t.type?r=fn.fromString(r.toString()):Tn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),Ys(r,e.default,t.default)}Pn.register(Os,{error:[{kind:"error"},[Yi],(e,[t])=>{throw new xn(t.evaluate(e))}],typeof:[Yi,[en],(e,[t])=>sn(An(t.evaluate(e)))],"to-rgba":[on(Xi,4),[Ki],(e,[t])=>t.evaluate(e).toArray()],rgb:[Ki,[Xi,Xi,Xi],zs],rgba:[Ki,[Xi,Xi,Xi,Xi],zs],hsl:[Ki,[Xi,Xi,Xi],Bs],hsla:[Ki,[Xi,Xi,Xi,Xi],Bs],has:{type:$i,overloads:[[[Yi],(e,[t])=>Rs(t.evaluate(e),e.properties())],[[Yi,Ji],(e,[t,r])=>Rs(t.evaluate(e),r.evaluate(e))]]},get:{type:en,overloads:[[[Yi],(e,[t])=>Fs(t.evaluate(e),e.properties())],[[Yi,Ji],(e,[t,r])=>Fs(t.evaluate(e),r.evaluate(e))]]},"feature-state":[en,[Yi],(e,[t])=>Fs(t.evaluate(e),e.featureState||{})],properties:[Ji,[],e=>e.properties()],"geometry-type":[Yi,[],e=>e.geometryType()],id:[en,[],e=>e.id()],zoom:[Xi,[],e=>e.globals.zoom],pitch:[Xi,[],e=>e.globals.pitch||0],"distance-from-center":[Xi,[],e=>e.distanceFromCenter()],"measure-light":[Xi,[Yi],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[Xi,[],e=>e.globals.heatmapDensity||0],"line-progress":[Xi,[],e=>e.globals.lineProgress||0],"raster-value":[Xi,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Xi,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Xi,[],e=>e.globals.skyRadialProgress||0],accumulated:[en,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Xi,js(Xi),(e,t)=>{let r=0;for(const i of t)r+=i.evaluate(e);return r}],"*":[Xi,js(Xi),(e,t)=>{let r=1;for(const i of t)r*=i.evaluate(e);return r}],"-":{type:Xi,overloads:[[[Xi,Xi],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Xi],(e,[t])=>-t.evaluate(e)]]},"/":[Xi,[Xi,Xi],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Xi,[Xi,Xi],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Xi,[],()=>Math.LN2],pi:[Xi,[],()=>Math.PI],e:[Xi,[],()=>Math.E],"^":[Xi,[Xi,Xi],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Xi,[Xi],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))],log2:[Xi,[Xi],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Xi,[Xi],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Xi,[Xi],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Xi,[Xi],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Xi,[Xi],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Xi,[Xi],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Xi,[Xi],(e,[t])=>Math.atan(t.evaluate(e))],min:[Xi,js(Xi),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Xi,js(Xi),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Xi,[Xi],(e,[t])=>Math.abs(t.evaluate(e))],round:[Xi,[Xi],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Xi,[Xi],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Xi,[Xi],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[$i,[Yi,en],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[$i,[en],(e,[t])=>e.id()===t.value],"filter-type-==":[$i,[Yi],(e,[t])=>e.geometryType()===t.value],"filter-<":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[$i,[Yi,en],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[$i,[en],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[$i,[en],(e,[t])=>t.value in e.properties()],"filter-has-id":[$i,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[$i,[on(Yi)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[$i,[on(en)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[$i,[Yi,on(en)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[$i,[Yi,on(en)],(e,[t,r])=>function(e,t,r,i){for(;r<=i;){const n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:$i,overloads:[[[$i,$i],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[js($i),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:$i,overloads:[[[$i,$i],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[js($i),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[$i,[$i],(e,[t])=>!t.evaluate(e)],"is-supported-script":[$i,[Yi],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Yi,[Yi],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Yi,[Yi],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Yi,js(en),(e,t)=>t.map((t=>_n(t.evaluate(e)))).join("")],"resolved-locale":[Yi,[tn],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[Xi,[Xi,Xi,en],(e,t)=>{const[r,i,n]=t.map((t=>t.evaluate(e)));if(r>i)return r;if(r===i)return r;let o;if("string"==typeof n)o=function(e){let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}(n);else{if("number"!=typeof n)throw new xn(`Invalid seed input: ${n}`);o=n}return r+Ls(o)()*(i-r)}]});class ta{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new In(r,i),this._defaultValue=t?function(e){return"color"===e.type&&(Qs(e.default)||Array.isArray(e.default))?new Ni(0,0,0,0):"color"===e.type?Ni.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,o,s,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,o,s,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new xn(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function ra(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Os}function ia(e,t,r,i){const n=new Go(Os,[],t?function(e){const t={color:Ki,string:Yi,number:Xi,enum:Yi,boolean:$i,formatted:rn,resolvedImage:nn};return"array"===e.type?on(t[e.value]||en,e.length):t[e.type]}(t):void 0,void 0,void 0,r,i),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Vs(new ta(o,t,r,i)):Ns(n.errors)}class na{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isLightConstant=r,this.isStateDependent="constant"!==e&&!Vo(t.expression),this.isConfigDependent=!No(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}}class oa{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Vo(t.expression),this.isLightConstant=n,this.isConfigDependent=!No(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}interpolationFactor(e,t,r){return this.interpolationType?ds.interpolationFactor(this.interpolationType,e,t,r):0}}function sa(e,t,r,i){if("error"===(e=ia(e,t,r,i)).result)return e;const n=e.value.expression,o=jo(n);if(!o&&!Hs(t))return Ns([new Wi("","data expressions not supported")]);const s=Uo(n,["zoom","pitch","distance-from-center"]);if(!s&&!Zs(t))return Ns([new Wi("","zoom expressions not supported")]);const a=Uo(n,["measure-light"]);if(!a&&!Gs(t))return Ns([new Wi("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=la(n);return c||s||l?c instanceof Wi?Ns([c]):c instanceof ds&&!Ws(t)?Ns([new Wi("",'"interpolate" expressions cannot be used with this property')]):Vs(c?new oa(o?"camera":"composite",e.value,c.labels,c instanceof ds?c.interpolation:void 0,a):new na(o?"constant":"source",e.value,a)):Ns([new Wi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class aa{constructor(e,t){this._parameters=e,this._specification=t,Zi(this,Xs(this._parameters,this._specification))}static deserialize(e){return new aa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function la(e){let t=null;if(e instanceof ms)t=la(e.result);else if(e instanceof fs){for(const r of e.args)if(t=la(r),t)break}else(e instanceof Qo||e instanceof ds)&&e.input instanceof Pn&&"zoom"===e.input.name&&(t=e);return t instanceof Wi||e.eachChild((e=>{const r=la(e);r instanceof Wi?t=r:t&&r&&t!==r&&(t=new Wi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var ca=ha,ua=3;function ha(e,t,r){var i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],this.d=(t=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var s=n[ua+o],a=n[ua+o+1];i.push(s===a?null:n.subarray(s,a))}var l=n[ua+i.length+1];this.keys=n.subarray(n[ua+i.length],l),this.bboxes=n.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var u=r/t*e;this.min=-u,this.max=e+u}ha.prototype.insert=function(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},ha.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ha.prototype._insertCell=function(e,t,r,i,n,o){this.cells[n].push(o)},ha.prototype.query=function(e,t,r,i,n){var o=this.min,s=this.max;if(e<=o&&t<=o&&s<=r&&s<=i&&!n)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(e,t,r,i,this._queryCell,a,{},n),a},ha.prototype._queryCell=function(e,t,r,i,n,o,s,a){var l=this.cells[n];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):e<=u[p+2]&&t<=u[p+3]&&r>=u[p+0]&&i>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},ha.prototype._forEachCell=function(e,t,r,i,n,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(i),d=l;d<=u;d++)for(var p=c;p<=h;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&n.call(this,e,t,r,i,f,o,s,a))return}},ha.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ha.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ua+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=t,s=0;s<e.length;s++){var a=e[s];n[ua+s]=o,n.set(a,o),o+=a.length}return n[ua+e.length]=o,n.set(this.keys,o),n[ua+e.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var da=h(ca);const pa={};function fa(e,t,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pa[t]={klass:e,omit:r.omit||[]}}fa(Object,"Object"),da.serialize=function(e,t){const r=e.toArrayBuffer();return t&&t.add(r),{buffer:r}},da.deserialize=function(e){return new da(e.buffer)},Object.defineProperty(da,"name",{value:"Grid"}),fa(da,"Grid"),fa(Ni,"Color"),fa(Error,"Error"),fa(pn,"Formatted"),fa(dn,"FormattedSection"),fa(Yr,"AJAXError"),fa(fn,"ResolvedImage"),fa(aa,"StylePropertyFunction"),fa(ta,"StyleExpression",{omit:["_evaluator"]}),fa(oa,"ZoomDependentExpression"),fa(na,"ZoomConstantExpression"),fa(Pn,"CompoundExpression",{omit:["_evaluate"]});for(const e in Os)pa[Os[e]._classRegistryKey]||fa(Os[e],`Expression${e}`);function ma(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ga(e){return self.ImageBitmap&&e instanceof ImageBitmap}function Aa(e,t){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)return e;if(ma(e)||ga(e))return t&&t.add(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.add(r.buffer),r}if(e instanceof ImageData)return t&&t.add(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const i of e)r.push(Aa(i,t));return r}if(e instanceof Map){const t={$name:"Map"};for(const[r,i]of e.entries())t[r]=Aa(i);return t}if("object"==typeof e){const r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error(`can't serialize object of unregistered class ${i}`);const n=r.serialize?r.serialize(e,t):{};if(!r.serialize){for(const r in e)e.hasOwnProperty(r)&&(pa[i].omit.indexOf(r)>=0||(n[r]=Aa(e[r],t)));e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}throw new Error("can't serialize object of type "+typeof e)}function _a(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||ma(e)||ga(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(_a);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const r of Object.keys(e))"$name"!==r&&t.set(r,_a(e[r]));return t}const{klass:r}=pa[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const i=Object.create(r.prototype);for(const t of Object.keys(e))"$name"!==t&&(i[t]=_a(e[t]));return i}throw new Error("can't deserialize object of type "+typeof e)}const ya={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function xa(e){for(const t of e)if(wa(t.charCodeAt(0)))return!0;return!1}function va(e){for(const t of e)if(!ba(t.charCodeAt(0)))return!1;return!0}function ba(e){return!(ya.Arabic(e)||ya["Arabic Supplement"](e)||ya["Arabic Extended-A"](e)||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e))}function wa(e){return!(746!==e&&747!==e&&(e<4352||!(ya["Bopomofo Extended"](e)||ya.Bopomofo(e)||ya["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ya["CJK Compatibility Ideographs"](e)||ya["CJK Compatibility"](e)||ya["CJK Radicals Supplement"](e)||ya["CJK Strokes"](e)||!(!ya["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs"](e)||ya["Enclosed CJK Letters and Months"](e)||ya["Hangul Compatibility Jamo"](e)||ya["Hangul Jamo Extended-A"](e)||ya["Hangul Jamo Extended-B"](e)||ya["Hangul Jamo"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya["Ideographic Description Characters"](e)||ya.Kanbun(e)||ya["Kangxi Radicals"](e)||ya["Katakana Phonetic Extensions"](e)||ya.Katakana(e)&&12540!==e||!(!ya["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)||!(!ya["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ya["Unified Canadian Aboriginal Syllabics"](e)||ya["Unified Canadian Aboriginal Syllabics Extended"](e)||ya["Vertical Forms"](e)||ya["Yijing Hexagram Symbols"](e)||ya["Yi Syllables"](e)||ya["Yi Radicals"](e))))}function Ca(e){return!(wa(e)||function(e){return!!(ya["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ya["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)||ya["Letterlike Symbols"](e)||ya["Number Forms"](e)||ya["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)||ya["Control Pictures"](e)&&9251!==e||ya["Optical Character Recognition"](e)||ya["Enclosed Alphanumerics"](e)||ya["Geometric Shapes"](e)||ya["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ya["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ya["CJK Symbols and Punctuation"](e)||ya.Katakana(e)||ya["Private Use Area"](e)||ya["CJK Compatibility Forms"](e)||ya["Small Form Variants"](e)||ya["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 Ta(e){return e>=1424&&e<=2303||ya["Arabic Presentation Forms-A"](e)||ya["Arabic Presentation Forms-B"](e)}function Ea(e,t){return!(!t&&Ta(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ya.Khmer(e))}function Ma(e){for(const t of e)if(Ta(t.charCodeAt(0)))return!0;return!1}const Sa="deferred",Ia="loading",Pa="loaded";let Da=null,ka="unavailable",La=null;const Oa=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(ka="error"),Da&&Da(e)};function za(){Ba.fire(new Li("pluginStateChange",{pluginStatus:ka,pluginURL:La}))}const Ba=new zi,Ra=function(){return ka},Fa=function(){if(ka!==Sa||!La)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ka=Ia,za(),La&&Jr({url:La},(e=>{e?Oa(e):(ka=Pa,za())}))},ja={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>ka===Pa||null!=ja.applyArabicShaping,isLoading:()=>ka===Ia,setState(e){ka=e.pluginStatus,La=e.pluginURL},isParsed:()=>null!=ja.applyArabicShaping&&null!=ja.processBidirectionalText&&null!=ja.processStyledBidirectionalText,getPluginURL:()=>La};class Va{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return function(e,t){for(const r of e)if(!Ea(r.charCodeAt(0),t))return!1;return!0}(e,ja.isLoaded())}}class Na{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=function(e,t,r,i){if(Qs(e))return new aa(e,t);if(ra(e)||Array.isArray(e)&&e.length>0){const n=sa(e,t,r,i);if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return n.value}{let r=e;return"string"==typeof e&&"color"===t.type&&(r=Ni.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Ua{constructor(e,t,r){this.property=e,this.value=new Na(e,void 0,t,r)}transitioned(e,t){return new Ga(this.property,this.value,t,Jt({},e.transition,this.transition),e.now)}untransitioned(){return new Ga(this.property,this.value,null,{},0)}}class Ha{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property,this._scope,this._options)),this._values[e].value=new Na(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].value.expression.isConfigDependent}setTransitionOrValue(e,t){t&&(this._options=t);const r=this._properties.properties;if(e)for(const t in e){const i=e[t];if(sr(t,"-transition")){const e=t.slice(0,-11);r[e]&&this.setTransition(e,i)}else r[t]&&this.setValue(t,i)}}getTransition(e){return cr(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ua(this._values[e].property)),this._values[e].transition=cr(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){const r=new Za(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){const e=new Za(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ga{constructor(e,t,r,i,n){const o=i.delay||0,s=i.duration||0;n=n||0,this.property=e,this.value=t,this.begin=n+o,this.end=this.begin+s,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(e,t,r);{const s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),n,Wt(s))}}return n}}class Za{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const i=new qa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Wa{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._scope=t,this._options=r,this.isConfigDependent=!1}getValue(e){return cr(this._values[e].value)}setValue(e,t){this._values[e]=new Na(this._values[e].property,null===t?void 0:cr(t),this._scope,this._options),this.isConfigDependent=this.isConfigDependent||this._values[e].expression.isConfigDependent}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const i=new qa(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}}class Qa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}}class qa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Xa{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,r){const i=Gi[this.specification.type];return i?i(e,t,r):e}}class Ya{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return new Qa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Qa(this,{kind:"constant",value:void 0},e.parameters);const i=Gi[this.specification.type];return i?new Qa(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,i,n,o){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,o)}}class $a{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}}class Ka{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Va(0,{});for(const r in e){const i=e[r];i.specification.overridable&&this.overridableProperties.push(r);const n=this.defaultPropertyValues[r]=new Na(i,void 0),o=this.defaultTransitionablePropertyValues[r]=new Ua(i);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate(t)}}}function Ja(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function el(e){if(Array.isArray(e))return e.map(el);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=el(e[r]);return t}return Ja(e)}fa(Ya,"DataDrivenProperty"),fa(Xa,"DataConstantProperty"),fa($a,"ColorRampProperty");var tl=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"camera":{"type":"camera"},"imports":{"type":"array","value":"import"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"expression":{},"property-type":"data-constant"},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"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":1,"tms":1},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":1}},"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},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"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},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"type":{"required":true,"type":"enum","values":{"raster-array":1}},"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},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{},"hillshade":{},"model":{},"background":{},"sky":{},"slot":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"expression":{},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function rl(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));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(const t of e.slice(1))if(!rl(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function il(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};rl(e)||(e=ul(e));const r=e;let i=!0;try{i=function(e){if(!sl(e))return e;let t=el(e);return ol(t),t=nl(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const n=tl[`filter_${t}`],o=ia(i,n);let s=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(e,t,r)=>o.value.evaluate(e,t,{},r);let a=null,l=null;if(i!==r){const e=ia(r,n);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,r,i,n,o)=>e.value.evaluate(t,r,{},i,void 0,void 0,n,o),l=!jo(e.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:cl(i),needFeature:!!l}}function nl(e){if(!Array.isArray(e))return e;const t=function(e){if(al.has(e[0]))for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>nl(e)))}function ol(e){let t=!1;const r=[];if("case"===e[0]){for(let i=1;i<e.length-1;i+=2)t=t||sl(e[i]),r.push(e[i+1]);r.push(e[e.length-1])}else if("match"===e[0]){t=t||sl(e[1]);for(let t=2;t<e.length-1;t+=2)r.push(e[t+1]);r.push(e[e.length-1])}else if("step"===e[0]){t=t||sl(e[1]);for(let t=1;t<e.length-1;t+=2)r.push(e[t+1])}t&&(e.length=0,e.push("any",...r));for(let t=1;t<e.length;t++)ol(e[t])}function sl(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(sl(e[t]))return!0;return!1}const al=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ll(e,t){return e<t?-1:e>t?1:0}function cl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(cl(e[t]))return!0;return!1}function ul(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?hl(e[1],e[2],"=="):"!="===t?fl(hl(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?hl(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(ul))):"all"===t?["all"].concat(e.slice(1).map(ul)):"none"===t?["all"].concat(e.slice(1).map(ul).map(fl)):"in"===t?dl(e[1],e.slice(2)):"!in"===t?fl(dl(e[1],e.slice(2))):"has"===t?pl(e[1]):"!has"!==t||fl(pl(e[1]));var r}function hl(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function dl(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((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(ll)]]:["filter-in-small",e,["literal",t]]}}function pl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function fl(e){return["!",e]}const ml="";function gl(e,t){return t?`${e}${ml}${t}`:e}const Al="-transition",_l=new Set(["fill","line","background","hillshade","raster"]);class yl extends zi{constructor(e,t,r,i){if(super(),this.id=e.id,this.fqid=gl(this.id,r),this.type=e.type,this.scope=r,this.options=i,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.isConfigDependent=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new Wa(t.layout,this.scope,i),this.isConfigDependent=this.isConfigDependent||this._unevaluatedLayout.isConfigDependent),t.paint)){this._transitionablePaint=new Ha(t.paint,this.scope,i);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.isConfigDependent=this.isConfigDependent||this._transitionablePaint.isConfigDependent,this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new qa(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return _l.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const r=this._unevaluatedLayout;r._properties.properties[e]&&(r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return sr(e,Al)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const r=this._transitionablePaint,i=r._properties.properties;if(sr(e,Al)){const n=e.slice(0,-11);return i[n]&&r.setTransition(n,t||void 0),!1}if(!i[e])return!1;const n=r._values[e],o=n.value.isDataDriven(),s=n.value;r.setValue(e,t),this.isConfigDependent=this.isConfigDependent||r.isConfigDependent,this._handleSpecialPaintPropertyUpdate(e);const a=r._values[e].value,l=a.isDataDriven(),c=sr(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t){return null}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return lr({id:this.id,type:this.type,slot:this.slot,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()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Qa&&Hs(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=il(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,r,i,n,o,s,a,l){}queryIntersectsMatchingFeature(e,t,r,i){}}const xl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class vl{constructor(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}}class bl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function wl(e,t=1){let r=0,i=0;return{members:e.map((e=>{const n=xl[e.type].BYTES_PER_ELEMENT,o=r=Cl(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Cl(r,Math.max(i,t)),alignment:t}}function Cl(e,t){return Math.ceil(e/t)*t}class Tl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}}Tl.prototype.bytesPerElement=4,fa(Tl,"StructArrayLayout2i4");class El extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}}El.prototype.bytesPerElement=6,fa(El,"StructArrayLayout3i6");class Ml extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,e}}Ml.prototype.bytesPerElement=8,fa(Ml,"StructArrayLayout4i8");class Sl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,e}}Sl.prototype.bytesPerElement=10,fa(Sl,"StructArrayLayout5i10");class Il extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.uint8[c+4]=i,this.uint8[c+5]=n,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,e}}Il.prototype.bytesPerElement=12,fa(Il,"StructArrayLayout2i4ub1f12");class Pl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,e}}Pl.prototype.bytesPerElement=16,fa(Pl,"StructArrayLayout4f16");class Dl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}}Dl.prototype.bytesPerElement=8,fa(Dl,"StructArrayLayout2f8");class kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=r,this.uint16[s+2]=i,this.uint16[s+3]=n,this.float32[a+2]=o,e}}kl.prototype.bytesPerElement=12,fa(kl,"StructArrayLayout4ui1f12");class Ll extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=r,this.uint16[o+2]=i,this.uint16[o+3]=n,e}}Ll.prototype.bytesPerElement=8,fa(Ll,"StructArrayLayout4ui8");class Ol extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,this.int16[a+4]=o,this.int16[a+5]=s,e}}Ol.prototype.bytesPerElement=12,fa(Ol,"StructArrayLayout6i12");class zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,r,i,n,o,s,a,l,c,u,h)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=i,this.int16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,e}}zl.prototype.bytesPerElement=24,fa(zl,"StructArrayLayout4i4ui4i24");class Bl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.float32[l+2]=n,this.float32[l+3]=o,this.float32[l+4]=s,e}}Bl.prototype.bytesPerElement=20,fa(Bl,"StructArrayLayout3i3f20");class Rl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Rl.prototype.bytesPerElement=4,fa(Rl,"StructArrayLayout1ul4");class Fl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}}Fl.prototype.bytesPerElement=4,fa(Fl,"StructArrayLayout2ui4");class jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,o,s,a,l,c,u,h,d)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=h,this.uint16[f+18]=d,this.uint16[f+19]=p,e}}jl.prototype.bytesPerElement=40,fa(jl,"StructArrayLayout5i4f1i1ul2ui40");class Vl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=r,this.int16[l+2]=i,this.int16[l+4]=n,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Vl.prototype.bytesPerElement=16,fa(Vl,"StructArrayLayout3i2i2i16");class Nl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[a+6]=n,this.int16[a+7]=o,e}}Nl.prototype.bytesPerElement=16,fa(Nl,"StructArrayLayout2f1f2i16");class Ul extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=12*e,s=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,e}}Ul.prototype.bytesPerElement=12,fa(Ul,"StructArrayLayout2ub2f12");class Hl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}}Hl.prototype.bytesPerElement=6,fa(Hl,"StructArrayLayout3ui6");class Gl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v){const b=30*e,w=15*e,C=60*e;return this.int16[b+0]=t,this.int16[b+1]=r,this.int16[b+2]=i,this.float32[w+2]=n,this.float32[w+3]=o,this.uint16[b+8]=s,this.uint16[b+9]=a,this.uint32[w+5]=l,this.uint32[w+6]=c,this.uint32[w+7]=u,this.uint16[b+16]=h,this.uint16[b+17]=d,this.uint16[b+18]=p,this.float32[w+10]=f,this.float32[w+11]=m,this.uint8[C+48]=g,this.uint8[C+49]=A,this.uint8[C+50]=_,this.uint32[w+13]=y,this.int16[b+28]=x,this.uint8[C+58]=v,e}}Gl.prototype.bytesPerElement=60,fa(Gl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Zl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D){const k=this.length;return this.resize(k+1),this.emplace(k,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E,M,S,I,P,D,k){const L=20*e,O=40*e,z=80*e;return this.float32[L+0]=t,this.float32[L+1]=r,this.int16[O+4]=i,this.int16[O+5]=n,this.int16[O+6]=o,this.int16[O+7]=s,this.int16[O+8]=a,this.int16[O+9]=l,this.int16[O+10]=c,this.int16[O+11]=u,this.int16[O+12]=h,this.uint16[O+13]=d,this.uint16[O+14]=p,this.uint16[O+15]=f,this.uint16[O+16]=m,this.uint16[O+17]=g,this.uint16[O+18]=A,this.uint16[O+19]=_,this.uint16[O+20]=y,this.uint16[O+21]=x,this.uint16[O+22]=v,this.uint16[O+23]=b,this.uint16[O+24]=w,this.uint16[O+25]=C,this.uint16[O+26]=T,this.uint16[O+27]=E,this.uint32[L+14]=M,this.float32[L+15]=S,this.float32[L+16]=I,this.float32[L+17]=P,this.float32[L+18]=D,this.uint8[z+76]=k,e}}Zl.prototype.bytesPerElement=80,fa(Zl,"StructArrayLayout2f9i15ui1ul4f1ub80");class Wl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Wl.prototype.bytesPerElement=4,fa(Wl,"StructArrayLayout1f4");class Ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.float32[s+3]=n,this.float32[s+4]=o,e}}Ql.prototype.bytesPerElement=20,fa(Ql,"StructArrayLayout5f20");class ql extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=r,this.float32[l+2]=i,this.float32[l+3]=n,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}ql.prototype.bytesPerElement=28,fa(ql,"StructArrayLayout7f28");class Xl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=i,this.uint16[o+4]=n,e}}Xl.prototype.bytesPerElement=12,fa(Xl,"StructArrayLayout1ul3ui12");class Yl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Yl.prototype.bytesPerElement=2,fa(Yl,"StructArrayLayout1ui2");class $l extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}$l.prototype.bytesPerElement=12,fa($l,"StructArrayLayout3f12");class Kl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m)}emplace(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g){const A=16*e;return this.float32[A+0]=t,this.float32[A+1]=r,this.float32[A+2]=i,this.float32[A+3]=n,this.float32[A+4]=o,this.float32[A+5]=s,this.float32[A+6]=a,this.float32[A+7]=l,this.float32[A+8]=c,this.float32[A+9]=u,this.float32[A+10]=h,this.float32[A+11]=d,this.float32[A+12]=p,this.float32[A+13]=f,this.float32[A+14]=m,this.float32[A+15]=g,e}}Kl.prototype.bytesPerElement=64,fa(Kl,"StructArrayLayout16f64");class Jl extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o,s)}emplace(e,t,r,i,n,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=r,this.uint16[l+2]=i,this.uint16[l+3]=n,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}Jl.prototype.bytesPerElement=20,fa(Jl,"StructArrayLayout4ui3f20");class ec extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}ec.prototype.bytesPerElement=2,fa(ec,"StructArrayLayout1i2");class tc extends bl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}tc.prototype.bytesPerElement=1,fa(tc,"StructArrayLayout1ub1");class rc extends vl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}rc.prototype.size=40;class ic extends jl{get(e){return new rc(this,e)}}fa(ic,"CollisionBoxArray");class nc extends vl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}nc.prototype.size=60;class oc extends Gl{get(e){return new nc(this,e)}}fa(oc,"PlacedSymbolArray");class sc extends vl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}sc.prototype.size=80;class ac extends Zl{get(e){return new sc(this,e)}}fa(ac,"SymbolInstanceArray");class lc extends Wl{getoffsetX(e){return this.float32[1*e+0]}}fa(lc,"GlyphOffsetArray");class cc extends Tl{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}fa(cc,"SymbolLineVertexArray");class uc extends vl{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}uc.prototype.size=12;class hc extends Xl{get(e){return new uc(this,e)}}fa(hc,"FeatureIndexArray");class dc extends Fl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}fa(dc,"FillExtrusionCentroidArray");const pc=wl([{name:"a_pos",components:2,type:"Int16"}],4),fc=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class mc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,r,i){let n=this.segments[this.segments.length-1];return e>mc.MAX_VERTEX_ARRAY_LENGTH&&hr(`Max vertices per segment is ${mc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!n||n.vertexLength+e>mc.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:t,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n}prepareSegment(e,t,r,i){return this._prepareSegment(e,t.length,r.length,i)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,i){return new mc([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}}function gc(e,t){return 256*(e=Xt(Math.floor(e),0,255))+Xt(Math.floor(t),0,255)}mc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa(mc,"SegmentVector");const Ac=wl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),_c=wl([{name:"a_dash",components:4,type:"Uint16"}]);class yc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(xc(e)),this.positions.push(t,r,i)}eachPosition(e,t){const r=xc(e);let i=0,n=this.ids.length-1;for(;i<n;){const e=i+n>>1;this.ids[e]>=r?n=e:i=e+1}for(;this.ids[i]===r;)t(this.positions[3*i],this.positions[3*i+1],this.positions[3*i+2]),i++}static serialize(e,t){const r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return vc(r,i,0,r.length-1),t&&(t.add(r.buffer),t.add(i.buffer)),{ids:r,positions:i}}static deserialize(e){const t=new yc;let r;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==r&&t.uniqueIds.push(e),r=e;return t.indexed=!0,t}}function xc(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Pi(String(e))}function vc(e,t,r,i){for(;r<i;){const n=e[r+i>>1];let o=r-1,s=i+1;for(;;){do{o++}while(e[o]<n);do{s--}while(e[s]>n);if(o>=s)break;bc(e,o,s),bc(t,3*o,3*s),bc(t,3*o+1,3*s+1),bc(t,3*o+2,3*s+2)}s-r<i-s?(vc(e,t,r,s),r=s+1):(vc(e,t,s+1,i),i=s)}}function bc(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}fa(yc,"FeaturePositionMap");class wc{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}set(e,t,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Cc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}}class Tc extends wc{constructor(e){super(e),this.current=0}set(e,t,r){this.fetchUniformLocation(e,t)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))}}class Ec extends wc{constructor(e){super(e),this.current=[0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])))}}class Mc extends wc{constructor(e){super(e),this.current=[0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])))}}class Sc extends wc{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,r){this.fetchUniformLocation(e,t)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])))}}class Ic extends wc{constructor(e){super(e),this.current=Ni.transparent}set(e,t,r){this.fetchUniformLocation(e,t)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)))}}const Pc=new Float32Array(16);class Dc extends wc{constructor(e){super(e),this.current=Pc}set(e,t,r){if(this.fetchUniformLocation(e,t)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let e=1;e<16;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const kc=new Float32Array(9),Lc=new Float32Array(4);class Oc extends wc{constructor(e){super(e),this.current=Lc}set(e,t,r){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(r[e]!==this.current[e]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function zc(e){return[gc(255*e.r,255*e.g),gc(255*e.b,255*e.a)]}class Bc{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r,i,n){t.set(e,n,i.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new Ic(e):new Tc(e)}}class Rc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,r,i,n){const o="u_pattern"===n||"u_dash"===n?this.pattern:"u_pixel_ratio"===n?this.pixelRatio:null;o&&t.set(e,n,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Sc(e):new Tc(e)}}class Fc{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r,i,n,o,s){const a=this.paintVertexArray.length,l=this.expression.evaluate(new Va(0,{brightness:o}),t,{},n,i,s);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l)}updatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate({zoom:0,brightness:s},r,i,void 0,n);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){const i=zc(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class jc{constructor(e,t,r,i,n,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate(new Va(this.zoom,{brightness:o}),t,{},n,i,s),l=this.expression.evaluate(new Va(this.zoom+1,{brightness:o}),t,{},n,i,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l)}updatePaintArray(e,t,r,i,n,o,s){const a=this.expression.evaluate({zoom:this.zoom,brightness:s},r,i,void 0,n),l=this.expression.evaluate({zoom:this.zoom+1,brightness:s},r,i,void 0,n);this._setPaintValue(e,t,a,l)}_setPaintValue(e,t,r,i){if("color"===this.type){const n=zc(r),o=zc(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],o[0],o[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,r,i,n){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,s=Xt(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,n,s)}getBinding(e,t){return new Tc(e)}}class Vc{constructor(e,t,r,i,n){this.expression=e,this.layerId=n,this.paintVertexAttributes=("array"===r?_c:Ac).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new i}populatePaintArray(e,t,r){const i=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,i,n,o,s){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],o)}_setPaintValues(e,t,r,i){if(!i||!r)return;const n=i[r];if(!n)return;const{tl:o,br:s,pixelRatio:a}=n;for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,o[0],o[1],s[0],s[1],a)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Nc{constructor(e,t,r=(()=>!0)){this.binders={},this._buffers=[];const i=[];for(const n in e.paint._values){const o=e.paint.get(n);if(!r(n))continue;if(!(o instanceof Qa&&Hs(o.property.specification)))continue;const s=Gc(n,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===n||n.endsWith("pattern"),h="line-dasharray"===n&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==a.kind||h)if("source"===a.kind||h||u){const t=Qc(n,l,"source");this.binders[n]=u?new Vc(a,s,l,t,e.id):new Fc(a,s,l,t),i.push(`/a_${n}`)}else{const e=Qc(n,l,"composite");this.binders[n]=new jc(a,s,l,c,t,e),i.push(`/z_${n}`)}else this.binders[n]=u?new Rc(a.value,s):new Bc(a.value,s,l),i.push(`/u_${n}`)}this.cacheKey=i.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Fc||t instanceof jc?t.maxValue:0}populatePaintArrays(e,t,r,i,n,o,s){for(const a in this.binders){const l=this.binders[a];(l instanceof Fc||l instanceof jc||l instanceof Vc)&&l.populatePaintArray(e,t,r,i,n,o,s)}}setConstantPatternPositions(e){for(const t in this.binders){const r=this.binders[t];r instanceof Rc&&r.setConstantPatternPositions(e)}}updatePaintArrays(e,t,r,i,n,o,s,a){let l=!1;const c=Object.keys(e),u=0!==c.length,h=u?c:t.uniqueIds;for(const c in this.binders){const d=this.binders[c];if((d instanceof Fc||d instanceof jc||d instanceof Vc)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=n.paint.get(c);d.expression=p.value;for(const r of h){const n=e[r.toString()];t.eachPosition(r,((e,t,r)=>{const l=i.feature(e);d.updatePaintArray(t,r,l,n,o,s,a)}))}if(!u)for(const t of r.uniqueIds){const n=e[t.toString()];r.eachPosition(t,((e,t,r)=>{const l=i.feature(e);d.updatePaintArray(t,r,l,n,o,s,a)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Bc||r instanceof Rc)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Fc||r instanceof jc||r instanceof Vc)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Bc||r instanceof Rc||r instanceof jc)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const r in this.binders){const i=this.binders[r];if(i instanceof Bc||i instanceof Rc||i instanceof jc)for(const n of i.uniformNames)t.push({name:n,property:r,binding:i.getBinding(e,n)})}return t}setUniforms(e,t,r,i,n){for(const{name:t,property:o,binding:s}of r)this.binders[o].setUniform(e,s,n,i.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Vc)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof Fc||r instanceof jc||r instanceof Vc)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Fc||t instanceof jc||t instanceof Vc)&&t.destroy()}}}class Uc{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const i of e)this.programConfigurations[i.id]=new Nc(i,t,r);this.needsUpload=!1,this._featureMap=new yc,this._featureMapWithoutIds=new yc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,r,i,n,o,s,a){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i,n,o,s,a);void 0!==t.id?this._featureMap.add(t.id,r,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i,n,o){for(const s of r)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,s,i,n,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Hc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Gc(e,t){return Hc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Zc={"line-pattern":{source:kl,composite:kl},"fill-pattern":{source:kl,composite:kl},"fill-extrusion-pattern":{source:kl,composite:kl},"line-dasharray":{source:Ll,composite:Ll}},Wc={color:{source:Dl,composite:Pl},number:{source:Wl,composite:Dl}};function Qc(e,t,r){const i=Zc[e];return i&&i[r]||Wc[t][r]}fa(Bc,"ConstantBinder"),fa(Rc,"PatternConstantBinder"),fa(Fc,"SourceExpressionBinder"),fa(Vc,"PatternCompositeBinder"),fa(jc,"CompositeExpressionBinder"),fa(Nc,"ProgramConfiguration",{omit:["_buffers"]}),fa(Uc,"ProgramConfigurationSet");const qc=no/Math.PI/2,Xc=5,Yc=6,$c=16383,Kc=64,Jc=[Kc,32,16],eu=-qc,tu=qc;function ru(e,t,r,i=qc){return r=Ht(r),[e*Math.sin(r)*i,-t*i,e*Math.cos(r)*i]}function iu(e,t,r){return ru(Math.cos(Ht(e)),Math.sin(Ht(e)),t,r)}const nu=6371008.8,ou=2*Math.PI*nu;class su{constructor(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")}wrap(){return new su($t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return nu*Math.acos(Math.min(n,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new au({lng:this.lng-r,lat:this.lat-t},{lng:this.lng+r,lat:this.lat+t})}toEcef(e){return iu(this.lat,this.lng,qc+e*qc/nu)}static convert(e){if(e instanceof su)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new su(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new su(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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class au{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}setSouthWest(e){return this._sw=e instanceof su?new su(e.lng,e.lat):su.convert(e),this}extend(e){const t=this._sw,r=this._ne;let i,n;if(e instanceof su)i=e,n=e;else{if(!(e instanceof au))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(au.convert(e)):this.extend(su.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(su.convert(e)):this;if(i=e._sw,n=e._ne,!i||!n)return this}return t||r?(t.lng=Math.min(i.lng,t.lng),t.lat=Math.min(i.lat,t.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)):(this._sw=new su(i.lng,i.lat),this._ne=new su(n.lng,n.lat)),this}getCenter(){return new su((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new su(this.getWest(),this.getNorth())}getSouthEast(){return new su(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:r}=su.convert(e);let i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}static convert(e){return!e||e instanceof au?e:new au(e)}}var lu={};!function(e,t){!function(e){function t(e,t,i){var n=r(256*e,256*(t=Math.pow(2,i)-t-1),i),o=r(256*(e+1),256*(t+1),i);return n[0]+","+n[1]+","+o[0]+","+o[1]}function r(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}e.getURL=function(e,r,i,n,o,s){return s=s||{},e+"?"+["bbox="+t(i,n,o),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+r].join("&")},e.getTileBBox=t,e.getMercCoords=r,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,lu);var cu=lu;class uu{constructor(e,t,r){this.z=e,this.x=t,this.y=r,this.key=pu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const r=cu.getTileBBox(this.x,this.y,this.z),i=function(e,t,r){let i,n="";for(let o=e;o>0;o--)i=1<<o-1,n+=(t&i?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",i).replace("{bbox-epsg-3857}",r)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=pu(e,t.z,t.z,t.x,t.y)}}class du{constructor(e,t,r,i,n){this.overscaledZ=e,this.wrap=t,this.canonical=new uu(r,+i,+n),this.key=0===t&&e===r?this.canonical.key:pu(t,e,r,i,n)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new du(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new du(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return pu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-e;return pu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.z<this.canonical.z&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new du(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new du(t,this.wrap,t,r,i),new du(t,this.wrap,t,r+1,i),new du(t,this.wrap,t,r,i+1),new du(t,this.wrap,t,r+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new du(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new du(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function pu(e,t,r,i,n){const o=1<<Math.min(r,22);let s=o*(n%o)+i%o;return e&&r<22&&(s+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-r)))),16*(32*s+r)+(t-r)}const fu=[e=>{let t=e.canonical.x-1,r=e.wrap;return t<0&&(t=(1<<e.canonical.z)-1,r--),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>{let t=e.canonical.x+1,r=e.wrap;return t===1<<e.canonical.z&&(t=0,r++),new du(e.overscaledZ,r,e.canonical.z,t,e.canonical.y)},e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new du(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)];fa(uu,"CanonicalTileID"),fa(du,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const mu=0,gu=25.5;function Au(e){return ou*Math.cos(e*Math.PI/180)}function _u(e){return(180+e)/360}function yu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function xu(e,t){return e/Au(t)}function vu(e){return 360*e-180}function bu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function wu(e,t){return e*Au(bu(t))}const Cu=85.051129;function Tu(e){return Math.cos(Ht(Xt(e,-Cu,Cu)))}function Eu(e,t){const r=Xt(t,mu,gu),i=Math.pow(2,r);return Tu(e)*ou/(512*i)}function Mu(e){return 1/Math.cos(e*Math.PI/180)}function Su(e,t=0){const r=Math.exp(Math.PI*(1-(e.y+t/no)/(1<<e.z)*2));return 80150034*r/(r*r+1)/no/(1<<e.z)}class Iu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=su.convert(e);return new Iu(_u(r.lng),yu(r.lat),xu(t,r.lat))}toLngLat(){return new su(vu(this.x),bu(this.y))}toAltitude(){return wu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ou*Mu(bu(this.y))}}function Pu(e,t,r,i,n,o,s,a,l){const c=(t+i)/2,u=(r+n)/2,h=new Vt(c,u);a(h),function(e,t,r,i,n,o){const s=r-n,a=i-o;return Math.abs((i-t)*s-(r-e)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?(Pu(e,t,r,c,u,o,h,a,l),Pu(e,c,u,i,n,h,s,a,l)):e.push(s)}function Du(e,t,r){let i=e[0],n=i.x,o=i.y;t(i);const s=[i];for(let a=1;a<e.length;a++){const l=e[a],{x:c,y:u}=l;t(l),Pu(s,n,o,c,u,i,l,t,r),n=c,o=u,i=l}return s}function ku(e,t,r,i){if(i(t,r)){const n=t.add(r)._mult(.5);ku(e,t,n,i),ku(e,n,r,i)}else e.push(r)}function Lu(e,t){let r=e[0];const i=[r];for(let n=1;n<e.length;n++){const o=e[n];ku(i,r,o,t),r=o}return i}const Ou=Math.pow(2,14)-1,zu=-Ou-1;function Bu(e,t){const r=Math.round(e.x*t),i=Math.round(e.y*t);return e.x=Xt(r,zu,Ou),e.y=Xt(i,zu,Ou),(r<e.x||r>e.x+1||i<e.y||i>e.y+1)&&hr("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Ru(e,t,r){const i=e.loadGeometry(),n=e.extent,o=no/n;if(t&&r&&r.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:s,x:a,y:l,projection:c}=r,u=e=>{const r=vu((t.x+e.x/n)/o),i=bu((t.y+e.y/n)/o),u=c.project(r,i);e.x=(u.x*s-a)*n,e.y=(u.y*s-l)*n};for(let t=0;t<i.length;t++)if(1!==e.type)i[t]=Du(i[t],u,1);else{const e=[];for(const r of i[t])r.x<0||r.x>=n||r.y<0||r.y>=n||(u(r),e.push(r));i[t]=e}}for(const e of i)for(const t of e)Bu(t,o);return i}function Fu(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ru(e):[]}}function ju(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}function Vu(e,t,r){const i=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*i,r[1]*i,r[2]*i)}class Nu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Tl,this.indexArray=new Hl,this.segments=new mc,this.programConfigurations=new Uc(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,i){const n=this.layers[0],o=[];let s=null;"circle"===n.type&&(s=n.layout.get("circle-sort-key"));for(const{feature:t,id:n,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),c,r))continue;const u=s?s.evaluate(c,{},r):void 0,h={id:n,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,i),patterns:{},sortKey:u};o.push(h)}s&&o.sort(((e,t)=>e.sortKey-t.sortKey));let a=null;"globe"===i.projection.name&&(this.globeExtVertexArray=new Ol,a=i.projection);for(const i of o){const{geometry:n,index:o,sourceLayerIndex:s}=i,l=e[o].feature;this.addFeature(i,n,o,t.availableImages,r,a,t.brightness),t.featureIndex.insert(l,n,o,s,this.index)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,fc.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,r,i,n,o,s){for(const r of t)for(const t of r){const r=t.x,i=t.y;if(r<0||r>=no||i<0||i>=no)continue;if(o){const e=o.projectTilePoint(r,i,n),t=o.upVector(n,r,i),s=this.globeExtVertexArray;Vu(s,e,t),Vu(s,e,t),Vu(s,e,t),Vu(s,e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;ju(this.layoutVertexArray,r,i,-1,-1),ju(this.layoutVertexArray,r,i,1,-1),ju(this.layoutVertexArray,r,i,1,1),ju(this.layoutVertexArray,r,i,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i,n,s)}}function Uu(e,t){for(let r=0;r<e.length;r++)if($u(t,e[r]))return!0;for(let r=0;r<t.length;r++)if($u(e,t[r]))return!0;return!!Wu(e,t)}function Hu(e,t,r){return!!$u(e,t)||!!qu(t,e,r)}function Gu(e,t){if(1===e.length)return Yu(t,e[0]);for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<i.length;t++)if($u(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(Yu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Wu(e,t[r]))return!0;return!1}function Zu(e,t,r){if(e.length>1){if(Wu(e,t))return!0;for(let i=0;i<t.length;i++)if(qu(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(qu(e[i],t,r))return!0;return!1}function Wu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++)if(Qu(i,n,t[e],t[e+1]))return!0}return!1}function Qu(e,t,r,i){return dr(e,r,i)!==dr(t,r,i)&&dr(e,t,r)!==dr(e,t,i)}function qu(e,t,r){const i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++)if(Xu(e,t[r-1],t[r])<i)return!0;return!1}function Xu(e,t,r){const i=t.distSqr(r);if(0===i)return e.distSqr(t);const n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return e.distSqr(n<0?t:n>1?r:r.sub(t)._mult(n)._add(t))}function Yu(e,t){let r,i,n,o=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)i=r[e],n=r[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(o=!o)}return o}function $u(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){const o=e[i],s=e[n];o.y>t.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(r=!r)}return r}function Ku(e,t,r,i,n){for(const o of e)if(t<=o.x&&r<=o.y&&i>=o.x&&n>=o.y)return!0;const o=[new Vt(t,r),new Vt(t,n),new Vt(i,n),new Vt(i,r)];if(e.length>2)for(const t of o)if($u(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Ju(e[t],e[t+1],o))return!0;return!1}function Ju(e,t,r){const i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;const o=dr(e,t,r[0]);return o!==dr(e,t,r[1])||o!==dr(e,t,r[2])||o!==dr(e,t,r[3])}function eh(e,t,r,i,n,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((r.x-e.x)*s+(r.y-e.y)*a-o<0||(i.x-e.x)*s+(i.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0)}function th(e,t,r,i,n,o,s){return!(eh(e,t,i,n,o,s)||eh(t,r,i,n,o,s)||eh(r,e,i,n,o,s)||eh(i,n,e,t,r,s)||eh(n,o,e,t,r,s)||eh(o,i,e,t,r,s))}function rh(e,t,r){const i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function ih(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function nh(e,t,r,i,n){if(!t[0]&&!t[1])return e;const o=Vt.convert(t)._mult(n);"viewport"===r&&o._rotate(-i);const s=[];for(let t=0;t<e.length;t++)s.push(e[t].sub(o));return s}function oh(e,t,r,i){const n=Vt.convert(e)._mult(i);return"viewport"===t&&n._rotate(-r),n}fa(Nu,"CircleBucket",{omit:["layers"]});const sh=new Ka({"circle-sort-key":new Ya(tl.layout_circle["circle-sort-key"]),visibility:new Xa(tl.layout_circle.visibility)});var ah={paint:new Ka({"circle-radius":new Ya(tl.paint_circle["circle-radius"]),"circle-color":new Ya(tl.paint_circle["circle-color"]),"circle-blur":new Ya(tl.paint_circle["circle-blur"]),"circle-opacity":new Ya(tl.paint_circle["circle-opacity"]),"circle-translate":new Xa(tl.paint_circle["circle-translate"]),"circle-translate-anchor":new Xa(tl.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xa(tl.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xa(tl.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ya(tl.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ya(tl.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ya(tl.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Xa(tl.paint_circle["circle-emissive-strength"])}),layout:sh};class lh{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(t,r,i){const n=e.Q.dot(r,this.dir);if(Math.abs(n)<1e-6)return!1;const o=((t[0]-this.pos[0])*r[0]+(t[1]-this.pos[1])*r[1]+(t[2]-this.pos[2])*r[2])/n;return i[0]=this.pos[0]+this.dir[0]*o,i[1]=this.pos[1]+this.dir[1]*o,i[2]=this.pos[2]+this.dir[2]*o,!0}closestPointOnSphere(t,r,i){if(e.Q.equals(this.pos,t)||0===r)return i[0]=i[1]=i[2]=0,!1;const[n,o,s]=this.dir,a=this.pos[0]-t[0],l=this.pos[1]-t[1],c=this.pos[2]-t[2],u=n*n+o*o+s*s,h=2*(a*n+l*o+c*s),d=h*h-4*u*(a*a+l*l+c*c-r*r);if(d<0){const e=Math.max(-h/2,0),t=a+n*e,u=l+o*e,d=c+s*e,p=Math.hypot(t,u,d);return i[0]=t*r/p,i[1]=u*r/p,i[2]=d*r/p,!1}{const e=(-h-Math.sqrt(d))/(2*u);if(e<0){const e=Math.hypot(a,l,c);return i[0]=a*r/e,i[1]=l*r/e,i[2]=c*r/e,!1}return i[0]=a+n*e,i[1]=l+o*e,i[2]=c+s*e,!0}}}class ch{constructor(e,t,r,i,n){this.TL=e,this.TR=t,this.BR=r,this.BL=i,this.horizon=n}static fromInvProjectionMatrix(t,r,i){const n=[-1,1,1],o=[1,1,1],s=[1,-1,1],a=[-1,-1,1],l=e.Q.transformMat4(n,n,t),c=e.Q.transformMat4(o,o,t),u=e.Q.transformMat4(s,s,t),h=e.Q.transformMat4(a,a,t);return new ch(l,c,u,h,r/i)}}function uh(t,r,i){let n=1/0,o=-1/0;const s=[];for(const a of t){e.Q.sub(s,a,r);const t=e.Q.dot(s,i);n=Math.min(n,t),o=Math.max(o,t)}return[n,o]}function hh(t,r){let i=!0;for(let n=0;n<t.planes.length;n++){const o=t.planes[n];let s=0;for(let t=0;t<r.length;t++)s+=e.Q.dot(o,r[t])+o[3]>=0;if(0===s)return 0;s!==r.length&&(i=!1)}return i?2:1}function dh(e,t){for(const r of e.projections){const i=uh(t,e.points[0],r.axis);if(r.projection[1]<i[0]||r.projection[0]>i[1])return 0}return 1}function ph(t,r){let i=0;const n=[0,0,0,0];for(let o=0;o<t.length;o++)n[0]=t[o][0],n[1]=t[o][1],n[2]=t[o][2],n[3]=1,e.aa.dot(n,r)>=0&&i++;return i}class fh{constructor(t,r){this.points=t||new Array(8).fill([0,0,0]),this.planes=r||new Array(6).fill([0,0,0,0]),this.bounds=mh.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.Q.sub([],this.points[2],this.points[3]),e.Q.sub([],this.points[0],this.points[3]),e.Q.sub([],this.points[4],this.points[0]),e.Q.sub([],this.points[5],this.points[1]),e.Q.sub([],this.points[6],this.points[2]),e.Q.sub([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],r=[e[2],0,-e[0]];this.projections.push({axis:t,projection:uh(this.points,this.points[0],t)}),this.projections.push({axis:r,projection:uh(this.points,this.points[0],r)})}}static fromInvProjectionMatrix(t,r,i,n){const o=Math.pow(2,i),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((i=>{const s=e.aa.transformMat4([],i,t),a=1/s[3]/r*o;return e.aa.mul(s,s,[a,a,n?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const r=e.Q.sub([],s[t[0]],s[t[1]]),i=e.Q.sub([],s[t[2]],s[t[1]]),n=e.Q.normalize([],e.Q.cross([],r,i)),o=-e.Q.dot(n,s[t[1]]);return n.concat(o)})),l=[];for(let e=0;e<s.length;e++)l.push([s[e][0],s[e][1],s[e][2]]);return new fh(l,a)}intersectsPrecise(t,r,i){for(let e=0;e<r.length;e++)if(!ph(t,r[e]))return 0;for(let e=0;e<this.planes.length;e++)if(!ph(t,this.planes[e]))return 0;for(const r of i)for(const i of this.frustumEdges){const n=e.Q.cross([],r,i),o=e.Q.length(n);if(0===o)continue;e.Q.scale(n,n,1/o);const s=uh(this.points,this.points[0],n),a=uh(t,this.points[0],n);if(s[0]>a[1]||a[0]>s[1])return 0}return 1}}class mh{static fromPoints(t){const r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of t)e.Q.min(r,r,n),e.Q.max(i,i,n);return new mh(r,i)}static fromTileIdAndHeight(e,t,r){const i=1<<e.canonical.z,n=e.canonical.x,o=e.canonical.y;return new mh([n/i,o/i,t],[(n+1)/i,(o+1)/i,r])}static applyTransform(t,r){const i=t.getCorners();for(let t=0;t<i.length;++t)e.Q.transformMat4(i[t],i[t],r);return mh.fromPoints(i)}static projectAabbCorners(t,r){const i=t.getCorners();for(let t=0;t<i.length;++t)e.Q.transformMat4(i[t],i[t],r);return i}constructor(t,r){this.min=t,this.max=r,this.center=e.Q.scale([],e.Q.add([],this.min,this.max),.5)}quadrant(t){const r=[t%2==0,t<2],i=e.Q.clone(this.min),n=e.Q.clone(this.max);for(let e=0;e<r.length;e++)i[e]=r[e]?this.min[e]:this.center[e],n[e]=r[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new mh(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){return this.intersectsAabb(e.bounds)?hh(e,this.getCorners()):0}intersectsFlat(e){return this.intersectsAabb(e.bounds)?hh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(e,t){return t||this.intersects(e)?dh(e,this.getCorners()):0}intersectsPreciseFlat(e,t){return t||this.intersectsFlat(e)?dh(e,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(e){for(let t=0;t<3;++t)if(this.min[t]>e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}fa(mh,"Aabb");const gh=wl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ah}=gh,_h=wl([{name:"a_pos_3",components:3,type:"Int16"}]);var yh=wl([{name:"a_pos",type:"Int16",components:2}]);function xh(e){return e*qc/nu}const vh=[new mh([eu,eu,eu],[tu,tu,tu]),new mh([eu,eu,eu],[0,0,tu]),new mh([0,eu,eu],[tu,0,tu]),new mh([eu,0,eu],[0,tu,tu]),new mh([0,0,eu],[tu,tu,tu])];function bh(t,r,i,n=!0){const o=e.Q.scale([],t._camera.position,t.worldSize),s=[r,i,1,1];e.aa.transformMat4(s,s,t.pixelMatrixInverse),e.aa.scale(s,s,1/s[3]);const a=e.Q.sub([],s,o),l=e.Q.normalize([],a),c=t.globeMatrix,u=[c[12],c[13],c[14]],h=e.Q.sub([],u,o),d=e.Q.length(h),p=e.Q.normalize([],h),f=t.worldSize/(2*Math.PI),m=e.Q.dot(p,l),g=Math.asin(f/d);if(g<Math.acos(m)){if(!n)return null;const t=[],r=[];e.Q.scale(t,l,d/m),e.Q.normalize(r,e.Q.sub(r,t,h)),e.Q.normalize(l,e.Q.add(l,h,e.Q.scale(l,r,Math.tan(g)*d)))}const A=[];new lh(o,l).closestPointOnSphere(u,f,A);const _=e.Q.normalize([],Tr(c,0)),y=e.Q.normalize([],Tr(c,1)),x=e.Q.normalize([],Tr(c,2)),v=e.Q.dot(_,A),b=e.Q.dot(y,A),w=e.Q.dot(x,A),C=Gt(Math.asin(-b/f));let T=Gt(Math.atan2(v,w));T=t.center.lng+function(e,t){const r=(t-e+180)%360-180;return r<-180?r+360:r}(t.center.lng,T);const E=_u(T),M=Xt(yu(C),0,1);return new Iu(E,M)}class wh{constructor(t,r,i){this.a=e.Q.sub([],t,i),this.b=e.Q.sub([],r,i),this.center=i;const n=e.Q.normalize([],this.a),o=e.Q.normalize([],this.b);this.angle=Math.acos(e.Q.dot(n,o))}}function Ch(e,t){if(0===e.angle)return null;let r;return r=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),r<0||r>1?null:function(e,t,r,i){const n=Math.sin(r);return e*(Math.sin((1-i)*r)/n)+t*(Math.sin(i*r)/n)}(e.a[t],e.b[t],e.angle,Xt(r,0,1))+e.center[t]}function Th(e){if(e.z<=1)return vh[e.z+2*e.y+e.x];const t=Ph(Ih(e));return mh.fromPoints(t)}function Eh(t,r,i){return e.Q.scale(t,t,1-i),e.Q.scaleAndAdd(t,t,r,i)}function Mh(t,r,i){for(const n of t)e.Q.transformMat4(n,n,r),e.Q.scale(n,n,i)}function Sh(t,r,i,n){const o=r/t.worldSize,s=t.globeMatrix;if(i.z<=1){const e=Th(i).getCorners();return Mh(e,s,o),mh.fromPoints(e)}const a=Ih(i,n),l=Ph(a,qc+xh(t._tileCoverLift));Mh(l,s,o);const c=Number.MAX_VALUE,u=[-c,-c,-c],h=[c,c,c];if(a.contains(t.center)){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);u[2]=0;const r=t.point,i=[r.x*o,r.y*o,0];return e.Q.min(h,h,i),e.Q.max(u,u,i),new mh(h,u)}if(t._tileCoverLift>0){for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return new mh(h,u)}const d=[s[12]*o,s[13]*o,s[14]*o],p=a.getCenter(),f=Xt(t.center.lat,-Cu,Cu),m=Xt(p.lat,-Cu,Cu),g=_u(t.center.lng),A=yu(f);let _=g-_u(p.lng);const y=A-yu(m);_>.5?_-=1:_<-.5&&(_+=1);let x=0;if(Math.abs(_)>Math.abs(y))x=_>=0?1:3;else{x=y>=0?0:2;const t=[s[4]*o,s[5]*o,s[6]*o],r=-Math.sin(Ht(y>=0?a.getSouth():a.getNorth()))*qc;e.Q.scaleAndAdd(d,d,t,r)}const v=l[x],b=l[(x+1)%4],w=new wh(v,b,d),C=[Ch(w,0)||v[0],Ch(w,1)||v[1],Ch(w,2)||v[2]],T=jh(t.zoom);if(T>0){const n=function({x:e,y:t,z:r},i,n,o,s){const a=1/(1<<r);let l=e*a,c=l+a,u=t*a,h=u+a,d=0;const p=(l+c)/2-o;return p>.5?d=-1:p<-.5&&(d=1),l=((l+d)*i-(o*=i))*n+o,c=((c+d)*i-o)*n+o,u=(u*i-(s*=i))*n+s,h=(h*i-s)*n+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(i,r,t._pixelsPerMercatorPixel,g,A);for(let e=0;e<l.length;e++)Eh(l[e],n[e],T);const o=e.Q.add([],n[x],n[(x+1)%4]);e.Q.scale(o,o,.5),Eh(C,o,T)}for(const t of l)e.Q.min(h,h,t),e.Q.max(u,u,t);return h[2]=Math.min(v[2],b[2]),e.Q.min(h,h,C),e.Q.max(u,u,C),new mh(h,u)}function Ih({x:e,y:t,z:r},i=!1){const n=1/(1<<r),o=new su(vu(e*n),t===(1<<r)-1&&i?-90:bu((t+1)*n)),s=new su(vu((e+1)*n),0===t&&i?90:bu(t*n));return new au(o,s)}function Ph(e,t=qc){const r=Ht(e.getNorth()),i=Ht(e.getSouth()),n=Math.cos(r),o=Math.cos(i),s=Math.sin(r),a=Math.sin(i),l=e.getWest(),c=e.getEast();return[ru(o,a,l,t),ru(o,a,c,t),ru(n,s,c,t),ru(n,s,l,t)]}function Dh(e,t,r,i){const n=1<<r.z,o=(e/no+r.x)/n;return iu(bu((t/no+r.y)/n),vu(o),i)}function kh({min:e,max:t}){return $c/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Lh=new Float64Array(16);function Oh(t){const r=kh(t),i=e.a9.fromScaling(Lh,[r,r,r]);return e.a9.translate(i,i,e.Q.negate([],t.min))}function zh(t){const r=e.a9.fromTranslation(Lh,t.min),i=1/kh(t);return e.a9.scale(r,r,[i,i,i])}function Bh(e){const t=no/(2*Math.PI);return e/(2*Math.PI)/t}function Rh(e,t){return no/(512*Math.pow(2,e))*kh(Th(t))}function Fh(t,r,i,n,o){const s=Bh(i),a=[t,r,-i/(2*Math.PI)],l=e.a9.identity(new Float64Array(16));return e.a9.translate(l,l,a),e.a9.scale(l,l,[s,s,s]),e.a9.rotateX(l,l,Ht(-o)),e.a9.rotateY(l,l,Ht(-n)),l}function jh(e){return Yt(Xc,Yc,e)}function Vh(t,r){const i=iu(r.lat,r.lng),n=function(t){const r=iu(t._center.lat,t._center.lng),i=e.Q.fromValues(0,1,0);let n=e.Q.cross([],i,r);const o=e.a9.fromRotation([],-t.angle,r);n=e.Q.transformMat4(n,n,o),e.a9.fromRotation(o,-t._pitch,n);const s=e.Q.normalize([],r);return e.Q.scale(s,s,xh(t.cameraToCenterDistance/t.pixelsPerMeter)),e.Q.transformMat4(s,s,o),e.Q.add([],r,s)}(t),o=e.Q.subtract([],n,i);return e.Q.angle(o,i)}function Nh(e,t){return Vh(e,t)>Math.PI/2*1.01}const Uh=Ht(85),Hh=Math.cos(Uh),Gh=Math.sin(Uh),Zh=e.a9.create(),Wh=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function Qh(t,r,i,n,o,s,a,l,c){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(c*=t.pixelToTileUnitsFactor);const u=t.tileID.canonical,h=i.projection.upVectorScale(u,i.center.lat,i.worldSize).metersToTile;for(const d of r)for(const r of d){const d=r.add(l),p=o&&i.elevation?i.elevation.exaggeration()*o.getElevationAt(d.x,d.y,!0):0,f=i.projection.projectTilePoint(d.x,d.y,u);if(p>0){const e=i.projection.upVector(u,d.x,d.y);f.x+=e[0]*h*p,f.y+=e[1]*h*p,f.z+=e[2]*h*p}const m=s?d:qh(f.x,f.y,f.z,n),g=s?t.tilespaceRays.map((e=>$h(e,p))):t.queryGeometry.screenGeometry,A=e.aa.transformMat4([],[f.x,f.y,f.z,1],n);if(!a&&s?c*=A[3]/i.cameraToCenterDistance:a&&!s&&(c*=i.cameraToCenterDistance/A[3]),s){const e=bu((r.y/no+u.y)/(1<<u.z));c/=i.projection.pixelsPerMeter(e,1)/xu(1,e)}if(Hu(g,m,c))return!0}return!1}function qh(t,r,i,n){const o=e.aa.transformMat4([],[t,r,i,1],n);return new Vt(o[0]/o[3],o[1]/o[3])}const Xh=e.Q.fromValues(0,0,0),Yh=e.Q.fromValues(0,0,1);function $h(t,r){const i=e.Q.create();return Xh[2]=r,t.intersectsPlane(Xh,Yh,i),new Vt(i[0],i[1])}class Kh extends Nu{}function Jh(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError("mismatched image size")}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function ed(e,t,r){const{width:i,height:n}=t;i===e.width&&n===e.height||(td(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,i),height:Math.min(e.height,n)},r),e.width=i,e.height=n,e.data=t.data)}function td(e,t,r,i,n,o,s){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,l=t.data,c=4===o&&s;for(let s=0;s<n.height;s++){const u=((r.y+s)*e.width+r.x)*o,h=((i.y+s)*t.width+i.x)*o;if(c)for(let e=0;e<n.width;e++){const t=u+e*o+3,r=h+e*o;l[r+0]=255,l[r+1]=255,l[r+2]=255,l[r+3]=a[t]}else for(let e=0;e<n.width*o;e++)l[h+e]=a[u+e]}return t}fa(Kh,"HeatmapBucket",{omit:["layers"]});class rd{constructor(e,t){Jh(this,e,1,t)}resize(e){ed(this,new rd(e),1)}clone(){return new rd({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){td(e,t,r,i,n,1)}}class id{constructor(e,t){Jh(this,e,4,t)}resize(e){ed(this,new id(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new id({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n,o){td(e,t,r,i,n,4,o)}}class nd{constructor(e,t){this.width=e.width,this.height=e.height,this.data=t instanceof Uint8Array?new Float32Array(t.buffer):t}}fa(rd,"AlphaImage"),fa(id,"RGBAImage");const od=new Ka({visibility:new Xa(tl.layout_heatmap.visibility)});var sd={paint:new Ka({"heatmap-radius":new Ya(tl.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ya(tl.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xa(tl.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $a(tl.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xa(tl.paint_heatmap["heatmap-opacity"])}),layout:od};function ad(e){const t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new id({width:r,height:i}),o=(r,i,o)=>{t[e.evaluationKey]=o;const s=e.expression.evaluate(t);s&&(n.data[r+i+0]=Math.floor(255*s.r/s.a),n.data[r+i+1]=Math.floor(255*s.g/s.a),n.data[r+i+2]=Math.floor(255*s.b/s.a),n.data[r+i+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){const a=i/(r-1),{start:l,end:c}=e.clips[t];o(n,s,l*(1-a)+c*a)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return n}const ld=new Ka({visibility:new Xa(tl.layout_hillshade.visibility)});var cd={paint:new Ka({"hillshade-illumination-direction":new Xa(tl.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Xa(tl.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xa(tl.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xa(tl.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xa(tl.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xa(tl.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Xa(tl.paint_hillshade["hillshade-emissive-strength"])}),layout:ld};const ud=wl([{name:"a_pos",components:2,type:"Int16"}],4),{members:hd}=ud;var dd={exports:{}};function pd(e,t,r){r=r||2;var i,n,o,s,a,l,c,u=t&&t.length,h=u?t[0]*r:e.length,d=fd(e,0,h,r,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,r,i){var n,o,s,a=[];for(n=0,o=t.length;n<o;n++)(s=fd(e,t[n]*i,n<o-1?t[n+1]*i:e.length,i,!1))===s.next&&(s.steiner=!0),a.push(Td(s));for(a.sort(vd),n=0;n<a.length;n++)r=bd(a[n],r);return r}(e,t,d,r)),e.length>80*r){i=o=e[0],n=s=e[1];for(var f=r;f<h;f+=r)(a=e[f])<i&&(i=a),(l=e[f+1])<n&&(n=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-i,s-n))?32767/c:0}return gd(d,p,r,i,n,c,0),p}function fd(e,t,r,i,n){var o,s;if(n===Fd(e,t,r,i)>0)for(o=t;o<r;o+=i)s=zd(o,e[o],e[o+1],s);else for(o=r-i;o>=t;o-=i)s=zd(o,e[o],e[o+1],s);return s&&Id(s,s.next)&&(Bd(s),s=s.next),s}function md(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!Id(i,i.next)&&0!==Sd(i.prev,i,i.next))i=i.next;else{if(Bd(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function gd(e,t,r,i,n,o,s){if(e){!s&&o&&function(e,t,r,i){var n=e;do{0===n.z&&(n.z=Cd(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,o,s,a,l,c=1;do{for(r=e,e=null,o=null,s=0;r;){for(s++,i=r,a=0,t=0;t<c&&(a++,i=i.nextZ);t++);for(l=c;a>0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,c*=2}while(s>1)}(n)}(e,i,n,o);for(var a,l,c=e;e.prev!==e.next;)if(a=e.prev,l=e.next,o?_d(e,i,n,o):Ad(e))t.push(a.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),Bd(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?gd(e=yd(md(e),t,r),t,r,i,n,o,2):2===s&&xd(e,t,r,i,n,o):gd(md(e),t,r,i,n,o,1);break}}}function Ad(e){var t=e.prev,r=e,i=e.next;if(Sd(t,r,i)>=0)return!1;for(var n=t.x,o=r.x,s=i.x,a=t.y,l=r.y,c=i.y,u=n<o?n<s?n:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=n>o?n>s?n:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,f=i.next;f!==t;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Ed(n,a,o,l,s,c,f.x,f.y)&&Sd(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function _d(e,t,r,i){var n=e.prev,o=e,s=e.next;if(Sd(n,o,s)>=0)return!1;for(var a=n.x,l=o.x,c=s.x,u=n.y,h=o.y,d=s.y,p=a<l?a<c?a:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,A=Cd(p,f,t,r,i),_=Cd(m,g,t,r,i),y=e.prevZ,x=e.nextZ;y&&y.z>=A&&x&&x.z<=_;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==n&&y!==s&&Ed(a,u,l,h,c,d,y.x,y.y)&&Sd(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==s&&Ed(a,u,l,h,c,d,x.x,x.y)&&Sd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==n&&y!==s&&Ed(a,u,l,h,c,d,y.x,y.y)&&Sd(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==s&&Ed(a,u,l,h,c,d,x.x,x.y)&&Sd(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function yd(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!Id(n,o)&&Pd(n,i,i.next,o)&&Ld(n,o)&&Ld(o,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),Bd(i),Bd(i.next),i=e=o),i=i.next}while(i!==e);return md(i)}function xd(e,t,r,i,n,o){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Md(s,a)){var l=Od(s,a);return s=md(s,s.next),l=md(l,l.next),gd(s,t,r,i,n,o,0),void gd(l,t,r,i,n,o,0)}a=a.next}s=s.next}while(s!==e)}function vd(e,t){return e.x-t.x}function bd(e,t){var r=function(e,t){var r,i=t,n=e.x,o=e.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s&&(s=a,r=i.x<i.next.x?i:i.next,a===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,d=1/0;i=r;do{n>=i.x&&i.x>=u&&n!==i.x&&Ed(o<h?n:s,o,u,h,o<h?s:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),Ld(i,e)&&(l<d||l===d&&(i.x>r.x||i.x===r.x&&wd(r,i)))&&(r=i,d=l)),i=i.next}while(i!==c);return r}(e,t);if(!r)return t;var i=Od(r,e);return md(i,i.next),md(r,r.next)}function wd(e,t){return Sd(e.prev,e,t.prev)<0&&Sd(t.next,e,e.next)<0}function Cd(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Td(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Ed(e,t,r,i,n,o,s,a){return(n-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(r-s)*(t-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function Md(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Pd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Ld(e,t)&&Ld(t,e)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}(e,t)&&(Sd(e.prev,e,t.prev)||Sd(e,t.prev,t))||Id(e,t)&&Sd(e.prev,e,e.next)>0&&Sd(t.prev,t,t.next)>0)}function Sd(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Id(e,t){return e.x===t.x&&e.y===t.y}function Pd(e,t,r,i){var n=kd(Sd(e,t,r)),o=kd(Sd(e,t,i)),s=kd(Sd(r,i,e)),a=kd(Sd(r,i,t));return n!==o&&s!==a||!(0!==n||!Dd(e,r,t))||!(0!==o||!Dd(e,i,t))||!(0!==s||!Dd(r,e,i))||!(0!==a||!Dd(r,t,i))}function Dd(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function kd(e){return e>0?1:e<0?-1:0}function Ld(e,t){return Sd(e.prev,e,e.next)<0?Sd(e,t,e.next)>=0&&Sd(e,e.prev,t)>=0:Sd(e,t,e.prev)<0||Sd(e,e.next,t)<0}function Od(e,t){var r=new Rd(e.i,e.x,e.y),i=new Rd(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function zd(e,t,r,i){var n=new Rd(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Bd(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 Rd(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fd(e,t,r,i){for(var n=0,o=t,s=r-i;o<r;o+=i)n+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return n}dd.exports=pd,dd.exports.default=pd,pd.deviation=function(e,t,r,i){var n=t&&t.length,o=Math.abs(Fd(e,0,n?t[0]*r:e.length,r));if(n)for(var s=0,a=t.length;s<a;s++)o-=Math.abs(Fd(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r));var l=0;for(s=0;s<i.length;s+=3){var c=i[s]*r,u=i[s+1]*r,h=i[s+2]*r;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},pd.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var s=0;s<t;s++)r.vertices.push(e[n][o][s]);n>0&&r.holes.push(i+=e[n-1].length)}return r};var jd=h(dd.exports);function Vd(e,t){const r=e.length;if(r<=1)return[e];const i=[];let n,o;for(let t=0;t<r;t++){const r=pr(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(n&&i.push(n),n=[e[t]]):n.push(e[t]))}if(n&&i.push(n),t>1)for(let e=0;e<i.length;e++)i[e].length<=t||(On(i[e],t,1,i[e].length-1,Nd),i[e]=i[e].slice(0,t));return i}function Nd(e,t){return t.area-e.area}function Ud(e,t,r){const i=r.patternDependencies;let n=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(n=!0);const o=t.constantOr(null);o&&(n=!0,i[o]=!0)}return n}function Hd(e,t,r,i,n){const o=n.patternDependencies;for(const s of t){const t=s.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i},r,{},n.availableImages);e=e&&e.name?e.name:e,o[e]=!0,r.patterns[s.id]=e}}return r}class Gd{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Tl,this.indexArray=new Hl,this.indexArray2=new Fl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.segments2=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,r,i){this.hasPattern=Ud("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Fu(s,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),u,r))continue;const h=n?n.evaluate(u,{},r,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Ru(s,r,i),patterns:{},sortKey:h};o.push(d)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of o){const{geometry:n,index:o,sourceLayerIndex:s}=i;if(this.hasPattern){const e=Hd("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,{},t.availableImages,t.brightness);t.featureIndex.insert(e[o].feature,n,o,s,this.index)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}addFeatures(e,t,r,i,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,i,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n,o=[],s){for(const e of Vd(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=r.vertexLength,n=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(n.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),n.push(t[0].x),n.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),n.push(t[e].x),n.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const s=jd(n,o);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(i+s[e],i+s[e+1],i+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,s)}}fa(Gd,"FillBucket",{omit:["layers","patternFeatures"]});const Zd=new Ka({"fill-sort-key":new Ya(tl.layout_fill["fill-sort-key"]),visibility:new Xa(tl.layout_fill.visibility)});var Wd={paint:new Ka({"fill-antialias":new Xa(tl.paint_fill["fill-antialias"]),"fill-opacity":new Ya(tl.paint_fill["fill-opacity"]),"fill-color":new Ya(tl.paint_fill["fill-color"]),"fill-outline-color":new Ya(tl.paint_fill["fill-outline-color"]),"fill-translate":new Xa(tl.paint_fill["fill-translate"]),"fill-translate-anchor":new Xa(tl.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ya(tl.paint_fill["fill-pattern"]),"fill-emissive-strength":new Xa(tl.paint_fill["fill-emissive-strength"])}),layout:Zd};const Qd=wl([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),qd=wl([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Xd=wl([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Yd=wl([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),$d=wl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Kd}=Qd;var Jd={},ep=Ft,tp=rp;function rp(e,t,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n,e.readFields(ip,this,t)}function ip(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function np(e){for(var t,r,i=0,n=0,o=e.length,s=o-1;n<o;s=n++)i+=((r=e[s]).x-(t=e[n]).x)*(t.y+r.y);return i}rp.types=["Unknown","Point","LineString","Polygon"],rp.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,a=[];e.pos<r;){if(n<=0){var l=e.readVarint();i=7&l,n=l>>3}if(n--,1===i||2===i)o+=e.readSVarint(),s+=e.readSVarint(),1===i&&(t&&a.push(t),t=[]),t.push(new ep(o,s));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&a.push(t),a},rp.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;e.pos<t;){if(i<=0){var u=e.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<s&&(s=n),n>a&&(a=n),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,a,c]},rp.prototype.toGeoJSON=function(e,t,r){var i,n,o=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),c=rp.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],o=0;o<t;o++){var s=np(e[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(r&&n.push(r),r=[e[o]]):r.push(e[o]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)u(l[i][n])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var op=tp,sp=ap;function ap(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(lp,this,t),this.length=this._features.length}function lp(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(r))}ap.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 op(this._pbf,t,this.extent,this._keys,this._values)};var cp=sp;function up(e,t,r){if(3===e){var i=new cp(r,r.readVarint()+r.pos);i.length&&(t[i.name]=i)}}var hp=Jd.VectorTile=function(e,t){this.layers=e.readFields(up,{},t)},dp=Jd.VectorTileFeature=tp;function pp(e,t,r,i){const n=[],o=0===i?(e,t,r,i,n,o)=>{e.push(new Vt(o,r+(o-t)/(i-t)*(n-r)))}:(e,t,r,i,n,o)=>{e.push(new Vt(t+(o-r)/(n-r)*(i-t),o))};for(const s of e){const e=[];for(const n of s){if(n.length<=2)continue;const s=[];for(let e=0;e<n.length-1;e++){const a=n[e].x,l=n[e].y,c=n[e+1].x,u=n[e+1].y,h=0===i?a:l,d=0===i?c:u;h<t?d>t&&o(s,a,l,c,u,t):h>r?d<r&&o(s,a,l,c,u,r):s.push(n[e]),d<t&&h>=t&&o(s,a,l,c,u,t),d>r&&h<=r&&o(s,a,l,c,u,r)}let a=n[n.length-1];const l=0===i?a.x:a.y;l>=t&&l<=r&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&n.push(e)}return n}function fp(e,t){return e.x-t.x||e.y-t.y}function mp(e,t){return 0===fp(e.min,t.min)&&0===fp(e.max,t.max)}function gp(e,t){return!(e.min.x>t.max.x||e.max.x<t.min.x||e.min.y>t.max.y||e.max.y<t.min.y)}function Ap(e,t,r){const i=1/no,n=1/(1<<r.canonical.z),o=(t.x*i+r.canonical.x)*n+r.wrap,s=(t.y*i+r.canonical.y)*n;return{min:new Vt((e.x*i+r.canonical.x)*n+r.wrap,(e.y*i+r.canonical.y)*n),max:new Vt(o,s)}}function _p(e,t,r){const i=1<<r.canonical.z,n=((t.x-r.wrap)*i-r.canonical.x)*no,o=(t.y*i-r.canonical.y)*no;return{min:new Vt(((e.x-r.wrap)*i-r.canonical.x)*no,(e.y*i-r.canonical.y)*no),max:new Vt(n,o)}}function yp(e,t,r,i,n,o,s){const a=e.indices,l=e.vertices,c=[];for(let u=i;u<i+n;u+=3){const i=t[r[u+0]+o],n=t[r[u+1]+o],h=t[r[u+2]+o],d=Math.min(i.x,n.x,h.x),p=Math.max(i.x,n.x,h.x),f=Math.min(i.y,n.y,h.y),m=Math.max(i.y,n.y,h.y);c.length=0,e.grid.query(new Vt(d,f),new Vt(p,m),c);for(let e=0;e<c.length;e++){const t=c[e];if(th(l[a[3*t+0]],l[a[3*t+1]],l[a[3*t+2]],i,n,h,s))return!0}}return!1}function xp(e,t,r,i){if(!e||!r)return!1;let n=e.vertices;if(!t.canonical.equals(i.canonical)||t.wrap!==i.wrap){if(r.vertices.length<e.vertices.length)return xp(r,i,e,t);const o=t.canonical,s=i.canonical,a=Math.pow(2,s.z-o.z);n=e.vertices.map((e=>new Vt((e.x+o.x*no)*a-s.x*no,(e.y+o.y*no)*a-s.y*no)))}return yp(r,n,e.indices,0,e.indices.length,0,0)}Jd.VectorTileLayer=sp;class vp{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const r=this.toIdx(e,t);return{min:this.minimums[r],max:this.maximums[r]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function bp(e,t,r,i){let n=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(i[s])<1e-15){if(r[s]<e[s]||r[s]>t[s])return null}else{const a=1/i[s];let l=(e[s]-r[s])*a,c=(t[s]-r[s])*a;if(l>c){const e=l;l=c,c=e}if(l>n&&(n=l),c<o&&(o=c),n>o)return null}return n}function wp(e,t,r,i,n,o,s,a,l,c,u){const h=i-e,d=n-t,p=o-r,f=s-e,m=a-t,g=l-r,A=u[1]*g-u[2]*m,_=u[2]*f-u[0]*g,y=u[0]*m-u[1]*f,x=h*A+d*_+p*y;if(Math.abs(x)<1e-15)return null;const v=1/x,b=c[0]-e,w=c[1]-t,C=c[2]-r,T=(b*A+w*_+C*y)*v;if(T<0||T>1)return null;const E=w*p-C*d,M=C*h-b*p,S=b*d-w*h,I=(u[0]*E+u[1]*M+u[2]*S)*v;return I<0||T+I>1?null:(f*E+m*M+g*S)*v}function Cp(e,t,r){return(e-t)/(r-t)}function Tp(e,t,r,i,n,o,s,a,l){const c=1<<r,u=o-i,h=s-n,d=(e+1)/c*u+i,p=(t+0)/c*h+n,f=(t+1)/c*h+n;a[0]=(e+0)/c*u+i,a[1]=p,l[0]=d,l[1]=f}class Ep{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),r=[];let i=Math.ceil(Math.pow(2,t));const n=1/i,o=(e,t,r,i,n)=>{const o=i?1:0,s=(e+1)*r-o,a=t*r,l=(t+1)*r-o;n[0]=e*r,n[1]=a,n[2]=s,n[3]=l};let s=new vp(i);const a=[];for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),n,!1,a);const r=Sp(a[0],a[1],e),l=Sp(a[2],a[1],e),c=Sp(a[2],a[3],e),u=Sp(a[0],a[3],e);s.minimums.push(Math.min(r,l,c,u)),s.maximums.push(Math.max(r,l,c,u)),s.leaves.push(1)}for(r.push(s),i/=2;i>=1;i/=2){const e=r[r.length-1];s=new vp(i);for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),2,!0,a);const r=e.getElevation(a[0],a[1]),n=e.getElevation(a[2],a[1]),l=e.getElevation(a[2],a[3]),c=e.getElevation(a[0],a[3]),u=e.isLeaf(a[0],a[1]),h=e.isLeaf(a[2],a[1]),d=e.isLeaf(a[2],a[3]),p=e.isLeaf(a[0],a[3]),f=Math.min(r.min,n.min,l.min,c.min),m=Math.max(r.max,n.max,l.max,c.max),g=u&&h&&d&&p;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}r.push(s)}return r}(this.dem),r=t.length-1,i=t[r];this._addNode(i.minimums[0],i.maximums[0],i.leaves[0]),this._construct(t,0,0,r,0)}raycastRoot(e,t,r,i,n,o,s=1){return bp([e,t,-100],[r,i,this.maximums[0]*s],n,o)}raycast(t,r,i,n,o,s,a=1){if(!this.nodeCount)return null;const l=this.raycastRoot(t,r,i,n,o,s,a);if(null==l)return null;const c=[],u=[],h=[],d=[],p=[{idx:0,t:l,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:l,t:f,nodex:m,nodey:g,depth:A}=p.pop();if(this.leaves[l]){Tp(m,g,A,t,r,i,n,h,d);const l=1<<A,c=(m+0)/l,u=(m+1)/l,p=(g+0)/l,_=(g+1)/l,y=Sp(c,p,this.dem)*a,x=Sp(u,p,this.dem)*a,v=Sp(u,_,this.dem)*a,b=Sp(c,_,this.dem)*a,w=wp(h[0],h[1],y,d[0],h[1],x,d[0],d[1],v,o,s),C=wp(d[0],d[1],v,h[0],d[1],b,h[0],h[1],y,o,s),T=Math.min(null!==w?w:Number.MAX_VALUE,null!==C?C:Number.MAX_VALUE);if(T!==Number.MAX_VALUE)return T;{const t=e.Q.scaleAndAdd([],o,s,f);if(Mp(y,x,b,v,Cp(t[0],h[0],d[0]),Cp(t[1],h[1],d[1]))>=t[2])return f}continue}let _=0;for(let e=0;e<this._siblingOffset.length;e++){Tp((m<<1)+this._siblingOffset[e][0],(g<<1)+this._siblingOffset[e][1],A+1,t,r,i,n,h,d),h[2]=-100,d[2]=this.maximums[this.childOffsets[l]+e]*a;const p=bp(h,d,o,s);if(null!=p){const t=p;c[e]=t;let r=!1;for(let i=0;i<_&&!r;i++)t>=c[u[i]]&&(u.splice(i,0,e),r=!0);r||(u[_]=e),_++}}for(let e=0;e<_;e++){const t=u[e];p.push({idx:this.childOffsets[l]+t,t:c[t],nodex:(m<<1)+this._siblingOffset[t][0],nodey:(g<<1)+this._siblingOffset[t][1],depth:A+1})}}return null}_addNode(e,t,r){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,r,i,n){if(1===e[i].isLeaf(t,r))return;this.childOffsets[n]||(this.childOffsets[n]=this.nodeCount);const o=i-1,s=e[o];let a=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const i=2*t+this._siblingOffset[e][0],n=2*r+this._siblingOffset[e][1],o=s.getElevation(i,n),c=s.isLeaf(i,n),u=this._addNode(o.min,o.max,c);c&&(a|=1<<e),l||(l=u)}for(let i=0;i<this._siblingOffset.length;i++)a&1<<i||this._construct(e,2*t+this._siblingOffset[i][0],2*r+this._siblingOffset[i][1],o,l+i)}}function Mp(e,t,r,i,n,o){return Ui(Ui(e,r,o),Ui(t,i,o),n)}function Sp(e,t,r){const i=r.dim,n=Xt(e*i-.5,0,i-1),o=Xt(t*i-.5,0,i-1),s=Math.floor(n),a=Math.floor(o),l=Math.min(s+1,i-1),c=Math.min(a+1,i-1);return Mp(r.get(s,a),r.get(l,a),r.get(s,c),r.get(l,c),n-s,o-a)}const Ip={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Pp(e,t,r){return(256*e*256+256*t+r)/10-1e4}function Dp(e,t,r){return 256*e+t+r/256-32768}class kp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,r,i=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return hr(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const n=this.dim=t.height-2,o=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.floatView=new Float32Array(t.data.buffer),this.borderReady=i,this._modifiedForSources={},!i){for(let e=0;e<n;e++)o[this._idx(-1,e)]=o[this._idx(0,e)],o[this._idx(n,e)]=o[this._idx(n-1,e)],o[this._idx(e,-1)]=o[this._idx(e,0)],o[this._idx(e,n)]=o[this._idx(e,n-1)];o[this._idx(-1,-1)]=o[this._idx(0,0)],o[this._idx(n,-1)]=o[this._idx(n-1,0)],o[this._idx(-1,n)]=o[this._idx(0,n-1)],o[this._idx(n,n)]=o[this._idx(n-1,n-1)]}const s="terrarium"===r?Dp:Pp;for(let e=0;e<o.length;++e){const t=4*e;this.floatView[e]=s(this.pixels[t],this.pixels[t+1],this.pixels[t+2])}this._timestamp=Dr.now()}_buildQuadTree(){this._tree=new Ep(this)}get(e,t,r=!1){r&&(e=Xt(e,-1,this.dim),t=Xt(t,-1,this.dim));const i=this._idx(e,t);return this.floatView[i]}set(e,t,r){const i=this._idx(e,t),n=this.floatView[i];return this.floatView[i]=r,r-n}static getUnpackVector(e){return Ip[e]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const r=[0,0,0,0],i=kp.getUnpackVector(t);let n=Math.floor((e+i[3])/i[2]);return r[2]=n%256,n=Math.floor(n/256),r[1]=n%256,n=Math.floor(n/256),r[0]=n,r}getPixels(){return new nd({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,o=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-r*this.dim;for(let t=o;t<s;t++)for(let r=i;r<n;r++){const i=4*this._idx(r,t),n=4*this._idx(r+a,t+l);this.pixels[i+0]=e.pixels[n+0],this.pixels[i+1]=e.pixels[n+1],this.pixels[i+2]=e.pixels[n+2],this.pixels[i+3]=e.pixels[n+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}fa(kp,"DEMData"),fa(Ep,"DemMinMaxQuadTree",{omit:["dem"]});class Lp{constructor(e,t,r){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=r}static create(e,t,r){const i=r||e.findDEMTileFor(t);if(!i||!i.dem)return;const n=i.dem,o=i.tileID,s=1<<t.canonical.z-o.canonical.z;return new Lp(i,n.dim/no/s,[(t.canonical.x/s-o.canonical.x)*n.dim,(t.canonical.y/s-o.canonical.y)*n.dim])}tileCoordToPixel(e,t){const r=t*this._scale+this._offset[1],i=Math.floor(e*this._scale+this._offset[0]),n=Math.floor(r);return new Vt(i,n)}getElevationAt(e,t,r,i){const n=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],s=Math.floor(n),a=Math.floor(o),l=this._dem;return i=!!i,r?Ui(Ui(l.get(s,a,i),l.get(s,a+1,i),o-a),Ui(l.get(s+1,a,i),l.get(s+1,a+1,i),o-a),n-s):l.get(s,a,i)}getElevationAtPixel(e,t,r){return this._dem.get(e,t,!!r)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*xu(1,e)*this._dem.stride}}const Op=dp.types,zp=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius"],Bp=["fill-extrusion-flood-light-ground-radius"],Rp=Math.pow(2,13),Fp=Math.pow(2,15)-1,jp=new Vt(0,1),Vp=2147483648;function Np(e,t,r,i,n,o,s,a){e.emplaceBack((t<<1)+s,(r<<1)+o,(Math.floor(i*Rp)<<1)+n,Math.round(a))}function Up(e,t,r,i,n,o){e.emplaceBack(t.x,t.y,(r.x<<1)+i,(r.y<<1)+n,o)}function Hp(e,t,r){const i=16384;e.emplaceBack(t.x,t.y,t.z,r[0]*i,r[1]*i,r[2]*i)}class Gp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Zp{constructor(){this.centroidXY=new Vt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Vt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Vt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Vt(this.max.x-this.min.x,this.max.y-this.min.y)}}class Wp{constructor(){this.acc=new Vt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(e,t){e.min.x===Number.MAX_VALUE&&(e.min.x=e.max.x=t.x,e.min.y=e.max.y=t.y)}appendEdge(e,t,r){this.accCount++,this.acc._add(t);let i=!!this.borders;t.x<e.min.x?(e.min.x=t.x,i=!0):t.x>e.max.x&&(e.max.x=t.x,i=!0),t.y<e.min.y?(e.min.y=t.y,i=!0):t.y>e.max.y&&(e.max.y=t.y,i=!0),((0===t.x||t.x===no)&&t.x===r.x)!=((0===t.y||t.y===no)&&t.y===r.y)&&this.processBorderOverlap(t,r),i&&this.checkBorderIntersection(t,r)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,Ui(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>no!=e.x>no&&this.addBorderIntersection(1,Ui(t.y,e.y,(no-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Ui(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>no!=e.y>no&&this.addBorderIntersection(3,Ui(t.x,e.x,(no-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const r=this.borders[e];t<r[0]&&(r[0]=t),t>r[1]&&(r[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const r=0===e.x?0:1;this.addBorderIntersection(r,t.y),this.addBorderIntersection(r,e.y)}else{const r=0===e.y?2:3;this.addBorderIntersection(r,t.x),this.addBorderIntersection(r,e.x)}}centroid(){return 0===this.accCount?new Vt(0,0):new Vt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function Qp(e,t){const r=e.add(t)._unit(),i=Xt(e.x*r.x+e.y*r.y,-1,1);var n,o,s;return n=Math.acos(i),Math.min(4,Math.max(-4,Math.tan(n)))/4*Fp*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const qp=[e=>e.x<0,e=>e.x>no,e=>e.y<0,e=>e.y>no];function Xp(e,t,r,i){const n=[4];if(0===i)return n;r._mult(i);const o=e.sub(r),s=t.sub(r),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(qp[e](t)){n.push(e);break}return n}class Yp{constructor(e){this.vertexArray=new Sl,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>Bp.includes(e))),this._segments=new mc,this.hiddenByLandmarkVertexArray=new tc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new mc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,r,i=!1){const n=e.length;if(n>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*n,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],r=e[1];a=Qp(t.sub(e[n-1])._perp()._unit(),r.sub(t)._perp()._unit())}for(let l=0;l<n;l++){const c=l===n-1?0:l+1,u=e[l],h=e[c],d=e[c===n-1?0:c+1],p=h.sub(u)._perp()._unit(),f=Qp(p,d.sub(h)._perp()._unit()),m=a,g=f;if(tf(u,h,t)||i&&rf(u,t)&&rf(h,t)){a=f;continue}const A=s.vertexLength;Up(this.vertexArray,u,h,1,1,m),Up(this.vertexArray,u,h,1,0,m),Up(this.vertexArray,u,h,0,1,g),Up(this.vertexArray,u,h,0,0,g),s.vertexLength+=4;const _=Xp(u,h,p,r);for(const e of _)this._segmentToGroundQuads[o].push({id:A,region:e}),this._segmentToRegionTriCounts[o][e]+=2,s.primitiveLength+=2;a=f}}}prepareBorderSegments(){if(!this.hasData())return;const e=this._segments.get(),t=e.length;for(let e=0;e<t;e++)this._segmentToGroundQuads[e].sort(((e,t)=>e.region-t.region));for(let r=0;r<t;r++){const t=this._segmentToGroundQuads[r],i=e[r],n=this._segmentToRegionTriCounts[r];n.reduce(((e,t)=>e+t),0);let o=0;for(let e=0;e<=4;e++){const t=n[e];if(0!==t){let r=this.regionSegments[e];r||(r=this.regionSegments[e]=new mc);const n={vertexOffset:i.vertexOffset,primitiveOffset:i.primitiveOffset+o,vertexLength:i.vertexLength,primitiveLength:t};r.get().push(n)}o+=t}for(let e=0;e<t.length;e++){const r=t[e].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2)}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null}addPaintPropertiesData(e,t,r,i,n,o){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,e,t,r,i,n,o)}upload(e){this.hasData()&&(this.vertexBuffer=e.createVertexBuffer(this.vertexArray,qd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray))}uploadPaintProperties(e){this.hasData()&&this.programConfigurations.upload(e)}update(e,t,r,i,n,o){this.hasData()&&this.programConfigurations.updatePaintArrays(e,t,r,i,n,o)}updateHiddenByLandmark(e){if(!this.hasData())return;const t=e.groundVertexCount+e.groundVertexArrayOffset;if(0===e.groundVertexCount)return;const r=e.flags&Vp?1:0;for(let i=e.groundVertexArrayOffset;i<t;++i)this.hiddenByLandmarkVertexArray.emplace(i,r);this._needsHiddenByLandmarkUpdate=!0}uploadHiddenByLandmark(e){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,Yd.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class $p{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Hl,this.footprintVertices=new Tl,this.footprintSegments=[],this.layoutVertexArray=new Ml,this.centroidVertexArray=new dc,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom,(e=>zp.includes(e))),this.segments=new mc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new Yp(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}populate(e,t,r,i){this.features=[],this.hasPattern=Ud("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=Su(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:n,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Fu(n,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),l,r))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Ru(n,r,i),properties:n.properties,type:n.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Hd("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,s,r,{},t.availableImages,i,t.brightness),t.featureIndex.insert(n,c.geometry,s,a,this.index,u)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,r,i,n,o){for(const e of this.features){const{geometry:s}=e;this.addFeature(e,s,e.index,t,r,i,n,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,r,i,n){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,s,r,i,n),this.groundEffect.update(e,t,s,r,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Kd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,$d.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Xd.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n,o,s,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new Vt(0,0),new Vt(no,no)],u=s.projection,h="globe"===u.name,d="Polygon"===Op[e.type],p=new Wp;p.centroidDataIndex=this.centroidData.length;const f=new Zp,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},i)<=0,g=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},i);f.height=g,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Ol);const A=Vd(t,500);for(let e=A.length-1;e>=0;e--){const t=A[e];(0===t.length||(_=t[0]).every((e=>e.x<=0))||_.every((e=>e.x>=no))||_.every((e=>e.y<=0))||_.every((e=>e.y>=no)))&&A.splice(e,1)}var _;let y;if(h)y=af(A,c,i);else{y=[];for(const e of A)y.push({polygon:e,bounds:c})}const x=d?this.edgeRadius:0,v=x>0&&this.zoom<17,b=(e,t)=>{if(0===e.length)return!1;const r=e[e.length-1];return t.x===r.x&&t.y===r.y};for(const{polygon:e,bounds:t}of y){let r=0,n=0;for(const t of e)d&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=d?t.length-1:t.length;const o=this.segments.prepareSegment((d?5:4)*n,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new Gp;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const n=[],s=[];r=o.vertexLength;for(let r=0;r<e.length;r++){const c=e[r];c.length&&0!==r&&s.push(n.length/2);const d=[];let p,f;p=c[1].sub(c[0])._perp()._unit(),a.ringIndices.push(c.length-1);for(let e=1;e<c.length;e++){const t=c[e],r=c[e===c.length-1?1:e+1],s=t.clone();if(x){f=r.sub(t)._perp()._unit();const e=p.add(f)._unit(),i=x*Math.min(4,1/(p.x*e.x+p.y*e.y));s.x+=i*e.x,s.y+=i*e.y,s.x=Math.round(s.x),s.y=Math.round(s.y),p=f}!m||0!==x&&!v||b(d,s)||d.push(s),Np(this.layoutVertexArray,s.x,s.y,0,0,1,1,0),o.vertexLength++,this.footprintVertices.emplaceBack(t.x,t.y),n.push(t.x,t.y),h&&Hp(this.layoutVertexExtArray,u.projectTilePoint(s.x,s.y,i),u.upVector(i,s.x,s.y))}m&&(0===x||v)&&(0!==d.length&&b(d,d[0])&&d.pop(),this.groundEffect.addData(d,t,l))}const c=jd(n,s);for(let e=0;e<c.length;e+=3)this.footprintIndices.emplaceBack(a.vertexOffset+c[e+0],a.vertexOffset+c[e+1],a.vertexOffset+c[e+2]),this.indexArray.emplaceBack(r+c[e],r+c[e+2],r+c[e+1]),o.primitiveLength++;a.indexCount+=c.length,a.vertexCount+=this.footprintVertices.length-a.vertexOffset}for(let n=0;n<e.length;n++){const s=e[n];p.startRing(f,s[0]);let a=s.length>4&&nf(s[s.length-2],s[0],s[1]),c=x?Jp(s[s.length-2],s[0],s[1],x):0;const g=[];let A,_,y;_=s[1].sub(s[0])._perp()._unit();let v=!0;for(let e=1,n=0;e<s.length;e++){let l=s[e-1],d=s[e];const w=s[e===s.length-1?1:e+1];if(p.appendEdge(f,d,l),tf(d,l,t)){x&&(_=w.sub(d)._perp()._unit(),v=!v);continue}const C=d.sub(l)._perp(),T=C.x/(Math.abs(C.x)+Math.abs(C.y)),E=C.y>0?1:0,M=l.dist(d);if(n+M>32768&&(n=0),x){y=w.sub(d)._perp()._unit();let e=ef(l,d,w,Kp(_,y),x);isNaN(e)&&(e=0);const t=d.sub(l)._unit();l=l.add(t.mult(c))._round(),d=d.add(t.mult(-e))._round(),c=e,_=y,m&&this.zoom>=17&&(b(g,l)||g.push(l),b(g,d)||g.push(d))}const S=o.vertexLength,I=s.length>4&&nf(l,d,w);let P=of(n,a,v);if(Np(this.layoutVertexArray,l.x,l.y,T,E,0,0,P),Np(this.layoutVertexArray,l.x,l.y,T,E,0,1,P),n+=M,P=of(n,I,!v),a=I,Np(this.layoutVertexArray,d.x,d.y,T,E,0,0,P),Np(this.layoutVertexArray,d.x,d.y,T,E,0,1,P),o.vertexLength+=4,this.indexArray.emplaceBack(S+0,S+1,S+2),this.indexArray.emplaceBack(S+1,S+3,S+2),o.primitiveLength+=2,x){const i=r+(1===e?s.length-2:e-2),n=1===e?r:i+1;if(this.indexArray.emplaceBack(S+1,i,S+3),this.indexArray.emplaceBack(i,n,S+3),o.primitiveLength+=2,void 0===A&&(A=S),!tf(w,s[e],t)){const t=e===s.length-1?A:o.vertexLength;this.indexArray.emplaceBack(S+2,S+3,t),this.indexArray.emplaceBack(S+3,t+1,t),this.indexArray.emplaceBack(S+3,n,t+1),o.primitiveLength+=3}v=!v}if(h){const e=this.layoutVertexExtArray,t=u.projectTilePoint(l.x,l.y,i),r=u.projectTilePoint(d.x,d.y,i),n=u.upVector(i,l.x,l.y),o=u.upVector(i,d.x,d.y);Hp(e,t,n),Hp(e,t,n),Hp(e,r,o),Hp(e,r,o)}}d&&(r+=s.length-1),m&&x&&this.zoom>=17&&(0!==g.length&&b(g,g[0])&&g.pop(),this.groundEffect.addData(g,t,l,x>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?jp:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;t<p.borders.length;t++)p.borders[t][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[t].push(e)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,a),this.groundEffect.addPaintPropertiesData(e,r,n,o,i,a),this.maxHeight=Math.max(this.maxHeight,g)}}sortBorders(){for(let e=0;e<this.borderFeatureIndices.length;e++)this.borderFeatureIndices[e].sort(((t,r)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[r].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;t<this.centroidData.length;t++){const r=this.centroidData[t],i=+(r.min.y+r.max.y>no),n=2*i+(+(r.min.x+r.max.x>no)^i);for(let i=0;i<r.polygonSegLen;i++){const o=r.polygonSegIdx+i;e.push({centroidIdx:t,subtile:n,polygonSegmentIdx:o,triangleSegmentIdx:this.polygonSegments[o].triangleSegIdx})}}const t=new Hl;e.sort(((e,t)=>e.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let r=0,i=0,n=0;for(const t of e){if(t.triangleSegmentIdx!==r)break;n++}const o=e.length;for(;i!==e.length;){r=e[i].triangleSegmentIdx;let s=0,a=i,l=i;for(let t=a;t<n&&e[t].subtile===s;t++)l++;for(;a!==n;){const i=e[a];s=i.subtile;const o=this.centroidData[i.centroidIdx].min.clone(),c=this.centroidData[i.centroidIdx].max.clone(),u={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:t.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=a;r<l;r++){const i=e[r],n=this.polygonSegments[i.polygonSegmentIdx],s=this.centroidData[i.centroidIdx].min,a=this.centroidData[i.centroidIdx].max,l=this.indexArray.uint16;for(let e=n.triangleArrayOffset;e<n.triangleArrayOffset+n.triangleCount;e++)t.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);u.primitiveLength+=n.triangleCount,o.x=Math.min(o.x,s.x),o.y=Math.min(o.y,s.y),c.x=Math.max(c.x,a.x),c.y=Math.max(c.y,a.y)}u.primitiveLength>0&&this.triangleSubSegments.push({segment:u,min:o,max:c}),a=l;for(let t=a;t<n&&e[t].subtile===e[a].subtile;t++)l++}i=n;for(let t=i;t<o&&e[t].triangleSegmentIdx===e[i].triangleSegmentIdx;t++)n++}t._trim(),this.indexArray=t}getVisibleSegments(e,t,r){let i=0,n=0;const o=1<<e.canonical.z;if(t){const r=t.getMinMaxForTile(e);r&&(i=r.min,n=r.max)}n+=this.maxHeight;const s=e.toUnwrapped();let a;const l=[s.canonical.x/o+s.wrap,s.canonical.y/o],c=[(s.canonical.x+1)/o+s.wrap,(s.canonical.y+1)/o],u=new mc,h=(e,t,r)=>[e[0]*(1-r[0])+t[0]*r[0],e[1]*(1-r[1])+t[1]*r[1]],d=[],p=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/no,d[1]=e.min.y/no,p[0]=e.max.x/no,p[1]=e.max.y/no;const t=h(l,c,d),o=h(l,c,p);if(0===new mh([t[0],t[1],i],[o[0],o[1],n]).intersectsPrecise(r)){a&&(u.segments.push(a),a=void 0);continue}const s=e.segment;a&&a.vertexOffset!==s.vertexOffset&&(u.segments.push(a),a=void 0),a?(a.vertexLength+=s.vertexLength,a.primitiveLength+=s.primitiveLength):a={vertexOffset:s.vertexOffset,primitiveLength:s.primitiveLength,vertexLength:s.vertexLength,primitiveOffset:s.primitiveOffset,sortKey:void 0,vaos:{}}}return a&&u.segments.push(a),u}encodeCentroid(e,t){const r=e.centroid(),i=t.span(),n=Math.min(7,Math.round(i.x*this.tileToMeter/10)),o=Math.min(7,Math.round(i.y*this.tileToMeter/10));return new Vt(Xt(r.x,1,no-1)<<3|n,Xt(r.y,1,no-1)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Vt(0,0);const t=e.borders,r=Number.MAX_VALUE;if(t[0][0]!==r||t[1][0]!==r){const e=t[0][0]!==r?0:1;return new Vt(6|(t[0][0]!==r?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==r?2:3;return new Vt((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==r?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=Vp,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,r=e.vertexCount+e.vertexArrayOffset,i=e.flags&Vp?jp:e.centroidXY,n=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==i.y||n!==i.x){for(let e=t;e<r;++e)this.centroidVertexArray.emplace(e,i.x,i.y);this.needsCentroidUpdate=!0}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const e of this.centroidData)this.writeCentroidToBuffer(e)}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped());if(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].sourceId!==t[r].sourceId||!mp(e[r],t[r]))return!1;return!0}(this.activeReplacements,r))return;if(this.activeReplacements=r,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const e of this.centroidData)e.flags&=2147483647;const i=[];for(const t of this.activeReplacements){const r=Math.pow(2,t.footprintTileId.canonical.z-e.canonical.z);for(const n of this.centroidData)if(!(n.flags&Vp||t.min.x>n.max.x||n.min.x>t.max.x||t.min.y>n.max.y||n.min.y>t.max.y))for(let o=0;o<n.footprintSegLen;o++){const s=this.footprintSegments[n.footprintSegIdx+o];if(i.length=0,lf(this.footprintVertices,s.vertexOffset,s.vertexCount,t.footprintTileId.canonical,e.canonical,i),yp(t.footprint,i,this.footprintIndices.uint16,s.indexOffset,s.indexCount,-s.vertexOffset,-r)){n.flags|=Vp;break}}}for(const e of this.centroidData)this.writeCentroidToBuffer(e);this.borderDoneWithNeighborZ=[-1,-1,-1,-1]}footprintContainsPoint(e,t,r){let i=!1;for(let n=0;n<r.footprintSegLen;n++){const o=this.footprintSegments[r.footprintSegIdx+n];let s=0;for(const r of o.ringIndices){for(let n=s,a=r+s-1;n<r+s;a=n++){const r=this.footprintVertices.int16[2*(n+o.vertexOffset)+0],s=this.footprintVertices.int16[2*(n+o.vertexOffset)+1],l=this.footprintVertices.int16[2*(a+o.vertexOffset)+1];s>t!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-r)*(t-s)/(l-s)+r&&(i=!i)}s=r}}return i}getHeightAtTileCoord(e,t){let r=Number.NEGATIVE_INFINITY,i=!0;const n=4*(e+no)*no+(t+no);if(this.partLookup.hasOwnProperty(n)){const e=this.partLookup[n];return e?{height:e.height,hidden:!!(e.flags&Vp)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>r&&(r=o.height,this.partLookup[n]=o,i=!!(o.flags&Vp));if(r!==Number.NEGATIVE_INFINITY)return{height:r,hidden:i};this.partLookup[n]=void 0}}function Kp(e,t){const r=e.add(t)._unit();return e.x*r.x+e.y*r.y}function Jp(e,t,r,i){const n=t.sub(e)._perp()._unit(),o=r.sub(t)._perp()._unit();return ef(e,t,r,Kp(n,o),i)}function ef(e,t,r,i,n){const o=Math.sqrt(1-i*i);return Math.min(e.dist(t)/3,t.dist(r)/3,n*o/i)}function tf(e,t,r){return e.x<r[0].x&&t.x<r[0].x||e.x>r[1].x&&t.x>r[1].x||e.y<r[0].y&&t.y<r[0].y||e.y>r[1].y&&t.y>r[1].y}function rf(e,t){return e.x<t[0].x||e.x>t[1].x||e.y<t[0].y||e.y>t[1].y}function nf(e,t,r){if(e.x<0||e.x>=no||t.x<0||t.x>=no||r.x<0||r.x>=no)return!1;const i=r.sub(t),n=i.perp(),o=e.sub(t);return(i.x*o.x+i.y*o.y)/Math.sqrt((i.x*i.x+i.y*i.y)*(o.x*o.x+o.y*o.y))>-.866&&n.x*o.x+n.y*o.y<0}function of(e,t,r){const i=t?2|e:-3&e;return r?1|i:-2&i}function sf(){const e=Math.PI/32,t=Math.tan(e),r=nu;return r*Math.sqrt(1+2*t*t)-r}function af(e,t,r){const i=1<<r.z,n=vu(r.x/i),o=vu((r.x+1)/i),s=bu(r.y/i),a=bu((r.y+1)/i);return function(e,t,r,i,n=0,o){const s=[];if(!e.length||!r||!i)return s;const a=(e,t)=>{for(const r of e)s.push({polygon:r,bounds:t})},l=Math.ceil(Math.log2(r)),c=Math.ceil(Math.log2(i)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=pp(d,t[0].y-n,t[1].y+n,1),d=pp(d,t[0].x-n,t[1].x+n,0),!d.length)return s;const p=[];for(h.length?p.push({polygons:d,bounds:t,depth:0}):a(d,t);p.length;){const e=p.pop(),t=e.depth,r=h[t],i=e.bounds[0],s=e.bounds[1],l=0===r?i.x:i.y,c=0===r?s.x:s.y,u=o?o(r,l,c):.5*(l+c),d=pp(e.polygons,l-n,u+n,r),f=pp(e.polygons,u-n,c+n,r);if(d.length){const e=[i,new Vt(0===r?u:s.x,1===r?u:s.y)];h.length>t+1?p.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(f.length){const e=[new Vt(0===r?u:i.x,1===r?u:i.y),s];h.length>t+1?p.push({polygons:f,bounds:e,depth:t+1}):a(f,e)}}return s}(e,t,Math.ceil((o-n)/11.25),Math.ceil((s-a)/11.25),1,((e,t,n)=>{if(0===e)return.5*(t+n);{const e=bu((r.y+t/no)/i);return(yu(.5*(bu((r.y+n/no)/i)+e))*i-r.y)*no}}))}function lf(e,t,r,i,n,o){const s=Math.pow(2,i.z-n.z);for(let a=0;a<r;a++){let r=e.int16[2*(a+t)+0],l=e.int16[2*(a+t)+1];r=(r+n.x*no)*s-i.x*no,l=(l+n.y*no)*s-i.y*no,o.push(new Vt(r,l))}}fa($p,"FillExtrusionBucket",{omit:["layers","features"]}),fa(Zp,"PartData"),fa(Gp,"FootprintSegment"),fa(Wp,"BorderCentroidData"),fa(Yp,"GroundEffect");const cf=new Ka({visibility:new Xa(tl["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Xa(tl["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uf={paint:new Ka({"fill-extrusion-opacity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Ya(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Xa(tl["paint_fill-extrusion"]["fill-extrusion-emissive-strength"])}),layout:cf};class hf extends Vt{constructor(e,t,r){super(e,t),this.z=r}}function df(e,t){return e.x*t.x+e.y*t.y}function pf(e,t){if(1===e.length){let r=0;const i=t[r++];let n;for(;!n||i.equals(n);)if(n=t[r++],!n)return 1/0;for(;r<t.length;r++){const o=t[r],s=e[0],a=n.sub(i),l=o.sub(i),c=s.sub(i),u=df(a,a),h=df(a,l),d=df(l,l),p=df(c,a),f=df(c,l),m=u*d-h*h,g=(d*p-h*f)/m,A=(u*f-h*p)/m,_=i.z*(1-g-A)+n.z*g+o.z*A;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}function ff(e,t,r,i,n,o,s,a){const l=s*n.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(e,t,r){const i=Math.floor(t[0]/8),n=Math.floor(t[1]/8),o=10*(t[0]-8*i),s=10*(t[1]-8*n),a=e.getElevationAt(i,n,!0,!0),l=e.getMeterToDEM(r),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=e.tileCoordToPixel(i,n),d=2*c+1,p=2*u+1,f=function(e,t,r,i,n){return[e.getElevationAtPixel(t,r,!0),e.getElevationAtPixel(t+n,r,!0),e.getElevationAtPixel(t,r+n,!0),e.getElevationAtPixel(t+i,r+n,!0)]}(e,h.x-c,h.y-u,d,p),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),A=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),_=Math.min(.25,.5*l*(m+g)/d),y=Math.min(.25,.5*l*A/p);return a+Math.max(_*o,y*s)}(n,o,a):l;return{base:l+(0===r)?-1:r,top:c?Math.max(u+i,l+r+2):l+i}}const mf=wl([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:gf}=mf,Af=wl([{name:"a_packed",components:4,type:"Float32"}]),{members:_f}=Af,yf=wl([{name:"a_pattern_data",components:2,type:"Float32"}]),{members:xf}=yf;class vf{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new rd({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const r=this.getKey(e,t);return this.positions[r]}trim(){const e=this.width,t=this.height=ir(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,r){const i=[];let n=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,s=!0;i.push({left:n,right:o,isDash:s,zeroLength:0===e[0]});let a=e[0];for(let t=1;t<e.length;t++){s=!s;const l=e[t];n=a*r,a+=l,o=a*r,i.push({left:n,right:o,isDash:s,zeroLength:0===l})}return i}addRoundDash(e,t,r){const i=t/2;for(let t=-r;t<=r;t++){const n=this.width*(this.nextRow+r+t);let o=0,s=e[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const d=t/r*(i+1);if(s.isDash){const e=i-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=i-Math.sqrt(u*u+d*d);this.image.data[n+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}const r=e[0],i=e[e.length-1];r.isDash===i.isDash&&(r.left=i.left-this.width,i.right=r.right+this.width);const n=this.width*this.nextRow;let o=0,s=e[o];for(let r=0;r<this.width;r++){r/s.right>1&&(s=e[++o]);const i=Math.abs(r-s.left),a=Math.abs(r-s.right),l=Math.min(i,a);this.image.data[n+r]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const r=this.getKey(e,t);if(this.positions[r])return this.positions[r];const i="round"===t,n=i?7:0,o=2*n+1;if(this.nextRow+o>this.height)return hr("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;t<e.length;t++)e[t]<0&&(hr("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),s+=e[t];if(0!==s){const r=this.width/s,o=this.getDashRanges(e,this.width,r);i?this.addRoundDash(o,r,n):this.addRegularDash(o,"square"===t?.5*r:0)}const a=this.nextRow+n;this.nextRow+=o;const l={tl:[a,n],br:[s,0]};return this.positions[r]=l,l}}fa(vf,"LineAtlas");const bf=dp.types,wf=Math.cos(Math.PI/180*37.5),Cf=Math.cos(Math.PI/180*5);class Tf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Il,this.layoutVertexArray2=new Pl,this.patternVertexArray=new Dl,this.indexArray=new Hl,this.programConfigurations=new Uc(e.layers,e.zoom),this.segments=new mc,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r,i){this.hasPattern=Ud("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:s,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Fu(t,e);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),c,r))continue;const u=n?n.evaluate(c,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Ru(t,r,i),patterns:{},sortKey:u};o.push(h)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:s,featureIndex:a}=t,l=this.addConstantDashes(s);for(const i of o){const{geometry:n,index:o,sourceLayerIndex:c}=i;if(l&&this.addFeatureDashes(i,s),this.hasPattern){const e=Hd("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,s.positions,t.availableImages,t.brightness);a.insert(e[o].feature,n,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const r of this.layers){const i=r.paint.get("line-dasharray").value,n=r.layout.get("line-cap").value;if("constant"!==i.kind||"constant"!==n.kind)t=!0;else{const t=n.value,r=i.value;if(!r)continue;e.addDash(r,t)}}return t}addFeatureDashes(e,t){const r=this.zoom;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,o=i.layout.get("line-cap").value;if("constant"===n.kind&&"constant"===o.kind)continue;let s,a;if("constant"===n.kind){if(s=n.value,!s)continue}else s=n.evaluate({zoom:r},e);a="constant"===o.kind?o.value:o.evaluate({zoom:r},e),t.addDash(s,a),e.patterns[i.id]=t.getKey(s,a)}}update(e,t,r,i,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,r,i,n)}addFeatures(e,t,r,i,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r,i,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,_f)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,xf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,i,n,o,s){const a=this.layers[0].layout,l=a.get("line-join").evaluate(e,{}),c=a.get("line-cap").evaluate(e,{}),u=a.get("line-miter-limit"),h=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,l,c,u,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,o,i,s)}addLine(e,t,r,i,n,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0;const s="none"===r;if(this.patternJoinNone=this.hasPattern&&s,this.segmentStart=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===bf[t.type];let l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(a?3:2))return;"bevel"===r&&(n=1.05);const u=this.overscaling<=16?15*no/(512*this.overscaling):0,h=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);let d,p,f,m,g;this.e1=this.e2=-1,a&&(d=e[l-2],g=e[c].sub(d)._unit()._perp());for(let t=c;t<l;t++){if(f=t===l-1?a?e[c+1]:void 0:e[t+1],f&&e[t].equals(f))continue;g&&(m=g),d&&(p=d),d=e[t],g=f?f.sub(d)._unit()._perp():m,m=m||g;const A=p&&f;let _=A?r:a||s?"butt":i;const y=m.x*g.x+m.y*g.y;if(s){const e=function(e){if(e.patternJoinNone){const t=e.segmentPoints.length/2,r=e.lineSoFar-e.segmentStart;for(let i=0;i<t;++i){const t=e.segmentPoints[2*i+1],n=Math.round(e.segmentPoints[2*i])+.5+.25*t;e.patternVertexArray.emplaceBack(n,r),e.patternVertexArray.emplaceBack(n,r)}e.segmentPoints=[],e.segmentStart=e.lineSoFar}e.e1=e.e2=-1};if(A&&y<Cf){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this),this.addCurrentVertex(d,g,-1,-1,h);continue}if(p){if(!f){this.updateDistance(p,d),this.addCurrentVertex(d,m,1,1,h),e(this);continue}_="miter"}}let x=m.add(g);0===x.x&&0===x.y||x._unit();const v=x.x*g.x+x.y*g.y,b=0!==v?1/v:1/0,w=2*Math.sqrt(2-2*v),C=v<wf&&p&&f,T=m.x*g.y-m.y*g.x>0;if(C&&t>c){const e=d.dist(p);if(e>2*u){const t=d.sub(d.sub(p)._mult(u/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,m,0,0,h),p=t}}if(A&&"round"===_&&(b<o?_="miter":b<=2&&(_="fakeround")),"miter"===_&&b>n&&(_="bevel"),"bevel"===_&&(b>2&&(_="flipbevel"),b<n&&(_="miter")),p&&this.updateDistance(p,d),"miter"===_)x._mult(b),this.addCurrentVertex(d,x,0,0,h);else if("flipbevel"===_){if(b>100)x=g.mult(-1);else{const e=b*m.add(g).mag()/m.sub(g).mag();x._perp()._mult(e*(T?-1:1))}this.addCurrentVertex(d,x,0,0,h),this.addCurrentVertex(d,x.mult(-1),0,0,h)}else if("bevel"===_||"fakeround"===_){const e=-Math.sqrt(b*b-1),t=T?e:0,r=T?0:e;if(p&&this.addCurrentVertex(d,m,t,r,h),"fakeround"===_){const e=Math.round(180*w/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}const i=g.sub(m)._mult(r)._add(m)._unit()._mult(T?-1:1);this.addHalfVertex(d,i.x,i.y,!1,T,0,h)}}f&&this.addCurrentVertex(d,g,-t,-r,h)}else"butt"===_?this.addCurrentVertex(d,x,0,0,h):"square"===_?(p||this.addCurrentVertex(d,x,-1,-1,h),this.addCurrentVertex(d,x,0,0,h),p&&this.addCurrentVertex(d,x,1,1,h)):"round"===_&&(p&&(this.addCurrentVertex(d,m,0,0,h),this.addCurrentVertex(d,m,1,1,h,!0)),f&&(this.addCurrentVertex(d,g,-1,-1,h,!0),this.addCurrentVertex(d,g,0,0,h)));if(C&&t<l-1){const e=d.dist(f);if(e>2*u){const t=d.add(f.sub(d)._mult(u/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,g,0,0,h),d=t}}}}addCurrentVertex(e,t,r,i,n,o=!1){const s=t.y*i-t.x,a=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,n),this.addHalfVertex(e,s,a,o,!0,-i,n),this.patternJoinNone&&this.segmentPoints.push(this.lineSoFar-this.segmentStart,r)}addHalfVertex({x:e,y:t},r,i,n,o,s,a){this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}fa(Tf,"LineBucket",{omit:["layers","patternFeatures"]});const Ef=new Ka({"line-cap":new Ya(tl.layout_line["line-cap"]),"line-join":new Ya(tl.layout_line["line-join"]),"line-miter-limit":new Xa(tl.layout_line["line-miter-limit"]),"line-round-limit":new Xa(tl.layout_line["line-round-limit"]),"line-sort-key":new Ya(tl.layout_line["line-sort-key"]),visibility:new Xa(tl.layout_line.visibility)});var Mf={paint:new Ka({"line-opacity":new Ya(tl.paint_line["line-opacity"]),"line-color":new Ya(tl.paint_line["line-color"]),"line-translate":new Xa(tl.paint_line["line-translate"]),"line-translate-anchor":new Xa(tl.paint_line["line-translate-anchor"]),"line-width":new Ya(tl.paint_line["line-width"]),"line-gap-width":new Ya(tl.paint_line["line-gap-width"]),"line-offset":new Ya(tl.paint_line["line-offset"]),"line-blur":new Ya(tl.paint_line["line-blur"]),"line-dasharray":new Ya(tl.paint_line["line-dasharray"]),"line-pattern":new Ya(tl.paint_line["line-pattern"]),"line-gradient":new $a(tl.paint_line["line-gradient"]),"line-trim-offset":new Xa(tl.paint_line["line-trim-offset"]),"line-emissive-strength":new Xa(tl.paint_line["line-emissive-strength"]),"line-border-width":new Ya(tl.paint_line["line-border-width"]),"line-border-color":new Ya(tl.paint_line["line-border-color"])}),layout:Ef};function Sf(e,t,r){return t*(no/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}function If(e,t){return 1/Sf(e,1,t.tileZoom)}function Pf(e,t,r,i){return e.translatePosMatrix(i||t.tileID.projMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Df=e=>{const t=[];kf(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const r=e.paint.get("line-trim-offset");0===r[0]&&0===r[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const i="none"===e.layout.get("line-join").constantOr("miter"),n=!!e.paint.get("line-pattern").constantOr(1);return i&&n&&t.push("LINE_JOIN_NONE"),t};function kf(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Lf=new class extends Ya{possiblyEvaluate(e,t){return t=new Va(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=Jt({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}}(Mf.paint.properties["line-width"].specification);function Of(e,t){return t>0?t+2*e:e}Lf.useIntegerZoom=!0;const zf=wl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Bf=wl([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Rf=wl([{name:"a_projected_pos",components:4,type:"Float32"}],4);wl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ff=wl([{name:"a_z_offset",components:1,type:"Float32"}],4),jf=wl([{name:"a_texb",components:2,type:"Uint16"}]),Vf=wl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Nf=wl([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_z_offset",components:1,type:"Float32"}]);wl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Uf=wl([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hf=wl([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);wl([{name:"triangle",components:3,type:"Uint16"}]),wl([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),wl([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),wl([{type:"Float32",name:"offsetX"}]),wl([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Gf=24;const Zf=128;function Wf(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Va(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:i}=r;let n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let o=n;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const s=t[n],a=t[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:a,minSize:r.evaluate(new Va(s)),maxSize:r.evaluate(new Va(a)),interpolationType:i}}}function Qf(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return"source"===e.kind?i/Zf:"composite"===e.kind?Ui(i/Zf,n/Zf,r):t}function qf(e,t){let r=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){const{interpolationType:n,minZoom:o,maxZoom:s}=e,a=n?Xt(ds.interpolationFactor(n,t,o,s),0,1):0;"camera"===e.kind?i=Ui(e.minSize,e.maxSize,a):r=a}return{uSizeT:r,uSize:i}}var Xf=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Zf,evaluateSizeForFeature:Qf,evaluateSizeForZoom:qf,getSizeData:Wf});function Yf(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),ja.applyArabicShaping&&(e=ja.applyArabicShaping(e)),e}(e.text,t,r)})),e}const $f={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function Kf(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function Jf(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var em={
|
|
34
34
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
35
35
|
read:function(e,t,r,i,n){var o,s,a=8*n-i-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?n-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=c}return(p?-1:1)*s*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var s,a,l,c=8*o-n-1,u=(1<<c)-1,h=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,n),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;e[r+p]=255&a,p+=f,a/=256,n-=8);for(s=s<<n|a,c+=n;c>0;e[r+p]=255&s,p+=f,s/=256,c-=8);e[r+p-f]|=128*m}},tm=im,rm=em;function im(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}im.Varint=0,im.Fixed64=1,im.Bytes=2,im.Fixed32=5;var nm=4294967296,om=1/nm,sm="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function am(e){return e.type===im.Bytes?e.readVarint()+e.pos:e.pos+1}function lm(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function cm(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n--)r.buf[n+i]=r.buf[n]}function um(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function hm(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function dm(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function pm(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function fm(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function mm(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function gm(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Am(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function _m(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function ym(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function xm(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function vm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}im.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,e(n,t,this),this.pos===o&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=ym(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=vm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=ym(this.buf,this.pos)+ym(this.buf,this.pos+4)*nm;return this.pos+=8,e},readSFixed64:function(){var e=ym(this.buf,this.pos)+vm(this.buf,this.pos+4)*nm;return this.pos+=8,e},readFloat:function(){var e=rm.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=rm.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,i=this.buf;return t=127&(r=i[this.pos++]),r<128?t:(t|=(127&(r=i[this.pos++]))<<7,r<128?t:(t|=(127&(r=i[this.pos++]))<<14,r<128?t:(t|=(127&(r=i[this.pos++]))<<21,r<128?t:function(e,t,r){var i,n,o=r.buf;if(i=(112&(n=o[r.pos++]))>>4,n<128)return lm(e,i,t);if(i|=(127&(n=o[r.pos++]))<<3,n<128)return lm(e,i,t);if(i|=(127&(n=o[r.pos++]))<<10,n<128)return lm(e,i,t);if(i|=(127&(n=o[r.pos++]))<<17,n<128)return lm(e,i,t);if(i|=(127&(n=o[r.pos++]))<<24,n<128)return lm(e,i,t);if(i|=(1&(n=o[r.pos++]))<<31,n<128)return lm(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=i[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=this.pos;return this.pos=e,e-t>=12&&sm?function(e,t,r){return sm.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var i="",n=t;n<r;){var o,s,a,l=e[n],c=null,u=l>239?4:l>223?3:l>191?2:1;if(n+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[n+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=e[n+2],128==(192&(o=e[n+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=e[n+2],a=e[n+3],128==(192&(o=e[n+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=u}return i}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==im.Bytes)return e.push(this.readVarint(t));var r=am(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==im.Bytes)return e.push(this.readSVarint());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==im.Bytes)return e.push(this.readBoolean());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==im.Bytes)return e.push(this.readFloat());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==im.Bytes)return e.push(this.readDouble());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==im.Bytes)return e.push(this.readFixed32());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==im.Bytes)return e.push(this.readSFixed32());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==im.Bytes)return e.push(this.readFixed64());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==im.Bytes)return e.push(this.readSFixed64());var t=am(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===im.Varint)for(;this.buf[this.pos++]>127;);else if(t===im.Bytes)this.pos=this.readVarint()+this.pos;else if(t===im.Fixed32)this.pos+=4;else{if(t!==im.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;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),xm(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),xm(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),xm(this.buf,-1&e,this.pos),xm(this.buf,Math.floor(e*om),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),xm(this.buf,-1&e,this.pos),xm(this.buf,Math.floor(e*om),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((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)))))}(i,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,r){for(var i,n,o=0;o<t.length;o++){if((i=t.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&cm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),rm.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),rm.write(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 r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&cm(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,r){this.writeTag(e,im.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,um,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,hm,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,fm,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,dm,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,pm,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,mm,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,gm,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Am,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,_m,t)},writeBytesField:function(e,t){this.writeTag(e,im.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,im.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,im.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,im.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,im.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,im.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,im.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,im.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,im.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,im.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var bm=h(tm);const wm=3;function Cm(e,t,r){t.glyphs=[],1===e&&r.readMessage(Tm,t)}function Tm(e,t,r){if(3===e){const{id:e,bitmap:i,width:n,height:o,left:s,top:a,advance:l}=r.readMessage(Em,{});t.glyphs.push({id:e,bitmap:new rd({width:n+2*wm,height:o+2*wm},i),metrics:{width:n,height:o,left:s,top:a,advance:l}})}else 4===e?t.ascender=r.readSVarint():5===e&&(t.descender=r.readSVarint())}function Em(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}const Mm=wm,Sm={horizontal:1,vertical:2,horizontalOnly:3};class Im{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new Im;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Im;return t.imageName=e,t}}class Pm{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new Pm;for(let i=0;i<e.sections.length;i++){const n=e.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCodePoint(e){return this.text.codePointAt(e)}verticalizePunctuation(e){this.text=function(e,t){let r="";for(let i=0;i<e.length;i++){const n=e.charCodeAt(i+1)||null,o=e.charCodeAt(i-1)||null;r+=!t&&(n&&Ca(n)&&!$f[e[i+1]]||o&&Ca(o)&&!$f[e[i-1]])||!$f[e[i]]?e[i]:$f[e[i]]}return r}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&km[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&km[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new Pm;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Im.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.namePrimary:"";if(0===t.length)return void hr("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCodePoint(r),this.sections.push(Im.forImage(t)),this.sectionIndex.push(this.sections.length-1)):hr("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Dm(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f){const m=Pm.fromFeature(e,n);h===Sm.vertical&&m.verticalizePunctuation(d);let g=[];const A=function(e,t,r,i,n,o){if(!e)return[];const s=[],a=function(e,t,r,i,n,o){let s=0;for(let r=0;r<e.length();r++){const a=e.getSection(r);s+=Om(e.getCodePoint(r),a,i,n,t,o)}return s/Math.max(1,Math.ceil(s/r))}(e,t,r,i,n,o),l=e.text.indexOf("")>=0;let c=0;for(let r=0;r<e.length();r++){const h=e.getSection(r),d=e.getCodePoint(r);if(km[d]||(c+=Om(d,h,i,n,t,o)),r<e.length()-1){const t=!((u=d)<11904||!(ya["Bopomofo Extended"](u)||ya.Bopomofo(u)||ya["CJK Compatibility Forms"](u)||ya["CJK Compatibility Ideographs"](u)||ya["CJK Compatibility"](u)||ya["CJK Radicals Supplement"](u)||ya["CJK Strokes"](u)||ya["CJK Symbols and Punctuation"](u)||ya["CJK Unified Ideographs Extension A"](u)||ya["CJK Unified Ideographs"](u)||ya["Enclosed CJK Letters and Months"](u)||ya["Halfwidth and Fullwidth Forms"](u)||ya.Hiragana(u)||ya["Ideographic Description Characters"](u)||ya["Kangxi Radicals"](u)||ya["Katakana Phonetic Extensions"](u)||ya.Katakana(u)||ya["Vertical Forms"](u)||ya["Yi Radicals"](u)||ya["Yi Syllables"](u)));(Lm[d]||t||h.imageName)&&s.push(Rm(r+1,c,a,s,Bm(d,e.getCodePoint(r+1),t&&l),!1))}}var u;return Fm(Rm(e.length(),c,a,s,0,!0))}(m,c,o,t,i,p),{processBidirectionalText:_,processStyledBidirectionalText:y}=ja;if(_&&1===m.sections.length){const e=_(m.toString(),A);for(const t of e){const e=new Pm;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(y){const e=y(m.text,m.sectionIndex,A);for(const t of e){const e=new Pm;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){const r=[],i=e.text;let n=0;for(const i of t)r.push(e.substring(n,i)),n=i;return n<i.length&&r.push(e.substring(n,i.length)),r}(m,A);const x=[],v={positionedLines:x,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,t,r,i,n,o,s,a,l,c,u,h){let d=0,p=0,f=0;const m="right"===a?1:"left"===a?0:.5;let g=!1;for(const e of n){const r=e.getSections();for(const e of r){if(e.imageName)continue;const r=t[e.fontStack];if(r&&(g=void 0!==r.ascender&&void 0!==r.descender,!g))break}if(!g)break}let A=0;for(const s of n){s.trim();const n=s.getMaxScale(),a=(n-1)*Gf,y={positionedGlyphs:[],lineOffset:0};e.positionedLines[A]=y;const x=y.positionedGlyphs;let v=0;if(!s.length()){p+=o,++A;continue}let b=0,w=0;for(let o=0;o<s.length();o++){const a=s.getSection(o),f=s.getSectionIndex(o),m=s.getCodePoint(o);let A=a.scale,y=null,C=null,T=null,E=Gf,M=0;const S=!(l===Sm.horizontal||!u&&!wa(m)||u&&(km[m]||(_=m,ya.Arabic(_)||ya["Arabic Supplement"](_)||ya["Arabic Extended-A"](_)||ya["Arabic Presentation Forms-A"](_)||ya["Arabic Presentation Forms-B"](_))));if(a.imageName){const t=i[a.imageName];if(!t)continue;T=a.imageName,e.iconsInText=e.iconsInText||!0,C=t.paddedRect;const r=t.displaySize;A=A*Gf/h,y={width:r[0],height:r[1],left:0,top:-Mm,advance:S?r[1]:r[0],localGlyph:!1},M=g?-y.height*A:n*Gf-17-r[1]*A,E=y.advance;const o=(S?r[0]:r[1])*A-Gf*n;o>0&&o>v&&(v=o)}else{const e=r[a.fontStack];if(!e)continue;e[m]&&(C=e[m]);const i=t[a.fontStack];if(!i)continue;const o=i.glyphs[m];if(!o)continue;if(y=o.metrics,E=8203!==m?Gf:0,g){const e=void 0!==i.ascender?Math.abs(i.ascender):0,t=void 0!==i.descender?Math.abs(i.descender):0,r=(e+t)*A;b<r&&(b=r,w=(e-t)/2*A),M=-e*A}else M=(n-A)*Gf-17}S?(e.verticalizable=!0,x.push({glyph:m,imageName:T,x:d,y:p+M,vertical:S,scale:A,localGlyph:y.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:y,rect:C}),d+=E*A+c):(x.push({glyph:m,imageName:T,x:d,y:p+M,vertical:S,scale:A,localGlyph:y.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:y,rect:C}),d+=y.advance*A+c)}0!==x.length&&(f=Math.max(d-c,f),g?Vm(x,m,v,w,o*n/2):Vm(x,m,v,0,o/2)),d=0;const C=o*n+v;y.lineOffset=Math.max(v,a),p+=C,++A}var _;const y=p,{horizontalAlign:x,verticalAlign:v}=jm(s);(function(e,t,r,i,n,o){const s=(t-r)*n,a=-o*i;for(const t of e)for(const e of t.positionedGlyphs)e.x+=s,e.y+=a})(e.positionedLines,m,x,v,f,y),e.top+=-v*y,e.bottom=e.top+y,e.left+=-x*f,e.right=e.left+f,e.hasBaseline=g}(v,t,r,i,g,s,a,l,h,c,d,f),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&v}const km={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Lm={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Om(e,t,r,i,n,o){if(t.imageName){const e=i[t.imageName];return e?e.displaySize[0]*t.scale*Gf/o+n:0}{const i=r[t.fontStack],o=i&&i.glyphs[e];return o?o.metrics.advance*t.scale+n:0}}function zm(e,t,r,i){const n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function Bm(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),40!==e&&65288!==e||(i+=50),41!==t&&65289!==t||(i+=50),i}function Rm(e,t,r,i,n,o){let s=null,a=zm(t,r,n,o);for(const e of i){const i=zm(t-e.x,r,n,o)+e.badness;i<=a&&(s=e,a=i)}return{index:e,x:t,priorBreak:s,badness:a}}function Fm(e){return e?Fm(e.priorBreak).concat(e.index):[]}function jm(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Vm(e,t,r,i,n){if(!(t||r||i||n))return;const o=e.length-1,s=e[o],a=(s.x+s.metrics.advance*s.scale)*t;for(let t=0;t<=o;t++)e[t].x-=a,e[t].y+=r+i+n}function Nm(e,t,r,i){const{horizontalAlign:n,verticalAlign:o}=jm(i),s=r[0]-e.displaySize[0]*n,a=r[1]-e.displaySize[1]*o;return{imagePrimary:e,imageSecondary:t,top:a,bottom:a+e.displaySize[1],left:s,right:s+e.displaySize[0]}}function Um(e,t,r,i,n,o){const s=e.imagePrimary;let a;if(s.content){const e=s.content,t=s.pixelRatio||1;a=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,p;"width"===r||"both"===r?(p=n[0]+l-i[3],h=n[0]+c+i[1]):(p=n[0]+(l+c-s.displaySize[0])/2,h=p+s.displaySize[0]);const f=t.top*o,m=t.bottom*o;return"height"===r||"both"===r?(u=n[1]+f-i[0],d=n[1]+m+i[2]):(u=n[1]+(f+m-s.displaySize[1])/2,d=u+s.displaySize[1]),{imagePrimary:s,imageSecondary:void 0,top:u,right:h,bottom:d,left:p,collisionPadding:a}}class Hm extends Vt{constructor(e,t,r,i,n){super(e,t),this.angle=i,this.z=r,void 0!==n&&(this.segment=n)}clone(){return new Hm(this.x,this.y,this.z,this.angle,this.segment)}}function Gm(e,t,r,i,n){if(void 0===t.segment)return!0;let o=t,s=t.segment+1,a=0;for(;a>-r/2;){if(s--,s<0)return!1;a-=e[s].dist(o),o=e[s]}a+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;a<r/2;){const t=e[s],r=e[s+1];if(!r)return!1;let o=e[s-1].angleTo(t)-t.angleTo(r);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>i;)c-=l.shift().angleDelta;if(c>n)return!1;s++,a+=t.dist(r)}return!0}function Zm(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Wm(e,t,r){return e?.6*t*r:0}function Qm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function qm(e,t,r,i,n,o){const s=Wm(r,n,o),a=Qm(r,i)*o;let l=0;const c=Zm(e)/2;for(let r=0;r<e.length-1;r++){const i=e[r],n=e[r+1],o=i.dist(n);if(l+o>c){const u=(c-l)/o,h=Ui(i.x,n.x,u),d=Ui(i.y,n.y,u),p=new Hm(h,d,0,n.angleTo(i),r);return!s||Gm(e,p,a,s,t)?p:void 0}l+=o}}function Xm(e,t,r,i,n,o,s,a,l){const c=Wm(i,o,s),u=Qm(i,n),h=u*s,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Ym(e,d?t/2*a%t:(u/2+2*o)*s*a%t,t,c,r,h,d,!1,l)}function Ym(e,t,r,i,n,o,s,a,l){const c=o/2,u=Zm(e);let h=0,d=t-r,p=[];for(let t=0;t<e.length-1;t++){const s=e[t],a=e[t+1],f=s.dist(a),m=a.angleTo(s);for(;d+r<h+f;){d+=r;const g=(d-h)/f,A=Ui(s.x,a.x,g),_=Ui(s.y,a.y,g);if(A>=0&&A<l&&_>=0&&_<l&&d-c>=0&&d+c<=u){const r=new Hm(A,_,0,m,t);i&&!Gm(e,r,o,i,n)||p.push(r)}}h+=f}return a||p.length||s||(p=Ym(e,h/2,r,i,n,o,s,!0,l)),p}function $m(e,t,r,i,n){const o=[];for(let s=0;s<e.length;s++){const a=e[s];let l;for(let e=0;e<a.length-1;e++){let s=a[e],c=a[e+1];s.x<t&&c.x<t||(s.x<t?s=new Vt(t,s.y+(t-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x<t&&(c=new Vt(t,s.y+(t-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y<r&&c.y<r||(s.y<r?s=new Vt(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round():c.y<r&&(c=new Vt(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round()),s.x>=i&&c.x>=i||(s.x>=i?s=new Vt(i,s.y+(i-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x>=i&&(c=new Vt(i,s.y+(i-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y>=n&&c.y>=n||(s.y>=n?s=new Vt(s.x+(n-s.y)/(c.y-s.y)*(c.x-s.x),n)._round():c.y>=n&&(c=new Vt(s.x+(n-s.y)/(c.y-s.y)*(c.x-s.x),n)._round()),l&&s.equals(l[l.length-1])||(l=[s],o.push(l)),l.push(c)))))}}return o}function Km(e){let t=0,r=0;for(const i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort(((e,t)=>t.h-e.h));const i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let n=0,o=0;for(const t of e)for(let e=i.length-1;e>=0;e--){const r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,o=Math.max(o,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){const t=i.pop();e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:o,fill:t/(n*o)||0}}fa(Hm,"Anchor");const Jm=1;class eg{constructor(e,{pixelRatio:t,version:r,stretchX:i,stretchY:n,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=n,this.content=o,this.version=r}get tl(){return[this.paddedRect.x+Jm,this.paddedRect.y+Jm]}get br(){return[this.paddedRect.x+this.paddedRect.w-Jm,this.paddedRect.y+this.paddedRect.h-Jm]}get displaySize(){return[(this.paddedRect.w-2*Jm)/this.pixelRatio,(this.paddedRect.h-2*Jm)/this.pixelRatio]}}class tg{constructor(e,t){const r={},i={};this.haveRenderCallbacks=[];const n=[];this.addImages(e,r,n),this.addImages(t,i,n);const{w:o,h:s}=Km(n),a=new id({width:o||1,height:s||1});for(const t in e){const i=e[t],n=r[t].paddedRect;id.copy(i.data,a,{x:0,y:0},{x:n.x+Jm,y:n.y+Jm},i.data,i.sdf)}for(const e in t){const r=t[e],n=i[e].paddedRect,o=n.x+Jm,s=n.y+Jm,l=r.data.width,c=r.data.height;id.copy(r.data,a,{x:0,y:0},{x:o,y:s},r.data),id.copy(r.data,a,{x:0,y:c-1},{x:o,y:s-1},{width:l,height:1}),id.copy(r.data,a,{x:0,y:0},{x:o,y:s+c},{width:l,height:1}),id.copy(r.data,a,{x:l-1,y:0},{x:o-1,y:s},{width:1,height:c}),id.copy(r.data,a,{x:0,y:0},{x:o+l,y:s},{width:1,height:c})}this.image=a,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(const i in e){const n=e[i],o={x:0,y:0,w:n.data.width+2*Jm,h:n.data.height+2*Jm};r.push(o),t[i]=new eg(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t,r){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t,r))),e.dispatchRenderCallbacks(this.haveRenderCallbacks,r);for(const i in e.getUpdatedImages(r))this.patchUpdatedImage(this.iconPositions[i],e.getImage(i,r),t),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i,r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[i,n]=e.tl,o=!!Object.keys(this.patternPositions).length;r.update(t.data,{useMipmap:o},{x:i,y:n})}}fa(eg,"ImagePosition"),fa(tg,"ImageAtlas");const rg=1e20;function ig(e,t,r,i,n,o,s,a,l){for(let c=t;c<t+i;c++)ng(e,r*o+c,o,n,s,a,l);for(let c=r;c<r+n;c++)ng(e,c*o+t,1,i,s,a,l)}function ng(e,t,r,i,n,o,s){o[0]=0,s[0]=-rg,s[1]=rg,n[0]=e[t];for(let a=1,l=0,c=0;a<i;a++){n[a]=e[t+a*r];const i=a*a;do{const e=o[l];c=(n[a]-n[e]+i-e*e)/(a-e)/2}while(c<=s[l]&&--l>-1);l++,o[l]=a,s[l]=c,s[l+1]=rg}for(let a=0,l=0;a<i;a++){for(;s[l+1]<a;)l++;const i=o[l],c=a-i;e[t+a*r]=n[i]+c*c}}const og=2,sg={none:0,ideographs:1,all:2};class ag{constructor(e,t,r){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=r,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e,t){this.urls[t]=e}getGlyphs(e,t,r){const n=[],o=this.urls[t]||i.GLYPHS_URL;for(const t in e)for(const r of e[t])n.push({stack:t,id:r});Kt(n,(({stack:e,id:t},r)=>{let i=this.entries[e];i||(i=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let n=i.glyphs[t];if(void 0!==n)return void r(null,{stack:e,id:t,glyph:n});if(n=this._tinySDF(i,e,t),n)return i.glyphs[t]=n,void r(null,{stack:e,id:t,glyph:n});const s=Math.floor(t/256);if(256*s>65535)return void r(new Error("glyphs > 65535 not supported"));if(i.ranges[s])return void r(null,{stack:e,id:t,glyph:n});let a=i.requests[s];a||(a=i.requests[s]=[],ag.loadGlyphRange(e,s,o,this.requestManager,((e,t)=>{if(t){i.ascender=t.ascender,i.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(i.glyphs[+e]=t.glyphs[+e]);i.ranges[s]=!0}for(const r of a)r(e,t);delete i.requests[s]}))),a.push(((i,n)=>{i?r(i):n&&r(null,{stack:e,id:t,glyph:n.glyphs[t]||null})}))}),((e,t)=>{if(e)r(e);else if(t){const e={};for(const{stack:r,id:i,glyph:n}of t)void 0===e[r]&&(e[r]={}),void 0===e[r].glyphs&&(e[r].glyphs={}),e[r].glyphs[i]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics},e[r].ascender=this.entries[r].ascender,e[r].descender=this.entries[r].descender;r(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==sg.none&&(this.localGlyphMode===sg.all?!!this.localFontFamily:!!this.localFontFamily&&(ya["CJK Unified Ideographs"](e)||ya["Hangul Syllables"](e)||ya.Hiragana(e)||ya.Katakana(e)||ya["CJK Symbols and Punctuation"](e)||ya["CJK Unified Ideographs Extension A"](e)||ya["CJK Unified Ideographs Extension B"](e)))}_tinySDF(e,t,r){const i=this.localFontFamily;if(!i||!this._doesCharSupportLocalGlyph(r))return;let n=e.tinySDF;if(!n){let r="400";/bold/i.test(t)?r="900":/medium/i.test(t)?r="500":/light/i.test(t)&&(r="200"),n=e.tinySDF=new ag.TinySDF({fontFamily:i,fontWeight:r,fontSize:24*og,buffer:3*og,radius:8*og}),n.fontWeight=r}if(this.localGlyphs[n.fontWeight][r])return this.localGlyphs[n.fontWeight][r];const o=String.fromCodePoint(r),{data:s,width:a,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:p}=n.draw(o);return this.localGlyphs[n.fontWeight][r]={id:r,bitmap:new rd({width:a,height:l},s),metrics:{width:c/og,height:u/og,left:h/og,top:d/og-27,advance:p/og,localGlyph:!0}}}}ag.loadGlyphRange=function(e,t,r,i,n){const o=256*t,s=o+255,a=i.transformRequest(i.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",`${o}-${s}`),Xr.Glyphs);Jr(a,((e,t)=>{if(e)n(e);else if(t){const e={},r=function(e){return new bm(e).readFields(Cm,{})}(t);for(const t of r.glyphs)e[t.id]=t;n(null,{glyphs:e,ascender:r.ascender,descender:r.descender})}}))},ag.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:i=.25,fontFamily:n="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=t,this.cutoff=i,this.radius=r;const a=this.size=e+4*t,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${e}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:i,actualBoundingBoxLeft:n,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(r),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-n))),l=Math.min(this.size-this.buffer,s+Math.ceil(i)),c=a+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:u,glyphWidth:a,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===a||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:A}=this;f.clearRect(m,m,a,l),f.fillText(e,m,m+s);const _=f.getImageData(m,m,a,l);A.fill(rg,0,h),g.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<a;t++){const r=_.data[4*(e*a+t)+3]/255;if(0===r)continue;const i=(e+m)*c+t+m;if(1===r)A[i]=0,g[i]=rg;else{const e=.5-r;A[i]=e>0?e*e:0,g[i]=e<0?e*e:0}}ig(A,0,0,c,u,c,this.f,this.v,this.z),ig(g,m,m,a,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){const t=Math.sqrt(A[e])-Math.sqrt(g[e]);d[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};const lg=Jm;function cg(e,t,r,i){const n=[],o=e.imagePrimary,s=o.pixelRatio,a=o.paddedRect.w-2*lg,l=o.paddedRect.h-2*lg,c=e.right-e.left,u=e.bottom-e.top,h=o.stretchX||[[0,a]],d=o.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],f=h.reduce(p,0),m=d.reduce(p,0),g=a-f,A=l-m;let _=0,y=f,x=0,v=m,b=0,w=g,C=0,T=A;if(o.content&&i){const e=o.content;_=ug(h,0,e[0]),x=ug(d,0,e[1]),y=ug(h,e[0],e[2]),v=ug(d,e[1],e[3]),b=e[0]-_,C=e[1]-x,w=e[2]-e[0]-y,T=e[3]-e[1]-v}const E=(i,n,a,l)=>{const h=dg(i.stretch-_,y,c,e.left),d=pg(i.fixed-b,w,i.stretch,f),p=dg(n.stretch-x,v,u,e.top),g=pg(n.fixed-C,T,n.stretch,m),A=dg(a.stretch-_,y,c,e.left),E=pg(a.fixed-b,w,a.stretch,f),M=dg(l.stretch-x,v,u,e.top),S=pg(l.fixed-C,T,l.stretch,m),I=new Vt(h,p),P=new Vt(A,p),D=new Vt(A,M),k=new Vt(h,M),L=new Vt(d/s,g/s),O=new Vt(E/s,S/s),z=t*Math.PI/180;if(z){const e=Math.sin(z),t=Math.cos(z),r=[t,-e,e,t];I._matMult(r),P._matMult(r),k._matMult(r),D._matMult(r)}const B=i.stretch+i.fixed,R=a.stretch+a.fixed,F=n.stretch+n.fixed,j=l.stretch+l.fixed,V=e.imageSecondary;return{tl:I,tr:P,bl:k,br:D,texPrimary:{x:o.paddedRect.x+lg+B,y:o.paddedRect.y+lg+F,w:R-B,h:j-F},texSecondary:V?{x:V.paddedRect.x+lg+B,y:V.paddedRect.y+lg+F,w:R-B,h:j-F}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:O,minFontScaleX:w/s/c,minFontScaleY:T/s/u,isSDF:r}};if(i&&(o.stretchX||o.stretchY)){const e=hg(h,g,f),t=hg(d,A,m);for(let r=0;r<e.length-1;r++){const i=e[r],o=e[r+1];for(let e=0;e<t.length-1;e++)n.push(E(i,t[e],o,t[e+1]))}}else n.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:a+1},{fixed:0,stretch:l+1}));return n}function ug(e,t,r){let i=0;for(const n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function hg(e,t,r){const i=[{fixed:-lg,stretch:0}];for(const[t,r]of e){const e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+lg,stretch:r}),i}function dg(e,t,r,i){return e/t*r+i}function pg(e,t,r,i){return e-t*r/i}function fg(e,t,r,i){const n=t+e.positionedLines[i].lineOffset;return 0===i?r+n/2:r+(n+(t+e.positionedLines[i-1].lineOffset))/2}function mg(e,t=1,r=!1){let i=1/0,n=1/0,o=-1/0,s=-1/0;const a=e[0];for(let e=0;e<a.length;e++){const t=a[e];(!e||t.x<i)&&(i=t.x),(!e||t.y<n)&&(n=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}const l=Math.min(o-i,s-n);let c=l/2;const u=new io([],gg);if(0===l)return new Vt(i,n);for(let t=i;t<o;t+=l)for(let r=n;r<s;r+=l)u.push(new Ag(t+c,r+c,c,e));let h=function(e){let t=0,r=0,i=0;const n=e[0];for(let e=0,o=n.length,s=o-1;e<o;s=e++){const o=n[e],a=n[s],l=o.x*a.y-a.x*o.y;r+=(o.x+a.x)*l,i+=(o.y+a.y)*l,t+=3*l}return new Ag(r/t,i/t,0,e)}(e),d=u.length;for(;u.length;){const i=u.pop();(i.d>h.d||!h.d)&&(h=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,d)),i.max-h.d<=t||(c=i.h/2,u.push(new Ag(i.p.x-c,i.p.y-c,c,e)),u.push(new Ag(i.p.x+c,i.p.y-c,c,e)),u.push(new Ag(i.p.x-c,i.p.y+c,c,e)),u.push(new Ag(i.p.x+c,i.p.y+c,c,e)),d+=4)}return r&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function gg(e,t){return t.max-e.max}class Ag{constructor(e,t,r,i){this.p=new Vt(e,t),this.h=r,this.d=function(e,t){let r=!1,i=1/0;for(let n=0;n<t.length;n++){const o=t[n];for(let t=0,n=o.length,s=n-1;t<n;s=t++){const n=o[t],a=o[s];n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r),i=Math.min(i,Xu(e,n,a))}}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}}const _g=Number.POSITIVE_INFINITY,yg=Math.sqrt(2);function xg(e,[t,r]){let i=0,n=0;if(r===_g){t<0&&(t=0);const r=t/yg;switch(e){case"top-right":case"top-left":n=r-7;break;case"bottom-right":case"bottom-left":n=7-r;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":i=-r;break;case"top-left":case"bottom-left":i=r;break;case"left":i=t;break;case"right":i=-t}}else{switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}}return[i,n]}function vg(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bg(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f){let m=o.textMaxSize.evaluate(t,{},h);void 0===m&&(m=s);const g=e.layers[0].layout,A=g.get("icon-offset").evaluate(t,{},h),_=Eg(r.horizontal)||r.vertical,y="globe"===d.name,x=Gf,v=s/x,b=e.tilePixelRatio*m/x,w=(D=e.overscaling,e.zoom>18&&D>2&&(D>>=1),Math.max(no/(512*D),1)*g.get("symbol-spacing")),C=g.get("text-padding")*e.tilePixelRatio,T=g.get("icon-padding")*e.tilePixelRatio,E=Ht(g.get("text-max-angle")),M="map"===g.get("text-rotation-alignment")&&"point"!==g.get("symbol-placement"),S="map"===g.get("icon-rotation-alignment")&&"point"!==g.get("symbol-placement"),I=g.get("symbol-placement"),P=w/2;var D;const k=g.get("icon-text-fit").evaluate(t,{},h),L=g.get("icon-text-fit-padding").evaluate(t,{},h),O="none"!==k;let z;!1===e.hasAnyIconTextFit&&O&&(e.hasAnyIconTextFit=!0),i&&O&&(e.allowVerticalPlacement&&r.vertical&&(z=Um(i,r.vertical,k,L,A,v)),_&&(i=Um(i,_,k,L,A,v)));const B=(s,a,m)=>{if(a.x<0||a.x>=no||a.y<0||a.y>=no)return;let g=null;if(y){const{x:e,y:t,z:r}=d.projectTilePoint(a.x,a.y,m);g={anchor:new Hm(e,t,r,0,void 0),up:d.upVector(m,a.x,a.y)}}!function(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A,_,y,x,v,b,w,C,T,E){const M=e.addToLineVertexArray(t,i);let S,I,P,D,k,L,O,z=0,B=0,R=0,F=0,j=-1,V=-1;const N={};let U=Pi("");const H=r?r.anchor:t,G="none"!==l.layout.get("icon-text-fit").evaluate(x,{},C);let Z=0,W=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[Z,W]=l.layout.get("text-offset").evaluate(x,{},C).map((e=>e*Gf)):(Z=l.layout.get("text-radial-offset").evaluate(x,{},C)*Gf,W=_g),e.allowVerticalPlacement&&n.vertical){const e=n.vertical;if(f)L=Sg(e),a&&(O=Sg(a));else{const r=l.layout.get("text-rotate").evaluate(x,{},C)+90;P=Mg(c,H,t,u,h,d,e,p,r,m),a&&(D=Mg(c,H,t,u,h,d,a,A,r))}}if(o){const i=l.layout.get("icon-rotate").evaluate(x,{},C),n=cg(o,i,b,G),s=a?cg(a,i,b,G):void 0;I=Mg(c,H,t,u,h,d,o,A,i),z=4*n.length;const p=e.iconSizeData;let f=null;"source"===p.kind?(f=[Zf*l.layout.get("icon-size").evaluate(x,{},C)],f[0]>Cg&&hr(`${e.layerIds[0]}: Value for "icon-size" is >= ${wg}. Reduce your "icon-size".`)):"composite"===p.kind&&(f=[Zf*v.compositeIconSizes[0].evaluate(x,{},C),Zf*v.compositeIconSizes[1].evaluate(x,{},C)],(f[0]>Cg||f[1]>Cg)&&hr(`${e.layerIds[0]}: Value for "icon-size" is >= ${wg}. Reduce your "icon-size".`)),e.addSymbols(e.icon,n,f,y,_,x,!1,r,t,M.lineStartIndex,M.lineLength,-1,w,C,T,E),j=e.icon.placedSymbolArray.length-1,s&&(B=4*s.length,e.addSymbols(e.icon,s,f,y,_,x,Sm.vertical,r,t,M.lineStartIndex,M.lineLength,-1,w,C,T,E),V=e.icon.placedSymbolArray.length-1)}for(const i in n.horizontal){const o=n.horizontal[i];S||(U=Pi(o.text),f?k=Sg(o):S=Mg(c,H,t,u,h,d,o,p,l.layout.get("text-rotate").evaluate(x,{},C),m));const a=1===o.positionedLines.length;if(R+=Tg(e,r,t,o,s,l,f,x,m,M,n.vertical?Sm.horizontal:Sm.horizontalOnly,a?Object.keys(n.horizontal):[i],N,j,v,w,C,T),a)break}n.vertical&&(F+=Tg(e,r,t,n.vertical,s,l,f,x,m,M,Sm.vertical,["vertical"],N,V,v,w,C,T));let Q=-1;const q=(e,t)=>e?Math.max(e,t):t;Q=q(k,Q),Q=q(L,Q),Q=q(O,Q);const X=Q>-1?1:0;e.glyphOffsetArray.length>=65535&&hr("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,H.x,H.y,H.z,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical>=0?N.vertical:-1,j,V,U,void 0!==S?S:e.collisionBoxArray.length,void 0!==S?S+1:e.collisionBoxArray.length,void 0!==P?P:e.collisionBoxArray.length,void 0!==P?P+1:e.collisionBoxArray.length,void 0!==I?I:e.collisionBoxArray.length,void 0!==I?I+1:e.collisionBoxArray.length,D||e.collisionBoxArray.length,D?D+1:e.collisionBoxArray.length,u,R,F,z,B,X,0,Z,W,Q,0,G?1:0)}(e,a,g,s,r,i,n,z,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,C,M,l,0,T,S,A,t,o,c,u,h,p,f)};if("line"===I)for(const n of $m(t.geometry,0,0,no,no)){const t=Xm(n,w,E,r.vertical||_,i,x,b,e.overscaling,no);for(const r of t)_&&Ig(e,_.text,P,r)||B(n,r,h)}else if("line-center"===I){for(const e of t.geometry)if(e.length>1){const t=qm(e,E,r.vertical||_,i,x,b);t&&B(e,t,h)}}else if("Polygon"===t.type)for(const e of Vd(t.geometry,0)){const t=mg(e,16);B(e[0],new Hm(t.x,t.y,0,0,void 0),h)}else if("LineString"===t.type)for(const e of t.geometry)B(e,new Hm(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)B([t],new Hm(t.x,t.y,0,0,void 0),h)}const wg=255,Cg=wg*Zf;function Tg(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m,g,A){const _=function(e,t,r,i,n,o,s,a){const l=[];if(0===t.positionedLines.length)return l;const c=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],r=e[1],i=t*r;return i>0?[t,-r]:i<0?[-t,r]:0===t?[r,t]:[r,-t]}(r);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const d=t.positionedLines.length,p=h/d;let f=t.top-r[1];for(let e=0;e<d;++e){const i=t.positionedLines[e];f=fg(t,p,f,e);for(const e of i.positionedGlyphs){if(!e.rect)continue;const i=e.rect||{};let o=Mm+1,h=!0,d=1,p=0;if(e.imageName){const t=s[e.imageName];if(!t)continue;if(t.sdf){hr("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,d=t.pixelRatio,o=Jm/d}const m=(n||a)&&e.vertical,g=e.metrics.advance*e.scale/2,A=e.metrics,_=e.rect;if(null===_)continue;a&&t.verticalizable&&(p=e.imageName?g-e.metrics.width*e.scale/2:0);const y=n?[e.x+g,e.y]:[0,0];let x=[0,0],v=[0,0],b=!1;n||(m?(v=[e.x+g+u[0],e.y+u[1]-p],b=!0):x=[e.x+g+r[0],e.y+r[1]-p]);const w=_.w*e.scale/(d*(e.localGlyph?og:1)),C=_.h*e.scale/(d*(e.localGlyph?og:1));let T,E,M,S;if(m){const t=e.y-f,r=new Vt(-g,g-t),i=-Math.PI/2,n=new Vt(...v);T=new Vt(-g+x[0],x[1]),T._rotateAround(i,r)._add(n),T.x+=-t+g,T.y-=(A.left-o)*e.scale;const s=e.imageName?A.advance*e.scale:Gf*e.scale,a=String.fromCodePoint(e.glyph);Kf(a)?T.x+=(1-o)*e.scale:Jf(a)?T.x+=s-A.height*e.scale+(-o-1)*e.scale:T.x+=e.imageName||A.width+2*o===_.w&&A.height+2*o===_.h?(s-C)/2:(s-(A.height+2*o)*e.scale)/2,E=new Vt(T.x,T.y-w),M=new Vt(T.x+C,T.y),S=new Vt(T.x+C,T.y-w)}else{const t=(A.left-o)*e.scale-g+x[0],r=(-A.top-o)*e.scale+x[1],i=t+w,n=r+C;T=new Vt(t,r),E=new Vt(i,r),M=new Vt(t,n),S=new Vt(i,n)}if(c){let e;e=n?new Vt(0,0):b?new Vt(u[0],u[1]):new Vt(r[0],r[1]),T._rotateAround(c,e),E._rotateAround(c,e),M._rotateAround(c,e),S._rotateAround(c,e)}const I=new Vt(0,0),P=new Vt(0,0);l.push({tl:T,tr:E,bl:M,br:S,texPrimary:i,texSecondary:void 0,writingMode:t.writingMode,glyphOffset:y,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:I,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return l}(0,i,l,o,s,a,n,e.allowVerticalPlacement),y=e.textSizeData;let x=null;"source"===y.kind?(x=[Zf*o.layout.get("text-size").evaluate(a,{},g)],x[0]>Cg&&hr(`${e.layerIds[0]}: Value for "text-size" is >= ${wg}. Reduce your "text-size".`)):"composite"===y.kind&&(x=[Zf*f.compositeTextSizes[0].evaluate(a,{},g),Zf*f.compositeTextSizes[1].evaluate(a,{},g)],(x[0]>Cg||x[1]>Cg)&&hr(`${e.layerIds[0]}: Value for "text-size" is >= ${wg}. Reduce your "text-size".`)),e.addSymbols(e.text,_,x,l,s,a,u,t,r,c.lineStartIndex,c.lineLength,p,m,g,A,!1);for(const t of h)d[t]=e.text.placedSymbolArray.length-1;return 4*_.length}function Eg(e){for(const t in e)return e[t];return null}function Mg(e,t,r,i,n,o,s,a,l,c){let u=s.top,h=s.bottom,d=s.left,p=s.right;const f=s.collisionPadding;if(f&&(d-=f[0],u-=f[1],p+=f[2],h+=f[3]),l){const e=new Vt(d,u),t=new Vt(p,u),r=new Vt(d,h),i=new Vt(p,h),n=Ht(l);let o=new Vt(0,0);c&&(o=new Vt(c[0],c[1])),e._rotateAround(n,o),t._rotateAround(n,o),r._rotateAround(n,o),i._rotateAround(n,o),d=Math.min(e.x,t.x,r.x,i.x),p=Math.max(e.x,t.x,r.x,i.x),u=Math.min(e.y,t.y,r.y,i.y),h=Math.max(e.y,t.y,r.y,i.y)}return e.emplaceBack(t.x,t.y,t.z,r.x,r.y,d,u,p,h,a,i,n,o),e.length-1}function Sg(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Ig(e,t,r,i){const n=e.compareText;if(t in n){const e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}function Pg(e,t){const r=e.fovAboveCenter,i=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,n=(e._camera.position[2]*e.worldSize-i)/Math.cos(e._pitch),o=Math.sin(r)*n/Math.sin(Math.max(Math.PI/2-e._pitch-r,.01)),s=Math.sin(e._pitch)*o+n;return Math.min(1.01*s,n*(1/e._horizonShift))}function Dg(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const r=Math.pow(2,-e.z),i=e.x*r,n=(e.x+1)*r,o=e.y*r,s=(e.y+1)*r,a=vu(i),l=vu(n),c=bu(o),u=bu(s),h=t.project(a,c),d=t.project(l,c),p=t.project(l,u),f=t.project(a,u);let m=Math.min(h.x,d.x,p.x,f.x),g=Math.min(h.y,d.y,p.y,f.y),A=Math.max(h.x,d.x,p.x,f.x),_=Math.max(h.y,d.y,p.y,f.y);const y=r/16;function x(e,r,i,n,o,s){const a=(i+o)/2,l=(n+s)/2,c=t.project(vu(a),bu(l)),u=Math.max(0,m-c.x,g-c.y,c.x-A,c.y-_);m=Math.min(m,c.x),A=Math.max(A,c.x),g=Math.min(g,c.y),_=Math.max(_,c.y),u>y&&(x(e,c,i,n,a,l),x(c,r,a,l,o,s))}x(h,d,i,o,n,o),x(d,p,n,o,n,s),x(p,f,n,s,i,s),x(f,h,i,s,i,o),m-=y,g-=y,A+=y,_+=y;const v=1/Math.max(A-m,_-g);return{scale:v,x:m*v,y:g*v,x2:A*v,y2:_*v,projection:t}}function kg(e,{x:t,y:r},i=0){return new Vt(((t-i)*e.scale-e.x)*no,(r*e.scale-e.y)*no)}const Lg=e.a9.identity(new Float32Array(16));class Og{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new su(0,0)}projectTilePoint(e,t,r){return{x:e,y:t,z:0}}locationPoint(e,t,r=!0){return e._coordinatePoint(e.locationCoordinate(t),r)}pixelsPerMeter(e,t){return xu(1,e)*t}pixelSpaceConversion(e,t,r){return 1}farthestPixelDistance(e){return Pg(e,e.pixelsPerMeter)}pointCoordinate(e,t,r,i){const n=e.horizonLineFromTop(!1),o=new Vt(t,Math.max(n,r));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,i))}pointCoordinate3D(e,t,r){const i=new Vt(t,r);if(e.elevation)return e.elevation.pointCoordinate(i);{const t=this.pointCoordinate(e,i.x,i.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);const r=e.horizonLineFromTop();return t.y<r}createInversionMatrix(e,t){return Lg}createTileMatrix(t,r,i){let n,o,s;const a=i.canonical,l=e.a9.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const c=Dg(a,this);n=1,o=c.x+i.wrap*c.scale,s=c.y,e.a9.scale(l,l,[n/c.scale,n/c.scale,t.pixelsPerMeter/r])}else n=r/t.zoomScale(a.z),o=(a.x+Math.pow(2,a.z)*i.wrap)*n,s=a.y*n;return e.a9.translate(l,l,[o,s,0]),e.a9.scale(l,l,[n/no,n/no,1]),l}upVector(e,t,r){return[0,0,1]}upVectorScale(e,t,r){return{metersToTile:1}}}class zg extends Og{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,r]=this.parallels=e.parallels||[29.5,45.5],i=Math.sin(Ht(t));this.n=(i+Math.sin(Ht(r)))/2,this.c=1+i*(2*this.n-i),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:r,c:i,r0:n}=this,o=Ht(e-this.center[0]),s=Ht(t),a=Math.sqrt(i-2*r*Math.sin(s))/r;return{x:a*Math.sin(o*r),y:a*Math.cos(o*r)-n,z:0}}unproject(e,t){const{n:r,c:i,r0:n}=this,o=n+t;let s=Math.atan2(e,Math.abs(o))*Math.sign(o);o*r<0&&(s-=Math.PI*Math.sign(e)*Math.sign(o));const a=Ht(this.center[0])*r;s=$t(s,-Math.PI-a,Math.PI-a);const l=Xt(Gt(s/r)+this.center[0],-180,180),c=Math.asin(Xt((i-(e*e+o*o)*r*r)/(2*r),-1,1)),u=Xt(Gt(c),-Cu,Cu);return new su(l,u)}}const Bg=1.340264,Rg=-.081106,Fg=893e-6,jg=.003796,Vg=Math.sqrt(3)/2;class Ng extends Og{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const r=Math.asin(Vg*Math.sin(t)),i=r*r,n=i*i*i;return{x:.5*(e*Math.cos(r)/(Vg*(Bg+3*Rg*i+n*(7*Fg+9*jg*i)))/Math.PI+.5),y:1-.5*(r*(Bg+Rg*i+n*(Fg+jg*i))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,i=r*r,n=i*i*i;for(let e,o,s,a=0;a<12&&(o=r*(Bg+Rg*i+n*(Fg+jg*i))-t,s=Bg+3*Rg*i+n*(7*Fg+9*jg*i),e=o/s,r=Xt(r-e,-Math.PI/3,Math.PI/3),i=r*r,n=i*i*i,!(Math.abs(e)<1e-12));++a);const o=Vg*e*(Bg+3*Rg*i+n*(7*Fg+9*jg*i))/Math.cos(r),s=Math.asin(Math.sin(r)/Vg),a=Xt(180*o/Math.PI,-180,180),l=Xt(180*s/Math.PI,-Cu,Cu);return new su(a,l)}}class Ug extends Og{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const r=360*(e-.5),i=Xt(360*(.5-t),-Cu,Cu);return new su(r,i)}}const Hg=Math.PI/2;function Gg(e){return Math.tan((Hg+e)/2)}class Zg extends Og{constructor(e){super(e),this.center=e.center||[0,30];const[t,r]=this.parallels=e.parallels||[30,30];let i=Ht(t),n=Ht(r);this.southernCenter=i+n<0,this.southernCenter&&(i=-i,n=-n);const o=Math.cos(i),s=Gg(i);this.n=i===n?Math.sin(i):Math.log(o/Math.cos(n))/Math.log(Gg(n)/s),this.f=o*Math.pow(Gg(i),this.n)/this.n}project(e,t){t=Ht(t),this.southernCenter&&(t=-t),e=Ht(e-this.center[0]);const r=1e-6,{n:i,f:n}=this;n>0?t<-Hg+r&&(t=-Hg+r):t>Hg-r&&(t=Hg-r);const o=n/Math.pow(Gg(t),i);let s=o*Math.sin(i*e),a=n-o*Math.cos(i*e);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:r,f:i}=this,n=i-t,o=Math.sign(n),s=Math.sign(r)*Math.sqrt(e*e+n*n);let a=Math.atan2(e,Math.abs(n))*o;n*r<0&&(a-=Math.PI*Math.sign(e)*o);const l=Xt(Gt(a/r)+this.center[0],-180,180),c=Xt(Gt(2*Math.atan(Math.pow(i/s,1/r))-Hg),-Cu,Cu);return new su(l,this.southernCenter?-c:c)}}class Wg extends Og{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:_u(e),y:yu(t),z:0}}unproject(e,t){const r=vu(e),i=bu(t);return new su(r,i)}}const Qg=Ht(Cu);class qg extends Og{project(e,t){const r=(t=Ht(t))*t,i=r*r;return{x:.5*((e=Ht(e))*(.8707-.131979*r+i*(i*(.003971*r-.001529*i)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+r*(.015085+i*(.028874*r-.044475-.005916*i)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let r=t=(2*(1-t)-1)*Math.PI,i=25,n=0,o=r*r;do{o=r*r;const e=o*o;n=(r*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),r=Xt(r-n,-Qg,Qg)}while(Math.abs(n)>1e-6&&--i>0);o=r*r;const s=Xt(Gt(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=Gt(r);return new su(s,a)}}const Xg=Ht(Cu);class Yg extends Og{project(e,t){t=Ht(t),e=Ht(e);const r=Math.cos(t),i=2/Math.PI,n=Math.acos(r*Math.cos(e/2)),o=Math.sin(n)/n,s=.5*(e*i+2*r*Math.sin(e/2)/o)||0,a=.5*(t+Math.sin(t)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let r=e=(2*e-.5)*Math.PI,i=t=(2*(1-t)-1)*Math.PI,n=25;const o=1e-6;let s=0,a=0;do{const n=Math.cos(i),o=Math.sin(i),l=2*o*n,c=o*o,u=n*n,h=Math.cos(r/2),d=Math.sin(r/2),p=2*h*d,f=d*d,m=1-u*h*h,g=m?1/m:0,A=m?Math.acos(n*h)*Math.sqrt(1/m):0,_=.5*(2*A*n*d+2*r/Math.PI)-e,y=.5*(A*o+i)-t,x=.5*g*(u*f+A*n*h*c)+1/Math.PI,v=g*(p*l/4-A*o*d),b=.125*g*(l*d-A*o*u*p),w=.5*g*(c*h+A*f*n)+.5,C=v*b-w*x;s=(y*v-_*w)/C,a=(_*b-y*x)/C,r=Xt(r-s,-Math.PI,Math.PI),i=Xt(i-a,-Xg,Xg)}while((Math.abs(s)>o||Math.abs(a)>o)&&--n>0);return new su(Gt(r),Gt(i))}}class $g extends Og{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Ht(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:r,cosPhi:i}=this;return{x:Ht(e)*i*r+.5,y:-Math.sin(Ht(t))/i*r+.5,z:0}}unproject(e,t){const{scale:r,cosPhi:i}=this,n=-(t-.5)/r,o=Xt(Gt((e-.5)/r)/i,-180,180),s=Math.asin(Xt(n*i,-1,1)),a=Xt(Gt(s),-Cu,Cu);return new su(o,a)}}class Kg extends Wg{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,r,i){const n=Dh(t,r,i),o=Oh(Th(i));return e.Q.transformMat4(n,n,o),{x:n[0],y:n[1],z:n[2]}}locationPoint(t,r){const i=iu(r.lat,r.lng),n=e.Q.normalize([],i),o=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(r),t._centerAltitude):t._centerAltitude,s=xu(1,0)*no*o;e.Q.scaleAndAdd(i,i,n,s);const a=e.a9.identity(new Float64Array(16));return e.a9.multiply(a,t.pixelMatrix,t.globeMatrix),e.Q.transformMat4(i,i,a),new Vt(i[0],i[1])}pixelsPerMeter(e,t){return xu(1,0)*t}pixelSpaceConversion(e,t,r){const i=xu(1,e)*t,n=Ui(xu(1,45)*t,i,r);return this.pixelsPerMeter(e,t)/n}createTileMatrix(t,r,i){const n=zh(Th(i.canonical));return e.a9.multiply(new Float64Array(16),t.globeMatrix,n)}createInversionMatrix(t,r){const{center:i}=t,n=Oh(Th(r));return e.a9.rotateY(n,n,Ht(i.lng)),e.a9.rotateX(n,n,Ht(i.lat)),e.a9.scale(n,n,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,r,i){return bh(e,t,r,!0)||new Iu(0,0)}pointCoordinate3D(e,t,r){const i=this.pointCoordinate(e,t,r,0);return[i.x,i.y,i.z]}isPointAboveHorizon(e,t){return!bh(e,t.x,t.y,!1)}farthestPixelDistance(t){const r=function(t,r){const i=t.cameraToCenterDistance,n=t._centerAltitude*r,o=t._camera,s=t._camera.forward(),a=e.Q.add([],e.Q.scale([],s,-i),[0,0,n]),l=t.worldSize/(2*Math.PI),c=[0,0,-l],u=t.width/t.height,h=Math.tan(t.fovAboveCenter),d=e.Q.scale([],o.up(),h),p=e.Q.scale([],o.right(),h*u),f=e.Q.normalize([],e.Q.add([],e.Q.add([],s,d),p)),m=[];let g;if(new lh(a,f).closestPointOnSphere(c,l,m)){const r=e.Q.add([],m,c),i=e.Q.sub([],r,a);g=Math.cos(t.fovAboveCenter)*e.Q.length(i)}else{const t=e.Q.sub([],a,c),r=e.Q.sub([],c,a);e.Q.normalize(r,r);const i=e.Q.length(t)-l;g=Math.sqrt(i*(i+2*l));const n=Math.acos(g/(l+i))-Math.acos(e.Q.dot(s,r));g*=Math.cos(n)}return 1.01*g}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),i=jh(t.zoom);if(i>0){const e=Pg(t,xu(1,t.center.lat)*t.worldSize),n=t.worldSize/(2*Math.PI),o=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Ui(r,e+n*(1-Math.cos(o)),Math.pow(i,10))}return r}upVector(e,t,r){return Dh(t,r,e,1)}upVectorScale(e){return{metersToTile:xh(kh(Th(e)))}}}function Jg(e){const t=e.parallels,r=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new Wg(e);case"equirectangular":return new Ug(e);case"naturalEarth":return new qg(e);case"equalEarth":return new Ng(e);case"winkelTripel":return new Yg(e);case"albers":return r?new $g(e):new zg(e);case"lambertConformalConic":return r?new $g(e):new Zg(e);case"globe":return new Kg(e)}throw new Error(`Invalid projection name: ${e.name}`)}const eA=dp.types,tA=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function rA(e,t,r,i,n,o,s,a,l,c,u,h,d){const p=a?Math.min(Cg,Math.round(a[0])):0,f=a?Math.min(Cg,Math.round(a[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),o,s,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function iA(e,t,r){e.emplaceBack(t,r)}function nA(e,t,r,i,n,o,s){e.emplaceBack(t,r,i,n,o,s)}function oA(e,t,r,i,n){e.emplaceBack(t,r,i,n),e.emplaceBack(t,r,i,n),e.emplaceBack(t,r,i,n),e.emplaceBack(t,r,i,n)}function sA(e){for(const t of e.sections)if(Ma(t.text))return!0;return!1}class aA{constructor(e){this.layoutVertexArray=new zl,this.indexArray=new Hl,this.programConfigurations=e,this.segments=new mc,this.dynamicLayoutVertexArray=new Pl,this.opacityVertexArray=new Rl,this.placedSymbolArray=new oc,this.iconTransitioningVertexArray=new Fl,this.globeExtVertexArray=new Bl,this.zOffsetVertexArray=new Wl}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,t,r,i,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Rf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,tA,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,jf.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Bf.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||n)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Ff.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}fa(aA,"SymbolBuffers");class lA{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new mc,this.collisionVertexArray=new Ul,this.collisionVertexArrayExt=new Pl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Vf.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Nf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}fa(lA,"CollisionBuffers");class cA{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=e.a9.identity([]),this.placementViewportMatrix=e.a9.identity([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Wf(this.zoom,r["text-size"]),this.iconSizeData=Wf(this.zoom,r["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),o=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map((e=>Sm[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID,this.projection=t.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=i.get("symbol-z-elevate")}createArrays(){this.text=new aA(new Uc(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new aA(new Uc(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new lc,this.lineVertexArray=new cc,this.symbolInstances=new ac}calculateGlyphDependencies(e,t,r,i,n){for(let r=0;r<e.length;r++){const o=e.codePointAt(r);if(void 0===o)break;if(t[o]=!0,i&&n&&o<=65535){const i=$f[e.charAt(r)];i&&(t[i.charCodeAt(0)]=!0)}}}populate(t,r,i,n){const o=this.layers[0],s=o.layout,a="globe"===this.projection.name,l=s.get("text-font"),c=s.get("text-field"),u=s.get("icon-image"),h=("constant"!==c.value.kind||c.value.value instanceof pn&&!c.value.value.isEmpty()||c.value.value.toString().length>0)&&("constant"!==l.value.kind||l.value.value.length>0),d="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,p=s.get("symbol-sort-key");if(this.features=[],!h&&!d)return;const f=r.iconDependencies,m=r.glyphDependencies,g=r.availableImages,A=new Va(this.zoom);for(const{feature:r,id:c,index:u,sourceLayerIndex:_}of t){const t=o._featureFilter.needGeometry,y=Fu(r,t);if(!o._featureFilter.filter(A,y,i))continue;if(t||(y.geometry=Ru(r,i,n)),a&&1!==r.type&&i.z<=5){const t=y.geometry,r=.98078528056,n=(t,n)=>{const o=Dh(t.x,t.y,i,1),s=Dh(n.x,n.y,i,1);return e.Q.dot(o,s)<r};for(let e=0;e<t.length;e++)t[e]=Lu(t[e],n)}let x,v;if(h){const e=o.getValueAndResolveTokens("text-field",y,i,g),t=pn.factory(e);sA(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ra()||this.hasRTLText&&ja.isParsed())&&(x=Yf(t,o,y))}if(d){const e=o.getValueAndResolveTokens("icon-image",y,i,g);v=e instanceof fn?e:fn.fromString(e)}if(!x&&!v)continue;const b=this.sortFeaturesByKey?p.evaluate(y,{},i):void 0;if(this.features.push({id:c,text:x,icon:v,index:u,sourceLayerIndex:_,geometry:y.geometry,properties:r.properties,type:eA[r.type],sortKey:b}),v&&(f[v.namePrimary]=!0,v.nameSecondary&&(f[v.nameSecondary]=!0)),x){const e=l.evaluate(y,{},i).join(","),t="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Sm.vertical)>=0;for(const r of x.sections)if(r.image)f[r.image.namePrimary]=!0;else{const i=xa(x.toString()),n=r.fontStack||e,o=m[n]=m[n]||{};this.calculateGlyphDependencies(r.text,o,t,this.allowVerticalPlacement,i)}}}"line"===s.get("symbol-placement")&&(this.features=function(e){const t={},r={},i=[];let n=0;function o(t){i.push(e[t]),n++}function s(e,t,n){const o=r[e];return delete r[e],r[t]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function a(e,r,n){const o=t[r];return delete t[r],t[e]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function l(e,t,r){const i=r?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const p=l(d,h),f=l(d,h,!0);if(p in r&&f in t&&r[p]!==t[f]){const e=a(p,f,h),n=s(p,f,i[e].geometry);delete t[p],delete r[f],r[l(d,i[n].geometry,!0)]=n,i[e].geometry=null}else p in r?s(p,f,h):f in t?a(p,f,h):(o(c),t[p]=n-1,r[f]=n-1)}return i.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r,i,n){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(e,t,s,r,i,n),this.icon.programConfigurations.updatePaintArrays(e,t,s,r,i,n)}updateZOffset(){const e=(e,t,i)=>{r+=t,r>e.length&&e.resize(r);for(let n=-t;n<0;n++)e.emplace(n+r,i)},t=(e,t,r)=>{i+=t,i>e.length&&e.resize(i);for(let n=-t;n<0;n++)e.emplace(n+i,r)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let r=0,i=0;for(let r=0;r<this.symbolInstances.length;r++){const i=this.symbolInstances.get(r),{numHorizontalGlyphVertices:n,numVerticalGlyphVertices:o,numIconVertices:s}=i,a=i.zOffset,l=s>0;if((n>0||o>0)&&(e(this.text.zOffsetVertexArray,n,a),e(this.text.zOffsetVertexArray,o,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:r}=i;e>=0&&t(this.icon.zOffsetVertexArray,s,a),r>=0&&t(this.icon.zOffsetVertexArray,i.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jg(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:r}of t)this.lineVertexArray.emplaceBack(e,r);return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,o,s,a,l,c,u,h,d,p,f,m){const g=e.indexArray,A=e.layoutVertexArray,_=e.globeExtVertexArray,y=e.segments.prepareSegment(4*t.length,A,g,this.canOverlap?o.sortKey:void 0),x=this.glyphOffsetArray.length,v=y.vertexLength,b=this.allowVerticalPlacement&&s===Sm.vertical?Math.PI/2:0,w=o.text&&o.text.sections;for(let i=0;i<t.length;i++){const{tl:n,tr:s,bl:c,br:u,texPrimary:h,texSecondary:x,pixelOffsetTL:v,pixelOffsetBR:C,minFontScaleX:T,minFontScaleY:E,glyphOffset:M,isSDF:S,sectionIndex:I}=t[i],P=y.vertexLength,D=M[1];if(rA(A,l.x,l.y,n.x,D+n.y,h.x,h.y,r,S,v.x,v.y,T,E),rA(A,l.x,l.y,s.x,D+s.y,h.x+h.w,h.y,r,S,C.x,v.y,T,E),rA(A,l.x,l.y,c.x,D+c.y,h.x,h.y+h.h,r,S,v.x,C.y,T,E),rA(A,l.x,l.y,u.x,D+u.y,h.x+h.w,h.y+h.h,r,S,C.x,C.y,T,E),a){const{x:t,y:r,z:i}=a.anchor,[n,o,s]=a.up;nA(_,t,r,i,n,o,s),nA(_,t,r,i,n,o,s),nA(_,t,r,i,n,o,s),nA(_,t,r,i,n,o,s),oA(e.dynamicLayoutVertexArray,t,r,i,b)}else oA(e.dynamicLayoutVertexArray,l.x,l.y,l.z,b);if(m){const t=x||h;iA(e.iconTransitioningVertexArray,t.x,t.y),iA(e.iconTransitioningVertexArray,t.x+t.w,t.y),iA(e.iconTransitioningVertexArray,t.x,t.y+t.h),iA(e.iconTransitioningVertexArray,t.x+t.w,t.y+t.h)}g.emplaceBack(P,P+1,P+2),g.emplaceBack(P+1,P+2,P+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),i!==t.length-1&&I===t[i+1].sectionIndex||e.programConfigurations.populatePaintArrays(A.length,o,o.index,{},d,p,f,w&&w[I])}const C=a?a.anchor:l;e.placedSymbolArray.emplaceBack(C.x,C.y,C.z,l.x,l.y,x,this.glyphOffsetArray.length-x,v,c,u,l.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,h,0)}_commitLayoutVertex(e,t,r,i,n,o,s){e.emplaceBack(t,r,i,n,o,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(e,t,r,i,n,o,s){const a=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),l=a.vertexLength,c=s.tileAnchorX,u=s.tileAnchorY;for(let e=0;e<4;e++)r.collisionVertexArray.emplaceBack(0,0,0,0);this._commitDebugCollisionVertexUpdate(r.collisionVertexArrayExt,t,e.padding,s.zOffset),this._commitLayoutVertex(r.layoutVertexArray,i,n,o,c,u,new Vt(e.x1,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,i,n,o,c,u,new Vt(e.x2,e.y1)),this._commitLayoutVertex(r.layoutVertexArray,i,n,o,c,u,new Vt(e.x2,e.y2)),this._commitLayoutVertex(r.layoutVertexArray,i,n,o,c,u,new Vt(e.x1,e.y2)),a.vertexLength+=4;const h=r.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,r,i,n,o){for(let s=i;s<n;s++){const i=r.get(s),n=this.getSymbolInstanceTextSize(e,o,t,s);this._addCollisionDebugVertices(i,n,this.textCollisionBox,i.projectedAnchorX,i.projectedAnchorY,i.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,r,i,n,o){for(let s=i;s<n;s++){const i=r.get(s),n=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(i,n,this.iconCollisionBox,i.projectedAnchorX,i.projectedAnchorY,i.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new lA(Vl,Uf.members,Fl),this.iconCollisionBox=new lA(Vl,Uf.members,Fl);const r=qf(this.iconSizeData,e),i=qf(this.textSizeData,e);for(let n=0;n<this.symbolInstances.length;n++){const o=this.symbolInstances.get(n);this._addTextDebugCollisionBoxes(i,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(i,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,r,i){const n=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:i),o=Qf(this.textSizeData,e,n)/Gf;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,r){const i=this.icon.placedSymbolArray.get(r),n=Qf(this.iconSizeData,e,i);return this.tilePixelRatio*n}_commitDebugCollisionVertexUpdate(e,t,r,i){e.emplaceBack(t,-r,-r,i),e.emplaceBack(t,r,-r,i),e.emplaceBack(t,r,r,i),e.emplaceBack(t,-r,r,i)}_updateTextDebugCollisionBoxes(e,t,r,i,n,o){for(let s=i;s<n;s++){const i=r.get(s),n=this.getSymbolInstanceTextSize(e,o,t,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,n,i.padding,o.zOffset)}}_updateIconDebugCollisionBoxes(e,t,r,i,n,o){for(let s=i;s<n;s++){const i=r.get(s),n=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,n,i.padding,o.zOffset)}}updateCollisionDebugBuffers(e,t){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const r=qf(this.iconSizeData,e),i=qf(this.textSizeData,e);for(let n=0;n<this.symbolInstances.length;n++){const o=this.symbolInstances.get(n);this._updateTextDebugCollisionBoxes(i,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(i,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(r,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._updateIconDebugCollisionBoxes(r,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,o,s,a,l){const c={};if(t<r){const{x1:r,y1:i,x2:n,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(t);c.textBox={x1:r,y1:i,x2:n,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=p}if(i<n){const{x1:t,y1:r,x2:n,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(i);c.verticalTextBox={x1:t,y1:r,x2:n,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=p}if(o<s){const{x1:t,y1:r,x2:i,y2:n,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(o);c.iconBox={x1:t,y1:r,x2:i,y2:n,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=p}if(a<l){const{x1:t,y1:r,x2:i,y2:n,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:p}=e.get(a);c.verticalIconBox={x1:t,y1:r,x2:i,y2:n,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=p}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),i=[],n=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const s=this.symbolInstances.get(e);i.push(0|Math.round(t*s.tileAnchorX+r*s.tileAnchorY)),n.push(s.featureIndex)}return o.sort(((e,t)=>i[e]-i[t]||n[t]-n[e])),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;e<this.symbolInstances.length;++e)this.symbolInstanceIndexesSortedZOffset.push(e)}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort(((e,t)=>this.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset))}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:i,leftJustifiedTextSymbolIndex:n,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=t;r>=0&&this.addIndicesForPlacedSymbol(this.text,r),i>=0&&i!==r&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}fa(cA,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),cA.addDynamicAttributes=oA;const uA=new Ka({"symbol-placement":new Xa(tl.layout_symbol["symbol-placement"]),"symbol-spacing":new Xa(tl.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xa(tl.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ya(tl.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xa(tl.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Xa(tl.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new Xa(tl.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Xa(tl.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xa(tl.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xa(tl.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ya(tl.layout_symbol["icon-size"]),"icon-text-fit":new Ya(tl.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ya(tl.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ya(tl.layout_symbol["icon-image"]),"icon-rotate":new Ya(tl.layout_symbol["icon-rotate"]),"icon-padding":new Xa(tl.layout_symbol["icon-padding"]),"icon-keep-upright":new Xa(tl.layout_symbol["icon-keep-upright"]),"icon-offset":new Ya(tl.layout_symbol["icon-offset"]),"icon-anchor":new Ya(tl.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xa(tl.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xa(tl.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xa(tl.layout_symbol["text-rotation-alignment"]),"text-field":new Ya(tl.layout_symbol["text-field"]),"text-font":new Ya(tl.layout_symbol["text-font"]),"text-size":new Ya(tl.layout_symbol["text-size"]),"text-max-width":new Ya(tl.layout_symbol["text-max-width"]),"text-line-height":new Ya(tl.layout_symbol["text-line-height"]),"text-letter-spacing":new Ya(tl.layout_symbol["text-letter-spacing"]),"text-justify":new Ya(tl.layout_symbol["text-justify"]),"text-radial-offset":new Ya(tl.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xa(tl.layout_symbol["text-variable-anchor"]),"text-anchor":new Ya(tl.layout_symbol["text-anchor"]),"text-max-angle":new Xa(tl.layout_symbol["text-max-angle"]),"text-writing-mode":new Xa(tl.layout_symbol["text-writing-mode"]),"text-rotate":new Ya(tl.layout_symbol["text-rotate"]),"text-padding":new Xa(tl.layout_symbol["text-padding"]),"text-keep-upright":new Xa(tl.layout_symbol["text-keep-upright"]),"text-transform":new Ya(tl.layout_symbol["text-transform"]),"text-offset":new Ya(tl.layout_symbol["text-offset"]),"text-allow-overlap":new Xa(tl.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Xa(tl.layout_symbol["text-ignore-placement"]),"text-optional":new Xa(tl.layout_symbol["text-optional"]),visibility:new Xa(tl.layout_symbol.visibility)});var hA={paint:new Ka({"icon-opacity":new Ya(tl.paint_symbol["icon-opacity"]),"icon-emissive-strength":new Ya(tl.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Ya(tl.paint_symbol["text-emissive-strength"]),"icon-color":new Ya(tl.paint_symbol["icon-color"]),"icon-halo-color":new Ya(tl.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ya(tl.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ya(tl.paint_symbol["icon-halo-blur"]),"icon-translate":new Xa(tl.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xa(tl.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Ya(tl.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Ya(tl.paint_symbol["text-opacity"]),"text-color":new Ya(tl.paint_symbol["text-color"],{runtimeType:Ki,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Ya(tl.paint_symbol["text-halo-color"]),"text-halo-width":new Ya(tl.paint_symbol["text-halo-width"]),"text-halo-blur":new Ya(tl.paint_symbol["text-halo-blur"]),"text-translate":new Xa(tl.paint_symbol["text-translate"]),"text-translate-anchor":new Xa(tl.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Xa(tl.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Xa(tl.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Xa(tl.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Xa(tl.paint_symbol["icon-color-brightness-max"])}),layout:uA};class dA{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:qi,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}fa(dA,"FormatSectionOverride",{omit:["defaultValue"]});class pA extends yl{constructor(t,r,i){super(t,hA,r,i),this._colorAdjustmentMatrix=e.a9.identity([])}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const r=this.layout.get("text-writing-mode");if(r){const e=[];for(const t of r)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(t,r,i,n){return this._saturation===t&&this._contrast===r&&this._brightnessMin===i&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(t,r,i,n){t=Ir(t),r=Sr(r);const o=e.a9.create(),s=t/3,a=1-2*s,l=[a,s,s,0,s,a,s,0,s,s,a,0,0,0,0,1],c=.5-.5*r,u=n-i;return e.a9.multiply(o,[u,0,0,0,0,u,0,0,0,0,u,0,i,i,i,1],[r,0,0,0,0,r,0,0,0,0,r,0,c,c,c,1]),e.a9.multiply(o,o,l),o}(t,r,i,n),this._saturation=t,this._contrast=r,this._brightnessMin=i,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,r,i){const n=this.layout.get(e).evaluate(t,{},r,i),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||ra(o.value)||!n?n:function(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}(t.properties,n)}createBucket(e){return new cA(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of hA.paint.overridableProperties){if(!pA.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new dA(t),i=new ta(r,t.property.specification,this.scope,this.options);let n=null;n="constant"===t.value.kind||"source"===t.value.kind?new na("source",i):new oa("composite",i,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new Qa(t.property,n,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&pA.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),i=hA.paint.properties[t];let n=!1;const o=e=>{for(const t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(n=!0)};if("constant"===r.value.kind&&r.value.value instanceof pn)o(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{n||(t instanceof yn&&An(t.value)===rn?o(t.value.sections):t instanceof wn?o(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}getProgramIds(){const e=0!==this.paint.get("icon-opacity").constantOr(1),t=0!==this.paint.get("text-opacity").constantOr(1),r=[];return e&&r.push("symbolIcon"),t&&r.push("symbolSDF"),r}getDefaultProgramParams(e,t){return{config:new Nc(this,t),overrideFog:!1}}}const fA=new Ka({visibility:new Xa(tl.layout_background.visibility)});var mA={paint:new Ka({"background-color":new Xa(tl.paint_background["background-color"]),"background-pattern":new Xa(tl.paint_background["background-pattern"]),"background-opacity":new Xa(tl.paint_background["background-opacity"]),"background-emissive-strength":new Xa(tl.paint_background["background-emissive-strength"])}),layout:fA};const gA=new Ka({visibility:new Xa(tl.layout_raster.visibility)});var AA={paint:new Ka({"raster-opacity":new Xa(tl.paint_raster["raster-opacity"]),"raster-color":new $a(tl.paint_raster["raster-color"]),"raster-color-mix":new Xa(tl.paint_raster["raster-color-mix"]),"raster-color-range":new Xa(tl.paint_raster["raster-color-range"]),"raster-hue-rotate":new Xa(tl.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xa(tl.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xa(tl.paint_raster["raster-brightness-max"]),"raster-saturation":new Xa(tl.paint_raster["raster-saturation"]),"raster-contrast":new Xa(tl.paint_raster["raster-contrast"]),"raster-resampling":new Xa(tl.paint_raster["raster-resampling"]),"raster-fade-duration":new Xa(tl.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Xa(tl.paint_raster["raster-emissive-strength"]),"raster-array-band":new Xa(tl.paint_raster["raster-array-band"]),"raster-elevation":new Xa(tl.paint_raster["raster-elevation"])}),layout:gA},_A=wl([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class yA{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,i)}update(e,t,r){const{width:i,height:n}=e,{context:o}=this,{gl:s}=o;if(s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),r||this.size&&this.size[0]===i&&this.size[1]===n){const{x:t,y:o}=r||{x:0,y:0};if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap)s.texSubImage2D(s.TEXTURE_2D,0,t,o,s.RGBA,s.UNSIGNED_BYTE,e);else{let r=this.format,a=s.UNSIGNED_BYTE;this.format===s.R32F&&(r=s.RED,a=s.FLOAT),s.texSubImage2D(s.TEXTURE_2D,0,t,o,i,n,r,a,e.data)}}else if(this.size=[i,n],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap){let t=this.format;this.format===s.R8&&(t=s.RED),s.texImage2D(s.TEXTURE_2D,0,this.format,t,s.UNSIGNED_BYTE,e)}else{let t=this.format,r=this.format,o=s.UNSIGNED_BYTE;this.format===s.DEPTH_COMPONENT&&(t=s.DEPTH_COMPONENT16,o=s.UNSIGNED_SHORT),this.format===s.R8&&(r=s.RED),this.format===s.R32F&&(o=s.FLOAT,r=s.RED),s.texImage2D(s.TEXTURE_2D,0,t,i,n,0,r,o,e.data)}this.useMipmap=Boolean(t&&t.useMipmap),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t,r=!1){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,this.useMipmap&&!r?e===n.NEAREST?n.NEAREST_MIPMAP_NEAREST:n.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,r,i){const{context:n}=this,{gl:o}=n;o.bindTexture(o.TEXTURE_2D,this.texture),t!==this.magFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),r!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),this.wrapS=r),i!==this.wrapT&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,i),this.wrapT=i)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class xA{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:r}=this,{gl:i}=r;i.bindTexture(i.TEXTURE_2D,this.texture),e!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrapS=t)}}function vA(t,r,i,n,o,s,a,l){const c=[t,r,1,i,n,1,o,s,1],u=[a,l,1],h=e.ct.adjoint([],c),[d,p,f]=e.Q.transformMat3(u,u,h);return e.ct.multiply(c,c,[d,0,0,0,p,0,0,0,f])}function bA(t,r,i,n,o,s,a,l){const c=function(t,r,i,n,o,s,a,l){const c=vA(0,0,1,0,1,1,0,1),u=vA(t,r,i,n,o,s,a,l),h=e.ct.adjoint([],c);return e.ct.multiply(u,u,h)}(t,r,i,n,o,s,a,l);return[c[2]/c[8]/no,c[5]/c[8]/no]}function wA(e){return[e[0],Math.min(Math.max(e[1],-Cu),Cu)]}class CA extends zi{constructor(e,t,r,i){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(i),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new Li("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=ni(this.map._requestManager.transformRequest(this.url,Xr.Image),((t,r)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new Oi(t)):r&&(this.image=r instanceof HTMLImageElement?Dr.getImageData(r):r,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new xA(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Li("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof xA||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],r=e[0][1];for(const i of e)i[1]>r&&(r=i[1]),i[1]<t&&(t=i[1]);const i=(r+t)/2;if(i>Cu?this.onNorthPole=!0:i<-Cu&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(Iu.fromLngLat);this.tileID=function(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x),n=Math.max(n,o.y);const o=Math.max(i-t,n-r),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),a=Math.pow(2,s);let l=Math.floor((t+i)/2*a);return l>1&&(l-=1),new uu(s,l,Math.floor((r+n)/2*a))}(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Li("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const r=Dg(new uu(0,0,0),this.map.transform.projection),i=[r.projection.project(this.coordinates[0][0],this.coordinates[0][1]),r.projection.project(this.coordinates[1][0],this.coordinates[1][1]),r.projection.project(this.coordinates[2][0],this.coordinates[2][1]),r.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(e){const t=e[1].x-e[0].x,r=e[1].y-e[0].y,i=e[2].x-e[1].x,n=e[2].y-e[1].y,o=e[3].x-e[2].x,s=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*n-i*r,u=i*s-o*n,h=o*l-a*s,d=a*r-t*l;return c>0&&u>0&&h>0&&d>0||c<0&&u<0&&h<0&&d<0}(i))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=Dg(this.tileID,this.map.transform.projection),[o,s,a,l]=this.coordinates.map((e=>{const t=n.projection.project(e[0],e[1]);return kg(n,t)._round()}));this.perspectiveTransform=bA(o.x,o.y,s.x,s.y,a.x,a.y,l.x,l.y);const c=this._boundsArray=new Ml;c.emplaceBack(o.x,o.y,0,0),c.emplaceBack(s.x,s.y,no,0),c.emplaceBack(l.x,l.y,0,no),c.emplaceBack(a.x,a.y,no,no),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=t.createVertexBuffer(c,_A.members),this.boundsSegments=mc.simpleSegment(0,0,4,2);const u=[],h=[wA((d=this.coordinates)[0]),wA(d[1]),wA(d[2]),wA(d[3])];var d;const[p,f,m,g]=function(e){let t=e[0][0],r=t,i=e[0][1],n=i;for(let o=1;o<e.length;o++)e[o][0]<t?t=e[o][0]:e[o][0]>r&&(r=e[o][0]),e[o][1]<i?i=e[o][1]:e[o][1]>n&&(n=e[o][1]);return[t,i,r-t,n-i]}(h);{const n=new Ml,[o,s,a,l]=function(e){let t=e[0].x,r=t,i=e[0].y,n=i;for(let o=1;o<e.length;o++)e[o].x<t?t=e[o].x:e[o].x>r&&(r=e[o].x),e[o].y<i?i=e[o].y:e[o].y>n&&(n=e[o].y);return[t,i,r-t,n-i]}(i),c=e=>[(e.x-o)/a,(e.y-s)/l],[h,d,A,_]=i.map(c),y=function(t,r,i,n,o,s,a,l){const c=vA(0,0,1,0,1,1,0,1),u=vA(t,r,i,n,o,s,a,l),h=e.ct.adjoint([],u);return e.ct.multiply(c,c,h)}(h[0],h[1],d[0],d[1],A[0],A[1],_[0],_[1]);this.elevatedGlobePerspectiveTransform=bA(h[0],h[1],d[0],d[1],A[0],A[1],_[0],_[1]);const x=(t,r)=>{u.push(t.lng);const i=Math.round((t.lng-p)/m*no),o=Math.round((t.lat-f)/g*no),s=c(r),a=e.Q.transformMat3([],[s[0],s[1],1],y),l=Math.round(a[0]/a[2]*no),h=Math.round(a[1]/a[2]*no);n.emplaceBack(i,o,l,h)},v=i[3].x-i[0].x,b=i[3].y-i[0].y,w=i[2].x-i[1].x,C=i[2].y-i[1].y;for(let e=0;e<65;e++){const t=e/64,n=[i[0].x+t*v,i[0].y+t*b],o=[i[1].x+t*w,i[1].y+t*C],s=o[0]-n[0],a=o[1]-n[1];for(let e=0;e<65;e++){const t=e/64,i={x:n[0]+s*t,y:n[1]+a*t,z:0};x(r.projection.unproject(i.x,i.y),i)}}this.elevatedGlobeVertexBuffer=t.createVertexBuffer(n,_A.members)}{this.maxLongitudeTriangleSize=0;let e=[],r=new Hl;const i=(t,i,n)=>{r.emplaceBack(t,i,n);const o=u[t],s=u[i],a=u[n],l=Math.min(Math.min(o,s),a),c=Math.max(Math.max(o,s),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),e.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const r=65*e+t,n=r+1,o=r+65,s=o+1;i(r,o,n),i(n,o,s)}[e,r]=function(e,t){const r=Array.from({length:e.length},((e,t)=>t));r.sort(((t,r)=>e[t]-e[r]));const i=[],n=new Hl;for(let o=0;o<r.length;o++){const s=r[o];i.push(e[s]);const a=3*s,l=a+1;n.emplaceBack(t.uint16[a],t.uint16[l],t.uint16[l+1])}return[i,n]}(e,r),this.elevatedGlobeTrianglesCenterLongitudes=e,this.elevatedGlobeIndexBuffer=t.createIndexBuffer(r)}this.elevatedGlobeSegments=mc.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,m/no,0,g/no,0,0,f,p,0])}prepare(){const e=0!==Object.keys(this.tiles).length;if(this.tileID&&!e)return;const t=this.map.painter.context,r=t.gl;!this._dirty||this.texture instanceof xA||(this.texture?this.texture.update(this.image):(this.texture=new yA(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._dirty=!1),e&&this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}getSegmentsForLongitude(e){const t=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!t)return null;const r=this.elevatedGlobeTrianglesCenterLongitudes;let i=((e,t)=>e+360*Math.round((t-e)/360))(e+180,r[0]);const n=new mc,o=(e,r)=>{n.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}})},s=.51*this.maxLongitudeTriangleSize;if(Math.abs(r[0]-i)<=s){const e=Mr(r,0,r.length,i+s);return e===r.length||o(e,Er(r,e+1,r.length,i+360-s)-e),n}i<r[0]&&(i+=360);const a=Er(r,0,r.length,i-s);if(a===r.length)return o(0,r.length),n;o(0,a-0);const l=Mr(r,a+1,r.length,i+s);return l!==r.length&&o(l,r.length-l),n}}const TA=(Math.pow(256,2)-1)/16907520;class EA extends yl{constructor(e,t,r){super(e,AA,t,r),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(e){return!(e&&e._source instanceof CA&&(e._source.onNorthPole||e._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(e){"raster-color"!==e&&"raster-color-range"!==e||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}updateColorRamp(e){if(!this.hasColorMap())return;if(!this._curRampRange)return;const t=this._transitionablePaint._values["raster-color"].value.expression,[r,i]=e||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(r)&&isNaN(i)||r===this._curRampRange[0]&&i===this._curRampRange[1]||(this.colorRamp=ad({expression:t,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:r,end:i}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[r,i])}}const MA=new Ka({visibility:new Xa(tl["layout_raster-particle"].visibility)});var SA={paint:new Ka({"raster-particle-array-band":new Xa(tl["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Xa(tl["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new $a(tl["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Xa(tl["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Xa(tl["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Xa(tl["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Xa(tl["paint_raster-particle"]["raster-particle-reset-rate-factor"])}),layout:MA};class IA extends yl{constructor(e,t,r){super(e,SA,t,r),this._updateColorRamp(),this.lastInvalidatedAt=Dr.now()}onRemove(e){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(e){return!1}_handleSpecialPaintPropertyUpdate(e){"raster-particle-color"!==e&&"raster-particle-max-speed"!==e||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===e&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const e=this._transitionablePaint._values["raster-particle-color"].value.expression,t=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=ad({expression:e,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:t}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=Dr.now()}}class PA extends yl{constructor(e,t){super(e,{},t),this.implementation=e,e.slot&&(this.slot=e.slot)}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(e){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}const DA=new Ka({visibility:new Xa(tl.layout_sky.visibility)});var kA={paint:new Ka({"sky-type":new Xa(tl.paint_sky["sky-type"]),"sky-atmosphere-sun":new Xa(tl.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Xa(tl.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Xa(tl.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Xa(tl.paint_sky["sky-gradient-radius"]),"sky-gradient":new $a(tl.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Xa(tl.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Xa(tl.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Xa(tl.paint_sky["sky-opacity"])}),layout:DA};function LA(t,r,i){const n=[0,0,1],o=e.bl.identity([]);return e.bl.rotateY(o,o,i?-Ht(t)+Math.PI:Ht(t)),e.bl.rotateX(o,o,-Ht(r)),e.Q.transformQuat(n,n,o),e.Q.normalize(n,n)}var OA={paint:new Ka({})};function zA(t,r){const i=RA(t.projection,t.zoom,t.width,t.height),n=function(t,r,i,n,o){const s=new su(i.lng-180*FA,i.lat),a=new su(i.lng+180*FA,i.lat),l=t.project(s.lng,s.lat),c=t.project(a.lng,a.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),h=Iu.fromLngLat(i);h.y=Xt(h.y,-1+FA,1-FA);const d=h.toLngLat(),p=t.project(d.lng,d.lat),f=Iu.fromLngLat(d);f.x+=FA;const m=f.toLngLat(),g=t.project(m.lng,m.lat),A=VA(g.x-p.x,g.y-p.y,u),_=Iu.fromLngLat(d);_.y+=FA;const y=_.toLngLat(),x=t.project(y.lng,y.lat),v=VA(x.x-p.x,x.y-p.y,u),b=Math.abs(A.x)/Math.abs(v.y),w=e.a9.identity([]);e.a9.rotateZ(w,w,-u*(1-(o?0:n)));const C=e.a9.identity([]);return e.a9.scale(C,C,[1,1-(1-b)*n,1]),C[4]=-v.x/v.y*n,e.a9.rotateZ(C,C,u),e.a9.multiply(C,w,C),C}(t.projection,0,t.center,i,r),o=BA(t);return e.a9.scale(n,n,[o,o,1]),n}function BA(e){const t=e.projection,r=RA(e.projection,e.zoom,e.width,e.height),i=jA(t,e.center),n=jA(t,su.convert(t.center));return Math.pow(2,i*r+(1-r)*n)}function RA(e,t,r,i,n=1/0){const o=e.range;if(!o)return 0;const s=Math.min(n,Math.max(r,i)),a=Math.log(s/1024)/Math.LN2;return Yt(o[0]+a,o[1]+a,t)}const FA=1/4e4;function jA(e,t){const r=Xt(t.lat,-Cu,Cu),i=new su(t.lng-180*FA,r),n=new su(t.lng+180*FA,r),o=e.project(i.lng,r),s=e.project(n.lng,r),a=Iu.fromLngLat(i),l=Iu.fromLngLat(n),c=s.x-o.x,u=s.y-o.y,h=l.x-a.x,d=l.y-a.y,p=Math.sqrt((h*h+d*d)/(c*c+u*u));return Math.log(p)/Math.LN2}function VA(e,t,r){const i=Math.cos(r),n=Math.sin(r);return{x:e*i-t*n,y:e*n+t*i}}function NA(t,r,i){e.a9.identity(t),e.a9.rotateZ(t,t,Ht(r[2])),e.a9.rotateX(t,t,Ht(r[0])),e.a9.rotateY(t,t,Ht(r[1])),e.a9.scale(t,t,i),e.a9.multiply(t,t,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1])}function UA(t,r,i,n,o,s,a,l){const c=[i[0]-r[0],i[1]-r[1],0],u=[n[0]-r[0],n[1]-r[1],0];if(e.Q.length(c)<1e-12||e.Q.length(u)<1e-12)return e.bl.identity(t);const h=e.Q.cross([],c,u);e.Q.normalize(h,h),e.Q.subtract(u,n,r),c[2]=(s-o)*l,u[2]=(a-o)*l;const d=c;return e.Q.cross(d,c,u),e.Q.normalize(d,d),e.bl.rotationTo(t,h,d)}function HA(t,r,i=!1){const n=jh(r.zoom),o=function(t,r,i){const n=r.worldSize,o=[t[12],t[13],t[14]],s=bu(o[1]/n),a=vu(o[0]/n),l=e.a9.identity([]),c=xu(1,s)*n,u=xu(1,0)*n*Eu(s,r.zoom),h=1/Bh(n);let d=u*h;if(i){const e=RA(r.projection,r.zoom,r.width,r.height,1024);d=h*r.projection.pixelSpaceConversion(r.center.lat,n,e)}const p=iu(s,a);e.Q.add(p,p,e.Q.scale([],e.Q.normalize([],p),c*d*o[2]));const f=function(t){const r=[t[0],t[1],t[2]];let i=[0,1,0];const n=e.Q.cross([],i,r);return e.Q.cross(i,r,n),0===e.Q.squaredLength(i)&&(i=[0,1,0],e.Q.cross(n,r,i)),e.Q.normalize(n,n),e.Q.normalize(i,i),e.Q.normalize(r,r),[n[0],n[1],n[2],0,i[0],i[1],i[2],0,r[0],r[1],r[2],0,t[0],t[1],t[2],1]}(p);e.a9.scale(l,l,[d,d,d*c]),e.a9.translate(l,l,[-o[0],-o[1],-o[2]]);const m=e.a9.multiply([],r.globeMatrix,f);return e.a9.multiply(m,m,l),e.a9.multiply(m,m,t),m}(t,r,i);if(n>0){const i=function(t,r){const i=r.worldSize,n=xu(1,0)*i*Eu(r.center.lat,r.zoom)/Bh(i),o=xu(1,r.center.lat)*i,s=e.a9.identity([]);return e.a9.rotateY(s,s,Ht(r.center.lng)),e.a9.rotateX(s,s,Ht(r.center.lat)),e.a9.translate(s,s,[0,0,qc]),e.a9.scale(s,s,[n,n,n*o]),e.a9.translate(s,s,[r.point.x-.5*i,r.point.y-.5*i,0]),e.a9.multiply(s,s,t),e.a9.multiply(s,r.globeMatrix,s)}(t,r);return function(t,r,i){const n=(t,r,i)=>{const n=e.Q.length(t),o=e.Q.length(r),s=Eh(t,r,i);return e.Q.scale(s,s,1/e.Q.length(s)*Ui(n,o,i))},o=n([t[0],t[1],t[2]],[r[0],r[1],r[2]],i),s=n([t[4],t[5],t[6]],[r[4],r[5],r[6]],i),a=n([t[8],t[9],t[10]],[r[8],r[9],r[10]],i),l=Eh([t[12],t[13],t[14]],[r[12],r[13],r[14]],i);return[o[0],o[1],o[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],0,l[0],l[1],l[2],1]}(o,i,n)}return o}function GA(e,t,r,i){const n=mh.projectAabbCorners(i,r);let o=Number.MAX_VALUE,s=-1;for(let e=0;e<n.length;++e){const r=n[e];r[0]=(.5*r[0]+.5)*t.width,r[1]=(.5-.5*r[1])*t.height,r[2]<o&&(s=e,o=r[2])}const a=e=>new Vt(n[e][0],n[e][1]);let l;switch(s){case 0:case 6:l=[a(1),a(5),a(4),a(7),a(3),a(2),a(1)];break;case 1:case 7:l=[a(0),a(4),a(5),a(6),a(2),a(3),a(0)];break;case 3:case 5:l=[a(1),a(0),a(4),a(7),a(6),a(2),a(1)];break;default:l=[a(1),a(5),a(6),a(7),a(3),a(0),a(1)]}if(Uu(e,l))return o}const ZA=wl([{name:"a_pos_3f",components:3,type:"Float32"}]),WA=wl([{name:"a_color_3f",components:3,type:"Float32"}]),QA=wl([{name:"a_color_4f",components:4,type:"Float32"}]),qA=wl([{name:"a_uv_2f",components:2,type:"Float32"}]),XA=wl([{name:"a_normal_3f",components:3,type:"Float32"}]),YA=wl([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),$A=wl([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);class KA{constructor(e,t,r,i){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}}function JA(e,t){const r=-1===e.indexOf("://");try{return new URL(e,r&&t?"http://example.com":void 0),!0}catch(e){return!1}}class e_{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class t_{constructor(){this.instancedDataArray=new Kl,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class r_{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1}populate(e,t,r,i){this.tileToMeter=Su(r);const n=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=null!=s?s:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=Fu(o,n);if(!this.layers[0]._featureFilter.filter(new Va(this.zoom),c,r))continue;const u={id:e,sourceLayerIndex:l,index:a,geometry:n?c.geometry:Ru(o,r,i),properties:o.properties,type:o.type,patterns:{}},h=this.addFeature(u,u.geometry,c);h&&t.featureIndex.insert(o,u.geometry,a,l,this.index,this.instancesPerModel[h].instancedDataArray.length,no/32)}this.lookup=null}update(e,t,r,i){for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];for(const t in e)r.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(r.features[r.idToFeaturesIndex[t]],e[t],r,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let t=!1;for(const r in this.instancesPerModel){const i=this.instancesPerModel[r];for(const r of i.features){const n=this.layers[0],o=r.feature,s=this.canonical,a=n.paint.get("model-rotation").evaluate(o,{},s),l=n.paint.get("model-scale").evaluate(o,{},s),c=n.paint.get("model-translation").evaluate(o,{},s);e.Q.exactEquals(r.rotation,a)&&e.Q.exactEquals(r.scale,l)&&e.Q.exactEquals(r.translation,c)||(this.evaluate(r,r.featureStates,i,!0),t=!0)}}return t}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const r=this.instancesPerModel[t];r.instancedDataArray.length<0||0===r.instancedDataArray.length||(r.instancedDataBuffer?r.instancedDataBuffer.updateData(r.instancedDataArray):r.instancedDataBuffer=e.createVertexBuffer(r.instancedDataArray,YA.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const t of this.modelUris)e.removeModel(t,"")}addFeature(e,t,r){const i=this.layers[0],n=i.layout.get("model-id").evaluate(r,{},this.canonical);if(!n)return hr(`modelId is not evaluated for layer ${i.id} and it is not going to get rendered.`),n;JA(n,!1)&&(this.modelUris.includes(n)||this.modelUris.push(n)),this.instancesPerModel[n]||(this.instancesPerModel[n]=new t_);const o=this.instancesPerModel[n],s=o.instancedDataArray,a=new e_(r,s.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=no||t.y<0||t.y>=no)continue;const e=(this.lookupDim-1)/no,r=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[r])continue;this.lookup[r]=1}this.instanceCount++;const i=s.length;s.resize(i+1),o.instancesEvaluatedElevation.push(0),s.float32[16*i]=t.x,s.float32[16*i+1]=t.y}return a.instancedDataCount=o.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(e.id&&(o.idToFeaturesIndex[e.id]=o.features.length),o.features.push(a),this.evaluate(a,{},o,!1)),n}getModelUris(){return this.modelUris}evaluate(e,t,r,i){const n=this.layers[0],o=e.feature,s=this.canonical,a=e.rotation=n.paint.get("model-rotation").evaluate(o,t,s),l=e.scale=n.paint.get("model-scale").evaluate(o,t,s),c=e.translation=n.paint.get("model-translation").evaluate(o,t,s),u=n.paint.get("model-color").evaluate(o,t,s);u.a=n.paint.get("model-color-mix-intensity").evaluate(o,t,s);const h=[];this.maxVerticalOffset<c[2]&&(this.maxVerticalOffset=c[2]),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),NA(h,a,l);const d=Math.round(100*u.a)+u.b/1.05;for(let t=0;t<e.instancedDataCount;++t){const n=e.instancedDataOffset+t,o=16*n,a=r.instancedDataArray.float32;let l=0;i&&(l=a[o+6]-r.instancesEvaluatedElevation[n]);const p=0|a[o+1];a[o]=(0|a[o])+u.r/1.05,a[o+1]=p+u.g/1.05,a[o+2]=d,a[o+3]=1/(s.z>10?this.tileToMeter:Su(s,p)),a[o+4]=c[0],a[o+5]=c[1],a[o+6]=c[2]+l,a[o+7]=h[0],a[o+8]=h[1],a[o+9]=h[2],a[o+10]=h[4],a[o+11]=h[5],a[o+12]=h[6],a[o+13]=h[8],a[o+14]=h[9],a[o+15]=h[10],r.instancesEvaluatedElevation[n]=c[2]}}}fa(r_,"ModelBucket",{omit:["layers"]}),fa(t_,"PerModelAttributes"),fa(e_,"ModelFeature");const i_=new Ka({visibility:new Xa(tl.layout_model.visibility),"model-id":new Ya(tl.layout_model["model-id"])});var n_={paint:new Ka({"model-opacity":new Xa(tl.paint_model["model-opacity"]),"model-rotation":new Ya(tl.paint_model["model-rotation"]),"model-scale":new Ya(tl.paint_model["model-scale"]),"model-translation":new Ya(tl.paint_model["model-translation"]),"model-color":new Ya(tl.paint_model["model-color"]),"model-color-mix-intensity":new Ya(tl.paint_model["model-color-mix-intensity"]),"model-type":new Xa(tl.paint_model["model-type"]),"model-cast-shadows":new Xa(tl.paint_model["model-cast-shadows"]),"model-receive-shadows":new Xa(tl.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Xa(tl.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Ya(tl.paint_model["model-emissive-strength"]),"model-roughness":new Ya(tl.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Ya(tl.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Xa(tl.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Xa(tl.paint_model["model-front-cutoff"])}),layout:i_};const o_=64,s_={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function a_(t,r,i,n,o,s,a,l,c,u=!1){const h=i.zoom,d=i.project(n),p=Eu(n.lat,h),f=1/p;e.a9.identity(t),e.a9.translate(t,t,[d.x+a[0]*f,d.y+a[1]*f,a[2]]);let m=1,g=1;const A=i.worldSize;if(u){if("mercator"===i.projection.name){let t=0;i.elevation&&(t=i.elevation.getAtPointOrZero(new Iu(d.x/A,d.y/A),0));const r=e.aa.transformMat4([],[d.x,d.y,t,1],i.projMatrix)[3]/i.cameraToCenterDistance;m=r,g=r*Eu(i.center.lat,h)}else if("globe"===i.projection.name){const r=HA(t,i),o=e.a9.multiply([],i.projMatrix,r),s=[0,0,0,1];e.aa.transformMat4(s,s,o);const a=s[3]/i.cameraToCenterDistance,l=jh(h),c=i.projection.pixelsPerMeter(n.lat,A)*Eu(n.lat,h),u=i.projection.pixelsPerMeter(i.center.lat,A)*Eu(i.center.lat,h);m=a/Ui(c,Tu(i.center.lat),l),g=a*p/c,m*=u,g*=u}}else m=f;e.a9.scale(t,t,[m,m,g]);const _=[...t],y=r.orientation,x=[];if(NA(x,[y[0]+o[0],y[1]+o[1],y[2]+o[2]],s),e.a9.multiply(t,_,x),l&&i.elevation){let o=0;const s=[];if(c&&i.elevation){o=function(t,r,i,n,o){const s=r.elevation;if(!s)return 0;const a=mh.projectAabbCorners(i,n),l=xu(1,o.lat)*r.worldSize,c=function(t,r){const i=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const o of n){const n=t[o.corners[0]],s=t[o.corners[1]],a=t[o.corners[2]],l=[s[0]-n[0],s[1]-n[1],r*(s[2]-n[2])],c=e.Q.cross(l,l,[a[0]-n[0],a[1]-n[1],r*(a[2]-n[2])]);e.Q.normalize(c,c),o.dotProductWithUp=e.Q.dot(c,i)}return n.sort(((e,t)=>e.dotProductWithUp-t.dotProductWithUp)),n[0].corners}(a,l),u=a[c[0]],h=a[c[1]],d=a[c[2]],p=a[c[3]],f=s.getAtPointOrZero(new Iu(u[0]/r.worldSize,u[1]/r.worldSize),0),m=s.getAtPointOrZero(new Iu(h[0]/r.worldSize,h[1]/r.worldSize),0),g=s.getAtPointOrZero(new Iu(d[0]/r.worldSize,d[1]/r.worldSize),0),A=s.getAtPointOrZero(new Iu(p[0]/r.worldSize,p[1]/r.worldSize),0),_=(f+A)/2,y=(m+g)/2;return _>y?m<g?UA(t,h,p,u,m,A,f,l):UA(t,d,u,p,g,f,A,l):f<A?UA(t,u,h,d,f,m,g,l):UA(t,p,d,h,A,g,m,l),Math.max(_,y)}(s,i,r.aabb,t,n);const a=e.a9.fromQuat([],s),l=e.a9.multiply([],a,x);e.a9.multiply(t,_,l)}else o=i.elevation.getAtPointOrZero(new Iu(d.x/A,d.y/A),0);0!==o&&(t[14]+=o)}}function l_(e,t,r=!1){e.uploaded||(e.gfxTexture=new yA(t,e.image,r?t.gl.R8:t.gl.RGBA,{useMipmap:e.sampler.minFilter>=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function c_(e,t,r){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,ZA.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,XA.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,qA.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?WA:QA).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,$A.members,!0)),e.segments=mc.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const i=e.material;i.pbrMetallicRoughness.baseColorTexture&&l_(i.pbrMetallicRoughness.baseColorTexture,t),i.pbrMetallicRoughness.metallicRoughnessTexture&&l_(i.pbrMetallicRoughness.metallicRoughnessTexture,t),i.normalTexture&&l_(i.normalTexture,t),i.occlusionTexture&&l_(i.occlusionTexture,t,r),i.emissionTexture&&l_(i.emissionTexture,t)}function u_(e,t,r){if(e.meshes)for(const i of e.meshes)c_(i,t,r);if(e.children)for(const i of e.children)u_(i,t,r)}function h_(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)h_(t)}function d_(e){if(e.meshes)for(const r of e.meshes)r.vertexBuffer&&(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.normalBuffer&&r.normalBuffer.destroy(),r.texcoordBuffer&&r.texcoordBuffer.destroy(),r.colorBuffer&&r.colorBuffer.destroy(),r.pbrBuffer&&r.pbrBuffer.destroy(),r.segments.destroy(),r.material&&((t=r.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const t of e.children)d_(t)}class p_{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class f_{constructor(){this.tasks={},this.taskQueue=[],or(["process"],this),this.invoker=new p_(this.process),this.nextId=0}add(e,t){const r=this.nextId++,i=function({type:e,isSymbolTile:t,zoom:r}){return r=r||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-r:"maybePrepare"===e&&t?400-r:500:200-r:100-r}(t);if(0===i){mr();try{e()}finally{}return null}return this.tasks[r]={fn:e,metadata:t,priority:i,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r]}}}process(){mr();try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let r=0;r<this.taskQueue.length;r++){const i=this.tasks[this.taskQueue[r]];i.priority<t&&(t=i.priority,e=r)}if(null===e)return null;const r=this.taskQueue[e];return this.taskQueue.splice(e,1),r}remove(){this.invoker.remove()}}class m_{constructor(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.cancelCallbacks={},or(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new f_}send(e,t,r,i,n=!1,o){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=o,this.callbacks[s]=r);const a=new Set;return this.target.postMessage({id:s,type:e,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:Aa(t,a)},a),{cancel:()=>{r&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}}}receive(e){const t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e.cancel()}else if(t.mustQueue||mr()){const e=this.callbacks[r],i=this.scheduler.add((()=>this.processTask(r,t)),e&&e.metadata||{type:"message"});i&&(this.cancelCallbacks[r]=i)}else this.processTask(r,t)}processTask(e,t){if(delete this.cancelCallbacks[e],"<response>"===t.type){const r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(_a(t.error)):r(null,_a(t.data)))}else{const r=new Set,i=t.hasCallback?(t,i)=>{this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Aa(t):null,data:Aa(i,r)},r)}:e=>{},n=_a(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,n,i);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],n.source,n.scope)[e[1]](n,i)}else i(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class g_{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=tr();const r=this.workerPool.acquire(this.id);for(let e=0;e<r.length;e++){const i=new g_.Actor(r[e],t,this.id);i.name=`Worker ${e}`,this.actors.push(i)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(e,t,r){Kt(this.actors,((r,i)=>{r.send(e,t,i)}),r=r||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}g_.Actor=m_;var A_={workerUrl:"",workerClass:null,workerParams:void 0};function __(){return null!=A_.workerClass?new A_.workerClass:new self.Worker(A_.workerUrl,A_.workerParams)}const y_="mapboxgl_preloaded_worker_pool";class x_{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<x_.workerCount;)this.workers.push(new __);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.workers&&0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[y_]}numActive(){return Object.keys(this.active).length}}let v_;function b_(){return v_||(v_=new x_),v_}x_.workerCount=2;let w_,C_,T_,E_,M_,S_=null;function I_(){return mr()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:C_||i.DRACO_URL}function P_(){if(mr()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(E_)return E_;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return E_=WebAssembly.validate(e)?i.MESHOPT_SIMD_URL:i.MESHOPT_URL,E_}const D_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},k_={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},L_={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function O_(e,t,r){const i=r.json.bufferViews.length,n=r.buffers.length;t.bufferView=i,r.json.bufferViews[i]={buffer:n,byteLength:e.byteLength},r.buffers[n]=e}const z_="KHR_draco_mesh_compression";function B_(e,t){const r=e.extensions&&e.extensions[z_];if(!r)return;const i=new T_.Decoder,n=H_(t,r.bufferView),o=new T_.Mesh;if(!i.DecodeArrayToMesh(n,n.byteLength,o))throw new Error("Failed to decode Draco mesh");const s=t.json.accessors[e.indices],a=D_[s.componentType],l=s.count*a.BYTES_PER_ELEMENT,c=T_._malloc(l);a===Uint16Array?i.GetTrianglesUInt16Array(o,l,c):i.GetTrianglesUInt32Array(o,l,c),O_(T_.memory.buffer.slice(c,c+l),s,t),T_._free(c);for(const n of Object.keys(r.attributes)){const s=i.GetAttributeByUniqueId(o,r.attributes[n]),a=t.json.accessors[e.attributes[n]],l=k_[a.componentType],c=a.count*L_[a.type]*D_[a.componentType].BYTES_PER_ELEMENT,u=T_._malloc(c);i.GetAttributeDataArrayForAllPoints(o,s,T_[l],c,u),O_(T_.memory.buffer.slice(u,u+c),a,t),T_._free(u)}i.destroy(),o.destroy(),delete e.extensions[z_]}const R_="EXT_meshopt_compression";function F_(e,t){if(!e.extensions||!e.extensions[R_])return;const r=e.extensions[R_],i=new Uint8Array(t.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),n=new Uint8Array(r.count*r.byteStride);M_.decodeGltfBuffer(n,r.count,r.byteStride,i,r.mode,r.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=n.buffer,delete e.extensions[R_]}const j_=1179937895,V_=new TextDecoder("utf8");function N_(e,t){return new URL(e,t).href}function U_(e,t,r,i){return fetch(N_(e.uri,i)).then((e=>e.arrayBuffer())).then((e=>{t.buffers[r]=e}))}function H_(e,t){const r=e.json.bufferViews[t];return new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function G_(e,t,r,i){if(e.uri){const n=N_(e.uri,i);return fetch(n).then((e=>e.blob())).then((e=>createImageBitmap(e))).then((e=>{t.images[r]=e}))}if(void 0!==e.bufferView){const i=H_(t,e.bufferView),n=new Blob([i],{type:e.mimeType});return createImageBitmap(n).then((e=>{t.images[r]=e}))}}function Z_(e,t=0,r){const i={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===j_){const r=new Uint32Array(e,t);let n=2;const o=(r[n++]>>2)-3,s=r[n++]>>2;if(n++,i.json=JSON.parse(V_.decode(r.subarray(n,n+s))),n+=s,n<o){const o=r[n++];n++;const s=t+(n<<2);i.buffers[0]=e.slice(s,s+o)}}else i.json=JSON.parse(V_.decode(new Uint8Array(e,t)));const{buffers:n,images:o,meshes:s,extensionsUsed:a,bufferViews:l}=i.json;let c=Promise.resolve();if(n){const e=[];for(let t=0;t<n.length;t++){const o=n[t];o.uri?e.push(U_(o,i,t,r)):i.buffers[t]||(i.buffers[t]=null)}c=Promise.all(e)}return c.then((()=>{const e=[],t=a&&a.includes(z_),n=a&&a.includes(R_);if(t&&e.push(function(){if(!T_)return w_||(w_=function(e){let t,r=null;function i(){t=new Uint8Array(r.buffer)}function n(){throw new Error("Unexpected Draco error.")}const o={a:{a:n,d:function(e,r,i){return t.copyWithin(e,r,r+i)},c:function(e){const n=t.length,o=Math.max(e>>>0,Math.ceil(1.2*n)),s=Math.ceil((o-n)/65536);try{return r.grow(s),i(),!0}catch(e){return!1}},b:n}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,o)))).then((e=>{const{Rb:n,Qb:o,P:s,T:a,X:l,Ja:c,La:u,Qa:h,Va:d,Wa:p,eb:f,jb:m,f:g,e:A,yb:_,zb:y,Ab:x,Bb:v,Db:b,Gb:w}=e.instance.exports;r=A;const C=(()=>{let e=0,r=0,i=0,s=0;return a=>{i&&(n(s),n(e),r+=i,i=e=0),e||(r+=128,e=o(r));const l=a.length+7&-8;let c=e;l>=r&&(i=l,c=s=o(l));for(let e=0;e<a.length;e++)t[c+e]=a[e];return c}})();return i(),g(),{memory:A,_free:n,_malloc:o,Mesh:class{constructor(){this.ptr=s()}destroy(){a(this.ptr)}},Decoder:class{constructor(){this.ptr=c()}destroy(){m(this.ptr)}DecodeArrayToMesh(e,t,r){const i=C(e),n=u(this.ptr,i,t,r.ptr);return!!l(n)}GetAttributeByUniqueId(e,t){return{ptr:h(this.ptr,e.ptr,t)}}GetTrianglesUInt16Array(e,t,r){d(this.ptr,e.ptr,t,r)}GetTrianglesUInt32Array(e,t,r){p(this.ptr,e.ptr,t,r)}GetAttributeDataArrayForAllPoints(e,t,r,i,n){f(this.ptr,e.ptr,t.ptr,r,i,n)}},DT_INT8:_(),DT_UINT8:y(),DT_INT16:x(),DT_UINT16:v(),DT_UINT32:b(),DT_FLOAT32:w()}}))}(fetch(I_())),w_.then((e=>{T_=e,w_=void 0})))}()),n&&e.push(function(){if(M_)return;const e=function(e){let t;const r=WebAssembly.instantiateStreaming(e,{}).then((e=>{t=e.instance,t.exports.__wasm_call_ctors()})),i={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},n={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:r,supported:!0,decodeGltfBuffer(e,r,o,s,a,l){!function(e,t,r,i,n,o,s){const a=e.exports.sbrk,l=i+3&-4,c=a(l*n),u=a(o.length),h=new Uint8Array(e.exports.memory.buffer);h.set(o,u);const d=t(c,i,n,u,o.length);if(0===d&&s&&s(c,l,n),r.set(h.subarray(c,c+i*n)),a(c-a(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)}(t,t.exports[n[a]],e,r,o,s,t.exports[i[l]])}}}(fetch(P_()));return e.ready.then((()=>{M_=e}))}()),o)for(let t=0;t<o.length;t++)e.push(G_(o[t],i,t,r));return(e.length?Promise.all(e):Promise.resolve()).then((()=>{if(t&&s)for(const{primitives:e}of s)for(const t of e)B_(t,i);if(n&&s&&l)for(const e of l)F_(e,i);return i}))}))}class W_{constructor(e,t,r,i){if(this.triangleCount=t.length/3,this.min=new Vt(0,0),this.max=new Vt(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===e.length)return;const[n,o]=[e[0].clone(),e[0].clone()];for(let t=1;t<e.length;++t){const r=e[t];n.x=Math.min(n.x,r.x),n.y=Math.min(n.y,r.y),o.x=Math.max(o.x,r.x),o.y=Math.max(o.y,r.y)}if(i){const e=Math.ceil(Math.max(o.x-n.x,o.y-n.y)/i);r=Math.max(r,e)}if(0===r)return;this.min=n,this.max=o;const s=this.max.sub(this.min);s.x=Math.max(s.x,1),s.y=Math.max(s.y,1);const a=Math.max(s.x,s.y)/r;this.cellsX=Math.max(1,Math.ceil(s.x/a)),this.cellsY=Math.max(1,Math.ceil(s.y/a)),this.xScale=1/a,this.yScale=1/a;const l=[];for(let r=0;r<this.triangleCount;r++){const i=e[t[3*r+0]].sub(this.min),n=e[t[3*r+1]].sub(this.min),o=e[t[3*r+2]].sub(this.min),s=Q_(Math.floor(Math.min(i.x,n.x,o.x)),this.xScale,this.cellsX),c=Q_(Math.floor(Math.max(i.x,n.x,o.x)),this.xScale,this.cellsX),u=Q_(Math.floor(Math.min(i.y,n.y,o.y)),this.yScale,this.cellsY),h=Q_(Math.floor(Math.max(i.y,n.y,o.y)),this.yScale,this.cellsY),d=new Vt(0,0),p=new Vt(0,0),f=new Vt(0,0),m=new Vt(0,0);for(let e=u;e<=h;++e){d.y=p.y=e*a,f.y=m.y=(e+1)*a;for(let t=s;t<=c;++t)d.x=f.x=t*a,p.x=m.x=(t+1)*a,(th(i,n,o,d,p,m)||th(i,n,o,d,m,f))&&l.push({cellIdx:e*this.cellsX+t,triIdx:r})}}if(0===l.length)return;l.sort(((e,t)=>e.cellIdx-t.cellIdx||e.triIdx-t.triIdx));let c=0;for(;c<l.length;){const e=l[c].cellIdx,t={start:this.payload.length,len:0};for(;c<l.length&&l[c].cellIdx===e;)++t.len,this.payload.push(l[c++].triIdx);this.cells[e]=t}}query(e,t,r){if(0===this.triangleCount||0===this.cells.length)return;if(e.x>this.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8)));for(let e=0;e<this.lookup.length;e++)this.lookup[e]=0;const i=Q_(e.x-this.min.x,this.xScale,this.cellsX),n=Q_(t.x-this.min.x,this.xScale,this.cellsX),o=Q_(e.y-this.min.y,this.yScale,this.cellsY),s=Q_(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=s;e++)for(let t=i;t<=n;t++){const i=this.cells[e*this.cellsX+t];if(i)for(let e=0;e<i.len;e++){const t=this.payload[i.start+e],n=Math.floor(t/8),o=1<<t%8;if(!(this.lookup[n]&o)&&(this.lookup[n]|=o,r.push(t),r.length===this.triangleCount))return}}}}function Q_(e,t,r){return Math.max(0,Math.min(r-1,Math.floor(e*t)))}function q_(e,t){const r=e.json.bufferViews[t.bufferView],i=D_[t.componentType];return new i(e.buffers[r.buffer],(t.byteOffset||0)+(r.byteOffset||0),t.count*(r.byteStride&&r.byteStride!==L_[t.type]*i.BYTES_PER_ELEMENT?r.byteStride/i.BYTES_PER_ELEMENT:L_[t.type]))}function X_(e,t,r,i){const n=D_[t.componentType],o=function(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(n),s=e.json.bufferViews[t.bufferView],a=s.byteStride?s.byteStride/n.BYTES_PER_ELEMENT:L_[t.type],l=r.float32,c=l.length/r.capacity;for(let e=0,r=0;e<t.count*a;e+=a,r+=c)for(let t=0;t<c;t++)l[r+t]=i[e+t]*o;r._trim()}function Y_(e,t,r){const i=e.indices,n=e.attributes,o={};o.indexArray=new Hl;const s=t.json.accessors[i],a=s.count/3;o.indexArray.reserve(a);const l=q_(t,s);for(let e=0;e<a;e++)o.indexArray.emplaceBack(l[3*e],l[3*e+1],l[3*e+2]);o.indexArray._trim(),o.vertexArray=new $l;const c=t.json.accessors[n.POSITION];o.vertexArray.reserve(c.count);const u=q_(t,c);for(let e=0;e<c.count;e++)o.vertexArray.emplaceBack(u[3*e],u[3*e+1],u[3*e+2]);if(o.vertexArray._trim(),o.aabb=new mh(c.min,c.max),o.centroid=function(e,t){const r=[0,0,0],i=e.length;if(i>0){for(let n=0;n<i;n++){const i=3*e[n];r[0]+=t[i],r[1]+=t[i+1],r[2]+=t[i+2]}r[0]/=i,r[1]/=i,r[2]/=i}return r}(l,u),void 0!==n.COLOR_0){const e=t.json.accessors[n.COLOR_0],r=L_[e.type],i=q_(t,e);o.colorArray=3===r?new $l:new Pl,o.colorArray.resize(e.count),X_(t,e,o.colorArray,i)}if(void 0!==n.NORMAL){o.normalArray=new $l;const e=t.json.accessors[n.NORMAL];o.normalArray.resize(e.count);const r=q_(t,e);X_(t,e,o.normalArray,r)}if(void 0!==n.TEXCOORD_0&&r.length>0){o.texcoordArray=new Dl;const e=t.json.accessors[n.TEXCOORD_0];o.texcoordArray.resize(e.count);const r=q_(t,e);X_(t,e,o.texcoordArray,r)}if(void 0!==n._FEATURE_ID_RGBA4444){const e=t.json.accessors[n._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=q_(t,e))}void 0!==n._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(q_(t,t.json.accessors[n._FEATURE_RGBA4444]).buffer));const h=e.material;return o.material=function(e,t){const{emissiveFactor:r=[0,0,0],alphaMode:i="OPAQUE",alphaCutoff:n=.5,normalTexture:o,occlusionTexture:s,emissiveTexture:a,doubleSided:l}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:u=1,roughnessFactor:h=1,baseColorTexture:d,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},f=s?t[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&f){const e=s.extensions.KHR_texture_transform;f.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new Ni(...c),metallicFactor:u,roughnessFactor:h,baseColorTexture:d?t[d.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:r,alphaMode:i,alphaCutoff:n,normalTexture:o?t[o.index]:void 0,occlusionTexture:f,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}}(void 0!==h?t.json.materials[h]:{defined:!1},r),o}function $_(t,r,i){const{matrix:n,rotation:o,translation:s,scale:a,mesh:l,extras:c,children:u}=t,h={};if(h.matrix=n||e.a9.fromRotationTranslationScale([],o||[0,0,0,1],s||[0,0,0],a||[1,1,1]),void 0!==l){h.meshes=i[l];const e=h.anchor=[0,0];for(const t of h.meshes){const{min:r,max:i}=t.aabb;e[0]+=r[0]+i[0],e[1]+=r[1]+i[1]}e[0]=Math.floor(e[0]/h.meshes.length/2),e[1]=Math.floor(e[1]/h.meshes.length/2)}if(c&&(c.id&&(h.id=c.id),c.lights&&(h.lights=function(e){if(!e.length)return[];const t=function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.codePointAt(e);return r}(e),r=[],i=t.length/24,n=new Uint16Array(t.buffer),o=new Float32Array(t.buffer);for(let e=0;e<i;e++){const t=n[2*e*6]/30,i=n[2*e*6+1]/30,s=n[2*e*6+10]/100,a=o[6*e+1],l=o[6*e+2],c=o[6*e+3],u=o[6*e+4],h=c-a,d=u-l,p=Math.hypot(h,d);r.push({pos:[a+.5*h,l+.5*d,i],normal:[d/p,-h/p,0],width:p,height:t,depth:s,points:[a,l,c,u]})}return r}(c.lights))),u){const e=[];for(const t of u)e.push($_(r.json.nodes[t],r,i));h.children=e}return h}function K_(e){if(0===e.vertices.length||0===e.indices.length)return null;const t=new W_(e.vertices,e.indices,8,256),[r,i]=[t.min.clone(),t.max.clone()];return{vertices:e.vertices,indices:e.indices,grid:t,min:r,max:i}}function J_(e){if(!e.extras||!e.extras.ground)return null;const t=e.extras.ground;if(!t||!Array.isArray(t)||0===t.length)return null;const r=t[0];if(!r||!Array.isArray(r)||0===r.length)return null;const i=[];for(const e of r){if(!Array.isArray(e)||2!==e.length)continue;const t=e[0],r=e[1];"number"==typeof t&&"number"==typeof r&&i.push(new Vt(t,r))}if(i.length<3)return null;i.length>1&&i[i.length-1].equals(i[0])&&i.pop();let n=0;for(let e=0;e<i.length;e++){const t=i[e],r=i[(e+1)%i.length],o=i[(e+2)%i.length];n+=(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)}n>0&&i.reverse();const o=jd(i.flatMap((e=>[e.x,e.y])),[]);return 0===o.length?null:{vertices:i,indices:o}}function ey(t,r){const i=[],n=[];let o=0;const s=[];for(const a of t){o=i.length;const t=a.vertexArray.float32,l=a.indexArray.uint16;for(let n=0;n<a.vertexArray.length;n++)s[0]=t[3*n+0],s[1]=t[3*n+1],s[2]=t[3*n+2],e.Q.transformMat4(s,s,r),i.push(new Vt(s[0],s[1]));for(let e=0;e<3*a.indexArray.length;e++)n.push(l[e]+o)}if(n.length%3!=0)return null;for(let e=0;e<n.length;e+=3){const t=i[n[e+0]],r=i[n[e+1]],o=i[n[e+2]];(t.x-r.x)*(o.y-r.y)-(o.x-r.x)*(t.y-r.y)>0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:i,indices:n}}function ty(e){const t=function(e,t){const r=[],i=WebGL2RenderingContext;if(e.json.textures)for(const n of e.json.textures){const o={magFilter:i.LINEAR,minFilter:i.NEAREST,wrapS:i.REPEAT,wrapT:i.REPEAT};void 0!==n.sampler&&Object.assign(o,e.json.samplers[n.sampler]),r.push({image:t[n.source],sampler:o,uploaded:!1})}return r}(e,e.images),r=function(e,t){const r=[];for(const i of e.json.meshes){const n=[];for(const r of i.primitives)n.push(Y_(r,e,t));r.push(n)}return r}(e,t),{scenes:i,scene:n,nodes:o}=e.json,s=i?i[n||0].nodes:o,a=[];for(const t of s)a.push($_(o[t],e,r));return function(e,t,r){const i={},n=new Set;for(let o=0;o<e.length;o++){const e=r[t[o]];if(!e.extras)continue;const s=e.extras["mapbox:footprint:version"],a=e.extras["mapbox:footprint:id"];(s||a)&&n.add(o),"1.0.0"===s&&a&&(i[a]=o)}for(let o=0;o<e.length;o++){if(n.has(o))continue;const s=e[o],a=r[t[o]];if(!a.extras)continue;let l=null;s.id in i&&(l=ey(e[i[s.id]].meshes,s.matrix)),l||(l=J_(a)),l&&(s.footprint=K_(l))}if(n.size>0){const t=Array.from(n.values()).sort(((e,t)=>e-t));for(let r=t.length-1;r>=0;r--)e.splice(t[r],1)}}(a,s,e.json.nodes),a}function ry(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,r=e.aabb.min[0]-1,i=e.aabb.min[1]-1,n=o_/(e.aabb.max[0]-r+2),o=o_/(e.aabb.max[1]-i+2);for(let s=0;s<t.length;s+=3){const a=t[s+2],l=(t[s+0]-r)*n|0,c=(t[s+1]-i)*o|0;a>e.heightmap[c*o_+l]&&(e.heightmap[c*o_+l]=a)}}function iy(t,r){const i={};i.indexArray=new Hl,i.indexArray.reserve(4*t.length),i.vertexArray=new $l,i.vertexArray.reserve(10*t.length),i.colorArray=new Pl,i.vertexArray.reserve(10*t.length);let n=0;for(const o of t){const t=Math.min(10,Math.max(4,1.3*o.height))*r,s=[-o.normal[1],o.normal[0],0],a=Math.min(.29,.1*o.width/o.depth),l=o.width-2*o.depth*r*(a+.01),c=e.Q.scaleAndAdd([],o.pos,s,l/2),u=e.Q.scaleAndAdd([],o.pos,s,-l/2),h=[c[0],c[1],c[2]+o.height],d=[u[0],u[1],u[2]+o.height],p=e.Q.scaleAndAdd([],o.normal,s,a);e.Q.scale(p,p,t);const f=e.Q.scaleAndAdd([],o.normal,s,-a);e.Q.scale(f,f,t),e.Q.add(p,c,p),e.Q.add(f,u,f),c[2]+=.1,u[2]+=.1,i.vertexArray.emplaceBack(p[0],p[1],p[2]),i.vertexArray.emplaceBack(f[0],f[1],f[2]),i.vertexArray.emplaceBack(c[0],c[1],c[2]),i.vertexArray.emplaceBack(u[0],u[1],u[2]),i.vertexArray.emplaceBack(h[0],h[1],h[2]),i.vertexArray.emplaceBack(d[0],d[1],d[2]),i.vertexArray.emplaceBack(c[0],c[1],c[2]),i.vertexArray.emplaceBack(u[0],u[1],u[2]),i.vertexArray.emplaceBack(p[0],p[1],p[2]),i.vertexArray.emplaceBack(f[0],f[1],f[2]);const m=l/t/2;i.colorArray.emplaceBack(-m-a,-1,m,.8),i.colorArray.emplaceBack(m+a,-1,m,.8),i.colorArray.emplaceBack(-m,0,m,1.3),i.colorArray.emplaceBack(m,0,m,1.3),i.colorArray.emplaceBack(m+a,-.8,m,.7),i.colorArray.emplaceBack(m+a,-.8,m,.7),i.colorArray.emplaceBack(0,0,m,1.3),i.colorArray.emplaceBack(0,0,m,1.3),i.colorArray.emplaceBack(m+a,-1.2,m,.8),i.colorArray.emplaceBack(m+a,-1.2,m,.8),i.indexArray.emplaceBack(6+n,4+n,8+n),i.indexArray.emplaceBack(7+n,9+n,5+n),i.indexArray.emplaceBack(0+n,1+n,2+n),i.indexArray.emplaceBack(1+n,3+n,2+n),n+=10}const o={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=Ni.white,o.pbrMetallicRoughness=s,i.material=o,i.aabb=new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),i}fa(W_,"TriangleGridIndex");class ny{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const oy=["tile","layer","source","sourceLayer","state"];class sy{constructor(e,t,r,i,n){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=r,this._y=i,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const t of oy)void 0!==this[t]&&(e[t]=this[t]);return e}}class ay{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new da(no,16,0),this.featureIndexArray=new hc,this.promoteId=t,this.is3DTile=!1}insert(e,t,r,i,n,o=0,s=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n,o);const l=this.grid;for(let e=0;e<t.length;e++){const r=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){const t=r[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}0!==s&&(i[0]-=s,i[1]-=s,i[2]+=s,i[3]+=s),i[0]<no&&i[1]<no&&i[2]>=0&&i[3]>=0&&l.insert(a,i[0],i[1],i[2],i[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new hp(new bm(this.rawTileData)).layers,this.sourceLayerCoder=new ny(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,r,i){this.loadVTLayers();const n=e.params||{},o=il(n.filter),s=e.tileResult,a=e.transform,l=s.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,r,i)=>Ku(s.bufferedTilespaceGeometry,e,t,r,i)));c.sort(cy);let u=null;a.elevation&&c.length>0&&(u=Lp.create(a.elevation,this.tileID));const h={};let d;for(let l=0;l<c.length;l++){const p=c[l];if(p===d)continue;d=p;const f=this.featureIndexArray.get(p);let m=null;if(this.is3DTile){const e=this.bucketLayerIDs[0][0],r=t[e];if("model"!==r.type)continue;const{queryFeature:i,intersectionZ:n}=r.queryIntersectsMatchingFeature(s,f.featureIndex,o,a);i&&this.appendToResult(h,e,f.featureIndex,i,n)}else this.loadMatchingFeature(h,f,o,n.layers,n.availableImages,t,r,i,((t,r,i,n=0)=>(m||(m=Ru(t,this.tileID.canonical,e.tileTransform)),r.queryIntersectsFeature(s,t,i,m,this.z,e.transform,e.pixelPosMatrix,u,n))))}return h}loadMatchingFeature(e,t,r,i,n,o,s,a,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:d}=t,p=this.bucketLayerIDs[u];if(i&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(i,p))return;const f=this.sourceLayerCoder.decode(h),m=this.vtLayers[f].feature(c);if(r.needGeometry){const e=Fu(m,!0);if(!r.filter(new Va(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!r.filter(new Va(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let t=0;t<p.length;t++){const r=p[t];if(i&&i.indexOf(r)<0)continue;const u=o[r];if(!u)continue;let h={};void 0!==g&&a&&(h=a.getState(u.sourceLayer||"_geojsonTileLayer",g));const f=!l||l(m,u,h,d);if(!f)continue;const A=new sy(m,this.z,this.x,this.y,g),_=Jt({},s[r]);_.paint=ly(_.paint,u.paint,m,h,n),_.layout=ly(_.layout,u.layout,m,h,n),A.layer=_,this.appendToResult(e,r,c,A,f)}}appendToResult(e,t,r,i,n){let o=e[t];void 0===o&&(o=e[t]=[]),o.push({featureIndex:r,feature:i,intersectionZ:n})}lookupSymbolFeatures(e,t,r,i,n,o,s,a){const l={};this.loadVTLayers();const c=il(n);for(const n of e)this.loadMatchingFeature(l,{bucketIndex:r,sourceLayerIndex:i,featureIndex:n,layoutVertexArrayOffset:0},c,o,s,a,t);return l}loadFeature(e){const{featureIndex:t,sourceLayerIndex:r}=e;this.loadVTLayers();const i=this.sourceLayerCoder.decode(r),n=this.vtFeatures[i];if(n[t])return n[t];const o=this.vtLayers[i].feature(t);return n[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){const i="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];null!=i&&(r=e.properties[i]),"boolean"==typeof r&&(r=Number(r))}return r}}function ly(e,t,r,i,n){return ar(e,((e,o)=>{const s=t instanceof qa?t.get(o):null;return s&&s.evaluate?s.evaluate(r,i,n):s}))}function cy(e,t){return t-e}fa(ay,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const uy=new Float32Array(262144),hy=new Uint8Array(262144);function dy(e){let t=0;if(e.meshes)for(const r of e.meshes)t=Math.max(t,r.aabb.max[2]);if(e.children)for(const r of e.children)t=Math.max(t,dy(r));return t}function py(e,t,r){if(e.meshes)for(const i of e.meshes)i.aabb.min[0]!==1/0&&r.insert(t,i.aabb.min[0],i.aabb.min[1],i.aabb.max[0],i.aabb.max[1]);if(e.children)for(const i of e.children)py(i,t,r)}const fy=["","wall","door","roof","window","lamp","logo"];class my{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.feature={type:"Point",id:e.id,geometry:[],properties:{height:dy(e)}}}getLocalBounds(){if(!this.node.meshes)return new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new mh([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const r of this.node.meshes)this.node.lightMeshIndex!==e&&t.encapsulate(r.aabb),e++;this.aabb=mh.applyTransform(t,this.node.matrix)}return this.aabb}}class gy{constructor(e,t,r,i,n,o){this.id=t,this.modelTraits|=s_.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,r&&(this.modelTraits|=s_.HasMapboxMeshFeatures),i&&(this.modelTraits|=s_.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=n,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[];for(const t of e)this.nodesInfo.push(new my(t)),py(t,o.featureIndexArray.length,o.grid),o.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,o.bucketLayerIDs.length-1,0)}update(){console.log("Update 3D model bucket")}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const r of t){const t=r.node;this.uploaded?this.updatePbrBuffer(t):u_(t,e,!0)}for(const e of t)h_(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const r of e.meshes)r.pbrBuffer&&(r.pbrBuffer.updateData(r.featureArray),t=!0);return t}needsReEvaluation(e,t,r){const i=e.transform.projectionOptions,n=e.style.getBrightness(),o=this.brightness!==n;return!!(!this.uploaded||this.dirty||i.name!==this.projection.name||Ay(r.paint.get("model-color").value,o)||Ay(r.paint.get("model-color-mix-intensity").value,o)||Ay(r.paint.get("model-roughness").value,o)||Ay(r.paint.get("model-emissive-strength").value,o)||Ay(r.paint.get("model-height-based-emissive-strength-multiplier").value,o))&&(this.projection=i,this.brightness=n,!0)}evaluateScale(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const r=this.getNodesInfo(),i=this.id.canonical;for(const e of r){const r=e.feature;e.evaluatedScale=t.paint.get("model-scale").evaluate(r,{},i)}}evaluate(e){const t=this.getNodesInfo();for(const r of t){if(!r.node.meshes)continue;const t=r.feature,i=r.node.meshes&&r.node.meshes[0].featureData,n=r.evaluatedColor[2],o=r.evaluatedRMEA[2],s=this.id.canonical;if(r.hasTranslucentParts=!1,i){for(let i=0;i<fy.length;i++){const n=fy[i];n.length&&(t.properties.part=n);const o=e.paint.get("model-color").evaluate(t,{},s),a=e.paint.get("model-color-mix-intensity").evaluate(t,{},s);r.evaluatedColor[i]=[o.r,o.g,o.b,a],r.evaluatedRMEA[i][0]=e.paint.get("model-roughness").evaluate(t,{},s),r.evaluatedRMEA[i][2]=e.paint.get("model-emissive-strength").evaluate(t,{},s),r.evaluatedRMEA[i][3]=o.a,r.emissionHeightBasedParams[i]=e.paint.get("model-height-based-emissive-strength-multiplier").evaluate(t,{},s),!r.hasTranslucentParts&&o.a<1&&(r.hasTranslucentParts=!0)}delete t.properties.part,yy(r,n!==r.evaluatedColor[2]||o!==r.evaluatedRMEA[2],this.modelTraits)}else r.evaluatedRMEA[0][2]=e.paint.get("model-emissive-strength").evaluate(t,{},s);r.evaluatedScale=e.paint.get("model-scale").evaluate(t,{},s),this.updatePbrBuffer(r.node)||(this.needsUpload=!0)}this.dirty=!1}elevationUpdate(e,t,r,i){const n=e.findDEMTileFor(r);if(n&&(n.tileID.canonical!==this.terrainTile||t!==this.terrainExaggeration)){if(n.dem&&n.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=n.tileID.overscaledZ;const t=Lp.create(e,r,n);if(!t)return;this.modelTraits&s_.HasMapboxMeshFeatures&&this.updateDEM(e,t,r,i);for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.vertices||!r.footprint.vertices.length)continue;const i=r.footprint.vertices;let n=t.getElevationAt(i[0].x,i[0].y,!0,!0);for(let e=1;e<i.length;e++)n=Math.min(n,t.getElevationAt(i[e].x,i[e].y,!0,!0));r.elevation=n}}this.terrainTile=n.tileID.canonical,this.terrainExaggeration=t}}updateDEM(e,t,r,i){let n=t._dem._modifiedForSources[i];if(void 0===n&&(t._dem._modifiedForSources[i]=[],n=t._dem._modifiedForSources[i]),n.includes(r.canonical))return;const o=t._dem.dim;n.push(r.canonical);let s=!1;for(const e of this.getNodesInfo()){const r=e.node;if(!r.footprint||!r.footprint.grid)continue;const i=r.footprint.grid,n=t.tileCoordToPixel(i.min.x,i.min.y),a=t.tileCoordToPixel(i.max.x,i.max.y),l=Math.min(Math.min(o-a.y,n.x),Math.min(n.y,o-a.x));if(l<0)continue;const c=Xt(l,2,5);let u=Math.max(0,n.x-c),h=Math.max(0,n.y-c),d=Math.min(a.x+c,o-1),p=Math.min(a.y+c,o-1);for(let e=h;e<=p;++e)for(let t=u;t<=d;++t)hy[e*o+t]=255;let f=0,m=0;for(let e=0;e<i.cellsY;++e)for(let r=0;r<i.cellsX;++r){if(!i.cells[e*i.cellsX+r])continue;const n=t.tileCoordToPixel(i.min.x+r/i.xScale,i.min.y+e/i.yScale),s=t.tileCoordToPixel(i.min.x+(r+1)/i.xScale,i.min.y+(e+1)/i.yScale);for(let e=n.y;e<=Math.min(s.y+1,o-1);++e)for(let r=n.x;r<=Math.min(s.x+1,o-1);++r)255===hy[e*o+r]&&(hy[e*o+r]=0,f+=t.getElevationAtPixel(r,e),m++)}const g=f/m;u=Math.max(1,n.x-c),h=Math.max(1,n.y-c),d=Math.min(a.x+c,o-2),p=Math.min(a.y+c,o-2),s=!0;for(let e=h;e<=p;++e)for(let r=u;r<=d;++r)0===hy[e*o+r]&&(uy[e*o+r]=t._dem.set(r,e,g));for(let e=1;e<c;++e){u=Math.max(1,n.x-e),h=Math.max(1,n.y-e),d=Math.min(a.x+e,o-2),p=Math.min(a.y+e,o-2);for(let r=h;r<=p;++r)for(let i=u;i<=d;++i){const n=r*o+i;if(255===hy[n]){let s=0,a=0,l=-1,u=-1;for(let t=-1;t<=1;++t)for(let n=-1;n<=1;++n){const c=(r+t)*o+i+n;if(hy[c]>=e)continue;const h=uy[c],d=Math.abs(h);d>a&&(s=h,a=d,l=n,u=t)}if(a>.1){const o=1-(e+.5*Math.abs(l*u))/c;let a=t._dem.get(i,r)+s*o;const h=t._dem.get(i+l,r+u),d=t._dem.get(i-l,r-u,!0);(a-h)*(a-d)>0&&(a=(h+d)/2),uy[n]=t._dem.set(i,r,a),hy[n]=e}}}}}s&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=Dr.now())}getNodesInfo(){return this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)h_(t.node),d_(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const r=t.getReplacementRegionsForTile(e.toUnwrapped()),i=this.getNodesInfo();for(let e=0;e<this.nodesInfo.length;e++){const t=i[e].node;i[e].hiddenByReplacement=!!t.footprint&&!r.find((e=>e.footprint===t.footprint))}}getHeightAtTileCoord(t,r){const i=this.getNodesInfo(),n=[],o=[0,0,0];for(let s=0;s<this.nodesInfo.length;s++){const a=i[s],l=a.node.meshes[0],c=mh.applyTransform(l.aabb,a.node.matrix);if(t<c.min[0]||r<c.min[1]||t>c.max[0]||r>c.max[1])continue;const u=(t-l.aabb.min[0])/(l.aabb.max[0]-l.aabb.min[0])*o_|0,h=Math.min(63,(r-l.aabb.min[1])/(l.aabb.max[1]-l.aabb.min[1])*o_|0)*o_+Math.min(63,u);if(o[2]=l.heightmap[h],e.Q.transformMat4(o,o,a.node.matrix),!(l.heightmap[h]<0&&a.node.footprint)){if(a.hiddenByReplacement)return;return{height:o[2],maxHeight:a.feature.properties.height,hidden:!1,verticalScale:a.evaluatedScale[2]}}if(a.node.footprint.grid.query(new Vt(t,r),new Vt(t,r),n),n.length>0)return{height:void 0,maxHeight:a.feature.properties.height,hidden:a.hiddenByReplacement,verticalScale:a.evaluatedScale[2]}}}}function Ay(e,t){return!e.isLightConstant&&t}function _y(e,t,r,i,n,o,s,a){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,u=240&t|(240&t)>>4;r[3]>0&&(l=Ui(l,255*r[0],r[3]),c=Ui(c,255*r[1],r[3]),u=Ui(u,255*r[2],r[3]));const h=l<<8|c,d=u<<8|Math.floor(255*i[3]),p=function(e){const t=Xt(e,0,2);return Math.min(Math.round(.5*t*255),255)}(i[2])<<8|15*i[0]<<4|15*i[1],f=Xt(n[0],0,1),m=Xt(n[1],0,1),g=Xt(n[2],0,1),A=Xt(n[3],0,1);let _,y,x,v;if(f!==m&&s!==o&&m!==f){const e=s-o;y=1/(e*(m-f)),x=-(o+e*f)/(e*(m-f));const t=Xt(n[4],-1,1);v=Math.pow(10,t),_=255*g<<8|255*A}else _=65535,y=0,x=1,v=1;if(e.emplaceBack(h,d,p,_,y,x,v),a){const e=a.length;a.clear();for(let t=0;t<e;t++)a.emplaceBack(h,d,p,_,y,x,v)}}function yy(e,t,r){const i=e.node;let n=0;const o=r&s_.HasMeshoptCompression;for(const r of i.meshes){if(i.lights&&i.lightMeshIndex===n)continue;if(!r.featureData)continue;r.featureArray=new Jl,r.featureArray.reserve(r.featureData.length);let s=t;for(const t of r.featureData){const n=o?65535&t:t>>16&65535,a=o?t>>16&65535:65535&t,l=(15&a)<8?15&a:0,c=e.evaluatedRMEA[l],u=e.evaluatedColor[l],h=e.emissionHeightBasedParams[l];let d;if(s&&2===l&&i.lights&&(d=new Jl,d.resize(10*i.lights.length)),_y(r.featureArray,n,u,c,h,r.aabb.min[2],r.aabb.max[2],d),d&&s){s=!1;const e=i.meshes[i.lightMeshIndex];e.featureArray=d,e.featureArray._trim()}}r.featureArray._trim(),n++}}function xy(e,t,r,i){const n=1<<e.z;t.lat=bu((i/no+e.y)/n),t.lng=vu((r/no+e.x)/n)}fa(gy,"Tiled3dModelBucket",{omit:["layers"]}),fa(my,"Tiled3dModelFeature");const vy={circle:class extends yl{constructor(e,t,r){super(e,ah,t,r)}createBucket(e){return new Nu(e)}queryRadius(e){const t=e;return rh("circle-radius",this,t)+rh("circle-stroke-width",this,t)+ih(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,i,n,o,s,a){const l=oh(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r);return Qh(e,i,o,s,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getDefaultProgramParams(e,t){const r=Wh(this);return{config:new Nc(this,t),defines:r,overrideFog:!1}}},heatmap:class extends yl{createBucket(e){return new Kh(e)}constructor(e,t,r){super(e,sd,t,r),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ad({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(e){return rh("heatmap-radius",this,e)}queryIntersectsFeature(e,t,r,i,n,o,s,a){const l=this.paint.get("heatmap-radius").evaluate(t,r);return Qh(e,i,o,s,a,!0,!0,new Vt(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(e,t){return"heatmap"===e?{config:new Nc(this,t),overrideFog:!1}:{}}},hillshade:class extends yl{constructor(e,t,r){super(e,cd,t,r)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(e,t){return{overrideFog:!1}}},fill:class extends yl{constructor(e,t,r){super(e,Wd,t,r)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),r=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(e,t){return{config:new Nc(this,t),overrideFog:!1}}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Gd(e)}queryRadius(){return ih(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,i,n,o){return!e.queryGeometry.isAboveHorizon&&Gu(nh(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),i)}isTileClipped(){return!0}},"fill-extrusion":class extends yl{constructor(e,t,r){super(e,uf,t,r),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new $p(e)}queryRadius(){return ih(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}hasShadowPass(){return!0}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(t,r,i,n,o,s,a,l,c){const u=oh(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(r,i),d=this.paint.get("fill-extrusion-base").evaluate(r,i),p=[0,0],f=l&&s.elevation,m=s.elevation?s.elevation.exaggeration():1,g=t.tile.getBucket(this);if(f&&g instanceof $p){const e=g.centroidVertexArray,t=c+1;t<e.length&&(p[0]=e.geta_centroid_pos0(t),p[1]=e.geta_centroid_pos1(t))}if(0===p[0]&&1===p[1])return!1;"globe"===s.projection.name&&(n=af([n],[new Vt(0,0),new Vt(no,no)],t.tileID.canonical).map((e=>e.polygon)).flat());const A=f?l:null,[_,y]=function(t,r,i,n,o,s,a,l,c,u,h){return"globe"===t.projection.name?function(t,r,i,n,o,s,a,l,c,u,h){const d=[],p=[],f=t.projection.upVectorScale(h,t.center.lat,t.worldSize).metersToTile,m=[0,0,0,1],g=[0,0,0,1],A=(e,t,r,i)=>{e[0]=t,e[1]=r,e[2]=i,e[3]=1},_=sf();i>0&&(i+=_),n+=_;for(const _ of r){const r=[],y=[];for(const d of _){const p=d.x+o.x,_=d.y+o.y,x=t.projection.projectTilePoint(p,_,h),v=t.projection.upVector(h,d.x,d.y);let b=i,w=n;if(a){const e=ff(p,_,i,n,a,l,c,u);b+=e.base,w+=e.top}0!==i?A(m,x.x+v[0]*f*b,x.y+v[1]*f*b,x.z+v[2]*f*b):A(m,x.x,x.y,x.z),A(g,x.x+v[0]*f*w,x.y+v[1]*f*w,x.z+v[2]*f*w),e.Q.transformMat4(m,m,s),e.Q.transformMat4(g,g,s),r.push(new hf(m[0],m[1],m[2])),y.push(new hf(g[0],g[1],g[2]))}d.push(r),p.push(y)}return[d,p]}(t,r,i,n,o,s,a,l,c,u,h):a?function(t,r,i,n,o,s,a,l,c){const u=[],h=[],d=[0,0,0,1];for(const p of t){const t=[],f=[];for(const u of p){const h=u.x+n.x,p=u.y+n.y,m=ff(h,p,r,i,s,a,l,c);d[0]=h,d[1]=p,d[2]=m.base,d[3]=1,e.aa.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const g=new hf(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=h,d[1]=p,d[2]=m.top,d[3]=1,e.aa.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const A=new hf(d[0]/d[3],d[1]/d[3],d[2]/d[3]);t.push(g),f.push(A)}u.push(t),h.push(f)}return[u,h]}(r,i,n,o,s,a,l,c,u):function(e,t,r,i,n){const o=[],s=[],a=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,h=n[8]*r,d=n[9]*r,p=n[10]*r,f=n[11]*r;for(const t of e){const e=[],r=[];for(const o of t){const t=o.x+i.x,s=o.y+i.y,m=n[0]*t+n[4]*s+n[12],g=n[1]*t+n[5]*s+n[13],A=n[2]*t+n[6]*s+n[14],_=n[3]*t+n[7]*s+n[15],y=m+a,x=g+l,v=A+c,b=Math.max(_+u,1e-5),w=m+h,C=g+d,T=A+p,E=Math.max(_+f,1e-5);e.push(new hf(y/b,x/b,v/b)),r.push(new hf(w/E,C/E,T/E))}o.push(e),s.push(r)}return[o,s]}(r,i,n,o,s)}(s,n,d,h,u,a,A,p,m,s.center.lat,t.tileID.canonical),x=t.queryGeometry;return function(e,t,r){let i=1/0;Gu(r,t)&&(i=pf(r,t[0]));for(let n=0;n<t.length;n++){const o=t[n],s=e[n];for(let e=0;e<o.length-1;e++){const t=o[e],n=[t,o[e+1],s[e+1],s[e],t];Uu(r,n)&&(i=Math.min(i,pf(r,n)))}}return i!==1/0&&i}(_,y,x.isPointQuery()?x.screenBounds:x.screenGeometry)}},line:class extends yl{constructor(e,t,r){super(e,Mf,t,r),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Qo,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Lf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Tf(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t){const r=Df(this);return{config:new Nc(this,t),defines:r,overrideFog:!1}}queryRadius(e){const t=e,r=Of(rh("line-width",this,t),rh("line-gap-width",this,t)),i=rh("line-offset",this,t);return r/2+Math.abs(i)+ih(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,i,n,o){if(e.queryGeometry.isAboveHorizon)return!1;const s=nh(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*Of(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),l=this.paint.get("line-offset").evaluate(t,r);return l&&(i=function(e,t){const r=[],i=new Vt(0,0);for(let n=0;n<e.length;n++){const o=e[n],s=[];for(let e=0;e<o.length;e++){const r=o[e],n=o[e+1],a=0===e?i:r.sub(o[e-1])._unit()._perp(),l=e===o.length-1?i:n.sub(r)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),s.push(c._mult(t)._add(r))}r.push(s)}return r}(i,l*e.pixelToTileUnitsFactor)),function(e,t,r){for(let i=0;i<t.length;i++){const n=t[i];if(e.length>=3)for(let t=0;t<n.length;t++)if($u(e,n[t]))return!0;if(Zu(e,n,r))return!0}return!1}(s,i,a)}isTileClipped(){return!0}},symbol:pA,background:class extends yl{constructor(e,t,r){super(e,mA,t,r)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(e,t){return{overrideFog:!1}}},raster:EA,"raster-particle":IA,sky:class extends yl{constructor(e,t,r){super(e,kA,t,r),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=ad({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),i=!r,n=e.style.light,o=n.properties.get("position");return i&&"viewport"===n.properties.get("anchor")&&hr("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),i?LA(o.azimuthal,90-o.polar,t):LA(r[0],90-r[1],t)}const r=this.paint.get("sky-gradient-center");return LA(r[0],90-r[1],t)}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}},slot:class extends yl{constructor(e,t,r){super(e,OA,t)}},model:class extends yl{constructor(e,t,r){super(e,n_,t,r),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(e){return new r_(e)}getProgramIds(){return["model"]}is3D(){return!0}hasShadowPass(){return!0}canCastShadows(){return!0}hasLightBeamPass(){return!0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(e){return e instanceof gy?no-1:0}queryIntersectsFeature(t,r,i,n,o,s){if(!this.modelManager)return!1;const a=this.modelManager,l=t.tile.getBucket(this);if(!(l&&l instanceof r_))return!1;const c=l;for(const i in c.instancesPerModel){const n=c.instancesPerModel[i],o=void 0!==r.id?r.id:r.properties&&r.properties.hasOwnProperty("id")?r.properties.id:void 0;if(n.idToFeaturesIndex.hasOwnProperty(o)){const r=n.features[n.idToFeaturesIndex[o]],l=a.getModel(i,this.scope);if(!l)return!1;let u=e.a9.create();const h=new su(0,0),d=c.canonical;let p=Number.MAX_VALUE;for(let i=0;i<r.instancedDataCount;++i){const o=16*(r.instancedDataOffset+i),a=n.instancedDataArray.float32,c=[a[o+4],a[o+5],a[o+6]];xy(d,h,a[o],0|a[o+1]),a_(u,l,s,h,r.rotation,r.scale,c,!1,!1,!1),"globe"===s.projection.name&&(u=HA(u,s));const f=e.a9.multiply([],s.projMatrix,u),m=t.queryGeometry,g=GA(m.isPointQuery()?m.screenBounds:m.screenGeometry,s,f,l.aabb);null!=g&&(p=Math.min(g,p))}return p!==Number.MAX_VALUE&&p}}return!1}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven()||"model-color"!==e&&"model-color-mix-intensity"!==e&&"model-rotation"!==e&&"model-scale"!==e&&"model-translation"!==e&&"model-emissive-strength"!==e)}_isPropertyZoomDependent(e){const t=this._transitionablePaint._values[e];return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof oa}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}queryIntersectsMatchingFeature(t,r,i,n){const o=t.tile,s=o.getBucket(this);let a=null,l=Number.MAX_VALUE;if(!(s&&s instanceof gy))return{queryFeature:a,intersectionZ:l};const c=s.getNodesInfo()[r];if(c.hiddenByReplacement||!c.node.meshes||!i.filter(new Va(o.tileID.overscaledZ),c.feature,o.tileID.canonical))return{queryFeature:a,intersectionZ:l};const u=c.node,h=n.calculatePosMatrix(o.tileID.toUnwrapped(),n.worldSize),d=c.evaluatedScale;let p=0;n.elevation&&u.elevation&&(p=u.elevation*n.elevation.exaggeration()),e.a9.translate(h,h,[(u.anchor?u.anchor[0]:0)*(d[0]-1),(u.anchor?u.anchor[1]:0)*(d[1]-1),p]),e.a9.scale(h,h,d),e.a9.multiply(h,h,u.matrix);const f=t.queryGeometry,m=f.isPointQuery()?f.screenBounds:f.screenGeometry,g=function(t){const r=e.a9.multiply([],h,t.matrix),i=e.a9.multiply(r,n.expandedFarZProjMatrix,r);for(let e=0;e<t.meshes.length;++e){const r=t.meshes[e];if(e===t.lightMeshIndex)continue;const o=GA(m,n,i,r.aabb);null!=o&&(l=Math.min(o,l))}if(t.children)for(const e of t.children)g(e)};if(g(u),l===Number.MAX_VALUE)return{queryFeature:a,intersectionZ:l};const A=new su(0,0);return xy(o.tileID.canonical,A,c.node.anchor[0],c.node.anchor[1]),a={type:"Feature",geometry:{type:"Point",coordinates:[A.lng,A.lat]},properties:c.feature.properties,id:c.feature.id,state:{},layer:this.serialize()},{queryFeature:a,intersectionZ:l}}}},by={read:function(e,t){return e.readFields(by._readField,{header_length:0,x:0,y:0,z:0,layers:[]},t)},_readField:function(e,t,r){1===e?t.header_length=r.readFixed32():2===e?t.x=r.readVarint():3===e?t.y=r.readVarint():4===e?t.z=r.readVarint():5===e&&t.layers.push(by.Layer.read(r,r.readVarint()+r.pos))},PixelFormat:{PIXEL_FORMAT_UNKNOWN:{value:0,options:{}},PIXEL_FORMAT_UINT32:{value:1,options:{}},PIXEL_FORMAT_UINT16:{value:2,options:{}},PIXEL_FORMAT_UINT8:{value:3,options:{}}},Filter:{}};by.Filter.read=function(e,t){return e.readFields(by.Filter._readField,{delta_filter:null,filter:null,zigzag_filter:null,bitshuffle_filter:null,byteshuffle_filter:null},t)},by.Filter._readField=function(e,t,r){1===e?(t.delta_filter=by.Filter.Delta.read(r,r.readVarint()+r.pos),t.filter="delta_filter"):2===e?(t.zigzag_filter=by.Filter.Zigzag.read(r,r.readVarint()+r.pos),t.filter="zigzag_filter"):3===e?(t.bitshuffle_filter=by.Filter.BitShuffle.read(r,r.readVarint()+r.pos),t.filter="bitshuffle_filter"):4===e&&(t.byteshuffle_filter=by.Filter.ByteShuffle.read(r,r.readVarint()+r.pos),t.filter="byteshuffle_filter")},by.Filter.Delta={},by.Filter.Delta.read=function(e,t){return e.readFields(by.Filter.Delta._readField,{block_size:0},t)},by.Filter.Delta._readField=function(e,t,r){1===e&&(t.block_size=r.readVarint())},by.Filter.Zigzag={},by.Filter.Zigzag.read=function(e,t){return e.readFields(by.Filter.Zigzag._readField,{},t)},by.Filter.Zigzag._readField=function(e,t,r){},by.Filter.BitShuffle={},by.Filter.BitShuffle.read=function(e,t){return e.readFields(by.Filter.BitShuffle._readField,{},t)},by.Filter.BitShuffle._readField=function(e,t,r){},by.Filter.ByteShuffle={},by.Filter.ByteShuffle.read=function(e,t){return e.readFields(by.Filter.ByteShuffle._readField,{},t)},by.Filter.ByteShuffle._readField=function(e,t,r){},by.Codec={},by.Codec.read=function(e,t){return e.readFields(by.Codec._readField,{gzip_data:null,codec:null,jpeg_image:null,webp_image:null,png_image:null},t)},by.Codec._readField=function(e,t,r){1===e?(t.gzip_data=by.Codec.GzipData.read(r,r.readVarint()+r.pos),t.codec="gzip_data"):2===e?(t.jpeg_image=by.Codec.JpegImage.read(r,r.readVarint()+r.pos),t.codec="jpeg_image"):3===e?(t.webp_image=by.Codec.WebpImage.read(r,r.readVarint()+r.pos),t.codec="webp_image"):4===e&&(t.png_image=by.Codec.PngImage.read(r,r.readVarint()+r.pos),t.codec="png_image")},by.Codec.GzipData={},by.Codec.GzipData.read=function(e,t){return e.readFields(by.Codec.GzipData._readField,{},t)},by.Codec.GzipData._readField=function(e,t,r){},by.Codec.JpegImage={},by.Codec.JpegImage.read=function(e,t){return e.readFields(by.Codec.JpegImage._readField,{},t)},by.Codec.JpegImage._readField=function(e,t,r){},by.Codec.WebpImage={},by.Codec.WebpImage.read=function(e,t){return e.readFields(by.Codec.WebpImage._readField,{},t)},by.Codec.WebpImage._readField=function(e,t,r){},by.Codec.PngImage={},by.Codec.PngImage.read=function(e,t){return e.readFields(by.Codec.PngImage._readField,{},t)},by.Codec.PngImage._readField=function(e,t,r){},by.DataIndexEntry={},by.DataIndexEntry.read=function(e,t){return e.readFields(by.DataIndexEntry._readField,{first_byte:0,last_byte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},t)},by.DataIndexEntry._readField=function(e,t,r){1===e?t.first_byte=r.readFixed64():2===e?t.last_byte=r.readFixed64():3===e?t.filters.push(by.Filter.read(r,r.readVarint()+r.pos)):4===e?t.codec=by.Codec.read(r,r.readVarint()+r.pos):5===e?t.offset=r.readFloat():6===e?t.scale=r.readFloat():7===e&&t.bands.push(r.readString())},by.Layer={},by.Layer.read=function(e,t){return e.readFields(by.Layer._readField,{version:0,name:"",units:"",tilesize:0,buffer:0,pixel_format:0,data_index:[]},t)},by.Layer._readField=function(e,t,r){1===e?t.version=r.readVarint():2===e?t.name=r.readString():3===e?t.units=r.readString():4===e?t.tilesize=r.readVarint():5===e?t.buffer=r.readVarint():6===e?t.pixel_format=r.readVarint():7===e&&t.data_index.push(by.DataIndexEntry.read(r,r.readVarint()+r.pos))};const wy={read:function(e,t){return e.readFields(wy._readField,{uint32_values:null,values:null,fixed32_values:null},t)},_readField:function(e,t,r){2===e?(t.uint32_values=wy.Uint32Values.read(r,r.readVarint()+r.pos),t.values="uint32_values"):3===e&&(t.fixed32_values=wy.Fixed32Values.read(r,r.readVarint()+r.pos),t.values="fixed32_values")},Uint32Values:{}};wy.Uint32Values.read=function(e,t){return e.readFields(wy.Uint32Values._readField,{values:[]},t)},wy.Uint32Values._readField=function(e,t,r){1===e&&(t.readValuesInto=function(e){if(2!==e.type)throw new Error(`Unsupported pbf type "${e.type}"`);const t=function(e){return 2===e.type?e.readVarint()+e.pos:e.pos+1}(e),r=e.pos;return e.pos=t,function(i){e.pos=r;let n=0;for(;e.pos<t;){const t=e.readVarint();i[n++]=t}return i}}(r))},wy.Fixed32Values={},wy.Fixed32Values.read=function(e,t){return e.readFields(wy.Fixed32Values._readField,{values:[]},t)},wy.Fixed32Values._readField=function(e,t,r){throw new Error("Not implemented")};
|
|
36
36
|
/**
|