@twinmatrix/spatialverse-sdk-web 3.1.4 → 3.1.5
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/lib/cjs/index.js +1 -1
- package/lib/cjs/react/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/react/index.js +1 -1
- package/lib/types/meta-atlas-sdk/meta-atlas-sdk.d.ts +1 -1
- package/lib/types/meta-atlas-sdk/meta-atlas-sdk.d.ts.map +1 -1
- package/lib/types/react/MetaAtlasMap.d.ts +1 -1
- package/lib/types/react/MetaAtlasMap.d.ts.map +1 -1
- package/lib/types/react/types/index.d.ts +6 -0
- package/lib/types/react/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -665,4 +665,4 @@ async function(){if(!BK())return YY.warn(JY.create("indexeddb-unavailable",{erro
|
|
|
665
665
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
666
666
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
667
667
|
*/
|
|
668
|
-
!function(e,t){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,l=128,f=1/0,c=9007199254740991,u=NaN,h=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],d="[object Arguments]",A="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",w="[object Function]",v="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",j="[object Promise]",E="[object RegExp]",T="[object Set]",C="[object String]",k="[object Symbol]",S="[object WeakMap]",I="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",q="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",F="[object Uint8ClampedArray]",D="[object Uint16Array]",N="[object Uint32Array]",z=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,W=RegExp(G.source),Q=RegExp(V.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,de=/^\[object .+?Constructor\]$/,Ae=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,we=/['\n\r\u2028\u2029\\]/g,ve="\\ud800-\\udfff",ye="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\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",Ce="["+ve+"]",ke="["+Te+"]",Se="["+ye+"]",Ie="\\d+",Pe="["+_e+"]",Me="["+xe+"]",qe="[^"+ve+Te+Ie+_e+xe+je+"]",Be="\\ud83c[\\udffb-\\udfff]",Re="[^"+ve+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+je+"]",De="\\u200d",Ne="(?:"+Me+"|"+qe+")",ze="(?:"+Fe+"|"+qe+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Se+"|"+Be+")?",Ve="["+Ee+"]?",We=Ve+Ge+"(?:"+De+"(?:"+[Re,Le,Oe].join("|")+")"+Ve+Ge+")*",Qe="(?:"+[Pe,Le,Oe].join("|")+")"+We,Ke="(?:"+[Re+Se+"?",Se,Le,Oe,Ce].join("|")+")",Xe=RegExp("['’]","g"),Ye=RegExp(Se,"g"),Je=RegExp(Be+"(?="+Be+")|"+Ke+We,"g"),$e=RegExp([Fe+"?"+Me+"+"+He+"(?="+[ke,Fe,"$"].join("|")+")",ze+"+"+Ue+"(?="+[ke,Fe+Ne,"$"].join("|")+")",Fe+"?"+Ne+"+"+He,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,Qe].join("|"),"g"),Ze=RegExp("["+De+ve+ye+Ee+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["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"],nt=-1,rt={};rt[M]=rt[q]=rt[B]=rt[R]=rt[L]=rt[O]=rt[F]=rt[D]=rt[N]=!0,rt[d]=rt[A]=rt[I]=rt[m]=rt[P]=rt[g]=rt[b]=rt[w]=rt[y]=rt[_]=rt[x]=rt[E]=rt[T]=rt[C]=rt[S]=!1;var it={};it[d]=it[A]=it[I]=it[P]=it[m]=it[g]=it[M]=it[q]=it[B]=it[R]=it[L]=it[y]=it[_]=it[x]=it[E]=it[T]=it[C]=it[k]=it[O]=it[F]=it[D]=it[N]=!0,it[b]=it[w]=it[S]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,at=parseInt,lt="object"==typeof i&&i&&i.Object===Object&&i,ft="object"==typeof self&&self&&self.Object===Object&&self,ct=lt||ft||Function("return this")(),ut=t&&!t.nodeType&&t,ht=ut&&e&&!e.nodeType&&e,pt=ht&&ht.exports===ut,dt=pt&<.process,At=function(){try{return ht&&ht.require&&ht.require("util").types||dt&&dt.binding&&dt.binding("util")}catch(e){}}(),mt=At&&At.isArrayBuffer,gt=At&&At.isDate,bt=At&&At.isMap,wt=At&&At.isRegExp,vt=At&&At.isSet,yt=At&&At.isTypedArray;function _t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function xt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Ct(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Ft(e,t,0)>-1}function St(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Mt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function qt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Bt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rt=Ht("length");function Lt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Ot(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Ot(e,Nt,n)}function Dt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Nt(e){return e!=e}function zt(e,t){var n=null==e?0:e.length;return n?Vt(e,t)/n:u}function Ht(e){return function(t){return null==t?n:t[e]}}function Ut(e){return function(t){return null==e?n:e[t]}}function Gt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Vt(e,t){for(var r,i=-1,o=e.length;++i<o;){var s=t(e[i]);s!==n&&(r=r===n?s:r+s)}return r}function Wt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Qt(e){return e?e.slice(0,un(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return It(t,function(t){return e[t]})}function Yt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var Zt=Ut({"À":"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"}),en=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function tn(e){return"\\"+ot[e]}function nn(e){return Ze.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function fn(e){return nn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Rt(e)}function cn(e){return nn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function un(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var hn=Ut({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function e(t){var i=(t=null==t?ct:pn.defaults(ct.Object(),t,pn.pick(ct,tt))).Array,re=t.Date,ve=t.Error,ye=t.Function,_e=t.Math,xe=t.Object,je=t.RegExp,Ee=t.String,Te=t.TypeError,Ce=i.prototype,ke=ye.prototype,Se=xe.prototype,Ie=t["__core-js_shared__"],Pe=ke.toString,Me=Se.hasOwnProperty,qe=0,Be=function(){var e=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Re=Se.toString,Le=Pe.call(xe),Oe=ct._,Fe=je("^"+Pe.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=pt?t.Buffer:n,Ne=t.Symbol,ze=t.Uint8Array,He=De?De.allocUnsafe:n,Ue=on(xe.getPrototypeOf,xe),Ge=xe.create,Ve=Se.propertyIsEnumerable,We=Ce.splice,Qe=Ne?Ne.isConcatSpreadable:n,Ke=Ne?Ne.iterator:n,Je=Ne?Ne.toStringTag:n,Ze=function(){try{var e=ao(xe,"defineProperty");return e({},"",{}),e}catch(e){}}(),ot=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,lt=re&&re.now!==ct.Date.now&&re.now,ft=t.setTimeout!==ct.setTimeout&&t.setTimeout,ut=_e.ceil,ht=_e.floor,dt=xe.getOwnPropertySymbols,At=De?De.isBuffer:n,Rt=t.isFinite,Ut=Ce.join,dn=on(xe.keys,xe),An=_e.max,mn=_e.min,gn=re.now,bn=t.parseInt,wn=_e.random,vn=Ce.reverse,yn=ao(t,"DataView"),_n=ao(t,"Map"),xn=ao(t,"Promise"),jn=ao(t,"Set"),En=ao(t,"WeakMap"),Tn=ao(xe,"create"),Cn=En&&new En,kn={},Sn=Bo(yn),In=Bo(_n),Pn=Bo(xn),Mn=Bo(jn),qn=Bo(En),Bn=Ne?Ne.prototype:n,Rn=Bn?Bn.valueOf:n,Ln=Bn?Bn.toString:n;function On(e){if(Js(e)&&!Ns(e)&&!(e instanceof zn)){if(e instanceof Nn)return e;if(Me.call(e,"__wrapped__"))return Ro(e)}return new Nn(e)}var Fn=function(){function e(){}return function(t){if(!Ys(t))return{};if(Ge)return Ge(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Dn(){}function Nn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function Wn(e){var t=this.__data__=new Un(e);this.size=t.size}function Qn(e,t){var n=Ns(e),r=!n&&Ds(e),i=!n&&!r&&Gs(e),o=!n&&!r&&!i&&oa(e),s=n||r||i||o,a=s?Wt(e.length,Ee):[],l=a.length;for(var f in e)!t&&!Me.call(e,f)||s&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||Ao(f,l))||a.push(f);return a}function Kn(e){var t=e.length;return t?e[Gr(0,t-1)]:n}function Xn(e,t){return Po(Ei(e),ir(t,0,e.length))}function Yn(e){return Po(Ei(e))}function Jn(e,t,r){(r!==n&&!Ls(e[t],r)||r===n&&!(t in e))&&nr(e,t,r)}function $n(e,t,r){var i=e[t];Me.call(e,t)&&Ls(i,r)&&(r!==n||t in e)||nr(e,t,r)}function Zn(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function er(e,t,n,r){return fr(e,function(e,i,o){t(r,e,n(e),o)}),r}function tr(e,t){return e&&Ti(t,Ca(t),e)}function nr(e,t,n){"__proto__"==t&&Ze?Ze(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function rr(e,t){for(var r=-1,o=t.length,s=i(o),a=null==e;++r<o;)s[r]=a?n:_a(e,t[r]);return s}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function or(e,t,r,i,o,s){var a,l=1&t,f=2&t,c=4&t;if(r&&(a=o?r(e,i,o,s):r(e)),a!==n)return a;if(!Ys(e))return e;var u=Ns(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ei(e,a)}else{var h=co(e),p=h==w||h==v;if(Gs(e))return wi(e,l);if(h==x||h==d||p&&!o){if(a=f||p?{}:ho(e),!l)return f?function(e,t){return Ti(e,fo(e),t)}(e,function(e,t){return e&&Ti(t,ka(t),e)}(a,e)):function(e,t){return Ti(e,lo(e),t)}(e,tr(a,e))}else{if(!it[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case I:return vi(e);case m:case g:return new i(+e);case P:return function(e,t){var n=t?vi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case q:case B:case R:case L:case O:case F:case D:case N:return yi(e,n);case y:return new i;case _:case C:return new i(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new i;case k:return r=e,Rn?xe(Rn.call(r)):{}}}(e,h,l)}}s||(s=new Wn);var A=s.get(e);if(A)return A;s.set(e,a),na(e)?e.forEach(function(n){a.add(or(n,t,r,n,e,s))}):$s(e)&&e.forEach(function(n,i){a.set(i,or(n,t,r,i,e,s))});var b=u?n:(c?f?eo:Zi:f?ka:Ca)(e);return jt(b||e,function(n,i){b&&(n=e[i=n]),$n(a,i,or(n,t,r,i,e,s))}),a}function sr(e,t,r){var i=r.length;if(null==e)return!i;for(e=xe(e);i--;){var o=r[i],s=t[o],a=e[o];if(a===n&&!(o in e)||!s(a))return!1}return!0}function ar(e,t,i){if("function"!=typeof e)throw new Te(r);return Co(function(){e.apply(n,i)},t)}function lr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],f=t.length;if(!a)return l;n&&(t=It(t,Kt(n))),r?(o=St,s=!1):t.length>=200&&(o=Yt,s=!1,t=new Vn(t));e:for(;++i<a;){var c=e[i],u=null==n?c:n(c);if(c=r||0!==c?c:0,s&&u==u){for(var h=f;h--;)if(t[h]===u)continue e;l.push(c)}else o(t,u,r)||l.push(c)}return l}On.templateSettings={escape:K,evaluate:X,interpolate:Y,variable:"",imports:{_:On}},On.prototype=Dn.prototype,On.prototype.constructor=On,Nn.prototype=Fn(Dn.prototype),Nn.prototype.constructor=Nn,zn.prototype=Fn(Dn.prototype),zn.prototype.constructor=zn,Hn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Hn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hn.prototype.get=function(e){var t=this.__data__;if(Tn){var r=t[e];return r===o?n:r}return Me.call(t,e)?t[e]:n},Hn.prototype.has=function(e){var t=this.__data__;return Tn?t[e]!==n:Me.call(t,e)},Hn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tn&&t===n?o:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=Zn(t,e);return!(n<0||(n==t.length-1?t.pop():We.call(t,n,1),--this.size,0))},Un.prototype.get=function(e){var t=this.__data__,r=Zn(t,e);return r<0?n:t[r][1]},Un.prototype.has=function(e){return Zn(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=Zn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(_n||Un),string:new Hn}},Gn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return oo(this,e).get(e)},Gn.prototype.has=function(e){return oo(this,e).has(e)},Gn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(e){return this.__data__.set(e,o),this},Vn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.clear=function(){this.__data__=new Un,this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Wn.prototype.get=function(e){return this.__data__.get(e)},Wn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!_n||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var fr=Si(gr),cr=Si(br,!0);function ur(e,t){var n=!0;return fr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function hr(e,t,r){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(l===n?a==a&&!ia(a):r(a,l)))var l=a,f=s}return f}function pr(e,t){var n=[];return fr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function dr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=po),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?dr(a,t-1,n,r,i):Pt(i,a):r||(i[i.length]=a)}return i}var Ar=Ii(),mr=Ii(!0);function gr(e,t){return e&&Ar(e,t,Ca)}function br(e,t){return e&&mr(e,t,Ca)}function wr(e,t){return Ct(t,function(t){return Qs(e[t])})}function vr(e,t){for(var r=0,i=(t=Ai(t,e)).length;null!=e&&r<i;)e=e[qo(t[r++])];return r&&r==i?e:n}function yr(e,t,n){var r=t(e);return Ns(e)?r:Pt(r,n(e))}function _r(e){return null==e?e===n?"[object Undefined]":"[object Null]":Je&&Je in xe(e)?function(e){var t=Me.call(e,Je),r=e[Je];try{e[Je]=n;var i=!0}catch(e){}var o=Re.call(e);return i&&(t?e[Je]=r:delete e[Je]),o}(e):function(e){return Re.call(e)}(e)}function xr(e,t){return e>t}function jr(e,t){return null!=e&&Me.call(e,t)}function Er(e,t){return null!=e&&t in xe(e)}function Tr(e,t,r){for(var o=r?St:kt,s=e[0].length,a=e.length,l=a,f=i(a),c=1/0,u=[];l--;){var h=e[l];l&&t&&(h=It(h,Kt(t))),c=mn(h.length,c),f[l]=!r&&(t||s>=120&&h.length>=120)?new Vn(l&&h):n}h=e[0];var p=-1,d=f[0];e:for(;++p<s&&u.length<c;){var A=h[p],m=t?t(A):A;if(A=r||0!==A?A:0,!(d?Yt(d,m):o(u,m,r))){for(l=a;--l;){var g=f[l];if(!(g?Yt(g,m):o(e[l],m,r)))continue e}d&&d.push(m),u.push(A)}}return u}function Cr(e,t,r){var i=null==(e=jo(e,t=Ai(t,e)))?e:e[qo(Wo(t))];return null==i?n:_t(i,e,r)}function kr(e){return Js(e)&&_r(e)==d}function Sr(e,t,r,i,o){return e===t||(null==e||null==t||!Js(e)&&!Js(t)?e!=e&&t!=t:function(e,t,r,i,o,s){var a=Ns(e),l=Ns(t),f=a?A:co(e),c=l?A:co(t),u=(f=f==d?x:f)==x,h=(c=c==d?x:c)==x,p=f==c;if(p&&Gs(e)){if(!Gs(t))return!1;a=!0,u=!1}if(p&&!u)return s||(s=new Wn),a||oa(e)?Ji(e,t,r,i,o,s):function(e,t,n,r,i,o,s){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!o(new ze(e),new ze(t)));case m:case g:case _:return Ls(+e,+t);case b:return e.name==t.name&&e.message==t.message;case E:case C:return e==t+"";case y:var a=rn;case T:var l=1&r;if(a||(a=an),e.size!=t.size&&!l)return!1;var f=s.get(e);if(f)return f==t;r|=2,s.set(e,t);var c=Ji(a(e),a(t),r,i,o,s);return s.delete(e),c;case k:if(Rn)return Rn.call(e)==Rn.call(t)}return!1}(e,t,f,r,i,o,s);if(!(1&r)){var w=u&&Me.call(e,"__wrapped__"),v=h&&Me.call(t,"__wrapped__");if(w||v){var j=w?e.value():e,S=v?t.value():t;return s||(s=new Wn),o(j,S,r,i,s)}}return!!p&&(s||(s=new Wn),function(e,t,r,i,o,s){var a=1&r,l=Zi(e),f=l.length;if(f!=Zi(t).length&&!a)return!1;for(var c=f;c--;){var u=l[c];if(!(a?u in t:Me.call(t,u)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var d=!0;s.set(e,t),s.set(t,e);for(var A=a;++c<f;){var m=e[u=l[c]],g=t[u];if(i)var b=a?i(g,m,u,t,e,s):i(m,g,u,e,t,s);if(!(b===n?m===g||o(m,g,r,i,s):b)){d=!1;break}A||(A="constructor"==u)}if(d&&!A){var w=e.constructor,v=t.constructor;w==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof v&&v instanceof v||(d=!1)}return s.delete(e),s.delete(t),d}(e,t,r,i,o,s))}(e,t,r,i,Sr,o))}function Ir(e,t,r,i){var o=r.length,s=o,a=!i;if(null==e)return!s;for(e=xe(e);o--;){var l=r[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var f=(l=r[o])[0],c=e[f],u=l[1];if(a&&l[2]){if(c===n&&!(f in e))return!1}else{var h=new Wn;if(i)var p=i(c,u,f,e,t,h);if(!(p===n?Sr(u,c,3,i,h):p))return!1}}return!0}function Pr(e){return!(!Ys(e)||(t=e,Be&&Be in t))&&(Qs(e)?Fe:de).test(Bo(e));var t}function Mr(e){return"function"==typeof e?e:null==e?Za:"object"==typeof e?Ns(e)?Or(e[0],e[1]):Lr(e):ll(e)}function qr(e){if(!vo(e))return dn(e);var t=[];for(var n in xe(e))Me.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Br(e,t){return e<t}function Rr(e,t){var n=-1,r=Hs(e)?i(e.length):[];return fr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Lr(e){var t=so(e);return 1==t.length&&t[0][2]?_o(t[0][0],t[0][1]):function(n){return n===e||Ir(n,e,t)}}function Or(e,t){return go(e)&&yo(t)?_o(qo(e),t):function(r){var i=_a(r,e);return i===n&&i===t?xa(r,e):Sr(t,i,3)}}function Fr(e,t,r,i,o){e!==t&&Ar(t,function(s,a){if(o||(o=new Wn),Ys(s))!function(e,t,r,i,o,s,a){var l=Eo(e,r),f=Eo(t,r),c=a.get(f);if(c)Jn(e,r,c);else{var u=s?s(l,f,r+"",e,t,a):n,h=u===n;if(h){var p=Ns(f),d=!p&&Gs(f),A=!p&&!d&&oa(f);u=f,p||d||A?Ns(l)?u=l:Us(l)?u=Ei(l):d?(h=!1,u=wi(f,!0)):A?(h=!1,u=yi(f,!0)):u=[]:ea(f)||Ds(f)?(u=l,Ds(l)?u=pa(l):Ys(l)&&!Qs(l)||(u=ho(f))):h=!1}h&&(a.set(f,u),o(u,f,i,s,a),a.delete(f)),Jn(e,r,u)}}(e,t,a,r,Fr,i,o);else{var l=i?i(Eo(e,a),s,a+"",e,t,o):n;l===n&&(l=s),Jn(e,a,l)}},ka)}function Dr(e,t){var r=e.length;if(r)return Ao(t+=t<0?r:0,r)?e[t]:n}function Nr(e,t,n){t=t.length?It(t,function(e){return Ns(e)?function(t){return vr(t,1===e.length?e[0]:e)}:e}):[Za];var r=-1;t=It(t,Kt(io()));var i=Rr(e,function(e,n,i){var o=It(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=_i(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(i)}function zr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=vr(e,s);n(a,s)&&Xr(o,Ai(s,e),a)}return o}function Hr(e,t,n,r){var i=r?Dt:Ft,o=-1,s=t.length,a=e;for(e===t&&(t=Ei(t)),n&&(a=It(e,Kt(n)));++o<s;)for(var l=0,f=t[o],c=n?n(f):f;(l=i(a,c,l,r))>-1;)a!==e&&We.call(a,l,1),We.call(e,l,1);return e}function Ur(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ao(i)?We.call(e,i,1):ai(e,i)}}return e}function Gr(e,t){return e+ht(wn()*(t-e+1))}function Vr(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Wr(e,t){return ko(xo(e,t,Za),e+"")}function Qr(e){return Kn(La(e))}function Kr(e,t){var n=La(e);return Po(n,ir(t,0,n.length))}function Xr(e,t,r,i){if(!Ys(e))return e;for(var o=-1,s=(t=Ai(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var f=qo(t[o]),c=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(o!=a){var u=l[f];(c=i?i(u,f,l):n)===n&&(c=Ys(u)?u:Ao(t[o+1])?[]:{})}$n(l,f,c),l=l[f]}return e}var Yr=Cn?function(e,t){return Cn.set(e,t),e}:Za,Jr=Ze?function(e,t){return Ze(e,"toString",{configurable:!0,enumerable:!1,value:Ya(t),writable:!0})}:Za;function $r(e){return Po(La(e))}function Zr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=i(o);++r<o;)s[r]=e[r+t];return s}function ei(e,t){var n;return fr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ti(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!ia(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ni(e,t,Za,n)}function ni(e,t,r,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,l=null===t,f=ia(t),c=t===n;o<s;){var u=ht((o+s)/2),h=r(e[u]),p=h!==n,d=null===h,A=h==h,m=ia(h);if(a)var g=i||A;else g=c?A&&(i||p):l?A&&p&&(i||!d):f?A&&p&&!d&&(i||!m):!d&&!m&&(i?h<=t:h<t);g?o=u+1:s=u}return mn(s,4294967294)}function ri(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function ii(e){return"number"==typeof e?e:ia(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ns(e))return It(e,oi)+"";if(ia(e))return Ln?Ln.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function si(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=St;else if(o>=200){var f=t?null:Vi(e);if(f)return an(f);s=!1,i=Yt,l=new Vn}else l=t?[]:a;e:for(;++r<o;){var c=e[r],u=t?t(c):c;if(c=n||0!==c?c:0,s&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),a.push(c)}else i(l,u,n)||(l!==a&&l.push(u),a.push(c))}return a}function ai(e,t){return null==(e=jo(e,t=Ai(t,e)))||delete e[qo(Wo(t))]}function li(e,t,n,r){return Xr(e,t,n(vr(e,t)),r)}function fi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Zr(e,r?0:o,r?o+1:i):Zr(e,r?o+1:0,r?i:o)}function ci(e,t){var n=e;return n instanceof zn&&(n=n.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},n)}function ui(e,t,n){var r=e.length;if(r<2)return r?si(e[0]):[];for(var o=-1,s=i(r);++o<r;)for(var a=e[o],l=-1;++l<r;)l!=o&&(s[o]=lr(s[o]||a,e[l],t,n));return si(dr(s,1),t,n)}function hi(e,t,r){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:n;r(a,e[i],l)}return a}function pi(e){return Us(e)?e:[]}function di(e){return"function"==typeof e?e:Za}function Ai(e,t){return Ns(e)?e:go(e,t)?[e]:Mo(da(e))}var mi=Wr;function gi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Zr(e,t,r)}var bi=ot||function(e){return ct.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=He?He(n):new e.constructor(n);return e.copy(r),r}function vi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function yi(e,t){var n=t?vi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _i(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,s=ia(e),a=t!==n,l=null===t,f=t==t,c=ia(t);if(!l&&!c&&!s&&e>t||s&&a&&f&&!l&&!c||i&&a&&f||!r&&f||!o)return 1;if(!i&&!s&&!c&&e<t||c&&r&&o&&!i&&!s||l&&r&&o||!a&&o||!f)return-1}return 0}function xi(e,t,n,r){for(var o=-1,s=e.length,a=n.length,l=-1,f=t.length,c=An(s-a,0),u=i(f+c),h=!r;++l<f;)u[l]=t[l];for(;++o<a;)(h||o<s)&&(u[n[o]]=e[o]);for(;c--;)u[l++]=e[o++];return u}function ji(e,t,n,r){for(var o=-1,s=e.length,a=-1,l=n.length,f=-1,c=t.length,u=An(s-l,0),h=i(u+c),p=!r;++o<u;)h[o]=e[o];for(var d=o;++f<c;)h[d+f]=t[f];for(;++a<l;)(p||o<s)&&(h[d+n[a]]=e[o++]);return h}function Ei(e,t){var n=-1,r=e.length;for(t||(t=i(r));++n<r;)t[n]=e[n];return t}function Ti(e,t,r,i){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var l=t[s],f=i?i(r[l],e[l],l,r,e):n;f===n&&(f=e[l]),o?nr(r,l,f):$n(r,l,f)}return r}function Ci(e,t){return function(n,r){var i=Ns(n)?xt:er,o=t?t():{};return i(n,e,io(r,2),o)}}function ki(e){return Wr(function(t,r){var i=-1,o=r.length,s=o>1?r[o-1]:n,a=o>2?r[2]:n;for(s=e.length>3&&"function"==typeof s?(o--,s):n,a&&mo(r[0],r[1],a)&&(s=o<3?n:s,o=1),t=xe(t);++i<o;){var l=r[i];l&&e(t,l,i,s)}return t})}function Si(e,t){return function(n,r){if(null==n)return n;if(!Hs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=xe(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ii(e){return function(t,n,r){for(var i=-1,o=xe(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Pi(e){return function(t){var r=nn(t=da(t))?cn(t):n,i=r?r[0]:t.charAt(0),o=r?gi(r,1).join(""):t.slice(1);return i[e]()+o}}function Mi(e){return function(t){return Mt(Qa(Da(t).replace(Xe,"")),e,"")}}function qi(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 n=Fn(e.prototype),r=e.apply(n,t);return Ys(r)?r:n}}function Bi(e){return function(t,r,i){var o=xe(t);if(!Hs(t)){var s=io(r,3);t=Ca(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,i);return a>-1?o[s?t[a]:a]:n}}function Ri(e){return $i(function(t){var i=t.length,o=i,s=Nn.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Te(r);if(s&&!l&&"wrapper"==no(a))var l=new Nn([],!0)}for(o=l?o:i;++o<i;){var f=no(a=t[o]),c="wrapper"==f?to(a):n;l=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[no(c[0])].apply(l,c[3]):1==a.length&&bo(a)?l[f]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ns(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function Li(e,t,r,o,s,a,f,c,u,h){var p=t&l,d=1&t,A=2&t,m=24&t,g=512&t,b=A?n:qi(e);return function l(){for(var w=arguments.length,v=i(w),y=w;y--;)v[y]=arguments[y];if(m)var _=ro(l),x=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(v,_);if(o&&(v=xi(v,o,s,m)),a&&(v=ji(v,a,f,m)),w-=x,m&&w<h){var j=sn(v,_);return Ui(e,t,Li,l.placeholder,r,v,j,c,u,h-w)}var E=d?r:this,T=A?E[e]:e;return w=v.length,c?v=function(e,t){for(var r=e.length,i=mn(t.length,r),o=Ei(e);i--;){var s=t[i];e[i]=Ao(s,r)?o[s]:n}return e}(v,c):g&&w>1&&v.reverse(),p&&u<w&&(v.length=u),this&&this!==ct&&this instanceof l&&(T=b||qi(T)),T.apply(E,v)}}function Oi(e,t){return function(n,r){return function(e,t,n,r){return gr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Fi(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=oi(r),i=oi(i)):(r=ii(r),i=ii(i)),o=e(r,i)}return o}}function Di(e){return $i(function(t){return t=It(t,Kt(io())),Wr(function(n){var r=this;return e(t,function(e){return _t(e,r,n)})})})}function Ni(e,t){var r=(t=t===n?" ":oi(t)).length;if(r<2)return r?Vr(t,e):t;var i=Vr(t,ut(e/fn(t)));return nn(t)?gi(cn(i),0,e).join(""):i.slice(0,e)}function zi(e){return function(t,r,o){return o&&"number"!=typeof o&&mo(t,r,o)&&(r=o=n),t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,n,r){for(var o=-1,s=An(ut((t-e)/(n||1)),0),a=i(s);s--;)a[r?s:++o]=e,e+=n;return a}(t,r,o=o===n?t<r?1:-1:fa(o),e)}}function Hi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ha(t),n=ha(n)),e(t,n)}}function Ui(e,t,r,i,o,s,l,f,c,u){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var p=[e,t,o,h?s:n,h?l:n,h?n:s,h?n:l,f,c,u],d=r.apply(n,p);return bo(e)&&To(d,p),d.placeholder=i,So(d,e,t)}function Gi(e){var t=_e[e];return function(e,n){if(e=ha(e),(n=null==n?0:mn(ca(n),292))&&Rt(e)){var r=(da(e)+"e").split("e");return+((r=(da(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Vi=jn&&1/an(new jn([,-0]))[1]==f?function(e){return new jn(e)}:il;function Wi(e){return function(t){var n=co(t);return n==y?rn(t):n==T?ln(t):function(e,t){return It(t,function(t){return[t,e[t]]})}(t,e(t))}}function Qi(e,t,o,f,c,u,h,p){var d=2&t;if(!d&&"function"!=typeof e)throw new Te(r);var A=f?f.length:0;if(A||(t&=-97,f=c=n),h=h===n?h:An(ca(h),0),p=p===n?p:ca(p),A-=c?c.length:0,64&t){var m=f,g=c;f=c=n}var b=d?n:to(e),w=[e,t,o,f,c,m,g,u,h,p];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var f=t[3];if(f){var c=e[3];e[3]=c?xi(c,f,t[4]):f,e[4]=c?sn(e[3],s):t[4]}(f=t[5])&&(c=e[5],e[5]=c?ji(c,f,t[6]):f,e[6]=c?sn(e[5],s):t[6]),(f=t[7])&&(e[7]=f),r&l&&(e[8]=null==e[8]?t[8]:mn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(w,b),e=w[0],t=w[1],o=w[2],f=w[3],c=w[4],!(p=w[9]=w[9]===n?d?0:e.length:An(w[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)v=8==t||16==t?function(e,t,r){var o=qi(e);return function s(){for(var a=arguments.length,l=i(a),f=a,c=ro(s);f--;)l[f]=arguments[f];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:sn(l,c);return(a-=u.length)<r?Ui(e,t,Li,s.placeholder,n,l,u,n,n,r-a):_t(this&&this!==ct&&this instanceof s?o:e,this,l)}}(e,t,p):t!=a&&33!=t||c.length?Li.apply(n,w):function(e,t,n,r){var o=1&t,s=qi(e);return function t(){for(var a=-1,l=arguments.length,f=-1,c=r.length,u=i(c+l),h=this&&this!==ct&&this instanceof t?s:e;++f<c;)u[f]=r[f];for(;l--;)u[f++]=arguments[++a];return _t(h,o?n:this,u)}}(e,t,o,f);else var v=function(e,t,n){var r=1&t,i=qi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,o);return So((b?Yr:To)(v,w),e,t)}function Ki(e,t,r,i){return e===n||Ls(e,Se[r])&&!Me.call(i,r)?t:e}function Xi(e,t,r,i,o,s){return Ys(e)&&Ys(t)&&(s.set(t,e),Fr(e,t,n,Xi,s),s.delete(t)),e}function Yi(e){return ea(e)?n:e}function Ji(e,t,r,i,o,s){var a=1&r,l=e.length,f=t.length;if(l!=f&&!(a&&f>l))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,p=!0,d=2&r?new Vn:n;for(s.set(e,t),s.set(t,e);++h<l;){var A=e[h],m=t[h];if(i)var g=a?i(m,A,h,t,e,s):i(A,m,h,e,t,s);if(g!==n){if(g)continue;p=!1;break}if(d){if(!Bt(t,function(e,t){if(!Yt(d,t)&&(A===e||o(A,e,r,i,s)))return d.push(t)})){p=!1;break}}else if(A!==m&&!o(A,m,r,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(xo(e,n,zo),e+"")}function Zi(e){return yr(e,Ca,lo)}function eo(e){return yr(e,ka,fo)}var to=Cn?function(e){return Cn.get(e)}:il;function no(e){for(var t=e.name+"",n=kn[t],r=Me.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ro(e){return(Me.call(On,"placeholder")?On:e).placeholder}function io(){var e=On.iteratee||el;return e=e===el?Mr:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function so(e){for(var t=Ca(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,yo(i)]}return t}function ao(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Pr(r)?r:n}var lo=dt?function(e){return null==e?[]:(e=xe(e),Ct(dt(e),function(t){return Ve.call(e,t)}))}:ul,fo=dt?function(e){for(var t=[];e;)Pt(t,lo(e)),e=Ue(e);return t}:ul,co=_r;function uo(e,t,n){for(var r=-1,i=(t=Ai(t,e)).length,o=!1;++r<i;){var s=qo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&Ao(s,i)&&(Ns(e)||Ds(e))}function ho(e){return"function"!=typeof e.constructor||vo(e)?{}:Fn(Ue(e))}function po(e){return Ns(e)||Ds(e)||!!(Qe&&e&&e[Qe])}function Ao(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,n){if(!Ys(n))return!1;var r=typeof t;return!!("number"==r?Hs(n)&&Ao(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function go(e,t){if(Ns(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ia(e))||$.test(e)||!J.test(e)||null!=t&&e in xe(t)}function bo(e){var t=no(e),n=On[t];if("function"!=typeof n||!(t in zn.prototype))return!1;if(e===n)return!0;var r=to(n);return!!r&&e===r[0]}(yn&&co(new yn(new ArrayBuffer(1)))!=P||_n&&co(new _n)!=y||xn&&co(xn.resolve())!=j||jn&&co(new jn)!=T||En&&co(new En)!=S)&&(co=function(e){var t=_r(e),r=t==x?e.constructor:n,i=r?Bo(r):"";if(i)switch(i){case Sn:return P;case In:return y;case Pn:return j;case Mn:return T;case qn:return S}return t});var wo=Ie?Qs:hl;function vo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)}function yo(e){return e==e&&!Ys(e)}function _o(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in xe(r))}}function xo(e,t,r){return t=An(t===n?e.length-1:t,0),function(){for(var n=arguments,o=-1,s=An(n.length-t,0),a=i(s);++o<s;)a[o]=n[t+o];o=-1;for(var l=i(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),_t(e,this,l)}}function jo(e,t){return t.length<2?e:vr(e,Zr(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var To=Io(Yr),Co=ft||function(e,t){return ct.setTimeout(e,t)},ko=Io(Jr);function So(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(p,function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(se):[]}(r),n)))}function Io(e){var t=0,r=0;return function(){var i=gn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Po(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var s=Gr(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var Mo=function(){var e=Is(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Z,function(e,n,r,i){t.push(r?i.replace(fe,"$1"):n||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function qo(e){if("string"==typeof e||ia(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Bo(e){if(null!=e){try{return Pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof zn)return e.clone();var t=new Nn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Wr(function(e,t){return Us(e)?lr(e,dr(t,1,Us,!0)):[]}),Oo=Wr(function(e,t){var r=Wo(t);return Us(r)&&(r=n),Us(e)?lr(e,dr(t,1,Us,!0),io(r,2)):[]}),Fo=Wr(function(e,t){var r=Wo(t);return Us(r)&&(r=n),Us(e)?lr(e,dr(t,1,Us,!0),n,r):[]});function Do(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ca(n);return i<0&&(i=An(r+i,0)),Ot(e,io(t,3),i)}function No(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=ca(r),o=r<0?An(i+o,0):mn(o,i-1)),Ot(e,io(t,3),o,!0)}function zo(e){return null!=e&&e.length?dr(e,1):[]}function Ho(e){return e&&e.length?e[0]:n}var Uo=Wr(function(e){var t=It(e,pi);return t.length&&t[0]===e[0]?Tr(t):[]}),Go=Wr(function(e){var t=Wo(e),r=It(e,pi);return t===Wo(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Tr(r,io(t,2)):[]}),Vo=Wr(function(e){var t=Wo(e),r=It(e,pi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Tr(r,n,t):[]});function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Qo=Wr(Ko);function Ko(e,t){return e&&e.length&&t&&t.length?Hr(e,t):e}var Xo=$i(function(e,t){var n=null==e?0:e.length,r=rr(e,t);return Ur(e,It(t,function(e){return Ao(e,n)?+e:e}).sort(_i)),r});function Yo(e){return null==e?e:vn.call(e)}var Jo=Wr(function(e){return si(dr(e,1,Us,!0))}),$o=Wr(function(e){var t=Wo(e);return Us(t)&&(t=n),si(dr(e,1,Us,!0),io(t,2))}),Zo=Wr(function(e){var t=Wo(e);return t="function"==typeof t?t:n,si(dr(e,1,Us,!0),n,t)});function es(e){if(!e||!e.length)return[];var t=0;return e=Ct(e,function(e){if(Us(e))return t=An(e.length,t),!0}),Wt(t,function(t){return It(e,Ht(t))})}function ts(e,t){if(!e||!e.length)return[];var r=es(e);return null==t?r:It(r,function(e){return _t(t,n,e)})}var ns=Wr(function(e,t){return Us(e)?lr(e,t):[]}),rs=Wr(function(e){return ui(Ct(e,Us))}),is=Wr(function(e){var t=Wo(e);return Us(t)&&(t=n),ui(Ct(e,Us),io(t,2))}),os=Wr(function(e){var t=Wo(e);return t="function"==typeof t?t:n,ui(Ct(e,Us),n,t)}),ss=Wr(es),as=Wr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ts(e,r)});function ls(e){var t=On(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var cs=$i(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof zn&&Ao(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:n}),new Nn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),us=Ci(function(e,t,n){Me.call(e,n)?++e[n]:nr(e,n,1)}),hs=Bi(Do),ps=Bi(No);function ds(e,t){return(Ns(e)?jt:fr)(e,io(t,3))}function As(e,t){return(Ns(e)?Et:cr)(e,io(t,3))}var ms=Ci(function(e,t,n){Me.call(e,n)?e[n].push(t):nr(e,n,[t])}),gs=Wr(function(e,t,n){var r=-1,o="function"==typeof t,s=Hs(e)?i(e.length):[];return fr(e,function(e){s[++r]=o?_t(t,e,n):Cr(e,t,n)}),s}),bs=Ci(function(e,t,n){nr(e,n,t)});function ws(e,t){return(Ns(e)?It:Rr)(e,io(t,3))}var vs=Ci(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ys=Wr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&mo(e,t[0],t[1])?t=[]:n>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Nr(e,dr(t,1),[])}),_s=lt||function(){return ct.Date.now()};function xs(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Qi(e,l,n,n,n,n,t)}function js(e,t){var i;if("function"!=typeof t)throw new Te(r);return e=ca(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Es=Wr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ro(Es));r|=a}return Qi(e,r,t,n,i)}),Ts=Wr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ro(Ts));r|=a}return Qi(t,r,e,n,i)});function Cs(e,t,i){var o,s,a,l,f,c,u=0,h=!1,p=!1,d=!0;if("function"!=typeof e)throw new Te(r);function A(t){var r=o,i=s;return o=s=n,u=t,l=e.apply(i,r)}function m(e){var r=e-c;return c===n||r>=t||r<0||p&&e-u>=a}function g(){var e=_s();if(m(e))return b(e);f=Co(g,function(e){var n=t-(e-c);return p?mn(n,a-(e-u)):n}(e))}function b(e){return f=n,d&&o?A(e):(o=s=n,l)}function w(){var e=_s(),r=m(e);if(o=arguments,s=this,c=e,r){if(f===n)return function(e){return u=e,f=Co(g,t),h?A(e):l}(c);if(p)return bi(f),f=Co(g,t),A(c)}return f===n&&(f=Co(g,t)),l}return t=ha(t)||0,Ys(i)&&(h=!!i.leading,a=(p="maxWait"in i)?An(ha(i.maxWait)||0,t):a,d="trailing"in i?!!i.trailing:d),w.cancel=function(){f!==n&&bi(f),u=0,o=c=s=f=n},w.flush=function(){return f===n?l:b(_s())},w}var ks=Wr(function(e,t){return ar(e,1,t)}),Ss=Wr(function(e,t,n){return ar(e,ha(t)||0,n)});function Is(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Is.Cache||Gn),n}function Ps(e){if("function"!=typeof e)throw new Te(r);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)}}Is.Cache=Gn;var Ms=mi(function(e,t){var n=(t=1==t.length&&Ns(t[0])?It(t[0],Kt(io())):It(dr(t,1),Kt(io()))).length;return Wr(function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return _t(e,this,r)})}),qs=Wr(function(e,t){var r=sn(t,ro(qs));return Qi(e,a,n,t,r)}),Bs=Wr(function(e,t){var r=sn(t,ro(Bs));return Qi(e,64,n,t,r)}),Rs=$i(function(e,t){return Qi(e,256,n,n,n,t)});function Ls(e,t){return e===t||e!=e&&t!=t}var Os=Hi(xr),Fs=Hi(function(e,t){return e>=t}),Ds=kr(function(){return arguments}())?kr:function(e){return Js(e)&&Me.call(e,"callee")&&!Ve.call(e,"callee")},Ns=i.isArray,zs=mt?Kt(mt):function(e){return Js(e)&&_r(e)==I};function Hs(e){return null!=e&&Xs(e.length)&&!Qs(e)}function Us(e){return Js(e)&&Hs(e)}var Gs=At||hl,Vs=gt?Kt(gt):function(e){return Js(e)&&_r(e)==g};function Ws(e){if(!Js(e))return!1;var t=_r(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ea(e)}function Qs(e){if(!Ys(e))return!1;var t=_r(e);return t==w||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ks(e){return"number"==typeof e&&e==ca(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ys(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Js(e){return null!=e&&"object"==typeof e}var $s=bt?Kt(bt):function(e){return Js(e)&&co(e)==y};function Zs(e){return"number"==typeof e||Js(e)&&_r(e)==_}function ea(e){if(!Js(e)||_r(e)!=x)return!1;var t=Ue(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pe.call(n)==Le}var ta=wt?Kt(wt):function(e){return Js(e)&&_r(e)==E},na=vt?Kt(vt):function(e){return Js(e)&&co(e)==T};function ra(e){return"string"==typeof e||!Ns(e)&&Js(e)&&_r(e)==C}function ia(e){return"symbol"==typeof e||Js(e)&&_r(e)==k}var oa=yt?Kt(yt):function(e){return Js(e)&&Xs(e.length)&&!!rt[_r(e)]},sa=Hi(Br),aa=Hi(function(e,t){return e<=t});function la(e){if(!e)return[];if(Hs(e))return ra(e)?cn(e):Ei(e);if(Ke&&e[Ke])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ke]());var t=co(e);return(t==y?rn:t==T?an:La)(e)}function fa(e){return e?(e=ha(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ca(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function ua(e){return e?ir(ca(e),0,h):0}function ha(e){if("number"==typeof e)return e;if(ia(e))return u;if(Ys(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ys(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Qt(e);var n=pe.test(e);return n||Ae.test(e)?at(e.slice(2),n?2:8):he.test(e)?u:+e}function pa(e){return Ti(e,ka(e))}function da(e){return null==e?"":oi(e)}var Aa=ki(function(e,t){if(vo(t)||Hs(t))Ti(t,Ca(t),e);else for(var n in t)Me.call(t,n)&&$n(e,n,t[n])}),ma=ki(function(e,t){Ti(t,ka(t),e)}),ga=ki(function(e,t,n,r){Ti(t,ka(t),e,r)}),ba=ki(function(e,t,n,r){Ti(t,Ca(t),e,r)}),wa=$i(rr),va=Wr(function(e,t){e=xe(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&mo(t[0],t[1],o)&&(i=1);++r<i;)for(var s=t[r],a=ka(s),l=-1,f=a.length;++l<f;){var c=a[l],u=e[c];(u===n||Ls(u,Se[c])&&!Me.call(e,c))&&(e[c]=s[c])}return e}),ya=Wr(function(e){return e.push(n,Xi),_t(Ia,n,e)});function _a(e,t,r){var i=null==e?n:vr(e,t);return i===n?r:i}function xa(e,t){return null!=e&&uo(e,t,Er)}var ja=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),e[t]=n},Ya(Za)),Ea=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]},io),Ta=Wr(Cr);function Ca(e){return Hs(e)?Qn(e):qr(e)}function ka(e){return Hs(e)?Qn(e,!0):function(e){if(!Ys(e))return function(e){var t=[];if(null!=e)for(var n in xe(e))t.push(n);return t}(e);var t=vo(e),n=[];for(var r in e)("constructor"!=r||!t&&Me.call(e,r))&&n.push(r);return n}(e)}var Sa=ki(function(e,t,n){Fr(e,t,n)}),Ia=ki(function(e,t,n,r){Fr(e,t,n,r)}),Pa=$i(function(e,t){var n={};if(null==e)return n;var r=!1;t=It(t,function(t){return t=Ai(t,e),r||(r=t.length>1),t}),Ti(e,eo(e),n),r&&(n=or(n,7,Yi));for(var i=t.length;i--;)ai(n,t[i]);return n}),Ma=$i(function(e,t){return null==e?{}:function(e,t){return zr(e,t,function(t,n){return xa(e,n)})}(e,t)});function qa(e,t){if(null==e)return{};var n=It(eo(e),function(e){return[e]});return t=io(t),zr(e,n,function(e,n){return t(e,n[0])})}var Ba=Wi(Ca),Ra=Wi(ka);function La(e){return null==e?[]:Xt(e,Ca(e))}var Oa=Mi(function(e,t,n){return t=t.toLowerCase(),e+(n?Fa(t):t)});function Fa(e){return Wa(da(e).toLowerCase())}function Da(e){return(e=da(e))&&e.replace(ge,Zt).replace(Ye,"")}var Na=Mi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),za=Mi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ha=Pi("toLowerCase"),Ua=Mi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ga=Mi(function(e,t,n){return e+(n?" ":"")+Wa(t)}),Va=Mi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Wa=Pi("toUpperCase");function Qa(e,t,r){return e=da(e),(t=r?n:t)===n?function(e){return et.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var Ka=Wr(function(e,t){try{return _t(e,n,t)}catch(e){return Ws(e)?e:new ve(e)}}),Xa=$i(function(e,t){return jt(t,function(t){t=qo(t),nr(e,t,Es(e[t],e))}),e});function Ya(e){return function(){return e}}var Ja=Ri(),$a=Ri(!0);function Za(e){return e}function el(e){return Mr("function"==typeof e?e:or(e,1))}var tl=Wr(function(e,t){return function(n){return Cr(n,e,t)}}),nl=Wr(function(e,t){return function(n){return Cr(e,n,t)}});function rl(e,t,n){var r=Ca(t),i=wr(t,r);null!=n||Ys(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ca(t)));var o=!(Ys(n)&&"chain"in n&&!n.chain),s=Qs(e);return jt(i,function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})}),e}function il(){}var ol=Di(It),sl=Di(Tt),al=Di(Bt);function ll(e){return go(e)?Ht(qo(e)):function(e){return function(t){return vr(t,e)}}(e)}var fl=zi(),cl=zi(!0);function ul(){return[]}function hl(){return!1}var pl,dl=Fi(function(e,t){return e+t},0),Al=Gi("ceil"),ml=Fi(function(e,t){return e/t},1),gl=Gi("floor"),bl=Fi(function(e,t){return e*t},1),wl=Gi("round"),vl=Fi(function(e,t){return e-t},0);return On.after=function(e,t){if("function"!=typeof t)throw new Te(r);return e=ca(e),function(){if(--e<1)return t.apply(this,arguments)}},On.ary=xs,On.assign=Aa,On.assignIn=ma,On.assignInWith=ga,On.assignWith=ba,On.at=wa,On.before=js,On.bind=Es,On.bindAll=Xa,On.bindKey=Ts,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ns(e)?e:[e]},On.chain=ls,On.chunk=function(e,t,r){t=(r?mo(e,t,r):t===n)?1:An(ca(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=i(ut(o/t));s<o;)l[a++]=Zr(e,s,s+=t);return l},On.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},On.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Pt(Ns(n)?Ei(n):[n],dr(t,1))},On.cond=function(e){var t=null==e?0:e.length,n=io();return e=t?It(e,function(e){if("function"!=typeof e[1])throw new Te(r);return[n(e[0]),e[1]]}):[],Wr(function(n){for(var r=-1;++r<t;){var i=e[r];if(_t(i[0],this,n))return _t(i[1],this,n)}})},On.conforms=function(e){return function(e){var t=Ca(e);return function(n){return sr(n,e,t)}}(or(e,1))},On.constant=Ya,On.countBy=us,On.create=function(e,t){var n=Fn(e);return null==t?n:tr(n,t)},On.curry=function e(t,r,i){var o=Qi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},On.curryRight=function e(t,r,i){var o=Qi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},On.debounce=Cs,On.defaults=va,On.defaultsDeep=ya,On.defer=ks,On.delay=Ss,On.difference=Lo,On.differenceBy=Oo,On.differenceWith=Fo,On.drop=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,(t=r||t===n?1:ca(t))<0?0:t,i):[]},On.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,0,(t=i-(t=r||t===n?1:ca(t)))<0?0:t):[]},On.dropRightWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!0,!0):[]},On.dropWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!0):[]},On.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&mo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=ca(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:ca(i))<0&&(i+=o),i=r>i?0:ua(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},On.filter=function(e,t){return(Ns(e)?Ct:pr)(e,io(t,3))},On.flatMap=function(e,t){return dr(ws(e,t),1)},On.flatMapDeep=function(e,t){return dr(ws(e,t),f)},On.flatMapDepth=function(e,t,r){return r=r===n?1:ca(r),dr(ws(e,t),r)},On.flatten=zo,On.flattenDeep=function(e){return null!=e&&e.length?dr(e,f):[]},On.flattenDepth=function(e,t){return null!=e&&e.length?dr(e,t=t===n?1:ca(t)):[]},On.flip=function(e){return Qi(e,512)},On.flow=Ja,On.flowRight=$a,On.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},On.functions=function(e){return null==e?[]:wr(e,Ca(e))},On.functionsIn=function(e){return null==e?[]:wr(e,ka(e))},On.groupBy=ms,On.initial=function(e){return null!=e&&e.length?Zr(e,0,-1):[]},On.intersection=Uo,On.intersectionBy=Go,On.intersectionWith=Vo,On.invert=ja,On.invertBy=Ea,On.invokeMap=gs,On.iteratee=el,On.keyBy=bs,On.keys=Ca,On.keysIn=ka,On.map=ws,On.mapKeys=function(e,t){var n={};return t=io(t,3),gr(e,function(e,r,i){nr(n,t(e,r,i),e)}),n},On.mapValues=function(e,t){var n={};return t=io(t,3),gr(e,function(e,r,i){nr(n,r,t(e,r,i))}),n},On.matches=function(e){return Lr(or(e,1))},On.matchesProperty=function(e,t){return Or(e,or(t,1))},On.memoize=Is,On.merge=Sa,On.mergeWith=Ia,On.method=tl,On.methodOf=nl,On.mixin=rl,On.negate=Ps,On.nthArg=function(e){return e=ca(e),Wr(function(t){return Dr(t,e)})},On.omit=Pa,On.omitBy=function(e,t){return qa(e,Ps(io(t)))},On.once=function(e){return js(2,e)},On.orderBy=function(e,t,r,i){return null==e?[]:(Ns(t)||(t=null==t?[]:[t]),Ns(r=i?n:r)||(r=null==r?[]:[r]),Nr(e,t,r))},On.over=ol,On.overArgs=Ms,On.overEvery=sl,On.overSome=al,On.partial=qs,On.partialRight=Bs,On.partition=vs,On.pick=Ma,On.pickBy=qa,On.property=ll,On.propertyOf=function(e){return function(t){return null==e?n:vr(e,t)}},On.pull=Qo,On.pullAll=Ko,On.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Hr(e,t,io(n,2)):e},On.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Hr(e,t,n,r):e},On.pullAt=Xo,On.range=fl,On.rangeRight=cl,On.rearg=Rs,On.reject=function(e,t){return(Ns(e)?Ct:pr)(e,Ps(io(t,3)))},On.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=io(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Ur(e,i),n},On.rest=function(e,t){if("function"!=typeof e)throw new Te(r);return Wr(e,t=t===n?t:ca(t))},On.reverse=Yo,On.sampleSize=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:ca(t),(Ns(e)?Xn:Kr)(e,t)},On.set=function(e,t,n){return null==e?e:Xr(e,t,n)},On.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Xr(e,t,r,i)},On.shuffle=function(e){return(Ns(e)?Yn:$r)(e)},On.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&mo(e,t,r)?(t=0,r=i):(t=null==t?0:ca(t),r=r===n?i:ca(r)),Zr(e,t,r)):[]},On.sortBy=ys,On.sortedUniq=function(e){return e&&e.length?ri(e):[]},On.sortedUniqBy=function(e,t){return e&&e.length?ri(e,io(t,2)):[]},On.split=function(e,t,r){return r&&"number"!=typeof r&&mo(e,t,r)&&(t=r=n),(r=r===n?h:r>>>0)?(e=da(e))&&("string"==typeof t||null!=t&&!ta(t))&&!(t=oi(t))&&nn(e)?gi(cn(e),0,r):e.split(t,r):[]},On.spread=function(e,t){if("function"!=typeof e)throw new Te(r);return t=null==t?0:An(ca(t),0),Wr(function(n){var r=n[t],i=gi(n,0,t);return r&&Pt(i,r),_t(e,this,i)})},On.tail=function(e){var t=null==e?0:e.length;return t?Zr(e,1,t):[]},On.take=function(e,t,r){return e&&e.length?Zr(e,0,(t=r||t===n?1:ca(t))<0?0:t):[]},On.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,(t=i-(t=r||t===n?1:ca(t)))<0?0:t,i):[]},On.takeRightWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?fi(e,io(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Te(r);return Ys(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Cs(e,t,{leading:i,maxWait:t,trailing:o})},On.thru=fs,On.toArray=la,On.toPairs=Ba,On.toPairsIn=Ra,On.toPath=function(e){return Ns(e)?It(e,qo):ia(e)?[e]:Ei(Mo(da(e)))},On.toPlainObject=pa,On.transform=function(e,t,n){var r=Ns(e),i=r||Gs(e)||oa(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Ys(e)&&Qs(o)?Fn(Ue(e)):{}}return(i?jt:gr)(e,function(e,r,i){return t(n,e,r,i)}),n},On.unary=function(e){return xs(e,1)},On.union=Jo,On.unionBy=$o,On.unionWith=Zo,On.uniq=function(e){return e&&e.length?si(e):[]},On.uniqBy=function(e,t){return e&&e.length?si(e,io(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?si(e,n,t):[]},On.unset=function(e,t){return null==e||ai(e,t)},On.unzip=es,On.unzipWith=ts,On.update=function(e,t,n){return null==e?e:li(e,t,di(n))},On.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:li(e,t,di(r),i)},On.values=La,On.valuesIn=function(e){return null==e?[]:Xt(e,ka(e))},On.without=ns,On.words=Qa,On.wrap=function(e,t){return qs(di(t),e)},On.xor=rs,On.xorBy=is,On.xorWith=os,On.zip=ss,On.zipObject=function(e,t){return hi(e||[],t||[],$n)},On.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xr)},On.zipWith=as,On.entries=Ba,On.entriesIn=Ra,On.extend=ma,On.extendWith=ga,rl(On,On),On.add=dl,On.attempt=Ka,On.camelCase=Oa,On.capitalize=Fa,On.ceil=Al,On.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ha(r))==r?r:0),t!==n&&(t=(t=ha(t))==t?t:0),ir(ha(e),t,r)},On.clone=function(e){return or(e,4)},On.cloneDeep=function(e){return or(e,5)},On.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:n)},On.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:n)},On.conformsTo=function(e,t){return null==t||sr(e,t,Ca(t))},On.deburr=Da,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=ml,On.endsWith=function(e,t,r){e=da(e),t=oi(t);var i=e.length,o=r=r===n?i:ir(ca(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},On.eq=Ls,On.escape=function(e){return(e=da(e))&&Q.test(e)?e.replace(V,en):e},On.escapeRegExp=function(e){return(e=da(e))&&te.test(e)?e.replace(ee,"\\$&"):e},On.every=function(e,t,r){var i=Ns(e)?Tt:ur;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},On.find=hs,On.findIndex=Do,On.findKey=function(e,t){return Lt(e,io(t,3),gr)},On.findLast=ps,On.findLastIndex=No,On.findLastKey=function(e,t){return Lt(e,io(t,3),br)},On.floor=gl,On.forEach=ds,On.forEachRight=As,On.forIn=function(e,t){return null==e?e:Ar(e,io(t,3),ka)},On.forInRight=function(e,t){return null==e?e:mr(e,io(t,3),ka)},On.forOwn=function(e,t){return e&&gr(e,io(t,3))},On.forOwnRight=function(e,t){return e&&br(e,io(t,3))},On.get=_a,On.gt=Os,On.gte=Fs,On.has=function(e,t){return null!=e&&uo(e,t,jr)},On.hasIn=xa,On.head=Ho,On.identity=Za,On.includes=function(e,t,n,r){e=Hs(e)?e:La(e),n=n&&!r?ca(n):0;var i=e.length;return n<0&&(n=An(i+n,0)),ra(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},On.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ca(n);return i<0&&(i=An(r+i,0)),Ft(e,t,i)},On.inRange=function(e,t,r){return t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,n){return e>=mn(t,n)&&e<An(t,n)}(e=ha(e),t,r)},On.invoke=Ta,On.isArguments=Ds,On.isArray=Ns,On.isArrayBuffer=zs,On.isArrayLike=Hs,On.isArrayLikeObject=Us,On.isBoolean=function(e){return!0===e||!1===e||Js(e)&&_r(e)==m},On.isBuffer=Gs,On.isDate=Vs,On.isElement=function(e){return Js(e)&&1===e.nodeType&&!ea(e)},On.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(Ns(e)||"string"==typeof e||"function"==typeof e.splice||Gs(e)||oa(e)||Ds(e)))return!e.length;var t=co(e);if(t==y||t==T)return!e.size;if(vo(e))return!qr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},On.isEqual=function(e,t){return Sr(e,t)},On.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Sr(e,t,n,r):!!i},On.isError=Ws,On.isFinite=function(e){return"number"==typeof e&&Rt(e)},On.isFunction=Qs,On.isInteger=Ks,On.isLength=Xs,On.isMap=$s,On.isMatch=function(e,t){return e===t||Ir(e,t,so(t))},On.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Ir(e,t,so(t),r)},On.isNaN=function(e){return Zs(e)&&e!=+e},On.isNative=function(e){if(wo(e))throw new ve("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Pr(e)},On.isNil=function(e){return null==e},On.isNull=function(e){return null===e},On.isNumber=Zs,On.isObject=Ys,On.isObjectLike=Js,On.isPlainObject=ea,On.isRegExp=ta,On.isSafeInteger=function(e){return Ks(e)&&e>=-9007199254740991&&e<=c},On.isSet=na,On.isString=ra,On.isSymbol=ia,On.isTypedArray=oa,On.isUndefined=function(e){return e===n},On.isWeakMap=function(e){return Js(e)&&co(e)==S},On.isWeakSet=function(e){return Js(e)&&"[object WeakSet]"==_r(e)},On.join=function(e,t){return null==e?"":Ut.call(e,t)},On.kebabCase=Na,On.last=Wo,On.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ca(r))<0?An(i+o,0):mn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ot(e,Nt,o,!0)},On.lowerCase=za,On.lowerFirst=Ha,On.lt=sa,On.lte=aa,On.max=function(e){return e&&e.length?hr(e,Za,xr):n},On.maxBy=function(e,t){return e&&e.length?hr(e,io(t,2),xr):n},On.mean=function(e){return zt(e,Za)},On.meanBy=function(e,t){return zt(e,io(t,2))},On.min=function(e){return e&&e.length?hr(e,Za,Br):n},On.minBy=function(e,t){return e&&e.length?hr(e,io(t,2),Br):n},On.stubArray=ul,On.stubFalse=hl,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=bl,On.nth=function(e,t){return e&&e.length?Dr(e,ca(t)):n},On.noConflict=function(){return ct._===this&&(ct._=Oe),this},On.noop=il,On.now=_s,On.pad=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ni(ht(i),n)+e+Ni(ut(i),n)},On.padEnd=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;return t&&r<t?e+Ni(t-r,n):e},On.padStart=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;return t&&r<t?Ni(t-r,n)+e:e},On.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(da(e).replace(ne,""),t||0)},On.random=function(e,t,r){if(r&&"boolean"!=typeof r&&mo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=fa(e),t===n?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=wn();return mn(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gr(e,t)},On.reduce=function(e,t,n){var r=Ns(e)?Mt:Gt,i=arguments.length<3;return r(e,io(t,4),n,i,fr)},On.reduceRight=function(e,t,n){var r=Ns(e)?qt:Gt,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},On.repeat=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:ca(t),Vr(da(e),t)},On.replace=function(){var e=arguments,t=da(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.result=function(e,t,r){var i=-1,o=(t=Ai(t,e)).length;for(o||(o=1,e=n);++i<o;){var s=null==e?n:e[qo(t[i])];s===n&&(i=o,s=r),e=Qs(s)?s.call(e):s}return e},On.round=wl,On.runInContext=e,On.sample=function(e){return(Ns(e)?Kn:Qr)(e)},On.size=function(e){if(null==e)return 0;if(Hs(e))return ra(e)?fn(e):e.length;var t=co(e);return t==y||t==T?e.size:qr(e).length},On.snakeCase=Ua,On.some=function(e,t,r){var i=Ns(e)?Bt:ei;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},On.sortedIndex=function(e,t){return ti(e,t)},On.sortedIndexBy=function(e,t,n){return ni(e,t,io(n,2))},On.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ti(e,t);if(r<n&&Ls(e[r],t))return r}return-1},On.sortedLastIndex=function(e,t){return ti(e,t,!0)},On.sortedLastIndexBy=function(e,t,n){return ni(e,t,io(n,2),!0)},On.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ti(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},On.startCase=Ga,On.startsWith=function(e,t,n){return e=da(e),n=null==n?0:ir(ca(n),0,e.length),t=oi(t),e.slice(n,n+t.length)==t},On.subtract=vl,On.sum=function(e){return e&&e.length?Vt(e,Za):0},On.sumBy=function(e,t){return e&&e.length?Vt(e,io(t,2)):0},On.template=function(e,t,r){var i=On.templateSettings;r&&mo(e,t,r)&&(t=n),e=da(e),t=ga({},t,i,Ki);var o,s,a=ga({},t.imports,i.imports,Ki),l=Ca(a),f=Xt(a,l),c=0,u=t.interpolate||be,h="__p += '",p=je((t.escape||be).source+"|"+u.source+"|"+(u===Y?ce:be).source+"|"+(t.evaluate||be).source+"|$","g"),d="//# sourceURL="+(Me.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(c,l).replace(we,tn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t}),h+="';\n";var A=Me.call(t,"variable")&&t.variable;if(A){if(le.test(A))throw new ve("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(z,""):h).replace(H,"$1").replace(U,"$1;"),h="function("+(A||"obj")+") {\n"+(A?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ka(function(){return ye(l,d+"return "+h).apply(n,f)});if(m.source=h,Ws(m))throw m;return m},On.times=function(e,t){if((e=ca(e))<1||e>c)return[];var n=h,r=mn(e,h);t=io(t),e-=h;for(var i=Wt(r,t);++n<e;)t(n);return i},On.toFinite=fa,On.toInteger=ca,On.toLength=ua,On.toLower=function(e){return da(e).toLowerCase()},On.toNumber=ha,On.toSafeInteger=function(e){return e?ir(ca(e),-9007199254740991,c):0===e?e:0},On.toString=da,On.toUpper=function(e){return da(e).toUpperCase()},On.trim=function(e,t,r){if((e=da(e))&&(r||t===n))return Qt(e);if(!e||!(t=oi(t)))return e;var i=cn(e),o=cn(t);return gi(i,Jt(i,o),$t(i,o)+1).join("")},On.trimEnd=function(e,t,r){if((e=da(e))&&(r||t===n))return e.slice(0,un(e)+1);if(!e||!(t=oi(t)))return e;var i=cn(e);return gi(i,0,$t(i,cn(t))+1).join("")},On.trimStart=function(e,t,r){if((e=da(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=oi(t)))return e;var i=cn(e);return gi(i,Jt(i,cn(t))).join("")},On.truncate=function(e,t){var r=30,i="...";if(Ys(t)){var o="separator"in t?t.separator:o;r="length"in t?ca(t.length):r,i="omission"in t?oi(t.omission):i}var s=(e=da(e)).length;if(nn(e)){var a=cn(e);s=a.length}if(r>=s)return e;var l=r-fn(i);if(l<1)return i;var f=a?gi(a,0,l).join(""):e.slice(0,l);if(o===n)return f+i;if(a&&(l+=f.length-l),ta(o)){if(e.slice(l).search(o)){var c,u=f;for(o.global||(o=je(o.source,da(ue.exec(o))+"g")),o.lastIndex=0;c=o.exec(u);)var h=c.index;f=f.slice(0,h===n?l:h)}}else if(e.indexOf(oi(o),l)!=l){var p=f.lastIndexOf(o);p>-1&&(f=f.slice(0,p))}return f+i},On.unescape=function(e){return(e=da(e))&&W.test(e)?e.replace(G,hn):e},On.uniqueId=function(e){var t=++qe;return da(e)+t},On.upperCase=Va,On.upperFirst=Wa,On.each=ds,On.eachRight=As,On.first=Ho,rl(On,(pl={},gr(On,function(e,t){Me.call(On.prototype,t)||(pl[t]=e)}),pl),{chain:!1}),On.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){On[e].placeholder=On}),jt(["drop","take"],function(e,t){zn.prototype[e]=function(r){r=r===n?1:An(ca(r),0);var i=this.__filtered__&&!t?new zn(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,h),type:e+(i.__dir__<0?"Right":"")}),i},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),jt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),jt(["head","last"],function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}}),jt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}}),zn.prototype.compact=function(){return this.filter(Za)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Wr(function(e,t){return"function"==typeof e?new zn(this):this.map(function(n){return Cr(n,e,t)})}),zn.prototype.reject=function(e){return this.filter(Ps(io(e)))},zn.prototype.slice=function(e,t){e=ca(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ca(t))<0?r.dropRight(-t):r.take(t-e)),r)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(h)},gr(zn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=On[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(On.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof zn,f=a[0],c=l||Ns(t),u=function(e){var t=o.apply(On,Pt([e],a));return i&&h?t[0]:t};c&&r&&"function"==typeof f&&1!=f.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=s&&!h,A=l&&!p;if(!s&&c){t=A?t:new zn(this);var m=e.apply(t,a);return m.__actions__.push({func:fs,args:[u],thisArg:n}),new Nn(m,h)}return d&&A?e.apply(this,a):(m=this.thru(u),d?i?m.value()[0]:m.value():m)})}),jt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);On.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ns(i)?i:[],e)}return this[n](function(n){return t.apply(Ns(n)?n:[],e)})}}),gr(zn.prototype,function(e,t){var n=On[t];if(n){var r=n.name+"";Me.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}}),kn[Li(n,2).name]=[{name:"wrapper",func:n}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ns(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mn(t,e+s);break;case"takeRight":e=An(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,f=r?a:s-1,c=this.__iteratees__,u=c.length,h=0,p=mn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return ci(e,this.__actions__);var d=[];e:for(;l--&&h<p;){for(var A=-1,m=e[f+=t];++A<u;){var g=c[A],b=g.iteratee,w=g.type,v=b(m);if(2==w)m=v;else if(!v){if(1==w)continue e;break e}}d[h++]=m}return d},On.prototype.at=cs,On.prototype.chain=function(){return ls(this)},On.prototype.commit=function(){return new Nn(this.value(),this.__chain__)},On.prototype.next=function(){this.__values__===n&&(this.__values__=la(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},On.prototype.plant=function(e){for(var t,r=this;r instanceof Dn;){var i=Ro(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},On.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Yo],thisArg:n}),new Nn(t,this.__chain__)}return this.thru(Yo)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return ci(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Ke&&(On.prototype[Ke]=function(){return this}),On}();ht?((ht.exports=pn)._=pn,ut._=pn):ct._=pn}).call(i)}(wJ,bJ);var vJ=6371008.8,yJ={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:vJ,metres:vJ,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function _J(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function xJ(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!TJ(e[0])||!TJ(e[1]))throw new Error("coordinates must contain numbers");return _J({type:"Point",coordinates:e},t,n)}function jJ(e){return e%(2*Math.PI)*180/Math.PI}function EJ(e){return e%360*Math.PI/180}function TJ(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function CJ(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function kJ(e,t,n={}){var r=CJ(e),i=CJ(t),o=EJ(i[1]-r[1]),s=EJ(i[0]-r[0]),a=EJ(r[1]),l=EJ(i[1]),f=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return function(e,t="kilometers"){const n=yJ[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),n.units)}var SJ=Object.defineProperty,IJ=Object.defineProperties,PJ=Object.getOwnPropertyDescriptors,MJ=Object.getOwnPropertySymbols,qJ=Object.prototype.hasOwnProperty,BJ=Object.prototype.propertyIsEnumerable,RJ=(e,t,n)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LJ=(e,t)=>{for(var n in t||(t={}))qJ.call(t,n)&&RJ(e,n,t[n]);if(MJ)for(var n of MJ(t))BJ.call(t,n)&&RJ(e,n,t[n]);return e},OJ=(e,t)=>IJ(e,PJ(t));function FJ(e,t){const[n,r,i]=e,[o,s,a]=t;return n*o+r*s+i*a}function DJ(e,t){const[n,r,i]=e,[o,s,a]=t;return[r*a-i*s,i*o-n*a,n*s-r*o]}function NJ(e){const t=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2))}(e);return[e[0]/t,e[1]/t,e[2]/t]}function zJ(e){const t=EJ(e[1]),n=EJ(e[0]);return[Math.cos(t)*Math.cos(n),Math.cos(t)*Math.sin(n),Math.sin(t)]}function HJ(e){const[t,n,r]=e,i=Math.min(Math.max(r,-1),1),o=jJ(Math.asin(i));return[jJ(Math.atan2(n,t)),o]}function UJ(e,t,n){const r=zJ(e),i=zJ(t),o=zJ(n),s=DJ(r,i);if(0===s[0]&&0===s[1]&&0===s[2])return FJ(r,i)>0?[[...t],!0]:[[...n],!1];const a=DJ(s,o);if(0===a[0]&&0===a[1]&&0===a[2])return[[...t],!0];const l=NJ(DJ(a,s)),f=[-l[0],-l[1],-l[2]],c=FJ(o,l)>FJ(o,f)?l:f,u=NJ(s),h=FJ(DJ(r,c),u),p=FJ(DJ(c,i),u);return h>=0&&p>=0?[HJ(c),!1]:FJ(r,o)>FJ(i,o)?[[...e],!1]:[[...t],!0]}var GJ=function(e,t,n={}){if(!e||!t)throw new Error("lines and inputPoint are required arguments");const r=CJ(t);let i=xJ([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,s=0,a=-1;return l=function(e,l,f){a!==f&&(a=f,s=0);const c=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),u=c.length-2;for(let e=0;e<c.length-1;e++){const a=xJ(c[e]),l=CJ(a),h=xJ(c[e+1]),p=CJ(h),d=kJ(a,h,n);let A,m;p[0]===r[0]&&p[1]===r[1]?[A,m]=[p,!0]:l[0]===r[0]&&l[1]===r[1]?[A,m]=[l,!1]:[A,m]=UJ(l,p,r);const g=kJ(t,A,n);if(g<i.properties.pointDistance){const t=kJ(a,A,n);i=xJ(A,{lineStringIndex:f,segmentIndex:m&&e+1<=u?e+1:e,totalDistance:o+t,lineDistance:s+t,segmentDistance:t,pointDistance:g,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),i.properties=OJ(LJ({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}o+=d,s+=d}},function(e,t){var n,r,i,o,s,a,l,f,c,u,h=0,p="FeatureCollection"===e.type,d="Feature"===e.type,A=p?e.features.length:1;for(n=0;n<A;n++){for(a=p?e.features[n].geometry:d?e.geometry:e,f=p?e.features[n].properties:d?e.properties:{},c=p?e.features[n].bbox:d?e.bbox:void 0,u=p?e.features[n].id:d?e.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,f,c,u))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],h,f,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,f,c,u))return!1;h++}}(e,function(e,t,n,r,i){var o,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==l(_J(e,n,{bbox:r,id:i}),t,0)&&void 0}switch(s){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}for(var a=0;a<e.coordinates.length;a++){var f=e.coordinates[a];if(!1===l(_J({type:o,coordinates:f},n),t,a))return!1}}),i;var l};function VJ(e,t,n){if(null!==e)for(var r,i,o,s,a,l,f,c,u=0,h=0,p=e.type,d="FeatureCollection"===p,A="Feature"===p,m=d?e.features.length:1,g=0;g<m;g++){a=(c=!!(f=d?e.features[g].geometry:A?e.geometry:e)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var b=0;b<a;b++){var w=0,v=0;if(null!==(s=c?f.geometries[b]:f)){l=s.coordinates;var y=s.type;switch(u=!n||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":if(!1===t(l,h,g,w,v))return!1;h++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,g,w,v))return!1;h++,"MultiPoint"===y&&w++}"LineString"===y&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-u;i++){if(!1===t(l[r][i],h,g,w,v))return!1;h++}"MultiLineString"===y&&w++,"Polygon"===y&&v++}"Polygon"===y&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(v=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-u;o++){if(!1===t(l[r][i][o],h,g,w,v))return!1;h++}v++}w++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===VJ(s.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function WJ(e){const t={type:"Feature"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=QJ(e.properties),null==e.geometry?t.geometry=null:t.geometry=KJ(e.geometry),t}function QJ(e){const t={};return e?(Object.keys(e).forEach(n=>{const r=e[n];"object"==typeof r?null===r?t[n]=null:Array.isArray(r)?t[n]=r.map(e=>e):t[n]=QJ(r):t[n]=r}),t):t}function KJ(e){const t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map(e=>KJ(e)),t):(t.coordinates=XJ(e.coordinates),t)}function XJ(e){const t=e;return"object"!=typeof t[0]?t.slice():t.map(e=>XJ(e))}var YJ=6371008.8,JJ={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*YJ,kilometers:6371.0088,kilometres:6371.0088,meters:YJ,metres:YJ,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:YJ/1852,radians:1,yards:6967335.223679999};function $J(e){return e%360*Math.PI/180}function ZJ(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function e$(e,t,n,r={}){const i=t<0;let o=function(e,t="kilometers",n="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return function(e,t="kilometers"){const n=JJ[t];if(!n)throw new Error(t+" units is invalid");return e*n}(function(e,t="kilometers"){const n=JJ[t];if(!n)throw new Error(t+" units is invalid");return e/n}(e,t),n)}(Math.abs(t),r.units,"meters");i&&(o=-Math.abs(o));const s=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),a=function(e,t,n,r){const i=t/(r=void 0===r?YJ:Number(r)),o=e[0]*Math.PI/180,s=$J(e[1]),a=$J(n),l=i*Math.cos(a);let f=s+l;Math.abs(f)>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f);const c=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),u=Math.abs(c)>1e-11?l/c:Math.cos(s);return[(180*(o+i*Math.sin(a)/u)/Math.PI+540)%360-180,180*f/Math.PI]}(s,o,n);return a[0]+=a[0]-s[0]>180?-360:s[0]-a[0]>180?360:0,function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ZJ(e[0])||!ZJ(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}(a,r.properties)}var t$=function(e,t,n,r){if(null===(i=r=r||{})||"object"!=typeof i||Array.isArray(i))throw new Error("options is invalid");var i,o=r.units,s=r.zTranslation,a=r.mutate;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");if(s&&"number"!=typeof s&&isNaN(s))throw new Error("zTranslation is not a number");if(s=void 0!==s?s:0,0===t&&0===s)return e;if(null==n||isNaN(n))throw new Error("direction is required");return t<0&&(t=-t,n+=180),!1!==a&&void 0!==a||(e=function(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return WJ(e);case"FeatureCollection":return function(e){const t={type:"FeatureCollection"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(e=>WJ(e)),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return KJ(e);default:throw new Error("unknown GeoJSON type")}}(e)),VJ(e,function(e){var r=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e$(e,t,n,{units:o}));e[0]=r[0],e[1]=r[1],s&&3===e.length&&(e[2]+=s)}),e};const n$="meters",r$=1.42;var i$,o$,s$,a$;function l$(e){if(!e)throw new Error("geojson is required");var t=[];return S(e,function(e){!function(e,t){var n=[],r=e.geometry;if(null!==r){switch(r.type){case"Polygon":n=_(r);break;case"LineString":n=[_(r)]}n.forEach(function(n){var r=function(e,t){var n=[];return e.reduce(function(e,r){var i,o,s,a,l,f,c=A([e,r],t);return c.bbox=(o=r,s=(i=e)[0],a=i[1],[s<(l=o[0])?s:l,a<(f=o[1])?a:f,s>l?s:l,a>f?a:f]),n.push(c),r}),n}(n,e.properties);r.forEach(function(e){e.id=t.length,t.push(e)})})}}(e,t)}),m(t)}!function(e){e[e.TwoWay=2]="TwoWay",e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(i$||(i$={})),function(e){e.Transit="transit",e.Public="public"}(o$||(o$={})),function(e){e.Edge="what.route_edge",e.Network="what.route_network",e.PortalNetwork="what.link"}(s$||(s$={})),function(e){e.escalator="escalator",e.lift="lift",e.liftAnchor="liftAnchor",e.bus="airport_transfer",e.skytrain="skytrain",e.entrance="entrance",e.exit="exit",e.staircase="staircase",e.unknown=""}(a$||(a$={}));var f$={},c$={get exports(){return f$},set exports(e){f$=e}},u$={},h$={get exports(){return u$},set exports(e){u$=e}};h$.exports=function(){function e(e,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,f=Math.log(a),c=.5*Math.exp(2*f/3),u=.5*Math.sqrt(f*c*(a-c)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*c/a+u)),Math.min(o,Math.floor(r+(a-l)*c/a+u)),s)}var h=n[r],p=i,d=o;for(t(n,i,r),s(n[o],h)>0&&t(n,i,o);p<d;){for(t(n,p,d),p++,d--;s(n[p],h)<0;)p++;for(;s(n[d],h)>0;)d--}0===s(n[i],h)?t(n,i,d):t(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,r,i||0,o||e.length-1,s||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:e>t?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function o(e,t){s(e,0,e.children.length,t,e)}function s(e,t,n,r,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=t;o<n;o++){var s=e.children[o];a(i,e.leaf?r(s):s)}return i}function a(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function l(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function h(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function d(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(t,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;e(t,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!p(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o<t.children.length;o++){var s=t.children[o],a=t.leaf?r(s):s;p(e,a)&&(t.leaf?n.push(s):h(e,a)?this._all(s,n):i.push(s))}t=i.pop()}return n},r.prototype.collides=function(e){var t=this.data;if(!p(e,t))return!1;for(var n=[];t;){for(var r=0;r<t.children.length;r++){var i=t.children[r],o=t.leaf?this.toBBox(i):i;if(p(e,o)){if(t.leaf||h(e,o))return!0;n.push(i)}}t=n.pop()}return!1},r.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(e,t){if(!e)return this;for(var n,r,o,s=this.data,a=this.toBBox(e),l=[],f=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=f.pop(),o=!0),s.leaf){var c=i(e,s.children,t);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!h(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),f.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(e){return e},r.prototype.compareMinX=function(e,t){return e.minX-t.minX},r.prototype.compareMinY=function(e,t){return e.minY-t.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(e){return this.data=e,this},r.prototype._all=function(e,t){for(var n=[];e;)e.leaf?t.push.apply(t,e.children):n.push.apply(n,e.children),e=n.pop();return t},r.prototype._build=function(e,t,n,r){var i,s=n-t+1,a=this._maxEntries;if(s<=a)return o(i=d(e.slice(t,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=d([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),f=l*Math.ceil(Math.sqrt(a));A(e,t,n,f,this.compareMinX);for(var c=t;c<=n;c+=f){var u=Math.min(c+f-1,n);A(e,c,u,l,this.compareMinY);for(var h=c;h<=u;h+=l){var p=Math.min(h+l-1,u);i.children.push(this._build(e,h,p,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<t.children.length;a++){var l=t.children[a],f=c(l),u=(h=e,p=l,(Math.max(p.maxX,h.maxX)-Math.min(p.minX,h.minX))*(Math.max(p.maxY,h.maxY)-Math.min(p.minY,h.minY))-f);u<o?(o=u,i=f<i?f:i,s=l):u===o&&f<i&&(i=f,s=l)}t=s||t.children[0]}var h,p;return t},r.prototype._insert=function(e,t,n){var r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),a(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(e,t){this.data=d([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,l,f,u,h=1/0,p=1/0,d=t;d<=n-t;d++){var A=s(e,0,d,this.toBBox),m=s(e,d,n,this.toBBox),g=(i=A,o=m,void 0,void 0,void 0,void 0,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),f=Math.min(i.maxX,o.maxX),u=Math.min(i.maxY,o.maxY),Math.max(0,f-a)*Math.max(0,u-l)),b=c(A)+c(m);g<h?(h=g,r=d,p=b<p?b:p):g===h&&b<p&&(p=b,r=d)}return r||n-t},r.prototype._chooseSplitAxis=function(e,t,n){var r=e.leaf?this.compareMinX:l,i=e.leaf?this.compareMinY:f;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)},r.prototype._allDistMargin=function(e,t,n,r){e.children.sort(r);for(var i=this.toBBox,o=s(e,0,t,i),l=s(e,n-t,n,i),f=u(o)+u(l),c=t;c<n-t;c++){var h=e.children[c];a(o,e.leaf?i(h):h),f+=u(o)}for(var p=n-t-1;p>=t;p--){var d=e.children[p];a(l,e.leaf?i(d):d),f+=u(l)}return f},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)a(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}();var p$={};!function(e){function t(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function n(e,n,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(e[0])||!h(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function r(e,n,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:e},n,r)}function i(e,n,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:e},n,r)}function o(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function s(e,n,r){return void 0===r&&(r={}),t({type:"MultiLineString",coordinates:e},n,r)}function a(e,n,r){return void 0===r&&(r={}),t({type:"MultiPoint",coordinates:e},n,r)}function l(e,n,r){return void 0===r&&(r={}),t({type:"MultiPolygon",coordinates:e},n,r)}function f(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function u(e){return e%(2*Math.PI)*180/Math.PI}function h(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=t,e.geometry=function(e,t,o){switch(e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return r(t).geometry;case"MultiPoint":return a(t).geometry;case"MultiLineString":return s(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},e.point=n,e.points=function(e,t,r){return void 0===r&&(r={}),o(e.map(function(e){return n(e,t)}),r)},e.polygon=r,e.polygons=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return r(e,t)}),n)},e.lineString=i,e.lineStrings=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return i(e,t)}),n)},e.featureCollection=o,e.multiLineString=s,e.multiPoint=a,e.multiPolygon=l,e.geometryCollection=function(e,n,r){return void 0===r&&(r={}),t({type:"GeometryCollection",geometries:e},n,r)},e.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},e.radiansToLength=f,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return u(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=u,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(c(e,t),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=h,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!h(e))throw new Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(p$);var d$={};Object.defineProperty(d$,"__esModule",{value:!0});var A$=p$;function m$(e,t,n){if(null!==e)for(var r,i,o,s,a,l,f,c,u=0,h=0,p=e.type,d="FeatureCollection"===p,A="Feature"===p,m=d?e.features.length:1,g=0;g<m;g++){a=(c=!!(f=d?e.features[g].geometry:A?e.geometry:e)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var b=0;b<a;b++){var w=0,v=0;if(null!==(s=c?f.geometries[b]:f)){l=s.coordinates;var y=s.type;switch(u=!n||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":if(!1===t(l,h,g,w,v))return!1;h++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,g,w,v))return!1;h++,"MultiPoint"===y&&w++}"LineString"===y&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-u;i++){if(!1===t(l[r][i],h,g,w,v))return!1;h++}"MultiLineString"===y&&w++,"Polygon"===y&&v++}"Polygon"===y&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(v=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-u;o++){if(!1===t(l[r][i][o],h,g,w,v))return!1;h++}v++}w++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===m$(s.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g$(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function b$(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function w$(e,t){var n,r,i,o,s,a,l,f,c,u,h=0,p="FeatureCollection"===e.type,d="Feature"===e.type,A=p?e.features.length:1;for(n=0;n<A;n++){for(a=p?e.features[n].geometry:d?e.geometry:e,f=p?e.features[n].properties:d?e.properties:{},c=p?e.features[n].bbox:d?e.bbox:void 0,u=p?e.features[n].id:d?e.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,f,c,u))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],h,f,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,f,c,u))return!1;h++}}function v$(e,t){w$(e,function(e,n,r,i,o){var s,a=null===e?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==t(A$.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<e.coordinates.length;l++){var f={type:s,coordinates:e.coordinates[l]};if(!1===t(A$.feature(f,r),n,l))return!1}})}function y$(e,t){v$(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,f=0;return!1!==m$(e,function(o,c,u,h,p){if(void 0===s||n>a||h>l||p>f)return s=o,a=n,l=h,f=p,void(i=0);var d=A$.lineString([s,o],e.properties);if(!1===t(d,n,r,p,i))return!1;i++,s=o})&&void 0}}})}function _$(e,t){if(!e)throw new Error("geojson is required");v$(e,function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===t(A$.lineString(o[s],e.properties),n,r,s))return!1}}})}d$.coordAll=function(e){var t=[];return m$(e,function(e){t.push(e)}),t},d$.coordEach=m$,d$.coordReduce=function(e,t,n,r){var i=n;return m$(e,function(e,r,o,s,a){i=0===r&&void 0===n?e:t(i,e,r,o,s,a)},r),i},d$.featureEach=b$,d$.featureReduce=function(e,t,n){var r=n;return b$(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},d$.findPoint=function(e,t){if(t=t||{},!A$.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.coordIndex||0,a=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":a=a||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return A$.point(l,a,t);case"MultiPoint":return i<0&&(i=l.length+i),A$.point(l[i],a,t);case"LineString":return s<0&&(s=l.length+s),A$.point(l[s],a,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),A$.point(l[o][s],a,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s),A$.point(l[i][s],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s),A$.point(l[i][o][s],a,t)}throw new Error("geojson is invalid")},d$.findSegment=function(e,t){if(t=t||{},!A$.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.segmentIndex||0,a=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":a=a||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),A$.lineString([l[s],l[s+1]],a,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),A$.lineString([l[o][s],l[o][s+1]],a,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s-1),A$.lineString([l[i][s],l[i][s+1]],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s-1),A$.lineString([l[i][o][s],l[i][o][s+1]],a,t)}throw new Error("geojson is invalid")},d$.flattenEach=v$,d$.flattenReduce=function(e,t,n){var r=n;return v$(e,function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)}),r},d$.geomEach=w$,d$.geomReduce=function(e,t,n){var r=n;return w$(e,function(e,i,o,s,a){r=0===i&&void 0===n?e:t(r,e,i,o,s,a)}),r},d$.lineEach=_$,d$.lineReduce=function(e,t,n){var r=n;return _$(e,function(e,i,o,s){r=0===i&&void 0===n?e:t(r,e,i,o,s)}),r},d$.propEach=g$,d$.propReduce=function(e,t,n){var r=n;return g$(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},d$.segmentEach=y$,d$.segmentReduce=function(e,t,n){var r=n,i=!1;return y$(e,function(e,o,s,a,l){r=!1===i&&void 0===n?e:t(r,e,o,s,a,l),i=!0}),r};var x$={};Object.defineProperty(x$,"__esModule",{value:!0});var j$=d$;function E$(e){var t=[1/0,1/0,-1/0,-1/0];return j$.coordEach(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}E$.default=E$,x$.default=E$;var T$=u$,C$=p$,k$=d$,S$=x$.default,I$=k$.featureEach;k$.coordEach;var P$=C$.featureCollection;function M$(e){var t=new T$(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:S$(e),T$.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:S$(e),t.push(e)}):I$(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:S$(e),t.push(e)}),T$.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:S$(e),T$.prototype.remove.call(this,e,t)},t.clear=function(){return T$.prototype.clear.call(this)},t.search=function(e){var t=T$.prototype.search.call(this,this.toBBox(e));return P$(t)},t.collides=function(e){return T$.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=T$.prototype.all.call(this);return P$(e)},t.toJSON=function(){return T$.prototype.toJSON.call(this)},t.fromJSON=function(e){return T$.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=S$(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=S$(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}function q$(e,t){var n={},r=[];if("LineString"===e.type&&(e=h(e)),"LineString"===t.type&&(t=h(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=B$(e,t);return i&&r.push(i),m(r)}var o=f$();return o.load(l$(t)),C(l$(e),function(e){C(o.search(e),function(t){var i=B$(e,t);if(i){var o=_(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),m(r)}function B$(e,t){var n=_(e),r=_(t);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=r[0][0],f=r[0][1],c=r[1][0],u=r[1][1],h=(u-f)*(s-i)-(c-l)*(a-o);if(0===h)return null;var d=((c-l)*(o-f)-(u-f)*(i-l))/h,A=((s-i)*(o-f)-(a-o)*(i-l))/h;return d>=0&&d<=1&&A>=0&&A<=1?p([i+d*(s-i),o+d*(a-o)]):null}function R$(e,t){void 0===t&&(t={});var n=x(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),n.type){case"Polygon":return function(e,t){return void 0===t&&(t={}),L$(x(e).coordinates,t.properties?t.properties:"Feature"===e.type?e.properties:{})}(n,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var n=x(e).coordinates,r=t.properties?t.properties:"Feature"===e.type?e.properties:{},i=[];return n.forEach(function(e){i.push(L$(e,r))}),m(i)}(n,t);default:throw new Error("invalid poly")}}function L$(e,t){return e.length>1?function(e,t,n){return void 0===n&&(n={}),h({type:"MultiLineString",coordinates:e},t,n)}(e,t):A(e[0],t)}function O$(e,t){var n=!0;return S(e,function(e){S(t,function(t){if(!1===n)return!1;n=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,r=t.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!F$(t,e);case"Polygon":return!io(e,t)}break;case"LineString":switch(t.type){case"Point":return!F$(e,t);case"LineString":return!(q$(e,t).features.length>0);case"Polygon":return!D$(t,e)}break;case"Polygon":switch(t.type){case"Point":return!io(t,e);case"LineString":return!D$(e,t);case"Polygon":return!function(e,t){for(var n=0,r=e.coordinates[0];n<r.length;n++)if(io(r[n],t))return!0;for(var i=0,o=t.coordinates[0];i<o.length;i++)if(io(o[i],e))return!0;return q$(R$(e),R$(t)).features.length>0}(t,e)}}var n,r;return!1}(e.geometry,t.geometry)})}),n}function F$(e,t){for(var n=0;n<e.coordinates.length-1;n++)if(N$(e.coordinates[n],e.coordinates[n+1],t.coordinates))return!0;return!1}function D$(e,t){for(var n=0,r=t.coordinates;n<r.length;n++)if(io(r[n],e))return!0;return q$(t,R$(e)).features.length>0}function N$(e,t,n){var r=n[0]-e[0],i=n[1]-e[1],o=t[0]-e[0],s=t[1]-e[1];return 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?e[0]<=n[0]&&n[0]<=t[0]:t[0]<=n[0]&&n[0]<=e[0]:s>0?e[1]<=n[1]&&n[1]<=t[1]:t[1]<=n[1]&&n[1]<=e[1])}function z$(e,t,n){void 0===n&&(n={});var r=p([1/0,1/0],{dist:1/0}),i=0;return S(e,function(e){for(var o=_(e),s=0;s<o.length-1;s++){var a=p(o[s]);a.properties.dist=E(t,a,n);var l=p(o[s+1]);l.properties.dist=E(t,l,n);var f=E(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),u=no(a,l),h=ro(t,c,u+90,n),d=ro(t,c,u-90,n),m=q$(A([h.geometry.coordinates,d.geometry.coordinates]),A([a.geometry.coordinates,l.geometry.coordinates])),g=null;m.features.length>0&&((g=m.features[0]).properties.dist=E(t,g,n),g.properties.location=i+E(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=s+1,r.properties.location=i+f),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=f}}),r}function H$(e,t,n){var r=_(n);if("LineString"!==j(n))throw new Error("line must be a LineString");for(var i,o=z$(n,e),s=z$(n,t),a=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],l=i[0].properties.index+1;l<i[1].properties.index+1;l++)a.push(r[l]);return a.push(i[1].geometry.coordinates),A(a,n.properties)}function U$(e,t){if(!new.target)return new U$(e,t);if(Array.isArray(e)||(t=e,e=[]),t=t||{},this.data=e||[],this.length=this.data.length,this.compare=t.compare||V$,this.setNodeId=t.setNodeId||G$,this.length>0)for(var n=this.length>>1;n>=0;n--)this._down(n);if(t.setNodeId)for(n=0;n<this.length;++n)this.setNodeId(this.data[n],n)}function G$(){}function V$(e,t){return e-t}function W$(e){this.node=e,this.parent=null,this.closed=!1,this.open=0,this.distanceToSource=Number.POSITIVE_INFINITY,this.fScore=Number.POSITIVE_INFINITY,this.heapIndex=-1}c$.exports=M$,f$.default=M$,U$.prototype={push:function(e){this.data.push(e),this.setNodeId(e,this.length),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.setNodeId(this.data[0],0),this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},updateItem:function(e){this._down(e),this._up(e)},_up:function(e){for(var t=this.data,n=this.compare,r=this.setNodeId,i=t[e];e>0;){var o=e-1>>1,s=t[o];if(n(i,s)>=0)break;t[e]=s,r(s,e),e=o}t[e]=i,r(i,e)},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e],o=this.setNodeId;e<r;){var s=1+(e<<1),a=s+1,l=t[s];if(a<this.length&&n(t[a],l)<0&&(s=a,l=t[a]),n(l,i)>=0)break;t[e]=l,o(l,e),e=s}t[e]=i,o(i,e)}};const Q$=[];"function"==typeof Object.freeze&&Object.freeze(Q$);const K$={heuristic:function(){return 0},distance:function(){return 1},blocked:function(){return!1},compareFScore:function(e,t){return e.fScore-t.fScore},NO_PATH:Q$,setHeapIndex:function(e,t){e.heapIndex=t},setH1:function(e,t){e.h1=t},setH2:function(e,t){e.h2=t},compareF1Score:function(e,t){return e.f1-t.f1},compareF2Score:function(e,t){return e.f2-t.f2}};var X$=K$.NO_PATH;function Y$(e,t){var n=(t=t||{}).oriented,r=t.blocked;r||(r=K$.blocked);var i=t.heuristic;i||(i=K$.heuristic);var o=t.distance;o||(o=K$.distance);var s=function(){var e=0,t=[];return{createNewState:function(n){var r=t[e];return r?(r.node=n,r.parent=null,r.closed=!1,r.open=0,r.distanceToSource=Number.POSITIVE_INFINITY,r.fScore=Number.POSITIVE_INFINITY,r.heapIndex=-1):(r=new W$(n),t[e]=r),e++,r},reset:function(){e=0}}}();return{find:function(t,a){var l=e.getNode(t);if(!l)throw new Error("fromId is not defined in this graph: "+t);var f=e.getNode(a);if(!f)throw new Error("toId is not defined in this graph: "+a);s.reset();var c,u=new Map,h=new U$({compare:K$.compareFScore,setNodeId:K$.setHeapIndex}),p=s.createNewState(l);for(u.set(t,p),p.fScore=i(l,f),p.distanceToSource=0,h.push(p),p.open=1;h.length>0;){if(J$(c=h.pop(),f))return $$(c);c.closed=!0,e.forEachLinkedNode(c.node.id,d,n)}return X$;function d(e,t){var n=u.get(e.id);if(n||(n=s.createNewState(e),u.set(e.id,n)),!n.closed&&(0===n.open&&(h.push(n),n.open=1),!r(e,c.node,t))){var a=c.distanceToSource+o(e,c.node,t);a>=n.distanceToSource||(n.parent=c,n.distanceToSource=a,n.fScore=a+i(n.node,f),h.updateItem(n.heapIndex))}}}}}function J$(e,t){return e.node===t}function $$(e){for(var t=[e.node],n=e.parent;n;)t.push(n.node),n=n.parent;return t}function Z$(e){if("uniqueLinkId"in(e=e||{})&&(e.multigraph=e.uniqueLinkId),void 0===e.multigraph&&(e.multigraph=!1),"function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var t,n=new Map,r=new Map,i={},o=0,s=e.multigraph?function(e,t,n){var r=rZ(e,t),o=i.hasOwnProperty(r);if(o||y(e,t)){o||(i[r]=0);var s="@"+ ++i[r];r=rZ(e+s,t+s)}return new nZ(e,t,n,r)}:function(e,t,n){var i=rZ(e,t),o=r.get(i);return o?(o.data=n,o):new nZ(e,t,n,i)},a=[],l=_,f=_,c=_,u=_,h={version:20,addNode:A,addLink:function(e,t,n){c();var i=m(e)||A(e),o=m(t)||A(t),a=s(e,t,n),f=r.has(a.id);return r.set(a.id,a),tZ(i,a),e!==t&&tZ(o,a),l(a,f?"update":"add"),u(),a},removeLink:function(e,t){return void 0!==t&&(e=y(e,t)),v(e)},removeNode:g,getNode:m,getNodeCount:b,getLinkCount:w,getEdgeCount:w,getLinksCount:w,getNodesCount:b,getLinks:function(e){var t=m(e);return t?t.links:null},forEachNode:E,forEachLinkedNode:function(e,t,r){var i=m(e);if(i&&i.links&&"function"==typeof t)return r?function(e,t,r){for(var i=e.values(),o=i.next();!o.done;){var s=o.value;if(s.fromId===t&&r(n.get(s.toId),s))return!0;o=i.next()}}(i.links,e,t):function(e,t,r){for(var i=e.values(),o=i.next();!o.done;){var s=o.value,a=s.fromId===t?s.toId:s.fromId;if(r(n.get(a),s))return!0;o=i.next()}}(i.links,e,t)},forEachLink:function(e){if("function"==typeof e)for(var t=r.values(),n=t.next();!n.done;){if(e(n.value))return!0;n=t.next()}},beginUpdate:c,endUpdate:u,clear:function(){c(),E(function(e){g(e.id)}),u()},hasLink:y,hasNode:m,getLink:y,getLinkById:function(e){return void 0===e?void 0:r.get(e)}};return function(e){!function(e){if(!e)throw new Error("Eventify cannot use falsy object as events subject");const t=["on","fire","off"];for(let n=0;n<t.length;++n)if(e.hasOwnProperty(t[n]))throw new Error("Subject cannot be eventified, since it already has property '"+t[n]+"'")}(e);const t=function(e){let t=Object.create(null);return{on:function(n,r,i){if("function"!=typeof r)throw new Error("callback is expected to be a function");let o=t[n];return o||(o=t[n]=[]),o.push({callback:r,ctx:i}),e},off:function(n,r){if(void 0===n)return t=Object.create(null),e;if(t[n])if("function"!=typeof r)delete t[n];else{const e=t[n];for(let t=0;t<e.length;++t)e[t].callback===r&&e.splice(t,1)}return e},fire:function(n){const r=t[n];if(!r)return e;let i;arguments.length>1&&(i=Array.prototype.slice.call(arguments,1));for(let e=0;e<r.length;++e){const t=r[e];t.callback.apply(t.ctx,i)}return e}}}(e);e.on=t.on,e.off=t.off,e.fire=t.fire}(h),t=h.on,h.on=function(){return h.beginUpdate=c=x,h.endUpdate=u=j,l=p,f=d,h.on=t,t.apply(h,arguments)},h;function p(e,t){a.push({link:e,changeType:t})}function d(e,t){a.push({node:e,changeType:t})}function A(e,t){if(void 0===e)throw new Error("Invalid node identifier");c();var r=m(e);return r?(r.data=t,f(r,"update")):(r=new eZ(e,t),f(r,"add")),n.set(e,r),u(),r}function m(e){return n.get(e)}function g(e){var t=m(e);if(!t)return!1;c();var r=t.links;return r&&(r.forEach(v),t.links=null),n.delete(e),f(t,"remove"),u(),!0}function b(){return n.size}function w(){return r.size}function v(e){if(!e)return!1;if(!r.get(e.id))return!1;c(),r.delete(e.id);var t=m(e.fromId),n=m(e.toId);return t&&t.links.delete(e),n&&n.links.delete(e),l(e,"remove"),u(),!0}function y(e,t){if(void 0!==e&&void 0!==t)return r.get(rZ(e,t))}function _(){}function x(){o+=1}function j(){0==(o-=1)&&a.length>0&&(h.fire("changed",a),a.length=0)}function E(e){if("function"!=typeof e)throw new Error("Function is expected to iterate over graph nodes. You passed "+e);for(var t=n.values(),r=t.next();!r.done;){if(e(r.value))return!0;r=t.next()}}}function eZ(e,t){this.id=e,this.links=null,this.data=t}function tZ(e,t){e.links?e.links.add(t):e.links=new Set([t])}function nZ(e,t,n,r){this.fromId=e,this.toId=t,this.data=n,this.id=r}function rZ(e,t){return e.toString()+"👉 "+t.toString()}function iZ(e,t){void 0===t&&(t={});var n="object"==typeof t?t.mutate:t;if(!e)throw new Error("geojson is required");var r=j(e),i=[];switch(r){case"LineString":i=oZ(e);break;case"MultiLineString":case"Polygon":_(e).forEach(function(e){i.push(oZ(e))});break;case"MultiPolygon":_(e).forEach(function(e){var t=[];e.forEach(function(e){t.push(oZ(e))}),i.push(t)});break;case"Point":return e;case"MultiPoint":var o={};_(e).forEach(function(e){var t=e.join("-");Object.prototype.hasOwnProperty.call(o,t)||(i.push(e),o[t]=!0)});break;default:throw new Error(r+" geometry not supported")}return e.coordinates?!0===n?(e.coordinates=i,e):{type:r,coordinates:i}:!0===n?(e.geometry.coordinates=i,e):h({type:r,coordinates:i},e.properties,{bbox:e.bbox,id:e.id})}function oZ(e){var t=_(e);if(2===t.length&&!sZ(t[0],t[1]))return t;var n=[],r=t.length-1,i=n.length;n.push(t[0]);for(var o=1;o<r;o++){var s=n[n.length-1];t[o][0]===s[0]&&t[o][1]===s[1]||(n.push(t[o]),(i=n.length)>2&&aZ(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1))}if(n.push(t[t.length-1]),i=n.length,sZ(t[0],t[t.length-1])&&i<4)throw new Error("invalid polygon");return aZ(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1),n}function sZ(e,t){return e[0]===t[0]&&e[1]===t[1]}function aZ(e,t,n){var r=n[0],i=n[1],o=e[0],s=e[1],a=t[0],l=t[1],f=a-o,c=l-s;return 0===(r-o)*c-(i-s)*f&&(Math.abs(f)>=Math.abs(c)?f>0?o<=r&&r<=a:a<=r&&r<=o:c>0?s<=i&&i<=l:l<=i&&i<=s)}function lZ(e,t=!0){const n=Aa.getState().data;if(!n.hasOwnProperty(s$.Network))return[];const r=n[s$.Network],i=[];for(let n=0;n<r.length;n++){const o=r[n];o&&o.properties&&o.properties.dimension_where&&(t?o.properties.dimension_where.includes(e)&&i.push(o):o.properties.dimension_where===e&&i.push(o))}return bJ.cloneDeep(i)}function fZ(e,t=!0){return lZ(e,t)}function cZ(e){const t=function(e){const t=Aa.getState().data;if("string"==typeof e){if(!e||!t.hasOwnProperty(s$.Edge)||!t[s$.Edge].edges.hasOwnProperty(e))return;return bJ.cloneDeep(t[s$.Edge].edges[e])}{const n=lZ(e.whereDimension);if(n.length<1)return null;let r,i,o=1/0;n.map(t=>{const n=iZ(t),s=GJ(n,e.sourceCoords),a=E(s.geometry.coordinates,e.sourceCoords);a<o&&(o=a,r=s,i=t)});const s=[A([e.sourceCoords,r.geometry.coordinates],{title:"user_edgeLine",zone:i.properties.zone,wheelchair:1,direction:i$.TwoWay,dimension_where:e.whereDimension})],a={id:"user_position",name:"Custom Position",coords:e.sourceCoords,lines:s,where:e.whereDimension,what:"",zone:i.properties.zone};return t[s$.Edge][a.id]=a,a}}(e);return t}function uZ(e){return function(e){const t=Aa.getState().data;return e&&t.hasOwnProperty("what.service.immigration")&&t["what.service.immigration"].hasOwnProperty(e)?t["what.service.immigration"][e]:[]}(e)}Y$.l2=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},Y$.l1=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)+Math.abs(r)};const hZ=.001;function pZ(e,t,n=!0){const r=(n,r)=>{const i=iZ(r),o=GJ(i,n);void 0!==o.properties.index&&(t.geometry.coordinates.splice(o.properties.index+1,0,e.geometry.coordinates),t.properties&&(t.properties.modified=1))};if(n){const n=function(e,t){let n=-1;return T(e,(e,r,i,o,s)=>{if(-1===n){const i=p(e);E(t,i,{units:"meters"})<hZ&&(n=r)}}),n}(t,e);-1===n?r(e.geometry.coordinates,t):(t.geometry.coordinates[n]=e.geometry.coordinates,t.properties&&(t.properties.modified=1))}else r(e.geometry.coordinates,t)}function dZ(e,t){const n=f$();n.load(t),e.forEach(e=>{const t=L(e);n.search(t).features.forEach(t=>{const n=t;if(e.properties&&e.properties.dimension_where&&n.properties&&n.properties.dimension_where&&e.properties.dimension_where===n.properties.dimension_where){!function(e,t){"LineString"===j(e)&&T(e,(n,r,i,o,s)=>{const a=p(n),l=iZ(t),f=GJ(l,a,{units:"meters"});if(f&&void 0!==f.properties.dist&&void 0!==f.properties.index){const n=p(t.geometry.coordinates[f.properties.index]);E(a,n,{units:"meters"})<hZ?(f.geometry.coordinates=n.geometry.coordinates,e.geometry.coordinates[r]=f.geometry.coordinates,e.properties&&(e.properties.modified=1)):f.properties.dist<hZ&&(e.geometry.coordinates[r]=f.geometry.coordinates,t.geometry.coordinates.splice(f.properties.index+1,0,f.geometry.coordinates),e.properties&&(e.properties.modified=1))}})}(e,n);const t=q$(e,n);if(t.features.length>0)for(let r=0;r<t.features.length;r+=1){const i=t.features[r];pZ(i,e,!1),pZ(i,n,!1)}}})})}function AZ(e){const t=e.split("."),n=t[t.length-1];return e.replace(".".concat(n),"")}function mZ(e,t){const n=[],r={};for(const i in e)if(e[i].where.includes(t)){const t=e[i];r[i]=t,n.push(...t.lines),t.links.forEach(e=>{n.push(...e.lines)})}return{edgeData:r,lines:n}}function gZ(e,t){const n=[],r={};return t.forEach(i=>{if(i in e&&t.has(e[i].id)){const t=e[i];r[i]=t,n.push(...t.lines),t.links.forEach(e=>{n.push(...e.lines)})}}),{edgeData:r,lines:n}}const bZ=function(){let e,t,n="where.singapore",r=!0,i=!0,o=!1,s={edgeData:{},lines:[]};function a(e,t,n,r,i,o,s=!1){const a=`${t.toString()},${r}`;let l=e.getNode(a);if(void 0===l){const s={mapObjectId:n,coords:t,where:r,what:i,zone:o,zoneUnionVertex:!1};l=e.addNode(a,s)}else s&&(l.data.mapObjectId=n,l.data.zone!==o&&(l.data.zoneUnionVertex=!0),l.data.zone=o);return l}function l(e,t,n,i){const{cost:o,description:s}=i,a=i.isPortal?o/r$:o;(!r||r&&i.wheelChairAccesible)&&e.addLink(t.id,n.id,{weight:a,cost:o,description:s})}function f(e,t){return E(p(e),p(t),{units:"meters"})}function c(e,t){const n=t;if(n){const t=a(e,n.coords,n.id,n.where,n.what,n.zone,!0);for(let t=0;t<n.lines.length;t+=1){const r=n.lines[t],i=_(r);for(let t=0;t<i.length-1;t+=1){const o=a(e,i[t],"vertex",n.where,s$.Edge,r.properties.zone),s=a(e,i[t+1],"vertex",n.where,s$.Edge,r.properties.zone);if(o.id!==s.id){const n=f(i[t],i[t+1]);r.properties.direction!==i$.Forward&&r.properties.direction!==i$.TwoWay||l(e,o,s,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null}),r.properties.direction!==i$.Backward&&r.properties.direction!==i$.TwoWay||l(e,s,o,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null})}}}return t}}function u(e,t){const n=t;if(void 0!==n)return a(e,n.coords,n.id,n.where,n.what,n.zone,!0)}function h(e){return{type:"Feature",geometry:{type:"LineString",coordinates:[e.data.coords]},properties:{dimension_where:e.data.where,zone:e.data.zone,cost:0}}}function d(t,n,r,o){const p=Z$(),d=c(p,t),m=c(p,n);if(d&&m){!function(e,t){for(const n in t){const r=t[n];for(let t=0;t<r.links.length;t+=1){const n=r.links[t];let{cost:i}=n;i=bJ.toInteger(i);const{direction:o,wheelchair:s,description:a}=n,f=u(e,r),h=u(e,n);void 0!==f&&void 0!==h&&f.id!==h.id&&(o!==i$.Forward&&o!==i$.TwoWay||l(e,f,h,{wheelChairAccesible:s,cost:i,description:a,isPortal:!0}),o!==i$.Backward&&o!==i$.TwoWay||l(e,h,f,{wheelChairAccesible:s,cost:i,description:a,isPortal:!0}),c(e,n))}c(e,r)}}(p,r),function(e,t){for(let n=0;n<t.length;n+=1){const r=t[n];if("LineString"===r.geometry.type){const t=_(r);if(r.properties){const n=r.properties.dimension_where,i=s$.Network,{zone:o}=r.properties;for(let s=0;s<t.length-1;s+=1){const c=a(e,t[s],"vertex",n,i,o,!0),u=a(e,t[s+1],"vertex",n,i,o,!0);if(c.id!==u.id){const n=f(t[s],t[s+1]);r.properties.direction!==i$.Forward&&r.properties.direction!==i$.TwoWay||l(e,c,u,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null}),r.properties.direction!==i$.Backward&&r.properties.direction!==i$.TwoWay||l(e,u,c,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null})}}}}}}(p,o);const b=function(t,n,r){return Y$(r,{oriented:!0,distance:(e,t,n)=>n.data.weight,blocked(t,n,r){if(i&&(null==t?void 0:t.data.zone)!==(null==n?void 0:n.data.zone)){const r=AZ(t.data.where),i=AZ(e.where),o=AZ(n.data.where);if(r!==i&&o!==i)return!0}return!1}}).find(t.id,n.id).reverse()}(d,m,p),w=function(e,t,n,r){if(n.length<=1)return{};const i=e,o=t,a=[];let l=n[0].data;const f=[h(n[0])];for(let e=1;e<n.length;e+=1){const t=n[e],i=n[e-1],o=f[f.length-1];if("vertex"!==t.data.mapObjectId||t.data.zoneUnionVertex){let f;if(PZ(i.data.what)&&PZ(t.data.what)){let e;if(i.data.zone,t.data.zone,SZ(i.data.what)){const n=(e,t,n,r=!1)=>{const i=n.data.mapObjectId,o=gZ(e,(new Set).add(i));if(o&&o.edgeData[i]){const e=o.edgeData[i];for(let i=0;i<e.links.length;i+=1){const o=e.links[i];if(o.id===t.data.mapObjectId&&o.pathFeatures&&o.pathFeatures.length>0){const e=o.pathFeatures[0],i=!1===r?n.data.coords:t.data.coords,s=!1===r?t.data.coords:n.data.coords;return A(E(i,e.geometry.coordinates[0])<E(s,e.geometry.coordinates[0])?e.geometry.coordinates:e.geometry.coordinates.slice().reverse())}}}return null};e=n(s.edgeData,t,i,!1),e||(e=n(s.edgeData,i,t,!0))}const n=r.getLink(i.id,t.id),o=n&&n.data.cost?n.data.cost:void 0,c=n&&n.data.description?n.data.description:void 0;f={geojson:g([i.data.coords,t.data.coords],{zone:t.data.zone}),edges:[i.data.mapObjectId,t.data.mapObjectId],startFloor:i.data.where,endFloor:t.data.where,isPortal:!0,portalPath:e,cost:o,description:c},a.push(f),l=t.data}else{const r=e+1<n.length?n[e+1]:void 0;t.data.zoneUnionVertex&&i&&r&&(null==i?void 0:i.data.zone)===(null==r?void 0:r.data.zone)||(f={geojson:o,edges:[l.mapObjectId,t.data.mapObjectId],startFloor:l.where,endFloor:l.where,isPortal:!1,portalPath:void 0,cost:o.properties.cost},a.push(f),l=t.data)}}if(PZ(i.data.what)&&PZ(t.data.what))o.geometry.coordinates.length<2&&f.pop(),f.push(h(t));else{const e=r.getLink(i.id,t.id),n=e&&e.data.cost?e.data.cost:void 0;o.geometry.coordinates.push(t.data.coords),o.properties.cost+=n}if(t.data.zoneUnionVertex){const r=e>0?n[e-1]:void 0,i=e+1<n.length?n[e+1]:void 0;if(r&&i&&(null==r?void 0:r.data.zone)===(null==i?void 0:i.data.zone));else if(i){const e=bJ.cloneDeep(t);e.data.zone=i.data.zone,f.push(h(e))}else f.push(h(t))}}return{startNode:i,endNode:o,routes:a,distance:0}}(t,n,b,p);return w}return{}}function m(e,t,r){const i=new Set;for(let e=0;r.routes&&e<r.routes.length;e+=1){const t=r.routes[e];t.isPortal&&(i.add(t.edges[0]),i.add(t.edges[1]))}let a=performance.now();const l=fZ(n),f=gZ(s.edgeData,i);a=performance.now();const c=e.lines.concat(t.lines,f.lines),u=l;return o&&dZ(c,u),d(e,t,f.edgeData,u)}return{getRoute:function(a,l,f){if(r=f,a===l)return{};"string"==typeof a&&"string"==typeof l||(o=!0);const c=cZ(a),u=cZ(l);if(e=c,t=u,e&&e.where){const t=e.where.split(".");t.length>=2&&(n=`${t[0]}.${t[1]}`)}let h=performance.now();if(s=function(){const e=Aa.getState().data;return e.hasOwnProperty("portal")?e.portal:{edgeData:{},lines:[]}}(),h=performance.now(),e&&t){i=!0;const r=()=>{const r=function(e,t){let n=performance.now();const r=fZ(AZ(e.where)),i=fZ(AZ(t.where)),a=mZ(s.edgeData,AZ(e.where)),l=mZ(s.edgeData,AZ(t.where));n=performance.now();const f=e.lines.concat(t.lines,a.lines,l.lines),c=r.concat(i);return o&&dZ(f,c),d(e,t,Object.assign(Object.assign({},a.edgeData),l.edgeData),c)}(e,t);if(bJ.isEmpty(r)){const r=function(e,t){let r=performance.now();const i=fZ(n);r=performance.now();const a=e.lines.concat(t.lines,s.lines),l=i;return o&&dZ(a,l),d(e,t,s.edgeData,l)}(e,t);return m(e,t,r)}return m(e,t,r)};let a=r();return bJ.isEmpty(a)&&(i=!1,a=r()),a}return{}}}}();var wZ,vZ,yZ;function _Z(e){const t=cZ(e.edges[0]),n=cZ(e.edges[1]);return{maneuverType:wZ.Static,coordinates:[],distance:0,features:[],time:0,startEdge:{mapObjectId:e.edges[0],whereDimension:e.startFloor,whatDimension:t?t.what:"",name:t?t.name:"Your Location"},endEdge:{mapObjectId:e.edges[1],whereDimension:e.endFloor,whatDimension:n?n.what:"",name:n?n.name:""},isPortal:e.isPortal,instructions:[],patchNumber:-1,whereDimension:"",zone:"",cost:e.cost,description:e.description}}function xZ(e){return e.maneuverType===wZ.RouteOverview||e.maneuverType===wZ.SectionOverview}function jZ(e,t){for(let n=0;n<e.length;n+=1){e[n].properties.highlight=!!t}return e}function EZ(e,t,n,r,i=""){if(0===e.length)return[];const o=[p(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return jZ(o,n),o}function TZ(e,t,n,r,i,o=""){if(0===e.length)return[];const s={segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},a=A(e,Object.assign(Object.assign({},s),{featureBelongsToLineString:!0})),l=p(e[0],Object.assign(Object.assign({},s),{featureBelongsToLineString:!1})),f=p(e[e.length-1],Object.assign(Object.assign({},s),{featureBelongsToLineString:!1})),c=[];return c.push(l,a,f),jZ(c,n),c}function CZ(e,t=0){const n=bJ.cloneDeep(e.segments[1]),r=e.segments.length>1?e.segments[1].startEdge.whereDimension:"";n.coordinates=[],n.features=[],n.time=0,n.distance=0,n.isPortal=!1,n.maneuverType=wZ.RouteOverview,n.patchNumber=t,n.instructions=["Overview"];for(let t=1;t<e.segments.length;t+=1)if(e.segments[t].maneuverType!==wZ.SectionOverview){for(let r=0;r<e.segments[t].coordinates.length;r+=1){const i=e.segments[t].coordinates[r];n.coordinates.push(i)}for(let i=0;i<e.segments[t].features.length;i+=1){const o=bJ.cloneDeep(e.segments[t].features[i]);o.properties&&!o.properties.isNode&&(o.properties.dimension_where!==r?o.properties.isNonHighlightedOverview="1":o.properties.isNonHighlightedOverview="0",o.properties.dimension_where=r,o.properties.patchNumber=n.patchNumber,o.properties.segmentNumber=n.patchNumber,n.features.push(o))}}return n.endEdge=bJ.cloneDeep(e.segments[e.segments.length-1].endEdge),n.time=e.walkingTime+e.transportTime,n.distance=e.walkingDistance+e.transportDistance,n}function kZ(e,t,n){var r;let i=[];for(let o=0;o<e.segments.length;o+=1){const s=e.segments[o];if(n.includeOverviewFeatures){if(xZ(s)){const e=[],t=[];for(let i=0;i<s.features.length;i++){const o=s.features[i];void 0!==(null===(r=o.properties)||void 0===r?void 0:r.patchNumber)&&o.properties.patchNumber===n.patchNumberForOverviewFeatures&&void 0!==o.properties.isNonHighlightedOverview&&("1"===o.properties.isNonHighlightedOverview?e.push(o):t.push(o))}const o=e.concat(t);i=i.concat(o)}}else s.patchNumber===t&&(xZ(s)||(i=i.concat(s.features)))}return i}function SZ(e){return!!Object.values(vZ).includes(e)}function IZ(e){return!!Object.values(yZ).includes(e)}function PZ(e){return!(!SZ(e)&&!IZ(e))}function MZ(e){switch(e){case"what.transport.skytrain":return"Skytrain";case"what.service.airport_transfer":return"Bus";case"what.infra.escalator":return"Escalator";case"what.infra.lift":return"Lift";case"what.infra.entrance":case"what.infra.exit":return"";default:return e}}function qZ(e,t){const n=function(e){const t=e.split(".").slice(-2).join("").toUpperCase().match(/^(T\d+|JEWEL)([A-Za-z]\d+[A-Za-z]?)$/);if(t){let e;switch(t[1][0]){case"T":e="Terminal";break;case"J":e="Jewel";break;default:e="Level"}const n="Terminal"===e?`${e} ${t[1][1]}`:`${e}`;let r;switch(t[2][0]){case"L":default:r="Level";break;case"B":r="Basement"}return{Terminal:n,Level:`${r} ${t[2].substr(1)}`}}return null}(t);if(n){if((r=e)===vZ.Skytrain||r===vZ.Bus)return n.Terminal;if(e===vZ.Escalator||e===vZ.Lift)return n.Level;if(IZ(e))return n.Terminal}var r;return t.split(".").slice(-2).join(" ").toUpperCase()}!function(e){e.RouteOverview="Route Overview",e.SectionOverview="Section Overview",e.LeftHairPinTurn="Left hairpin turn",e.RightHairPinTurn="Right hairpin turn",e.LeftTurn="Turn left",e.RightTurn="Turn right",e.ContinueStraight="Continue straight",e.EnterPortal="Enter Portal",e.TravelPortal="Travel Portal",e.ExitPortal="Exit Portal",e.Static="Static",e.ChangeZone="Change Zone",e.PassThroughImmigration="Pass Through Immigration"}(wZ||(wZ={})),function(e){e.Skytrain="what.transport.skytrain",e.Bus="what.service.airport_transfer",e.Escalator="what.infra.escalator",e.Lift="what.infra.lift"}(vZ||(vZ={})),function(e){e.Entrance="what.infra.entrance",e.Exit="what.infra.exit"}(yZ||(yZ={}));const BZ=["match",["get","isNonHighlightedOverview"],"1","#A7A6BA","0",["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"],["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"]],RZ=[{id:"route-line-outline-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],style:{lineCap:"round",lineJoin:"round",lineColor:BZ,lineWidth:5},paint:{"line-color":BZ,"line-width":5},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:BZ,lineWidth:6},paint:{"line-color":BZ,"line-width":6},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-outline-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineGapWidth:6},paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-endpoint-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleOpacity:0,circleStrokeWidth:2,circleStrokeColor:"#FFFFFF",circleStrokeOpacity:.7},paint:{"circle-radius":2,"circle-opacity":0,"circle-stroke-width":2,"circle-stroke-color":"#FFFFFF","circle-stroke-opacity":.7}},{id:"route-line-endpoint-fill-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleColor:"#FFFFFF",circleOpacity:.7},paint:{"circle-color":"#FFFFFF","circle-radius":2,"circle-opacity":.7}}],LZ=[{id:"route-line-animate",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineOpacity:.7,lineWidth:4},paint:{"line-color":"#FFFFFF","line-width":4,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"},isAnimationLayer:!0}];class OZ{constructor(e){this.routeSourceName="routeGeojson",this.patchFeatureCollection={type:"FeatureCollection",features:[]},this.highlightedSegmentNumber=-1,this.currentPatchNumber=-1,this.animateRouteSourceName="routeAnimateGeojson",this.animationFrameID=-1,this.animateRouteSegmentFeatureCollection={type:"FeatureCollection",features:[]},this.animationStartTime=0,this.end={from:0,to:0},this.animateHighlightedRouteSegment=()=>{const e=bJ.cloneDeep(this.animateRouteSegmentFeatureCollection.features[0]);if(e){const t=Date.now()-this.animationStartTime,n=(e,t)=>{e.geometry.coordinates=t;const n=this.map.getSource(this.animateRouteSourceName);n&&n.setData({type:"FeatureCollection",features:[e]})},r=2e3;if(t<r){const i=1-t/r,o=e.geometry.coordinates,{end:s}=this;let a;if(i>.5){const e=2*(i-.5);a=s.from*(1-e)+e*s.to}else{const e=2*i;a=s.from*(1-e)+e*s.to}let l=0,f=0,c=o.length-1;for(;f<a&&c>0;)l=f,f+=E(p(o[c]),p(o[c-1])),c-=1;if(i>.5){const t=(a-l)/(f-l),r=1-t;n(e,[...o.slice(0,c+1),[o[c][0]*t+o[c+1][0]*r,o[c][1]*t+o[c+1][1]*r]])}else{f<=a&&n(e,[...o.slice(o.length-2,o.length)]);const t=(a-l)/(f-l),r=1-t;n(e,[[o[c][0]*t+o[c+1][0]*r,o[c][1]*t+o[c+1][1]*r],...o.slice(c+1,o.length)])}this.animationFrameID=requestAnimationFrame(this.animateHighlightedRouteSegment)}else this.resetRouteSegmentAnimation()}},this.main=e}getCurrentFocus(){return this.main.getCurrentFocus()}filterWhereDimension(e){this.main.focusTo(e,!1)}setupRouting(e){this.map=e,this.map.addSource(this.routeSourceName,{type:"geojson",data:this.patchFeatureCollection});for(const e of RZ)e.source=this.routeSourceName,this.map.addLayer(e);this.map.addSource(this.animateRouteSourceName,{type:"geojson",data:this.animateRouteSegmentFeatureCollection});for(const e of LZ)e.source=this.animateRouteSourceName,this.map.addLayer(e)}computeRoute(e,t){return r(this,arguments,void 0,function*(e,t,n=!1,i=!0,o=0){this.currentPatchNumber=-1;const s=yield function(e,t,n){return r(this,arguments,void 0,function*(e,t,n,r=!0,i=0){const o=bZ.getRoute(e,t,n).routes,s=[];let a;for(let e=0;o&&e<o.length;e+=1){const t=o[e],n=t.geojson.properties.zone;if(t.isPortal){a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[t.geojson.geometry.coordinates[1]],zone:n,isPortal:!1});const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.EnterPortal,coordinates:[t.geojson.geometry.coordinates[0]]});s.push(e);const r=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ExitPortal,coordinates:[t.geojson.geometry.coordinates[1]]});s.push(r);const i=s.length>0?s[s.length-1]:void 0;if(i&&i.maneuverType===wZ.ExitPortal){if(s.pop(),t.portalPath){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.TravelPortal,coordinates:t.portalPath.geometry.coordinates,zone:n});s.push(e)}s.push(r)}}else{const r=t.geojson.geometry.coordinates;let i=wZ.Static;if(0===s.length){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[r[0]]});s.push(e)}if(e>0&&s.length>0){const t=o[e-1];if(n!==t.geojson.properties.zone){const e=t.geojson.geometry.coordinates,r=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ChangeZone,zone:n,coordinates:[e[e.length-1]]});s.push(r),i=wZ.ChangeZone}}if(r.length>2)for(let e=0;e<r.length-2;e+=1){const o=r[e],l=r[e+1],f=r[e+2];let c;a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[f],zone:n}),c=wZ.ContinueStraight;const u=Object.assign(Object.assign({},_Z(t)),{maneuverType:c,zone:n});i===wZ.ContinueStraight?(e+3===r.length?s[s.length-1].coordinates.push(l,f):s[s.length-1].coordinates.push(l),s[s.length-1].maneuverType=c):(u.coordinates.push(o,l),s.push(u),e+3===r.length&&(c===wZ.ContinueStraight?s[s.length-1].coordinates.push(f):s.push(Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,coordinates:[l,f],zone:n})))),i=c}else{const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,coordinates:r,zone:n});s.push(e)}const l=()=>{if(s.length>0){const e=s[s.length-1];e.maneuverType===wZ.ChangeZone&&e.zone===o$.Transit&&s.pop()}};let f=s.length>0?s[s.length-1]:void 0;if(f&&f.maneuverType===wZ.ContinueStraight){const e=uZ(f.startEdge.whereDimension),r=A(f.coordinates);for(let i=0;i<e.length;i+=1){const o=e[i];if(!O$(r,o)){const e=q$(r,o);if(e.features.length>1){s.pop();const i=H$(_(r)[0],y(e.features[0]),r);if(I(i,{units:"meters"})>=10){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(i)});s.push(e)}else if(s.length>0)if(f=s[s.length-1],f.maneuverType===wZ.ChangeZone){const e=_(i);if(f.coordinates=[e[e.length-1]],s.length>1){const e=s[s.length-2];e.coordinates=e.coordinates.concat(_(i))}}else f.coordinates.concat(_(i));const o=H$(y(e.features[0]),y(e.features[1]),r),a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(o)});0===s.length&&(a.coordinates=i.geometry.coordinates.concat(a.coordinates)),l(),s.push(a);const c=_(r),u=H$(y(e.features[1]),c[c.length-1],r),h=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(u)});s.push(h)}else if(e.features.length>0)if(io(_(r)[0],o)){s.pop();const i=H$(_(r)[0],y(e.features[0]),r),o=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(i)});if(f=s.length>0?s[s.length-1]:void 0,f&&f.maneuverType===wZ.ChangeZone){const e=s.pop();if(s.length>1){const t=s[s.length-1];t.maneuverType===wZ.PassThroughImmigration&&(s.pop(),e.coordinates=[t.coordinates[0]],s.push(e),o.coordinates=t.coordinates.concat(o.coordinates))}}l(),s.push(o);const a=_(r),c=H$(y(e.features[0]),a[a.length-1],r),u=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(c)});s.push(u)}else{const i=H$(_(r)[0],y(e.features[0]),r);f.coordinates=_(i);const o=_(r),a=H$(y(e.features[0]),o[o.length-1],r),l=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(a)});s.push(l)}}}}}}a&&s.push(a);const l={segments:s,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:n$,speed:r$};if(l.segments.length>0){const e=r;let t=0;if(e){const e=bJ.cloneDeep(l.segments[0]);e.maneuverType=wZ.RouteOverview,l.segments.unshift(e),t=1}let n=i+t,o=l.segments.length>t?l.segments[t].startEdge.whereDimension:"";for(let e=t;e<l.segments.length;e+=1){const t=!1,r=l.segments[e],s=i+e;if(r.isPortal){if(r.maneuverType===wZ.EnterPortal){const i=EZ(r.coordinates[0],s,t,n,r.startEdge.whereDimension),a=[];for(const e of i)a.push(e);r.features=a,r.patchNumber=n,r.whereDimension=o;const f=l.segments.length>=e+2?l.segments[e+1]:void 0;if(f&&f.maneuverType!==wZ.TravelPortal){const e=r.cost;r.time=e||0}else r.time=0;r.distance=0}if(r.maneuverType===wZ.TravelPortal){r.features=TZ(r.coordinates,s,t,n,r.zone,r.startEdge.whereDimension),r.patchNumber=n,r.whereDimension=o;const i=r.cost;let a;r.time=i||0,a=r.coordinates.length>1?I(A(r.coordinates),{units:l.distanceUnit}):0,r.distance=a,e>0&&(l.segments[e-1].time=0)}r.maneuverType===wZ.ExitPortal&&(n+=1,o=r.endEdge.whereDimension,l.segments.splice(e,1),e-=1);const i=l.segments.length>=e+2?l.segments[e+1]:void 0;i&&i.maneuverType===wZ.TravelPortal&&(n+=1)}else{r.maneuverType===wZ.Static||r.maneuverType===wZ.ChangeZone?(r.features=EZ(r.coordinates[0],s,t,n,r.endEdge.whereDimension),r.patchNumber=n,r.whereDimension=o):(r.features=TZ(r.coordinates,s,t,n,r.zone,r.startEdge.whereDimension),r.patchNumber=n,r.whereDimension=o);const e=r.coordinates;let i;i=e.length>1?I(A(e),{units:l.distanceUnit}):0,r.distance=i,r.maneuverType!==wZ.PassThroughImmigration?r.time=r.distance/l.speed:r.time=0}r.maneuverType===wZ.TravelPortal?(l.transportDistance+=r.distance,l.transportTime+=r.time):(l.walkingDistance+=r.distance,l.walkingTime+=r.time)}if(e){const e=CZ(l,i);l.segments[0]=e}}return l})}(e,t,n,i,o);return function(e){const t=t=>0===t||1===t&&e.segments[t-1].maneuverType===wZ.RouteOverview,n=e=>e.startEdge.whereDimension.toLowerCase().includes("l1")?"Clear Arrival Immigration":"Clear Departure Immigration";for(let r=0;r<e.segments.length;r+=1){const i=e.segments[r];if(i.instructions=[],i.maneuverType===wZ.RouteOverview){const e="Overview";i.instructions.push(e)}if(r>0&&i.maneuverType===wZ.ChangeZone){let t="";e.segments[r-1].zone===o$.Public&&i.zone===o$.Transit?t=n(i):e.segments[r-1].zone===o$.Transit&&i.zone===o$.Public&&(t="Exit Baggage Claim Hall"),i.instructions.push(t)}else if(i.maneuverType===wZ.ContinueStraight||i.maneuverType===wZ.PassThroughImmigration){const t=i.maneuverType===wZ.ContinueStraight?`Walk for ${Math.ceil(i.distance)} ${e.distanceUnit}`:n(i);let o;e.segments[r-1].maneuverType===wZ.ChangeZone||(e.segments[r-1].maneuverType,wZ.PassThroughImmigration),o=t,i.instructions.push(o)}else if(i.maneuverType===wZ.Static)t(r)&&i.instructions.push(`Start at ${i.startEdge.name}`),r===e.segments.length-1&&i.instructions.push(`Arrive at ${i.endEdge.name}`);else if(i.maneuverType===wZ.EnterPortal){let t=`Enter ${i.startEdge.name} at ${i.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()}`;if(IZ(i.startEdge.whatDimension))t=`Continue to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,i.instructions.push(t);else if(SZ(i.startEdge.whatDimension)){const n=r+1<=e.segments.length-1?e.segments[r+1]:void 0;n&&n.maneuverType===wZ.TravelPortal?(i.instructions.push(t),r+=1,t=`Take ${MZ(n.startEdge.whatDimension)} to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,n.instructions.push(t),i.description&&n.instructions.push(i.description)):(t=`Take ${MZ(i.startEdge.whatDimension)} to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,i.instructions.push(t))}}}}(s),s})}handleAllRouteUpdate(e,t,n){const r=e[n].features.filter(e=>"LineString"===e.geometry.type)[0],i=A(r.geometry.coordinates.slice(1)),o=A([r.geometry.coordinates[0],r.geometry.coordinates[1]]),s=GJ(o,t.sourceCoords);i.geometry.coordinates.unshift(t.sourceCoords,s.geometry.coordinates);const a=i.geometry.coordinates,l=s.properties.index,f=a.slice(l);i.geometry.coordinates=f,i.geometry.coordinates.unshift(t.sourceCoords),i.properties=r.properties;let c=-1;e[n].features.map((e,t)=>{"LineString"===e.geometry.type&&(c=t)}),e[n].features[c]=i,e[n].coordinates=i.geometry.coordinates}computeRoutes(e){return r(this,arguments,void 0,function*(e,t=!1){if(e.length<2)return;const n={segments:[],walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:n$,speed:r$};n.segments.push({});let r=1;for(let i=0;i<e.length-1;i+=1){let o=e[i];const s=e[i+1],a=!0,l=e[0];if("string"!=typeof e[0]){const e=Aa.getState().data,t=this.map.project([l.sourceCoords[0],l.sourceCoords[1]]);this.map.queryRenderedFeatures(t).map(t=>{e[s$.Edge].hasOwnProperty(t.properties.mapObjectId)&&e[s$.Edge][t.properties.mapObjectId].lines.length>0&&(o=t.properties.mapObjectId)})}const f=yield this.computeRoute(o,s,t,a,r);if(f.segments,f.segments.length>0){const e=f.segments[0];e.maneuverType=wZ.SectionOverview,e.instructions=[`${e.startEdge.name} to ${e.endEdge.name}`]}for(let e=0;e<f.segments.length;e+=1){const t=f.segments[e];n.segments.push(t)}n.walkingDistance+=f.walkingDistance,n.transportDistance+=f.transportDistance,n.walkingTime+=f.walkingTime,n.transportTime+=f.transportTime,r+=f.segments.length}if(n.segments.length>1){const e=CZ(n);n.segments[0]=e}else n.segments.length=0;return n})}updateRouteSource(e){if(!this.map)return!1;this.patchFeatureCollection=e;const t=this.map.getSource(this.routeSourceName);return t&&t.setData(e),!0}updateAnimateRouteSource(e){if(!this.map)return!1;this.animateRouteSegmentFeatureCollection=e;const t=this.map.getSource(this.animateRouteSourceName);return t&&t.setData(e),!0}setActiveRoute(e){this.route=e}getActiveRoute(){return this.route}resetRouteSegmentAnimation(){this.animationStartTime=Date.now(),cancelAnimationFrame(this.animationFrameID),this.animateRouteSegmentFeatureCollection.features.length>0&&"LineString"===this.animateRouteSegmentFeatureCollection.features[0].geometry.type&&this.animateHighlightedRouteSegment()}updateFeaturesToAnimate(e,t){if(this.route&&this.route.segments.length>e){const n=this.route.segments[e];if(n.features.length>0){const e=function(e,t=""){const n=[];for(let r=0;r<e.features.length;r+=1){const i=e.features[r];i.properties.featureBelongsToLineString&&(""!==t?i.properties.dimension_where&&i.properties.dimension_where===t&&n.push(i):n.push(i))}return n}(n,t);if(e.length>0){this.updateAnimateRouteSource({type:"FeatureCollection",features:e});const t=e[0],n=GJ(t,p(e[0].geometry.coordinates[0])),r=I(t)-n.properties.location;this.end={from:0,to:r}}else this.updateAnimateRouteSource({type:"FeatureCollection",features:[]});this.resetRouteSegmentAnimation()}}}highlightRouteSegment(e,n=!0){const{route:r}=this;if(r&&r.segments.length>e&&r.segments[e].coordinates.length>0){this.highlightedSegmentNumber=e;const i=r.segments[e],o=i.maneuverType===wZ.ExitPortal||i.maneuverType===wZ.Static?i.endEdge.whereDimension:i.startEdge.whereDimension;let s=this.patchFeatureCollection.features;const a=i.features[0].properties.patchNumber;this.currentPatchNumber!==a&&(this.currentPatchNumber=a,s=kZ(r,a,{includeOverviewFeatures:xZ(i),patchNumberForOverviewFeatures:a})),o&&o!==this.getCurrentFocus()&&n&&this.filterWhereDimension(o);const l=function(e,t,n=!1){for(let r=0;r<e.length;r+=1){const i=e[r];i.properties.segmentNumber===t?n?!0===i.properties.startPoint&&jZ([i],!0):jZ([i],!0):jZ([i],!1)}return e}(s,e);if(this.updateRouteSource({type:"FeatureCollection",features:l}),xZ(i)?this.updateAnimateRouteSource({type:"FeatureCollection",features:[]}):this.updateFeaturesToAnimate(e,o),i){const e=e=>"Point"===e.geometry.type?e.geometry.coordinates:e.geometry.coordinates[0],n=this.map.getCanvas(),o=n.clientWidth,s=n.clientHeight,a={padding:{top:.2*s,bottom:.2*s,left:.2*o,right:.2*o},duration:1e3,bearing:this.map.getBearing(),pitch:this.map.getPitch()};if(i.coordinates.length>1){const n=function(e,t=0){let n=[];for(let r=0;r<e.segments.length;r+=1){const i=e.segments[r];i.patchNumber===t&&(n=n.concat(i.features))}return n}(r,i.patchNumber),o=e(n[0]),s=new t.LngLat(o[0],o[1]),l=new t.LngLat(o[0],o[1]),f=new t.LngLatBounds(s,l);for(let e=0;e<n.length;e++){const t=n[e];if("Point"===t.geometry.type)f.extend(t.geometry.coordinates);else for(const e of t.geometry.coordinates)f.extend(e)}this.map.fitBounds(f,a)}else{const e={type:"FeatureCollection",features:[p(i.coordinates[0])]},t=t$(e,.025,3).features[0].geometry.coordinates,n=[t$(e,-.025,-3).features[0].geometry.coordinates,t];this.map.fitBounds(n,a)}}}}clearRoute(){const e={type:"FeatureCollection",features:[]};this.updateRouteSource(e),this.updateAnimateRouteSource(e),this.route=null,cancelAnimationFrame(this.animationFrameID)}}var FZ,DZ;!function(e){e.Name="title",e.LocalRef="localRef",e.WhatTaxonomy="dimension_what"}(FZ||(FZ={})),function(e){e.UrlLoad="url_load",e.MapClick="map_click",e.BannerClick="banner_click",e.SearchInput="search_input",e.ListClick="list_click",e.InfoPopupClick="info_popup_click",e.Chatbot="chatbot",e.RoutingUI="routing_ui",e.StampRallyClick="stamp_rally_click"}(DZ||(DZ={}));const NZ="https://api.maptiler.com/maps/01985ac8-56d2-707b-afa8-68abfe8f18be/style.json?key=12H5hrITUbJ1sDrVPqkq";class zZ{setupFirebase(){this.firebaseApp=nY({apiKey:"AIzaSyBDWO2wNkotbgjbkyqVrC_OEAJ3mbvlheI",authDomain:"tmt-lenovo-tech-day-26-id.firebaseapp.com",projectId:"tmt-lenovo-tech-day-26-id",storageBucket:"tmt-lenovo-tech-day-26-id.firebasestorage.app",messagingSenderId:"618619544262",appId:"1:618619544262:web:cb7a7953a908aeed212dc7",measurementId:"G-HN2FS1L0P4"}),this.analytics=function(e=function(e=WX){const t=KX.get(e);if(!t&&e===WX&&MK())return nY();if(!t)throw eY.create("no-app",{appName:e});return t}()){const t=ZX(e=HK(e),KY);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=ZX(e,KY);if(n.isInitialized()){const e=n.getImmediate();if(DK(t,n.getOptions()))return e;throw JY.create("already-initialized")}return n.initialize({options:t})}(e)}(this.firebaseApp)}logAnalyticsEvent(e,t){this.analytics&&(t?AJ(this.analytics,e,t):AJ(this.analytics,e))}onLoad(){!0===this.mapLoaded&&!0===this.apiAuthenticationCallbackReceived&&(this.routingVisualizer.setupRouting(this.map),this.onLoadCallback&&this.onLoadCallback())}addImage(e,t,n){if(!this.map)throw new Error("Map must be initialized before adding images");this.map.addImage(e,t,n)}loadImage(e){return this.map?new Promise((t,n)=>{this.map.loadImage(e,(e,r)=>{!e&&r?t(r):n(e||new Error("Failed to load image"))})}):Promise.reject(new Error("Map must be initialized before loading images"))}onLoadFail(e){!1===this.onFailCallbackSent&&(this.onFailCallbackSent=!0,this.onLoadFailCallback&&this.onLoadFailCallback(e))}initMetaAtlasCore(e,t){this.metaAtlasCore.init(this.empApiURL,this.accessToken,this.secretKey,n=>r(this,void 0,void 0,function*(){this.apiAuthenticationCallbackReceived=!0,n.authenticated?(yield this.metaAtlasCore.setupFocusTree(),this.metaAtlasCore.setupRouting(e),this.metaAtlasCore.setupMapObjectSearch(t),this.onCoreLoadCallback&&this.onCoreLoadCallback(),this.onLoad()):this.onLoadFail("Failed to authenticate token")}))}constructor(t,n,r=()=>{},i=e=>{},o=()=>{},s=()=>{},a=()=>{},l=()=>{}){this.onLoadCallback=void 0,this.onLoadFailCallback=void 0,this.onCoreLoadCallback=void 0,this.onRenderReadyCallback=void 0,this.mapLoaded=!1,this.onFailCallbackSent=!1,this.UserLayers=[],this.defaultFocusedTaxonomy="where.gbtb",this.currentFocus=this.defaultFocusedTaxonomy,this.map3D=null,this.apiAuthenticationCallbackReceived=!1,this.routingVisualizer=new OZ(this),this.clickSubscribers=new Set,this.loadSubscribers=new Set,this.moveEndSubscribers=new Set,this.clickOnceSubscribers=new Set,this.tileServer="https://atoms-map-tiles-middleware.sandbox.spatialverse.online",this.HOST="https://atoms-sdk.sandbox.spatialverse.online/",this.empApiURL="https://atoms-api.sandbox.spatialverse.online",this.mapBoxDrawSourceID="drawnDataSource",this.drawGeojsonData={type:"FeatureCollection",features:[]},this.popups=[],this.markers=[],this.accessToken=t,this.secretKey=n,this.onLoadCallback=r,this.onLoadFailCallback=i,this.onCoreLoadCallback=a,this.onRenderReadyCallback=l,this.map=null,this.mapBoxDraw=null,this.maplibregl=e,this.CustomerLayers=TK,this.roleName="changipublic",this.verNum="1",this.metaAtlasCore=new ka,this.customMapObjectsManager=new Sa(this.metaAtlasCore,this),this.initMetaAtlasCore(o,s),this.setupFirebase()}setupMap(t,n,r){var i,o,s;if(this.roleName=t,"string"==typeof n){const t=(null==r?void 0:r.longitude)&&(null==r?void 0:r.latitude)?[r.longitude,r.latitude]:[110.40560122701005,1.5626614114987702],a=null!==(i=null==r?void 0:r.zoom)&&void 0!==i?i:18,l=null!==(o=null==r?void 0:r.pitch)&&void 0!==o?o:42,f=null!==(s=null==r?void 0:r.bearing)&&void 0!==s?s:23.4;this.map=new e.Map({container:n,style:NZ,center:t,zoom:a,pitch:l,bearing:f,antialias:!0,attributionControl:!1})}else this.map=n;const a=()=>{this.map.addSource("custom",{type:"vector",url:this.tileServer+"/"+this.roleName+"/"+this.verNum+"/geojson?accessToken="+this.accessToken}),this.map.addSource("customMapObjects",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.logAnalyticsEvent("open_app",{type:"web",token:this.accessToken}),this.map.on("click",e=>{this.map3D&&this.map3D.getViewMode()!==Ca.MODE_2D?setTimeout(()=>{this.process2DClick(e)},0):this.process2DClick(e)});const e=this.CustomerLayers;for(const t of e)t["source-layer"]="geojson",this.map.addLayer(t);this.mapLoaded=!0,this.setupMapBoxDraw(),this.onRenderReadyCallback&&this.onRenderReadyCallback(),this.notifyLoadSubscribers()};this.map.loaded()?a():this.map.on("load",a),this.map.on("moveend",()=>{this.notifyMoveEndSubscribers()}),this.map.on("error",e=>{const t=e.message||"";t.includes("layer")||t.includes("filter")||t.includes("source")||t.includes("paint")||t.includes("layout")||this.onLoadFail(e.message)})}setupMapBoxDraw(){this.mapBoxDraw=new mi({displayControlsDefault:!1,userProperties:!0,modes:Object.assign(Object.assign({},mi.modes),{draw_marker:Oi,marker_select:Ki}),styles:bi}),this.map.addControl(this.mapBoxDraw),this.map.addSource(this.mapBoxDrawSourceID,{type:"geojson",data:this.drawGeojsonData});for(let e=0;e<gi.length;e++){const t=gi[e];t.source=this.mapBoxDrawSourceID,this.map.addLayer(t)}this.mapLoaded=!0,this.onLoad()}overRideSelectionOfDrawnPointGeometry(e){if(this.mapBoxDraw&&"simple_select"===this.mapBoxDraw.getMode()&&1===this.mapBoxDraw.getAll().features.length){const t=this.mapBoxDraw.getAll().features;void 0===e.properties.id?this.mapBoxDraw.deleteAll():void 0!==e.properties.id&&t[0].id!==e.properties.id&&(this.mapBoxDraw.deleteAll(),e.properties.id)}}process2DClick(e){var t,n,r;const i=this.map.queryRenderedFeatures(e.point)||[];let o=null,s=null;const a=this.CustomerLayers.map(e=>e.id),l=this.UserLayers.map(e=>e.id);for(const e of i){const r=null===(t=e.layer)||void 0===t?void 0:t.id;if(!r)continue;const i=this.map.getLayer(r);if(!i)continue;const f=i.source,c=f===this.mapBoxDrawSourceID,u=a.includes(r)||"custom"===f,h=l.includes(r)||"customMapObjects"===f;if(c&&!o&&(o=e),!s&&(u||h)){const t=e.properties||{},r=!!t._isCustom,i=(null===(n=t.dimension_what)||void 0===n?void 0:n.includes("what.infra.garden"))||t.isSearchable&&"Transit"!==t.title&&"Public"!==t.title;(r||i)&&(s=e)}}if(o?(this.overRideSelectionOfDrawnPointGeometry(o),(null===(r=o.properties)||void 0===r?void 0:r.id)?this.lastClickedDrawing=this.getDrawingById(o.properties.id):this.lastClickedDrawing=this.setDrawing()):this.lastClickedDrawing=this.setDrawing(),s){const t=s,n=t.properties||{};n.title&&this.logAnalyticsEvent("feature_clicked",{feature_clicked:n.title}),this.overRideSelectionOfDrawnPointGeometry(t);let r=null;if("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type)if(n.center)try{r=JSON.parse(n.center)}catch(e){r=O(t).geometry.coordinates}else r=O(t).geometry.coordinates;else if("Point"===t.geometry.type)r=t.geometry.coordinates;else if("LineString"===t.geometry.type||"MultiLineString"===t.geometry.type){const e=this.metaAtlasCore.getMidPointOfFeature(t);if(e&&Array.isArray(e)&&e.length>=2)r=[e[0],e[1]];else{const e=t.geometry.coordinates;Array.isArray(e)&&e.length>0&&Array.isArray(e[0])&&(r=e[0])}}else{const e=t.geometry.coordinates;r=Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]?e:O(t).geometry.coordinates}this.metaAtlasCore.setLastClickedFeature({mapObjectId:n.myMapObjectId||n.id||null,coordinates:r,name:n.title||n.name||null,whatDimension:n.dimension_what||null,whereDimension:n.dimension_where||null,geometry:t.geometry,properties:n,clickEvent:e})}else this.map3D&&this.map3D.getViewMode()!==Ca.MODE_2D||this.metaAtlasCore.setLastClickedFeature({mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null,clickEvent:e});this.notifyClickSubscribers(this.getLastClickedFeature())}getFocusTree(){return this.metaAtlasCore.getFocusTree()}setDrawing(e=null,t=null,n=null,r=null){return{id:e,where:t,geometry:n,properties:r}}getLastClickedFeature(){return this.metaAtlasCore.getLastClickedFeature()}getLastClickedDrawing(){let e=this.lastClickedDrawing;return this.lastClickedDrawing&&(!this.lastClickedDrawing||null!==this.lastClickedDrawing.id&&null!==this.lastClickedDrawing.where)||(e=this.setDrawing()),e}getMidPointOfFeature(e){return this.metaAtlasCore.getMidPointOfFeature(e)}dropPin(t,n,r=!0){const i={feature:t,popupStyle:n},o=document.createElement("div");o.innerHTML=i.popupStyle;const s=new e.Marker({element:o}).setLngLat(this.getMidPointOfFeature(i.feature)).addTo(this.map);return r?this.popups.length>1?(this.popups[this.popups.length-1].popup.remove(),this.popups[this.popups.length-1].popup=s,this.popups[this.popups.length-1].id=i.feature.mapObjectId):(this.popups.length>0&&this.popups[this.popups.length-1].popup.remove(),this.popups=[{popup:s,id:i.feature.mapObjectId}]):this.popups.push({popup:s,id:i.feature.mapObjectId}),this.popups[this.popups.length-1].id}dropMarkerForRouting(e){e.forEach(e=>{var t,n,r;const i=(null===(t=e.selectedLocation)||void 0===t?void 0:t.coordinates)?e.selectedLocation.coordinates:null===(r=null===(n=e.selectedLocation)||void 0===n?void 0:n.geometry)||void 0===r?void 0:r.coordinates;if(i&&2===i.length){const e=new this.maplibregl.Marker({color:"#188689"}).setLngLat([i[0],i[1]]).addTo(this.map);this.markers.push(e)}})}clearMarker(){this.markers&&this.markers.length>0&&this.markers.forEach(e=>{e.remove()}),this.markers=[]}extractLocation(e){const t=e.match(/^(?:[^_]*_){3}([^_]*)/);return t?t[1]:null}hidePin(e="-1"){let t;if("-1"===e){const e=this.popups[this.popups.length-1];if(!e)return;t=e.id}else t=e;const n=this.popups.find(e=>e.id===t);if(n){let e=n.popup.getElement();e&&(e.style.display="none")}}hidePins(){this.popups.length>0&&this.popups.forEach(e=>{let t=e.popup.getElement();t&&(t.style.display="none")})}showPin(e="-1"){let t;if("-1"===e){const e=this.popups[this.popups.length-1];if(!e)return;t=e.id}else t=e;const n=this.popups.find(e=>e.id===t);if(n){let e=n.popup.getElement();e&&(e.style.display="flex")}}showPins(){this.popups.length>0&&this.popups.forEach(e=>{let t=e.popup.getElement();t&&(t.style.display="flex")})}clearPin(e="-1"){let t;if("-1"===e){if(t=this.popups.length-1,t<0)return}else if(t=this.popups.findIndex(t=>t.id===e),-1===t)return;this.popups[t]&&(this.popups[t].popup.remove(),this.popups.splice(t,1))}clearPins(){this.popups.length>0&&(this.popups.forEach(e=>{e.popup.remove()}),this.popups.length=0)}removePin(){f(".mapboxgl-popup").remove()}getCurrentFocus(){return this.metaAtlasCore.getCurrentFocus()}getCurrentFocusBuilding(){return this.metaAtlasCore.getCurrentFocusBuilding()}getCurrentFocusFloor(){return this.metaAtlasCore.getCurrentFocusFloor()}addUserLayer(e){this.UserLayers.push(e),this.map.addLayer(e)}filterWhereDimension(e){if(!e)return;let t=pi(this.UserLayers);if(t.length>0)try{let n=this.metaAtlasCore.filterBaseMapWhereDimension(t,e);for(let e=0;e<n.length;e++){const r=n[e].id,i=n[e].filter;if(this.map.getLayer(r))try{t[e].filter=i,this.map.setFilter(r,i)}catch(e){continue}}}catch(e){}let n=pi(this.CustomerLayers);for(let e=0;e<n.length;e+=1){const t=n[e].id,r=this.map.getFilter(t);n[e].filter=r}let r=this.metaAtlasCore.filterBaseMapWhereDimension(n,e);for(let e=0;e<r.length;e+=1){const t=r[e].id,n=r[e].filter;this.map.setFilter(t,n)}}filterWhatTaxonomy(e){if(!this.map)return;this.metaAtlasCore.setCurrentWhatFilters(e||[]);let t=pi(this.CustomerLayers);for(let e=0;e<t.length;e+=1){const n=t[e].id,r=this.map.getFilter(n);t[e].filter=r}let n=this.metaAtlasCore.filterLayersWhatDimension(t,e);for(let e=0;e<n.length;e+=1){const t=n[e].id,r=n[e].filter;this.map.setFilter(t,r)}let r=pi(this.UserLayers);if(r.length>0){for(let e=0;e<r.length;e+=1){const t=r[e].id,n=this.map.getFilter(t);r[e].filter=n}let t=this.metaAtlasCore.filterLayersWhatDimension(r,e);for(let e=0;e<t.length;e+=1){const n=t[e].id,r=t[e].filter;this.map.setFilter(n,r)}}this.map3D&&this.map3D.filterWhatTaxonomy(e)}focusTo(e,t=!0){const n=this.map;let r=e;if(!r||!n)return;this.filterWhereDimension(r);const i=window.innerWidth<768;if(t){const e=this.metaAtlasCore.getFlyToLocation(r,i);this.map.flyTo({center:e.center?e.center:this.map.getCenter(),zoom:e.zoom?e.zoom:this.map.getZoom(),bearing:e.bearing?e.bearing:this.map.getBearing(),speed:.8})}if(this.map3D){const e=function(e){if(!e)return null;if($i(e))return"site";return function(e){if(!e)return null;const t=Ji();for(const n in t){const r=t[n];if(!r||!r.buildings)continue;const i=Array.isArray(r.buildings)?r.buildings:Object.values(r.buildings);for(const t of i)if(t&&t.taxonomyPath===e)return{building:t,site:r}}return null}(e)?"building":Zi(e)?"floor":null}(r);"floor"===e?this.map3D.selectFloor(r):"building"===e&&"function"==typeof this.map3D.showFullBuildingModel&&this.map3D.showFullBuildingModel()}}filterLayersByCategories(e,t,n,r){const i=this.map;if(!t||!i)return;let o=pi(this.CustomerLayers);for(let e=0;e<o.length;e+=1){const t=o[e].id,n=this.map.getFilter(t);o[e].filter=n}let s=this.metaAtlasCore.filterLayersByCategories(o,e,t,n,r,this.map);for(let e=0;e<s.length;e+=1){const t=s[e].id,n=s[e].filter;this.map.setFilter(t,n)}}filterLayersByType(e,t,n=""){const r=this.map;if(!t||!r)return;let i=pi(this.UserLayers);if(i.length>0){let r=this.metaAtlasCore.filterLayersByType(i,e,t,n);for(let e=0;e<r.length;e++){const t=r[e].id,n=r[e].filter;i[e].filter=n,this.map.setFilter(t,n)}}}styleLayersByType(e,t,n,r){if(!t||!this.map)return;let i=this.map.getStyle().layers,o=this.metaAtlasCore.styleLayersByType(i,e,t,n,r);for(let e=0;e<o.length;e+=1){const t=o[e].id,r=o[e].paint,i=o[e].type;!i||"fill"!==i&&"line"!==i||r[n]&&this.map.setPaintProperty(t,n,r[n])}}clearStyleLayersByType(e,t,n){if(!this.map)return;let r=this.map.getStyle().layers,i=this.metaAtlasCore.clearStyleLayersByType(r,e,t,n);for(let e=0;e<i.length;e+=1){const t=i[e].id,r=i[e].paint,o=i[e].type;!o||"fill"!==o&&"line"!==o||r[n]&&this.map.setPaintProperty(t,n,r[n])}}changeTerminalInFocusToUserViewpoint(e={}){let t=this.map.getCenter().wrap();const n=[t.lng,t.lat];if(this.metaAtlasCore.checkUserViewport(n,this.getCurrentFocusBuilding(),this.getCurrentFocusFloor()))return!0;let r=this.metaAtlasCore.getUserViewportBuilding(n);return!(!r||r.name in e&&(this.focusTo(e[r.name],!1),0))}isLocationWithinHongKong(e){const t=d([[[103.59716039266556,1.2570288388163817],[103.5792058079661,1.2001127572538621],[103.69481581677104,1.2005505778590049],[103.9124604166791,1.2408297702235416],[104.07843084598773,1.3003717948835174],[104.09332001378709,1.3428384139758691],[104.06568408463107,1.4395702492902842],[104.01405273250049,1.430831826129534],[103.94486100905976,1.4264524124152587],[103.88661860370877,1.4347670822090777],[103.84020398120549,1.470670314084117],[103.79466396668937,1.467591709607774],[103.75700361138325,1.4470255906078648],[103.72197278477057,1.4605952336399213],[103.68041038922672,1.4408697939934143],[103.64577440712543,1.379174061413977],[103.59716039266556,1.2570288388163817],[103.59716039266556,1.2570288388163817]]]);return io(p(e),t)}getMapObjectsByFilteredLocalRef(...e){return this.metaAtlasCore.getMapObjectsByFilteredLocalRef(...e)}getMapObjectsByName(...e){return this.metaAtlasCore.getMapObjectsByName(...e)}getMapObjectById(...e){return this.metaAtlasCore.getMapObjectById(...e)}getMapObjectByLocalRef(...e){return this.metaAtlasCore.getMapObjectByLocalRef(...e)}getMapObjectMatchingLocalRef(...e){return this.metaAtlasCore.getMapObjectMatchingLocalRef(...e)}getMapObjectsMatchingLocalRefs(...e){return this.metaAtlasCore.getMapObjectsMatchingLocalRefs(...e)}getMapObjectsByWhatTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhatTaxonomy(...e)}getMapObjectsByWhatTaxonomyAPI(...e){return this.metaAtlasCore.getMapObjectsByWhatTaxonomyAPI(...e)}getMapObjectsByWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhereTaxonomy(...e)}getMapObjectsByWhatAndWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhatAndWhereTaxonomy(...e)}getMapObjectsInWhatTaxonomy(...e){return this.metaAtlasCore.getMapObjectsInWhatTaxonomy(...e)}getMapObjectsInWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsInWhereTaxonomy(...e)}computeRoute(...e){return this.routingVisualizer.computeRoute(...e)}computeRoutes(e,t=!1,n){const i=this;return(()=>{r(this,void 0,void 0,function*(){const t=yield(e=>r(this,void 0,void 0,function*(){const t=e.map(e=>(e=>new Promise(t=>{"string"!=typeof e&&t("User GPS Location"),i.getMapObjectById(e,e=>{var n;t(null===(n=e[0])||void 0===n?void 0:n.name)})}))(e));return yield Promise.all(t)}))(e);t.forEach(e=>{this.logAnalyticsEvent("route_per_object",{destination:e,route_per_object_event_source:n})}),this.logAnalyticsEvent("route",{destinations:t,route_event_source:n})})})(),this.routingVisualizer.computeRoutes(e,t)}setActiveRoute(...e){return this.routingVisualizer.setActiveRoute(...e)}getActiveRoute(...e){return this.routingVisualizer.getActiveRoute(...e)}highlightRouteSegment(...e){return this.routingVisualizer.highlightRouteSegment(...e)}clearRoute(...e){return this.routingVisualizer.clearRoute(...e)}drawGeometryOnMap(e,t,n=!1){if("simple_select"!==this.mapBoxDraw.getMode())return!1;let r=!1;return"draw_point"===e?(this.mapBoxDraw.changeMode("draw_point"),r=!0):"draw_line_string"===e?(this.mapBoxDraw.changeMode("draw_line_string"),r=!0):"draw_polygon"===e?(this.mapBoxDraw.changeMode("draw_polygon"),r=!0):"draw_marker"===e&&(this.mapBoxDraw.changeMode("draw_marker"),r=!0),r&&(this.map.once("draw.create",e=>{let r=e.features[0];r.properties.id=r.id,r.properties.dimension_where=n?this.getCurrentFocus():this.defaultFocusedTaxonomy,t(r)}),this.map.once("draw.modechange",()=>{this.mapBoxDraw.deleteAll()})),r}isInDrawMode(){return this.mapBoxDraw&&this.mapBoxDraw.getAll().features.length>0}addDrawingsToBaseMap(e){this.drawGeojsonData.features=this.drawGeojsonData.features.concat(e),this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData)}getDrawingById(e){for(let t=0;t<this.drawGeojsonData.features.length;t++){const n=this.drawGeojsonData.features[t];if(n.id===e)return n}}editDrawing(e){if(void 0===e)return!1;let t=this.getDrawingById(e);if(void 0===t)return!1;let n={type:"FeatureCollection",features:[t]};this.mapBoxDraw.set(n);const r=e=>{const t=this.mapBoxDraw.get(e);if(this.mapBoxDraw.deleteAll(),t){let e=!1;for(let n=0;n<this.drawGeojsonData.features.length;n++)this.drawGeojsonData.features[n].id===t.id&&(this.drawGeojsonData.features[n]=t,e=!0);e&&this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData)}};if("Point"!==t.geometry.type)void 0!==t.properties.marker?this.mapBoxDraw.changeMode("marker_select",{featureId:t.id}):this.mapBoxDraw.changeMode("direct_select",{featureId:t.id}),this.map.once("draw.modechange",()=>{"simple_select"===this.mapBoxDraw.getMode()&&r(t.id)});else{let e=!1;const n=i=>{i.features.length>0&&i.features[0].id===t.id?e||(e=!0):e&&(r(t.id),this.map.off("draw.selectionchange",n))};this.map.on("draw.selectionchange",n)}return!0}removeDrawing(e){for(let t=0;t<this.drawGeojsonData.features.length;t++)if(this.drawGeojsonData.features[t].id===e)return this.drawGeojsonData.features.splice(t,1),this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData),!0;return!1}createMarker(t){void 0===t&&(t={}),t.draggable=!0,t.color="#FFB52E";const n=new e.Marker(t).setLngLat(this.map.getCenter()).addTo(this.map);return this.map.once("click",()=>{n.setDraggable(!1);const e="#3FB1CE";n.getElement().querySelectorAll('svg g[fill="'+n._color+'"]')[0].setAttribute("fill",e),n._color=e}),n}getCoordinates(e){return _(e)}getLength(e,t={units:"kilometers"}){if(e.geometry&&e.geometry.type){const n=e.geometry.type;if("LineString"===n||"MultiLineString"===n)return I(e,t)}}getArea(e){return M(e)}getMap3D(){return this.map3D}notifyClickSubscribers(e){this.clickSubscribers.forEach(t=>t(e)),this.clickOnceSubscribers.size>0&&(this.clickOnceSubscribers.forEach(t=>t(e)),this.clickOnceSubscribers.clear())}notifyLoadSubscribers(){this.loadSubscribers.forEach(e=>e())}notifyMoveEndSubscribers(){this.moveEndSubscribers.forEach(e=>e())}subscribeToClick(e){return this.clickSubscribers.add(e),()=>{this.clickSubscribers.delete(e)}}subscribeToLoad(e){return this.loadSubscribers.add(e),()=>{this.loadSubscribers.delete(e)}}subscribeToMoveEnd(e){return this.moveEndSubscribers.add(e),()=>{this.moveEndSubscribers.delete(e)}}subscribeToClickOnce(e){return this.clickOnceSubscribers.add(e),()=>{this.clickOnceSubscribers.delete(e)}}addMapObject(e){this.customMapObjectsManager.addMapObject(e)}removeMapObject(e){this.customMapObjectsManager.removeMapObject(e)}updateMapObject(e,t){this.customMapObjectsManager.updateMapObject(e,t)}getCustomMapObjects(){return this.customMapObjectsManager.getCustomMapObjects()}clearCustomMapObjects(){this.customMapObjectsManager.clearCustomMapObjects()}}export{NZ as DEFAULT_MAP_STYLE,DZ as EventSource,wZ as ManeuverType,zZ as MetaAtlasSdk};
|
|
668
|
+
!function(e,t){(function(){var n,r="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,l=128,f=1/0,c=9007199254740991,u=NaN,h=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],d="[object Arguments]",A="[object Array]",m="[object Boolean]",g="[object Date]",b="[object Error]",w="[object Function]",v="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",j="[object Promise]",E="[object RegExp]",T="[object Set]",C="[object String]",k="[object Symbol]",S="[object WeakMap]",I="[object ArrayBuffer]",P="[object DataView]",M="[object Float32Array]",q="[object Float64Array]",B="[object Int8Array]",R="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",F="[object Uint8ClampedArray]",D="[object Uint16Array]",N="[object Uint32Array]",z=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,W=RegExp(G.source),Q=RegExp(V.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),ne=/^\s+/,re=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,de=/^\[object .+?Constructor\]$/,Ae=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,we=/['\n\r\u2028\u2029\\]/g,ve="\\ud800-\\udfff",ye="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Te="\\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",Ce="["+ve+"]",ke="["+Te+"]",Se="["+ye+"]",Ie="\\d+",Pe="["+_e+"]",Me="["+xe+"]",qe="[^"+ve+Te+Ie+_e+xe+je+"]",Be="\\ud83c[\\udffb-\\udfff]",Re="[^"+ve+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+je+"]",De="\\u200d",Ne="(?:"+Me+"|"+qe+")",ze="(?:"+Fe+"|"+qe+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ue="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Se+"|"+Be+")?",Ve="["+Ee+"]?",We=Ve+Ge+"(?:"+De+"(?:"+[Re,Le,Oe].join("|")+")"+Ve+Ge+")*",Qe="(?:"+[Pe,Le,Oe].join("|")+")"+We,Ke="(?:"+[Re+Se+"?",Se,Le,Oe,Ce].join("|")+")",Xe=RegExp("['’]","g"),Ye=RegExp(Se,"g"),Je=RegExp(Be+"(?="+Be+")|"+Ke+We,"g"),$e=RegExp([Fe+"?"+Me+"+"+He+"(?="+[ke,Fe,"$"].join("|")+")",ze+"+"+Ue+"(?="+[ke,Fe+Ne,"$"].join("|")+")",Fe+"?"+Ne+"+"+He,Fe+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,Qe].join("|"),"g"),Ze=RegExp("["+De+ve+ye+Ee+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["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"],nt=-1,rt={};rt[M]=rt[q]=rt[B]=rt[R]=rt[L]=rt[O]=rt[F]=rt[D]=rt[N]=!0,rt[d]=rt[A]=rt[I]=rt[m]=rt[P]=rt[g]=rt[b]=rt[w]=rt[y]=rt[_]=rt[x]=rt[E]=rt[T]=rt[C]=rt[S]=!1;var it={};it[d]=it[A]=it[I]=it[P]=it[m]=it[g]=it[M]=it[q]=it[B]=it[R]=it[L]=it[y]=it[_]=it[x]=it[E]=it[T]=it[C]=it[k]=it[O]=it[F]=it[D]=it[N]=!0,it[b]=it[w]=it[S]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,at=parseInt,lt="object"==typeof i&&i&&i.Object===Object&&i,ft="object"==typeof self&&self&&self.Object===Object&&self,ct=lt||ft||Function("return this")(),ut=t&&!t.nodeType&&t,ht=ut&&e&&!e.nodeType&&e,pt=ht&&ht.exports===ut,dt=pt&<.process,At=function(){try{return ht&&ht.require&&ht.require("util").types||dt&&dt.binding&&dt.binding("util")}catch(e){}}(),mt=At&&At.isArrayBuffer,gt=At&&At.isDate,bt=At&&At.isMap,wt=At&&At.isRegExp,vt=At&&At.isSet,yt=At&&At.isTypedArray;function _t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function xt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Ct(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function kt(e,t){return!(null==e||!e.length)&&Ft(e,t,0)>-1}function St(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Mt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function qt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Bt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Rt=Ht("length");function Lt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Ot(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Ot(e,Nt,n)}function Dt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Nt(e){return e!=e}function zt(e,t){var n=null==e?0:e.length;return n?Vt(e,t)/n:u}function Ht(e){return function(t){return null==t?n:t[e]}}function Ut(e){return function(t){return null==e?n:e[t]}}function Gt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Vt(e,t){for(var r,i=-1,o=e.length;++i<o;){var s=t(e[i]);s!==n&&(r=r===n?s:r+s)}return r}function Wt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Qt(e){return e?e.slice(0,un(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return It(t,function(t){return e[t]})}function Yt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function $t(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var Zt=Ut({"À":"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"}),en=Ut({"&":"&","<":"<",">":">",'"':""","'":"'"});function tn(e){return"\\"+ot[e]}function nn(e){return Ze.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function ln(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function fn(e){return nn(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Rt(e)}function cn(e){return nn(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function un(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var hn=Ut({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function e(t){var i=(t=null==t?ct:pn.defaults(ct.Object(),t,pn.pick(ct,tt))).Array,re=t.Date,ve=t.Error,ye=t.Function,_e=t.Math,xe=t.Object,je=t.RegExp,Ee=t.String,Te=t.TypeError,Ce=i.prototype,ke=ye.prototype,Se=xe.prototype,Ie=t["__core-js_shared__"],Pe=ke.toString,Me=Se.hasOwnProperty,qe=0,Be=function(){var e=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Re=Se.toString,Le=Pe.call(xe),Oe=ct._,Fe=je("^"+Pe.call(Me).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),De=pt?t.Buffer:n,Ne=t.Symbol,ze=t.Uint8Array,He=De?De.allocUnsafe:n,Ue=on(xe.getPrototypeOf,xe),Ge=xe.create,Ve=Se.propertyIsEnumerable,We=Ce.splice,Qe=Ne?Ne.isConcatSpreadable:n,Ke=Ne?Ne.iterator:n,Je=Ne?Ne.toStringTag:n,Ze=function(){try{var e=ao(xe,"defineProperty");return e({},"",{}),e}catch(e){}}(),ot=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,lt=re&&re.now!==ct.Date.now&&re.now,ft=t.setTimeout!==ct.setTimeout&&t.setTimeout,ut=_e.ceil,ht=_e.floor,dt=xe.getOwnPropertySymbols,At=De?De.isBuffer:n,Rt=t.isFinite,Ut=Ce.join,dn=on(xe.keys,xe),An=_e.max,mn=_e.min,gn=re.now,bn=t.parseInt,wn=_e.random,vn=Ce.reverse,yn=ao(t,"DataView"),_n=ao(t,"Map"),xn=ao(t,"Promise"),jn=ao(t,"Set"),En=ao(t,"WeakMap"),Tn=ao(xe,"create"),Cn=En&&new En,kn={},Sn=Bo(yn),In=Bo(_n),Pn=Bo(xn),Mn=Bo(jn),qn=Bo(En),Bn=Ne?Ne.prototype:n,Rn=Bn?Bn.valueOf:n,Ln=Bn?Bn.toString:n;function On(e){if(Js(e)&&!Ns(e)&&!(e instanceof zn)){if(e instanceof Nn)return e;if(Me.call(e,"__wrapped__"))return Ro(e)}return new Nn(e)}var Fn=function(){function e(){}return function(t){if(!Ys(t))return{};if(Ge)return Ge(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Dn(){}function Nn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Gn;++t<n;)this.add(e[t])}function Wn(e){var t=this.__data__=new Un(e);this.size=t.size}function Qn(e,t){var n=Ns(e),r=!n&&Ds(e),i=!n&&!r&&Gs(e),o=!n&&!r&&!i&&oa(e),s=n||r||i||o,a=s?Wt(e.length,Ee):[],l=a.length;for(var f in e)!t&&!Me.call(e,f)||s&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||Ao(f,l))||a.push(f);return a}function Kn(e){var t=e.length;return t?e[Gr(0,t-1)]:n}function Xn(e,t){return Po(Ei(e),ir(t,0,e.length))}function Yn(e){return Po(Ei(e))}function Jn(e,t,r){(r!==n&&!Ls(e[t],r)||r===n&&!(t in e))&&nr(e,t,r)}function $n(e,t,r){var i=e[t];Me.call(e,t)&&Ls(i,r)&&(r!==n||t in e)||nr(e,t,r)}function Zn(e,t){for(var n=e.length;n--;)if(Ls(e[n][0],t))return n;return-1}function er(e,t,n,r){return fr(e,function(e,i,o){t(r,e,n(e),o)}),r}function tr(e,t){return e&&Ti(t,Ca(t),e)}function nr(e,t,n){"__proto__"==t&&Ze?Ze(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function rr(e,t){for(var r=-1,o=t.length,s=i(o),a=null==e;++r<o;)s[r]=a?n:_a(e,t[r]);return s}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function or(e,t,r,i,o,s){var a,l=1&t,f=2&t,c=4&t;if(r&&(a=o?r(e,i,o,s):r(e)),a!==n)return a;if(!Ys(e))return e;var u=Ns(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Ei(e,a)}else{var h=co(e),p=h==w||h==v;if(Gs(e))return wi(e,l);if(h==x||h==d||p&&!o){if(a=f||p?{}:ho(e),!l)return f?function(e,t){return Ti(e,fo(e),t)}(e,function(e,t){return e&&Ti(t,ka(t),e)}(a,e)):function(e,t){return Ti(e,lo(e),t)}(e,tr(a,e))}else{if(!it[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case I:return vi(e);case m:case g:return new i(+e);case P:return function(e,t){var n=t?vi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case q:case B:case R:case L:case O:case F:case D:case N:return yi(e,n);case y:return new i;case _:case C:return new i(e);case E:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new i;case k:return r=e,Rn?xe(Rn.call(r)):{}}}(e,h,l)}}s||(s=new Wn);var A=s.get(e);if(A)return A;s.set(e,a),na(e)?e.forEach(function(n){a.add(or(n,t,r,n,e,s))}):$s(e)&&e.forEach(function(n,i){a.set(i,or(n,t,r,i,e,s))});var b=u?n:(c?f?eo:Zi:f?ka:Ca)(e);return jt(b||e,function(n,i){b&&(n=e[i=n]),$n(a,i,or(n,t,r,i,e,s))}),a}function sr(e,t,r){var i=r.length;if(null==e)return!i;for(e=xe(e);i--;){var o=r[i],s=t[o],a=e[o];if(a===n&&!(o in e)||!s(a))return!1}return!0}function ar(e,t,i){if("function"!=typeof e)throw new Te(r);return Co(function(){e.apply(n,i)},t)}function lr(e,t,n,r){var i=-1,o=kt,s=!0,a=e.length,l=[],f=t.length;if(!a)return l;n&&(t=It(t,Kt(n))),r?(o=St,s=!1):t.length>=200&&(o=Yt,s=!1,t=new Vn(t));e:for(;++i<a;){var c=e[i],u=null==n?c:n(c);if(c=r||0!==c?c:0,s&&u==u){for(var h=f;h--;)if(t[h]===u)continue e;l.push(c)}else o(t,u,r)||l.push(c)}return l}On.templateSettings={escape:K,evaluate:X,interpolate:Y,variable:"",imports:{_:On}},On.prototype=Dn.prototype,On.prototype.constructor=On,Nn.prototype=Fn(Dn.prototype),Nn.prototype.constructor=Nn,zn.prototype=Fn(Dn.prototype),zn.prototype.constructor=zn,Hn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Hn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hn.prototype.get=function(e){var t=this.__data__;if(Tn){var r=t[e];return r===o?n:r}return Me.call(t,e)?t[e]:n},Hn.prototype.has=function(e){var t=this.__data__;return Tn?t[e]!==n:Me.call(t,e)},Hn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tn&&t===n?o:t,this},Un.prototype.clear=function(){this.__data__=[],this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=Zn(t,e);return!(n<0||(n==t.length-1?t.pop():We.call(t,n,1),--this.size,0))},Un.prototype.get=function(e){var t=this.__data__,r=Zn(t,e);return r<0?n:t[r][1]},Un.prototype.has=function(e){return Zn(this.__data__,e)>-1},Un.prototype.set=function(e,t){var n=this.__data__,r=Zn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(_n||Un),string:new Hn}},Gn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return oo(this,e).get(e)},Gn.prototype.has=function(e){return oo(this,e).has(e)},Gn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(e){return this.__data__.set(e,o),this},Vn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.clear=function(){this.__data__=new Un,this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Wn.prototype.get=function(e){return this.__data__.get(e)},Wn.prototype.has=function(e){return this.__data__.has(e)},Wn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Un){var r=n.__data__;if(!_n||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var fr=Si(gr),cr=Si(br,!0);function ur(e,t){var n=!0;return fr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function hr(e,t,r){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(l===n?a==a&&!ia(a):r(a,l)))var l=a,f=s}return f}function pr(e,t){var n=[];return fr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function dr(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=po),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?dr(a,t-1,n,r,i):Pt(i,a):r||(i[i.length]=a)}return i}var Ar=Ii(),mr=Ii(!0);function gr(e,t){return e&&Ar(e,t,Ca)}function br(e,t){return e&&mr(e,t,Ca)}function wr(e,t){return Ct(t,function(t){return Qs(e[t])})}function vr(e,t){for(var r=0,i=(t=Ai(t,e)).length;null!=e&&r<i;)e=e[qo(t[r++])];return r&&r==i?e:n}function yr(e,t,n){var r=t(e);return Ns(e)?r:Pt(r,n(e))}function _r(e){return null==e?e===n?"[object Undefined]":"[object Null]":Je&&Je in xe(e)?function(e){var t=Me.call(e,Je),r=e[Je];try{e[Je]=n;var i=!0}catch(e){}var o=Re.call(e);return i&&(t?e[Je]=r:delete e[Je]),o}(e):function(e){return Re.call(e)}(e)}function xr(e,t){return e>t}function jr(e,t){return null!=e&&Me.call(e,t)}function Er(e,t){return null!=e&&t in xe(e)}function Tr(e,t,r){for(var o=r?St:kt,s=e[0].length,a=e.length,l=a,f=i(a),c=1/0,u=[];l--;){var h=e[l];l&&t&&(h=It(h,Kt(t))),c=mn(h.length,c),f[l]=!r&&(t||s>=120&&h.length>=120)?new Vn(l&&h):n}h=e[0];var p=-1,d=f[0];e:for(;++p<s&&u.length<c;){var A=h[p],m=t?t(A):A;if(A=r||0!==A?A:0,!(d?Yt(d,m):o(u,m,r))){for(l=a;--l;){var g=f[l];if(!(g?Yt(g,m):o(e[l],m,r)))continue e}d&&d.push(m),u.push(A)}}return u}function Cr(e,t,r){var i=null==(e=jo(e,t=Ai(t,e)))?e:e[qo(Wo(t))];return null==i?n:_t(i,e,r)}function kr(e){return Js(e)&&_r(e)==d}function Sr(e,t,r,i,o){return e===t||(null==e||null==t||!Js(e)&&!Js(t)?e!=e&&t!=t:function(e,t,r,i,o,s){var a=Ns(e),l=Ns(t),f=a?A:co(e),c=l?A:co(t),u=(f=f==d?x:f)==x,h=(c=c==d?x:c)==x,p=f==c;if(p&&Gs(e)){if(!Gs(t))return!1;a=!0,u=!1}if(p&&!u)return s||(s=new Wn),a||oa(e)?Ji(e,t,r,i,o,s):function(e,t,n,r,i,o,s){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!o(new ze(e),new ze(t)));case m:case g:case _:return Ls(+e,+t);case b:return e.name==t.name&&e.message==t.message;case E:case C:return e==t+"";case y:var a=rn;case T:var l=1&r;if(a||(a=an),e.size!=t.size&&!l)return!1;var f=s.get(e);if(f)return f==t;r|=2,s.set(e,t);var c=Ji(a(e),a(t),r,i,o,s);return s.delete(e),c;case k:if(Rn)return Rn.call(e)==Rn.call(t)}return!1}(e,t,f,r,i,o,s);if(!(1&r)){var w=u&&Me.call(e,"__wrapped__"),v=h&&Me.call(t,"__wrapped__");if(w||v){var j=w?e.value():e,S=v?t.value():t;return s||(s=new Wn),o(j,S,r,i,s)}}return!!p&&(s||(s=new Wn),function(e,t,r,i,o,s){var a=1&r,l=Zi(e),f=l.length;if(f!=Zi(t).length&&!a)return!1;for(var c=f;c--;){var u=l[c];if(!(a?u in t:Me.call(t,u)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var d=!0;s.set(e,t),s.set(t,e);for(var A=a;++c<f;){var m=e[u=l[c]],g=t[u];if(i)var b=a?i(g,m,u,t,e,s):i(m,g,u,e,t,s);if(!(b===n?m===g||o(m,g,r,i,s):b)){d=!1;break}A||(A="constructor"==u)}if(d&&!A){var w=e.constructor,v=t.constructor;w==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof v&&v instanceof v||(d=!1)}return s.delete(e),s.delete(t),d}(e,t,r,i,o,s))}(e,t,r,i,Sr,o))}function Ir(e,t,r,i){var o=r.length,s=o,a=!i;if(null==e)return!s;for(e=xe(e);o--;){var l=r[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var f=(l=r[o])[0],c=e[f],u=l[1];if(a&&l[2]){if(c===n&&!(f in e))return!1}else{var h=new Wn;if(i)var p=i(c,u,f,e,t,h);if(!(p===n?Sr(u,c,3,i,h):p))return!1}}return!0}function Pr(e){return!(!Ys(e)||(t=e,Be&&Be in t))&&(Qs(e)?Fe:de).test(Bo(e));var t}function Mr(e){return"function"==typeof e?e:null==e?Za:"object"==typeof e?Ns(e)?Or(e[0],e[1]):Lr(e):ll(e)}function qr(e){if(!vo(e))return dn(e);var t=[];for(var n in xe(e))Me.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Br(e,t){return e<t}function Rr(e,t){var n=-1,r=Hs(e)?i(e.length):[];return fr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Lr(e){var t=so(e);return 1==t.length&&t[0][2]?_o(t[0][0],t[0][1]):function(n){return n===e||Ir(n,e,t)}}function Or(e,t){return go(e)&&yo(t)?_o(qo(e),t):function(r){var i=_a(r,e);return i===n&&i===t?xa(r,e):Sr(t,i,3)}}function Fr(e,t,r,i,o){e!==t&&Ar(t,function(s,a){if(o||(o=new Wn),Ys(s))!function(e,t,r,i,o,s,a){var l=Eo(e,r),f=Eo(t,r),c=a.get(f);if(c)Jn(e,r,c);else{var u=s?s(l,f,r+"",e,t,a):n,h=u===n;if(h){var p=Ns(f),d=!p&&Gs(f),A=!p&&!d&&oa(f);u=f,p||d||A?Ns(l)?u=l:Us(l)?u=Ei(l):d?(h=!1,u=wi(f,!0)):A?(h=!1,u=yi(f,!0)):u=[]:ea(f)||Ds(f)?(u=l,Ds(l)?u=pa(l):Ys(l)&&!Qs(l)||(u=ho(f))):h=!1}h&&(a.set(f,u),o(u,f,i,s,a),a.delete(f)),Jn(e,r,u)}}(e,t,a,r,Fr,i,o);else{var l=i?i(Eo(e,a),s,a+"",e,t,o):n;l===n&&(l=s),Jn(e,a,l)}},ka)}function Dr(e,t){var r=e.length;if(r)return Ao(t+=t<0?r:0,r)?e[t]:n}function Nr(e,t,n){t=t.length?It(t,function(e){return Ns(e)?function(t){return vr(t,1===e.length?e[0]:e)}:e}):[Za];var r=-1;t=It(t,Kt(io()));var i=Rr(e,function(e,n,i){var o=It(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=_i(i[r],o[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(i)}function zr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=vr(e,s);n(a,s)&&Xr(o,Ai(s,e),a)}return o}function Hr(e,t,n,r){var i=r?Dt:Ft,o=-1,s=t.length,a=e;for(e===t&&(t=Ei(t)),n&&(a=It(e,Kt(n)));++o<s;)for(var l=0,f=t[o],c=n?n(f):f;(l=i(a,c,l,r))>-1;)a!==e&&We.call(a,l,1),We.call(e,l,1);return e}function Ur(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ao(i)?We.call(e,i,1):ai(e,i)}}return e}function Gr(e,t){return e+ht(wn()*(t-e+1))}function Vr(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Wr(e,t){return ko(xo(e,t,Za),e+"")}function Qr(e){return Kn(La(e))}function Kr(e,t){var n=La(e);return Po(n,ir(t,0,n.length))}function Xr(e,t,r,i){if(!Ys(e))return e;for(var o=-1,s=(t=Ai(t,e)).length,a=s-1,l=e;null!=l&&++o<s;){var f=qo(t[o]),c=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(o!=a){var u=l[f];(c=i?i(u,f,l):n)===n&&(c=Ys(u)?u:Ao(t[o+1])?[]:{})}$n(l,f,c),l=l[f]}return e}var Yr=Cn?function(e,t){return Cn.set(e,t),e}:Za,Jr=Ze?function(e,t){return Ze(e,"toString",{configurable:!0,enumerable:!1,value:Ya(t),writable:!0})}:Za;function $r(e){return Po(La(e))}function Zr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=i(o);++r<o;)s[r]=e[r+t];return s}function ei(e,t){var n;return fr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ti(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!ia(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ni(e,t,Za,n)}function ni(e,t,r,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,l=null===t,f=ia(t),c=t===n;o<s;){var u=ht((o+s)/2),h=r(e[u]),p=h!==n,d=null===h,A=h==h,m=ia(h);if(a)var g=i||A;else g=c?A&&(i||p):l?A&&p&&(i||!d):f?A&&p&&!d&&(i||!m):!d&&!m&&(i?h<=t:h<t);g?o=u+1:s=u}return mn(s,4294967294)}function ri(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!Ls(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function ii(e){return"number"==typeof e?e:ia(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ns(e))return It(e,oi)+"";if(ia(e))return Ln?Ln.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function si(e,t,n){var r=-1,i=kt,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=St;else if(o>=200){var f=t?null:Vi(e);if(f)return an(f);s=!1,i=Yt,l=new Vn}else l=t?[]:a;e:for(;++r<o;){var c=e[r],u=t?t(c):c;if(c=n||0!==c?c:0,s&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),a.push(c)}else i(l,u,n)||(l!==a&&l.push(u),a.push(c))}return a}function ai(e,t){return null==(e=jo(e,t=Ai(t,e)))||delete e[qo(Wo(t))]}function li(e,t,n,r){return Xr(e,t,n(vr(e,t)),r)}function fi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Zr(e,r?0:o,r?o+1:i):Zr(e,r?o+1:0,r?i:o)}function ci(e,t){var n=e;return n instanceof zn&&(n=n.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},n)}function ui(e,t,n){var r=e.length;if(r<2)return r?si(e[0]):[];for(var o=-1,s=i(r);++o<r;)for(var a=e[o],l=-1;++l<r;)l!=o&&(s[o]=lr(s[o]||a,e[l],t,n));return si(dr(s,1),t,n)}function hi(e,t,r){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:n;r(a,e[i],l)}return a}function pi(e){return Us(e)?e:[]}function di(e){return"function"==typeof e?e:Za}function Ai(e,t){return Ns(e)?e:go(e,t)?[e]:Mo(da(e))}var mi=Wr;function gi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Zr(e,t,r)}var bi=ot||function(e){return ct.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=He?He(n):new e.constructor(n);return e.copy(r),r}function vi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function yi(e,t){var n=t?vi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _i(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,s=ia(e),a=t!==n,l=null===t,f=t==t,c=ia(t);if(!l&&!c&&!s&&e>t||s&&a&&f&&!l&&!c||i&&a&&f||!r&&f||!o)return 1;if(!i&&!s&&!c&&e<t||c&&r&&o&&!i&&!s||l&&r&&o||!a&&o||!f)return-1}return 0}function xi(e,t,n,r){for(var o=-1,s=e.length,a=n.length,l=-1,f=t.length,c=An(s-a,0),u=i(f+c),h=!r;++l<f;)u[l]=t[l];for(;++o<a;)(h||o<s)&&(u[n[o]]=e[o]);for(;c--;)u[l++]=e[o++];return u}function ji(e,t,n,r){for(var o=-1,s=e.length,a=-1,l=n.length,f=-1,c=t.length,u=An(s-l,0),h=i(u+c),p=!r;++o<u;)h[o]=e[o];for(var d=o;++f<c;)h[d+f]=t[f];for(;++a<l;)(p||o<s)&&(h[d+n[a]]=e[o++]);return h}function Ei(e,t){var n=-1,r=e.length;for(t||(t=i(r));++n<r;)t[n]=e[n];return t}function Ti(e,t,r,i){var o=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var l=t[s],f=i?i(r[l],e[l],l,r,e):n;f===n&&(f=e[l]),o?nr(r,l,f):$n(r,l,f)}return r}function Ci(e,t){return function(n,r){var i=Ns(n)?xt:er,o=t?t():{};return i(n,e,io(r,2),o)}}function ki(e){return Wr(function(t,r){var i=-1,o=r.length,s=o>1?r[o-1]:n,a=o>2?r[2]:n;for(s=e.length>3&&"function"==typeof s?(o--,s):n,a&&mo(r[0],r[1],a)&&(s=o<3?n:s,o=1),t=xe(t);++i<o;){var l=r[i];l&&e(t,l,i,s)}return t})}function Si(e,t){return function(n,r){if(null==n)return n;if(!Hs(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=xe(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ii(e){return function(t,n,r){for(var i=-1,o=xe(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function Pi(e){return function(t){var r=nn(t=da(t))?cn(t):n,i=r?r[0]:t.charAt(0),o=r?gi(r,1).join(""):t.slice(1);return i[e]()+o}}function Mi(e){return function(t){return Mt(Qa(Da(t).replace(Xe,"")),e,"")}}function qi(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 n=Fn(e.prototype),r=e.apply(n,t);return Ys(r)?r:n}}function Bi(e){return function(t,r,i){var o=xe(t);if(!Hs(t)){var s=io(r,3);t=Ca(t),r=function(e){return s(o[e],e,o)}}var a=e(t,r,i);return a>-1?o[s?t[a]:a]:n}}function Ri(e){return $i(function(t){var i=t.length,o=i,s=Nn.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Te(r);if(s&&!l&&"wrapper"==no(a))var l=new Nn([],!0)}for(o=l?o:i;++o<i;){var f=no(a=t[o]),c="wrapper"==f?to(a):n;l=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[no(c[0])].apply(l,c[3]):1==a.length&&bo(a)?l[f]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ns(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function Li(e,t,r,o,s,a,f,c,u,h){var p=t&l,d=1&t,A=2&t,m=24&t,g=512&t,b=A?n:qi(e);return function l(){for(var w=arguments.length,v=i(w),y=w;y--;)v[y]=arguments[y];if(m)var _=ro(l),x=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(v,_);if(o&&(v=xi(v,o,s,m)),a&&(v=ji(v,a,f,m)),w-=x,m&&w<h){var j=sn(v,_);return Ui(e,t,Li,l.placeholder,r,v,j,c,u,h-w)}var E=d?r:this,T=A?E[e]:e;return w=v.length,c?v=function(e,t){for(var r=e.length,i=mn(t.length,r),o=Ei(e);i--;){var s=t[i];e[i]=Ao(s,r)?o[s]:n}return e}(v,c):g&&w>1&&v.reverse(),p&&u<w&&(v.length=u),this&&this!==ct&&this instanceof l&&(T=b||qi(T)),T.apply(E,v)}}function Oi(e,t){return function(n,r){return function(e,t,n,r){return gr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Fi(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=oi(r),i=oi(i)):(r=ii(r),i=ii(i)),o=e(r,i)}return o}}function Di(e){return $i(function(t){return t=It(t,Kt(io())),Wr(function(n){var r=this;return e(t,function(e){return _t(e,r,n)})})})}function Ni(e,t){var r=(t=t===n?" ":oi(t)).length;if(r<2)return r?Vr(t,e):t;var i=Vr(t,ut(e/fn(t)));return nn(t)?gi(cn(i),0,e).join(""):i.slice(0,e)}function zi(e){return function(t,r,o){return o&&"number"!=typeof o&&mo(t,r,o)&&(r=o=n),t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,n,r){for(var o=-1,s=An(ut((t-e)/(n||1)),0),a=i(s);s--;)a[r?s:++o]=e,e+=n;return a}(t,r,o=o===n?t<r?1:-1:fa(o),e)}}function Hi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ha(t),n=ha(n)),e(t,n)}}function Ui(e,t,r,i,o,s,l,f,c,u){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var p=[e,t,o,h?s:n,h?l:n,h?n:s,h?n:l,f,c,u],d=r.apply(n,p);return bo(e)&&To(d,p),d.placeholder=i,So(d,e,t)}function Gi(e){var t=_e[e];return function(e,n){if(e=ha(e),(n=null==n?0:mn(ca(n),292))&&Rt(e)){var r=(da(e)+"e").split("e");return+((r=(da(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Vi=jn&&1/an(new jn([,-0]))[1]==f?function(e){return new jn(e)}:il;function Wi(e){return function(t){var n=co(t);return n==y?rn(t):n==T?ln(t):function(e,t){return It(t,function(t){return[t,e[t]]})}(t,e(t))}}function Qi(e,t,o,f,c,u,h,p){var d=2&t;if(!d&&"function"!=typeof e)throw new Te(r);var A=f?f.length:0;if(A||(t&=-97,f=c=n),h=h===n?h:An(ca(h),0),p=p===n?p:ca(p),A-=c?c.length:0,64&t){var m=f,g=c;f=c=n}var b=d?n:to(e),w=[e,t,o,f,c,m,g,u,h,p];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==l&&8==n||r==l&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var f=t[3];if(f){var c=e[3];e[3]=c?xi(c,f,t[4]):f,e[4]=c?sn(e[3],s):t[4]}(f=t[5])&&(c=e[5],e[5]=c?ji(c,f,t[6]):f,e[6]=c?sn(e[5],s):t[6]),(f=t[7])&&(e[7]=f),r&l&&(e[8]=null==e[8]?t[8]:mn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(w,b),e=w[0],t=w[1],o=w[2],f=w[3],c=w[4],!(p=w[9]=w[9]===n?d?0:e.length:An(w[9]-A,0))&&24&t&&(t&=-25),t&&1!=t)v=8==t||16==t?function(e,t,r){var o=qi(e);return function s(){for(var a=arguments.length,l=i(a),f=a,c=ro(s);f--;)l[f]=arguments[f];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:sn(l,c);return(a-=u.length)<r?Ui(e,t,Li,s.placeholder,n,l,u,n,n,r-a):_t(this&&this!==ct&&this instanceof s?o:e,this,l)}}(e,t,p):t!=a&&33!=t||c.length?Li.apply(n,w):function(e,t,n,r){var o=1&t,s=qi(e);return function t(){for(var a=-1,l=arguments.length,f=-1,c=r.length,u=i(c+l),h=this&&this!==ct&&this instanceof t?s:e;++f<c;)u[f]=r[f];for(;l--;)u[f++]=arguments[++a];return _t(h,o?n:this,u)}}(e,t,o,f);else var v=function(e,t,n){var r=1&t,i=qi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,o);return So((b?Yr:To)(v,w),e,t)}function Ki(e,t,r,i){return e===n||Ls(e,Se[r])&&!Me.call(i,r)?t:e}function Xi(e,t,r,i,o,s){return Ys(e)&&Ys(t)&&(s.set(t,e),Fr(e,t,n,Xi,s),s.delete(t)),e}function Yi(e){return ea(e)?n:e}function Ji(e,t,r,i,o,s){var a=1&r,l=e.length,f=t.length;if(l!=f&&!(a&&f>l))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,p=!0,d=2&r?new Vn:n;for(s.set(e,t),s.set(t,e);++h<l;){var A=e[h],m=t[h];if(i)var g=a?i(m,A,h,t,e,s):i(A,m,h,e,t,s);if(g!==n){if(g)continue;p=!1;break}if(d){if(!Bt(t,function(e,t){if(!Yt(d,t)&&(A===e||o(A,e,r,i,s)))return d.push(t)})){p=!1;break}}else if(A!==m&&!o(A,m,r,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function $i(e){return ko(xo(e,n,zo),e+"")}function Zi(e){return yr(e,Ca,lo)}function eo(e){return yr(e,ka,fo)}var to=Cn?function(e){return Cn.get(e)}:il;function no(e){for(var t=e.name+"",n=kn[t],r=Me.call(kn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ro(e){return(Me.call(On,"placeholder")?On:e).placeholder}function io(){var e=On.iteratee||el;return e=e===el?Mr:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function so(e){for(var t=Ca(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,yo(i)]}return t}function ao(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Pr(r)?r:n}var lo=dt?function(e){return null==e?[]:(e=xe(e),Ct(dt(e),function(t){return Ve.call(e,t)}))}:ul,fo=dt?function(e){for(var t=[];e;)Pt(t,lo(e)),e=Ue(e);return t}:ul,co=_r;function uo(e,t,n){for(var r=-1,i=(t=Ai(t,e)).length,o=!1;++r<i;){var s=qo(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xs(i)&&Ao(s,i)&&(Ns(e)||Ds(e))}function ho(e){return"function"!=typeof e.constructor||vo(e)?{}:Fn(Ue(e))}function po(e){return Ns(e)||Ds(e)||!!(Qe&&e&&e[Qe])}function Ao(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&me.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,n){if(!Ys(n))return!1;var r=typeof t;return!!("number"==r?Hs(n)&&Ao(t,n.length):"string"==r&&t in n)&&Ls(n[t],e)}function go(e,t){if(Ns(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ia(e))||$.test(e)||!J.test(e)||null!=t&&e in xe(t)}function bo(e){var t=no(e),n=On[t];if("function"!=typeof n||!(t in zn.prototype))return!1;if(e===n)return!0;var r=to(n);return!!r&&e===r[0]}(yn&&co(new yn(new ArrayBuffer(1)))!=P||_n&&co(new _n)!=y||xn&&co(xn.resolve())!=j||jn&&co(new jn)!=T||En&&co(new En)!=S)&&(co=function(e){var t=_r(e),r=t==x?e.constructor:n,i=r?Bo(r):"";if(i)switch(i){case Sn:return P;case In:return y;case Pn:return j;case Mn:return T;case qn:return S}return t});var wo=Ie?Qs:hl;function vo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)}function yo(e){return e==e&&!Ys(e)}function _o(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in xe(r))}}function xo(e,t,r){return t=An(t===n?e.length-1:t,0),function(){for(var n=arguments,o=-1,s=An(n.length-t,0),a=i(s);++o<s;)a[o]=n[t+o];o=-1;for(var l=i(t+1);++o<t;)l[o]=n[o];return l[t]=r(a),_t(e,this,l)}}function jo(e,t){return t.length<2?e:vr(e,Zr(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var To=Io(Yr),Co=ft||function(e,t){return ct.setTimeout(e,t)},ko=Io(Jr);function So(e,t,n){var r=t+"";return ko(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(p,function(n){var r="_."+n[0];t&n[1]&&!kt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(se):[]}(r),n)))}function Io(e){var t=0,r=0;return function(){var i=gn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Po(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var s=Gr(r,o),a=e[s];e[s]=e[r],e[r]=a}return e.length=t,e}var Mo=function(){var e=Is(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Z,function(e,n,r,i){t.push(r?i.replace(fe,"$1"):n||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function qo(e){if("string"==typeof e||ia(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Bo(e){if(null!=e){try{return Pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof zn)return e.clone();var t=new Nn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Wr(function(e,t){return Us(e)?lr(e,dr(t,1,Us,!0)):[]}),Oo=Wr(function(e,t){var r=Wo(t);return Us(r)&&(r=n),Us(e)?lr(e,dr(t,1,Us,!0),io(r,2)):[]}),Fo=Wr(function(e,t){var r=Wo(t);return Us(r)&&(r=n),Us(e)?lr(e,dr(t,1,Us,!0),n,r):[]});function Do(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ca(n);return i<0&&(i=An(r+i,0)),Ot(e,io(t,3),i)}function No(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=ca(r),o=r<0?An(i+o,0):mn(o,i-1)),Ot(e,io(t,3),o,!0)}function zo(e){return null!=e&&e.length?dr(e,1):[]}function Ho(e){return e&&e.length?e[0]:n}var Uo=Wr(function(e){var t=It(e,pi);return t.length&&t[0]===e[0]?Tr(t):[]}),Go=Wr(function(e){var t=Wo(e),r=It(e,pi);return t===Wo(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Tr(r,io(t,2)):[]}),Vo=Wr(function(e){var t=Wo(e),r=It(e,pi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Tr(r,n,t):[]});function Wo(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Qo=Wr(Ko);function Ko(e,t){return e&&e.length&&t&&t.length?Hr(e,t):e}var Xo=$i(function(e,t){var n=null==e?0:e.length,r=rr(e,t);return Ur(e,It(t,function(e){return Ao(e,n)?+e:e}).sort(_i)),r});function Yo(e){return null==e?e:vn.call(e)}var Jo=Wr(function(e){return si(dr(e,1,Us,!0))}),$o=Wr(function(e){var t=Wo(e);return Us(t)&&(t=n),si(dr(e,1,Us,!0),io(t,2))}),Zo=Wr(function(e){var t=Wo(e);return t="function"==typeof t?t:n,si(dr(e,1,Us,!0),n,t)});function es(e){if(!e||!e.length)return[];var t=0;return e=Ct(e,function(e){if(Us(e))return t=An(e.length,t),!0}),Wt(t,function(t){return It(e,Ht(t))})}function ts(e,t){if(!e||!e.length)return[];var r=es(e);return null==t?r:It(r,function(e){return _t(t,n,e)})}var ns=Wr(function(e,t){return Us(e)?lr(e,t):[]}),rs=Wr(function(e){return ui(Ct(e,Us))}),is=Wr(function(e){var t=Wo(e);return Us(t)&&(t=n),ui(Ct(e,Us),io(t,2))}),os=Wr(function(e){var t=Wo(e);return t="function"==typeof t?t:n,ui(Ct(e,Us),n,t)}),ss=Wr(es),as=Wr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ts(e,r)});function ls(e){var t=On(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var cs=$i(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof zn&&Ao(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:n}),new Nn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),us=Ci(function(e,t,n){Me.call(e,n)?++e[n]:nr(e,n,1)}),hs=Bi(Do),ps=Bi(No);function ds(e,t){return(Ns(e)?jt:fr)(e,io(t,3))}function As(e,t){return(Ns(e)?Et:cr)(e,io(t,3))}var ms=Ci(function(e,t,n){Me.call(e,n)?e[n].push(t):nr(e,n,[t])}),gs=Wr(function(e,t,n){var r=-1,o="function"==typeof t,s=Hs(e)?i(e.length):[];return fr(e,function(e){s[++r]=o?_t(t,e,n):Cr(e,t,n)}),s}),bs=Ci(function(e,t,n){nr(e,n,t)});function ws(e,t){return(Ns(e)?It:Rr)(e,io(t,3))}var vs=Ci(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ys=Wr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&mo(e,t[0],t[1])?t=[]:n>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Nr(e,dr(t,1),[])}),_s=lt||function(){return ct.Date.now()};function xs(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Qi(e,l,n,n,n,n,t)}function js(e,t){var i;if("function"!=typeof t)throw new Te(r);return e=ca(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Es=Wr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ro(Es));r|=a}return Qi(e,r,t,n,i)}),Ts=Wr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ro(Ts));r|=a}return Qi(t,r,e,n,i)});function Cs(e,t,i){var o,s,a,l,f,c,u=0,h=!1,p=!1,d=!0;if("function"!=typeof e)throw new Te(r);function A(t){var r=o,i=s;return o=s=n,u=t,l=e.apply(i,r)}function m(e){var r=e-c;return c===n||r>=t||r<0||p&&e-u>=a}function g(){var e=_s();if(m(e))return b(e);f=Co(g,function(e){var n=t-(e-c);return p?mn(n,a-(e-u)):n}(e))}function b(e){return f=n,d&&o?A(e):(o=s=n,l)}function w(){var e=_s(),r=m(e);if(o=arguments,s=this,c=e,r){if(f===n)return function(e){return u=e,f=Co(g,t),h?A(e):l}(c);if(p)return bi(f),f=Co(g,t),A(c)}return f===n&&(f=Co(g,t)),l}return t=ha(t)||0,Ys(i)&&(h=!!i.leading,a=(p="maxWait"in i)?An(ha(i.maxWait)||0,t):a,d="trailing"in i?!!i.trailing:d),w.cancel=function(){f!==n&&bi(f),u=0,o=c=s=f=n},w.flush=function(){return f===n?l:b(_s())},w}var ks=Wr(function(e,t){return ar(e,1,t)}),Ss=Wr(function(e,t,n){return ar(e,ha(t)||0,n)});function Is(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Is.Cache||Gn),n}function Ps(e){if("function"!=typeof e)throw new Te(r);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)}}Is.Cache=Gn;var Ms=mi(function(e,t){var n=(t=1==t.length&&Ns(t[0])?It(t[0],Kt(io())):It(dr(t,1),Kt(io()))).length;return Wr(function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return _t(e,this,r)})}),qs=Wr(function(e,t){var r=sn(t,ro(qs));return Qi(e,a,n,t,r)}),Bs=Wr(function(e,t){var r=sn(t,ro(Bs));return Qi(e,64,n,t,r)}),Rs=$i(function(e,t){return Qi(e,256,n,n,n,t)});function Ls(e,t){return e===t||e!=e&&t!=t}var Os=Hi(xr),Fs=Hi(function(e,t){return e>=t}),Ds=kr(function(){return arguments}())?kr:function(e){return Js(e)&&Me.call(e,"callee")&&!Ve.call(e,"callee")},Ns=i.isArray,zs=mt?Kt(mt):function(e){return Js(e)&&_r(e)==I};function Hs(e){return null!=e&&Xs(e.length)&&!Qs(e)}function Us(e){return Js(e)&&Hs(e)}var Gs=At||hl,Vs=gt?Kt(gt):function(e){return Js(e)&&_r(e)==g};function Ws(e){if(!Js(e))return!1;var t=_r(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ea(e)}function Qs(e){if(!Ys(e))return!1;var t=_r(e);return t==w||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ks(e){return"number"==typeof e&&e==ca(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ys(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Js(e){return null!=e&&"object"==typeof e}var $s=bt?Kt(bt):function(e){return Js(e)&&co(e)==y};function Zs(e){return"number"==typeof e||Js(e)&&_r(e)==_}function ea(e){if(!Js(e)||_r(e)!=x)return!1;var t=Ue(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pe.call(n)==Le}var ta=wt?Kt(wt):function(e){return Js(e)&&_r(e)==E},na=vt?Kt(vt):function(e){return Js(e)&&co(e)==T};function ra(e){return"string"==typeof e||!Ns(e)&&Js(e)&&_r(e)==C}function ia(e){return"symbol"==typeof e||Js(e)&&_r(e)==k}var oa=yt?Kt(yt):function(e){return Js(e)&&Xs(e.length)&&!!rt[_r(e)]},sa=Hi(Br),aa=Hi(function(e,t){return e<=t});function la(e){if(!e)return[];if(Hs(e))return ra(e)?cn(e):Ei(e);if(Ke&&e[Ke])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ke]());var t=co(e);return(t==y?rn:t==T?an:La)(e)}function fa(e){return e?(e=ha(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ca(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function ua(e){return e?ir(ca(e),0,h):0}function ha(e){if("number"==typeof e)return e;if(ia(e))return u;if(Ys(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ys(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Qt(e);var n=pe.test(e);return n||Ae.test(e)?at(e.slice(2),n?2:8):he.test(e)?u:+e}function pa(e){return Ti(e,ka(e))}function da(e){return null==e?"":oi(e)}var Aa=ki(function(e,t){if(vo(t)||Hs(t))Ti(t,Ca(t),e);else for(var n in t)Me.call(t,n)&&$n(e,n,t[n])}),ma=ki(function(e,t){Ti(t,ka(t),e)}),ga=ki(function(e,t,n,r){Ti(t,ka(t),e,r)}),ba=ki(function(e,t,n,r){Ti(t,Ca(t),e,r)}),wa=$i(rr),va=Wr(function(e,t){e=xe(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&mo(t[0],t[1],o)&&(i=1);++r<i;)for(var s=t[r],a=ka(s),l=-1,f=a.length;++l<f;){var c=a[l],u=e[c];(u===n||Ls(u,Se[c])&&!Me.call(e,c))&&(e[c]=s[c])}return e}),ya=Wr(function(e){return e.push(n,Xi),_t(Ia,n,e)});function _a(e,t,r){var i=null==e?n:vr(e,t);return i===n?r:i}function xa(e,t){return null!=e&&uo(e,t,Er)}var ja=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),e[t]=n},Ya(Za)),Ea=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),Me.call(e,t)?e[t].push(n):e[t]=[n]},io),Ta=Wr(Cr);function Ca(e){return Hs(e)?Qn(e):qr(e)}function ka(e){return Hs(e)?Qn(e,!0):function(e){if(!Ys(e))return function(e){var t=[];if(null!=e)for(var n in xe(e))t.push(n);return t}(e);var t=vo(e),n=[];for(var r in e)("constructor"!=r||!t&&Me.call(e,r))&&n.push(r);return n}(e)}var Sa=ki(function(e,t,n){Fr(e,t,n)}),Ia=ki(function(e,t,n,r){Fr(e,t,n,r)}),Pa=$i(function(e,t){var n={};if(null==e)return n;var r=!1;t=It(t,function(t){return t=Ai(t,e),r||(r=t.length>1),t}),Ti(e,eo(e),n),r&&(n=or(n,7,Yi));for(var i=t.length;i--;)ai(n,t[i]);return n}),Ma=$i(function(e,t){return null==e?{}:function(e,t){return zr(e,t,function(t,n){return xa(e,n)})}(e,t)});function qa(e,t){if(null==e)return{};var n=It(eo(e),function(e){return[e]});return t=io(t),zr(e,n,function(e,n){return t(e,n[0])})}var Ba=Wi(Ca),Ra=Wi(ka);function La(e){return null==e?[]:Xt(e,Ca(e))}var Oa=Mi(function(e,t,n){return t=t.toLowerCase(),e+(n?Fa(t):t)});function Fa(e){return Wa(da(e).toLowerCase())}function Da(e){return(e=da(e))&&e.replace(ge,Zt).replace(Ye,"")}var Na=Mi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),za=Mi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ha=Pi("toLowerCase"),Ua=Mi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ga=Mi(function(e,t,n){return e+(n?" ":"")+Wa(t)}),Va=Mi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Wa=Pi("toUpperCase");function Qa(e,t,r){return e=da(e),(t=r?n:t)===n?function(e){return et.test(e)}(e)?function(e){return e.match($e)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var Ka=Wr(function(e,t){try{return _t(e,n,t)}catch(e){return Ws(e)?e:new ve(e)}}),Xa=$i(function(e,t){return jt(t,function(t){t=qo(t),nr(e,t,Es(e[t],e))}),e});function Ya(e){return function(){return e}}var Ja=Ri(),$a=Ri(!0);function Za(e){return e}function el(e){return Mr("function"==typeof e?e:or(e,1))}var tl=Wr(function(e,t){return function(n){return Cr(n,e,t)}}),nl=Wr(function(e,t){return function(n){return Cr(e,n,t)}});function rl(e,t,n){var r=Ca(t),i=wr(t,r);null!=n||Ys(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ca(t)));var o=!(Ys(n)&&"chain"in n&&!n.chain),s=Qs(e);return jt(i,function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})}),e}function il(){}var ol=Di(It),sl=Di(Tt),al=Di(Bt);function ll(e){return go(e)?Ht(qo(e)):function(e){return function(t){return vr(t,e)}}(e)}var fl=zi(),cl=zi(!0);function ul(){return[]}function hl(){return!1}var pl,dl=Fi(function(e,t){return e+t},0),Al=Gi("ceil"),ml=Fi(function(e,t){return e/t},1),gl=Gi("floor"),bl=Fi(function(e,t){return e*t},1),wl=Gi("round"),vl=Fi(function(e,t){return e-t},0);return On.after=function(e,t){if("function"!=typeof t)throw new Te(r);return e=ca(e),function(){if(--e<1)return t.apply(this,arguments)}},On.ary=xs,On.assign=Aa,On.assignIn=ma,On.assignInWith=ga,On.assignWith=ba,On.at=wa,On.before=js,On.bind=Es,On.bindAll=Xa,On.bindKey=Ts,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ns(e)?e:[e]},On.chain=ls,On.chunk=function(e,t,r){t=(r?mo(e,t,r):t===n)?1:An(ca(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=i(ut(o/t));s<o;)l[a++]=Zr(e,s,s+=t);return l},On.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},On.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Pt(Ns(n)?Ei(n):[n],dr(t,1))},On.cond=function(e){var t=null==e?0:e.length,n=io();return e=t?It(e,function(e){if("function"!=typeof e[1])throw new Te(r);return[n(e[0]),e[1]]}):[],Wr(function(n){for(var r=-1;++r<t;){var i=e[r];if(_t(i[0],this,n))return _t(i[1],this,n)}})},On.conforms=function(e){return function(e){var t=Ca(e);return function(n){return sr(n,e,t)}}(or(e,1))},On.constant=Ya,On.countBy=us,On.create=function(e,t){var n=Fn(e);return null==t?n:tr(n,t)},On.curry=function e(t,r,i){var o=Qi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},On.curryRight=function e(t,r,i){var o=Qi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},On.debounce=Cs,On.defaults=va,On.defaultsDeep=ya,On.defer=ks,On.delay=Ss,On.difference=Lo,On.differenceBy=Oo,On.differenceWith=Fo,On.drop=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,(t=r||t===n?1:ca(t))<0?0:t,i):[]},On.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,0,(t=i-(t=r||t===n?1:ca(t)))<0?0:t):[]},On.dropRightWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!0,!0):[]},On.dropWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!0):[]},On.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&mo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=ca(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:ca(i))<0&&(i+=o),i=r>i?0:ua(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},On.filter=function(e,t){return(Ns(e)?Ct:pr)(e,io(t,3))},On.flatMap=function(e,t){return dr(ws(e,t),1)},On.flatMapDeep=function(e,t){return dr(ws(e,t),f)},On.flatMapDepth=function(e,t,r){return r=r===n?1:ca(r),dr(ws(e,t),r)},On.flatten=zo,On.flattenDeep=function(e){return null!=e&&e.length?dr(e,f):[]},On.flattenDepth=function(e,t){return null!=e&&e.length?dr(e,t=t===n?1:ca(t)):[]},On.flip=function(e){return Qi(e,512)},On.flow=Ja,On.flowRight=$a,On.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},On.functions=function(e){return null==e?[]:wr(e,Ca(e))},On.functionsIn=function(e){return null==e?[]:wr(e,ka(e))},On.groupBy=ms,On.initial=function(e){return null!=e&&e.length?Zr(e,0,-1):[]},On.intersection=Uo,On.intersectionBy=Go,On.intersectionWith=Vo,On.invert=ja,On.invertBy=Ea,On.invokeMap=gs,On.iteratee=el,On.keyBy=bs,On.keys=Ca,On.keysIn=ka,On.map=ws,On.mapKeys=function(e,t){var n={};return t=io(t,3),gr(e,function(e,r,i){nr(n,t(e,r,i),e)}),n},On.mapValues=function(e,t){var n={};return t=io(t,3),gr(e,function(e,r,i){nr(n,r,t(e,r,i))}),n},On.matches=function(e){return Lr(or(e,1))},On.matchesProperty=function(e,t){return Or(e,or(t,1))},On.memoize=Is,On.merge=Sa,On.mergeWith=Ia,On.method=tl,On.methodOf=nl,On.mixin=rl,On.negate=Ps,On.nthArg=function(e){return e=ca(e),Wr(function(t){return Dr(t,e)})},On.omit=Pa,On.omitBy=function(e,t){return qa(e,Ps(io(t)))},On.once=function(e){return js(2,e)},On.orderBy=function(e,t,r,i){return null==e?[]:(Ns(t)||(t=null==t?[]:[t]),Ns(r=i?n:r)||(r=null==r?[]:[r]),Nr(e,t,r))},On.over=ol,On.overArgs=Ms,On.overEvery=sl,On.overSome=al,On.partial=qs,On.partialRight=Bs,On.partition=vs,On.pick=Ma,On.pickBy=qa,On.property=ll,On.propertyOf=function(e){return function(t){return null==e?n:vr(e,t)}},On.pull=Qo,On.pullAll=Ko,On.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Hr(e,t,io(n,2)):e},On.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Hr(e,t,n,r):e},On.pullAt=Xo,On.range=fl,On.rangeRight=cl,On.rearg=Rs,On.reject=function(e,t){return(Ns(e)?Ct:pr)(e,Ps(io(t,3)))},On.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=io(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return Ur(e,i),n},On.rest=function(e,t){if("function"!=typeof e)throw new Te(r);return Wr(e,t=t===n?t:ca(t))},On.reverse=Yo,On.sampleSize=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:ca(t),(Ns(e)?Xn:Kr)(e,t)},On.set=function(e,t,n){return null==e?e:Xr(e,t,n)},On.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Xr(e,t,r,i)},On.shuffle=function(e){return(Ns(e)?Yn:$r)(e)},On.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&mo(e,t,r)?(t=0,r=i):(t=null==t?0:ca(t),r=r===n?i:ca(r)),Zr(e,t,r)):[]},On.sortBy=ys,On.sortedUniq=function(e){return e&&e.length?ri(e):[]},On.sortedUniqBy=function(e,t){return e&&e.length?ri(e,io(t,2)):[]},On.split=function(e,t,r){return r&&"number"!=typeof r&&mo(e,t,r)&&(t=r=n),(r=r===n?h:r>>>0)?(e=da(e))&&("string"==typeof t||null!=t&&!ta(t))&&!(t=oi(t))&&nn(e)?gi(cn(e),0,r):e.split(t,r):[]},On.spread=function(e,t){if("function"!=typeof e)throw new Te(r);return t=null==t?0:An(ca(t),0),Wr(function(n){var r=n[t],i=gi(n,0,t);return r&&Pt(i,r),_t(e,this,i)})},On.tail=function(e){var t=null==e?0:e.length;return t?Zr(e,1,t):[]},On.take=function(e,t,r){return e&&e.length?Zr(e,0,(t=r||t===n?1:ca(t))<0?0:t):[]},On.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Zr(e,(t=i-(t=r||t===n?1:ca(t)))<0?0:t,i):[]},On.takeRightWhile=function(e,t){return e&&e.length?fi(e,io(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?fi(e,io(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Te(r);return Ys(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Cs(e,t,{leading:i,maxWait:t,trailing:o})},On.thru=fs,On.toArray=la,On.toPairs=Ba,On.toPairsIn=Ra,On.toPath=function(e){return Ns(e)?It(e,qo):ia(e)?[e]:Ei(Mo(da(e)))},On.toPlainObject=pa,On.transform=function(e,t,n){var r=Ns(e),i=r||Gs(e)||oa(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Ys(e)&&Qs(o)?Fn(Ue(e)):{}}return(i?jt:gr)(e,function(e,r,i){return t(n,e,r,i)}),n},On.unary=function(e){return xs(e,1)},On.union=Jo,On.unionBy=$o,On.unionWith=Zo,On.uniq=function(e){return e&&e.length?si(e):[]},On.uniqBy=function(e,t){return e&&e.length?si(e,io(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?si(e,n,t):[]},On.unset=function(e,t){return null==e||ai(e,t)},On.unzip=es,On.unzipWith=ts,On.update=function(e,t,n){return null==e?e:li(e,t,di(n))},On.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:li(e,t,di(r),i)},On.values=La,On.valuesIn=function(e){return null==e?[]:Xt(e,ka(e))},On.without=ns,On.words=Qa,On.wrap=function(e,t){return qs(di(t),e)},On.xor=rs,On.xorBy=is,On.xorWith=os,On.zip=ss,On.zipObject=function(e,t){return hi(e||[],t||[],$n)},On.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xr)},On.zipWith=as,On.entries=Ba,On.entriesIn=Ra,On.extend=ma,On.extendWith=ga,rl(On,On),On.add=dl,On.attempt=Ka,On.camelCase=Oa,On.capitalize=Fa,On.ceil=Al,On.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ha(r))==r?r:0),t!==n&&(t=(t=ha(t))==t?t:0),ir(ha(e),t,r)},On.clone=function(e){return or(e,4)},On.cloneDeep=function(e){return or(e,5)},On.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:n)},On.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:n)},On.conformsTo=function(e,t){return null==t||sr(e,t,Ca(t))},On.deburr=Da,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=ml,On.endsWith=function(e,t,r){e=da(e),t=oi(t);var i=e.length,o=r=r===n?i:ir(ca(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},On.eq=Ls,On.escape=function(e){return(e=da(e))&&Q.test(e)?e.replace(V,en):e},On.escapeRegExp=function(e){return(e=da(e))&&te.test(e)?e.replace(ee,"\\$&"):e},On.every=function(e,t,r){var i=Ns(e)?Tt:ur;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},On.find=hs,On.findIndex=Do,On.findKey=function(e,t){return Lt(e,io(t,3),gr)},On.findLast=ps,On.findLastIndex=No,On.findLastKey=function(e,t){return Lt(e,io(t,3),br)},On.floor=gl,On.forEach=ds,On.forEachRight=As,On.forIn=function(e,t){return null==e?e:Ar(e,io(t,3),ka)},On.forInRight=function(e,t){return null==e?e:mr(e,io(t,3),ka)},On.forOwn=function(e,t){return e&&gr(e,io(t,3))},On.forOwnRight=function(e,t){return e&&br(e,io(t,3))},On.get=_a,On.gt=Os,On.gte=Fs,On.has=function(e,t){return null!=e&&uo(e,t,jr)},On.hasIn=xa,On.head=Ho,On.identity=Za,On.includes=function(e,t,n,r){e=Hs(e)?e:La(e),n=n&&!r?ca(n):0;var i=e.length;return n<0&&(n=An(i+n,0)),ra(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},On.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ca(n);return i<0&&(i=An(r+i,0)),Ft(e,t,i)},On.inRange=function(e,t,r){return t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,n){return e>=mn(t,n)&&e<An(t,n)}(e=ha(e),t,r)},On.invoke=Ta,On.isArguments=Ds,On.isArray=Ns,On.isArrayBuffer=zs,On.isArrayLike=Hs,On.isArrayLikeObject=Us,On.isBoolean=function(e){return!0===e||!1===e||Js(e)&&_r(e)==m},On.isBuffer=Gs,On.isDate=Vs,On.isElement=function(e){return Js(e)&&1===e.nodeType&&!ea(e)},On.isEmpty=function(e){if(null==e)return!0;if(Hs(e)&&(Ns(e)||"string"==typeof e||"function"==typeof e.splice||Gs(e)||oa(e)||Ds(e)))return!e.length;var t=co(e);if(t==y||t==T)return!e.size;if(vo(e))return!qr(e).length;for(var n in e)if(Me.call(e,n))return!1;return!0},On.isEqual=function(e,t){return Sr(e,t)},On.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Sr(e,t,n,r):!!i},On.isError=Ws,On.isFinite=function(e){return"number"==typeof e&&Rt(e)},On.isFunction=Qs,On.isInteger=Ks,On.isLength=Xs,On.isMap=$s,On.isMatch=function(e,t){return e===t||Ir(e,t,so(t))},On.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Ir(e,t,so(t),r)},On.isNaN=function(e){return Zs(e)&&e!=+e},On.isNative=function(e){if(wo(e))throw new ve("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Pr(e)},On.isNil=function(e){return null==e},On.isNull=function(e){return null===e},On.isNumber=Zs,On.isObject=Ys,On.isObjectLike=Js,On.isPlainObject=ea,On.isRegExp=ta,On.isSafeInteger=function(e){return Ks(e)&&e>=-9007199254740991&&e<=c},On.isSet=na,On.isString=ra,On.isSymbol=ia,On.isTypedArray=oa,On.isUndefined=function(e){return e===n},On.isWeakMap=function(e){return Js(e)&&co(e)==S},On.isWeakSet=function(e){return Js(e)&&"[object WeakSet]"==_r(e)},On.join=function(e,t){return null==e?"":Ut.call(e,t)},On.kebabCase=Na,On.last=Wo,On.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ca(r))<0?An(i+o,0):mn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ot(e,Nt,o,!0)},On.lowerCase=za,On.lowerFirst=Ha,On.lt=sa,On.lte=aa,On.max=function(e){return e&&e.length?hr(e,Za,xr):n},On.maxBy=function(e,t){return e&&e.length?hr(e,io(t,2),xr):n},On.mean=function(e){return zt(e,Za)},On.meanBy=function(e,t){return zt(e,io(t,2))},On.min=function(e){return e&&e.length?hr(e,Za,Br):n},On.minBy=function(e,t){return e&&e.length?hr(e,io(t,2),Br):n},On.stubArray=ul,On.stubFalse=hl,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=bl,On.nth=function(e,t){return e&&e.length?Dr(e,ca(t)):n},On.noConflict=function(){return ct._===this&&(ct._=Oe),this},On.noop=il,On.now=_s,On.pad=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ni(ht(i),n)+e+Ni(ut(i),n)},On.padEnd=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;return t&&r<t?e+Ni(t-r,n):e},On.padStart=function(e,t,n){e=da(e);var r=(t=ca(t))?fn(e):0;return t&&r<t?Ni(t-r,n)+e:e},On.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(da(e).replace(ne,""),t||0)},On.random=function(e,t,r){if(r&&"boolean"!=typeof r&&mo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=fa(e),t===n?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=wn();return mn(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gr(e,t)},On.reduce=function(e,t,n){var r=Ns(e)?Mt:Gt,i=arguments.length<3;return r(e,io(t,4),n,i,fr)},On.reduceRight=function(e,t,n){var r=Ns(e)?qt:Gt,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},On.repeat=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:ca(t),Vr(da(e),t)},On.replace=function(){var e=arguments,t=da(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.result=function(e,t,r){var i=-1,o=(t=Ai(t,e)).length;for(o||(o=1,e=n);++i<o;){var s=null==e?n:e[qo(t[i])];s===n&&(i=o,s=r),e=Qs(s)?s.call(e):s}return e},On.round=wl,On.runInContext=e,On.sample=function(e){return(Ns(e)?Kn:Qr)(e)},On.size=function(e){if(null==e)return 0;if(Hs(e))return ra(e)?fn(e):e.length;var t=co(e);return t==y||t==T?e.size:qr(e).length},On.snakeCase=Ua,On.some=function(e,t,r){var i=Ns(e)?Bt:ei;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},On.sortedIndex=function(e,t){return ti(e,t)},On.sortedIndexBy=function(e,t,n){return ni(e,t,io(n,2))},On.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ti(e,t);if(r<n&&Ls(e[r],t))return r}return-1},On.sortedLastIndex=function(e,t){return ti(e,t,!0)},On.sortedLastIndexBy=function(e,t,n){return ni(e,t,io(n,2),!0)},On.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ti(e,t,!0)-1;if(Ls(e[n],t))return n}return-1},On.startCase=Ga,On.startsWith=function(e,t,n){return e=da(e),n=null==n?0:ir(ca(n),0,e.length),t=oi(t),e.slice(n,n+t.length)==t},On.subtract=vl,On.sum=function(e){return e&&e.length?Vt(e,Za):0},On.sumBy=function(e,t){return e&&e.length?Vt(e,io(t,2)):0},On.template=function(e,t,r){var i=On.templateSettings;r&&mo(e,t,r)&&(t=n),e=da(e),t=ga({},t,i,Ki);var o,s,a=ga({},t.imports,i.imports,Ki),l=Ca(a),f=Xt(a,l),c=0,u=t.interpolate||be,h="__p += '",p=je((t.escape||be).source+"|"+u.source+"|"+(u===Y?ce:be).source+"|"+(t.evaluate||be).source+"|$","g"),d="//# sourceURL="+(Me.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,function(t,n,r,i,a,l){return r||(r=i),h+=e.slice(c,l).replace(we,tn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t}),h+="';\n";var A=Me.call(t,"variable")&&t.variable;if(A){if(le.test(A))throw new ve("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(z,""):h).replace(H,"$1").replace(U,"$1;"),h="function("+(A||"obj")+") {\n"+(A?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ka(function(){return ye(l,d+"return "+h).apply(n,f)});if(m.source=h,Ws(m))throw m;return m},On.times=function(e,t){if((e=ca(e))<1||e>c)return[];var n=h,r=mn(e,h);t=io(t),e-=h;for(var i=Wt(r,t);++n<e;)t(n);return i},On.toFinite=fa,On.toInteger=ca,On.toLength=ua,On.toLower=function(e){return da(e).toLowerCase()},On.toNumber=ha,On.toSafeInteger=function(e){return e?ir(ca(e),-9007199254740991,c):0===e?e:0},On.toString=da,On.toUpper=function(e){return da(e).toUpperCase()},On.trim=function(e,t,r){if((e=da(e))&&(r||t===n))return Qt(e);if(!e||!(t=oi(t)))return e;var i=cn(e),o=cn(t);return gi(i,Jt(i,o),$t(i,o)+1).join("")},On.trimEnd=function(e,t,r){if((e=da(e))&&(r||t===n))return e.slice(0,un(e)+1);if(!e||!(t=oi(t)))return e;var i=cn(e);return gi(i,0,$t(i,cn(t))+1).join("")},On.trimStart=function(e,t,r){if((e=da(e))&&(r||t===n))return e.replace(ne,"");if(!e||!(t=oi(t)))return e;var i=cn(e);return gi(i,Jt(i,cn(t))).join("")},On.truncate=function(e,t){var r=30,i="...";if(Ys(t)){var o="separator"in t?t.separator:o;r="length"in t?ca(t.length):r,i="omission"in t?oi(t.omission):i}var s=(e=da(e)).length;if(nn(e)){var a=cn(e);s=a.length}if(r>=s)return e;var l=r-fn(i);if(l<1)return i;var f=a?gi(a,0,l).join(""):e.slice(0,l);if(o===n)return f+i;if(a&&(l+=f.length-l),ta(o)){if(e.slice(l).search(o)){var c,u=f;for(o.global||(o=je(o.source,da(ue.exec(o))+"g")),o.lastIndex=0;c=o.exec(u);)var h=c.index;f=f.slice(0,h===n?l:h)}}else if(e.indexOf(oi(o),l)!=l){var p=f.lastIndexOf(o);p>-1&&(f=f.slice(0,p))}return f+i},On.unescape=function(e){return(e=da(e))&&W.test(e)?e.replace(G,hn):e},On.uniqueId=function(e){var t=++qe;return da(e)+t},On.upperCase=Va,On.upperFirst=Wa,On.each=ds,On.eachRight=As,On.first=Ho,rl(On,(pl={},gr(On,function(e,t){Me.call(On.prototype,t)||(pl[t]=e)}),pl),{chain:!1}),On.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){On[e].placeholder=On}),jt(["drop","take"],function(e,t){zn.prototype[e]=function(r){r=r===n?1:An(ca(r),0);var i=this.__filtered__&&!t?new zn(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,h),type:e+(i.__dir__<0?"Right":"")}),i},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),jt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),jt(["head","last"],function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}}),jt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}}),zn.prototype.compact=function(){return this.filter(Za)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Wr(function(e,t){return"function"==typeof e?new zn(this):this.map(function(n){return Cr(n,e,t)})}),zn.prototype.reject=function(e){return this.filter(Ps(io(e)))},zn.prototype.slice=function(e,t){e=ca(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ca(t))<0?r.dropRight(-t):r.take(t-e)),r)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(h)},gr(zn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=On[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(On.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof zn,f=a[0],c=l||Ns(t),u=function(e){var t=o.apply(On,Pt([e],a));return i&&h?t[0]:t};c&&r&&"function"==typeof f&&1!=f.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=s&&!h,A=l&&!p;if(!s&&c){t=A?t:new zn(this);var m=e.apply(t,a);return m.__actions__.push({func:fs,args:[u],thisArg:n}),new Nn(m,h)}return d&&A?e.apply(this,a):(m=this.thru(u),d?i?m.value()[0]:m.value():m)})}),jt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);On.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ns(i)?i:[],e)}return this[n](function(n){return t.apply(Ns(n)?n:[],e)})}}),gr(zn.prototype,function(e,t){var n=On[t];if(n){var r=n.name+"";Me.call(kn,r)||(kn[r]=[]),kn[r].push({name:t,func:n})}}),kn[Li(n,2).name]=[{name:"wrapper",func:n}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ns(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=mn(t,e+s);break;case"takeRight":e=An(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,f=r?a:s-1,c=this.__iteratees__,u=c.length,h=0,p=mn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return ci(e,this.__actions__);var d=[];e:for(;l--&&h<p;){for(var A=-1,m=e[f+=t];++A<u;){var g=c[A],b=g.iteratee,w=g.type,v=b(m);if(2==w)m=v;else if(!v){if(1==w)continue e;break e}}d[h++]=m}return d},On.prototype.at=cs,On.prototype.chain=function(){return ls(this)},On.prototype.commit=function(){return new Nn(this.value(),this.__chain__)},On.prototype.next=function(){this.__values__===n&&(this.__values__=la(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},On.prototype.plant=function(e){for(var t,r=this;r instanceof Dn;){var i=Ro(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},On.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Yo],thisArg:n}),new Nn(t,this.__chain__)}return this.thru(Yo)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return ci(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Ke&&(On.prototype[Ke]=function(){return this}),On}();ht?((ht.exports=pn)._=pn,ut._=pn):ct._=pn}).call(i)}(wJ,bJ);var vJ=6371008.8,yJ={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:vJ,metres:vJ,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999};function _J(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function xJ(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!TJ(e[0])||!TJ(e[1]))throw new Error("coordinates must contain numbers");return _J({type:"Point",coordinates:e},t,n)}function jJ(e){return e%(2*Math.PI)*180/Math.PI}function EJ(e){return e%360*Math.PI/180}function TJ(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function CJ(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function kJ(e,t,n={}){var r=CJ(e),i=CJ(t),o=EJ(i[1]-r[1]),s=EJ(i[0]-r[0]),a=EJ(r[1]),l=EJ(i[1]),f=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return function(e,t="kilometers"){const n=yJ[t];if(!n)throw new Error(t+" units is invalid");return e*n}(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),n.units)}var SJ=Object.defineProperty,IJ=Object.defineProperties,PJ=Object.getOwnPropertyDescriptors,MJ=Object.getOwnPropertySymbols,qJ=Object.prototype.hasOwnProperty,BJ=Object.prototype.propertyIsEnumerable,RJ=(e,t,n)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LJ=(e,t)=>{for(var n in t||(t={}))qJ.call(t,n)&&RJ(e,n,t[n]);if(MJ)for(var n of MJ(t))BJ.call(t,n)&&RJ(e,n,t[n]);return e},OJ=(e,t)=>IJ(e,PJ(t));function FJ(e,t){const[n,r,i]=e,[o,s,a]=t;return n*o+r*s+i*a}function DJ(e,t){const[n,r,i]=e,[o,s,a]=t;return[r*a-i*s,i*o-n*a,n*s-r*o]}function NJ(e){const t=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2))}(e);return[e[0]/t,e[1]/t,e[2]/t]}function zJ(e){const t=EJ(e[1]),n=EJ(e[0]);return[Math.cos(t)*Math.cos(n),Math.cos(t)*Math.sin(n),Math.sin(t)]}function HJ(e){const[t,n,r]=e,i=Math.min(Math.max(r,-1),1),o=jJ(Math.asin(i));return[jJ(Math.atan2(n,t)),o]}function UJ(e,t,n){const r=zJ(e),i=zJ(t),o=zJ(n),s=DJ(r,i);if(0===s[0]&&0===s[1]&&0===s[2])return FJ(r,i)>0?[[...t],!0]:[[...n],!1];const a=DJ(s,o);if(0===a[0]&&0===a[1]&&0===a[2])return[[...t],!0];const l=NJ(DJ(a,s)),f=[-l[0],-l[1],-l[2]],c=FJ(o,l)>FJ(o,f)?l:f,u=NJ(s),h=FJ(DJ(r,c),u),p=FJ(DJ(c,i),u);return h>=0&&p>=0?[HJ(c),!1]:FJ(r,o)>FJ(i,o)?[[...e],!1]:[[...t],!0]}var GJ=function(e,t,n={}){if(!e||!t)throw new Error("lines and inputPoint are required arguments");const r=CJ(t);let i=xJ([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,s=0,a=-1;return l=function(e,l,f){a!==f&&(a=f,s=0);const c=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),u=c.length-2;for(let e=0;e<c.length-1;e++){const a=xJ(c[e]),l=CJ(a),h=xJ(c[e+1]),p=CJ(h),d=kJ(a,h,n);let A,m;p[0]===r[0]&&p[1]===r[1]?[A,m]=[p,!0]:l[0]===r[0]&&l[1]===r[1]?[A,m]=[l,!1]:[A,m]=UJ(l,p,r);const g=kJ(t,A,n);if(g<i.properties.pointDistance){const t=kJ(a,A,n);i=xJ(A,{lineStringIndex:f,segmentIndex:m&&e+1<=u?e+1:e,totalDistance:o+t,lineDistance:s+t,segmentDistance:t,pointDistance:g,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),i.properties=OJ(LJ({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}o+=d,s+=d}},function(e,t){var n,r,i,o,s,a,l,f,c,u,h=0,p="FeatureCollection"===e.type,d="Feature"===e.type,A=p?e.features.length:1;for(n=0;n<A;n++){for(a=p?e.features[n].geometry:d?e.geometry:e,f=p?e.features[n].properties:d?e.properties:{},c=p?e.features[n].bbox:d?e.bbox:void 0,u=p?e.features[n].id:d?e.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,f,c,u))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],h,f,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,f,c,u))return!1;h++}}(e,function(e,t,n,r,i){var o,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==l(_J(e,n,{bbox:r,id:i}),t,0)&&void 0}switch(s){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}for(var a=0;a<e.coordinates.length;a++){var f=e.coordinates[a];if(!1===l(_J({type:o,coordinates:f},n),t,a))return!1}}),i;var l};function VJ(e,t,n){if(null!==e)for(var r,i,o,s,a,l,f,c,u=0,h=0,p=e.type,d="FeatureCollection"===p,A="Feature"===p,m=d?e.features.length:1,g=0;g<m;g++){a=(c=!!(f=d?e.features[g].geometry:A?e.geometry:e)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var b=0;b<a;b++){var w=0,v=0;if(null!==(s=c?f.geometries[b]:f)){l=s.coordinates;var y=s.type;switch(u=!n||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":if(!1===t(l,h,g,w,v))return!1;h++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,g,w,v))return!1;h++,"MultiPoint"===y&&w++}"LineString"===y&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-u;i++){if(!1===t(l[r][i],h,g,w,v))return!1;h++}"MultiLineString"===y&&w++,"Polygon"===y&&v++}"Polygon"===y&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(v=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-u;o++){if(!1===t(l[r][i][o],h,g,w,v))return!1;h++}v++}w++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===VJ(s.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function WJ(e){const t={type:"Feature"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=QJ(e.properties),null==e.geometry?t.geometry=null:t.geometry=KJ(e.geometry),t}function QJ(e){const t={};return e?(Object.keys(e).forEach(n=>{const r=e[n];"object"==typeof r?null===r?t[n]=null:Array.isArray(r)?t[n]=r.map(e=>e):t[n]=QJ(r):t[n]=r}),t):t}function KJ(e){const t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map(e=>KJ(e)),t):(t.coordinates=XJ(e.coordinates),t)}function XJ(e){const t=e;return"object"!=typeof t[0]?t.slice():t.map(e=>XJ(e))}var YJ=6371008.8,JJ={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*YJ,kilometers:6371.0088,kilometres:6371.0088,meters:YJ,metres:YJ,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:YJ/1852,radians:1,yards:6967335.223679999};function $J(e){return e%360*Math.PI/180}function ZJ(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function e$(e,t,n,r={}){const i=t<0;let o=function(e,t="kilometers",n="kilometers"){if(!(e>=0))throw new Error("length must be a positive number");return function(e,t="kilometers"){const n=JJ[t];if(!n)throw new Error(t+" units is invalid");return e*n}(function(e,t="kilometers"){const n=JJ[t];if(!n)throw new Error(t+" units is invalid");return e/n}(e,t),n)}(Math.abs(t),r.units,"meters");i&&(o=-Math.abs(o));const s=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),a=function(e,t,n,r){const i=t/(r=void 0===r?YJ:Number(r)),o=e[0]*Math.PI/180,s=$J(e[1]),a=$J(n),l=i*Math.cos(a);let f=s+l;Math.abs(f)>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f);const c=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),u=Math.abs(c)>1e-11?l/c:Math.cos(s);return[(180*(o+i*Math.sin(a)/u)/Math.PI+540)%360-180,180*f/Math.PI]}(s,o,n);return a[0]+=a[0]-s[0]>180?-360:s[0]-a[0]>180?360:0,function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ZJ(e[0])||!ZJ(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}(a,r.properties)}var t$=function(e,t,n,r){if(null===(i=r=r||{})||"object"!=typeof i||Array.isArray(i))throw new Error("options is invalid");var i,o=r.units,s=r.zTranslation,a=r.mutate;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");if(s&&"number"!=typeof s&&isNaN(s))throw new Error("zTranslation is not a number");if(s=void 0!==s?s:0,0===t&&0===s)return e;if(null==n||isNaN(n))throw new Error("direction is required");return t<0&&(t=-t,n+=180),!1!==a&&void 0!==a||(e=function(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return WJ(e);case"FeatureCollection":return function(e){const t={type:"FeatureCollection"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(e=>WJ(e)),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return KJ(e);default:throw new Error("unknown GeoJSON type")}}(e)),VJ(e,function(e){var r=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e$(e,t,n,{units:o}));e[0]=r[0],e[1]=r[1],s&&3===e.length&&(e[2]+=s)}),e};const n$="meters",r$=1.42;var i$,o$,s$,a$;function l$(e){if(!e)throw new Error("geojson is required");var t=[];return S(e,function(e){!function(e,t){var n=[],r=e.geometry;if(null!==r){switch(r.type){case"Polygon":n=_(r);break;case"LineString":n=[_(r)]}n.forEach(function(n){var r=function(e,t){var n=[];return e.reduce(function(e,r){var i,o,s,a,l,f,c=A([e,r],t);return c.bbox=(o=r,s=(i=e)[0],a=i[1],[s<(l=o[0])?s:l,a<(f=o[1])?a:f,s>l?s:l,a>f?a:f]),n.push(c),r}),n}(n,e.properties);r.forEach(function(e){e.id=t.length,t.push(e)})})}}(e,t)}),m(t)}!function(e){e[e.TwoWay=2]="TwoWay",e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(i$||(i$={})),function(e){e.Transit="transit",e.Public="public"}(o$||(o$={})),function(e){e.Edge="what.route_edge",e.Network="what.route_network",e.PortalNetwork="what.link"}(s$||(s$={})),function(e){e.escalator="escalator",e.lift="lift",e.liftAnchor="liftAnchor",e.bus="airport_transfer",e.skytrain="skytrain",e.entrance="entrance",e.exit="exit",e.staircase="staircase",e.unknown=""}(a$||(a$={}));var f$={},c$={get exports(){return f$},set exports(e){f$=e}},u$={},h$={get exports(){return u$},set exports(e){u$=e}};h$.exports=function(){function e(e,r,i,o,s){!function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,f=Math.log(a),c=.5*Math.exp(2*f/3),u=.5*Math.sqrt(f*c*(a-c)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*c/a+u)),Math.min(o,Math.floor(r+(a-l)*c/a+u)),s)}var h=n[r],p=i,d=o;for(t(n,i,r),s(n[o],h)>0&&t(n,i,o);p<d;){for(t(n,p,d),p++,d--;s(n[p],h)<0;)p++;for(;s(n[d],h)>0;)d--}0===s(n[i],h)?t(n,i,d):t(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,r,i||0,o||e.length-1,s||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:e>t?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function o(e,t){s(e,0,e.children.length,t,e)}function s(e,t,n,r,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=t;o<n;o++){var s=e.children[o];a(i,e.leaf?r(s):s)}return i}function a(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function l(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function h(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function d(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(t,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;e(t,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!p(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o<t.children.length;o++){var s=t.children[o],a=t.leaf?r(s):s;p(e,a)&&(t.leaf?n.push(s):h(e,a)?this._all(s,n):i.push(s))}t=i.pop()}return n},r.prototype.collides=function(e){var t=this.data;if(!p(e,t))return!1;for(var n=[];t;){for(var r=0;r<t.children.length;r++){var i=t.children[r],o=t.leaf?this.toBBox(i):i;if(p(e,o)){if(t.leaf||h(e,o))return!0;n.push(i)}}t=n.pop()}return!1},r.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(e,t){if(!e)return this;for(var n,r,o,s=this.data,a=this.toBBox(e),l=[],f=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=f.pop(),o=!0),s.leaf){var c=i(e,s.children,t);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!h(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),f.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(e){return e},r.prototype.compareMinX=function(e,t){return e.minX-t.minX},r.prototype.compareMinY=function(e,t){return e.minY-t.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(e){return this.data=e,this},r.prototype._all=function(e,t){for(var n=[];e;)e.leaf?t.push.apply(t,e.children):n.push.apply(n,e.children),e=n.pop();return t},r.prototype._build=function(e,t,n,r){var i,s=n-t+1,a=this._maxEntries;if(s<=a)return o(i=d(e.slice(t,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=d([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),f=l*Math.ceil(Math.sqrt(a));A(e,t,n,f,this.compareMinX);for(var c=t;c<=n;c+=f){var u=Math.min(c+f-1,n);A(e,c,u,l,this.compareMinY);for(var h=c;h<=u;h+=l){var p=Math.min(h+l-1,u);i.children.push(this._build(e,h,p,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<t.children.length;a++){var l=t.children[a],f=c(l),u=(h=e,p=l,(Math.max(p.maxX,h.maxX)-Math.min(p.minX,h.minX))*(Math.max(p.maxY,h.maxY)-Math.min(p.minY,h.minY))-f);u<o?(o=u,i=f<i?f:i,s=l):u===o&&f<i&&(i=f,s=l)}t=s||t.children[0]}var h,p;return t},r.prototype._insert=function(e,t,n){var r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),a(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(e,t){this.data=d([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,l,f,u,h=1/0,p=1/0,d=t;d<=n-t;d++){var A=s(e,0,d,this.toBBox),m=s(e,d,n,this.toBBox),g=(i=A,o=m,void 0,void 0,void 0,void 0,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),f=Math.min(i.maxX,o.maxX),u=Math.min(i.maxY,o.maxY),Math.max(0,f-a)*Math.max(0,u-l)),b=c(A)+c(m);g<h?(h=g,r=d,p=b<p?b:p):g===h&&b<p&&(p=b,r=d)}return r||n-t},r.prototype._chooseSplitAxis=function(e,t,n){var r=e.leaf?this.compareMinX:l,i=e.leaf?this.compareMinY:f;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)},r.prototype._allDistMargin=function(e,t,n,r){e.children.sort(r);for(var i=this.toBBox,o=s(e,0,t,i),l=s(e,n-t,n,i),f=u(o)+u(l),c=t;c<n-t;c++){var h=e.children[c];a(o,e.leaf?i(h):h),f+=u(o)}for(var p=n-t-1;p>=t;p--){var d=e.children[p];a(l,e.leaf?i(d):d),f+=u(l)}return f},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)a(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():o(e[t],this.toBBox)},r}();var p$={};!function(e){function t(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function n(e,n,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(e[0])||!h(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function r(e,n,r){void 0===r&&(r={});for(var i=0,o=e;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:e},n,r)}function i(e,n,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:e},n,r)}function o(e,t){void 0===t&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function s(e,n,r){return void 0===r&&(r={}),t({type:"MultiLineString",coordinates:e},n,r)}function a(e,n,r){return void 0===r&&(r={}),t({type:"MultiPoint",coordinates:e},n,r)}function l(e,n,r){return void 0===r&&(r={}),t({type:"MultiPolygon",coordinates:e},n,r)}function f(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t*r}function c(t,n){void 0===n&&(n="kilometers");var r=e.factors[n];if(!r)throw new Error(n+" units is invalid");return t/r}function u(e){return e%(2*Math.PI)*180/Math.PI}function h(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=t,e.geometry=function(e,t,o){switch(e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return r(t).geometry;case"MultiPoint":return a(t).geometry;case"MultiLineString":return s(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},e.point=n,e.points=function(e,t,r){return void 0===r&&(r={}),o(e.map(function(e){return n(e,t)}),r)},e.polygon=r,e.polygons=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return r(e,t)}),n)},e.lineString=i,e.lineStrings=function(e,t,n){return void 0===n&&(n={}),o(e.map(function(e){return i(e,t)}),n)},e.featureCollection=o,e.multiLineString=s,e.multiPoint=a,e.multiPolygon=l,e.geometryCollection=function(e,n,r){return void 0===r&&(r={}),t({type:"GeometryCollection",geometries:e},n,r)},e.round=function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,t||0);return Math.round(e*n)/n},e.radiansToLength=f,e.lengthToRadians=c,e.lengthToDegrees=function(e,t){return u(c(e,t))},e.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},e.radiansToDegrees=u,e.degreesToRadians=function(e){return e%360*Math.PI/180},e.convertLength=function(e,t,n){if(void 0===t&&(t="kilometers"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(c(e,t),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=h,e.isObject=function(e){return!!e&&e.constructor===Object},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!h(e))throw new Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}(p$);var d$={};Object.defineProperty(d$,"__esModule",{value:!0});var A$=p$;function m$(e,t,n){if(null!==e)for(var r,i,o,s,a,l,f,c,u=0,h=0,p=e.type,d="FeatureCollection"===p,A="Feature"===p,m=d?e.features.length:1,g=0;g<m;g++){a=(c=!!(f=d?e.features[g].geometry:A?e.geometry:e)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var b=0;b<a;b++){var w=0,v=0;if(null!==(s=c?f.geometries[b]:f)){l=s.coordinates;var y=s.type;switch(u=!n||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":if(!1===t(l,h,g,w,v))return!1;h++,w++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,g,w,v))return!1;h++,"MultiPoint"===y&&w++}"LineString"===y&&w++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-u;i++){if(!1===t(l[r][i],h,g,w,v))return!1;h++}"MultiLineString"===y&&w++,"Polygon"===y&&v++}"Polygon"===y&&w++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(v=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-u;o++){if(!1===t(l[r][i][o],h,g,w,v))return!1;h++}v++}w++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===m$(s.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g$(e,t){var n;switch(e.type){case"FeatureCollection":for(n=0;n<e.features.length&&!1!==t(e.features[n].properties,n);n++);break;case"Feature":t(e.properties,0)}}function b$(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var n=0;n<e.features.length&&!1!==t(e.features[n],n);n++);}function w$(e,t){var n,r,i,o,s,a,l,f,c,u,h=0,p="FeatureCollection"===e.type,d="Feature"===e.type,A=p?e.features.length:1;for(n=0;n<A;n++){for(a=p?e.features[n].geometry:d?e.geometry:e,f=p?e.features[n].properties:d?e.properties:{},c=p?e.features[n].bbox:d?e.bbox:void 0,u=p?e.features[n].id:d?e.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(o,h,f,c,u))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===t(o.geometries[r],h,f,c,u))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,f,c,u))return!1;h++}}function v$(e,t){w$(e,function(e,n,r,i,o){var s,a=null===e?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==t(A$.feature(e,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<e.coordinates.length;l++){var f={type:s,coordinates:e.coordinates[l]};if(!1===t(A$.feature(f,r),n,l))return!1}})}function y$(e,t){v$(e,function(e,n,r){var i=0;if(e.geometry){var o=e.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,f=0;return!1!==m$(e,function(o,c,u,h,p){if(void 0===s||n>a||h>l||p>f)return s=o,a=n,l=h,f=p,void(i=0);var d=A$.lineString([s,o],e.properties);if(!1===t(d,n,r,p,i))return!1;i++,s=o})&&void 0}}})}function _$(e,t){if(!e)throw new Error("geojson is required");v$(e,function(e,n,r){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===t(A$.lineString(o[s],e.properties),n,r,s))return!1}}})}d$.coordAll=function(e){var t=[];return m$(e,function(e){t.push(e)}),t},d$.coordEach=m$,d$.coordReduce=function(e,t,n,r){var i=n;return m$(e,function(e,r,o,s,a){i=0===r&&void 0===n?e:t(i,e,r,o,s,a)},r),i},d$.featureEach=b$,d$.featureReduce=function(e,t,n){var r=n;return b$(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},d$.findPoint=function(e,t){if(t=t||{},!A$.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.coordIndex||0,a=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":a=a||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return A$.point(l,a,t);case"MultiPoint":return i<0&&(i=l.length+i),A$.point(l[i],a,t);case"LineString":return s<0&&(s=l.length+s),A$.point(l[s],a,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),A$.point(l[o][s],a,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s),A$.point(l[i][s],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s),A$.point(l[i][o][s],a,t)}throw new Error("geojson is invalid")},d$.findSegment=function(e,t){if(t=t||{},!A$.isObject(t))throw new Error("options is invalid");var n,r=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.segmentIndex||0,a=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),a=a||e.features[r].properties,n=e.features[r].geometry;break;case"Feature":a=a||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),A$.lineString([l[s],l[s+1]],a,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),A$.lineString([l[o][s],l[o][s+1]],a,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s-1),A$.lineString([l[i][s],l[i][s+1]],a,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s-1),A$.lineString([l[i][o][s],l[i][o][s+1]],a,t)}throw new Error("geojson is invalid")},d$.flattenEach=v$,d$.flattenReduce=function(e,t,n){var r=n;return v$(e,function(e,i,o){r=0===i&&0===o&&void 0===n?e:t(r,e,i,o)}),r},d$.geomEach=w$,d$.geomReduce=function(e,t,n){var r=n;return w$(e,function(e,i,o,s,a){r=0===i&&void 0===n?e:t(r,e,i,o,s,a)}),r},d$.lineEach=_$,d$.lineReduce=function(e,t,n){var r=n;return _$(e,function(e,i,o,s){r=0===i&&void 0===n?e:t(r,e,i,o,s)}),r},d$.propEach=g$,d$.propReduce=function(e,t,n){var r=n;return g$(e,function(e,i){r=0===i&&void 0===n?e:t(r,e,i)}),r},d$.segmentEach=y$,d$.segmentReduce=function(e,t,n){var r=n,i=!1;return y$(e,function(e,o,s,a,l){r=!1===i&&void 0===n?e:t(r,e,o,s,a,l),i=!0}),r};var x$={};Object.defineProperty(x$,"__esModule",{value:!0});var j$=d$;function E$(e){var t=[1/0,1/0,-1/0,-1/0];return j$.coordEach(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}E$.default=E$,x$.default=E$;var T$=u$,C$=p$,k$=d$,S$=x$.default,I$=k$.featureEach;k$.coordEach;var P$=C$.featureCollection;function M$(e){var t=new T$(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:S$(e),T$.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:S$(e),t.push(e)}):I$(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:S$(e),t.push(e)}),T$.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:S$(e),T$.prototype.remove.call(this,e,t)},t.clear=function(){return T$.prototype.clear.call(this)},t.search=function(e){var t=T$.prototype.search.call(this,this.toBBox(e));return P$(t)},t.collides=function(e){return T$.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=T$.prototype.all.call(this);return P$(e)},t.toJSON=function(){return T$.prototype.toJSON.call(this)},t.fromJSON=function(e){return T$.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=S$(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=S$(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}function q$(e,t){var n={},r=[];if("LineString"===e.type&&(e=h(e)),"LineString"===t.type&&(t=h(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=B$(e,t);return i&&r.push(i),m(r)}var o=f$();return o.load(l$(t)),C(l$(e),function(e){C(o.search(e),function(t){var i=B$(e,t);if(i){var o=_(i).join(",");n[o]||(n[o]=!0,r.push(i))}})}),m(r)}function B$(e,t){var n=_(e),r=_(t);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=r[0][0],f=r[0][1],c=r[1][0],u=r[1][1],h=(u-f)*(s-i)-(c-l)*(a-o);if(0===h)return null;var d=((c-l)*(o-f)-(u-f)*(i-l))/h,A=((s-i)*(o-f)-(a-o)*(i-l))/h;return d>=0&&d<=1&&A>=0&&A<=1?p([i+d*(s-i),o+d*(a-o)]):null}function R$(e,t){void 0===t&&(t={});var n=x(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),n.type){case"Polygon":return function(e,t){return void 0===t&&(t={}),L$(x(e).coordinates,t.properties?t.properties:"Feature"===e.type?e.properties:{})}(n,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var n=x(e).coordinates,r=t.properties?t.properties:"Feature"===e.type?e.properties:{},i=[];return n.forEach(function(e){i.push(L$(e,r))}),m(i)}(n,t);default:throw new Error("invalid poly")}}function L$(e,t){return e.length>1?function(e,t,n){return void 0===n&&(n={}),h({type:"MultiLineString",coordinates:e},t,n)}(e,t):A(e[0],t)}function O$(e,t){var n=!0;return S(e,function(e){S(t,function(t){if(!1===n)return!1;n=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return n=e.coordinates,r=t.coordinates,!(n[0]===r[0]&&n[1]===r[1]);case"LineString":return!F$(t,e);case"Polygon":return!io(e,t)}break;case"LineString":switch(t.type){case"Point":return!F$(e,t);case"LineString":return!(q$(e,t).features.length>0);case"Polygon":return!D$(t,e)}break;case"Polygon":switch(t.type){case"Point":return!io(t,e);case"LineString":return!D$(e,t);case"Polygon":return!function(e,t){for(var n=0,r=e.coordinates[0];n<r.length;n++)if(io(r[n],t))return!0;for(var i=0,o=t.coordinates[0];i<o.length;i++)if(io(o[i],e))return!0;return q$(R$(e),R$(t)).features.length>0}(t,e)}}var n,r;return!1}(e.geometry,t.geometry)})}),n}function F$(e,t){for(var n=0;n<e.coordinates.length-1;n++)if(N$(e.coordinates[n],e.coordinates[n+1],t.coordinates))return!0;return!1}function D$(e,t){for(var n=0,r=t.coordinates;n<r.length;n++)if(io(r[n],e))return!0;return q$(t,R$(e)).features.length>0}function N$(e,t,n){var r=n[0]-e[0],i=n[1]-e[1],o=t[0]-e[0],s=t[1]-e[1];return 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?e[0]<=n[0]&&n[0]<=t[0]:t[0]<=n[0]&&n[0]<=e[0]:s>0?e[1]<=n[1]&&n[1]<=t[1]:t[1]<=n[1]&&n[1]<=e[1])}function z$(e,t,n){void 0===n&&(n={});var r=p([1/0,1/0],{dist:1/0}),i=0;return S(e,function(e){for(var o=_(e),s=0;s<o.length-1;s++){var a=p(o[s]);a.properties.dist=E(t,a,n);var l=p(o[s+1]);l.properties.dist=E(t,l,n);var f=E(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),u=no(a,l),h=ro(t,c,u+90,n),d=ro(t,c,u-90,n),m=q$(A([h.geometry.coordinates,d.geometry.coordinates]),A([a.geometry.coordinates,l.geometry.coordinates])),g=null;m.features.length>0&&((g=m.features[0]).properties.dist=E(t,g,n),g.properties.location=i+E(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=s+1,r.properties.location=i+f),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=f}}),r}function H$(e,t,n){var r=_(n);if("LineString"!==j(n))throw new Error("line must be a LineString");for(var i,o=z$(n,e),s=z$(n,t),a=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],l=i[0].properties.index+1;l<i[1].properties.index+1;l++)a.push(r[l]);return a.push(i[1].geometry.coordinates),A(a,n.properties)}function U$(e,t){if(!new.target)return new U$(e,t);if(Array.isArray(e)||(t=e,e=[]),t=t||{},this.data=e||[],this.length=this.data.length,this.compare=t.compare||V$,this.setNodeId=t.setNodeId||G$,this.length>0)for(var n=this.length>>1;n>=0;n--)this._down(n);if(t.setNodeId)for(n=0;n<this.length;++n)this.setNodeId(this.data[n],n)}function G$(){}function V$(e,t){return e-t}function W$(e){this.node=e,this.parent=null,this.closed=!1,this.open=0,this.distanceToSource=Number.POSITIVE_INFINITY,this.fScore=Number.POSITIVE_INFINITY,this.heapIndex=-1}c$.exports=M$,f$.default=M$,U$.prototype={push:function(e){this.data.push(e),this.setNodeId(e,this.length),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.setNodeId(this.data[0],0),this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},updateItem:function(e){this._down(e),this._up(e)},_up:function(e){for(var t=this.data,n=this.compare,r=this.setNodeId,i=t[e];e>0;){var o=e-1>>1,s=t[o];if(n(i,s)>=0)break;t[e]=s,r(s,e),e=o}t[e]=i,r(i,e)},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e],o=this.setNodeId;e<r;){var s=1+(e<<1),a=s+1,l=t[s];if(a<this.length&&n(t[a],l)<0&&(s=a,l=t[a]),n(l,i)>=0)break;t[e]=l,o(l,e),e=s}t[e]=i,o(i,e)}};const Q$=[];"function"==typeof Object.freeze&&Object.freeze(Q$);const K$={heuristic:function(){return 0},distance:function(){return 1},blocked:function(){return!1},compareFScore:function(e,t){return e.fScore-t.fScore},NO_PATH:Q$,setHeapIndex:function(e,t){e.heapIndex=t},setH1:function(e,t){e.h1=t},setH2:function(e,t){e.h2=t},compareF1Score:function(e,t){return e.f1-t.f1},compareF2Score:function(e,t){return e.f2-t.f2}};var X$=K$.NO_PATH;function Y$(e,t){var n=(t=t||{}).oriented,r=t.blocked;r||(r=K$.blocked);var i=t.heuristic;i||(i=K$.heuristic);var o=t.distance;o||(o=K$.distance);var s=function(){var e=0,t=[];return{createNewState:function(n){var r=t[e];return r?(r.node=n,r.parent=null,r.closed=!1,r.open=0,r.distanceToSource=Number.POSITIVE_INFINITY,r.fScore=Number.POSITIVE_INFINITY,r.heapIndex=-1):(r=new W$(n),t[e]=r),e++,r},reset:function(){e=0}}}();return{find:function(t,a){var l=e.getNode(t);if(!l)throw new Error("fromId is not defined in this graph: "+t);var f=e.getNode(a);if(!f)throw new Error("toId is not defined in this graph: "+a);s.reset();var c,u=new Map,h=new U$({compare:K$.compareFScore,setNodeId:K$.setHeapIndex}),p=s.createNewState(l);for(u.set(t,p),p.fScore=i(l,f),p.distanceToSource=0,h.push(p),p.open=1;h.length>0;){if(J$(c=h.pop(),f))return $$(c);c.closed=!0,e.forEachLinkedNode(c.node.id,d,n)}return X$;function d(e,t){var n=u.get(e.id);if(n||(n=s.createNewState(e),u.set(e.id,n)),!n.closed&&(0===n.open&&(h.push(n),n.open=1),!r(e,c.node,t))){var a=c.distanceToSource+o(e,c.node,t);a>=n.distanceToSource||(n.parent=c,n.distanceToSource=a,n.fScore=a+i(n.node,f),h.updateItem(n.heapIndex))}}}}}function J$(e,t){return e.node===t}function $$(e){for(var t=[e.node],n=e.parent;n;)t.push(n.node),n=n.parent;return t}function Z$(e){if("uniqueLinkId"in(e=e||{})&&(e.multigraph=e.uniqueLinkId),void 0===e.multigraph&&(e.multigraph=!1),"function"!=typeof Map)throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var t,n=new Map,r=new Map,i={},o=0,s=e.multigraph?function(e,t,n){var r=rZ(e,t),o=i.hasOwnProperty(r);if(o||y(e,t)){o||(i[r]=0);var s="@"+ ++i[r];r=rZ(e+s,t+s)}return new nZ(e,t,n,r)}:function(e,t,n){var i=rZ(e,t),o=r.get(i);return o?(o.data=n,o):new nZ(e,t,n,i)},a=[],l=_,f=_,c=_,u=_,h={version:20,addNode:A,addLink:function(e,t,n){c();var i=m(e)||A(e),o=m(t)||A(t),a=s(e,t,n),f=r.has(a.id);return r.set(a.id,a),tZ(i,a),e!==t&&tZ(o,a),l(a,f?"update":"add"),u(),a},removeLink:function(e,t){return void 0!==t&&(e=y(e,t)),v(e)},removeNode:g,getNode:m,getNodeCount:b,getLinkCount:w,getEdgeCount:w,getLinksCount:w,getNodesCount:b,getLinks:function(e){var t=m(e);return t?t.links:null},forEachNode:E,forEachLinkedNode:function(e,t,r){var i=m(e);if(i&&i.links&&"function"==typeof t)return r?function(e,t,r){for(var i=e.values(),o=i.next();!o.done;){var s=o.value;if(s.fromId===t&&r(n.get(s.toId),s))return!0;o=i.next()}}(i.links,e,t):function(e,t,r){for(var i=e.values(),o=i.next();!o.done;){var s=o.value,a=s.fromId===t?s.toId:s.fromId;if(r(n.get(a),s))return!0;o=i.next()}}(i.links,e,t)},forEachLink:function(e){if("function"==typeof e)for(var t=r.values(),n=t.next();!n.done;){if(e(n.value))return!0;n=t.next()}},beginUpdate:c,endUpdate:u,clear:function(){c(),E(function(e){g(e.id)}),u()},hasLink:y,hasNode:m,getLink:y,getLinkById:function(e){return void 0===e?void 0:r.get(e)}};return function(e){!function(e){if(!e)throw new Error("Eventify cannot use falsy object as events subject");const t=["on","fire","off"];for(let n=0;n<t.length;++n)if(e.hasOwnProperty(t[n]))throw new Error("Subject cannot be eventified, since it already has property '"+t[n]+"'")}(e);const t=function(e){let t=Object.create(null);return{on:function(n,r,i){if("function"!=typeof r)throw new Error("callback is expected to be a function");let o=t[n];return o||(o=t[n]=[]),o.push({callback:r,ctx:i}),e},off:function(n,r){if(void 0===n)return t=Object.create(null),e;if(t[n])if("function"!=typeof r)delete t[n];else{const e=t[n];for(let t=0;t<e.length;++t)e[t].callback===r&&e.splice(t,1)}return e},fire:function(n){const r=t[n];if(!r)return e;let i;arguments.length>1&&(i=Array.prototype.slice.call(arguments,1));for(let e=0;e<r.length;++e){const t=r[e];t.callback.apply(t.ctx,i)}return e}}}(e);e.on=t.on,e.off=t.off,e.fire=t.fire}(h),t=h.on,h.on=function(){return h.beginUpdate=c=x,h.endUpdate=u=j,l=p,f=d,h.on=t,t.apply(h,arguments)},h;function p(e,t){a.push({link:e,changeType:t})}function d(e,t){a.push({node:e,changeType:t})}function A(e,t){if(void 0===e)throw new Error("Invalid node identifier");c();var r=m(e);return r?(r.data=t,f(r,"update")):(r=new eZ(e,t),f(r,"add")),n.set(e,r),u(),r}function m(e){return n.get(e)}function g(e){var t=m(e);if(!t)return!1;c();var r=t.links;return r&&(r.forEach(v),t.links=null),n.delete(e),f(t,"remove"),u(),!0}function b(){return n.size}function w(){return r.size}function v(e){if(!e)return!1;if(!r.get(e.id))return!1;c(),r.delete(e.id);var t=m(e.fromId),n=m(e.toId);return t&&t.links.delete(e),n&&n.links.delete(e),l(e,"remove"),u(),!0}function y(e,t){if(void 0!==e&&void 0!==t)return r.get(rZ(e,t))}function _(){}function x(){o+=1}function j(){0==(o-=1)&&a.length>0&&(h.fire("changed",a),a.length=0)}function E(e){if("function"!=typeof e)throw new Error("Function is expected to iterate over graph nodes. You passed "+e);for(var t=n.values(),r=t.next();!r.done;){if(e(r.value))return!0;r=t.next()}}}function eZ(e,t){this.id=e,this.links=null,this.data=t}function tZ(e,t){e.links?e.links.add(t):e.links=new Set([t])}function nZ(e,t,n,r){this.fromId=e,this.toId=t,this.data=n,this.id=r}function rZ(e,t){return e.toString()+"👉 "+t.toString()}function iZ(e,t){void 0===t&&(t={});var n="object"==typeof t?t.mutate:t;if(!e)throw new Error("geojson is required");var r=j(e),i=[];switch(r){case"LineString":i=oZ(e);break;case"MultiLineString":case"Polygon":_(e).forEach(function(e){i.push(oZ(e))});break;case"MultiPolygon":_(e).forEach(function(e){var t=[];e.forEach(function(e){t.push(oZ(e))}),i.push(t)});break;case"Point":return e;case"MultiPoint":var o={};_(e).forEach(function(e){var t=e.join("-");Object.prototype.hasOwnProperty.call(o,t)||(i.push(e),o[t]=!0)});break;default:throw new Error(r+" geometry not supported")}return e.coordinates?!0===n?(e.coordinates=i,e):{type:r,coordinates:i}:!0===n?(e.geometry.coordinates=i,e):h({type:r,coordinates:i},e.properties,{bbox:e.bbox,id:e.id})}function oZ(e){var t=_(e);if(2===t.length&&!sZ(t[0],t[1]))return t;var n=[],r=t.length-1,i=n.length;n.push(t[0]);for(var o=1;o<r;o++){var s=n[n.length-1];t[o][0]===s[0]&&t[o][1]===s[1]||(n.push(t[o]),(i=n.length)>2&&aZ(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1))}if(n.push(t[t.length-1]),i=n.length,sZ(t[0],t[t.length-1])&&i<4)throw new Error("invalid polygon");return aZ(n[i-3],n[i-1],n[i-2])&&n.splice(n.length-2,1),n}function sZ(e,t){return e[0]===t[0]&&e[1]===t[1]}function aZ(e,t,n){var r=n[0],i=n[1],o=e[0],s=e[1],a=t[0],l=t[1],f=a-o,c=l-s;return 0===(r-o)*c-(i-s)*f&&(Math.abs(f)>=Math.abs(c)?f>0?o<=r&&r<=a:a<=r&&r<=o:c>0?s<=i&&i<=l:l<=i&&i<=s)}function lZ(e,t=!0){const n=Aa.getState().data;if(!n.hasOwnProperty(s$.Network))return[];const r=n[s$.Network],i=[];for(let n=0;n<r.length;n++){const o=r[n];o&&o.properties&&o.properties.dimension_where&&(t?o.properties.dimension_where.includes(e)&&i.push(o):o.properties.dimension_where===e&&i.push(o))}return bJ.cloneDeep(i)}function fZ(e,t=!0){return lZ(e,t)}function cZ(e){const t=function(e){const t=Aa.getState().data;if("string"==typeof e){if(!e||!t.hasOwnProperty(s$.Edge)||!t[s$.Edge].edges.hasOwnProperty(e))return;return bJ.cloneDeep(t[s$.Edge].edges[e])}{const n=lZ(e.whereDimension);if(n.length<1)return null;let r,i,o=1/0;n.map(t=>{const n=iZ(t),s=GJ(n,e.sourceCoords),a=E(s.geometry.coordinates,e.sourceCoords);a<o&&(o=a,r=s,i=t)});const s=[A([e.sourceCoords,r.geometry.coordinates],{title:"user_edgeLine",zone:i.properties.zone,wheelchair:1,direction:i$.TwoWay,dimension_where:e.whereDimension})],a={id:"user_position",name:"Custom Position",coords:e.sourceCoords,lines:s,where:e.whereDimension,what:"",zone:i.properties.zone};return t[s$.Edge][a.id]=a,a}}(e);return t}function uZ(e){return function(e){const t=Aa.getState().data;return e&&t.hasOwnProperty("what.service.immigration")&&t["what.service.immigration"].hasOwnProperty(e)?t["what.service.immigration"][e]:[]}(e)}Y$.l2=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},Y$.l1=function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)+Math.abs(r)};const hZ=.001;function pZ(e,t,n=!0){const r=(n,r)=>{const i=iZ(r),o=GJ(i,n);void 0!==o.properties.index&&(t.geometry.coordinates.splice(o.properties.index+1,0,e.geometry.coordinates),t.properties&&(t.properties.modified=1))};if(n){const n=function(e,t){let n=-1;return T(e,(e,r,i,o,s)=>{if(-1===n){const i=p(e);E(t,i,{units:"meters"})<hZ&&(n=r)}}),n}(t,e);-1===n?r(e.geometry.coordinates,t):(t.geometry.coordinates[n]=e.geometry.coordinates,t.properties&&(t.properties.modified=1))}else r(e.geometry.coordinates,t)}function dZ(e,t){const n=f$();n.load(t),e.forEach(e=>{const t=L(e);n.search(t).features.forEach(t=>{const n=t;if(e.properties&&e.properties.dimension_where&&n.properties&&n.properties.dimension_where&&e.properties.dimension_where===n.properties.dimension_where){!function(e,t){"LineString"===j(e)&&T(e,(n,r,i,o,s)=>{const a=p(n),l=iZ(t),f=GJ(l,a,{units:"meters"});if(f&&void 0!==f.properties.dist&&void 0!==f.properties.index){const n=p(t.geometry.coordinates[f.properties.index]);E(a,n,{units:"meters"})<hZ?(f.geometry.coordinates=n.geometry.coordinates,e.geometry.coordinates[r]=f.geometry.coordinates,e.properties&&(e.properties.modified=1)):f.properties.dist<hZ&&(e.geometry.coordinates[r]=f.geometry.coordinates,t.geometry.coordinates.splice(f.properties.index+1,0,f.geometry.coordinates),e.properties&&(e.properties.modified=1))}})}(e,n);const t=q$(e,n);if(t.features.length>0)for(let r=0;r<t.features.length;r+=1){const i=t.features[r];pZ(i,e,!1),pZ(i,n,!1)}}})})}function AZ(e){const t=e.split("."),n=t[t.length-1];return e.replace(".".concat(n),"")}function mZ(e,t){const n=[],r={};for(const i in e)if(e[i].where.includes(t)){const t=e[i];r[i]=t,n.push(...t.lines),t.links.forEach(e=>{n.push(...e.lines)})}return{edgeData:r,lines:n}}function gZ(e,t){const n=[],r={};return t.forEach(i=>{if(i in e&&t.has(e[i].id)){const t=e[i];r[i]=t,n.push(...t.lines),t.links.forEach(e=>{n.push(...e.lines)})}}),{edgeData:r,lines:n}}const bZ=function(){let e,t,n="where.singapore",r=!0,i=!0,o=!1,s={edgeData:{},lines:[]};function a(e,t,n,r,i,o,s=!1){const a=`${t.toString()},${r}`;let l=e.getNode(a);if(void 0===l){const s={mapObjectId:n,coords:t,where:r,what:i,zone:o,zoneUnionVertex:!1};l=e.addNode(a,s)}else s&&(l.data.mapObjectId=n,l.data.zone!==o&&(l.data.zoneUnionVertex=!0),l.data.zone=o);return l}function l(e,t,n,i){const{cost:o,description:s}=i,a=i.isPortal?o/r$:o;(!r||r&&i.wheelChairAccesible)&&e.addLink(t.id,n.id,{weight:a,cost:o,description:s})}function f(e,t){return E(p(e),p(t),{units:"meters"})}function c(e,t){const n=t;if(n){const t=a(e,n.coords,n.id,n.where,n.what,n.zone,!0);for(let t=0;t<n.lines.length;t+=1){const r=n.lines[t],i=_(r);for(let t=0;t<i.length-1;t+=1){const o=a(e,i[t],"vertex",n.where,s$.Edge,r.properties.zone),s=a(e,i[t+1],"vertex",n.where,s$.Edge,r.properties.zone);if(o.id!==s.id){const n=f(i[t],i[t+1]);r.properties.direction!==i$.Forward&&r.properties.direction!==i$.TwoWay||l(e,o,s,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null}),r.properties.direction!==i$.Backward&&r.properties.direction!==i$.TwoWay||l(e,s,o,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null})}}}return t}}function u(e,t){const n=t;if(void 0!==n)return a(e,n.coords,n.id,n.where,n.what,n.zone,!0)}function h(e){return{type:"Feature",geometry:{type:"LineString",coordinates:[e.data.coords]},properties:{dimension_where:e.data.where,zone:e.data.zone,cost:0}}}function d(t,n,r,o){const p=Z$(),d=c(p,t),m=c(p,n);if(d&&m){!function(e,t){for(const n in t){const r=t[n];for(let t=0;t<r.links.length;t+=1){const n=r.links[t];let{cost:i}=n;i=bJ.toInteger(i);const{direction:o,wheelchair:s,description:a}=n,f=u(e,r),h=u(e,n);void 0!==f&&void 0!==h&&f.id!==h.id&&(o!==i$.Forward&&o!==i$.TwoWay||l(e,f,h,{wheelChairAccesible:s,cost:i,description:a,isPortal:!0}),o!==i$.Backward&&o!==i$.TwoWay||l(e,h,f,{wheelChairAccesible:s,cost:i,description:a,isPortal:!0}),c(e,n))}c(e,r)}}(p,r),function(e,t){for(let n=0;n<t.length;n+=1){const r=t[n];if("LineString"===r.geometry.type){const t=_(r);if(r.properties){const n=r.properties.dimension_where,i=s$.Network,{zone:o}=r.properties;for(let s=0;s<t.length-1;s+=1){const c=a(e,t[s],"vertex",n,i,o,!0),u=a(e,t[s+1],"vertex",n,i,o,!0);if(c.id!==u.id){const n=f(t[s],t[s+1]);r.properties.direction!==i$.Forward&&r.properties.direction!==i$.TwoWay||l(e,c,u,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null}),r.properties.direction!==i$.Backward&&r.properties.direction!==i$.TwoWay||l(e,u,c,{wheelChairAccesible:r.properties.wheelchair,cost:n,isPortal:!1,description:null})}}}}}}(p,o);const b=function(t,n,r){return Y$(r,{oriented:!0,distance:(e,t,n)=>n.data.weight,blocked(t,n,r){if(i&&(null==t?void 0:t.data.zone)!==(null==n?void 0:n.data.zone)){const r=AZ(t.data.where),i=AZ(e.where),o=AZ(n.data.where);if(r!==i&&o!==i)return!0}return!1}}).find(t.id,n.id).reverse()}(d,m,p),w=function(e,t,n,r){if(n.length<=1)return{};const i=e,o=t,a=[];let l=n[0].data;const f=[h(n[0])];for(let e=1;e<n.length;e+=1){const t=n[e],i=n[e-1],o=f[f.length-1];if("vertex"!==t.data.mapObjectId||t.data.zoneUnionVertex){let f;if(PZ(i.data.what)&&PZ(t.data.what)){let e;if(i.data.zone,t.data.zone,SZ(i.data.what)){const n=(e,t,n,r=!1)=>{const i=n.data.mapObjectId,o=gZ(e,(new Set).add(i));if(o&&o.edgeData[i]){const e=o.edgeData[i];for(let i=0;i<e.links.length;i+=1){const o=e.links[i];if(o.id===t.data.mapObjectId&&o.pathFeatures&&o.pathFeatures.length>0){const e=o.pathFeatures[0],i=!1===r?n.data.coords:t.data.coords,s=!1===r?t.data.coords:n.data.coords;return A(E(i,e.geometry.coordinates[0])<E(s,e.geometry.coordinates[0])?e.geometry.coordinates:e.geometry.coordinates.slice().reverse())}}}return null};e=n(s.edgeData,t,i,!1),e||(e=n(s.edgeData,i,t,!0))}const n=r.getLink(i.id,t.id),o=n&&n.data.cost?n.data.cost:void 0,c=n&&n.data.description?n.data.description:void 0;f={geojson:g([i.data.coords,t.data.coords],{zone:t.data.zone}),edges:[i.data.mapObjectId,t.data.mapObjectId],startFloor:i.data.where,endFloor:t.data.where,isPortal:!0,portalPath:e,cost:o,description:c},a.push(f),l=t.data}else{const r=e+1<n.length?n[e+1]:void 0;t.data.zoneUnionVertex&&i&&r&&(null==i?void 0:i.data.zone)===(null==r?void 0:r.data.zone)||(f={geojson:o,edges:[l.mapObjectId,t.data.mapObjectId],startFloor:l.where,endFloor:l.where,isPortal:!1,portalPath:void 0,cost:o.properties.cost},a.push(f),l=t.data)}}if(PZ(i.data.what)&&PZ(t.data.what))o.geometry.coordinates.length<2&&f.pop(),f.push(h(t));else{const e=r.getLink(i.id,t.id),n=e&&e.data.cost?e.data.cost:void 0;o.geometry.coordinates.push(t.data.coords),o.properties.cost+=n}if(t.data.zoneUnionVertex){const r=e>0?n[e-1]:void 0,i=e+1<n.length?n[e+1]:void 0;if(r&&i&&(null==r?void 0:r.data.zone)===(null==i?void 0:i.data.zone));else if(i){const e=bJ.cloneDeep(t);e.data.zone=i.data.zone,f.push(h(e))}else f.push(h(t))}}return{startNode:i,endNode:o,routes:a,distance:0}}(t,n,b,p);return w}return{}}function m(e,t,r){const i=new Set;for(let e=0;r.routes&&e<r.routes.length;e+=1){const t=r.routes[e];t.isPortal&&(i.add(t.edges[0]),i.add(t.edges[1]))}let a=performance.now();const l=fZ(n),f=gZ(s.edgeData,i);a=performance.now();const c=e.lines.concat(t.lines,f.lines),u=l;return o&&dZ(c,u),d(e,t,f.edgeData,u)}return{getRoute:function(a,l,f){if(r=f,a===l)return{};"string"==typeof a&&"string"==typeof l||(o=!0);const c=cZ(a),u=cZ(l);if(e=c,t=u,e&&e.where){const t=e.where.split(".");t.length>=2&&(n=`${t[0]}.${t[1]}`)}let h=performance.now();if(s=function(){const e=Aa.getState().data;return e.hasOwnProperty("portal")?e.portal:{edgeData:{},lines:[]}}(),h=performance.now(),e&&t){i=!0;const r=()=>{const r=function(e,t){let n=performance.now();const r=fZ(AZ(e.where)),i=fZ(AZ(t.where)),a=mZ(s.edgeData,AZ(e.where)),l=mZ(s.edgeData,AZ(t.where));n=performance.now();const f=e.lines.concat(t.lines,a.lines,l.lines),c=r.concat(i);return o&&dZ(f,c),d(e,t,Object.assign(Object.assign({},a.edgeData),l.edgeData),c)}(e,t);if(bJ.isEmpty(r)){const r=function(e,t){let r=performance.now();const i=fZ(n);r=performance.now();const a=e.lines.concat(t.lines,s.lines),l=i;return o&&dZ(a,l),d(e,t,s.edgeData,l)}(e,t);return m(e,t,r)}return m(e,t,r)};let a=r();return bJ.isEmpty(a)&&(i=!1,a=r()),a}return{}}}}();var wZ,vZ,yZ;function _Z(e){const t=cZ(e.edges[0]),n=cZ(e.edges[1]);return{maneuverType:wZ.Static,coordinates:[],distance:0,features:[],time:0,startEdge:{mapObjectId:e.edges[0],whereDimension:e.startFloor,whatDimension:t?t.what:"",name:t?t.name:"Your Location"},endEdge:{mapObjectId:e.edges[1],whereDimension:e.endFloor,whatDimension:n?n.what:"",name:n?n.name:""},isPortal:e.isPortal,instructions:[],patchNumber:-1,whereDimension:"",zone:"",cost:e.cost,description:e.description}}function xZ(e){return e.maneuverType===wZ.RouteOverview||e.maneuverType===wZ.SectionOverview}function jZ(e,t){for(let n=0;n<e.length;n+=1){e[n].properties.highlight=!!t}return e}function EZ(e,t,n,r,i=""){if(0===e.length)return[];const o=[p(e,{segmentNumber:t,dimension_where:i,patchNumber:r,isNode:!0})];return jZ(o,n),o}function TZ(e,t,n,r,i,o=""){if(0===e.length)return[];const s={segmentNumber:t,dimension_where:o,patchNumber:r,isNode:!1,zone:i},a=A(e,Object.assign(Object.assign({},s),{featureBelongsToLineString:!0})),l=p(e[0],Object.assign(Object.assign({},s),{featureBelongsToLineString:!1})),f=p(e[e.length-1],Object.assign(Object.assign({},s),{featureBelongsToLineString:!1})),c=[];return c.push(l,a,f),jZ(c,n),c}function CZ(e,t=0){const n=bJ.cloneDeep(e.segments[1]),r=e.segments.length>1?e.segments[1].startEdge.whereDimension:"";n.coordinates=[],n.features=[],n.time=0,n.distance=0,n.isPortal=!1,n.maneuverType=wZ.RouteOverview,n.patchNumber=t,n.instructions=["Overview"];for(let t=1;t<e.segments.length;t+=1)if(e.segments[t].maneuverType!==wZ.SectionOverview){for(let r=0;r<e.segments[t].coordinates.length;r+=1){const i=e.segments[t].coordinates[r];n.coordinates.push(i)}for(let i=0;i<e.segments[t].features.length;i+=1){const o=bJ.cloneDeep(e.segments[t].features[i]);o.properties&&!o.properties.isNode&&(o.properties.dimension_where!==r?o.properties.isNonHighlightedOverview="1":o.properties.isNonHighlightedOverview="0",o.properties.dimension_where=r,o.properties.patchNumber=n.patchNumber,o.properties.segmentNumber=n.patchNumber,n.features.push(o))}}return n.endEdge=bJ.cloneDeep(e.segments[e.segments.length-1].endEdge),n.time=e.walkingTime+e.transportTime,n.distance=e.walkingDistance+e.transportDistance,n}function kZ(e,t,n){var r;let i=[];for(let o=0;o<e.segments.length;o+=1){const s=e.segments[o];if(n.includeOverviewFeatures){if(xZ(s)){const e=[],t=[];for(let i=0;i<s.features.length;i++){const o=s.features[i];void 0!==(null===(r=o.properties)||void 0===r?void 0:r.patchNumber)&&o.properties.patchNumber===n.patchNumberForOverviewFeatures&&void 0!==o.properties.isNonHighlightedOverview&&("1"===o.properties.isNonHighlightedOverview?e.push(o):t.push(o))}const o=e.concat(t);i=i.concat(o)}}else s.patchNumber===t&&(xZ(s)||(i=i.concat(s.features)))}return i}function SZ(e){return!!Object.values(vZ).includes(e)}function IZ(e){return!!Object.values(yZ).includes(e)}function PZ(e){return!(!SZ(e)&&!IZ(e))}function MZ(e){switch(e){case"what.transport.skytrain":return"Skytrain";case"what.service.airport_transfer":return"Bus";case"what.infra.escalator":return"Escalator";case"what.infra.lift":return"Lift";case"what.infra.entrance":case"what.infra.exit":return"";default:return e}}function qZ(e,t){const n=function(e){const t=e.split(".").slice(-2).join("").toUpperCase().match(/^(T\d+|JEWEL)([A-Za-z]\d+[A-Za-z]?)$/);if(t){let e;switch(t[1][0]){case"T":e="Terminal";break;case"J":e="Jewel";break;default:e="Level"}const n="Terminal"===e?`${e} ${t[1][1]}`:`${e}`;let r;switch(t[2][0]){case"L":default:r="Level";break;case"B":r="Basement"}return{Terminal:n,Level:`${r} ${t[2].substr(1)}`}}return null}(t);if(n){if((r=e)===vZ.Skytrain||r===vZ.Bus)return n.Terminal;if(e===vZ.Escalator||e===vZ.Lift)return n.Level;if(IZ(e))return n.Terminal}var r;return t.split(".").slice(-2).join(" ").toUpperCase()}!function(e){e.RouteOverview="Route Overview",e.SectionOverview="Section Overview",e.LeftHairPinTurn="Left hairpin turn",e.RightHairPinTurn="Right hairpin turn",e.LeftTurn="Turn left",e.RightTurn="Turn right",e.ContinueStraight="Continue straight",e.EnterPortal="Enter Portal",e.TravelPortal="Travel Portal",e.ExitPortal="Exit Portal",e.Static="Static",e.ChangeZone="Change Zone",e.PassThroughImmigration="Pass Through Immigration"}(wZ||(wZ={})),function(e){e.Skytrain="what.transport.skytrain",e.Bus="what.service.airport_transfer",e.Escalator="what.infra.escalator",e.Lift="what.infra.lift"}(vZ||(vZ={})),function(e){e.Entrance="what.infra.entrance",e.Exit="what.infra.exit"}(yZ||(yZ={}));const BZ=["match",["get","isNonHighlightedOverview"],"1","#A7A6BA","0",["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"],["match",["get","zone"],"transit","#4F7EF8","public","#CF9FFF","#CF9FFF"]],RZ=[{id:"route-line-outline-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-inactive",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!1]],style:{lineCap:"round",lineJoin:"round",lineColor:BZ,lineWidth:5},paint:{"line-color":BZ,"line-width":5},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:BZ,lineWidth:6},paint:{"line-color":BZ,"line-width":6},layout:{"line-cap":"round","line-join":"round"},belowLayerID:"route-line-animate"},{id:"route-line-outline-active",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineGapWidth:6},paint:{"line-color":"#FFFFFF","line-gap-width":6},layout:{"line-cap":"round","line-join":"round"}},{id:"route-line-endpoint-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleOpacity:0,circleStrokeWidth:2,circleStrokeColor:"#FFFFFF",circleStrokeOpacity:.7},paint:{"circle-radius":2,"circle-opacity":0,"circle-stroke-width":2,"circle-stroke-color":"#FFFFFF","circle-stroke-opacity":.7}},{id:"route-line-endpoint-fill-active",type:"circle",filter:["all",["==",["geometry-type"],"Point"],["==",["get","highlight"],!0],["==",["get","isNode"],!0]],style:{circleRadius:2,circleColor:"#FFFFFF",circleOpacity:.7},paint:{"circle-color":"#FFFFFF","circle-radius":2,"circle-opacity":.7}}],LZ=[{id:"route-line-animate",type:"line",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","highlight"],!0]],style:{lineCap:"round",lineJoin:"round",lineColor:"#FFFFFF",lineOpacity:.7,lineWidth:4},paint:{"line-color":"#FFFFFF","line-width":4,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"},isAnimationLayer:!0}];class OZ{constructor(e){this.routeSourceName="routeGeojson",this.patchFeatureCollection={type:"FeatureCollection",features:[]},this.highlightedSegmentNumber=-1,this.currentPatchNumber=-1,this.animateRouteSourceName="routeAnimateGeojson",this.animationFrameID=-1,this.animateRouteSegmentFeatureCollection={type:"FeatureCollection",features:[]},this.animationStartTime=0,this.end={from:0,to:0},this.animateHighlightedRouteSegment=()=>{const e=bJ.cloneDeep(this.animateRouteSegmentFeatureCollection.features[0]);if(e){const t=Date.now()-this.animationStartTime,n=(e,t)=>{e.geometry.coordinates=t;const n=this.map.getSource(this.animateRouteSourceName);n&&n.setData({type:"FeatureCollection",features:[e]})},r=2e3;if(t<r){const i=1-t/r,o=e.geometry.coordinates,{end:s}=this;let a;if(i>.5){const e=2*(i-.5);a=s.from*(1-e)+e*s.to}else{const e=2*i;a=s.from*(1-e)+e*s.to}let l=0,f=0,c=o.length-1;for(;f<a&&c>0;)l=f,f+=E(p(o[c]),p(o[c-1])),c-=1;if(i>.5){const t=(a-l)/(f-l),r=1-t;n(e,[...o.slice(0,c+1),[o[c][0]*t+o[c+1][0]*r,o[c][1]*t+o[c+1][1]*r]])}else{f<=a&&n(e,[...o.slice(o.length-2,o.length)]);const t=(a-l)/(f-l),r=1-t;n(e,[[o[c][0]*t+o[c+1][0]*r,o[c][1]*t+o[c+1][1]*r],...o.slice(c+1,o.length)])}this.animationFrameID=requestAnimationFrame(this.animateHighlightedRouteSegment)}else this.resetRouteSegmentAnimation()}},this.main=e}getCurrentFocus(){return this.main.getCurrentFocus()}filterWhereDimension(e){this.main.focusTo(e,!1)}setupRouting(e){this.map=e,this.map.addSource(this.routeSourceName,{type:"geojson",data:this.patchFeatureCollection});for(const e of RZ)e.source=this.routeSourceName,this.map.addLayer(e);this.map.addSource(this.animateRouteSourceName,{type:"geojson",data:this.animateRouteSegmentFeatureCollection});for(const e of LZ)e.source=this.animateRouteSourceName,this.map.addLayer(e)}computeRoute(e,t){return r(this,arguments,void 0,function*(e,t,n=!1,i=!0,o=0){this.currentPatchNumber=-1;const s=yield function(e,t,n){return r(this,arguments,void 0,function*(e,t,n,r=!0,i=0){const o=bZ.getRoute(e,t,n).routes,s=[];let a;for(let e=0;o&&e<o.length;e+=1){const t=o[e],n=t.geojson.properties.zone;if(t.isPortal){a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[t.geojson.geometry.coordinates[1]],zone:n,isPortal:!1});const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.EnterPortal,coordinates:[t.geojson.geometry.coordinates[0]]});s.push(e);const r=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ExitPortal,coordinates:[t.geojson.geometry.coordinates[1]]});s.push(r);const i=s.length>0?s[s.length-1]:void 0;if(i&&i.maneuverType===wZ.ExitPortal){if(s.pop(),t.portalPath){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.TravelPortal,coordinates:t.portalPath.geometry.coordinates,zone:n});s.push(e)}s.push(r)}}else{const r=t.geojson.geometry.coordinates;let i=wZ.Static;if(0===s.length){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[r[0]]});s.push(e)}if(e>0&&s.length>0){const t=o[e-1];if(n!==t.geojson.properties.zone){const e=t.geojson.geometry.coordinates,r=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ChangeZone,zone:n,coordinates:[e[e.length-1]]});s.push(r),i=wZ.ChangeZone}}if(r.length>2)for(let e=0;e<r.length-2;e+=1){const o=r[e],l=r[e+1],f=r[e+2];let c;a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.Static,coordinates:[f],zone:n}),c=wZ.ContinueStraight;const u=Object.assign(Object.assign({},_Z(t)),{maneuverType:c,zone:n});i===wZ.ContinueStraight?(e+3===r.length?s[s.length-1].coordinates.push(l,f):s[s.length-1].coordinates.push(l),s[s.length-1].maneuverType=c):(u.coordinates.push(o,l),s.push(u),e+3===r.length&&(c===wZ.ContinueStraight?s[s.length-1].coordinates.push(f):s.push(Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,coordinates:[l,f],zone:n})))),i=c}else{const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,coordinates:r,zone:n});s.push(e)}const l=()=>{if(s.length>0){const e=s[s.length-1];e.maneuverType===wZ.ChangeZone&&e.zone===o$.Transit&&s.pop()}};let f=s.length>0?s[s.length-1]:void 0;if(f&&f.maneuverType===wZ.ContinueStraight){const e=uZ(f.startEdge.whereDimension),r=A(f.coordinates);for(let i=0;i<e.length;i+=1){const o=e[i];if(!O$(r,o)){const e=q$(r,o);if(e.features.length>1){s.pop();const i=H$(_(r)[0],y(e.features[0]),r);if(I(i,{units:"meters"})>=10){const e=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(i)});s.push(e)}else if(s.length>0)if(f=s[s.length-1],f.maneuverType===wZ.ChangeZone){const e=_(i);if(f.coordinates=[e[e.length-1]],s.length>1){const e=s[s.length-2];e.coordinates=e.coordinates.concat(_(i))}}else f.coordinates.concat(_(i));const o=H$(y(e.features[0]),y(e.features[1]),r),a=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(o)});0===s.length&&(a.coordinates=i.geometry.coordinates.concat(a.coordinates)),l(),s.push(a);const c=_(r),u=H$(y(e.features[1]),c[c.length-1],r),h=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(u)});s.push(h)}else if(e.features.length>0)if(io(_(r)[0],o)){s.pop();const i=H$(_(r)[0],y(e.features[0]),r),o=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(i)});if(f=s.length>0?s[s.length-1]:void 0,f&&f.maneuverType===wZ.ChangeZone){const e=s.pop();if(s.length>1){const t=s[s.length-1];t.maneuverType===wZ.PassThroughImmigration&&(s.pop(),e.coordinates=[t.coordinates[0]],s.push(e),o.coordinates=t.coordinates.concat(o.coordinates))}}l(),s.push(o);const a=_(r),c=H$(y(e.features[0]),a[a.length-1],r),u=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.ContinueStraight,zone:n,coordinates:_(c)});s.push(u)}else{const i=H$(_(r)[0],y(e.features[0]),r);f.coordinates=_(i);const o=_(r),a=H$(y(e.features[0]),o[o.length-1],r),l=Object.assign(Object.assign({},_Z(t)),{maneuverType:wZ.PassThroughImmigration,zone:n,coordinates:_(a)});s.push(l)}}}}}}a&&s.push(a);const l={segments:s,walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:n$,speed:r$};if(l.segments.length>0){const e=r;let t=0;if(e){const e=bJ.cloneDeep(l.segments[0]);e.maneuverType=wZ.RouteOverview,l.segments.unshift(e),t=1}let n=i+t,o=l.segments.length>t?l.segments[t].startEdge.whereDimension:"";for(let e=t;e<l.segments.length;e+=1){const t=!1,r=l.segments[e],s=i+e;if(r.isPortal){if(r.maneuverType===wZ.EnterPortal){const i=EZ(r.coordinates[0],s,t,n,r.startEdge.whereDimension),a=[];for(const e of i)a.push(e);r.features=a,r.patchNumber=n,r.whereDimension=o;const f=l.segments.length>=e+2?l.segments[e+1]:void 0;if(f&&f.maneuverType!==wZ.TravelPortal){const e=r.cost;r.time=e||0}else r.time=0;r.distance=0}if(r.maneuverType===wZ.TravelPortal){r.features=TZ(r.coordinates,s,t,n,r.zone,r.startEdge.whereDimension),r.patchNumber=n,r.whereDimension=o;const i=r.cost;let a;r.time=i||0,a=r.coordinates.length>1?I(A(r.coordinates),{units:l.distanceUnit}):0,r.distance=a,e>0&&(l.segments[e-1].time=0)}r.maneuverType===wZ.ExitPortal&&(n+=1,o=r.endEdge.whereDimension,l.segments.splice(e,1),e-=1);const i=l.segments.length>=e+2?l.segments[e+1]:void 0;i&&i.maneuverType===wZ.TravelPortal&&(n+=1)}else{r.maneuverType===wZ.Static||r.maneuverType===wZ.ChangeZone?(r.features=EZ(r.coordinates[0],s,t,n,r.endEdge.whereDimension),r.patchNumber=n,r.whereDimension=o):(r.features=TZ(r.coordinates,s,t,n,r.zone,r.startEdge.whereDimension),r.patchNumber=n,r.whereDimension=o);const e=r.coordinates;let i;i=e.length>1?I(A(e),{units:l.distanceUnit}):0,r.distance=i,r.maneuverType!==wZ.PassThroughImmigration?r.time=r.distance/l.speed:r.time=0}r.maneuverType===wZ.TravelPortal?(l.transportDistance+=r.distance,l.transportTime+=r.time):(l.walkingDistance+=r.distance,l.walkingTime+=r.time)}if(e){const e=CZ(l,i);l.segments[0]=e}}return l})}(e,t,n,i,o);return function(e){const t=t=>0===t||1===t&&e.segments[t-1].maneuverType===wZ.RouteOverview,n=e=>e.startEdge.whereDimension.toLowerCase().includes("l1")?"Clear Arrival Immigration":"Clear Departure Immigration";for(let r=0;r<e.segments.length;r+=1){const i=e.segments[r];if(i.instructions=[],i.maneuverType===wZ.RouteOverview){const e="Overview";i.instructions.push(e)}if(r>0&&i.maneuverType===wZ.ChangeZone){let t="";e.segments[r-1].zone===o$.Public&&i.zone===o$.Transit?t=n(i):e.segments[r-1].zone===o$.Transit&&i.zone===o$.Public&&(t="Exit Baggage Claim Hall"),i.instructions.push(t)}else if(i.maneuverType===wZ.ContinueStraight||i.maneuverType===wZ.PassThroughImmigration){const t=i.maneuverType===wZ.ContinueStraight?`Walk for ${Math.ceil(i.distance)} ${e.distanceUnit}`:n(i);let o;e.segments[r-1].maneuverType===wZ.ChangeZone||(e.segments[r-1].maneuverType,wZ.PassThroughImmigration),o=t,i.instructions.push(o)}else if(i.maneuverType===wZ.Static)t(r)&&i.instructions.push(`Start at ${i.startEdge.name}`),r===e.segments.length-1&&i.instructions.push(`Arrive at ${i.endEdge.name}`);else if(i.maneuverType===wZ.EnterPortal){let t=`Enter ${i.startEdge.name} at ${i.startEdge.whereDimension.split(".").slice(-2).join(" ").toUpperCase()}`;if(IZ(i.startEdge.whatDimension))t=`Continue to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,i.instructions.push(t);else if(SZ(i.startEdge.whatDimension)){const n=r+1<=e.segments.length-1?e.segments[r+1]:void 0;n&&n.maneuverType===wZ.TravelPortal?(i.instructions.push(t),r+=1,t=`Take ${MZ(n.startEdge.whatDimension)} to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,n.instructions.push(t),i.description&&n.instructions.push(i.description)):(t=`Take ${MZ(i.startEdge.whatDimension)} to ${qZ(i.startEdge.whatDimension,i.endEdge.whereDimension)}`,i.instructions.push(t))}}}}(s),s})}handleAllRouteUpdate(e,t,n){const r=e[n].features.filter(e=>"LineString"===e.geometry.type)[0],i=A(r.geometry.coordinates.slice(1)),o=A([r.geometry.coordinates[0],r.geometry.coordinates[1]]),s=GJ(o,t.sourceCoords);i.geometry.coordinates.unshift(t.sourceCoords,s.geometry.coordinates);const a=i.geometry.coordinates,l=s.properties.index,f=a.slice(l);i.geometry.coordinates=f,i.geometry.coordinates.unshift(t.sourceCoords),i.properties=r.properties;let c=-1;e[n].features.map((e,t)=>{"LineString"===e.geometry.type&&(c=t)}),e[n].features[c]=i,e[n].coordinates=i.geometry.coordinates}computeRoutes(e){return r(this,arguments,void 0,function*(e,t=!1){if(e.length<2)return;const n={segments:[],walkingDistance:0,transportDistance:0,walkingTime:0,transportTime:0,distanceUnit:n$,speed:r$};n.segments.push({});let r=1;for(let i=0;i<e.length-1;i+=1){let o=e[i];const s=e[i+1],a=!0,l=e[0];if("string"!=typeof e[0]){const e=Aa.getState().data,t=this.map.project([l.sourceCoords[0],l.sourceCoords[1]]);this.map.queryRenderedFeatures(t).map(t=>{e[s$.Edge].hasOwnProperty(t.properties.mapObjectId)&&e[s$.Edge][t.properties.mapObjectId].lines.length>0&&(o=t.properties.mapObjectId)})}const f=yield this.computeRoute(o,s,t,a,r);if(f.segments,f.segments.length>0){const e=f.segments[0];e.maneuverType=wZ.SectionOverview,e.instructions=[`${e.startEdge.name} to ${e.endEdge.name}`]}for(let e=0;e<f.segments.length;e+=1){const t=f.segments[e];n.segments.push(t)}n.walkingDistance+=f.walkingDistance,n.transportDistance+=f.transportDistance,n.walkingTime+=f.walkingTime,n.transportTime+=f.transportTime,r+=f.segments.length}if(n.segments.length>1){const e=CZ(n);n.segments[0]=e}else n.segments.length=0;return n})}updateRouteSource(e){if(!this.map)return!1;this.patchFeatureCollection=e;const t=this.map.getSource(this.routeSourceName);return t&&t.setData(e),!0}updateAnimateRouteSource(e){if(!this.map)return!1;this.animateRouteSegmentFeatureCollection=e;const t=this.map.getSource(this.animateRouteSourceName);return t&&t.setData(e),!0}setActiveRoute(e){this.route=e}getActiveRoute(){return this.route}resetRouteSegmentAnimation(){this.animationStartTime=Date.now(),cancelAnimationFrame(this.animationFrameID),this.animateRouteSegmentFeatureCollection.features.length>0&&"LineString"===this.animateRouteSegmentFeatureCollection.features[0].geometry.type&&this.animateHighlightedRouteSegment()}updateFeaturesToAnimate(e,t){if(this.route&&this.route.segments.length>e){const n=this.route.segments[e];if(n.features.length>0){const e=function(e,t=""){const n=[];for(let r=0;r<e.features.length;r+=1){const i=e.features[r];i.properties.featureBelongsToLineString&&(""!==t?i.properties.dimension_where&&i.properties.dimension_where===t&&n.push(i):n.push(i))}return n}(n,t);if(e.length>0){this.updateAnimateRouteSource({type:"FeatureCollection",features:e});const t=e[0],n=GJ(t,p(e[0].geometry.coordinates[0])),r=I(t)-n.properties.location;this.end={from:0,to:r}}else this.updateAnimateRouteSource({type:"FeatureCollection",features:[]});this.resetRouteSegmentAnimation()}}}highlightRouteSegment(e,n=!0){const{route:r}=this;if(r&&r.segments.length>e&&r.segments[e].coordinates.length>0){this.highlightedSegmentNumber=e;const i=r.segments[e],o=i.maneuverType===wZ.ExitPortal||i.maneuverType===wZ.Static?i.endEdge.whereDimension:i.startEdge.whereDimension;let s=this.patchFeatureCollection.features;const a=i.features[0].properties.patchNumber;this.currentPatchNumber!==a&&(this.currentPatchNumber=a,s=kZ(r,a,{includeOverviewFeatures:xZ(i),patchNumberForOverviewFeatures:a})),o&&o!==this.getCurrentFocus()&&n&&this.filterWhereDimension(o);const l=function(e,t,n=!1){for(let r=0;r<e.length;r+=1){const i=e[r];i.properties.segmentNumber===t?n?!0===i.properties.startPoint&&jZ([i],!0):jZ([i],!0):jZ([i],!1)}return e}(s,e);if(this.updateRouteSource({type:"FeatureCollection",features:l}),xZ(i)?this.updateAnimateRouteSource({type:"FeatureCollection",features:[]}):this.updateFeaturesToAnimate(e,o),i){const e=e=>"Point"===e.geometry.type?e.geometry.coordinates:e.geometry.coordinates[0],n=this.map.getCanvas(),o=n.clientWidth,s=n.clientHeight,a={padding:{top:.2*s,bottom:.2*s,left:.2*o,right:.2*o},duration:1e3,bearing:this.map.getBearing(),pitch:this.map.getPitch()};if(i.coordinates.length>1){const n=function(e,t=0){let n=[];for(let r=0;r<e.segments.length;r+=1){const i=e.segments[r];i.patchNumber===t&&(n=n.concat(i.features))}return n}(r,i.patchNumber),o=e(n[0]),s=new t.LngLat(o[0],o[1]),l=new t.LngLat(o[0],o[1]),f=new t.LngLatBounds(s,l);for(let e=0;e<n.length;e++){const t=n[e];if("Point"===t.geometry.type)f.extend(t.geometry.coordinates);else for(const e of t.geometry.coordinates)f.extend(e)}this.map.fitBounds(f,a)}else{const e={type:"FeatureCollection",features:[p(i.coordinates[0])]},t=t$(e,.025,3).features[0].geometry.coordinates,n=[t$(e,-.025,-3).features[0].geometry.coordinates,t];this.map.fitBounds(n,a)}}}}clearRoute(){const e={type:"FeatureCollection",features:[]};this.updateRouteSource(e),this.updateAnimateRouteSource(e),this.route=null,cancelAnimationFrame(this.animationFrameID)}}var FZ,DZ;!function(e){e.Name="title",e.LocalRef="localRef",e.WhatTaxonomy="dimension_what"}(FZ||(FZ={})),function(e){e.UrlLoad="url_load",e.MapClick="map_click",e.BannerClick="banner_click",e.SearchInput="search_input",e.ListClick="list_click",e.InfoPopupClick="info_popup_click",e.Chatbot="chatbot",e.RoutingUI="routing_ui",e.StampRallyClick="stamp_rally_click"}(DZ||(DZ={}));const NZ="https://api.maptiler.com/maps/01985ac8-56d2-707b-afa8-68abfe8f18be/style.json?key=12H5hrITUbJ1sDrVPqkq";class zZ{setupFirebase(){this.firebaseApp=nY({apiKey:"AIzaSyBDWO2wNkotbgjbkyqVrC_OEAJ3mbvlheI",authDomain:"tmt-lenovo-tech-day-26-id.firebaseapp.com",projectId:"tmt-lenovo-tech-day-26-id",storageBucket:"tmt-lenovo-tech-day-26-id.firebasestorage.app",messagingSenderId:"618619544262",appId:"1:618619544262:web:cb7a7953a908aeed212dc7",measurementId:"G-HN2FS1L0P4"}),this.analytics=function(e=function(e=WX){const t=KX.get(e);if(!t&&e===WX&&MK())return nY();if(!t)throw eY.create("no-app",{appName:e});return t}()){const t=ZX(e=HK(e),KY);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=ZX(e,KY);if(n.isInitialized()){const e=n.getImmediate();if(DK(t,n.getOptions()))return e;throw JY.create("already-initialized")}return n.initialize({options:t})}(e)}(this.firebaseApp)}logAnalyticsEvent(e,t){this.analytics&&(t?AJ(this.analytics,e,t):AJ(this.analytics,e))}onLoad(){!0===this.mapLoaded&&!0===this.apiAuthenticationCallbackReceived&&(this.routingVisualizer.setupRouting(this.map),this.onLoadCallback&&this.onLoadCallback())}addImage(e,t,n){if(!this.map)throw new Error("Map must be initialized before adding images");this.map.addImage(e,t,n)}loadImage(e){return this.map?new Promise((t,n)=>{this.map.loadImage(e,(e,r)=>{!e&&r?t(r):n(e||new Error("Failed to load image"))})}):Promise.reject(new Error("Map must be initialized before loading images"))}onLoadFail(e){!1===this.onFailCallbackSent&&(this.onFailCallbackSent=!0,this.onLoadFailCallback&&this.onLoadFailCallback(e))}initMetaAtlasCore(e,t){this.metaAtlasCore.init(this.empApiURL,this.accessToken,this.secretKey,n=>r(this,void 0,void 0,function*(){this.apiAuthenticationCallbackReceived=!0,n.authenticated?(yield this.metaAtlasCore.setupFocusTree(),this.metaAtlasCore.setupRouting(e),this.metaAtlasCore.setupMapObjectSearch(t),this.onCoreLoadCallback&&this.onCoreLoadCallback(),this.onLoad()):this.onLoadFail("Failed to authenticate token")}))}constructor(t,n,r=()=>{},i=e=>{},o=()=>{},s=()=>{},a=()=>{},l=()=>{},f=""){this.onLoadCallback=void 0,this.onLoadFailCallback=void 0,this.onCoreLoadCallback=void 0,this.onRenderReadyCallback=void 0,this.mapLoaded=!1,this.onFailCallbackSent=!1,this.UserLayers=[],this.defaultFocusedTaxonomy="where.gbtb",this.currentFocus=this.defaultFocusedTaxonomy,this.map3D=null,this.apiAuthenticationCallbackReceived=!1,this.routingVisualizer=new OZ(this),this.clickSubscribers=new Set,this.loadSubscribers=new Set,this.moveEndSubscribers=new Set,this.clickOnceSubscribers=new Set,this.tileServer="https://atoms-map-tiles-middleware.sandbox.spatialverse.online",this.HOST="https://atoms-sdk.sandbox.spatialverse.online/",this.empApiURL="https://atoms-api.sandbox.spatialverse.online",this.mapBoxDrawSourceID="drawnDataSource",this.drawGeojsonData={type:"FeatureCollection",features:[]},this.popups=[],this.markers=[],this.accessToken=t,this.secretKey=n,this.onLoadCallback=r,this.onLoadFailCallback=i,this.onCoreLoadCallback=a,this.onRenderReadyCallback=l,this.map=null,this.mapBoxDraw=null,this.maplibregl=e,this.CustomerLayers=TK,this.roleName="changipublic",this.verNum="1","agil"===f&&(this.tileServer="https://map-tiles-middleware.agil.spatialverse.online",this.HOST="https://editor.agil.spatialverse.online/sdk/2.1.2-sandbox/",this.empApiURL="https://api.agil.spatialverse.online"),this.metaAtlasCore=new ka,this.customMapObjectsManager=new Sa(this.metaAtlasCore,this),this.initMetaAtlasCore(o,s),this.setupFirebase()}setupMap(t,n,r){var i,o,s;if(this.roleName=t,"string"==typeof n){const t=(null==r?void 0:r.longitude)&&(null==r?void 0:r.latitude)?[r.longitude,r.latitude]:[110.40560122701005,1.5626614114987702],a=null!==(i=null==r?void 0:r.zoom)&&void 0!==i?i:18,l=null!==(o=null==r?void 0:r.pitch)&&void 0!==o?o:42,f=null!==(s=null==r?void 0:r.bearing)&&void 0!==s?s:23.4;this.map=new e.Map({container:n,style:NZ,center:t,zoom:a,pitch:l,bearing:f,antialias:!0,attributionControl:!1})}else this.map=n;const a=()=>{this.map.addSource("custom",{type:"vector",url:this.tileServer+"/"+this.roleName+"/"+this.verNum+"/geojson?accessToken="+this.accessToken}),this.map.addSource("customMapObjects",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.logAnalyticsEvent("open_app",{type:"web",token:this.accessToken}),this.map.on("click",e=>{this.map3D&&this.map3D.getViewMode()!==Ca.MODE_2D?setTimeout(()=>{this.process2DClick(e)},0):this.process2DClick(e)});const e=this.CustomerLayers;for(const t of e)t["source-layer"]="geojson",this.map.addLayer(t);this.mapLoaded=!0,this.setupMapBoxDraw(),this.onRenderReadyCallback&&this.onRenderReadyCallback(),this.notifyLoadSubscribers()};this.map.loaded()?a():this.map.on("load",a),this.map.on("moveend",()=>{this.notifyMoveEndSubscribers()}),this.map.on("error",e=>{const t=e.message||"";t.includes("layer")||t.includes("filter")||t.includes("source")||t.includes("paint")||t.includes("layout")||this.onLoadFail(e.message)})}setupMapBoxDraw(){this.mapBoxDraw=new mi({displayControlsDefault:!1,userProperties:!0,modes:Object.assign(Object.assign({},mi.modes),{draw_marker:Oi,marker_select:Ki}),styles:bi}),this.map.addControl(this.mapBoxDraw),this.map.addSource(this.mapBoxDrawSourceID,{type:"geojson",data:this.drawGeojsonData});for(let e=0;e<gi.length;e++){const t=gi[e];t.source=this.mapBoxDrawSourceID,this.map.addLayer(t)}this.mapLoaded=!0,this.onLoad()}overRideSelectionOfDrawnPointGeometry(e){if(this.mapBoxDraw&&"simple_select"===this.mapBoxDraw.getMode()&&1===this.mapBoxDraw.getAll().features.length){const t=this.mapBoxDraw.getAll().features;void 0===e.properties.id?this.mapBoxDraw.deleteAll():void 0!==e.properties.id&&t[0].id!==e.properties.id&&(this.mapBoxDraw.deleteAll(),e.properties.id)}}process2DClick(e){var t,n,r;const i=this.map.queryRenderedFeatures(e.point)||[];let o=null,s=null;const a=this.CustomerLayers.map(e=>e.id),l=this.UserLayers.map(e=>e.id);for(const e of i){const r=null===(t=e.layer)||void 0===t?void 0:t.id;if(!r)continue;const i=this.map.getLayer(r);if(!i)continue;const f=i.source,c=f===this.mapBoxDrawSourceID,u=a.includes(r)||"custom"===f,h=l.includes(r)||"customMapObjects"===f;if(c&&!o&&(o=e),!s&&(u||h)){const t=e.properties||{},r=!!t._isCustom,i=(null===(n=t.dimension_what)||void 0===n?void 0:n.includes("what.infra.garden"))||t.isSearchable&&"Transit"!==t.title&&"Public"!==t.title;(r||i)&&(s=e)}}if(o?(this.overRideSelectionOfDrawnPointGeometry(o),(null===(r=o.properties)||void 0===r?void 0:r.id)?this.lastClickedDrawing=this.getDrawingById(o.properties.id):this.lastClickedDrawing=this.setDrawing()):this.lastClickedDrawing=this.setDrawing(),s){const t=s,n=t.properties||{};n.title&&this.logAnalyticsEvent("feature_clicked",{feature_clicked:n.title}),this.overRideSelectionOfDrawnPointGeometry(t);let r=null;if("Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type)if(n.center)try{r=JSON.parse(n.center)}catch(e){r=O(t).geometry.coordinates}else r=O(t).geometry.coordinates;else if("Point"===t.geometry.type)r=t.geometry.coordinates;else if("LineString"===t.geometry.type||"MultiLineString"===t.geometry.type){const e=this.metaAtlasCore.getMidPointOfFeature(t);if(e&&Array.isArray(e)&&e.length>=2)r=[e[0],e[1]];else{const e=t.geometry.coordinates;Array.isArray(e)&&e.length>0&&Array.isArray(e[0])&&(r=e[0])}}else{const e=t.geometry.coordinates;r=Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]?e:O(t).geometry.coordinates}this.metaAtlasCore.setLastClickedFeature({mapObjectId:n.myMapObjectId||n.id||null,coordinates:r,name:n.title||n.name||null,whatDimension:n.dimension_what||null,whereDimension:n.dimension_where||null,geometry:t.geometry,properties:n,clickEvent:e})}else this.map3D&&this.map3D.getViewMode()!==Ca.MODE_2D||this.metaAtlasCore.setLastClickedFeature({mapObjectId:null,coordinates:null,name:null,whatDimension:null,whereDimension:null,geometry:null,properties:null,clickEvent:e});this.notifyClickSubscribers(this.getLastClickedFeature())}getFocusTree(){return this.metaAtlasCore.getFocusTree()}setDrawing(e=null,t=null,n=null,r=null){return{id:e,where:t,geometry:n,properties:r}}getLastClickedFeature(){return this.metaAtlasCore.getLastClickedFeature()}getLastClickedDrawing(){let e=this.lastClickedDrawing;return this.lastClickedDrawing&&(!this.lastClickedDrawing||null!==this.lastClickedDrawing.id&&null!==this.lastClickedDrawing.where)||(e=this.setDrawing()),e}getMidPointOfFeature(e){return this.metaAtlasCore.getMidPointOfFeature(e)}dropPin(t,n,r=!0){const i={feature:t,popupStyle:n},o=document.createElement("div");o.innerHTML=i.popupStyle;const s=new e.Marker({element:o}).setLngLat(this.getMidPointOfFeature(i.feature)).addTo(this.map);return r?this.popups.length>1?(this.popups[this.popups.length-1].popup.remove(),this.popups[this.popups.length-1].popup=s,this.popups[this.popups.length-1].id=i.feature.mapObjectId):(this.popups.length>0&&this.popups[this.popups.length-1].popup.remove(),this.popups=[{popup:s,id:i.feature.mapObjectId}]):this.popups.push({popup:s,id:i.feature.mapObjectId}),this.popups[this.popups.length-1].id}dropMarkerForRouting(e){e.forEach(e=>{var t,n,r;const i=(null===(t=e.selectedLocation)||void 0===t?void 0:t.coordinates)?e.selectedLocation.coordinates:null===(r=null===(n=e.selectedLocation)||void 0===n?void 0:n.geometry)||void 0===r?void 0:r.coordinates;if(i&&2===i.length){const e=new this.maplibregl.Marker({color:"#188689"}).setLngLat([i[0],i[1]]).addTo(this.map);this.markers.push(e)}})}clearMarker(){this.markers&&this.markers.length>0&&this.markers.forEach(e=>{e.remove()}),this.markers=[]}extractLocation(e){const t=e.match(/^(?:[^_]*_){3}([^_]*)/);return t?t[1]:null}hidePin(e="-1"){let t;if("-1"===e){const e=this.popups[this.popups.length-1];if(!e)return;t=e.id}else t=e;const n=this.popups.find(e=>e.id===t);if(n){let e=n.popup.getElement();e&&(e.style.display="none")}}hidePins(){this.popups.length>0&&this.popups.forEach(e=>{let t=e.popup.getElement();t&&(t.style.display="none")})}showPin(e="-1"){let t;if("-1"===e){const e=this.popups[this.popups.length-1];if(!e)return;t=e.id}else t=e;const n=this.popups.find(e=>e.id===t);if(n){let e=n.popup.getElement();e&&(e.style.display="flex")}}showPins(){this.popups.length>0&&this.popups.forEach(e=>{let t=e.popup.getElement();t&&(t.style.display="flex")})}clearPin(e="-1"){let t;if("-1"===e){if(t=this.popups.length-1,t<0)return}else if(t=this.popups.findIndex(t=>t.id===e),-1===t)return;this.popups[t]&&(this.popups[t].popup.remove(),this.popups.splice(t,1))}clearPins(){this.popups.length>0&&(this.popups.forEach(e=>{e.popup.remove()}),this.popups.length=0)}removePin(){f(".mapboxgl-popup").remove()}getCurrentFocus(){return this.metaAtlasCore.getCurrentFocus()}getCurrentFocusBuilding(){return this.metaAtlasCore.getCurrentFocusBuilding()}getCurrentFocusFloor(){return this.metaAtlasCore.getCurrentFocusFloor()}addUserLayer(e){this.UserLayers.push(e),this.map.addLayer(e)}filterWhereDimension(e){if(!e)return;let t=pi(this.UserLayers);if(t.length>0)try{let n=this.metaAtlasCore.filterBaseMapWhereDimension(t,e);for(let e=0;e<n.length;e++){const r=n[e].id,i=n[e].filter;if(this.map.getLayer(r))try{t[e].filter=i,this.map.setFilter(r,i)}catch(e){continue}}}catch(e){}let n=pi(this.CustomerLayers);for(let e=0;e<n.length;e+=1){const t=n[e].id,r=this.map.getFilter(t);n[e].filter=r}let r=this.metaAtlasCore.filterBaseMapWhereDimension(n,e);for(let e=0;e<r.length;e+=1){const t=r[e].id,n=r[e].filter;this.map.setFilter(t,n)}}filterWhatTaxonomy(e){if(!this.map)return;this.metaAtlasCore.setCurrentWhatFilters(e||[]);let t=pi(this.CustomerLayers);for(let e=0;e<t.length;e+=1){const n=t[e].id,r=this.map.getFilter(n);t[e].filter=r}let n=this.metaAtlasCore.filterLayersWhatDimension(t,e);for(let e=0;e<n.length;e+=1){const t=n[e].id,r=n[e].filter;this.map.setFilter(t,r)}let r=pi(this.UserLayers);if(r.length>0){for(let e=0;e<r.length;e+=1){const t=r[e].id,n=this.map.getFilter(t);r[e].filter=n}let t=this.metaAtlasCore.filterLayersWhatDimension(r,e);for(let e=0;e<t.length;e+=1){const n=t[e].id,r=t[e].filter;this.map.setFilter(n,r)}}this.map3D&&this.map3D.filterWhatTaxonomy(e)}focusTo(e,t=!0){const n=this.map;let r=e;if(!r||!n)return;this.filterWhereDimension(r);const i=window.innerWidth<768;if(t){const e=this.metaAtlasCore.getFlyToLocation(r,i);this.map.flyTo({center:e.center?e.center:this.map.getCenter(),zoom:e.zoom?e.zoom:this.map.getZoom(),bearing:e.bearing?e.bearing:this.map.getBearing(),speed:.8})}if(this.map3D){const e=function(e){if(!e)return null;if($i(e))return"site";return function(e){if(!e)return null;const t=Ji();for(const n in t){const r=t[n];if(!r||!r.buildings)continue;const i=Array.isArray(r.buildings)?r.buildings:Object.values(r.buildings);for(const t of i)if(t&&t.taxonomyPath===e)return{building:t,site:r}}return null}(e)?"building":Zi(e)?"floor":null}(r);"floor"===e?this.map3D.selectFloor(r):"building"===e&&"function"==typeof this.map3D.showFullBuildingModel&&this.map3D.showFullBuildingModel()}}filterLayersByCategories(e,t,n,r){const i=this.map;if(!t||!i)return;let o=pi(this.CustomerLayers);for(let e=0;e<o.length;e+=1){const t=o[e].id,n=this.map.getFilter(t);o[e].filter=n}let s=this.metaAtlasCore.filterLayersByCategories(o,e,t,n,r,this.map);for(let e=0;e<s.length;e+=1){const t=s[e].id,n=s[e].filter;this.map.setFilter(t,n)}}filterLayersByType(e,t,n=""){const r=this.map;if(!t||!r)return;let i=pi(this.UserLayers);if(i.length>0){let r=this.metaAtlasCore.filterLayersByType(i,e,t,n);for(let e=0;e<r.length;e++){const t=r[e].id,n=r[e].filter;i[e].filter=n,this.map.setFilter(t,n)}}}styleLayersByType(e,t,n,r){if(!t||!this.map)return;let i=this.map.getStyle().layers,o=this.metaAtlasCore.styleLayersByType(i,e,t,n,r);for(let e=0;e<o.length;e+=1){const t=o[e].id,r=o[e].paint,i=o[e].type;!i||"fill"!==i&&"line"!==i||r[n]&&this.map.setPaintProperty(t,n,r[n])}}clearStyleLayersByType(e,t,n){if(!this.map)return;let r=this.map.getStyle().layers,i=this.metaAtlasCore.clearStyleLayersByType(r,e,t,n);for(let e=0;e<i.length;e+=1){const t=i[e].id,r=i[e].paint,o=i[e].type;!o||"fill"!==o&&"line"!==o||r[n]&&this.map.setPaintProperty(t,n,r[n])}}changeTerminalInFocusToUserViewpoint(e={}){let t=this.map.getCenter().wrap();const n=[t.lng,t.lat];if(this.metaAtlasCore.checkUserViewport(n,this.getCurrentFocusBuilding(),this.getCurrentFocusFloor()))return!0;let r=this.metaAtlasCore.getUserViewportBuilding(n);return!(!r||r.name in e&&(this.focusTo(e[r.name],!1),0))}isLocationWithinHongKong(e){const t=d([[[103.59716039266556,1.2570288388163817],[103.5792058079661,1.2001127572538621],[103.69481581677104,1.2005505778590049],[103.9124604166791,1.2408297702235416],[104.07843084598773,1.3003717948835174],[104.09332001378709,1.3428384139758691],[104.06568408463107,1.4395702492902842],[104.01405273250049,1.430831826129534],[103.94486100905976,1.4264524124152587],[103.88661860370877,1.4347670822090777],[103.84020398120549,1.470670314084117],[103.79466396668937,1.467591709607774],[103.75700361138325,1.4470255906078648],[103.72197278477057,1.4605952336399213],[103.68041038922672,1.4408697939934143],[103.64577440712543,1.379174061413977],[103.59716039266556,1.2570288388163817],[103.59716039266556,1.2570288388163817]]]);return io(p(e),t)}getMapObjectsByFilteredLocalRef(...e){return this.metaAtlasCore.getMapObjectsByFilteredLocalRef(...e)}getMapObjectsByName(...e){return this.metaAtlasCore.getMapObjectsByName(...e)}getMapObjectById(...e){return this.metaAtlasCore.getMapObjectById(...e)}getMapObjectByLocalRef(...e){return this.metaAtlasCore.getMapObjectByLocalRef(...e)}getMapObjectMatchingLocalRef(...e){return this.metaAtlasCore.getMapObjectMatchingLocalRef(...e)}getMapObjectsMatchingLocalRefs(...e){return this.metaAtlasCore.getMapObjectsMatchingLocalRefs(...e)}getMapObjectsByWhatTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhatTaxonomy(...e)}getMapObjectsByWhatTaxonomyAPI(...e){return this.metaAtlasCore.getMapObjectsByWhatTaxonomyAPI(...e)}getMapObjectsByWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhereTaxonomy(...e)}getMapObjectsByWhatAndWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsByWhatAndWhereTaxonomy(...e)}getMapObjectsInWhatTaxonomy(...e){return this.metaAtlasCore.getMapObjectsInWhatTaxonomy(...e)}getMapObjectsInWhereTaxonomy(...e){return this.metaAtlasCore.getMapObjectsInWhereTaxonomy(...e)}computeRoute(...e){return this.routingVisualizer.computeRoute(...e)}computeRoutes(e,t=!1,n){const i=this;return(()=>{r(this,void 0,void 0,function*(){const t=yield(e=>r(this,void 0,void 0,function*(){const t=e.map(e=>(e=>new Promise(t=>{"string"!=typeof e&&t("User GPS Location"),i.getMapObjectById(e,e=>{var n;t(null===(n=e[0])||void 0===n?void 0:n.name)})}))(e));return yield Promise.all(t)}))(e);t.forEach(e=>{this.logAnalyticsEvent("route_per_object",{destination:e,route_per_object_event_source:n})}),this.logAnalyticsEvent("route",{destinations:t,route_event_source:n})})})(),this.routingVisualizer.computeRoutes(e,t)}setActiveRoute(...e){return this.routingVisualizer.setActiveRoute(...e)}getActiveRoute(...e){return this.routingVisualizer.getActiveRoute(...e)}highlightRouteSegment(...e){return this.routingVisualizer.highlightRouteSegment(...e)}clearRoute(...e){return this.routingVisualizer.clearRoute(...e)}drawGeometryOnMap(e,t,n=!1){if("simple_select"!==this.mapBoxDraw.getMode())return!1;let r=!1;return"draw_point"===e?(this.mapBoxDraw.changeMode("draw_point"),r=!0):"draw_line_string"===e?(this.mapBoxDraw.changeMode("draw_line_string"),r=!0):"draw_polygon"===e?(this.mapBoxDraw.changeMode("draw_polygon"),r=!0):"draw_marker"===e&&(this.mapBoxDraw.changeMode("draw_marker"),r=!0),r&&(this.map.once("draw.create",e=>{let r=e.features[0];r.properties.id=r.id,r.properties.dimension_where=n?this.getCurrentFocus():this.defaultFocusedTaxonomy,t(r)}),this.map.once("draw.modechange",()=>{this.mapBoxDraw.deleteAll()})),r}isInDrawMode(){return this.mapBoxDraw&&this.mapBoxDraw.getAll().features.length>0}addDrawingsToBaseMap(e){this.drawGeojsonData.features=this.drawGeojsonData.features.concat(e),this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData)}getDrawingById(e){for(let t=0;t<this.drawGeojsonData.features.length;t++){const n=this.drawGeojsonData.features[t];if(n.id===e)return n}}editDrawing(e){if(void 0===e)return!1;let t=this.getDrawingById(e);if(void 0===t)return!1;let n={type:"FeatureCollection",features:[t]};this.mapBoxDraw.set(n);const r=e=>{const t=this.mapBoxDraw.get(e);if(this.mapBoxDraw.deleteAll(),t){let e=!1;for(let n=0;n<this.drawGeojsonData.features.length;n++)this.drawGeojsonData.features[n].id===t.id&&(this.drawGeojsonData.features[n]=t,e=!0);e&&this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData)}};if("Point"!==t.geometry.type)void 0!==t.properties.marker?this.mapBoxDraw.changeMode("marker_select",{featureId:t.id}):this.mapBoxDraw.changeMode("direct_select",{featureId:t.id}),this.map.once("draw.modechange",()=>{"simple_select"===this.mapBoxDraw.getMode()&&r(t.id)});else{let e=!1;const n=i=>{i.features.length>0&&i.features[0].id===t.id?e||(e=!0):e&&(r(t.id),this.map.off("draw.selectionchange",n))};this.map.on("draw.selectionchange",n)}return!0}removeDrawing(e){for(let t=0;t<this.drawGeojsonData.features.length;t++)if(this.drawGeojsonData.features[t].id===e)return this.drawGeojsonData.features.splice(t,1),this.map.getSource(this.mapBoxDrawSourceID).setData(this.drawGeojsonData),!0;return!1}createMarker(t){void 0===t&&(t={}),t.draggable=!0,t.color="#FFB52E";const n=new e.Marker(t).setLngLat(this.map.getCenter()).addTo(this.map);return this.map.once("click",()=>{n.setDraggable(!1);const e="#3FB1CE";n.getElement().querySelectorAll('svg g[fill="'+n._color+'"]')[0].setAttribute("fill",e),n._color=e}),n}getCoordinates(e){return _(e)}getLength(e,t={units:"kilometers"}){if(e.geometry&&e.geometry.type){const n=e.geometry.type;if("LineString"===n||"MultiLineString"===n)return I(e,t)}}getArea(e){return M(e)}getMap3D(){return this.map3D}notifyClickSubscribers(e){this.clickSubscribers.forEach(t=>t(e)),this.clickOnceSubscribers.size>0&&(this.clickOnceSubscribers.forEach(t=>t(e)),this.clickOnceSubscribers.clear())}notifyLoadSubscribers(){this.loadSubscribers.forEach(e=>e())}notifyMoveEndSubscribers(){this.moveEndSubscribers.forEach(e=>e())}subscribeToClick(e){return this.clickSubscribers.add(e),()=>{this.clickSubscribers.delete(e)}}subscribeToLoad(e){return this.loadSubscribers.add(e),()=>{this.loadSubscribers.delete(e)}}subscribeToMoveEnd(e){return this.moveEndSubscribers.add(e),()=>{this.moveEndSubscribers.delete(e)}}subscribeToClickOnce(e){return this.clickOnceSubscribers.add(e),()=>{this.clickOnceSubscribers.delete(e)}}addMapObject(e){this.customMapObjectsManager.addMapObject(e)}removeMapObject(e){this.customMapObjectsManager.removeMapObject(e)}updateMapObject(e,t){this.customMapObjectsManager.updateMapObject(e,t)}getCustomMapObjects(){return this.customMapObjectsManager.getCustomMapObjects()}clearCustomMapObjects(){this.customMapObjectsManager.clearCustomMapObjects()}}export{NZ as DEFAULT_MAP_STYLE,DZ as EventSource,wZ as ManeuverType,zZ as MetaAtlasSdk};
|