@mappedin/mappedin-js 5.1.2 → 5.1.3
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/esm/get-venue/index.d.ts +3 -2
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/navigator/index.js +1 -1
- package/lib/esm/renderer/{browser-KLN7ADQ4.js → browser-2ZAM3EFH.js} +1 -1
- package/lib/esm/renderer/chunk-RTW5SJDQ.js +1 -0
- package/lib/esm/renderer/index.d.ts +16 -8
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +6 -2
- package/lib/esm/renderer/chunk-EVU7ZQGH.js +0 -1
package/lib/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ao,P,Hr=Object.create,Bt=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Xr=Object.getOwnPropertyNames,Yr=Object.getPrototypeOf,Kr=Object.prototype.hasOwnProperty,Zr=(t,e,n)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ri=t=>Bt(t,"__esModule",{value:!0}),c=(t,e)=>Bt(t,"name",{value:e,configurable:!0}),Qr=(t,e)=>()=>(t&&(e=t(t=0)),e),yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),eo=(t,e)=>{for(var n in Ri(t),e)Bt(t,n,{get:e[n],enumerable:!0})},to=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of Xr(e))!Kr.call(t,i)&&"default"!==i&&Bt(t,i,{get:()=>e[i],enumerable:!(n=Jr(e,i))||n.enumerable});return t},dn=t=>to(Ri(Bt(null!=t?Hr(Yr(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),d=(t,e,n)=>(Zr(t,"symbol"!=typeof e?e+"":e,n),n),Jn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},u=(t,e,n)=>(Jn(t,e,"read from private field"),n?n.call(t):e.get(t)),N=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_=(t,e,n,i)=>(Jn(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),Xn=(t,e,n,i)=>({set _(i){_(t,e,i,n)},get _(){return u(t,e,i)}}),it=(t,e,n)=>(Jn(t,e,"access private method"),n),I=Qr((()=>{P={env:ao={NODE_ENV:"production",npm_package_version:"5.1.2"}}})),qi=yt(((t,e)=>{I(),function(n){var i="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=c((function(t){this.message=t}),"InvalidCharacterError");s.prototype=new Error,s.prototype.name="InvalidCharacterError";var o=c((function(t){throw new s(t)}),"error"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h=c((function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,r=0,a="",s=-1;++s<e;)i=l.indexOf(t.charAt(s)),n=r%4?64*n+i:i,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a}),"decode"),d={encode:c((function(t){t=String(t),/[^\0-\xFF]/.test(t)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,i,r,a=t.length%3,s="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,i=t.charCodeAt(++u),s+=l.charAt((r=e+n+i)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==a?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),s+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(u),s+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),s}),"encode"),decode:h,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return d}));else if(i&&!i.nodeType)if(r)r.exports=d;else for(var p in d)d.hasOwnProperty(p)&&(i[p]=d[p]);else n.base64=d}(t)})),Vi=yt(((t,e)=>{var n,i;I(),n="undefined"!=typeof self?self:t,i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return c(n,"r"),n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"computeDestinationPoint",(function(){return B})),n.d(e,"convertArea",(function(){return L})),n.d(e,"convertDistance",(function(){return C})),n.d(e,"convertSpeed",(function(){return P})),n.d(e,"decimalToSexagesimal",(function(){return z})),n.d(e,"findNearest",(function(){return H})),n.d(e,"getAreaOfPolygon",(function(){return V})),n.d(e,"getBounds",(function(){return J})),n.d(e,"getBoundsOfDistance",(function(){return X})),n.d(e,"getCenter",(function(){return Y})),n.d(e,"getCenterOfBounds",(function(){return K})),n.d(e,"getCompassDirection",(function(){return Q})),n.d(e,"getCoordinateKey",(function(){return y})),n.d(e,"getCoordinateKeys",(function(){return x})),n.d(e,"getDistance",(function(){return U})),n.d(e,"getDistanceFromLine",(function(){return tt})),n.d(e,"getGreatCircleBearing",(function(){return et})),n.d(e,"getLatitude",(function(){return F})),n.d(e,"getLongitude",(function(){return S})),n.d(e,"getPathLength",(function(){return it})),n.d(e,"getPreciseDistance",(function(){return rt})),n.d(e,"getRhumbLineBearing",(function(){return Z})),n.d(e,"getRoughCompassDirection",(function(){return at})),n.d(e,"getSpeed",(function(){return st})),n.d(e,"isDecimal",(function(){return m})),n.d(e,"isPointInLine",(function(){return ot})),n.d(e,"isPointInPolygon",(function(){return lt})),n.d(e,"isPointNearLine",(function(){return ut})),n.d(e,"isPointWithinRadius",(function(){return ht})),n.d(e,"isSexagesimal",(function(){return v})),n.d(e,"isValidCoordinate",(function(){return E})),n.d(e,"isValidLatitude",(function(){return I})),n.d(e,"isValidLongitude",(function(){return N})),n.d(e,"orderByDistance",(function(){return q})),n.d(e,"sexagesimalToDecimal",(function(){return _})),n.d(e,"toDecimal",(function(){return A})),n.d(e,"toRad",(function(){return R})),n.d(e,"toDeg",(function(){return D})),n.d(e,"wktToPolygon",(function(){return pt})),n.d(e,"sexagesimalPattern",(function(){return i})),n.d(e,"earthRadius",(function(){return r})),n.d(e,"MINLAT",(function(){return a})),n.d(e,"MAXLAT",(function(){return s})),n.d(e,"MINLON",(function(){return o})),n.d(e,"MAXLON",(function(){return l})),n.d(e,"longitudeKeys",(function(){return u})),n.d(e,"latitudeKeys",(function(){return h})),n.d(e,"altitudeKeys",(function(){return d})),n.d(e,"distanceConversion",(function(){return p})),n.d(e,"timeConversion",(function(){return f})),n.d(e,"areaConversion",(function(){return g}));var i=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,r=6378137,a=-90,s=90,o=-180,l=180,u=["lng","lon","longitude",0],h=["lat","latitude",1],d=["alt","altitude","elevation","elev",2],p={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},f={m:60,h:3600,d:86400},g={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};g.sqm=g.m2,g.sqkm=g.km2,g.sqft=g.ft2,g.sqyd=g.yd2,g.sqin=g.in2;var y=c((function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)}),"m"),m=c((function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)}),"v"),v=c((function(t){return i.test(t.toString().trim())}),"p"),_=c((function(t){var e=new RegExp(i).exec(t);if(null==e)throw new Error("Given value is not in sexagesimal format");var n=Number(e[2])/60||0,r=Number(e[4])/3600||0,a=parseFloat(e[1])+n+r;return["S","W"].includes(e[7])?-a:a}),"y");function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c(w,"b"),c(M,"M"),c(b,"O");var x=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:u,latitude:h,altitude:d},n=y(t,e.longitude),i=y(t,e.latitude),r=y(t,e.altitude);return M({latitude:i,longitude:n},r?{altitude:r}:{})}),"S"),I=c((function t(e){return m(e)?!(parseFloat(e)>s||e<a):!!v(e)&&t(_(e))}),"t"),N=c((function t(e){return m(e)?!(parseFloat(e)>l||e<o):!!v(e)&&t(_(e))}),"t"),E=c((function(t){var e=x(t),n=e.latitude,i=e.longitude;if(Array.isArray(t)&&t.length>=2)return N(t[0])&&I(t[1]);if(void 0===n||void 0===i)return!1;var r=t[i],a=t[n];return void 0!==a&&void 0!==r&&!1!==I(a)&&!1!==N(r)}),"j");function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){O(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c(T,"w"),c(k,"x"),c(O,"E");var A=c((function t(e){if(m(e))return Number(e);if(v(e))return _(e);if(E(e)){var n=x(e);return Array.isArray(e)?e.map((function(e,n){return[0,1].includes(n)?t(e):e})):k(k(k({},e),n.latitude&&O({},n.latitude,t(e[n.latitude]))),n.longitude&&O({},n.longitude,t(e[n.longitude])))}return Array.isArray(e)?e.map((function(e){return E(e)?t(e):e})):e}),"t"),F=c((function(t,e){var n=y(t,h);if(null!=n){var i=t[n];return!0===e?i:A(i)}}),"A"),S=c((function(t,e){var n=y(t,u);if(null!=n){var i=t[n];return!0===e?i:A(i)}}),"I"),R=c((function(t){return t*Math.PI/180}),"W"),D=c((function(t){return 180*t/Math.PI}),"D"),B=c((function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,r=F(t),a=S(t),s=e/i,u=R(n),h=R(r),c=R(a),d=Math.asin(Math.sin(h)*Math.cos(s)+Math.cos(h)*Math.sin(s)*Math.cos(u)),p=c+Math.atan2(Math.sin(u)*Math.sin(s)*Math.cos(h),Math.cos(s)-Math.sin(h)*Math.sin(d)),f=D(p);return(f<o||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=D(p)),{latitude:D(d),longitude:f}}),"F"),L=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=g[e];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")}),"C"),C=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=p[e];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")}),"k"),P=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(e){case"kmh":return t*f.h*p.km;case"mph":return t*f.h*p.mi;default:return t}}),"T");function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return W(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}c(j,"q"),c(W,"$");var G=c((function(t){var e=Math.pow(10,12);return Math.round(t*e)/e}),"B"),z=c((function(t){var e=j(t.toString().split("."),2),n=e[0],i=e[1],r=Math.abs(Number(n)),a=G(60*Number("0."+(i||0))),s=Math.floor(a),o=G(60*(a%s||0));return r+"° "+Number(s.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(o.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'}),"R"),$=c((function(t){return t>1?1:t<-1?-1:t}),"X"),U=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i=F(t),a=S(t),s=F(e),o=S(e),l=Math.acos($(Math.sin(R(s))*Math.sin(R(i))+Math.cos(R(s))*Math.cos(R(i))*Math.cos(R(a)-R(o))))*r;return Math.round(l/n)*n}),"_"),q=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U;return n="function"==typeof n?n:U,e.slice().sort((function(e,i){return n(t,e)-n(t,i)}))}),"K"),H=c((function(t,e){return q(t,e)[0]}),"Y"),V=c((function(t){var e=0;if(t.length>2){for(var n,i,a,s=0;s<t.length;s++){s===t.length-2?(n=t.length-2,i=t.length-1,a=0):s===t.length-1?(n=t.length-1,i=0,a=1):(n=s,i=s+1,a=s+2);var o=S(t[n]),l=F(t[i]),u=S(t[a]);e+=(R(u)-R(o))*Math.sin(R(l))}e=e*r*r/2}return Math.abs(e)}),"Z"),J=c((function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,e){var n=F(e),i=S(e);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}),"G"),X=c((function(t,e){var n,i,u=F(t),h=S(t),c=R(u),d=R(h),p=e/r,f=c-p,g=c+p,y=R(s),m=R(a),v=R(l),_=R(o);if(f>m&&g<y){var w=Math.asin(Math.sin(p)/Math.cos(c));(n=d-w)<_&&(n+=2*Math.PI),(i=d+w)>v&&(i-=2*Math.PI)}else f=Math.max(f,m),g=Math.min(g,y),n=_,i=v;return[{latitude:D(f),longitude:D(n)},{latitude:D(g),longitude:D(i)}]}),"V"),Y=c((function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var e=t.length,n=t.reduce((function(t,e){var n=R(F(e)),i=R(S(e));return{X:t.X+Math.cos(n)*Math.cos(i),Y:t.Y+Math.cos(n)*Math.sin(i),Z:t.Z+Math.sin(n)}}),{X:0,Y:0,Z:0}),i=n.X/e,r=n.Y/e,a=n.Z/e;return{longitude:D(Math.atan2(r,i)),latitude:D(Math.atan2(a,Math.sqrt(i*i+r*r)))}}),"U"),K=c((function(t){var e=J(t),n=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(i.toFixed(6))}}),"z"),Z=c((function(t,e){var n=R(S(e))-R(S(t)),i=Math.log(Math.tan(R(F(e))/2+Math.PI/4)/Math.tan(R(F(t))/2+Math.PI/4));return Math.abs(n)>Math.PI&&(n=n>0?-1*(2*Math.PI-n):2*Math.PI+n),(D(Math.atan2(n,i))+360)%360}),"H"),Q=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z,i="function"==typeof n?n(t,e):Z(t,e);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}),"J"),tt=c((function(t,e,n){var i=U(e,t),r=U(t,n),a=U(e,n),s=Math.acos($((i*i+a*a-r*r)/(2*i*a))),o=Math.acos($((r*r+a*a-i*i)/(2*r*a)));return s>Math.PI/2?i:o>Math.PI/2?r:Math.sin(s)*i}),"Q"),et=c((function(t,e){var n=F(e),i=S(e),r=F(t),a=S(t);return(D(Math.atan2(Math.sin(R(i)-R(a))*Math.cos(R(n)),Math.cos(R(r))*Math.sin(R(n))-Math.sin(R(r))*Math.cos(R(n))*Math.cos(R(i)-R(a))))+360)%360}),"tt");function nt(t){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}c(nt,"nt");var it=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;return t.reduce((function(t,n){return"object"===nt(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance}),"rt"),rt=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i,a,s,o,l,u,h,c=F(t),d=S(t),p=F(e),f=S(e),g=6356752.314245,y=1/298.257223563,m=R(f-d),v=Math.atan((1-y)*Math.tan(R(parseFloat(c)))),_=Math.atan((1-y)*Math.tan(R(parseFloat(p)))),w=Math.sin(v),M=Math.cos(v),b=Math.sin(_),x=Math.cos(_),I=m,N=100;do{var E=Math.sin(I),T=Math.cos(I);if(0===(u=Math.sqrt(x*E*(x*E)+(M*b-w*x*T)*(M*b-w*x*T))))return 0;i=w*b+M*x*T,a=Math.atan2(u,i),l=i-2*w*b/(o=1-(s=M*x*E/u)*s),isNaN(l)&&(l=0);var k=y/16*o*(4+y*(4-3*o));h=I,I=m+(1-k)*y*s*(a+k*u*(l+k*i*(2*l*l-1)))}while(Math.abs(I-h)>1e-12&&--N>0);if(0===N)return NaN;var O=o*(r*r-g*g)/(g*g),A=1+O/16384*(4096+O*(O*(320-175*O)-768)),D=O/1024*(256+O*(O*(74-47*O)-128)),B=D*u*(l+D/4*(i*(2*l*l-1)-D/6*l*(4*u*u-3)*(4*l*l-3))),L=g*A*(a-B);return Math.round(L/n)*n}),"et"),at=c((function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0}),"it"),st=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U,i=n(t,e),r=Number(e.time)-Number(t.time),a=i/r*1e3;return a}),"ot"),ot=c((function(t,e,n){return U(e,t)+U(t,n)===U(e,n)}),"ut"),lt=c((function(t,e){for(var n=!1,i=e.length,r=-1,a=i-1;++r<i;a=r)(S(e[r])<=S(t)&&S(t)<S(e[a])||S(e[a])<=S(t)&&S(t)<S(e[r]))&&F(t)<(F(e[a])-F(e[r]))*(S(t)-S(e[r]))/(S(e[a])-S(e[r]))+F(e[r])&&(n=!n);return n}),"at"),ut=c((function(t,e,n,i){return tt(t,e,n)<i}),"ct"),ht=c((function(t,e,n){return U(t,e)<n}),"ft");function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dt(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}c(ct,"st"),c(dt,"lt");var pt=c((function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var e=ct(t.split(" "),2),n=e[0],i=e[1];return{longitude:parseFloat(n),latitude:parseFloat(i)}}))}),"dt")}])},"object"==typeof t&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof t?t.geolib=i():n.geolib=i()})),hr=yt(((t,e)=>{I(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),kr=yt(((t,e)=>{I();var n="%[a-f0-9]{2}",i=new RegExp("("+n+")|([^%]+?)","gi"),r=new RegExp("("+n+")+","gi");function a(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],a(n),a(i))}function s(t){try{return decodeURIComponent(t)}catch(r){for(var e=t.match(i)||[],n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(i)||[];return t}}function o(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var i=s(n[0]);i!==n[0]&&(e[n[0]]=i)}n=r.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];t=t.replace(new RegExp(l,"g"),e[l])}return t}c(a,"decodeComponents"),c(s,"decode"),c(o,"customDecodeURIComponent"),e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return o(t)}}})),vr=yt(((t,e)=>{I(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),wr=yt(((t,e)=>{I(),e.exports=function(t,e){for(var n={},i=Object.keys(t),r=Array.isArray(e),a=0;a<i.length;a++){var s=i[a],o=t[s];(r?-1!==e.indexOf(s):e(s,o,t))&&(n[s]=o)}return n}})),_r=yt((t=>{I();var e=hr(),n=kr(),i=vr(),r=wr(),a=c((t=>null==t),"isNullOrUndefined"),s=Symbol("encodeFragmentIdentifier");function o(t){switch(t.arrayFormat){case"index":return e=>(n,i)=>{let r=n.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[h(e,t),"[",r,"]"].join("")]:[...n,[h(e,t),"[",h(r,t),"]=",h(i,t)].join("")]};case"bracket":return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[h(e,t),"[]"].join("")]:[...n,[h(e,t),"[]=",h(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(i,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?i:(r=null===r?"":r,0===i.length?[[h(n,t),e,h(r,t)].join("")]:[[i,h(r,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,h(e,t)]:[...n,[h(e,t),"=",h(i,t)].join("")]}}function l(t){let e;switch(t.arrayFormat){case"index":return(t,n,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=n):i[t]=n};case"bracket":return(t,n,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],n):i[t]=[n]:i[t]=n};case"comma":case"separator":return(e,n,i)=>{let r="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!r&&d(n,t).includes(t.arrayFormatSeparator);n=a?d(n,t):n;let s=r||a?n.split(t.arrayFormatSeparator).map((e=>d(e,t))):null===n?n:d(n,t);i[e]=s};case"bracket-separator":return(e,n,i)=>{let r=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!r)return void(i[e]=n&&d(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>d(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],a):i[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}function u(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function d(t,e){return e.decode?n(t):t}function p(t){return Array.isArray(t)?t.sort():"object"==typeof t?p(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function f(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function g(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}function y(t){let e=(t=f(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function m(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function v(t,e){u((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=l(e),r=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return r;for(let a of t.split("&")){if(""===a)continue;let[t,s]=i(e.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:d(s,e),n(d(t,e),s,r)}for(let t of Object.keys(r)){let n=r[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=m(n[t],e);else r[t]=m(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{let n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=p(n):t[e]=n,t}),Object.create(null))}c(o,"encoderForArrayFormat"),c(l,"parserForArrayFormat"),c(u,"validateArrayFormatSeparator"),c(h,"encode"),c(d,"decode"),c(p,"keysSorter"),c(f,"removeHash"),c(g,"getHash"),c(y,"extract"),c(m,"parseValue"),c(v,"parse"),t.extract=y,t.parse=v,t.stringify=(t,e)=>{if(!t)return"";u((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=c((n=>e.skipNull&&a(t[n])||e.skipEmptyString&&""===t[n]),"shouldFilter"),i=o(e),r={};for(let e of Object.keys(t))n(e)||(r[e]=t[e]);let s=Object.keys(r);return!1!==e.sort&&s.sort(e.sort),s.map((n=>{let r=t[n];return void 0===r?"":null===r?h(n,e):Array.isArray(r)?0===r.length&&"bracket-separator"===e.arrayFormat?h(n,e)+"[]":r.reduce(i(n),[]).join("&"):h(n,e)+"="+h(r,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:v(y(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);let i=f(e.url).split("?")[0]||"",r=t.extract(e.url),a=t.parse(r,{sort:!1}),o=Object.assign(a,e.query),l=t.stringify(o,n);l&&(l=`?${l}`);let u=g(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${i}${l}${u}`},t.pick=(e,n,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[s]:!1},i);let{url:a,query:o,fragmentIdentifier:l}=t.parseUrl(e,i);return t.stringifyUrl({url:a,query:r(o,n),fragmentIdentifier:l},i)},t.exclude=(e,n,i)=>{let r=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,r,i)}})),Cr=yt(((t,e)=>{var n,i;I(),n=t,i=function(){"use strict";var t=c((function(){return t=Object.assign||c((function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}),"__assign"),t.apply(this,arguments)}),"__assign");function e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}c(e,"__values"),c(n,"__read");var i,r="KEYS",a="VALUES",s="",o=function(){function t(t,e){var n=t._tree,i=Array.from(n.keys());this.set=t,this._type=e,this._path=i.length>0?[{node:n,keys:i}]:[]}return c(t,"TreeIterator"),t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=l(this._path),e=t.node,n=t.keys;if(l(n)===s)return{done:!1,value:this.result()};var i=e.get(l(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=l(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return l(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return l(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case r:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),l=c((function(t){return t[t.length-1]}),"last$1"),u=c((function(t,e,n){var i=new Map;if(void 0===e)return i;for(var r=e.length+1,a=r+n,s=new Uint8Array(a*r).fill(n+1),o=0;o<r;++o)s[o]=o;for(var l=1;l<a;++l)s[l*r]=l;return h(t,e,n,i,s,1,r,""),i}),"fuzzySearch"),h=c((function(t,n,i,r,a,o,l,u){var c,d,p=o*l;try{t:for(var f=e(t.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y===s){var m=a[p-1];m<=i&&r.set(u,[t.get(y),m])}else{for(var v=o,_=0;_<y.length;++_,++v){for(var w=y[_],M=l*v,b=M-l,x=a[M],I=Math.max(0,v-i-1),N=Math.min(l-1,v+i),E=I;E<N;++E){var T=w!==n[E],k=a[b+E]+ +T,O=a[b+E+1]+1,A=a[M+E]+1,F=a[M+E+1]=Math.min(k,O,A);F<x&&(x=F)}if(x>i)continue t}h(t.get(y),n,i,r,a,v,l,u+y)}}}catch(t){c={error:t}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}}),"recurse"),d=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return c(t,"SearchableMap"),t.prototype.atPrefix=function(i){var r,a;if(!i.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=n(p(this._tree,i.slice(this._prefix.length)),2),l=o[0],u=o[1];if(void 0===l){var h=n(_(u),2),c=h[0],d=h[1];try{for(var f=e(c.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y!==s&&y.startsWith(d)){var m=new Map;return m.set(y.slice(d.length),c.get(y)),new t(m,i)}}}catch(t){r={error:t}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}return new t(l,i)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,y(this._tree,t)},t.prototype.entries=function(){return new o(this,"ENTRIES")},t.prototype.forEach=function(t){var i,r;try{for(var a=e(this),s=a.next();!s.done;s=a.next()){var o=n(s.value,2);t(o[0],o[1],this)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},t.prototype.fuzzyGet=function(t,e){return u(this._tree,t,e)},t.prototype.get=function(t){var e=f(this._tree,t);return void 0!==e?e.get(s):void 0},t.prototype.has=function(t){var e=f(this._tree,t);return void 0!==e&&e.has(s)},t.prototype.keys=function(){return new o(this,r)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,g(this._tree,t).set(s,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=g(this._tree,t);return n.set(s,e(n.get(s))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=g(this._tree,t),i=n.get(s);return void 0===i&&n.set(s,i=e()),i},t.prototype.values=function(){return new o(this,a)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(i){var r,a,s=new t;try{for(var o=e(i),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1];s.set(h,c)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return s},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),p=c((function(t,n,i){var r,a;if(void 0===i&&(i=[]),0===n.length||null==t)return[t,i];try{for(var o=e(t.keys()),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==s&&n.startsWith(u))return i.push([t,u]),p(t.get(u),n.slice(u.length),i)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return i.push([t,n]),p(void 0,"",i)}),"trackDown"),f=c((function(t,n){var i,r;if(0===n.length||null==t)return t;try{for(var a=e(t.keys()),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==s&&n.startsWith(l))return f(t.get(l),n.slice(l.length))}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}),"lookup"),g=c((function(t,n){var i,r,a=n.length;t:for(var o=0;t&&o<a;){try{for(var l=(i=void 0,e(t.keys())),u=l.next();!u.done;u=l.next()){var h=u.value;if(h!==s&&n[o]===h[0]){for(var c=Math.min(a-o,h.length),d=1;d<c&&n[o+d]===h[d];)++d;var p=t.get(h);if(d===h.length)t=p;else{var f=new Map;f.set(h.slice(d),p),t.set(n.slice(o,o+d),f),t.delete(h),t=f}o+=d;continue t}}}catch(t){i={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}var g=new Map;return t.set(n.slice(o),g),g}return t}),"createPath"),y=c((function(t,e){var i=n(p(t,e),2),r=i[0],a=i[1];if(void 0!==r)if(r.delete(s),0===r.size)m(a);else if(1===r.size){var o=n(r.entries().next().value,2),l=o[0],u=o[1];v(a,l,u)}}),"remove"),m=c((function(t){if(0!==t.length){var e=n(_(t),2),i=e[0],r=e[1];if(i.delete(r),0===i.size)m(t.slice(0,-1));else if(1===i.size){var a=n(i.entries().next().value,2),o=a[0],l=a[1];o!==s&&v(t.slice(0,-1),o,l)}}}),"cleanup"),v=c((function(t,e,i){if(0!==t.length){var r=n(_(t),2),a=r[0],s=r[1];a.set(s+e,i),a.delete(s)}}),"merge"),_=c((function(t){return t[t.length-1]}),"last"),w="or",M=function(){function i(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=t(t(t({},E),e),{searchOptions:t(t({},T),e.searchOptions||{})}),this._index=new d,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return c(i,"MiniSearch"),i.prototype.add=function(t){var n,i,r,a,s=this._options,o=s.extractField,l=s.tokenize,u=s.processTerm,h=s.fields,c=s.idField,d=o(t,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,t);try{for(var f=e(h),g=f.next();!g.done;g=f.next()){var y=g.value,m=o(t,y);if(null!=m){var v=l(m.toString(),y),_=this._fieldIds[y],w=new Set(v).size;this.addFieldLength(p,_,this._documentCount-1,w);try{for(var M=(r=void 0,e(v)),b=M.next();!b.done;b=M.next()){var x=u(b.value,y);x&&this.addTerm(_,p,x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(a=M.return)&&a.call(M)}finally{if(r)throw r.error}}}}}catch(t){n={error:t}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},i.prototype.addAll=function(t){var n,i;try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.add(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},i.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var i=e.chunkSize,r=void 0===i?10:i,a={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,i){var a=t.chunk,s=t.promise;return a.push(e),(i+1)%r==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},i.prototype.remove=function(t){var i,r,a,s,o,l,u=this._options,h=u.tokenize,c=u.processTerm,d=u.extractField,p=u.fields,f=u.idField,g=d(t,f);if(null==g)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var y=e(this._documentIds),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0];if(g===v[1]){try{for(var w=(a=void 0,e(p)),M=w.next();!M.done;M=w.next()){var b=M.value,x=d(t,b);if(null!=x){var I=h(x.toString(),b),N=this._fieldIds[b],E=new Set(I).size;this.removeFieldLength(_,N,this._documentCount,E);try{for(var T=(o=void 0,e(I)),k=T.next();!k.done;k=T.next()){var O=c(k.value,b);O&&this.removeTerm(N,_,O)}}catch(t){o={error:t}}finally{try{k&&!k.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}}}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return this._storedFields.delete(_),this._documentIds.delete(_),this._fieldLength.delete(_),void(this._documentCount-=1)}}}catch(t){i={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(i)throw i.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"))},i.prototype.removeAll=function(t){var n,i;if(t)try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.remove(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new d,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},i.prototype.search=function(t,i){var r,a;void 0===i&&(i={});var s=this.executeQuery(t,i),o=[];try{for(var l=e(s),u=l.next();!u.done;u=l.next()){var h=n(u.value,2),c=h[0],d=h[1],p=d.score,f=d.terms,g=d.match,y=f.length,m={id:this._documentIds.get(c),score:p*y,terms:Object.keys(g),match:g};Object.assign(m,this._storedFields.get(c)),(null==i.filter||i.filter(m))&&o.push(m)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o.sort(F),o},i.prototype.autoSuggest=function(i,r){var a,s,o,l;void 0===r&&(r={}),r=t(t({},k),r);var u=new Map;try{for(var h=e(this.search(i,r)),c=h.next();!c.done;c=h.next()){var d=c.value,p=d.score,f=(M=d.terms).join(" ");null!=(_=u.get(f))?(_.score+=p,_.count+=1):u.set(f,{score:p,terms:M,count:1})}}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}var g=[];try{for(var y=e(u),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0],w=v[1],M=(p=w.score,w.terms),b=w.count;g.push({suggestion:_,terms:M,score:p/b})}}catch(t){o={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return g.sort(F),g},Object.defineProperty(i.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),i.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return i.loadJS(JSON.parse(t),e)},i.getDefault=function(t){if(E.hasOwnProperty(t))return b(E,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},i.loadJS=function(t,r){var a,s,o,l,u=t.index,h=t.documentCount,c=t.nextId,p=t.documentIds,f=t.fieldIds,g=t.fieldLength,y=t.averageFieldLength,m=t.storedFields,v=t.serializationVersion;if(1!==v&&2!==v)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var _=new i(r);_._documentCount=h,_._nextId=c,_._documentIds=R(p),_._fieldIds=f,_._fieldLength=R(g),_._avgFieldLength=y,_._storedFields=R(m),_._index=new d;try{for(var w=e(u),M=w.next();!M.done;M=w.next()){var b=n(M.value,2),x=b[0],I=b[1],N=new Map;try{for(var E=(o=void 0,e(Object.keys(I))),T=E.next();!T.done;T=E.next()){var k=T.value,O=I[k];1===v&&(O=O.ds),N.set(parseInt(k,10),R(O))}}catch(t){o={error:t}}finally{try{T&&!T.done&&(l=E.return)&&l.call(E)}finally{if(o)throw o.error}}_._index.set(x,N)}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return _},i.prototype.executeQuery=function(e,n){var i=this;if(void 0===n&&(n={}),"string"!=typeof e){var r=t(t(t({},n),e),{queries:void 0}),a=e.queries.map((function(t){return i.executeQuery(t,r)}));return this.combineResults(a,e.combineWith)}var s=this._options,o=s.tokenize,l=s.processTerm,u=s.searchOptions,h=t(t({tokenize:o,processTerm:l},u),n),c=h.tokenize,d=h.processTerm,p=c(e).map((function(t){return d(t)})).filter((function(t){return!!t})).map(N(h)).map((function(t){return i.executeQuerySpec(t,h)}));return this.combineResults(p,h.combineWith)},i.prototype.executeQuerySpec=function(i,r){var a,s,o,l,u,h,c=t(t({},this._options.searchOptions),r),d=(c.fields||this._options.fields).reduce((function(e,n){var i;return t(t({},e),((i={})[n]=b(e,n)||1,i))}),c.boost||{}),p=c.boostDocument,f=c.weights,g=c.maxFuzzy,y=t(t({},T.weights),f),m=y.fuzzy,v=y.prefix,_=this._index.get(i.term),w=this.termResults(i.term,i.term,1,_,d,p);if(i.prefix&&(u=this._index.atPrefix(i.term)),i.fuzzy){var M=!0===i.fuzzy?.2:i.fuzzy,x=M<1?Math.min(g,Math.round(i.term.length*M)):M;x&&(h=this._index.fuzzyGet(i.term,x))}if(u)try{for(var I=e(u),N=I.next();!N.done;N=I.next()){var E=n(N.value,2),k=E[0],O=E[1];if(R=k.length-i.term.length){null==h||h.delete(k);var A=v*k.length/(k.length+.3*R);this.termResults(i.term,k,A,O,d,p,w)}}}catch(t){a={error:t}}finally{try{N&&!N.done&&(s=I.return)&&s.call(I)}finally{if(a)throw a.error}}if(h)try{for(var F=e(h.keys()),S=F.next();!S.done;S=F.next()){k=S.value;var R,D=n(h.get(k),2),B=D[0];(R=D[1])&&(A=m*k.length/(k.length+R),this.termResults(i.term,k,A,B,d,p,w))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(l=F.return)&&l.call(F)}finally{if(o)throw o.error}}return w},i.prototype.combineResults=function(t,e){if(void 0===e&&(e=w),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(x[n])||new Map},i.prototype.toJSON=function(){var t,i,r,a,s=[];try{for(var o=e(this._index),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1],d={};try{for(var p=(r=void 0,e(c)),f=p.next();!f.done;f=p.next()){var g=n(f.value,2),y=g[0],m=g[1];d[y]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}s.push([h,d])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:s,serializationVersion:2}},i.prototype.termResults=function(t,n,i,r,a,s,o){var l,u,h,c,d;if(void 0===o&&(o=new Map),null==r)return o;try{for(var p=e(Object.keys(a)),f=p.next();!f.done;f=p.next()){var g=f.value,y=a[g],m=this._fieldIds[g],v=r.get(m);if(null!=v){var _=v.size,w=this._avgFieldLength[m];try{for(var M=(h=void 0,e(v.keys())),x=M.next();!x.done;x=M.next()){var N=x.value,E=s?s(this._documentIds.get(N),n):1;if(E){var T=v.get(N),k=this._fieldLength.get(N)[m],A=i*y*E*I(T,_,this._documentCount,k,w),F=o.get(N);if(F){F.score+=A,O(F.terms,t);var S=b(F.match,n);S?S.push(g):F.match[n]=[g]}else o.set(N,{score:A,terms:[t],match:(d={},d[n]=[g],d)})}}}catch(t){h={error:t}}finally{try{x&&!x.done&&(c=M.return)&&c.call(M)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}return o},i.prototype.addTerm=function(t,e,n){var i=this._index.fetch(n,S),r=i.get(t);if(null==r)(r=new Map).set(e,1),i.set(t,r);else{var a=r.get(e);r.set(e,(a||0)+1)}},i.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var i=this._index.fetch(n,S),r=i.get(t);null==r||null==r.get(e)?this.warnDocumentChanged(e,t,n):r.get(e)<=1?r.size<=1?i.delete(t):r.delete(e):r.set(e,r.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},i.prototype.warnDocumentChanged=function(t,n,i){var r,a;if(null!=console&&null!=console.warn)try{for(var s=e(Object.keys(this._fieldIds)),o=s.next();!o.done;o=s.next()){var l=o.value;if(this._fieldIds[l]===n)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(i,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}},i.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},i.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},i.prototype.addFieldLength=function(t,e,n,i){var r=this._fieldLength.get(t);null==r&&this._fieldLength.set(t,r=[]),r[e]=i;var a=(this._avgFieldLength[e]||0)*n+i;this._avgFieldLength[e]=a/(n+1)},i.prototype.removeFieldLength=function(t,e,n,i){var r=this._avgFieldLength[e]*n-i;this._avgFieldLength[e]=r/(n-1)},i.prototype.saveStoredFields=function(t,n){var i,r,a=this._options,s=a.storeFields,o=a.extractField;if(null!=s&&0!==s.length){var l=this._storedFields.get(t);null==l&&this._storedFields.set(t,l={});try{for(var u=e(s),h=u.next();!h.done;h=u.next()){var c=h.value,d=o(n,c);void 0!==d&&(l[c]=d)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}}},i}(),b=c((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),x=((i={}).or=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null==l)t.set(o,n.get(o));else{var u=n.get(o),h=u.score,c=u.terms,d=u.match;l.score=l.score+h,l.match=Object.assign(l.match,d),A(l.terms,c)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i.and=function(t,n){var i,r,a=new Map;try{for(var s=e(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=t.get(l);if(null!=u){var h=n.get(l),c=h.score,d=h.terms,p=h.match;A(u.terms,d),a.set(l,{score:u.score+c,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a},i.and_not=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;t.delete(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i),I=c((function(t,e,n,i,r){return Math.log(1+(n-e+.5)/(e+.5))*(.5+2.2*t/(t+1.2*(1-.7+.7*i/r)))}),"calcBM25Score"),N=c((function(t){return function(e,n,i){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,i):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,i):!0===t.prefix}}}),"termToQuerySpec"),E={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(D)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},T={combineWith:w,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},k={prefix:function(t,e,n){return e===n.length-1}},O=c((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),A=c((function(t,n){var i,r;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var o=s.value;t.includes(o)||t.push(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}),"assignUniqueTerms"),F=c((function(t,e){var n=t.score;return e.score-n}),"byScore"),S=c((function(){return new Map}),"createMap"),R=c((function(t){var n,i,r=new Map;try{for(var a=e(Object.keys(t)),s=a.next();!s.done;s=a.next()){var o=s.value;r.set(parseInt(o,10),t[o])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r}),"objectToNumericMap"),D=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;return M},"object"==typeof t&&void 0!==e?e.exports=i():"function"==typeof define&&define.amd?define(i):(n="undefined"!=typeof globalThis?globalThis:n||self).MiniSearch=i()}));eo(exports,{Mappedin:()=>jt,MappedinDestinationSet:()=>Nt,OfflineSearch:()=>Xa,getVenue:()=>Fi,getVenueBundle:()=>Li,initialize:()=>ns}),I(),I();var Dr=dn(qi());I(),I(),I();var Ui=dn(Vi());I();var Kn=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:i=0,distance:r=0,angle:a=0}){let s,o;if(d(this,"origin"),d(this,"destination"),d(this,"vortex"),d(this,"distance"),d(this,"angle"),d(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=a,n?(this.distance=0,this.angle=0,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,o=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=i*o+s):(s=e.weight&&e.weight>=0?e.weight:0,o=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}};c(Kn,"Edge");var hn=Kn;I();var Zn="mi-debug",no={loggingEnabled(){var t;return"development"===P.env.NODE_ENV||"dev"===P.env.NODE_ENV||"test"===P.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Zn))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},D=no;function io(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],i=(0,Ui.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(r*r+a*a)/i}catch(t){return D.error(t),1}}function ro(t,e){let n=t.x-e.x,i=t.y-e.y;return(Math.atan2(i,n)+2.5*Math.PI)%(2*Math.PI)}c(io,"getMapScale"),c(ro,"getAngle");var Qn=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:i=!1}){d(this,"edges"),d(this,"nodesById"),d(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:io(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:i?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new hn({angle:ro(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let i=e;for(;i<t.nodes.length;){let e=this.nodesById[t.nodes[i]];if(i++,null==e)continue;let r=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,s=Math.abs(r-a);this.edges[n.id].push(new hn({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new hn({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let i=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===i.length||0===r.length)return[];let a=[],s={},o={};for(i.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);a.push({origin:t,priority:e}),s[t.id]=null,o[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(r.includes(t.origin)){let e=[],n=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let i=e.vortex&&!1===e.vortex.accessible;if(n&&(i||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=o[t.origin.id]+e.weight;if(null==o[e.destination.id]||l<o[e.destination.id]){o[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);a.push({origin:e.destination,priority:t}),s[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,i=t.x-e.x,r=t.y-e.y,a=i*i+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let i=this.getDistance(t,n);return Math.min(e,i)}),Number.MAX_VALUE)}};c(Qn,"NavigationGraph");var je,Ce,kt,ei=Qn;function oo(t){switch(t){case kt.DOWN:case kt.UP:return`${t} `;default:return""}}I(),I(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(je||(je={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Ce||(Ce={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(kt||(kt={})),c(oo,"vortexDirectionTest");var ti=class{constructor({origin:t,action:e,distance:n,atLocation:i,instruction:r}){d(this,"node"),d(this,"instruction"),d(this,"action"),d(this,"atLocation"),d(this,"type"),d(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=i,this.instruction="",r?this.instruction=r:(null!=e&&e.type===je.DEPARTURE?this.instruction=null!=i?`Depart from ${i.name}`:"Depart from current location":null!=e&&e.type===je.ARRIVAL?this.instruction=null!=i?`Arrive at ${i.name}`:"Arrive at destination":null!=e&&e.type===je.TAKEVORTEX?this.instruction=`Take ${i&&i.name} ${oo(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===je.EXITVORTEX?this.instruction=`Exit ${i&&i.name} at ${e.toMap.name}`:null!=e&&e.bearing===Ce.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Ce.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Ce.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Ce.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Ce.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===je.TURN&&i&&(this.instruction+=` at ${i.name}`))}};c(ti,"Directive");var mn,bt=ti;(mn||(mn={})).NO_VALID_PATH="No Valid Path Available";var gn=.1*Math.PI;function fn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}c(fn,"differenceBetweenAngles");var ai=class{constructor({locations:t,nodes:e,vortexes:n,maps:i,showVortexNames:r}){d(this,"graph"),d(this,"locationsByNodeId"),this.graph=new ei({maps:i,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let i=0,r=0,a=t;for(;Math.abs(i)<e&&r<n;){let t=this.graph.edges[a.destination.id],s=null,o=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-fn(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-fn(a.angle,e.angle);if(null==s)return null;{if(Math.abs(o)>=e||(i+=o,r+=s.distance,Math.abs(i)>=e||r>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;a=s}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:i,arriveAt:r}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new bt({distance:0,instruction:mn.NO_VALID_PATH})],path:[]};let s=0,o=new Array(a.length+1);for(let t=0;t<a.length;t++)o[t]=a[t].origin;o[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,o=e.destination;if(s+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new bt({action:{type:je.DEPARTURE},atLocation:i,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],i=this.graph.mapsById[o.map],r=kt.NONE;if(null!=t.elevation&&null!=i.elevation){let e=t.elevation-i.elevation;e>0?r=kt.DOWN:e<0&&(r=kt.UP)}l.push(new bt({action:{direction:r,fromMap:t,toMap:i,type:je.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new bt({action:{fromMap:t,toMap:e,type:je.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let i=-fn(h.angle,e.angle),r=t.reduce(((t,n)=>{let i=-fn(e.angle,n.angle);return Math.min(t,Math.abs(i))}),Math.PI);if(Math.abs(i)>=gn||Math.abs(r)<=gn){let t;t=i<=-Math.PI/4?Ce.RIGHT:i<=-gn?Ce.SLIGHTRIGHT:i<=gn?Ce.STRAIGHT:i<=Math.PI/4?Ce.SLIGHTLEFT:Ce.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let i=new bt({action:{bearing:t,referencePosition:"At",type:je.TURN},atLocation:e,distance:c,origin:n});i.type=t,l.push(i)}else l.push(new bt({action:{bearing:t,referencePosition:"At",type:je.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new bt({action:{type:je.ARRIVAL},atLocation:r,distance:s-d<0?0:s-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let p=[],f=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===je.TAKEVORTEX?(f=e.node,p.unshift(e)):n&&n.type===je.TURN&&null!=f?this.graph.getDistance(e.node,f)>5&&p.unshift(e):p.unshift(e)}return{distance:s,instructions:p,path:o}}};c(ai,"Navigator");var ni=ai;function ii(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return $i(this.cover(e,n),e,n,t)}function $i(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,s,o,l,u,h,c,d,p=t._root,f={data:i},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,r=p,!(p=p[c=h<<1|u]))return r[c]=f,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&n===l)return f.next=p,r?r[c]=f:t._root=f,t;do{r=r?r[c]=new Array(4):t._root=new Array(4),(u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s}while((c=h<<1|u)==(d=(l>=s)<<1|o>=a));return r[d]=p,r[c]=f,t}function Wi(t){var e,n,i,r,a=t.length,s=new Array(a),o=new Array(a),l=1/0,u=1/0,h=-1/0,c=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(s[n]=i,o[n]=r,i<l&&(l=i),i>h&&(h=i),r<u&&(u=r),r>c&&(c=r));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)$i(this,s[n],o[n],t[n]);return this}function ri(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var s,o,l=r-n||1,u=this._root;n>t||t>=r||i>e||e>=a;)switch(o=(e<i)<<1|t<n,s=new Array(4),s[o]=u,u=s,l*=2,o){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function oi(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function si(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Te(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function li(t,e,n){var i,r,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Te(g,h,c,d,p)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(a=l.y0)>p||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(r+s)/2,m=(a+o)/2;f.push(new Te(g[3],y,m,s,o),new Te(g[2],r,m,y,o),new Te(g[1],y,a,s,m),new Te(g[0],r,a,y,m)),(u=(e>=m)<<1|t>=y)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var v=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=t-M,c=e-M,d=t+M,p=e+M,i=g.data}}return i}function ui(t){if(isNaN(a=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,i,r,a,s,o,l,u,h,c,d,p=this._root,f=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((u=a>=(o=(f+y)/2))?f=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[c=h<<1|u]))return this;if(!p.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[c]=r:delete e[c],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=r,this)}function Hi(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ci(){return this._root}function di(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function pi(t){var e,n,i,r,a,s,o=[],l=this._root;for(l&&o.push(new Te(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,s=e.y1)&&l.length){var u=(i+a)/2,h=(r+s)/2;(n=l[3])&&o.push(new Te(n,u,h,a,s)),(n=l[2])&&o.push(new Te(n,i,h,u,s)),(n=l[1])&&o.push(new Te(n,u,r,a,h)),(n=l[0])&&o.push(new Te(n,i,r,u,h))}return this}function hi(t){var e,n=[],i=[];for(this._root&&n.push(new Te(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,s=e.x0,o=e.y0,l=e.x1,u=e.y1,h=(s+l)/2,c=(o+u)/2;(a=r[0])&&n.push(new Te(a,s,o,h,c)),(a=r[1])&&n.push(new Te(a,h,o,l,c)),(a=r[2])&&n.push(new Te(a,s,c,h,u)),(a=r[3])&&n.push(new Te(a,h,c,l,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function Ji(t){return t[0]}function mi(t){return arguments.length?(this._x=t,this):this._x}function Xi(t){return t[1]}function gi(t){return arguments.length?(this._y=t,this):this._y}function ua(t,e,n){var i=new fi(null==e?Ji:e,null==n?Xi:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function fi(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Yi(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}I(),I(),I(),I(),c(ii,"default"),c($i,"add"),c(Wi,"addAll"),I(),c(ri,"default"),I(),c(oi,"default"),I(),c(si,"default"),I(),I(),c(Te,"default"),c(li,"default"),I(),c(ui,"default"),c(Hi,"removeAll"),I(),c(ci,"default"),I(),c(di,"default"),I(),c(pi,"default"),I(),c(hi,"default"),I(),c(Ji,"defaultX"),c(mi,"default"),I(),c(Xi,"defaultY"),c(gi,"default"),c(ua,"quadtree"),c(fi,"Quadtree"),c(Yi,"leaf_copy");var Le=ua.prototype=fi.prototype;Le.copy=function(){var t,e,n=new fi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Yi(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Yi(e));return n},Le.add=ii,Le.addAll=Wi,Le.cover=ri,Le.data=oi,Le.extent=si,Le.find=li,Le.remove=ui,Le.removeAll=Hi,Le.root=ci,Le.size=di,Le.visit=pi,Le.visitAfter=hi,Le.x=mi,Le.y=gi;var He,xe,Ot=class{constructor(t){N(this,He,void 0),d(this,"categories"),d(this,"locations"),d(this,"vortexes"),d(this,"maps"),d(this,"nodes"),d(this,"polygons"),d(this,"events"),d(this,"mapGroups"),d(this,"locationStates"),d(this,"rankings"),N(this,xe,{}),_(this,He,t)}get polygonsByMapId(){if(u(this,xe).polygonsByMapId)return u(this,xe).polygonsByMapId;let t,e={};for(let n=0,i=u(this,He).polygons.length;n<i;++n)t=u(this,He).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).polygonsByMapId=n,u(this,xe).polygonsByMapId}get nodesByMapId(){if(u(this,xe).nodesByMapId)return u(this,xe).nodesByMapId;let t,e={};for(let n=0,i=u(this,He).nodes.length;n<i;++n)t=u(this,He).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).nodesByMapId=n,u(this,xe).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(u(this,xe).nodeTreesByMap||(u(this,xe).nodeTreesByMap=new Map),!u(this,xe).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],i=ua();i.x((t=>t.x)),i.y((t=>t.y)),i.addAll(e),u(this,xe).nodeTreesByMap.set(t,i)}return u(this,xe).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(u(this,xe).locationsByMapId)return u(this,xe).locationsByMapId;let t,e={};for(let n=0,i=u(this,He).locations.length;n<i;++n){t=u(this,He).locations[n];for(let n=0,i=t.polygons.length;n<i;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).locationsByMapId=n,u(this,xe).locationsByMapId}static create(t){return Ot.instances.has(t)||Ot.instances.set(t,new Ot(t)),Ot.instances.get(t)}static clear(){Ot.instances.clear()}},yn=Ot;c(yn,"MappedinCache"),He=new WeakMap,xe=new WeakMap,d(yn,"instances",new Map);var Re=yn;I(),I(),I(),I();var Ki=" ",Fe=class{static get separator(){return Ki}static set separator(t){Ki=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let i=null,r=null,a=null,s=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),i=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),r++),r=("000"+r).slice(-3),a<10&&(a="0"+a),i=r+"°"+Fe.separator+a+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,r++),r=("000"+r).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=r+"°"+Fe.separator+a+"′"+Fe.separator+s+"″"}return i}static toLat(t,e,n){let i=Fe.toDms(Fe.wrap90(t),e,n);return null===i?"–":i.slice(1)+Fe.separator+(t<0?"S":"N")}static toLon(t,e,n){let i=Fe.toDms(Fe.wrap180(t),e,n);return null===i?"–":i+Fe.separator+(t<0?"W":"E")}static toBrng(t,e,n){let i=Fe.toDms(Fe.wrap360(t),e,n);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=Fe.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};c(Fe,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var te=Fe,fe=Math.PI,R=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=te.wrap90(Number(t)),this._lon=te.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?te.wrap90(te.parse(t)):te.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?te.wrap90(te.parse(t)):te.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?[n,e]=i.coordinates:(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(n=i.longitude),null!=i.lng&&(n=i.lng),null!=i.lon&&(n=i.lon),e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new R(e,n)}distanceTo(t,e=6371e3){if(t instanceof R||(t=R.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,i=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),s=a-i,o=t.lon.toRadians()-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(i),a=Math.sin(i)*Math.cos(n),s=Math.atan2(a,r).toDegrees();return te.wrap360(s)}finalBearingTo(t){t instanceof R||(t=R.parse(t));let e=t.initialBearingTo(this)+180;return te.wrap360(e)}midpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),a=Math.cos(e),s=0,o=Math.sin(e),l={x:a+Math.cos(i)*Math.cos(r),y:s+Math.cos(i)*Math.sin(r),z:o+Math.sin(i)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new R(c,d)}intermediatePointTo(t,e){if(t instanceof R||(t=R.parse(t)),this.equals(t))return new R(this.lat,this.lon);let n=this.lat.toRadians(),i=this.lon.toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=r-n,o=a-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(i)+c*Math.cos(r)*Math.cos(a),p=h*Math.cos(n)*Math.sin(i)+c*Math.cos(r)*Math.sin(a),f=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(f,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=g.toDegrees(),v=y.toDegrees();return new R(m,v)}destinationPoint(t,e,n=6371e3){let i=t/n,r=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(i)+Math.cos(a)*Math.sin(i)*Math.cos(r),l=Math.asin(o),u=Math.sin(r)*Math.sin(i)*Math.cos(a),h=Math.cos(i)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),p=c.toDegrees();return new R(d,p)}static intersection(t,e,n,i){if(t instanceof R||(t=R.parse(t)),n instanceof R||(n=R.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(i))throw new TypeError(`invalid brng2 ‘${i}’`);let r=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(i).toRadians(),h=s-r,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new R(t.lat,t.lon);let p=(Math.sin(s)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),f=(Math.sin(r)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(o-a)>0?g:2*fe-g),v=(Math.sin(o-a)>0?2*fe-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let _=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*_),M=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(w)+Math.cos(r)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(r),Math.cos(w)-Math.sin(r)*Math.sin(M)),x=M.toDegrees(),I=b.toDegrees();return new R(x,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(a-s))*i}alongTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(r)*Math.sin(a-s));return Math.acos(Math.cos(r)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let i=Number(n).toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=e.lat.toRadians(),o=e.lon.toRadians()-a,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(o),u=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(o)-Math.cos(r)*Math.sin(s)*Math.cos(i),h=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(o);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),p=a+c+d,f=(a+c-d).toDegrees(),g=p.toDegrees();return{lon1:te.wrap180(f),lon2:te.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof R||(t=R.parse(t));let n=e,i=this.lat.toRadians(),r=t.lat.toRadians(),a=r-i,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>fe&&(s=s>0?-(2*fe-s):2*fe+s);let o=Math.log(Math.tan(r/2+fe/4)/Math.tan(i/2+fe/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians();Math.abs(i)>fe&&(i=i>0?-(2*fe-i):2*fe+i);let r=Math.log(Math.tan(n/2+fe/4)/Math.tan(e/2+fe/4)),a=Math.atan2(i,r).toDegrees();return te.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let i=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(e).toRadians(),s=t/n,o=s*Math.cos(a),l=i+o;Math.abs(l)>fe/2&&(l=l>0?fe-l:-fe-l);let u=Math.log(Math.tan(l/2+fe/4)/Math.tan(i/2+fe/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(i),c=r+s*Math.sin(a)/h,d=l.toDegrees(),p=c.toDegrees();return new R(d,p)}rhumbMidpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>fe&&(n+=2*fe);let a=(e+i)/2,s=Math.tan(fe/4+e/2),o=Math.tan(fe/4+i/2),l=Math.tan(fe/4+a/2),u=((r-n)*Math.log(l)+n*Math.log(o)-r*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+r)/2);let h=a.toDegrees(),c=u.toDegrees();return new R(h,c)}static areaOf(t,e=6371e3){let n=e,i=t[0].equals(t[t.length-1]);i||t.push(t[0]);let r=t.length-1,a=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),i=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(i/2)),1+Math.tan(n/2)*Math.tan(i/2))}o(t)&&(a=Math.abs(a)-2*fe);let s=Math.abs(a*n*n);return i||t.pop(),s;function o(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let i=0;i<t.length-1;i++){let r=t[i].initialBearingTo(t[i+1]),a=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(a-r+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90}}equals(t){return t instanceof R||(t=R.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${te.toLat(this.lat,t,e)}, ${te.toLon(this.lon,t,e)}`}};c(R,"LatLonSpherical"),I(),I(),I();var Nt=class{constructor(t){d(this,"destinations",[]),this.destinations=t}};c(Nt,"MappedinDestinationSet"),I();var ca,rt,Dt=class{constructor(t,e){N(this,ca,void 0),N(this,rt,void 0),d(this,"distance",0),d(this,"path",[]),d(this,"instructions",[]),_(this,rt,t),_(this,ca,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,i,r,a,s,o,l,h,c,d,p;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(i=null==(n=u(this,rt))?void 0:n._vortexesById)?void 0:i[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(s=null==(a=u(this,rt))?void 0:a._nodesById)?void 0:s[t.node.id]:void 0};return((null==(o=f.action)?void 0:o.type)===je.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===je.EXITVORTEX)&&(f.action.fromMap=null==(c=u(this,rt)._mapsById)?void 0:c[null==(h=f.action)?void 0:h.fromMap.id],f.action.toMap=null==(p=u(this,rt)._mapsById)?void 0:p[null==(d=f.action)?void 0:d.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=u(this,rt))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return u(this,ca)}};c(Dt,"MappedinDirections"),ca=new WeakMap,rt=new WeakMap;var vt,ot=class{constructor(t){N(this,vt,void 0),_(this,vt,t)}directionsTo(t,e){if(t instanceof Nt){let n=[],i=this;for(let r=0;r<t.destinations.length;r++){let a=t.destinations[r],s=da(i),o=da(a),l=u(this,vt).navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),h=new Dt(u(this,vt),l);n.push(h),i=a}return n}{let n=da(this),i=da(t),r=u(this,vt).navigator.getDirections({originIds:n,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new Dt(u(this,vt),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};c(ot,"MappedinNavigatable"),vt=new WeakMap;var so=0,lo="9999-12-31T00:00:00.000Z";function uo(t,e,n=new Date){if(!t.states)return;let i=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||so),n=new Date(t.end||lo);return e<i&&n>i}));return r?e.find((t=>t.value===r.type)):void 0}c(uo,"getCurrentLocationState");var Je,Mt,Ge,pa,ha,ma,ga=class extends ot{constructor(t,e){super(t),N(this,Je,void 0),N(this,Mt,void 0),N(this,Ge,{}),d(this,"states"),d(this,"id",""),d(this,"name",""),d(this,"type",""),d(this,"description"),d(this,"sortOrder"),d(this,"logo"),d(this,"phone"),d(this,"social"),d(this,"color"),d(this,"shortName"),d(this,"detailsUrl"),d(this,"tags"),d(this,"externalId"),d(this,"showLabelWhenImagePresent"),d(this,"picture"),d(this,"operationHours"),d(this,"siblingGroups"),d(this,"gallery"),N(this,pa,void 0),N(this,ha,[]),N(this,ma,void 0),_(this,Je,t),_(this,Mt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=u(this,Ge).polygons;if(void 0!==t)return t;let e=[],n=u(this,pa),i=u(this,Je)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return u(this,Ge).polygons=e,e}set polygons(t){_(this,pa,t)}get nodes(){let t=u(this,Ge).nodes;if(void 0!==t)return t;let e=[],n=u(this,ha),i=u(this,Je)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return u(this,Ge).nodes=e,e}set nodes(t){_(this,ha,t)}get parent(){let t=u(this,Ge).parent;if(void 0!==t)return t;let e,n=u(this,Je)._locationsById,i=u(this,ma);return void 0!==i&&(e=n[i]),u(this,Ge).parent=e,e}set parent(t){_(this,ma,t)}get categories(){let t=u(this,Ge).categories;if(void 0!==t)return t;let e=[];return u(this,Mt).categories.forEach((t=>{let n=u(this,Je).getCollectionItemById(lt.CATEGORY,t);n&&e.push(n)})),u(this,Ge).categories=e,e}get state(){return uo(this,u(this,Je).locationStates)}clone(){return new ga(u(this,Je),u(this,Mt))}get nodeOperationHours(){let t=u(this,Ge).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=u(this,Mt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return u(this,Ge).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new ga(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&ve(e,"categories"),t.options.things.nodes&&ve(e,"nodes"),t.options.things.polygons&&ve(e,"polygons"),t.options.things.locationStates&&ve(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await be(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new ga(t,e)))}catch(t){return D.error("Fetch Locations:",t),[]}}toJSON(){let t=u(this,Mt);return delete t.color,t}},st=ga;c(st,"MappedinLocation"),Je=new WeakMap,Mt=new WeakMap,Ge=new WeakMap,pa=new WeakMap,ha=new WeakMap,ma=new WeakMap,I();var wt,Rt,qe,fa,kn=class extends ot{constructor(t,e){super(t),N(this,wt,void 0),N(this,Rt,void 0),N(this,qe,{}),d(this,"geometry"),d(this,"perspectives"),d(this,"image"),d(this,"holes"),d(this,"textures"),d(this,"material"),d(this,"label"),d(this,"id",""),d(this,"layer"),d(this,"layerId"),d(this,"name"),d(this,"externalId"),d(this,"vertexes"),d(this,"canvasBounds"),N(this,fa,void 0),_(this,wt,t),_(this,Rt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=u(this,qe).map;if(void 0!==t)return t;let e=u(this,wt).getCollectionItemById(lt.MAP,u(this,Rt).map);return u(this,qe).map=e,e}get locations(){var t,e;let n=u(this,qe).locations;if(void 0!==n)return n;let i=[],r=null!=(e=null==(t=Re.instances.get(u(this,wt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=r.length;t<e;++t){let e=r[t],n=e.polygons;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===a){i.push(e);break}}return u(this,qe).locations=i,i}get entrances(){let t=u(this,qe).entrances;if(void 0!==t)return t;let e=[],n=u(this,fa),i=u(this,wt)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&e.push(r)}return u(this,qe).entrances=e,e}return[]}set entrances(t){_(this,fa,t)}get rank(){let t=u(this,qe).rank;if(void 0!==t)return t;let{rankings:e}=u(this,wt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(u(this,qe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(u(this,qe).rank=null,null)}static hydrate(t,e){return t.map((t=>new kn(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&ve(e,"map"),t.options.things.nodes&&ve(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new kn(t,e)))}catch(t){return D.error("Fetch Polygons:",t),[]}}toJSON(){return u(this,Rt)}},_t=kn;function Zi(t){return/^[\da-f]{24}$/i.test(t)}function Qi(t,e=!1){let n="";if(null!=t){let i="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=r.length;e<a;++e){let a=r[e],s=t[a];null!=s&&(n+=`${i+encodeURIComponent(a)}=${encodeURIComponent(s)}`,i="&")}}return n}function co(t,e,n,i=!1){var r,a;return i?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Qi(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+Qi(n)}async function be(t,e,n,i=!1){return yi(t,e,n,i,!0)}async function yi(t,e,n,i=!1,r=!1){let a=co(t,e,n,i),s=await ki(t,a,i);if(!r&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function ki(t,e,n=!1){let i={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete i.language,i.language&&(e+=`&lang=${encodeURIComponent(i.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),i.language&&(r["Accept-Language"]=i.language);let a={method:"GET",headers:r},s=await ya()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function ve(t,e){t.indexOf(e)<0&&t.push(e)}function er([t,e],[n,i]){let r=new R(t,e),a=new R(n,i);return r.distanceTo(a)}function tr(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],i=t.georeference[2],r=new R(n.target.x,n.target.y),a=new R(i.target.x,i.target.y),s=r.distanceTo(a),o=n.control.x-i.control.x,l=n.control.y-i.control.y;e=Math.sqrt(o*o+l*l)/s}catch(n){e=1,D.warn(n),D.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function da(t){var e;return t instanceof _t?t.entrances.map((t=>t.id)):t instanceof st?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function ar(t){let e={},{maps:n,images:i,scenes:r,polygons:a}=t;if(null!=i)try{let t=Object.keys(i).map((t=>fetch(`data:image/png;base64,${i[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{D.error(t)}))));await Promise.all(t)}catch(t){D.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=i&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,i;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(i=null==t?void 0:t.image)?void 0:i.url)){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}}))))})),null!=i&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function bi(t,e,n){let i;return function(){let r=this,a=arguments,s=c((function(){i=null,n||t.apply(r,a)}),"later"),o=n&&!i;clearTimeout(i),i=setTimeout(s,e),o&&t.apply(r,a)}}c(_t,"MappedinPolygon"),wt=new WeakMap,Rt=new WeakMap,qe=new WeakMap,fa=new WeakMap,c(Zi,"isGatewayKey"),c(Qi,"stringifyQuery"),c(co,"buildUrl"),c(be,"getArray"),c(yi,"getObject"),c(ki,"generateAPIRequest"),c(ve,"addToSet"),c(er,"getDistanceBetweenLatLon"),c(tr,"getMapScale"),c(da,"getNodesForNavigatable"),c(ar,"populateBundledImagesAsBlobs"),c(bi,"debounce");var ka,ba,va,bn=class{constructor(t,e){N(this,ka,void 0),N(this,ba,{}),N(this,va,void 0),d(this,"name"),d(this,"externalId"),d(this,"parents"),d(this,"id"),d(this,"icon"),this.id=e.id,_(this,va,e),_(this,ka,t),Object.assign(this,e)}get locations(){var t;let e=u(this,ba).locations;if(void 0!==e)return e;let n=[],{locations:i}=u(this,ka),{id:r}=this;for(let e=0,a=i.length;e<a;++e){let a=i[e],s=a.categories;if(Array.isArray(s))for(let e=0,i=s.length;e<i;++e)if((null==(t=s[e])?void 0:t.id)===r){n.push(a);break}}return u(this,ba).locations=n,n}static hydrate(t,e){return t.map((t=>new bn(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await be(t.options,"category",e)).map((e=>new bn(t,e)))}catch(t){return D.error("Fetch Categories:",t),[]}}toJSON(){return u(this,va)}},At=bn;c(At,"MappedinCategory"),ka=new WeakMap,ba=new WeakMap,va=new WeakMap,I();var wa,Gt,ja,vn=class{constructor(t,e){N(this,wa,void 0),N(this,Gt,void 0),N(this,ja,{}),d(this,"id",""),d(this,"type",""),d(this,"name",""),d(this,"description"),d(this,"image"),d(this,"startDate"),d(this,"endDate"),d(this,"showDate"),_(this,Gt,e),_(this,wa,t),Object.assign(this,e)}location(){let t=u(this,ja).location;if(void 0!==t)return t;let e,n=u(this,wa)._locationsById,i=u(this,Gt).location;if(null!=i){let t=n[i];null!=t&&(e=t)}return u(this,ja).location=e,e}static hydrate(t,e){return t.map((t=>new vn(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&ve(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await be(t.options,"event",n)).map((e=>new vn(t,e)))}catch(t){return D.error("Fetch Events:",t),[]}}toJSON(){return u(this,Gt)}},Ma=vn;c(Ma,"MappedinEvent"),wa=new WeakMap,Gt=new WeakMap,ja=new WeakMap,I();var xa,wn=class{constructor(t){N(this,xa,void 0),d(this,"id",""),d(this,"name",""),d(this,"value",""),_(this,xa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new wn(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await be(t.options,"location-state",e)).map((t=>new wn(t)))}catch(t){return D.error("Fetch Location States:",t),[]}}toJSON(){return u(this,xa)}},Mn=wn;c(Mn,"MappedinLocationState"),xa=new WeakMap,I(),I();var Ta,nr,Ia,ir,za,Oa,jn,po,xn,ho,Xe,Ye,Ke,Ze,qt=class{constructor(t){N(this,Ta),N(this,Ia),N(this,jn),N(this,xn),d(this,"map"),N(this,za,{}),N(this,Oa,void 0),N(this,Xe,void 0),N(this,Ye,void 0),N(this,Ke,void 0),N(this,Ze,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(_(this,Xe,t.lat),_(this,Ye,t.lon)),null!=t.x&&null!=t.y&&(_(this,Ke,t.x),_(this,Ze,t.y)),this.map=e,_(this,Oa,n)}get x(){return it(this,Ia,ir).call(this,"x")}get y(){return it(this,Ia,ir).call(this,"y")}get lat(){return it(this,Ta,nr).call(this,"lat")}get lon(){return it(this,Ta,nr).call(this,"lon")}absoluteDistanceTo(t){return er([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=u(this,za).nearestNode;if(void 0!==t)return t;let e=Re.instances.get(u(this,Oa)).findNearestNodeOnMap(this.map.id,this);return u(this,za).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};c(qt,"MappedinCoordinate"),Ta=new WeakSet,nr=c((function(t){if(u(this,Xe)&&u(this,Ye))return u(this,"lat"===t?Xe:Ye);if(null!=u(this,Ke)&&null!=u(this,Ze)){let[e,n]=it(this,xn,ho).call(this,u(this,Ke),u(this,Ze));return _(this,Xe,e),_(this,Ye,n),u(this,"lat"===t?Xe:Ye)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),Ia=new WeakSet,ir=c((function(t){if(u(this,Ke)&&u(this,Ze))return u(this,"x"===t?Ke:Ze);if(null!=u(this,Xe)&&null!=u(this,Ye)){let[e,n]=it(this,jn,po).call(this,u(this,Xe),u(this,Ye));return _(this,Ke,e),_(this,Ze,n),u(this,"x"===t?Ke:Ze)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),za=new WeakMap,Oa=new WeakMap,jn=new WeakSet,po=c((function(t,e){let n=this.map.georeference[0],i=new R(n.target.x,n.target.y),r=new R(t,e),a=i.distanceTo(r),s=(i.finalBearingTo(r)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*o,h=Math.cos(l)*o;return[n.control.x+u,n.control.y-h]}),"#latLonToXY"),xn=new WeakSet,ho=c((function(t,e){let n,i=this.map.georeference[0],r=new R(i.target.x,i.target.y),a=t-i.control.x,s=i.control.y-e,o=Math.atan2(a,s);n=0===a&&0===s?0:0===a?s:a/Math.sin(o);let l=o-this.map.getNorth(),u=n/this.map._scale,h=r.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}),"#xyToLatLon"),Xe=new WeakMap,Ye=new WeakMap,Ke=new WeakMap,Ze=new WeakMap;var Qe,_a,Aa,Tn=class{constructor(t,e){N(this,Qe,void 0),N(this,_a,{}),N(this,Aa,void 0),d(this,"id",""),d(this,"group",""),d(this,"name",""),d(this,"shortName",""),d(this,"elevation",0),d(this,"scale",0),d(this,"layers"),d(this,"x_scale"),d(this,"perspectiveId"),d(this,"scene"),d(this,"width",0),d(this,"height",0),d(this,"georeference",[]),d(this,"_scale",0),_(this,Qe,t),_(this,Aa,e),Object.assign(this,e),this._scale=tr(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=u(this,_a).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&u(this,Qe)._mapGroupsById[e]||null;return u(this,_a).mapGroup=n,n}createCoordinateByXY(t,e){return new qt({x:t,y:e,map:this,mappedin:u(this,Qe)})}createCoordinate(t,e){return new qt({lat:t,lon:e,map:this,mappedin:u(this,Qe)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],i=new R(e.target.x,e.target.y),r=new R(n.target.x,n.target.y);t=-((i.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,D.warn(e),D.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new Tn(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&ve(e,"perspectives"),t.options.things.mapGroups&&ve(e,"group"),ve(e,"elevation"),ve(e,"x_scale"),ve(e,"scale"),ve(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await be(t.options,"map",n),a=c((t=>{let e=i.layers.find((e=>e.id===t));e?e.visible=!0:i.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let n=0,s=r.length;n<s;++n){var i=r[n];if(i){let t=i.perspective;null!=t&&(i.perspectiveId=t.id,e.indexOf("scene")>-1&&(i.scene=t.scene),t.layers?(i.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):i.layers.forEach((t=>{t.visible=!0}))),delete i.perspective}r[n]=new Tn(t,i)}return r}catch(t){return D.error("Fetch Maps:",t),[]}}toJSON(){return u(this,Aa)}},Na=Tn;c(Na,"MappedinMap"),Qe=new WeakMap,_a=new WeakMap,Aa=new WeakMap,I();var Ea,Vt,Fa,In=class{constructor(t,e){N(this,Ea,void 0),N(this,Vt,void 0),N(this,Fa,{}),d(this,"id",""),d(this,"name",""),_(this,Vt,e),_(this,Ea,t),Object.assign(this,e)}get maps(){let t=u(this,Fa).maps;if(void 0!==t)return t;let e=[],{maps:n}=u(this,Ea),{id:i}=u(this,Vt);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===i&&e.push(r)}return u(this,Fa).maps=e,e}static hydrate(t,e){return t.map((t=>new In(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await be(t.options,"map-group",e)).map((e=>new In(t,e)))}catch(t){return D.error("Fetch Map Groups:",t),[]}}toJSON(){return u(this,Vt)}},Sa=In;c(Sa,"MappedinMapGroup"),Ea=new WeakMap,Vt=new WeakMap,Fa=new WeakMap,I();var et,Ut,_e,Ca,zn=class extends ot{constructor(t,e){super(t),N(this,et,void 0),N(this,Ut,void 0),N(this,_e,{}),d(this,"id",""),d(this,"x",0),d(this,"y",0),d(this,"operationHours"),d(this,"externalId"),N(this,Ca,void 0),_(this,et,t),_(this,Ut,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=u(this,_e).map;if(void 0!==t)return t;let e=u(this,et).getCollectionItemById(lt.MAP,u(this,Ut).map);return u(this,_e).map=e,e}get lat(){var t;let e=u(this,_e).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=u(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return u(this,_e).cachedLatLon=n.createCoordinateByXY(this.x,this.y),u(this,_e).cachedLatLon.lat}get lon(){var t;let e=u(this,_e).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=u(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return u(this,_e).cachedLatLon=n.createCoordinateByXY(this.x,this.y),u(this,_e).cachedLatLon.lon}get paths(){let t=u(this,_e).paths;if(void 0!==t)return t;let e=[],n=u(this,et)._nodesById,i=u(this,Ca);if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return u(this,_e).paths=e,e}set paths(t){_(this,Ca,t)}get locations(){var t,e,n;let i=u(this,_e).locations;if(void 0!==i)return i;let r=[],a=null!=(n=null==(e=null==(t=Re.instances.get(u(this,et)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t],n=e.nodes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===s){r.push(e);break}}return u(this,_e).locations=r,r}get polygon(){var t,e,n;let i=u(this,_e).polygon;if(void 0!==i)return i;let r,a=null!=(n=null==(e=null==(t=Re.instances.get(u(this,et)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t];e.entrances.map((t=>t.id)).includes(s)&&(r=e)}return u(this,_e).polygon=r,r}static hydrate(t,e){return t.map((t=>new zn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&ve(e,"map"),["weight","multiplier","accessible"].forEach((function(t){ve(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"node",n)).map((e=>new zn(t,e)))}catch(t){return D.error("Fetch Nodes:",t),[]}}toJSON(){return u(this,Ut)}},La=zn;c(La,"MappedinNode"),et=new WeakMap,Ut=new WeakMap,_e=new WeakMap,Ca=new WeakMap,I();var Ba,On=class{constructor(t){N(this,Ba,void 0),d(this,"polygons",[]),_(this,Ba,t),Object.assign(this,t)}static hydrate(t){return new On(t)}static async fetch(t){try{let e=await yi(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new On(e)}catch(t){return D.error("Fetch Rankings:",t),null}}toJSON(){return u(this,Ba)}},Pa=On;c(Pa,"MappedinRankings"),Ba=new WeakMap,I();var Da,_n=class{constructor(t){d(this,"id",""),N(this,Da,void 0),_(this,Da,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new _n(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await be(t.options,"apollo-theme",e)).map((t=>new _n(t)))}catch(t){return D.error("Fetch Theme:",t),[]}}toJSON(){return u(this,Da)}},Nn=_n;c(Nn,"MappedinTheme"),Da=new WeakMap,I();var Ga,qa,$t,An=class{constructor(t,e){N(this,Ga,void 0),N(this,qa,void 0),N(this,$t,{}),d(this,"defaultMap",""),d(this,"address",""),d(this,"city",""),d(this,"countrycode",""),d(this,"externalId",""),d(this,"id",""),d(this,"latitude"),d(this,"logo"),d(this,"longitude"),d(this,"metadata"),d(this,"name",""),d(this,"operationHours"),d(this,"postal",""),d(this,"slug",""),d(this,"state",""),d(this,"telephone",""),d(this,"tzid",""),d(this,"tzidOverride",""),d(this,"utcOffset",""),d(this,"website",""),_(this,qa,t),_(this,Ga,e),Object.assign(this,e)}static hydrate(t,e){return new An(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await be(t.options,"venue",e);return new An(t,n[0])}catch(t){return D.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==u(this,$t).isMultiBuilding){let t=u(this,qa).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;u(this,$t).isMultiBuilding=n}return u(this,$t).isMultiBuilding}toJSON(){return u(this,Ga)}},Ra=An;c(Ra,"MappedinVenue"),Ga=new WeakMap,qa=new WeakMap,$t=new WeakMap,I();var Ua,Sn=class{constructor(t){d(this,"id",""),N(this,Ua,void 0),d(this,"name"),d(this,"type"),d(this,"weight"),d(this,"multiplier"),_(this,Ua,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Sn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){ve(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"vortex",n)).map((t=>new Sn(t)))}catch(t){return D.error("Fetch Vortexes:",t),[]}}toJSON(){return u(this,Ua)}},Va=Sn;function mo(t,e){let n=[];return t.features.forEach((t=>{var i,r;let a=[];null==(i=t.properties.spaces)||i.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let s=a.map((t=>({node:"n_"+t.id,map:t.level}))),o=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),u={...t.properties,polygons:o||[],nodes:s||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l};delete u.spaces,n.push(u)})),n}function go(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function fo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function yo(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),i=Math.max(i,t[1]),n=Math.min(n,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:i,maxLong:r}}function ko(t,e,n){let i=n.createGeoreferences(),r=[];return t.features.forEach((t=>{let a=new Set;e.forEach((t=>{t.layer&&a.add(t.layer)}));let s=[...a].map((t=>({id:t,visible:!0}))),o=1/n.mapScale,l={...t.properties,georeference:i,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};r.push(l)})),r}c(Va,"MappedinVortex"),Ua=new WeakMap,I(),c(mo,"convertLocations"),c(go,"convertLocationStates"),c(fo,"convertCategories"),c(yo,"getMapExtent"),c(ko,"convertMaps");var vi=class{constructor(t){d(this,"mapExtent"),d(this,"stretchRatio"),d(this,"midLat"),d(this,"midLong"),d(this,"mapUnitRatio",1e6),d(this,"latDistance"),d(this,"longDistance"),d(this,"mapScale"),d(this,"widthInMapUnits"),d(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:i,maxLong:r}=t,a=(e+i)/2,s=(n+r)/2,o=new R(a,r),l=new R(a,n),u=new R(e,s),h=new R(i,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,p=(i-e)/(r-n);this.stretchRatio=c/p,this.midLat=a,this.midLong=s,this.widthInMapUnits=(r-n)*this.mapUnitRatio,this.heightInMapUnits=(i-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:i}=this.mapExtent;return[[t,e],[t,i],[n,i],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function bo(t,e){let n=[];return t.features.forEach((t=>{let i=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,s={...t.properties,x:i.x,y:i.y,paths:r,map:a,externalId:t.properties.externalId||""};n.push(s)})),n}c(vi,"CoordinateConverter"),c(bo,"convertNodes");var rr=c(((t,e,n,i,r)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let s=[];"entrances"in t.properties&&(s=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let o,l=n[t.properties.id],u=e.find((t=>t.id===l)),h=t.geometry.coordinates[0].map((t=>r.convert(t))),c=i.find((e=>e.polygonId===t.properties.id)),d=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;if(c){let t=r.convert([c.position[0],c.position[1]]),e=c.size.x,n=c.size.y,i=r.mapScale,a=n*i,s=e*i/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:s,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p={...t.properties,entrances:s,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*r.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*r.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:o,vertexes:h};a.push(p)})),a}),"generateMappedinPolygons");function vo(t,e,n,i,r,a){let s=rr(t,n,i,r,a),o=rr(e,n,i,r,a);return s.concat(o)}function Mo(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let i=n[0].split("-")[0],r=e.get(i),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...a);else{let{name:n,type:r,weight:s,multiplier:o,accessible:l}=t.properties,u={id:i,nodes:a,name:n,type:r,weight:s,multiplier:o,accessible:l};e.set(i,u)}}))})),Array.from(e.values())}function wo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function or(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),i=t.building,r=t.category,a=t.style,s=t.location,o=t.imageInstance,l=t.polygonStyle,u={},h=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,i=yo(e),r=new vi(i);c.set(n,r);let s=t.obstruction.get(n),d=t.space.get(n),p=o.get(n),f=l.get(n);u[n]=vo(d,s,a,f,p,r);let g=t.node.get(n);h.push(...bo(g,r))}));let d=Object.values(u).flat(),p=Mo(e),f=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return ko(t,u[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=wo(i),m=mo(s,g),v=fo(r),_=go(s),w=t.manifest.features[0].properties.name,M=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:m,categories:v,nodes:h,maps:f,polygons:d,vortexes:p,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}c(vo,"convertPolygons"),c(Mo,"convertVortexes"),c(wo,"convertMapGroups"),c(or,"convertMVFToMappedin"),I(),I(),I(),I();var St,$e,We,Mi=[0,4,6,8,10],ut=c((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],Mi.map(((t,e)=>n.slice(t,e===Mi.length-1?void 0:Mi[e+1]).join(""))).join("-")}),"randomId"),sr="mi-session-data",lr="mi-local-data",wi=class{constructor(){N(this,$e,void 0),N(this,We,void 0);try{let t=sessionStorage.getItem(sr);_(this,$e,t?JSON.parse(t):{id:ut()})}catch{_(this,$e,{id:ut()})}try{let t=localStorage.getItem(lr);_(this,We,t?JSON.parse(t):{deviceId:ut()})}catch{_(this,We,{deviceId:ut()})}u(this,$e).id||(u(this,$e).id=ut()),u(this,We).deviceId||(u(this,We).deviceId=ut())}static getInstance(){return u(this,St)||_(this,St,new wi),u(this,St)}static ___clearInstance(){_(this,St,void 0)}saveSessionData(t,e){u(this,$e)[t]=e;try{return sessionStorage.setItem(sr,JSON.stringify(u(this,$e))),!0}catch{return!1}}loadSessionData(t){let e=u(this,$e)[t];if(null!=e)return e}saveLocalData(t,e){u(this,We)[t]=e;try{return localStorage.setItem(lr,JSON.stringify(u(this,We))),!0}catch{return!1}}loadLocalData(t){let e=u(this,We)[t];if(null!=e)return e}},Wt=wi;function ur(t){return/^[\da-f]{24}$/i.test(t)}function cr(){return Wt.getInstance().loadLocalData("deviceId")}function dr(){return Wt.getInstance().loadSessionData("id")}c(Wt,"SafeStorage"),St=new WeakMap,$e=new WeakMap,We=new WeakMap,N(Wt,St,void 0),c(ur,"isGatewayKey"),c(cr,"getDeviceID"),c(dr,"getSessionID");var Sr,Er,$a,Ht,Jt,Wa,Xt,Yt,Kt,Et,Ha,Zt,Qt,Ja,Ar=dn(_r()),So=null==(Er=null==(Sr=P)?void 0:Sr.env)?void 0:Er.npm_package_version,Ti=["websdk","web","webv2"],Ii="websdk",zi=class{constructor(t){var e;N(this,$a,void 0),N(this,Ht,void 0),N(this,Jt,void 0),N(this,Wa,void 0),N(this,Xt,void 0),N(this,Yt,void 0),N(this,Kt,void 0),N(this,Et,void 0),N(this,Ha,void 0),N(this,Zt,void 0),N(this,Qt,void 0),N(this,Ja,void 0),_(this,Et,t.clientId),_(this,Ha,t.clientSecret),_(this,Zt,t.accessToken),_(this,Kt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!u(this,Kt)&&u(this,Et)&&!ur(u(this,Et))&&(n="https://web-proxy.mappedin.com/a/"),_(this,Jt,n),_(this,Jt,u(this,Jt)+(t.venue+"/")),_(this,Ht,!1),_(this,$a,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),_(this,Wa,Ti.find((e=>e===t.context))||Ti[0]),_(this,Xt,cr()),_(this,Yt,dr()),_(this,Qt,new Set),_(this,Ja,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(u(this,$a))return;let n={...e,g:u(this,Ht)},i=u(this,Jt)+t+"?"+Ar.default.stringify(n),r={"mi-context":Ii||u(this,Wa),"mi-session":u(this,Yt),"mi-device":u(this,Xt),"mappedin-sdk-version":So,"mappedin-platform-version":u(this,Ja)};u(this,Zt)?r.Authorization=`Bearer ${u(this,Zt)}`:u(this,Kt)||(r.Authorization=`Basic ${btoa(`${u(this,Et)}:${u(this,Ha)}`)}`),ya()(i,{method:"GET",mode:"cors",headers:r})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,n,i){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:i||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return u(this,Yt)}getDeviceID(){return u(this,Xt)}setGeolocationMode(t){_(this,Ht,t)}trackBlueDotEvent(t){t&&Object.values(zi.BLUEDOT_EVENT).includes(t)&&!u(this,Qt).has(t)?(this.track(t),u(this,Qt).add(t)):D.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=Ti.find((e=>e===t));e&&(Ii=e)}static clearContext(){Ii=void 0}},En=zi;c(En,"Analytics"),$a=new WeakMap,Ht=new WeakMap,Jt=new WeakMap,Wa=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,Kt=new WeakMap,Et=new WeakMap,Ha=new WeakMap,Zt=new WeakMap,Qt=new WeakMap,Ja=new WeakMap,d(En,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var lt,Fn=En,Fr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(lt||(lt={}));var xt,ta,ea={categories:At,locations:st,vortexes:Va,maps:Na,nodes:La,polygons:_t,venue:Ra,events:Ma,mapGroups:Sa,themes:Nn,locationStates:Mn,rankings:Pa},jt=class{constructor(t){d(this,"perspective"),d(this,"things"),d(this,"options"),N(this,xt,void 0),N(this,ta,""),d(this,"updatedAt"),d(this,"categories",[]),d(this,"locations",[]),d(this,"vortexes",[]),d(this,"maps",[]),d(this,"nodes",[]),d(this,"polygons",[]),d(this,"venue",{}),d(this,"events",[]),d(this,"mapGroups",[]),d(this,"themes",[]),d(this,"locationStates",[]),d(this,"rankings"),d(this,"_categoriesById"),d(this,"_locationsById"),d(this,"_vortexesById"),d(this,"_mapsById"),d(this,"_nodesById"),d(this,"_polygonsById"),d(this,"_eventsById"),d(this,"_mapGroupsById"),d(this,"_locationStatesById"),d(this,"_locationRankingsById"),d(this,"_rankingsById"),d(this,"_categoriesByExternalId"),d(this,"_locationsByExternalId"),d(this,"_vortexesByExternalId"),d(this,"_mapsByExternalId"),d(this,"_nodesByExternalId"),d(this,"_polygonsByExternalId"),d(this,"_eventsByExternalId"),d(this,"_mapGroupsByExternalId"),d(this,"_locationStatesByExternalId"),d(this,"_locationRankingsByExternalId"),d(this,"_rankingsByExternalId"),d(this,"images"),d(this,"imageBinaries"),d(this,"scenes"),d(this,"analytics"),d(this,"navigator"),this.options=t,_(this,xt,Re.create(this));let e=new Fn({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Zn,"true")}})}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=u(this,xt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),u(this,xt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=u(this,xt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),u(this,xt)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,i=this[`_${t}ById`];return null!=i&&null!=i[e]||(i=this[n],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=or(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{_(this,ta,t),n=JSON.parse(t)}catch(t){return void D.error("Unable to parse JSON",t)}else n=t,_(this,ta,JSON.stringify(n));let i=Object.keys(n);for(let t=0,e=i.length;t<e;++t){let e=i[t],r=n[e];null!=ea[e]&&"function"==typeof ea[e].hydrate&&(this[e]=ea[e].hydrate(r,this))}e&&await ar(n);let{images:r,scenes:a,imageBinaries:s}=n;this.images=r,this.scenes=a,this.imageBinaries=s,this.generateGetters(i),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Zi(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,i=n.length;t<i;++t){let i=n[t];ea[i]&&e.push(ea[i].fetch(this).then((t=>(this[i]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new ni({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in ea)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return u(this,ta)||JSON.stringify(this.toJSON())}};c(jt,"Mappedin"),xt=new WeakMap,ta=new WeakMap,I();var Lr={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};I();var Ft=dn(Cr());I();var Eo=["0","1","2","3","4","5","6","7","8","9"],Fo=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Lo=["0","1","2","3","4","5","6","7","8","9"],Co=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],ac=[...Eo,...Fo,...Lo,...Co],Pr=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];I();var Po=32,Be=!1,Bo=120,_i=0,Ln=class{constructor(t){d(this,"_callback"),d(this,"_frameCount"),d(this,"_ordering"),d(this,"_supersededBy"),d(this,"name"),d(this,"_remainingFrameCount"),d(this,"_lastFrameTime"),d(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,Be&&D.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};c(Ln,"FrameUpdate");var dt=class{constructor(t){if(d(this,"_postponed"),d(this,"userdata"),d(this,"_priority"),d(this,"_group"),d(this,"name"),d(this,"_lastFrameTime"),d(this,"_callback"),d(this,"_complete"),d(this,"_scheduled"),d(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,Be&&D.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};c(dt,"FrameTask");var Cn=class{constructor(t){d(this,"_postponed"),d(this,"_onComplete"),d(this,"_priority"),d(this,"userdata"),d(this,"name"),d(this,"_tasks"),d(this,"_scheduledTasks"),d(this,"_scheduled"),d(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,Be&&D.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}};c(Cn,"FrameTaskGroup");var Ai=class{constructor(t){d(this,"_maxMillisecondsPerFrame"),d(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Po,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};c(Ai,"RealTimeTimer");var Pn=class{constructor(t){var e;d(this,"_raf"),d(this,"_timer"),d(this,"_performance"),d(this,"_scheduledUpdatesByOrdering"),d(this,"_scheduledTasksByPriority"),d(this,"_postponedTasks"),d(this,"_requestAnimationFrameHandle"),d(this,"_updatesToRunThisFrame"),d(this,"_lastFrameTime",0),d(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Ai,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new aa,this._scheduledTasksByPriority=new aa,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Be&&D.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0:e.TEST_IOS)&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new aa,this._scheduledTasksByPriority=new aa,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Be&&D.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;Be&&(0===_i&&(n=!0),++_i,_i%=Bo);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&D.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,n&&D.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let i;this._performance&&(i=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-i),n&&D.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),i=null;D.assert(void 0!==n),Object.getPrototypeOf(n)===Cn.prototype&&(i=n,n=i._popTask()),D.assert(void 0!==n),D.assert(Object.getPrototypeOf(n)===dt.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Be&&D.log("task completed",n.name),null!=i&&(i.isComplete()?(i.clear(),i._onComplete(),Be&&D.log("group completed",i.name)):this._scheduledTasksByPriority.insert(i._priority,i))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===Cn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,Be&&D.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Be&&D.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===dt.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Be&&D.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===dt.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===dt.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Be&&D.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===dt.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===dt.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Be&&D.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===dt.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,Be&&D.log("task priority changed",t.name,e)}};c(Pn,"TaskScheduler");var aa=class{constructor(){d(this,"_map"),d(this,"_size"),d(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(D.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let i=t.next();if(i.done)return i;e=this._map.get(i.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return D.assert(t===this._size),t}};c(aa,"Multimap");var Lt,Ve,Tt,tt,Ae,Ya,Ka,ia,Za,ra,ht,Bn,Dn,It,Qa,Rn,Gn,qn,Ko,en,tn,Si,pt=c((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),na="",Do=.09,Ro=1,Go=.025,qo=.5,Vo=5e-4,Uo=5e-4,$o=.01,Wo=.05,Br=1,Ho=.01,Jo=.2,Xo={MappedinCategory:"categories",MappedinLocation:"locations"},Yo={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Pr,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===P.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Do,PRIMARY_INDEX_WEIGHT:Ro,SECONDARY_INDEX_WEIGHT:Go,CATEGORY_NAME_WEIGHT:qo,LOCATION_NAME_WEIGHT:Br,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Vo,CATEGORY_LOCATION_TAGS_WEIGHT:Uo,CATEGORY_LOCATION_NAME_WEIGHT:$o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Wo,LOCATION_DEFAULT_RANK:Br,RATIO_OF_FUZZY_TO_EXACT:Ho,RATIO_OF_PREFIX_TO_EXACT:Jo}},Xa=class{constructor(t,e){var n,i,r;N(this,qn),N(this,Lt,void 0),N(this,Ve,void 0),N(this,Tt,void 0),N(this,tt,void 0),N(this,Ae,void 0),N(this,Ya,new Pn({performance:!0})),N(this,Ka,void 0),N(this,ia,void 0),N(this,Za,new Map),N(this,ra,0),N(this,ht,c((t=>{Xn(this,ra)._++,u(this,Ya).scheduleUpdate(new Ln({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),Xn(this,ra)._--,0===u(this,ra)&&u(this,Qa).call(this)}}))}),"#addTask")),N(this,Bn,c((t=>{var e,n,i;let{SECONDARY_INDEX_WEIGHT:r,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=u(this,Ae).constants,o=a;(null==(e=u(this,Ae))?void 0:e.useLocationRank)&&(o=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:a})),a):a),u(this,ht).call(this,(()=>{u(this,Ve).add({name:pt(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:o})})),(null==(n=u(this,Ae))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{u(this,Ve).add({name:"",tag:pt(e),id:"MappedinLocation_"+t.id,weight:s,rank:o})})),(null==(i=u(this,Ae))?void 0:i.searchDescriptions)&&u(this,ht).call(this,(()=>u(this,Tt).add({description:pt(t.description||""),id:"MappedinLocation_"+t.id,weight:r,rank:o})))}),"#processLocation")),N(this,Dn,c((t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:i,CATEGORY_LOCATION_TAGS_WEIGHT:r,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:s}=u(this,Ae).constants;u(this,ht).call(this,(()=>u(this,Ve).add({name:pt(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let o=t.locations.reduce(((t,e)=>t+` ${na} `+e.name),"")+` ${na}`;if((null==(e=u(this,Ae))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&u(this,ht).call(this,(()=>u(this,tt).add({id:"MappedinCategory_"+t.id,"category.locations.description":pt(e.description),ref:e.name,weight:i})))})),null==(n=u(this,Ae))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${na} `+e),""))+` ${na}`}),"");u(this,ht).call(this,(()=>u(this,tt).add({"category.locations.tags":pt(e),id:"MappedinCategory_"+t.id,weight:r})))}u(this,ht).call(this,(()=>u(this,tt).add({"category.locations.name":pt(o),id:"MappedinCategory_"+t.id,weight:a})))}),"#processCategory")),N(this,It,void 0),N(this,Qa,void 0),N(this,Rn,c((t=>{var e;let n=t.score,{object:i,id:r,weight:a,rank:s}=t,[o,l]=r.split("_"),h=i||u(this,Lt).getCollectionItemById(Xo[o],l);return s&&(null==(e=u(this,Ae))?void 0:e.useLocationRank)&&(n+=s),a&&(n*=a),{score:n,type:o,object:h}}),"#processSearchResult")),N(this,Gn,c(((t,e)=>{for(let n in t.match)t.match[n].forEach((i=>{let r=t.ref||t[i]||e.object[i];if("category.locations.tags"===i||"category.locations.name"===i){let e=new RegExp(`[^${na}]* `+n+` [^${na}]*`,"ig").exec(t[i]);null!=e&&(r=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:i,value:r})}))}),"#addMatches")),N(this,en,void 0),N(this,tn,void 0),_(this,ia,new Fn({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),_(this,Ae,{...Yo,...e}),_(this,Lt,t),_(this,Ka,new Set(null==(n=u(this,Ae))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:s,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:h,PRIMARY_INDEX_TAGS_NAME_WEIGHT:d}=u(this,Ae).constants,p=["object","query","weight","tag","rank"],f={fields:["query","name","tag"],storeFields:p,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:s,query:s,tag:d},weights:{fuzzy:l,prefix:h},boostDocument:t=>t.includes("MappedinLocation")?s:t.includes("MappedinCategory")?o:s},g={fields:["description"],storeFields:p,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=u(this,Ka))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...p,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(_(this,It,new Promise((t=>{_(this,Qa,t)}))),null==(i=u(this,Ae))?void 0:i.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(r=u(this,Ae))?void 0:r.jsonIndex);_(this,Ve,Ft.default.loadJS(t,f)),_(this,Tt,Ft.default.loadJS(e,g)),_(this,tt,Ft.default.loadJS(n,y))}else _(this,Ve,new Ft.default(f)),_(this,Tt,new Ft.default(g)),_(this,tt,new Ft.default(y)),u(this,Lt).locations.forEach(u(this,Bn)),u(this,Lt).categories.forEach(u(this,Dn));u(this,Ya).update(performance.now()),_(this,en,bi(((t,e)=>{u(this,ia).trackSearchSuggest({query:t,hits:e})}),300)),_(this,tn,bi(((t,e)=>{u(this,ia).trackSearch({query:t,hits:e})}),300))}async suggest(t){await u(this,It);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:r,RATIO_OF_PREFIX_TO_EXACT:a}=u(this,Ae).constants,s=u(this,Ve).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:i},weights:{fuzzy:r,prefix:a}});return u(this,en).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await u(this,It);let e=it(this,qn,Ko).call(this,t);return u(this,tn).call(this,t,e.length),e}async toJSON(){return await u(this,It),JSON.stringify({primary:u(this,Ve),secondary:u(this,Tt),extra:u(this,tt)})}async addQuery(t){let e,n,{query:i,object:r,weight:a=1}=t;await u(this,It),e=r instanceof st?"MappedinLocation":r instanceof At?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+r.id:"string"==typeof r.id?n="Custom_"+r.id:(n=u(this,Za).get(r),n||(n="Custom_"+ut(),u(this,Za).set(r,n))),u(this,Ve).add({id:n,weight:a,object:r,query:pt(i)})}};c(Xa,"OfflineSearch"),Lt=new WeakMap,Ve=new WeakMap,Tt=new WeakMap,tt=new WeakMap,Ae=new WeakMap,Ya=new WeakMap,Ka=new WeakMap,ia=new WeakMap,Za=new WeakMap,ra=new WeakMap,ht=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,It=new WeakMap,Qa=new WeakMap,Rn=new WeakMap,Gn=new WeakMap,qn=new WeakSet,Ko=c((function(t){let e=[],n=pt(t);e=[...u(this,Ve).search(n),...u(this,Tt).search(n),...u(this,tt).search(n)].sort(((t,e)=>e.score-t.score));let i={};for(let t of e){let e=u(this,Rn).call(this,t);i[t.id]?i[t.id].score+=e.score:i[t.id]={...e,matches:[]},u(this,Gn).call(this,t,i[t.id])}return Object.keys(i).map((t=>({...i[t],matches:i[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))}),"#doSearch"),en=new WeakMap,tn=new WeakMap,I(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Si||(Si={}));var Rr=globalThis.fetch;function ya(){if(null==Rr)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Rr}c(ya,"isomorphicFetch");var qr,Vr,Zo=null==(Vr=null==(qr=P)?void 0:qr.env)?void 0:Vr.npm_package_version;globalThis.btoa||(globalThis.btoa=Dr.encode);var Qo=["ar"];function Ei(t){let e={...Fr,things:Lr,...t};return e.headers={...e.headers,"mappedin-sdk-version":Zo},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function Fi(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),i=new jt({...e,baseUrl:e.baseUrl+n});return await i.fetch(),i}c(Ei,"parseOptions"),c(Fi,"getVenue");var Gr={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function Li(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...Gr,...t}),{url:n,updated_at:i}=await es(t),r=await ya()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await r.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new jt(e);return await o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=i,o}async function es(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...Gr,...t}),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Qo.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${i}&version=1.0.0`;return e.language=void 0,await ki(e,r)}c(Li,"getVenueBundle"),c(es,"getVenueBundleURL");var ts=!1;function as(t){t.things=t.things||{},t.things.venue=t.things.venue||[],t.things.venue.push("slug","defaultMap"),t.things.nodes=t.things.nodes||[],t.things.nodes.push("x","y","paths","map"),t.things.polygons=t.things.polygons||[],t.things.locations=t.things.locations||[],t.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),t.things.maps=t.things.maps||[],t.things.maps.push("height","width","georeference"),t.perspective=t.perspective3D||t.perspective||void 0,t.things.maps.push("scene","layers"),t.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),ts&&t.things.polygons.push("layer","geometry","vertexes")}c(as,"parseOptions");var ns=c((function(t){return null==t.mapView&&(t.mapView={}),new Promise((function(e,n){function i(i,r){if(i)n(i);else{let i={};try{t.firstMapSelector&&(t.mapView=t.mapView||{},t.mapView.firstMap=t.firstMapSelector(r))}catch(t){D.error("Failure in firstMapSelector! Loading default map instead."),D.error(t),n(t)}i.venue=r,e(i)}}c(i,"handleInit"),as(t.venue),t.venue.useVenueBundle?Li(t.venue).then((t=>i(null,t))).catch((t=>i(t,null))):Fi(t.venue).then((t=>i(null,t))).catch((t=>i(t,null)))}))}),"initialize");
|
|
1
|
+
var ao,P,Hr=Object.create,Bt=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Xr=Object.getOwnPropertyNames,Yr=Object.getPrototypeOf,Kr=Object.prototype.hasOwnProperty,Zr=(t,e,n)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ri=t=>Bt(t,"__esModule",{value:!0}),c=(t,e)=>Bt(t,"name",{value:e,configurable:!0}),Qr=(t,e)=>()=>(t&&(e=t(t=0)),e),yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),eo=(t,e)=>{for(var n in Ri(t),e)Bt(t,n,{get:e[n],enumerable:!0})},to=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of Xr(e))!Kr.call(t,i)&&"default"!==i&&Bt(t,i,{get:()=>e[i],enumerable:!(n=Jr(e,i))||n.enumerable});return t},dn=t=>to(Ri(Bt(null!=t?Hr(Yr(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),d=(t,e,n)=>(Zr(t,"symbol"!=typeof e?e+"":e,n),n),Jn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},u=(t,e,n)=>(Jn(t,e,"read from private field"),n?n.call(t):e.get(t)),N=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_=(t,e,n,i)=>(Jn(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),Xn=(t,e,n,i)=>({set _(i){_(t,e,i,n)},get _(){return u(t,e,i)}}),it=(t,e,n)=>(Jn(t,e,"access private method"),n),I=Qr((()=>{P={env:ao={NODE_ENV:"production",npm_package_version:"5.1.3"}}})),qi=yt(((t,e)=>{I(),function(n){var i="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=c((function(t){this.message=t}),"InvalidCharacterError");s.prototype=new Error,s.prototype.name="InvalidCharacterError";var o=c((function(t){throw new s(t)}),"error"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h=c((function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,r=0,a="",s=-1;++s<e;)i=l.indexOf(t.charAt(s)),n=r%4?64*n+i:i,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a}),"decode"),d={encode:c((function(t){t=String(t),/[^\0-\xFF]/.test(t)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,i,r,a=t.length%3,s="",u=-1,h=t.length-a;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,i=t.charCodeAt(++u),s+=l.charAt((r=e+n+i)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==a?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),s+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(u),s+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),s}),"encode"),decode:h,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return d}));else if(i&&!i.nodeType)if(r)r.exports=d;else for(var p in d)d.hasOwnProperty(p)&&(i[p]=d[p]);else n.base64=d}(t)})),Vi=yt(((t,e)=>{var n,i;I(),n="undefined"!=typeof self?self:t,i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return c(n,"r"),n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"computeDestinationPoint",(function(){return B})),n.d(e,"convertArea",(function(){return L})),n.d(e,"convertDistance",(function(){return C})),n.d(e,"convertSpeed",(function(){return P})),n.d(e,"decimalToSexagesimal",(function(){return z})),n.d(e,"findNearest",(function(){return H})),n.d(e,"getAreaOfPolygon",(function(){return V})),n.d(e,"getBounds",(function(){return J})),n.d(e,"getBoundsOfDistance",(function(){return X})),n.d(e,"getCenter",(function(){return Y})),n.d(e,"getCenterOfBounds",(function(){return K})),n.d(e,"getCompassDirection",(function(){return Q})),n.d(e,"getCoordinateKey",(function(){return y})),n.d(e,"getCoordinateKeys",(function(){return x})),n.d(e,"getDistance",(function(){return U})),n.d(e,"getDistanceFromLine",(function(){return tt})),n.d(e,"getGreatCircleBearing",(function(){return et})),n.d(e,"getLatitude",(function(){return F})),n.d(e,"getLongitude",(function(){return S})),n.d(e,"getPathLength",(function(){return it})),n.d(e,"getPreciseDistance",(function(){return rt})),n.d(e,"getRhumbLineBearing",(function(){return Z})),n.d(e,"getRoughCompassDirection",(function(){return at})),n.d(e,"getSpeed",(function(){return st})),n.d(e,"isDecimal",(function(){return m})),n.d(e,"isPointInLine",(function(){return ot})),n.d(e,"isPointInPolygon",(function(){return lt})),n.d(e,"isPointNearLine",(function(){return ut})),n.d(e,"isPointWithinRadius",(function(){return ht})),n.d(e,"isSexagesimal",(function(){return v})),n.d(e,"isValidCoordinate",(function(){return E})),n.d(e,"isValidLatitude",(function(){return I})),n.d(e,"isValidLongitude",(function(){return N})),n.d(e,"orderByDistance",(function(){return q})),n.d(e,"sexagesimalToDecimal",(function(){return _})),n.d(e,"toDecimal",(function(){return A})),n.d(e,"toRad",(function(){return R})),n.d(e,"toDeg",(function(){return D})),n.d(e,"wktToPolygon",(function(){return pt})),n.d(e,"sexagesimalPattern",(function(){return i})),n.d(e,"earthRadius",(function(){return r})),n.d(e,"MINLAT",(function(){return a})),n.d(e,"MAXLAT",(function(){return s})),n.d(e,"MINLON",(function(){return o})),n.d(e,"MAXLON",(function(){return l})),n.d(e,"longitudeKeys",(function(){return u})),n.d(e,"latitudeKeys",(function(){return h})),n.d(e,"altitudeKeys",(function(){return d})),n.d(e,"distanceConversion",(function(){return p})),n.d(e,"timeConversion",(function(){return f})),n.d(e,"areaConversion",(function(){return g}));var i=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,r=6378137,a=-90,s=90,o=-180,l=180,u=["lng","lon","longitude",0],h=["lat","latitude",1],d=["alt","altitude","elevation","elev",2],p={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},f={m:60,h:3600,d:86400},g={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};g.sqm=g.m2,g.sqkm=g.km2,g.sqft=g.ft2,g.sqyd=g.yd2,g.sqin=g.in2;var y=c((function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)}),"m"),m=c((function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)}),"v"),v=c((function(t){return i.test(t.toString().trim())}),"p"),_=c((function(t){var e=new RegExp(i).exec(t);if(null==e)throw new Error("Given value is not in sexagesimal format");var n=Number(e[2])/60||0,r=Number(e[4])/3600||0,a=parseFloat(e[1])+n+r;return["S","W"].includes(e[7])?-a:a}),"y");function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c(w,"b"),c(M,"M"),c(b,"O");var x=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:u,latitude:h,altitude:d},n=y(t,e.longitude),i=y(t,e.latitude),r=y(t,e.altitude);return M({latitude:i,longitude:n},r?{altitude:r}:{})}),"S"),I=c((function t(e){return m(e)?!(parseFloat(e)>s||e<a):!!v(e)&&t(_(e))}),"t"),N=c((function t(e){return m(e)?!(parseFloat(e)>l||e<o):!!v(e)&&t(_(e))}),"t"),E=c((function(t){var e=x(t),n=e.latitude,i=e.longitude;if(Array.isArray(t)&&t.length>=2)return N(t[0])&&I(t[1]);if(void 0===n||void 0===i)return!1;var r=t[i],a=t[n];return void 0!==a&&void 0!==r&&!1!==I(a)&&!1!==N(r)}),"j");function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){O(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}c(T,"w"),c(k,"x"),c(O,"E");var A=c((function t(e){if(m(e))return Number(e);if(v(e))return _(e);if(E(e)){var n=x(e);return Array.isArray(e)?e.map((function(e,n){return[0,1].includes(n)?t(e):e})):k(k(k({},e),n.latitude&&O({},n.latitude,t(e[n.latitude]))),n.longitude&&O({},n.longitude,t(e[n.longitude])))}return Array.isArray(e)?e.map((function(e){return E(e)?t(e):e})):e}),"t"),F=c((function(t,e){var n=y(t,h);if(null!=n){var i=t[n];return!0===e?i:A(i)}}),"A"),S=c((function(t,e){var n=y(t,u);if(null!=n){var i=t[n];return!0===e?i:A(i)}}),"I"),R=c((function(t){return t*Math.PI/180}),"W"),D=c((function(t){return 180*t/Math.PI}),"D"),B=c((function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,r=F(t),a=S(t),s=e/i,u=R(n),h=R(r),c=R(a),d=Math.asin(Math.sin(h)*Math.cos(s)+Math.cos(h)*Math.sin(s)*Math.cos(u)),p=c+Math.atan2(Math.sin(u)*Math.sin(s)*Math.cos(h),Math.cos(s)-Math.sin(h)*Math.sin(d)),f=D(p);return(f<o||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=D(p)),{latitude:D(d),longitude:f}}),"F"),L=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=g[e];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")}),"C"),C=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=p[e];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")}),"k"),P=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(e){case"kmh":return t*f.h*p.km;case"mph":return t*f.h*p.mi;default:return t}}),"T");function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return W(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}c(j,"q"),c(W,"$");var G=c((function(t){var e=Math.pow(10,12);return Math.round(t*e)/e}),"B"),z=c((function(t){var e=j(t.toString().split("."),2),n=e[0],i=e[1],r=Math.abs(Number(n)),a=G(60*Number("0."+(i||0))),s=Math.floor(a),o=G(60*(a%s||0));return r+"° "+Number(s.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(o.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'}),"R"),$=c((function(t){return t>1?1:t<-1?-1:t}),"X"),U=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i=F(t),a=S(t),s=F(e),o=S(e),l=Math.acos($(Math.sin(R(s))*Math.sin(R(i))+Math.cos(R(s))*Math.cos(R(i))*Math.cos(R(a)-R(o))))*r;return Math.round(l/n)*n}),"_"),q=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U;return n="function"==typeof n?n:U,e.slice().sort((function(e,i){return n(t,e)-n(t,i)}))}),"K"),H=c((function(t,e){return q(t,e)[0]}),"Y"),V=c((function(t){var e=0;if(t.length>2){for(var n,i,a,s=0;s<t.length;s++){s===t.length-2?(n=t.length-2,i=t.length-1,a=0):s===t.length-1?(n=t.length-1,i=0,a=1):(n=s,i=s+1,a=s+2);var o=S(t[n]),l=F(t[i]),u=S(t[a]);e+=(R(u)-R(o))*Math.sin(R(l))}e=e*r*r/2}return Math.abs(e)}),"Z"),J=c((function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,e){var n=F(e),i=S(e);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}),"G"),X=c((function(t,e){var n,i,u=F(t),h=S(t),c=R(u),d=R(h),p=e/r,f=c-p,g=c+p,y=R(s),m=R(a),v=R(l),_=R(o);if(f>m&&g<y){var w=Math.asin(Math.sin(p)/Math.cos(c));(n=d-w)<_&&(n+=2*Math.PI),(i=d+w)>v&&(i-=2*Math.PI)}else f=Math.max(f,m),g=Math.min(g,y),n=_,i=v;return[{latitude:D(f),longitude:D(n)},{latitude:D(g),longitude:D(i)}]}),"V"),Y=c((function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var e=t.length,n=t.reduce((function(t,e){var n=R(F(e)),i=R(S(e));return{X:t.X+Math.cos(n)*Math.cos(i),Y:t.Y+Math.cos(n)*Math.sin(i),Z:t.Z+Math.sin(n)}}),{X:0,Y:0,Z:0}),i=n.X/e,r=n.Y/e,a=n.Z/e;return{longitude:D(Math.atan2(r,i)),latitude:D(Math.atan2(a,Math.sqrt(i*i+r*r)))}}),"U"),K=c((function(t){var e=J(t),n=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(i.toFixed(6))}}),"z"),Z=c((function(t,e){var n=R(S(e))-R(S(t)),i=Math.log(Math.tan(R(F(e))/2+Math.PI/4)/Math.tan(R(F(t))/2+Math.PI/4));return Math.abs(n)>Math.PI&&(n=n>0?-1*(2*Math.PI-n):2*Math.PI+n),(D(Math.atan2(n,i))+360)%360}),"H"),Q=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z,i="function"==typeof n?n(t,e):Z(t,e);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}),"J"),tt=c((function(t,e,n){var i=U(e,t),r=U(t,n),a=U(e,n),s=Math.acos($((i*i+a*a-r*r)/(2*i*a))),o=Math.acos($((r*r+a*a-i*i)/(2*r*a)));return s>Math.PI/2?i:o>Math.PI/2?r:Math.sin(s)*i}),"Q"),et=c((function(t,e){var n=F(e),i=S(e),r=F(t),a=S(t);return(D(Math.atan2(Math.sin(R(i)-R(a))*Math.cos(R(n)),Math.cos(R(r))*Math.sin(R(n))-Math.sin(R(r))*Math.cos(R(n))*Math.cos(R(i)-R(a))))+360)%360}),"tt");function nt(t){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}c(nt,"nt");var it=c((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;return t.reduce((function(t,n){return"object"===nt(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance}),"rt"),rt=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i,a,s,o,l,u,h,c=F(t),d=S(t),p=F(e),f=S(e),g=6356752.314245,y=1/298.257223563,m=R(f-d),v=Math.atan((1-y)*Math.tan(R(parseFloat(c)))),_=Math.atan((1-y)*Math.tan(R(parseFloat(p)))),w=Math.sin(v),M=Math.cos(v),b=Math.sin(_),x=Math.cos(_),I=m,N=100;do{var E=Math.sin(I),T=Math.cos(I);if(0===(u=Math.sqrt(x*E*(x*E)+(M*b-w*x*T)*(M*b-w*x*T))))return 0;i=w*b+M*x*T,a=Math.atan2(u,i),l=i-2*w*b/(o=1-(s=M*x*E/u)*s),isNaN(l)&&(l=0);var k=y/16*o*(4+y*(4-3*o));h=I,I=m+(1-k)*y*s*(a+k*u*(l+k*i*(2*l*l-1)))}while(Math.abs(I-h)>1e-12&&--N>0);if(0===N)return NaN;var O=o*(r*r-g*g)/(g*g),A=1+O/16384*(4096+O*(O*(320-175*O)-768)),D=O/1024*(256+O*(O*(74-47*O)-128)),B=D*u*(l+D/4*(i*(2*l*l-1)-D/6*l*(4*u*u-3)*(4*l*l-3))),L=g*A*(a-B);return Math.round(L/n)*n}),"et"),at=c((function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0}),"it"),st=c((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U,i=n(t,e),r=Number(e.time)-Number(t.time),a=i/r*1e3;return a}),"ot"),ot=c((function(t,e,n){return U(e,t)+U(t,n)===U(e,n)}),"ut"),lt=c((function(t,e){for(var n=!1,i=e.length,r=-1,a=i-1;++r<i;a=r)(S(e[r])<=S(t)&&S(t)<S(e[a])||S(e[a])<=S(t)&&S(t)<S(e[r]))&&F(t)<(F(e[a])-F(e[r]))*(S(t)-S(e[r]))/(S(e[a])-S(e[r]))+F(e[r])&&(n=!n);return n}),"at"),ut=c((function(t,e,n,i){return tt(t,e,n)<i}),"ct"),ht=c((function(t,e,n){return U(t,e)<n}),"ft");function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dt(t,e)}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}c(ct,"st"),c(dt,"lt");var pt=c((function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var e=ct(t.split(" "),2),n=e[0],i=e[1];return{longitude:parseFloat(n),latitude:parseFloat(i)}}))}),"dt")}])},"object"==typeof t&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof t?t.geolib=i():n.geolib=i()})),hr=yt(((t,e)=>{I(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),kr=yt(((t,e)=>{I();var n="%[a-f0-9]{2}",i=new RegExp("("+n+")|([^%]+?)","gi"),r=new RegExp("("+n+")+","gi");function a(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],a(n),a(i))}function s(t){try{return decodeURIComponent(t)}catch(r){for(var e=t.match(i)||[],n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(i)||[];return t}}function o(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var i=s(n[0]);i!==n[0]&&(e[n[0]]=i)}n=r.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];t=t.replace(new RegExp(l,"g"),e[l])}return t}c(a,"decodeComponents"),c(s,"decode"),c(o,"customDecodeURIComponent"),e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return o(t)}}})),vr=yt(((t,e)=>{I(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),wr=yt(((t,e)=>{I(),e.exports=function(t,e){for(var n={},i=Object.keys(t),r=Array.isArray(e),a=0;a<i.length;a++){var s=i[a],o=t[s];(r?-1!==e.indexOf(s):e(s,o,t))&&(n[s]=o)}return n}})),_r=yt((t=>{I();var e=hr(),n=kr(),i=vr(),r=wr(),a=c((t=>null==t),"isNullOrUndefined"),s=Symbol("encodeFragmentIdentifier");function o(t){switch(t.arrayFormat){case"index":return e=>(n,i)=>{let r=n.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[h(e,t),"[",r,"]"].join("")]:[...n,[h(e,t),"[",h(r,t),"]=",h(i,t)].join("")]};case"bracket":return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[h(e,t),"[]"].join("")]:[...n,[h(e,t),"[]=",h(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(i,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?i:(r=null===r?"":r,0===i.length?[[h(n,t),e,h(r,t)].join("")]:[[i,h(r,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,h(e,t)]:[...n,[h(e,t),"=",h(i,t)].join("")]}}function l(t){let e;switch(t.arrayFormat){case"index":return(t,n,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=n):i[t]=n};case"bracket":return(t,n,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],n):i[t]=[n]:i[t]=n};case"comma":case"separator":return(e,n,i)=>{let r="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!r&&d(n,t).includes(t.arrayFormatSeparator);n=a?d(n,t):n;let s=r||a?n.split(t.arrayFormatSeparator).map((e=>d(e,t))):null===n?n:d(n,t);i[e]=s};case"bracket-separator":return(e,n,i)=>{let r=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!r)return void(i[e]=n&&d(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>d(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],a):i[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}function u(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function d(t,e){return e.decode?n(t):t}function p(t){return Array.isArray(t)?t.sort():"object"==typeof t?p(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function f(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function g(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}function y(t){let e=(t=f(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function m(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function v(t,e){u((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=l(e),r=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return r;for(let a of t.split("&")){if(""===a)continue;let[t,s]=i(e.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:d(s,e),n(d(t,e),s,r)}for(let t of Object.keys(r)){let n=r[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=m(n[t],e);else r[t]=m(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{let n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=p(n):t[e]=n,t}),Object.create(null))}c(o,"encoderForArrayFormat"),c(l,"parserForArrayFormat"),c(u,"validateArrayFormatSeparator"),c(h,"encode"),c(d,"decode"),c(p,"keysSorter"),c(f,"removeHash"),c(g,"getHash"),c(y,"extract"),c(m,"parseValue"),c(v,"parse"),t.extract=y,t.parse=v,t.stringify=(t,e)=>{if(!t)return"";u((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=c((n=>e.skipNull&&a(t[n])||e.skipEmptyString&&""===t[n]),"shouldFilter"),i=o(e),r={};for(let e of Object.keys(t))n(e)||(r[e]=t[e]);let s=Object.keys(r);return!1!==e.sort&&s.sort(e.sort),s.map((n=>{let r=t[n];return void 0===r?"":null===r?h(n,e):Array.isArray(r)?0===r.length&&"bracket-separator"===e.arrayFormat?h(n,e)+"[]":r.reduce(i(n),[]).join("&"):h(n,e)+"="+h(r,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:v(y(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);let i=f(e.url).split("?")[0]||"",r=t.extract(e.url),a=t.parse(r,{sort:!1}),o=Object.assign(a,e.query),l=t.stringify(o,n);l&&(l=`?${l}`);let u=g(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${i}${l}${u}`},t.pick=(e,n,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[s]:!1},i);let{url:a,query:o,fragmentIdentifier:l}=t.parseUrl(e,i);return t.stringifyUrl({url:a,query:r(o,n),fragmentIdentifier:l},i)},t.exclude=(e,n,i)=>{let r=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,r,i)}})),Cr=yt(((t,e)=>{var n,i;I(),n=t,i=function(){"use strict";var t=c((function(){return t=Object.assign||c((function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}),"__assign"),t.apply(this,arguments)}),"__assign");function e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}c(e,"__values"),c(n,"__read");var i,r="KEYS",a="VALUES",s="",o=function(){function t(t,e){var n=t._tree,i=Array.from(n.keys());this.set=t,this._type=e,this._path=i.length>0?[{node:n,keys:i}]:[]}return c(t,"TreeIterator"),t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=l(this._path),e=t.node,n=t.keys;if(l(n)===s)return{done:!1,value:this.result()};var i=e.get(l(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=l(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return l(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return l(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case r:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),l=c((function(t){return t[t.length-1]}),"last$1"),u=c((function(t,e,n){var i=new Map;if(void 0===e)return i;for(var r=e.length+1,a=r+n,s=new Uint8Array(a*r).fill(n+1),o=0;o<r;++o)s[o]=o;for(var l=1;l<a;++l)s[l*r]=l;return h(t,e,n,i,s,1,r,""),i}),"fuzzySearch"),h=c((function(t,n,i,r,a,o,l,u){var c,d,p=o*l;try{t:for(var f=e(t.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y===s){var m=a[p-1];m<=i&&r.set(u,[t.get(y),m])}else{for(var v=o,_=0;_<y.length;++_,++v){for(var w=y[_],M=l*v,b=M-l,x=a[M],I=Math.max(0,v-i-1),N=Math.min(l-1,v+i),E=I;E<N;++E){var T=w!==n[E],k=a[b+E]+ +T,O=a[b+E+1]+1,A=a[M+E]+1,F=a[M+E+1]=Math.min(k,O,A);F<x&&(x=F)}if(x>i)continue t}h(t.get(y),n,i,r,a,v,l,u+y)}}}catch(t){c={error:t}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}}),"recurse"),d=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return c(t,"SearchableMap"),t.prototype.atPrefix=function(i){var r,a;if(!i.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=n(p(this._tree,i.slice(this._prefix.length)),2),l=o[0],u=o[1];if(void 0===l){var h=n(_(u),2),c=h[0],d=h[1];try{for(var f=e(c.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y!==s&&y.startsWith(d)){var m=new Map;return m.set(y.slice(d.length),c.get(y)),new t(m,i)}}}catch(t){r={error:t}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}return new t(l,i)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,y(this._tree,t)},t.prototype.entries=function(){return new o(this,"ENTRIES")},t.prototype.forEach=function(t){var i,r;try{for(var a=e(this),s=a.next();!s.done;s=a.next()){var o=n(s.value,2);t(o[0],o[1],this)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},t.prototype.fuzzyGet=function(t,e){return u(this._tree,t,e)},t.prototype.get=function(t){var e=f(this._tree,t);return void 0!==e?e.get(s):void 0},t.prototype.has=function(t){var e=f(this._tree,t);return void 0!==e&&e.has(s)},t.prototype.keys=function(){return new o(this,r)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,g(this._tree,t).set(s,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=g(this._tree,t);return n.set(s,e(n.get(s))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=g(this._tree,t),i=n.get(s);return void 0===i&&n.set(s,i=e()),i},t.prototype.values=function(){return new o(this,a)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(i){var r,a,s=new t;try{for(var o=e(i),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1];s.set(h,c)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return s},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),p=c((function(t,n,i){var r,a;if(void 0===i&&(i=[]),0===n.length||null==t)return[t,i];try{for(var o=e(t.keys()),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==s&&n.startsWith(u))return i.push([t,u]),p(t.get(u),n.slice(u.length),i)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return i.push([t,n]),p(void 0,"",i)}),"trackDown"),f=c((function(t,n){var i,r;if(0===n.length||null==t)return t;try{for(var a=e(t.keys()),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==s&&n.startsWith(l))return f(t.get(l),n.slice(l.length))}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}),"lookup"),g=c((function(t,n){var i,r,a=n.length;t:for(var o=0;t&&o<a;){try{for(var l=(i=void 0,e(t.keys())),u=l.next();!u.done;u=l.next()){var h=u.value;if(h!==s&&n[o]===h[0]){for(var c=Math.min(a-o,h.length),d=1;d<c&&n[o+d]===h[d];)++d;var p=t.get(h);if(d===h.length)t=p;else{var f=new Map;f.set(h.slice(d),p),t.set(n.slice(o,o+d),f),t.delete(h),t=f}o+=d;continue t}}}catch(t){i={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}var g=new Map;return t.set(n.slice(o),g),g}return t}),"createPath"),y=c((function(t,e){var i=n(p(t,e),2),r=i[0],a=i[1];if(void 0!==r)if(r.delete(s),0===r.size)m(a);else if(1===r.size){var o=n(r.entries().next().value,2),l=o[0],u=o[1];v(a,l,u)}}),"remove"),m=c((function(t){if(0!==t.length){var e=n(_(t),2),i=e[0],r=e[1];if(i.delete(r),0===i.size)m(t.slice(0,-1));else if(1===i.size){var a=n(i.entries().next().value,2),o=a[0],l=a[1];o!==s&&v(t.slice(0,-1),o,l)}}}),"cleanup"),v=c((function(t,e,i){if(0!==t.length){var r=n(_(t),2),a=r[0],s=r[1];a.set(s+e,i),a.delete(s)}}),"merge"),_=c((function(t){return t[t.length-1]}),"last"),w="or",M=function(){function i(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=t(t(t({},E),e),{searchOptions:t(t({},T),e.searchOptions||{})}),this._index=new d,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return c(i,"MiniSearch"),i.prototype.add=function(t){var n,i,r,a,s=this._options,o=s.extractField,l=s.tokenize,u=s.processTerm,h=s.fields,c=s.idField,d=o(t,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,t);try{for(var f=e(h),g=f.next();!g.done;g=f.next()){var y=g.value,m=o(t,y);if(null!=m){var v=l(m.toString(),y),_=this._fieldIds[y],w=new Set(v).size;this.addFieldLength(p,_,this._documentCount-1,w);try{for(var M=(r=void 0,e(v)),b=M.next();!b.done;b=M.next()){var x=u(b.value,y);x&&this.addTerm(_,p,x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(a=M.return)&&a.call(M)}finally{if(r)throw r.error}}}}}catch(t){n={error:t}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},i.prototype.addAll=function(t){var n,i;try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.add(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},i.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var i=e.chunkSize,r=void 0===i?10:i,a={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,i){var a=t.chunk,s=t.promise;return a.push(e),(i+1)%r==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},i.prototype.remove=function(t){var i,r,a,s,o,l,u=this._options,h=u.tokenize,c=u.processTerm,d=u.extractField,p=u.fields,f=u.idField,g=d(t,f);if(null==g)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var y=e(this._documentIds),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0];if(g===v[1]){try{for(var w=(a=void 0,e(p)),M=w.next();!M.done;M=w.next()){var b=M.value,x=d(t,b);if(null!=x){var I=h(x.toString(),b),N=this._fieldIds[b],E=new Set(I).size;this.removeFieldLength(_,N,this._documentCount,E);try{for(var T=(o=void 0,e(I)),k=T.next();!k.done;k=T.next()){var O=c(k.value,b);O&&this.removeTerm(N,_,O)}}catch(t){o={error:t}}finally{try{k&&!k.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}}}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return this._storedFields.delete(_),this._documentIds.delete(_),this._fieldLength.delete(_),void(this._documentCount-=1)}}}catch(t){i={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(i)throw i.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"))},i.prototype.removeAll=function(t){var n,i;if(t)try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.remove(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new d,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},i.prototype.search=function(t,i){var r,a;void 0===i&&(i={});var s=this.executeQuery(t,i),o=[];try{for(var l=e(s),u=l.next();!u.done;u=l.next()){var h=n(u.value,2),c=h[0],d=h[1],p=d.score,f=d.terms,g=d.match,y=f.length,m={id:this._documentIds.get(c),score:p*y,terms:Object.keys(g),match:g};Object.assign(m,this._storedFields.get(c)),(null==i.filter||i.filter(m))&&o.push(m)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o.sort(F),o},i.prototype.autoSuggest=function(i,r){var a,s,o,l;void 0===r&&(r={}),r=t(t({},k),r);var u=new Map;try{for(var h=e(this.search(i,r)),c=h.next();!c.done;c=h.next()){var d=c.value,p=d.score,f=(M=d.terms).join(" ");null!=(_=u.get(f))?(_.score+=p,_.count+=1):u.set(f,{score:p,terms:M,count:1})}}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}var g=[];try{for(var y=e(u),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),_=v[0],w=v[1],M=(p=w.score,w.terms),b=w.count;g.push({suggestion:_,terms:M,score:p/b})}}catch(t){o={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return g.sort(F),g},Object.defineProperty(i.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),i.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return i.loadJS(JSON.parse(t),e)},i.getDefault=function(t){if(E.hasOwnProperty(t))return b(E,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},i.loadJS=function(t,r){var a,s,o,l,u=t.index,h=t.documentCount,c=t.nextId,p=t.documentIds,f=t.fieldIds,g=t.fieldLength,y=t.averageFieldLength,m=t.storedFields,v=t.serializationVersion;if(1!==v&&2!==v)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var _=new i(r);_._documentCount=h,_._nextId=c,_._documentIds=R(p),_._fieldIds=f,_._fieldLength=R(g),_._avgFieldLength=y,_._storedFields=R(m),_._index=new d;try{for(var w=e(u),M=w.next();!M.done;M=w.next()){var b=n(M.value,2),x=b[0],I=b[1],N=new Map;try{for(var E=(o=void 0,e(Object.keys(I))),T=E.next();!T.done;T=E.next()){var k=T.value,O=I[k];1===v&&(O=O.ds),N.set(parseInt(k,10),R(O))}}catch(t){o={error:t}}finally{try{T&&!T.done&&(l=E.return)&&l.call(E)}finally{if(o)throw o.error}}_._index.set(x,N)}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return _},i.prototype.executeQuery=function(e,n){var i=this;if(void 0===n&&(n={}),"string"!=typeof e){var r=t(t(t({},n),e),{queries:void 0}),a=e.queries.map((function(t){return i.executeQuery(t,r)}));return this.combineResults(a,e.combineWith)}var s=this._options,o=s.tokenize,l=s.processTerm,u=s.searchOptions,h=t(t({tokenize:o,processTerm:l},u),n),c=h.tokenize,d=h.processTerm,p=c(e).map((function(t){return d(t)})).filter((function(t){return!!t})).map(N(h)).map((function(t){return i.executeQuerySpec(t,h)}));return this.combineResults(p,h.combineWith)},i.prototype.executeQuerySpec=function(i,r){var a,s,o,l,u,h,c=t(t({},this._options.searchOptions),r),d=(c.fields||this._options.fields).reduce((function(e,n){var i;return t(t({},e),((i={})[n]=b(e,n)||1,i))}),c.boost||{}),p=c.boostDocument,f=c.weights,g=c.maxFuzzy,y=t(t({},T.weights),f),m=y.fuzzy,v=y.prefix,_=this._index.get(i.term),w=this.termResults(i.term,i.term,1,_,d,p);if(i.prefix&&(u=this._index.atPrefix(i.term)),i.fuzzy){var M=!0===i.fuzzy?.2:i.fuzzy,x=M<1?Math.min(g,Math.round(i.term.length*M)):M;x&&(h=this._index.fuzzyGet(i.term,x))}if(u)try{for(var I=e(u),N=I.next();!N.done;N=I.next()){var E=n(N.value,2),k=E[0],O=E[1];if(R=k.length-i.term.length){null==h||h.delete(k);var A=v*k.length/(k.length+.3*R);this.termResults(i.term,k,A,O,d,p,w)}}}catch(t){a={error:t}}finally{try{N&&!N.done&&(s=I.return)&&s.call(I)}finally{if(a)throw a.error}}if(h)try{for(var F=e(h.keys()),S=F.next();!S.done;S=F.next()){k=S.value;var R,D=n(h.get(k),2),B=D[0];(R=D[1])&&(A=m*k.length/(k.length+R),this.termResults(i.term,k,A,B,d,p,w))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(l=F.return)&&l.call(F)}finally{if(o)throw o.error}}return w},i.prototype.combineResults=function(t,e){if(void 0===e&&(e=w),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(x[n])||new Map},i.prototype.toJSON=function(){var t,i,r,a,s=[];try{for(var o=e(this._index),l=o.next();!l.done;l=o.next()){var u=n(l.value,2),h=u[0],c=u[1],d={};try{for(var p=(r=void 0,e(c)),f=p.next();!f.done;f=p.next()){var g=n(f.value,2),y=g[0],m=g[1];d[y]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}s.push([h,d])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:s,serializationVersion:2}},i.prototype.termResults=function(t,n,i,r,a,s,o){var l,u,h,c,d;if(void 0===o&&(o=new Map),null==r)return o;try{for(var p=e(Object.keys(a)),f=p.next();!f.done;f=p.next()){var g=f.value,y=a[g],m=this._fieldIds[g],v=r.get(m);if(null!=v){var _=v.size,w=this._avgFieldLength[m];try{for(var M=(h=void 0,e(v.keys())),x=M.next();!x.done;x=M.next()){var N=x.value,E=s?s(this._documentIds.get(N),n):1;if(E){var T=v.get(N),k=this._fieldLength.get(N)[m],A=i*y*E*I(T,_,this._documentCount,k,w),F=o.get(N);if(F){F.score+=A,O(F.terms,t);var S=b(F.match,n);S?S.push(g):F.match[n]=[g]}else o.set(N,{score:A,terms:[t],match:(d={},d[n]=[g],d)})}}}catch(t){h={error:t}}finally{try{x&&!x.done&&(c=M.return)&&c.call(M)}finally{if(h)throw h.error}}}}}catch(t){l={error:t}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}return o},i.prototype.addTerm=function(t,e,n){var i=this._index.fetch(n,S),r=i.get(t);if(null==r)(r=new Map).set(e,1),i.set(t,r);else{var a=r.get(e);r.set(e,(a||0)+1)}},i.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var i=this._index.fetch(n,S),r=i.get(t);null==r||null==r.get(e)?this.warnDocumentChanged(e,t,n):r.get(e)<=1?r.size<=1?i.delete(t):r.delete(e):r.set(e,r.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},i.prototype.warnDocumentChanged=function(t,n,i){var r,a;if(null!=console&&null!=console.warn)try{for(var s=e(Object.keys(this._fieldIds)),o=s.next();!o.done;o=s.next()){var l=o.value;if(this._fieldIds[l]===n)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(i,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}},i.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},i.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},i.prototype.addFieldLength=function(t,e,n,i){var r=this._fieldLength.get(t);null==r&&this._fieldLength.set(t,r=[]),r[e]=i;var a=(this._avgFieldLength[e]||0)*n+i;this._avgFieldLength[e]=a/(n+1)},i.prototype.removeFieldLength=function(t,e,n,i){var r=this._avgFieldLength[e]*n-i;this._avgFieldLength[e]=r/(n-1)},i.prototype.saveStoredFields=function(t,n){var i,r,a=this._options,s=a.storeFields,o=a.extractField;if(null!=s&&0!==s.length){var l=this._storedFields.get(t);null==l&&this._storedFields.set(t,l={});try{for(var u=e(s),h=u.next();!h.done;h=u.next()){var c=h.value,d=o(n,c);void 0!==d&&(l[c]=d)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}}},i}(),b=c((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),x=((i={}).or=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null==l)t.set(o,n.get(o));else{var u=n.get(o),h=u.score,c=u.terms,d=u.match;l.score=l.score+h,l.match=Object.assign(l.match,d),A(l.terms,c)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i.and=function(t,n){var i,r,a=new Map;try{for(var s=e(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=t.get(l);if(null!=u){var h=n.get(l),c=h.score,d=h.terms,p=h.match;A(u.terms,d),a.set(l,{score:u.score+c,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a},i.and_not=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;t.delete(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i),I=c((function(t,e,n,i,r){return Math.log(1+(n-e+.5)/(e+.5))*(.5+2.2*t/(t+1.2*(1-.7+.7*i/r)))}),"calcBM25Score"),N=c((function(t){return function(e,n,i){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,i):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,i):!0===t.prefix}}}),"termToQuerySpec"),E={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(D)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},T={combineWith:w,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},k={prefix:function(t,e,n){return e===n.length-1}},O=c((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),A=c((function(t,n){var i,r;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var o=s.value;t.includes(o)||t.push(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}}),"assignUniqueTerms"),F=c((function(t,e){var n=t.score;return e.score-n}),"byScore"),S=c((function(){return new Map}),"createMap"),R=c((function(t){var n,i,r=new Map;try{for(var a=e(Object.keys(t)),s=a.next();!s.done;s=a.next()){var o=s.value;r.set(parseInt(o,10),t[o])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r}),"objectToNumericMap"),D=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;return M},"object"==typeof t&&void 0!==e?e.exports=i():"function"==typeof define&&define.amd?define(i):(n="undefined"!=typeof globalThis?globalThis:n||self).MiniSearch=i()}));eo(exports,{Mappedin:()=>jt,MappedinDestinationSet:()=>Nt,OfflineSearch:()=>Xa,getVenue:()=>Fi,getVenueBundle:()=>Li,initialize:()=>ns}),I(),I();var Dr=dn(qi());I(),I(),I();var Ui=dn(Vi());I();var Kn=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:i=0,distance:r=0,angle:a=0}){let s,o;if(d(this,"origin"),d(this,"destination"),d(this,"vortex"),d(this,"distance"),d(this,"angle"),d(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=a,n?(this.distance=0,this.angle=0,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,o=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=i*o+s):(s=e.weight&&e.weight>=0?e.weight:0,o=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}};c(Kn,"Edge");var hn=Kn;I();var Zn="mi-debug",no={loggingEnabled(){var t;return"development"===P.env.NODE_ENV||"dev"===P.env.NODE_ENV||"test"===P.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Zn))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},D=no;function io(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],i=(0,Ui.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(r*r+a*a)/i}catch(t){return D.error(t),1}}function ro(t,e){let n=t.x-e.x,i=t.y-e.y;return(Math.atan2(i,n)+2.5*Math.PI)%(2*Math.PI)}c(io,"getMapScale"),c(ro,"getAngle");var Qn=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:i=!1}){d(this,"edges"),d(this,"nodesById"),d(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:io(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let a=e.map((t=>({...t,name:i?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new hn({angle:ro(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let i=e;for(;i<t.nodes.length;){let e=this.nodesById[t.nodes[i]];if(i++,null==e)continue;let r=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,s=Math.abs(r-a);this.edges[n.id].push(new hn({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new hn({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let i=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===i.length||0===r.length)return[];let a=[],s={},o={};for(i.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);a.push({origin:t,priority:e}),s[t.id]=null,o[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(r.includes(t.origin)){let e=[],n=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let i=e.vortex&&!1===e.vortex.accessible;if(n&&(i||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=o[t.origin.id]+e.weight;if(null==o[e.destination.id]||l<o[e.destination.id]){o[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);a.push({origin:e.destination,priority:t}),s[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,i=t.x-e.x,r=t.y-e.y,a=i*i+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let i=this.getDistance(t,n);return Math.min(e,i)}),Number.MAX_VALUE)}};c(Qn,"NavigationGraph");var je,Ce,kt,ei=Qn;function oo(t){switch(t){case kt.DOWN:case kt.UP:return`${t} `;default:return""}}I(),I(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(je||(je={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Ce||(Ce={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(kt||(kt={})),c(oo,"vortexDirectionTest");var ti=class{constructor({origin:t,action:e,distance:n,atLocation:i,instruction:r}){d(this,"node"),d(this,"instruction"),d(this,"action"),d(this,"atLocation"),d(this,"type"),d(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=i,this.instruction="",r?this.instruction=r:(null!=e&&e.type===je.DEPARTURE?this.instruction=null!=i?`Depart from ${i.name}`:"Depart from current location":null!=e&&e.type===je.ARRIVAL?this.instruction=null!=i?`Arrive at ${i.name}`:"Arrive at destination":null!=e&&e.type===je.TAKEVORTEX?this.instruction=`Take ${i&&i.name} ${oo(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===je.EXITVORTEX?this.instruction=`Exit ${i&&i.name} at ${e.toMap.name}`:null!=e&&e.bearing===Ce.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Ce.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Ce.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Ce.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Ce.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===je.TURN&&i&&(this.instruction+=` at ${i.name}`))}};c(ti,"Directive");var mn,bt=ti;(mn||(mn={})).NO_VALID_PATH="No Valid Path Available";var gn=.1*Math.PI;function fn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}c(fn,"differenceBetweenAngles");var ai=class{constructor({locations:t,nodes:e,vortexes:n,maps:i,showVortexNames:r}){d(this,"graph"),d(this,"locationsByNodeId"),this.graph=new ei({maps:i,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let i=0,r=0,a=t;for(;Math.abs(i)<e&&r<n;){let t=this.graph.edges[a.destination.id],s=null,o=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-fn(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-fn(a.angle,e.angle);if(null==s)return null;{if(Math.abs(o)>=e||(i+=o,r+=s.distance,Math.abs(i)>=e||r>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;a=s}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:i,arriveAt:r}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new bt({distance:0,instruction:mn.NO_VALID_PATH})],path:[]};let s=0,o=new Array(a.length+1);for(let t=0;t<a.length;t++)o[t]=a[t].origin;o[a.length]=a[a.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,o=e.destination;if(s+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new bt({action:{type:je.DEPARTURE},atLocation:i,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],i=this.graph.mapsById[o.map],r=kt.NONE;if(null!=t.elevation&&null!=i.elevation){let e=t.elevation-i.elevation;e>0?r=kt.DOWN:e<0&&(r=kt.UP)}l.push(new bt({action:{direction:r,fromMap:t,toMap:i,type:je.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new bt({action:{fromMap:t,toMap:e,type:je.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let i=-fn(h.angle,e.angle),r=t.reduce(((t,n)=>{let i=-fn(e.angle,n.angle);return Math.min(t,Math.abs(i))}),Math.PI);if(Math.abs(i)>=gn||Math.abs(r)<=gn){let t;t=i<=-Math.PI/4?Ce.RIGHT:i<=-gn?Ce.SLIGHTRIGHT:i<=gn?Ce.STRAIGHT:i<=Math.PI/4?Ce.SLIGHTLEFT:Ce.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let i=new bt({action:{bearing:t,referencePosition:"At",type:je.TURN},atLocation:e,distance:c,origin:n});i.type=t,l.push(i)}else l.push(new bt({action:{bearing:t,referencePosition:"At",type:je.TURN},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new bt({action:{type:je.ARRIVAL},atLocation:r,distance:s-d<0?0:s-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let p=[],f=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===je.TAKEVORTEX?(f=e.node,p.unshift(e)):n&&n.type===je.TURN&&null!=f?this.graph.getDistance(e.node,f)>5&&p.unshift(e):p.unshift(e)}return{distance:s,instructions:p,path:o}}};c(ai,"Navigator");var ni=ai;function ii(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return $i(this.cover(e,n),e,n,t)}function $i(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,s,o,l,u,h,c,d,p=t._root,f={data:i},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s,r=p,!(p=p[c=h<<1|u]))return r[c]=f,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&n===l)return f.next=p,r?r[c]=f:t._root=f,t;do{r=r?r[c]=new Array(4):t._root=new Array(4),(u=e>=(a=(g+m)/2))?g=a:m=a,(h=n>=(s=(y+v)/2))?y=s:v=s}while((c=h<<1|u)==(d=(l>=s)<<1|o>=a));return r[d]=p,r[c]=f,t}function Wi(t){var e,n,i,r,a=t.length,s=new Array(a),o=new Array(a),l=1/0,u=1/0,h=-1/0,c=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(s[n]=i,o[n]=r,i<l&&(l=i),i>h&&(h=i),r<u&&(u=r),r>c&&(c=r));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),n=0;n<a;++n)$i(this,s[n],o[n],t[n]);return this}function ri(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var s,o,l=r-n||1,u=this._root;n>t||t>=r||i>e||e>=a;)switch(o=(e<i)<<1|t<n,s=new Array(4),s[o]=u,u=s,l*=2,o){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function oi(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function si(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Te(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function li(t,e,n){var i,r,a,s,o,l,u,h=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Te(g,h,c,d,p)),null==n?n=1/0:(h=t-n,c=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(a=l.y0)>p||(s=l.x1)<h||(o=l.y1)<c))if(g.length){var y=(r+s)/2,m=(a+o)/2;f.push(new Te(g[3],y,m,s,o),new Te(g[2],r,m,y,o),new Te(g[1],y,a,s,m),new Te(g[0],r,a,y,m)),(u=(e>=m)<<1|t>=y)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var v=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),w=v*v+_*_;if(w<n){var M=Math.sqrt(n=w);h=t-M,c=e-M,d=t+M,p=e+M,i=g.data}}return i}function ui(t){if(isNaN(a=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,i,r,a,s,o,l,u,h,c,d,p=this._root,f=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((u=a>=(o=(f+y)/2))?f=o:y=o,(h=s>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[c=h<<1|u]))return this;if(!p.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[c]=r:delete e[c],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=r,this)}function Hi(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ci(){return this._root}function di(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function pi(t){var e,n,i,r,a,s,o=[],l=this._root;for(l&&o.push(new Te(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,s=e.y1)&&l.length){var u=(i+a)/2,h=(r+s)/2;(n=l[3])&&o.push(new Te(n,u,h,a,s)),(n=l[2])&&o.push(new Te(n,i,h,u,s)),(n=l[1])&&o.push(new Te(n,u,r,a,h)),(n=l[0])&&o.push(new Te(n,i,r,u,h))}return this}function hi(t){var e,n=[],i=[];for(this._root&&n.push(new Te(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,s=e.x0,o=e.y0,l=e.x1,u=e.y1,h=(s+l)/2,c=(o+u)/2;(a=r[0])&&n.push(new Te(a,s,o,h,c)),(a=r[1])&&n.push(new Te(a,h,o,l,c)),(a=r[2])&&n.push(new Te(a,s,c,h,u)),(a=r[3])&&n.push(new Te(a,h,c,l,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function Ji(t){return t[0]}function mi(t){return arguments.length?(this._x=t,this):this._x}function Xi(t){return t[1]}function gi(t){return arguments.length?(this._y=t,this):this._y}function ua(t,e,n){var i=new fi(null==e?Ji:e,null==n?Xi:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function fi(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Yi(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}I(),I(),I(),I(),c(ii,"default"),c($i,"add"),c(Wi,"addAll"),I(),c(ri,"default"),I(),c(oi,"default"),I(),c(si,"default"),I(),I(),c(Te,"default"),c(li,"default"),I(),c(ui,"default"),c(Hi,"removeAll"),I(),c(ci,"default"),I(),c(di,"default"),I(),c(pi,"default"),I(),c(hi,"default"),I(),c(Ji,"defaultX"),c(mi,"default"),I(),c(Xi,"defaultY"),c(gi,"default"),c(ua,"quadtree"),c(fi,"Quadtree"),c(Yi,"leaf_copy");var Le=ua.prototype=fi.prototype;Le.copy=function(){var t,e,n=new fi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Yi(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Yi(e));return n},Le.add=ii,Le.addAll=Wi,Le.cover=ri,Le.data=oi,Le.extent=si,Le.find=li,Le.remove=ui,Le.removeAll=Hi,Le.root=ci,Le.size=di,Le.visit=pi,Le.visitAfter=hi,Le.x=mi,Le.y=gi;var He,xe,Ot=class{constructor(t){N(this,He,void 0),d(this,"categories"),d(this,"locations"),d(this,"vortexes"),d(this,"maps"),d(this,"nodes"),d(this,"polygons"),d(this,"events"),d(this,"mapGroups"),d(this,"locationStates"),d(this,"rankings"),N(this,xe,{}),_(this,He,t)}get polygonsByMapId(){if(u(this,xe).polygonsByMapId)return u(this,xe).polygonsByMapId;let t,e={};for(let n=0,i=u(this,He).polygons.length;n<i;++n)t=u(this,He).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).polygonsByMapId=n,u(this,xe).polygonsByMapId}get nodesByMapId(){if(u(this,xe).nodesByMapId)return u(this,xe).nodesByMapId;let t,e={};for(let n=0,i=u(this,He).nodes.length;n<i;++n)t=u(this,He).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).nodesByMapId=n,u(this,xe).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(u(this,xe).nodeTreesByMap||(u(this,xe).nodeTreesByMap=new Map),!u(this,xe).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],i=ua();i.x((t=>t.x)),i.y((t=>t.y)),i.addAll(e),u(this,xe).nodeTreesByMap.set(t,i)}return u(this,xe).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(u(this,xe).locationsByMapId)return u(this,xe).locationsByMapId;let t,e={};for(let n=0,i=u(this,He).locations.length;n<i;++n){t=u(this,He).locations[n];for(let n=0,i=t.polygons.length;n<i;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return u(this,xe).locationsByMapId=n,u(this,xe).locationsByMapId}static create(t){return Ot.instances.has(t)||Ot.instances.set(t,new Ot(t)),Ot.instances.get(t)}static clear(){Ot.instances.clear()}},yn=Ot;c(yn,"MappedinCache"),He=new WeakMap,xe=new WeakMap,d(yn,"instances",new Map);var Re=yn;I(),I(),I(),I();var Ki=" ",Fe=class{static get separator(){return Ki}static set separator(t){Ki=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let i=null,r=null,a=null,s=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),i=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),r++),r=("000"+r).slice(-3),a<10&&(a="0"+a),i=r+"°"+Fe.separator+a+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,r++),r=("000"+r).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=r+"°"+Fe.separator+a+"′"+Fe.separator+s+"″"}return i}static toLat(t,e,n){let i=Fe.toDms(Fe.wrap90(t),e,n);return null===i?"–":i.slice(1)+Fe.separator+(t<0?"S":"N")}static toLon(t,e,n){let i=Fe.toDms(Fe.wrap180(t),e,n);return null===i?"–":i+Fe.separator+(t<0?"W":"E")}static toBrng(t,e,n){let i=Fe.toDms(Fe.wrap360(t),e,n);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=Fe.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};c(Fe,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var te=Fe,fe=Math.PI,R=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=te.wrap90(Number(t)),this._lon=te.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?te.wrap90(te.parse(t)):te.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?te.wrap90(te.parse(t)):te.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?te.wrap180(te.parse(t)):te.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?[n,e]=i.coordinates:(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(n=i.longitude),null!=i.lng&&(n=i.lng),null!=i.lon&&(n=i.lon),e=te.wrap90(te.parse(e)),n=te.wrap180(te.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new R(e,n)}distanceTo(t,e=6371e3){if(t instanceof R||(t=R.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,i=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),s=a-i,o=t.lon.toRadians()-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(i),a=Math.sin(i)*Math.cos(n),s=Math.atan2(a,r).toDegrees();return te.wrap360(s)}finalBearingTo(t){t instanceof R||(t=R.parse(t));let e=t.initialBearingTo(this)+180;return te.wrap360(e)}midpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),a=Math.cos(e),s=0,o=Math.sin(e),l={x:a+Math.cos(i)*Math.cos(r),y:s+Math.cos(i)*Math.sin(r),z:o+Math.sin(i)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new R(c,d)}intermediatePointTo(t,e){if(t instanceof R||(t=R.parse(t)),this.equals(t))return new R(this.lat,this.lon);let n=this.lat.toRadians(),i=this.lon.toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=r-n,o=a-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(i)+c*Math.cos(r)*Math.cos(a),p=h*Math.cos(n)*Math.sin(i)+c*Math.cos(r)*Math.sin(a),f=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(f,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=g.toDegrees(),v=y.toDegrees();return new R(m,v)}destinationPoint(t,e,n=6371e3){let i=t/n,r=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(i)+Math.cos(a)*Math.sin(i)*Math.cos(r),l=Math.asin(o),u=Math.sin(r)*Math.sin(i)*Math.cos(a),h=Math.cos(i)-Math.sin(a)*o,c=s+Math.atan2(u,h),d=l.toDegrees(),p=c.toDegrees();return new R(d,p)}static intersection(t,e,n,i){if(t instanceof R||(t=R.parse(t)),n instanceof R||(n=R.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(i))throw new TypeError(`invalid brng2 ‘${i}’`);let r=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(i).toRadians(),h=s-r,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new R(t.lat,t.lon);let p=(Math.sin(s)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),f=(Math.sin(r)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(o-a)>0?g:2*fe-g),v=(Math.sin(o-a)>0?2*fe-y:y)-u;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let _=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),w=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*_),M=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(w)+Math.cos(r)*Math.sin(w)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(r),Math.cos(w)-Math.sin(r)*Math.sin(M)),x=M.toDegrees(),I=b.toDegrees();return new R(x,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(a-s))*i}alongTrackDistanceTo(t,e,n=6371e3){t instanceof R||(t=R.parse(t)),e instanceof R||(e=R.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(r)*Math.sin(a-s));return Math.acos(Math.cos(r)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let i=Number(n).toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=e.lat.toRadians(),o=e.lon.toRadians()-a,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(o),u=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(o)-Math.cos(r)*Math.sin(s)*Math.cos(i),h=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(o);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),p=a+c+d,f=(a+c-d).toDegrees(),g=p.toDegrees();return{lon1:te.wrap180(f),lon2:te.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof R||(t=R.parse(t));let n=e,i=this.lat.toRadians(),r=t.lat.toRadians(),a=r-i,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>fe&&(s=s>0?-(2*fe-s):2*fe+s);let o=Math.log(Math.tan(r/2+fe/4)/Math.tan(i/2+fe/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof R||(t=R.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians();Math.abs(i)>fe&&(i=i>0?-(2*fe-i):2*fe+i);let r=Math.log(Math.tan(n/2+fe/4)/Math.tan(e/2+fe/4)),a=Math.atan2(i,r).toDegrees();return te.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let i=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(e).toRadians(),s=t/n,o=s*Math.cos(a),l=i+o;Math.abs(l)>fe/2&&(l=l>0?fe-l:-fe-l);let u=Math.log(Math.tan(l/2+fe/4)/Math.tan(i/2+fe/4)),h=Math.abs(u)>1e-11?o/u:Math.cos(i),c=r+s*Math.sin(a)/h,d=l.toDegrees(),p=c.toDegrees();return new R(d,p)}rhumbMidpointTo(t){t instanceof R||(t=R.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>fe&&(n+=2*fe);let a=(e+i)/2,s=Math.tan(fe/4+e/2),o=Math.tan(fe/4+i/2),l=Math.tan(fe/4+a/2),u=((r-n)*Math.log(l)+n*Math.log(o)-r*Math.log(s))/Math.log(o/s);isFinite(u)||(u=(n+r)/2);let h=a.toDegrees(),c=u.toDegrees();return new R(h,c)}static areaOf(t,e=6371e3){let n=e,i=t[0].equals(t[t.length-1]);i||t.push(t[0]);let r=t.length-1,a=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),i=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(i/2)),1+Math.tan(n/2)*Math.tan(i/2))}o(t)&&(a=Math.abs(a)-2*fe);let s=Math.abs(a*n*n);return i||t.pop(),s;function o(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let i=0;i<t.length-1;i++){let r=t[i].initialBearingTo(t[i+1]),a=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(a-r+540)%360-180,n=a}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90}}equals(t){return t instanceof R||(t=R.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${te.toLat(this.lat,t,e)}, ${te.toLon(this.lon,t,e)}`}};c(R,"LatLonSpherical"),I(),I(),I();var Nt=class{constructor(t){d(this,"destinations",[]),this.destinations=t}};c(Nt,"MappedinDestinationSet"),I();var ca,rt,Dt=class{constructor(t,e){N(this,ca,void 0),N(this,rt,void 0),d(this,"distance",0),d(this,"path",[]),d(this,"instructions",[]),_(this,rt,t),_(this,ca,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,i,r,a,s,o,l,h,c,d,p;let f={...t,action:{...t.action},atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(i=null==(n=u(this,rt))?void 0:n._vortexesById)?void 0:i[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(s=null==(a=u(this,rt))?void 0:a._nodesById)?void 0:s[t.node.id]:void 0};return((null==(o=f.action)?void 0:o.type)===je.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===je.EXITVORTEX)&&(f.action.fromMap=null==(c=u(this,rt)._mapsById)?void 0:c[null==(h=f.action)?void 0:h.fromMap.id],f.action.toMap=null==(p=u(this,rt)._mapsById)?void 0:p[null==(d=f.action)?void 0:d.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=u(this,rt))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return u(this,ca)}};c(Dt,"MappedinDirections"),ca=new WeakMap,rt=new WeakMap;var vt,ot=class{constructor(t){N(this,vt,void 0),_(this,vt,t)}directionsTo(t,e){if(t instanceof Nt){let n=[],i=this;for(let r=0;r<t.destinations.length;r++){let a=t.destinations[r],s=da(i),o=da(a),l=u(this,vt).navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),h=new Dt(u(this,vt),l);n.push(h),i=a}return n}{let n=da(this),i=da(t),r=u(this,vt).navigator.getDirections({originIds:n,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new Dt(u(this,vt),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};c(ot,"MappedinNavigatable"),vt=new WeakMap;var so=0,lo="9999-12-31T00:00:00.000Z";function uo(t,e,n=new Date){if(!t.states)return;let i=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||so),n=new Date(t.end||lo);return e<i&&n>i}));return r?e.find((t=>t.value===r.type)):void 0}c(uo,"getCurrentLocationState");var Je,Mt,Ge,pa,ha,ma,ga=class extends ot{constructor(t,e){super(t),N(this,Je,void 0),N(this,Mt,void 0),N(this,Ge,{}),d(this,"states"),d(this,"id",""),d(this,"name",""),d(this,"type",""),d(this,"description"),d(this,"sortOrder"),d(this,"logo"),d(this,"phone"),d(this,"social"),d(this,"color"),d(this,"shortName"),d(this,"detailsUrl"),d(this,"tags"),d(this,"externalId"),d(this,"showLabelWhenImagePresent"),d(this,"showSmartLabelWhenImagePresent"),d(this,"picture"),d(this,"operationHours"),d(this,"siblingGroups"),d(this,"gallery"),N(this,pa,void 0),N(this,ha,[]),N(this,ma,void 0),_(this,Je,t),_(this,Mt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=u(this,Ge).polygons;if(void 0!==t)return t;let e=[],n=u(this,pa),i=u(this,Je)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return u(this,Ge).polygons=e,e}set polygons(t){_(this,pa,t)}get nodes(){let t=u(this,Ge).nodes;if(void 0!==t)return t;let e=[],n=u(this,ha),i=u(this,Je)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return u(this,Ge).nodes=e,e}set nodes(t){_(this,ha,t)}get parent(){let t=u(this,Ge).parent;if(void 0!==t)return t;let e,n=u(this,Je)._locationsById,i=u(this,ma);return void 0!==i&&(e=n[i]),u(this,Ge).parent=e,e}set parent(t){_(this,ma,t)}get categories(){let t=u(this,Ge).categories;if(void 0!==t)return t;let e=[];return u(this,Mt).categories.forEach((t=>{let n=u(this,Je).getCollectionItemById(lt.CATEGORY,t);n&&e.push(n)})),u(this,Ge).categories=e,e}get state(){return uo(this,u(this,Je).locationStates)}clone(){return new ga(u(this,Je),u(this,Mt))}get nodeOperationHours(){let t=u(this,Ge).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=u(this,Mt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return u(this,Ge).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new ga(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&ve(e,"categories"),t.options.things.nodes&&ve(e,"nodes"),t.options.things.polygons&&ve(e,"polygons"),t.options.things.locationStates&&ve(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await be(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new ga(t,e)))}catch(t){return D.error("Fetch Locations:",t),[]}}toJSON(){let t=u(this,Mt);return delete t.color,t}},st=ga;c(st,"MappedinLocation"),Je=new WeakMap,Mt=new WeakMap,Ge=new WeakMap,pa=new WeakMap,ha=new WeakMap,ma=new WeakMap,I();var wt,Rt,qe,fa,kn=class extends ot{constructor(t,e){super(t),N(this,wt,void 0),N(this,Rt,void 0),N(this,qe,{}),d(this,"geometry"),d(this,"perspectives"),d(this,"image"),d(this,"holes"),d(this,"textures"),d(this,"material"),d(this,"label"),d(this,"id",""),d(this,"layer"),d(this,"layerId"),d(this,"name"),d(this,"externalId"),d(this,"vertexes"),d(this,"canvasBounds"),N(this,fa,void 0),_(this,wt,t),_(this,Rt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=u(this,qe).map;if(void 0!==t)return t;let e=u(this,wt).getCollectionItemById(lt.MAP,u(this,Rt).map);return u(this,qe).map=e,e}get locations(){var t,e;let n=u(this,qe).locations;if(void 0!==n)return n;let i=[],r=null!=(e=null==(t=Re.instances.get(u(this,wt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=r.length;t<e;++t){let e=r[t],n=e.polygons;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===a){i.push(e);break}}return u(this,qe).locations=i,i}get entrances(){let t=u(this,qe).entrances;if(void 0!==t)return t;let e=[],n=u(this,fa),i=u(this,wt)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&e.push(r)}return u(this,qe).entrances=e,e}return[]}set entrances(t){_(this,fa,t)}get rank(){let t=u(this,qe).rank;if(void 0!==t)return t;let{rankings:e}=u(this,wt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(u(this,qe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(u(this,qe).rank=null,null)}static hydrate(t,e){return t.map((t=>new kn(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&ve(e,"map"),t.options.things.nodes&&ve(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new kn(t,e)))}catch(t){return D.error("Fetch Polygons:",t),[]}}toJSON(){return u(this,Rt)}},_t=kn;function Zi(t){return/^[\da-f]{24}$/i.test(t)}function Qi(t,e=!1){let n="";if(null!=t){let i="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=r.length;e<a;++e){let a=r[e],s=t[a];null!=s&&(n+=`${i+encodeURIComponent(a)}=${encodeURIComponent(s)}`,i="&")}}return n}function co(t,e,n,i=!1){var r,a;return i?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Qi(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+Qi(n)}async function be(t,e,n,i=!1){return yi(t,e,n,i,!0)}async function yi(t,e,n,i=!1,r=!1){let a=co(t,e,n,i),s=await ki(t,a,i);if(!r&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function ki(t,e,n=!1){let i={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete i.language,i.language&&(e+=`&lang=${encodeURIComponent(i.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),i.language&&(r["Accept-Language"]=i.language);let a={method:"GET",headers:r},s=await ya()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function ve(t,e){t.indexOf(e)<0&&t.push(e)}function er([t,e],[n,i]){let r=new R(t,e),a=new R(n,i);return r.distanceTo(a)}function tr(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],i=t.georeference[2],r=new R(n.target.x,n.target.y),a=new R(i.target.x,i.target.y),s=r.distanceTo(a),o=n.control.x-i.control.x,l=n.control.y-i.control.y;e=Math.sqrt(o*o+l*l)/s}catch(n){e=1,D.warn(n),D.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function da(t){var e;return t instanceof _t?t.entrances.map((t=>t.id)):t instanceof st?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function ar(t){let e={},{maps:n,images:i,scenes:r,polygons:a}=t;if(null!=i)try{let t=Object.keys(i).map((t=>fetch(`data:image/png;base64,${i[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{D.error(t)}))));await Promise.all(t)}catch(t){D.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=i&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,i;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(i=null==t?void 0:t.image)?void 0:i.url)){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}}))))})),null!=i&&a.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function bi(t,e,n){let i;return function(){let r=this,a=arguments,s=c((function(){i=null,n||t.apply(r,a)}),"later"),o=n&&!i;clearTimeout(i),i=setTimeout(s,e),o&&t.apply(r,a)}}c(_t,"MappedinPolygon"),wt=new WeakMap,Rt=new WeakMap,qe=new WeakMap,fa=new WeakMap,c(Zi,"isGatewayKey"),c(Qi,"stringifyQuery"),c(co,"buildUrl"),c(be,"getArray"),c(yi,"getObject"),c(ki,"generateAPIRequest"),c(ve,"addToSet"),c(er,"getDistanceBetweenLatLon"),c(tr,"getMapScale"),c(da,"getNodesForNavigatable"),c(ar,"populateBundledImagesAsBlobs"),c(bi,"debounce");var ka,ba,va,bn=class{constructor(t,e){N(this,ka,void 0),N(this,ba,{}),N(this,va,void 0),d(this,"name"),d(this,"externalId"),d(this,"parents"),d(this,"id"),d(this,"icon"),this.id=e.id,_(this,va,e),_(this,ka,t),Object.assign(this,e)}get locations(){var t;let e=u(this,ba).locations;if(void 0!==e)return e;let n=[],{locations:i}=u(this,ka),{id:r}=this;for(let e=0,a=i.length;e<a;++e){let a=i[e],s=a.categories;if(Array.isArray(s))for(let e=0,i=s.length;e<i;++e)if((null==(t=s[e])?void 0:t.id)===r){n.push(a);break}}return u(this,ba).locations=n,n}static hydrate(t,e){return t.map((t=>new bn(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await be(t.options,"category",e)).map((e=>new bn(t,e)))}catch(t){return D.error("Fetch Categories:",t),[]}}toJSON(){return u(this,va)}},At=bn;c(At,"MappedinCategory"),ka=new WeakMap,ba=new WeakMap,va=new WeakMap,I();var wa,Gt,ja,vn=class{constructor(t,e){N(this,wa,void 0),N(this,Gt,void 0),N(this,ja,{}),d(this,"id",""),d(this,"type",""),d(this,"name",""),d(this,"description"),d(this,"image"),d(this,"startDate"),d(this,"endDate"),d(this,"showDate"),_(this,Gt,e),_(this,wa,t),Object.assign(this,e)}location(){let t=u(this,ja).location;if(void 0!==t)return t;let e,n=u(this,wa)._locationsById,i=u(this,Gt).location;if(null!=i){let t=n[i];null!=t&&(e=t)}return u(this,ja).location=e,e}static hydrate(t,e){return t.map((t=>new vn(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&ve(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await be(t.options,"event",n)).map((e=>new vn(t,e)))}catch(t){return D.error("Fetch Events:",t),[]}}toJSON(){return u(this,Gt)}},Ma=vn;c(Ma,"MappedinEvent"),wa=new WeakMap,Gt=new WeakMap,ja=new WeakMap,I();var xa,wn=class{constructor(t){N(this,xa,void 0),d(this,"id",""),d(this,"name",""),d(this,"value",""),_(this,xa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new wn(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await be(t.options,"location-state",e)).map((t=>new wn(t)))}catch(t){return D.error("Fetch Location States:",t),[]}}toJSON(){return u(this,xa)}},Mn=wn;c(Mn,"MappedinLocationState"),xa=new WeakMap,I(),I();var Ta,nr,Ia,ir,za,Oa,jn,po,xn,ho,Xe,Ye,Ke,Ze,qt=class{constructor(t){N(this,Ta),N(this,Ia),N(this,jn),N(this,xn),d(this,"map"),N(this,za,{}),N(this,Oa,void 0),N(this,Xe,void 0),N(this,Ye,void 0),N(this,Ke,void 0),N(this,Ze,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(_(this,Xe,t.lat),_(this,Ye,t.lon)),null!=t.x&&null!=t.y&&(_(this,Ke,t.x),_(this,Ze,t.y)),this.map=e,_(this,Oa,n)}get x(){return it(this,Ia,ir).call(this,"x")}get y(){return it(this,Ia,ir).call(this,"y")}get lat(){return it(this,Ta,nr).call(this,"lat")}get lon(){return it(this,Ta,nr).call(this,"lon")}absoluteDistanceTo(t){return er([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=u(this,za).nearestNode;if(void 0!==t)return t;let e=Re.instances.get(u(this,Oa)).findNearestNodeOnMap(this.map.id,this);return u(this,za).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};c(qt,"MappedinCoordinate"),Ta=new WeakSet,nr=c((function(t){if(u(this,Xe)&&u(this,Ye))return u(this,"lat"===t?Xe:Ye);if(null!=u(this,Ke)&&null!=u(this,Ze)){let[e,n]=it(this,xn,ho).call(this,u(this,Ke),u(this,Ze));return _(this,Xe,e),_(this,Ye,n),u(this,"lat"===t?Xe:Ye)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),Ia=new WeakSet,ir=c((function(t){if(u(this,Ke)&&u(this,Ze))return u(this,"x"===t?Ke:Ze);if(null!=u(this,Xe)&&null!=u(this,Ye)){let[e,n]=it(this,jn,po).call(this,u(this,Xe),u(this,Ye));return _(this,Ke,e),_(this,Ze,n),u(this,"x"===t?Ke:Ze)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),za=new WeakMap,Oa=new WeakMap,jn=new WeakSet,po=c((function(t,e){let n=this.map.georeference[0],i=new R(n.target.x,n.target.y),r=new R(t,e),a=i.distanceTo(r),s=(i.finalBearingTo(r)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*o,h=Math.cos(l)*o;return[n.control.x+u,n.control.y-h]}),"#latLonToXY"),xn=new WeakSet,ho=c((function(t,e){let n,i=this.map.georeference[0],r=new R(i.target.x,i.target.y),a=t-i.control.x,s=i.control.y-e,o=Math.atan2(a,s);n=0===a&&0===s?0:0===a?s:a/Math.sin(o);let l=o-this.map.getNorth(),u=n/this.map._scale,h=r.destinationPoint(u,180*l/Math.PI);return[h.lat,h.lon]}),"#xyToLatLon"),Xe=new WeakMap,Ye=new WeakMap,Ke=new WeakMap,Ze=new WeakMap;var Qe,_a,Aa,Tn=class{constructor(t,e){N(this,Qe,void 0),N(this,_a,{}),N(this,Aa,void 0),d(this,"id",""),d(this,"group",""),d(this,"name",""),d(this,"shortName",""),d(this,"elevation",0),d(this,"scale",0),d(this,"layers"),d(this,"x_scale"),d(this,"perspectiveId"),d(this,"scene"),d(this,"width",0),d(this,"height",0),d(this,"georeference",[]),d(this,"_scale",0),_(this,Qe,t),_(this,Aa,e),Object.assign(this,e),this._scale=tr(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=Re.instances.get(u(this,Qe)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=u(this,_a).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&u(this,Qe)._mapGroupsById[e]||null;return u(this,_a).mapGroup=n,n}createCoordinateByXY(t,e){return new qt({x:t,y:e,map:this,mappedin:u(this,Qe)})}createCoordinate(t,e){return new qt({lat:t,lon:e,map:this,mappedin:u(this,Qe)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],i=new R(e.target.x,e.target.y),r=new R(n.target.x,n.target.y);t=-((i.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,D.warn(e),D.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new Tn(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&ve(e,"perspectives"),t.options.things.mapGroups&&ve(e,"group"),ve(e,"elevation"),ve(e,"x_scale"),ve(e,"scale"),ve(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await be(t.options,"map",n),a=c((t=>{let e=i.layers.find((e=>e.id===t));e?e.visible=!0:i.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let n=0,s=r.length;n<s;++n){var i=r[n];if(i){let t=i.perspective;null!=t&&(i.perspectiveId=t.id,e.indexOf("scene")>-1&&(i.scene=t.scene),t.layers?(i.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):i.layers.forEach((t=>{t.visible=!0}))),delete i.perspective}r[n]=new Tn(t,i)}return r}catch(t){return D.error("Fetch Maps:",t),[]}}toJSON(){return u(this,Aa)}},Na=Tn;c(Na,"MappedinMap"),Qe=new WeakMap,_a=new WeakMap,Aa=new WeakMap,I();var Ea,Vt,Fa,In=class{constructor(t,e){N(this,Ea,void 0),N(this,Vt,void 0),N(this,Fa,{}),d(this,"id",""),d(this,"name",""),_(this,Vt,e),_(this,Ea,t),Object.assign(this,e)}get maps(){let t=u(this,Fa).maps;if(void 0!==t)return t;let e=[],{maps:n}=u(this,Ea),{id:i}=u(this,Vt);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===i&&e.push(r)}return u(this,Fa).maps=e,e}static hydrate(t,e){return t.map((t=>new In(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await be(t.options,"map-group",e)).map((e=>new In(t,e)))}catch(t){return D.error("Fetch Map Groups:",t),[]}}toJSON(){return u(this,Vt)}},Sa=In;c(Sa,"MappedinMapGroup"),Ea=new WeakMap,Vt=new WeakMap,Fa=new WeakMap,I();var et,Ut,_e,Ca,zn=class extends ot{constructor(t,e){super(t),N(this,et,void 0),N(this,Ut,void 0),N(this,_e,{}),d(this,"id",""),d(this,"x",0),d(this,"y",0),d(this,"operationHours"),d(this,"externalId"),N(this,Ca,void 0),_(this,et,t),_(this,Ut,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=u(this,_e).map;if(void 0!==t)return t;let e=u(this,et).getCollectionItemById(lt.MAP,u(this,Ut).map);return u(this,_e).map=e,e}get lat(){var t;let e=u(this,_e).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=u(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return u(this,_e).cachedLatLon=n.createCoordinateByXY(this.x,this.y),u(this,_e).cachedLatLon.lat}get lon(){var t;let e=u(this,_e).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=u(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return u(this,_e).cachedLatLon=n.createCoordinateByXY(this.x,this.y),u(this,_e).cachedLatLon.lon}get paths(){let t=u(this,_e).paths;if(void 0!==t)return t;let e=[],n=u(this,et)._nodesById,i=u(this,Ca);if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return u(this,_e).paths=e,e}set paths(t){_(this,Ca,t)}get locations(){var t,e,n;let i=u(this,_e).locations;if(void 0!==i)return i;let r=[],a=null!=(n=null==(e=null==(t=Re.instances.get(u(this,et)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t],n=e.nodes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===s){r.push(e);break}}return u(this,_e).locations=r,r}get polygon(){var t,e,n;let i=u(this,_e).polygon;if(void 0!==i)return i;let r,a=null!=(n=null==(e=null==(t=Re.instances.get(u(this,et)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t];e.entrances.map((t=>t.id)).includes(s)&&(r=e)}return u(this,_e).polygon=r,r}static hydrate(t,e){return t.map((t=>new zn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&ve(e,"map"),["weight","multiplier","accessible"].forEach((function(t){ve(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"node",n)).map((e=>new zn(t,e)))}catch(t){return D.error("Fetch Nodes:",t),[]}}toJSON(){return u(this,Ut)}},La=zn;c(La,"MappedinNode"),et=new WeakMap,Ut=new WeakMap,_e=new WeakMap,Ca=new WeakMap,I();var Ba,On=class{constructor(t){N(this,Ba,void 0),d(this,"polygons",[]),_(this,Ba,t),Object.assign(this,t)}static hydrate(t){return new On(t)}static async fetch(t){try{let e=await yi(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new On(e)}catch(t){return D.error("Fetch Rankings:",t),null}}toJSON(){return u(this,Ba)}},Pa=On;c(Pa,"MappedinRankings"),Ba=new WeakMap,I();var Da,_n=class{constructor(t){d(this,"id",""),N(this,Da,void 0),_(this,Da,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new _n(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await be(t.options,"apollo-theme",e)).map((t=>new _n(t)))}catch(t){return D.error("Fetch Theme:",t),[]}}toJSON(){return u(this,Da)}},Nn=_n;c(Nn,"MappedinTheme"),Da=new WeakMap,I();var Ga,qa,$t,An=class{constructor(t,e){N(this,Ga,void 0),N(this,qa,void 0),N(this,$t,{}),d(this,"defaultMap",""),d(this,"address",""),d(this,"city",""),d(this,"countrycode",""),d(this,"externalId",""),d(this,"id",""),d(this,"latitude"),d(this,"logo"),d(this,"longitude"),d(this,"metadata"),d(this,"name",""),d(this,"operationHours"),d(this,"postal",""),d(this,"slug",""),d(this,"state",""),d(this,"telephone",""),d(this,"tzid",""),d(this,"tzidOverride",""),d(this,"utcOffset",""),d(this,"website",""),_(this,qa,t),_(this,Ga,e),Object.assign(this,e)}static hydrate(t,e){return new An(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await be(t.options,"venue",e);return new An(t,n[0])}catch(t){return D.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==u(this,$t).isMultiBuilding){let t=u(this,qa).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;u(this,$t).isMultiBuilding=n}return u(this,$t).isMultiBuilding}toJSON(){return u(this,Ga)}},Ra=An;c(Ra,"MappedinVenue"),Ga=new WeakMap,qa=new WeakMap,$t=new WeakMap,I();var Ua,Sn=class{constructor(t){d(this,"id",""),N(this,Ua,void 0),d(this,"name"),d(this,"type"),d(this,"weight"),d(this,"multiplier"),_(this,Ua,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Sn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){ve(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await be(t.options,"vortex",n)).map((t=>new Sn(t)))}catch(t){return D.error("Fetch Vortexes:",t),[]}}toJSON(){return u(this,Ua)}},Va=Sn;function mo(t,e){let n=[];return t.features.forEach((t=>{var i,r;let a=[];null==(i=t.properties.spaces)||i.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let s=a.map((t=>({node:"n_"+t.id,map:t.level}))),o=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>({...t,"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),u={...t.properties,polygons:o||[],nodes:s||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l};delete u.spaces,n.push(u)})),n}function go(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function fo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties,icon:t.properties.picture};delete n.picture,e.push(n)})),e}function yo(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),i=Math.max(i,t[1]),n=Math.min(n,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:i,maxLong:r}}function ko(t,e,n){let i=n.createGeoreferences(),r=[];return t.features.forEach((t=>{let a=new Set;e.forEach((t=>{t.layer&&a.add(t.layer)}));let s=[...a].map((t=>({id:t,visible:!0}))),o=1/n.mapScale,l={...t.properties,georeference:i,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits};r.push(l)})),r}c(Va,"MappedinVortex"),Ua=new WeakMap,I(),c(mo,"convertLocations"),c(go,"convertLocationStates"),c(fo,"convertCategories"),c(yo,"getMapExtent"),c(ko,"convertMaps");var vi=class{constructor(t){d(this,"mapExtent"),d(this,"stretchRatio"),d(this,"midLat"),d(this,"midLong"),d(this,"mapUnitRatio",1e6),d(this,"latDistance"),d(this,"longDistance"),d(this,"mapScale"),d(this,"widthInMapUnits"),d(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:i,maxLong:r}=t,a=(e+i)/2,s=(n+r)/2,o=new R(a,r),l=new R(a,n),u=new R(e,s),h=new R(i,s);this.latDistance=u.distanceTo(h),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,p=(i-e)/(r-n);this.stretchRatio=c/p,this.midLat=a,this.midLong=s,this.widthInMapUnits=(r-n)*this.mapUnitRatio,this.heightInMapUnits=(i-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:i}=this.mapExtent;return[[t,e],[t,i],[n,i],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function bo(t,e){let n=[];return t.features.forEach((t=>{let i=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,s={...t.properties,x:i.x,y:i.y,paths:r,map:a,externalId:t.properties.externalId||""};n.push(s)})),n}c(vi,"CoordinateConverter"),c(bo,"convertNodes");var rr=c(((t,e,n,i,r)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let s=[];"entrances"in t.properties&&(s=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let o,l=n[t.properties.id],u=e.find((t=>t.id===l)),h=t.geometry.coordinates[0].map((t=>r.convert(t))),c=i.find((e=>e.polygonId===t.properties.id)),d=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;if(c){let t=r.convert([c.position[0],c.position[1]]),e=c.size.x,n=c.size.y,i=r.mapScale,a=n*i,s=e*i/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:s,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p={...t.properties,entrances:s,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*r.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*r.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:o,vertexes:h};a.push(p)})),a}),"generateMappedinPolygons");function vo(t,e,n,i,r,a){let s=rr(t,n,i,r,a),o=rr(e,n,i,r,a);return s.concat(o)}function Mo(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let i=n[0].split("-")[0],r=e.get(i),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...a);else{let{name:n,type:r,weight:s,multiplier:o,accessible:l}=t.properties,u={id:i,nodes:a,name:n,type:r,weight:s,multiplier:o,accessible:l};e.set(i,u)}}))})),Array.from(e.values())}function wo(t){let e=[];return t.features.forEach((t=>{let n={...t.properties};e.push(n)})),e}function or(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),i=t.building,r=t.category,a=t.style,s=t.location,o=t.imageInstance,l=t.polygonStyle,u={},h=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,i=yo(e),r=new vi(i);c.set(n,r);let s=t.obstruction.get(n),d=t.space.get(n),p=o.get(n),f=l.get(n);u[n]=vo(d,s,a,f,p,r);let g=t.node.get(n);h.push(...bo(g,r))}));let d=Object.values(u).flat(),p=Mo(e),f=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return ko(t,u[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=wo(i),m=mo(s,g),v=fo(r),_=go(s),w=t.manifest.features[0].properties.name,M=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:m,categories:v,nodes:h,maps:f,polygons:d,vortexes:p,mapGroups:y,locationStates:_,themes:[],venue:{name:w,latitude:b,longitude:M},imageBinaries:x}}c(vo,"convertPolygons"),c(Mo,"convertVortexes"),c(wo,"convertMapGroups"),c(or,"convertMVFToMappedin"),I(),I(),I(),I();var St,$e,We,Mi=[0,4,6,8,10],ut=c((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],Mi.map(((t,e)=>n.slice(t,e===Mi.length-1?void 0:Mi[e+1]).join(""))).join("-")}),"randomId"),sr="mi-session-data",lr="mi-local-data",wi=class{constructor(){N(this,$e,void 0),N(this,We,void 0);try{let t=sessionStorage.getItem(sr);_(this,$e,t?JSON.parse(t):{id:ut()})}catch{_(this,$e,{id:ut()})}try{let t=localStorage.getItem(lr);_(this,We,t?JSON.parse(t):{deviceId:ut()})}catch{_(this,We,{deviceId:ut()})}u(this,$e).id||(u(this,$e).id=ut()),u(this,We).deviceId||(u(this,We).deviceId=ut())}static getInstance(){return u(this,St)||_(this,St,new wi),u(this,St)}static ___clearInstance(){_(this,St,void 0)}saveSessionData(t,e){u(this,$e)[t]=e;try{return sessionStorage.setItem(sr,JSON.stringify(u(this,$e))),!0}catch{return!1}}loadSessionData(t){let e=u(this,$e)[t];if(null!=e)return e}saveLocalData(t,e){u(this,We)[t]=e;try{return localStorage.setItem(lr,JSON.stringify(u(this,We))),!0}catch{return!1}}loadLocalData(t){let e=u(this,We)[t];if(null!=e)return e}},Wt=wi;function ur(t){return/^[\da-f]{24}$/i.test(t)}function cr(){return Wt.getInstance().loadLocalData("deviceId")}function dr(){return Wt.getInstance().loadSessionData("id")}c(Wt,"SafeStorage"),St=new WeakMap,$e=new WeakMap,We=new WeakMap,N(Wt,St,void 0),c(ur,"isGatewayKey"),c(cr,"getDeviceID"),c(dr,"getSessionID");var Sr,Er,$a,Ht,Jt,Wa,Xt,Yt,Kt,Et,Ha,Zt,Qt,Ja,Ar=dn(_r()),So=null==(Er=null==(Sr=P)?void 0:Sr.env)?void 0:Er.npm_package_version,Ti=["websdk","web","webv2"],Ii="websdk",zi=class{constructor(t){var e;N(this,$a,void 0),N(this,Ht,void 0),N(this,Jt,void 0),N(this,Wa,void 0),N(this,Xt,void 0),N(this,Yt,void 0),N(this,Kt,void 0),N(this,Et,void 0),N(this,Ha,void 0),N(this,Zt,void 0),N(this,Qt,void 0),N(this,Ja,void 0),_(this,Et,t.clientId),_(this,Ha,t.clientSecret),_(this,Zt,t.accessToken),_(this,Kt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!u(this,Kt)&&u(this,Et)&&!ur(u(this,Et))&&(n="https://web-proxy.mappedin.com/a/"),_(this,Jt,n),_(this,Jt,u(this,Jt)+(t.venue+"/")),_(this,Ht,!1),_(this,$a,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),_(this,Wa,Ti.find((e=>e===t.context))||Ti[0]),_(this,Xt,cr()),_(this,Yt,dr()),_(this,Qt,new Set),_(this,Ja,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(u(this,$a))return;let n={...e,g:u(this,Ht)},i=u(this,Jt)+t+"?"+Ar.default.stringify(n),r={"mi-context":Ii||u(this,Wa),"mi-session":u(this,Yt),"mi-device":u(this,Xt),"mappedin-sdk-version":So,"mappedin-platform-version":u(this,Ja)};u(this,Zt)?r.Authorization=`Bearer ${u(this,Zt)}`:u(this,Kt)||(r.Authorization=`Basic ${btoa(`${u(this,Et)}:${u(this,Ha)}`)}`),ya()(i,{method:"GET",mode:"cors",headers:r})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,n,i){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:i||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return u(this,Yt)}getDeviceID(){return u(this,Xt)}setGeolocationMode(t){_(this,Ht,t)}trackBlueDotEvent(t){t&&Object.values(zi.BLUEDOT_EVENT).includes(t)&&!u(this,Qt).has(t)?(this.track(t),u(this,Qt).add(t)):D.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=Ti.find((e=>e===t));e&&(Ii=e)}static clearContext(){Ii=void 0}},En=zi;c(En,"Analytics"),$a=new WeakMap,Ht=new WeakMap,Jt=new WeakMap,Wa=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,Kt=new WeakMap,Et=new WeakMap,Ha=new WeakMap,Zt=new WeakMap,Qt=new WeakMap,Ja=new WeakMap,d(En,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var lt,Fn=En,Fr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(lt||(lt={}));var xt,ta,ea={categories:At,locations:st,vortexes:Va,maps:Na,nodes:La,polygons:_t,venue:Ra,events:Ma,mapGroups:Sa,themes:Nn,locationStates:Mn,rankings:Pa},jt=class{constructor(t){d(this,"perspective"),d(this,"things"),d(this,"options"),N(this,xt,void 0),N(this,ta,""),d(this,"updatedAt"),d(this,"categories",[]),d(this,"locations",[]),d(this,"vortexes",[]),d(this,"maps",[]),d(this,"nodes",[]),d(this,"polygons",[]),d(this,"venue",{}),d(this,"events",[]),d(this,"mapGroups",[]),d(this,"themes",[]),d(this,"locationStates",[]),d(this,"rankings"),d(this,"_categoriesById"),d(this,"_locationsById"),d(this,"_vortexesById"),d(this,"_mapsById"),d(this,"_nodesById"),d(this,"_polygonsById"),d(this,"_eventsById"),d(this,"_mapGroupsById"),d(this,"_locationStatesById"),d(this,"_locationRankingsById"),d(this,"_rankingsById"),d(this,"_categoriesByExternalId"),d(this,"_locationsByExternalId"),d(this,"_vortexesByExternalId"),d(this,"_mapsByExternalId"),d(this,"_nodesByExternalId"),d(this,"_polygonsByExternalId"),d(this,"_eventsByExternalId"),d(this,"_mapGroupsByExternalId"),d(this,"_locationStatesByExternalId"),d(this,"_locationRankingsByExternalId"),d(this,"_rankingsByExternalId"),d(this,"images"),d(this,"imageBinaries"),d(this,"scenes"),d(this,"analytics"),d(this,"navigator"),this.options=t,_(this,xt,Re.create(this));let e=new Fn({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Zn,"true")}})}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=u(this,xt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),u(this,xt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=u(this,xt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),u(this,xt)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,i=this[`_${t}ById`];return null!=i&&null!=i[e]||(i=this[n],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=or(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{_(this,ta,t),n=JSON.parse(t)}catch(t){return void D.error("Unable to parse JSON",t)}else n=t,_(this,ta,JSON.stringify(n));let i=Object.keys(n);for(let t=0,e=i.length;t<e;++t){let e=i[t],r=n[e];null!=ea[e]&&"function"==typeof ea[e].hydrate&&(this[e]=ea[e].hydrate(r,this))}e&&await ar(n);let{images:r,scenes:a,imageBinaries:s}=n;this.images=r,this.scenes=a,this.imageBinaries=s,this.generateGetters(i),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Zi(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,i=n.length;t<i;++t){let i=n[t];ea[i]&&e.push(ea[i].fetch(this).then((t=>(this[i]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new ni({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in ea)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return u(this,ta)||JSON.stringify(this.toJSON())}};c(jt,"Mappedin"),xt=new WeakMap,ta=new WeakMap,I();var Lr={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery","showSmartLabelWhenImagePresent"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};I();var Ft=dn(Cr());I();var Eo=["0","1","2","3","4","5","6","7","8","9"],Fo=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Lo=["0","1","2","3","4","5","6","7","8","9"],Co=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],ac=[...Eo,...Fo,...Lo,...Co],Pr=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];I();var Po=32,Be=!1,Bo=120,_i=0,Ln=class{constructor(t){d(this,"_callback"),d(this,"_frameCount"),d(this,"_ordering"),d(this,"_supersededBy"),d(this,"name"),d(this,"_remainingFrameCount"),d(this,"_lastFrameTime"),d(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,Be&&D.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};c(Ln,"FrameUpdate");var dt=class{constructor(t){if(d(this,"_postponed"),d(this,"userdata"),d(this,"_priority"),d(this,"_group"),d(this,"name"),d(this,"_lastFrameTime"),d(this,"_callback"),d(this,"_complete"),d(this,"_scheduled"),d(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,Be&&D.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};c(dt,"FrameTask");var Cn=class{constructor(t){d(this,"_postponed"),d(this,"_onComplete"),d(this,"_priority"),d(this,"userdata"),d(this,"name"),d(this,"_tasks"),d(this,"_scheduledTasks"),d(this,"_scheduled"),d(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,Be&&D.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}};c(Cn,"FrameTaskGroup");var Ai=class{constructor(t){d(this,"_maxMillisecondsPerFrame"),d(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Po,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};c(Ai,"RealTimeTimer");var Pn=class{constructor(t){var e;d(this,"_raf"),d(this,"_timer"),d(this,"_performance"),d(this,"_scheduledUpdatesByOrdering"),d(this,"_scheduledTasksByPriority"),d(this,"_postponedTasks"),d(this,"_requestAnimationFrameHandle"),d(this,"_updatesToRunThisFrame"),d(this,"_lastFrameTime",0),d(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Ai,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new aa,this._scheduledTasksByPriority=new aa,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Be&&D.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0:e.TEST_IOS)&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new aa,this._scheduledTasksByPriority=new aa,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Be&&D.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;Be&&(0===_i&&(n=!0),++_i,_i%=Bo);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&D.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,n&&D.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let i;this._performance&&(i=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-i),n&&D.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),i=null;D.assert(void 0!==n),Object.getPrototypeOf(n)===Cn.prototype&&(i=n,n=i._popTask()),D.assert(void 0!==n),D.assert(Object.getPrototypeOf(n)===dt.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Be&&D.log("task completed",n.name),null!=i&&(i.isComplete()?(i.clear(),i._onComplete(),Be&&D.log("group completed",i.name)):this._scheduledTasksByPriority.insert(i._priority,i))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===Cn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,Be&&D.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Be&&D.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===dt.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Be&&D.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===dt.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===dt.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Be&&D.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===dt.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===dt.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Be&&D.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===dt.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,Be&&D.log("task priority changed",t.name,e)}};c(Pn,"TaskScheduler");var aa=class{constructor(){d(this,"_map"),d(this,"_size"),d(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(D.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let i=t.next();if(i.done)return i;e=this._map.get(i.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return D.assert(t===this._size),t}};c(aa,"Multimap");var Lt,Ve,Tt,tt,Ae,Ya,Ka,ia,Za,ra,ht,Bn,Dn,It,Qa,Rn,Gn,qn,Ko,en,tn,Si,pt=c((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),na="",Do=.09,Ro=1,Go=.025,qo=.5,Vo=5e-4,Uo=5e-4,$o=.01,Wo=.05,Br=1,Ho=.01,Jo=.2,Xo={MappedinCategory:"categories",MappedinLocation:"locations"},Yo={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Pr,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===P.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Do,PRIMARY_INDEX_WEIGHT:Ro,SECONDARY_INDEX_WEIGHT:Go,CATEGORY_NAME_WEIGHT:qo,LOCATION_NAME_WEIGHT:Br,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Vo,CATEGORY_LOCATION_TAGS_WEIGHT:Uo,CATEGORY_LOCATION_NAME_WEIGHT:$o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Wo,LOCATION_DEFAULT_RANK:Br,RATIO_OF_FUZZY_TO_EXACT:Ho,RATIO_OF_PREFIX_TO_EXACT:Jo}},Xa=class{constructor(t,e){var n,i,r;N(this,qn),N(this,Lt,void 0),N(this,Ve,void 0),N(this,Tt,void 0),N(this,tt,void 0),N(this,Ae,void 0),N(this,Ya,new Pn({performance:!0})),N(this,Ka,void 0),N(this,ia,void 0),N(this,Za,new Map),N(this,ra,0),N(this,ht,c((t=>{Xn(this,ra)._++,u(this,Ya).scheduleUpdate(new Ln({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),Xn(this,ra)._--,0===u(this,ra)&&u(this,Qa).call(this)}}))}),"#addTask")),N(this,Bn,c((t=>{var e,n,i;let{SECONDARY_INDEX_WEIGHT:r,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=u(this,Ae).constants,o=a;(null==(e=u(this,Ae))?void 0:e.useLocationRank)&&(o=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:a})),a):a),u(this,ht).call(this,(()=>{u(this,Ve).add({name:pt(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:o})})),(null==(n=u(this,Ae))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{u(this,Ve).add({name:"",tag:pt(e),id:"MappedinLocation_"+t.id,weight:s,rank:o})})),(null==(i=u(this,Ae))?void 0:i.searchDescriptions)&&u(this,ht).call(this,(()=>u(this,Tt).add({description:pt(t.description||""),id:"MappedinLocation_"+t.id,weight:r,rank:o})))}),"#processLocation")),N(this,Dn,c((t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:i,CATEGORY_LOCATION_TAGS_WEIGHT:r,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:s}=u(this,Ae).constants;u(this,ht).call(this,(()=>u(this,Ve).add({name:pt(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let o=t.locations.reduce(((t,e)=>t+` ${na} `+e.name),"")+` ${na}`;if((null==(e=u(this,Ae))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&u(this,ht).call(this,(()=>u(this,tt).add({id:"MappedinCategory_"+t.id,"category.locations.description":pt(e.description),ref:e.name,weight:i})))})),null==(n=u(this,Ae))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${na} `+e),""))+` ${na}`}),"");u(this,ht).call(this,(()=>u(this,tt).add({"category.locations.tags":pt(e),id:"MappedinCategory_"+t.id,weight:r})))}u(this,ht).call(this,(()=>u(this,tt).add({"category.locations.name":pt(o),id:"MappedinCategory_"+t.id,weight:a})))}),"#processCategory")),N(this,It,void 0),N(this,Qa,void 0),N(this,Rn,c((t=>{var e;let n=t.score,{object:i,id:r,weight:a,rank:s}=t,[o,l]=r.split("_"),h=i||u(this,Lt).getCollectionItemById(Xo[o],l);return s&&(null==(e=u(this,Ae))?void 0:e.useLocationRank)&&(n+=s),a&&(n*=a),{score:n,type:o,object:h}}),"#processSearchResult")),N(this,Gn,c(((t,e)=>{for(let n in t.match)t.match[n].forEach((i=>{let r=t.ref||t[i]||e.object[i];if("category.locations.tags"===i||"category.locations.name"===i){let e=new RegExp(`[^${na}]* `+n+` [^${na}]*`,"ig").exec(t[i]);null!=e&&(r=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:i,value:r})}))}),"#addMatches")),N(this,en,void 0),N(this,tn,void 0),_(this,ia,new Fn({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),_(this,Ae,{...Yo,...e}),_(this,Lt,t),_(this,Ka,new Set(null==(n=u(this,Ae))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:s,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:h,PRIMARY_INDEX_TAGS_NAME_WEIGHT:d}=u(this,Ae).constants,p=["object","query","weight","tag","rank"],f={fields:["query","name","tag"],storeFields:p,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:s,query:s,tag:d},weights:{fuzzy:l,prefix:h},boostDocument:t=>t.includes("MappedinLocation")?s:t.includes("MappedinCategory")?o:s},g={fields:["description"],storeFields:p,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=u(this,Ka))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...p,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(_(this,It,new Promise((t=>{_(this,Qa,t)}))),null==(i=u(this,Ae))?void 0:i.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(r=u(this,Ae))?void 0:r.jsonIndex);_(this,Ve,Ft.default.loadJS(t,f)),_(this,Tt,Ft.default.loadJS(e,g)),_(this,tt,Ft.default.loadJS(n,y))}else _(this,Ve,new Ft.default(f)),_(this,Tt,new Ft.default(g)),_(this,tt,new Ft.default(y)),u(this,Lt).locations.forEach(u(this,Bn)),u(this,Lt).categories.forEach(u(this,Dn));u(this,Ya).update(performance.now()),_(this,en,bi(((t,e)=>{u(this,ia).trackSearchSuggest({query:t,hits:e})}),300)),_(this,tn,bi(((t,e)=>{u(this,ia).trackSearch({query:t,hits:e})}),300))}async suggest(t){await u(this,It);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:r,RATIO_OF_PREFIX_TO_EXACT:a}=u(this,Ae).constants,s=u(this,Ve).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:i},weights:{fuzzy:r,prefix:a}});return u(this,en).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await u(this,It);let e=it(this,qn,Ko).call(this,t);return u(this,tn).call(this,t,e.length),e}async toJSON(){return await u(this,It),JSON.stringify({primary:u(this,Ve),secondary:u(this,Tt),extra:u(this,tt)})}async addQuery(t){let e,n,{query:i,object:r,weight:a=1}=t;await u(this,It),e=r instanceof st?"MappedinLocation":r instanceof At?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+r.id:"string"==typeof r.id?n="Custom_"+r.id:(n=u(this,Za).get(r),n||(n="Custom_"+ut(),u(this,Za).set(r,n))),u(this,Ve).add({id:n,weight:a,object:r,query:pt(i)})}};c(Xa,"OfflineSearch"),Lt=new WeakMap,Ve=new WeakMap,Tt=new WeakMap,tt=new WeakMap,Ae=new WeakMap,Ya=new WeakMap,Ka=new WeakMap,ia=new WeakMap,Za=new WeakMap,ra=new WeakMap,ht=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,It=new WeakMap,Qa=new WeakMap,Rn=new WeakMap,Gn=new WeakMap,qn=new WeakSet,Ko=c((function(t){let e=[],n=pt(t);e=[...u(this,Ve).search(n),...u(this,Tt).search(n),...u(this,tt).search(n)].sort(((t,e)=>e.score-t.score));let i={};for(let t of e){let e=u(this,Rn).call(this,t);i[t.id]?i[t.id].score+=e.score:i[t.id]={...e,matches:[]},u(this,Gn).call(this,t,i[t.id])}return Object.keys(i).map((t=>({...i[t],matches:i[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))}),"#doSearch"),en=new WeakMap,tn=new WeakMap,I(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Si||(Si={}));var Rr=globalThis.fetch;function ya(){if(null==Rr)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Rr}c(ya,"isomorphicFetch");var qr,Vr,Zo=null==(Vr=null==(qr=P)?void 0:qr.env)?void 0:Vr.npm_package_version;globalThis.btoa||(globalThis.btoa=Dr.encode);var Qo=["ar"];function Ei(t){let e={...Fr,things:Lr,...t};return e.headers={...e.headers,"mappedin-sdk-version":Zo},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function Fi(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),i=new jt({...e,baseUrl:e.baseUrl+n});return await i.fetch(),i}c(Ei,"parseOptions"),c(Fi,"getVenue");var Gr={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function Li(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...Gr,...t}),{url:n,updated_at:i}=await es(t),r=await ya()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=await r.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new jt(e);return await o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=i,o}async function es(t){let e=Ei({baseUrl:"https://api-gateway.mappedin.com/",...Gr,...t}),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Qo.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${i}&version=1.0.0`;return e.language=void 0,await ki(e,r)}c(Li,"getVenueBundle"),c(es,"getVenueBundleURL");var ts=!1;function as(t){t.things=t.things||{},t.things.venue=t.things.venue||[],t.things.venue.push("slug","defaultMap"),t.things.nodes=t.things.nodes||[],t.things.nodes.push("x","y","paths","map"),t.things.polygons=t.things.polygons||[],t.things.locations=t.things.locations||[],t.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),t.things.maps=t.things.maps||[],t.things.maps.push("height","width","georeference"),t.perspective=t.perspective3D||t.perspective||void 0,t.things.maps.push("scene","layers"),t.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),ts&&t.things.polygons.push("layer","geometry","vertexes")}c(as,"parseOptions");var ns=c((function(t){return null==t.mapView&&(t.mapView={}),new Promise((function(e,n){function i(i,r){if(i)n(i);else{let i={};try{t.firstMapSelector&&(t.mapView=t.mapView||{},t.mapView.firstMap=t.firstMapSelector(r))}catch(t){D.error("Failure in firstMapSelector! Loading default map instead."),D.error(t),n(t)}i.venue=r,e(i)}}c(i,"handleInit"),as(t.venue),t.venue.useVenueBundle?Li(t.venue).then((t=>i(null,t))).catch((t=>i(t,null))):Fi(t.venue).then((t=>i(null,t))).catch((t=>i(t,null)))}))}),"initialize");
|